Posts

Showing posts from July, 2011

Detect being animated and end of animation state for animate.css with jQuery -

this question has answer here: animate.css - wait animation finish before continuing 2 answers i using animate.css animate few blocks on web page. <a href="#" class="clicktoanimate">click animate</a> <div class="div-to-animate"> content... </div> $('.clicktoanimate').click(function(direction){ $('.div-to-animate').addclass('animated fadein'); }); so animation. but want tasks when being animated , when animation done. so, check if being animated, used following condition if ($('.div-to-animate').hasclass('animated')) { // } which fine not cases. because animated class not being removed after transition. so, guess piece of puzzle need solve is: how remove animated class after animation completed. you can listen animationend event , remove

Hybris: show error message on storefront -

in case product offline, want show error message on storefront same when user checkouts @ cart page. updated source code in controller class , added error message globalmessages below: globalmessages.addmessage(model, globalmessages.error_messages_holder, "basket.validation.offlineproduct", new object[] { productdata.getname(), producturl, quantity }); i added error property "basket.validation.offlineproduct" in property file below: basket.validation.offlineproduct=unfortunately <a href="{1}">{0}</a> removed cart offline. had {2} in cart. but error message not getting displayed, although on debugging custom code being called , error message code being set model. other setting required display error message present in jsp file below: <%@ taglib prefix="common" tagdir="/web-inf/tags/desktop/common" %> <common:globalmessages/> i checked other controller file source code, , process seems same , erro

mysql - SqlDataAdapter Insert Database not working C# winform -

i trying insert data sql server database , show on datagridview c# winforms. i click on insert button no error shows, no data being insert database , datagridview becomes blank. i re-debug can see data update in datagridview, database not on visual studio server explorer database(picture1). on other hand.i set breakpoint when click insert button,that jump on line 42~46.directly line 50.ex(picture2). picture1 picture2 edit : question when click insert button,datagridview have update new data.but database no insert new data.database 2 data. edit2 changed connection string attachdbfilename. attachdbfilename=c:\vis\no4\windowsformsapplication1\app_dat‌​a\database1.mdf; value can insert database. here connection string: <add name="con1" connectionstring="data source=(localdb)\v11.0;attachdbfilename=|datadirectory|\database1.mdf;integrated security=true" providername="system.data.sqlclient" /> here form_load , load_grid fu

mysql - MariaDB secure-file-priv settings -

i have huge problem setting secure-file-priv. have added correspondent option in /etc/my.cnf is: secure-file-priv=/home/username/ when tried restart service won't up log file shows this: 161108 8:49:11 [note] /usr/libexec/mysqld: normal shutdown 161108 8:49:11 [note] event scheduler: purging queue. 0 events 161108 8:49:11 innodb: starting shutdown... 161108 8:49:12 innodb: shutdown completed; log sequence number 1597945 161108 8:49:12 [note] /usr/libexec/mysqld: shutdown complete 161108 08:49:12 mysqld_safe mysqld pid file /var/run/mariadb/mariadb.pid ended 161108 08:49:13 mysqld_safe starting mysqld daemon databases /var/lib/mysql 161108 8:49:13 [warning] failed normalize argument --secure-file-priv. 161108 8:49:13 [error] aborting 161108 08:49:13 mysqld_safe mysqld pid file /var/run/mariadb/mariadb.pid ended when change folder path for: secure-file-priv=/home/ works fine. i'm using mariadb 5.5.50 can guys please give me hints ? edit: problem s

java - Convert comma-separated string to list of variables? -

this question has answer here: how split string in java 29 answers for java , in reference question how save each value in array separate variable? if string value is: 1234,aaa,30 variables be: var1=1234 var2=aaa var3=30 use: string str = "1234,aaa,30"; string[] variables = str.split(","); string first = variables[0]; string second = variables[1]; string third = variables[2]; and should work

dcm4che - Creation of multi-frame dicom image using DCM4CHE3(JAVA) -

i trying create multiframe dicom file multiple jpeg file writing them using imagewriter writer.canwritesequence() giving false not able write jpeg file multiframe dicom file there way can create multiframe dicom file jpeg image or bufferedimage public attributes createdicomheader(bufferedimage sampleframe, int numberofframes) { // image information sample image: // frames should have same information once. int colorcomponents = sampleframe.getcolormodel().getnumcolorcomponents(); int bitsperpixel = sampleframe.getcolormodel().getpixelsize(); int bitsallocated = (bitsperpixel / colorcomponents); int samplesperpixel = colorcomponents; // dicom object hold our frames attributes dicom = new attributes(); // add patient related information dicom dataset dicom.getstring(tag.patientname, "aditya^g"); dicom.getstring(tag.patientid, "1234id"); dicom.getdate(tag.patientbir

sql - MySQL: How to use alias to construct a new field? -

i trying use 2 aliases ( like_count , dislike_count ) construct new field ( score ) used order purposes. below current piece of query have not work. following error below query: "unknown column 'like_count' in 'field list" . have looked similar question on so, have not been able find out solution. has idea how it? select comment.id, comment.content, sum(if(comment_reaction.type = 'like', 1, 0)) like_count, sum(if(comment_reaction.type = 'dislike', 1, 0)) dislike_count, ((like_count + 1.9208) / (like_count + dislike_count) - 1.96 * sqrt((like_count * dislike_count) / (like_count + dislike_count) + 0.9604) / (like_count + dislike_count)) / (1 + 3.8416 / (like_count + dislike_count)) score, (select comment_reaction.type comment_reaction comment_reaction.person_id = :person_id , comment.id = comment_reaction.comment_id) my_reaction comment left join comment_reaction on comment.id = comment_reaction.comment_id comment.topic_id

javascript - Need Dual Y axes for line chart along with zooming ability, in D3 charts using AngularJS -

i have used linewithfocuschart of d3 charts getting line chart having zoom in , out ability. want add second y axis it. tried shuffling through code of directive. can see sample chart code here the multichart did not prove of in case of zooming combined 2 y axes. can suggest how can add dual y axes chart?

iphone - AVAudioRecorder 256 Kbps recording in iOS -

i wants record audio in ios (avaudiorecorder) below code working fine _filename = [nsstring stringwithformat:@"record_%@.m4a",[dateandtimeutil stringfromdate:[nsdate date] withformatterstring:@"hh_mm_ss_dd_mm_yyyy"]];nsarray *pathcomponents = [nsarray arraywithobjects: [nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes) lastobject], _filename, nil]; nsurl *outputfileurl = [nsurl fileurlwithpathcomponents:pathcomponents]; // setup audio session avaudiosession *session = [avaudiosession sharedinstance]; [session setcategory:avaudiosessioncategoryplayandrecord error:nil]; // define recorder setting nsmutabledictionary *recordsetting = [[nsmutabledictionary alloc] init]; [recordsetting setvalue:[nsnumber numberwithint:kaudioformatmpeg4aac] forkey:avformatidkey]; [recordsetting setvalue:[nsnumber numberwithfloat:44100.0] forkey:avsamplerate

delphi - No mapping for the Unicode character exists in the target multi-byte code page -

i have soap builded delphi 2007 , work! after conversion in delphi 10.1 berlin have lot of exceptions: no mapping unicode character exists in target multi-byte code page the cause seem, when webbroker httpapp parsing request parameters, raise exception if request has url encoded chars in query string, eg.: http://localhost/soap/soap.dll/action?param=%e0 in fact if call url.decode() %e0 ( à url encoded ): tnetencoding.url.decode('%e0'); it raise same exception: no mapping unicode character exists in target multi-byte code page the problem seem unit system.netencoding on method turlencoding.dodecode(const input: string): string . method try convert url encoded chars in utf-8 without fallback on windows-1252 . string %e0 windows-1252 encoding à , delphi conver utf-8 version: %c3%a0 . a small (not perfect, not elegant) fix add fallback: try result := tencoding.utf8.getstring(bytes); // original delphi 10.1 line except on e: eencodingerror

dojo - Dojox Charting. Cannot change indicator line style of MouseIndicator -

i'm trying create chart using dojox charting. created plot , added series. this.addplot("st", {type: lines, markers: false, tension:"x"}); this.addseries("series a", [{x:0, y:0}, {x:5, y:10}, {x:10, y:12}, {x:15, y:14}, {x:20, y:15}, {x:25, y:16}, {x:30, y:18}], {plot: "st"}); then added mouseindicator new mouseindicator (this, "st", {series: "series a", labels: false, mouseover: true, linestroke: { color: "blue" } }); so has added indicator default colors. tried change indicator linestroke, lineoutline or lineshadow. nothing changed. according api docs should change line style^ http://bill.dojotoolkit.org/api/1.9/dojox/charting/action2d/mouseindicator does knows how change mouseindicator line style? here hack of solution. using dojo/aspec

javascript - How to run open function from iframe so it will take iframes base url -

i'm trying run javascript function iframe, here code i have on page: function start_course() { ifrm = document.getelementbyid('mycourse'); var bt = ifrm.contentdocument.createelement("base"); bt.setattribute("href", "http://yourdomain.com/course/review/html/"); ifrm.contentdocument.getelementsbytagname("head")[0].appendchild(bt); document.getelementbyid('mycourse').contentwindow.launch_course(); } this function want call , in iframe page. function launch_course() { url = "flash/engine.htm" remote = open(url, "m", "fullscreen=0, height=853,width=1280,,toolbar=0,menubar=0,maximize=1,titlebar=1,status=1,resizable=yes, left=1,top=0") } but when call start_course() on page take webpage url base instead iframe webpage url. when launch_course() run within iframe picks wrong path mean path of wrapping window. note: page runs iframe , content loaded iframe same domain, can

PHP - Select sql from html checkbox -

Image
i have html form, checkbox. i want write sql include checkbox. for example on database: column: stato options: 0,1,2,3 where: 0 = aperto, 1 = stampato, 2 = bloccato, 3 = ❤ (favorite), so, if selected must show me kinds, otherwise not. how can write sql? this checkbox: <div id="radioset"> <input type="checkbox" id="radio1" name="aperto" checked="checked"><label for="radio1">aperto</label> <input type="checkbox" id="radio2" name="stampato" checked="checked"><label for="radio2">stampato</label> <input type="checkbox" id="radio3" name="bloccato" checked="checked"><label for="radio3">bloccato</label> <input type="checkbox" id="radio4" name="favorite" checked="checked">&l

Change value of an XML attribute via xslt -

i have following xml-file: <book description="for beginners" name="it book"> <available>yes</available> <info pages="500.</info> </book> i want this: <book description="for pros" name="it book"> <available>yes</available> <info pages="500.</info> </book> i looked how modify xml-documents on internet. found out first of should declare template copying everything: <xsl:template match="node() | @*"> <xsl:copy> <xsl:apply-templates select="node() | @*"/> </xsl:copy> </xsl:template> however, dont know how write template actual modification. helping out beginner. edit: here stylesheet far (as requested ul1): <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns

vba - Splitting multi value cells in Excel into rows -

Image
i encountered problem in excel, i'm planning split multi-valued cell rows through vba. this current table then i'm trying make this thank you this want. i'm assuming 'emails' column column b , start on row 1. option explicit const analysis_row string = "b" const data_start_row long = 1 sub replicatedata() dim irow long dim lastrow long dim ws worksheet dim isplit() string dim iindex long dim isize long 'application.screenupdating = false application.calculation = xlcalculationmanual thisworkbook .worksheets("sheet1").copy after:=.worksheets("sheet1") set ws = activesheet end ws lastrow = .cells(.rows.count, analysis_row).end(xlup).row end irow = lastrow data_start_row step -1 isplit = split(ws.cells(irow, analysis_row).value2, ",") isize = ubound(isplit) - lbound(isplit) + 1 if isize = 1 goto

web services - SOAP AMSX tracing vb.net -

i trying creating logging (tracing) soap webservice created on visual studio 2010 using vb.net. microsoft has created tracing asmx in link: https://msdn.microsoft.com/en-us/library/bb885203(v=vs.100).aspx , don't understand below points: in section should code added in web.config? how can view traced data? file created , saved somewhere? is there way specify webmethods traced? any additional links or explanations appreciated

Pandas: substitute NA's with shadow values obtained from contemporary non missing values in other column -

suppose have following prices, asset x: 2004 nan 2005 nan 2006 246313.490770 2007 245557.678822 2008 nan 2009 nan 2010 246221.051892 the values of x missing of years. and have price comparable asset, asset y (asset y never has nan prices): 2004 249008.038563 2005 248558.125114 2006 249644.313926 2007 249381.243924 2008 248739.371177 2009 249514.093672 2010 251120.103454 for every nan in price of asset x (top matrix), replace nan last non nan value of asset x multiplied growth rate of y (botom matrix) in intermediate years. so example substitution value in 2009 be: 245557.678822/249381.243924*249514.093672 (value 2007 of x times growth rate of y between 2007 , 2009) the values 2004 , 2005 remain nan's though. i can code using ugly nested loops wondering if there elegant 2 liners in pandas (i have dataframe several columns x.1, x.2,... scattered missing values , column y no miss

Python random.uniform not generate 0 -

i want use random.uniform generate float in between [-2, 2] , not generate 0 , how in loop, from random import uniform flag = true while flag: if uniform(-2, 2) not 0: flag = false i wondering there better way it? cheers this more code review , briefly: from random import uniform while true: if uniform(-2, 2) != 0.0: break is more pythonic / standard way (standard, in pattern occurs in other languages well). it's rare flag variable necessary break out of (while) loop. perhaps when using double loop. note : changed is not != , , 0 0.0 (the latter more it's clear we're comparing float float). because you're comparing float int , they'll never same item. besides, comparing numbers using is bad idea: >>> 2*3 6 # may work, don't rely on true >>> 10*60 600 # doesn't work false >>> 0 0 # sure, works... true >>> 0.0 0 # doesn't: float vs int false of cou

c# - Xamarin android unable to assign text value to edit text -

i new mobile development. working on android in xamarin using visual studio 2015. following sample code , doing same described in it. i getting exception when try assign text value edit text in update layout. bellow code in assigning values edit text void list_itemclick(object sender, adapterview.itemclickeventargs e) { click_employee = e.position + 1; icursor c = dbhelper.getsingleentry(click_employee); c.movetofirst(); name = c.getstring(c.getcolumnindex(dbhelper.employee_name)); email = c.getstring(c.getcolumnindex(dbhelper.employee_email)); phone = c.getstring(c.getcolumnindex(dbhelper.employee_phone)); designation = c.getstring(c.getcolumnindex(dbhelper.employee_designation)); dname.text = name; demail.text = email; dphone.text = phone; ddesignation.text = designation; } in above code exception raised @ dname.text = name; bellow error description system.nullreferenceex

php - ZF2 + Doctrine 2: Hydrate related objects via ZF2 Form -

our application (zend framework 2 + doctrine 2) has order entity references related objects billingaddress , on. have implemented rest api create , update orders. data passed api associative array , data of referenced objects can encapsulated inside array. i. e. data received order api looks this $data = [ // attribute of order entity 'remarks' => 'urgent order', // data of referenced billingaddress 'billing_address' => [ 'firstname' => 'barry', 'lastname' => 'fooman' ] ]; first thing note fact given billingaddress can either new or existing one! in latter case id part of billing_address data. using doctrineobject hydrator $hydrator = new doctrineobject($entitymanager); $hydrator->hydrate($order, $data); doctrine takes care of updating or creating referenced objects automagically. how doing far: take received data, little processing sanitize , validate data ,

c# - Unable to convert string to JSON object -

below json string { "resources": { "resource": [ { "resourceid": "d513e96f-ea6c-e511-8133-000d3a0044f4", "mspslogin": "richa.dinesh.parkar", "email": "richa.dinesh.parkar@accenture.com" }, { "resourceid": "d513e96f-ea6c-e511-8133-000d3a0044f4", "mspslogin": "harshal.arun.vadnere", "email ": "harshal.arun.vadnere@accenture.com" } ] }, "createdon":"2016-07-18t12:51:14.23z", "createdbyapp":"ad" } my class in models: public class resource { public string resourceid { get; set; } public string mspslogin { get; set; } public string email { get; set; } } public class resources { public ilist<resource> resource { get; set; } } public clas

selenium - Jenkins Execution Issue -

a selenium script , when executing eclipse in local machine , clicks upload button in browser upload files local machine application running in browser. this uploading part failing when script executing jenkins because jenkins server unable access local machine. any idea how overcome issue..?? accessing these files server bad idea (unless it's jenkins's slave) though can achieved via code or cmd tool, providing address , credentials. put effort in , you'll find how it... the better solutions adding these files jenkins server or committing these files repository , checkout them before test. shared folder trick on filer type server or similar. hope helps. anyway there's no substitute own research e.g. google , stackoverflow.

html - MDL drawer does not fill the height of the page? -

i'm using material design lite add fixed header , drawer ruby on rails app. can see in video , when navigate page, drawer menu on left hand side of page not fill height of page. it remains @ abnormal height (even when click link) until refresh page. can figure out what's going on here? here body of application view: <!-- material design fixed header , drawer --> <div class="mdl-layout mdl-js-layout mdl-layout--fixed-drawer mdl-layout--fixed-header"> <header class="mdl-layout__header"> <div class="mdl-layout__header-row"> <!-- add spacer align search bar right --> <div class="mdl-layout-spacer"></div> <!-- search bar --> <div class="mdl-textfield mdl-js-textfield mdl-textfield--expandable mdl-textfield--floating-label mdl-textfield--align-right"> <label class="mdl-button mdl-js-button mdl-b

Azure Android SDK - Active Directory Authentication - How to get Roles? -

how hold of role (custom) details active directory once authenticated. developing android application using azure mbaas , followed link enabling authentication https://azure.microsoft.com/en-us/documentation/articles/app-service-mobile-android-get-started-users/ but not sure on how roles , user details once user logged in. help? as known, can try custom role details azure ad using azure ad graph api, please refer offical document know it. meanwhile, can search graphapi on github of azure samples code samples references azure mbaas application. hope helps. concern, please feel free let me know.

Python: sorting the values of a dict and extracting the keys corresponding to the last n values -

say have dict this, not ordered in values: d={a:2,k:2,c:11,f:17,e:84,y:86} and want sort values largest smallest: order=sorted(d.values(),reverse=true) this give you: order=[86,84,17,11,2,2] now, let's take last 2 elements: b=order[-2:]=[2,2] what pythonic way of retrieving keys in d values in b correspond? in case, intended outcome be: ans=[a,k] use key argument sorted() : >>> d = {"a":2, "k":2, "c":11, "f":17, "e":84, "y":86} >>> sorted(d, key=d.get, reverse=true)[-2:] ['a', 'k'] from docs : key specifies function of 1 argument used extract comparison key each list element: key=str.lower . default value none (compare elements directly).

sonar runner - Sonarqube plugin for Eclipse 4.4.0 (Luna) + Java 1.6_0111 not working -

i new sonarqube. tried install sonarqube eclipse plugin. installation successful , restarted eclipse. but, not see sonar options or view. i tried both sonar lint , this http://downloads.sonarsource.com/eclipse/eclipse/ eclipse : luna java : 1.6 sonar-server : 4.0 please me how installed , analyse project in eclipse.

Heyzap v10.1.1 ads not showing in iOS -

Image
please see attached screenshot. after heyzap v10.1.1 ( latest ) sdk integration in ios , tried calling test suite , result how can make work in ios ? btw, same sdk works fine in android

csv - How can I use absolute path in batch file or force vbs not to need the path? -

i writing batch file , part of converts .csv .xlsx. i've been able incorporate solution post: convert .csv .xlsx using command line dim file, wb createobject("excel.application") on error resume next each file in wscript.arguments set wb = .workbooks.open(file) wb.saveas replace(wb.fullname, ".csv", ".xlsx"), 51 wb.close false next .quit end it works great, issue must pass absolute path batch file work, so: csv2xlsx.vbs c:\users\data\ktq\abc.csv as explained in original thread, doesn't work doing following: csv2xlsx.vbs abc.csv this bit of pain if move folder need update path. there way can force vbs take in above command correctly finding file, or can absolute path file in question , pass in somehow? great! the following script provide path of running .vbs script. can use such script determine path of files. if, instance, script stored in c:\users\data\ktq\yourscript.vbs", script bellow output str

ms word - Headings inside table cells don't appear in Navigation pane: workaround? -

i have long table. not realizing headings inserted inside table don't appear in outline view or navigation pane (see blom's answer http://answers.microsoft.com/en-us/msoffice/forum/msoffice_word-mso_other/headings-do-not-appear-in-navigation-pane/c3ff186f-8363-47e2-9f46-8f2cf83d78b4 ), put bunch of heading 1 , heading 2 headings inside table. i'm having trouble jumping around inside document. the brute force approach has occurred me split table after every heading, , take heading out of table. any other ideas? ms word 2010. this known issue , stefan blom's answer still holds: it known limitation in word headings inside table cells won't appear in navigation pane. it's worth, same thing applies predecessor of navigation pane, so-called document map, in older versions of word. have noticed, word adds headings inside table toc, fortunately. if want headings appear in navigation pane have place them outside of tables, i.e. suggested a

java - import com.chilkatsoft.* not resolved -

this question has answer here: how import jar in eclipse 6 answers i have been developing java project need create ssh tunnel. using chilkat library purpose.i have installed in project folder. here code snippet. getting error saying: import com.chilkatsoft.* not resolved . the code is: package usingchilkat; import com.chilkatsoft.*; public class myclass { static { try{ system.loadlibrary("chilkat"); `` } catch (unsatisfiedlinkerror e) { system.err.println("native code library failed load.\n" + e); system.exit(1); } } public static void main(string argv[]) { // important: helpful send contents of // ssh.lasterrortext property when requesting support. cksshunnel ssh = new ckssh(); boolean success = ssh.unlockco

jquery - Most efficient way to determine if HREF is file or redirect -

i'm working on smart script reports button/link clicks ga. i'd separate redirects file downloads. tag used a href attribute specified. so let's have following hrefs: "/" "aboutus/" "//www.google.com" "file1.txt" "file2.pdf" "file3.jpeg" would efficient approach having array possible file extensions , matching href or should regex or else? as mentioned in comment, impossible know url browser link. the browser reads response gets server, , based on headers in response decide (view page, redirect, download, etc). i think better check on server-side links create, , if link downloadable-file - add class link: <a href="file.pdf" class="downloadable">click download</a> and on javascript code check <a> tags have downloadable class: $('a.downloadable').click(function() { // whatever need once link clicked. }) another option (if want to) se

javascript - How to apply css for local scope without iframe? -

i developing application drag , drop @ here: (without iframe) https://cdn.rawgit.com/haonx/landingpage-builder/develop/index.html now, use iframe feature preview inner document (iframe) cannot detect type (and information) of dragging object outer document. placeholers not show. , texts allowed drop image dropzone . (expected not) i included scripts in both iframe , outer document here: https://cdn.rawgit.com/haonx/landingpage-builder/feature/instant-preview/index.html border droppable zone not show i tried iframe because css local scope. , display styles correct. is solution alternative embed document local styles? or way object information when drag on iframe (for show placeholder droppable)? tried ng-include, event drop not working

entity framework - Edit model data after EF6 add -

usually tipical ef6 add should be var newstudent = new student(); newstudent.studentname = "bill"; context.students.add(newstudent); context.savechanges(); in case i'm using logic var student = context.students.find(id); if (student == null) { student = new student(); context.students.add(student ); } student.blabla1 = "..."; student.blabla2 = "..."; //other 20 blabla... student.studentname = "bill"; // studentname required field context.savechanges(); it's bad practise edit data model after add method on entity framework 6? context injected can thrown error on case savechanges called on method , actual thread before assignment of "studentname"? why can't ... var student = context.students.find(id); if (student == null) { student = new student(); modifyblabla(student );//call private method context.students.add(student); } else { modifyblabla(stu

Spring @ControllerAdvice vs ErrorController -

in rest serving app, i'm planning create @controlleradvice class catch controller thrown exceptions , return responseentity objects according error type. but i've set @restcontroller extending errorcontroller catch "whitelabel" errors. does 2 interfers in manner ? in cases errorcontroller called when @controlleradvice set ? edit errorcontroller code requested @restcontroller public class controllercustomerror implements errorcontroller{ //error json object public class errorjson { public integer status; public string error; public string message; public string timestamp; public string trace; public errorjson(int status, map<string, object> errorattributes) { this.status = status; this.error = (string) errorattributes.get("error"); this.message = (string) errorattributes.get("message"); this.timestamp = errorattributes.get(&qu

search - Show graphs in Solr client web interface -

my search query comprises of more 1 fields search string, date field , 1 optional field. i need represent these on web interface users. secondly, need represent search data in graphical format (month wise popularity graph of hotel etc). is there solr web client provides above features or there way modify default solr browse interface , add above options?

PHP : flatten array - fastest way? -

is there fast way flatten array , select subkeys ('key'&'value' in case) without running foreach loop, or foreach fastest way? array ( [0] => array ( [key] => string [value] => simple string [cas] => 0 ) [1] => array ( [key] => int [value] => 99 [cas] => 0 ) [2] => array ( [key] => array [value] => array ( [0] => 11 [1] => 12 ) [cas] => 0 ) ) to: array ( [int] => 99 [string] => simple string [array] => array ( [0] => 11 [1] => 12 ) ) give shot: $ret = array(); while ($el = each($array)) { $ret[$el['value']['key']] = $el['value']['value']; }

MongoDB Get names of all keys in collection -

i'd names of keys in mongodb collection. for example, this: db.things.insert( { type : ['dog', 'cat'] } ); db.things.insert( { egg : ['cat'] } ); db.things.insert( { type : [] } ); db.things.insert( { hello : [] } ); i'd unique keys: type, egg, hello you mapreduce: mr = db.runcommand({ "mapreduce" : "my_collection", "map" : function() { (var key in this) { emit(key, null); } }, "reduce" : function(key, stuff) { return null; }, "out": "my_collection" + "_keys" }) then run distinct on resulting collection find keys: db[mr.result].distinct("_id") ["foo", "bar", "baz", "_id", ...]

node.js - Installing nodejs on linux ubuntu 16.04 -

Image
so have been searching , searching answer install node using brew install package. installs node , when node -v or node --version says node program not installed yet, when try install again says current version of node installed. if haven't already, follow install docs nodejs' website. curl -sl https://deb.nodesource.com/setup_7.x | sudo -e bash - sudo apt-get install -y nodejs working on fresh install ubuntu 16.04 box.

qt - Changing default values for properties (e.g. asynchronous) -

for many applications, on low-performance machines, beneficial have built-in components, such loader , image , setup load resources asynchronously. this, there 2 obvious options: set required property of built-in component, i.e. asynchronous: true create custom component asyncxxx content: asyncxxx.qml: xxx { asynchronous: true } where xxx either loader or image . i wonder why not set asynchronous mode default. most importantly, there way - environment variable, global setting - change default behaviour of built-in components asynchronous one, avoiding custom components? you make asloader , asimage qml types loader , image asynchronous: true , use throughout project. save on having modify everywhere, , if want override that, go , change in prototype. i wonder why not set asynchronous mode default. asynchronous more complicated , more overhead, makes sense if not default behavior. qml code i've seen, synchronous used more asynchronous,

reactjs - React cloneElement and component instance -

i have following higher order component trying wrap in container element supplied prop: import react, { proptypes } 'react'; export default (component) => { return class extends react.component { static proptypes = { containerelement: proptypes.element } static defaultprops = { containerelement: <div /> }; componentdidmount() { console.log(this.el); } render() { const containerprops = { ref: (el) => this.el = el }; return react.cloneelement(containerelement, containerprops, component); }; } } i wrap component this: export default animationcomponent(reduxform({ form: 'newresultform', validate })(newresultform)); but when log element in componentdidmount empty <div/> . why passed in component not child of newly created container element? your method of writing higher order component little unorthodox. react developers typically don't have

sql server - Ruby-ODBC transaction statement not updating table in MSSQL (Mac OSX) -

i have installed freetds (1.00.15) unixodbc (2.3.4) , accessed ms sql server (2014). able verify issue having doesn't lie freetds , unixodbc. because within isql client prompt, able execute both select , update queries. i running el capitan os x sinatra app has ruby-odbc gem, requirement. the application able query records database properly. however, when try running ruby method triggers update statement, in logs says it's successful, when check database nothing has been updated. hindering ruby web app updating data source correctly. new information so discovered morning (11-11-2016) ruby-odbc doesn't work if update statement ran in transaction block. however, if comment out transaction, works fine , commits data. difference in processing of code between os x , fedora. does have solution issue? if using freetds python or php , you're going have set autocommit=true part of connection options. search here autocommit more details: http://www.c

c# - Login form using collection list methods -

here when press login and here when press yes am doing atm project using c# , required teacher complete task out using database created class contains list store data in while creating new account, problem cant use data login (i don't know how bool coding thing determines if item in list) note:in login should enter name , pin code login here create account form code public partial class newaccountform : form { public newaccountform() { initializecomponent(); } accounts account1; private void btncreate_click(object sender, eventargs e) { } private void button1_click(object sender, eventargs e) { } private void button2_click(object sender, eventargs e) { form1 login = new form1(); this.hide(); login.show(); } private void btncreate_click(object sender, eventargs e) { int interest = 0; char type = '0'; double amount = 0 ; double bala