Posts

Showing posts from January, 2015

javascript - How Show "No record found" or "No Data Found" message in jeasyui datagrid when the grid has no rows -

is there method set emptymessage in easy-ui datagrid showing text "no data found" when datagrid empty. use footer rows. when returning json server, if record count 0, frame footer row "no records found". refer http://www.jeasyui.com/demo/main/index.php?plugin=datagrid&theme=default&dir=ltr&pitem=

r - Can ff object do this ff_object %in% ff_object? -

i have 2 ff objects , b (from package ff ), integer list has 1656644 rows while b hase 202897 rows want vector c <- %in% b but c = logical(0) is there way %in% operations fast 2 ff objects use match() , %in% binary version of match() .

Why does Java allow to assign a string literal to a String object? -

string class in java. while declaring , assigning string, correct string name = "paul" though instantiate object java class string name = new string(); taking name object, i'm wondering why can assign series of characters "paul" object. under concept 1 works , how it? that's because implicitly strings - "..." treated objects well. under cover jvm looks similar "objects" in called string pool , if finds there returns object (instead of creating new one) otherwise creates new object , puts string pool. this memory efficiency, , "paul" new string("paul") not same. this possible because know, strings immutable in java. you can read more behavior search keyword "string pool".

get file content and assign to property in Phing -

is there way file content , assign property phing? an equivalent ant: <project name="foobar" default="foo"> <target name="foo"> <loadfile property="foo.bar" srcfile="foobar/moo.txt"/> <echo>${foo.bar}</echo> </target> </project> ? doesn't loadfile task you're after?

asp.net - CutyCapt not able to generate HTTPS web site screenshot when launched from w3wp.exe -

i have updated latest code svn , complie cutycapt qt sdk 4.8. , have static-linked libeay32.dll / ssleay32.dll in same location of binary. it works fine if launch cutycapt process in command window. it works fine if launch cutycapt process asp.net (w3wp) capture http web page. it not work if launch cutycapt process asp.net (w3wp) capture https web page, generates blank image. i doubted because libeay32.dll / ssleay32.dll dependencies not loaded, copied these 2 dll system32 / syswow64 , not resolve problem. monitor process processmonitor, shows me libeay32.dll / ssleay32.dll loaded successfully. so, dependencies not reason. here c# code launch cutycapt, using (process process = new process()) { process.startinfo.filename = ti.exefile; process.startinfo.errordialog = false; process.startinfo.createnowindow = true; process.startinfo.windowstyle = processwindowstyle.hidden; process.startinfo.workingdirectory = path.getdirectoryname(ti.exefile); pr

php - Base64 encoded string saves incorrectly to MySQL -

i'm struggling several hours on issue. i have long string. value base64_encoded json data. when i'm doing var_dump or saving string mysql gets cut off. saves correctly file. this output saved file. (correct) http://pastebin.com/brr9a271 this data saved mysql blob field. (cutted). same appears when var_dump http://pastebin.com/u1xnanub what missing? can php bug? your file has 86kib, blob column maximum length of 65,535. use mediumblob . from documentation : type | maximum length -----------+------------------------------------- tinyblob | 255 (2 8 −1) bytes blob | 65,535 (2 16 −1) bytes = 64 kib mediumblob | 16,777,215 (2 24 −1) bytes = 16 mib longblob | 4,294,967,295 (2 32 −1) bytes = 4 gib

php native functions like min() do not support fixed arrays -

i wondering why native php function min($array) not support spl fixed arrays . okay gettype object, still contains array data. there many useful php functions arrays, in order use them have use method $fx_array->toarray() . whenever decide use fixed arrays have think.. need use toarray() ? as splfixedarray implements iterator , easy extend class itself: class splfixedarrayonsteroids extends splfixedarray { public function min(){ $min = $this[0]; foreach($this $value) { if($value < $min) $min = $value; } return $min; } } ok know less portable , all, welcome php.

c++ - Cross compile on Fedora 18 for Centos 6.4 -

