Posts

Showing posts from June, 2010

Laravel 4 - how to use the package class as a queue worker -

i have built first laravel 4 package. i have used artisan create structure. i need use package process queue (as worker). i using builtin beanstalk queue , have configured , able add queue. what correct syntax add correct path class use process queue. i can working if class saved here /app/controllers/testclass.php ( beacuse gets autoloaded) example: route::get('/addtoqueue', function() { $message = "this test message"; queue::push('testclass', array('message' => $message)); return 'added queue'; }); but should put in class in queue if class in package? file in workbench: workbench\vendor\package\src\vendor\package my package composer file contains "autoload": { "psr-0": { "qwickli\\tika": "src/" } }, eg. queue::push('vendor\package\testclass', array('message' => $message)); when run php artisan queue:listen correctly picks ...

javascript - Getting Jquery code to stay after form has finished submitting -

my code jquery code adds text table when user makes mistake in form. text dissapears once has finished checking , appears brief split second. here username validator: function validateusername() { var u = document.forms["newuser"]["user"].value var ulength = u.length; var illegalchars = /\w/; // allow letters, numbers, , underscores if (u == null || u == "") { $("#erroruser").text("you left username field emptyyy"); return false; } else if (ulength <4 || ulength > 11) { $("#erroruser").text("the username must between 4 , 11 characters"); return false; } else if (illegalchars.test(u)) { $("#erroruser").text("the username contains illegal charectors men!"); return false; } else { return true; } } to prevent form submission, need prevent default action. give way:...

android - Cursor does not get values from database -

im trying values database using cursor. problem when try values out of db cursor out of bounds. im sure values want exists in db because have other method can values. want value column_fields_parameter log cat: 05-09 11:24:17.872: e/androidruntime(4113): fatal exception: main 05-09 11:24:17.872: e/androidruntime(4113): android.database.cursorindexoutofboundsexception: index 0 requested, size of 0 05-09 11:24:17.872: e/androidruntime(4113): @ android.database.abstractcursor.checkposition(abstractcursor.java:424) here code: putting values: public void putparameters(int[] parameters, string exercise) { string parameterslist = ""; for(int = 0; < parameters.length; i++){ if (parameters[i] != 0) { parameterslist = parameterslist + " " + parameters[i]; } } contentvalues cv = new contentvalues(); cv.put(column_fields_parameter, parameterslist); cv.put(column_exercise, exercise); strin...

nhibernate - fluent nhibarnate doesn't delete orpahns -

i found similar threads got code answer. i using one-to-many relationship. father mapping: hasmany(x => x.targetings).keycolumn("fk_campaign_id").cascade.alldeleteorphan().inverse().asbag(); and child : references(x => x.nhcampaign).column("fk_campaign_id"); where father has list of child. working - inserting , updating. reason when empty list in father or want delete list item, doesn't delete child database. if list empty. this how update: using (isession session = nhibernatehelper.opensession()) { using (itransaction transaction = session.begintransaction()) { session.update(fatherobject); //session.saveorupdate(ocampaign); transaction.commit(); } } am doing wrong here? got using not.lazyload() method.

C# WebBrowser Run Javascript - Return blank page with the result of the Javascript - Why? -

when try run javascript in webbrowser, code runs, after has been executed takes me on white page upper right corner numeric value (in case "1000"), taking me away site previously htmlelement head = webbrowser1.document.getelementsbytagname("head")[0]; htmlelement scriptel = webbrowser1.document.createelement("script"); ihtmlscriptelement element = (ihtmlscriptelement)scriptel.domelement; element.text = "function scrolldown() { document.getelementsbyclassname('scrollableitemclass').scrolltop = 1000 }"; head.appendchild(scriptel); webbrowser1.document.invokescript("scrolldown"); thank help you can scroll html elemet htmlelement.scrollintoview . see example: public partial class form1 : form { public form1() { initializecomponent(); webbrowser1.documentcompleted += new webbrowserdocumentcompletedeventhandler(webbrowser1_documentcompleted); } private ...

java - How to pass an object of a class using an intent? -

how pass object of class using intent ? ex. myclass mc = new myclass(); how can pass mc using intent ? you need use android parcelable what parcel: parcel light weight ipc (inter process communication) data structure, can flatten objects in byte stream. parcelable android specific interface implement serialization yourself. created far more efficient serializable, , around problems default java serialization scheme. how use parcelable : 1.implement interface android.os.parcelable make objects of parcelable class. 2.overwrite 2 methods of android.os.parcelable interface bellow : describecontents()- define kind of object going parcel. writetoparcel(parcel dest, int flags)- actual object serialization/flattening happens here. need individually parcel each element of object. 3.define variable called creator of type parcelable.creator check tutorial : http://prasanta-paul.blogspot.com/2010/06/android-parc...

Java exception when spring loading context configuration file - occurs in UNIX but not Windows -

i've been stuck 1 while now. have created mini subset of project occurs , reproduced issue. i'm running test loads spring context file 1 bean classpathxmlapplicationcontext object. the weird thing is, on windows, test passes fine when run ide (eclipse/intellij) , when run through maven command line. fails when test run unix machine (red hat enterprise linux 5) (and code inevitable end up). in exception below complains lookutils class. can't see why it's trying create class 1 thing noticed has private constructor. also, i'm using spring v2.5.6 , have stick security reason. i'm pretty stuck 1 appreciated. thank you. here exception: ------------------------------------------------------------------------------- test set: startuptest.apptest ------------------------------------------------------------------------------- tests run: 1, failures: 0, errors: 1, skipped: 0, time elapsed: 0.458 sec <<< failure! testguistartup(startuptest.apptest) t...

How to make a video from frames in Android -

i have app uses image processing on video stream. each frame capture camera, send frame code (ndk) , byte array frame processed. i take processed frame stream , create small video (about 20 frames second 5 seconds). i'd save video gallery or file in file system. how possible? many thanks! you can use mediacodec encoder api introduced in android 4.3 recording easily. refer class started http://developer.android.com/reference/android/media/mediacodec.html

javascript - Webpage quickest redirection To Mobile -

i redirect request web page mobile page (based on screen size) we have layers ngnix , squid , spring application. i'm trying in web page (the jsp ), in javascript block. jsp page had redirect huge (i cant fix now). working but, loads complete page , redirect, isnt optimal thing. else can handle ( ngnix/squid )? if i'm forced in js/web page, there anyway can in without loading huge page? thanks mahesh check article out on css-tricks.com chris coyier. in article discusses how mobile redirect visitors based on screen size or targeting specific mobile options. http://css-tricks.com/snippets/javascript/redirect-mobile-devices/

How to include php echo within mysql update? -

so updating mysql database using php. below end of update, , if have string instead of echo $row[embedcode]"); works fine, , echo sets data on page fine retrieving right value, within update doesn't work. ...where `embedcode` = echo $row[embedcode]"); i have tried using ". ." around , adding own php tag around i'm not sure needs done. " ... `embedcode=` '" .$row[embedcode]. "';");

c# - The string was not recognized as a valid DateTime, There is an unknown word starting at index 25 -

i grabbing pubdate node xml file, item.pubdate have date grabbed. newsitem.date datetime column in database table column. but cant seem parse datetime. i "the string not recognized valid datetime, there unknown word starting @ index 25" item.pubdate have value: "thu, 9 may 2013 05:04:18 pdt" when try: newsitem.date = datetime.parse(item.pubdate); i error. how come other xml files pubdates works? and have "thu, 09 may 2013 09:15:11 gmt"? your string contains pdt (timezone info), can't parse in string replace empty string , parse. newsitem.date = datetime.parse(item.pubdate.replace(" pdt","")); if string contains gmt datetime.parse s contains z or gmt time zone designator, , styles includes roundtripkind flag. date , time interpreted utc.

python - FuzzyWuzzy String Matching - Case Sensitivity -

i'm using fuzzywuzzy string matching module seatgeek . i find when using token_set_ratio search algorithm, small differences in case gives wildly differing results. for example, if looking phrase "i eating" in file, 100% match. if phrase "i eating", change in case of 1 letter, gives me 65% match. is there way make algorithm case insensitive? token_set_ratio() case sensitive default. from fuzzywuzzy import fuzz fuzz.token_set_ratio("i eating", "i eating") => 100

How to extract specific characters in R String -

i have file name string: directorylocation<-"\users\me\dropbox\work\" how can extract "\" , replace "\"? in other languages, can loop through string , replace character character, don't think can in r. i tried substr(directorylocation,1,1) but highly optimized case...how can more general? thanks gsub general tool this, others have noted need confusing 4 slashes account escapes: need escape both r text , regexp engine simultaneously. an alternative, if using windows, use normalizepath , setting winslash parameter: normalizepath(directorylocation,winslash="/",mustwork=false) [1] "c:/users/me/dropbox/work/" though may perform additional work on expanding relative paths absolute ones (seen here prepending c: ).

How to create floating figures in reStructuredText / Sphinx? -

i want have figure text wrapped around it. this i'm saying: installation of optional accessories ==================================== .. warning:: never plug in or unplug hand robot or grasp sensor while robot turned on, system not function , damage robot occur. installing hand robot ----------------------- .. _`fig-attach-hand-robot`: .. figure:: attach-hand-robot.* :scale: 40% :align: right attach hand robot make sure robot turned off described in section :ref:`turn-off-robot`. take hand robot out of grounded bin sits on top of electrical panel (if have adjustable height table) or sits on top of rear table (if have fixed height table). make sure not touch pins on electrical wiring while doing so. insert conical protrusion of hand robot conical receptacle (see :ref:`fig-attach-hand-robot`). once hand robot supported inmotion arm robot, make sure 2 knobs below hand robot have engaged , sprung in. if have not, twist them until shown (see :ref:`fig-knobs-in`). ...

php - CURL keeping session with get and post -

i have logged in website post , it's ok. when site method ok (returend "hello, username !" etc) when i'am trying send post site it's redirecting me login page. it's seems curl doesnt send cookie session post method. how fix ? code: public function curlinit() { $this->_ch = null; $this->_ch = curl_init(); curl_setopt($this->_ch, curlopt_useragent, $this->_useragent); curl_setopt($this->_ch, curlopt_returntransfer, 1); curl_setopt($this->_ch, curlopt_connecttimeout, 25); curl_setopt($this->_ch, curlopt_verbose, 1); curl_setopt($this->_ch, curlopt_cookiefile, dirname(__file__) . '/cookies-jar.txt'); curl_setopt($this->_ch, curlopt_cookiejar, dirname(__file__) . '/cookies-jar.txt'); curl_setopt($this->_ch, curlopt_followlocation, 1); curl_setopt($this->_ch, curlopt_cookiesession, 1); curl_setopt($this->_ch, curlopt_httpheader, 1); curl_setopt($this->_ch, cu...

svd - How do I generate data from a similarity matrix? -

suppose there 14 objects, each of have or not have 1000 binary features. have 14x14 similarity matrix, not raw 14x1000 data. there way reconstruct or generate similar raw data, given similarity matrix? i tried monte carlo simulations, unconstrained take way time achieve low level of consistency original similarity matrix. i saw relevant question: similarity matrix -> feature vectors algorithm? . however, wanted reduce not increase dimensionality. also, not sure (1) matrix or matrices use, , (2) how convert binary matrix. it's impossible sure unless describe how similarity scores computed. in general, usual kind of similarity scoring not possible: information has been lost in transformation individual features aggregate statistics. best can hope arrive @ set of features consistent similarity scores. i think talking when "similar to" original. problem pretty interesting. suppose similarity computed dot-product of 2 feature vectors (ie count of...

Continuous rotation in Processing -

Image
i wrote program in procesisng renders opaque cubes random colour , rotation on top of each other, i'm looking individually continuously spin each cube while program running. here's code @ moment, int boxval = 1; void setup(){ size (640, 320, p3d); framerate(60); } void draw(){ (int = 0; < boxval; i++){ translate(random(0,640), random(0,320), 0); rotatey(random(0,360)); rotatex(random(0,360)); rotatez(random(0,360)); fill(random(0,255),random(0,255),random(0,255),50); nostroke(); box(64,64,64); } } here's screenshot if helps @ all, this great time use object oriented programming! if understand question correctly, each cube rotate independently of other cubes. let's make cube class. think of each cube object handle individually. class cube { float x, y, z; // position of cube float size; // size of cube color c; // color of cube float xangle, yangle, zangle; // current rotation amount of cube's x, y, z axes float xspeed, yspeed, ...

c# - Setting a static datetime in WPF/xaml -

i'm trying blackout dates in datetime picker control starting day after today till datetime max value. the below code: <calendar.blackoutdates> <calendardaterange start="{x:static system:datetime.today}" end="{x:static system:datetime.maxvalue}" /> </calendar.blackoutdates> as see, above code blackout dates starting today, want start date tomorrow. question is, how can set this: start="{x:static system:datetime.today.adddays(1)}" could please help? you can create own static property this. public static class datetimehelper { public static datetime tomorrow { { return datetime.today.adddays(1); } } } . <calendardaterange start="{x:static app:datetimehelper.tomorrow}"…

resources - How to access the RESTful services from external server in my server in angularjs -

i running on domain server1. i have restful services on server2. i want access restful service on webpage using angularjs. tried way. it's returning empty array. no data bind. why? suggestions. here sample code. in sample code, resource definition looks this: var utilservice = $resource('server2/users/:userid', { }, { 'get' : { method: 'get',headers: {'content-type':'application/json'}, params: { userid:'anil' } , isarray : true } } ) that url appears relative. if you're trying target remote server, you're going need resolvable uri. unless that's mangled in anonymizing of example, think that's issue.

events - How to implement an eventable type in Dart -

is there built in functionality make eventable types in dart? in javascript applications use class called eventable provide following functionality: var dog = new dog() //where dog inherits eventable var cat = new cat() //where cat inherits eventable //use 'on' listen events cat.on(dog, 'bark', cat.runaway); //assuming cat has method runaway on prototype //use fire launch events dog.fire({type: 'bark'}); //this causes cat.runaway(event); called a common pattern in javascript, because helps me keep objects isolated in src , in mind. using on method creates new eventcontract has unique key based on owner ( cat above), client ( dog above), type ( 'bark' above) , function ( cat.runaway above). unique key allows me ensure no duplicated eventcontract s created, more importantly allows me keep easy lookup collection of of eventcontract s object has, such can call: cat.dispose(); and of event contracts cat destroyed, confident of exter...

iphone - how to disable UIMenuControll (cut,copy,paste,select all,delete) in UIviewController subclass? -

i have implemented many methods paste doesn't hide. using xcode version 4.5.2 -(bool)canperformaction:(sel)action withsender:(id)sender { uimenucontroller *menucontroller = [uimenucontroller sharedmenucontroller]; if (menucontroller) { [uimenucontroller sharedmenucontroller].menuvisible = no; } return no; } every method seems fail working me. can me on this? in advance you need these things enable/disable uimenucontroller items. to show/hide uimenucontroller items, view or view controller needs implement canbecomefirstresponder (returning yes/no show/hide). you can implement canperformaction:withsender: method of uiresponder disable or enable user-interface commands {copy, select, select all, paste , etc} based on context. or can override update method of uimenucontroller handle custom behavior of individual item. example, if pasteboard holds no data of compatible type, paste command disabled. may either force show/hide paste men...

javascript - jQuery: clicking on a table located in an iframe -

i have ordinary table in html in iframe , access parent page (yes on domain , server) i've tried every kind of: $("#iframe").contents().find("#mytable td"); i don't have impression detects table cell or table @ all. indeed event on it. $("#mytable td") .mousedown(function () { ismousedown = true; $(this).toggleclass("highlighted"); ishighlighted = $(this).hasclass("highlighted"); return false; }) .mouseover(function () { if (ismousedown) { $(this).toggleclass("highlighted", ishighlighted); } }) this event works on single page css style linked how should when using iframe? what's correct sentence detect table in iframe? thanks in advance. make sure selector, #iframe, on iframe element id. then setup in javascript... var mframe = $('#iframe').conte...

continue - Euler #4 in Python -

a palindromic number reads same both ways. largest palindrome made product of 2 2-digit numbers 9009 = 91 × 99. find largest palindrome made product of 2 3-digit numbers. http://projecteuler.net/problem=4 below solution problem. works, noticed solution used if x*y < max_seen: continue like this: def biggest(): big_x, big_y, max_seen = 0, 0, 0 x in xrange(999,99,-1): y in xrange(x, 99,-1): if x*y < max_seen: continue if is_palindrome(x*y): big_x, big_y, max_seen = x,y, x*y what don't how line works. first time through max_seen = 0 , first x*y 999*999 greater 0. condition isn't met , next line run. makes sense. eventually, however, max_seen larger x*y why continue here? it seems line isn't needed because if condition or isn't met program continue anyway. suspect i'm not understanding how continue works in python. this approach: def find_biggest(): big_x, big_y, ...

c# - 'Sequence contains more than one element' (InvalidOperationException) thrown by external System.Core call when using Linq2Sql -

Image
firstly let me explain understand why invalidoperationexception has been thrown , looking way avoid being thrown. there call system.linq.enumerable.singleordefault() can see in visual studio 2010 call stack window. however, call in external linq2sql code, have no access change it. (sorry, may need zoom in see image properly) the last internal code call before execution goes external found in application dbml.designer.cs file have access to, still cannot edit because updates automatically , loses custom changes. in ( linq2sql ) property setter 1 of database tables used in application , appears problem caused call _dbaudiotrackcontributors.entity object: public dbaudiotrackcontributor dbaudiotrackcontributors { { return this._dbaudiotrackcontributors.entity; } set { // last internal line before exception dbaudiotrackcontributor previousvalue = this._dbaudiotrackcontributors.entity; // execution never reaches here ...

python - Why is list.remove only removing every second item? -

in python 2.7.2 idle interpreter: >>> mylist = [1, 2, 3, 4, 5] >>> item in mylist: mylist.remove(item) >>> mylist [2, 4] why? it's because when iterate on list, python keeps track of index in list . consider following code instead: for in range(len(mylist)): if >= len(mylist): break item = mylist[i] mylist.remove(item) if track (which python doing in code), see when remove item in list, number right shifts 1 position left fill void left when removed item. right item @ index i , never seen in iteration because next thing happens increment i next iteration of loop. now little clever. if instead iterate on list backward, we'll clear out list: for item in reversed(mylist): mylist.remove(item) the reason here we're taking item off end of list @ each iteration of loop. since we're taking items off end, nothing needs shift (assuming uniqueness in list -- if list isn't unique, ...

mysql - No data from the database after the files downloaded -

i want display data on particular condition of table after user enters data want display. failed display data. confused fault lies. looks variable $thn = $ _post['thn'], $bln = $ _post['bln'], $periode = $ _post['periode'] empty. please help. i have 4 files. here codes: 1.absen_xls.php: <?php include '../../inc/inc.koneksi.php'; ini_set('display_errors', 1); ini_set('error_reporting', e_error); include '../../excel/phpexcel.php'; include '../../excel/phpexcel/iofactory.php'; $table = 'absen_karyawan'; $bln = $_post['bln']; //this not work, don't know why? $thn = $_post['thn']; //this not work, don't know why? $periode = $_post['periode']; //this not work, don't know why? $where = "where tahun = '$thn' , bulan = '$bln' , periode = '$periode'"; // create new phpexcel object $objphpexcel = new phpexcel(); $sql ...

python - Need the path for particular files using os.walk() -

i'm trying perform geoprocessing. task locate shapefiles within directory, , find full path name shapefile within directory. can name of shapefile, don't know how full path name shapefile. shpfiles = [] path, subdirs, files in os.walk(path): x in files: if x.endswith(".shp") == true: shpfiles.append[x] os.walk gives path directory first value in loop, use os.path.join() create full filename: shpfiles = [] dirpath, subdirs, files in os.walk(path): x in files: if x.endswith(".shp"): shpfiles.append(os.path.join(dirpath, x)) i renamed path in loop dirpath not conflict path variable passing os.walk() . note not need test if result of .endswith() == true ; if you, == true part entirely redundant. you can use .extend() , generator expression make above code little more compact: shpfiles = [] dirpath, subdirs, files in os.walk(path): shpfile.extend(os.path.join(dirpath, x) x in f...

ant - IntelliJ does not show javac output -

when running build , terminal, javac output formatted so: [javac] compiling 99 source files /users/user/devdir [javac] note: java note . . however, when run ant build script through intellij, output is: javac i've tried using both ant version packaged intellij , 1 used terminal (pointed binary in /usr dir) , same result. project builds fine , else works expected, i'm not getting debug information want see in messages pane. ideas on why happen?

Javascript string assignment to key-value string -

i have following code: var inputstring ={"key1":"planes","key2":"trains","key3":"cars","key4":"caoch","key5":"cycles","key6":"bikes"} var value = inputstring ["key3"]; alert(value); the above code works fine, notice variable inputstring assigned between curly braces. i'm js novice think convention indicate sort of object. kind of string assignment looks strange me, works demonstrated above. my issue when try assign variable inputstring string literal, follows: var inputstring2 ='{"key1":"planes","key2":"trains","key3":"cars","key4":"caoch","key5":"cycles","key6":"bikes"}' var value = inputstring2 ["key3"]; alert(value); the above code returns undefined , why? i'm sure deep understanding of javasc...

c - Broken CMake and gcc under OSX -

when running configure in cmake-gui on osx platform, following error occuring: the c compiler identification gnu cxx compiler identification gnu checking whether c compiler has -isysroot checking whether c compiler has -isysroot - yes checking whether c compiler supports osx deployment target flag checking whether c compiler supports osx deployment target flag - yes check working c compiler: /usr/bin/gcc-4.0 check working c compiler: /usr/bin/gcc-4.0 -- broken cmake error @ /applications/cmake 2.8-2.app/contents/share/cmake-2.8/modules/cmaketestccompiler.cmake:52 (message): c compiler "/usr/bin/gcc-4.0" not able compile simple test program. fails following output: change dir: /users/bill/desktop/cmake_test/build/cmakefiles/cmaketmp run build command:/opt/local/bin/gmake "cmtrycompileexec/fast" /opt/local/bin/gmake -f cmakefiles/cmtrycompileexec.dir/build.make cmakefiles/cmtrycompileexec.dir/build gmake[1]: entering directory `/user...

oracle - sqlplus print running statement -

is there way sqlplus can print statement executed. mean have .sql files run in bash script. need know when read log file statement sqlplus ran. example: have test.sql file: set timing on create table foo (a varchar2(10)); create table bar (b varchar2(10)); exit when check log this: table created. elapsed: 00:00:00.02 table created. elapsed: 00:00:00.01 which not informative. there way can output this: table foo created. elapsed: 00:00:00.02 table bar created. elapsed: 00:00:00.01 or this: create table foo (a varchar2(10)); table created. elapsed: 00:00:00.02 create table bar (b varchar2(10)); table created. elapsed: 00:00:00.01 i know can use prompt before each statement have big sql scripts , tedious write prompt before each statement. edit: for allan's solution work (i.e. using " set echo on "), should avoid following: 1) don't use -s option sqlplus because suppress display of echoing of commands. 2) don't "cat"...

java - What role does optionType play in a JOptionPane OptionsDialog? -

Image
note: please pay attention fact options dialog here, not confirm dialog. makes difference in i'm asking , how swing behaves! i looked @ code example of option dialog in action , confused 1 thing: if supplying dialog options in options parameter, of use/role/significance optiontype parameter? according javadocs you're options are: default_option yes_no_option yes_no_cancel_option ; or ok_cancel_option how these different options affect resultant dialog, or swing ignore them?!? in advance! the optiontype parameter defines amongst options user have choose. if use yes_no_cancel_option , display 3 buttons, 1 each option: yes no cancel the same goes possible optiontype values.

java - bad operand types for binary operator '+' -

this question has answer here: java: generic methods , numbers 4 answers i working on creating generic class manipulate matrices. here problem: when implement addition operation, "bad operand types binary operator '+'" it says that: first type: object second type: t t type-variable: t extends object declared in class matrix is there way make addition? here code: public class matrix<t> { private t tab[][]; public matrix( t tab[][]) { this.tab = (t[][])new object[tab.length][tab[0].length]; for(int = 0; < tab.length; i++){ system.arraycopy(tab[i], 0, this.tab[i], 0, tab.length); } } public matrix(int row, int column) { this.tab = (t[][])new object[row][column]; } //other constructors... public matrix addition(matrix othermatrix) { ma...

javascript - CKEditor and elFinder in modal dialog -

i need integrate elfinder ckeditor. followed this: https://github.com/studio-42/elfinder/wiki/integration-with-ckeditor it working opening pop-up window image selection not nice want open elfinder in modal dialog. for "modal integration" followed thread: http://bxuulgygd9.tal.ki/20110728/integration-with-ckeditor-759177/ the last post there partially works. opens elfinder in modal. but: when want insert image url url field in ckfinder have know exact id. not fill image resolution , brings other problems. best solution run function called in "ordinary popup" integration, handles everything: window.opener.ckeditor.tools.callfunction(funcnum, file); but in "popup integration", funcnum callback registered, in modal integration it not i'm unable call it. have tip run elfinder (or other image manager - same) in modal window? i'm desperate. i have solved myself. code combination of several tutorials , allows integrate elfinder i...

android - How to know in which TableRow a CheckBox is placed -

i have tablelayout tablerows , checkbox , textview inside. when push checkbox need know in wich tablerow checkbox placed textview "associated" checkbox. example: tablelayout: tablerow 1: x textview1 tablerow 2: x textview2 ... i'm trying this: cb.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { if (cb.ischecked()) { int id_cb = cb.getid(); boolean encontrado = false; (int = 0; < tabla_tareas.getchildcount() && !encontrado; i++) { tablerow aux_tr = (tablerow) tabla_tareas.getchildat(i); checkbox aux_cb = (checkbox) aux_tr.getchildat(0); if (id_cb == aux_cb.getid()) encontrado = true; }... but doesn't work. utilizing elior has said, why don't use folling methods achieve want: cb.setonclicklistener(new view.onclicklistener() { ...

c# Entity Framework does not execute sql -

i have next code: guid[] sessions; while ((sessions = getsessions()).any()) { sessions.asparallel().forall(processsession); } ... private guid[] getsessions() { using (var tmpcontext = new mydbcontext()) { return (from pendingsession in tmpcontext.pendingsessions !tmpcontext.pendingfiles.any(pf => pf.pendingsession.sessionid == pendingsession.sessionid) select pendingsession.sessionid).toarray() } } i have traced code running sqlserver profiler , recognized entityframework doesn't execute on sqlserver side query getsessions method on each call of method... mean sql executed , getsessions method running without execution of sql query on sqlserver side. cause problems in processsession method. what can reason entityframwork decide not execute query, , way make run each time? thanks, aleksey

FireBug (or any other method) - How to copy all CSS styling from DIV and child divs? -

i trying copy css styling div (and child/inner divs). user firebug , hoping there simple way don't have go through thousands of lines of css stylesheet pick out handful need. does know how firebug? or other developer tool? (i.e chrome, etc.) as per: https://stackoverflow.com/a/8013320/900747 can use ie9 or ie8: open page want grab style in ie9 press f12 display developer toolbar in developer toolbar press find , select "select element click" then go "view" > "source" , select "element source style" this should give parent styles ensure layout same.

sql - Joining between several tables -

my question sql queries using following tables: 1. consultant(id,name,skill) 2. customercompany(id,name address, phone, email, webaddr,market) 3. project(id,startdate,enddate,consultantid,customerid,days) 4. invoice(id,date,customer,amount,status) sql statement find names of consultants worked customers in berlin , london i think have join tables cant definite query, suggestions? something like select c.name consultant c --join on projects consultant worked on join project p on p.consultantid = c.consultantid --join on customer companies projects join customercompany cc on cc.id = p.customerid --addresses might have various formats, use operator cc.address '%london%' or cc.address '%berlin%' might trick.

java - How to internationalize f:selectItems that holds data from database? -

i have h:selectonemenu coded this <h:selectonemenu value="{mybean.selecteditem}" > <f:selectitems value="#{mybean.datafromdb}" /> </h:selectonemenu> when user changes language via dropdownmenu let english chinese have property file holds chinese character. but, not know how implement them <f:selectitems value="#{mybean.datafromdb}" /> notice change of language , act accordingly if use <f:selectitme value="#{mypropertiefile.value1}" /> <f:selectitme value="#{mypropertiefile.value2}" /> <f:selectitme value="#{mypropertiefile.value3}" /> from property file work, defeat idea of doing things property file , database only. how can can resolve problem?

mysql - Sql join or separate queries -

i have movie database. keep images, videos, reviews, etc in separate tables. when movie viewed can use table joins , display output. possible separately. is, first query gets movie details, second gets pictures of movie, gets video of movie. so should use? table joins first joins tables , applies condition. having more overhead? when use joins, mysql use temporary tables. general rule, if can avoid these, it. ought bunch of different queries , join them in memory.

asp.net - Why is my application going back to the login page after successful authentication? -

i'm working on asp.net web application uses forms-based authentication. i'm authenticating against active directory domain. i'm getting successful authentication, getting information need ad, , using response.redirect() redirect user application's default.aspx page, instead returning login.aspx. can't figure out what's going wrong. here's login code (gets run when user enters domain, username, , password , clicks "login"): protected void btnlogin_click(object sender, eventargs e) { string adpath = "ldap://my.ad.path:636"; formsauth.ldapauthentication adauth = new formsauth.ldapauthentication(adpath); bool isauthenticated = false; //"loggedinuser" class hold information user loggedinuser = adauth.loginandgetrequestorlogininfo(out isauthenticated, tbxdomain.text, tbxusername.text, tbxpassword.text); if (isauthenticated) { //create ticket formsauthenticationticket authticket = ...

sql - Can't complete complicated query -

i have question sql in c# want implement i'm bit stuck. below tables example data: student : (pk)tagid studentid (fk)courseid 4855755 huj564334 25 4534664 red231232 33 course (pk)courseid coursename 25 computer science 33 biology coursemodule (fk)courseid (fk)moduleid 25 cmp2343 25 cmp3456 33 bio3422 33 bio2217 module (pk)moduleid modulename cmp2343 networking cmp3456 databases bio3422 human body bio2217 genetics modulesession (fk)moduleid (fk)sessionid cmp2343 1acmp2343 cmp2343 2acmp2343 cmp3456 1acmp3456 cmp3456 2acmp3456 bio3422 1abio3422 bio3422 2abio3422 bio2217 1abio2217 bio2217 2abio2217 session (pk)sessionid sessionstartdate sessiontimestart sessiontimeend 1acmp2343 09/05/2013 12:00 14:00 pm 2acmp2343 05/05/2013 09:00 11:00 pm 1acmp3456 15/...