Posts

Showing posts from August, 2015

java - Unable to store Database results into a Map -

i have made query shown above fetched me folowing results mysql> select distinct category_id , t1 ca +-------------+--------------------+ | category_id | t1 | +-------------+--------------------+ | 1 | popcorn | | 2 | popcorn | | 3 | popcorn | | 4 | popcorn | | 5 | popcorn | | 6 | popcorn | | 7 | soft drinks | | 8 | soft drinks | | 9 | soft drinks | | 10 | soft drinks | for each t1 coulmn , trying store category_id so looks popcorn=[ 1, 2, 3, 4, 5, 6, ] softdrinks=[ 7, 8, 9, 10, ] i have followed below approach accomplish map<string,linkedlist<integer>> categoryitemslist = new hashmap<string,linkedlist<integer>>(); preparedstatement stmt2 = connecti

c++ - Reverse vertex winding order using matrices -

i'm implementing reflections (using render-to-texture method), , far works, problem objects in reflected version rendered inside out. i'd avoid changing internal opengl vertex winding order make sure don't interfere other rendering operations much. instead, i'd transform reflection matrix reversing. (which should reflection?) this reflection matrix (which transforms view matrix of camera): glm::mat4 matreflection( 1.f -2.f *n.x *n.x,-2.f *n.x *n.y,-2.f *n.x *n.z,-2.f *n.x *d, -2.f *n.x *n.y,1.f -2.f *n.y *n.y,-2.f *n.y *n.z,-2.f *n.y *d, -2.f *n.x *n.z,-2.f *n.y *n.z,1.f -2.f *n.z *n.z,-2.f *n.z *d, 0.f,0.f,0.f,1.f ); n = normal of plane of reflection; d = distance of plane is possible reverse vertex order through matrix transformation? if so, how exactly? if apply matrix scale y-axis -1 after other transformations (including projection), end upside-down image (which can use including uv.y = 1-uv.y somewhere in pipeline).

android - easiest way to make GCM registration working on real devices less than 4 -

my application gcm(using google play service) registration works fine on real device samsung running on android 4, does't working on galaxy gt-5360 running on android 2.3.6 after half-day of searching how make gcm registration working on real devices, don't helpful results. but search not go down drain, these solutions found not resolve problem. 1.first solution: link: gcm service_not_available on android 2.2 i experienced same problem. gcm works fine on tablet running android 4.04, received service_not_available on smartphone running android 2.3. i found following workaround not using (so far know) deprecated classes. add action "com.google.android.c2dm.intent.registration" gcmbroadcastreceiver in manifest. enable receive registration_id @ gcmbroadcastreceiver. <receiver android:name="your_package_name.gcmbroadcastreceiver" android:permission="com.google.android.c2dm.permission.send" > <intent-filter>

wpf - Same click event for both Button and Grid -

i read routed events today , tried provide same click event handler both normal button , custom grid button. stackpanel handling routed button click event, , invoke same handler firing click event grid's mousedown event. code without error not working expected. button click brings messagebox clicking grid mouse nothing. <window x:class="routedeventpr.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="mainwindow" height="550" width="525"> <stackpanel background="transparent" button.click="button_click_1"> <grid width="200" height="100" background="aqua" mousedown="grid_mousedown_1"> <ellipse strokethickness="4" width="200" height="100" fill="beige"/> <textbloc

matlab guide - How get Current point -

good morning, have aplicattion with: set(gcf,'windowbuttonmotionfcn',{@mousecapturelc}); where x , y coordinates mousecapturelc function. function mousecapturelc(src, eventdata) pos = get(gca, 'currentpoint'); % axes image - (axes1) x = pos(1, 1); y = pos(1, 2); % working this values send labels text in gui: hfig1 = findobj('tag','lbl_x'); handles = guidata(hfig1); hfig2 = findobj('tag','lbl_y'); handles = guidata(hfig2); set(handles.lbl_x, 'string', sprintf('x: %1.0f ', x)); set(handles.lbl_y, 'string', sprintf('y: %1.0f ', y)); i need do: i need use x values in other axes, ie (axes2), in real time. want plot columns image in axes2 moving mouse. the problem: in side mousecapturelc(), when handle of axes2 motion function leave working. h = gcf; axes2 = findobj(h,'tag','axes2'); axes(axes2) it works clicking. not working more movement mouse. 1) tried values