i working on project, uses classes c++11 standard, on fedora 18 machine , want deploy on centos 6.4 server. i able resolve loader errors except libc , libc++ versions, glibc_2.11, glibcxx_3.4.15 , on fedora machine glibc_2.14 , @ least glibcxx_3.4.17 respectively. is possible tell compiler compile/link server versions or older compatible versions of libraries? when run ldd executable ./executable: /lib64/libc.so.6: version `glibc_2.14' not found (required ./executable) ./executable: /usr/lib64/libstdc++.so.6: version `glibcxx_3.4.15' not found (required ./executable) thanks in advance! instead of manually copying libraries separate directory set chroot contaiing centos build env, using mock , epel-6-x86_64 config. use yum in mock chroot install packages want (e.g. qt) , build in there, ensure code uses centos 6 libs installed in chroot, not rest of packages on fedora os. update: when i'm using mock chroot building gcc this: # need these s

java - Concurrent HTTP Session is returning wrong user -

i experiencing quite weird problem. when 2 users logging @ exact same time, 1 of them detected other. locale = new locale(getlocale(request).getlanguage(), getlocale(request).getcountry()); strremoteuser = webtools.getuseridwithoutdomainname(request.getremoteuser()).touppercase(); logger.info("[myapp] user " + strremoteuser + " logging in"); logger.info("[myapp] creating session : " + strremoteuser); httpsession session = request.getsession(false); if (session != null) { session.invalidate(); session = request.getsession(); } logger.info("[myapp] user in session : " + strremoteuser); what following. let's assume 2 users (usr001 , usr002) logging application @ same exact time. located in different location. logs: 2013-05-14 08:19:38,550 info [com.myapp.action.common.loginaction] [myapp] user usr001 logging in 2013-05-14 08:19:38,551 info [com.myapp.ac

json - Google spreadsheed API with Sencha Touch Ext.List -

i using sencha touch 2.1 build mobile app. trying load google spreadsheet datasource list. i have made google spreadsheet public can find @ link: https://docs.google.com/spreadsheet/pub?key=0ahw0xtl9j2badhlwre1qce1wddvla2drddbxntjbv0e&output=html however not able working. here code have far: the model ext.define('myapp.model.infolist', { extend: 'ext.data.model', config: { fields: [ 'title', 'description', 'icon' ], idproperty: '_id' } }); the store ext.define('myapp.store.infolist', { extend : 'ext.data.store', config : { model : 'myapp.model.infolist', proxy: { type: 'jsonp', url : 'https://spreadsheets.google.com/feeds/list/0ahw0xtl9j2badhlwre1qce1wddvla2drddbxntjbv0e/od6/public/basic?alt=json-in-script', reader: { type: 'json', root:

java - SAXParser: handle only specific parent childs -

