Posts

Showing posts from May, 2013

html - how to know about the font information in a psd file? -

i have psd , trying convert html css. thing can't determine font used in psd? how can find out font information? click on font tool (the t) , click word or phrase want, click on right side of photoshop screen , read in little font window says. this not question site, should have been posted on superuser.com @ least.

hibernate - spring 3 + jpa 2 - fully qualified class name in queries -

i've configured spring 3 + jpa 2.0. when do: em.createquery("from systemuser",systemuser.class).getresultlist(); i receive following exception : java.lang.illegalargumentexception: org.hibernate.hql.ast.querysyntaxexception: systemuser not mapped [from systemuser] @ org.hibernate.ejb.abstractentitymanagerimpl.convert(abstractentitymanagerimpl.java:1201) @ org.hibernate.ejb.abstractentitymanagerimpl.convert(abstractentitymanagerimpl.java:1147) but when type qualified class name: em.createquery("from com.aims.domain.systemuser",systemuser.class).getresultlist(); it works. configurations missed out. my persistence.xml: <?xml version="1.0" encoding="utf-8"?> <persistence-unit name="aims" transaction-type="resource_local"> <provider>org.hibernate.ejb.hibernatepersistence</provider> <properties> <property name="hibernate.dialect" value="org.hibe...

java - How to populate a dropdown on page load in jsf? -