c++ - In Qt 4.8.5, the differences between setPaused(false) and resume() after setPaused(true) in QTimeLine -

in source of qtimeline.cpp, setpaused(false) , resume() same followd: d->timerid = starttimer(d->updateinterval); d->starttime = d->currenttime; d->timer.start(); d->setstate(running); in docs, setpaused(false) resumes timeline , continues left, resume() resumes timeline current time. can explain different result "same" code? read solved topic http://qt-project.org/forums/viewthread/28076 "qtimeline setpaused doesn’t pause time line correctly". still cannot find out reason. the intention the intended difference between resume () , setpaused (false) following: resume unconditionally change state of qtimeline running , no matter previous state of was, whereas; setpaused(false) not unless state paused . the source code the implementation of setpaused have check see state indeed paused before running code have in question, why "the same code" yields different results. the below entire body of res

how to set twig global default variable -

is there way set global default variable instead of setting each 1 ? {{ app.model.foo | default('not set') }} {{ app.model.bar | default('not set') }} the built-in default filter cannot wish achieve. here's complete code: function _twig_default_filter($value, $default = '') { if (twig_test_empty($value)) { return $default; } return $value; } but twig easy extend ! can create own twig extension, registers new filter, code of this: function my_default_filter($value, $default = '') { if (twig_test_empty($value)) { return $default ?: $this->default; } return $value; } where class has $default property can set code, want.

c# - MenuItem in Window, CommandBinding in UserControl -

i have window: <window x:class="somenamespace.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" height="350" width="525"> <window.commandbindings> <commandbinding command="applicationcommands.copy" canexecute="commandcanexecute" executed="commandexecuted"/> </window.commandbindings> <dockpanel> <menu dockpanel.dock="top"> <menuitem header="file"> <menuitem command="applicationcommands.copy"/> </menuitem> </menu> </dockpanel> </window> with code behind: void commandcanexecute(object sender, canexecuteroutedeventargs e) { e.canexecute = true; } void commandexecuted(object sender, eventargs e) { messagebox.show("done!"); } and works way ex

android - Infinity loop. Reading data from database and comparing them to with an if statment -

