Posts

Showing posts from August, 2012

android - problem with bitmap not displaying image after a text -

i trying show image directly under text had retrieved file in sdcard text showing not image, have been trying several methods non of workable below code display them //find directory sd card using api //*don't* hardcode "/sdcard" file sdcard = environment.getexternalstoragedirectory(); //get text file file file = new file(sdcard,"file.txt"); //read text file stringbuilder text = new stringbuilder(); try { bufferedreader br = new bufferedreader(new filereader(file)); string line; while ((line = br.readline()) != null) { text.append(line); text.append('\n'); } } catch (ioexception e) { //you'll need add proper error handling here } //find view id textview tv = (textview)findviewbyid(r.id.textview01); //set text tv.settext(text); bitmap bitmap = bitmapfactory.decoderesource(getresources(),r.drawable.icon); canv

How to protect images from other applications in android? -

in application downloading lot of images web in order use them in application. problem android creating thumbnails images (gallery). is there way protect images other applications gallery can not access them? make folder hidden in sd card naming folder starts "." (.foldername). this hide folder accessing other android applications.

jquery - How to autorefresh asp.net MVC webpage if condition is met in background -

i working on having following functionality mvc website. want have, example 5 selected users voting on question. when user has voted, remain in 'waiting' state until has answered. once 5 users have answered, page autorefresh , can populate next question. my basic thinking need following pseudocode execute every (say 10 seconds) check status, possibly in jquery... controller can populate next question. while(condition not met) { } //wait refresh() is there simple way fulfil functionality? thanks. your thinking correct. uusing jquery.get on timer method call jquery. call url (route/controller) see if voting has completed , examine data in resulting function set callback in jquery.get function. if condition true, jquery can call method using jquery.load() results , update div such as: $('#question').load('/voting/nextquestion/10'); see following error handling when call jquery methods jquery error handling

solr - Nutch querying on the fly -

i newbie nutch , solr. relatively newer solr nutch :) i have been using nutch past 2 weeks, , wanted know if can query or search on nutch crawls on fly(before completes). asking because websites crawling huge , takes around 3-4 days crawl complete. want analyze quick results while nutch crawler still crawling urls. 1 suggested me solr make possible. i followed steps in http://www.lucidimagination.com/blog/2009/03/09/nutch-solr/ this. see injected urls shown in solr search. know did foolish , crawl never happened, feel missing information here. did steps mentioned in link. think somewhere in process there should crawling happening , missed. just wanted see if 1 me pointing out , went wrong in process. forgive foolishness , patience. cheers, abi this not possible. though chunk crawl cycle in smaller number of url's such publish result more whith command nutch generate crawl/crawldb crawl/segments -topn <the limit> if using onestop command craw l should

jQuery Selector Help Next Class -

im stuck on , although there 1000 different ways select need, cant going. in html below, <tr class="hide"> hidden, , when clicks link in span, want slidedown. i've tried $(this).parent().next().slidetoggle('slow'); and bunch of other similar things, no love. seems because hidden tr element down 2 levels cant select it. mind you, there multiple of these on page, needs next 1 in line slides down, cant $('.hide') select it. can help? heres html <td> <span class="details">details</span> </td> </tr> <tr class="hide"> <td></td> try to $(this).closest('tr').next().slidetoggle('slow');

C++ friend operator+ overloading -

i'm confused friend operator overloading. has no problem if write friend operator overloading function within header file, gives me following errors once moved function class file. googled samples , written function in header file. did wrong? thanks. ...: error: expected ‘,’ or ‘...’ before ‘&’ token ...: error: iso c++ forbids declaration of ‘statisticain’ no type ...: error: ‘main_savitch_2c::statistician operator+(int)’ must have argument of class or enumerated type // a.h class { public: friend operator + (const &a1, const &a2); }; // a.cpp #include "a.h" operator + (const &a1, const &a2) { // } from error message you're getting: iso c++ forbids declaration of ‘statisticain’ no type i think misspelled "statistician" reversing last 2 letters (note have "statisticain" instead of "statistician.") this should have nothing whether operator+ implemented in header or .cpp file.

php - Google AJAX Search API not returnig results -

i using code below search results. when insert string in google 1 search result when trying result through code returns nothing. can explain why code not working. returns results if enter other search term <?php $string="make them see things view"; $request = trim("http://ajax.googleapis.com/ajax/services/search/web"); $referrer = trim("http://localhost/"); $version = "1.0"; $getargs = '?v='. $version .'&rsz=small&q="'. urlencode($string).'"' ; // curl session object $session = curl_init($request . $getargs); // set options. curl_setopt($session, curlopt_httpget, true); curl_setopt($session, curlopt_header, true); curl_setopt($session, curlopt_returntransfer, true); curl_setopt($session, curlopt_referer, $referrer); //var_dump $response; $response=null; // post , close session $response = curl_exec(

javascript - Comma-formated numbers in jQuery -

i have following function in jquery format number comma-formatted: function commaformattedn(amount) { var delimiter = ","; var = parseint(amount); if(isnan(i)) { return ''; } = math.abs(i); var minus = ''; if (i < 0) { minus = '-'; } var n = new string(i); var = []; while(n.length > 3) { var nn = n.substr(n.length-3); a.unshift(nn); n = n.substr(0,n.length-3); } if (n.length > 0) { a.unshift(n); } n = a.join(delimiter); amount = minus + n; return amount; } i calling function on $('.text_field1').bind("focus blur change keyup", function(){ var $el = $(this); $el.val(commaformattedn($el.val())); }); it's working fine, problem is, when number of digits increase 5, makes nothing. digits deleted , starts again. there bug related sign. using absolute value instead of original one. your code seems wor

Neural networks in Lisp - advice -

