Posts

Showing posts from April, 2015

Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

c# - Generic Type to be of class type only in java -

c# code: public class xyz<t> t : class, new() in .net can force generic of class type using above syntex. my question how can achieve same using java? in java there's no constraint allows express type must have no-arg constructor. contrary .net in java t erased @ runtime .

java - Is it possible inheritance here?Does Inner parent class extends outer child class? -

a |_a1 | |_parent.java |_child.java does parent.java inherits child.java in possible way? here , a1 packages or directories only if child has extends clause public class child extends parent{} if so, child have access public , protected members of parent . otherwise, child have access public members of parent . if files inside same directory hierarchy, not within same directory, packages not considered related, , hence members default ("package-protected") visibility not visible. relevant reading: java tutorial: controlling access members of class java tutorial: inheritance

how can I read the document using php and store database in mysql with linux? -

how can read word document using php , store in mysql database on linux? i'm using ubuntu , php5. here resources at php upload form send document server http://www.tizag.com/phpt/fileupload.php php download, how php tells browser response send treated downloadable file. http://snipplr.com/view/205/download-file/ here tips storing data in mysql database http://www.php-mysql-tutorial.com/wikis/mysql-tutorials/uploading-files-to-mysql-database.aspx start checking these out , rephrase or add detail question =)

visual c++ - How can I write a method to determine the typedef type at runtime? -

i have binary search tree want implement different types. binary search tree templated , determined using following statement: typedef desiredtype treeitemtype; // desired type of tree items i.e. string, int, person normally change desiredtype string tree of strings if want make tree of integers? i'm thinking need make method determining typdef type @ runtime don't know begin because desiredtype can variety of variable object types. ideas? it hard tell 1 line, looks use c preprocessor command #define savedesiredtype desiredtype // save previous setting #define desiredtype char* // change type ... <code> #define desiredtype savedesiredtype // restore previous setting however, think may define particular typedef once in module (object file .o). the way know create workable tree structures of variable types in c go pointer manipulation model, or add type parameter tree functions, , pointer math different sizes of types. mo

flash - Bindings UI in Actionscript 3 still the same as Actionscript 2? -

i can't see update of as3: creating bindings between ui components using actionscript http://help.adobe.com/en_us/as2lcr/flash_10.0/help.html?content=00000404.html

SessionCookies n asp.net -

i new asp.net i dont understand concept of sessioncookies what sessioncookie,what advantages of sessioncookie whats sessioncookie about, how create sessioncookie, how retreive values sessioncookies, how store values in sessioncookies. i searched in net dont clear idea sessioncookie concept can pls clarify whats sessioncookies , concepts , provide code samples if possible. thanks take @ this: http://www.codeproject.com/kb/aspnet/exploringsession.aspx

winforms - Set objects properties from string in C# -

is there way set properties of objects string. example have "fullrowselect=true" , "hoverselection=true" statements string listview property. how assign these property along values without using if-else or switch-case statments? there setproperty(propertyname,value) method or similar this? you can reflection, have @ propertyinfo class's setvalue method yourclass theobject = this; propertyinfo piinstance = typeof(yourclass).getproperty("propertyname"); piinstance.setvalue(theobject, "value", null);

java - Reading nested tags with sax parser -