i have xml structure <data> <id>id</id> <title>datatitle</title> <entry> <title>title1</title> </entry> <entry> <title>title2</title> </entry> </data> and want parse , save in list title elements under entry. how can check in endelement title under entry? not have nullpointerexpception because parser tries save title data child. @override public void startelement(string uri, string localname, string qname, attributes attributes) throws saxexception { elementon = true; if ("entry".equals(localname)) { song = new song(); } } @override public void endelement(string uri, string localname, string qname) throws saxexception { elementon = false; if ("title".equalsignorecase(localname)) { song.settitle(elementvalue); } else if ("entry".equalsignorecase(localname)) { songlist.add(song); }

javascript - Relation between Ecmascript and the window object -

i know window object current browser has offer far functionality concerned. but how ecmascript related this? how included in browser, , how know browser loads version of ecmascript? for example, here ecmascript 5 object properties. how supposed know if it's supported in current browser instance? you can resort feature testing e.g. var preventextensionsupport = !!object.preventextensions; var ownpropertydescriptorsupport = !!object.getownpropertydescriptor

c# - Unity3d font with strikethrough -

is there way have strikethrough/linethrough ( example ) font in guitext ? i have searched on , can't seem find anywhere. it doesn't seem possible standard guitext feature of unity3d. might want consider gl lines or assets.

javascript - Thingiview and Three.js script conflict -

i have problem three.js , thingiview.js (that come three.js). have conflict 2 libraries/scripts. (i think three.js , three.min.js files). here can have 50% of scripts :s what want showing scene thingiview , calculate boundingbox three.js. i hope know solution kind of conflict. have passed day on :( here code call: <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/cfinstall.min.js"></script> <script src="thingview/javascripts/three.js"></script> <script src="thingview/javascripts/thingiview.js"></script> <script> var modele = document.getelementbyid('modele3d').value; window.onload = function() { // may want place these lines inside onload handler cfinstall.check({ mode: "inline", // default node: "prompt" }); thingiurlbase = ""; thingiview = new thingiview("vi

actionscript 3 - TypeError: Error #1009: Cannot access a property or method of a null object reference. This code works most of time but a few times generate errors -

i stuck last 2 days; no sleep @ due stupid error. same code runs , generates error, trace it; works , not. pasting whole cs3 code. please guide me. these 2 lines generating errors are 64: if(movieclip(charvector[i]).visible==true)updateobjectposition(charvector[i],charpoints[i]); , 110: textfield(txtscoregot.getchildbyname("txtscorehit")).text=e1.tostring(); var lastx:int=stage.mousex; var totallives:int=3; var totalallowedlives:int=3; var timercounter:int=0 var currentobjectsfalling:int=0; var score:int=0; var speed:int=4; var charvector:array=new array(point5, point6, point9, point10, point15, point20, rocket, speedbreaker, life, poison); var charpoints:array=new array(5,6,9,10,15,20,0,3,50,-20) for(var i:int=0; i<=9;i++) movieclip(charvector[i]).visible=false; stop(); btnplayagain.visible=false; btnplayagain.addeventlistener(mouseevent.click, mybuttonclick); txtscoregot.visible=false; function mybuttonclick(ev:mouseevent):void { gotoandstop(2); ev.upd

php - phpseclib Warning: unpack() [function.unpack]: Type C: not enough inpu -

some sftp credential works fine below open source, credential throwing below error. root cause below error, saw threads posted workouts, solutions not worked me. why getting below error, solution. open source: phpseclib error: bellow error warning: unpack() [function.unpack]: type c: not enough input, need 1, have 0 in \net\ssh2.php on line 1469 warning: extract() expects parameter 1 array, boolean given in \net\ssh2.php on line 1469 https://github.com/phpseclib/phpseclib/blob/master/phpseclib/net/ssh2.php#l1538 what on line 1469? version linked has on line 1469: while ($this->decrypt_block_size > strlen($iv)) { your link line 1538, this: break; if post 3 lines before , after, too, that'd great. thanks!

c# - Cannot create default converter when dll is in a different folder -

i created typeconverter in assembly a.dll. wpf app. works fine when a.dll file in same folder app. when a.dll file in folder (a sub folder), got following error : system.windows.data error: 1 : cannot create default converter perform 'two-way' conversions between types 'system.nullable`1[ekey]' , 'ekeyid'. consider using converter property of binding. bindingexpression:path=clientkey; dataitem='mitem' (hashcode=25260709); target element 'selector' (name='this'); target property 'selectedkey' (type 'keyid') i don't understand problem ? have lot of other dll files in sub folder loaded correctly. in advance help.

objective c - Searching For Closest float values in an array -

i have problem trying pick closest float value out of array. here example data; the numbers dealing share mirroring characteristic. {-9,-3,-1,0,1,3,9} if search -8.8 expect returned -9. if searched 8.8 expect returned 9. in past when searching arrays closest values go through array keeping track of absolute value each array element minus value wanted. smallest value win. that method presents problem here me tho because @ least 2 numbers in array "closest" (in above example 9 & -9) your array sorted, binary search should amenable reduce candidate set 2 array values @ max. can conceive of 1 challenge arise if original array contains floats of differ less machine precision. how deal best situation depend on application (if isn't esoteric in first place); note values indistinguishable test value form contiguous subsequence in array, heuristic might pick middle element of subsequence.

android - Combine EditText, TextView and Preference -

is possible view contained block textview, editext , second block contains preferencescreen (checkbox, list, chexbox etc...) what want do, somethink this. first block has 2 edittext , 2 textview title, , message. in second block (at botttom) want configure stoof. please how can make it. want bottom block list view. when make hover on each item want item listview item i tried this, not work! defined inflated class public static class in myactivity class. doing wrong? <?xml version="1.0" encoding="utf-8"?> <framelayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/framelayout1" android:layout_width="fill_parent" android:layout_height="fill_parent"> <scrollview android:layout_width="fill_parent" android:layout_height="wrap_content"> <linearlayout android:layout_width="match_parent"

html - Runnning javascript for dropdown on page load? -

i have js function controls appearnace of select element upon change. however, 1 thing need code run start when element loads selected options class should have been applied. css: select {height: 50px; width: 80px; border: solid 1px #c8c8c8; color:rgba(0, 0, 0, 0);} select:focus, #select:focus { color:black; } .lightgrey {background: lightgrey} .green {background:green} .orange {background:orange} .yellow {background:yellow} .red {background:red} .purple {background:purple} javascript: function colourfunction(select) { var colour = select.options[select.selectedindex].classname; select.classname = colour; select.blur(); } select: <select class="selectelement" runat="server" id="dropdown_" onchange="colourfunction(this)"> <option selected="selected" class="lightgrey" value="n">n</option> <option class="g

linux - Issue with unix sort -

this more of doubt question. so have input file this: $ cat test class||sw sw-explr bot|results|id,23,0a522b36-556f-4116-b485-adcf132b6cad,20130325,/html/body/div/div[3]/div[2]/div[2]/div[3]/div/div/div/div/div/div[2]/div/div/ul/li[4]/div/img class||sw sw-explr bot|results|id,40,30cefa2c-6ebf-485e-b49c-3a612fe3fd73,20130323,/html/body/div/div[3]/div[2]/div[3]/div[3]/div/div/div/div/div[3]/div/div/ul/li[8]/div/img class||sw sw-explr bot|results|id,3,72805487-72c3-4173-947f-e5abed6ea1e4,20130324,/html/body/div/div[3]/div[2]/div[2]/div[2]/div/div/div/div/div/div[3]/div/div/div[2]/ul/li[20]/div/img kind of defining element in html page. comma separated 5 columns can considered. i want sort file respect second column, i.e. columns having 23,40,3. i not sure why unix sort isn't working. these queries tried, surprisingly none gave me desired result. cat test | sort -nt',' -k2 cat test | sort -n -t, -k2 cat test | sort -n -t$',' -k2 cat test | sort -

testing - UI automation in windows phone 8 application -

Image
i have searched automating ui in windows phone 8 applications , did not useful tool or framework there framework automate ui application in windows phone 8? you can use winium. why winium? you have selenium webdriver testing of web apps, appium for testing of ios , android apps. , have selenium-based tools testing of windows apps too. of benefits? said appium: you can write tests favorite dev tools using webdriver-compatible language such java, objective-c, javascript node.js (in promise, callback or generator flavors), php, python, ruby, c#, clojure , or perl selenium webdriver api , language-specific client libraries. you can use testing framework. how works? winium.storeapps consists of 2 essential parts: winium.storeapps.driver implements selenium remote webdriver , listens jsonwireprotocol commands. responsible launching emulator, deploying aut, simulating input, forwarding commands winium.storeapps.inn

java - Spreading array of objects to the list of arguments -

i want spread array of objects this: int size = 3; /* sample size */ object[] arrayofobjects = new object[size]; /* initialize array objects */ and using magical method, on output: object obj1, object obj2, object obj3 i need kind of output, because need use method allows list of arguments. ps. api provides addall method, type of argument is: iterable <some_type> don't understand. addall method "iterates" on collection , adds elements datastructure. iterable, iterable, creates datastructure called iterator allows iterate on datastructure yourself. object[] arrayofobjects = new object[size]; collection<object> mynewcollection = new arraylist<object>(); // use addall mynewcollection.addall(arrayofobjects); // use iterator iterator<object> iter = mynewcollection.iterator(); while(iter.hasnext()){ object object = iter.next(); // object }

powershell - How do I get specific properties with Get-AdUser -

i have following ps script written: get-aduser -filter * -searchbase 'ou=users & computers, dc=aaaaaaa, dc=com' -properties displayname | export-csv "adusers.csv" from can tell should returning displayname. it's returning though. problem distinguishedname causing truncation problems later on in process. how can script return properties? using select-object expample: get-aduser -filter * -searchbase 'ou=users & computers, dc=aaaaaaa, dc=com' -properties displayname | select -expand displayname | export-csv "adusers.csv"

different categories of false file path java -

i making program read data excel file , store them in mysql database. in program user give path of file use. code doing below. string strfullpath = ""; scanner scanner = new scanner(system. in ); system.out.println("please enter fullpath of file"); strfullpath = scanner.nextline(); string file = strfullpath.substring(strfullpath.lastindexof('/') + 1); system.out.println(file.substring(0, file.indexof('.'))); @suppresswarnings("unused") string filename = strfullpath.substring(strfullpath.lastindexof('\\') + 1); system.out.println(filename); string[] parts = filename.split("\\."); then user when gives full path in console have options of making mistake. example if write file there not in folder or if write special caracter not recognized or example if write path in not appropriate way. how give these command in java? how user understand type wrong? you should make validation loop: while (true) {

asp.net mvc - Why would SSRS allow access some times, but not others? -

i have ssrs server set use basic authentication - using username , password. when visit web management interface ( https://alpha.myserver.com/reports ) username/password dialog, enter username , password set up, , system gives me access. likewise, if visit web services url ( https://alpha.myserver.com/reportservice ) same login dialog, , system give me access. now strange embedding report viewer control mvc app. app has configured credentials sent along requests. app uses web service url things (get list of reports, folders, etc.) , 'display' urls displaying reports. when run application locally on dev machine, configured talk remote ssrs server, works fine. yesterday did first deployment of app test server , getting '401 not authorized' response code when make web services call list reports. don't understand why in same cases credentials work , in other cases don't. have double , triple-checked using same domain, username, , password in each case.

networking - How to link multiple iTunes Clients to one Mediaserver -

i have multiple clients (older macminis osx snow leopart on it), in same network server (new macmini osx mountain). have them same library, worked share local network option. but run djay app on (to pitch music), works local media far know. is there possibility solve problem? thought mounting media folder on startup, , symlink data media folder, users on thin clients mustn't allowed change data, i'm not quite sure if works. thanks help! it simpler thought: i changed media directory under settings > advanced servers media directory. causes djay app use data, works fine. there may strange effets if 2 persons alter same playlist, since dicovered no further problems.

How to get two drop downs to a single field in drupal? -

how 2 drop downs single field? example, time field 1 drop down hours(0-23) , other minutes(0-59). if have custom module you're using on drupal 7 site, can include implementation of hook_form_alter makes transformation you. (see http://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_form_alter/7 detailed explanation of hook.) basically, want hook form you're trying alter (perhaps testing $form_id in if clause make sure matches form want alter) , create 2 new fields hours , minutes, while hiding built-in field shows time you're trying store. here's example: function mymodule_form_alter(&$form, &$form_state, $form_id) { if ($form_id == 'my_form_id') { $form['original_time_field']['#type'] = 'hidden'; $hours = array(); ($digit = 0; $digit < 24; $digit++) { $hours[$digit] = $digit; } $minutes = array(); ($digit = 0; $digit < 60; $digit++) { $minutes[

ruby on rails - How do I create instance variables from an array? -

i'm using rails 3.2. here's code: transports = %w(car bike) transports.each |transport| @transport = transport.classify.all end that code not working, want results be: @cars = car.all @bikes = bike.all how do that? transports.each |transport| instance_variable_set("@#{transport}", transport.classify.constantize.all) end update given entries in transports array singular correct code result want is transports.each |transport| instance_variable_set("@#{transport.pluralize}", transport.classify.constantize.all) end

.net - How to use List<int> as SQL parameter in C# -

this question has answer here: where in (array of ids) 9 answers i trying use list< int> sql parameter using code: var listid= new list<int>() { 1, 2, 3, 4, 5, 6, 7, 8, 9 }; using (var sqlconnection = new sqlconnection(_connectionstring)) { using (var cmd = new sqlcommand()) { cmd.connection = sqlconnection; cmd.commandtext = "delete mytable tableid in ( @tableid)"; string param = string.join(",", listid.toarray()); cmd.parameters.add("@tableid", param); sqlconnection.open(); cmd.executenonquery(); } sqlconnection.close(); } the problem is, code generate: exec sp_executesql n'delete mytable tableid in ( @tableid)',n'@tableid nvarchar(1

python - What could make celery worker becoming unresponsive after a few tasks? -

my workers stopping after few (<50) tasks. i have simple client/worker setup. client post task via func.delay(...) enter while loop wait completion of tasks (i.e checking ready() method of asyncresult ). use rabbitmq broker , result backend. the setup works...for while. after few tasks, client doesn't receive , worker seems idle (there not output in console anymore). (the machine work on bit old resource problem not impossible. still, @ 50 tasks runs 2secs, cannot system under heavy load).

gcc - How to add gdi32.lib from command line -

i have found example gdi32.lib should linked in way, don't know how gcc command line. examples i've found suggest somewhere in project properties in ms visual studio or eclipse. bsod.cpp : #include <windows.h> int main() { hdc dc = createcompatibledc (null); setlayout (dc, layout_rtl); scalewindowextex (dc, -2147483647 - 1, -1, 1, 1, null); } my gcc compiler ruby development kit (seems mingw). just add link command line: -lgdi32 so e.g. link line like gcc -o executable somemain.o -lgdi32 make sure library specified after needs it. for example, if have single c++ source file named myprog.cpp , run g++ -o myprog myprog.cpp -lgdi32 or seperate commands g++ -c myprog.cpp g++ -o myprog myprog.o -lgdi32 you can add optimization or debug options first 2 commands. link command doesn't need else.

android - Activitiy's layout opens more than one? -

i have 3 activities connected witdh 3 layouts. when call activity everytime before 1 collect background. eg. on mainactivity then, call b call main again when on b, after call b , sitution if click on screen b, comes b>main>b>main or such b>a>main>a>main>b>main... private intent intent_main; . . . intent_main = new intent(this, mainactivity.class); startactivity(intent_main); this code calling activities, b (this, b.class) that... i want when click on different main turn main , when main shows exit -not show activity screens-... edit: how can close screen (exit) on main activity , how can return main activity others? [if go b.class , screen go main activity (with button etc.) , again b, after click return main activity push again return first b , click returns first time openin mainactivity after close] instead of starting new intent go activty main each time you're in activity b call finish()

c# - How to cast back an object with a linq query inside it with more than 1 entity? -

this question has answer here: how return query results method uses linq sql 7 answers i have following scenario. 1 linq query join statment: public object getmgm(int meb_id) { var unitofwork = new dal.implementations.entity_framework.unitofwork<dbgmentities>(); var queryroles = in unitofwork._ctx.membrosmgm join b in unitofwork._ctx.membros on a.mgm_pai equals b.meb_id a.mgm_filho == meb_id select new { b.meb_nome, b.meb_id, a.mgm_familiar }; return queryroles; } queryroles running inside thread. so, have return object. cannot find way cast , { b.meb_nome, b.meb_id, a.mgm_familiar } of select. tried following code 1 entity set on return , works fine, if have more 1 entity on same linq query don't know how cast back: //this 1 works fine if have 1 entity set

officewriter - Export ado.net dataset into excel worksheets using softartisans Excelwriter -

i have ado.net dataset have 3 datatables let dataset name customer , tables accounts, purchases , profile . export them using softartisans excelwriter worksheets using templates example dataset mydataset = new dataset(); mydataset.tables.add("customer"); mydataset.tables.add("accounts"); mydataset.tables.add("purchases"); xlt.binddata(mydataset,null , xlt.createdatabindingproperties()); i export theses tables seperate excel worksheets. the binddata method of officewriter's exceltemplate object has number of overloads . 1 accepts dataset not automatically import every datatable in dataset, imports first one. if want use every datatable in dataset, should use overload takes datatable (see documentation ). example: //the 2nd parameter datasource name must correspond first //part of datamarker in template workbook (i.e. %%=customer.firstname) xlt.binddata(ds.tables["customer"], "cust

dictionary - convert a list of delimited strings to a tree/nested dict, using python -

i trying convert list of dot-separated strings, e.g. ['one.two.three.four', 'one.six.seven.eight', 'five.nine.ten', 'twelve.zero'] into tree (nested lists or dicts - easy walk through). real data happens have 1 4 dot-separated parts of different length , has 2200 records in total. actual goal fill in set of 4 qcombobox'es data, in manner 1st qcombobox filled first set items ['one', 'five', 'twelve'] (no duplicates). depending on chosen item, 2nd qcombobox filled related items: 'one' be: ['two', 'six'], , on, if there's nested level. so far i've got working list -> nested dicts solution, it's horribly slow, since use regular dict(). , seem have trouble redesign defaultdict in way work out filling comboboxes properly. my current code: def list2tree(m): tmp = {} in range(len(m)): if m.count('.') == 0: return m = m.split('.',

ruby on rails - Helper methods in Controller -

i have helper module: module sessionshelper @current_user @current_session def current_user @current_user = user.find(cookies[:user_id]) if(cookies[:user_id]) end def current_session @current_session = session.find_by_secret_key(cookies[:session_secret_key]) end def current_user=(user) @current_user = user end def current_session=(session) @current_session = session end end and controller: class sessionscontroller < applicationcontroller include sessionshelper respond_to :json def create u = user.find_by_ip(request.remote_ip) u = user.create({:ip => request.remote_ip}) unless u s = session.create s.admin = u s.save! send(:current_user=,u) send(:current_session=,s) respond_with s end end notice how have set current user :send method, because calling current_user=u directly in controller not it. calling current_user directly expected work, need use self explicit receiver d

For a data analytical web app, would it be better to use django's auto-generated relational objects or raw SQL queries? -

i making application serve demonstration of data analysis capabilities our team can provide. new django , auto-generated apis seem pretty cool, worry scalability , having quickness constructed , queried database can provide. has been in situation , regretted/been satisfied there choice of raw queries vs django apis? django's orm great. 1 of complete , easy use orm have ever encounter, every orm, has limitations. if application requires full control of database , efficient queries, might consider other approaches , compare them django , see 1 fits better. you'll have research. django great developing fast complicated database applications, i'm sure --if application grows long enough-- sooner or later you'll have start working directly database engine optimization reasons. orms generic tools, database engine specific functions not available. there no rule decide wheter or not django gonna work but, 1 thing can tell orm helps app started quick , if find

eclipse - Maven Dependencies references non existing library -

as stated above have problem regarding maven. in current eclipse project used maven dependecy management , worked fine until now. the project not working anymore , states that: maven dependencies references non existing library: c:\.m2\repository\org\eclipse\lyo\oslc4j\core\oslc4j-core\1.1\oslc4j-core-1.1.jar' if check folder there files have same name jar end on jar.lastupdated. i tried maven clean , maven update did not work. line in pom.xml marked red , states: missing artifact org.eclipse.lyo.oslc4j.core:oslc4j-core:jar:1.1 this content of pom.xml: <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http:/www.w3.org2001xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.or/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>rtc_oslc_common</groupid> <artifactid>rtc_oslc_common</artifactid> <version>0.0.1-snapshot<

What is the name of the default date format used by MySQL? -

mysql defaults displaying columns of type datetime using format yyyy-mm-dd hh:mm:ss . format have name, such rfc 1123 format? how pervasive format among database vendors? an example of date value displayed in format be: 2013-05-13 12:58:26 it's commonly known iso 8601 format.

How to load FXML from string in JavaFX -

Image
i new javafx, , tried search solution problem in stackoverflow , google, not find solution. sorry, if reporst. here question. trying load fxml string, possible? let's string result contains fxml information. inputstream is2 = new bytearrayinputstream(result.getbytes("utf-8")); fxmlloader fxmlloader = new fxmlloader(); fxmlloader.setbuilderfactory(new javafxbuilderfactory()); parent root = (parent) fxmlloader.load(is2); but code wont work. thanks help. loading fxml string works me (java 8b89, os x 10.8) fxmlloader loader = new fxmlloader(); anchorpane layout = (anchorpane) loader.load( new bytearrayinputstream(fxml_string.getbytes()) ); note relative references won't work. example, in sample code below, css stylesheet inclusion commented out requires full url rather relative filename resolve (as there no relative path resolve against when loading inputstream). here adaption of fxml sample load fxml string rather file: import java