my english little rusty, try explain want do. i have database , 5 rows in it. trying this: read n rows database. assign data database variables check if variables belongs condition if(((szerokosc<=a)&&(szerokosc>=b)) && ((dlugosc>=c)&&(dlugosc<=d))) if yes, display (opis) if not, display(brak danych) if end of rows go first if there exists next row, go it, i want on , on again; public void onlocationchanged(location location) { showlocation(location); showadditionalinfo(location); if(savedlocation == null) savedlocation = locationmanager.getlastknownlocation(locationmanager.gps_provider); databasehelper zb = new databasehelper(getapplicationcontext()); double szerokosc = location.getlatitude(); double dlugosc = location.getlongitude(); cursor k = zb.dajcos(); string lokalizacja = "jestes na: "; while(k.movetonext()) { nazwa = k.getstring(0); szmax= k.getdoubl

java - Hibernate delete using criteria -

can use criteria delete records tables? for example, criteria todelete = session.createcriteria(car.class, "car").createalias("car.wheel", "wheel"); todelete.add(restrictions.eq("brand", "toyota")); todelete.add(restrictions.eq("wheel.brand", "bbs"); todelete.add(restrictions.gt("date_of_purchase", someday); todelete.add(restrictions.between("cost", 3000, 5000); how can use todelete criteria delete records interested in? inefficient way query ids using todelete criteria, delete car objects there. also, can know how many objects have deleted? you should upgrade hibernate version version implements jpa 2.1 (hibernate starts jpa 2.1 on version 4.3.11.final - hibernate downloads ) once have upgraded, can use criteriadelete want. here small example: example

javascript - How to make a animated sidein navigation bar? -

how make following slidein navigation bar? possible without using plugins , stick css3? http://middle-earth.thehobbit.com/map no plugins, simple markup, css transitions, , few lines of javascript http://jsfiddle.net/7a5t6/6/ #menu{ height:100%; transition:1s; width:200px; margin-left:-200px; } button{ position:absolute; right:-30px; } javascript: var open = document.getelementbyid('open') var menu = document.getelementbyid('menu') open.addeventlistener('click',openit,false); var = 0; function openit(){ if(i==0){ menu.style.marginleft= "0px" i=1 } else{ menu.style.marginleft= "-200px" i=0 } }

c - Is it possible to implement readdir() in Ubuntu 12.10 (kernel 3.5)? -

in 8.6 of k & r , authors implemented simple version of readdir() . code follows: #include <sys/dir.h> /* local directory structure */ /* readdir: read directory entries in sequence */ dirent *readdir(dir *dp) { struct direct dirbuf; /* local directory structure */ static dirent d; /* return: portable structure */ while (read(dp->fd, (char *) &dirbuf, sizeof(dirbuf)) == sizeof(dirbuf)) { if (dirbuf.d_ino == 0) /* slot not in use */ continue; d.ino = dirbuf.d_ino; strncpy(d.name, dirbuf.d_name, dirsiz); d.name[dirsiz] = '\0'; /* ensure termination */ return &d; } return null; } in opinion, in line read() , dp->fd file descriptor of directory. authors used read() struct direct directly directory file. however, in ubuntu, not possible read directory file. when tried read directory, got strange. i read in apue in systems, action not allowed. there other

date - How to round current time in teradata and insert into timestamp(6) fields -

i have table date fields of timestamp(6) fields . create table test_time ( t1 timestamp(6) format 'mm/dd/yyyy hh:mm:si' , ); i want insert table current date , time rounded. i.e. example if current date time 08/07/2014 10:34:56 value in table should 08/07/2014 10:00:00 . (or) if current data , time 08/07/2014 10:54:56 value should be 08/07/2014 10:34:56 your first example truncating time, not rounding. truncating can done this: current_timestamp(0) - extract(minute current_timestamp(0)) * interval '1' minute - extract(second current_timestamp(0)) * interval '1' second but don't second example, there's no truncation/rounding @ all, it's subtracting 20 minutes?

Add badge for tab widget android -

Image
i want add badge tab widget @ android. use android-viewbadger lib, not set badge show image here code: tabs = (tabwidget) findviewbyid(android.r.id.tabs); badge = new badgeview(this, tabs, 2); // badge.setbackgroundresource(r.drawable.badge_28); badge.setbadgeposition(badgeview.position_top_right); badge.setwidth(14); badge.setheight(14); badge.show();

c++ - Common interface for all derived classes -

i have base class item store data , grant access accessors, like: class item{ (...) public: int get_value(); double get_weight(); itemmaterial get_material(); (...) } then i've got derived classes weapon, armor add additional data: class weapon : public item { (...) public: int get_dmg(); (...) } i store these items in container: std::vector<item*> inventory; and here comes problem interface - how access derived class data? thinking, , got 3 ideas: 1. separate interfaces each derived class adds data, shown above, , use dynamic_cast: item *item = new weapon; int dmg = dynamic_cast<weapon*>(item)->get_dmg(); 2. common interface class make interface class accessors: iteminterface{ public: virtual int get_value() = 0; //item interface virtual double get_weight() = 0; (..) virtual int get_dmg() = 0; //weapon interface (...) } and this: item : public iteminterface{ (...) } and weapon : public item { (...

javascript - Angularjs Error Logging -

currently using stacktrace.js logging errors in angularjs app below app.factory('$exceptionhandler', ['errorlogservice',function (errorlogservice) { return function (exception, cause) { errorlogservice.log(exception.message, cause); }; } ]); this service log every error occurred in app. question is, can choose types or levels of errors logged? i'm pretty sure i'm logging every damn thing! causing lot of headaches.. afaik stacktrace.js has no feature specify types or levels of errors logged. because js has no standard error type or error level. script error error - that's all! having said - problem seems in coding style. why should there many errors thrown in js code? many errors in js code clutter whole console , make logging useless. solution can think of fix errors logs cleaner. there should 0 such errors in console before go live - if have tested code properly.

android - Design help for Calculator App -

Image
i trying design calculator. want calculator android's default. i used linear layout this. tried gridlayout , tablelayout well, sucked. <?xml version = "1.0" encoding = "utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <linearlayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="12" android:orientation="horizontal" > <edittext android:id="@+id/rawdataet" android:layout_width="0dp" android:layout_height="fill_parent" android:layout_weight="80" android:maxlines="1" android:textcolor="@android:color/black" /> <button android:id="@+id/

ios - What is the Custom Class in Storyboard builder used for? -

i new ios development. saw few tutorials , examples editing custom class in identity inspectors , did not mention why did this. what doing here? thank you this when subclass element used in storyboard - class use 1 initialized. example: when creating custom uitableviewcell various iboutlets defined in subclass of uitableviewcell , need somehow associate layout created in interface builder class itself. how it's done.

jquery - AngularJS: Sum of Input values -

i have simple list of inputs bound list of items display nicely. when change value in input, the sum doesn't update?? example: http://plnkr.co/edit/b7teasxsfvylrmj5xcnj?p=preview html <body ng-controller="mainctrl"> <div ng-repeat="item in items"> <p><input type=text value="{{item}}"></p> </div> total: <input type=text value="{{sum(items)}}"> </body> script app.controller('mainctrl', function($scope) { $scope.items = [1,2,5,7]; $scope.sum = function(list) { var total=0; angular.foreach(list , function(item){ total+= item; }); return total; } }); check fiddle implementation: http://jsfiddle.net/9tsdv/ the points take note of: use ng-model directive input element allow two-way binding between item model , input element since ng-repeat creates child scope , elements in items array of primitive type or value type , hence copied value durin

html - Menu list with borders not displaying correctly -

i have menu 5 items. idea there border between each. the issue of menu items need double lined, when happens, borders on place. i've been looking @ code hour , not sure how correct this. i have them single lined, goes against design. jsfiddle: http://jsfiddle.net/69csf/ css: body { background-color:black; } #menu { width:500px; top:100px; -border:solid 1px #ffff00; height:40px; vertical-align:middle; } ul { list-style-type: none; margin: 0; padding: 0; font-family:'open sans', sans-serif; font-size: 12px; text-transform: uppercase; color:#fff; width:100%; height:40px; } li { display: inline-block; width:19%; height:40px; text-align:center; padding-top:9px; vertical-align:center; } li~li { border-left: 3px solid #ffffff } li>a:hover { color:#fff; } li>a { color:rgb(200, 200, 200); text-decoration:none; } html: <div id="menu"> &l

dart - Parameter type confusing -

i trying use virtualdirectory class , find great example in web. import 'dart:io'; import 'package:http_server/http_server.dart'; main() { httpserver.bind('127.0.0.1', 8888).then((httpserver server) { var vd = new virtualdirectory('./'); vd.jailroot = false; vd.serve(server); }); } look @ call method serve vd.serve(server); and passed parameter, httpserver type. when looking in api docs expected httprequest type. streamsubscription<httprequest> serve(stream<httprequest> requests) serve stream of httprequests, in virtualdirectory. why can pass httpserver instance serve method instead httpreqeust instance? see documentation of httpserver the httpserver stream provides httprequest objects.

javascript - how can i get all input fields values to an array in jquery? -

this question has answer here: jquery. how load inputs values array? 2 answers how can input fields values array in jquery? please see codes bellow: <input type="text" name="a" value="a" /> <input type="text" name="b" value="hello" /> <input type="text" name="c" value="world" /> <script type="text/javascript"> function get_fields_values(){ // code var arr=[]; $.each($("input"),function(i,n){ arr.push(n.value) }); return arr; // there jquery method fields values array? // $('input').xxx() ? } </script> try use .map() along .get() accomplish task, var arr = $("input").map(function(){ return this.value; }).get(); full

spring data - jpa application-context schema error -

i having issue xml schema spring jpa repository. i have tried suggestions available online not seem resolve it. please help. getting error in application-context.xml repository. multiple annotations found @ line: - cvc-complex-type.2.4.c: matching wildcard strict, no declaration can found element 'repository:repositories'. - cvc-complex-type.2.4.a: invalid content found starting element 'repositories'. 1 of '{"http://www.springframework.org/schema/ beans":import, "http://www.springframework.org/schema/beans":alias, "http://www.springframework.org/schema/beans":bean, wc[##other:"http:// www.springframework.org/schema/beans"]}' expected. my application context looks this <?xml version="1.0" encoding="utf-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:context="http://www.sp

Print multiple PDF pages using Android 4.4 printing framework -

i want ask help. want print/create pdf document. can create 1 pdf page , write data page via canvas. problem dont know how can create pdf page , continue writing second page. if has experiences full spend many time this. i use this: https://developer.android.com/reference/android/print/pdf/printedpdfdocument.html part of code there: private void doprint(int _docnumber){ docnumber = _docnumber; //get printmanager instance printmanager printmanager = (printmanager)this.getsystemservice(context.print_service); // set job name, displayed in print queue string jobname = getstring(r.string.app_name) + " dokument"; // start print job, passing in printdocumentadapter implementation // handle generation of print document printmanager.print(jobname, new myprintdocadapter(), null); toast.maketext(getbasecontext(), "príprava na tlač...", toast.length_short).show(); } public class myprintdocadapter extends printdocumentadapter {

asp.net web api - How post json data without column names using webapi? -

i had method post json data using webpi, when data data pushing mobile application in json format without columns names , how can receive , post in database in webapi? possible that? receiving data in below format? { "12122", "2000", "", "17.3660°n", "15", "56654", "cash", "", "78.4760°e" } you're receiving json serialized collection of strings. long can guarantee order, could this. in controller, have post method accept array of strings type, , traverse index. public httpresponsemessage post(string[] data) { var col1 = data[0]; var col2 = data[2]; }

tomcat - How to rename deployment descriptor ie. web.xml? -

why should deployment descriptor file web.xml ? in case if change other name, work fine ? need understand whole things how works? that's java servlet standard has decreed deployment descriptor should called. is there reason want change name?

ios - Phonegap not rendering page after splash screen -

i have phonegap application in store had had update recently. made changes javascript , html file , tried build again making changes build setting able build application iphone 5s (64 bit). problem runs new changes made in ipad (32 bit) not display after splash screen in iphone 5s. can download , run application store in iphone 5s build previous versions of iphone when build , run using xcode; problem appear. if have come across such problem; kindly request solution or suggestion.thanks in advance note: using latest xcode , phonegap 2.7.0

extjs - Button on TitleBar simply doesn't display Sencha Touch -

here code. ext.application({ name: 'sencha', launch: function() { ext.create("ext.tabpanel", { fullscreen: true, tabbarposition: 'bottom', items: [ { xtype: 'titlebar', docked: 'top', title: 'myapp', itmes: [{ xtype: 'button', text: 'add', align: 'right' }] }] }); } }); someone said use navigation view, , saw examples using ext.viewport.add(), don't either of them. wonder possible add buttons on titlebar , bind events onto buttons in configuration directly? update: i found approach--> using ext.viewport.add() , works in desktop browers, doesn't work when generated cordova project and/or deployed onto devices (both android , windows phone 8), titlebar doesn't di

jquery - Retrieving a list of Tin Can API statements from SCORM Cloud LRS -

i have added tin can course lms , able upload , playback course statements being written initial application realm lrs. far good. now want able retrieve lrs list of statements have been written can iterate through these , check course completion signed in user. statements being written following endpoint: https://cloud.scorm.com/tc/7qlmqa89wv/ i have tried query statements using .net library , following code: //initialize tincan remote lrs retrieving completion statistics lrs = new remotelrs("https://cloud.scorm.com/tc/7qlmqa89wv/", "<username>", "<pw>"); version = tincan.tcapiversion.v101; //create tincan statement query completed activities logged in user var query = new statementsquery(); query.agent = new tincan.agent(); query.agent.mbox = "mailto:jpmcfeely@hsl-data.com"; query.verbid = new uri("http://adlnet.gov/expapi/verbs/completed"); query.activityid = new uri("http://tincanapi.com/golfexample_tcap

Spring custom validation message -

custom validation messages don't work. have domain class: ... @roojpaactiverecord public class letter { @notnull(message="{validation.number_empty}") @size(min=1,max=20, message="{validation.number_size}") @column(length=20, nullable=false) private string number; ... } /web-inf/i18n/messages.properties: #validation validation.number_size=number must more 1 , less 20 symbols ... i want validate fields domain class during form submitting. validation works, output message: {validation.number_size} instead of expected string: number must more 1 , less 20 symbols in other places of project use messages properties files success. /web-inf/spring/webmvc-config.xml <bean class="org.springframework.context.support.reloadableresourcebundlemessagesource" id="messagesource" p:basenames="web-inf/i18n/messages,web-inf/i18n/application" p:fallbacktosystemlocale="false"> </bean>

multithreading - Nodejs synchronicity between requests -

i understand asynchronous nature of node , async programming concepts, have been doing long time. in situation need simultaneous requests check "in sync" if will. let me explain: usera requests resource doesn't exist. set flag "isprocessing" let others know resource being created. userb requests same resource, sees it's processing, , waits ready (using polling - don't focus on this, part works way want) [a bunch of heavy async stuff happens generate resource] resource ready, polling notified (like said, part works) the part has me in pickle "step 2" set "isprocessing" flag. asynchronous database operation ( mongo ) not yet complete when 2+ requests come in at same time . result, multiple requests attempting create same resource. problem goes away if requests separated enough time database write happen (~5ms), not "simultaneous" requests. can offer advice solve this. seems need set "isprocessing&quo

android - Use cases where PendingIntent is used -

i trying see how pendingintents useful. can provide examples of apps pendingintents used? i not looking examples of code, real life use cases pendingintents used, bit of explaination. thanks, in nutshell, pendingintent lets authorize different application execute intent on behalf, i.e. , permissions. a typical case passing pendingintent notificationmanager . have intent open activity private application. if you're passing intents within application don't have deal pendingintent . the documentation has pretty explanation of this.

android - is it possible to detect/modify input from softkeyboard -

i'm working on android service. 1 of task read input data entered user (and modify it) . the possible way till now, i've figured out make custom keyboard , write methods in custom keyboard. don't want . is other method it? thanks edit: need work across multiple applications. don't think textwatcher can here. it can surely observed using accessibilityservice. check http://developer.android.com/reference/android/accessibilityservice/accessibilityservice.html specially typeviewtextchanged , typewindowcontentchanged this not completly check key hooks can check changedtext in focused window. little workaround able want do.

extjs - Converting Sencha Touch 2.3 app to native android - cordova - APK size too big for even small app -

i converting sencha touch 2.3 app native android via sencha cmd (which integrates cordova) i following guide : http://docs.sencha.com/touch/2.3.1/#!/guide/cordova i have working sencha touch 2.3 app, made via sencha architect 3.0.4 i switch directory of app, , sencha codova init com.example.voltclient in cordova.local.properties generated in root folder, change following line android have android platform. cordova.platforms= android run sencha app build native i never told precisely .apk file made, search entire folder structure, , find apk inside \cordova\platforms\android\ant-build it has 2 files of name voltclient-debug-unaligned.apk , voltclient-debug.apk . both of same exact size, , copy 1 of them phone using usb connection, , install on phone work the last 2 points, have sort of figured out on own, didnt read in guide. questions are: is there better way of doing this? documented somewhere - surely there clear path apk generated rather me having search deep i

eclipse - Java game ArrayIndexOutOfBounds -

how fix error? trying import "sub- sprite sheet" game getting arrayindexoutofbounds error source code , errors: i'm trying implement 'sub-spritesheet" , have no idea why i'm getting out of bounds error. here screens of class errors occur. package com.apcompsci.game.graphics; import java.awt.image.bufferedimage; import java.io.ioexception; import javax.imageio.imageio; public class spritesheet { private string path; public final int size; public final int width,height; public int [] pixels; public static spritesheet tiles = new spritesheet("/textures/sheets/spritesheet.png",256); public static spritesheet spawn_level = new spritesheet("/textures/sheets/spwan_level.png",48); public static spritesheet projectile_demigod = new spritesheet("/textures/sheets/projectiles/demigod.png",48); public static spritesheet player = new spritesheet("/textures/sheets/player_sheet.png",95,129); public static spritesheet play

c# - WPF ListView binding mutliple sources -

i have listview , display multiple collections of same type (contrary other topics found multiple binding), or better - unediable item, "default item", first item in listview , multiple concatenated collections of same type. example 1 collection , 1 item: <listview itemssource="{binding people}"> <listview.itemtemplate> <datatemplate> <wrappanel> <textblock text="{binding name}" /> </wrappanel> </datatemplate> </listview.itemtemplate> <listviewitem itemssource="{binding patientzero}"> <wrappanel> <textblock text="{binding name}" /> </wrappanel> </listviewitem> </listview> and public class person { public string name { get; set; } public person(){} } ...and code observablecol

linux - Capture turbospeed while running a program -

i wanted create automation program capture turbospeed of cpu while program running. my automation script should using perl language. i did try use: system("script mytest.txt"); system("./turbostat"); when execute program, script line works not turbostat. can suggest me ways through can capture turbospeed? have @ sys::info::device::cpu module. synopsis use sys::info; use sys::info::constants qw( :device_cpu ); $info = sys::info->new; $cpu = $info->device( cpu => %options ); printf "cpu: %s\n", scalar($cpu->identify) || 'n/a'; printf "cpu speed %s mhz\n", $cpu->speed || 'n/a'; printf "there %d cpus\n" , $cpu->count || 1; printf "cpu load: %s\n" , $cpu->load || 0;

batch file - IF statement in cmd, how to use the current time to show an error -

i writing code in batch file school system, code shows when did student changed his/her password. had problem the system, shows student username have changed there password users show current time , date. trying make if statement saying: if date , time of user == date , time of current day. show echo message. i have tried alot of codes work doesn't seem right. here 1 of codes: (for /f "delims=" %%i in ('net user %myname% /domain ^| find /i "password last set"') set myresult=user %myname%: %%i) if "%date%-%time%" equ "%myresult%" echo "password not changed." it useful if code in vbs perfect. thank in advance. :) here's vbscript you. since time may change time net user returns , have opportunity test it, script checks see if it's within 10 seconds of current date , time. feel free adjust threshold see fit. ' create command string... strcommand = "cmd /c net user " & struse

jquery - load div from php with javascript -

i want build editable lists in php, javascript. issue want when click on item occurs, load more details item in div. without details code works fine. can't extras.. code : product.class public function __tostring(){ // string return outputted echo statement return ' <li id="product-'.$this->data['productid'].'" class="product"> <div class="text">'.$this->data['productname'].'</div> <div id="productdetails"></div> <div class="actions"> <a href="#" class="edit" id="editproduct">edit</a> <a href="#" class="delete">delete</a> </div> </li>'; } product.js // listening click on edit button $('.product a.edit').live(&

unity3d - Serialization error: Error when trying to link to a previously seen object -

my game has 2 scenes: scene main menu, , scene actual game. if playing in game scene, able return main menu. code brings me main menu looks this: application.loadlevel(“menu”); if click on new game in main menu, game scene restarts, i.e. following code executed: application.loadlevel(“game”); when scene loads following error reported: missingreferenceexception: object of type ‘storeinformation’ has been destroyed still trying access it. script should either check if null or should not destroy object. uniqueidentifier.configureid () (at assets/plugins/whydoidoit.com/serialization/uniqueidentifier.cs:107) uniqueidentifier.fullconfigure () (at assets/plugins/whydoidoit.com/serialization/uniqueidentifier.cs:86) uniqueidentifier.<awake>m__43 () (at assets/plugins/whydoidoit.com/serialization/uniqueidentifier.cs:101) savegamemanager.awake () (at assets/plugins/whydoidoit.com/serialization/savegamemanager.cs:295) note: realised don’t have start game in scene “game” error

android - Load images from byte array into the gridview -

i'm using universalimageloader library load images gridview. , i'm having images in form of byte array. how use universalimageloader arraylist of byte arrays i'm getting byte array sqlite database. try method use byte array object pass method , bitmap arraylist in store bitmap , pass customgridviewadapter in pass array list in adapter , set bitmap in imageview void setimage2(byte[] byteimage2) { bitmapfactory.options options = new bitmapfactory.options(); options.indither = false; options.injustdecodebounds = false; options.inpreferredconfig = bitmap.config.argb_8888; options.insamplesize = 1; options.inpurgeable = true; options.inpreferqualityoverspeed = true; options.intempstorage = new byte[32 * 1024]; bitmap bmp = bitmapfactory.decodebytearray(byteimage2, 0, byteimage2.length, options); // bitmap store in bitmap arraylist in add }

java - GWT : Render a hyperlink in a TextColumn of a CellTable -

first of - beginner java , gwt. have scripting language background please explicit. i have celltable populated data database( serverkeyword class gets data ). mycelltable.addcolumn(new textcolumn<serverkeyword>() { @override public string getvalue(serverkeyword object) { // todo auto-generated method stub return object.getname(); } }); the example above works, shows data text. need make hyperlink, when click it, opens new tab location. i've surfed web , got conclusion need override render. public class hypertextcell extends abstractcell<serverkeyword> { interface template extends safehtmltemplates { @template("<a target=\"_blank\" href=\"{0}\">{1}</a>") safehtml hypertext(safeuri link, string text); } private static template template; public static final int link_index = 0, url_index = 1; /** * construct new linkcell. */ public hypertextcell() {

d3.js - Passing (this) between functions -

i'm trying extend 1 rectangle using drag handle without altering other rectangles. i've tried pass on selected 1 using (this) can't work. http://jsfiddle.net/sjp700/gmlay/ -drag right hand black bar. issue or alternatives? var dragright = d3.behavior.drag() .origin(function() { var t = d3.select(this);

javascript - How to handle DropZone.js file upload completed -

after file uploaded, want able move out of dropzone html element , li item. html structur <div class="dropzone"> here.jpg </div> <ul> <li>to here.jpg</li> </ul> js $(function() { // event listeners var mydropzone = new dropzone("div#mydrop", { url: "/images/upload/"}); //not working mydropzone.on("addedfile", function(file) { file.previewelement.addeventlistener("click", function() { }); //feedback dropzone.options.mydropzone = { init: function() { this.on("success", function(file, responsetext) { //do stuff }); this.on("complete", function(file) { //do stuff }); this.on("addedfile", function(file) { //do stuff }); this.on("uploadprogress", function(file) { //do stuff });

windows - Logstash input not working -

i trying use nio2path logstash 1.4.1 ( https://logstash.jira.com/browse/logstash-2229 ). trying thix fix because experimencing serious troubles when use glob path on windows parse folder of iis logs. this config: input { nio2path { path=>"logs/*.log" } } output { stdout { codec => rubydebug } } and when run agent: logstash-1.4.1\bin\logstash agent -f myconfig.config -l log\agent.log nothing happens, console keep running without crashing or display errors. message warning log written in log\agent.log: {:timestamp=>"2014-06-10t11:32:45.585000+0200", :message=>"using milestone 1 input plugin 'nio2path'. plugin should work, benefit use folks you. please let know if find bugs or have suggestions on how improve plugin. more information on plugin milestones, see http://logstash.net/docs/1.4.1/plugin-milestones", :level=>:warn} {:timestamp=>"2014-06-10t15:13:47.846000+0200", :message=>

terminology - What is the difference between the following Neural Networks: Artifical NN, Static NN, Simulated NN -

i came along following names: artificial neural network [1] static neural network [1] simulated neural network [2] do mean same? [1] huang, b. , kechadi, m.-t. hmm-snn method online handwriting symbol recognition. image analysis , recognition, springer berlin heidelberg, 2006, 4142, 897-905. [2] https://en.wikipedia.org/wiki/snn artificial neural network (ann) seems generic term. guess people use prefix "simulated" want emphasize not biological neural network. every ann either "static" or "dynamic". static ann don't have context memory. well-known types of ann static are multilayer perceptron (mlp) radial basis function networks (rbfn) wavelet networks fuzzy networks well-known types of dynamic anns are: recurrent neural networks (rnn) time-delay neural networks (tdnn) see also: types of neural networks

javascript - How to trigger scroll of container by scrolling outside of said container -

here's dilemma: have container of content runs in centre of window. outside of container grey background gets larger or smaller depending on how big window size is. issue i'm having i'm not able scroll up/down central container if mouse outside container (it work fine if mouse in container). achieve effect see in google documents or site here . basically, i'd able scroll container point in window. things have attempted: binding mouse scroll whole body--this work, issue there no detection on mobile. binding scroll body doesn't seem work either body technically static--it's content within goes down page. here's sample code of template below (nonhome_container scrolling): </pre> <div class="full-width" id="content"> <?php // run page loop output page content. if ( have_posts() ) while ( have_posts() ) : the_post(); ?> <article id="post-<?php the_id(); ?>">> <di

c++ - What to do when a DLL needs a bigger stack size than the main exe application? -

i have simulation engine written in visual c++ 2010 , i'm implementing dll plugin based on 3rd party application. however, stack overflow error when library called 3rd party app's thread. after debugging turned out dll requires bigger stack size thread has. possible extend current thread's stack size somehow? i know should review simulation engine's code , move big objects heap. problem engine maintained vendor , i'd avoid modifying code if possible. i'm thinking creating own thread in dll bigger stack size , returning results calling thread when calculation finishes. right approach? thanks, michal i'm going suggest first thing check how stack space you're using. allocating large objects on stack? program utilize significant recursion depths? write test hook application can link dll , check how stack space use. if you're allocating large objects on stack suggest moving them heap. if you're doing significant recursion may