can suggest tutorial or book neural networks in lisp, or blog, or share code sample? i have experience neural netowrks in imperative languages c++, java, c#, want try in lisp. the seminal book ai: modern approach includes lisp source code on website: link specifically, check out learning chapter ( perceptron etc) in same vein have paradigms of ai in lisp , doesn't touch neural networks if remember correctly.

delphi - Something like StrTok() or Sscanf()? -

so, reading modbos on serial port , readings following : '+0020.8+0022.8-00.046-00.002-00.005-001.99+00.000+00.003'; basically, there 8 floating point readings, preceded plus or minus sign, although may of varying character length. what's efficient way values array of float (or array of string or tsringlist)? i not certain, might time critical, efficiency has way on elegance. i this: type tfloatarray = array[0..7] of double; procedure parsefloats(const afloatstr: string; var afloatarray: tfloatarray); var lpos: integer; lnextpos: integer; lpospositive: integer; lposnegative: integer; i: integer; lformatsettings: tformatsettings; begin //do not forget formatsettings, or problems regional settings lformatsettings.decimalseparator := '.'; lformatsettings.thousandseparator := ','; lpos := 1; := 0 high(afloatarray) begin lpospositive := posex('+', afloatstr, lpos + 1); lposnegative := posex('-&

ruby on rails - How to Close Fancy box -

i'm using fancybox load/display iframe in fancybox. after action in fancybox, ajax request made responds with: parent.$.fancybox.close(); problem here when runs, there's error (chrome): " failed load resource " any ideas why, and/or how close fancybox via ajax request w/o error? a little more technical details. in parent have jquery 1.5 w bunch of plugins, in iframe have jquery 1.5 rails jquery-ujs. thanks try making window.parent.$.fancybox.close(); .

java - How to parse IP addresses from Apache Server Log? -

i have find commonly occuring ip addresses apache logs. 12.1.12.1 9000 127.0.0.1 - frank [10/oct/2000:13:55:36 -0700] "get /apache_pb.gif http/1.0" 200 2326 "http://www.example.com/start.html" "mozilla/4.08 [en] (win98; ;nav)" 12.1.12.1 9000 192.145.1.23 - frank [10/oct/2000:13:55:36 -0700] "get /apache_pb.gif http/1.0" 200 2326 "http://www.example.com/start.html" "mozilla/4.08 [en] (win98; ;nav)" how extract ip addresses (i.e. 3rd word in each line) using regular expressions in java? have find common ip addresses it, finding out robotic access. log contains millions of lines, regexp may suitable this. here 1 solution: string str1 = "12.1.12.1 9000 127.0.0.1 - frank [10/oct/2000:13:55:36" + " -0700] \"get /apache_pb.gif http/1.0\" 200 2326 " + "\"http://www.example.com/start.html\" \"mozilla/4.08 "

php - Netbeans & Xdebug Problem: private variables in class methods not visible? -

when debug php project using netbeans ide 6.9.1 , xdebug 2.0.5 variables declared in scope of class methods $myvar in following example not visible in variables-window : class test { public function test($myvar) { return $myvar=1+$myvar; } } though object-variables , superglobals visible. this annoying behavior values of these variables important hints finding bugs. is facing same problem? is normal behavior of xdebug or have change configuration? thanks or hints. you turn on watches/balloons evaluation in tools, options, php. xdebug tends unstable when on large project.

Printing special characters in php -

i have php variable contains data io stream (say, file i've read). string contains number of special characters such \n , \t , forth. need able print of these characters screen can examine string visually. i'm presuming there's way of escaping them, life of me can't figure out how. addcslashes("test\n", "\0..\37\177..\377")

Java code in Netbeans IDE: Code executed is the older one! even when I make changes in the code -

i building application in java using netbeans ide. trying debug errors in code. when modify messages passed in log statements, not see corresponding change in logged messages. implies when execute code, runs older version of code & prints old version of log messages well. what cause of error ? & how should rectify ? thanks helping.. by saving code. assume, have compile-on-save enabled. if not have build before running it. yes need enable build-on-save, otherwise glassfish wouldn't able show changes, because new changes have never been deployed. sometimes, deploying on save bothers lot. so, is, don't enable build-on-save , work tests , thereby run tests see result of change. when seems fine, build app , deploy on server further verifications.

c++ - The correct decision of storing objects in memory (composite pattern) -

i have object of ccompositeprimitive class in main.cpp int main() { ... ccompositeprimitive drawobjects; ... } the ccompositeprimitive class has field: private: list<cdrawobject*> m_objects; and method: public: add(...); void ccompositeprimitive::add() { objects.push_back(new rectangle(...)) } on forums ask me drawobjects object stored in heap. think else. in opinion drawobjects object stored in stack. how can preserve computer's memory of stack overflow (any different memory problems), if drawobjects can store in list m_objects; many objects, can content ccompositeprimitive objects (composite pattern). depends on how class ccompositeprimitive m_drawojects; stored in gets created. (i assume it's stored inside class because of m_ ) if class created on stack, m_drawobjects too. if class created on heap, m_drawobjects . indifferent of wether m_drawobjects created on heap or stack, objects inside list<cdrawobject*> m_objec

jsf 2 - JSF 2.0: h:inputText inside composite component fails with non-String objects when validation is set -

in backing bean: @min(3) integer foo; if have form like: <h:form> <h:commandbutton value="submit" /> <h:inputtext value="#{bean.foo}" /> </h:form> this works ok. however, if like <cc:interface> <cc:attribute name="text" /> <cc:editablevalueholder name="text" targets="field" /> <cc:interface> <cc:implementation> <h:inputtext id="field" value="#{cc.attrs.text}" /> </cc:implementation> and call inside form instead of directly h:inputtext in: <!-- <h:inputtext value="#{bean.foo}" /> --> <pref:fieldcomponent text="#{bean.foo}" /> but get: javax.validation.validationexception: unexpected exception during isvalid call @ org.hibernate.validator.engine.constrainttree.validatesingleconstraint(constrainttree.java:144) @ org.hibernate.validator.engine.constrainttree.validateco

