Posts

Showing posts from August, 2014

php - Fetch large amount of data in laravel 4.2 -

i have developed bulk sms sending software. software send millions of sms per day. want make report millions of data. cant fetch data. fetch 27000 row or less. apply query 2 fields id , mobile number. when try raw php code in other application works fine laravel can not fetch data. show memory size exhausted error. in php.ini memory limit 128m now want know best way fetch millions of data in laravel. or should implement other technology. you can use chunk method. user::chunk(200, function($users) { foreach ($users $user) { // } }); if need process lot (thousands) of eloquent records, using chunk command allow without using of ram. or you can run composer update no memory limit , can in following way php -d memory_limit=-1 composer update

java - Use EL ${XY} directly in scriptlet <% XY %> -

in project i've asign variable every time jsp being opened. tried scriptlets <% %> in jsp , el ${} gives variable back. but seems not working. <% string korrekteantwort=${frage.korrekteantwort};%> <%session.setattribute("korrekteantwort", korrekteantwort);%> there error after korrekteantwort=${} , isn't possible asign directly variable el in scriptlet? you're mixing scriptlets , el , expecting run "in sync". won't work. the 1 oldschool way of writing jsps , the other modern way of writing jsps . should use 1 or other, not both. coming concrete question, under hoods, el resolves variables pagecontext#findattribute() . same in scriptlets . frage frage = (frage) pagecontext.findattribute("frage"); session.setattribute("korrekteantwort", frage.getkorrekteantwort()); however , said, oldschool way of using jsps , not "best" way the functional requirement you've had in mind, ...

swift - SpriteNode not rendered at first time when using atlases - works with xcassets -

i have strange behaviour when rendering skspritenodes using atlas via imagenamed. sprite = skspritenode(imagenamed: triangle.triangletype1.spritename) sprite.size.height = tileheight sprite.size.width = tilewidth sprite.zrotation = degreestoradians(triangle.rotation) sprite.position = pointforcolumn(triangle.column, row:triangle.row, columnoffset: tilewidth, rowoffset: tileheight, tw: tilewidth,th: tileheight) trianglelayer.addchild(sprite) triangle.sprite1 = sprite addedtriangles++ print(sprite) some of sprites not rendered adding them layer (another skspritenode) first time - printing "sprite" shows they're size 0,0 , image shows " trviolet " instead of " trviolet@2x.png ". other ones rendered supposed be. removing nodes , executing same code second time work though. when put image in xcassets works charm - first time. is there way debug kind of behavior or have idea on might happening here?

android - Does findViewById has priority over ButterKnife's bind method call? -

in activity's oncreateview have 2 different source views inflate ui elements. inflating ui elements belong 1 source view findviewbyid() , belong other source view using butterknife's bind method call. but work if findviewbyid has priority on butterknife , otherwise first set of elements attached second source view. so true findviewbyid has priority on butterknife ? under hood butterknife's bind being executed findviewbyid integer value of id, rather lookup r.id.something , means both methods performing same , have same "priority", depends 1 execute first. so answer "no, butterknife's bind has no priority, though execution can bit faster due lookup"

javascript - How to create a set of two elements: Raphael -

i have 2 rectangles on canvas, want them snap if drag 1 of them ontop of other. guess need use set() not sure how. got far. $(document).ready(function(){ var paper = raphael(20, 20, 5000, 5000); var rect1 = paper.rect(50, 50, 50, 50).attr({ fill: "hsb(.8, 1, 1)", stroke: "none", opacity: .5, }); var rect2 = paper.rect(50, 50, 50, 50).attr({ fill: "hsb(.8, 1, 1)", stroke: "none", opacity: .5, }); var rectstart = function() { this.ox = this.attr("x"); this.oy = this.attr("y"); this.attr({opacity: 1}); }, rectmove = function(dx, dy) { this.attr({x: this.ox + dx, y: this.oy + dy}); }, rectup = function(){ this.attr({opacity: .5}); }; rect1.drag(rectmove, rectstart, rectup); rect2.drag(rectmove, rectstart, rectup); you have write logic inside rectup method. here working fiddle var paper = raphael(20, 20, 5000, 5000); va...

mysql - Why is Delphi (Zeos) giving me widestring fields in SQLite when I ask for unsigned big int? -

i using latest zeos sqlite 3. going well, converting mysql, once made persistent integer field tlargeint . but when use column definition unsigned big int (the unsigned type allowed according https://www.sqlite.org/datatype3.html ), delphi calling resulting field ftwidestring . no, not "revert" string, sqlite stores data provided. as the documentation states : sqlite supports concept of "type affinity" on columns. type affinity of column recommended type data stored in column. important idea here type recommended, not required. column can still store type of data. columns, given choice, prefer use 1 storage class on another. preferred storage class column called "affinity". if supplied/bind text value, store text value. there no conversion type supplied in create table statement, may appear in other more strict rbms, e.g. mysql. so in case, if retrieve data ftwidestring , guess because wrote data text. instance, tool or program...

node.js - how to install npm on ubuntu? -

i want install mocha test framework need npm ran following commands 1. sudo apt-get install npm 2. npm install -g mocha but getting following error when ran first command user@dell:~/mochatest$ sudo apt-get install npm [sudo] password user: reading package lists... done building dependency tree reading state information... done following packages automatically installed , no longer required: apt-clone archdetect-deb autogen ax25-node binutils-mingw-w64-i686 binutils-mingw-w64-x86-64 dmraid g++-mingw-w64 g++-mingw-w64-i686 g++-mingw-w64-x86-64 gcc-mingw-w64 gcc-mingw-w64-base gcc-mingw-w64-i686 gcc-mingw-w64-x86-64 gfortran-mingw-w64 gfortran-mingw-w64-i686 gfortran-mingw-w64-x86-64 gir1.2-json-1.0 gir1.2-timezonemap-1.0 gir1.2-xkl-1.0 gnat-mingw-w64 gnat-mingw-w64-base gnat-mingw-w64-i686 gnat-mingw-w64-x86-64 kpartx kpartx-boot libax25 libdebian-installer4 libdevmapper-event1.02.1 libdmraid1.0.0.rc16 libopts25 libopts25-dev lvm2 mingw-w64 mingw-w6...

c# - UIA Verify shows no name property for buttons -

Image
i need automate workflow , tried rely on teststack white , uia verify find buttons in application. when try identify buttons greeted empty name properties controls inside window need control (see attached screenshot). controls apparently of type custom. i want able press buttons , enter text textboxes check checkbox. is there way? can access them via example index (e.g. button = third control in window)? edit: requested screenshot inspect.exe would mind taking @ controls inspect.exe , posting screen shot of properites? might able find unique property on them identify with. inspect.exe can found c:\program files (x86)\windows kits\8.1\bin\x64\inspect.exe. with white wont able collection of buttons raw ui-automation able collection of automationelements using findall . here example of how controls of type. retrieve multiple uiitems byclassname edit: after looking @ updated image inspect afraid application trying automate didn't expose application ui-autom...

c - Discarded 'const' qualifier at assignment -

i have following code - int acb(const uint16 *msgptr) { uint16 *p = (msgptr + 1); printf("%d", *p); } i following warning - discarded 'const' qualifier @ assignment line above printf. how resolve? the argument acb pointer constant uint16 , pointer you're creating not pointing constant. discards const qualifier. either remove const argument passed function or make p point const uint16 . why case? tell compiler guarantee won't change msgptr points to, create pointer can modify msgptr points *(p - 1) = ...;

Android Studio + Gradle: define resValue without translation, how can I do that? -

when defining resources resvalue in build.gradle impossible mark them translatable="false". in xml possible. exemple: in gradle.properties: facebook_app_id="xxxxxxxxxxxxx" in gradle: resvalue "string", "facebook_app_id", facebook_app_id when want generate signed apk, there translation error on string because not translated in other language... it's normal, don't want translate it. gradle doesn't support yet . cannot add similar notranslate in gradle file. you can add facebook_app_id exclude lint translation check. missingtranslation https://code.google.com/p/android/issues/detail?id=152198

windows - "delims=#+#" - more then 1 character as delimiter -

is possible define delimiter not limited 1 character? based on title's example, define separator e.g. '#+#'. textfiles/lines can contain both characters, there little chance you'll come across particular substring/text combo. no, can not use string delimiter in delims= clause. of course can include string, handled set of separate characters used delimiters, not delimiter string. if need split on string, fastest approach replace delimiter string character not included in data , use character delimiter @echo off setlocal enableextensions disabledelayedexpansion /f "delims=" %%a in ("this +test!! #+# of string #splitting#") ( set "buffer=%%a" setlocal enabledelayedexpansion (for /f "tokens=1,2 delims=¬" %%b in ("!buffer:#+#=¬!") ( endlocal echo full line : [%%a] echo first token : [%%b] echo second token : [%%c] ...

How to call function from jquery to php? -

php: $product_code = $_get['product_code']; $countrycode = getcountrycode(); <script src="js/register_script.js" type="text/javascript"></script> jquery: function getcountrycode() { countrycode = qrcode_getinfo(qrcode1,"mfg_c_a_code",0) return countrycode; } i want country code jquery perform validation task, however, wasn't able retrieve country code. idea should work? please note library been called. (i had read on examples dont understand how works..) it not possible directly call php function javascript , vice versa. part of reason @pekka indicated js runs clientside (in browser) while php runs server-side (on server). it possible use ajax purposes: html <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script type="text/javascript"> function getcountrycode() { countrycode = qrcode_getinfo(qrcode1,"mfg_c_...

woocommerce - WordPress Plugin or Woo-Commerce Extension -

i want combo pack facility in woo-commerce wordpress site this:- let's dress costs 100, ring 20 , shoe 40 , purse 10 total price 170. total combo sold 150, 20 discount. there extension or plugin there it? you can use woo-commerce function chained product or

mysql - WordPress negates DB_COLLATE in wp-config -

i'm having trouble installing wordpress on localhost development area. working fine, when want move site online environment problems showing db collation. i read , seems wordpress created tables on localhost using utf8mb4_unicode_ci charset/collation. although online environment has higher version of mysql running, won't import tables when moving. i decided force wordpress use older db collation on localhost. changed wp-config this, before running setup: /** database charset use in creating database tables. */ define('db_charset', 'utf8'); /** database collate type. don't change if in doubt. */ define('db_collate', 'utf8_general_ci'); i saved , ran setup. quick check in database resulted in tables still in utf8mb4_unicode_ci collation! how force wordpress use utf8_general_ci collation? before installing, comment line in wp-config-sample.php // define ('db_charset', 'utf8'); // define ('db_collate...

java - NullPointerException in filter from Ajax Request -

i've migrate apache nginx web server. since that, npe error filters on ajax request : java.lang.nullpointerexception @ org.ulpmm.eev.web.administration.modifyelevedossierutilisateur.verificationdateentree(modifyelevedossierutilisateur.java:340) @ org.ulpmm.eev.web.administration.modifyelevedossierutilisateur.modifyuser(modifyelevedossierutilisateur.java:175) @ org.ulpmm.eev.web.administration.modifyelevedossierutilisateur.doprocess(modifyelevedossierutilisateur.java:142) @ org.ulpmm.eev.web.administration.modifyelevedossierutilisateur.dopost(modifyelevedossierutilisateur.java:91) @ javax.servlet.http.httpservlet.service(httpservlet.java:641) @ javax.servlet.http.httpservlet.service(httpservlet.java:722) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:305) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:210) @ org.ulpmm.eev.utils.setcharacterencodingfilter.dofilter(setcharacterencodingfilter....

javascript - How to add Bootstrap Tool tips to a input field when its type=“file” -

i tried following code, <input type="file" name="file" id="filefield" data-toggle="tooltip" data-placement="bottom"/> <script> $(document).ready(function() { $('[data-toggle="tooltip"]').tooltip(); }); </script> after executes this, <input id="filefield" type="file" data-placement="bottom" data-toggle="tooltip" name="file" data-original-title="" title=""> normally add title attribute simple tool tip. in following example simple tool tip without title attribute. , gets updated whenever select different file. need these tool tips bootstrap tool tips , needs updated whenever select different file through "choose file" button. http://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_input_type_file try <input type="file" name="file" id="filefield" data-...

mysql - Need to display records by joining two tables and the records should be Unique -

i have 2 tables student , taskeffort . many students have worked on same tasks. particular task name of students , effort should considered. the student table contains studentid , firstname , lastname . the taskeffort table contains taskid , studentid , effort i need display taskid, first name, last name, effort, worked on particular task. this 1 of queries tried, not working. select t.id, s.firstname, s.lastname, t.effort taskeffort t left outer join student s on t.id = 4 , s.studentid = t.studentid thanks in advance. select t.id, s.firstname,s.lastname, t.effort taskeffort t left outer join student s on s.studentid = t.studentid t.id = 4;

no function is mapped to the name "action:output" , oozie shell action -

according oozie documentation , can capture output of shell action using function string action:output(string node, string key) when use in decision node <decision name="mydecision"> <switch> <case to="shell1"> ${action:output('decidescript','decide.next.step.name') = 'shell1'} </case> <default to="end"/> </switch> </decision> oozie throws me error saying no function mapped name "action:output" , oozie shell action the seems error in oozie documentation of shell action. use {wf:actiondata('decidescript')['decide.next.step.name'] = 'shell1} el instead.

gradle - 'AllDevelopmentDebugClassesForMultiDex'. > java.util.zip.ZipException: duplicate entry: retrofit/android/AndroidApacheClient.class -

my build.gradle : apply plugin: 'com.android.application' apply plugin: 'io.fabric' buildscript { repositories maven { url 'https://maven.fabric.io/public' } } dependencies { classpath 'io.fabric.tools:gradle:1.+' } } android { compilesdkversion 22 buildtoolsversion "23.0.1" defaultconfig { applicationid "com.myapp" minsdkversion 19 targetsdkversion 22 versioncode 1 versionname "1.0" multidexenabled true } productflavors { production { applicationid "com.myapp" } development { applicationid "com.myapp.development" } staging { applicationid "com.myapp.staging" } qa { applicationid "com.myapp.qa" } } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } sourcesets...

How To Use External Sqlite in Android -

i learning android have doubt how use external sqlite manager (add on in firefox) in android studio or please how use 2 table names in sqlite example :user table , admin table you can put database schema table design , may data in tables to 1 mb in assets folder , when create instance of sqlite manager copy assets data/data/packagename/databases/ first check database copied or not using code private static string db_path = "/data/data/packagename/databases/"; private static string db_name = "dbname.db"; private boolean checkdatabase() { sqlitedatabase checkdb = null; try { string mypath = db_path + db_name; checkdb = sqlitedatabase.opendatabase(mypath, null, sqlitedatabase.open_readwrite); if(checkdb.getversion() < database_version){ onupgrade(checkdb, checkdb.getversion(), database_version); } } catch (sqliteexception e) { } if (checkdb != null) { ch...

android - Custom CoordinatorLayout behavior -

this layout: <android.support.design.widget.coordinatorlayout android:id="@+id/coordinator_layout" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <include layout="@layout/view_product_details"/> // contains nestedscrollview <linearlayout android:id="@+id/indicator" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="right|bottom" android:layout_marginbottom="16dp" android:gravity="right|bottom" android:orientation="horizontal" app:layout_behavior="utils.custombehavior"> // views.. </linearlayout> i want indi...

JavaFx 8 WebEngine - Caching images via user data directory? -

i new javafx , tried implement browser in application. since reloading images on every new startup quite time-consuming, i'd store them in cache directory , have been failing so. tried using setuserdatadirectory(...) , leads empty folder called localstorage , empty .lock file being created. i found so thread , firstly, not yet allowed comment there , secondly, seems address javafx 2.2. has been posted there still hold true javafx 8? if so: there simple way implement such urlconnection cache? many :) so, after 2 days of digging problem , learning urlconnection class, able come own (presumably crude) implementation i'd share here in case little knowledge happens stumble on thread. again, basic idea place specific file types in cache, not everything. chose store jpg , png , gif , js files thought them load-heavy ones, though every other file format should possible, too. first things first: browser.getengine().setuserdatadirectory(...) not job. still have no...

intellij idea - Return to normal execution after debugging a part of code -

Image
when debug program using intellij' debugger, how can return normal execution of program after debugging part of code ? i start program, test it. when debugger find breakpoints, starts step step debugging of program. i stuff , checks, nothing goes wrong. i want exit step step debugging , go fluid execution of program (without having press button actions) until debugger find new breakpoint. how can , exit step step debugging? you can use "resume program" button, looks green triangle (a "play" button"), or f9 shortcut. see, e.g., screenshot debugging session started (mouse cursor , hovering tooltip show button's location): note: screenshot taken in intellij idea 14.1.4 exact layout may differ according specific version, same behavior, buttons , shortcuts have existed in intellij years now.

regex - Replacing only first block of text between dilimiters with content of file using sed -

i have been tasked replacing license boiler plate text in large number of files. because there many i'd script it, , ideally in one-liner using sed . i know this similar question can use like: find . -type f -exec \ sed -i -ne '/^\/\/ dom-ignore-begin/ {p; r /path/to/new/license.txt' \ -e ':a; n; /^\/\/ dom-ignore-end/ {p; b}; ba}; p' '{}' \; which find files , replace between ^// dom-ignore-begin , ^// dom-ignore-end content of replacement license file. , that's fine , dandy, works charm. the problem is, of files contain multiple dom-ignore-* blocks, new license replaces whatever in blocks - far ideal. so i'd know how can limit replacement on first block found , skip rest. regex-fu lacking in respect. sample input: blah blah blah blah blah // dom-ignore-begin foo foo foo foo // dom-ignore-end blah blah blah blah // dom-ignore-begin foo foo foo foo foo foo foo foo foo // dom-ignore-end blah blah expected output: ...

objective c - How to access object for id -

hiho code-friends, i created nsmutabledictionary "_favdictionary" picture-data inside. getting key current cell collection-view, contains integer named "key". flamaincell *cell = (flamaincell *) sender.view; nsuinteger *key = cell.key; nsstring *instr = [nsstring stringwithformat:@"%lu", (unsigned long)key]; _favdictionary[instr] = storeimage; - (uiimage *)getfavouriteimages:(nsinteger)index{ return _favdictionary[index]; } i beginner in objective-c , not find possibility access dictionary integer value in method "getfavouriteimages". error getting says "nsmutabledictionary doesn't respond objectatindexedsubscript". can tell me how can access dictionary via integer? first of all, if indexing integers, use nsarray . if want use nsdictionary , don't have convert integers strings, can use nsnumber instead. flamaincell *cell = (flamaincell *) sender.view; nsuinteger *key = cell.key; nsnumber *innu...

Dependency Management in Android Studio of former multiproject Eclipse workspace with gradle and artifactory -

i've converted eclipse workspace usable in android studio using gradle scripts in eclipse , deploying local artifactory repository. my problem used go eclipse build-chain when developing , debugging , gradle toolchain when releasing. androidstudio (v.1.3.2) did job analysing gradle scripts , i'm able start app workbench. there 1 bigger library imports of dependencies , app stub uses library. have 2 android studio instances open 1 each project, tried import library module copied source app stub folder. how can accomplish develop library project in android studio without having release via 'uploadarchives' , adjusting library version in both projects time? thanks help. below gradle script illustrate situation: import java.util.regex.matcher; import java.util.regex.pattern; buildscript { repositories { maven { //url 'http://debian:8081/artifactory/repo' url 'http://debian:8081/artifactory/plugins-release...

scala - Closure not working in Filter method -

i have written following under impression line sort of keyword when iterating & filtering through multiple lines of text. error upon compilation. aware line word in spark code used under other context why code not working. have started learning scala 2 days now. please patient little understanding of syntax & slangs. can explain why line works in spark code & not in plain scala code? can other line in spark & simple scala code. plain scala code: val mystring = """hello world line 1 line 2 line 3"""; println(mystring.filter(line => line.contains(3))); ^^^^^^ error here spark code: val sc = new sparkcontext(conf) val logdata = sc.textfile(logfile, 2).cache() val numas = logdata.filter(line => line.contains("a")).count() line name of variable binding, it's no way special neither in plain scala nor in spark. i don't know of spark believe logd...

c# - The connection to the remote server can not be established -

i want download file windows server 2012 r2 local computer. file path: e:\update . i tried code: string localpath = @"c:\update\"; string filename = "update.xml"; try { var requestfiledownload = (ftpwebrequest)webrequest.create("ftp://111.111.111.111/e:/update/" + filename); requestfiledownload.method = webrequestmethods.ftp.downloadfile; ftpwebresponse responsefiledownload = (ftpwebresponse)requestfiledownload.getresponse(); using (stream responsestream = responsefiledownload.getresponsestream()) { using (filestream writestream = new filestream(localpath + filename, filemode.create)) { int length = 2048; byte[] buffer = new byte[length]; int bytesread = responsestream.read(buffer, 0, length); while (bytesread > 0) { writestream.write(buffer, 0, bytesread); bytesread = responsestream.read(buffer, 0, length); ...

oracle - SQL error 17002 : Physical DB connection is invalid -

i trying connect oracle db(installed in remote machine) java application. but, getting sql error code 17022. pls let me know how solve issue. full stack trace msg: connecting jdbc:oracle:thin:@(description=(address_list=(address=(protocol=tcp)(host=dlocdb04)(port=50000))(address=(protocol=tcp)(host=dlocdb04)(port=50000)))(connect_data=(service_name=os02rtdb01svc.world)(server=dedicated))) oracle jdbc driver version: 9.2.0.1.0 [cumulative retries=0] user_id: unknown level: warn date: 2015-09-21 10:51:45,563 category: com.retek.merch.utils.connectionpool msg: [sql error code: 17002, state: null] physical db connection invalid. restarting pool due following error. user_id: unknown java.sql.sqlexception: io exception: connection refused(description=(err=1153)(vsnnum=0)(error_stack=(error=(code=1153)(emfi=4)(args='(description=(address=(protocol=tcp)(host=dlocdb0401)(port=27320))(connect_data=(cid=(program=)(host=__jdbc__)(user=))null))'))(error=(code...

processing.js - Processing sketch on web: different behaviours on different computers, same browser -

i have 3 processing sketches on webpage (150.146.65.246). according computer open page, have different behaviours: on computer, once page opened sketches erroneously reinitialised again , again, if page continuously refreshed. on other computer, sketches correctly initialised once, when page opened. browsers tested firefox , chrome. i'm starting think dependes on browser settings, have idea?

java - Take values from a text file and put them in a array -

for in program using hard-coded values, want user can use text file , same result. import java.io.ioexception; import java.io.bufferedreader; import java.io.filereader; import java.io.file; public class a1_12177903 { public static void main(string [] args) throws ioexception { if (args[0] == null) { system.out.println("file not found"); } else { file file = new file(args[0]); filereader fr = new filereader(file); bufferedreader br = new bufferedreader(fr); string line = ""; while (br.ready()) { line += br.readline(); } string[] work = line.split(","); double[] doublearr = new double[work.length]; (int =0; < doublearr.length; i++) { doublearr[i] = double.parsedouble(work[i]); } double maxstartindex=0; double maxendindex=0; double maxsum = 0; double total = 0; double maxstartindexuntilnow = 0; (int currentindex = 0; cu...

php - How can I get array from GET request? -

i have trouble: have url of view: ?materials=1&materials=2&materials=3&materials=4&materials=5&materials=6 how can in array throw yii mechanism? yii::app()->request->getparam('materials') not working $_get['materials'] too not working url static , can not change this url created https://github.com/mikhus/jsurl plugin php automatically parses parameter array, if ends [] . (i.e. ?materials[]=1&materials[]=2&materials[]=3&materials[]=4&materials[]=5&materials[]=6 ) otherwise can parse query string manually solve issue. @ this

javascript - Count all checkboxes that are checked in the entire DOM even when they are not displayed with DataTable? -

i have table contains list of cities. every row has checkbox city class. although cities present in source code of page table show ten city @ time (because want so). in bottom of table there button shows next cities. i want know how many checkboxes checked. so, tried $('.city').length , function counts checkboxes present in table @ moment, , not checkboxes present in dom. (for example: in dom there 30 cities present, table shows 10 cities @ time. function above returns 10.) how can count checkboxes checked? update : using datatable, solved with: var nodes = $('#table').datatable().rows().nodes(); with rows of table. try this: $('input:checkbox:checked').length for city can following $('input:checkbox.city:checked')

java - Get info from logged in person Facebook Graph API -

how can information logged in person via graph api? i have looked @ graphrequest request = graphrequest.newmerequest , , seems straight forward. how friends? taggable friends? you can taggable friends below code if(accesstoken.getcurrentaccesstoken() != null) { graphrequest graphrequest = graphrequest.newgraphpathrequest( accesstoken.getcurrentaccesstoken(), "me/taggable_friends", new graphrequest.callback() { @override public void oncompleted(graphresponse graphresponse) { //your code if(graphresponse != null) { jsonobject jsonobject = graphresponse.getjsonobject(); string taggablefriendsjson = jsonobject.tostring(); gson gson = new gson(); taggablefriendswrapper taggablefriendswrapper=...

php - I face error in my IF ELSE -

i new in php. face problem in if else. if else statement not working. have 2 sql queries. in starting have simple query fetch client_id against opinion_id , store result of thi squery in variable $opinion_id after have sql query fetch opinion_id against client_id fetched previous query. my 3rd query if there no client_id against opinion_id with reference 1st query print record against that opinion_id` in if else have problem execute else part if client_id null or not. my remaining php code is $opinion = array(); while($row1 = mysql_fetch_assoc($result1)) { $opinion[]= $row1['opinion']; $action[]= $row1['atitle']; $long_term[]= $row1['ltitle']; $outlook[]= $row1['otitle']; $rating_type[]= $row1['ttitle']; $short_term[]= $row1['stitle']; } html code is <?php include ("connection.php"); include ("sqlquery.php"); ?> <!doctype html public "-//w3c...

java - Where is JAVA_HOME on OSX Sierra (10.12), El Capitan (10.11), Yosemite (10.10), Mavericks (10.9), Mountain Lion (10.8) or OSX Lion (10.7)? -

java optional package on latest versions of osx. yet once installed appears java_home environment variable not set properly . with java optional package or oracle jdk installed, adding 1 of following lines ~/.bash_profile file set environment variable accordingly. export java_home="$(/usr/libexec/java_home -v 1.6)" or export java_home="$(/usr/libexec/java_home -v 1.7)" or export java_home="$(/usr/libexec/java_home -v 1.8)" update: added -v flag based on jilles van gurp response .

python - Dataframe manipulation, something with groupby, probably :/ -

need dataframe transformation. have df = pd.dataframe({'c' : [1, 2, 1, 1, 2, 2, 1], 'd' : [1, 2, 13, 4, 5, 9, 10]}) df = df.sort('c') => c d 0 1 1 1 1 13 2 1 4 3 1 10 4 2 2 5 2 5 6 2 9 and get f1 f2 f3 f4 1 1 13 4 10 2 2 5 9 nan currently, loop on everything, on large dataframe, it's slow. thanks you adding new f column , calling pivot : >>> df["f"] = "f" + (df.groupby("c").cumcount() + 1).astype(str) >>> d2 = df.pivot(index="c", columns="f", values="d") >>> d2 f f1 f2 f3 f4 c 1 1 13 4 10 2 2 5 9 nan the f , c there index , column names; if want rid of set them none. >>> d2.index.name = none >>> d2.columns.name = none >>> d2 f1 f2 f3 f4 1 1 13 4 10 2 2...

c# - Group by for list in list -

i have list of issues : list<issue> issue class : public class issue : baseentity { private string m_keystring; [jsonproperty("expand")] public string expand { get; set; } [jsonproperty("id")] public int id { get; set; } #region special key solution [jsonproperty("key")] public string proxykey { { return key.tostring(); } set { m_keystring = value; } } [jsonignore] public issuekey key { { return issuekey.parse(m_keystring); } } #endregion special key solution [jsonproperty("fields")] public fields fields { get; set; } } class fields looks : public class fields { [jsonproperty("summary")] public string summary { get; set; } [jsonproperty("assignee")] public assignee assignee { get; set; } [jsonproperty("w...

Windows php error on first line with <? -

i have php script starts following line <?xml version="1.0" encoding="utf-8"?> it works fine in lamp world when port windows think thinks line code when it's not error in visual studio: syntax error: unexpected token 'version' is there way can windows php not consider code? thought code blocks had start <?php ? you can use header function of php render tag you. put @ first line of code: <? header("content-type: text/xml; charset=utf-8") ?> then won't have problems opening php tag.

Android app on Lollipop behaves differently from older versions -

i have developed , published app riddles. have problem lollipop devices, built , ran app on kitkat , jelly bean , works. when comes lollipop background drawable of main activity not set white. furthermore in settings activity customizedthumbs have no more color have set invisible , app crashes when starting slide activity , fragment backcard action. all points list work great on pre-lollipop versions: 1) background main activity: relativelayout.setbackgroundresource(arraybackground[backgroundchoice]); 2) thumbs switch set based on sharedpreferences: switchrisolti.setthumbresource(r.color.blue); 3) start slide activity intent intent = new intent(impostazioni.this, screenslideactivity.class); startactivity(intent);` 4) fragment flipcard: //load fragment fragmentmanager fragmentmanager = getfragmentmanager(); fragmenttransaction fragmenttransaction = fragmentmanager.begintransaction(); cardfrontfragment fragment = new cardfrontfragment(); fragmenttransac...

javascript - How to mock dependency classes for unit testing with mocha.js? -

given have 2 es6 classes. this class a: import b 'b'; class { somefunction(){ var dependency = new b(); dependency.dosomething(); } } and class b: class b{ dosomething(){ // } } i unit testing using mocha (with babel es6), chai , sinon, works great. how can provide mock class class b when testing class a? i want mock entire class b (or needed function, doesn't matter) class doesn't execute real code can provide testing functionality. this is, mocha test looks now: var = require('path/to/a.js'); describe("class a", () => { var instanceofa; beforeeach(() => { instanceofa = new a(); }); it('should call b', () => { instanceofa.somefunction(); // how test a.somefunction() without relying on b??? }); }); you can use sinonjs create stub prevent real function executed. for example, given class a: import b './b'; c...

ios - UITableViewCell dynamic height does not work with size classes -

Image
setting estimatedrowheight , rowheight of uitableview makes table view calculate proper height of each cell. works charm until use size classes. seems calculations being done any/any size class , bigger font applied later. result height of cell not calculated , label doesn't fit. here code: class viewcontroller: uiviewcontroller, uitableviewdelegate, uitableviewdatasource { @iboutlet weak var tableview: uitableview! override func viewdidload() { super.viewdidload() self.tableview.estimatedrowheight = 50 self.tableview.rowheight = uitableviewautomaticdimension } func tableview(tableview: uitableview, numberofrowsinsection section: int) -> int { return 3 } func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell { let cell = tableview.dequeuereusablecellwithidentifier("reuse", forindexpath: indexpath) as! mytableviewcell println("...