i trying read xml file following tag, sax parser unable read nested tags <active-prod-ownership> <activeprodownership> <product code="3n3" component="tri_score" ordernumber="1-77305469" /> </activeprodownership> </active-prod-ownership> here code using public class loginconsumerresponseparser extends defaulthandler { // =========================================================== // fields // =========================================================== static string str="default"; private boolean in_errorcode=false; private boolean in_ack=false; private boolean in_activeprodownership= false; private boolean in_consumerid= false; private boolean in_consumeracctoken=false; public void startdocument() throws saxexception { log.e("i ","in start document"); } public void enddocument() throws saxexception { // nothing log.e("doc read", " ends here&q

c# - Retrieve URL for Action from Controller -

i calling controller action view, within controller need invoke action invoke save view network location either html or image. how retrieve url action within controller. please note need actual url, means redirectiontoaction or view() wont work. why? need pass in url contain call view. view used generate image or html document using system.windows.forms.webbrowser. .net 3.5; c#; mvc 1; i this, dirty ... leaves me dirty feeling. using(html.beginform("action", "myworkflowcontroller", new { myid = "bla", urltogenerateimage = url.action("generateimage", "myworkflowcontroller") })) i ended using mvccontrib.ui.blockrenderer convert view html instead of generating image. proceeded save html string file system location. here link further information http://www.brightmix.com/blog/how-to-renderpartial-to-string-in-asp-net-mvc/

c# - Contravariant parameters? -

this stupid question but, have method use make syntax of page little more easy read public void do(delegate method, dispatcherpriority priority = dispatcherpriority.normal) { this.window.dispatcher.begininvoke(method, dispatcherpriority.background); } then can write do(new action(() => { //dostuff() })); however, i'd move action method can write more simply: do(() => { //dostuff() })); but i'm bit sure how write contravariant parameter do method? lambdas untyped, not possible. if don't care method-arguments, appears case, why not change method signature : public void do(action method, dispatcherpriority priority = dispatcherpriority.normal) then, second sample work fine since compiler able implicitly convert lambda action . if want accept instance of any delegate-type represents method takes no arguments, you'll have stick

php - Logging without loss of time -

greetz fellows! i'm looking way log actions of cli script without losing time. did benchmarks , figured out echo ing someting after each action, script 2x slower , appending actions log file it'll 17x times slower. so, has solution? if using cli, guess can test this: your_script.php > /tmp/log.txt & inside your_script.php <? /* action */ echo date('r').some_action_1()."\n"; <-- bad # remark 1 echo date('r').some_action_2()."\n"; echo date('r'), some_action_1(), "\n"; <-- nice # remark 2 echo date('r'), some_action_2(), "\n"; ?> and monitor using tail -f /tmp/log.txt the reason remark 1 slow because function execute first, while remakr 2 not (output first)

c# - Why use this construct - PropertyChangedEventHandler handler = this.PropertyChanged? -

the article http://msdn.microsoft.com/en-us/magazine/dd419663.aspx has following code sample: public event propertychangedeventhandler propertychanged; protected virtual void onpropertychanged(string propertyname) { propertychangedeventhandler handler = this.propertychanged; if (handler != null) { var e = new propertychangedeventargs(propertyname); handler(this, e); } } my question gained introducing variable 'handler' - following code seems work fine: public event propertychangedeventhandler propertychanged; protected virtual void onpropertychanged(string propertyname) { if (propertychanged!= null) { var e = new propertychangedeventargs(propertyname); propertychanged(this, e); } } the reasoning behind local variable in multi-threaded environment, event devoid of subscribers (ie, become null) in gap between checking null , firing event. by taking local variable, avoiding potential iss

.net - Garbage collector performance on different machines -

i have large memory consumption .net 2.0 application. ussually gc handles cleaning of memory well. however, have case application installed in 2 different machines, 1 2gb of memory , 1 3gb of memory. in 3gb of memory crashes out of memory exception, while in 2gb nevers fails. .net runtime same in both machines , application installation same. possible when there more memory trigger start grabage collector not raised on time? the amount of ram has nothing amount of memory available .net program. modern operating systems provide virtual memory. on windows, typical amount of virtual memory available program bit less 2 gigabytes. there's special boot option (/3gb) increases 3 gigabytes, @ cost of taking addressable memory away operating system. doesn't work anymore on modern machines, video card tends eat addressable physical memory. isn't impossible less 2gb because of this. if machine runs 64-bit operating system you'll close 4 gigabytes if code runs

Relate JDBC connections to Oracle listener log file content -

environment various applications use jdbc connection pool: weblogic 8 (and higher) , tomcat 6 application servers, various versions of oracle database (from 9.2.0.7 10.2.0.4) on various platforms (rhel 5.5, solaris 9, solari 10 etc). i'm trying understand meaning of following entries in listener log file (notice frequency): 07-dec-2010 09:32:30 * (connect_data=(sid=<my_sid>)(cid=(program=)(host=__jdbc__)(user=<my_user>))) * (address=(protocol=tcp)(host=<my_host>)(port=59576)) * establish * <my_sid> * 0 07-dec-2010 09:32:30 * (connect_data=(sid=<my_sid>)(cid=(program=)(host=__jdbc__)(user=<my_user>))) * (address=(protocol=tcp)(host=<my_host>)(port=59578)) * establish * <my_sid> * 0 07-dec-2010 09:32:30 * (connect_data=(sid=<my_sid>)(cid=(program=)(host=__jdbc__)(user=<my_user>))) * (address=(protocol=tcp)(host=<my_host>)(port=59577)) * establish * <my_sid> * 0 07-dec-2010 09:32:30 * (connect_data=(sid=

Change Eclipse tab to correctly indent line as Emacs does -

in emacs when hit tab anywhere on line, line indent correctly (or @ least mode settings). when hit tab again move next block. when programming python helps since closing block done lowering indention level. is there way configure eclipse same? currently, have erase leading white space hit tab. this question reposting of a superuser question. try ctrl-i (cmd-i on osx) indent current line or selection inside eclipse (if you're using default key binds opposed emacs). or, if want different key bind, go appearances > general > keys , change bind correct indentation key(s) of choice

ASP.NET: Why is FormsAuthenticationTicket null after authentication timeout? -

i'm implementing authentication timeout detection mechanism per previous question , answer of mine here . i've implemented http module uses authenticaterequest event run code capture whether authentication period has expired. code below: public class authenticationmodule : ihttpmodule { #region ihttpmodule members void ihttpmodule.dispose() { } void ihttpmodule.init(httpapplication application) { application.authenticaterequest += new eventhandler(this.context_authenticaterequest); } #endregion /// <summary> /// inspect auth request... /// </summary> /// <remarks>see "how implement iprincipal" in msdn</remarks> private void context_authenticaterequest(object sender, eventargs e) { httpapplication = (httpapplication)sender; httpcontext context = a.context; // extract forms authentication cookie string cookiename = formsauthentication.formscookiename;

regex - CMake: how to get the backslash literal in Regexp replace? -

i trying replace forwardslashes backslashes. have following line of code: string(regex replace "/" "\\" sourcegroup ${sourcegrouppath} ) sourcegrouppath = a/file/path. sourcegroup variable set result to. the problem having with, "\\" part code. have tried several ways getting use backslash literal "\\" , using unicode nothing seems work. the error in cmake is: cmake error @ cmakelists.txt:41 (string): string sub-command regex, mode replace: replace-expression ends in backslash. can please me out? thanks, wouter the reason in cmake string literal, backslash escape character (just in c, java or javascript) , in regex, backslash escape character as well . so represent regex string literal, need double escaping. (that's why many "higher level" languages have regex literal notation, btw.) the string literal "\\" represents in-memory string "\" , that's invalid regex,

IIS6 cannot handle WCF json response -

i wonder if me this. have .net 3.5 wcf restful service returns json. service works fine on local machine when deploy on iis6 error: server encountered error processing request. see server logs more details. the webinvoke method , when try access service method in browser on iis6 machine prompt asks me download file (with response of request). i'm baffled when choose download , open file see json suppossed returned....strange behavior iis. any clues on this? i suspect might need edit iis 6's mime types list. have seen similar post? get iis6 serve json files (inc. post,get)?

c# - Retrieve data from dataset -

sqldataadapter da = new sqldataadapter("select studentid,studentname studentmaster studentid = '" + start + "'", conn); dataset ds = new dataset(); da.fill(ds,"studentmaster"); sqldataadapter db = new sqldataadapter("select registration_no candidate_registration studentid='" + start + "'", conn); db.fill(ds, "candidate_registration"); here 'start' textbox value of textbox in previous form i.e form2. want fetch studentname , studentid studentmaster studentid = start. table named 'studentmaster'. fill dataset studentmaster. want fetch registration_no candidate_registration studentid=start. table named 'candidate_registration'. fill dataset candidate_registration. according 'registration_no' fetched, want fetch 'courseid' 'registered_courses'. but, problem is, how access fetched 'registration_no' i.e. how put in following query: if can ta

Replace in ColdFusion spoiling SQL query -

i've got below mysql query, it's causing error, error below too. select distinct s.id id, s.auctioneer auctioneer, s.adverttype adverttype, s.saletype saletype, an.name auctioneername, st.entrycopy saletypename, at.entrycopy adverttypename, s.heading heading, sl.city city, sd.id sdid, sd.startdate startdate sales s left join saleloc sl on sl.saleid = s.id left join saledates sd on sd.saleloc = sl.id, auctioneers an, lookupcopy st, lookupcopy @ #replace(findwhere,"''","'","all")# , s.id = sd.saleid , sl.saleid = s.id , an.id = s.auctioneer , st.id = s.saletype , at.id = s.adverttype group id order startdate, auctioneername, city error database select distinct s.id id, s.auctioneer auctioneer, s.adverttype adverttype, s.saletype saletype, an.name auctioneername, st.entrycopy saletypename, at.entrycopy adverttypename, s.heading heading, sl.city city,

Android - Preference onCreateView attrs.getAttributeCount() -

how "max" attribute during oncreateview()? if can attrs.getattributecount() work solve problem. <?xml version="1.0" encoding="utf-8"?> <preferencescreen xmlns:android="http://schemas.android.com/apk/res/android" android:title="@string/livewallpaper_settings" android:key="livewallpaper_settings" > <com.example.myapp.seekbarpreference1 android:persistent="true" android:key="keyitems" android:title="items" android:defaultvalue="50" android:max="200" /> <com.example.myapp.seekbarpreference1 android:persistent="true" android:key="keyitemstwo" android:title="items two" android:defaultvalue="5" android:max="10" /> </preferencescreen&g

postgresql - Postgres Encryption of configuration files -

currently in postgres largest security hole .conf files database relies on, because access system (not database) can modify files , gain entry. because of seeking out resources on how encrypt .conf files , decrypt them during each session of database. performance not issue @ point. have resources on or has developed prototypes utilize functionality? edit since there seems confusion here asking. scenario can best illustrated on windows box following groups: 1) administrators system administrators 2) database administrators postgres administrators 3) auditors security auditors the auditors group typically needs access log files , configuration files ensure system security. however, issue comes when member of auditors group needs view postgres configuration , log files. if member decides want access database though do not have database account short task break in . how 1 go preventing this? answers such as: get better auditors quite poor can never predict people

sql - dynamic declaration/query in oracle 9i -

in oracle, given list of table names, want perform 'select column1 var1 table' statements on mass number of tables. , want columns of table. cannot declare type of var1 until query user_tab_columns returns column's type. tried declare var1 sys.anytype got ora-00932 error message such "inconsistent datatypes: expected char got char". so how can past error or how can dynamically declare variable? many thanks. craig right should declare varchar2 instad of anytype. this article jeff hunter has nice function makes easy populate variable in way won't break if data can't converted. create or replace function getdata(data in sys.anydata) return varchar2 l_varchar2 varchar2(4000); l_rc number; begin case data.gettypename when 'sys.number' l_rc := data.getnumber(l_varchar2); when 'sys.date' l_rc := data.getdate(l_varchar2); when 'sys.varchar2&

jquery - I'm looking for a clone of Google Instant that dynamically changes the page as you continue to type (autocomplete) -

i'm trying find tutorial or script has of google instant functionality hit api instead of google , displaying results domain. it's ajax autocomplete. jquery ui has built-in autocompleter that's easy work with.

javascript - Performance for appending large element/datasets to the dom -

i appending large amounts of table row elements @ time , experiencing major bottlenecks. @ moment using jquery, i'm open javascript based solution if gets job done. i have need append anywhere 0-100 table rows @ given time (it's potentially more, i'll paginating on 100). right appending each table row individually dom... loop { ..build html str... $("#mytable").append(row); } then fade them in @ once $("#mytable tr").fadein(); there couple things consider here... 1) binding data each individual table row, why switched mass append appending individual rows in first place. 2) fade effect. although not essential application big on aesthetics , animations (that of course don't distract use of application). there has way apply modest fade effect larger amounts of data. (edit) 3) major reason me approaching in smaller chunk/recursive way need bind specific data each row. binding data wrong? there better way keep track of data

c# - IIS error 0x80005006 (2147463162) -

i told had old virtual machine had same problem , fixed downloading , installing "iis develepor toolset". idea "iis developer toolset" might be? iis 7.0 this on windows 7 box trying remote webserver , setup iis. directoryentry rvd = forms_website.children.cast<directoryentry>().first(); rvd.properties["afname"].value = "default application"; 0x80005006 (2174763162) generic iis property error thrown lot of reasons. installation of toolkit may have corrected permission setting on extension, updated property in metabase, etc. not directed fix lucky 1 possible error being thrown unrelated tool set, update corrected ancillary issue.

visual studio 2008 - Moving MSTEST classes into their own folders breaks "Create Unit Tests..." -

i organize unit test classes functional areas using folders, process use organize application classes. however, "create unit tests" option in right-click menu method breaks if original target test class moved new location, presumably because code generator trying create new class of same name in root of unit tests project. i can fix problem temporarily moving original test class root of unit tests project, prior executing "create unit tests...", , move original folder when code generation complete, clumsy. is there better way manage this? this design. use same strategy of having folders split tests, , when add new unit test, vs create class in root folder. so, ended using code template (in resharper) use create new unit test class in folder. suggest same - if don't use resharper have visual studio code snippet ones found here .

Problem with deploying rails app to heroku while running "heroku create" command -

has seen problem before? when try run command "heroku create", long error directories related ruby. c:\rails\waterloop3>heroku create creating severe-samurai-489.... done created http://severe-samurai-489.heroku.com/ | git@heroku.com:severe-samurai-48 9.git c:/ruby192/lib/ruby/gems/1.9.1/gems/heroku-1.14.10/lib/heroku/helpers.rb:78:in ``': no such file or directory - git remote (errno::enoent) c:/ruby192/lib/ruby/gems/1.9.1/gems/heroku-1.14.10/lib/heroku/helpe rs.rb:78:in `block in shell' c:/ruby192/lib/ruby/1.9.1/fileutils.rb:121:in `chdir' c:/ruby192/lib/ruby/1.9.1/fileutils.rb:121:in `cd' c:/ruby192/lib/ruby/gems/1.9.1/gems/heroku-1.14.10/lib/heroku/helpe rs.rb:78:in `shell' c:/ruby192/lib/ruby/gems/1.9.1/gems/heroku-1.14.10/lib/heroku/comma nds/app.rb:265:in `create_git_remote' c:/ruby192/lib/ruby/gems/1.9.1/gems/heroku-1.14.10/lib/heroku/comma nds/app.rb:49:in `create' c:/ruby19

flex - What CSS selector do I need here? -

i'm trying center title text on alert control. i'm using following css right now: mx|alert{ text-align: center; } the problem above code centers alert content well, not title text. selector need access title of alert control? edit: i'm using 4.x sdk , spark. code: alert.show(); use titlestylename declare css class can used style title, add styles class: mx|alert { titlestylename: 'alerttitle'; } .alerttitle { text-align: center; } should work spark if i'm not wrong.

why use Google V8 -

i don't it. i'm c/c++ programmer, what's possible use of v8 me? there few examples , tutorials out there, , lack substance - don't want use library add couple of numbers or print in console window. question is: there real use technology, , if yes, scenario? also, can part of gui way? help appreciated. "v8 google's open source javascript engine" so whole point ability write code in javascript, , run quite fast (for interpreted dynamic language). google chrome, written in c++, uses internal scripting — not regular web page scripting, extension code. let's consider 'real use'. so, if app needs scripting, v8 may (js not perfect language, stil quite decent). gui, you'll need bind gui components js first, there's no built-in ui components (as tk in tcl).

oledb - c# application crashes on ShowDialog() after running oledbconnection -

i have been working on c# project connects access database, sequence of events causes crash accessviolationexception the issue comes after calling database connection using oledb in separate form savefiledialog, , calling savefiledialog1.showdialog() note: applies open file dialog. it might a bug in access database engine 2010 . use 2007 instead. connect.microsoft.com: oledb-operations-cause-accessviolationexception-during-savefiledialog codeproject: openfiledialog + oledbconnection = accessviolationexception

jQuery Validation Plugin: How to validate empty fields? -

jquery validation plugin doesn't validate required empty fields until submit clicked. there way validate inline? i need these fields validate if left empty user tabs through them. inline messages should displayed immeadiately after tabbing out of required field (onblur). $("form#checkout").validate({ rules: { nameoncard: { required: true, minlength: 2}, creditcardtype: {required: true}, cardnumber: {required: true, creditcard: true}, confemail: {equalto: "#email" }, firstname: {required:true} }, messages: { nameoncard: "enter name on card", creditcardtype: "select credit card type", cardnumber: { required: "please enter credit card number", creditcard: "not valid credit card number" } } }) this meant behaviour. purpose annoy user little possible. source: http://docs.jquery.com/plugins/validatio

flash - Streaming Video Recommendations -

i'm trying find viable option streaming flash video browsers. the setup have no server 2008/iis server using asp. our site gets somewhere in neighborhood of 1,200 hits day, , videos wouldn't watched more hundred or times day, @ most. still, said have 20gb/~100 videos various speaking engagements hour long or so, , our main goal make them streamed, users don't need wait progressive downloads jump around in video. i've read bit http streaming, , if that's doable i'd hear reliable method use; otherwise sort of server software purchase use, preferably on same server stream our videos users? here short article on http streaming . i have found adobe flash media server , reasonably affordable solution. you might want check out third company streaming hosts - depending on size of company , actual traffic expect, cost/benefit ratio of outsourcing can better when you're setting , maintaining server in-house.

mysql - SELECT-ing data from stored procedures -

i have complicated select query filters on time range, , want time range (start , end dates) specifiable using user-supplied parameters. can use stored procedure this, , return multiple-row result set. problem i'm having how deal result set afterwards. can't like: select * (call stored_procedure(start_time, end_time)) even though stored procedure select takes parameters. server-side prepared statement don't work (and they're not persistent either). suggest using temporary tables; reason that's not ideal solution 1) don't want specify table schema , seems have to, , 2) lifetime of temporary table limited invocation of query, doesn't need persist beyond that. so recap, want persistent prepared statement server-side, return result set mysql can manipulate if subquery. ideas? thanks. by way, i'm using mysql 5.0. know it's pretty old version, feature doesn't seem exist in more recent version. i'm not sure whether select-ing s