pivot - Transpose rows into columns in MySQL -

how can convert rows columns in mysql query? you can turn rows a column group_concat , can't transpose whole result sets in automatic way. either write query produces each column manually, or in application. here's tutorial on writing complicated queries emulate transposition: http://www.artfulsoftware.com/infotree/queries.php#78

multithreading - how to analyze threads in eclipse blackberry project? -

i creating multithreaded application.. drains battery. whether want check threads running , memory leaks etc.. is there tool or plugin check thread activity in eclipse blackberry application.. sorry asking here, please guide me post such questions , tell me solution this.. if you're eclipse user, blackberry java plug-in eclipse 1.3 come blackberry memory statistics view, objects view , profiler view. i've had success , 1.3.0 fixes issue debugging on actual device.

c# 3.0 - Refactoring: Extracting interface -

i refactoring existing code. i've extracted interfaces existing classes. have created separate class library holds such interfaces. problem have classes structures , enums. these classes have methods returning these structures , enums. i want extract interface these class. worried structures , enums. can't have these structures , enums extracted in interface , hence methods returning structure , enums not reflect in extraction. how can overcome situation wherein want have structure , enums in extracted interface? need break structure , have use members of interface? how can define methods returning structure in interface? structures , enums shouldn't nested- unlike classes, part of 'public contract' of type, , you'd typically extract them own files , put them in shared class library interfaces.

php - phpexcel set data type on range of cells -

with phpexcel , i'm using: $worksheet->fromarray($array) ; to set data. however, 1 column needs set string (a number leading zero, leading 0 gets cut off if not set string). if wasn't using fromarray method, set data type using phpexcel_worksheet::setcellvalueexplicit() . however, want using range of columns. ideally this: $worksheet->getcell('a1:a50')->setdatatype(phpexcel_cell_datatype::type_string); but looking @ code, getcell won't allow range, single cell. how can this? there no method in phpexcel allow set data type range of cells, individual cell. there couple of options... harder write custom cell value binder automatically sets data type cells string when cell value set fromarray(). what instead (and far easier), leave datatype number, , value numeric, set number format mask tells excel display numbers leading zeroes. $objphpexcel->getactivesheet()->getstyle('l3:n2048') ->

Spring transaction management for execution service methods from same service -

