Posts

Showing posts from April, 2010

swing - Java - Maven - Setting Icon Images in a Form -

i've maven project there jframe , want set frame's icon image buttons' icon images. my icon images lives package com.foo.bar.frame.images . have set correctly buttons' icon images when run maven project hesitate this: severe: null java.lang.nullpointerexception @ javax.swing.imageicon.<init>(imageicon.java:167) @ com.intel.jiratool.jiraexcelclient.view.excelview.initcomponents(excelview.java:119) @ com.intel.jiratool.jiraexcelclient.view.excelview.<init>(excelview.java:40) @ com.intel.jiratool.jiraexcelclient.main.main(main.java:54) line 167: btnclose.seticon(newjavax.swing.imageicon(getclass().getresource("/com/intel/jiratool/jiraexcelclient/view/images/32px-crystal_clear_action_exit.png"))); // noi18n moreover, when go target folder resides jar file, if inspect it, there aren't images. how can working situation? maybe including in maven's pom file? best regards, santiago.-

inheritance - What is a correct way of using an implementation with an interface class in C++? -

i have class child , class human human has functions declared in child virtual functions. , class child inherits human class. i want use human interface file hide implementation in child . i didn't set constructor, set init() function initializes basic settings. now, way can use child functions using human interface file? i tried human *john = new child(); but got following errors. main.cpp:7: error: expected type-specifier before ‘child’ main.cpp:7: error: cannot convert ‘int*’ ‘human*’ in initialization main.cpp:7: error: expected ‘,’ or ‘;’ before ‘child i don't understand int* came either. none of functions declared returns int*. edit main.cpp #include <stdlib.h> #include <stdio.h> #include "human.h" using namespace std; int main(){ human *john = new child(); return 0; } human.h #ifndef __human_h__ #define __human_h__ class human { public: virtual void init() = 0; virtual void cleanup() = 0;

php - In XSLT, can you use XPath on dynamically created elements? -

would expect work or not? (it seems can't use xpath on dynamically created elements, perhaps because they're not in 'behind scenes' magic used make xpath perform well) <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:template match="/"> <xsl:variable name="data"> <fu><bar>test</bar></fu> </xsl:variable> value: <xsl:value-of select="$data/fu/bar" /> </xsl:template> </xsl:stylesheet> i error in xslt processors i've tried, e.g. "invalid type" when using php5; removing "$" before "data" make error go away, not desired, try match data/fu/bar xml document xslt being ran against. there aren't easy answers this, "the way" the node-set() function. it's not technically p

c# - Reading a 2 dimensional array or sharePoint list from InfoPath -

i new @ c# , infopath. using sharepoint 2007 , infopath 2007. have infopath form want read values list want read value based on column name and row # in c# code 2 dimensional array or list<>. possible read sharepoint list without writing c# code (workflow) access values in list? 7/25/11: couldn't comment or reply editing original post instead: @andreas thank idea. your suggestion not want although doing tutorials msdn recommended. of review me learning new tricks (i.e. certificate signing). anyway, have list in sharepoint per diem rate chart travelers. trying figure out way pick correct rate, based on days of travel , destination zip code. sharepoint list column name rate values $46, $51, $76 , rows breakfast, lunch, dinner incidentals, "first or last day of travel". if rate = $46 , days of travel > 0 , < 3, (i.e. 2 days total) "first , last day of travel" per diem applies. my dilema how read value (rate) "first , last day o

c# - how do i write an extension method on ConcurrentDictionary -

