Posts

Showing posts from July, 2015

JSON array in Delphi -

i have place json string http request's body. 1 of string value must json array. how tried: uses dbxjson; const ccontent = 'hello world'; var ljsonobject: tjsonobject; x: tbytes; i: integer; temp: string; begin ljsonobject:= tjsonobject.create; ljsonobject.addpair('id1', 'value1'); ljsonobject.addpair('id2', 'value2'); ljsonobject.addpair('id2', 'value3'); x:= tencoding.ansi.getbytes(ccontent); temp:= ''; := 0 length(x) - 1 temp:= temp + inttostr(x[i]) + ','; delete(temp, length(temp), 1); ljsonobject.addpair('id4', '[' + temp + ']'); showmessage(ljsonobject.tostring); end; this 1 not working, because value encapsulated in double quotes. proper way pass array value jsonobject? you passing string rather array. hence result observe. rule, if find assembling json manually, doing wrong. pass array: var arr: tjsonarray; b: byte...

python - Use pandas groupby function on multiple columns -

Image
i have dataframe similar this: key departure species1 species2 status 1 r carlan carlan d 1 r scival carex c 2 r carlan scival d 2 r scival bougra c 3 d carlan carlan d 3 d scival scival c i want count occurrences of each unique species1 given departure , status of d of c my desired output is: species1 rd rc dd dc carlan 2 nan 1 nan scival nan 2 nan 1 use pandas.crosstab() method. single line of code: pd.crosstab(df.species1, [df.departure, df.status]) the resulting table: if combine @dermen's 'comb' column, df['comb'] = df.departure + df.status pd.crosstab(df.species1, df.comb) you'll get: if really want 'nan', tack on .replace('0', np.nan) , (assuming import numpy np has been done): pd.crosstab...

javascript - Display only $(this) row of table data when button is clicked -

i working on drop down option feature within table loads data mysql database. when user clicks button that's within row displays table data hidden. should display data in row below instead applies rows in table class $(.options). goal apply row under row contains .button. have far: css: .options { display:none; } mysql table php): while($sound=mysql_fetch_assoc($records)){ echo "<tbody>"; echo "<tr>"; echo "<td width='40' class='player'>&nbsp;&nbsp;<a href='beats/".$sound['downloadlink']."' class='sm2_button'>play/</a></td>"; echo '<td width="250" class="name">'.$sound['name'].'&nbsp;&nbsp;&nbsp;<span class="red date">'.$sound['date'].'</span></td>'; echo "<td width='88' class='bpm'>".$sou...

ios - UITableView ReloadData Animate Cell UI -

