Posts

Showing posts from May, 2013

javascript - Click function not working on dynamically added div -

this question has answer here: event binding on dynamically created elements? 19 answers <button id="add_tab">add tab</button> <input id="text-search" type="text"/> <div id="tabs"> <ul> <li><a href="#tabs-1" style="padding:0;"><span class="color-bar">&nbsp;</span><div class="alert-header">alert #1</br><span class="time-date">5:30pm - 07/11/2014</span></div><span class="ui-icon ui-icon-close" role="presentation">remove tab</span></a></li> <li><a href="#tabs-2" style="padding:0;"><span class="color-bar">&nbsp;</span><div class="alert-header">alert #2</br><

jsf 2 - Get file url in JSF 2.2 -

i trying make openfiledialog in backing bean, can url of local file. seems standard jsf library not support open/save file dialog. there way of getting url of file similar openfiledialog? here has happen: click on button --> send action backing bean --> show openfiledialog --> url of file --> add url of file list of strings. i not sure how accomplish bold steps above. there can give me leads or accomplish this? (i using jsf & primefaces, prefer not use external library if possible.) since you're using jsf 2.2 primefaces, why not use primefaces component itself? below primefaces 5.0 showcase example basic file upload: <h:form enctype="multipart/form-data"> <p:growl id="messages" showdetail="true" /> <p:fileupload value="#{fileuploadview.file}" mode="simple" skinsimple="true"/> <p:commandbutton value="submit" ajax="false" actionl

c# - Method which accepts both int[] and List<int> -

question: write single method declaration can accept both list<int> , int[] my answer involved this: void testmethod(object param) // object base class can accept both int[] , list<int> but not intended answer, said so. any ideas how method signature ? you can use ilist<int> both, int[] , list<int> implement: void testmethod(ilist<int> ints) on way can still use indexer or count property( yes, array has count property if cast ilist<t> or icollection<t> ). it's greatest possible intersection between both types allows fast access, using for -loops or other supported methods . note methods not supported if can called add , you'll notsuportedexception @ runtime("collection of fixed size") if use array.

while loop - Paging in Mule ESB -

we have mule flow processes bunch of records. want implement paging because 1 of steps in process calling external system can take set amount of records @ time. we have attempted solve adding choice in flow checks if there more records process , if yes call same flow again (self reference flow) caused stackoverflow errors. we have tried using until-successful scope need errors break out of loop , caught exception strategy. thanx mule possesses ability process messages in batches http://www.mulesoft.org/documentation/display/current/batch+processing it best option requirement.

c++ - icon for QT app -