for example have bean service has 2 methods , 1 of them (testa) execute 1 (testb). public class testserviceimpl implements testservice { ... public void testa() throws exception { ... try { this.testb(); catch(exception e) { ... } ... } public void testb() throws exception { ... } } method testb defined propagation_requires_new transaction attribute, method testa defined propagation_required. <bean id="testservice" class="org.springframework.transaction.interceptor.transactionproxyfactorybean"> <property name="target" ref="testservicetarget"/> <property name="transactionmanager" ref="transactionmanager"/> <property name="transactionattributes"> <props> <prop key="testb*">propagation_requires_new, isolation_read_committed, -exception</prop> <prop

php - extend wordpress session into main domain -

i have site uses wordpress community purposes, installed under subdirectory "mysite/community" when try call wordpress functions "mysite" cannot retrieve logged user. here's sample code: require $xcart_dir . dir_community . '/wp-load.php'; wp_get_current_user(); if ( 0 == $current_user->id ) { echo "not logged in"; } else { echo "logged in"; } cookies can contain path, looking for: http://codex.wordpress.org/editing_wp-config.php#additional_defined_constants to allow cookie path on domain, use define('cookiepath',"/"); . you can set cookie domain in wp-config.php: http://codex.wordpress.org/editing_wp-config.php#set_cookie_domain use ".example.com" allow cookie subdomains of example.com.

python - PYTHONPATH missing from environment -

please me understand this. here can see have pythonpath set (it's .bashrc ) jean@klippie:~$ echo $pythonpath :/home/jean/local/lib/python2.6/site-packages but if try launch in local site-packages ignored: jean@klippie:~$ gtimelog traceback (most recent call last): file "/home/jean/bin/gtimelog", line 5, in <module> pkg_resources import load_entry_point file "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 2671, in <module> working_set.require(__requires__) file "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 654, in require needed = self.resolve(parse_requirements(requirements)) file "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 552, in resolve raise distributionnotfound(req) pkg_resources.distributionnotfound: gtimelog==0.5.0 now if manually export pythonpath value echo showed me above, not ignored: jean@klippie:~$ export pythonpath=:/home/jean/local/lib/pytho

java - Maven Eclipse plugin doesn't regard Maven failsave plugin? -

i'm using maven build project , eclipse project settings. eclipse:eclipse target generates .classpath file eclipse regarding dependencies , other project settings source directory, test source directory , on. added maven failsafe plugin , defined <testsourcedirectory>/test/integration</testsourcedirectory> beside normal (junit) test directory. test/unit -> contains junit test cases executes in maven "test" phase test/integration -> contains integration (maybe junit) test cases, executed in maven phase "integration-test". works fine eclipse plugin won't consider <testsourcedirectory> , won't add entry .claspath file :-( there way manipulate eclispe plugin add classpath entry failsafe plugin? following: <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-eclipse-plugin</artifactid> <configuration> <additional

html - How to make a table with no wrap and no horizontal scroll -

i have table 8 columns. , 3rd , 4th columns may have long texts in it. situation creates horizontal scroll. want want every column have fixed size. , dont want text inside columns wrapped , dont want have scroll bar. if column has long string example "abcdefghijklmnop" should show as possible without wrapping , without creating scroll. text seen on table may somethintg "abcdefg" actually triyng in eclipse birt. adequate if can learn how make in html , css. can adopt birt. way dont want check size of text javascript. did use css max-width? css max-width

Is this jQuery like syntax valid in Java? -

in c++, chain-able syntax invalid. builder.setmessage("are sure want exit?") .setcancelable(false) .setpositivebutton("yes", new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int id) { act.finish(); } }) .setnegativebutton("no", new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int id) { dialog.cancel(); } }); as long methods return same object, work fine. it work in c++ too, except anonymous inner classes. (which c++ doesn't support until c++0x) however, in c++, more performant return pointers , use -> operator.

Why does jQuery have undefined in its argument signature, and why does it pass window in again? -

i see jquery wrapped with... (function( window, undefined ) { ... })(window); source . i see passes in window again (my guess make accessing faster), why undefined there, , not passed in self invoking function? my guess protect jquery bozo doing... var undefined = 'defined'; in instance , undefined string 'defined' , , bad. if i'm right (always first :p), clever way of ensuring undefined always undefined . am right? can elaborate? passing window again indeed make things faster? thanks.

ejb 3.0 - Can you package an ejb interceptor in a library? -

and if how do it? i have got ejb @javax.interceptor.aroundinvoke interceptor move library reuse. moved code library fixed dependencies in maven , compiles now. on deploy following error message: 09.02.2011 14:19:48 com.sun.logging.logdomains$1 log schwerwiegend: exception while invoking class org.glassfish.ejb.startup.ejbapplication start method java.lang.runtimeexception: java.lang.classnotfoundexception: from jsr 318: enterprise javabeans, version 3.1 - ejb core contract , requirements : 20.3 packaging requirements the ejb-jar file or .war file must contain, either inclusion or by reference , class files of each enterprise bean follows: the enterprise bean class. the enterprise bean business interfaces, web service endpoint interfaces, , home , com-ponent interfaces. interceptor classes. the primary key class if bean entity bean. we .jar file contains second file “by reference” if second file named in class-path

iphone - How to store image in big size in local? -

Image
i storing image locally image store in small size. want store image in orignal size how can ? my code store image .. nsstring *myurl = [[nsstring alloc]init]; myurl =[data valueforkey:@"large_image"]; nsdata *mydata = [[[nsdata alloc] initwithcontentsofurl:[nsurl urlwithstring:myurl]] retain]; uiimage *myimage = [[[uiimage alloc] initwithdata:mydata] retain]; nsdata *imagedata = uiimagepngrepresentation(myimage); nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *documentsdirectory = [paths objectatindex:0]; // nsstring *imagename = [nsstring stringwithformat:@"image.png",documentsdirectory]; nsstring *fullpathtofile = [documentsdirectory stringbyappendingpathcomponent:imagename]; [imagedata writetofile:fullpathtofile atomically:yes]; this stored image and orignal image i doing wrong in code. reason. why happend. may because of leak ok knowledge time. :) other

Single WCF service with two basicHttpBindings https endpoints -

please help!, first of all, on same site can defined 2 https bindings? i use basichttpbinding, in single wcf service add 2 https endpoints, 1 security: <security mode="transport"> <transport clientcredentialtype="certificate" proxycredentialtype="none"/> </security> <endpoint address="https://xxx.svc" /> default port 443 other: <security mode="transportwithmessagecredential"> <transport clientcredentialtype="windows" proxycredentialtype="none" realm=""/> </security> <endpoint address="https://yyy:4430/xxx.svc" /> in servicehostingenvironment add prefix in baseaddressprefixfilters <add prefix="https://xxx.svc"/> and when try browsing service got following error: ssl settings service 'sslrequirecert' not match of iis &#

silverlight - What is the best technology for content display and ads in screens? -

i know guys think in wich best technology content display interface (ads, weather, news) screens. what i've found qt, silverlight , java fx option. there better one? prefer open-source :) (lgpl fine too) you didn't mention it, might want consider web technologies (html5, javascript). supported (by multiple vendors) , standardized, should safe bet. it's quite easy hire competent people. flash dying wouldn't bet on it. silverlight backed microsoft , adoption doesn't seem great, looks microsoft decide kill overnight. multi-platform support sub-par. qt nice i'm not sure if it's best tool want do. don't know javafx, won't comment.

routing - Rails 3 subdomain -

i publish application selected set of individuals private beta. created sub-domain task: beta.company.com. the application operates expected on workstation, when push server, application continually routes authentication page. fyi, i'm using declarative-authorization, authlogic, , passenger. routes.rb: #application controller match "/not_authorized", :to => "application#not_authorized", :as => :not_authorized #usersessions controller match "/quit", :to => "user_sessions#destroy", :as => :quit match "/authenticate", :to => "user_sessions#new", :as => :authenticate resources :user_sessions, :only => :create #users controller match "/enroll", :to => "users#new", :as => :enroll # root url root :to => "users#index" symptoms: anonymous routes (e.g. user_sessions#create, not_authorized) work expected anon. user the application ope

Does the book "JSF 2.0, the complete reference" by Ed Burns draw a good comparison between 1.2 and 2.0? -

i'm analyse , present improvements of jsf 2.0 (in comparison jsf 1.2). i'm looking book that. my first guess reference ed burns, readers' reviews start unsettle me: http://www.amazon.com/javaserver-faces-2-0-complete-reference/product-reviews/0071625097/ref=cm_cr_dp_hist_5?ie=utf8&showviewpoints=0&filterby=addfivestar will book helpful task? i'm familiar jsf 1.2, pure update backed additional information great. additionally found german book, in contrast has better reviews: of german readers recommend it? http://www.amazon.de/javaserver-faces-2-0-grundlagen-erweiterte/dp/3898646068/ref=cm_cr_pr_product_top tia, peter i own both books , have read 1.2 version more once (since used create , correct exams students based on book). i got 2.0 version while back. if want book focusses on differences between 1.2 , 2.0, might not best book although in fairness ed burns make attempt. in introduction there's 3 page overview of things new in jsf

javascript - Google Map Error -

i'm getting error google map script. i've messed setting true or false? http://cornerstonemedical.ie/contact.php in line have ...&sensor=true_or_false . set ...&sensor=true or ...&sensor=false . :-)

layout - Autoscroll on parent panel, when there is overflow on child panels.Extjs -

i'm having single parent panel, has 2 child panels. 1 has content dynamically created, while other fixed height , width. parent panel using border layout, center , east regions defined. i'm trying autoscroll trigger on parent panel when there overflow on on center region panel. i've set autoscroll option true parent panel, everytime there overflow on center panel, gets cuts off. when i'm adding overflow center region panel, scrollbar panel alone. don't need that, rather want on entire parent panel. let me know if has suggestions.. this issue result of over-nesting panels, and/or 1 or more panels in layout not having layout config specified. layout configuration code help.

MySQL 'Truncated incorrect INTEGER value' -

i'm getting odd 'truncated incorrect integer value' error when run following update query: update tbl set projectnumber = right(comments, 7) createdby = 'me' , length(convert(right(comments, 7), signed integer)) = 7 , convert(right(comments, 7), signed integer) > 0 , convert(right(comments, 7), signed integer) not null , createdon > '2011-01-31 12:00:00' , projectnumber null projectnumber varchar(10). when run straight select not error , see results expected. ideas? i'm trying update projectnumber field end of comments in imported notes 7 numeric characters (but projectnumber's not always 7 numeric, why field varchar(10)). it's not error. it's warning comes convert() when ask convert non-numeric integer; run these queries in console see: mysql> select convert(right('1s23d45678', 7), signed integer); +-------------------------------------------------+ | convert(right('1s23d45678', 7), signed

regfreecom - Reg-free COM - location of COM dll relative to client exe -

i want use reg-free com don't have register legacy com component. however, able put com dll in location not in or below directory of client exe, e.g. ....\lib. i'm not able in server manifest file doesn't allow relative or absolute paths. does know if there way round this? update: found relative paths work on xp. however, can use absolute paths on windows server 2008 using activation context api that's cool. problem com component has static dependency on managed database driver it's not finding it. i've read manifest files hoped add element com reg-free manifest pointing @ dll in same directory com dll can't work. so, in summary, have exe in 1 directory uses activation context api reference com manifest/dll in directory (that not subdirectory of exe directory) finds , loads correctly. have managed database driver dll in same directory com dll , want know how can load using manifest files - if it's possible. i've achieved running

c# - SharePoint 2010: Bad / slow browsing experience of a specific page in IE7 -

we have sharepoint 2010 site works in firefox , ie8. in ie7 of pages work fine there 1 page pretty long , has lot of controls radio buttons, checkboxlist, textboxes e.t.c. application form lot of questions. in ie7 page loads when scroll or hover on links, buttons, click on dropdown options experience slow , delay. example if hover on link takes second or 2 before pointer changes hand. certainly sounds issue specific ie7 , it's rendering engine. submit bug microsoft there's nothing stackoverflow able you.

jnlp - Java - How to get permission in Java Web Start -

hi managed create jar , .jnlp files java application running trouble when runs. launches okay java web start think need when run it doesn't ask permission access hd file i/o. would appreciate , advise know permission rights i.e. have have classes not sure. error message in java web start below. exception in thread "awt-eventqueue-0" java.security.accesscontrolexception: access denied (java.io.filepermission stockdatabase;stocks.dat read) @ java.security.accesscontrolcontext.checkpermission(unknown source) @ java.security.accesscontroller.checkpermission(unknown source) @ java.lang.securitymanager.checkpermission(unknown source) @ java.lang.securitymanager.checkread(unknown source) @ java.io.file.exists(unknown source) @ stockcodedatabase.<init>(optradersa.java:782) @ optradersa.actionperformed(optradersa.java:136) @ javax.swing.abstractbutton.fireactionperformed(unknown source) @ javax.swing.abstractbutton$handler.acti

enums - Enumeration in iphone is not working -

i developing iphone application in have 3 classes => main class , abc class, pqr class. on main view , have imageview on displaying image. when user touch @ center of image on main view , new view pushed (depending on condition mentioned below) a) if user came abc view new view not pushed b) if user came pqr view have push new view . my problem how can detect view user came main view. i create 1 class in have following code in .h file typedef enum { abcviewselected, pqrviewselected } selectedviewtype; @interface enumeration : nsobject { selectedviewtype selectedviewtype; } @property(nonatomic) selectedviewtype selectedviewtype; in . m file have @synthesize selectedviewtype; when user select table cell abcview & pqrview , pushing main view & setting view type in didselectrowatindexpath follows :- enumobj.selectedviewtype = abcviewselected; enumobj.selectedviewtype = pqrviewselected; in main view's touchbegan method co

