Posts

Showing posts from June, 2013

mysql - How to get all values in a certain column with php -

i need print out usernames of members in site list, don't know how it. tried use 'mysqli_fetch_array' function fetch names username column, i've been failing. so, please assist me on how can in efficient way. this code $sql = "select username users"; $query = mysqli_query($db_con, $sql); $array = array; while($row = mysqli_fetch_array($query)) { $array = row[]; } foreach ($names $array) { echo $names; } also want format output, separating each username " | " you quite close.. $sql = "select username users"; $query = mysqli_query($db_con, $sql); while($row = mysqli_fetch_assoc($query)) { echo $row['username'].'|'; }

Passing values from HTML to python using EVE rest framework -

i creating website using html frontend , python backend using eve framework. have enabled token authentication users restful account management . when pass values eve framework gives me 401. var login = function (logindata) { var deferred = $q.defer(); $http.post(appconfig.serviceurl + 'user',{data:logindata}) here logindata holds username , password of user html page piece of code inside .js file. my api.py holds following authentication code. class rolesauth(tokenauth): def check_auth(self, token, allowed_roles, resource, method): # use eve's own db driver; no additional connections/resources used accounts = app.data.driver.db['user'] lookup = {'token': token} if allowed_roles: lookup['roles'] = {'$in': allowed_roles} account = accounts.find_one(lookup) return account def add_token(documents): # don't use in production: # should @ least make sure token unique. document in documents: ...

Excluding a file from the roslyn analyzers -

since have lot of generated code, roslyn analyzers go crazy code. there way exclude files analyzers? there no way explicitly "don't run analyzer on generated code". have handle manually. i believe heuristics used follows. (i took list giovanni bassi, 1 of authors of code cracker ) file auto generated if of following conditions met: it has 1 of these attributes: debuggernonusercodeattribute generatedcodeattribute the file path contains: *.g.cs *.designer.cs *.assemblyinfo.cs *.generated.cs *.g.cs *.g.i.cs *.assemblyattributes.cs temporarygeneratedfile_*.cs a header comment contains: <auto-generated> the code cracker project has number of extension methods detecting generated files. check out generatedcodeanalysisextensions

opencv and c++ visual studio 2012 -

i have code work good. when video length less 1 minute , video size 165 kb when change video other length 2 minute , size 15 mb or 1 same length size 5 mb show me project has stop working this code # include "windows.h" # ifdef _ch_ # pragma package < opencv > # endif # include "windows.h" # ifndef _eic # include "cv.h" # include "cvaux.h" # include "highgui.h" # include "cxcore.h" # include < stdio.h > # include < ctype.h > # endif // x?y? int getpixel ( iplimage * image , int x , int y , int * h , int * s , int * v ) { * h = ( uchar ) image -> imagedata [ y * image -> widthstep + x * image -> nchannels ] ; * s = ( uchar ) image -> imagedata [ y * image -> widthstep + x * image -> nchannels + 1 ] ; * v = ( uchar ) image -> imagedata [ y * image -> widthstep + x * image -> nchannels + 2 ] ; return 0 ; } //--------------------------------------------...

html - text-overflow in combination with flexbox not working -

this question has answer here: how can ff 33.x flexbox behavior in ff 34.x? 2 answers i have container 300px wide 2 flexed divs inside. second 1 100px wide , other should take remaining space. when place text wider remaining 200px in first div, overflows , can use overflow: hidden , text-overflow: ellipsis add ... when text overflows. when put h1 tag within first div , add overflow , text-overflow should create same effect. , (in chrome), in ie , firefox div grows larger , ellipsis doesn't work. when remove additional h1 layer , update css accordingly, described behavior works expected. or @ jsfiddle body{ display: flex; } #container{ display: flex; flex-basis: 300px; overflow: hidden; } #content{ display: block; height: 300px; background-color: red; flex-grow: 1; flex-shrink: 1; } h1, ...

java - How to create an object using same type of object -

i wonder if possible new instance of object, using other object of same type. public class vegetable{ private int ... //a lot of fields public vegetable(vegetable v) { //some magic here } } i looking option, wouldn't copy each single field manually in constructor, rather use super(v) . java not provide default copy constructor. however, java provide method object.clone() . can call on instances of classes implement cloneable. otherwise, throw clonenotsupportedexception. the default implementation creates shallow copy . if object contains references other objects, references copied. not want. create deeper, more independent copy, can extend default implementation. you can create own copy constructor, , useful. however, unlike clone() , copy constructor not necessary create instance of same class. copy constructor class t create t, if it's passed instance of subclass of t.

jsf - How to dynamically add <p:tab> to <p:wizard> in a loop -

i dynamically add <p:tab> components <p:wizard> component in loop. i tried using <ui:repeat> inside , outside <p:wizard> component. <p:wizard> <ui:repeat value="#{tabbean.tabs}" var="tab"> <p:tab title="#{tab.tabname}"> </ui:repeat> </p:wizard> <ui:repeat value="#{tabbean.tabs}" var="tab"> <p:wizard> <p:tab title="#{tab.tabname}"> </p:wizard> </ui:repeat> none of both attempts work. how can achieve requirement? the <p:wizard> understands <p:tab> children. doesn't understand <ui:repeat> child. need create physical <p:tab> children in jsf component tree immediate child of <p:wizard> component. the <c:foreach> taghandler capable of doing that. <p:wizard> <c:foreach items="#{tabbean.tabs}" var="tab"> ...

python - request.POST.get('<BooleanField>') always returns 'on' in Django (1.8) -

i'm trying extract data django form in view. i'm using request.post.get(). i'm aware form.cleaned_data[] preferred, can't use because incompatible ajax, need form (form.is_valid() returns false; if has way around this, that'd great too.) anyways, form has few booleanfields: distributive = forms.booleanfield(widget=forms.checkboxinput(attrs={'id':'distributive'}),required=false) transitivity = forms.booleanfield(widget=forms.checkboxinput(attrs={'id':'transitivity'}),required=false) whether these fields "checked" or not user, request.post.get() returning 'on'. here code view: def post(self, request): form = verbqueryform(request.post) transitivity = request.post.get('transitivity') distributive = request.post.get('distributive') what i'm looking either: a. (ideal, not point of post) way use form.is_valid() , cleaned_data ajax b. way request.post.get() return boolean ...

android - Can't alight TextView toRightOf ImageView -

Image
the textview doesn't alight right (end) of imageview reason. see battery image , percents. current: expected: the code: ... <relativelayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1.3"> <imageview android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_alignparentleft="true" android:layout_alignparentstart="true" android:scaletype="fitstart" android:id="@+id/battery_level" /> <textview android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_torightof="@id/battery_level" android:layout_toendof="@id/battery_level" android:layout_alignend="@id/battery_level" android:layout_alignrig...

java - Disallow entity declarations but allow DTDs -

i given xml document must allowed have document type declaration (dtd), prohibit entity declarations. the xml document parsed saxparser.parse() , follows: saxparserfactory factory = saxparserfactory.newinstance(); factory.setfeature("http://xml.org/sax/features/external-general-entities", false); factory.setfeature("http://xml.org/sax/features/external-parameter-entities", false); factory.setvalidating(true); saxparser parser = factory.newsaxparser(); the xml passed parser inputsource : inputsource inputsource= ... ; parser.parse(inputsource, handler); and handler has resolveentity method, saxparser.parse() calls: public inputsource resolveentity(string pubid, string sysid) throws saxexception { inputsource inputsource = null; try { inputsource = entityresolver.resolveentity(publicid, systemid); } catch (ioexception e) { throw new saxexception(e); } return inputsource; } when pass in xml file entity reference, seems nothi...

php array woes when parsing a string -

i'm looping through array of strings in php. specifically, i'm looking double dots in each array row (..). if no dots found, entire row appended second array row. if found, split row, put left half in current (second) array row, , right half in next row. this have far: $fudgedindex = 0; $parsedrows = array(''); foreach($refinedlist $rowtoparse) { $pos2 = strpos($rowtoparse, ".."); //echo $refinedlist[$index] . "<br>"; if ($pos2 === false) { $parsedrows[$fudgedindex] = $parsedrows[$fudgedindex] . $rowtoparse; } else { $length = strlen($rowtoparse); $partialleft = substr($rowtoparse, 0, $pos2); $partialright = substr($rowtoparse, $pos2); $parsedrows[$fudgedindex] = $parsedrows[$fudgedindex] . $partialleft; $fudgedindex = $fudgedindex + 1; $parsedrows = ''; $parsedrows[$fudgedindex] = $parsedrows[$fudgedindex] . $partialright; } } ...

html - Problems with element positioning in css -

i try create small website. i've problems positioning of several html attributes. i'll quite simple: header should have width of 100% , fixed on top. footer should have width of 100% , fixed on button. vertical navigation bar should fill space between footer , header. content, should fill rest, margin of 10px. here's actual try: css: * { margin: 0px; padding: 0px; border: 0px; } html, body { height: 100%; width; 100%; } #pagewrapper { height: 100%; } header{ height: 50px; width: 100%; background-color:yellow; } footer{ height: 50px; width: 100%; background-color:blue; } #mainwrapper{ width:100%; height: 100%; background-color:black; } #mainwrapper #navigation { width: 250px; height: 100%; background-color:orange; float: left; } #mainwrapper #content { height: 100%; width: 100%; background-color: green; } html: <body> <div id="pagewrapper"> <header> </header> <div id=...

Python ByteToHex Java Conversion -

hey have bytetohex converter in python , wanted convert java , have no idea how attempts have failed i've come here.. here code def bytetohex( bytestr ): return ' '.join( [ "%02x" % ord( x ) x in bytestr ] ) i wanna know how in java method edit i have string send on socket , this string hexstr = "\\x7e\\x00\\x0c\\x01\\x00\\xa5\\xbd\\x00\\x7e\\x01\\x00\\x40\\x2d\\x00\\x3f\\x71"; then tried write method jsut converts string this. 7e 00 16 a1 c5 dd 39 02 7e 00 01 e7 2d 0a 00 23 41 1b 6c 11 b9 b9 b9 ba 3b e8 just simple string array no 'x' , no '\' tried doing in java... public byte[] bytetohex(string hexx) { byte [] b; hexx.replace("\\", ""); (int = 0; < hexx.length(); i++) { hexx.replace("\\", ""); b[i] = char(i) + b.add(i +1); } } but thats not right , cant figure out. solution just going old questions , answering them. pub...

Wordpress PHP Fatal Error with Openshift -

when try access plugins or themes section of wordpress site admin panel presented blank screen. when run logs following error: navigating wp-admin/plugins.php: php fatal error: call undefined function wp_json_encode() in /var/lib/openshift/{userid}/app-root/data/current/wp-includes/update.php on line 277 navigating wp-admin/themes.php: php fatal error: call undefined function wp_json_encode() in /var/lib/openshift/{userid}/app-root/data/current/wp-includes/update.php on line 440 solutions online indicated should re-add function, or re-install wordpress. without access core files, downloaded local repository of application (but noticed did not contain of plugins or themes had uploaded via admin interface). i extracted plugin , theme (placing them in respective directories) pushed changes production in hopes extract , re-install updated version of wordpress. restarted app. the error still persists , can not validate if plugin or theme uploaded installed. there way ref...

css - Removing white space between Divs - help me restructure code -

i have 2 divs want merge website header. want them both black , have no white space in between. please advise. - recommend how write code? im using container class don't have 1 in css - bootstrap default or something? thanks! see below <div class="nav"> <div class="container" style="background-color: #000000;> <ul class="pull-left"> <li><a href="#">home</a></li> <li><a href="#">about us</a></li> </ul> <ul class="pull-right"> <li><a href="#">portfolio</a></li> <li><a href="#">pricing</a></li> <li><a href="#">contact</a></li> </ul> </div> </div> <div style="background-color: #000000;" class="container...

graph - Getting stuck and running out of nodes in Prim's algorithm? -

Image
so have graph and i'm trying build minimum spanning tree. starting @ vertex go a-b-f-e-d , after there's no place go, considering adjacent vertexes d part of tree, how keep going? also how calculate range of values of new edge part of minimum spanning tree? thanks in advance guys. i think have slight misunderstanding of how prim's algorithm works. based on description gave above, looks think prim's algorithm works this: start @ node. look @ nodes connected current node haven't visited. go cheapest of these nodes. repeat until nodes covered. this close how prim's algorithm works, it's not right. in prim's algorithm, there's no notion of "current" node. instead, have 2 sets of nodes: nodes you've added in, , nodes haven't. prim's algorithm works this: start @ node. add "in" set. look @ nodes connected "in" set haven't been added "in" set. add cheapest of these n...

sql - Oracle Text - "user filter command exited with status 127" -

i'm trying create full text index using oracle text module on table containing blobs (files). i'm using following script create index.. create index my_docs_doc_idx on test_blob(doc) indextype ctxsys.context; i got result: [sql] create index my_docs_doc_idx on test_blob(doc) indextype ctxsys.context affected rows: 0 time: 0.190ms however, when want test created index using... select score(1) score, file_name test_blob contains (doc,'cola',1) > 0 i 0 results, no matter value add selector. thanks article: https://community.oracle.com/thread/434057?start=0&tstart=0 found errors in ctx_user_index_errors table... drg-11207: user filter command exited status 127 what cause of problem? edit: issue seems connected operation system. oracle installed on windows indexes fine, while 1 installed on redhat won't work @ all.

javascript - Scroll Div inside Absolute positioned parent -

im trying allow inner div in html allow scrolling. i'm not sure preventing scrolling. here's html: <div class ="item item-text-wrap" ng-class="{show: showingdata, more: moreinfo}"> <div> <!-- stuff don't want have scroll --> </div> <div class="scrollable"> <!-- scrollable stuff here --> </div> </div> and here's css: .item.item-text-wrap{ z-index: 10; position: absolute; bottom: 0px; width:101%; max-height: 25px; color:rgba(255, 255, 255, 1); background-color: rgba(50, 50, 50, 0.75); border: 0; overflow: hidden; -webkit-transition: max-height .1s; transition: max-height .1s; } .item.item-text-wrap.show{ max-height: 180px; height: 500px; } .scrollable{ height: 1000px; position: relative; margin-bottom: 20px !important; overflow-y: s...

How to perform this kind of CURL request on Ruby -

i using api provided web host whom can register new clients , domains. unfortunately don't provide documentation (basically none) , i'm not used curl they give 1 , superficial example of how create new client, , follows curl -d "clientetipo=i&clientecpfcnpj=00112135045&clienteempresa=nomeempresa&clientenome=meunome&clienteemail=email@dominio.com.br&clienteemailcobranca=emailcobranca@dominio.com.br&clientesenhapainel=654321&clientefone=555100000000&clientefax=555100000001&clientecep=44587421&clienteendereco=ruanome&clientebairro=meubairro&clientecidade=porto alegre&clienteestado=rs&clientelimitemapeamento=1&clientelimitesubdominio=2&clientelimitemysql=3&clientelimitemssql=1&clientelimitepgsql=1&clientelimitefirebird=1&clientelimiteftpadd=1&clienteunibox=on&clienteacessoftp=on&clienteacessodownloadbackup=on" -k --digest -u usuario:senha -x post https://api.kinghost.net/cl...

vba - Open Excel file from batch script and return message to batch script after closing it again -

i open excel file command line, using statement in batch file: start /wait excel "myworkbook.xlsb" /e/parameters inside workbook, there auto-open macro something. in case of errors want close excel , send error message batch file. how achieve that? possible quit application error code or this? i don't think can return actual errorcode vba batch file. as mentioned @fabrizio can add error handling code vba. if want batch file check if excel successful or not, have vba error handler create text file details of error , have batch file check existence of file. if file exists, batch file can rename it. way have record of error was.

linux - concatenateing string variables overwrites them -

i have problem concatenate 2 string variables. second variable overwrites first one. script: subject1=$(grep -e -o "exit.{0,12}" 123.log) subject2=$(grep transferred: 123.log) completesubject="$subject1 / $subject2" echo $completesubject subject1 contains exit status 0 , while subject2 contains transferred: sent 308464915408, received 11704 bytes, in 14844.1 . now completesubject results in / transferred: sent 308464915408, received 11704 bytes, in 14844.1 seconds , want exit status 0 / transferred: sent 308464915408, received 11704 bytes, in 14844.1 seconds . what problem?

php - filter_var and validating integer values -

i'm trying validate if variable 32-bit signed integer. i thought use filter_var() , filter_validate_int apparently phps definition of int entirely different, 999999999999999999 passes without problem. looking @ php docs dosn't specific. filter_var($var, filter_validate_int) validate? i think problem lies more integer : the size of integer platform-dependent, although maximum value of 2 billion usual value (that's 32 bits signed). 64-bit platforms have maximum value of 9e18, except windows, 32 bit. php not support unsigned integers. integer size can determined using constant php_int_size, , maximum value using constant php_int_max since php 4.4.0 , php 5.0.5. filter_validate_int allows min_range , max_range passed options. should use those.

sql server - Entity Framework, variable criteria runs much more slowly -

the following runs <0.3s, constant in predicate condition iqueryable<fn_getdocumentsforcontact_result> _queriable; var zeus = new zeus(); var uow = new unitofwork(zeus); var sp = new storedprocedureservice(zeus); int _userid = 183494; int totalrecords = 0; int doctype = 2; var predicate = predicatebuilder.true<fn_getdocumentsforcontact_result>(); predicate = predicate.and(x=>x.type == 2); iqueryable<fn_getdocumentsforcontact_result> documents = sp.fn_getdocumentsforcontact(183494) .asexpandable() .where(predicate); _queriable = documents; _queriable.count().dump(); generates following sql: -- region parameters declare @ctcidnumber int = 183494 declare @p__linq__0 int = 2 -- endregion select [groupby1].[a1] [c1] ( select count(1) [a1] [dbo].[fn_getdocumentsforcontact](@ctcidnumber) [extent1] [extent1].[type] = @p__linq__0 ) [groupby1] if change: predicate = predicate.and(x=>x.type == 2); ...

node.js - Nodejs HTTP request fails with some character -

i saving data using http request , working fine. following code: var data = { title: request.body.title, description: request.body.description }; var datastring = json.stringify(data); logger.debug(datastring); var options = { hostname: config.hostname, port: config.defaultport, path: '/api/save', method: 'put', headers: { 'content-type': 'application/json', 'content-length': datastring.length, 'authtoken': token } }; var req = http.request(options, function (res) { var datastr = ''; res.setencoding('utf8'); res.on('data', function (chunk) { datastr += chunk; }); res.on('end', function () { var res_data = json.parse(datastr); if (res_data.status === "success") { response.note = json.parse(datastr); callback(null, response); } else if(res_data.status === ...

solaris - OracleSolaris 11.2 -- is /usr/kernel/drv/driver.conf required for PCI? -

i'm implementing small pci driver academic purposes, , 1 thing i'm not clear if have provide driver.conf ? different materials read (including http://blog.csdn.net/hotsolaris/article/details/1763716 ), pci driver config file optional, in case seems pci_config_setup() successful driver.conf provided: name="mydrv" parent="/pci@0,0/pci8086,2e11" then do: % add_drv -i 'pcixxxx,yy' mydrv and adds in system no warning or error messages. assume properties of pci device can't derived automatically system, e.g. parent bus? i appreciate if shed light on this. thanks. if @ random selection of small files under /kernel/drv actual physical hardware, you'll see contain line ddi_forceattach=1; pseudo drivers have driver.conf(4) file reflects parentage in system. recommend reading manpage, goes detail what's required here.

asp.net mvc - Choosing the Right Solution for Reverse Engineering with Code First -

Image
using asp.net boilerplate have created solution project , have pre-existing database wish use project. wish use ef code first reverse engineering tool map db code. for best practices however, i'm unsure in solution wish generate mappings? tool works right-clicking solution file , selecting reverse engineer code first , you're asked choose database. question solution use ef tool? thanks edit: believe i'm being misunderstood. know how use ef power tools already. i'm not sure solution should contain classes ef reverse engineer generates? use power tools, have right click on 1 of solutions. best practices solution should contain files? thanks

javascript - Inserting custom text in JS output -

i have below line in js code. runs 0 2. want put custom text in place of: ' + info[i] + ' each of i's(over iterations of i). how do that? for(var i=0; < origins.length-1; i++) { var results = response.rows[i].elements; output += '<tr><td>' + info[i] + '</td><td>' + origins[i] + '</td><td></td><td>' + destinations[i+1] + '</td><td></td><td>' + results[i+1].distance.text + '</td></tr>'; } . want put custom text in place of: ' + info[i] + ' each of i's(over iterations of i). not sure "custom text" assume custom text should in array: var customtext = ["custom text i=0", "custom text i=1", "custom text i=2"]; for(var i=0; < origins.length-1; i++) { var results = response.rows[i].elements; output += '<tr><t...

oracle - SQL joins using (+) operator in where clause -

i trying rewrite oracle sql query uses operators in clause join in clause instead. understand how tell if left or right join, don't know make of this... referencing column number??? alias.column(+) = 1 what trying tell me? i'm rewrite like: left join table on alias.column = 1 is 1 actual value? if why use (+)? i'm not familiar sql sorry if basic question. it's not easy thing google either... i've tried last hour , cannot find explain join... take @ this: " (+) = " operator in oracle sql in clause (+) old oracle syntax used joins, it's deprecated. , yes, can (and should) rewrite this.

angularjs - My service is returning the function's text and not an object -

i have service share object in app... want post object mongo db when call function should return object gives me function's text. the service here: angular.module('comhubapp') .service('markerservice', function () { this.markers = []; this.newmarker = { title: '', description: '', lat: '', lon: '', user: '', created_at: '' }; // supposed return marker object this.newmarker = function () { return this.newmarker; }; this.settitle = function (title) { this.newmarker.title = title; console.log('title service set: ' + title); }; this.setdescription = function (description) { this.newmarker.description = description; console.log('description service set: ' + description); }; this.setlat = function (lat) { this.newmarker.lat = lat; console.log('lat service set: '...

Can you make a YouTube analytics API request using Net::HTTP in Ruby? -

assuming access_token , test_channel_id correct, shouldn't request work? i'm getting 404 error, missing parameter? uri = uri.parse("https://www.googleapis.com") http = net::http.new(uri.host, uri.port) http.use_ssl = true http.verify_mode = openssl::ssl::verify_none request = net::http::post.new("/youtube/analytics/v1/reports") request.body = uri.encode_www_form({"authorization" => "bearer #{access_token}", "ids" => "channel==#{test_channel_id}", "start-date" => "2015-07-01", "end-date" => "2015-07-20", "metrics" => "views"}) response = http.request(request) it's worth mentioning obtained access_token refresh_token authorized youtube api scopes if you're passing access token url parameter, name of parameter should "access_token" , don't need "bearer" part of string; be: request.body = u...

android - Can i change accent color (AppCompat) programmatically? -

i have: <style name="apptheme" parent="theme.appcompat"> <item name="coloraccent">@color/mycolor</item> </style> but want allow user change accent color. can appcompat? no can't, because accent color defined in theme , themes read-only in android. the thing can switch themes or set color of each component manually. note : can apply theme portion of ui instead of whole activity in order change accent color (or other things) locally. so, can use android:theme attribute in xml layout appcompat library, or can inflate layout providing contextthemewrapper context layoutinflater .

sprite kit - Swift Changing the Background of SKScene -

the scene im present linked skscene, how change background color of scene programmatically? import uikit import spritekit import coregraphics class coolscene: skscene { } you can change background via self.backgroundcolor .

text loading delay in android activity -

Image
given below (oncreate) code use display information on screen of android app. activity getting loaded on event triggered in activity. problem when screen loaded. first loads blank screen , renders relevant text on delay. delay can noticed end user , makes them feel screen getting loaded twice. there solution this? @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_end); commonutils.changeactionbarcolor(getsupportactionbar()); //get respective child object has displayed in gui string childobjectkey = getintent().getstringextra(child_object_key); // single method pop(), both pushweak() , pushstrong() endobject = (ipend) asfobjectstore.getdefault().pop(childobjectkey); this.settitle(endobject.getpathwayname()); //endwebview web...

android - Horizontal ListView not updating -

i'm developing app has horizontallistview , i'm using twowayview lib, , works fine, when has item changed, listview try reconstruct view, nothing changes, here code: if (mhorizontallistviewusersinchat.getadapter() != null) { usersinchatadapter.notifydatasetchanged(); mhorizontallistviewusersinchat.invalidate(); } else { mhorizontallistviewusersinchat.setadapter(usersinchatadapter); } inside adapter there imageview loads image picasso , when adapter notified, new url not loaded inside imageview , me? thanks.

checkbox - Change status of Check Box in Access -

how can change 1 click status of checkbox in whole access table? (there 30000 rows that's why need perform automatic change) you can use update query, update tablename set checkboxfield=1

Pagination not working AngularJS 1.4 with ui-bootstrap -

here's have (i've tried numerous things other answers , tutorials no avail): simpleimagereview.js: var app = angular.module("simpleimagereview", ['ui.bootstrap']); imgviewerctrl.js: app.controller("imgviewerctrl", function($scope, $http) { $scope.imglist = []; $http.get("http://127.0.0.1:5000/api/file_metadata").success( function(data, status, headers, config) { $scope.data = data; $scope.totalimgs = $scope.data.num_results; $scope.totalpages = $scope.data.total_pages; $scope.currentpage = $scope.data.page; $scope.imglist = $scope.data.objects; $scope.imgsperpage = 10; }); }); index.html (stripped down): ... header, imports, etc. - no issues <body ng-app="simpleimagereview"> <div ng-controller="imgviewerctrl"> <ul> <li> <li ng-repeat="img in imglist...

c - Memcached timeout -

i found sample code using libmemcached in c/c++. don't understand meaning of 2 timeout: memcached_timeout of memcached_behavior_set() expire of memcached_set() rc = memcached_behavior_set( memc_primary, memcached_behavior_connect_timeout , memcached_timeout ); rc = memcached_set( memc_primary, memcached_key_val, memcached_key_len, save_value, strlen( save_value ), expire, 0 ); could please explain used for? thank much!

linux - Using client certificate in Curl command -

curl command: curl -k -vvvv --request post --header "content-type: application/json" --cert client.pem:password --key key.pem "https://test.com:8443/testing" i trying send client certificate using curl command specified above. trying know following: what http request header should looking @ server side pull out client certificate http request. if cannot pull out client certificate on server side http request, can add custom request header in http request , send client certificate value of custom header. great if provide me example of approach. tls client certificates not sent in http headers. transmitted client part of tls handshake , , server typically check validity of certificate during handshake well. if certificate accepted, web servers can configured add headers transmitting certificate or information contained on certificate application. environment variables populated certificate information in apache , nginx can used in other dir...

Float division of big numbers in python -

i have 2 big numbers a , b of length around 10000, such a <= b . now, have find c = / b , upto 10 places of decimal, how do without loosing precision? the decimal module should work. seen in tigerhawkt3's link, can choose number of decimal places quotient should be. from decimal import * getcontext().prec = 6 = float(raw_input('the first number:')) #can int() if needed b = float(raw_input('the second number:')) c = decimal(a) / decimal(b) print float(c)

android - Why does this code get me a "Cannot find symbol" error when I declare the method in this page? -

hi wondering why getting error saying cannot find symbol bindhour when have declared @ bottom of page? appreciated, thank in advance!! package com.dredaydesigns.stormy.adapters; import android.support.v7.widget.recyclerview; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import android.widget.imageview; import android.widget.textview; import com.dredaydesigns.stormy.r; import com.dredaydesigns.stormy.weather.hour; /** * created andreas on 7/2/2015. */ public class houradapter extends recyclerview.adapter { private hour [] mhours; public houradapter(hour [] hours) { mhours = hours; } @override public recyclerview.viewholder oncreateviewholder(viewgroup parent, int viewtype) { view view = layoutinflater.from(parent.getcontext()) .inflate(r.layout.hourly_list_item, parent, false); hourviewholder viewholder = new hourviewholder(view); return viewholder; }...

jquery - How to anchor to the bottom of the page while switching to the right video in a carousel? -

i have carousel @ bottom of page 3 youtube videos. there twitter button share individual video. when click on twitter button, link like: http://yoursite.com/index.html#video-1 so link point bottom of page. however, trying figure out pseudo code , logic point bottom of page , rotate correct video. at moment, http://yoursite.com/index.html#video-1 http://yoursite.com/index.html#video-2 http://yoursite.com/index.html#video-3 will point #video-1 i have figured out. essentially, string detection in url , solve problem. // check url given # anchor string if(document.url.indexof("buying-a-car") != -1) { $("#ytvideo"+1).show(); } else if(document.url.indexof("taking-a-holiday") != -1){ $("#ytvideo"+2).show(); } else if(document.url.indexof("moving-to-new-zealand") != -1){ $("#ytvideo"+3).show(); } else if(document.url.indexof("selling-your-house") != -1){ $(...

ios - BLE, iPhone and Swift -

i trying develop app iphone (written in swift, using corebluetooth) needs connect ble module (that has act peripheral), , send module data. unfortunately cannot on own because of little knowledge. can indicate me find information? or, alternative, know how can this? i suggest you, irrespective of language going use, first understand core bluetooth framework . go through each term . can start basic functionality searching peripherals , connect peripherals. here links can you: https://developer.apple.com/library/ios/documentation/corebluetooth/reference/corebluetooth_framework/ and http://www.raywenderlich.com/52080/introduction-core-bluetooth-building-heart-rate-monitor

What are the most recent bittorrent DHT implementation recommendations? -

i'm working on implementing yet bittorrent client , @ time struggling dht. implemented accordingly specification http://www.bittorrent.org/beps/bep_0005.html starting debugging noticed other nodes' responses on network vary. for example, find_node supposed return either target node info or 8 closest nodes. of nodes reply 34 closest nodes , 1 - 3 nodes 34 reply consequent ping request. is there document better implementation recommendation? may proved using 15 minutes interval change nodes state questionable not efficient , have use 10 or other number? can find best date suggestions? there strange thing. bootstrap nodes router.bittorrent.com reply more closest nodes , "nodes" bdictionary property buffer length not divisible 6 (compact node info: 4 ip , 2 port). now, cut off buffer @ closest divisible 6 length strange. know why might happen? the spec says (emphasis mine): when node receives find_node query, should respond key "nodes" ...

javascript - Apply a jQuery script already present in the page only the html called by Ajax, not on all html documents -

i created generalists jquery scripts of html tags: <script src="./scripts/public/scripts.js"></script> i html tags called ajax benefit these scripts. added function $.getscript() in code: $('.ajax-global').on('click', function(){ var param = $(this).attr('id'); $('.ajax-window').load('./ajax/' + param + '.php', function(){ $.getscript("./scripts/public/scripts.js"); }); }); the problem code affects entire page, or wish limited ajax code called... how proceed?

c++ - memset pointer + offset -

for example, have: dword pointer = 0x123456; dword offset = 0xabc; i want add offset pointer , set value @ address pointed pointer 1.0f . how give memset() pointer , offset first argument? dwords same uint32_t's. add them other integer. also, while setting float (i assuming you're setting float due 'f' after '1.0'), wouldn't use memset. cast pointer float, , de-reference so: dword pointer = 0x123456; dword offset = 0xabc; pointer += offset; float* float_pointer = reinterpret_cast<float*>(pointer); *float_pointer = 1.0f;

java - How can I get a count from a related table in Hibernate -

i have 2 simple pojos placed in many 1 relation @entity public class meeting { @id @generatedvalue(strategy = generationtype.identity) private int meetingid; private string title; @manytoone private location location; ... and @entity public class location { @id @generatedvalue(strategy = generationtype.identity) private int locationid; private string name; ... i'm wondering need count of meetings inside locationlist below session session = hibernatehelper.getsessionfactory().opensession(); session.begintransaction(); list<location> locationlist = session.createcriteria(location.class).list(); i've thinked of definig @transient meetingscount inside location pojo don't know how go on in order tell hibernate retrieve me. i know how information making explicit query not i'm looking for

python - celery: how to use celery.utils.worker_direct -

i working on project using celery distributing tasks. in order route task specific worker (because needs specific files, created previous task), trying use celery.utils.worker_direct . what i'm doing this: @app.task(bind=true) def task_a(self, arg): worker = str(self.request.hostname) # ... s = task_b.s(arg1, worker) s.delay() @app.task def task_b(arg1, worker): task_c.apply_async((arg1, arg2), queue=worker_direct(worker)) @app.task def task_c(arg1, arg2): pass when task_c.apply_async((arg1, arg2), queue=worker_direct(worker)) executed, error: typeerror: object of type 'queue' has no len() what doing wrong? found solution: # task_a worker = worker_direct(self.request.hostname).name # task_b task_c.apply_async((arg1, arg2), queue=worker)

ios - Object from JSON with Mantle: ignore a property -

my app creates objc objects json. things working fine, until added new property objc model class, doesn't have counterpart in json. i've configured mapping follows: + (nsdictionary *)jsonkeypathsbypropertykey { return @{ @"firstname" : @"firstname", @"middlename" : @"middlename", @"lastname" : @"lastname", // etc. @"phonenumber" : nsnull.null // no json data 1 }; } however assertion failure in mantle, in mtljsonadapter initwithmodelclass : " phonenumber must either map json key path or json array of key paths, got: null. " this how create model object: mydata *mydata = [mtljsonadapter modelofclass:[mydata class] fromjsondictionary:json error:&error]; how can have phonenumber property in data class with...

java - Adding JLabel dynamically in a pattern but last one is not working correctly -

Image
i'm trying creating 40 dynamical jlabels in pattern , working quite last jlabel not placing according pattern. can tell me did wrong ? here have done far: public class booking2 { public static void main(string[] args) { jframe jf = new jframe(); jf.setvisible(true); jf.setdefaultcloseoperation(jf.exit_on_close); jf.setsize(700, 400); jf.setlocationrelativeto(null); int c1 = 40; int count = 0, count2 = 0, count3 = 0, count4 = 0, x; jlabel[] jl = new jlabel[c1]; (int = 0; <= c1 - 1; i++) { jl[i] = new jlabel(); if (i <= 9) { x = 25 * count; jl[i].setbounds(x, 50, 20, 30); count++; } if (i >= 10 && <= 19) { x = 25 * count2; jl[i].setbounds(x, 80, 20, 20); count2++; } if (i >= 20 && <= 29) { ...

Windows batch file redirect output to logfile with date/time -

i trying run batch file runs executable , redirects output log file. log file must have date , time file name. command using: "%programfiles%\postgresql\9.4\bin\vacuumdb.exe" --username postgres --verbose --analyze --all > e:\logs\vacuumdb\%date:~10,4%_%date:~4,2%_%date:~7,2%_%time:~0,2%_%time:~3,2%_%time:~6,2%.log 2>&1 this command works when pasted directly in cmd. log file created expected '2015_06_25__11_20_46.log'. however, not work when pasted in batch file, , run in cmd. cmd interprets command follow: "c:\program files\postgresql\9.4\bin\vacuumdb.exe" --username postgres --verbose --analyze --all 8_21_42.log 1>e:\logs\vacuumdb\2015_06_26_ 2>&1 notice how file name truncated , time appended command arguments instead of being in file name. command fails. this surely simple have not found way fix this. appreciated. thank you! your problem is, timestring may contain space (before 10 o'clock) can replace z...