i'm using qtcreator build application on mac. @ time application icon default 1 set qt creator. i set 1 custom specific app. what have in in .qrc file, have added <rcc> <qresource prefix="/"> <file>main.qml</file> <file>images/logo.icns</file> </qresource> </rcc> i have made try on main.cpp adding qicon icon(":images/logo.icns"); qapplication app(argc, argv); app.setwindowicon(icon); it doesn't work... have tried in class in define how window of app done qicon icon(":images/logo.icns"); qmainwindow *window = new qmainwindow(); window->setwindowtitle(qstring::fromutf8("puls")); window->resize(600, 600); qwidget *centralwidget = new qwidget(window); centralwidget->setwindowicon(icon); it's not working. the icon's path may incorrect. try change qicon icon(":images/logo.icns"); to qicon icon(":/images/

javascript - jQCloud - how to clear it? -

i'm using script showing tag-cloud here . var word_list = gettags(); $("#example").jqcloud(word_list); <div id='example'></div> i'm loading tags dynamically different sources clicking on button. first time shows the tags properly, next time "adds them up" tags there. need clear or refresh tag-cloud somehow, tried this: $('#example').val(''); and there no luck. is there way @ all? you may try using this: $('#example').html(""); the .val method used or set values of form elements such input, select , textarea. won't set value of div trying to.

android - combobox labels to movieclip frames that are on same frame as3 -

hi making android app on flash cs5 helper "mmorpg" game. in app have 3 buttons named flux, naptha , food flavor, lead list of 11 comboboxes named cb1-11. buttons work on same frame (they clear list of each combobox , add theres), on each combobox there 67 labels. on same frame there 11 movieclips namend mv1 - 11 have 67 frames each. what want make each label gotoandstop on spesified frame in movie clip. want make application save data user able load list agen. oh , cant seem make exit buton work. p.s. beginner in actionscript 3.0 rather have answer explained in detail. here example of 1 of comboboxes. import flash.events.mouseevent; function fluxlist():void { cb1.additem( { label: "choose herb" } ); cb1.additem( { label: "acerba moretum" } ); cb1.additem( { label: "adipem nebulo" } ); cb1.additem( { label: "albus viduae" } ); cb1.additem( { label: "aquila peccatum" } ); cb1.additem( { label: "aureus magistru

javascript - How to change .getElementById.value and assign each value to a variable -

i have got 5 variables , function: function key(id){ document.getelementbyid('songs').value =document.albums.names.selectedindex } how assign each value (0,1,2,3,4) each variable show in form when clicked on? just that <select> <option value="1">volvo</option> <option value="2">bmw</option> <option value="3">mercedes</option> <option value="4">audi</option> </select> see this page documentation

assembly - Optimal SIMD algorithm to rotate or transpose an array -

i working on data structure have array of 16 uint64. laid out in memory (each below representing single int64): a0 a1 a2 a3 b0 b1 b2 b3 c0 c1 c2 c3 d0 d1 d2 d3 the desired result transpose array this: a0 b0 c0 d0 a1 b1 c1 d1 a2 b2 c2 d2 a3 b3 c3 d3 the rotation of array 90 degrees acceptable solution future loop: d0 c0 b0 a0 d1 c1 b1 a1 d2 c2 b2 a2 d3 c3 b3 a3 i need in order operate on arrow fast @ later point (traverse sequentially simd trip, 4 @ time). so far, have tried "blend" data loading 4 x 64 bit vector of a's, bitmaskising , shuffling elements , or'ing b's etc , repeating c's... unfortunately, 5 x 4 simd instructions per segment of 4 elements in array (one load, 1 mask, 1 shuffle, 1 or next element , store). seems should able better. i have avx2 available , compiling clang. uint64_t a[16] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; __m256i row0 = _mm256_loadu_si256((__m256i*)&a[ 0]); //0 1 2 3 __m256i row1 = _mm256_loa

generics - Covariance and contravariance usage in C# -

i'm trying achieve i'm not sure possible , i'm bit stuck. i have base types called client , server defined this: public class client { } public class server<clienttemplate> clienttemplate : client { public virtual void clientconnected(clienttemplate client){} public virtual void clientdisconnected(clienttemplate client){} public virtual void messagereceived(clienttemplate client, message message){} public virtual void sendmessage(clienttemplate client, message message){} } these classes later expanded in different assembly this: public class lobbyclient : client { string username; string passwordhash; } public class lobbyserver : server<lobbyclient> { public override void clientconnected(lobbyclient client) { console.writeline("client connected"); } } from first assembly dynamically load second 1 base classes derived. i'm trying this: server<client> server = activator.creat

javascript - Are there any shorter way to write codes for canvas html? I want to avoid using images if possible -

how simplify code without repeating context? there library canvas api? tried using with(context), throws error because using 'use strict'. there way around this? context.save(); context.beginpath(); context.settransform(1, 0, 0, 1, 0, 0); context.translate(alien.x, alien.y); context.rotate(0); context.moveto(-15, 0); context.lineto(-15, 5); context.beziercurveto(-15, -10, 15, -10, 15, 5); context.lineto(15, 0); context.lineto(-15, 0); context.lineto(-15, 5); context.lineto(-20, 5); context.lineto(-25, 10); context.lineto(25, 10); context.lineto(20, 5); context.lineto(-20, 5); context.moveto(10, 10); context.lineto(10, 15); context.lineto(15, 15); context.lineto(15, 10); context.moveto(-10, 10); context.lineto(-10, 15); context.lineto(-15, 15); context.lineto(-15, 10); cont

Which animation/view is used for Recent apps/History in android 5.0(Lollipop)? -

Image
i need animation there in recent app section in android 5.0. shown in image below. hint or link or animation type used here helpful. take here: https://github.com/vikramkakkar/deckview there example here. can find recentsview here: https://github.com/android/platform_frameworks_base/blob/59701b9ba5c453e327bc0e6873a9f6ff87a10391/packages/systemui/src/com/android/systemui/recents/views/recentsview.java

How to access private class methods in Rails -

i have class initialization. i have method send_mail class method def self.send_mail = user_stats end user_stats private method , when try call method, throws error class << self private def user_stats true end end when tried accessing user_stats , undefined method 'user_stats' initialization also tried class << self def self.send_mail = user_stats end private def user_stats true end end both of approaches correct, in latter shouldn't use self , cause define method in initialization 's eigenclass: class initialization class << self def send_mail = user_stats end private def user_stats true end end end initialization.send_mail # => true your first approach works me: class initialization def self.send_mail = user_stats end class << self private def user_stats true end end end initialization.send_mail # => true

Crossfilter: Bypass filters on other dimensions -

i use multiple dimensions in crossfilter (e.g. dimensions date, category, status). works expected, want have id-dimension fast retrieving single data object. problem is: if filter iddimension.filter(myid), , @ same time other filters (which filter out object id=myid) applied, crossfilter won't find given data object. (afterwards reset iddimension.filter(null)). is there way bypass other filters single crossfilter query? or there should method save , restore current filters. doing filter on unique value dimension in order retrieve single record inefficient in crossfilter. remove records except single record groups, add them when remove filter. means group aggregation addition , subtraction functions run twice on each of these records, no reason @ all. it depends on exact need is, think better option keep array of records outside of crossfilter sorted on id property , use crossfilter.bisect find record, or create map of records keyed on unique id (use es6 map if

How to Install new_relic into django application running under apache and mod_wsgi -

i running django using apache , mod_wsgi , wanted install new_relic i preconfiure newrelic.ini , put in django base dir in new_relic doc prefix following : new_relic_config_file=newrelic.ini newrelic-admin run-program but file /var/www//index.wsgi looks like: import os import sys import site #... import django.core.handlers.wsgi application = django.core.handlers.wsgi.wsgihandler() how emerge new_relic django application using mod-wsgi ? thanks, simply googling "new relic mod_wsgi" sent me new relic's own page entitled python agent , mod_wsgi , explains do: the new relic python agent can used apache/mod_wsgi... integration of python agent application when using apache/mod_wsgi should follow standard instructions manual integration python application. wrapper script cannot used apache/mod_wsgi. following link "manual integration" takes this page , has exact instructions add wsgi file.

activex - Teechart smooth Line -

Image
want kind of chart type should select draw chart similar below , how can show statistic summary on chart. teechart activex comes set of examples contained in demo program call "features demo". find @ teechart activex installation folder, @ \examples\visual basic\teechartaxv2014demo\teechartfeaturedemo.exe the example @ all features\welcome !\tools\series stats shows how statistics series , show them. the example @ all features\welcome !\chart styles\statistical\histogram\histogram transparency show histogram series, appropriate draw green histogram in image. there examples under all features\welcome !\functions showing how use different functions. i'd open example @ all features\welcome !\basic features shows empty chart access editor. i'd add histogram series through editor (series\stats tab in teechart gallery) , i'd try different functions (functions tab in teechart gallery) find appropriate needs. edit: here have example showin

javascript - AJAX request results in 'undefined is not an object' error -

my function works correctly, in data correctly requested via ajax , displayed appropriate, following error being thrown: typeerror: undefined not object (evaluating 'obj[i].title') my function follows: function populatenews(obj) { var article = $('article p'); article.each(function(i) { $(this).html('<p>'+obj[i].title+'</p>'); }); } i'm failing understand how resolve error. populatenews(obj) being called deferred ajax request via .done() ; have read similar posts allude potentially being issue, no answer seems fit particular scenario. no need have for loop.... error means obj 's length less length of article function populatenews(obj) { var article = $('article p'); //no need have loop article.each(function (i) { //if obj[i] not there update empty content $(this).html('<p>' + (obj[i] ? obj[i].title : '') + '</p>');

mysql - How to select latest records less than value -

i have table named conductor. want select latest records date less my_value . +----+-----------+------+ | id | program | date | +----+-----------+------+ | 1 | program 1 | 1 | | 2 | program 1 | 3 | | 3 | program 2 | 3 | | 4 | program 1 | 5 | | 5 | program 1 | 7 | +----+-----------+------+ if consider my_value 4 output be: +----+-----------+------+ | id | program | date | +----+-----------+------+ | 2 | program 1 | 3 | | 3 | program 2 | 3 | +----+-----------+------+ how can select records sql? select * conductor `date` = (select max(`date`) conductor `date` < myvalue )

php - Korean character break on wamp2.2 with oracle -

i using wamp 2.2 oracle. loading xsl content oracle table , loading on textarea in php page , allowing user edit , save this. the problem is: if xsl contains korean character, php doesn't show data. at other environments shows data when save data, stores special characters question marks loosing korean characters. i have checked utf-8 , al32utf8 poor in applying techniques. could me on this? this code using $db_charset = 'al32utf8'; $db = "(description = (address_list = (address = (protocol = tcp)"; $db .= "(host = ".$ini_array["db_host"].")(port = ".$ini_array["db_port"].")) )"; $db .= "(connect_data = (sid = ".$ini_array["db_sid"].") ) )"; $ds_conn = ocilogon("eres", "eres123", $db, $db_charset); $query="some sql query; $results = executeociquery($query,$ds_conn); $status = sendmail("random confirm letter",$html,$results[&

jquery - MVC 4 Ajax.BeginForm binding grid -

i use codeplex mvc.grid,i want bind grid after dropdownlist selected my question simple : i m new in mvc development, have 4 dropboxes , each dropdown triggers next dpdown object bind values. how can bind grid using ajaxform. in case, want select first dropdownlist,this action populate second dropdownlist,this action populate next dropdownlist... finally when click loadlisttogrid button, dont want refresh page,just bind gridview thats all. why cant in mvc, how can plz tell me thanks helping view: (checklist.cshtml) @using (ajax.beginform("checklist", "check", new ajaxoptions { updatetargetid = "productresult" })) {` <div>dp1</div> @html.dropdownlist("dpcompany", viewbag.companylist list<selectlistitem>, new { @class = "btn btn-default dropdown-toggle" }) <div>dp2</div> @html.dropdownlist("dpbank", viewbag.companylist list<selectlistitem>, new { @class = "btn

c# - Multibinding with convertback does not work when one converted value in UnsetValue -

i have following multibinding: <grid.visibility> <multibinding converter="{staticresource mymultivalueconverter}" mode="twoway"> <binding relativesource="{relativesource templatedparent}" path="myvisibilitydependencyproperty" mode="twoway"/> <binding relativesource="{relativesource templatedparent}" path="myboolproperty" mode="twoway"/> </multibinding> </grid.visibility> myvisibilitydependencyproperty dependency property. myboolproperty normal property. implementation of mymultivalueconverter important thing: public class mymultivalueconverter: imultivalueconverter { public object convert(object[] values, type targettype, object parameter, cultureinfo culture) { //not interesting } public object[] convertback(object value, type[] targettypes, object parameter, cultureinfo culture) { return new[] { value, bi

ios - Perform segue is not having any impact -

i have following code : - (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { indexpathrow = indexpath.row; nslog(@"indexpathrow.%d", indexpathrow); mylist.recordidtoedit = [[myidarray objectatindex:indexpathr nslog(@"item selected..%d", safetyinventorylist.recordidtoedit); [self performseguewithidentifier:@"detailsviewcontroller" sender:nil]; } - (void)prepareforsegue:(uistoryboardsegue *)segue sender:(id)sender { if([segue.identifier isequaltostring:@"detailsviewcontroller"]) { detailsviewcontroller *destviewcontroller = segue.destinationviewcontroller; int itemidtofetch = mylist.recordidtoedit; [detailedlist fetchdetails:itemidtofetch]; destviewcontroller.name = detailedlist.itemname; destviewcontroller.itemid = itemidtofetch; } } my segue identifier correct , perform segue works fine if dont have processing in preparefor segue

Redis sunionstore returning Protocol error: invalid multibulk length -

i'm trying run sunionstore command, somehow crashes out protocol error: invalid multibulk length .. call made around 1.1m keys, lot-ish, shouldn't redis, right? i tried incrementally decreasing number of keys , started working again @ around 1.05m. checked first/last half , both options work, it's not invalid key somewhere or anything. any ideas? let me know if can else debug. ps. fwiw call being made node.js app, don't suppose can relevant can it. pps. tried running same call redis-py , same thing happens (instead it's redis.exceptions.connectionerror: error 104 while writing socket. connection reset peer. ) the execution time of both successful , failed calls small, <1s, that's unlikely issue. the issue happens regardless if sets unify or not, i.e. fails fake keys union empty.

pdf - How to add a rich Textbox (HTML) to a table cell? -

i have rich text box named:”documentcontent” i’m going add content pdf using below code: itextsharp.text.font font = fontfactory.getfont(@"c:\windows\fonts\arial.ttf", basefont.identity_h, basefont.embedded, 12f, font.normal, basecolor.black); documentcontent = system.web.httputility.htmldecode(documentcontent); chunk chunkcontent = new chunk(documentcontent); chunkcontent.font = font; phrase phrasecontent = new phrase(chunkcontent); phrasecontent.font = font; pdfptable table = new pdfptable(2); table.widthpercentage = 100; pdfpcell cell; cell = new pdfpcell(new phrase(phrasecontent)); cell.border = rectangle.no_border; table.addcell(cell); the problem when open pdf file content appears html not text below: <p>overview&#160; line1 </p><p>overview&#160; line2 </p><p>overview&#160;

mysql - Grouping with no repeating values in multiple columns -

i have following data: +-----+-----+ | id1 | id2 | +-----+-----+ | 100 | aaa | | 100 | bbb | | 200 | aaa | | 200 | bbb | | 300 | aaa | | 300 | bbb | | 300 | ccc | | 400 | bbb | +-----+-----+ i need somehow group rows in table above , get: +-----+-----+ +-----+-----+ +-----+-----+ | id1 | id2 | | id1 | id2 | | id1 | id2 | +-----+-----+ +-----+-----+ +-----+-----+ | 100 | aaa | or | 100 | bbb | or | 400 | bbb | acceptable | 200 | bbb | | 200 | aaa | | 300 | ccc | | 300 | ccc | | 300 | ccc | | 200 | aaa | +-----+-----+ +-----+-----+ +-----+-----+ which of above given grouped result-set not important long there no repeating occurrences of both id1 , id2 values . i.e. following result-set (got simple grouping id1 or id2) "wrong": +-----+-----+ +-----+-----+ | id1 | id2 | | id1 | id2 | +-----+-----+ +-----+-----+ | 100 | aaa | , | 100 | aaa | both "wrong" | 200 | aaa |

python - Sort object dict by not-always-there attribute -

i want sort object dictionary in python. these objects have attribute, let's call "architecture". so, sort dict this: data.sort(key=attrgetter('architecture')) so far good. but, objects not have attribute 'architecture' (sometimes yes, no) , python console raises attributeerror exception. so, question is, how can sort object dictionary attribute when of objects not have attribute sort? suppose want put without attribute last. from operator import attrgetter data_with_attr = list(d d in data.values() if hasattr(d, 'architecture')) data_with_attr.sort(key=itemgetter('architecture')) data_with_attr += list(d d in data.values() if not hasattr(d, 'architecture')) i'm not sure understand object dictionary correctly.

Does autocomplete with a large database effects the load time of a web page -

i'd use autocomplete fields search entries have large database of possibilities instance (over 10,000 entries). wondering if form affected in loading time , general performance using large amount of data. i know if autocomplete large database effects load time of web page. thanks in advance :-) atb, anne

jquery - Video-popup loses background & breaks on scroll in Chrome -

i'm trying create website, on there multiple animations , multiple video's, when click on animation in first video popup comes works perfectly.. however when click on animation in 2nd video video-popup breaks, buttons , white-background of video fall behind full-screen-background-video, know why? html popup-video: browser doesn't support video element. meer informatie direct afsluiten css pop-up video: .popupinfo{ display: none; padding: 15px; background:white; border: 1px solid white; float: left; font-size: 1.2em; position: fixed; top: 50%; left: 50%; margin: -20px 50px 0 -20px; z-index: 99999; box-shadow: 0px 0px 3px white; -moz-box-shadow: 0px 0px 3px white; -webkit-box-shadow: 0px 0px 3px white

HTML links in javascript -

i want place hyper link in javascript code (asda) in expample <<< this code: var klachtinternet = confirm("heeft u een klacht on ons product internet?"); if(klachtinternet == true){ document.writeln("<fieldset>" + "<legend>" + " internet" + "</legend>" + "klant meldt probleem met internet" + "<br/>" + "<br/> " ); var nu = confirm("kunt u browsen naar www.nu.nl?"); if(nu == true){ document.writeln("browsen nar www.nu.nl lukt" + "<br/>" + "<br/>"); } else{ document.writeln("probleem : browsen naar www.nu.nl lukt niet" + "<br/>" + "<br/>" //i want here hyperlink anything. tried link() t

regex - Mysql like regexp -

hi there here query: select * `person` memo 'john smith %' or memo '% john smith %' or memo '% john % smith %' or memo '%john%smith%' order case when memo 'john smith %' 1 when memo '% john smith %' 2 when memo '% john % smith %' 3 when memo '%john%smith%' 4 else 5 end how convert not use or operator can regexps? you can change where to: where memo '%john%smith%' the other conditions redundant. as order by , there isn't way simplify that.

angularjs - ng-repeat stuck in infinite loop angularfire 8.2 -

i'd figure out why ng-repeat statement runs infinite. item.members has length of 2 , contains userids = true <script type="text/ng-template" id="items_renderer.html"> <label> <span class="team-description" ng-show="!item.editing">{{item.name}}</span> <label ng-repeat="memberid in item.members"> <span>{{ getmember(memberid) }}</span> </label> </label> </script> <div ui-tree="options" class="teamlist"> <ol ui-tree-nodes ng-model="teams" class="panel-teams"> <li ui-tree-node ui-tree-handle ng-repeat="item in teams" ng-include="'items_renderer.html'"> </li> </ol> </div> $scope.getmember = (memberid) -> memberobj = fbutil.syncobject('users/' + memberid) memberobj

python - Matplotlib legends in subplot -

Image
i'm new @ matplotlib, put legends inside each 1 of subplots bellow. i've tried plt.legend didn't work. any suggestions? thanks in advance :-) f, (ax1, ax2, ax3) = plt.subplots(3, sharex=true, sharey=true) ax1.plot(xtr, color='r', label='blue stars') ax2.plot(ytr, color='g') ax3.plot(ztr, color='b') ax1.set_title('2012/09/15') plt.legend([ax1, ax2, ax3],["hhz 1", "hhn", "hhe"]) plt.show() suggestion atomh33ls: ax1.legend("hhz 1",loc="upper right") ax2.legend("hhn",loc="upper right") ax3.legend("hhe",loc="upper right") the legend position fixed, seems have problem strings, because each letter placed in new line. does knows how fix it? this should work: ax1.plot(xtr, color='r', label='hhz 1') ax1.legend(loc="upper right") ax2.plot(xtr, color='r', label='hhn') ax2.legend(loc=&q

php count array where inner value true -

i wish count values in array course have inner value completed=>true. there 2 values when standard count. have tried is_array , array_filter count($employee['course'] output: 2 course(array) 0(array) id:1 name:handling coursesemployee(array) id:1 employee_id:1 course_id:1 completed(true) 1(array) id:3 name:induction coursesemployee(array) id:2 employee_id:1 course_id:3 completed(false) if you're using php 5.3 or higher, may accomplish via single expression: count( array_filter( $employee['course'], function($item){return $item['coursesemployee']['completed'];} ) ) see docs on array_filter , anonymous functions .

r - Adding confidence intervals ggplot -

i want plot intervals of confidence of fitted values. read post related, still stuck..these sample of date: pd <-structure(list(date = 1:5, obs = c(44.6651011845397, 62.3441339250369, 52.8968240161506, 51.7795930633478, 63.1284636561025), pred = c(47.2643891039645, 55.7996450577325, 52.9566469533233, 51.3393289316, 59.0011440099732)), .names = c("date", "obs", "pred"), row.names = c(na, 5l), class = "data.frame") pd2 <- structure(list(date = 1:5, lwr = c(44.8529592578518, 54.9926370476338, 51.7358955911624, 49.401869166722, 58.1674619447108), upr = c(49.6758189500772, 56.6066530678312, 54.1773983154842, 53.2767886964779, 59.8348260752356 )), .names = c("date", "lwr", "upr"), row.names = c(na, 5l), class = "data.frame") dd <- melt(pd, id=c("date")) #data dd2 <- melt(pd2,id=c("date")) #intervals of co

javascript - Issue while loading Google maps api V3 in Firefox over https -

i loading google maps api v3 script on https using url https://maps.googleapis.com/maps/api/js?sensor=false .the maps loaded , work in ie , chrome. on firefox maps don't work , can see error typeerror: google.maps.event undefined .i checked if google object loaded using undefined check , not getting loaded on firefox, ie , chrome load properly. the same behavior can checked via url https://google-developers.appspot.com/maps/documentation/javascript/examples/full/map-simple . error occurs on https , not http. same issue has been noticed on multiple networks , multiple machines. firefox version being used:- 33.1. my script import in head , jquery bindings in document.ready, not chance of scripts executing before import. same behavior getting exhibited in firefox safe mode. can me out solution this? maybe problem ssl, try erasing "s" http http://maps.googleapis.com/maps/api/js?sensor=false

java - Using Hotswap Agent with JBoss (Jboss Developer Studio) -

Image
the tutorial here: http://www.hotswapagent.org/quick-start says use: -xxaltjvm=dcevm -javaagent:path_to_agent\hotswap-agent.jar as command line arguments. however, when running servlet on jboss, jboss developer studio, how pass in these arguments? at first look, may eclipse.ini/config.ini , ide jvm spawn new jvm jboss server, pass arguments .ini that? double click open server configuration click open dialog below finally add or edit vm arguments.

fpga - SV Compilation error: Unexpected token integer -

i compiling below system verilog code in active-hdl9.1 simulator. when compile error error: vcp2000 tb_hutil.sv : (35, 15): syntax error. unexpected token: integer[_integer]. expected tokens: 'constraint'. package hutil_pkg; `define date "june_2012" `ifdef tbid `else `define tbid "rapidio2_testbench" `endif `ifdef author `else `define author "altera" `endif `define info 32'h00000001 `define debug 32'h00000002 `define warning 32'h00000004 `define failure 32'h00000008 static integer err_cnt; //line no.35 //error on line i don't understand error , no idea whether problem system verilog syntax or tool issues. in posted example endpackage missing. use `ifndef if not defined statments. example below compiles on eda playground : package hutil_pkg; `define date "june_2012" `ifndef tbid `define tbid "rapidio2_testbench" `endif `ifndef au

c++ - How to convert CImg float image type to unchar image(0-255) type -

i using cimg library , implementing non maximum suppression harris corner detector. because calculation of numbers determinants requires float type image, declared images float type. when exracting local maximum on harris response float image, found hard set threshold because don't know values of pixels on float image are, , got strange points extracted weren't ones wanted. example printed out values of points, found pixel values 6e+9 or 1.8e+5, , don't know mean. there way convert float image unchar image can set integer threshold local maximum extraction? in advance! you have normalize image values, : cimg<unsigned char> img_normalized = img.get_normalize(0,255); then work on values of 'img_normalized' instead.

c# - Properly set a list of COM objects to a new value -

suppose have list of com objects property in class : public list<legacycomobjects> legacycomobjects { get; set; } what best way set property new value? should classic .net way or should release objects before setting because memory leaks may happen? think of : private list<legacycomobjects> _legacycomobjects ; public list<legacycomobjects> legacycomobjects { { return _legacycomobjects; } set { if (_legacycomobjects!= null) { _legacycomobjects.foreach(o => { marshal.releasecomobject(o); o = null; }); } _legacycomobjects= value; } }

How can I run xUnit Unit Tests with VS2015 Preview? -

Image
i added "xunit.net runner visual studio" v0.99.8 via extensions manager, when open test explorer window, not seem pick of unit tests. also, resharper 9 eap version of resharper supports vs2015 seem yet have plugin xunit test runner. how then, can run xunit unit tests in vs2015 preview? you can find answer here: http://blogs.msdn.com/b/webdev/archive/2014/11/12/announcing-asp-net-features-in-visual-studio-2015-preview-and-vs2013-update-4.aspx visual studio supports running , debugging asp.net 5 xunit tests through test explorer. need add xunit dependencies , test commands test project's project.json file, shown below (note: install xunit packages need add https://www.myget.org/f/aspnetvnext/api/v2 nuget package source): "dependencies": { "xunit.krunner": "1.0.0-beta1" }, "commands": { "test": "xunit.krunner" }, if asking how add https://www.myget.org/f/aspnetvnext/api/v2 nuge

c - strncpy function does not work properly -

what trying asking user enter in format like: cd directory. store "cd" in string , "directory" in string. here code: void main() { char buf[50], cdstr[2], dirstr[50]; printf("enter something: "); fgets(buf, sizeof(buf), stdin); //store cd in cdstr strncpy(cdstr, buf, 2); printf("cdstr: %s(test chars)\n", cdstr); //store directory in dirstr strncpy(dirstr, buf+3, sizeof(buf)-3); printf("dirstr: %s(test chars)\n", dirstr); } the output below input: cd pathname cdstr: cdcd pathname //incorrect answer (test chars) //an "\n" dirstr: pathname //correct answer (test chars) //an "\n" that's why? this because after doing strncpy(cdstr, buf, 2) , don't have null-terminated string in cdstr char array. can fix changing cdstr length 3 , adding: cdstr[2] = '\0' : void main() { char buf[50], cdstr[3], dirstr[50]={0}; printf("

java - JPA in spring-boot project "batch insert" very slow -

hey i'm trying insert 800 rows @onetomany relationships, seems slow. don't quite understand why, since i've read guides said should quick. hope kind soul tell me if there i've misunderstood , can me increase performance of insertions. the repository: @repository public interface footnoterepository extends crudrepository<footnotesentity, long> { @query("from footnotes number =?1 , footnote_type=?2 order date_start desc,id asc") public list<footnotesentity> findfootnotebynumberandtype(long number, string transportnumber, pageable pageable); } the domainclass: @autowired private entityrepository entityrepository; @autowired private footnoterepository footnoterepository; /** * handles jpa interface * * @param * @return success of operation */ @transactional private boolean insertupdatefootnoteentities(list<footnotesentity> footnotes) { boolean success = true; system.out.println("footnotes: " + footn

openstack - Dynamic storage deletion and deleteOnExit template option -

i'm wondering how storage template option "deleteonexit" works in cloudify 2.7.1 stable. i'm working on openstack cloud, , in case, option "deleteonexit" in "small_block" storage template set true. using dynamic storage allocation way create (with small_block template), attach, mount , format storage via context storage api. when undeploy application, storage not destroyed. normal behavior? thanks. yes normal behavior, dynamic storage, responsible deleting volume when undeploy. here example of deleting volume when 'shutdown' lifecycle event executed: shutdown { context.storage.unmount(device) context.storage.detachvolume(volumeid) context.storage.deletevolume(volumeid); }

Open the settings preferences on clicking the vertical dotted line on the upper-left corner on android app -

Image
i want make simple settings page, went google's documentation below: http://developer.android.com/guide/topics/ui/settings.html created new android testing project, created preferencescreen xml, , preferencefragment class inside mainactivity class. i want settings screen appear when press settings icon, instead shows 1 unclickable item named settings. i know question basic, tried lot make work no results. any please? if want open settings menu inside action bar, shown below : first, need define menu item inside menu.xml file activity : <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" tools:context=".mainactivity"> <item android:id="@+id/action_settings" android:title="@string/action_settings" android:orderincategory="100" android:showasaction="never" /> </menu> second, need i

cypher - Match node with multiple properties in neo4j -

i'm having troubles current data model , wondering if suggest better way structure data. nodes labelled 'person' have 5-10 properties each like: name, address, nationality, phone, age... , there no unique property use index. since don't want duplicates, every time create new person use merge instead create. problem doing merge i'm matching 5-10 properties on node slows down queries enormously. so taking out properties in each person node separate nodes labeled address, nationality, phone, age performance of merge query? other possible solutions? thanks in advance! how generating guid/uuid that's unique each person , using id each person? merge on property , use on create set other properties e.g. merge (p:person {id: 'abcd-efgh-...'}) on create set p.name = "mark", p.address = "..." or if not maybe hash or combination of properties key e.g. merge (p:person {id: "name-address-nationality-phone"}) on c

java - What localhost property is guaranteed to be unique across OSes and regardless of network? -

is there single property concerning local machine guaranteed unique on both windows , os x regardless of network attached , accessible java? for instance, mac address returned change when active nic changes (user switches between wired , wireless), hence mac address not meet criterion. a hostname closest meeting these criterion: inetaddress localhost = inetaddress.getlocalhost(); hostname = localhost.gethostname(); though in virtual machine environments vm guest cycled nightly, hostname can change (we have such users).

java - Is there a LinkedHashSet / Map equivalent, with order preserved for inserted duplicates? -

i wondering 2 things. 1) hashset added duplicate value? believe replaces value? if case, linkedhashset? i'm pretty sure doesn't change order, still replace value? (why it?) 2) if wanted use ordered collection doesn't allow duplicates, replace existing value it's duplicate, re-ordering position? ie. linkedhashset, except duplicate values added replaced , positions updated. there collection might this? or have write own? don't want have write own! 1) adding duplicate set not (it returns false immediately, , contents of set not affected), regardless of particular implementation, hashset, treeset or linkedhashset. 2) check out linkedhashmap, is, probably, closest want. has boolean argument constructor, lets specify whether want use "insertion-order" (false) or "access-order". former same linkedhashset, latter "bump" key if re-insert it, , also if up: map<string, integer> map = new linkedhashmap(10, 0.75, true); m

Jquery linking to another tab -

i have tabs working fine , adding 'active' class when clicked. want have text links within tabs content linking each other. have working can't find way tab active: jsfiddle: http://jsfiddle.net/sarah3585/01vas55s/ so here want apply active class tab2 when link clicked within tab1. html: <div class="tabs"> <div class="selection"> <ul class="tab-links"> <li class="active"><a class="tab-link button" href="#tab1">button1</a></li> <li><a class="tab-link button" href="#tab2">button 2</a></li> </ul> </div> <div class="internal-container tab-content"> <div id="tab1" class="tab active"> tab 1 content <a href="#tab2" class="tab-link">link tab2</a> </div>