Silverlight Large File Downloader -

i've got interesting one: ability marshal download of files - many in gigabyte region of data. i have silverlight website allows upload of large volumes of data (gigs) using following plugin: http://silverlightuploader.codeplex.com/ however, want able allow users download same data too. want able restrict amount of concurrent downloads. idea of directly controlling stream of data client via silverlight compelling - don't want directly install on machine. my question is: volume of data looking @ retrieving appropriate use webclient class (i can specify how many bytes http stream want read, can download incrementally, , put business rules round checking how many people downloading, , make wait until user count has gone down...), or can use sockets keep overhead down of http? unless there project i've not found thing! cheers in advance, matt as long download data in chunks of smaller size actual volume of total file won't matter , won't matte

multithreading - i have a process that is blocked.but one thread of this process is (not running) still executing something -

how threads library affect activity?is threads library responsible this?if is,is threads library responsible? , if can,explain me threads library.... a process can appear "blocked" if it's user interface thread waiting on routine. may thread in program, thread doing computationally intensive, , prevents user interface updating. that separate issue threading libraries, however.

git svn - How to tell which remote svn branch is a local git branch tracking? -

i'm bit confused how commit on several svn branches different local git branches. in particular, though i've read many of relates questions on topic, there's 1 specific thing nobody seems have explained far: if have few local branches, how can tell remote svn branch tracking (if any)? from this answer seems can change branch want tracking, how query it? git branch -v doesn't seem particularly helpful in (i.e. no additional information given). i've looked textual files in .git/ couldn't find in there well. git svn info gives full repository url, svn branch should appear there.