i have concurrentdictionary object defined concurrentdictionary<int, dirtyflag><int, dirtyflag> dirty flag enum has dirty/clean values. i trying write extension method dirty objects. objects has dirtyflag set dirty. i tried using gives me error: public static concurrentdictionary<int, dirtyflag> getdirtyroutes(this concurrentdictionary<int, dirtyflag> wholedictionary) { return wholedictionary.selectmany(a => a.value == dirtyflag.dirty); } this error message getting: the type arguments method 'system.linq.enumerable.selectmany<tsource,tresult> (system.collections.generic.ienumerable<tsource>, system.func<tsource,system.collections.generic.ienumerable<tresult>>)' cannot inferred usage. try specifying type arguments explicitly. any help? public static concurrentdictionary<int, dirtyflag> getdirtyroutes(this concurrentdictionary<int, dirtyflag> wholedictionary) { return new concurre

objective c - Two switches in a window on iPhone -

i've started learning how develop iphone app. i'm trying make app 2 switches. made 2 classes (switch1 & switch2). first, tested app 1 switch (switch1), , app worked. when made second class (switch2) , build/run app, first switch (switch1) disappeared, , saw second switch (switch2). after made background of (switch1 & switch2) celarcolor, see both of switches. however, first switch (switch1) can't switched. so think problem how make both switches (switch1 & switch2) visible , working @ same time in "window" the question (could stupid): can make them visible , working @ same time? think problem in following code: appdelegate uiscreen *s1 = [uiscreen mainscreen]; view1 = [[switch1 alloc] initwithframe: s1.applicationframe]; window = [[uiwindow alloc] initwithframe: s1.bounds]; [window addsubview: view1]; [window makekeyandvisible]; uiscreen *s2 = [uiscreen mainscreen]; view2 = [[switch2 alloc] initwithframe: s2.applicationframe]; window

curl - PHP curl_exec() hangs -

i use function make curl requests: function curl_request($options) //single custom curl request. { $ch = curl_init(); $options[curlopt_followlocation] = true; $options[curlopt_cookiejar] = 'cookies.txt'; $options[curlopt_cookiefile] = 'cookies.txt'; $options[curlinfo_header_out] = true; $options[curlopt_verbose] = true; $options[curlopt_returntransfer] = true; $options[curlopt_connecttimeout] = 5; $options[curlopt_timeout] = 5; curl_setopt_array($ch, $options); $response = curl_exec($ch); curl_close($ch); return $response; } the script hangs sometimes, not always, on $response = curl_exec($ch) line. occurs when php script set infinite timeout (on client side, firebug takes "aborted"). there nothing in error log.. doesn't past line when hangs. what going on? suggestions? the issue seems have been resources of server. when switched better web host higher bandwidth limit things

mod rewrite - .htaccess - add language sub directory by default "sv/" (redirect) -

trying orientate myself through .htaccess jungle, i've narrated down rewrite problems 1 - adding language suffix upon entering page / typing in address doesn't have such one. for example: visitor types mysite.com/kontakt . should take them default language of site, i.e. mysite.com/sv/kontakt . or, typing in mysite.com should take him/her mysite.com/sv/ . i'm developing site locally using mamp, , site located in subdirectory, , here's tricky part... how sort out in .htaccess file? current code used: rewritebase /mysite/ rewritecond %{request_uri} !^(sv|en) rewriterule ^(.*)$ sv/$1 [l,r=301] and takes me localhost/mysite/ localhost/sv/ . not right. try one: options +followsymlinks -multiviews rewriteengine on rewritebase /mysite/ rewriterule ^(?!(?:sv|en)/)(.*)$ sv/$1 [r=301,l] this needs placed .htaccess file /mysite/ folder. if accessing localhost/mysite/sv without trailing slash, rule redirect localhost/mysite/sv/sv expects langua

css - Overriding user agent stylesheet -

for reason website won't use styles! i have in stylesheet: #nav { margin: 15px 0 15px 0; padding: 0; width: 965px; background: #ffffff; border-bottom: 0px #f2e9e1 solid; height: 2.1em; } #nav ul { display: block; margin: 0; padding: 0 0 0 10px; line-height: 17px; list-style: none; z-index: 90 } #nav ul li { float: left; margin: 0 1px 0 0; padding: 0; font-size: 14px; letter-spacing: 1.0px; line-height: 17px; list-style-type: none; white-space: nowrap; } #nav ul li { float: left; display: block; width: auto; font-weight: normal; background: transparent; text-decoration: none; color: #1c140d; margin: 0; } part of html: <div id="nav"> <ul class="level1"> <li><a href="http://comparative-legumes.org/development_activities">development</a></li> <li class="sep">|</li> <li> <a hre

objective c - Is it possible to use FlurryAPI within a static library? -

i'm working on static library distribute ios developers, , i'd incorporate analytics library flurry know more how users interacting it. concern if app developers using flurry in apps , library initializes new session, clobber existing session. my first idea subclass flurryapi , it's hard whether or not without knowing implementation details. does have experience or ideas? in advance. received response flurry support saying it's against tos include flurry in static library use in other apps. looking modifying , using localytics sdk instead.

.net - Start a process from a bound wpf hyperlink -

what's simple way have wpf hyperlink run process.start on (data-bound) text content? one way (that improved refactoring usercontrol or static class or valueconverter or ...) have hyperlink bound command on viewmodel , pass in content of hyperlink (i couldn't find way relative binding) command parameter. wpf snippet <textblock> <textblock.datacontext> <viewmodels:viewmodel /> </textblock.datacontext> <hyperlink command="{binding launchhyperlinkcommand}" commandparameter="{binding elementname=_content, path=text}"> <run text="{binding filepath, mode=oneway}" name="_content"/> </hyperlink> </textblock> c# datacontext class snippet (note: using prism ) public class viewmodel : notificationobject { public string filepath { get; private set; } public delegatecommand<string> launchhyperlinkcommand { get; set; } public viewmodel()

php - getting value from textbox -

i have following code: <input type="hidden" name="qz_id" value="<?=$quizid; ?>" /> <input type="hidden" name="s_id" value="<?=$s_id; ?>" /> <? if($num!=$i) {?><input type="submit" value="next" /><? } ?> <? if($num==$i) {?><input type="submit" name="submit" value="finish" /><? } ?> this part of whole page of code. trying insert these values in database. can tell me how can value of textbox "answer" , store in php variable? want insert value database once user press next or finish? here form: <form id="formresp" method="post" action="respond.php?quiz_id=<?=$quizid ?>" name="register" onsubmit='return validateform(this)'> also triend $_post['answer'] not working you can use $_request['answer'];. sor

iis 7 - Setting up IIS 7 webserver - have static ip and port forwarding, what could be wrong? -

i trying set simple website on iis 7 server on home machine. going have light traffic , little while don't want go commercial hosting route. having trouble accessing site outside of local network. far setup is: iis 7 default iis7 page (this sort of control/test page) static ip port forwarding on port 1108 extermal ip:1108 static internal ip:1108 any idea wrong? friends trying connect not getting "could not connect server" error on end. thanks! if standard iis install running on port 80 , not 1108. also check if "windows firewall" enabled on network connection. if firewall on should allow http traffic (under 'allowed programs , features')

http - Can Nginx resolves upstream server name given as SRV DNS records? -

i want know if nginx able resolve srv dns records when given upstream server address. seems it's not case, maybe there workaround if can't out-of-the-box. thx in advance. srv records not meant used a(ddress) records. in theory should possible hack nginx resolve srv records advantage see 'weight' , 'priority' fields used in srv records. you can use feature in nginx config: upstream backend { server backend1.example.com weight=5; server backend2.example.com:8080; server unix:/tmp/backend3; } httpupstreammodule

