Posts

Showing posts from February, 2012

MySQL Select WHERE IN given order -

MySQL Select WHERE IN given order - i have like select * table id in (118,17,113,23,72); if returns rows in id ascending order. there way rows in order given in in statement? you should utilize "order field". so, instance: select * table id in (118,17,113,23,72) order field(id,118,17,113,23,72) mysql

vb.net - about datagridview -

vb.net - about datagridview - i have form want add together content of datagridview listbox every time double clik on cell of datagridview, store contents of listbox in database. please help. use cellclick event off datagridview, http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.cellclick.aspx then implement "system"(session or something) keeps track of clicks when amount of clicks = 2, add together cell value listbox , reset counter 0. when want storing of contents in listbox occure? vb.net

php - mysql: not able to retrieve data which is in between symbols -

php - mysql: not able to retrieve data which is in between <> symbols - am running sql query php retrieve info mysql database. works except that, if info contains symbols < , >, whatever info nowadays between these symbols doesnt show in output. for example, if info " <hello there> how you? " " how you? " shown. but when run query directly, shows me without missing anything. i have done before, cannot remember on top of head did. , google not helping me today, slow day me.... :( you should escape databse response using htmlentities() . $sql = 'select row_with_text your_table'; $query = mysql_query($sql); $result = mysql_fetch_array($query); echo htmlentities($result['row_with_text']); phpmyadmin escaping you, it's responsibility escape text html in application. php mysql

caching - how to find cpu cache size for a x86 processor -

caching - how to find cpu cache size for a x86 processor - i want find cpu cache size of l1 or l2 caches using x86 assembly language. heard cpuid , msr registers have scheme specific data. can 1 help me how can sizes please. here's minimal illustration of how you'd go finding out using cpuid instruction: #include <stdio.h> #include <limits.h> #define cpuid(id) __asm__( "cpuid" : "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx) : "a"(id), "b"(0), "c"(0), "d"(0)) #define b(val, base, end) ((val << (__wordsize-end-1)) >> (__wordsize-end+base-1)) int main(int argc, char **argv) { unsigned long eax, ebx, ecx, edx; cpuid(0); printf("identification: \"%.4s%.4s%.4s\"\n", (char *)&ebx, (char *)&edx, (char *)&ecx); printf("cpu information:\n"); cpuid(1); printf(" fam...

perl - ApplyForce and ApplyLinearImpulse in Box2D is not working -

perl - ApplyForce and ApplyLinearImpulse in Box2D is not working - i writing 2d platformer game in perl sdl , box2d, setlinearvelocity() function working can moving character left or right. when want create jump using applylinearimpulse() , not working, applyforce() not working too. character object remain there. my code : if ($key_name=~/w/){ $me->applylinearimpulse(box2d::b2vec2->new(0,20.0), $me->getworldcenter()); } i tried adding: $world->step(1.0/60.0,10,10); after it, stil no response. please help. oh found because should utilize getposition() rather getworldcenter() , forcefulness need much bigger lift object! perl sdl box2d game-physics

android - save view instance of fragment in backstack -

android - save view instance of fragment in backstack - i've read topic save instance state of fragment. think case different. example: have fragment a, b. have edit text. type text edit text add together fragment b backstack. then popbackstack fragment b => display. but edittext empty. here way fixed: private class myfragment extends fragment { private view rootview = null; @override public view oncreateview(layoutinflater inflater, @nullable viewgroup container, @nullable bundle savedinstancestate) { if (rootview != null) { ((windowmanager) rootview.getparent()).removeview(rootview); } else { view v = inflater.inflate(r.layout.my_layout, container, false); // find view layout. rootview = v; } homecoming rootview; } } it's auto maintain lastest state of fragment. but here question: does app spend much memory normal ? (because create new rootview save ins...

Can I use MS Visual Studio 2013 Community Edition for Excel Add-in development -

Can I use MS Visual Studio 2013 Community Edition for Excel Add-in development - i considering creating simple ribbon tab few options increment productivity @ work. far see msdn, can using ms visual studio, don't want purchase 1 (though keen share code open source project). do know if can using community edition of software or need professional edition @ least? answer yes, i.e can using community edition of visual studio. visual-studio excel-addins

oracle - No matching unique or primary key for this column-list: SQL -

oracle - No matching unique or primary key for this column-list: SQL - i working sql , running error ora-02270. sql> drop table employee; table dropped. sql> create table employee( age varchar(2), gender char(1), employee_no char(6), references worksite(employee_no), primary key(age, gender) ); table created. sql> create table employee_type( age varchar(2) references employee(age), gender char(1) references employee(gender), employee_type varchar(12), primary key (age, gender, employee_type) ); error @ line 3: ora-02270: no matching unique or primary key column-list. i have read other posts still dont understand error? thought might because have composite key reference columns of composite key. means says... in obscure way :-) in this page mysql doc says: you advised utilize foreign keys reference keys both unique (or primar...

jquery plugins - Textbox validtion is not working properly -

jquery plugins - Textbox validtion is not working properly - $("#deletesubscriberform").validate({ ignore: ':disabled', sucess: "valid", rules: { confirmationpwd: { required: true } }, messages: { confirmationpwd: { required: "password required" } } }); here deletesubscriberform id form tag, confirmationpwd out of textbox. have written validation code in document.ready function not working. jquery-plugins

scala - Is it possible to specify at the site of a Property definition how many times to execute the Property? -

scala - Is it possible to specify at the site of a Property definition how many times to execute the Property? - such this: class myspec extends specification scalacheck { def = s2""" mything should right way $x1 """ def x1 = prop(4 /*times*/) { (...) => ... } } } use setparameters , mintestsok : class myspec extends specification scalacheck { def = s2""" mything should right way $x1 """ def x1 = prop { (...) => ... }.set(mintestsok = 1) } } scala specs2 scalacheck