bash - Remove all occurrences of a duplicate line -

if want remove lines fields duplicated use sort -u -k n,n. keeps 1 occurrence. if want remove occurrences of duplicate there quick bash or awk way this? eg have: 1 apple 30 2 banana 21 3 apple 9 4 mango 2 i want: 2 banana 21 4 mango 2 i presort , use hash in perl v. large files going slow. try sort -k <your fields> | awk '{print $3, $1, $2}' | uniq -f2 -u | awk '{print $2, $3, $1}' remove lines duplicated (without keeping copies). if don't need last field, change first awk command cut -f 1-5 -d ' ' , change -f2 in uniq -f1 , , remove second awk command.

flex - Not sure why my program seems to be skipping some functions? -

hey there, i'm little confused actionscript i'm working on. gui, have written 4 functions times when computing taking place. these showmessage("loading text..."), disablebuttons(), clearmessage(), , enablebuttons(). work great throughout program. showmessage displays loading message, disablebuttons disables buttons no 1 can click anything, clearmessage clears loading message when job done, , enablebuttons turns them on. for reason, there 1 button click handler giving me troubles , i'm not sure why. i've set others similar (which work) 1 doesn't display message or shut off buttons. here clickhandler... private function buffer_route_clickhandler():void { showmessage("loading rbe options"); disablebuttons(); if(buffer_route.selected && rbeac.length == 0){ createrbeac(); } } and here creatrbeac function... private function createrbeac():void {

iphone - running ios4.2 app on on simulator is OK, on devices, a NIB view is blank -

i developed iphone app in xcode 3.2.5. know version of xcode comes sdk 4.2. while testing app, set active executable ipad simulator 3.2., when executable run, 1 of views in app in blank (white), uinavigationcontroller nav bar still visible though. this blank view happens 1 loaded nib file, other (working) views programmatically generated. i set ios deployment target ios 3.2 in build settings. is there reason problem? view simple, few buttons, labels , uiwebview. edit: view constructed in ib. fwiw there handful of images in view also update: i've since run app on devices (ipad 4.2 & iphone 3.1) same problem, particular view appears white. in response comments; in ib set file's owner's class view controller set viewcontroller's view root view (in case uiscrollview) connecting 'dot' uiscrollview. i don't have init method view controller, below viewdidload method. - (void)viewdidload{ [super viewdidload]; uibarbuttonitem *addbutton = [[u

imagemagick - More Efficient Method for PHP Imagick Color Replacement In PNG-24 -

i'm creating little web app people can choose colors different parts of race car. i'm using imagemagick take separate images of each part of car, recolor them (with clutimage function), , layer them on top of each other create final image. each image png-24 alpha transparency. each image same size make easier combine them. there ten layers, 6 of being recolored. problem performance bit poor; takes ten seconds render image after each color change. here's code: sample code: <?php if(isset($piece['color'])) { //make 1pixel image replace color $clut = new imagick(); $clut->newimage(1, 1, new imagickpixel("#".$piece["color"])); //change color of part $car_part->clutimage($clut); } //now need add part onto car $car->compositeimage($car_part, imagick::composite_default, 0, 0); clutimage seems might overkill task; i'm not doing gradient map, i'm replacing colored pixels solid color. yet

php - NoSQL solution for Zend Framework? -

i'm looking use nosql solution(couchdb/mongodb/etc) zend framework based site i'm building. can give me pointers on implementation or guide me somewhere me started? use-case data tagging solution tied around user management system there zend framework: zend_couch component proposal working couchdb , may in zend framework 2.0 there thread may out. zend framework , couch db

exception - CannotUnloadAppDomain Mbunit and CCNET -

our ccnet build system has been running fine since set up. moved room , changed 1 ip address on our system , getting cannotunloadappdomainexception mbunit run ncover. have checked our svn logs make sure there no changes , there aren't. has experienced before or have ideas should looking for? gallio runs tests in isolatedappdomain mode default . error indicates appdomain sandbox cannot unloaded due critical error involving resource lock, multi-thread race condition, or out of memory issue or stack overflow. you need more information diagnose root cause of problem. can do: run manually tests gallio.echo , have @ test report or @ console output. you may want run tests in isolatedprocess or local modes instead. make whole process collapse faster; may highlight underlying issue. you ask question in gallio user group .

asp.net - ASPX Website anchor link - orchard -

i made website orchard. links using no page names. link can "http://mywebsite/mainpage/subpage/product". now, on products page wanted link direct item. can use anchors this. "item 99" item 99 the link navigate item, looking this: "http://mywebsite/mainpage/subpage/product/index.aspx?#item99" but orchard has no index.aspx , when use "http://mywebsite/mainpage/subpage/product#item99" it not work. does have idea how link should when using cms/aspx/orchard ? regards <a href="#item99">item 99</a> or did misunderstand question?

Saving file to server in ColdFusion -