jquery - Why do these appended divs ignore their css? -

i'm appending div's jquery. , gave them size , color css. don't seem pick on css? , how can put of divs inside others here code http://jsfiddle.net/eqxzz/ your css #handler matches only id="handler" , not id="handlerxx" , should use class , class selector instead, this: '<div id="handler' + (counter) + '" class="handler">' + '</div>' (note trailing space on id removed, valid) matching css: .handler { /* styles */ } the same applies #drag -> .drag , etc. you can test here .

mysql - Movie DB - storage of Actors / actress / Tags? -

Image
creating movie db , dont idea of giving each actor/actress , each tag own row if there 10 million moives total, each has cast of atleast 20-30 people have 200-300 million rows in table. and gets more complex tags can unlimited per movie. how best store these 3 items? ideally these can modeled many many still have hundreds of millions of rows. better suggestions on storing these? using mysql. i dump in textfile need link actors between movies , analytics , allow users rate actors find movies tag, etc need use db. 10 million movies seems pretty ambitious. imdb's current statistics show have less 1.8m titles , around 3.9m people. having said that, see no problem creating table of titles, table of actors, , junction table resolve many-to-many relationship between two. same holds true tags.

android - What type of file does MediaStore.ACTION_VIDEO_CAPTURE give back? -

to capture video in android app, i'm using mediastore.action_video_capture action, extra_output specify location of new video file. how know mime type is? right assume it's “video/mp4”, there way video capture activity tell me type is? well, file type pops on sd cards 3gp . not sure encoding. as best can tell, extra_output copy of video doesn't replace 1 saved in standard location. if you're worried having correct extension, doesn't really matter...

