Posts

Showing posts from June, 2010

NHibernate + AppFabric cache -

NHibernate + AppFabric cache - i utilize appfabric nhibernate 2l cache provider. i have installed appfabric cache service, configured cache cluster , 1 cache apart default one: <datacache size="small"> <caches> <cache consistency="strongconsistency" name="nhibernate"> <policy> <eviction type="lru" /> <expiration defaultttl="10" isexpirable="true" /> </policy> </cache> <cache consistency="strongconsistency" name="default"> <policy> <eviction type="lru" /> <expiration defaultttl="10" isexpirable="true" /> </policy> </cache> </caches> <hosts> <host ...

ios - UITableViewController doesn't work properly in xcode 4.2? -

ios - UITableViewController doesn't work properly in xcode 4.2? - can tell me, doing wrong? have created quick project selecting template 'empty application'. created new controller subclass uitableviewcontroller. i wrote below piece of code phone call controller: -(bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { self.window = [[uiwindow alloc] initwithframe:[[uiscreen mainscreen] bounds]]; // override point customization after application launch. // self.window.backgroundcolor = [uicolor whitecolor]; mytableviewcontroller *mtvc = [[mytableviewcontroller alloc] init]; uinavigationcontroller *nav = [[uinavigationcontroller alloc] init]; [nav pushviewcontroller:mtvc animated:yes]; [self.window addsubview:nav.view]; [self.window makekeyandvisible]; homecoming yes; } and fill uitableviewcontroller's methods check if working: - (nsinteger)table...

java - How to resolve dependency errors in Maven with Nexus repository -

java - How to resolve dependency errors in Maven with Nexus repository - i newbie maven/nexus these simple questions hope: when run mvn install on project next errors: [warning] problems encountered while building effective model com.myproj.testproj:jar:0.0.1 [warning] 'build.plugins.plugin.version' org.apache.maven.plugins:maven-compiler-plugin missing. @ line 294, column 12 [warning] 'build.plugins.plugin.version' org.apache.maven.plugins:maven-surefire-plugin missing. @ line 304, column 12 [warning] [warning] highly recommended prepare these problems because threaten stability of build. [warning] [warning] reason, future maven versions might no longer back upwards building such malformed projects. and sec error [warning] pom oracle:ojdbc:jar:10.0.2.0 missing, no dependency info available for first error think wants me add together version info next plugin <plugin> <artifactid>maven-compiler-plugin</artif...

Where should I place resources.resx in a ASP.NET web application? -

Where should I place resources.resx in a ASP.NET web application? - i'm newbie asp.net web applications. when create asp.net web app project, there's file called resources.resx in folder project. working in computer can access file , content without problem. when deploy application can't access file. i've tried copying file seperately, , folder (my project) seperately, file in it, no luck. there way accomplish this? ps: i've read implicit localization , explicit localization i'd know if can done way. it's embedded dll when build (compile). can't alter when it's deployed. if want see in dll, you'll have utilize tool reflector, dotpeek, etc. you can read more on resources here, starting 'compiling resources assemblies' title (as know how utilize them now). asp.net embedded-resource

Java Inheritance and Understanding Interface Classes -

Java Inheritance and Understanding Interface Classes - hi, working on short java assignment have been set (i learning basics) struggling create sense of question. question follows: design , write classes model different types of publications in library. consider different types of publications, e.g. books , magazines. set attributes , methods mutual types of publications in super-class, , extend super-class appropriately create set of sub-classes. make sure include appropriate constructor, getter, setter , customised methods in classes. utilize method overloading , overriding appropriate. make maximum utilize of inheritance in design , class code. implement next interface class in design , coding: + getpublisher() : string + getpublicationtitle() : string + getprice : float + setpublication(publisherin: string, titlein:string, pricein:float) : void so have answered best can, please read , check on right track , understand meant doing, seems fat simple ...

javascript - Anyway to make body scrollbar appear if absolute position element goes below screen? -

javascript - Anyway to make body scrollbar appear if absolute position element goes below screen? - is there way this? don't want content go below screen without beingness scrollable. (this people may have smaller screens most) nb: levi putna right in pointing out behaviour occurs if <div> empty. two options: you set min-height , min-width <body> . you set height on <body> using javascript when window resized. setting min-height , min-width : for example, if absolutely positioned <div> 400 × 300 pixels: class="lang-css prettyprint-override"> body { min-height: 400px; min-width: 300px; } limitations: internet explorer 6 lacks support this, although there easy hacks prepare that. @ point, min-height works in practically every other browser out there. there no way accomodate dynamically sized <div> , expect overcompensating. dynamically setting height (when window resized): given a...

performance - Searching for hex string in a file in php? -

