Posts

Showing posts from June, 2014

javascript - How to define Spring WebSocket subscriber path -

i want know how define subscriber path. for instance, declaration of subscribing path stompclient.subscribe("/topic/simplemessagesresponse", function(servermessage) { why there 2 parts 'topic' , 'simplemessageresponse' .. refere. how many such domain parts can there , why ? question on not client side, server side . simpmessagingtemplate.convertandsend("/topic/simplemessagesresponse", "message client"); there tutorials showing websocket server , client samples. no enough details of rules declare subscriber path , how subscriber path found. what dependencies change path when declared in server , client side. think similar question raised because of location change of page websocket client written. quoting stomp spec documentation: note stomp treats destination opaque string , no delivery semantics assumed name of destination. should consult stomp server's documentation find out how construct

numpy - Organizing column and header data with pandas, python -

i'm having go @ using numpy instead of matlab, i'm relatively new python. my current challenge importing data in multiple file in sensible way can use , plot it. data organized in columnes (temperature, pressure, time, etc, each file being measurement period), , decided pandas best way import data. thinking of using top-leve descriptor each file, , subdescriptors each column. thought of doing this. reading multiple csv files python pandas dataframe the problem i'd retain , use of data in header (for plotting, instance). there's no column titles, general info on data mesaurements, this: flight id: xxxxxx date: 01-27-10 time: 5:25:19 owner release point: xx.304n xx.060e 11 m serial number xxxxxx surface data: 985.1 mb 1.0 c 100% 1.0 m/s @ 308 deg. i don't know how extract , store data in way makes sense when combined data frame. thought of perhaps dictionary, i'm not sure how split data efficiently since there's no consistent divider.

asp.net - XSLT 1.0 Substring then select distinct -

i quite new xslt, appreciated. below sample xml file. <documentelement> <records> <date>2014-07-01 00:00</date> </records> <records> <date>2014-08-03 00:00</date> </records> <records> <date>2013-08-03 00:00</date> </records> <documentelement> what need select distinct years dates. currently have below xslt brings duplicate years. <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" xmlns:ms="urn:schemas-microsoft-com:xslt"> <xsl:output method="xml" indent="yes"/> <xsl:template match="/"> <xsl:variable name="years" select="documentelement/records/date"/&

html - TD width not changing with input fields -

my goal make each td have width of 100px should make input fields 100px . however, when added width="100" td , nothing happens. here's html code: <table> <tr> <td>2.</td> <td width="100"> <input type="text" name="year2" id="year2" value="" /> </td> <td width="100"> <input type="text" name="make2" id="make2" value="" /> </td> <td width="100"> <input type="text" name="vin2" id="vin2" value="" /> </td> <td width="100"> <input type="text" name="radius2" id="radius2" value="" /> </td> <td width="100"> <input type=&quo

java - How to configure wildfly to use EclipseLink? -

i have installed wildfly 8.1 , because have project configured use eclipselink, have tried configure wildfly use it. however, same error : at org.jboss.as.server.deployment.deploymentunitphaseservice.start(deploymentunitphaseservice.java:166) [wildfly-server-8.1.0.final.jar:8.1.0.final] @ org.jboss.msc.service.servicecontrollerimpl$starttask.startservice(servicecontrollerimpl.java:1948) [jboss-msc-1.2.2.final.jar:1.2.2.final] @ org.jboss.msc.service.servicecontrollerimpl$starttask.run(servicecontrollerimpl.java:1881) [jboss-msc-1.2.2.final.jar:1.2.2.final] @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1145) [rt.jar:1.7.0_25] @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:615) [rt.jar:1.7.0_25] @ java.lang.thread.run(thread.java:724) [rt.jar:1.7.0_25] caused by: javax.persistence.persistenceexception: jbas011466: persistenceprovider ' org.eclipse.persistence.jpa.persistenceprovider ' not found @ org.jboss.

php - Is it possible to pass a route parameter to controller constructor in Laravel? -