Why do statistics get out of date so quickly in SQL Server? -

we have complex sql update query gets run few times month. of time seems run fast, on databases, takes long time. after running "update statistics" on tables involved, update runs again. set nightly task calls update statistics on tables in database. didn't seem fix problem. we're still ending having run "update statistics" manually each time. why statistics go stale quickly? here's approximately query looks like: update datatablea set datatablea.indexedcolumn1 = 123456789, datatablea.flag1 = 1 datatablea (index(ix_datatablea)) inner join groupingtablea on groupingtablea.foreignkey1 = groupingtablea.primarykey inner join lookuptablea on datatablea.foreignkey3 = lookuptablea.primarykey left outer join groupingtableb on datatablea.indexedcolumn2 = groupingtableb.indexedcolumn2 groupingtableb.indexedcolumn1 = 123456789 , datatablea.indexedcolumn1 null , datatablea.indexedcolumn2 in ( ... 300 entries here ... ) , datatablea.deleted = 0 , groupi

How to download multiple PDFs with curl in Terminal.app -

in terminal.app entered line curl -o http://print.nap.edu/pdf/0309065577/pdf_image/[1-319].pdf and in terminal says: curl: no url specified! how possible? i'm trying download bunch of successively numbered pdf files web server. if leave off -o downloads bunch of gibberish terminal window not file. doing wrong here? try curl -o file_#1.pdf 'http://foo.bar/abc/[1-319].pdf' note 2 things: (1) placeholder #1 in (2) output file name