performance - Searching for hex string in a file in php? - i'm using next 2 methods in class job done: function xseek($h,$pos){ rewind($h); if($pos>0) fread($h,$pos); } function find($str){ homecoming $this->startingindex($this->name,$str); } function startingindex($a,$b){ $lim = 1 + filesize($a) - strlen($b)/2; $h = fopen($a,"rb"); rewind($h); for($i=0;$i<$lim;$i++){ $this->xseek($h,$i); if($b==strtoupper(bin2hex(fread($h,strlen($b)/2)))){ fclose($h); homecoming $i; } } fclose($h); homecoming -1; } i realize quite inefficient, php, i'm not allowed other language on hosting plan. i ran couple tests, , when hex string towards origin of file, runs , returns offset. when hex string isn't found, however, page hangs while. kills me within because lastly time tested php , had hanging pages, webhost shut site downwards 24 hours due much cpu tim...

bash - Linux Shell: VLC programming -

bash - Linux Shell: VLC programming - is there way manipulate vlc linux shell script without script waiting vlc close. cvlc test.mp3 echo "now playing!" sleep 200 cvlc://pause:60 this code keeps running vlc until file completed, , evidently late pause file. you need utilize dbus interface of vlc. now, can utilize mpris interface of vlc. it's standard players clementine, banshee, songbird, spotify etc. so, lets suppose want pause playing song. dbus-send --print-reply --session --dest=org.mpris.vlc /player org.freedesktop.mediaplayer.pause to play song: dbus-send --print-reply --session --dest=org.mpris.vlc /player org.freedesktop.mediaplayer.play i utilize qdbusviewer know dbus-interface available me. linux bash shell vlc

c# - horizontal ScrollBar in MsChart -

c# - horizontal ScrollBar in MsChart - somewhere in net found code private void populatechart() { int elements = 500; random r = new random(); list<double> xvalues = new list<double>(); double currentx = 0; (int = 0; < elements; i++) { xvalues.add(currentx); currentx = currentx + r.next(1, 2000); } list<double> yvalues = new list<double>(); (int = 0; < elements; i++) { yvalues.add(r.next(0, 50)); } // remove previous series chart1.series.clear(); var series = chart1.series.add("myseries"); series.charttype = system.windows.forms.datavisualization.charting.seriescharttype.stock; //series.xvaluetype = system.windows.forms.datavisualization.charting.chartvaluetype.auto; datetime basedate = datetime.today; (int = 0; < xvalues.count; i++) { ...

c++ - Google Mocks test output to XML not working -

c++ - Google Mocks test output to XML not working - i have been using google test few months , have --gtest_output=xml:$(targetdir)\$(solutionname).unittest.results.$ (configuration).xml as command arguments in vs2010 test project. has been working output test results xml. i have been adding in google mocks , have tests working , google mocks working, don't test result in file. how xml file of test results , mock results? i have not been able find info on this. turns out 1 of mock functions not returning valid value , test application exiting before xml file generated. after fixed unit test need setup on mocked function. unit tests finish , xml file generated. c++ googletest googlemock

c# - Regular expression help for URL -

c# - Regular expression help for URL - i have url this: http://www.domain.com/sponsor/xxxxx/reo/news it needs end beingness rewritten to: http://www.domain.com/reo/news?brokerid=xxxxx i'm terrible @ regular expressions. how can extrapolate "xxxxxx" source url , transform string end result? i don't need much help creating end result, that's pretty trivial, if there's nice, clean way regex versus raw string manipulation, that'd nice know about. use "http://([^/]+)/sponsor/([^/]+)/reo/news" regexp. use , "http://$1/reo/news?brokerid=$2" as replacement string. i tried illustration on .net regex tester, , produced desired output. c# regex url-rewriting

android - SharedPreferences.Editor not being updated after initial commit -

android - SharedPreferences.Editor not being updated after initial commit - i'ma bit confused here. i'm trying alter value of edittextpreference, not updated in view. (this in preferenceactivity) here code: @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); addpreferencesfromresource(r.xml.modify_instrument_preferences); // set default values sharedpreferences customsharedpreference = preferencemanager.getdefaultsharedpreferences(this); sharedpreferences.editor editor = customsharedpreference.edit(); modifying = getobjectwithname(); //some object name; editor.putstring("namepref", modifying.getname()); editor.commit(); android.util.log.d("test", "written: "+customsharedpreference.getstring("namepref","")); } my printlns print out valid information, , commit() returns true, on clicking edittextpreference, displays old value. if rotate screen, causin...

flat file - Why won't Strawberry Perl remove these form feed characters? -