this question has answer here: how populate options of h:selectonemenu database? 3 answers i'm new jsf, read jsf life cycle couldn't understand how achieve this? i've controller "cities" , other controller "countries". i'm going create new page, provide search functionality. showed 2 dropdowns on page (one countries , other cities), want first drop down populated on page load. please tell me controller use? cities/countries? or create new one? , how load data on page load? thanks! everyone correct, need use <f:selectitems/> example: .xhtml <h:selectonemenu> <f:selectitems value="#{mycontroller.listitems}"/> </h:selectonemenu> bean public class mycontroller{ //the list items private list<selectitem> listitems = null; public mycontroller { loadcom...

objective c - How do I add multiple columns in my table in iPhone SDK? -

how add multiple columns in table in iphone sdk? any highly appreciated. currently uitableview doesn't have support have multiple columns in table view cell. so, can not add multiple columns in uitableview. there alternates, drawing custom grids on table view cells. have @ post.. iphone multiple columns in uitableview .. link http://usxue.is-programmer.com/posts/14176.html has code..

webservice client - How to share twitter user credentials between web and mobile applications? -

our web allows user publish tweets in timeline automatically when particular actions. however, mobile app connected web, actions user in mobile app must sent web app publish correspondly tweet in user timeline. the problem user can signin or login in mobile app using twitter , user credentials must sent webapp able publish in user timeline. which best approach share user credentials between mobile app , web app? i think best way share mobile app's access token server, legal , works unless the utilization of access tokens based on same agreement user gave you that's official answer thread https://dev.twitter.com/discussions/4314 . great citation there: access tokens represent relationship between user account , application -- ip address or host of machine involved isn't relevant.

java - How to call power off,reboot dialog from application? -

i call power off,reboot, etc.. dialog same default android dialog when push power button long application. no need call directly reboot,power off, etc... application. call dialog. how call ? or how send power button key on application ? in advance. if @ source code, you'll see it's handled internally (phonewindowmanager.java , globalactions.java). there no interface whatsoever through api. in short: can't done. if have reboot permission, can reboot phone directly powermanager.reboot() , unlikely public app need functionality. wouldn't trust app reboot permission.

Drupal 6 views_embed_view ignores content filtering? -

may encountered similar issue. output view on front page of d6 site using code: <?php print views_embed_view("frontpage_news_list", "default" ); ?> yet seems way of outputting view bypasses content filtering teaser field (not view filter, filters applied teaser of node). see because don't output img's in teasers, , not shown when check preview in views ui, yet on front page images shown in view. i have view, outputs nodes of same type in "page" output, , img's hidden in teasers there, required. has encountered similar issue before? appreciate this. <?php // can use block_1, ... blocn_n or page_1,...,page_n display id print views_embed_view("frontpage_news_list", "block_1" ); // or way show view $view = views_get_viev(you_view_machine_name); $view->set_display($display_id); // $view->set_exposed_input(array('var' => $myvar)); // set exposed filters // $view->s...

java - JTextField to read chinese character -

i need read chinese character through java input fields. have installed chinese in system , have set system locale chines. type chinese character using key board in notepad. when type in application english character. how make java input fields read chinese character. please me out. how make java input fields read chinese character. perhaps has encoding of text file. if have trouble encodings, try , create files in either eclipse or openoffice, able specify encoding. if on mac, can use textedit, or (even better) bean. edit : use utf8 encoding.

.net - Clarification on Exception handling -

its understanding when exception thrown bubble call stack until handled (within try/catch block) , if never happens exception go far reach program.main() , if still not handled deemed 'unhandled exception' runtime. is correct? i've searched high , low , cannot find information agrees this? inaccuracies in i've said? its understanding when exception thrown bubble call stack until handled (within try/catch block) , if never happens exception go far reach program.main() , if still not handled deemed 'unhandled exception' runtime. your description, though not inaccurate per se, extremely incomplete; not describe happens cases with: finally blocks fault blocks catch blocks filters note last 2 clr features not exposed c# language, still exist. the control flow 3 cases plus ordinary catch blocks can quite complex. if want more complete understanding of how works, recommend thorough , close reading of christopher brumme's detaile...

objective c - iPhone: 'endInterruption' is not being called for an <AVAudioSessionDelegate> Class -

i have sound manager class implements avaudiosessiondelegate protocol, i.e. begininterruption , endinterruption methods. however, when ring phone , go app, neither method gets called , app thereafter silent. tested using both debugger , using nslog calls. the sound manager class uses openal. - my class declared so: @interface cmopenalsoundmanager : nsobject <avaudioplayerdelegate, avaudiosessiondelegate> and delegate implementations follows: - (void)begininterruption { [self setactivated:no]; } - (void)audioplayerbegininterruption { [self setactivated:no]; } - (void)endinterruption { [self setactivated:yes]; } - (void)audioplayerendinterruption { [self setactivated:yes]; } where setactivated:(bool)state contains code start , stop sound manager. - i can't see reason delegate methods not called - perhaps there forgetting when start sound manager or set audio properties etc? or blatantly missing more obvious :o any ideas appreciated!...

html - How to CSS two vertical cylinders -

Image
i want how these css? update how align cylinders on same bottom, , how add caption below them? you have split cylinder image in 3 parts: top, middle (which repeated), , bottom. this: http://img218.imageshack.us/img218/8668/tlchargement.png call them top.png, middle.png, , bottom.png, example. then need 3 html elements, 1 each part: <div class="cylinder top"></div> <div class="cylinder middle" style="height:300px"></div> <div class="cylinder bottom"></div> and css: .cylinder { width: <width of cylinder image>px; } .cylinder.top { background-image:url('top.png') no-repeat; height: <height of top image>px; } .cylinder.middle { background-image:url('middle.png') repeat-y; /* repeat vertically */ } .cylinder.bottom { background-image:url('bottom.png') no-repeat; height: <height of bottom image>px; } to change height...

Embedding a facebook application in a facebook fanpage -

was looking around one, couldn't hold of answer yet. possible embed facebook application inside facebook fan page. example on awesomephotographer page , click on games , can play facebook game on game tab in awesome photographer page. i suggest begin this: https://developers.facebook.com/docs/appsonfacebook/pagetabs/

c++ - How to store the values of element values but it is referencing final address -

when storing data array after performing parsing xml file have store in array here stores final address of xml file i.e. stores values problem values referencing 1 address used vector getting values, there possibility values without using predefined methods. my code like, while(attr){ if(!xmlstrcmp(attr->name,(const xmlchar *)"user")){ sprintf((char *)username.c_str(),"%s",attr->children->content); std::cout<<"username: "<<username.c_str()<<"\t\t"; un.push_back(username.c_str()); } if(!xmlstrcmp(attr->name,(const xmlchar *)"password")){ sprintf((char *)password.c_str(),"%s",attr->children->content); std::cout<<"password: "<<password.c_str()<<std::endl; pwd.push_back(password.c_st...

python - Is Pyro signal safe? -

i have been using pyro 3 little while now, great success, have noticed, when signal such sighup or sigint arrives while pyro doing remote communications, process hangs, hence question, pyro signal safe? thanks in advance. seems issue here default python sets handlers sigint , sigterm raise exceptions. if therfore receive signal while doing pyro comms, exception raised, , off goes appropriate except clause, not finishing doing, if try , use pyro again, example in except/finally clause, can issues. in case sending messages log via queue proxied process using pyro.

mysql group by and filtering the values in each grouped record -

i have table of users im grouping age, each user has nationality , if 1 of users nationality want value in group record, seems take first nationality finds, how can write query? one way be: select *, if(instr(group_concat('--', nationality, '--'), '--us--'), 'us', nationality) table group age; what group_concat combines nationalities of 1 age , if finds string 'us' among them, returns 'us' , otherwise returns nationality do. adds '--' in beginning , end of nationality make 'us' become '--us--'. if didn't that, query think other nationality contains consecutive characters 'us' mean us. '--' characters used internally , not shown in final result. edit: (cleaner longer) way came mind: select * (select * table nation='us' union select * table nation!='us') tmp group age; so, first select persons nationality us, selec...

design - Generic IOC resolving counterparts in other languages -

i've used methodology alot lately (c#) able decouple logic domain objects shouldn't reside inside domain object itself. find nice , clean. how accomplish same in lets java or c++, etc? java doesn't have runtime generic type information method non existent there, can 1 same methodology? example resolving menu items domain object. (could other things aswell eg. resolving validation rules etc.): class domainobject { } interface imenuitem<t> { string gettitle(t entity); action<t> itemaction; } class domainobjectmenuitem : imenuitem<domainobject> { // menu item implementation domain object } public void generateitems(object domainobject) { type type = typeof(imenuitem<>).makegeneric(domainobject.gettype()); imenuitems[] items = container.resolveall(type); // items } java has many dependency injection frameworks (leads ioc) such spring , guice. can of course code hand, noone that. instead 1 uses framework, prescribed m...

c# - Is there any difference between declare variable in/out for? -

possible duplicate: declaring variable inside or outside foreach loop: faster/better? hi all, what difference between 2 examples or there any? ex 1: for (int = 0; < 2; i++) { thread newthread = new thread( ... ); newthread.start(); } ex 2: thread newthread; (int = 0; < 2; i++) { newthread = new thread( ... ); newthread.start(); } their il codes same... in second example, can access last thread newthread , not possible in first example. one more difference: second example holds reference last thread, garbage collector can't free memory when thread finished , disposed. the new keyword allocates memory, there no difference in memory allocation (see this link ).

iphone - UIPickerView is not scrolling when added to UIScrollView! -

i have added uipickerview uiscrollview upickerview not scrolling. when add self.view scrolls smoothly. here code monthsarray = [[nsarray alloc] initwithobjects:@"jan",@"feb",@"mar",@"apr",@"may",@"jun",@"jul",@"aug",@"sep",@"oct",@"nov",@"dec",nil]; uipickerview *objpickerview = [[uipickerview alloc] initwithframe:cgrectmake(185,350,100,100)]; objpickerview.userinteractionenabled=yes; objpickerview.delegate = self; objpickerview.showsselectionindicator = yes; [objscrollview addsubview:objpickerview]; i have included delegete , methods. have on issue. in advance. if not clear please tell me. i using subclass of uipickerview same purpose, mine simpler: @implementation scrollablepickerview - (uiscrollview *)findscrollablesuperview { uiview *parent = self.superview; while ((nil != parent) && (![parent iskindofclass:[...

JAXB: How to change XJC-generated classes names when attr type is specified in XSD? -

i'm beginner jaxb , i'm having annoying issues when generating java classes xjc. provided xsd this: <xs:element name="item" type="itemtype"/> ... <xs:complextype name="itemtype"> <xs:attribute name="id" type="xs:string" use="required"> ... </xs:complextype> and xjc generating class called itemtype.java , want name item.java . is, want generated classes if xsd this: <xs:element name="item"> <xs:complextype> <xs:attribute name="id" type="xs:string" use="required"> ... </xs:complextype> </xs:element> there won't reuse of itemtype on other element, it's people constructs xsd likes way. guess there may way custom bindings still haven't found how. any help? thanks, miguel jaxb provides 2 ways accomplish this: 1. inline schema anntotations you can use jaxb...

xml - Problem with restricting the element to be non empty -

i want restrict elements non empty through schema. following doing <xs:complextype name="criteriaatt"> <xs:simplecontent> <xs:extension base="xs:string"> <xs:attribute ref="fielduri" use="required" /> <xs:attribute ref="compare" use="required" /> </xs:extension> </xs:simplecontent> and using above type in element want non empty. working fine 2 of 3 elements. third 1 simpletype element , giving me validation errors. not able understand why not working when same logic working rest of 2 elements. difference in these elements can see of complextype , simpletype. following doing simpletype element. <xs:simpletype name="thentype"> <xs:restriction base="xs:string"> <xs:minlength value="1" /> </xs:restr...

Silverlight validation with DataAnnotation -

my problem following: i have childwindow gets entity editable. i use dataannotation attributes set validation rules. my entity has name property , required attribute applied on it. if modify existing entity , clear textbox binding name property validation error name field required. but when add new entity , name property null validation doesn't work. i set name property string.empty in constructor of class , display entity in childwindow validation error showing in textbox. what best solution? can set button showing childwindow doesn't fire validation? in asp.net button control has iscausesvalidation property false button doesn't fire validation. thanks advance l, what trying achieve? validation exception won't thrown until set property via setter on underlying bound object. want validation errors displayed when user first enters data entry form? using data form? if should able validate entire form @ time of saving data e.g. pr...

tomcat - my own grails hosting -

if have server machine tomcat etc. how create hosting myself only. mean if have several sites on 1 tomcat? if possible create stable environment without needing restarting whole server when uploading new code particular application on tomcat? know impossible classic java have several sites online 24x7 if changes code on 1 of application. not easy ruby on rails right? wrong. it's quite easy redeploy running application in tomcat, , other applications not affected. the main problem classloader leaks in applications, can lead outofmemoryerror , require restart.

iphone - Detect 'bring to front' event? -

how can detect 'bring front' event background running application in iphone4 or above? - (void)applicationdidbecomeactive:(uiapplication *)application; called without either of following getting called. - (void)applicationdidfinishlaunching:(uiapplication *)application; - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions;

.net - NHibernate mapping table of tables -

i'm trying wrap nhibernate around legacy database (not created me). has can best describe "table of tables," called table_detail. looks this: column_name | table_value | table_desc -------------+-----------------+--------------------------------- state | ca | california state | ny | new york ... country | | united states country | ca | canada i'm trying map using fluent nhibernate table-per-class-hierarchy strategy. in other words, have tabledetail class, , subclasses state , country. use column_name discriminator. tabledetailmap.cs: public class tabledetailmap : classmap<tabledetail> { public tabledetailmap() { table("table_detail"); compositeid() .keyproperty(x => x.tablevalue, "table_value") .keyproperty(x => x.columnname, "column_name"); map(x => x.columnname).column("column_name")...

Batch downloads in Ruby on Rails -

i've got ruby on rails app , wondering best way do batch downloads be? @ given time i've got set of urls point files want users able download, based on search of files done users want them able download subset of files, search result, in 1 process instead of having them download them individually. set of files may potentially number in thousands. real question is, based on array of urls, how enable app download entire set @ once? of course did googling , came solution below. doesn't seem work me, did seem work posted solution similar problem. , input appreciated. # controller code def download n in 0..(@urls.length - 1) send_file(@urls[n], :type => "video/quicktime", :filename => @urls[n].basename, :disposition => "attachment") end end # view code <%= link_to 'download them all', :controller => 'my_controller', :action...

vb.net - Crystal Reports - Poor performance on ReportDocument.Load -

we're having performance problems our app crystal reports (xi) hosted in wcf-service. of performance profiler able find out call reportdocument.load taking on 10 seconds. if dig deeper, problematic point in reportclientdocumentclass.open-method, taking whole 10 seconds. we're calling load-method this: dim doc reportdocument = new crystaldecisions.crystalreports.engine.reportdocument doc.load("filename") the report file hosted on same server service. the "stack trace" reportdocument.load looks this: reportdocument.load reportclientdocumentwrapper.ensuredocumentisopened reportclientdocumentwrapper.open reportclientdocumentclass.open and mentioned above, call reportclientdocumentclass.open 1 "hanging". ideas cause this? the original problem pinpointed printers. call open-method tries connect printer used when report designed. when report deployed, printer wasn't available anymore took crystal around 15 seconds notice that....

javascript - ExtJS EditorGridPanel display Error -

i have problem ext.grid.editorgridpanel, using extjs 2.3.0, can't changed. :-( following problem: i created window consist of 2 formpanel , between them editorgridpanel. viewconfig of grid, there "forcefit=true" set , no style or view options set columnmodel. each column align option set "center". columnmodel consits of 13 columns, more or less text only. open website working on browser , open window test gui. when try switch between cells in single row entire data row moves left, first cells no more shown. after adding new row grid (via add button) view resets , cells each column displayed correctly again. column headers , tbar fixed , correctly rendered. the problem occurs iexplorer 8.0x, older firefox version (2.0x), grid works fine firefox 3.6x , safari 5.0x. if had similar problem , got fixed or idea may causes problem, feel free answer. ;-) many in advance! [edit] thx comment, here modifyed source complete source: gettypeselectiongrid: functi...

How do I create a list of filenames from a folder in C# -

i got problem when want populate array file names. the code is: string [] arrays= {}; string sdira= "path of directory"; foreach (string d in directory.getdirectories(sdira)) { foreach (string f in directory.getfiles(d, "*.*"))`enter code here` { int j = 0; array[j++] = path.getfiles(f); } } when loop through array, array contains nothing :( how fill array in case? or better solution :) solution posted on other question . eliminates need loop @ all string [] arrays; string sdira= "path of directory"; arrays = directory.getfiles(sdira, "*", searchoption.alldirectories).select(x => path.getfilename(x)).toarray(); could arrays = directory.getfiles(sdira, "*", searchoption.alldirectories) .where(s => (path.getextension(s).tolower() == extensiontype)).toarray(); if want .jpg (seemed indicated in other question) extensiontype = ".jpg"

php - Take user back to previous page after logging in? -

i have controller called accounts, views signin , signout. the corresponding functions this: function signin() { if (!empty($this->data)) { //handle login ... //save login session $this->session->write('account', $data["account"]); //redirect previous page ??? } } function signout() { //delete login $this->session->delete('account'); //redirect previous page ??? } if user goes accounts/signin first checks see if form submited if(!empty($this->data)) if yes, logs them in, if not renders signin form. if succesfully log in, want redirect them page @ before signin page. whats best way that? edit: i not think can user regular http referrer because technically referrer signin in page because go /signin , submit sign in form. @ point form submited referrer /signin . want redirect before that. make sense? http://book.cakephp.org/view/430/referer...

java - Where should logic go for deciding which SQL query to execute -

i have dao method commitmentlistdao.getlistbyownerbadge returns arraylist of commitment items against supervisor badge (database field owned_by ) string sql_view_list_by_supervisor = select_query + " c.owned_by = ? " + " order p.program_name"; now, want add pull down on web form allow user choose between owned by or tasked to i'll need add where c.tasked_to = ? clause in dao. do perform logic field search on within dao - passed in parameter of pulldown (never request object) , rename method getlistbybadge(string whichfield, string badge) or should commitmentlistform class have logic , make appropriate call either getlistbyownerbadge or getlistbytasketobadge i go dao on 2 different methods differentiate call does. the point of dao hide sql implementation details. should consider question standpoint of, "what if switched different persistence mechanism, hbase?" hbase implementation may not store in way differenti...

python - Bijective relations between ranges and some constants? -

please, move question code review -area . better suited there because know code below junk , wanted critical feedback complete rewrite. how can write set-to-constants relations in python? if a in range, return corresponding constant. [0,10] <-> ]10,77] <-> b ]77,\inf[ <-> c smelling code, bad. # bad style provsum=0 # trial 1: messy if-clauses sold in getselling(): if (sold >=0 & sold <7700): rate =0.1 else if (sold>=7700 & sold <7700): #won't correct mistakes here because shows how not things rate =0.15 else if (sold>=7700): rate =0.20 # trial 2: messy, broke because getting hard read provisions= {"0|2000":0.1, "2000|7700":0.15, "7700|99999999999999":0.20} if int(sold) >= int(border.split("|")[0]) & int(sold) < int(border.split(...

winapi - How to find a user32.dll function address from an x64 process within an x86 process? -

how find user32.dll function address x64 process within x86 process? edit: mean program runs x64, , searching x86 address. stop (trying steal focus, is). though programmers here, on side of users. the old new thing: arms race between programs , users the old new thing: pressing registered hotkey gives foreground activation love

jquery hover mouseout when form select field extends outside toggle container -

first, here html <div class='container'> <div class='toolbar'></div> <div class='element'> <a href="#"><img src=''/></a> <form> <select name='albumselect' class='albumselect'></select> </form> </div> </div> i'm using jquery when container hovered shows form, , hides on mouseout. of course problem when select field long lose hover on container element , form disappears. should test if form has focus, , if not hide form on mouseout? way around this? if have been no pain adjusted size of select box using css !

spring mvc - Handling Multipart request that is not an Action request? -

i've been thinking if possible handle multipart request not action request. there reason why seems impossible me : only actionrequest implements getfile() kind of methods. can't find easy way how file out of request other action request what if don't use html form upload file , don't want view rendered after action request - render phase happens after action phase. what if want create post request (with file(s)) ajax , use @resourcemapping handler. how out of resourcerequest ? thank thoughts. this "pattern" afaik best way of handling multipart requests action request view layer goes method: @actionmapping(params = "javax.portlet.action=sample") public void response(multipartactionrequest request, actionresponse response) { response.setrenderparameter("javax.portlet.action", "success"); list<multipartfile> filelist = request.getfiles("file"); } render phase follows : ...

entity framework - How do I singularize my tables in EF Code First? -

i prefer using singular nouns when naming database tables. in ef code first however, generated tables plural. dbsets pluralized believe ef generating names don't want singularize these names believe more pratical have them plural in code. tried overriding setting no avail. any ideas? here code , thanks. myobjectcontext.cs public class myobjectcontext : dbcontext, idbcontext { public myobjectcontext(string connstring) : base(connstring) { } public dbset<product> products {get;set;} public dbset<category> categories {get;set;} //etc. protected override void onmodelcreating(modelbuilder modelbuilder) { modelbuilder.conventions.remove<pluralizingentitysetnameconvention>(); } } you've removed wrong convention ( pluralizingentitysetnameconvention ) purpose. replace onmodelcreating method below , go. using system.data.entity.modelconfiguration.conventions.edm.db; ... protected override vo...

jquery - Fancybox iFrame content not showing -

i have been using fancybox time , appreciate functionality. using iframe function first time pull pages site developing, these pages within same domain. you can see same here: http://ee.rouviere.com/photo/portfolio if click on first thumbnail image architecture see page loads incomplete. of styling stripped out , side row of thumbnails missing. can see page pulling here: http://ee.rouviere.com/photo_portfolio the code using launch iframe is: $("a.view-preview2").fancybox({ 'framewidth' : 500, 'frameheight' : 500, 'hideoncontentclick': false }); i tried iframe example on fancybox.net , works not sure missing here. appreciated! thank you. jquery(document).ready(function() { $("a.image-preview").fancybox({ 'framewidth' : 500, 'frameheight' : 500, 'hideoncontentclick': false, ...

activerecord - count() and group() in a rails 3 query, or just use sql? -

what's rails 3 chained-method way kind of query? @jobs_by_location = employer.find_by_sql ['select count(j.id) job_count, e.* employers e, jobs j' + ' e.parent_id = ? , j.employer_id = e.id' + ' , j.status = 2' + ' group e.id' + ' order e.state_id, e.city, e.name asc', @employer.id] i came with: @jobs_by_location = employer .select('employers.*, count(jobs.id) job_count').joins(:jobs) .group('employers.id').order('employers.state_id,employers.city,employers.name asc') .where(:jobs => {:status => 2}).where(@employer.id) can tighten more? can clean order() call, , should using count() somewhere? should bother? thanks. in order clause don't need specify table unless column name ambiguous. can do .order('state_id, city, name asc') also, think meant put .where(:parent_id =...

asp.net - How to open varbinary word doc as HTML -

i have problem have not been able find answer in months. store word doc resumes varbinary(max). can retrieve resumes based on full-text search – no problem. resumes retrieved word documents in .ashx file following code. need implement hit highlighting on site users can see if returned resume fit or not. don’t think can done .ashx file, think need able open resume html in aspx page , maybe use javascript hit highlighting or perhaps return text content of word document somehow , manipulate text before display html tags. cant find anywhere addresses problem. hoping can point me in right direction. thanks in advance advice. imports system.io imports system.web imports system.data imports system.data.sqlclient   public class readresume : implements ihttphandler const constring string = "data source=tcp:sql2k804.discountasp.net;initial catalog=sql2008r2_284060_resumedata;user id=sql2008r2_284060_resumedata_user;password=mypwd2314;" public sub processrequest(byval contex...

3dsmax - 3ds max export animation to gif -

new 3ds max!. i have scene car animated prom position 1 position 2, want export top view of animation jpegs or gifs can use in 2d environment. how this? press f10, set output path, choose file type, check animation range , hit big button below says render, when in doubt press f1.

c# - Do Access Database require any database engine? -

if develop application has access database in dose needs have other thing installed on client machine dot net frame work? is there other databse easy use may small not require additional install dot net framework you use vistadb . using in several projects. it requires .net framework 2.0 or higher , 1 single dll xcopy deployable without registration/installation. the performance slower e.g. microsoft access (which requires jet ) purposes enough. another candidate microsoft sql server compact edition (ce) . database requires no installation or registration, ship additional dlls application.

How do I manually fire HTTP POST requests with Firefox or Chrome? -

i want test urls on web application i'm working on. manually create http post requests (meaning can add whatever parameters like). is there extension or functionality in chrome and/or firefox i'm missing? i have been making chrome app called postman type of stuff. other extensions seemed bit dated made own. has bunch of other features have been helpful documenting our own api here. postman has native apps (i.e. standalone) windows, mac , linux! more preferable use native apps, read more here .

c# - Calling web methods from the same web service -

i need write wrapper collection of web methods exposed in particular web service. makes sense stick new wrapper method in same service since it's affecting same type of object. most of these web methods thin methods call static methods in other files, fine, have security logic done before these static method calls. rather recreate security logic before each method call want wrap, possible call these other web methods inside same service locally, or bad practice? here's example: [webmethod] public int smallmethod1(int a) { //securitylogic return anobject.staticmethod1(); } [webmethod] public int smallmethod2(int b) { //securitylogic return anobject.staticmethod2(); } [webmethod] public int wrappermethod(int c) { return anobject.staticmethod1() + anobject.staticmethod2(); } in general want separate public interface of web service actual implementation cleanly possible, in example have done encapsulating them in anobject allows unit testin...

Rails design for database record (employment) history -

so, have rails application tracks employees. want track employment history on time. we'd able following sorts of queries: search employees current status (salary, manager, title etc.) search remployees status of particular date search employees ever matched condition we don't mind historical queries being slower, maybe 2 orders of magnitude slower. this history different audit trail - audit trail history of data, audit trail tell "what salary stored employee x on date y," won't let correct older data if wrong. [we using audit trails auditing purposes, think of logic audit trails providing orthogonal design requirement.] is there known database design pattern best implementing kind of history? or site can find discussions of various "obvious" designs , trade-offs? rails plugins? rails 2.3.5 ruby 1.8.7, if matters. i haven't used it, paper_trail claims support type of version management. seem handle requirements (1) ,...

scala - What is the difference between the methods iterator and view? -

scala> (1 10).iterator.map{_ * 2}.tolist res1: list[int] = list(2, 4, 6, 8, 10, 12, 14, 16, 18, 20) scala> (1 10).view.map{_ * 2}.force res2: seq[int] = vector(2, 4, 6, 8, 10, 12, 14, 16, 18, 20) other using next,hasnext, when should choose iterator on view or view on iterator? there's huge difference between iterators , views. iterators use once only, compute on demand, while views use multiple times, recompute each time, elements needed. instance: scala> val list = list(1,2,3).map{x => println(x); x * 2} 1 2 3 list: list[int] = list(2, 4, 6) scala> list(2) res14: int = 6 scala> list(2) res15: int = 6 scala> val view = list(1,2,3).view.map{x => println(x); x * 2} view: scala.collection.seqview[int,seq[_]] = seqviewm(...) scala> view(2) 3 res12: int = 6 scala> view(2) 3 res13: int = 6 scala> val iterator = list(1,2,3).iterator.map{x => println(x); x * 2} iterator: iterator[int] = non-empty iterator scala> iterator.drop...

Sendgrid vs Postmark vs Amazon SES and other email/SMTP API providers? -

could please comment on relative merits/drawbacks sendgrid, postmark, amazon ses, , other email providers? recommend, , why? there email service recommend instead? attached: here list of ones being talked about: amazon ses postmark sendgrid socketlabs mailjet elasticemail at end of day, when competitor amazon enters market, reach bottom. there's no way postmark or sendgrid or mailjet or postage or socketlabs or sendlabs going able compete on price. and don't think point compete on price, on features , service. postmark's roadmap bristling awesome. @ end of day customers win when there's innovation , competition in market. to answer question, postmark , others have support smtp ease integration companies using stock smtp implementation. there's insight email deliverability, being able handle dkim/spf issues you, inbound processing, etc. comes down use case, , merits of service (actual deliverability rates example). (i developer...

special characters - PHP Normalizer: Fatal error: Class 'Normalizer' not found -

i trying normalise string, gives error, fatal error: class 'normalizer' not found in c:xx.php on line xx as far understand need if want use normalizer class, $string = "löic & rené"; $normalise = normalizer::normalize($string); i have turned on php extension php_intl . there else should turn on use type of class? or have done incorrectly? i tried code php.net have same error, $char_a_ring = "\xc3\x85"; // 'latin capital letter ring above' (u+00c5) $char_combining_ring_above = "\xcc\x8a"; // 'combining ring above' (u+030a) $char_1 = normalizer::normalize( $char_a_ring, normalizer::form_c ); $char_2 = normalizer::normalize( 'a' . $char_combining_ring_above, normalizer::form_c ); echo urlencode($char_1); echo ' '; echo urlencode($char_2); any ideas? i on wamp server 2.2.11 way. thanks. you need php 5 >= 5.3.0 reason do restarted web service?

report - VB.NET 2 subreports based off of one dataset -

problem description: have iseries query in vb.net/vs 2008 need run 2 separate values of same parameter , present in report a/b comparison. in other words - want see report result of run parameter = value1 on left, same query parameter = value2 on right. my initial idea use 2 tables on report each table based on result of each run dataset (xsd), seem able specify parameters on reportviewer level, means have 2 identical tables instead of a/b cases. obvious second way create 2 separate reports, each own parameter value , them subreports onto main one. however, both subreports show "error: subreport cannot shown". there way catch error see why? i did few other experiments, have problem fact it's not "neat" solution. what best way (a.k.a. best practices, industry standard, whatever want call it) create kind of a/b report? sure there well-known method make work, surprise haven't found except multiple copies of msdn articles. to use 2 reports s...

extract substring with regex that contains a period -

i have list of names here apple.fruit appleorder2.fruit orange.fruit i want extrat fruit name expected apple apple orange i have regex (.*)((order)|(\.fruit)) that returns @ position one, apple appleorder2 orange i think \. messing alternation character because when did test using (.*)((order)|(ge)) the alternation works fine returning @ position 1 empty apple oran perl being used use lazy quantifier: (.*?)(order|\.fruit) in regex, .* first matches entire string, backtracks 1 character @ time until alternation order|\.fruit matches. since that's case after 6 backtracks already, regex engine never gets point might find other, earlier alternative. solution: tell regex engine match few characters possible adding ? quantifier.

database - Find duplicates in app engine datastore -

i've duplicated elements in datastore (not whole row, of fields on it) in app engine. what's best way find them? i've both integer , string fields duplicated (in case comparing 1 faster other). thanks! an stupid quick approach take fields care about, concatenate them long string , store them key of db_unique entity references original entity. each time db_unique.get_or_insert() should verify reference correct original entity, otherwise, have duplicate. should done in map reduce . something like: class db_unique(db.model): r = db.referenceproperty() class db_obj(db.model): = db.integerproperty() b = db.stringproperty() c = db.stringproperty() # executed each db_obj... def mapreduce(entity): key = '%s_%s_%s' % (entity.a,entity.b,entity.c) res = db_unique.get_or_insert(key, r=entity) if db_unique.r.get_value_for_datastore(res) != entity.key(): # have possible collision, verify , delete? # out 2 entities res , entity th...

sql server - How to improve SQL performance for this case? -

i issue following sql: select * mytable myid =123 , mydate >= (case when isnull(null,'')='' mydate else null end) performance pretty bad. if modify this: select * mytable myid =123 , mydate >= mydate the performance better. my real sql like: select * mytable myid =123 , mydate >= (case when isnull(@mydate,'')='' mydate else null end) mydate datetime column. how improve performance case? if t-sql then: declare @mydate datetime set @mydate = null if @mydate not null begin select * mytable myid = 123 , mydate >= @mydate end else begin select * mytable myid = 123 , mydate >= '' end else param'd sql: select * mytable myid = 123 , (@mydate null or mydate >= @mydate) edit: added not if condition.

c++ - Does memory that is allocated in a function get freed when function returns? -

i have function allocates memory using new keyword. that array gets returned function, need somehow free it. ever freed after function returns, or receiving code free array after done it? should make array member variable, , free in class destructor? it depends. need define has got ownership of such object. you can allocate array in function, return it, , let caller free it, or put pointer in class destroy pointer in destructor. if ownership such object should shared among many entities should use shared_ptr . i'd suggest use kind of smart pointer handle raw pointers.

xml - xmlhttp request and querystring parameters -

i want create bookmark send parameter querystring such author=john smith inserted rails app, have far correct? providing find out how url parameters function updatedata(param) {   var myurl = 'http://localhost:3000/app/book';   http.open("get", myurl + "?author=" + value-of-querystring-param, true);   http.onreadystatechange = usehttpresponse;   http.send(null); } that looks should work, presuming usehttpresponse handler function. one thing should encode parameter: http.open("get", myurl + "?author=" + encodeuricomponent(param), true);

set timeout Dialog in android? -

i want set timeout dialog (progress dialog) in android , make dialog disappears after period of time (if there no response action !) the same approach in this post verified work (with long instead of float): public void timerdelayremovedialog(long time, final dialog d){ new handler().postdelayed(new runnable() { public void run() { d.dismiss(); } }, time); }

html - JQuery highlight table row -

i have table row has class='highlightedrows' within html i trying use $(".highlightedrows").effect("highlight", {}, 1500); but gives me javascript error 'object not support property or method' code 0 in i.e 6 i importing effects.core.js , effects.highlight.js, because animate method won't work on table row element? thanks, ignore wan't importing file correctly... delete question i have tried , works. jquery javascript files have specified are: <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js"></script> my javascript is: $('tr').click(function(){$(this).effect("highlight", {}, 3000);}); have specified files correctly?

flexpaper - A JavaScript problem by a beginner -

good day, i've been searching google on lot of issues have , find answers here , i'm hoping give time answering stupid question. i'm beginner in javascript , happened creating personal site uses flexpaper viewer of files, , i'm wondrin' how can change url based on href users click on. here's flexpaper snippet: var swfversionstr = "10.0.0"; var xiswfurlstr = "playerproductinstall.swf"; var file = "1984.swf"; var flashvars = { swffile : escape(file), parameters here }; var params = { } parameters , attributes here swfobject.embedswf( "flexpaperviewer.swf", "flashcontent", "700", "550", swfversionstr, xiswfurlstr, flashvars, params, attributes); swfobject.createcss("#flashcontent", "display:block;text-align...

php - html5 embed mp4 video | how to know if the device is an iphone 3/3gs or 4 | mp4 dimension are too big -

i have mp4 video embedded in html5. works on every browser , on iphone4 , ipad, not on iphone 3 , 3gs, cause dimension 900px*508px. how can know in php (or replace entire video tag in javascript) on device (iphone4 or 3g/3gs) im gonna show page? thanks lot in advance! you can serve different video (with reduced size) using media attribute, e.g. <video controls> <source src="myfile.ogg" type="video/ogg"> <source src="myfile.ogg" type="video/ogg" media="(max-device-width: 300px)"> </video> you can read more here , scroll down "sending differently-compressed videos handheld devices".

Oracle/SQL Couting multiple colums grouped by a common column -

i'm yet oracle query. want do counting on multiple columns grouped common field. have half of done far. given following table thing action -------------- t1 _a_ t1 _a_ t1 _b_ t2 _a_ t2 _b_ i have query select thing, count(action) "a" <table> action = '_a_' group thing which results in thing ---------- t1 2 t2 1 what see though this thing b -------------- t1 2 1 t2 1 1 but i'm not how that. ideas? thanks! select thing, count(case action when '_a_' 1 end) a, count(case action when '_b_' 1 end) b <table> group thing or sum(case action when '_a_' 1 else 0 end) if prefer

javascript - Colorbox and Content returned via ajax -

i'm using jquery colorbox popup user accounts in window. have button loads more users page via ajax, reason users loaded ajax not popup in colorbox window. how can colorbox work content returned via ajax? function loadmore(pageno) { //$("#loading").html('loading...').show(); var url = '/search/resultsajax'; $.get(url, {page: pageno}, function(response) { $("#results").append(response); //$("#loading").hide(); }); } $(document).ready(function() { var currpage = 1; $("a.next").click(function() { loadmore(++currpage); }); $("a.usr").colorbox({width:"960px", height:"90%", iframe:true}); }); when bind colorbox in $(document).ready() this: $("a.usr").colorbox({width:"960px", height:"90%", iframe:true}); jquery go search through page, grab matches a.usr , bind colorbox items, , forget a.usr . jquer...

jquery - setting image visible area in css -

Image
i using jcarousel make image slider of logos. in image should not used background should in image tag, thats requirement. placed images in li tag. , jcarousel working fine. but here have show half of picture(sprite image [default,mouse on image]) default , on mouse on part. in css how set image position show half of picture , on mouse on half. see screenshot. thanks first, make sure li elements set overflow: hidden. then, move img's left, outside of li elements: var neg_width_of_individual_img = -35; //may need change number! $(document).ready(function(){ $('#slideshow img').hover( function(){ $(this).css('margin-left',neg_width_of_individual_img); }, function () { $(this).css('margin-left',0); } ); });

java - Convert RGB values to Integer -

so in bufferedimage , receive single integer has rgb values represented in it. far use following rgb values it: // rgbs array of integers, every single integer represents // rgb values combined in way int r = (int) ((math.pow(256,3) + rgbs[k]) / 65536); int g = (int) (((math.pow(256,3) + rgbs[k]) / 256 ) % 256 ); int b = (int) ((math.pow(256,3) + rgbs[k]) % 256); and far, works. what need figure out how integer can use bufferedimage.setrgb() , because takes same type of data gave me. i think code like: int rgb = red; rgb = (rgb << 8) + green; rgb = (rgb << 8) + blue; also, believe can individual values using: int red = (rgb >> 16) & 0xff; int green = (rgb >> 8) & 0xff; int blue = rgb & 0xff;

PHP JSON HTTP POST -

i have server accepts http post request json body , sends response in json. dont know way in php this. i need send request server json body { myname="hitesh" myphone="8008288081" } any highly appreciated. the api available in server hosted @ xyz.hitesh.com , php code hosted @ abc.test.com $requestbody = file_get_contents('php://input'); $requestbody = json_decode($requestbody); // ??? $response = array('accepted' => 'yes'); header('content-type: application/json'); echo json_encode($response);

symfony1 - in Symfony, Frontend App, Using one of Module's form on another Module -

i building project symfony. blog-like web site. need implement: writing comment every article. every comment must moderationed editors etc. everything ready. have backend, use group, perms. on. need comment form on article's show page. my question can use comment module's newsuccess temp. if yes, how? when copy , paste content of newsuccess, not working evenif conf. do know there way use comment module's form @ article module? , how can configure it? thanks spend time read -maybe answer (;- just create form in controller: public function executeshowarticle(sfwebrequest $request) { // assume weve retrieved , set $this->article $comment = new comment(); $comment->setarticle($this->article); $this->commentform = new commentform($comment); } then can use echo $commentform in template article. if customizing layout of comment form move form partial , include_partial('comment/form', array('form' => $commentform); ...

c# - How Do Email Campaign Managers Report On Bounced Emails? -

can point me in right direction how handle capturing bounced email info. i'm looking writing email campaign manager , ability report data. bounced email slang non delivery report or ndr. smtp servers have own ways handle ndr's, typically via badmail folder. so first of all, confirm smtp server software ndr's. confirm working correctly. think if email fails send, sender notified .. if sender can't notified (ie. not reply email, etc) think how ends in badmail folder. anyways - u need find out , confirm software you're using handles ndr's. once does, it's easy write code check folder every 'whatever' or put filewatcher on .. , parse content of each file added folder. hth.

visual studio 2010 - Why do IDEs stick to old code after an error? -

what ides - flash develop, flash builder, visual studio or eclipse - makes them stick old error when delete code , start afresh point out error there though there magically invisible time..even in new code. its real bugger don't know ins , outs of said ides. once make error, that's it! no matter if delete code there , make print lines on screen "error this..error that" or ominous "build failed" without giving info. well if has gone through newbie stage , know better please point out if feature these ides have , how overcome thing. have tried build clean? i've seen time time on large builds.

security - How to save some config information in an Java Applet? -

how can save configuration locally , permanently in java applet? ideally should work not signed applet. in addition alexr's methods.. .. .. run applet in new generation java plug-in (1.6.0_10+) , use jnlp api's persistenceservice serialize data. here demo. of persistenceservice .

php - How could I display a checked checkbox based from it's value in the database? -

i'm new in php, me solve problem? i'm trying display checkbox checked based on value in database. have saved value 1 if it's checked , 0 if it's not. <?php $sql = "select somecol sometable"; $result = mysql_query($sql); $row = mysql_fetch_array($result); $checked = $result['somecol']; ?> <input type="checkbox" name="somecol" value="1" <?php if ($checked == 1) echo 'checked'; ?> />

firefox4 - Has anyone successfully run a WatiN test against FireFox 4? -

it looks jssh plugin (required run watin) still needs work going firefox bug 586869 , quote: probably obvious ought trying maintain jssh, but, have "hg -r 3ca5d6674feb" , copy wherever you're going work on it. haven't found recent activity on jssh either. firefox + jssh build watin - support firefox , chrome check links - watin works firefox latest version after installing mozrepl-jsshv2.6.xpi provided fabian thanks fabian. hope watin , firewatir community embeds xpi in repo

dynamic - Double evaluation - How do I access my query column based on a variable that holds the column name? -

i have query , list of field/column names. want sort of double loop - loop through each record in query, , loop through list of field/column names , output each corresponding field. loops should this: <table> <cfoutput query="myquery"> <tr> <cfloop list="#cols#" index="col"> <td>?</td> </cfloop> </tr> </cfoutput> </table> the problem put question mark is... i've tried #myquery[col]# , didn't work. need variable indicated string name in variable col ... , obviously, #col# return column name. need figure out way double-evaluate string... ##col## , of course won't work either. how can accomplish this? when referencing column names structure, need tell query row want get. should make sure check column name exists if didn't cols variable via myquery.columnlist. use following code dynamically reference ea...

webserver - Is it possible to save an HTML file locally and then open it locally but still keep the original src and hrefs -

if find webpage want tinker , save source desktop, change couple of bits, , re-open - src , href attributes don't work relative original hosting folder eg /images/picture1.jpg or /scripts/script1.js . is there way 'trick' browser persisting these relative references? preferably without going through every 1 of them , appending path front - have tried without success. format of qualified path name these resources? let me know if i'm not being clear. <base>

Python - file to dictionary? -

i have file comprising 2 columns, i.e., 1 2 b 3 c i wish read file dictionary such column 1 key , column 2 value, i.e., d = {1:'a', 2:'b', 3:'c'} the file small, efficiency not issue. thanks, s. d = {} open("file.txt") f: line in f: (key, val) = line.split() d[int(key)] = val

php - Add Categories to Blogger with Google Api? -

i using zend google api posting blogger (blogspot) blog. can enter title , content don't know how add categories (also known "labels"). there way use zend api post blogger categories? thanks! http://groups.google.com/group/bloggerdev/browse_thread/thread/84053cb152af6423/e76330903c5061f7?lnk=gst&q=category $labels = $entry->getcategory(); $newlabel = $gdclient->newcategory('testlabel2', 'http://www.blogger.com/atom/ns#'); $labels[] = $newlabel; // append new label list of labels. $entry->setcategory($labels);

javascript - Difference between Array.length = 0 and Array =[]? -

can 1 explain conceptual difference between both of them. read somewhere second 1 creates new array destroying references existing array , .length=0 empties array. didn't work in case //declaration var arr = new array(); the below 1 looping code executes again , again. $("#dummy").load("something.php",function(){ arr.length =0;// expected empty array $("div").each(function(){ arr = arr + $(this).html(); }); }); but if replace code arr =[] in place of arr.length=0 works fine. can explain what's happening here. foo = [] creates new array , assigns reference variable. other references unaffected , still point original array. foo.length = 0 modifies array itself. if access via different variable, still modified array. read somewhere second 1 creates new array destroying references existing array that backwards. creates new array , doesn't destroy other references. var foo = [1,2,3]; var bar = [1...