javascript - getElementID dont work on chrome -

i have code this: parent.document.getelementbyid("test").value ="1"; but doesnt work on chrome. error is: "uncaught typeerror: cannot call method 'getelementbyid' of undefined" any apreciated in advance! :) document.getelementbyid("test").value ="1"; parent of scope (window) null

How do I access environment variables in Vala? -

how access environment variables in vala? (as above) seems simple, can't find how g_getenv() mapped vala. the answer lies in bindings file. vala uses bindings (in .vapi files) binding constructs c language. in case can grep through glib-2.0.vapi (on system in /usr/share/vala-0.10/vapi ), , you'll see bound as: unowned string? glib.environment.get_variable(string name) it can quite useful have location of core vapi files handy, because if know c name of function can grep it.

android - How to pass custom component parameters in java and xml -

when creating custom component in android asked how create , pass through attrs property constructor. it suggested when creating component in java use default constructor, i.e. new mycomponent(context); rather attempting create attrs object pass through overloaded constructor seen in xml based custom components. i've tried create attrs object , doesn't seem either easy or @ possible (without exceedingly complicated process), , accounts isn't required. my question then: efficient way of construction custom component in java passes or sets properties have otherwise been set attrs object when inflating component using xml? (full disclosure: question offshoot of creating custom view ) you can create constructors beyond 3 standard ones inherited view add attributes want... mycomponent(context context, string foo) { super(context); // foo } ...but don't recommend it. it's better follow same convention other components. make component fle