is possible inject route-paramter (or route segment) controller-constructor? you find code clarify question. class testcontroller{ protected $_param; public function __construct($paramfromroute) { $this->param = $paramfromroute; } public function testaction() { return "hello ".$this->_param; } } ---------------------------------------------------- app::bind('testcontroller', function($app, $paramfromroute){ $controller = new testcontroller($paramfromroute); return $controller; }); ---------------------------------------------------- // here should magic route::get('foo/{bar}', 'testcontroller'); it's not possible inject them, have access of them via: class testcontroller{ protected $_param; public function __construct() { $id = route::current()->getparameter('id'); } }

Elegant way for exiting a function neatly without using goto in C -

we write functions have more 1 exit point (that is, return in c). @ same time, when exiting function, general works such resource cleanup, wish implement them once, rather implementing them @ every exit point. typically, may achieve our wish using goto following: void f() { ... ...{..{... if(exit_cond) goto f_exit; }..}.. ... f_exit: general work such cleanup } i think using goto here acceptable , , know many people agree on using goto here. just out of curiosity , there exist elegant way neatly exiting function without using goto in c? why avoid goto ? the problem want solve is: how make sure common code gets executed before function returns caller? issue c programmers, since c not provide built in support raii. as concede in question body, goto acceptable solution . never-the-less, there may non-technical reasons avoid using it: academic exercise coding standard compliance personal whim (which think motivating question) there more 1

javascript - C# convert HTML markup with svg code to PDF -

i working on asp .net 3.5 framework web form application. have html page kendo ui chart , other html tags. i want convert page pdf. tried pechkin posting html string code behind. displays svg data normal text , renders html properly. svg not displayed image. i have code converts svg xml bitmap image. how add image pdf instead of svg xml (something replacing svg xml tag)

networking - Display the network connection 2g/3g or 4g in a toast -

i display in toast network connection available. when start app shows me layout, doesn't make toast. did forget something? // shows every second toast. beginns right 1 goes next one.. have button now, shows me networktyp in textview. show 4g.. in advance help! button start; textview ergebniss; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); start = (button)findviewbyid(r.id.start); start.setonclicklistener(this); ergebniss = (textview) findviewbyid(r.id.textview1); } public void getnetworkclass(context context) { telephonymanager mtelephonymanager = (telephonymanager) context .getsystemservice(context.telephony_service); int networktype = mtelephonymanager.getnetworktype(); switch (networktype) { case telephonymanager.network_type_gprs: case telephonymanager.network_type_edge: case telephonymanager.network_type_cdma:

How to add a new column to SSIS destination -

i added new field ole db source in ssis package. goes flat file destination. in flat file destination object, field shows under available inpt columns doesnt show anywhere else (available destination columns, or bottom box lists fields) how available destination field? go flat file connection manager used destination object, go advanced, , click "new", add column properties.

How to set chef data bag values via Jenkins? -

i posted " how set chef attributes via jenkins? " answered correctly, is, using "-j" option. however, if want set load version in data bag in jenkins cookbooks can use it? don't want use "-j" option , instead search value in data bag? how do set chef data bag values via jenkins best way: use knife commands upload predfined or generated databags. knife data bag file bag json_file_for_item the file must have defined format, extended documentation here there's requirements on file system hierarchy and on file format, copying doc here sounds bad idea.

jquery - Laravel - Dynamic select menu -

i'm trying dynamically set options in select menu first selecting option in first select menu. example: user selects company in 1 select menu. in second select menu locations belong selected company set. here view <div class="form-group"> <select class="form-control admin-select" name="admin-select"> <option>- select -</option> <option value="1">company 1</option> <option value="2">company 2</option> <option value="3">company 3</option> </select> </div> <div class="form-group"> <select id="location" class="form-control" name="location"> <option>- select -</option> </select>

c++ - Doxygen command paragraph (hanging) indentation limitations? -

