Posts

Showing posts from July, 2012

html - Stuck with onblur event in IE8 -

Image
when text entered in text field, ( shown in image )and if incorrect open 1 alert box on onblur event. working fine in browser except one, ie 8. in ie 8 when typing wrong letters , directly clicking on datepicker icon it's not appear alert. means not executes onblur event in ie8. note : here text field has type text, user can write anything. means facing problem in onblur event in ie8 appreciated. seems work in ie7 , up. thought. <input type='text' id="id" name="name" maxlength="10" /> <input type='text' id="id2" name="name2" onblur="count(this);" maxlength="10" /> <script type="text/javascript"> function count(arg) { arg.value = 'blue'; return arg.value; } // option var t = document.getelementbyid("id"); t.onblur = function() { alert("blurring"); }; </script>

node.js - Nesting functions in nodejs / javascript -

from i've read, nesting functions in javascript causes declarations / destructions can avoided using "static functions" or singleton implementation. "new" same thing 2 instances of function or objects independent copies. is true? if so, can have same functionality nested functions , "new". game server in nodejs / javascript. i've reached 8 levels of nested functions , starting worry. example: db.cityupdateupkeep = function( cuid ) { /** @type {array} */ var buildings = null; db.cityget( cuid, function( error, city ) { if( error ) { console.log( "couldn't city" ); } else { db.ibuildings.find( {cuid:cuid}, function( error, cursor ) { if( error ) { console.log( "-error:" ); console.log( error ); } else { cursor.toarray( function( error, response ) {

php - Video-IDs to array, array has zero entries -

i have code edit: works now $eigenesvideoid = array(); $eigenesvideotitel = array(); $eigenesvideotags = array(); $counter = 0; function printentirefeed($videofeed, $counter) { global $eigenesvideoid; global $eigenesvideotitel; global $eigenesvideotags; global $counter; foreach($videofeed $videoentry) { if ($videoentry->isvideoprivate() != "1") { $eigenesvideoid[$counter] = $videoentry->getvideoid(); $eigenesvideotitel[$counter] = $videoentry->getvideotitle(); $eigenesvideotags[$counter] = implode(",", $videoentry->getvideotags()); $counter++; } } try { $videofeed = $videofeed->getnextfeed(); } catch (zend_gdata_app_exception $e) { return; } if ($videofeed) { printentirefeed($videofeed, $counter); } } printentirefeed($videofeed, 1); echo count($eigenesvideoid); should put each video not private array. array empty, count zero. how change recursive function (or outer array variables) hav

differential equations - Calculate ODE's with MATLAB -

Image
the differential equations: α'(t)=s(β-βα+α-qα^2) β'(t)=(s^-1)(-β-αβ+γ) γ'(t)=w(α-γ) intitial values α (0) = 30.00 β (0) = 1.000 γ (0) = 30.00 calculation i want solve problem t_0=0 t=10 while using values s = 1, q = 1 , w = 0.1610 i've no idea how write function ode's , appreciate help! i'm not in habit of solving other people's homework, today's lucky day guess. so, have system of coupled ordinary differential equations: α'(t) = s(β-α(β+1)-qα²) β'(t) = (-β-αβ+γ)/s γ'(t) = w(α-γ) and want solve for y = [α(t) β(t) γ(t)] with 0 < t < 10, s = 1, q = 1, w = 0.1610. way in matlab define function computes derivative ([α'(t) β'(t) γ'(t)]), , throw in 1 of ode solvers ( ode45 first bet): s = 1; q = 1; w = 0.1610; % define y(t) = [α(t) β(t) γ(t)] = [y(1) y(2) y(3)]: deriv = @(t,y) [... s * (y(2) - y(1)*(y(2)+1) - q*y(1)^2) % α'(t) (-y(2) - y(1)*y(2) + y(3))/s

iphone - Get ObjectManagedContext from Delegate -

i'm need de objectmanagedcontext appdelegate, when tried don't work... dont know why... followed mount of tutorials not work.... code: appdelegate.h #import <uikit/uikit.h> @class stopwalletviewcontroller; @interface stopwalletappdelegate : uiresponder <uiapplicationdelegate> @property (strong, nonatomic) uiwindow *window; @property (readonly, strong, nonatomic) nsmanagedobjectcontext *managedobjectcontext; @property (readonly, strong, nonatomic) nsmanagedobjectmodel *managedobjectmodel; @property (readonly, strong, nonatomic) nspersistentstorecoordinator *persistentstorecoordinator; @property (strong, nonatomic) stopwalletviewcontroller *viewcontroller; @property (strong,nonatomic) uinavigationcontroller *navigationcontroller; - (void)savecontext; - (nsurl *)applicationdocumentsdirectory; @end appdelegate.m #import "stopwalletappdelegate.h" #import "stopwalletviewcontroller.h" @implementation stopwalletappdelegate @synthesize

assign - Efficiency in assigning programmatically in R -

in summary, have script importing lots of data stored in several txt files. in sigle file not rows put in same table (df switching dt), each file select rows belonging same df, get df , assign rows. the first time create df named ,say, table1 do: name <- "table1" # in code value of name depend on different factors # , **not** known in advance assign(name, somerows) then, during execution code may find (in other files) other lines put in table1 data frame, so: name <- "table" assign(name, rbindfill(get(name), somerows)) my question is: assign(get(string), anyobject) best way doing assignment programmatically? thanks edit: here simplified version of code: (each item in datasource result of read.table() 1 single text file) set.seed(1) # datasource <- list(data.frame(filetype = rep(letters[1:2], each=4), id = rep(letters[1:4], each=2), var1 = as.inte

java - FileOutputStream appending issue, where I am going wrong? -

i trying 3 5 pdf file(from internet source) & merging them 1 after another. fyi, dont want use itext or other pdf lib, because, please @ code once public static void savefile(string[] urls, string filename) throws ioexception { clienturlconnection clienturlconnection = null; inputstream inputstream = null; try { int t = 1; fileoutputstream outputstream = new fileoutputstream(filename,true); (string url : urls) { clienturlconnection = new clienturlconnection(url); clienturlconnection.sethttpmethod(clienturlconnection.get_method); inputstream = clienturlconnection.getinputstream(); outputstream.write(ioutils.tobytearray(inputstream)); inputstream.close(); outputstream.flush(); system.out.println((t++) + " - file inserted in " + filename + "\n"); thread.sleep(3000); } outputstream.close();

android - How to customize style of AlertDialog across all versions? -

i try make custom style alert dialog work acros 2.2 4.2 versions. best approach found use alertdialog.builder builder = new alertdialog.builder(new contextthemewrapper(this, r.style.alertdialogcustom)); however available api 11 not work on versions older that. suggest painless way implement alert dialog custom style? thanks. you can use android-support-v4.jar (you can read library here ) add library in libs folder , add build path now, creating dialog, now convert extends activity fragmentactivity (it takes nothing, sub class of activity) now have create static inside activity : public static class reportnamefragment extends dialogfragment { @override public dialog oncreatedialog(bundle savedinstancestate) { alertdialog.builder builder = new alertdialog.builder(getactivity()); builder.settitle(r.string.enter_report_name); layoutinflater inflater = getactivity().getlayoutinflater(); view view = inflater.inflate(r.lay

python - How to add more eggs from the command line? -

my buildout.cfg looks : [eggs] recipe = zc.recipe.egg eggs = package1 package2 i able add more eggs on command line when run buildout. works 1 egg with: bin/buildout eggs:eggs+=package3 but did not find syntax add more 1 package. none of these working: bin/buildout eggs:eggs+=package3 eggs:eggs+=package4 bin/buildout "eggs:eggs+=package3 package4" bin/buildout "eggs:eggs+=package3:package4" with variations of : , ; , \n seprator. buildout takes newlines separators when merging += , -= options. you'll have insert newlines. bash lets insert newlines on command line within quoted strings: $ bin/buildout "eggs:eggs+=package3 > package4 > " you press enter after package3 , can insert newlines, until enter closing " quote.

How to Get All Memory Path (Internal or External Memory) list in android -

i'm facing problem detect memory path in android device. if try provide tips , example aren't able getting proper external memory path. for example : if try external memory in samsung tab 2 used code :: environment.getexternalstoragedirectory().getabsolutepath() it provide internal mounted memory path. //storage/sdcard0/ after lot of googling found 1 application show path of device application name " es explorer " application showing path of memory. please provide solution can fix our problem beyond types of storage volumes supported standard android sdk wide variety of vendor- , version- unique possibilities. you can find mounted filesystems reading /proc/mounts text file. however: this find filesystems mounted - example, not find usb storage volumes if handled arbitrary usb accessories application, rather mounted linux operating system underlying android. you have apply logic filter out other various file systems not general s

c++ - What is the purpose of boost accumulator error_of<mean>? -

the documentation of error_of< mean > feature boost accumulators states calculates error of mean value formula: sqrt(variance / (count - 1)), where variance calculated by: variance = 1/count sum[ (x_i - x_m)^2 ] sum goes on values x_i i=1..count of sample , x_m mean value. gives used formula (for error value): sqrt(1/ (count(count - 1)) sum[ (x_i - x_m)^2 ] ), wikipedia states standard deviation, 1 use either uncorrected or corrected sample standard deviation. latter calculated by: sqrt(1/(count-1) * sum[ (x_i - x_m)^2] ) this 1 use calculate errors of mean values. purpose of error_of< mean >? , error calculated there? the overall formula of boost.accumulators indeed correct, computed in non-standard fashion. first, sample variance average of squared deviations v_sample = sum[ (x_i - x_m)^2] / count s_sample = sqrt[ v_sample ] but s_sample biased estimater of population standard deviation sigma . unbiased estimator of population standa

javascript - jQuery RightClick Handler Plugin -

i looking way distinguish different click types in mouse events jquery. ended small plugin seems work. feedback on it. the main difficulty emulate dom event "click" or "mousedown" le right mouse button. if(jquery) (function(){ $.extend($.fn, { rightclick: function(handler) { $(this).each( function() { $(this).on("rightclick", function(e,event) { handler(event); }); }); return $(this); }, rightmousedown: function(handler) { $(this).each( function() { $(this).on("rightmousedown",function(e,event) { handler(event); }); }); return $(this); }, rightmouseup: function(handler) { $(this).each( function() { $(this).on("rightmouseup",function(e,event) { handler(even

doctrine2 - Two one-to-many relationship with reference table (Doctrine 2, ZF2) -

i've problem many-to-many relation. want have access reference table querybuilder query. many-to-many relation don't have access reference table, i've set 2 one-to-many relationships. structure likes: user ---> userusercategory <--- usercategory the above structure has 2 one-to-many relationships , working fine database. when have user following data in database (in userusercategory): table user id | name 1 | bart 2 | gerard table category id | name 1 | officer 2 | medic table userusercategory user | category 1 | 1 2 | 2 so bart officer , gerard medic. when want retrieve data, said bart medic, , gerard has "null" value in category. my user-entity: /** * entity class representing post of our user module. * * @orm\entity * @orm\table(name="user") * @orm\entity(repositoryclass="user\repository\userrepository") * */ class user extends zfcuser implements userinterface { /** * categories user

sql - Ordering a column while adding an identity column in an existing table in Sybase -

thanks forum, got number of solutions past queries, google too. first post in forum although. i have table order columns pin, orderpath, quantity . there 5000 data in table already. now, want add identy column, orderid , order column pin . using following query helps not in order required. alter table order add orderid numeric(6,0) identity here's see: pin--orderpath--quantity--orderid 11 xyz/pop 200 1 22 kl/pod 100 2 33 djh/dd 200 3 44 dj/po 300 4 alter table orderadd add order_id datatype

Is there a PHP framework for ticket system? -

i'm working on ticket system, rather issue system assigns tasks developer. need integrate small ticket system in big webapp made in php, allow operator ask chefs. do know php framework or php class collections accomplish behaviour? please google question before post here search "ticket system open source php" try http://pulse2.com/2012/12/27/open-source-ticket-system/

javascript - Need a regex that accepts any text that contains at least 3 alphabets -

i need regular expression accepts string contains @ least 3 english alphabets. alphabets can anywhere in string. test cases: should return true for: abc test number 123 $@!!. 123abc289389798 should return false for: ab ab213823897 edit: sorry, should clarify needs 3 english alphabets. alphabets can anywhere in string. how this? [a-za-z].*[a-za-z].*[a-za-z] the [a-za-z] matches character a-z or a-z. regex guarantees have 3 of these characters. .* matches number of character, 3 alpha characters can consecutive or have before/after/in between. test out @ regex tool http://gskinner.com/regexr/ you can consolidate this: ([a-za-z].*){3} edit: replaced \w [a-za-z] , added explanation. edit2: @nhahtdh, removed .* beginning , end since need match, not coverage of whole string.

Remove margin-right jquery -

i'm using sortable, need remove margin-right , not leave 0. have problems if use margin-right 0 sortable. wins default margin jquery. no use class change, , can not use remove.attr ("style"), because remove css. $('selector').css('margin-right', '');

How can I reset a function implemented with a jquery media query -

i have implemented function on resizing browser window below 1024, works fine when reducing size of browser if enlarge browser window on 1024 newly introduced function stays. how can removed or reset function? $(window).resize(function() { var width = $(window).width(); // define screen if( width >= 768 && width <= 1024 ) { // $(function() { // move $("article img").each(function() { var item = $(this); item.insertafter(item.next()); }); }); } }); not sure it, you're moving images, originally, have move images ? $(function() { $(window).on('resize', function() { var width = $(window).width(); if ( width >= 768 && width <= 1024 ) { $("article img").each(function() { var item = $(this); item.insertafter(item.next()); }); }else{ $("article img").each(function() {

Android library projects and custom xml attributes -

i'm using 2 libraries in projects: holoeverywhere , google maps v2. works fine except when try use libraries custom xml-attributes. since adt r17 no longer have use package name define namespace, instead use " http://schemas.android.com/apk/res-auto " . res-auto automatically substituted package name. example if want configure initial state of google map fragment in xml <?xml version="1.0" encoding="utf-8"?> <fragment xmlns:android="http://schemas.android.com/apk/res/android" xmlns:map="http://schemas.android.com/apk/res-auto" android:id="@+id/map" android:layout_width="fill_parent" android:layout_height="fill_parent" class="com.google.android.gms.maps.supportmapfragment" map:uicompass="true" map:maptype= "normal" map:uirotategestures="true" map:uiscrollgestures="true" map:uitiltgestures="true" map:uizoomcontrols="true"

xml - What should be targetNamespace in API that is being versioned? -

our team developing api being versioned. have following naming schema: http://example.com/remote/soap/vx.y/wsdl where x.y version number. question is: should targetnamespace contain whole wsdl address or i.e. http://example.com/remote/soap part? digging through inernet, have found following tutorial 1 can read: the value of targetnamespace unique identifier, typically companies use there url followed qualify it. in principle namespace has no meaning , companies have used url schema stored, targetnamespace , xml parsers use hint path schema [...] taking under consideration fact our api can change among different versions, think better provide version number in targetnamespace uri.

QSqlDatabase LNK2019 error -

i tried compile following code in qt 5.0.0 #include <qapplication> #include <qtsql/qsql> #include <qtsql/qsqldatabase> #include <qstringlist> int main(int argc, char *argv[]) { qapplication a(argc, argv); qstringlist db = qsqldatabase::drivers(); return a.exec(); } and received error: main.obj:-1: error: lnk2019: unresolved external symbol "__declspec(dllimport) public: static class qstringlist __cdecl qsqldatabase::drivers(void)" (__imp_?drivers@qsqldatabase@@sa?avqstringlist@@xz) referenced in function _main debug\test.exe:-1: error: lnk1120: 1 unresolved externals i have added qt += sql in .pro what's problem? you should add qtsql.lib ( can find name of qtsql in qt/lib in computer) go project/properties/configuration properties/linker/input, add qtsql.lib additional dependencies p.s. used face error, , error fixed way. luck

Can a .BMP file be stored in an HTA (HTML/VBScript)? -

i've noticed in backup of firefox bookmarks icon displayed left of each entry held character stream in tags. example: icon="data:image/png;base64,ivbor [data removed shorten example] rkjggg==" i have 3 bmp files (2 4x20 (249 bytes) , 1 102x82 (24.7 kb)) hide within html application don't lost. the larger 1 appears 3 times in style tag follows (1 occurrence shown): <style type="text/css"> #frmmainbody {background:grey; background-image:url('background.bmp'); margin:0; padding:0; font:normal 10pt microsoft sans serif;} </style> the other 2 appear in vbscript subroutines follows: sub button_glow ' highlights button when cursor hovers on it. window.event.srcelement.style if .backgroundcolor <> "lavender" .backgroundcolor = "lavender" .backgroundimage = "url(glow.bmp)" .backgroundpositiony = -2 .backgroundrepeat = "repeat-x" end

Android: Spinners loose their values when I add dynamically new ListView entries on click of spinner item? -

i developing android apps. in apps having 2 activities, first activity displaying list , in second activity having spinner , listview in same activity , when user click on item spinner listview displayed. when user navigate first activity second activity spinner populated listview. problem after listview displayed spinner item blank. don't know doing wrong. please have solution. here posting few code of second activity public class projectdetailactivity extends sherlocklistactivity { private list<string> list = new arraylist<string>(); private arraylist<hashmap<string, string>> list2 = new arraylist<hashmap<string,string>>(); protected void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); setcontentview(r.layout.activity_project_detail); //get spinner item server when user comes first activity. new loadphasedata().execute();

sql - How can I wait for an SSIS package to complete -

i have sql agent job. first step in job run ssis package loads data .txt file sql table. next steps in job manipulate data loaded table until refreshing table in excel results. problem having seems job not wait ssis package complete before moving on step 2 of job, works fine, , starts data manipulation before data loaded table , gives incorrect results. how can job wait ssis package complete before moving on? are running in sql server 2012? there specific parameter catalog packages called synchronized which, if set false, considers package execution step successful package starts. to see various commands being executed job, run query on server running jobs: select step_id, step_name, subsystem, command msdb.dbo.sysjobsteps js inner join msdb.dbo.sysjobs j on j.job_id = js.job_id j.name = <your job name here> order step_id if don't see /par "\"$serveroption::synchronized(boolean)\"";true in command field, means it's running async

What can i use instead of Array in javascript? -

i have script auto populate form (3 fields) , work wanted (previously), now, when have 2000 inputs, can not handle anymore. want is, make auto populate script can add more information later, new inputs, now, need start changing numbers each input, believe you'll understand batter through code: javascript: var ids = new array(); var use = new array(); var ful = new array(); ids[0] = ""; use[0] = ""; ful[0] = ""; ids[1] = "test1"; use[1] = "test2"; ful[1] = "test3"; ids[2] = "test1"; use[2] = "test"; ful[2] = "test3"; ids[3] = "test1"; use[3] = "test2"; ful[3] = "test3"; ids[4] = "test1"; use[4] = "test2"; ful[4] = "test3"; function choice() { //x = document.getelementbyid("users"); y = document.getelementbyid("selectusers"); //x.value = y.options[y.selectedindex].text; document.getelementbyid("id

android - Update check-boxes status with visibility change -

i having check boxes control visibility of different views. when check box status changed visibility changed, working fine. in app views visibility changes on different user input. want update checkbox status if visibility of view change way. there way it. you have put checkbox.setchecked(true); anywhere call someview.setvisibility(view.invisible); there no way afaik can inherently "watch" visibility state, have active set checked state @ same time change visibility state.

java - Are there any alternative for getSystemSelection()? -

i trying data clipboard using getsystemselection() it's returning null . references platforms don't support this. there alternative? here current code: clipboard c = toolkit.getdefaulttoolkit().getsystemselection(); system.out.println(c.getdata(dataflavor.stringflavor).tostring());

Weird calculation in ruby 1.9.3 -

i've upgraded 1 of old rails project 1.8.7 1.9.3, ran following problem: when i'm doing calculation 188 * 0.01, returns 1.8800000000000001 instead of 1.88, happens number 189 well, other numbers correct, i'm using bigdecimal, precision still messed up. didn't happen in 1.8.7, wondering if else having same problem , came fix. thanks.

delphi-shortcut to implement interface method and abstract method from ancestor interface or class -

i have example code this iexample=interface procedure test; end; tbaseclass=class function check:boolean;abstract; end; texampleobject=class(tinterfacedobject,iexample) end; tanotherobject=class(tbaseclass) end; my question is, how can implement interface method , abstract method ancestor? i use visual studio , c#, simple make implementation abstract method , interface method, right click on class, , implement method. does rad studio xe2 have similiar tool or third party tool have same function? because annoying if must write down abstract , interface method manually i suppose there ide plugins out there offer functionality want. i use method every day: copy methods interface public section of class, set cursor on 1 of these methods , execute shortcut ctrl-shift-c . delphi automagically create functions/procedures in implementation section you! this works classes...

Running multiple projects in visual studio -

i'm running visual studio express 2012 on windows 7 through bootcamp. have solution several projects, , when start debugging runs first project, can't start new instances of others (when right click , choose debug -> start new instance grayed out). i tried creating new solution 2 blank projects , have same problem. any ideas? right click on solution -> common properties -> startup project -> multiple startup projects -> choose "start" actions in drop-down lists. start debugging usual.

.net - DbGeography.PointFromText() throws 'Latitude values must be between -90 and 90 degrees' for Japan -

google tells me japan's lat/long values (36,138) .net throws error 24201: latitude values must between -90 , 90 degrees. any ideas why? i have had same issue you, using dbgeography.pointfromtext("point(lat lng)") when lat & lng arguments expected other way around. complete answer this: // google, japan's latitude: 36; longitude: 138 var lat = 36; var lng = 138; var location = dbgeography.pointfromtext($"point({lng} {lat})");

java - Aceepting any Client Certificate in SSL-Handshake -

i'm using netty on android , server side establish ssl-secured connection client-authentication. i'm having difficulties connecting these certificates since sslengine declines them due "null cert chain" . this i've done on server side. set sslcontext signed server certificat (the client knows ca can validate one). to make server accept certificates clients (since self-signed) implemented dummytrustmanager accept any. private static class dummytrustmanager implements x509trustmanager { private x509certificate[] mcerts; public dummytrustmanager(certificate[] pcerts) { // convert x509 array mcerts = new x509certificate[pcerts.length]; for(int = 0; < pcerts.length; i++) { mcerts[i] = (x509certificate)pcerts[i]; } } @override public void checkclienttrusted(x509certificate[] arg0, string arg1) throws certificateexception{}

c++ - memory overlapping in an initialization of a class -

my problem have header file in store classes , in cpp file have initializations of these classes, initialization not dynamic have number of arrays of different classes. now problem when started expanding classes in header, adding more members , methods,the initialization of 1 specific class start throwing assertions @ me of memory overlapping , suggested using memmove() instead of memcpy() , though use neither of them in class. i tried replacing class downgraded version of worked in older versions of source still threw same assertion @ me don't know part of code relevant here assertion being asserted in initialization of class without pointer wrong. this initialization of class : shuriken(cpfloat m,cpvect veloc,cpfloat elast,cpfloat myu) : spark() , bang1() , shurikenflame() { smass = m; sv = veloc; se = elast; su = myu; todraw = false; removed = true; allocatedbombanim = false; drawflamedshuriken = false; deployflamebang = false; passedline = false; hitfruit = false;

removing a word from a url using regex in php -

this if statement take example href source code: href="/toronto/2013/05/14/the-airborne-toxic-event/4296/" from source code if ($text=preg_match('/href="([^"]*)"/', $text, $matches)) { $output=$matches[1]; return $output; } and return /toronto/2013/05/14/the-airborne-toxic-event/4296/ i trying return url without either "/toronto" or "/toronto/" (i'm not sure 1 need) if show me regex expression would appreciate it. thanks use preg_replace : return preg_replace('~^/?toronto/~', '', $output); if you're sure "toronto/" not appear anywhere else in string, can use str_replace : return str_replace('/toronto', '', $output); this assumes there'll leading slash.

c# - FX COP Could not resolve type reference: System.Windows.Input.ICommand -

having troubles fxcop on our buildagent , through command line tool only. i using caliburn.mirco framework , added custom trigger can use delete button. class implements icommand interface the error : "the following error encountered while reading module 'myproject.ui': not resolve type reference: [system, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089]system.windows.input.icommand" the full error log <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/xsl" href="c:\buildagent\work\program files\microsoft fxcop 1.36\xml\fxcopreport.xsl"?> <fxcopreport version="10.0"> <localized> <string key="category">category</string> <string key="certainty">certainty</string> <string key="collapseall">collapse all</string> <string key="checkid">check id</string> <

nhibernate - QueryOver to return full tree hierarchy -

given following entity: public class comment { public int id { get; set; } public ilist<comment> childcomments { get; set; } } i want load full tree, ie comment children plus children , on using queryover given id. unfortunately dont know begin. setting mappings eager load collection isnt option me either. is there way or need use hql in case? thanks. well, think need future queries , distinctrootentityresulttransformer i can show how criteria , recommend same. in our project linq 1 had ugly , magic strings. group object many members , many subgroups. after executing query root (the root element parent null) hold loaded objects in it. case should add restriction commendid also, each fetch have done in separate future query. luck public static groupdto getgrouphierarchy(this isession session) { session .createcriteria<groupdto>() .add(expression.eq("isactive", true)) .setfetchmode(&q

Detect User's Drivers From php website -

how detect user's computer drivers php website ? there way javascript ? by searching on google found sigar api [java] , useful detect drivers ? please clear confusion , please write way detect drivers. this project should have driver detector because driver solutions website, site should detect drivers of user , should warn them outdated drivers what trying impossible without browser plug-in, , in general, wildly out of scope of js , general browsing. each , every browser on market these days has sandbox , abstraction layer. second abstract away os specific stuff, while first there provide isolated environment browser cannot directly access out-of-browser resources. drivers out of scope of browser. in order list them, therefore need escalate access code given. can done using java piece of code (with difficulty), or crafting own plug-in. there no other way, , there never way never necessary know user's driver list.

javascript - How to write this in json format? -

i have code stores data in array. want output on json format. currently, can convert input data json i'm not sure how change code works object. example code on lines : target = (children[p] || (children[p] = [])); and target.push({value:item}); any ideas? for (var = 0, len = arry.length; < len; ++i) { var item = arry[i], p = item.parent, target = []; if(p == rootid) { target = roots; } else { target = (children[p] || (children[p] = [])); } target.push({ value: item }); } you can serialize arbitrary javascript object json string calling json.stringify() . that may or may not want.

java - Writing temp file in tomcat 7.0 fails -

i try write temporary file tomcat 7.0 application. fails: servlet code snippet: file formfile = file.createtempfile("document", ".pdf"); exception java.io.ioexception: no such file or directory @ java.io.unixfilesystem.createfileexclusively(native method) @ java.io.file.createtempfile(file.java:1879) @ java.io.file.createtempfile(file.java:1923) @ goget(servlettest.java:20)} i guess catalina.policy in way. how can enable temp files web applications? tomcat missing temp directory. above issue got fixed on tomcat creating temp directory in tomcat base directory(cataline_home directory).

css3 - Hover CSS menu does not work on iOS -

this code have menu on publishing company's site. reason drop down menu (in publishing tab) works on faq page, not on other page. if me find workaround, great. works great on android phone, i'm not sure problem is. (might need mobile site, i'd work) <div class="publishingmenu"><ul> <li id="pm1" onclick="return true"> <a class="plevel1" href="#">submit manuscript</a> <ul class="submenu" id="submitamanuscript"> <li><a href="submissionguidelines.php">submission guidelines</a></li> <li id="onlinesubmissionform"><a href="onlinesubmissionform.php">online submission form</a></li></ul> </li> <li id="pm2" onclick="return true"> <a class="plevel1" href="#">publishing packages</a

extjs - How would you dim a container/panel like a modal Msg? -

i'm trying implement view requires response server update itself, i'd 'dim' container , show spinner while it's asynchronously loading information server , 'undim' when it's finished. i've seen same effect background of msg/panel , implement same thing spinner in middle. i think want use regular extjs loadmask , let know if need using it.

javascript - FancyBox: one function only taken into account -

jquery(document).ready(function () { jquery(".fancybox").fancybox({ helpers: { title: { type: 'float' } }, beforeshow: function () { this.title = '<div>' + jquery(this.element).next('div').html() + '</div>'; } }); jquery("a.fancybox").fancybox({ tpl: { next: '<a title="avanti" class="fancybox-nav fancybox-next"><span></span></a>', prev: '<a title="indietro" class="fancybox-nav fancybox-prev"><span></span></a>' } }); }); the first part (.fancybox) "ignored", second (a.fancybox) taken account. if remove second, first taken account. -_- you can see code i'm talking here: http://goo.gl/uuv5y unfortunately because it's live site left first part , removed tpl on

python - How to identify login form variables -

i'm trying login website requests module. login form in javascript think. need identify form names contain username , password. tried sort our firebug, hover on username field on website , here code: <div id="ctl00_main_login_dvusertxt" class="dvusr visible"> <input id="ctl00_main_login_usernametext" class="f10 b txmain tx" type="text" ondrop="javascript: return false;" ondrag="javascript: return false;" oncut="javascript: return false;" oncontextmenu="javascript: return false;" onblur="javascript: return false;" onpaste="javascript: return false;" oncopy="javascript: return false;" autocomplete="off" tabindex="1" readonly="readonly" maxlength="20" value="uzytkownik" name="ctl00$main$login$usernametext"> i did same password , tried combination of , none correct. i page sourc

plugins - How can I use the Tab key to indent in vim with SuperTab enabled? -

i've enabled supertab in vim, , if try indent blank line, supertab attempting insert strings. i'd like, guess, have supertab offer completions only if there non-whitespace left of cursor. i don't want have use ctrl-v or ctrl-q or anything. this caused old version of snipmate, update forked version maintained gargas. has quite few dependencies i'd recommend using vundle if you're not using it. see comments op more information.

mysql - Insert and select the id of a unique element in one query -

i have simple table this create table authid( id int not null auto_increment, authid varchar(128) not null unique, primary key(id) ); now if insert value with insert authid(authid) values('test'); it work fine , return inserted id first time, if again when authid exists (notice have authid marked unique) return error. is there way achieve this in 1 sql statement: insert it, id , if exists, still id. take @ this: http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html if you're using mysql 5.0 or higher can use "insert ... on duplicate key update" syntax. may able combine last_insert_id() (i'm not positive that) so: insert authid (authid) values ('test') on duplicate key update id=last_insert_id(id), authid='test'; select last_insert_id();

tfs - Shortcut to Compare to Latest Version in Solution Explorer - Visual Studio 2012 -

Image
in visual studio 2012, in solution explorer ( not pending changes), there way create keyboard shortcut, right click context menu item, or menu bar button tfs compare latest version? alternatively, on general compare dialog, there way change default selection of type: workspace version type: latest version? basically looking easiest way compare latest using fewest clicks, solution explorer. does setting tools/options/keyboard shortcut tfscompare help?

logging - Logstash parsing different action with different logs -

i using logstash parse logs. now want handle logs match particular regex differently , dont differently. is achievable logstash. how go it? my configuration file is: input { stdin { type => "stdin-type" } } filter { grok { type => "stdin-type" patterns_dir=>["./patterns"] pattern => "%{parse_error}" add_tag=>"%{type1},%{type2},%{slave},err_system" } date { replace=>["%{ts}","yyyy/mm/dd-hh:mm:ss.sss"] custom_timestamp=>[%{ts}] } mutate { type=>"stdin-type" replace => ["@message", "%{message}" ] } } output { stdout { debug => true debug_format => "json"} elasticsearch { } } say dont want put logs in elastic search not match regex. possible? how? yes, can conditionals either in filter{} section or output{} section: filter { if [field] == "value" { drop{}

sql server - SQL: Select columns with NULL values only -

how select columns in table contain null values rows? i'm using ms sql server 2005 . i'm trying find out columns not used in table can delete them. here sql 2005 or later version: replace addr_address tablename. declare @col varchar(255), @cmd varchar(max) declare getinfo cursor select c.name sys.tables t join sys.columns c on t.object_id = c.object_id t.name = 'addr_address' open getinfo fetch next getinfo @col while @@fetch_status = 0 begin select @cmd = 'if not exists (select top 1 * addr_address [' + @col + '] not null) begin print ''' + @col + ''' end' exec(@cmd) fetch next getinfo @col end close getinfo deallocate getinfo

How can I inspect the values of tags during the submit of a form using Chrome Dev Tools? -

Image
during page's "dormant" state, can inspect values of tag entering id in chrome dev tools' console tab, so, e.g. tag name "begindate": 0) enter "begindate" in console tab 1) mash key ...and see whole shebang: <input alt="date-us" data-val="true" data-val-regex="end date must in format &amp;quot;m/d/yyyy&amp;quot;" data-val-regex-pattern="[0-9]*[0-9]/[0-9]*[0-9]/[0-9]{4}" data-val-required="end date must in format &amp;quot;m/d/yyyy&amp;quot;" id="enddate" name="enddate" style="width: 164px;" type="text" value="5/14/2013" class="hasdatepicker"> so shows value, part i'm interested in, today's date. what want inspect, though, being passed/posted when form's submit button pressed; believe be, in asp.net, contents of request object, how can see these vals using chrome dev tools? i right-clicked i

javafx - JSoup randomly throws java.io.IOException: stream is closed when running from browser -

i'm having weird jsoup problem when running javafx application browser (or web-start). when run inside ide (eclipse or netbeans) or standalone app, runs normally. when try run web-start or browser (chrome), jsoup randomly throws "java.io.ioexception: stream closed". the site i'm trying parse thepiratebay.sx. when first run application (from browser), error. application running, if try parse again, works... sometimes. the jsoup code: try { //todo: change httpfetcher. method reporting "stream closed" when running on browser connection con = jsoup.connect(url) .timeout(http_timeout) .useragent(useragentgenerator.getuseragent()) .followredirects(false); doc = con.get(); system.out.println("fetching... " + url); } catch (ioexception e) { e.printstacktrace(); system.out.println("parser connect must have timed out, no results. " + url); fetchfailed[i] = true; continu