Joomla component - list view admin page - search is not working -

Joomla component - list view admin page - search is not working - in joomla 3.x component have list view admin page, added search tools: <div class="filter-search btn-group pull-left"> <label for="filter_search" class="element-invisible"><?php echo jtext::_('jsearch_filter');?></label> <input type="text" name="filter_search" id="filter_search" placeholder="<?php echo jtext::_('jsearch_filter'); ?>" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" title="<?php echo jtext::_('jsearch_filter'); ?>" /> </div> <div class="btn-group pull-left"> <button class="btn hastooltip" type="submit" title="<?php echo jtext::_('jsearch_filter_submit'); ?>"><i clas...

android - Textview changes on AVD but not on smartphone -

android - Textview changes on AVD but not on smartphone - i've made app in wich when press button clear textview command textv.settext("") but works on avd not on real smartphone utilize galaxy s4 version 5.0.1 code this..it's many imagebuttons 2 buttons , textview ..the onclick of textview @ end package com.fanis.math; import android.app.activity; import android.os.bundle; import android.view.view; import android.view.view.onclicklistener; import android.widget.button; import android.widget.imagebutton; import android.widget.textview; public class myresistance extends activity implements onclicklistener { view b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12; button bok, bclear; textview t; int k = -1; int[] ar = new int[4]; double n = 0; double multi=0; string nstring; @override protected void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); setcontentview(r.layout.resistance...

How to get a kernel thread ID? -

How to get a kernel thread ID? - when create kernel thread using kthread_run() , how can tid of thread, there pthread_self() or gettid() in kernel space? in kernel-space, don't need inquire thread in userspace calling gettid() -- have access task_struct of task: struct task_struct* tsk = kthread_run(...); pid_t tid = tsk->pid; // thread id of newly created task (if successful) linux-kernel

php - if(isset($_POST['submit'])){ } NOT WORKING on submit button -

php - if(isset($_POST['submit'])){ } NOT WORKING on submit button - i have problem when ever load page says form done when don't press submit here code - <?php $db_host = 'localhost'; $db_name = 'info';enter code here $db_user = 'root'; $db_password = ''; seek { $db = new pdo('mysql:host=' . $db_host . ';dbname=' . $db_name, $db_user, $db_password); echo "connected<br><br>"; } grab (pdoexception $e) { echo "error: " . $e->getmessage(); die(); } if(isset($_post['submit'])){ $name = $_post['name']; $phone = $_post['phone']; $email = $_post['email']; $info = $_post['info']; $date = $_post['date']; $sql = "insert info (name, phone, email, info, date)"; $sql .= " values (:name, :phone, :email, :info, :...

mysql - SQL Count Number of "Employees" With "Salary" -

mysql - SQL Count Number of "Employees" With "Salary" - i've got query i'd write. content of similar posting below: select id, name, position, salary, (select count(salary 's') employees s = salary) numberofemployeeswithsalary employees hire_date between '2013-01-01' , '2014-12-31' essentially, after ability sum number of employees particular, dynamically-defined salary (so able form percentage off it). i've wracked brain on google, dev.mysql, , trying find answer. i don't know if possible. may need separate out each "salary type" separate count query. so, instance, if info contains: salary ------ 30000 30000 30000 40000 40000 50000 i'd 3 30000, 2 40000, etc., intent of using result value in query grab percentage. select salary, count(*) numberofemployeeswithsalary employees hire_date between '2013-01-01' , '2014-12-31' grouping salary; try above query , ...

java - How to list all Google document from the Domain using Drive SDK? -

java - How to list all Google document from the Domain using Drive SDK? - i want list document google domain.i have tried per mention in google documentation : https://developers.google.com/drive/v2/reference/files/list#examples i have created service follow : httptransport httptransport = new nethttptransport(); jacksonfactory jsonfactory = new jacksonfactory(); googlecredential credential = new googlecredential.builder() .settransport(httptransport) .setjsonfactory(jsonfactory) .setserviceaccountid(service_account_email) .setserviceaccountscopes(arrays.aslist(drivescopes.drive)) .setserviceaccountuser(useremail) .setserviceaccountprivatekeyfromp12file( new java.io.file(service_account_pkcs12_file_path)) .build(); drive service = new drive.builder(httptransport, jsonfactory, null) .sethttprequestinitializer(credential).build(); files.list request = service.files().list(); when executing request follows : ...

dynamics crm - To restrict the multi entity lookup using javascript in MSCRM 2015 -

dynamics crm - To restrict the multi entity lookup using javascript in MSCRM 2015 - am trying restrict entities list in regarding object lookup in task entity. document.getelementbyid('regardingobjectid").getattribute("lookuptypenames") returning null in 2015 whereas in crm 2011 working fine. there way entity listed in multi entity lookup in crm 2015?. try use document.getelementbyid("regardingobjectid_i").getattribute("lookuptypenames") javascript dynamics-crm dynamics-crm-2015

url rewriting - Pass multiple URL parameters in Nginx rewrite -

url rewriting - Pass multiple URL parameters in Nginx rewrite - i'm trying redirect www.example.com/page www.example.com/something/some-stuff?foo=bar&foo2=bar2 in nginx can't seem properly. this have far: server { hear 80; server_name example.com www.example.com; homecoming ^/page /somepage/some-stuff?foo=bar&foo2=bar2 permanent; } what's wrong above server block? this worked! location /page { rewrite ^/page http://$http_host/somepage/some-stuff?foo=bar&foo2=bar2 redirect; } nginx url-rewriting rewrite server url-redirection

html - javascript how to zoom part of table cells area based on the selected cell -

html - javascript how to zoom part of table cells area based on the selected cell - how zoom part of table construction based on selected cell,the element within table cell can ,for illustration can span text in cell a2 or image in cell c3 eg. class="snippet-code-html lang-html prettyprint-override"> <table border=1> <tr style="height:10pt;"> <td>a1</td> <td><span>a2</span></td><td>a3</td><td>a4</td><td>a5</td></tr> <tr style="height:1pt;"><td>b1</td> <td>b2</td><td>b3</td><td>b4</td><td>b5</td></tr> <tr style="height:12pt;"><td>c1</td> <td>c2</td><td><img src=c3/></td><td>c4</td><td>c5</td></tr> <tr style="height:12pt;"><td>d1</td> <td>d2</td><t...

for loop - Swift for object in objects Xcode 6.3 '[AnyObject]?' does not have a member named 'Generator' -

for loop - Swift for object in objects Xcode 6.3 '[AnyObject]?' does not have a member named 'Generator' - xcode 6.3 '[anyobject]?' not have fellow member named 'generator' error line "for object2 in objects2{" allow findimage:pfquery = pfquery(classname: "_user") findimage.wherekey("objectid", containedin: self.userlist [anyobject]) findimage.findobjectsinbackgroundwithblock{ (objects2:[anyobject]?, error2:nserror?)->void in //var recordprofileimg:nsmutablearray = nsmutablearray() if !(error2 != nil){ object2 in objects2{ println(objects2.count) allow sweet:pfobject = object2 pfobject if sweet.objectforkey("profileimage") != nil{ var recordprofileimg:nsmutablearray = [sweet.objectid,sweet.objectf...

model view controller - ViewModel is posting back null -

model view controller - ViewModel is posting back null - ok, have view model not bound info object. building in steps , in page i'm binding viewmodel. however, want homecoming viewmodel in post can go on process. i've used typical viewmodel sample that's on codeproject.com, need have viewmodel posted because storing other info in there. created viewmodel in , send view, when submitted, viewmodel null. missing? help appreciated. i'm 3 weeks mvc. thanks. public class registrationchildviewmodel { public ienumerable<selectlistitem> children { get; set; } public ienumerable<string> selectedchildren { get; set; } public datetime selecteddate { get; set; } public string selectedroomkey { get; set; } } here controller (get , post) // assign - public actionresult selectchildren() { list<selectlistitem> listselectlistitem = new list<selectlistitem>(); datetime selecteddate = convert.todatetime(...

php - Yii2 assetManager appendTimestamp not working properly -

php - Yii2 assetManager appendTimestamp not working properly - i using appendtimestamp of assetmanager component 'assetmanager' => [ //append time stamps assets cache busting 'appendtimestamp' => true, ], 'cache' => [ 'class' => 'yii\caching\filecache', ], it correctly adds timestamp after each asset shown: <link href="/frontend/web/assets/7b3fec74/css/arabic.css?v=1428761706" rel="stylesheet"> however when create changes css file, timestamp not update. because of filecache? every time wish test new changes, need clear contents of web/assets folder am required delete contents of assets folder every time wish test new assets? the filecache component referred - has nil assets. responsible defined cache items : yii::$app->cache->set('key', 'value') yii::$app->cache->get('key') ... so there might problem...

ftp - How can I automatically rename, copy and delete files in linux for my ip camera webcam? -

ftp - How can I automatically rename, copy and delete files in linux for my ip camera webcam? - i have ip photographic camera automatically ftps images every few seconds directory on linux ubuntu server web server. i'd create simple webcam page references static image , refreshes every few seconds. problem ipcamera's firmware automatically names every file date_time.jpg type filename, , not have alternative overwrite same file name on , over. i'd have script running on linux machine automatically re-create new file has been ftp'd directory different directory, rename in process , delete original. regards, glen i made quick script, need uncomment rm -f line create delete things :) it prints command have run, can test higher confidence. you need set work_dir , dest_dir variables near top of script. #!/bin/bash ######################### # configure vars yyyymmdd=`date +%y%m%d` work_dir=/users/neil/linuxfn dest_dir=/users/neil/linuxfn/dest_dir...

ios - UITableView contentInset not updating when keyboard interactively dismissed -

ios - UITableView contentInset not updating when keyboard interactively dismissed - update i found in many refactorings inheriting uiviewcontroller instead of uitableviewcontroller , missing automatic behaviours uitableviewcontroller provides. however, still needed manually handle scroll views insets when keyboard beingness interactively dismissed. see updated answer. i trying emulate imessage in how keyboard dismissed when user drags bottom of screen. have working 1 little visual issue that's bugging me. as keyboard dragged off screen scroll indicators not resize correctly - until has been dismissed. i utilize keyboard notifications tell me when keyboard has appeared increment content , scroll insets height of keyboard. seems didn't need when keyboard has been dismissed insets appear right when has been. when dismissing interactively can't update insets during dragging event. to illustrate issue, first image shows content has scrolled off top of scre...

actionscript 3 - How to clear a text-field on focus with AS3? -

actionscript 3 - How to clear a text-field on focus with AS3? - the theme question sais all. i have input text-field on stage has text describing text in before user types anything. now, how clear text when user focuses on (clicks) field? listen focusevent.focus_in event on textfield , clear 1 time fires. http://www.adobe.com/livedocs/flash/9.0/actionscriptlangrefv3/flash/events/focusevent.html actionscript-3 textfield

Looking for 'HOLD' CLIST/REXX logic that can be executed from a TSO mainframe command line -

Looking for 'HOLD' CLIST/REXX logic that can be executed from a TSO mainframe command line - on ibm mainframes, i've been able type 'hold' on command line, press enter, , have new tso screen appear without losing original screen. go previous screen, i'd press f3. know can find clist/rexx code this? presuming when "tso" mean "ispf," there couple of ways new logical ispf screen in 3270 mode. one entering swap list command. pops window can request new logical screen. you can come in split new command. generates new logical screen , splits screen cursor located - unless have unchecked "always show split line" in settings. settings typically alternative 0 ispf main menu. all of covered in ispf user guide. if really looking write ispf dialog application these sorts of things, believe want familiarize ispexec apis. mainframe rexx clist tso

Using C function in another function -

Using C function in another function - i know has been answered, still can't work. first.c #include <stdio.h> #include "second.h" int main(void){ printf("%d\n", addone(5)); homecoming 0; } second.c int addone(int a){ homecoming ++a; } second.h int addone(int a); when run gcc -o executable first.c -wall shows me undefined reference addone #include <stdio.h> #include "second.h" include headers in second.c file , write makefile , compile make. makefile: cflags = -g -o -wall obj = first.o second.o # explicit rule required link. # compilation handled automatically. first: $(obj) $(cc) $(cflags) -o first $(obj) # declare both object files depend on header file. first.o second.o: second.h # conventionally 'make clean' removes 'make' creates. # not strictly required. .phony: clean clean: -rm -f first $(obj) you can't re-create , paste above; must alter both i...

python - One vs many return values on dynamic method calls? -

python - One vs many return values on dynamic method calls? - i'm accessing methods name using string : def blah(str) : method = getattr(self,str) x1, x2 = method() the problem method i'm using returns 1 argument instead of 2 , next error : typeerror: 'numpy.float64' object not iterable what cleanest way handle single vs. multiple homecoming values. thanks maybe this: result = method() try: x1, x2 = list(result) except typeerror: # "result" not iterable x1, x2 = [result, none] in python, it's easier inquire forgiveness permission note doesn't cover cases method returns list wrong number of elements (i.e. not two). for cases, might appropriate: result = method() try: result_list = list(result) except typeerror: # "result" not iterable result_list = [result] number_of_vars = 2 final_list = [none] * number_of_vars final_list[:min(number_of_vars, len(result_list))] = result_list[:num...

Macro to detect global scope -

Macro to detect global scope - from understand, mutual lisp has no global lexical scope, if want create global variable have utilize defvar instead of setq . programmer, i'm indignant having remember this. in believe in spirit of lisp, i'm trying create macro automatically. i'd write (= x 1) and have "just work" no matter am. imagine macro like (defmacro = (name value) `(,(if (is-global) 'defvar 'setf) ,name ,value)) how can write is-global ? introducing bindings from understand, mutual lisp has no global lexical scope, this part correct, there "typical" workarounds. there's no canonical implementation, searching deflexical can lead implementations. so if want to create a global variable have utilize defvar instead of setq. (emphasis added) this incorrect. part, don't create variables. introduce bindings environment. mutual way of doing let or arguments function. e.g.: (defun foo (b...

transpose - sqlite extract two row from two tables to create a new table -

transpose - sqlite extract two row from two tables to create a new table - i have sqlite db 2 table table1 ------------------------------ time | elevationa| elevationb| -----|-----------|-----------| t1 | ea1 | eb1  | t2 | ea2 | eb2 | table2 ------------------------------ time | temperat a| temperat b| -----|-----------|-----------| t1 | ta1 | tb1  | t2 | ta2 | tb2 | i searching "magic" command create table of parameter @ given time, e.g like: select where time=t1 table1 elev ,table2 as temp and result in table3 ------------ elev | temp | -----|----- | ea1 | ta1 | eb1 | tb1 | of course of study bash script prefer create view in sqlite more straightforwards , avoid duplicate data. thought welcome you can use: create table table3(elev,temp); insert table3(elev,temp) values((select time table1 time = t1),select time table2 time =t2)); these 2 select clauses must homecoming...

callback to Google Play from Facebook post made my Android app -

callback to Google Play from Facebook post made my Android app - i inquire little bit of help. developing native android application able post image using called 'android share extension'. works perfectly, , image appearing in user's timeline. i expecting name of application appear , redirect alternative google play when user (which not have app installed) clicks post. i think should utilize app link, cannot find out how implement this. currently, posting image this: uri myimagecontenturi = .... string myappid = "my app id"; intent shareintent = new intent(); shareintent.setaction(intent.action_send); shareintent.settype("image/*"); shareintent.putextra(intent.extra_stream, myimagecontenturi); shareintent.putextra("com.facebook.platform.extra.application_id", myappid); startactivityforresult(intent.createchooser(shareintent, "share"), myrequestid); what have link google play (or app if it's installed)? a...

forms - How to submit formRemote programatically in grails? -

forms - How to submit formRemote programatically in grails? - following formremote. <g:formremote id="searchform" name="searchform" url="[controller:'search', action:'show']" update="searchresultscontent"> <input type="text" name="keyword" value="${searchinput}"> <g:submitbutton name="searchbutton" value="search"/> i have tried using submit method submit form programatically e.g. document.searchform.submit(); there no error, results not same if submit button have been pressed. need mention controller , action somewhere call? forms grails submit

php - Is it access token facebook is static? -

php - Is it access token facebook is static? - i utilize open graph access fellow member register , login facebook business relationship in codeigniter, , have thought create automatic password access token every user, dont know access token facebook static or different every time user access other ip or something? thankyou the access token valid 2 months (if request extended token, otherwise few hours). remain same until user deletes app his/her business relationship or changes his/her password. need re-authenticate sending user fb 1 time again through app. ip address not matter. php facebook codeigniter

Get notified on clipboard change in swift -

Get notified on clipboard change in swift - is there clipboard alter event in swift? how can notified when clipboard changed in ios application thanks you can capture uipastedboardchangednotification described in link: https://developer.apple.com/library/ios/documentation/uikit/reference/uipasteboard_class/index.html#//apple_ref/c/data/uipasteboardchangednotification example: (impossible create code appeared correctly, i've pasted image. add notification didfinishlaunchingwithoptions call-back in appdelegate add function handle when uipastedboardchangednotification sent appdelegate swift clipboard

c - Enter the page in the loop with WebBrowser -

c - Enter the page in the loop with WebBrowser - i'm referring page command webbrowser.nagivat webbrowser sending first triggers webbrowser1_documentcompleted value method . webbrowser take worth goes lastly page . want wait while on every page public string[] search_bar = { "page1", "page2"}; public string[] page = { "http://page1.com/", "http://page2.net/"}; public string ara,secilen; public bool durum = false; private void webbrowser1_documentcompleted(object sender, webbrowserdocumentcompletedeventargs e) { if (!durum) { foreach (htmlelement kntrl in webbrowser1.document.all) { if (kntrl.name == "q") { break; } } foreach (htmlelement kntrl in webbrowser1.document.all) { if (kntrl.name == "btng") { kntrl.invokemember("click"); applicatio...

phpStorm can't find certificate for Wordpress SVN -

phpStorm can't find certificate for Wordpress SVN - i had first plugin approved wordpress repository, have empty repository @ svn.wordpress.org, every time seek commit phpstorm, asks me browse certificate , come in passphrase. have searched few hours , have not found anything. has 1 else succesffuly got phpstorm commit files wordpress svn repository? in advance. ok folks, figured out while back, forgot had posted here. so happening this: using display name login svn repository. on wp.org site used email(can utilize login name), svn utilize actual login, did not realize login different display name, had forgotten had changed display name years ago , grabbed real quick. wordpress svn certificate phpstorm

php - Javascript:: Convert JSON string post callback to pure javascript array -

php - Javascript:: Convert JSON string post callback to pure javascript array - i wrote php function check array duplicates. if array have no duplicates returned array json string otherwise print (as pure text) duplicate(/d) value(/s). my php function working perfectly. now want convert returned json string , utilize pure javascript array (off-course assuming there no duplicates). here hezi.php file: if($_server['request_method']==='post') { $gangina=array ( 'douplicatetesting', '1', '2', '3', 'douplicatetesting', '4', '3' ); function dupvalidator() { global $gangina; if(count($gangina)===count(array_unique($gangina))) { header('content-type: application/json'); echo json_encode($gangina); } else { header('content-type: text/...

Can you get the full count of result even when using limit clause with Neo4j -

Can you get the full count of result even when using limit clause with Neo4j - i'm limiting number of results performance reason, have query like match (a:part) homecoming limit 50 is possible total count of node label part in order display result represents 50 results out of x total records? but more expensive , not efficient has load/pull data. you can either (prob more efficient): match (a:part) count(*) c match (a:part) homecoming c,a limit 50 or match (a:part) count(*) c,collect(a)[0..50] parts unwind parts homecoming c,a limit 50 neo4j

ios - How to use reachabilityWithHostName in Swift? -

ios - How to use reachabilityWithHostName in Swift? - i'm trying utilize reachabilitywithhostname test server connection purpose of recognise whether "the server downwards or not reachable". however, there error: ' reachabilitywithhostname ' unavailable: utilize object construction ' reachability(hostname:) ' swift: allow _host = "www.google.com" nsstring var netreach: reachability = reachability.reachabilitywithhostname(_host) var netstatus: networkstatus = netreach.currentreachabilitystatus() if (netstatus.value==reachableviawifi.value) { } else if(netstatus.value==reachableviawwan.value) { } else { println("notreachable") } how can utilize function reachabilitywithhostname ? thanks help. use let _host = "www.google.com" nsstring var netreach: reachability = reachability(hostname:_host) ios swift reachability

Use Jade to dynamically fill a bootstrap caraousel. Some issues on iteration -

Use Jade to dynamically fill a bootstrap caraousel. Some issues on iteration - i trying create boostrap carousel using jade dynamically iterate through list of objects , display them in carousel. my first question possible. secondly how might go accomplishing it. here snippet of code trying generate list containing data-slide-to element of carousel : 10 - var n = 0 11 while n < newsarticles.length 12 if n == 0 13 li.active(data-target="#header-carousel",data-slide-to="n++") 14 else 15 li(data-target="#header-carousel",data-slide-to="n++") i know bad code failing , finding reference on how accomplish if possible. the error throwing is "unexpected text " pointing line 13 any advice appreciate. give thanks you time in advance , if there more info can provide helpful please allow me know. here total working illustration of dynamic carousel code: extends layout ...

c++ - How private inheritance allowed me to create object? -

c++ - How private inheritance allowed me to create object? - i have simple code, assume failed. i have privately inherit shield sealer , , shield not it's friend , still able create object of shield . class sealer { public: sealer() { cout<<"base constructor;"<<endl; } }; class shield : private sealer { public: void p() { cout<<"p gets called;"<<endl; } }; int main() { shield d; //success here d.p(); // here homecoming 0; } how possible? base of operations class constructor should not accessible. isn't it? i using visual studio 2012. class shield : private sealer means in sealer kept private within shield ; cannot seen outside shield or in classes derived it. it not magically go , create sealer 's constructor private shield cannot access it. point of private inheritance if kid class not access base of operations ...

iphone - Button does not respond to touches -

iphone - Button does not respond to touches - in app there background on top of window: uiimageview *mybg = [[uiimageview alloc] initwithimage:[uiimage imagenamed:@"bg_large.png"]]; [window addsubview:mybg]; then button in top of background: uibutton *infobutton = [[uibutton buttonwithtype:uibuttontypeinfolight] retain]; infobutton.frame = cgrectmake(280,420,20,20); [infobutton addtarget:self action:@selector(showinfopanel:) forcontrolevents:uicontroleventtouchupinside]; [window addsubview:infobutton]; [infobutton release]; then scrollview within navigation controller, added window on top: navcontroller = [[uinavigationcontroller alloc] init]; navcontroller.viewcontrollers = [[nsarray arraywithobject:dashboardviewcontroller] retain]; [navcontroller setnavigationbarhidden:yes]; myscrollview.opaque=no; myscrollview.backgroundcolor = [uicolor clearcolor]; dashboardviewcontroller.view.backgroundcolor = [uicolor clearcolor]; [window a...

java - trim whitespace from a string? -

java - trim whitespace from a string? - i writing function j2me application, don't have of more advanced / modern java classes available me. getting java.lang.arrayindexoutofboundsexception on this. so, apparently either doesn't way i've initialized newchars array, or i'm not doing correctly when calling system.arraycopy(). , advice appreciated! /* * remove leading , trailing spaces */ public static string trim(string str) { char[] chars = str.tochararray(); int len = chars.length; // leading while ( (len > 0 ) && ( chars[0] == ' ' ) ) { char[] newchars = new char[] {}; // initialize empty array system.arraycopy(chars, 1, newchars, 0, len - 1); chars = newchars; len = chars.length; } // todo: trailing homecoming chars.tostring(); } the simple way trim leading , trailing whitespace phone call string.trim() . if want trim leading , trailing spaces (rather leading , trailing...

nested - how to access fourth level gridview in asp.net c# -

nested - how to access fourth level gridview in asp.net c# - i have access "gvdepartments", "gvfuctions" & "gvsections" how can access "gvemployees"? c# code: protected void show_hide_employeesgrid(object sender, eventargs e) { imagebutton imgshowhide = (sender imagebutton); gridviewrow row = (imgshowhide.namingcontainer gridviewrow); if (imgshowhide.commandargument == "show") { row.findcontrol("pnlemployees").visible = true; imgshowhide.commandargument = "hide"; imgshowhide.imageurl = "~/images/minus.png"; string empid = (row.namingcontainer gridview).datakeys[row.rowindex].value.tostring(); gridview gvemployees = row.findcontrol("gvemployees") gridview; bindemployees(empid, gvemployees); //gvemployees. } else { row.findcontrol("pnlemployees").visible = fal...

What is the standard way to diagram a redis (key-value) data structure? -

What is the standard way to diagram a redis (key-value) data structure? - i working on creating redis (key-value) database, , want able alter diagram represents how info should stored. included in diagram want able distinguish info saved string of json, vs hash table, or set or ordered set. i tried writing in excel, much relational database, tried writing in json hard tell value of json string, , hashes. is there industry standard on how diagram this? edit: ended making own syntax, still know reply this. this syntax created myself: (and here sample redis construction of card game going make: http://pastebin.com/4arye4hq) key: = string #key: = hash $key: = set $$key: = sortedset this sublime syntax highlighting file used color code syntax (saved redis.yaml-tmlanguage ): # [packagedev] target_format: plist, ext: tmlanguage --- name: redis scopename: source.redis filetypes: [] uuid: 0033bdf9-cd9f-4147-bd2e-a9fed3d07e1e patterns: - include: '...

maven - Java - modular library project - how to? -

maven - Java - modular library project - how to? - i supposed deliver sdk in java company work for. have few years of java ee experience not much when comes develop api , sdk. the problem here, sdk available in .net c# , working fine. made myself. switching java nightmare. tried several solutions. failed, inconclusive due fact not progress. as title says, need develop java library has modules. internal modules. modules world out there not supposed see / utilize / modify. in c#, it's easy pie : create modules respective namespace, create classes , methods privates, expose 1 or more wrappers (bridges) entire assembly (project) internal "main module", through it's own public wrapper accessible world, can utilize tools provided within these internals modules. the keyword, here, internal. think it's pretty easy understand. let's take example. let's sdk consisting of 4 modules. the 1st module, main module, 1 public , exposed whole world. in ot...

java - How to get file resources of a JavaFX WebEngine -

java - How to get file resources of a JavaFX WebEngine - i pretty new javafx , i'm using code (https://docs.oracle.com/javafx/2/swing/simpleswingbrowser.java.htm) implement simple web view javafx. i'm not able files (html, css, images, javascript files, cookies, , on) create web page. how can access files, can work them? you can load html using next methods. js , css , other files linked in html loaded along it. webengine.load(getclass().getresource("/location/to-your-file.html").toexternalform()); if have file in local drive, can use: string url = new url("file:///" + ""/location/to-your-file.html").toexternalform(); webengine.load(url); java javafx-2 javafx-webengine

msbuild - Specify build directory name -

msbuild - Specify build directory name - i need project built folder: \bin\debug 1.0.3.4 where 1.0.3.4 current building assembly version specified in assembly: assemblyversion attribute. tried using different variables $(assemblyversion) , getassemblyidentity task had no luck.. i'm not @ using msbuild. a quick , dirty solution to, after build, utilize getassemblyidentity extract version info , move $(targetfile) appropriate directory. this assumes don't have dependencies going on. otherwise, you'll need modify $(targetpath) , $(targetname) , , $(targetext) or go "proper" way of doing - modifying $(outputpath) dynamically. <target name="afterbuild" aftertargets="build"> <getassemblyidentity assemblyfiles="$(targetpath)"> <output taskparameter="assemblies" itemname="assemblyidentity"/> </getassemblyidentity> <propertygroup> <ver...

Ruby gem simple_form 3.1.0 radio button -

Ruby gem simple_form 3.1.0 radio button - i utilize simple_form displaying radio button boolean attribute <%= simple_form_for @model |f| %> <%= f.input :is_deleted, as: :radio_buttons %> <% end %> but instead of 2 radio buttons yes/no titles see titles yes/no , no radio buttons. what's wrong? edit try this: <%= simple_form_for @model |f| %> <%= f.input :is_deleted, as: :radio_buttons, :collection => [[true, 'yes'], [false, 'no']] %> <% end %> obviously can substitute whatever values want display "yes" , "no" ruby-on-rails ruby radio-button simple-form

python - Django showing error (A server error occurred. Please contact the administrator.) when trying to access the local server (127.0.0.1:800) -

python - Django showing error (A server error occurred. Please contact the administrator.) when trying to access the local server (127.0.0.1:800) - i totally new this. running version 1.8 of django. error shows in console is: f:\django\mysite>python manage.py runserver performing scheme checks... system check identified no issues (0 silenced). apr 10, 2015 - 19:09:15 django version 1.8, using settings 'mysite.settings' starting development server @ http://127.0.0.1:8000/ quit server ctrl-break. traceback (most recent phone call last): file "c:\program files (x86)\python 3.5\lib\site-packages\django\core\handlers \base.py", line 119, in get_response resolver_match = resolver.resolve(request.path_info) file "c:\program files (x86)\python 3.5\lib\site-packages\django\core\urlresol vers.py", line 388, in resolve raise resolver404({'tried': tried, 'path': new_path}) django.core.urlresolvers.resolver404: {'trie...

java - Android: Share a background thread between activities using onBind Service -

java - Android: Share a background thread between activities using onBind Service - guys having problem implementing this. have server running in python. simple messaging protocol. way app connects server using 1 class takes reference activity in order update .this activity's thread. that's good, want have multiple activities, every time open activity , phone call server class, start new thread create socket. i read , think need implement bound service. have followed bound service documentation , have implemented localbinder, when connection doesn't start thread. i don't understand should run thread same 1 through of activities ? see code below start in onstartcommand, guess isn't right ? public class serverservice extends service { private final ibinder binder = new localbinder(); private static final string tag = "serverservice"; private static final int buffer_size = 2048; private socket socket; private static final int serverpo...

java - Put and get a map from Libgdx preferences -

java - Put and get a map from Libgdx preferences - hey i'm having problems getting info preferences file in libgdx. set map in coords can position stuff, when map preferences file (which gets entire file, not map set in) , can't read coords set in. can keys map no problem, when seek access value map runtime error java.lang.string cannot cast. i've tried different values vector2, , float[] same error heres code: public class setsettings { private actor actor; private actor hit; private sprite sprite; private sprite sprite2; private rectangle rect; private boolean customhit = false; private shaperenderer render = new shaperenderer(); array<actor> actors = gamescreen.buttons.stage.getactors(); public setsettings() { setoriginal(); setcustom(); rect = new rectangle(); } public void setoriginal() { learngame.ass.settings.get().clear(); float height = gdx.graphics.getheight(); float width = gdx.graphics.getwidth(); // ui settin...

django - update a queryset in a specific order -

django - update a queryset in a specific order - i have "index" field stores consequent range of integers, safety set unique. now want increment field one, maintain unique update value in descending order: mymodel.objects.all().order_by('-index').update(index=f('index')+1) what surprises me on machine integrityerror gets raised , complains duplicated index value. is there missed? save records 1 one? thanks in advance! update: i think root problem there no order in sql update command (see update order by, , sql server: update table using order by) obviously django translates statement sql update order_by, leads undefined behavior , creates different result per machine. you ordering queryset ascending. can create descending adding '-' field name in order by: mymodel.objects.all().order_by('-index').update(index=f('index')+1) django docs order_by django order django-queryset

javascript - Any significant reasons not to use AJAX? -

javascript - Any significant reasons not to use AJAX? - i'm planning on making web app quite ajax heavy. before do, i'm wondering people think of such sites. there important reasons not this? btw, no need mention seo reasons. also, think benefits create fact people without javascript have limited experience (though i'm open beingness convinced otherwise). it depends on how plan utilize it, imo. 1) if site absolutely fail without it, excluding users scripting disabled. think fair in many scenarios limit but not remove functionality no-script users (for example, google doesn't autocomplete searches if have scripting disabled; can't...but basic search still works). 2) right techniques need used in right place. example, asp.net updatepanel perform horribly if dump thousands of elements it. 3) becoming bigger , bigger fan of content loaded in little blocks on page not require total refresh nor require whole page executed again. lends soa nic...

html - css arrow of active LI with body image background? -

html - css arrow of active LI with body image background? - my objective hide line below triangle have outcome _____^_____ on active menu. there similar questions here @ stackoverflow solutions doesn't fixed issue have. pls help me play it. thanks! fiddle here. class="snippet-code-css lang-css prettyprint-override"> body { background: #1abc9c url(//dmypbau5frl9g.cloudfront.net/assets/homepage/banner--themeforest-342995208860d6c90b98134db089ef84.jpg); } ul { width:100%; border-bottom:3px solid reddish } li { display:inline-block;padding:20px; } li { display:block;position:relative; } li.active a:after { content:""; width:15px; height:15px; position:absolute; top:100%; left:0; right:0; margin:12px auto 0; border:solid red; border-width:3px 3px 0 0; -moz-transform:rotate(315deg); -webkit-transform:rotate(315deg); -ms-transform:rotate(315deg); }...

php - Larvel5 Global $config var - fetched form db? -

php - Larvel5 Global $config var - fetched form db? - i have config table holds lots of configuration values, how can create static helper/class available globally on laravel? for example, have view input: <input type="text" value="<?= settingshelper::getvalue('my-settings-key'); ?>" /> and off course of study don't want query each time it, 1 query gets configuration values. any ideas? you can create this, class settinghelper { protected $items; public function get($key, $default = null) { if ( empty($this->items)) { $this->loadsettingdata(); } if ( array_key_exists($key, $this->items) ) { homecoming $this->items[$key]; } homecoming value($default); } protected function loadsettingdata() { $this->items = setting::all()->lists('key', 'value'); } } need bind cla...

selenium webdriver - passing element id as parameter in appium -

selenium webdriver - passing element id as parameter in appium - i new appium , trying android hybrid app testing java. possible pass xyz in below illustration parameter method , how it? eg: dr.findelementbyandroiduiautomator("uiselector().text(xyz)").click(); also please point me out articles related topic. yes, if want pass text field can utilize method sendkeys(); that. selenium-webdriver appium android-testing

javascript - How reverse animations made with scrollTop(); -

javascript - How reverse animations made with scrollTop(); - function firstanimation() { $('.etc(1)').fadein(); } function secondanimation() { $('.etc(1)').fadeout(); $('.etc(2)').fadein(); } function thirdanimation() { $('.etc(2)').fadeout(); $('.etc(3)').fadein(); } function fourthanimation() { $('.etc(3)').fadeout(); $('.etc(4)').fadein(); } $(window).scroll(function() { if ($(this).scrolltop() > 150) { firstanimation(); } if ($(this).scrolltop() > 300) { secondanimation(); } if ($(this).scrolltop() > 450) { thirdanimation(); } if ($(this).scrolltop() > 600) { fourthanimation(); } }); guys, i'm using scrolltop() animate piece of site, , wondering if can reverse animation if o scroll bottom, , not top. i searching there isn't scrollbottom in jquery. first, set additional requirement each if statement status each event scroll range prevent ...