are there limits how indentation can used on multi-line (paragraph) commands? consider typical use-case of @details in context of function: /** * @brief foo. * @details lorem ipsum dolor sit amet, mentitum rationibus nec an. * usu magna eirmod et, aperiri discere volumus pri ex. * * te pro alii vidit, cu nonumes mediocritatem duo. * paulo detracto tincidunt id vim, ad has oblique percipit. * * @tparam t argument type. * @param param1 first parameter. * @param param2 second parameter. * @return return value. */ template< typename t > inline t foo( t const& param1, t const& param2 ); the long @details paragraphs have wrapped, leads question of there restrictions on indentation? i know doxygen uses markdown, has specific indentation restrictions / uses, such "4 space indentation" codeblocks. indentation above confuse or conflict in cases wanted insert code? more generally, there other indentation uses , pos

php - wordpress data serialize in corresponding order -

in wordpress have stored data serialize method means title 1st row named title[1], 2nd row title[2] , 3rd title[3] , on. method same fields(name,phone). after storing data serialize want fetch data. fetch have script this $results = $wpdb->get_results("select * `table` `id` = 4"); now when doing print_r($results); getting result this array ( [0] => stdclass object ( [id] => 4 [title] => a:3:{i:1;s:8:"title1";i:2;s:8:"title2";i:0;s:0:"title3";} [name] => a:3:{i:1;s:8:"name1";i:2;s:8:"name2";i:0;s:0:"name3";} [phone] => a:3:{i:1;s:8:"123";i:2;s:8:"324";i:0;s:0:"648";} ) ) to use data have used unserilize , foreach this foreach($results $result) { $titles = unserialize($result->title); $names = unserialize($result->name); $phones = unserialize($result->phone); fore

spring - Is there any analog of XML resources mapping for Java based configuration? -

my problem related access resources. more specific jsp couldn't access js , css (resources). there analog of xml tag <mvc:resources mapping="/resources/**" location="/web-inf/resources/"/> java based configuration? my configuration class @enablewebmvc @configuration @componentscan("com.springapp.mvc") @propertysource("classpath:names.properties") public class webmvcconfig extends webmvcconfigureradapter { @bean public internalresourceviewresolver setupviewresolver() { internalresourceviewresolver resolver = new internalresourceviewresolver(); resolver.setprefix("/web-inf/pages/"); resolver.setsuffix(".jsp"); return resolver; } // other beans } founded! need add method config class. @override public void addresourcehandlers(resourcehandlerregistry registry) { registry.addresourcehandler("/resources/**").addresourcelocations("/web-

ios - How can I tell if a Springs and Struts app is scaling in the iPhone 6 simulator? -

i have couple applications built pre-auto-layout (but w/ springs , struts support iphone 5+) i'm trying out in iphone 6 , 6 plus simulator , quite good. however, can't tell if springs , struts doing job so-to-speak or if they're being scaled. there must obvious thing i'm missing says which? also, auto-layout apps automatically convert when recompiled latest sdk iphone 6 they're not scaling long 3x artwork provided (in case of 6 plus)? you can see, if app runs in scaled mode outputting bounds , native bounds screen of main screen: println("bounds = \(uiscreen.mainscreen().bounds)") println("nativebounds = \(uiscreen.mainscreen().nativebounds)") without designated launch images output of iphone 6 plus simulator is: bounds = (0.0,0.0,320.0,480.0) nativebounds = (0.0,0.0,960.0,1440.0) the native bounds 3 times scaled bounds. reason behind @3x display.scale. in case of iphone 6 plus nativescale helps: println("main s

exchangewebservices - Exchange Web Service listing items of a folder -

i getting error message ms exchange: the ews id in ewslegacyid format not supported exchange version specified request. please use convertid method convert id ewsid ewslegacyid format. in response following soap request: <?xml version="1.0" encoding="utf-8"?> <soap:envelope xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:header> </soap:header> <soap:body> <m:finditem traversal="shallow"> <m:itemshape> <t:baseshape>default</t:baseshape> <!-- <t:additionalproperties> <t:fielduri fielduri="item:textbody" /> <t:fielduri fielduri="item:body&quo

jquery - fancybox2 / fancybox causes page to to jump to the top -

i have implemented fancybox2 on dev site. when engage fancybox (click link etc) whole html shifts behind - , goes top. have working fine in demo, when drag same code project jumps top. not links inline divs, simple image gallery. has experienced this? this can done helper in fancybox 2. $('.image').fancybox({ helpers: { overlay: { locked: false } } }); http://davekiss.com/prevent-fancybox-from-jumping-to-the-top-of-the-page/

php - Multiple (unwanted) executions when passing parameter to controller -

i'm using codeigniter, i have controller called 'property' action called 'details' the function defining 'details' action takes 2 parameters: so have url : example.com/property/details/23/appartment-for-rent the first parameter id of record on db, 2nd parameter seo purposes the details action increments views of record on db problem : when use http://example.com/property/details/23 works fine when use seo link http://example.com/property/details/23/appartment-for-rent the script executes several times causes views count inaccurate. here controller/action function: public function details($propertyid){ $this->load->model('model_property'); $pagedata['property'] = $this->model_property->getbyid($propertyid); if($pagedata['property']!=null){ $this->model_property->incrementviewbyid($pagedata['property']->id); $this->load->view('

arrays - Function returning elements of a multi-dimensonal list in python -

i trying define function returns elements of multi-dimensional variable according nested list of indices. working variables depending on multiple dimensions like, e.g.: time, altitude, latitude, longitude. make 3d (e.g., time, altitude , latitude): x = np.arange(125).reshape(5,5,5) if want first 4 time steps, first 3 altitude levels , first 2 latitudes can several things: x[[0,1,2,3],:,:][:,[0,1,2],:][:,:,[0,1]] or x[ [[[0]],[[1]],[[2]],[[3]]],[[0],[1],[2]],[0,1]] or x[np.ix_([0,1,2,3],[0,1,2],[0,1])] but have function giving me elements def get_elements( x, l ) where l list of indices l = [[0,1,2,3],[0,1,2],[0,1]] how function like? last alternative comes pretty close x[np.ix_(l)] gives me indexerror . moreover, great have opportunity leave dimensions untouched. e.g., using time steps in pseudo-code: l = [[:],[0,1,2],[0,1]] thanks lot! note signature of np.ix_ : np.ix_(*args) so need 'expand' l : x[np.ix_(*l)] take @ code

c# - How Can I Generate Nhibernate GROUP BY without SELECT the property -

i'd resolve problem : select max(date) table group subid (then pass subquery mid-action can id of item in table) select id table date in [[[ previous request ]]] (then full table item other table join) select * table left join... id in [[[ previous request ]]] i tried kind of request : var subquery = queryover.of<table>(() => x) .selectlist(list => list .selectmax(() => x.date) .selectgroup(() => x.sub.id) ); var filter = queryover.of<table>().withsubquery. whereexists(subquery) .select(p => p.id); var result = session.queryover<table>().withsubquery.whereproperty(p => p.id).in(filter).left.joinqueryover(p => p.sub).list(); but problem can't first request right date out of request. there better way kind of subqueries ? , there possibility in nhibernate groupy property with

c# - How to know when all my Producer - Consumer jobs have finished -

i have winforms application read several network folders , search files inside folders, function receive list<stirng> folders : private decimal _numberoffiles; private static list<string> _folders; public delegate void onfileadddelegate(list<string> files); public event onfileadddelegate onfileaddeventhandler; public delegate void onfinishsearchdelegate(); public event onfinishsearchdelegate onfinishsearcheventhandler; public void searchfiles() { foreach (string folder in _folders) { if (directory.exists(folder)) { var files = directory.enumeratefiles(folder, "*.doc", searchoption.topdirectoryonly) .orderbydescending(x => new fileinfo(x).creationtime).take((int)_numberoffiles).tolist<string>(); if (onfileaddeventhandler != null) onfileaddeventhandler(files); } } if (onfinishsearcheventhandler != null) onfinishsearcheventhandler(); } aft

c - Using Double Pointers after memory allocated within function -

i playing double pointers in c , wondering if create function initializes table, crashes on going main when try make use of memory allocated initstringtable. believe simple fix make strtable global , believe ok, prefer not more of learning exercise me in passing table around modification i.e. should able modify strtable main or function modifytable after initstringtable. can give. int main() { char** strtable; // allocates memory string table. initstringtable(strtable); // below lines should able copy strings newly allocated table. // below lines cause crash however. strcpy(strtable[0], "abcdef"); strcpy(strtable[1], "xy"); } // allocates memory string table. function should create table // of size 10 strings each string 50 chars long. code compiles fine. void initstringtable(char** table) { int = 0; table = (char**)malloc(sizeof(char)*10); for(i = 0; < 10; i++) { table[i] = (char*)malloc(sizeof(char)*50);

javascript - Node.js server no response -

i'm using node.js , express (express-generator) create website. had working fine yesterday afternoon, guess changed , doesn't work now. firewall turned off. i following on console. c:\website>node bin/www listening on 8080 / - - ms - - / - - ms - - / - - ms - - each of get / - - ms - - happens each time try go 127.0.0.1:8080 here bin/www file: #!/usr/bin/env node var debug = require('debug')('test'); var app = require('../app'); app.set('port', process.env.port || 8080); var server = app.listen(app.get('port'), function() { console.log("listening on " + server.address().port); debug('express server listening on port ' + server.address().port); }); and app.js: var express = require('express'); var path = require('path'); var favicon = require('serve-favicon'); var logger = require('morgan'); var cookieparser = require('cookie-parser'); var bodyparser =

How does DataBound works on Kendo Grid -

i'm displaying @ least 5 different types of notes, i.e. client note, system note, project note, contact note, , forth using same kendogrid . depending on type of note want edit, i'll need disable of dropdownlist or texbox controls. in asp.net gridview control, i'd plug logic inside ondatabound method, row that's being edited, , search controls want interact with. i've noticed kendogrid has databound event this databound: function (e) { //... } is possible know access row being edited? if so, possible access underlining data? maybe there event such onediting . thank helping. there edit event kendoui grid . believe looking for.

Elegant data processing in Python -

i don't know how name problem - have list of tuples in python: (int, str, datetime, float) there bunch of rows in list, sorted datetime , i'd count how rows in 5 minute time span, have floats in given range, i.e. 0 2, 2 5, 5 10 , on. mean, given such data (date not string, datetime.datetime): (1, 'abc', '2014-09-10 17:50:34', 5.5) (2, 'abc', '2014-09-10 17:51:34', 1.5) (3, 'abc', '2014-09-10 17:52:14', 7.1) (4, 'abc', '2014-09-10 17:59:34', 9.5) (5, 'abc', '2014-09-10 17:59:54', 9.2) i'd receive kind of dictionary: { the_end_of_time_interval1: {'0to2': int, '2to5': int, '5to10': int, ... }, the_end_of_time_interval2: {'0to2': int, '2to5': int, '5to10': int, ... }, ...} for example: { '2014-09-10 17:52:34': { '0to2': 1, '2to5': 0, '5to10': 2, '10to15': 0 }, '2014-09-10 17:59:54'

MongoDB: Determine index of item in array -

is there way determine index of retrieved item in array in mongodb? i have array of object ids inside document. { ids: [id1, id2, id3, ...] } i search array id3 , , if it's found, want position of object added result. in case, it's can insert more objects after in array. if can't this, how go creating ordered list of objects can retrieve , modify position of elements in ordered list (since insert operation on list result in modifying position of elements after insert)? answer: obtaining positional index not supported in mongodb . open new question redesigning application deal limitation. everyone! the way see it, have 2 choices: retrieve whole array, mutate wish in language of choice, , update array in db new array. come data structure supports whatever trying do.

jquery - tipr tooltip z-index not working -

i've problem tooltip: want show tooltip on div.container, tried edit z-index(1 in div.container, 9999 in tooltip), nothing works. jsfiddle: http://jsfiddle.net/9mss22xz/ div.tip { background-color: #f3f3f3; border: solid 1px #cfcfcf; -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; height: 55px; width: 55px; float: left; margin: 4px; text-align: center; position: relative; } div#container { width: 200px; height: 200px; overflow-y: scroll; border: 2px solid black; margin: auto; } can me? simply add wrapping container , add position: relative main one. please see working fiddle here .

Change color when hover a font awesome icon? -

base in font awesome documentation create icon: <span class="fa-stack fa-5x"> <i class="fa fa-circle fa-stack-2x"></i> <i class="fa fa-flag fa-stack-1x fa-inverse"></i> </span> this code create html: <span class="fa-stack fa-5x"> <i class="fa fa-circle fa-stack-2x">::before</i> <i class="fa fa-flag fa-stack-1x fa-inverse">::before</i> </span> it stacked flag icon. want change icon color on hover event, tried these: .fa-stack:hover{ color: red } .fa-stack i:hover{ color: red } .fa-stack before:hover{ color: red } but not working. if want change colour of flag on hover use this: http://jsfiddle.net/uvamhedx/ .fa-flag:hover { color: red; } <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/> <i class="fa fa-flag fa-3x&q

java - ContentResolver delete multiple -

i know record can deleted this: getcontentresolver().delete(events.content_uri, events._id + " =? ", eventid); where eventid string array containing, in case event's id. in case, don't want delete 1 event, multiple. i've got array of eventids containing multiple eventids. of course loop through array , delete events 1 one, possible delete them using 1 call? try code, arraylist<contentprovideroperation> operationlist = new arraylist<contentprovideroperation>(); contentprovideroperation contentprovideroperation; (/*loop on arraylist*/) { contentprovideroperation = contentprovideroperation.newdelete(events.content_uri).withselection(events._id + " =? ", new string[]{yourid}).build(); operationlist.add(contentprovideroperation); } try { getcontentresolver().applybatch(contract.authority, operationlist); } // catch exceptions more info: contentprovideroperation

iis - convert .htaccess to web.config on iis7 -

first .htaccess in root setenv application_env development <files *.ini> require valid-user </files> <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewritecond %{request_filename} !-f rewriterule ^lib(.*)$ ./lib/$1 [l] rewriterule ^(.*)\.(.*)$ ./public/$1.$2 [l] rewriterule ^(.*)$ ./public/$1/ [l] </ifmodule> second .htaccess in /public/ rewriteengine on rewritebase /public rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)/$ ./?page=$1&%{query_string} [l] i used rules import iis7 it's not work. when debug this, feel second web.config not read. in browser, url redirected http://www.url.be/fr/ , have error message 404. works, url http://www.url.be/?page=fr i'm lost! guy

Gradle Error configurations.add String cannot be cast to Configuration -

my gradle file says configurations.add "externaldeps" if run gradle 1.4 don't have problem. if run gradle 2.0 following error: caused by: java.lang.classcastexception: java.lang.string cannot cast org.gradle.api.artifacts.configuration @ org.gradle.api.artifacts.configuration$namer.determinename(configuration.java:87) @ org.gradle.api.internal.defaultnameddomainobjectcollection.add(defaultnameddomainobjectcollection.java:70) @ org.gradle.api.nameddomainobjectcollection$add$0.call(unknown source) @ build_3p9qdtholqj79o8rnevdt3d7t0.run(d:\code\trunk\projects\build.gradle:6) @ org.gradle.groovy.scripts.internal.defaultscriptrunnerfactory$scriptrunnerimpl.run(defaultscriptrunnerfactory.java:52) ... 82 more what has changed causing error? how should defining now? the manual explains how create configuration: configurations { externaldeps } the dsl documentation shows configuration container has method create(): confi

Astyle C++ enum class indentation -

is there way of getting astyle indent enum class elements same depth? i getting following: enum class test { test1 = 1, test2 = 2, test3 = 3, test4 = 4 }; whereas want like: enum class test { test1 = 1, test2 = 2, test3 = 3, test4 = 4 }; large enums indented far right. current options kr style, options: s l c n.

linux - GridGain 6.2.0 / 6.2.1 : too many file descriptors open -

after upgrading gridgain 6.2.0, on mac , linux "too many open files" exceptions when running our junit test case suite. individual test cases run fine on their. these errors when run entire suite. has changed in number of files gridgain keeps open in 6.2.x? here example of exception on mac (on linux, error similar stems nio package). increasing open file limit addresses on os resolves issue issue bug or additional upgrade item noted? thanks [2014-09-10 12:02:49,396] error gridtcpdiscoveryspi - failed accept tcp connection on mac os may have many file descriptors open (simple restart solves issue) [] java.net.socketexception: invalid argument @ java.net.plainsocketimpl.socketaccept(native method) @ java.net.abstractplainsocketimpl.accept(abstractplainsocketimpl.java:398) @ java.net.serversocket.implaccept(serversocket.java:530) @ java.net.serversocket.accept(serversocket.java:498) @ org.gridgain.grid.spi.discovery.tcp.gridtcpdiscoveryspi$tcpserver.body(gridtcpdiscover

sql server - Get ID of newly inserted record in SQL database -

i using detailsview insert records database, confirmation appear after insert displays id of new record. using following code: protected sub detailsview1_iteminserted(sender object, e detailsviewinsertedeventargs) handles detailsview1.iteminserted dim strconnstring string = configurationmanager.connectionstrings("houses").connectionstring dim con new sqlconnection(strconnstring) dim cmd new sqlcommand() cmd.commandtext = "select @@identity" cmd.connection = con try con.open() dim obj object = cmd.executescalar() response.write("<div class=newlisting> record ") response.write("<span class=deletedlistinghighlight>") response.write(obj.tostring) response.write("</span> added.</div>") catch ex exception throw ex con.close() con.dispose() end try end sub the confirmation appears @ top of page not

wordpress - Parse error: syntax error, unexpected '}' /functions.php on line 1 -

this functions.php file in wordpress theme installation. http://pastebin.com/rfaxbyup can me figure out why getting error? thanks! you have no line breaks in code, makes incredibly difficult you. but in code gave us, have <?php} 2 times. isn't correct. should <?php } space between php , brace.

Using C# to create the Twitter authorization header for search -

i'm writing write c# method generate authentication header twitter. i'm trying search twitter through api: https://api.twitter.com/1.1/search/tweets.json . here's url call: https://api.twitter.com/1.1/search/tweets.json?q=%23countryman+or+%23johncooperworks+or+%40mini%26since_id%3d24012619984051000%26max_id%3d250126199840518145%26result_type%3dmixed%26count%3d4 here's method: private string gettwitterauthheader() { const string oauthconsumerkey = ""; const string oauthconsumersecret = ""; const string oauthtoken = ""; const string oauthtokensecret = ""; const string oauthversion = "1.0"; const string oauthsignaturemethod = "hmac-sha1"; var oauthnonce = convert.tobase64string(new asciiencoding().getbytes(datetime.now.ticks.tostring(cultureinfo.invariantculture))); var timespan = datetime.utcnow - new datetime(1970, 1, 1, 0, 0, 0, 0, datetimekind.utc); var oauthtim

javascript - fadeIn starts from the beginning after mouseleave (setTimeout) -

i looking solution navigation menu working. here jsfiddle can see working code. the fadein effect needs happen on nav-item hover, happening while mouseleave bottom, left or right side of menu. it looks want is: when move mouse tab tab, don't want fade-out , in happen. in case, it's because you're not keeping track of whether or not menu open. should fading if menu not open, otherwise hide , show no fade. code: var timer; var ismenuopen = false; $('.nav-item').hover( function() { $('.subnav--main').hide(); $('.promoted-content--main').hide(); cleartimeout(timer); if(ismenuopen){ $(this).find('ul').show(); } else{ ismenuopen = true; $(this).find('ul').fadein( 'slow' ); } }, function() { timer = settimeout(function() { $('.subnav--main').fadeout( 'fast' ); $

Group an array on the basis of array keys in php -

i have array structure this,which coming loop: $a = array('9-aug','$50','room1'); $b = array('10-aug','$60','room1'); $c = array('9-aug','$70','room2'); $d = array('10-aug','$80','room2'); i need data this(i.e) group data on basis of date: ['9-aug-2014']=>{ [0]=>{'$50','room1'}, [1]=>{'$70','room2'} } ['10-aug-2014']=>{ [0]=>{'$60','room1'}, [1]=>{'$80','room2'} } is there function ? have tried using array_map, can't desired o/p. here have tried: $e = array_map(null, $a, $b, $c,$d); print_r($e); and got: array ( [0] => array ( [0] => 9-aug [1] => 10-aug [2] => 9-aug [3] => 10-aug ) [1] => array

c++ - Effective way of signaling and keeping a pthread open? -

i have code trying run intense matrix processing, thought faster if multithreaded it. however, intention is keep thread alive can used in future more processing. here problem, multithreaded version of code runs slower single thread, , believe problem lies way signal/keep threads alive. i using pthreads on windows , c++. here code thread, runtest() function matrix calculations happen: void* playqueue(void* arg) { while(true) { pthread_mutex_lock(&queuelock); if(testqueue.empty()) break; else testqueue.pop(); pthread_mutex_unlock(&queuelock); runtest(); } pthread_exit(null); } the playqueue() function 1 passed pthread, , have of now, there queue (testqueue) of lets 1000 items, , there 100 threads. each thread continue run until queue empty (hence stuff inside mutex). i believe reason multithread runs slow because of called false sharing (i think?) , method of signaling thread call runte

html - Bootstrap nav collapse - Menu items not aligning in toggle dropdown -

i implemented bootstrap 3 navbar collapse change navbar collapse having problem toggle on nav. i put in min-width: 992px make menu hover open rather toggle desktop sizes. ul.nav li.dropdown:hover ul.dropdown-menu { display: block; } /* adding hover effect bs navbar md size , */ .dropdown-menu > li > { text-align: right; } the problem i'm having when toggle menu item in sm size. dropdown menu doesn't toggle directly below. goes off right hand side. can't seem find css selector putting directly below while other items "move out of way" this happening bootstrap menu dropdown http://i57.tinypic.com/a4ogm0.png i want sm-size bootstrap menu dropdown http://i59.tinypic.com/2j4xzkx.png tried insert code bootply... doesn't collapse on there though??? http://www.bootply.com/q2fqp7kfak found out css changing collapse had a .navbar-nav>li { float: none; } that caused drift off side until hit xs! remov

java - Abstract Data Types, sorting objects by specific variable in a list -

alright here go. i made adt in form of sortedarraylist, has add method looking this: public boolean addtoarray(t i) { int insertplace = 0; for(int j=0;j<size;j++) { if(i.compareto(sortedarray[j])<0) { insertplace =j; j = size; } } if(size>0) { for(int w=size-1; w>=insertplace;w--) { sortedarray[size]=sortedarray[w]; } sortedarray[insertplace]=i; } else { sortedarray[0]=i; } size++; return true; } now, works wonders sorted adt when input strings. however, instead of strings, want add objects list in shape of persons,

c++ - Gtest with large C and C ++ codebase -

i project have large codebase , has no unit tests framework @ all.the code working on run on box acts switch/router/firewall. so working on piece of code needs unit-tested using gtest. problem have mocking variables in order test function itself. eg have function uses 4 pointers different objects , uses couple of global variables .in order test different paths in code need initialize entire state machien/values of dependent variables. adding complexity true in large codebase function/method have written uses bunch of other routines/methods needs tested well. each of needs uni-tested each of them having own dependencies. not sure whether approching problem right or case gtest may not right tool testing such large code-base. if has experience testing call-stack say function { code code function b code code function c code } function b { function d code function e } function c{ code function f function g code } someth

php - Getting fetch_object() error on a successful query -

i'm getting error: fatal error: call member function fetch_object() on non-object in c:\.....php on line 136 here's code: if ($result = $mysqli->query("insert partlistlist ( p_fam , p_code , p_name, p_var , p_ver , p_lnk , p_fol , p_notes , p_status , p_op ) values ( \"".$mod_fam ."\", \"".$mod_code ."\", \"".$mod_name ."\", \"".$mod_var ."\", 1 , \"".$mod_lnk ."\", \"".$mod_fold ."\", \"".$mod_note ."\", \"".$mod_stat ."\", \"". $_session['wh_pwd_usr']."\" ) ")); { echo "<br>articolo creato con successo"; $created_id = $mysqli->insert_id; if (!$result = $mysqli->query("select * partlistlist p_id = $created_id limit 1")) echo "error"; $row = $result->fetch_object(); $p_id = $created_id;