after doing research feel should work, not saving file images directory. <cfform name="uploadimgform" method="post" action="#cgi.path_info#?#cgi.query_string#" enctype="multipart/form-data"> <input name="txtimg" type="file" /> <input name="btnsubmit" type="submit" /> </cfform> <cfif isdefined("form.txtimg")> <cffile action="upload" filefield = "txtimg" destination="/images" accept="image/jpeg" nameconflict="makeunique"> </cfif> i plan on doing validation, simple example working first. i came across later helpful when trying rename file before upload: adobe link the destination has full path, otherwise gets sent directory relative temp directory of coldfusion. try this: <cfset destination = expandpath("images") /> <cff

iphone - Don't allow cell to be moved to another section -

how can disable user can move cells other sections? don't want show alert each time ;) thanks :d implement targetindexpathformovefromrowatindexpath delegate method: - (nsindexpath *)tableview:(uitableview *)tableview targetindexpathformovefromrowatindexpath:(nsindexpath *)sourceindexpath toproposedindexpath:(nsindexpath *)proposeddestinationindexpath { if (proposeddestinationindexpath.section != sourceindexpath.section) { //keep cell was... return sourceindexpath; } //ok move cell proposed path... return proposeddestinationindexpath; }

Oracle Database, What is an easy way to find all active db sessions (for all users) log in time (since when) using sql or em? -

oracle dbas, easy way find active db sessions (for users) log in time (since when)? checked sys view v$session , v$active_session_history, not infor want. checked on em client , em, seems no pages showing it. what, exactly, mean "active"? if mean oracle's definition of active-- session executing sql statement @ exact instant in time, think select username, status, logon_time v$session status = 'active' if have different definition of "active" or if trying determine front-end user name in three-tier application, can explain requirements bit more?

database - Password in postgres 8.3 not working -

i have installed postgres 8.3, entered test password while installation...my problem each time try access local database...each time enter password...it database connecting failed...i have tried change password via command line not work...even tried change configuration file...it not work...is there way out me make database work? reply... often people cannot connect postgres password because configured default use ident authentication local connections. try switching postgres system account , connecting username. if in without password you're configured ident. can check authentication methods in pg_hba.conf. if want switch using passwords local connections, can modify setting in pg_hba.conf. @ bottom of file there's section this: # not disable! # if change first entry need make sure # database # super user can access database using other method. # noninteractive # access databases required during automatic maintenance # (autovacuum, daily cronjob, replicati

javascript - can Ext JS do snap-to-grid for drag/drop/resize UI? -

currently planning time-line application. each elements on time line need resizable , draggable snap-to-grid positioning similar jquery ui's http://jqueryui.com/demos/draggable/#snap-to http://jqueryui.com/demos/resizable/#snap-to-grid (the snap 20x20 kinda thing) is feature available ext js? been googling around without results. can point me examples please? you may inspiration http://ext.ensible.com/deploy/dev/examples/calendar/custom-views.html edit source code on github

Complex taxonomy ORM mapping - looking for suggestions -