in tableview need animate ui of every cell tableview reloads data. this needs custom animation, not fade or default transition. for example, when tapping 'edit' button, in view, tableview reloads , each cell updates ui new edit mode. however, during reload have tried using uiview animation block update constraint on uilabel in cells, not animate. here code run when call reloaddata on tableview. called in cellforrowatindexpath method. [uiview animatewithduration:0.3f delay:0 options:uiviewanimationoptioncurveeasein animations:^ { //does not animate _lblcontainerleftconstraint.constant = 18; [self setneedslayout]; //does animate _reordericon.alpha = 0.5f; } completion:nil]; any appreciated, thanks. i think need in willdisplaycell rather cellforrowatindexpath since called before display close can point appears on screen. then set new constraint value before animation block , call [cell.contentview s...

sql - Oracle single query with multiple lookups to same table -

i have reference table containing list of account numbers. each account in table, need query table containing list of activities; each activity can have 0 many associated notes. each activity has product, call type, reason , outcome, stored references category table containing these in single field. , fun, have pull of data in single query. here's far: select activity.activityid, activity.accountno, activity.createdatetime, c1.catdesc product, c2.catdesc calldriver, c3.catdesc reason, c4.catdesc outcome, note.noteid, note.notedesc note right join activity on note.activityid = activity.activityid right join reference on activity.accountno = reference.accountno inner join category c1 on activity.productcode = c1.catcode inner join category c2 on activity.calldrivercode = c2.catcode inner join category c3 on activity.reasoncode = c3.catcode inner join category c4 on activity.outcomecode = c4.sour...

r - Convert Character Matrix to TRUE/FALSE Matrix based on column names -

i have data frame in following format 1 2 b c 1 b 0 0 0 2 b 0 0 0 3 c 0 0 0 i want fill columns through c true/false says whether column name in columns 1 or 2 1 2 b c 1 b 1 1 0 2 b 0 1 0 3 c 0 0 1 i have dataset of 530,000 records, 4 description columns, , 95 output columns loop not work. have tried code in following format, time consuming: > for(i in 3:5) { > for(j in 1:3) { > for(k in 1:2){ > if(df[j,k]==colnames(df)[i]) df[j, i]=1 > } > } > } is there easier, more efficient way achieve same output? thanks in advance! one option mtabulate qdaptools library(qdaptools) df1[-(1:2)] <- mtabulate(as.data.frame(t(df1[1:2])))[-3] df1 # 1 2 b c #1 b 1 1 0 #2 b 0 1 0 #3 c 0 0 1 or melt dataset after converting matrix , use table frequencies, , assign output columns numeric. library(reshape2) df1[-(1:2)] <- table(melt(as.matrix(df1[1:2]))[-2])[,-1] or can 'paste...

express - Is there a way to start a task before node.js server.listen event is emitted? -

i want able start async task before server starts listen port , gets requests, workaround invoke task onlistening function , when task done i'm binding port address - workaround ugly.. function onlistening() { var addr = server.address(); var bind; // following service gets default plugins yamls , stores them in db. defaultoperationsservice.getootboperations().then(function success() { logger.info('done getting default plugins operations!'); }, function err(err) { logger.error('error while trying operations' + err); }).done(function done() { bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port; logger.debug('listening on ' + bind); }); } i introduced better way , best way, call server.listen(port) when done: defaultoperationsservice.getootboperations().then(function success(){ logger.info(...

User Authentication on a mobile AngularJS App -

i'd ask question, have more 1 solution @ stage don't know how solve problem. i'm building mobile application built in angular/ionic accessing woocommerce api, app needs pass consumer key secret in order obtain product information create products. i assume not have direct access database on phone can store theses details authenticate app , point @ right woocommerce store. even if store these in server based app, mobile app still needs authenticate server based app in order access correct woocommerce store. could point me right directions how developers go problem? usually, mobile authentication in phonegap/ionic looks that: you send authentication request login/pass or apikey. server response token. you store token in localstorage. send token every apirequest. here example how pass token every api request if have token. angular.module('app').config(appconfig); appconfig.$inject = ['$httpprovider']; function appconfig($httpprov...

database - List only Oracle Temp Table Space -

is there way list temp tablespaces in oracle? found following query listing tablespaces, need temp tablespaces. sql> select tablespace_name dba_tablespaces; tablespace_name ------------------------------ system sysaux undotbs1 temp users you can filter list contents column: select tablespace_name dba_tablespaces contents = 'temporary' as described in oracle database online documentation dba_tablespaces .

Data preprocessing with apache spark and scala -

i'm pretty new spark , scala , therefore have questions concerning data preprocessing spark , working rdds. i'm working on little project , want implement machine learning system spark. working algorithms ok think have problems preprocessing data. have dataset 30 columns , 1 million rows. simplicity lets assume have following dataset (csv-file): columna, columnb, column_txt, label 1 , , abc , 0 2 , , abc , 0 3 , b , abc , 1 4 , b , abc , 1 5 , , abc , 0 6 , , abc , 0 7 , c , abc , 1 8 , , abc , 1 9 , b , abc , 1 10 , c , abc , 0 after loading data in spark want following steps: remove columns end "_txt" filter out rows columnb empty (this figured out already) delete columns have more 9 levels (here columna) so have problems issue 1. , 3. know can't remove columns have create new rdd how ...

jquery - HTTP request url is getting concatenated to other links -

i have ascx control top menu on page, on have lists different links on site like: <ul> <li class="catheading">section select</li> <li><a href="/section1/subsection1">one</a></li> <li><a href="/section2/subsection2">two</a></li> </ul> this menu animated jquery. thing lately have intermitent issue request logged on iis logs like: /section1/section2/subsection2 and valid request should be: /section1/subsection1 /section2/subsection2 does knows may cause malformed request? far know should on client side have not found information on this(btw i'm using chrome 43.0.2357.134 m). in advance!!

javascript - JavaScriptInterface only working with local HTML file -

i have created android application uses webview access html file. done map 2 javascript functions 2 native android functions using javascriptinterface. these 2 functions bring , dismiss android soft keyboard. when tested file, running locally , worked. since then, have placed file on server , changed webview access html file through server. since placing on server, javascriptinterface functions no longer being called. is there flag needs set or permission missing? have searched no avail. here html code <head id="head1" runat="server"> <title>login page</title> <script language="javascript" type="text/javascript"> function capturepassword(event) { event = (event) ? event : window.event var charcode = (event.which) ? event.which : event.keycode if (charcode == 13) { document.getelementbyid("password").focus(); document.getelementbyid("password")....

date - How to get first, third and fifth Saturday of a month in PHP? -

i have found solution problem, it's getting wrong condition. following findings: this code segment print first saturday of august 2015 , july 2015: $sat = date("f y",strtotime("2015-08-01")); echo $fir_sat = "$sat first saturday"; echo " ".date('d', strtotime($fir_sat)); $sat = date("f y",strtotime("2015-07-04")); echo $fir_sat = "$sat first saturday"; echo " ".date('d', strtotime($fir_sat)); following output: august 2015 first saturday 08 july 2015 first saturday 04 but 01 : august 2015 first saturday 01 how happen? solution? based on feedback's have tried coding. following findings. error happened because of php version. in lower version of php 5.2.9 following code not working echo date('y-m-d', strtotime('first saturday of august 2015')); but in higher version 5.4 wokring any ideas? try using of as echo date('d f y...

c# - Does ServiceBase.Run(ServiceBase[] ) method run all services in array asynchronously? -

servicebase[] servicestorun; servicestorun = new servicebase[] { new service1(), new service2() }; servicebase.run(servicestorun); how work? service1 run, , when onstart() done, service2's onstart() run, or both of them run @ same time? if that's case, , explicitly want service1's onstart done before running service2.onstart() , how go? would trick: servicebase.run(new service1()) servicebase.run(new service2()) you misunderstanding servicebase.run() does. from the documentation : registers executable multiple services service control manager (scm). the sequence goes this: a start request received 1 (or perhaps both) services. the scm launches executable. your main function calls servicebase.run(). the scm calls onstart() service matching start request, in new thread. unless both services being started, onstart() not called other one! if both services ...

javascript - Add external JS to react component -

i want add canvas react component. have achieved: var react = require('react'), c = require('./../canvas_animation'); var home = react.createclass({ componentdidmount: function () { react.finddomnode(this).childnodes[1].appendchild(c); }, this link contains canvas animation. problem: working fine in react apart mouse events? how can make them work? jquery(document).ready(function() { $(document).mousedown(function(e) { onmousedown(); }); $(document).mouseup(function(e) { onmouseup(); }); }) replicated here react having issue events. react.js using syntethic event system http://facebook.github.io/react/docs/events.html . first step attach events on react node directly: render: function() { return <div onmousedown={onmousedown} onmouseup={onmouseup}></div>;...

Sass compilation using Grunt and the role of ruby -

we use visual studio 2013 our development , need have .sass files compiled css (and same part of build/ci). exploring options grunt/gulp. in following urls, there mention need ruby installed on machine in order have sass (monitor and) compilation using grunt: http://www.smashingmagazine.com/2013/10/get-up-running-grunt/ http://www.gibedigital.com/blog/2015/may/28/compiling-sass-in-visual-studio-2015/ http://ryanchristiani.com/getting-started-with-grunt-and-sass/ in following urls, there no mention of ruby achieve same task: http://mattwatson.codes/compile-scss-javascript-grunt/ how setup gruntfile.js watch sass (compass) , js what ruby, , how related (if so) sass compilation using grunt? can not achieve task without ruby? if so, advantages/disadvantages. ruby programming language; sass written ruby. must have ruby in order install , use sass. away using sass without ruby if use http://libsass.org/ (a c implementation of sass). libsass should more performa...

Packages not loading after installing visual studio 2015 RTM -

Image
the problem i had visual studio 2015 rc installed , installed visual studio 2015 rtm on it. couldn't find on internet said couldn't this. don't know if relevant problem. unfortunately when started vs 2015 rtm first time after restarting popped message boxes with: "the 'microsoft.visualstudio.editor.implementation.editorpackage' package did not load correctly" also: xamarinshellpackage testwindowpackage nugetpackage errorlistpackage how can resolve error? logs it said in activitylog.xml . couldn't find microsoft.visualstudio.editor.implementation.editorpackage. but xamarinshellpackage said: <entry> <record>339</record> <time>2015/07/21 13:01:54.011</time> <type>error</type> <source>visualstudio</source> <description>setsite failed package [xamarinshellpackage]</description> <guid>{2d510815-1c4e-4210-bd82-3d9d2c56c140}</g...

c++ - What does pragma keylist keyword do? -

while reading various iot messaging protocols came across structure defined below: enum tempscale { celsium, kelvin, farenheit }; struct tempsensortype { short id; float temp; float hum; tempscale scale; }; #pragma keylist tempsensortype id my question is: #pragma keylist keyword , can find documentation using #pragma preprocessor directives (i believe such directive..). thanks. the #pragma looking @ prismtech method defining key value within omg-dds (data distribution service real-time systems) type structure. in case, defining short 'id' key value. comparable rti definition be struct tempsensortype { short id; //@key float temp; float hum; tempscale scale; } for interoperability between vendors' implementations, can safely do struct tempsensortype { short id; //@key float temp; float hum; tempscale scale; } #pragma keylist tempsensortype id because rti compiler ignores pragmas, , pt compi...

javascript - Append new line of text without using ".append" -

i have dropdown has contacts in there, i.e. john , bob , etc. , button next when it's clicked, display contact's phone number in <textarea></textarea> . each time when pick contact , press button, want display number in textarea , each additional contact's number add want number display below previous number. need line break between each number this. 1234567890 5557778888 when use first function using .append , works way want however, if edit numbers or take out numbers, can't use button add numbers textarea anymore. realized this article it's because text nodes , value can disconnected. then tried using .val , replaces numbers in textarea instead of appending below it. what best way solve problem? thanks! let me know if need additional information. my javascript functions: using .append() selectoption: function() { $('#addcontact').click(function() { $('#tophonenumber').append($('#t...

javascript - AngularJS 1.x dependent dropdowns: third level not getting reset when changing first level -

i have three-level dependent dropdown built using angularjs, shown in this fiddle , in following code. <select ng-model="clock" ng-options="clock clock.clockname clock in dropdowns"></select> <select ng-model="freq" ng-options="freq freq.freq freq in clock.freqs" ng-disabled="!clock"></select> <select ng-model="rate" ng-options="rate rate rate in freq.rates" ng-disabled="!clock || !freq"></select> the problem when change top level dropdown, doesn't reset third level dropdown. replicate it, try selecting 1 value each in first second , third dropdowns. change first dropdown, can see second dropdown reset, third not. any suggestions? you've discovered old bug: model wasn't updated if selected option removed. this odd behaviour has been corrected this commit , in angularjs 1.4.0-beta.0 . can update version of framework solve problem.

html - Make div expand on hover -

Image
basically, want create "relative" scale of div i'm hovering. tried following, output disaster. appericiated! .item { position: relative; display: inline-block; width: 20%; height: 100px; background-color: green; margin-right: 10px; transition: 0.4s ease; } .item:hover { transform: scale(1.5); margin-right: 40px; margin-left: 26px; } desired solution: *important, problem i'm having keeping padding between items on scaling. link to: jsfiddle just adjust margins, seems working well: .item:hover { transform: scale(1.5); margin-right: 54px; margin-left: 44px; }

xml - Label:- XMLContent De-duplication -

question 1---> working on project in translate english content other 17 languages. reduce translation cost using md5 hashcode , based on results decide whether topic new(master) or translated earlier(obselete). logic complicated , want reduce complexity level. using content management system filenet , way older..:) need best suggestion content de-duplication apart md5 hashing note :- topic means xml file images , rendered via xslt , not dita standard. question 2---> what best alternative render non-standard xml file or not dita standard xml file on ui html or pdf.? thanks in adavance ...waiting best suggestions. question 1 i recommend not rely on hashes or time stamps, depends on environment. if refactor variables, change indentation add/remove comments, etc. not change content , should not trigger translation process, may rely on metadata trigger semi-automatic process. further on, use diffing mechanism compare current version of document earlier one. q...

html - SQL Update Statement for change to correct fractions -

in database, have strings saved this: <sup>3</sup>&frasl;<sub>8</sub> this stores fraction html, want change html statement this: <div class="fraction"> <div class="numerator">3</div> <div class="denominator">8</div> </div> i know how change using sql update statement: update question_table set `option` = replace(`option`, '<sup>3</sup>&frasl;<sub>8</sub>','<div class="fraction"> <div class="numerator">3</div> <div class="denominator">8</div> </div>') `option` '%<sup>3</sup>&frasl;<sub>8</sub>%' but problem 3 , 8 might change accordingly. not 3 , 8. numbers can change. how change correct statement taking account different numbers. know need use regular expressions not sure how. need guidance on this. a...

c# - 'Expected Global Line.' exception while loading solution using Roslyn -

i'm learning roslyn , trying out first time. i've written small code snippet load solution , reference workspace. iworkspace workspace = workspace.loadsolution(solutionpath); foreach (iproject project in workspace.currentsolution.projects) { commoncompilation objcompilation = project.getcompilation(); } return workspace; but i'm getting exception in first line. exception details given below. message : expected global line. stack trace : @ roslyn.services.host.solutionfile.parseglobal(textreader reader) @ roslyn.services.host.solutionfile.parse(textreader reader) @ roslyn.services.host.loadedworkspace.loadsolution(solutionid solutionid, string filepath) @ roslyn.services.host.loadedworkspace.opensolution(string filename) @ roslyn.services.host.loadedworkspace.loadsolution(string solutionfilename, string configuration, string platform, boolean enablefiletracking) @ roslyn.services.workspace.loadsolution(string solutionfilename...

Actionbar tab text (android:textAllCaps=false) is not working -

i using action bar style generator style action bar. basic parent theme: @android:style/theme.holo.light i want change action bar tabs text lower case (by default upper case). i tried following. xml code: <style name="mymenutextappearance" parent="@android:style/textappearance.holo.widget.actionbar.menu"> <item name="android:textallcaps">false</item></style> java code: actionbar = getactionbar(); madapter = new tabspageradapter(getsupportfragmentmanager()); viewpager.setadapter(madapter); actionbar.sethomebuttonenabled(false); actionbar.setnavigationmode(actionbar.navigation_mode_tabs); // adding tabs (string tab_name : tabs) { actionbar.addtab(actionbar.newtab().settext(tab_name).settablistener(this)); } viewpager.setonpagechangelistener(new viewpager.onpagechangelistener() { @override public void onpageselected(int position) ...

forms - Maintain posted order in symfony2 choice input field (with choice list) -

i'm using symfony2 framework in project , use form component create forms. i'm using choice input field type enable users multi select options , i'm using plugin enable users order these options. unfortunately order of these options isn't maintained when posting form controller. request has correct order form component uses order of choices option. how can maintain posted order using form component , choice input field type? for record, did search on google, stackoverflow , @ github , found issue keeping order of preferred_choices ( https://github.com/symfony/symfony/issues/5136 ). issue speak sort option can't find option in symfony2 documentation. i tried solve same problem : needed select several organizations , sort them in list. and after $form->getdata() order request changed. i made form event handlers , found data have right order on formevents::pre_submit event , saved in $this->presubmitdata . after that, on formevents::su...

javascript - webrtc streaming video only one side -

i'm trying make video chat application based in http://www.html5rocks.com/en/tutorials/webrtc/basics/ it works in same network, when try other networks have following problem: if invite other user, other user can see streaming if invites me, can see streaming i think problem in iceservers, i'm using [{'url':'stun:stun.l.google.com:19302'}] any ideas on how can solve issue? according same article mention: if udp fails, ice tries tcp: first http, https. if direct connection fails—in particular, because of enterprise nat traversal , firewalls—ice uses intermediary (relay) turn server. in other words, ice first use stun udp directly connect peers and, if fails, fall turn relay server. if i'm not mistaken, use stun server. in case if direct connection not possible, , without turn server, acts relay, it's not possible establish two-way connection. check out article how set own turn server, , stun , turn stuff: http://www.htm...

Share whiteboard with other user using node.js and socket.io -

i need idea regarding whiteboard sharing other users.suppose 1 admin user wants share whiteboard 1 user.what writing/erasing on/from whiteboard display other user.the other user can read white board.i want implement using node.js , socket.io.can give me idea or reference link how implement feature ? it seems need room system app, http://socket.io/docs/rooms-and-namespaces/ , check docs , try integrate basic chat application firstly. if want draw whiteboard, that's area unrelated socket.io , can use canvas libraries( fabric.js seems handy library lot of demos(for requirement free-drawing demo )) creating whiteboard , can integrate whiteboard events in socket.io cleint-side ease.

sql server - Blocking Transaction Issue with SSIS -

Image
i have ssis package starts transaction, marks existing records in destination table inactive. have data flow task inserts new records before commiting or rolling transaction. the problem having df task hanging due deadlock. package has been running fine month, reason started having lock issues. i have tried setting different transaction levels, no luck far. can tell here lock condition: can show me execution plan? there clustered index scans? if there can solve pretty quickly. to fix problem, need create non-clustered index on column identified in predicate section. effect of doing non-clustered index seek (which more of direct path data scan) , bypass deadlock problem.

sql server - No suitable driver found for jdbc:sqlserver -

i realize considered duplicate topic, have followed recommended steps in other topics of same nature no success. i using ggts 3.6.4 grails 2.3.0 jdk1.7.0_80 groovy compiler level 2.3 microsoft sql server 2012 i have grails-app authenticates users logging in against ldap server apache shiro , have following code (in shiro generated authcontroller.groovy ) try , store information external database in session. (note: regards usernames, passwords, , database names, i've changed of them here privacy reasons) def signin = { subject subject = securityutils.getsubject(); string lowercaseusername=params.username.tolowercase(); def authtoken = new usernamepasswordtoken(lowercaseusername, params.password) // support "remember me" if (params.rememberme) { authtoken.rememberme = true } try{ subject.login(authtoken) if (subject.isauthenticated()) { session.username = lowercaseusername ...

MYSQL: How to get a group total repeating in column while keeping the grouping -

generated results this: ------------------------ |group a|group b|amount| ------------------------ | | 1 | 5 | | | 2 | 4 | | b | 1 | 4 | | b | 2 | 2 | | b | 3 | 6 | | c | 1 | 1 | | c | 2 | 4 | ------------------------ looking sum in new column total of group repeats along group b: --------------------------------------- |group a|group b|amount|sum of group a| --------------------------------------- | | 1 | 5 | 9 | | | 2 | 4 | 9 | | b | 1 | 4 | 12 | | b | 2 | 2 | 12 | | b | 3 | 6 | 12 | | c | 1 | 1 | 5 | | c | 2 | 4 | 5 | --------------------------------------- i'm using several derived , joined tables, hoping easy enough calculate within current select statement or derived table. ideas? can't add additional rows using rollup modifier. ...

javascript - NodeJS and web sockets: Check if socket origin is the same as the web socket server -

edit: i'm sending data app app b on web socket, router app else, , b web app. when b receives data, should send client viewing home page, on web socket. but, since roter app , home page clients connected same web socket server, don't know connections clients viewing home page, , connections other stuff, router. home page clients should receive data. i want pass logging data recieved router home page in real time can view it. ======== i have express app server simple html page. runs script: var host = window.document.location.host.replace(/:.*/, ''); var ws = new websocket('ws://' + host + ':5000'); ws.onmessage = function (event) { console.log(json.parse(event.data)); }; in nodejs backend, have simple ws server running, listening connections: var websocketserver = require("ws").server; module.exports.init = function(server) { var wss = new websocketserver({ server: server }); wss.on('connection', function (ws) { ...

Are haskell type declarations used the same way as python class/function documentation? -

i using "learn haskell tutorial" , have reached type declarations section. understand change way ghci gives error message, affect way actual function works? if not, python function documentation written """ """ underneath "def somefunction(x): "? - example example code: removenonuppercase :: [char] -> [char] removenonuppercase st = [ c | c <- st, c `elem` ['a'..'z']] edit: ask because tutorial explains haskell type-inferred @ compile time. signatures aren't documentation (even though useful well). enforced compiler, means adding signatures can make types of functions more restrictive otherwise. toy example: add x y = x + y addint :: int -> int -> int addint x y = x + y *main> :t add add :: num => -> -> *main> add 2 3 5 *main> add 2.1 3.1 5.2 *main> :t addint addint :: int -> int -> int *main> addint 2 3 5 *main> addint 2.1 3.1 -- addint not acc...

html - Show hidden text on hover (CSS) -

i have tried while show text on :hover , able explain me? i tried: #divforhoveritem:hover #hiddentext { display: block;} without luck, sadly. little piece in every example found. i failed understand: https://css-tricks.com/forums/topic/show-text-on-hover-with-css/ i try <div id="divforhoveritem"><p>shown text</p></div> <div id="hiddentext"><p>hidden text</p></div> css: #hiddentext { display: none; } and code line there ^ #divforhoveritem:hover #hiddentext { display: block;} the #hiddentext element has inside #divforhoveritem element if want achieve css. try this: #divforhoveritem { /*just can see it*/ height: 50px; width: 300px; background-color: red; } #hiddentext { display: none; } #divforhoveritem:hover #hiddentext { display:block; } <div id="divforhoveritem"> <div id="hiddentext"><p>...

jfreechart - How to use GridArrangement and BlockContainer -

i create mxn grid of charts - similar for in m*n: ax = fig.add_subplot(m, n, + 1) for matplotlib there appears supporting classes - within org.jfree.chart.block package. have been unable locate documentation, examples, testcases using arrangement/layout set of charts. pointers appreciated. this part of api rather low-level, , used internally jfreechart. example, gridarrangement may used create particular legend layout , within chart . in opinion, easiest way create grid of charts, use swing jpanel , gridlayout , , fill grid charts. jpanel grid = new jpanel( new gridlayout(m,n) ); for(int i=0; i<m*n; i++) grid.add(new chartpanel(createchart(i))); you can use combinedplot . allows add many plots want, either layed out side-by-side, or stacked vertically (but not on grid, far know). thing approach plots directly share common axis, , aligned nicely. (but depends on problem: charts share 1 common axis ? perhaps 2 ?)

java - configure Xuggler on Ubuntu 14-04 -

i trying install xuggle on ubuntu this tutorial but when used ant stage doesn`t work. see these commands on terminal > root@test1:~# ant stage unable locate tools.jar. expected find > in /usr/lib/jvm/java-7-openjdk-amd64/lib/tools.jar buildfile: > build.xml not exist! build failed do have idea how can fix it? the tools.jar error because ant can't find jdk, appears looking in open jdk location. might need install oracle-java7-set-default points system java oracle java installed.

Cannot get the kerning of some specific .ttf fonts with freetype -

Image
i trying extract kerning information out of .ttf fonts freetype 2.6 library. this how kerning informations (looping through characters): if( ft_has_kerning(face->getface()) && previous ){ ft_vector delta; ft_uint glyph_index = ft_get_char_index( face->getface(), character ); ft_uint prev_index = ft_get_char_index( face->getface(), previous ); ft_get_kerning( face->getface(), prev_index, glyph_index, ft_kerning_default, &delta ); kerning = delta.x >> 6; } i tried program different fonts: "times new roman.ttf", "tymes.ttf", "minion.otf". times new roman font only, kerning information correctly extracted, , checked logging info. the problem don't understand why kerning 0 (i.e. ft_has_kerning returns false, , ft_getkerning returns 0 anyway) other 2 fonts. i checked fontforge kerning info present pairs "va" , "to", , there! must stored in .ttf. neve...

javascript - Template conversion from XHTML 1 to HTML5 , CSS Error -

this simple 3-column template, side-bars on left , on right sides , content in middle. i'm not able understand spacing between columns, there's of space between content(post) column , right side-bar. [side-bar] [content/ post / matter]_____space/gap___[side-bar] i'm not able reduce/remove ' _space/gap ' make template like [side-bar] [content/ post / matter] [side-bar] before posting here, i've tried chrome-developer tool know , refactor it, i've not been able understand it. jsfiddle example change section of code: #right { float: right; width: 180px; padding: 10px 30px 10px 0; } to this: #right { float: left; width: 180px; margin-left: 10px; padding: 10px 30px 10px 0; } floating right hold container rightmost position can attain within own container.

python - Displaying a matplotlib bar chart in Tkinter -

i trying display matplotlib bar chart in tkinter window. have found plenty of tutorials on how put line chart in, such this: http://matplotlib.org/examples/user_interfaces/embedding_in_tk.html but can't find 1 putting in bar chart. way know make bar chart this: http://matplotlib.org/examples/api/barchart_demo.html . obviously, modules imported in bar chart example not same ones in tkinter examples, , i'm not sure how make work, if can @ all. long story short, can provide me example of matplotlib bar chart being displayed inside tkinter window? thanks. for may wondering in future, figured out how work. basically, bar chart has on figure figurecanvastkagg can generate widget tkinter use. had assumed needed use pyplot, isn't true. came with: import matplotlib, numpy, sys matplotlib.use('tkagg') matplotlib.backends.backend_tkagg import figurecanvastkagg matplotlib.figure import figure if sys.version_info[0] < 3: import tkinter tk else: impo...

mongodb - Querying referenced collections using Mongoose Populate -

i'm having tricky time mongoose populate(). trying load referenced documents collection using user id. i have user collection stored this. { id: "myuserid", // alphanumeric string. username: "me" sessions: [] // note deliberately empty. } i have gamesessions collection stores game save states this: { id: "gamesaveidstring", // unique id userid: "myuserid", // user saved this. ("me") properties: {} // bunch of stuff tracks doing in game. } i return object looks this: { id: "myuserid", username: "me", sessions: [{ id: "gamesaveidstring", properties: {} },{ id: "gamesaveidstring", properties: {} }, ...] // etc. } i have looked @ mongoose documentation, i'm not finding clean way (that works) accomplish this. can nesting queries, find messy. populate seems allow query collection par...

javascript - JQuery UI dialog modal caching old values -

i'm having big problem using using jquery dialog. dialog displayed when user clicks on link. first time form opened, works fine; form submitted server, , part of page updated.however, subsequent attempts use form problems start. when click on hyperlink second time, (with closing dialog or without closing dialog), showing old values. happens if navigate different screen in application , return. content of page re-rendered after each submission includes form makes dialog, 'old' values being submitted no longer exist in page markup. being somehow 'remembered' jquery ui. $(document).on("click", "#hyperlink", function () { $("#divsection").dialog({ title: "user details", resizable: false, autoopen: false, height: 'auto', width: 300, appendto: "form" }); }); i don't know how work around behaviour, can please me how ...

rest - Best HTTP Response Code for a Restful Api which makes calls to other Web Services when a failure occurs -

so i'm designing restful api makes calls other web services aggregates result , return client. if connection of of other web services fails reason, best thing return? right returning 500 - internal server error client return more details client on made request fail. redundant return 500 http response code response body containing message detailing error occurred or return 503 - service unavailable http response code? your response code should depend on can request. if clients can expect in case receive partial information , message indicating remote data feeds unavailable, send 200. not include http codes or failing uris in response, names of providers unavailable, , possibly reason why. if do, may find broken when need add non-uri-based providers. if must, make sure include "type" , require clients use it. partially future-proof you, expect many clients ignore type , break if add new types later. if clients can't partial data, should return 503 beca...

sbt - managed resource available only for freshly cleaned project -

i created sbt autoplugin generates resources: https://github.com/sphereio/json-schema-inliner/ (thx why doesn't custom resourcegenerator executed upon compile? , fix first problem.) there test project generates "test/inline/category.schema.json" example. the test project in git well: https://github.com/sphereio/json-schema-inliner/tree/master/testproject this generated resource available freshly cleaned project: cd testproject ▶ sbt clean run [...] [info] running main url test/category.schema.json: file:/users/yannsimon/projects/json-schema/testproject/target/scala-2.10/classes/test/category.schema.json url test/inline/category.schema.json: file:/users/yannsimon/projects/json-schema/testproject/target/scala-2.10/classes/test/inline/category.schema.json when running again, managed resource disappears "testproject/target/scala-2.10/classes/test/inline" ▶ sbt run [...] [info] running main url test/category.schema.json: file:/users/yannsimon/proje...

How we add a cookie value to an existing cookie in php -

this code not getting cookie value in page if (isset($_cookie['mycookie'])) { $cookie[] = $proid; $cookie = implode(',', $cookie); $cookie = unserialize($cookie); setcookie('mycookie', serialize($cookie), time() + (86400 * 30), '/'); } you doing isset($_cookie['mycookie']) check if $_cookie['mycookie'] set or not, return true if set else false . , if setting inside if block first time never set. should - if(!isset($_cookie['mycookie'])) // set cookie }

delphi xe - TObjectList re-order -

i need re-order tobjectlist, according rules. how can achieve this? so add panels scrollbox dinamically. when add them, add them objectlist in order added @ runtime, future use. can re-organize panels in scrollbox drag/drop. want objectlist mirror same order set @ runtime drag/drop. here code: var mainform: tmainform; panellist,panellisttmp:tobjectlist; implementation ... procedure tmainform.formcreate(sender: tobject); begin panellist:=tobjectlist.create; panellisttmp:=tobjectlist.create; end; procedure tmainform.button1click(sender: tobject); begin addpanel('0'); addpanel('1'); addpanel('2'); addpanel('3'); addpanel('4'); end; procedure tmainform.addpanel(what:string); var pan:tpanel; bv:tshape; begin pan:=tpanel.create(self); pan.parent:=thecontainer; pan.height:=50; pan.bevelouter:=bvnone; pan.borderstyle:=bsnone; pan.ctl3d:=false; pan.name:='layerpan'+what; pan.caption:=what; pan....