java - How to SSH to a server behind another SSH server using JSch? -

i need able ssh java program remote server, , there ssh server. have credentials both servers on client. the commands passed automatically within app regular strings (no user input). need able run custom commands on second server , able decide commands issue during runtime, based on output , simple logic. can use jsch , if yes, should start into? (examples, info) ============================================================= added: exception in thread "main" com.jcraft.jsch.jschexception: unknownhostkey: host.net. rsa key fingerprint 'blahblahblah' as till now, solving problem modifying known_hosts file , adding host manually in there. can bypass little problem settings option somewhere telling jsch press yes automatically when yes-no question asked? to connect second server behind firewall, there in principle 2 options. the naive 1 call ssh on first server (from exec channel), indicating right server. need agent forwarding jsch, , d

regex - mod_rewrite last match -

my htaccess located in localhost/me/.htaccess , , want append after last / .php e.g. localhost/me/test/index rewrites localhost/me/test/index.php so far rewriterule ^([a-za-z]+)$ $1.php [nc,l] works localhost/me/index , can't working first example there. why doesn't ^/([a-za-z]+)$ /$1.php [nc,l] work, , how change work? it doesn't work because you're matching on alpha letters , don't have / in character class, uri me/test/index . try this: rewriteengine on rewriterule ^([a-za-z/]+)$ $1.php [nc,l,qsa] also, since you're using [nc] , need a-z rather a-za-z doesn't hurt anything.

c# - How to record keys pressed? -

essentially want record every key press (including keydown/keyup , mouse clicks) , when occurred can create macro out of them. i found ton of stuff key presses , winforms or wpf, don't need gui, want dump out console after i'm done processing it. so how can record key presses, when console window doesn't have focus? sample output: send {q down} sleep 98 send {q up} sleep 4 send {f down} sleep 102 send {f up} sleep 43 send {a down} sleep 26 send {s down} sleep 111 send {a up} sleep 18 send {s up} sleep 17 send {a down} sleep 62 send {space down} sleep 72 send {a up} sleep 5 send {space up} using wpf now, input text field has focused. i'd rather able record keystrokes while i'm in game, hence question :) have @ setwindowshookex function. can used monitor keystrokes across system.

jQuery script not functioning in IE9 or Chrome (works in FireFox) -