python - Numpy vectorize, using lists as arguments -

the numpy vectorize function useful, doesn't behave when function arguments lists rather scalars. example: import numpy np def f(x, a): print "type(a)=%s, a=%s"%(type(a),a) return sum(a)/x x = np.linspace(1,2,10) p = [1,2,3] f2 = np.vectorize(f) f(x,p) f2(x,p) gives: type(a)=<type 'list'>, a=[1, 2, 3] type(a)=<type 'numpy.int64'>, a=1 traceback (most recent call last): file "vectorize.py", line 14, in <module> f2(x,p) file "/usr/local/lib/python2.6/dist-packages/numpy/lib/function_base.py", line 1824, in __call__ theout = self.thefunc(*newargs) file "vectorize.py", line 5, in f return sum(a)/x typeerror: 'numpy.int64' object not iterable i understand function f works just fine without vectorize ing it, i'd know how (in general) vectorize function arguments take in lists rather scalar. your question doesn't make clear precisely output see ve

Database design to manage data from Serial Port? -

i'm writing codes capture serial port data (e.g. micrometer) , following real time display , graphing delete/modify/replace existing data focus , re-measurement, save data somewhere additional statistical analysis (e.g. in excel). out put .csv option because each measurement may capture hundreds thousands of data (measurement points), i'm not sure how shall go design database - shall create new row each data received, or shall push data array , store super long string separated comma database? such application, need server 2008 or server 2008 express sufficient. pros/cons in terms of performance? is possible create such application client won't need install sql server? to answer last question first, @ sqlite because free open source, , i'm pretty sure license null. plus nothing install users. sqlite can compiled code. to answer primary question, encourage using database if makes sense. going running queries against data, or looking store , retr

version - Getting directory listing over http -

there directory being served on net i'm interested in monitoring. contents various versions of software i'm using , i'd write script run checks what's there, , downloads newer i've got. is there way, wget or something, a directory listing. i've tried using wget on directory, gives me html. avoid having parse html document, there way of retrieving simple listing ls give? i figured out way it: $ wget --spider -r --no-parent http://some.served.dir.ca/ it's quite verbose, need pipe through grep couple of times depending on you're after, information there. looks prints stderr, append 2>&1 let grep @ it. grepped "\.tar\.gz" find of tarballs site had offer. note wget writes temporary files in working directory, , doesn't clean temporary directories. if problem, can change temporary directory: $ (cd /tmp && wget --spider -r --no-parent http://some.served.dir.ca/)

NHibernate <timestamp> mapping for Oracle database causes StaleStateException -

we have nhibernate app migrating sql server oracle. our optimistic concurrency implemented via <timestamp name="version"> mapping element. the data type of corresponding version column in oracle date . after save object, in-memory c# object left timestamp value in milliseconds (e.g. 12:34:56.789) while value in database precise second (e.g. 12:34:56). thus, if attempt save object 2nd time, stalestateexception because 2 values not match. i attempted fix altering data type of version column timestamp(3) . unfortunately, c# object , db value still off 1 millisecond (e.g. 12:34:56.789 vs 12:34:56.788), 2nd attempt save object still causes stalestateexception. what can create working <timestamp> mapping oracle column of type date or timestamp same object can saved multiple times? thanks. -- brian timestamp(7) has correct precision match .net datetime class , fixed problem.

javascript - JQueryMobile HTC Android pinch zoom -

i have 1 website jquerymobile works fine iphone android htc looks weird when zooming. same thing happens in of demo pages of jquerymobile site, half of screen becomes blank breaking site. is there way of solving or @ least disable pinch zooming android htc browsers? the problem facing caused htc non-standard android browser. cannot use viewport meta tag prevent pinch zooming. zooming causes layout recalculated (page dimensions changed) assume causing issues. unfortunately doesn't seem there solution problem @ time, affects htc phones.

How to match 2 columns in excel? -

i have excel sheet, sheet1 has 2 cols, , b. col has values , has corresponding mapping in col b(not values in have mapping in b, empty). sorting done z-a , w.r.to col a. have excel sheet, sheet2 has similar col , col b. now, want find out whether match there between col of sheet1 , col of sheet2. if matches found, values should copied onto new column. =vlookup(sheet1!l24,e24:f27,2)

python - With regards to urllib AttributeError: 'module' object has no attribute 'urlopen' -

import re import string import shutil import os import os.path import time import datetime import math import urllib array import array import random filehandle = urllib.urlopen('http://www.google.com/') #open webpage s = filehandle.read() #read print s #display #what plan once first part working #results = re.findall('[<td style="font-weight:bold;" nowrap>$][0-9][0-9][0-9][.][0-9][0-9][</td></tr></tfoot></table>]',s) #earnings = '$ ' #for money in results: #earnings = earnings + money[1]+money[2]+money[3]+'.'+money[5]+money[6] #print earnings #raw_input() this code have far. have looked @ other forums give solutions such name of script, parse_money.py, , have tried doing urllib.request.urlopen , have tried running on python 2.5, 2.6, , 2.7. if has suggestions welcome, everyone!! --matt --- edit --- tried code , worked, im thinking kind of syntax error, if sharp eye can point out, appreciative. import

c# - asp.net mvc file upload security breach -