in project (asp.net mvc + nhibernate) have entities, lets document s, described set of custom metadata. metadata contained in structure can have multiple tags, categories etc. these terms have importance users seeking document want, has impact on views underlying data structures, database querying etc. from view side of application, interests me string values terms. ideally operate directly on collections of strings that: class metadataasseeninviews { public ilist<string> categories; public ilist<string> tags; // etc. } from model perspective, use same structure, simplest-possible orm mapping , use in queries "fetch documents metadata this". but kind of structure turn out useless if application needs perform complex database queries "fetch documents, at least one of categories in (cat1, cat2, ..., catn) or @ least one of tags in (tag1, ..., tagn) ". in case, performance reasons, use numeric keys categories , tags. so 1 can im

c# - Storing current time without milliseconds component -

i have timespan object needs hold time, without date. use datetime.now.timeofday but problem gives time in format 15:51:51.7368329 i don't want milliseconds component. how can trim out? you can either use datetime.now.hour/minute/second properties or use datetime.now.tostring("hh:mm:ss") . refer here more info: http://msdn.microsoft.com/en-us/library/zdtaw1bw.aspx

Explanation of Python namespaces -

i looking introduction python namespaces. found this tutorial good, i'm sure there more story that. the python reference contains information it's quite hard read. please explain python namespaces. in explanation please include complete examples show various uses. they're not complex. import mechanisms can complex , relative imports can bit more tricky, far actual namespaces , how they're resolved in code, tutorial seems pretty comprehensive. the language reference kind of be-all, end-all however, it's overkill starting out. if have specific questions how things work, you'll responses on here.

php - CakePHP Multiple Entry Fields w/ saveAll() HABTM multiple records Insert not saving -

i've found helpful tutorials , posts on stackoverflow topic, stuck on 1 point. everything below working with exception of habtm zip data . here code: <?php ($i = 1; $i <= 3; $i++) { // 3 fields @ time ?> <?php echo $this->form->input('plan.' . $i . '.plan_detail_id', array( 'options' => $plans_list, 'type' => 'select', 'empty' => '-- select plan detail --', 'label' => 'select plan detail' )); ?> <?php echo $this->form->input('plan.' . $i . '.monthly_cost', array('label' => 'monthly cost')); ?> <?php echo $this->form->input('plan.' . $i . '.dental_cost', array('label' => 'dental cost')); ?> <?php echo $this->form->input('plan.' . $i . '.age_id', array('label' => 'select age range', 'empty&

callback - How can I call javascript function using a foreach on a JSON object? -

my problem pretty easy understand. have json object (see code) , automatically call functions of object in order appears. . var installer = { : function() { ... } b : function() { ... } }; for(var func in installer) { fn.call(document); }; have idea why previous code doesn't work ? i'm sorry, i'm beginner in javascript. thanks in advance ! regards. you declare var func variable loop through members of installer , yet use fn.call(...) . did fn come from? should able do: installer[func].call(document) instead of fn.call(document) . also functions declared in installer object don't take arguments, yet you're passing document argument. [updated code add missing .call installer[func](document) ]

java - Sending object to Servlet throws an error I cant resolve -

i sending string applet servlet. when go output stream urlconnection exception thrown java.net.unknownserviceexception: protocol doesn't support output some background info; using eclipse, tested applet running in eclipse & in own html page made & throw same error. have downloaded correct java web sdk. maybe need set hxxp://8008... server? why happening & how can fix it? need sign applet make work? here code & have commented exception thrown: public string messageservlet() { try { urlconnection conn = connecttoservlet(); conn.setdooutput(true); outputstream out = conn.getoutputstream(); // exception thrown here: unknownserviceexception: protocol doesn't support output objectoutputstream objout = new objectoutputstream( out ); objout.writeobject( message ); objout.flush(); objout.close(); system.out.println( "1" ); // receive result servlet inputstrea

.net - ODP.NET Integrated Security Invalid Connection String Argument -

what missing? <add name="test" connectionstring="data source=test_oracle;integrated security=yes;" /> [argumentexception: 'integrated security' invalid connection string attribute] oracle.dataaccess.client.oracleconnection.parseconnectionstring() +2707 oracle.dataaccess.client.oracleconnection.set_connectionstring(string value) +533 oracle.dataaccess.client.oracleconnection..ctor(string connectionstring) +210 odp.net: oracle.dataaccess - 2.102.2.20 (i using bindingredirect version.) if take out integrated security , declare user id , password functions correctly. so, know there nothing wrong odp.net. i don't think odp has integrated security attribute: http://download.oracle.com/docs/html/e10927_01/featconnecting.htm#i1006259 but site (http://www.oracle.com/technetwork/topics/dotnet/code-154692.html) states to migrate odp.net, remove these attributes if part of microsoft oracleclient connection strin

Python module logging with eclipse -

i trying logging going across couple of different modules using logging.config.fileconfig() directory looks this: > package > source __init__.py somesource.py > test __init__.py sometests.py __init__.py inside in package.__init__.py have following: directory = 'c:/user/me/workspace/package/' logfile = 'logger.conf' logging.config.fileconfig(directory+logfile) log = logging.getlogger('package') log.info('logging initialized.') import test inside in package.test.__init__.py have log = logging.getlogger('package.test') log.info('test module started') so expected output like: logging initialized. test module started. i can run , log correctly while using eclipse using ctrl+f11. however, calling interpreter results in nothing @ all: >>> import package the log file remains empty. ideas? by default verbosity of logging in interactive interpreter sessi

jquery - Disable all input buttons on page if no PHP session exists -

i'm doing site voting system. want disable input buttons (the ability vote) if user isnt logged in (ie. session doesnt exist). how do check in php @ top of page , allow/disallow input buttons? use css or jquery? somewhere in code check if session not set: if(!isset($_session['some_key'])){ $disable = true; }else{ $disable = false; } then, in html: <input type="radio" name="" value=""<?=($disable ? " disabled=\"disabled\"" : "");?>/> vote 1 <input type="radio" name="" value=""<?=($disable ? " disabled=\"disabled\"" : "");?>/> vote 2 <input type="radio" name="" value=""<?=($disable ? " disabled=\"disabled\"" : "");?>/> vote 3 but still have check @ serverside before accept vote, if person has voted before, because form can edited post da

c# - How can I see warnings in Linqpad? -

when create c# programs in linqpad, see warnings compiler. shows error messages. how can see warnings? linqpad not full blown ide support everything.. it's ergonomic c#/vb scratchpad instantly executes c#/vb expression, statement block or program.. so feature not supported of now.

c++ - Write CSV file into vectors -

i have 8x14800 matrix has been extracted matlab csv file ("moves.mo"). need read file 14800 vectors 8 values each. can please navigate me here? so far, here: std::fstream inputfile; inputfile.open("moves.mo"); std::vector< std::vector<int>* > vectorsmoveslist; while (!inputfile.eof()) { std::string line; getline (inputfile,line); if(""!=line) { //if line nonempty std::vector<int>* mvec = new std::vector<int>(); //allocate vector vec(n) /* loop read file has go here */ } inputfile.close(); } return 0; } thank very much!!!! see split string in c++?

append part of java byte array to StringBuilder -

how append portion of byte array stringbuilder object under java? have segment of function reads inputstream byte array. want append whatever read stringbuilder object: byte[] buffer = new byte[4096]; inputstream is; // //some setup code // while (is.available() > 0) { int len = is.read(buffer); //i want append buffer[0] buffer[len] stringbuilder @ point } you should not use stringbuilder this, since can cause encoding errors variable-width encodings. can use java.io.bytearrayoutputstream instead, , convert string when data has been read: byte[] buffer = new byte[4096]; bytearrayoutputstream out = new bytearrayoutputstream(); inputstream is; // //some setup code // while (is.available() > 0) { int len = is.read(buffer); out.write(buffer, 0, len); } string result = out.tostring("utf-8"); // instance if encoding known not contain multi-byte sequences (you working ascii data, instance), using stringbuilder work.

Which is the best way to encode batch videos on server side? -

i making general question since developer , have no advance experience on video elaboration. have preparare web application purpose allow video files upload on our company server , video elaboration server, on user command. purpose of web application allow user make elaboration on video depending on user action launch web app: (server has ) convert video in different format(mp4, flv...) extact keyframes video , saves them in jpeg format possibility extract audio video automatic control of quality audio & video (black frames,silences detection) change scene detection , keyframe extraction ..... this what's bosses wanted web based application (with server support obviously), , understand first 3 points of list, rest me arabic.... my question is: best , fastest server side application works, can support multiple batch video conversions, command line (comand line php-soap-socket interaction or else..)? is suitable adobe media server batch video conversion? wh