attempting jquery execute method upon loading page fails chrome , ie9. following attempts execute method have been tried no avail: (function($) { $(document).ready(function(){ slideshow(7500); }); })(jquery); $(document).bind("ready", function() { slideshow(7500); }) $(window).load(function() {slideshow(7500);}); alert(typeof $); please note: last of these attempts execute jquery failed produce alert in chrome , ie9. also, placing these scripts @ end of document did not solve problem. doing produced blank page. versions of script listed above work in firefox. have tried $(document).ready(function(){ slideshow(7500); } after include jquery?

arrays - php in_array() usage -

i have array of data , checking result using in_array() function, yet reason returning false??? here code: var_dump($result); var_dump(in_array("result", $result)); and here output: array(4) { ["timestamp"]=> string(29) "#wed jul 20 22:00:32 pdt 2011" ["cause"]=> string(34) "username , password not match" ["result"]=> string(5) "false" [""]=> null } bool(false) i'm confused??? you looking key not value. want use function: http://php.net/manual/en/function.array-key-exists.php

How do I access a facebook page's tabs data in the Graph API -

according facebook developer's article on pages, pages have tabs connection. says common tabs can accessed plain text string. when try access tabs data on page, oauthexception error flagged stating subject must page. any ideas why page throwing exception? page id is:136789689670650 when use graph query information on root, 136789689670650, page information pulled up. when use graph query information on tabs, 136789689670650/tabs/reviews, exception thrown. thanks. you need things in order access pages tabs: send http https://graph.facebook.com/user_id/accounts , user_id page owner. can /me/accounts if it's own page. this return json data structure this: { data: [ { name: "page name", access_token: "page access token", category: "", id: "136789689670650", } ] } data array of pages admin'd user. each page has it's own access_token need use next request. once have

android - how Respond to BroadCast receiver based on Application Running status.? -

i have registered broad cast receiver in app store usb connected/disconnected state in shared preferences. working fine. now wanted perform task if usb connected , application running. how can this? if application not running , ll perform task in first activity based on shared preference value. please give ideas this.. i have paste code shows how check running services here . if looking activity use runningtaskinfo instead of runningservicesinfo.

google chrome extension - Add icon to child context menu -

i want add icon child context menus. right now, chrome extension options context menu doesnt provide option add icon while creating child menu. can add icon parent menu using icon parameter in manifest file . no option child menu. idea how might achieve this? sorry, not possible. got 1 parent icon set through manifest.

Flex DataGrid/List Drag and Drop - How to avoid copying -

i'm using drag , drop on datagrid reorder items. however, when user holds down ctrl can initiate drag copy operation. how can disable copying altogether? (not cancel drop, prevent ctrl + drag showing (+) icon) this worked me (for spark list): <s:list dragenabled="true" dropenabled="true" dragmoveenabled="true" dragenter="{event.ctrlkey = false}" dragover="{event.ctrlkey = false}"> ... </s:list>

sockets - java.net.SocketException: Software caused connection abort: recv failed, with java.net.SocketException: Connection reset -

i'm getting exception in java, hibernate, mysql project within netbeans ide. i've done digging try , fix strange socket exception, no avail. some forum solutions suggested implementing c3p0 connection pool hibernate. no fix. others suggested disabling av , firewall (!!) these interfere socket connection. no fix. i've tagged question hibernate, i'm not hibernate cause, exceptions occur on hibernate call (running query). other hibernate code in app works fine. hibernate version 3.2 . the exception: notifyutil::java.net.socketexception: software caused connection abort: recv failed @ java.net.socketinputstream.socketread0(native method) @ java.net.socketinputstream.read(socketinputstream.java:129) @ java.io.bufferedinputstream.fill(bufferedinputstream.java:218) @ java.io.bufferedinputstream.read1(bufferedinputstream.java:258) @ java.io.bufferedinputstream.read(bufferedinputstream.java:317) @ java.io.filterinputstream.read(filterinputstream.java:116) @ s

iOS Application Update Test -

is there method though wants test when application updated? i embarrassed because there bug occurs when application updated, , doesn't investigate. if asking if want find when application updated through app store, not aware of such method. a hackie approach save current app version nsuserdefaults, check if nsuserdefaults app version equal current app version. for example: - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { nsstring *currentappversion = [[[nsbundle mainbundle] infodictionary] objectforkey:@"cfbundleversion"]; if ([defaults objectforkey:@"savedappversionkey"] != nil) { //key exists nsstring *savedappversion = [[nsuserdefaults standarduserdefaults] objectforkey:@"savedappversionkey"]; if ([currentappversion isequaltostring:savedappversion]) { //still running same app version } else {

datetime - Convert dd-mm-yyyy into mm/dd/yyyyy in C# -

i want convert date dd-mm-yyyy default format of date time "mm/dd/yyyy" in c#. is there string format helps me do. (datetime.parseexact(input, "dd-mm-yyyy", cultureinfo.invarientculture).tostring("mm/dd/yyyy") (not assuming defaults – "mm/dd/yyyy" not default date format people.)

nhibernate - update with join in HQL -

i have request in pure sql (mysql) works : update index_record_format dbrf, index_record dbr set status = 1 dbr.record_id = dbrf.record_id i'd same hql, tried : update dbrecordformat dbrf, dbrecord dbr set status = 1 dbr.id = dbrf.indexrecord.id but doesn't work error : "expecting "set", found ','". idea? thanks in adwance.

javascript - Using the push method or .length when adding to array? -

what downsides doing: var myarray = []; myarray[myarray.length] = val1; myarray[myarray.length] = val2; instead of: var myarray = []; myarray.push(val1); myarray.push(val2); i'm sure push method more "acceptable", there differences in functionality? push way faster, 300% faster. proof: http://jsperf.com/push-vs-length-test

http - Why do some web services require the client to send its IP address? -

as example, see reference documentation 1 of paypal's apis: http://www.paypalobjects.com/en_us/ebook/pp_nvpapi_developerguide/appx_fieldreference.html#2824913 the question is, why need it? doesn't server part of http protocol? update: realized example gave wasn't good. i'm talking instances client talking directly web service. i'll close question. i'm not sure paypal specifically, 1 use case service requiring client's ip server needs fraud detection (too many requests coming same end user), source ip in packet comes aggregator of end user actual ips. perhaps aggregator has natted clients behind (possibly mobile devices, knows). server want aggregator send ip of clients. there may other cases; 1 know of.

c# - ADODB.Recordset data cannot bind into datagridview -

i wan bind data recordset data grid view, data cannot show in grid view, try count row, there 2 rows of data, cannot bind grid view if not rs.eof datagridview1.datasource = rs datagridview1.refresh() else msgbox("record not founds " & txtsearch.text, msgboxstyle.okonly) end if you can't bind datagridview adodb.recordset. if can't change data source ado.net have pre-process recordset datagridview can bind datatable, or alternatively write rows in manually.

Edit Excel files in asp.net -

we have document on server , want edit thru asp.net application. client can login account related excel file hosted on page of asp.net page. does know how edit server document (excel file) in asp.net client side. if want edit excel file in code, in asp.net application, may try aspose.cells .net . api provides quite flexibility manipulate excel files without need microsoft office installed on server. however, can work in full trust environment, not shared hosting environment. please see if might in scenario. further details, may consult aspose.cells .net documentation . disclosure: work developer evangelist @ aspose.

ios - Can I create a blue-screen effect with MPMoviePlayerController? -

i showing video inline (not fullscreen) using mpmovieplayercontroller. using class because player got working using remote file (progressive download) , not local file. is there way create blue-screen effect? mean decide on rgb value , set pixel's alpha 0. possible perform image processing per frame mpmovieplayercontroller? you can not use mpmovieplayercontroller such movie processing. still, there ways accomplish asking for. may use avassetwriter etc. check answer on similar question .

android - SQLite order by 3 fields and return top 1 for each category -

public cursor fetchallpbs() { string sql = "select * " + captures_table + " group " + key_captures_species + " order " + key_captures_pounds + " desc, " + key_captures_ounces + " desc, " + key_captures_drams + " desc;"; cursor c = mdb.rawquery(sql, null); if(c != null) { c.movetofirst(); } return c; } hi, i want above query return me user's personal best each species, is, heaviest item within each species. testing i've realised problem. i'm still relatively new sql project... say add 'chub' database of 7lb 6oz 0drms, add of 7lb 2oz 0drms - return more added fish pb , not biggest (the 7lb 2oz one). if add chub of 8lb 0oz 0drms return 8lb fish - seems it's not ordering them ounces , assume drams too. can see what's wrong here , suggest solution? many thanks first, need subquery determine heaviest fish per species. second, weight sp

Dropdown javascript / jquery form validation debugging help needed -

i have following jsfiddle setup: http://jsfiddle.net/xcca2/ basically when form submitted, size select dropdown validated make sure selection has been made. if valid size has been selected form posted. if invalid selection made, alert box "an invalid size has been selected" should popup. please can debugging this. nb: there many forms on page, , prefer uses classes rather id's there commented out html, form has been set class, works within form becomes clickable, not want. button should trigger validation. thanks try $(".wq").live( "click", function () { alert("test"); if($("select").val()!="") alert("not empty"); else{ alert("select val"); return false; } // $(this).submit(); }); http://jsfiddle.net/xcca2/4/

mysql - Efficiency when deleting rows in two tables -

i have table1(id_table1) , table2(id_table2, id_table1). i'd remove records in table2 (under given condition) remove items in table1 have no more relationships table2. efficient way in sql? i'm using mysql. thanks in advance! if use innodb, add foreign key constraint on delete cascade . automatically delete rows if relationship no longer correct. way, don't have query database after deleting rows in table2 check if relation still intact. foreign key constraints

asp.net - Using Resource .resx file in Class library project -

i have used resource file(.resx) file in class library project store error messages. when set "build action" "embedded resource" resx file , deploy works fine. separate resource file dll since may need change error messages in resx file in future without need recompiling class library project. tried other option in "build action" property content,resource, etc nothing seems working in way require. when use these property getting below error, not find resources appropriate specified culture or neutral culture. make sure correctly embedded or linked assembly @ compile time, or satellite assemblies required loadable , signed. is there way resolve error , make work? resource files have set embedded - that's how work. you can create assembly containing resources , reference - way can redeploy updated resources. requires bit more work in code (loading assembly in order able embedded resources). however, description (text messages need

excel - How to change size occupied by an array formula? -

i have formula, returns array. possible change range occupied result of formula? (programmatically) no, it's not possible. have delete array , make new one. from microsoft support website : you can't delete cells in array formula (you'll see "you cannot change part of array" error), can delete entire formula , start over. so in order achieve this, first have select cells in array, press delete , type / paste formula again in new range.

iphone - How to declare protocol in separate header file -

i have 2 classes. both these classes delegates of each other. gives me error "can not find protocol declaration". after searching on net, came conclusion that, case of cyclic dependency. to break dependency solution have suggested define protocol in header file. not find tutorial on how , how affect code? it helpful, if creates example of this. in advance. check @toro 's answer in previous question uiviewcontroller calling each other's delegate

version control - Eclipse: Keeping track of all the files that I have changed before checking in? -

when have changed lot of files forget checking in of them , breaks build. have tried maintaining lists doesnt work. there plugin eclipse tells me files have been changed since last checkin? and in general use synchronize view . team providers (git, cvs) hook it, , show delta between what's checked in , dirty in workspace. use window>show view>other... open view, or switch team synchronizing perspective. edit: i'll add if using egit, there's git staging view. show modified files current repo.

Java, JDBC connection pool, JDBC connection rollback -

we have database connection pool (java jdbc). every time checkout, first preemptive connection rollback avoid connection exceptions. please ignore business case. technical point of view, jdbc connection roll influence application performance lot (since our application mili-second business)? i dont understand why connections coming directly connection pool need rolled back. state has idle otherwise wouldn't able obtain them pool?! transactions have influence performance. if there transactions can rolled back, there may query cannot executed because dangling transaction blocking them. so if application time critical - should invest time optimizing code. use transactions have to.

Silverlight 4 Grid vs DataGrid ==>Pivot { Database Rows as Column } grouped by unique value in row -

data model: a document contains 1 more recordings , unique identifier. document template defines tabular format of recordings defining sequence of recordings. ui design: { static number of rows per template }| document1 | document2 ......{dynamic number of column} record1 name: | value of recording1 in doc1 | value of recording1 in doc2 record2 name: | value of recording2 in doc1 | value of recording2 in doc2 database model : each value in above tabular column row in database , 1 item in observable collection. question : is solution possible using data grid? give me directions ? my solution : used grid layout , create dynamic rows based on count of recording on template . generate columns based on distinct documents available. bind items in observable collection in textbox , add content column setting row & column attached property of text. my problem: i have write code column header / resizing etc... grid

flex - Issue with both red and blue colors with validator and errorString of textinput -

i'm facing strange issue flex , validator. here code: testmain.xml <?xml version="1.0" encoding="utf-8"?> <s:application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx"> <fx:script> <![cdata[ import mx.controls.alert; import mx.validators.stringvalidator; import utils.validableproperty; [bindable] public var nameid:validableproperty; public function start():void { var nameidvalidator:stringvalidator = new stringvalidator(); nameidvalidator.required = true; nameidvalidator.maxlength = 35; nameid = new validableproperty(nameidvalidator); nameid.validate(); } ]]> </fx:script> <s:applicationcomplete> start(); </s:applicationcomplete> <s:minheight>600</

eclipse - Menu contribution with icon and text -

Image
it possible create menu item in eclipse icon , text? menu items on main menu displayed icon only. need, however, display short text next icon. e.g. in attached screenshot "r2" short text next "run" icon (i don't want enhance "run" menu, example). for command contributed through org.eclipse.ui.menus can add mode attribute. see extension point description (you can pde editor>extensions tab). <extension point="org.eclipse.ui.menus"> <menucontribution locationuri="toolbar:org.eclipse.ui.workbench.file"> <command commandid="org.eclipse.ui.edit.copy" mode="force_text"/> </menucontribution> </extension>

How to automatically subscribe a user to a public calendar in Windows Live Calendar? -

i have public calendar on site , want provide users link automatically subscribe them calendar on windows live calendar. been looking info , couldn't find anything, way of doing manually inside windows live calendar. do know if there way of doing this? thank you

Codeigniter database connect to multiple databases in model -

to bridge gap between older system , codeigniter, have extended ci_model in ci 2. here's constructor: public function __construct ($pkname='', $tablename='') { parent::__construct (); $this->conf['pkname'] = $pkname; //name of auto-incremented primary key $this->conf['tablename']= $tablename; //corresponding table in database $this->dbr = $this->load->database('read', true); $this->dbw = $this->load->database('write', true); // echo $this->dbr->conn_id // echo $this->dbw->conn_id } if uncomment 2 lines echoing conn_id, different each time. shouldn't re-using connection information? i'd think means hitting same resource #id each time. have pconnect=true both. resource id #24 resource id #25 ... snip ... resource id #127 resource id #128 i'm in dev it's not big issue don't want go production connecting separately each model. thanks.

sql server - Need help with SQL query -

i have following data: transactiontype lane transactiondate ------------------------------------------------ sale 17 2011-07-21 06:15:34 signon 18 2011-07-21 07:00:00 sale 18 2011-07-21 07:06:43 signon 20 2011-07-21 08:01:12 sale 18 2011-07-21 07:30:00 sale 18 2011-07-21 08:30:00 sale 18 2011-07-21 09:30:50 sale 20 2011-07-21 10:15:34 signoff 18 2011-07-21 19:00:00 signoff 20 2011-07-21 19:10:52 i need following information: the count of lane lie between signon , signoff transaction types the total time each lane @ signon state, e.g. row lane number 18 12 hours, row lane 20 has time of 11 hours, 9 minutes , 40 seconds this of it... including multiple sign in/out per lane , how many transactions within each login/out time period. once result, can quer

java - InputStreamReader's read() method doesn't return anything -

i'm java , android developer. work software update application , use ftp4j project ftp library have problem. when connection's speed low @ end of download while getting ftp reply there strange issue. in codes @ bottom "int = reader.read()" doesn't return codes doesnt continue run. checked whether reader ready or not returns true when issue occurs. how can fix issue? helpless now. here codes: public string readline() throws ioexception { stringbuffer buffer = new stringbuffer(); int previous = -1; int current = -1; { int = reader.read(); if (i == -1) { if (buffer.length() == 0) { return null; } else { return buffer.tostring(); } } previous = current; current = i; if (/* previous == '\r' && */current == '\n') { // end of line. return buffer.tostring(); } else if (previous ==

selenium - Clicking at coordinates without identifying element -

as part of selenium test login function, click button identifying coordinates, , instructing selenium click @ coordinates. done without identifying element (via id, xpath, etc). i understand there other more efficient ways run click command, i'm looking use approach best match user experience. thanks. selenium won't let this.

c - What key to put on the receiver side of Linux message queues? -

i have created message queue , sender part creates , sends message message queue. i have used ipc_private key in msgget() on sender side. now question is, key use in msgget() on receiver side ? using ipc_private on receiver side key in msgget() not receive message , fails. i should mention msgsnd() in sender part indicates error (returns -1), when printing perror() , output success , message sent message queue , can seen using ipcs -q command @ terminal. don't know why happens. if(msgsnd(msqid,&msgp,88,ipc_nowait) == 0) { perror("\nsend : msgsnd fail"); msgctl(msqid,ipc_rmid,buf); return 1; } output : send : msgsnd fail: success you going have use common key value between 2 independent processes ... using ipc_private means not planning on sharing queue between 2 processes unless secondary process has been forked first process. because of forking operation, chi

LNK1201 on Visual C++ 2003 -

i keep getting error message result after every debug run have done on of projects in vs2003. have browsed around many forums , provide answer not fit actual problem. link : fatal error lnk1201: error writing program database 'd:\coding\flyff\projects\gui system 20110721\debug\gui system 20110721.pdb'; check insufficient disk space, invalid path, or insufficient privilege i'm using windows 7 ultimate x64 visual studio 2003 .net (service pack vs7.1sp1-kb918007-x86.exe). what have tried already: run in compatible mode several other operative systems , service packs. set project folders write permission full. run visual studio administrator. edited debug information format several other formats. to reproduce bug, must have windows 7 x64 (probably ultimate). visual studio 2003 (with vs7.1sp1-kb918007-x86.exe update). i have on 150 gb space has nothing that. visual studio simple locks pdb file when debugging, , after debug cannot unlock it. you m

doctrine2 - doctrine 2 querybuilder with set parameters not working -

this query: public function getdetails($userid, $orderby, $sort){ $query = $this->_em->createquerybuilder() ->select('u') ->from('\entities\users', 'u') ->where('u.userid= ?1') ->orderby('u.?3', '?3') ->setparameter(1, $userid) ->setparameter(2, $orderby) ->setparameter(3, $sort) ->getquery() ->getresult(); } it keeps erroring: message: [semantical error] line 0, col 83 near '?3 desc': error: '?3' not defined. how orderby properties in function query? you can't use placeholders dinamical build of dql query. you'll have code own: $sortby = in_array($sortby, array(...)) ? $sortby : 'id'; $sortdir = $sortdir == 'asc' ? 'asc' : 'desc'; $this->em->createquerybuilder() ... ->

java - Programmatically interrogate Ant build.xml -

i wish write java program interrogate specified ant build.xml file, listing out every detail in build file, such high level details build file description (which have managed achieve) down low level detail such each , every path/pathelement location, property names , values set in entire build script etc. i have been using code such this:- file buildfile = new file("build.xml"); project p = new project(); p.setuserproperty("ant.file", buildfile.getabsolutepath()); p.init(); p.initproperties(); projecthelper helper = projecthelper.getprojecthelper(); p.addreference("ant.projecthelper", helper); helper.parse(p, buildfile); i unable @ lowest level details, possible?

video - How do swf recorders work? -

there software convert swf file avi, mpeg or other types of video files. how work? the swf played , bitmap screengrab made of swf on each frame. of screengrabs compiled video , compressed/exported in desired format.

linux - How to find out whether i have libidn? -

i'm new linux, need install zimbra open source mail server on server running centos 5, in system requirements in zimbra documentation, under other dependencies sections said have install libidn. questions how can find out whether have installed & how can install it? replies! dan just run yum install libidn , either tell installed, or install if isn't.

Python equivalent of Perl's 'w' packing format -

what format should use in struct.unpack decode data packed in perl using w format character (as doc says 'ber compressed integer')? i don't believe python's struct module has support format, supports encodings commonly found in c structs. ber & der encodings encountered within asn.1 encoded streams... 1 of python asn.1 modules might helpful in case (i should note not user-friendly). if not, may have implement decoder yourself. following bit of code read off int, , return in string unpacking should pick at... def decode_ber_int(data, offset): value = 0 while true: tmp = ord(data[offset]) value = (value<<7) | (tmp&0x7f) offset += 1 if tmp & 0x80 == 0: break return value, offset sadly, require breaking unpack call unpack, decode_ber_int, , unpack rest.

Drupal autocomplete, callback with multiple parameters -

i adding autocomplete on form alter. problem in callback, string in textfield autocomplete on, available. want access value textfield in callback. how possible ? /** * implements hook_form_alter(). */ function webform_conversion_jquery_form_webform_client_form_1_alter(&$form, &$form_state, $form_id) { //load function process data module_load_include('inc', 'webform_conversion_jquery', '/includes/dataqueries'); //add js files drupal_add_js(drupal_get_path('module', 'webform_conversion_jquery') . '/js/conversionform.js'); $form['submitted']['correspondentadress']['cor_street']['#autocomplete_path'] = 'conversionform/conversion_street'; } } /** * implements hook_menu(). */ function webform_conversion_jquery_menu() { $items = array(); $items['conversionform/conversion_street'] = array( 'title' => '

php - Dynamically build a class member variable -

i trying setup php (zend framework) project through injection dependence . far when instanciated model, pass table , view (database view) model that: $table = new my_table(); $view = new my_view(); $model = new my_model($table, $view); all models extends same class take care of construction, message handling , getters forms interact model. now have inject model model , looking passive static way of doing this. in model's parent class have added static method inject called in application bootstrap. pass 2 string in form of key => value key name of variable have created in model , value string represents class instanciated. my_model::inject('dependentmodel', 'my_other_model') the issue arise when try use key new member variable through following code : protected function _initdependency() { $this->_table = null; foreach (self::$_staticdependency $key => $dependency) { $varname = '_' . $key; $this->{$$v

objective c - Launch method when window (and its views) appear in Cocoa -

i have multi window (a,b,c) application. user can close window a(transparent , buttonless) pressing specific button on interface, @ point can reopen click button. works great, need reset values when window opened again. i know awakefromnib called window , view once, doesn't call again @ window reopen. there method window (and views ?) call when window reopen ? viewwdidappear ios ? you register uiwindowdidbecomevisiblenotification that.

javascript - Regular expression including wildcard character in search string -

i want regular expression string string can contain * , ? in it. should have @ least 3 alphanumeric character in it. so, *abc* valid *ab*c valid *aaa? valid *aa not valid **aaa not valid not valid regular expression this should it: ^[*?]?([0-9a-z][*?]?){3,}$ explanation: ^ matches beginning of string [*?]? matches optional * or ? (...){3,} group must appear @ least 3 times [0-9a-z][*?]? matches alphanumeric character followed optional * or ? $ matches end of string consecutive * , ? not matched. update: forgot mention it, on mind: use i modifier make match case-insensitive ( /.../i ).

asp.net - Dragging a popup modal extender inside an usercontrol -

i'm trying use modal popup extender. have problem when using inside usercontrol. put drag property true, , popupdraghandlecontrolid can't drag popup. it seams problem happens when use popup modal extender inside usercontrol. if use inside aspx page, ok. please can me how deal problem? here code use in user control: <asp:linkbutton id="lnk" runat="server" text="rezervo"></asp:linkbutton> <ajax:modalpopupextender id="modalpopupextender1" backgroundcssclass="modalpopupbg" runat="server" cancelcontrolid="btncancel" okcontrolid="btnokay" targetcontrolid="lnk" popupcontrolid="pnlbooking" drag="true" popupdraghandlecontrolid="popupheader"> </ajax:modalpopupextender> <div id="pnlbooking" style="display: none;" class="popupconfirmation">

visual studio - ASP.NET VS2008 Calling a function from master page inside template -

so have master page has following function '# and/or set page id public property getpageid() string return pgid end set(byval value string) pgid = value end set end property in template i.e default.aspx references master page follows <%@ page title="" language="vb" autoeventwireup="false" masterpagefile="~/loggedin.master" codebehind="content.aspx.vb" inherits="udpharmalecheile.webform2" %> how can call masterpage function ? what want mastertype attribute. see here: http://msdn.microsoft.com/en-us/library/xxwa0ff0(v=vs.85).aspx

c# - $.ajax and .each in JQuery, with MVC, isn't asynchronous -

my ajax calls don't seem asynchronous when wrapped inside .each loop, instead seem wait each finish before calling next 1 .. mvc c#: [httppost] public jsonresult doactiongetnextstep(jsonsubmission submission) { somestruct body = new somestruct(); datetime start = datetime.now; try { system.threading.thread.sleep(5000); body.html= "there, done"; } catch (exception e) { body.html= "there error: "+e.message; } timespan s = datetime.now - start; ast.html = body.html+ "<p> c# took " +s.seconds +"s</p>"; return json(body); } jquery: function doactions(targets) { $(targets).each(function () { doaction($(this)); }); } function doaction(target) { var parent = $(target).parents('div.actionreplaceable'); var jsonsubmission = { data : "somedata" }; var submission = json.stringify(jsons

android - Is it possible to simulate a specified state of internet connection ("3G", "H", ...) -

i want test app in lot of possible states of internet connection. possible simulate specified state of internet connection (for example "3g" or "h") without leaving position? you use wanem allows modify characteristics of internet connection, packet loss. http://wanem.sourceforge.net/ from question take it's not looking maybe it'll give perspective.

c# - Automatic data update in WPF -

Image
<window x:class="binding2.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="mainwindow" height="350" width="525"> <stackpanel orientation="vertical"> <stackpanel horizontalalignment="left" name="stackpanel1" verticalalignment="top" width="165" orientation="horizontal"> <textblock height="20" name="_sourcetextblock" text="source" width="67" /> <textbox height="20" name="_sourcetextbox" width="92" /> </stackpanel> <stackpanel horizontalalignment="left" name="stackpanel2" verticalalignment="top" width="165" orientation="horizontal">

dojox.grid.datagrid - Prevent Dojo Caching ItemFileWriteStore Data -

i'm working on web page uses dojo's enhancedgrid allow user edit data , save server. have edit , saving correctly grid shows old value of cell if refresh page. if close window , open again new value. any thoughts? you need tell grid update row after have saved server. here callback method looks like. function onapplycelledithandler(ingrid, invalue, inrowindex, infieldindex) { ingrid.store.save({onerror: errorsaving}); ingrid.updaterow(inrowindex); } i've had issues mechanism updated data , grid not seeing results. in other words, user loads grid user b loads grid. user makes change , user b reloads grid. user b doesn't see user a's change. you'll need make call grid.update() tell grid refresh new data supplied call fetch.

ruby on rails - content_tag does return blank -

i have problem content_tag helper, piece of code def renderize(place_holder) content_tag(:div, "hello") @raw_estimate.field_estimates.where(:field_position_id => fieldposition.where(:place_holder => place_holder).first).each |field| if field.field_type.alias == "input" content_tag :div field.is_validate ? label_value = "*#{field.name}" : label_value = field.name content_tag(:label_tag, label_value) + text_field_tag("estimate[field_#{field.name.downcase.gsub(/\w+/, '')}]") end end end end end does not return anything, missing? thank you don't use each interacting array, use collect will return array of rendered tags see http://apidock.com/rails/actionview/helpers/taghelper/content_tag last few comments

plone - Reuse the same template for different content types -

i'm creating quite few dexterity content types (thanks zopeskel.dexterity devs!!) if need them different content types (searches, collections...), of them rendered equally. so, there's way reuse same template different content types? ok, made work i'm wondering if it's correct approach: from my.product.parent_type import iparenttype, parenttype, twocolumnsview ... code omitted ... # common folder templates grok.templatedir('parent_type_templates') class sametwocolumnsview(twocolumnsview): grok.context(customclass) grok.require('zope2.view') grok.template("twocolumnsview") any thought? how reuse templates across content types? create interface this: from zope.interface import interface class itwocolumnviewable(interface): """can viewed in 2-column layout""" you assign interface various content types, , register view interface instead directly type: class sametwocolumn

c# - WCF Discovery simply doesn't work -

i'm trying add ad-hoc discovery simple wcf service-client setup (currently implemented self hosting in console app). debugging using vs2010 on windows 7, , doing whatever can find in online tutorial, still - discovery client finds nothing. needless if open client correct service endpoint can access service client. service code: using (var selfhost = new servicehost(typeof(renderer))) { try { selfhost.open(); ... selfhost.close(); service app.config: <?xml version="1.0"?> <configuration> <system.servicemodel> <services> <service name="testapp.renderer"> <host> <baseaddresses> <add baseaddress="http://localhost:9000" /> </baseaddresses> </host> <endpoint address="ws" binding="wshttpbinding" contract="testapp.irenderer"/> <endpoint kind=&qu

Jquery code for adding/deleting/scrolling list items behaving very strange -

this piece of code that's in charge of scrolling vertical list of items. <script type="text/javascript"> $(document).ready(function(){ var first = 0; var speed = 700; var pause = 8000; function removefirst(){ first = $('ul#twitter_update_list li:first').html(); $('ul#twitter_update_list li:first') .animate({opacity: 0}, speed) .fadeout('slow', function() {$(this).remove();}); addlast(first); } function addlast(first){ last = '<li style="display:none">'+first+'</li>'; $('ul#twitter_update_list').append(last) $('ul#twitter_update_list li:last') .animate({opacity: 1}, speed) .fadein('slow') } interval = setinterval(removefirst, pause); }); </script> at first glance, seems work flawlessly. after 10 minu