ok apart checking file type , file size both server side how can avoid security breach during uploading of file may compromise system (basically advance hacker) . enough? . not talking special scenario simple file upload. well security 1 of major concern in application. you make sure don't store files folder publicly accessible , executable web server. use heuristics checking first few bytes of file known file formats. example common image formats have standard beginning headers might check presence of headers.

qt - How to print invalid QTime? -

i want this qtime time (25,0,0); qdebug() << time.tostring(); but invalid qtime , outputs "" can done in way other converting qtime seconds, seconds string? qtime time of day, , 25:0:0 invalid. seem want not time-of-day, duration. qt doesn't ship qduration class. it's quite simple though roll own (durations simpler dates , times, no timezones etc.).

java - How could I do face detect during recording video mode -

i want image processing work face detection or during camera under recording video mode . now can recording video , save file , transfer server. if want detect human face during recording,(i don't need algorithm , i'll take it) how can this? use kind of library ? think should use method each frame of recording video. how ? now, use "mediarecorder" capture video . surfaceview , surfaceholder : show preview screen is can give me suggestions ? thank in advance ^^ you need provide previewcallback when set camera object. more info here . that listener give pixel buffer of preview frame time time, can use perform face detect algorithm.

ASP.NET with NHibernate -

anyone know links started using nhibernate asp.net? buy book nhibernate 3.0 cookbook i have been usuing nhibernate on year , found hard going looking @ blogs, tutorials , sample apps etc. because there lot of information regarding nhibernate on web found lot of outdated, find lot of contradictions , code not work. buy book goes through how set website mappings session management , beyond. not disappointed. oh , way merry christmas well!

linux grep write output in to a file -

find . -name "*.php" | xargs grep -i -n "searchstring" >output.txt here trying write data file not happening... how appending results using >> ? find . -name "*.php" | xargs grep -i -n "searchstring" >> output.txt i haven't got linux box me right now, i'll try improvize. the xargs grep -i -n "searchstring" bothers me bit. perhaps meant xargs -i {} grep -i "searchstring" {} , or xargs grep -i "searchstring" ? since -n grep's argument give number lines, doubt needed. this way, final code be find . -name "*.php" | xargs grep -i "searchstring" >> output.txt

iphone - A view that is moving -

Image
i've no experience in making move in app. , observed effect in flickit pro. tap details view shake 1 or 2 second , stop. looks cute , user-friendly. so how can make effects this? gif moving? or other methods of cocoa touch? thanks in advance. di a high-level way [uiview beginanimations: context:] (where both parameters can null in simple case). can change properties want change of view should animated, add other "effects" ease-in/out, etc. pp. when done this, call [uiview commitanimations] , animate you. however, in case need more freedom, caanimation class (its inside quartzcore framework). also: documentation both ways (uiview / caanimation) , session 424 , 425 of 2010 wwdc.

internet explorer 7 - IE7 Negative value cuts off half the element - bug? -

i've relatively positioned 1 of elements negative 'top' , 'left' values, negative 'left' value takes element outside of 'body' width, seems fine in browsers apart ie7 cuts off. establi.sh i thought might weird bug if it's outside parent container have set z-index didn't work, thought might haslayout bug trying fix didn't work. i'm not expert on ie browsers need help. i'm thinking ie7 might choking negative left value takes outside body? thanks e7 doesn't support negative margins way want to. fortunately, can increase width of body tag, , increase left style of rest of absolute divs , accomplish same result.

forms - PHP accented characters in POST submit -

i have html form on submit.php, page encoded utf-8 (using meta tag), when form submitted process.php (via post), of variables stored in session, , page uses header: location go submit.php, uses session variables redisplay of entered information. if enter accented character, example é (&eacute), when page returns submit.php, not render character correctly, ã (&atilde) , © (&copy) instead. where should looking solve problem? i'm assuming it's server side, rendered page utf-8 (the browser confirms page utf-8 before , after submitting) solution: the string being passed through htmlentities() @ 1 point, turns out has default character encoding of iso-8859-1 answer specify 'utf-8' in function call. é being turned ~© sure-fire sign 2-byte utf-8 character @ point gets interpreted in 1-byte character set (most iso-8859-1). you need find happens, , fix it. maybe show code - maybe has idea.

javascript - jquery validator addMethod question -

working jquery validator , have quick question. i'm using addmethod define custom validation australian phone numbers based on regex. method i'd use in multiple pages, want define function in external .js file, , pop addmethod call. if use: $.validator.addmethod('phone', regexphone(value), 'please enter valid phone number'); i reference error: can't find value, if build function straight addmethod call, use parameter value. is there way add reusable function call addmethod? ta, ryan. try $.validator.addmethod('phone', regexphone, 'please enter valid phone number'); the second parameter in addmethod callback, call function regexphone. the way did called regexphone function before appending in callback.

android - SQLiteConstraintException: error code 19: constraint failed -

i'm getting exception when insert in sqlite database the following code gives me exception: mdbhelper.createuser("pablo","a","a","a","a"); the code mdbhelper (mydbadapter): private static final string user_table_create = "create table user ( email varchar, password varchar, fullname varchar, mobilephone varchar, mobileoperatingsystem varchar, primary key (email))"; public long createuser(string email, string password, string fullname, string mobilephone, string mobileoperatingsystem) { contentvalues initialvalues = new contentvalues(); initialvalues.put("email",email); initialvalues.put("password",password); initialvalues.put("fullname",fullname); initialvalues.put("mobilephone",mobilephone); initialvalues.put("mobileoperatingsystem",mobileoperatingsystem); return mdb.insert("user", null, i

