Posts

Showing posts from August, 2011

java - Why does ObjectOutputStream.writeObject not take a Serializable? -

why objectoutputstream.writeobject(object o) not take serializable ? why taking object ? this because writeobject in objectoutputstream overrides the method in the objectoutput interface not require object serializable . the objectoutput interface specifies methods allow objects written stream or underlying storage, may achieved process other serialization. objectoutputstream implements functionality, requires serializable objects. however, cannot modify signature of interface implements.

php - Nginx, Wordpress and URL rewriting problems -

trying nginx , wordpress play nicely seems don't understand each other quite yet, in terms of pretty urls , rewriting. i have following snippet in config file nginx @ bottom (got nginx's wiki page on wp), , keep getting error message in error log, makes me think it's not trying rewrite location. 2011/04/11 09:02:29 [error] 1208#1256: *284 "c:/local/path/2011/04/10/hello-world/index.html" not found (3: system cannot find path specified), client: 127.0.0.1, server: localhost, request: "get /2011/04/10/hello-world/ http/1.1", host: "dev.local:83" if can give me direction or pointers or links or suggestions, amazing because i'm stuck. thanks! nginx worker_processes 1; pid logs/nginx.pid; events { worker_connections 64; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; #gzip gzip on; gzip_http_version 1.0; gzip_comp...

java - Access EJB from Application Client (project configuration) -

i know has been asked before, can't find answer so want have client application calls remote ejbs. for have 2 ear applications. 1 ear ejb module, , ear application client module. in client module trying inject in main() class ejb @ejb annotation. application.xml ejb: <?xml version="1.0" encoding="utf-8"?> <application xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:application="http://java.sun.com /xml/ns/javaee/application_5.xsd" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns /javaee/application_5.xsd" id="application_id" version="5"> <display-name> mppl4_server</display-name> <module> <ejb>mppl4_serverejb.jar</ejb> </module> </application> application.xml app-client: <application <display-name> ...

c# - Color framed text in WPF -

what approach can taken, if not built in anyway, frame text of textblock color? instance white text black borders. convert text geometry a geometry can drawn using stroke (outline) , fill (inner brush) see page examples

objective c - Monitoring End of an Item in AV Foundation Framework (Notification in wrong thread) -

when playing video avplayer ( avqueueplayer ) trying monitor when video( avplayeritem ) done playing. tried add observer avplayeritemdidplaytoendtimenotification nsnotificationcenter . don't notification. documentation tells : important: notification may posted on different thread 1 on observer registered. i know notifications posted in same thread observer registered can fetched. how suposed solve this. im registering observer om main thread since not posted notification guess because avplayeritem post notification in different thread. the documentation warns me, can't find information of how handle this. if posted notification in own code use performselectoronmainthread . it's not can modify avplayeritem class. nether see smart way of extending avplayeritem categories nor subclassing post notification in right thread.

c# - Grab innertext from an anchor serverside -

how can grab <a> inner text? there html helpers work serverside asp.net webforms? (this not mvc app) method() { string trackingnumber = database.gettrackingnumber(); extracttext(trackingnumber); } string gettrackingnumber() { return "<a href=\"#\">textineedtoextract</a>" } extracttext(string somehtml) { //need way innerhtml <a>. html not formed. } update trying avoid adding more package dependencies. can jquery used serverside handle situation? htmlagilitypack it's available nuget repository

java - Hibernate :Cannot add or update a child row: a foreign key constraint fails -

i have issue : cannot add or update child row: foreign key constraint fails ( bytecodete . company_links , constraint fk_company_links_1 foreign key ( id ) references company ( iduser ) on delete cascade on update cascade) but don't understand happens, post tables here: //user table drop table if exists `bytecodete`.`user`; create table `bytecodete`.`user` ( `id` int(11) not null auto_increment, `email` varchar(255) not null, `password` varchar(255) not null, `type` tinyint(1) unsigned not null, primary key (`id`), unique key `email` (`email`) ) //company table drop table if exists `bytecodete`.`company`; create table `bytecodete`.`company` ( `iduser` int(11) not null, `fantasyname` varchar(55) not null, `corporatename` varchar(55) not null, `cnpj` varchar(14) not null, primary key (`iduser`), unique key `cnpj` (`cnpj`), constraint `company_ibfk_1` foreign key (`iduser`) references `user` (`id`) on delete cascade on updat...

get application user's info - Facebook-GRAPH API-PHP SDK -

i need dump info of application user's using code ! $fbme = $facebook->api('/me'); $str = $fbme['name'].' '.$fbme['sex'].' '.$fbme['hometown_location'].' '.$fbme['profile_url'].'\r\n'; $fp = fopen("data.txt", "w"); fwrite($fp, $str); fclose($fp); but shows name, nothing else ! why ? you're making property names. it's not sex, it's gender. , on. read: http://developers.facebook.com/docs/reference/api/user/

.net - Entity Framework Caching with the Repository Pattern -

if want implement caching when using repository pattern , entity framework, couldn't simple logic outside of entity framework handle caching? e.g. if(cache[productskey] != null) { return converttoproducts(cache[productskey]); } else { var products = repository.products; cache[productskey] = products; return products; } it seems lot of people over-complicating this. or doing way going limiting in way? i prefer repository clean. prefer implementing caching in service layer if needed. so 100% agree sample . repository returns products (by running query) , can cache or not in other layers. p.s.: assume start object context when it's needed(session start) , dispose when session ends.

oracle10g - How to grant user access to additional tablespaces in Oracle? -

i want know how grant user access additional tablespaces in oracle? , because have created 2 additional tablespaces, 1 data , other indexes, discussion said: tablespaces in oracle i’m doing performance. greetings the old way grant quota on tablespacename username , allowed users create objects on tablespace. can still way, there more current method (which cannot recall @ moment).

How to group financial time series objects in Matlab -

i want group 2 or more financial time series objects of different length. specifically, have fts , b, shorter b, , how can time series c, c has 2 sub series , b, , missing records in filled null values. thank you. sounds merge function you're looking for.

Change From :Id in URL in Rails 3 Routing -

boy seems piece of cake, can't find in routing bible -- is there way change default parameter ':id' else ':pid' without using 'match /post/:pid'? want avoid using 'match' because feels particularly brittle. edit confirm, success if can do: pid = params[:pid] doing: pid = params[:id] works already, wrong code, because it's not id in there. you can define to_param method in model: def to_param pid end then of generated links, etc. use pid instead of id . , in controller, params[:id] give pid , not id .

xamarin.ios - Automated builds in monotouch -

i trying implement one-click build solution (without having start monodevelop ide) monotouch projects, specify provisioning profiles , code signing certificates. searched popular build tools nant, ant , maven, none seems support monotouch. has tried similar ? i've gotten work jenkins (aka hudson) . you setup jenkins server, , setup mac "slave" build server. (i used jnlp slave). from there can run command line want in build, merely have run mdtool arguments, so: /applications/monodevelop.app/contents/macos/mdtool -v build "--configuration:release|iphone" "path/to/yoursolution.sln" one thing worry sign ios app, slave process must run under user. can't create mac daemon it, you'll have run slave process in startup user , minimize it, kind of annoying.

c# - How to correctly solve this situation regarding DataContext, IDisposable and Controls.Clear() -

Image
i'm using entity framework 4 orm on windows forms application. i have series of usercontrols function if forms or areas inside mainform.cs. reason did interchange display in 'content' block of form. so when click on buttons (on left), .clear() whatever controls in 'content' block , add select form. here's relevant code: private void navigationbar_click(object sender, eventargs e) { //panelholder regular winforms panel control. panelholder.controls.clear(); switch (sender.tostring()) { case "alumnos": var studentform = new students.studentlisterform(); panelholder.controls.add(studentform); break; case "personal": var personalform = new personal.personallisterform(); panelholder.controls.add(personalform); break; case "atendencia": var...

GWT - Getting session management right -

i'm trying implement simple session management mechanism in gwt, , i'm still not quite sure if got right: first, in onmoduleload , check if sessionid cookie exists. if exists, call server see if still valid. if is, return user object contains sessionid , full username (i need within application). if doesn't exist, diplay login dialog. user enters username , password. call authenticationservice , check if username + password valid, return user object. sessionid gets stored cookie. when loggin out, delete sessionid cookie. this how sessionid gets created: string sessionid = uuid.randomuuid().tostring(); is far correct? gwt session management this might too. have gone method too, needed wider user access control. should take @ ssl. go method suits needs.

asynchronous - C# How do I pass more than just IAsyncResult into AsyncCallback? -

how pass more iasyncresult asynccallback? example code: //usage var req = (httpwebrequest)iareq; req.begingetresponse(new asynccallback(iendgetresponse), req); //method private void iendgetresponse(iasyncresult ia, bool iwantintoo) { /*...*/ } i pass in example variable bool iwantintoo . don't know how add new asynccallback(iendgetresponse) . you have use object state pass in. right now, you're passing in req parameter - can, instead, pass in object containing both , boolean value. for example (using .net 4's tuple - if you're in .net <=3.5, can use custom class or keyvaluepair, or similar): var req = (httpwebrequest)iareq; bool iwantintoo = true; req.begingetresponse(new asynccallback(iendgetresponse), tuple.create(req, iwantintoo)); //method private void iendgetresponse(iasyncresult ia) { tuple<httpwebrequest, bool> state = (tuple<httpwebrequest, bool>)ia.asyncstate; bool iwantintoo = state.item2; // use values.....

Three20 Launcher adding items help? - iPhone SDK -

i using three20 launcher homescreen feel in app. implemented basic launcher. have 2 things want accomplish. first off, user push uibutton or whatever in different view controller ttviewcontroller , item added in launcher, how this? secondly know how view user add information add own item in launcher? isn't necessary first thing. i know of , deepen knowledge in three20 launcher. just setup way view controller talk launcher, either delegation, notifications or whatever want, add item this: ttlauncheritem *item = [[ttlauncheritem alloc] initwithtitle:@"title" image:@"http://imageurl" url:@"http://url" candelete:yes]; [_launcherview additem:item animated:yes]; [item release];

ajax - jQuery aspx error function always called, even with apparently valid return data -

i making ajax call using jquery (jquery-1.5.2.min.js). server receives call. fiddler shows response text coming apparently correct. in javascript error: function called instead of success: function, , data of parameters error function don't give clue problem. here's function make initial call: function selectcbgatclickedpoint() { $.ajax( { type: "get", datatype: "text", url: "http://localhost/ajax/selectcbgatpoint/1/2", success: function( msg ) { alert( "success: " + msg ); }, error: function( jqxhr, textstatus, errorthrown ) { alert( "error: " + jqxhr + textstatus + errorthrown ); } } ); } here's function handle call in cherrypy server code: def ajax( ajax, *args ): lock: print "ajax request received: " + str( args ) cherrypy.res...

c# - What's the best approach to split app.xaml? -

i have many styles in app.xaml file , it's close 5000 lines (after formatting) it's getting harder handle comments. what's best way simplify it? splitting multiple files reference them. thanks. you can typically put of content 1 or more separate resourcedictionary.xaml files, , use merged resource dictionaries pull them app.xaml. this lets keep styles in nice, small, manageable xaml files.

How to pass a value from one frame and receive in another frame in asp.net C#? -

i have 2 content pages , use these 2 pages in third page frames in 50% 50% ratio. i want textbox value left frame transferred right frame on button click. if use session , try receive session value in 2nd web page(which right frame) won't work because right frame content page never invoked. please, can give me correct , best way solve problem. create event in frame 1 , make frame 2 have event handler. on each action in frame 1 can respond in frame 2. you can transfer data using custom class inherits eventargs. public class myeventargs : eventargs { // add fields , constructor here // initialize fields in constructor }

artificial intelligence - How to convert this sentence into a first order logic well formed formula? -

i trying convert following sentence formed formula using first-order logic(predicate logic). all towers of same color. i have defined following predicates: tower(x) :: x tower. color(x, y) :: x of color y i not able convert aforementioned sentence formed formula using above predicates. possible convert using above predicates or new predicate should required. please advise. edit: forgot add detail. there 3 available colours in world (red, green, blue). can detail used. make difference solution? there exists y1 such x tower(x) implies color(x, y1)

c# - Problems using the WMI EnableStatic method -

i'm trying create tool converts dynamic dhcp-provided ipv4 address, gateway , dns-settings static configuration. i've tried use wmi solve puzzle, have problem can't figure out. the application completes, dns , gateway configured, enablestatic method (to set ip address , subnet) has been unsuccesful means ip still received dhcp (with greyed out fields) though default gateway has been set. how fix this? the returnvalue enablestatic 70 (invalid ip address). weird thing input parameters same extracted nic 2 seconds earlier. here code (except gui), http://pastebin.com/ae3dghuz : using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.windows.forms; using system.management; namespace static_nic_settings_creator { public partial class form1 : form { private managementobjectcollection querycollection; private string[] networkinterfa...

How to generate unique (short) URL folder name on the fly...like Bit.ly -

i'm creating application create large number of folders on web server, files inside of them. i need folder name unique. can guid, want more user friendly. doesn't need speakable users, should short , standard characters (alphas best). in short: i'm looking bit.ly unique names: www.mydomain.com/abcdef is there reference on how this? platform .net/c#, ok help, references, links, etc on general concept, or overall advice solve task. start @ 1. increment 2, 3, 4, 5, 6, 7, 8, 9, a, b... a, b, c... x, y, z, 10, 11, 12, ... 1a, 1b, you idea. you have synchronized global int/long "next id" , represent in base 62 (numbers, lowercase, caps) or base 36 or something.

Working with MySQL and Xcode -

i've been programing time now, , thing asked is, how mysql database. what sites learning data base programing xcode, can make app work web site? to integrate iphone/ipad application mysql need develop webservices , call them in app. suggest use of json, soap, xml or php, examples: http://www.raywenderlich.com/2941/how-to-write-a-simple-phpmysql-web-service-for-an-ios-app http://www.icodeblog.com/2008/11/03/iphone-programming-tutorial-intro-to-soap-web-services/ http://www.devx.com/wireless/article/43209 there lot of combinations possible.... can use php or .net or other frameworks, it's hard give complete list of tutorials. if want develop regular ios application, suggest link: http://blog.iosplace.com/?p=30 hope helps.

c++ - Create a array of structs but define the size later? -

i'm trying create array of structs, define it's size later, so: struct xy{ int x; int y; }; int main(){ xy pos; int size = 10; pos = new xy[size]; pos[0].x = 5; } but can't work no matter try. don't want use vector this, please don't should. new returns pointer: int main(){ xy* pos; int size = 10; pos = new xy[size]; pos[0].x = 5; }

javascript function on a window object, when invoked, replaces that window's contents? (sometimes??) -

for reasons shall not enumerated here, i've found potentially useful attach functions window object. however, i've discovered rather weird behavior. <html><head><script> function sideeffect() { console.log("side effect happened. wewt."); } window.foo = function() { sideeffect(); return true; } window.bar = function() { sideeffect(); } </script></head> <body> <a href="javascript:window.foo();">replaces entire window "true"</a> <br /> <a href="javascript:window.bar();">doesn't</a> </body></html> why invoking function return value decide replace window's contents? happens in firefox , opera, not in ie9, chrome, or safari (all tested on win7). so question this: there sort of documentation specifies behavior? or (known) bug in ff/opera? [edit] interestingly (according answers , comments thusfar) appears abuse of window object red he...

Convert date c# -

i have date following format: 20/01/2011 7:15:28 pm i need convert like: 2011-01-20 09:24:06 how this? thanks in advance. datetime.parseexact("20/01/2011 7:15:28 pm", "dd/mm/yyyy h:mm:ss tt", cultureinfo.invariantculture) .tostring("yyyy-mm-dd hh:mm:ss")

My Webview Reloads When I Change From Portrait To Landscape -

i have simple webview runs web application on android. problem when rotate phone change landscape webview reloads , goes beginning. how can prevent action? ron beginning android 3.2 (api level 13), "screen size" changes when device switches between portrait , landscape orientation. thus, if want prevent runtime restarts due orientation change when developing api level 13 or higher (as declared minsdkversion , targetsdkversion attributes), must include "screensize" value in addition "orientation" value. is, must decalare <activity android:configchanges="orientation|screensize"> here's docs: http://developer.android.com/guide/topics/resources/runtime-changes.html

iphone - Core Data Wont Persist Property Updates to Database -

i'm working subclass of nsmanagedobject. actually, inherits class inherits class inherits nsmanagedobject (that shouldn't problem, right?). the problem after make changes properties of object, object remembers changes lifetime, changes never saved database. how know this? i know because: when restart app, changes i've made lost. telling context refresh object – after i've made changes object , told context save – sets object's values original state before made changes. when running app in simulator, can @ sqlite database file in finder, , it's modified date isn't updated when attempt save context. nothing being written database! context i'm using auto-generated delegate methods create store coordinator , context. i'm passing context view controllers in init methods, recommended in docs. store sqlite. i able insert objects database , read them. can make property changes newly inserted object , save successfully. don't see...

eclipse - Project facet jst.webfragment has not been defined after create a web project from svn repository -

i new svn. have dynamic web project developed in eclipse. server apache tomcat 6. worked fine .on local machine development environment. today, import project svn repository. below how did 1. upload whole project folder linux server 2. removed class files 3. import reset branch 4. create new eclipse workspace 5 create new project svn repository. 6. ok got 1 error, showing below project facet jst.webfragment has not been defined. used in plugin org.eclipse.jst.server.tomcat.core. what's project facet? need create one? what's right step add eclipse web project svn repository thanks heng this message indicates bug in eclipse install , not related project or svn operation. please report issue on eclipse webtools forum. make sure describe eclipse install... version is... distro started with... added... etc. http://www.eclipse.org/forums/index.php?t=thread&frm_id=88&

Is it possible to create a plugin built on top of Google Maps for Android? -

i planning small, useful, addition google maps android. wondering if create .apk file that, when installed, adds feature stock google maps android. thing have found google add-on api , although don't think want. if use above add-on api, able create stand-alone application implements google maps api... right? please give me clarity here, , let me know if i'm missing something. the google add-on api set of classes allow show google maps inside application. apps use showing map sort of marker on it. the out of box functionality limited , not feature rich google maps application. enough time , effort possibly build replacement google maps it's not simple adding on functionality. see here guide on how started using apis.

iphone - "_OBJC_CLASS_$_DBAccess", referenced from: -

trying build program , getting following error. don't see obvious. import statements seem correct: undefined symbols: "_objc_class_$_dbaccess", referenced from: objc-class-ref-to-dbaccess in locationsviewcontroller.o ld: symbol(s) not found collect2: ld returned 1 exit status this sort of problem means linker isn't finding class (if imports wrong lexing warning). check make sure project linked whatever uses dbaccess , dbaccess.m/h included in output.

arrays - Objects stuck at top of stage and won't fall down -

i using math.random randomly drop objects top of stage. had working 1 object. wanted increase number 6 objects, added following code: "stuck" , 6 objects @ top of stage. doing wrong here? appreciate help. private function bombinit(): void { roachbombarray = new array(); (var i:uint =0; < numbombs; i++) { roachbomb= new roachbomb(); roachbomb.x = math.random() * stage.stagewidth; roachbomb.vy = math.random() * 2 -1; roachbomb.y = -10; addchild(roachbomb); roachbombarray.push(roachbomb); } addeventlistener(event.enter_frame, onentry); } private function onentry(event:event):void { (var i:uint = 0; i< numbombs; i++) { var roachbomb = roachbombarray[i]; vy += ay; roachbombarray[i] += ...

jquery - Background 100% and scroll problem -

i try put background in 100% following code: html { -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-color: # f2f2f2; background-size: cover; background-attachment: fixed; background-image: url (.. / images / background.jpg); background-repeat: no-repeat; background-position: top left; } my problem when scroll scroll content choppy. tested image resize script jquery , doing research found nothing on subject, if turn off background @ 100%, scroll again fluid. problem? website: http://www.confederationcreative.ch/dcube/en/store/ i apologize vague answer, have not experienced choppiness in firefox 4, internet explorer 9, , chrome 10.0.648.208. it helps if tell browser (ie, firefox, chrome, opera, etc.) , version (ie9, firefox 4, chrome 10, opera 10, etc.). also, os using , computer specs? not matters, thought might ask.

How do you get Android Intent for showing "QuickContact"? -

i'm working on first android application, , trying intent quickcontact panel. somewhere had found mention of method quickcontact.getquickcontactintent(...) . when try use it, tells me undefined type quickcontact . after googling several days, find bunch of pages using in code, nothing how use or imports necessary or anything. how use method? need intent used launch panel. i've included following import in file: import android.provider.contactscontract.quickcontact; alternatively, other method use quickcontact intent passing expecting intent? looking pass intent in cursor livefolder provider. i developing against google apis level 9, platform number 2.3.1. thanks! use widget onupdate() , onrecieve() events communicate remoteview explained here . documented source of discussion here if want reading material. can't begin assume why you're trying intent, or how created contactcontract.quickcontact object you're referring to. little more in...

MinGW MSYS Slow -- How to make faster? -

mingw still slow year after question posted, , i've tried fix there's no difference. someone else apparently has same problem too, no fix. i'm trying compile gcc , each object file taking several seconds. (this varies wildly; it's 1 second, it's 30.) (in case, though, it's not computer; it's fine other compilers.) know why it's slow, , if there options can set improve compile time? thanks! well, msys , cygwin have slow design, or in other words hard make faster. there continuous string processing of every command passed bash shell, posix shared memory pool manually manage etc... if want build gcc on windows, suggest installing free vm software, virtualbox, install lightweight distro, , cross-compile windows toolchain. windows, use other build system autocrap (cmake, qt's qmake, ...) , speed should not issue anymore. might sound lot of hassle , complete opposite of minimal system, heck, works sooo better, , faster.

c# - Getting error while throwing a list of errors? -

in project throwing list of error messages like list<string> errormessagelist = errors[0].split(new char[] { ',' }).tolist(); throw new workflowexception(errormessagelist); and workflowexception class looks this /// <summary> /// workflowexception class /// </summary> public class workflowexception : exception { /// <summary> /// initializes new instance of workflowexception class /// </summary> /// <param name="message">error message</param> public workflowexception(list<string> message) { base.message = message; } } but getting errors while assigning list of messages base.message can me this? exception.message string , not list<string> , , it's read-only, have pass string base class via constructor chaining: public class workflowexception : exception { public workflowexception(list<string> messages) : base(messages != null &...

How to get byteArray of file when uploading in Flex 2 -

there wsdl have 1 method take bytearray & filename(which want write) parameter write file in local system, following code... public void writelocation(byte[] bytetowrite, string filename) throws filenotfoundexception { stringbuffer filelocation = new stringbuffer("d:\\products\\device"); filelocation.append("\\"+filename); file file = new file(filelocation.tostring()); bufferedoutputstream bufferwriter = new bufferedoutputstream(new fileoutputstream(file)); try { bufferwriter.write(bytetowrite); } catch (ioexception e) { system.out.println("error file writing...."); e.printstacktrace(); } { try { bufferwriter.close(); } catch (ioexception e) { e.printstacktrace(); } } } now using flex 2 & following : <mx:application xmlns:mx="http://www.adobe.com/2006/mxml" layout="a...

php - Does Zend have validator for greater than 1900 -

i have date of birth field , want add validator no 1 enters value less 1900. zend have validator can used this? see alnum don't think it's enough because doesn't set minimum. yes, greaterthan .............

android - Gallery captures trackball navigation -

the gallery traps trackball/dpad navigation horizontally. here's example layout buttons on either side of gallery: <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" xmlns:android="http://schemas.android.com/apk/res/android"> <button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <gallery android:layout_height="match_parent" android:id="@+id/gallery" android:layout_width="match_parent" android:layout_weight="1" /> <button android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </linearlayout> when navigate gallery trackball ca...

ruby - why irb plugins not loaded in rails console session? -

i have installed both awsome print & hirb irb plugins ruby 1.9.2 through rvm. can able access irb session. when tried rails console, got error ruby-1.9.2-p180 :001 > require "hirb" loaderror: no such file load -- hirb what reason? you have add hirb gemfile .

Gmail import contacts functionality in magento frontend -

how import gmail contacts in magento frontend? no extension provided yet contacts gmail . can try updating 1 of following or build own want. provide functionalities send mail google. magento connect . magento smtp, gmail , google apps email magento extension .

aop - Using Unity 2.0 handle exception -

when use unity 2.0 handle exception, got problem, below: public class tracebehavior : iinterceptionbehavior { public ienumerable<type> getrequiredinterfaces() { return type.emptytypes; } public imethodreturn invoke(imethodinvocation input, getnextinterceptionbehaviordelegate getnext) { console.writeline(string.format("invoke method:{0}",input.methodbase.tostring())); imethodreturn result = getnext()(input, getnext); if (result.exception == null) { console.writeline("invoke successful!"); } else { console.writeline(string.format("invoke faild, error: {0}", result.exception.message)); result.exception = null; } return result; } public bool willexecute { { return true; } } } i have set result.exception=null (it's meaning have resolved exception , need not throw again.) however,it throw exception ...

javascript - get text area and text field data - jquery -

i have 2 text areas in page as; <input type="text" id="a1"/> <textarea id="b2"></textarea> <a id="button">button</a> when user click button link, want alert data entered in a1 , b2 . how can this?? here there demo thanks in advance... :) blasteralfred $(document).ready(function() { $('#button').click(function(e) { e.preventdefault(); alert($('#a1').val()); alert($('#b2').val()); }); });

Regex Replace A Variable Within Brackets, Including Brackets -

how rid of variable within square brackets, including brackets themselves? e.g. [152] or [153] or [154]. using yahoo pipes. you can escape brackets (like other character special meaning) \ . s/\[\d+\]/replacement/ in yahoo pipes should work like: replace \[.+\] with (leave blank) . maybe have check g flag.

aspose cells - How to import a segment of html into Excel -

requirement: 1.i need export table excel file. 2.i render in html page @ first. have button export html. my opinion: 1.i html page: document.getelementbyid('content').value = document.getelementbyid('containerid').innerhtml; form1.submit(); 2.i server, response.contenttype = "application/vnd.ms-excel;" // need client has installed microsoft excel. 3.i got right excel file "xxxx.xls". 4.but but, when open it, it's alert waring tell me "it's not right format of excel, confirm open it?" i'm feel sorry see it. so want import html section excel file, response right excel file user-agent. i have use aspose.cells library in project, don't know how use finish task, or other solution solve ? if need parse html tags/portion excel spreadsheet using aspose.cells .net, may use cell.htmlstring attribute set desired html code segment in cell, parsed accordingly in generated excel file. mind you, not ...

xml - if else for ant script -

hi current have ant script: <target name="cleanup snapshots" description="cleanup truecm snapshots"> <echo>executing: ${truecm_app}\ssremove.exe -h${truecm_host} "${truecm_new_ss}"</echo> <exec executable="${truecm_app}\ssremove.exe" failonerror="${truecm_failon_exec}"> <arg line="-h ${truecm_host}"/> <arg line='-f "${truesase}/${product_version}/${name}"'/> </exec> </target> what script execute ssremove.exe parameters shown. however, script above valid when parameter ${product_version} contains word "extensions" example 6.00_extensions else if dont contain "extensions" script should this: <target name="cleanup snapshots" description="cleanup truecm snapshots"> <echo>executing: ${truecm_app}\ssremove.exe -h${truecm_host}...

php variable scope -

i'm confused php variable scope. such as: while(true){ $var = "yes , test!"; } printf($var) the $var defined in while statement scope , how outside it's scope ? , can't find explanation on document . i wonder how php deal it's scope . if while(true) not out of while, wouldn't matter. if have real expression, ( this useless example, know ) $i=0 while($i<10){ $var = "yes , test!"; $i++; } printf($var); will work. there no special "while" variable scope, printf print string. check : http://php.net/manual/en/language.variables.scope.php

c# - Memory Leak when using DirectorySearcher.FindAll() -

i have long running process needs lot of queries on active directory quite often. purpose have been using system.directoryservices namespace, using directorysearcher , directoryentry classes. have noticed memory leak in application. it can reproduced code: while (true) { using (var de = new directoryentry("ldap://hostname", "user", "pass")) { using (var mysearcher = new directorysearcher(de)) { mysearcher.filter = "(objectclass=domain)"; using (searchresultcollection src = mysearcher.findall()) { } } } } the documentation these classes leak memory if dispose() not called. have tried without dispose well, leaks more memory in case. have tested both framework versions 2.0 , 4.0 has run before? there workarounds? update: tried running code in appdomain, , didn't seem either. as strange may be, seems memory leak occurs if don...

database - How to efficiently utilize 10+ computers to import data -

we have flat files (csv) >200,000,000 rows, import star schema 23 dimension tables. biggest dimension table has 3 million rows. @ moment run importing process on single computer , takes around 15 hours. long time, want utilize 40 computers importing. my question how can efficiently utilize 40 computers importing. main worry there lot of time spent replicating dimension tables across nodes need identical on nodes. mean if utilized 1000 servers importing in future, might slower utilize single one, due extensive network communication , coordination between servers. does have suggestion? edit: the following simplification of csv files: "avalue";"anothervalue" "bvalue";"evenanothervalue" "avalue";"evenanothervalue" "avalue";"evenanothervalue" "bvalue";"evenanothervalue" "avalue";"anothervalue" after importing, tables this: dimension_table1 id na...

objective c - IOS: Weird color in UIView transition : UIViewAnimationOptionTransitionCurlDown -

Image
i'm @ loss here, trying use uiviewanimationoptiontransitioncurldown on view has transparency, , here result (visually), code below. want transition happen without weird shadow. insight why shadow displaying helpful. happens during animation. [uiview transitionwithview:sender duration:15.0f options:uiviewanimationoptiontransitioncurldown animations:^{ [self modifycontentofpagewith:sender]; } completion:nil]; i tried same piece of code. downloaded yellow sticky image web , realized actual size of image bigger active image. shade of whole image during animation. cut (invisible) borders of image fit yellow part , , magically, worked perfect.

asp.net mvc 2 - Send generic JSON data to MVC2 Controller -

i have javascript client going send json-formatted data set of mvc2 controllers. client format json, , controller have no prior knowledge of how interpret json model. so, can't cast controller method parameter known model type, want grab generic json , pass factory of sort. my ajax call: function sendobjectasjsontoserver(object,url,idforresponsehtml) { // make call server process object var jsonifiedobject = json.stringify(object); $.ajax({ url: url // set caller , datatype: 'json' , data: jsonifiedobject , type: 'get' , error: function(data) { alert('error in sendobjectasjsontoserver:' + data); } , success: function(data) { alert(data.message); // note data parsed object } }); } my mvc controller: public actionresult saveform(string obj) { // ok, try saving object string rc = passjsontosomething(obj.tostring()); string me...

form.radio button in rails -

how select , create radio button in rails 3 when using database records id name selected 1 abc false 2 efg true 3 hij false 4 klm false the above display on form 4 radio buttons using form_for , need use f.radio_button each group... how achieve 1 selected thanks fetch records database in @records in view file <% @records.each |row| %> <br><%= radio_button_tag 'field_name', row.name, row.selected %> <%= row.name.humanize %> <% end %>

winapi - Can i use a 32 Bit ODBC Driver for my 64 Bit app -

i have win32 application makes odbc-connections. connect using sqldriverconnect() displays dialog select data source. in x64-version dialog shows , offers 2 different 32 bit ms access drivers. when select 1 of these, in 32 bit version see open file dialog select .mdb file. in 64 bit version call sqldriverconnect() @ point returns -1. sqlerror() returns: "[microsoft][odbc driver manager] data source name not found , no default driver specified" is in general possible use 32 bit odbc driver 64-bit executable? why these driver shown? far can find there no 64 bit ms access obdc driver far. can do? you absolutely cannot mix 32bit application , 64bit driver (or vice-versa). basically, odbc driver is, typically, dll (windows) or shared object (linux...) loaded parent application. all executables, dlls, etc share same process space must same bit'ness...

internet explorer - Sporadic error downloading data from PHP application -

Image
a php application offering binary data download: header("content-type: application/octet-stream"); header("pragma: public"); header("cache-control: private"); header("content-disposition: attachment; filename=\"$filename\""); header("expires: 0"); set_time_limit(0); ob_clean(); flush(); @readfile($completefilename); exit; $completefilename stream " ftp://user:pwd@ ..." the size of data can several mbyte. works fine, sporadically following error: it's remote stream down, or times out. also @fab says file trying load larger script's memory. you should start logging errors readfile() returns, e.g. using error_log php.ini directive . if needs foolproof, think you'll have use more refined readfile() allows set timeout (like curl , or readfile stream context options ). you catch errors occur while downloading, , serve locally hosted fallback document instead....

dictionary - The list with most elements -

i have list dictionary elements. each dictionary has entry called type. type field represents list. simplest/pythonic way of obtaining list elements? programmes_by_type = [] programmes_by_type.append({'type' : [1, 2, 3]}) programmes_by_type.append({'type' : [2, 5]}) programmes_by_type.append({'type' : [3]}) programmes_by_type.append({'type' : [11, 2, 6, 7]}) given previous example should return [11, 2, 6, 7] list. max([option['type'] option in programmes_by_type], key=len)