flat file - Why won't Strawberry Perl remove these form feed characters? - i'm running strawberry perl on winxp, , i'm trying process unix-formatted flat file. flat file uses line feed characters delimit fields, , form feed characters delimit record. trying convert ff else (crlf, ';', tab, etc). have tried using next perl one-liners no success: perl -p -e 's/\f/\r\n/g' < unix.txt > dos.txt perl -p -e 's/\x0c/\x0d\x0a/g' < unix.txt > dos.txt perl -p -e 's/\f/\t/g' < unix.txt > dos.txt the thing i've noticed the dos.txt ends lf chars converted crlf, ff chars remain. i've tried reprocess dos.txt file, 1 time again trying replace ff, still no dice. still much perl newbie, maybe i'm missing something? know why above commands don't want them do? the problem windows shell doesn't interpret single quotes way unix shell does. should utilize double quotes in commands. c:\ perl -e "prin...

php - Mail Headers Cause Failure -

php - Mail Headers Cause Failure - i making contact form. i've gotten rudimentary version work (gathering form info , sending email site personal email) cannot seem 'additional headers' work. works fine if have next headers: $headers = 'mime-version: 1.0' . "\r\n"; $headers .= 'content-type: text/html; charset=iso-8859-1' . "\r\n"; but if seek , add together additional mail service headers such as: $headers .= 'to: jack <jack johnson>' . "\r\n"; $headers .= 'from: birthday reminder <birthday@example.com>' . "\r\n"; $headers .= 'cc: birthdayarchive@example.com' . "\r\n"; $headers .= 'bcc: birthdaycheck@example.com' . "\r\n"; $headers .= "\r\nx-mailer: php/" ; i 'fail' on mail service function. i'm using php version 5.3.8. create sure mail service function working doing this: $sendmail = mail($email_to, $email...

java - Retriving records from database using hibernate -

java - Retriving records from database using hibernate - i have class trade , subclass operation . mapped in database. when do: trades = session.createquery("from trade").list() i arraylist of trade records , can access operations trade through trade instance. however, when do: trades = session.createquery(" trade trade inner bring together trade.operations operation to_char(operation.datetime, 'yyyymmdd') = to_char(sysdate, 'yyyymmdd') order operation.datetime" ).list(); i array of objects each element contains operation , trade instance. how retrieve records array of trades (same first option) conditions (same sec option)? i tried: select trade trade trade inner bring together trade.operations operation to_char(operation.datetime, 'yyyymmdd') = to_char(sysdate, 'yyyymmdd') order operation.datetime it worked, javatestcase. however, when loop trade.operations, trades contain operations...

oracle - Metadata regarding PL/SQL package-level record types -

oracle - Metadata regarding PL/SQL package-level record types - suppose have pl/sql bundle record type defined: create or replace bundle test_package type person_record_type record ( first_name varchar2(1000), last_name varchar2(1000) ); end; is there way obtain list of fields contained within test_package.person_record_type ? example, there all_* views information? i not interested in schema-level record types, package-level record types. here similar questions retrieving info bundle code. find bundle global variables info dictionary get bundle methods , parameters oracle i see similar problem first one. cannot acces fields via view. there parse source text solution, ugly, or may need workaround this. anyway, think wrong in architecture if need this. oracle reflection plsql

javascript - Code won't work properly in Firefox or IE -

javascript - Code won't work properly in Firefox or IE - here supposed happen: the moment user chooses alternative combination of input fields should show along 2 tables. when user fills in input fields , clicks button, results should appear in tables. those tables aren't showing up. input fields don't show in js fiddle. it works in newest versions of firefox, chrome, safari , ie. not in firefox 6.0 or ie 9.08. i made error of coding exclusively in chrome @ home find code doesn't work when tried go on working @ school. i used jsfiddle.net validate code , did successfully. although still won't work. doesn't show within jsfiddle. here fiddle demo code: http://jsfiddle.net/q2nz5/5/ the outputtable method contains line caption.align = "middle", cannot executed in ie , apparently in ff well. replace caption.style.textalign = "middle"; , prepare problem. the same mcaption. but best can here define styles in c...

multithreading - Delphi: Create and use socket outside main thread -

multithreading - Delphi: Create and use socket outside main thread - code below intended read info via socket within thread. //main method dll function getsocketdata(const ip, port: pchar): pchar; export; cdecl; var thread: tmythread; dataisread: tevent; begin dataisread := tevent.create(nil, true, false, ''); thread:= tmythread.create(dataisread, ip, port); dataisread.waitfor(infinite); result := blockalloc(thread.resultdata); dataisread.free; thread.free; end; tmythreadbase = class(tthread) protected fresultdata: string; public constructor create; property resultdata: string read fresultdata; end; constructor tmythreadbase.create; begin inherited create(false); // suspended fresultdata := ''; freeonterminate := false; end; tmythread = class(tmythreadbase) private fmydata: tmydata; fsocketcom: tsocketcom; //other params protected procedure connect(sender: tobject); procedure execute; override; public constructor cre...

css3 - Change CSS Transition Property Behaviour -

css3 - Change CSS Transition Property Behaviour - ul.nav { list-style: none; display: block; width: 200px; position: relative; top: 10px; left: 300px; padding: 10px 0 10px 10px; background: url(shad2.png) no-repeat; background-position:right; } ul.nav li { -moz-transition: 0.3s ease-out; -o-transition: 0.3s ease-out; -webkit-transition: 0.3s ease-out; background: #005a9c url(border.png) no-repeat; background-position: right; color: #ffffff; padding: 7px 15px 7px 20px; border-top-left-radius: 10px; border-bottom-left-radius: 10px; -webkit-border-top-right-radius: 10px; -webkit-border-bottom-right-radius: 10px; width: 100px; display: block; text-decoration: none; -webkit-box-shadow: 2px 2px 4px #888; box-shadow: 2px 2px 4px #888; } ul.nav li a:hover { background: #ebebeb url(border.png) no-repeat; color: #005a9c; padding: 7px 15px 7px 30px; } the above css transit...

Can the Windows API be utilized using just C? -

Can the Windows API be utilized using just C? - i'm in process of teaching myself c (coming java). appreciate language lot, , 1 of main reasons learning can utilize jni feature built java write native code when necessary. question windows api. can utilize functions , features of api using c? will windows api compatible pure c code or contain classes , such can utilized c++ code? also, if compiled shared library on windows machine (lib.sl not lib.dll), work on machine (mac/linux)? the windows api (aka win32 api) pure c library. no cannot utilize windows shared library on non-windows machine unless there software supports windows abi - such wine or reactos. c windows winapi jni shared-libraries

extjs3 - ExtJS Pop-up Window Form data loading -

extjs3 - ExtJS Pop-up Window Form data loading - i utilize grid panel. when select row in grid next results: if render form in 'document.body' ok, , form fields filled. if i, same form start in window panel, form fields empty. when utilize both, form rendered in 'document.body' closed, , form fields in window filled. where create mistake. // grip panel part sm: new ext.grid.rowselectionmodel({ singleselect: true, listeners: { rowselect: function(sm, index, record) {deletewindow.show();} } }) // end grid panel part var myform = new ext.form.formpanel({ title:"basic form", width:425, frame:true, items: [ new ext.form.textfield({ id:"to", fieldlabel:"to", width:275, allowblank:false, blanktext:"please come in address", ...

xhtml - What are the major differences in HTML 5 than previous versions? -

xhtml - What are the major differences in HTML 5 than previous versions? - i want inquire major things html 5 have previous version not. every reply appreciated. thanks have read html5 specs? html xhtml html5

ruby - How to use Fog (rubygem) to only start/stop the aws ec2 instance, but not terminate? -

ruby - How to use Fog (rubygem) to only start/stop the aws ec2 instance, but not terminate? - i've ec2 instance @ aws ebs store thats why can start/stop server. when start again, info persisted between restarts. but how utilize fog or other ruby gems automate this? not sure asking here shot stop insance via fog conn = fog::compute::aws.new( { :aws_access_key_id=>"your_key", :aws_secret_access_key=>"your_secret"} ) conn.start_instances("i-a3432cbb") conn.stop_instances("i-a3432cbb") ruby ruby-on-rails-3 rubygems fog

trace - Coordinating Times From /sys/kernel/debug/tracing In Ubuntu -

trace - Coordinating Times From /sys/kernel/debug/tracing In Ubuntu - i trying gather info multiple sources on ubuntu 10.10 machine programatically program's performance. of other sources, have been able gather them using rdtsc x86 instruction, , scale them using gettimeofday convert seconds in absolute time. when start trying coordinate these info sources output of doing sched_switch tracing in /sys/kernel/debug/tracing, however, run issue, since output seeing in seconds , microseconds since unknown time. steps have done: 1. i've determined linux kernel internally uses rdtsc, adds offset gathers, don't seem have ability retrieve. on per-core basis well, means have seek 4 cores , determine best one, seems poor solution problem. 2. i've tried converting rdtsc times around turning on logging, see if @ to the lowest degree conversion consistent (i.e. constant offset), scale doesn't seem remain constant throughout run. 3. clock_gettime(clock_monotonic, ...

HTML5 - Anchor separate from base link -

HTML5 - Anchor separate from base link - i've been practising html5 of recent, , come halt. i've added anchor part of code, when seek link it, link goes straight base of operations link. there anyway past this? this snippet of code: <head> <base href="http://en.wikipedia.org/wiki/" target="_blank" /> </head> <body> (...) link anchor: <a href="#link">link!</a> (...) <a name="link">welcome!</a> </body> thanks! try: <span id="link">welcome!</span> the name attribute form elements in html5. html5

In jQuery my :contains selector is ignored -

In jQuery my :contains selector is ignored - i'm trying add together class element provided word 'yes' appears somewhere in descendants. far i've written below code applies class regardless of whether word appears or not. ideas? $(document).ready(function() { if ($(".views-row-1 .field-item:contains('yes')")) { $(".views-row-1 .field-name-field-exp").addclass("solexpandable"); } }); this: $(".views-row-1 .field-item:contains('yes')") is true in boolean context regardless of (if anything) matched. if want see if selector matched anything, check length : if ($(".views-row-1 .field-item:contains('yes')").length) { $(".views-row-1 .field-name-field-exp").addclass("solexpandable"); } jquery contains

java - Pass method's parameters to another method within? -

java - Pass method's parameters to another method within? - i have next code: public boolean oncommand(commandsender sender, command cmd, string commandlabel, string[] args) { // stuff } i want able this: public boolean oncommand(commandsender sender, command cmd, string commandlabel, string[] args) { somemethod(sameparameters); } how do this? can provide example? not wanted how: public boolean oncommand(commandsender sender, command cmd, string commandlabel, string[] args) { somemethod(sender, cmd, commandlabel, args); } java multithreading methods parameters arguments

regex - rewrite url to non www multiple sites -

regex - rewrite url to non www multiple sites - i have sites running same files different templates, goal forcefulness utilize www or non www domains. this code: rewritecond %{https} (on)? rewritecond %{http:host} ^(?!www\.)(.+)$ [nc] rewritecond %{request_uri} (.+) rewritecond %{http:host} ^[^.]+\.[a-z]{2,5}$ [nc] rewriterule .? http(?%1s)://www.%2%3 [r=301,l] get other question on stackoverflow :) but if utilize www domain ok, if not redirect http://domain.de/www/htdocs/user/_production/http%28?s%29://www. why not simplify rules this: options +followsymlinks -multiviews rewriteengine on rewritecond %{https} !=on rewritecond %{http_host} !^www\. [nc] rewriterule ^ http://www.%{http_host}%{request_uri} [r=301,l] rewritecond %{https} =on rewritecond %{http_host} !^www\. [nc] rewriterule ^ https://www.%{http_host}%{request_uri} [r=301,l] regex .htaccess mod-rewrite

c++ - typedef with CRTP doesn't work when inheritance is used -

c++ - typedef with CRTP doesn't work when inheritance is used - is there ways define type same name classes in inheritance relationship using ctrp? tried next code got error: fellow member 'ptr_t' found in multiple base of operations classes of different types clang++ . #include <iostream> #include <tr1/memory> template <typename t> class pointable { public: // define type `ptr_t` in class `t` publicly typedef std::tr1::shared_ptr<t> ptr_t; }; class parent : public pointable<parent> { public: parent() { std::cout << "parent created" << std::endl; } ~parent() { std::cout << "parent deleted" << std::endl; } }; class kid : public parent, public pointable<child> { public: child() { std::cout << "child created" << std::endl; } ~child() { std::cout << "child deleted...

c# - Access properties file within Class Library -

c# - Access properties file within Class Library - i working on c# project have 3 separate projects within vs2010. 2 of projects different types of executable programs , 3rd project c# class library. i have created properties file within class library 2 executable programs needs access save settings within property file. how access properties file within class library other projects. the other projects have class library references , have tried doing mylibrary.properties... doesn't find anything. any help appreciated. thanks have tried add together reference class library? for every project (not library) right click on references -> add together reference -> under projects double click on library (mylibrary.properties). add together library project. see if solves problem. c# properties

java - jboss and sonic mq not playing nice -

java - jboss and sonic mq not playing nice - here's have been beating head against day now. have older version of jboss (jboss4), , within launching code go out , connect implementation of sonic mq (7.6, think) running client. running java 1.6.0_23. beingness said seeing weird behavior cant seem figure out. when process starts load of jndi props need found connection sonic mq server, phone call out this context ic = new initialcontext(jndienv); however see no traffic on wire shark @ point , baffling me. time out giving me exception javax.naming.namingexception. root exception com.sonicsw.mf.comm.connecttimeoutexception: timeout occured while attempting connect the real kick in teeth run process standalone jar (instead of within jboss) on same server , connects fine? hey comes across this... solved issue , thought share ... it turns out tho sonic tech team said code never looks @ jvm variable javax.ssl.keystore ... does... it set javax.ssl.keystore=...

On Linux, Debugging a C++ application with gdb in Eclipse CDT, how to input something to stdin? -

On Linux, Debugging a C++ application with gdb in Eclipse CDT, how to input something to stdin? - on linux, trying debug c++ application gdb in eclipse cdt. for illustration application applic.exe takes command line arguments arg1 , arg2 , expects info on stdin (say, taken file input.txt ). normally, run application in console this: cat input.txt | applic.exe arg1 arg2 using gdb in console can do: gdb applic.exe (gdb) run applic.exe arg1 arg2 < input.txt is possible gdb in eclipse? know how specify arguments (and environment) in eclipse debug configurations, stdin ? there console tab in eclipse (at bottom of ide) can set info here. c++ eclipse gdb stdin cdt

Slider "animation" in WPF? -

Slider "animation" in WPF? - i have button , slider, when press button want slider tick 1 step until reach maximum value. however, don't work. 1 time click button, sleeps while , show slider @ maximum value, without showing each tick. here's xaml code: <stackpanel orientation="horizontal"> <button x:name="animationgobutton" content="go" /> <slider x:name="animationslider" tickfrequency="1" tickplacement="bottomright" issnaptotickenabled="true" width="200" maximum="20" value="0" /> </stackpanel> and here's code behind: private sub animationgobutton_click(sender system.object, e system.windows.routedeventargs) handles animationgobutton.click while (me.animationslider.value < me.animationslider.maximum) me.animationslider.value += 1 system.threading.thread.sleep(100) end while end sub i have...

python - Get least recently rented movies in Django -

python - Get least recently rented movies in Django - so imagine have next 2 tables: create movies ( id int, name varchar(255), ... primary key (id) ); create movierentals ( id int, movie_id int, client varchar(255), daterented datetime, ... primary key (id) foreign key (movie_id) references movies(id) ); with sql directly, i'd approach query as: ( select movie_id, count(movie_id) rent_count movierentals daterented > [time_arg_here] grouping movie_id ) union ( select id movie_id, 0 rent_count film movie_id not in ( select movie_id movierentals daterented > [time_arg_here] grouping movie_id ) ) (get count of film rentals, id, since given date) obviously django version of these tables simple models: class movies(models.model): name = models.charfield(max_length=255, unique=true) class movierentals(models.model): client = models....

jsf - Reference an id in the for-Attribute of p:radioButton -

jsf - Reference an id in the for-Attribute of p:radioButton - is possible reference id, identifies component kid of parents-parent-naming container? for example: <div class="browserdiv" id="browserobjects"> <p:selectoneradio id ="selectedfolder" value="${cc.attrs.value.selectedobjectpath}" layout="custom"> <f:selectitems value="${cc.attrs.value.objectlist}" var="object" itmevalue="${object.path}" itemlabel=""/> </p:selectoneradio> <table> <ui:repeat var="object" value="${cc.attrs.value.objectlist}" id ="repeat" varstatus="status" > <tr> <td class="checkboxcell"> <p:radiobutton id="radiobut...

objective c - Why get a partial data range with subdataWithRange crashes? -

objective c - Why get a partial data range with subdataWithRange crashes? - i have code: nsmutabledata *derivedkey = [nsmutabledata datawithlength:32]; // code missing..fill somehow derivedkey 32 random bytes // line doesn't crash nsdata *iv = [derivedkey subdatawithrange:nsmakerange(0, 32)]; .. // line crashes nsdata *iv = [derivedkey subdatawithrange:nsmakerange(16, 32)]; any suggestion why happens ? seems somehow whole range 0 - 32 passes wanna simple new nsdata variable contains sec half of bytes it crashes, because sec parameter of nsrangemake length of range. trying take 32 bytes starting offset 16, exceeds info size (final byte 48 in order). so simply, alter to: nsdata *iv = [derivedkey subdatawithrange:nsmakerange(16, 16)]; check ref: http://developer.apple.com/library/mac/documentation/cocoa/reference/foundation/miscellaneous/foundation_functions/reference/reference.html#//apple_ref/c/func/nsmakerange objective-c

javascript - document.getElementById() returns null on IE9 -

javascript - document.getElementById() returns null on IE9 - i'm working on popup , i'm having hard time net explorer 9. piece of code gives me trouble: var popup= document.getelementbyid('projectinfo'); popup.style.left=(tempx-310)+'px'; popup.style.top=(tempy-110)+'px'; in ie9 (haven't tested in prior versions), popup null. in adition, i've tried including .js file before body closing tag , wrapping function in "document.ready()" function none of worked. same code though works in opera, chrome , firefox. know what's going on? note: function called in body's onload atribute of html. without using function can't work window.onload = function() { var popup= document.getelementbyid('projectinfo'); popup.style.left=(tempx-310)+'px'; popup.style.top=(tempy-110)+'px'; } javascript internet-explorer getelementbyid

mysql - query "not equal" doesn't work -

mysql - query "not equal" doesn't work - i have simple query this: select * `all_conversations` `deleted_1` != '1'; and deleted_1 default null or user id, reason query returns me 0 rows, tried <> still no luck wrong? edti after running more querys find out problems default value of deleted_1 field, null modified query , works fine: select * `all_conversations` `deleted_1` != 'null' , `deleted_1` != 23 select * all_conversations deleted_1 <> 1 or deleted_1 null null values need special treatment: http://dev.mysql.com/doc/refman/5.1/en/working-with-null.html i'd suggest using diamond operator ( <> ) in favor of != first 1 valid sql , sec 1 mysql addition. mysql sql

c# - MVC 3 WebGrid Paging doesn't return orginal search results -

c# - MVC 3 WebGrid Paging doesn't return orginal search results - i have search page on load fills webgrid. issue paging. on load fill grid "non published" articles (there none in case). search "currently published) , 3 rows. now have 3 pages (i set paging 1 row per page testing purposes). first time searches - gets right answers in grid,a nd lets there 2 pages. if click 2 go sec page - grid fills criteria of load - non published of there none. see not going httppost action on page click - not sure why this. you can see have initial load called admin , post called admin(formcollection values) on both set defaults "not published" public actionresult admin() { var menus = ( p in db.menus.tolist() p.parentid == 0 orderby p.order ascending select p.name ); viewbag.menus = new selectlist(menus, "home"); ...

eclipse - Can't commit my project with git -

eclipse - Can't commit my project with git - i'm using eclipse plugin git in order commit php projects. until goes fine when commit next error: committing failed an internal error occurred entry not found path: //ms_system/.../file.php i notice of files in commit list has invalid path, instead of: dcms_system/.../file.php i get: //ms_system/.../file.php which wrong. how can prepare it? i'm creating reference own future self none of above answers worked me. q on (or google) pertaining this. what did work, think, was: goto git repo view in eclipse -> rt click on repo -> collect garbage then commit ps: might not have done documenting it i on git shell (github shell) @ same time running git status commands (that's ran) on root of repo. , surprisingly found there no staged/unstaged changes, realizing problem solved. pps: if above not work: goto git repo view in eclipse -> rt click o...

c# - Converting an integer to an object and back causes InvalidCastException -

c# - Converting an integer to an object and back causes InvalidCastException - i'm trying store 3 variables in listviewitem's tag object. i'm doing this: lvi.tag = new object[] { value1, value2, value3 }; this not problem, when seek revert code: object[] objs = (lvi.tag object[]); int t = (int)objs[0]; it gives me exception system.invalidcastexception . i've tried debugging it, debugger gives me right info objs = object[] { 1, 93234, 0 } does have thought happening? the next code works fine: class programme { static void main() { listviewitem lvi = new listviewitem(); lvi.tag = new object[] { 1, 93234, 0 }; object[] objs = (lvi.tag object[]); int t = (int)objs[0]; console.writeline(t); } } so guess have doubles (or decimals or floats), not integers, create sure casting right type: double t = (double)objs[0]; c# object .net

android - Downloading images in list view -

android - Downloading images in list view - i downloading images server using lazy loading. images downloaded in cache not appear in list view appear when scroll list view or calling list view sec time public class imageloader { //the simplest in-memory cache implementation. should replaced softreference or bitmapoptions.inpurgeable(since 1.6) public static hashmap<string, bitmap> cache=new hashmap<string, bitmap>(); private imageview imageview; private file cachedir; private context context; public imageloader(context context){ this.context=context; //make background thead low priority. way not impact ui performance photoloaderthread.setpriority(thread.norm_priority-1); //find dir save cached images if (android.os.environment.getexternalstoragestate().equals(android.os.environment.media_mounted)) cachedir=new file(android.os.environment.getexternalstoragedirectory(),"ikzoook...

VBA Excel 2010 Editor capitalizes property name and it cannot be accessed -

VBA Excel 2010 Editor capitalizes property name and it cannot be accessed - as response post, server returns simple json object can indicate success or failure of upload. the json object can either {config_version:n} indicate success or {exception:reason} indicate failure. i process response in next manner: json = objhttp.responsetext set sc = createobject("scriptcontrol") sc.language = "jscript" set o = sc.eval("(" + json + ")") on error goto exception: ' seek utilize config_version property util.setconfigdata "version", o.config_version exit function exception: if o.exception = "config_not_valid" ' 1 kind of exception - accordingly else ' kind of exception end if the problem facing vba excel 2010 editor capitalizing o.exception o.exception ! in watch window see property exception cannot access it. how can forcefulness editor stop capitalizing property name? there other syntax accessi...

Complexity of algorithm -

Complexity of algorithm - what complexity given next problem o(n). shouldn't o(n^2)? because outer loop o(n) , inner o(n), hence n*n = o(n^2)? the reply sheet of question states reply o(n). how possible? public static void q1d(int n) { int count = 0; (int = 0; < n; i++) { count++; (int j = 0; j < n; j++) { count++; } } } the complexity next problem o(n^2), how can obtain that? can please elaborate? public static void q1e(int n) { int count = 0; (int = 0; < n; i++) { count++; (int j = 0; j < n/2; j++) { count++; } } } thanks the first illustration o(n^2) , seems they've made mistake. calculate (informally) sec example, can n * (n/2) = (n^2)/2 = o(n^2) . if doesn't create sense, need go , brush meaning of beingness o(n^k) is. algorithm

C# PDF work with tables -

C# PDF work with tables - i have pdf file table inside. want read document , alter existing row , add together new rows too. there way do this? i'm afraid won't have luck. unfortunately don't 'rows' in pdf - there no concept of table in pdf - text , vector graphics. this means have manually add together vectors , text in right places give illusion of table. c# pdf

string - Logging each error on a new line php -

string - Logging each error on a new line php - i need log each error on new line. file_put_contents('pdoerrors.txt', $e->getmessage() . \n, file_append); this works intended except remains on first line effort utilize \n appears incorrect. alternative way: file_put_contents('pdoerrors.txt', $e->getmessage().php_eol, file_append); php string string-concatenation

What sync primitives can I use with clone(2) (C/C++)? -

What sync primitives can I use with clone(2) (C/C++)? - what c++ synchronization primitives can utilize when using linux's clone(2) threads? cannot utilize pthreads because i'm building shared library replaces many of pthreads's function calls different definitions, i'm in need of mutex of sort. edit: might have spoke soon, looked @ pthread docs , utilize futex(2) implement these primitives. i'm assuming how this, too? you can utilize futex http://en.wikipedia.org/wiki/futex here simple mutex , cond var based on futex http://locklessinc.com/articles/mutex_cv_futex/ c++ c linux multithreading

c# - LINQ not accepting Contains() -

c# - LINQ not accepting Contains() - possible duplicate: 'contains()' workaround using linq entities? using linq in c#, have next problem; i need select rows big table, using 3 conditions: - "schooljaar" needs value, set before, - "p_bamatype" needs value not in list defined in settings (this stringcollection) - "p_stdgeb" needs value not in list defined in settings (this stringcollection) i have code: var set = (db.sa_opleiding.where(opleiding => opleiding.schooljaar == schooljaar && !properties.settings.default.admin_studiegebieden_exclude.cast <string>().tolist().contains( opleiding.p_stdgeb.tostring()) && !properties.settings.default.admin_studiet...

selenium - Email delivery testing with email_spec breaks on Rails 3.0.11 -> 3.1.3 -

selenium - Email delivery testing with email_spec breaks on Rails 3.0.11 -> 3.1.3 - i'm in process of migrating rails 3.0.11 app 3.1.3. , somehow, breaks email_spec testing amount of emails received when using cucumber + selenium setup. config.action_mailer.delivery_method = :test , have tried :cache , :file delivery methods. no matter what, actionmailer::base.deliveries empty, tho according logs, emails sent. , dropping downwards to rails 3.0.11 makes work again. edit: specific versions, here gemfile.lock (note spork not used cucumber features). clues, anyone? try setting: actionmailer::base.delivery_method = :test actionmailer::base.perform_deliveries = true actionmailer::base.deliveries.clear in features/support/env.rb or more it's bug somewhere, here can see people similar problems: https://github.com/bmabey/email-spec/issues?sort=created&direction=desc&state=open&page=1 keep eye out not send real emails reason (bugs, etc.) de...

CSS for a container made from 3 images -

CSS for a container made from 3 images - as titles says, i'm trying create container has top image of no-repeat propery, middle 1 going repeat vertically , bottom 1 going identical top one.so, problem can't eliminate padding between each of them correctly, i've tried if advertisement content in container messes al up.all need guidance of got remove paddings correctly , display content without gaps. i've made simple "demo" more clearly. do this. each box variable in height! <div id"box"> <div class="top_image"><!-- --></div> <div class="mid-image"> <p>hello world!</p> </div> <div class="bottom_image"><!-- --></div> </div> your css: #box div.top-image { background: url(img/top-image.png) 0 0 no-repeat; height: //your height; } #box div.mid-image { background: url(img/mid-image.png) 0 0 repeat-y; } #box div...