javascript - Please find the error in below written code for asp+java script -

<script type=text/javascript> function abc() { return confirm('are u sure'); } </script> <asp: button id="btnsubmit" runat="server" onclick="btnsubmit_click" onclientclick="abc" text="submit/> when click button message box appears if hit cancel button still function onclick called instead should not. if write javascript code directly in tag work properly onclientclick="return abc()" the return essential bit.

need smarty function, it will change digit to words -

i need display digit word in smarty, ie., in php pass value $rank = 2 samrty $smarty->assign('rank', $rank); then, display in samrty "two". any inbuilt function there? thanks there no function this. though pretty easy make one. http://www.smarty.net/docsv2/en/plugins.tpl

How to access Sharepoint 2010 word automation services from remote server? -

basically trying access sharepoint server 2010 installed on remote machine word operations. when trying connect remote server using spsite(), throwing below exception: system.io.filenotfoundexception unhandled message=the web application @ "http://remoteserver" not found. verify have typed url correctly. if url should serving existing content, system administrator may need add new request url mapping intended application. don't know how connect remote server using spsite(). it's impossible. spsite and, generally, whole object model not support connecting remote sharepoint farm. can access local sharepoint farm.

html - Is it possible to render table at end tag -

let's have large table (a couple of thousand rows) , want whole table render fast possible. is possible somehow delay rendering of table until whole table downloaded ? otherwise width calculations after each row seem take time. when use ie without declared doctype browser seem wait until gets table’s closing tag. when declare doctype table start rendering @ once , therefore have calculate table width after each new row. don't want use table-layout:fixed since don’t want content line break shouldn’t. it seem significant time difference in ie(8)? (pagination not option) thanks! you hide table until it's loaded: <table id="poptable" style="display:none"> ... </table> <script type="text/javascript"> document.getelementbyid('poptable').style.display = ''; </script>

linux - How can I force linking with a static library when a shared library of same name is present -

suppose have file main.cpp uses sin() function defined in libmath . suppose have both libmath.a , libmath.so available in same directory. if issue command g++ -o main main.cpp -lmath default behaviour of linux link shared library libmath.so . want know there way force program link static library libmath.a without deleting or moving shared library? you'll need pass -static linker, particular libraries want. e.g.: g++ -o main main.cpp -wl,-bstatic -lmath -wl,-bdynamic

.net - C# problem with Packing the supporting files with EXE, while publishing the project -

i using visual studio 2005, (.net version 2.0+) create windows application. functionality of project matching ideal design, there 1 problem in publishing project. i use mousehover method change picture(image) used in intention make attractive ui, when hover mouse pointer on picture .. other pic loaded in-place of .. , in mouseleave method same picture retained back. now problem while debugging functionality works properly, when published, , used, window won't load image (as installed folder doesn't contain these images ) .. how bind supporting files images, text files , other files xml exe?? mean there ideal way publish project?? in project, ensure images set copy always or copy if newer on copy output folder property (f4). that should ensure when doing xcopy deploy images in right folder (you proabably need change logic finding image paths, application finds them in right directory).

iphone - Is there a NSNotification for objects that become first resoponder? -

is there nsnotification objects become first responder. nsnotification give me uitextfield cause keyboard pop up? check uitextfieldtextdidbegineditingnotification , textfield started editing in notification's object property. there're uikeyboardwillshownotification , uikeyboarddidshownotification notifications

php - How to make localhost work -

i have installed wampserver 2.0i on computer. after having done so, typed in: http://localhost it showed error. but if type in 127.0.0.1 shows wamp server homepage should show in localhost page. have not done yet. not sure happened. please help. edit c:\windows\system32\drivers\etc\hosts , place following it: 127.0.0.1 localhost

python - sequence/stack diagam for recursive function -

for code below: def printlist(l): if l: print l[0] printlist(l[1:]) i can have sequence diagram this: # non python pseudo code printlist([1,2,3]) prints [1,2,3][0] => 1 runs printlist([1,2,3][1:]) => printlist([2,3]) => we're in printlist([2,3]) prints [2,3][0] => 2 runs printlist([2,3][1:]) => printlist([3]) => in printlist([3]) prints [3][0] => 3 runs printlist([3][1:]) => printlist([]) => in printlist([]) "if l" false empty list, return none => in printlist([3]) reaches end of function , returns none => in printlist([2,3]) reaches end of function , returns none => in printlist([1,2,3]) reaches end of function , returns none so question if change code to: def printlist(l): if l: print l[0] printlist(l[1:]) print l[0] how sequence diagram change, want understand happ

jQuery e.target bubbling best practice? -

in heavy-ajax code, bind "click" body tag & act depending on $(e.target) & using $.fn.hasclass() . when click on anchor has </span> tag inside, $(e.target) equals node, , not parent anchor to. from on, have used trick ( var $t = $(e.target); ) : /** bubbling **/ if($t.get(0).tagname !== "a" && $t.get(0).tagname !== "area") { $t = $t.parent("a"); if(empty($t)) return true; //else console.log("$t.bubble()", $t); } it feels wrong somehow... have better implementation ? $.fn.live() not solve issue still returns span target. i'm looking speed (running on atom-based touch devices) & live appeared way slower (twice) : http://jsperf.com/bind-vs-click/3 in fact, @guffa pointed, using $.fn.live() solves span bubbling issue don't need event.target anymore. guess there no other "right" answer here (using bind on container). why not use live method you? $('