Posts

Showing posts from March, 2011

html anchor works only once -

html anchor works only once - i ashamed have anchor issue. so have code: <a name="map"></a> $("div.store_list").click(function() { //do stuff location.href = location.href + '#map' }); when doing first click works fine. , url changes to: http://mydomain.local/stores#map second click url changes next , doesn't work: http://mydomain.local/stores#map#map any suggestions? thanks try location.hash instead, e.g. location.hash='#map' html anchor

Eclipse/IntelliJ failing to connect to network? -

Eclipse/IntelliJ failing to connect to network? - i've installed ubuntu 11.04 , wanted install eclipse grails back upwards home project. installed springsource tool suite, noticed when seek view available extensions kept on giving me "connect timeout" problems. after tinkering network settings, couldn't resolve thought i'd go , download eclipse indigo , install sts site. however, noticed version of eclipse has same problem - can't connect update sites, not indigo update site. in 1 instance, managed connect view available packages, when selected few download, failed. being desperate, install intellij (10.5.1), experienced same problem. what puzzling don't have proxy, i'm doing home! also, can access update sites browser without problem whatsoever. googled , found posts talking similar issues, people connecting through proxy. firewall disabled can't either.. here logs, hope shed more lite someone: from intellij: 2011-07-10 22:...

Maximum OpenGL FrameBuffer Object size limit? -

Maximum OpenGL FrameBuffer Object size limit? - i working on opengl application on laptop. app shows lots of black , white unrecognizable patterns when seek display monochrome image (quite large). have hunch old geforce go 7950 gtx (512 mb) old app, , thinking problem due framebuffer object size limit - there way find out largest fbo can be? there no maximum limit framebuffer size in opengl. limit largest texture or renderbuffer can attach it. there maximum viewport size, using gl_max_viewport_dims, according opengl specs, viewport silently clamped max size anyway , shouldn't cause glitches. https://www.opengl.org/sdk/docs/man/html/glviewport.xhtml opengl framebuffer

ios - Should I keep app state in core data? -

ios - Should I keep app state in core data? - i seek create app stopwatch feature , having confusing points. first, proper way maintain state of stopwatch (start, pause, stop). should maintain state in core info ? second, created core info entity date property maintain start time. should delete entity each time stopwatch reset or maintain in separate record ? coredata heavy handed want unless want maintain lots of different records in specific ways nsuserdefaults fine, persistent unless delete app this tutorial good. if had 2 variables time_started , time_ended, you'd time between , write them userdefaults. if want maintain record of multiple entries utilize loop increments count or index. dont have time @ mo write code tutorial , might find nsuserdefaults better. hope helps ios core-data

.net - Reading from DB and Writing to File -

.net - Reading from DB and Writing to File - scenario - there huge info in database. utility uses datareader read records 1 1 , appends txt/xml file. utility used read 1 record, write file; changed around 10k records read , set memory (stringbuilder) , flushed file , on. time reduction superb. so, guess file i/o bottleneck. want improve further. thinking utilize kind of buffer, , utilize 1 thread read db , set buffer, , thread fetch buffer , write file. is possible. start? improve alternatives? a starting point using 2 buffers, , asynchronously writing buffer content file. like: buffera bufferb currentbuffer=buffera fill currentbuffer info kickoff job write currentbuffer file wait previous write job finish, if relevant. currentbuffer=otherbuffer repeat until complete. .net asp.net visual-studio file-io

php - Whole variable including question mark and equals sign in preg_match -

php - Whole variable including question mark and equals sign in preg_match - i have code: $uri = $_server["request_uri"]; if (preg_match("/smda/", $uri)) { echo "whatever; } which catches url contains "smda". want narrow url contains src=smda. right in thinking code this? $uri = $_server["request_uri"]; if (preg_match("/src=smda/", $uri)) { echo "whatever; } proper , easy 1 is if (isset($_get['src']) && $_get['src'] == 'smda') { echo "whatever"; } php preg-match

c# - SharpSVN connection rate limit to localhost? -

c# - SharpSVN connection rate limit to localhost? - we utilize sharpsvn programmatically access svn repositories. have problem access local repositories via svn:// or http:// urls slow - every access needs @ to the lowest degree 1 second, , our app needs fetch bunch of properties , directory listings. we reproduce problem on 2 different machines, both windows 7 32 bit , in same domain. svn servers visualsvn 2.1.9 http:// urls , collabnet 1.6.17 svn:// urls. appears connections via "localhost" , via host name. appears in our c# application, little testbed app using ironpython , when calling sharpsvn svn.exe command. this problem not happen when accessing when accessing remote repositories (both linux , windows xp server) - here, each access between 0.01 , 0.08 secs, expected due network latency. problem not happen when acessing local repositories via file:// urls or when accessing repositories via "native" svn command line tools collabnet. now question ...

java - How can print multiple pdf files by reading from source and send to printer -

java - How can print multiple pdf files by reading from source and send to printer - i tested window.print() command purpose not fulfill requirement. used print content of iframe in source pdf file work in chrome not in other browser. i want print pdf files automatically using code instead of open file , print it. illustration there 2 files such 1.pdf , 2.pdf in directory , source given how can print both files using either javascript or php or both. i tested window.print() command purpose not fulfill requirement. my required image as: million in advance. this not possible since browsers, unlike google chrome (where works) don't have built in pdf viewer. the printing of pdf document pdf reader, whether or not installed browser plugin, not browser. java php javascript pdf

javascript - evaluate module in another module's context -

javascript - evaluate module in another module's context - i know un-node/commonjs-y—forgive me. (i'm writing library of sorts , i'd library's require method work same on browser , on nodejs.) what i'd able evaluate script in context of current module—that is, if exports.a = "100"; in module, i'd exports.a equal "100" in of code in require ing module after require . if isn't clear, i'd happy elaborate. this won't finish answer, help in right direction. i've been messing node's scheme of creating modules lastly couple of days. wanted create modules invoked in exclusively fresh context , variable scope, define limited subset , extension of node's capabilities. i ended studying their source here, , giving particular attending nativemodule constructor , methods. you'll notice source of module read file, wrapped in string representing function , eval'd actual code. the wrapper: n...

javascript - issue with insertBefore() -

javascript - issue with insertBefore() - i got little object has append new rows table.. works fine in cases, if there table within of rows (in "root" table) object doesn't append proper table!? i have been doing bit of debugging , found line goes wrong.. if debug set , line insertbefore() omitted object appends proper table var list = new function(){ this.append_row = function(row, tbl, index){ if(debug){ index = -1; } if(index == 0){ row.prependto(tbl); } else if(index > 0){ var elm = $('tr', tbl); if(elm.length > index){ row.insertbefore(elm.eq(index)); // issue in line } else{ row.appendto(tbl); } } else{ row.appendto(tbl); } }; } it because this: var elm = $('tr', tbl); ...is equivalent this: var elm = $(tbl).find('...

eclipse - Invoking Java Code with Acceleo -

eclipse - Invoking Java Code with Acceleo - i seek invoke java code in template acceleo. code given there : http://wiki.eclipse.org/acceleo/faq#how_to_use_a_java_service_in_acceleo works fine code doesn't , don't find error. here java function : public string test(softo.activite activity) { homecoming activity.getmodxname(); } and template code : [query public gettest(a : activite) : string = invoke('org.eclipse.acceleo.softogen.files.utility','test(softo.activite activity)', sequence{a}) /] [template public createoperationurl(activity : accessibleactivite) ] result : [gettest(activity)/] [/template] i tried replace homecoming function homecoming 'foobar' doesn't work either. don't have message when generate : file contains 'result :'. have checked paths , filenames use. any thought solve problem ? edit : okay ! found answer... it's stupid : in query code don't have set argument name, type, : ...

intentfilter - Android : Intent for viewing multiple images -

intentfilter - Android : Intent for viewing multiple images - my activity enables display gallery of images , want define "intent filter", indicating apps can open several images. example, after user takes pictures , wants browse it, chooser dialog should propose apps... i know code, in manifest, works 1 image : <intent-filter> <action android:name="android.intent.action.view" /> <category android:name="android.intent.category.default" /> <data android:mimetype="image/*" /> </intent-filter> but not work several images... i think value of mimetype not correct...but right mimetype open image of media provider ? here illustration of intent filter view google.note : <intent-filter android:label="@string/resolve_edit"> <action android:name="android.intent.action.view" /> <category android:name="android.intent.category.default" /> <data an...

titlebar - Android: having different title name and launcher name -

titlebar - Android: having different title name and launcher name - i have application custom title bar in have used in image title background or title image , have removed string of title. now problem if remove string title since using own customized titlebar, there no launcher name application (the name displayed below icon of application). if select notitlebar activity, won't show customized titlebar well. don't know why android takes string title , launcher same resource..it doesn't create sense so. here code of customized title bar <?xml version="1.0" encoding="utf-8"?> <resources> <style name="titlebarbackgroundstyle"> <item name="android:background">@drawable/titlebar</item> </style> <style name="theme.mycustomtheme" parent="android:theme"> <item name="android:windowtitlebackgroundstyle">@style/titlebarbackgroundstyle<...

jquery - How can I use parents('ul') to select the nearest/ closest only? -

jquery - How can I use parents('ul') to select the nearest/ closest <ul> only? - i have html, <ul> <li>a <ul> <li><a href="#">1</a></li> <li><a href="#">2</a></li> </ul> </li> </ul> how can utilize parents('ul') select nearest/ closest <ul> not toppest? to closest parent, utilize parents('ul:first') . jquery html-lists parents

regex - PHP Find and replace function -

regex - PHP Find and replace function - i need regular look find , replace i'm little stuck on. basically, have table several <td> 's in each <td> have a <img> i need re-create width , height <img> , place in <td> i have been doing manually, number of <td> 's growing , taking long. i need help doing actual find , replace any ideas? -- edit -- thanks advice, think go downwards dom route know better. have done reg ex before did task much more simple thought went there. you've saved me time you should consider using domdocument class provided php. example: <?php $doc = new domdocument; $doc->loadhtmlfile('/path/to/file.html'); // find td elements. $tds = $doc->getelementsbytagname('td'); // if td elements found, loop through each 1 of them. if ( ! empty($tds) ) foreach ( $tds $td ) { // find img elements located within td $imgs = $td->getelementsbytagname(...

objective c - How can I avoid EXC_BAD_ACCESS when checking if directories exist? -

objective c - How can I avoid EXC_BAD_ACCESS when checking if directories exist? - i'm building app caches images in documents directory of app bundle. in order create sure directories exist, want check see if exist and, if don't, create them @ point @ application starts. currently, i'm doing in didfinishlaunchingwithoptions: so: - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { nsarray *directoriestocreate = [[nsarray alloc] initwithobjects: @"dira/dira1", @"dira/dira2", @"dirb/dirb2", @"dirb/dirb2", @"dirc", nil]; nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *docum...

.htaccess - htaccess redirect rules - How to redirect up one level? -

.htaccess - htaccess redirect rules - How to redirect up one level? - http://mysite.com/level-1/level-2/level-3/ i want redirect http://mysite.com/level-1/level-2/ "level-1" , "level-2" can user enters... (not these exact words) could direct me tutorial or give me few pointers? thanks lot!! based on comment (from level-3 level-2 folder 301 permanent redirect): rewriteengine on rewritebase / rewriterule ^([^/]+/[^/]+/)[^/]+/$ http://www.example.com/$1 [qsa,r=301,l] this rule redirect example.com/hello/pink/kitten/ example.com/hello/pink/ if url construction different, no redirect occur: missing trailing slash (e.g. example.com/hello/pink/kitten ) 4-level deep url (e.g. example.com/hello/pink/kitten/family/ ) this rule needs placed in .htaccess in website root folder. if placed elsewhere (e.g. apache config file, within <virtualhost> , example) rule needs little tweaking. .htaccess mod-rewrite url-rewriting

ruby on rails - How to Nest Models within a Model -

ruby on rails - How to Nest Models within a Model - imagine have 2 models film -name -description -duration -year_made -rating -actors actor -name -d_o_b -biography -films actors nested in cinema , vice versa. how represent relationship in ruby models? realistically have 3rd table mapping actor_id film_id . whilst adding details cinema able create actor on fly(if actor not exist create new 1 name supplied) thank in advance. addition: just found link similar question. you're looking @ has , belongs many (habtm) relationship between 2 tables. read habtm relationship in rails guides here: http://edgeguides.rubyonrails.org/association_basics.html#has_and_belongs_to_many-association-reference first you'll need generate migration this: class addactorfilmtable < activerecord::migration def self.up create_table :actors_films, :id => false |t| t.integer :actor_id, :null => :false t.integer :film_id, :null => :false ...

php - Programmatically fetching definition of a word -

php - Programmatically fetching definition of a word - i writing social app people utilize tags organizing articles. these tags shared across site , each tag needs have description it. i wonder if there way can programmatically fetch resource wikipedia. (say first paragraph). the tags typically associated brands products , services. yes can <?php $contents = file_get_contents("http://en.wikipedia.org/wiki/php"); preg_match("/<p>(.*?)<\/p>/", $contents, $match); echo $match[1]; ?> http://sandbox.phpcode.eu/g/45c56.php edit: looks don't non-validated browser agents. you'll have curl edit2: curl browser agent: <?php $ch = curl_init("http://en.wikipedia.org/wiki/php"); $useragent="mozilla/5.0 (windows; u; windows nt 5.1; en-us; rv:1.8.1.1) gecko/20061204 firefox/2.0.0.1"; curl_setopt($ch, curlopt_useragent, $useragent); curl_setopt($ch, curlopt_returntransfer, true); $contents = curl_exec($ch...

java - OpenOffice API: Saving Impress (presentation) document as self-contained file -

java - OpenOffice API: Saving Impress (presentation) document as self-contained file - when save 'ms powerpoint 97' filter, image files used in graphicobjectshape objects linked, not contained in file. is there property of filter or document-property create ooo create self-contained file (image files embedded instead of linked)? edit: the xlinkagesupport object has breaklink function. clues how obtain these interfaces? you can embed images ooo document thru com.sun.star.drawing.bitmaptable object. next function take document (its xmultiservicefactory interface), file object pointing image file of selection , internalname has unique, embeds image , returns url pointing embedded instance. /** * embeds image document , gets new url. * * @param mill factory interface of document. * @param file image file. * @param internalname name of image used within document. * @return url of embedded image. */ public static string embedlocalimage(xmultiserv...

visual studio 2005 - R6034, but really don't know why -

visual studio 2005 - R6034, but really don't know why - i have no problem microsoft,but hate me that's true. have application written in visual studio 2005,where it's build works fine (vs2005 sp1, win xp sp3). have pc run it. when seek start comes r6034 error, click retry, error comes again, 1 time again retry , programme starts , works fine.i don't want see error message again. the os in pc win 7 (64bit). have installed required vcredist also. have read must build application manifest have done. have done linker 1 , , have embedded manifest. have copied requied dlls visual studio library manifest files folder exe exists, still nothing. i'm disappointed because have tried everything.please, if know's can seek help me.if need more info tell me. thanks in advance! visual-studio-2005 manifest visual-c++-2005

sql - Dynamically display rows as columns -

sql - Dynamically display rows as columns - i couldn't think of way word title, if can come improve please sense free. there old vb6 app pulls info db have more or less restructured , gives user dump of of product info @ once. need inner joins of these tables together. know how basic inner joins stuck on 1 detail. there few tables there multiple entries each item. example, crossreference table may have multiple cross reference numbers item, or may have one, or may have none @ all. possible have placed dynamically separate columns. this: item crossreferencenumber xxxxx crossref1 xxxxx crossref2 xxxxx crossref3 could become (after bring together other tables): item basepart size crossreferencenumber1 crossreferencenumber2 crossreferencenumber3 xxxx xxxx big crossref1 crossref2 crossref3 but if there no cross references, there no cross reference columns. possible or dreaming? oracle 11g...

javascript - Question related to input field -

javascript - Question related to <select> input field - i have 3 <select> input fields: <select name=first> , <select name=second> and <select name=three> . 2nd , 3rd fields disabled. if user changes value of first field, 2nd field should enabled , on. there illustration related task? thanks in easiest way, can bind event handler elements change event , adjust disabled property: var form = document.getelementbyid('formid'); form.first.onchange = function() { form.second.disabled = false; }; form.second.onchange = function() { form.three.disabled = false; }; demo i suggest disable fields via javascript, otherwise, if users have javascript disabled, cannot utilize form. javascript html

performance - SQL - fastest interval lookup -

performance - SQL - fastest interval lookup - i have table geoip 3 columns: bigint start, bigint end , varchar country (actually, ip country mapping). intervals specified start , end columns, sorted , have no overlaps or gaps. table has lot of rows (hundred thousands). table users 3 columns: int userid, varchar login , bigint ip. what fastest sql way (statement , table architecture) bring together these tables assign country each user? i'd have view. at moment utilize cross apply works pretty slow. update: i wrong in initial question. fortunately interval lookup works smoothly. real issue in string concatenations geoip.country + ' ' + geoip.region + ' ' + geoip.city region . badly changed execution plan. switching calculations select user function solved problem. i had similar problem 1 time ip range table doing total scans when querying range containing given element (on oracle 10g years ago): select country geoip ? between start , end ...

sql - Classic Asp insert to DB with table that has schema -

sql - Classic Asp insert to DB with table that has schema - i'm lucky winner of fixing legacy code base of operations adding stuff db. i have tabel in schema create table [agreements].approved ( id int not null identity primary key, domainname varchar(50) not null, applicantfirstname varchar(50) not null, applicantlastname varchar(50) not null, ownerfirstname varchar(50), ownerlastname varchar(50), ownercompany varchar(50), viewedappendix3 bit not null, approveddate datetime default getdate(), ) now question. how insert new row tabell has schema using classic asp? im trying with: agreesql = "insert [agreements].approved(domainname, applicantfirstname, applicantlastname, ownerfirstname, ownerlastname, viewedappendix3) values('" & domain1 &"','" & owner & "','" & owner &"','" & owner & "','" & owner & "...

java - How do I get chunked footers from a response on a connection that uses ThreadSafeClientConnManager? -

java - How do I get chunked footers from a response on a connection that uses ThreadSafeClientConnManager? - i'm using connection created threadsafeclientconnmanager (apache httpcomponents 4.1.1). response chunked (which expect), determined response.getentity().ischunked() however, there no way footers/trailers (which necessary our application). since response chunked, expect entity contents of type chunkedinputstream, default request director , executor classes used client wrap original response entity (which, looking @ httpcomponents source have been chunkedinputstream) in basicmanagedentity. in short, no longer able footers/trailers off of response, basicmanagedentity not create underlying entity available use. know how work around this? for reference, see: org.apache.http.impl.client.defaultrequestdirector.java, lines 523-525 org.apache.http.impl.entity.entitydeserializer.java, lines 93-96 one can utilize http response interceptor in order access chunk...

html - Perl Can't call method "parse_html_string" or unbless reference -

html - Perl Can't call method "parse_html_string" or unbless reference - i'm trying utilize module html::grabber parse html in perl. works when utilize in main process, throws me error when effort utilize threading. specifically, got error, thread 1 terminated abnormally: can't phone call method "parse_html_string" on unblessed reference @ /usr/local/activeperl-5.10/site/lib/html/grabber.pm line 79. where creation of grabber object. $mech->get($link); $dom = html::grabber->new(html => $mech->content); #at point any thought how prepare weird problem? the parse_html_string method called on xml::libxml parser object. xml::libxml seems have mixed back upwards threads: http://search.cpan.org/~shlomif/xml-libxml-1.78/libxml.pod#thread_support what happening html::grabber creating parser object when imported script in main thread. create kid thread, , since xml::libxml not clone between threads, obj...

objective c - What do the terms "identifier" and "accessor" mean? -

objective c - What do the terms "identifier" and "accessor" mean? - i have few things in obj-c need explained. need definition , example. are: "identifier" , "accessor". also, how set "identifier" before = ? as usual, google , official apple docs friends: accessors: official doc | other explanation id: id what mean putting identifier before '='? you can assign right of '=' whatever on left... operators most of questions not objective-c specific anyway, seems need brush on general programming concepts. start reading docs here objective-c identifier accessor

php - Setup XML Web Service Request -

php - Setup XML Web Service Request - i runningn php , mysql on server , want provie web service of product info , having searched google not sure best place start , if know can find sample code or easy undertand examples. i have 30 items can query example. dep section , count how many records return. brandname cost shortdescription sku the request made on http://website.com/productxml?dep=1&count=3&brandname=y&price=y. if knows resources or has sample code much appreciated. thanks roy as @lbu suggests dynamically create xml using php , info database (don't forget set headers!). i searching solution create little api webservice without much hussle , came across luracast restler. it's free php solution let's create api in no time. maintain in mind it's still in production, work rather already. (if made few fixes , i'll suggest these them soon). can download github project page , includes examples started. php xml web-s...

scripting - How to specify the current directory in Windows Shell? -

scripting - How to specify the current directory in Windows Shell? - i have next bat file intended archive specified folder, protect password , re-create archive file local dropbox folder. "c:\program files\7-zip\7z.exe" -mx9 archive.7z "g:\this test\directory\with subdirectories\" -psecret -mhe=on xcopy "g:\this test\directory\with subdirectories\archive.7z" "g:\my documents\my dropbox\" /c /d /s /e /k /y i utilize 7-zip archiving. is possible alter script in such way can set in folder take , same - archive current folder, protect password , re-create archive file local dropbox folder? simply said, command "archive current directory , sub-directories"? %cd% current directory. seek echo %cd% in dos prompt seek out. shell scripting batch-file

php - Querying table with an ampersand in the name -

php - Querying table with an ampersand in the name - i'm in process of cleaning mysql database , have create similar changes across multiple tables. such, gather list of tables $query = " select table_name information_schema.columns table_schema = 'mydb' , column_name = 'activecolumn'"; then iterate through each making changes need. problem of these tables have ampersand in title. guess php and/or mysql has problem this, throws direction /* $query = "select * cats&dogs"; */ have error in sql syntax; check manual corresponds mysql server version right syntax utilize near '&dogs' @ line 1 i've found ways prepare issue when need insert ampersand in db , when have 1 in clause(truthfully, isn't total solution it's best found). if come in exact query in mysql without using php works. what causing issue? backticks. select * `cats&dogs` . reference: http://dev.mysql.com/doc/...

javascript - Internet Explorer render issue (simple JS timer - window.setTimeout) -

javascript - Internet Explorer render issue (simple JS timer - window.setTimeout) - <script language="javascript" type="text/javascript"> var thebar = createprogressbar(document.getelementbyid('progress-bar')); var value; function resetvalue() { value = 0; } function showprogress() { value += 1; thebar.setvalue(value); if (value < 100) { window.settimeout(showprogress, 100); } } window.onload=resetvalue();showprogress(); </script> -- <script language="javascript" type="text/javascript"> function createprogressbar(elem) { var div1 = document.createelement('div'); div1.classname = 'progress-bar-background'; div1.style.height = elem.offsetheight + 'px'; elem.appendchild(div1); var div2 = document.createelement('div'); div2.classname = '...

How to select date and time without the seconds in mysql? -

How to select date and time without the seconds in mysql? - how select date , time without seconds in mysql column date value in table ? "yyyy-mm-dd hh:mm:ss" should "yyyy-mm-dd hh:mm" select date_format(`date`, '%y-%m-%d %h:%i') `formatted_date` `table`; mysql

tsql - How to check if the USER is already created in the database or not in SQL? -

tsql - How to check if the USER is already created in the database or not in SQL? - is there way can know if user(not login) created in database? mean user not login, since, know how check login. need check user created within specific db & role assigned it. this code checking login: select name sys.server_principals name = 'test_user' but how user? since need create user , assign role if not created. otherwise, go on without creating. thanks how about: use (your database want check user's existence in) select * sys.database_principals name = '(your user name check here)' sys.server_principals shows logins defined on server level - sys.database_principals shows principals (e.g. user accounts) on database level. sql tsql

Is buffer-overflow considered a "solved problem" ? (at least for future systems) -

Is buffer-overflow considered a "solved problem" ? (at least for future systems) - i looking @ various buffer/heap/stack protection technologies such pax, dep, nx, canaries, etc and new 1 smep - http://vulnfactory.org/blog/2011/06/05/smep-what-is-it-and-how-to-beat-it-on-linux/ assuming using latest kernel on latest mainstream processor assuming recompile apps various compiler protections assuming run dep, aslr nx bit whatever protection is reasonable buffer-overflow attack fail? , has been solved future systems? as corollary, true implemented, current win7 systems hopelessly vulnerable rot , other techniques particularly on 32bit apps ? p.s. purposely not going "managed code safe" argument here [disclaimer] not advocating sloppy coding. realize there many other attacks. know existing systems far outnumber "idealized" security configuration no, buffer-overflow not solved problem, @ to the lowest degree in unmanaged code. the...

php - form radio button not passing value -

php - form radio button not passing value - i failing see why little form radio button grouping fails pass value processing php page. have posted code @ pastebin.com @ link: http://pastebin.com/gt5hdpuc , grateful if point out why happening. give thanks you updated code @ http://jsfiddle.net/xgrb9/3/ you need have radio buttons in <form> element. encapsulate radio buttons in following: <form method="post"> radio buttons go here <input type="submit" value="submit" name="submit"> </form> php html

nsstring - Objective-C file i/o error -

nsstring - Objective-C file i/o error - - (ibaction)sendmessage:(id)sender { nsstring* conversationfile = [@"~/" stringbyappendingpathcomponent:@"conversation.txt"]; bool fileexists = [[nsfilemanager defaultmanager] fileexistsatpath:conversationfile]; if (fileexists == false) { [self doshellscript:@"do shell script \"cd ~/; touch conversation.txt\""]; } nsstring *conversationcontent = [[nsstring alloc] stringwithcontentsoffile:@"~/conversation.txt" encoding:nsutf8stringencoding error:null]; nsstring *mymessage = [[messagebox stringvalue]copy]; nsstring *combinedcontent = [nsstring stringwithformat:@"%@ \r\n %@", conversationcontent, mymessage]; [[[myconversationbox textstorage] mutablestring] setstring: combinedcontent]; [combinedcontent writetofile:@"~/conversation.txt" atomically:yes encoding:nsutf8stringencoding error:null]; } the above code presents ne...

wpf controls - WPF ScrollViewer show border when ScrollBar is Visible -

wpf controls - WPF ScrollViewer show border when ScrollBar is Visible - i want add together border scrollviewer. order should shown when scrollbar of scrollviewer visible (verticalscrollbarvisibility set "auto") thanky you! use binding , converter . public sealed class visibilitytoborderthicknessconverter : ivalueconverter { public object convert(object value, type targettype, object parameter, system.globalization.cultureinfo culture) { seek { var flag = (visibility)value; if (flag == visibility.visible) homecoming new thickness(0); else homecoming new thickness(1); } grab { homecoming new thickness(0); } } public object convertback(object value, type targettype, object parameter, system.globalization.cultureinfo culture) { throw new notimplementedexception(); } } and xaml: <scrollv...

cryptography - Certificate Encryption/Decryption Errors on C# -

cryptography - Certificate Encryption/Decryption Errors on C# - the next command utilize create keystore called myalias.p12 , export certificate called myalias2.cer. java keytool key , certificate management utility. allows users manage own public/private key pairs , certificates. e:\>keytool -genkeypair -keyalg rsa -keysize 2048 -sigalg sha1withrsa -validity 36000 -alias myalias2 -keystore myalias.p12 -storetype pkcs12 -dname "cn=www.myalias.com, ou=myalias2, o=myalias2, l=tp, st=tp, c=tw" -storepass 123456 -keypass 123456 e:\>keytool -export -alias myalias2 -keystore myalias.p12 -storetype pkcs12 -rfc -file myalias2.cer -storepass 123456 encryption: string input="hello"; x509certificate2 mycertificate = getcertfromcerfile("e:\\myalias2.cer"); rsacryptoserviceprovider provider1 = (rsacryptoserviceprovider)mycertificate.publickey.key; byte[] buffer1 = encoding.utf8.getbytes(input); byte[] result = provider1.encrypt(buff...

java - Query about Thawte certificate -

java - Query about Thawte certificate - does know whether thawte certificate certifies 1 time entire app or need certify every time release version same application. if have code-signing certificate can sign many apps/versions want. java java-me signing thawte

php - how to explode a string and make an echo of a chosen attribute -

php - how to explode a string and make an echo of a chosen attribute - i have string containing ; subdivided , , create echo of chosen value. my string $string='width,10;height,5;size,1,2,3' i want create echo of height value (echo result must 5) $parts = explode(';', $string); $component = explode(',', $parts[1]); // [1] height,5 portion echo $component[1]; // 5 php

ruby on rails - Which user is running my app? -

ruby on rails - Which user is running my app? - on ubuntu server apache2/rails 3.0.3 i'd know wich user runs app. documentation , lot of sources on net says owner of config/environnement.rb 1 running app. if ps -aux|grep apache, can see processes www-data owner. there no passenger or ruby or rails processes. how can know sure wich user running rails app? use ps aux | grep -i passenger or if doesn't result in anything, ps aux | grep -i /application/directory/ if it's running passenger app, homecoming passenger processes. specifically, you'll looking passenger applicationspawner: /your/app/public/ ruby-on-rails apache2 passenger

http - How do protocols for web are created & what are the specifications? -

http - How do protocols for web are created & what are the specifications? - how web protocols http, ftp created & implemented? if decide create new protocol, how should proceed? computer/network protocols formalized , made standards ietf. http/1.1, 1999, http/1.0, 1996 ftp (1985), ftp (1980) http

Unable to use "HelveticaLtEx" font in Flex project -

Unable to use "HelveticaLtEx" font in Flex project - unable utilize "helveticaltex" font. <?xml version="1.0" encoding="utf-8"?> <mx:application xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%" fontfamily="arial" fontsize="12" xmlns:ilog="http://www.ilog.com/2007/ilog/flex" xmlns:local="c7.views.apps.calendar.*" backgroundcolor="#ffffff"> <mx:style> @font-face { src:url("assets/cloud_main/font/helveticaneueltstd-ltex.otf"); fontfamily: helveticaltex; } .datestyle{ font-family: "helveticaltex"; fontsize: 18; } </mx:style> <mx:canvas> <mx:vbox> <mx:label text="testing te...

Does a final method prevent Hibernate from creating a proxy for such an entity? -

Does a final method prevent Hibernate from creating a proxy for such an entity? - hibernate uses proxies enable lazy loading of collections , single-ended associations. according hibernate's (3.6.5) reference documentaion (section 21.1.3, single-ended association proxies), such proxy can't constructed hibernate if contains "any final methods". question is, restriction apply getters/setters of persistent fields or method in entity class? so, method one: public final string tostring() { homecoming this.getclass().getsimplename() + id; } really prevent creation of (cglib or javassist) proxy entity? matter if field-based or property access used? since cglib replaced javassist, provide more features in direction? i utilize inheritance in entity hierarchy , hence requirement define final methods, example, in base of operations class prevent subclasses overriding methods. thanks in advance! by help of hibernate mailing list (thanks emmanuel bernar...

c++ - Changing dialog boxes -

c++ - Changing dialog boxes - win32 api: so let's have dialog box 2 menu items, "menu item a" , "menu item b" when click "menu item a" want main screen of current dialog alter dialog a's screen when click "menu item b" want main screen of current dialog alter dialog b's screen. how this? i'm new win32 api, in advance! the usual way have 2 kid 'container' dialogs children of outer frame window; let's phone call them dialoga , dialogb. these contain controls 2 respective dialogs. when want switch 1 other, utilize showwindow() show 1 dialog , hide other. in win32, hiding hwnd hides kid controls it, can hide , show groups of controls grouping them in sub-windows this. that's overview of general technique. sub-dialogs, can either create them manually using createwindow(), or utilize createdialog() have windows work of creating kid controls dialog template you. this technique property she...

Understanding some Python code -

Understanding some Python code - i'm working way through gmail access using imaplib , came across: # count unread emails status, response = imap_server.status('inbox', "(unseen)") unreadcount = int(response[0].split()[2].strip(').,]')) print unreadcount i wish know what: status, does in front end of "response =". google it, have no thought i'd inquire find reply :(. thanks. when function returns tuple, can read more 1 variable. def ret_tup(): homecoming 1,2 # can written parens a,b = ret_tup() a , b 1 , 2 respectively python

php - What would be the correct check syntax for these strings? -

php - What would be the correct check syntax for these strings? - i writting script checks folder k:/comics , inserts each name + number database, table name = comics. check see if comic exists before run insert queries. table structure: create table if not exists `comics` ( `id` int(100) not null auto_increment, `name` varchar(255) not null, `issue` varchar(4) default null, `bio` longtext not null, `pages` int(10) not null, `size` varchar(100) not null, `price` varchar(11) not null, primary key (`id`) ) engine=myisam default charset=latin1 ; code: <?php $main_folder = 'k:/comics/'; // should k:\comics\ changed because of highlighting issue $folders = glob($main_folder.'* [0-9]*', glob_onlydir); $comics_series = array(); foreach($folders $folder){ $comics_series[] = preg_split('/(.+)\s(\d+)/', str_replace($main_folder, '', $folder), -1, preg_split_delim_capture|preg_split_no_empty); } ...

android - RingtonePreference not firing onSharedPreferenceChanged -

android - RingtonePreference not firing onSharedPreferenceChanged - my preferences trigger onsharedpreferencechanged event upon change. works preferences: checkbox, list, custom, etc. won't called if select ringtone ringtonepreference. have code: <checkboxpreference android:title="@string/pref_notification" android:defaultvalue="true" android:summary="@string/pref_notification_summary" android:key="prefnotification" /> <ringtonepreference android:title="@string/pref_ringtone" android:key="prefringtone" android:summary="@string/pref_ringtone_summary" android:ringtonetype="all" /> <checkboxpreference android:title="@string/pref_vibrate" android:defaultvalue="true" android:summary="@string/pref_vibrate_summary" android:key="prefvibrationon" /> <listpreference android:...

objective c - app is crashing when i try to release nsmutablestring please help on this -

objective c - app is crashing when i try to release nsmutablestring please help on this - intialised nsmutablestring below: -(nsstring*)filterit:(nsstring*)source { temp1= [[nsstring alloc] initwithstring:[source stringbyreplacingoccurrencesofstring:@"rlm;" withstring:@""]]; //nsstring *m_temp; temp1 = [temp1 stringbyreplacingoccurrencesofstring:@"&" withstring:@""]; temp1 = [temp1 stringbyreplacingoccurrencesofstring:@"#x" withstring:@"&#x"]; nsrange range = [temp1 rangeofstring:@"&#x"]; nsrange range1 = nsmakerange(range.location, 8); if (range1.location != nsnotfound) { nsstring* temp2 = [temp1 stringbyreplacingcharactersinrange:range1 withstring:@""]; //[temp1 setstring:temp2]; temp1 = temp2; range = [temp1 rangeofstring:@"&#x"]; while (range.location < [temp1 length]) { range1 = nsmake...

php - using FFMPEG to convert to MP4 with maximum browsers compatibilty -

php - using FFMPEG to convert to MP4 with maximum browsers compatibilty - i'm converting wmv flv using ffmpeg , , problem flv videos big! 15 minutes video's size ranges between 150mb , 1gb! i'm using next ffmpeg command convert , split wmv videos : nohup nice -1 ffmpeg -y -ss 00:00:00 -t 00:15:00 -async 1 -i input.wmv -acodec libmp3lame output.flv , i've tried converting mp4 before , video size much smaller flv video. questions are: would mp4 videos have compatibility issues browsers? would work on iphone, ipad? (i know flv videos doesn't work on iphones or ipads) what best ffmpeg command convert mp4 without losing quality of video? a few points... video size has bit rate, dimension, , codec. not have container. you can expect 15 minutes of video large, assuming want more postage stamp stamp viewing area. normal. any time re-compress something, going lose quality. there no way around this. might able maintain quality recompressin...

.net - Dependency Injection when using the Command Pattern -

.net - Dependency Injection when using the Command Pattern - i'm using command pattern first time. i'm little unsure how should handle dependencies. in code below, dispatch createproductcommand queued executed @ later time. command encapsulates info needs execute. in case need access info store of type create product. question is, how inject dependency command can execute? public interface icommand { void execute(); } public class createproductcommand : icommand { private string productname; public createproductcommand(string productname) { this.productname = productname; } public void execute() { // save product } } public class dispatcher { public void dispatch<tcommand>(tcommand command) tcommand : icommand { // save command queue } } public class commandinvoker { public void run() { // queue while (true) { var command = queue.dequeue<icommand>(); ...

python - Conditionally show and hide a form field and set the field value -

python - Conditionally show and hide a form field and set the field value - i have form in django looks this: class personnelform(forms.form): """ form creating new personnel. """ username = forms.regexfield( required=true, max_length=30, label=_("name") ) is_manager = forms.booleanfield( required=true, label=_("is manager") ) i utilize form in 2 places in site. 1 1 of places, i'd display form , of fields except is_manager field set default value of field true . in other place, i'd display form , of fields including is_manager field , have default value of false. how can accomplish this? seems trivial thing can't figure out. thanks. you utilize form's __init__ method hide (or delete) field, i.e. class personnelform(forms.form): """ form creating new personnel. """ username = forms.regexfield( re...

language agnostic - Examples of good in-game tutorials -

language agnostic - Examples of good in-game tutorials - i thinking how users can larn perform complex tasks in programs , wonder if can larn computer games. what games think have in-game tutorials teach player how play? are there other ways teach user how perform tasks? i know if think in-game tutorials bad idea, provided have reason. note: not looking tutorials on implementing games. i have been tester , producer ea mobile in lastly 3 years , 1 year , half ago wondering same thing. looking @ on market recommend wow because: 1) 3/4 of game easy plenty not bored new player , not killed. rest of 1/4 more lethal. 2) since first level until lastly (level 85 @ moment) on every level user receives (either talent point or new ability). 3) advanced aspects (such glyphs help customize spells) received 3 times during leveling process. 4) whole leveling requires bit on month new casual player. after 1 month of mind-numbing killing user considers experience worth-wile bec...

multithreading - Python Socket and Thread pooling, how to get more performance? -

multithreading - Python Socket and Thread pooling, how to get more performance? - i trying implement basic lib issue http get requests. target receive info through socket connections - minimalistic design improve performance - usage threads, thread pool(s). i have bunch of links grouping hostnames, here's simple demonstration of input urls: hostname1.com - 500 links hostname2.org - 350 links hostname3.co.uk - 100 links ... i intend utilize sockets because of performance issues. intend utilize number of sockets keeps connected (if possible , is) , issue http requests. thought came urllib low performance on continuous requests, met urllib3, realized uses httplib , decided seek sockets. here's accomplished till now: getsocket class, socketpool class, threadpool , worker classes getsocket class minified, "http only" version of python's httplib. so, utilize these classes that: sp = comm.socketpool(host,size=self.poolsize, timeout=5) link i...

Code to display all prime numbers not working in JavaScript? -

Code to display all prime numbers not working in JavaScript? - i'm trying display prime numbers 10 , isn't working. can see did wrong? function findprimenumbers() { var count = 10, primes = []; (var = 0; <= count; i++) { if (count / === 1 || count) primes.push(i); else continue; count -= 1; } (var = 0, len = primes.length; < len; i++) homecoming primes[i]; } console.log(findprimenumbers()); it returns 0 in console. for (var = 0, len = primes.length; < len; i++) homecoming primes[i]; here homecoming first element of array. think meant this var retstr = ""; (var = 0, len = primes.length; < len; i++) { //to improve str format if(i == len-1) retstr += primes[i]; else retstr += primes[i] + ", "; } homecoming retstr; hope helps. javascript primes

c# - Problem with a hyperlink -

c# - Problem with a hyperlink - i set hyperlink within datalist.. <itemtemplate> <asp:hyperlink id="hyperlink1" runat="server">'<%# eval("threadtitle") %>'</asp:hyperlink> <br /> <br /> </itemtemplate> i want enable pressed datalist event triggered , transfer me page: protected void datalist1_selectedindexchanged(object sender, eventargs e) { server.transfer("answerquestion.aspx?x=" + datalist1.datakeyfield + "&question=" + datalist1.selectedvalue + "&time=" + datetime.now); } unfortunately, link seems disabled , cant press on trigger datalist selected event.. how can create hyperlink active ? if want trigger selecteditemchaned event utilize linkbutton instead of hyperlink. <asp:datalist id="datalist1" runat="server" onselectedindexchan...

jquery - Dictionary is not supported for deserialization of an array -

jquery - Dictionary is not supported for deserialization of an array - updated: i have next code, trying utilize returned json data, deserialize it, , homecoming 1 part of info user. <%@ page language="vb" debug="true" enableviewstate="false" %> <%@ import namespace="system.web.script.serialization" %> <script runat="server"> class item public property some_number() double homecoming m_some_number end set(byval value double) m_some_number = value end set end property private m_some_number double public property some_text() string homecoming m_some_text end set(byval value string) m_some_text = value end set end property private m_some_text string public property serial_number() string...

WebsiteSpark and BizSpark : Which one ? Requirements? -

WebsiteSpark and BizSpark : Which one ? Requirements? - i kind of freelancer owning company 1 in there, might bring together winter. concerning websitespark , bizspark. if developping somehow personal website , web application, web products potential buyers , websites future clients (this winter) programme best fit me ? also exact requirements , status ? obligated develop website client within time frame ? thanks. i think need websitespark. it's intended web developers , web designers. bizspark start-ups focus on developing own core product. read ms pages thoroughly anyway grasp of need in order comply these programs: http://www.microsoft.com/bizspark/faqs.aspx#startup-question1 http://www.microsoft.com/web/websitespark/support.aspx?tab=programdetails bizspark websitespark

How to call an unmanaged C++ function with a std::vector::iterator as parameter from C#? -

How to call an unmanaged C++ function with a std::vector<>::iterator as parameter from C#? - in unmanaged c++ have function i'm trying phone call c#. c++ function follows: typedef std::vector<point> points; typedef std::back_insert_iterator<points> outputiterator; namespace mynamespace{ dllexport outputiterator convexhull(points::iterator first, points::iterator last, outputiterator result); } when called c++, function used follows: points points, result; points.push_back(point(0,0)); points.push_back(point(10,0)); points.push_back(point(10,10)); points.push_back(point(6,5)); points.push_back(point(4,1)); outputiterator resultiterator = std::back_inserter(result); mynamespace::convexhull( points.begin(), points.end(), resultiterator); std::cout << result.size() << " points on convex hull" << std::endl; i've started writing c# code, i've no thought types should passing: [dllimport...