Posts

Showing posts from August, 2010

html - <span> vs <figure> vs <area> -

i'm wondering difference between 'span' , new html5 tags 'figure' , 'area'. what intended purpose of each, , appropriate uses? example, use 'span' background image rather 'img' tag prevent image being selectable; best element accomplish this? <span> inline element, used inline div. "generic wrapper phrasing content not represent anything." ( w3c spec ) <figure> used alongside <figcaption> element mark "can moved away main flow of document without affecting document’s meaning." ( w3c spec ) <area> making image maps, , used inside <map> element. in case, i'd recommend using div instead, or img tag transparent png content background image. use img tag user-select:none; usual prefixes instead stop image being selectable.

asp.net - change the text of two labels based on the selected row of a gridview -

i want change text of 2 labels based on selected row of gridview. i keep getting error says public member row not exist on linkbutton protected sub linkbutton1_click(byval sender object, byval e system.eventargs) dim linkbutton1 linkbutton = directcast(sender, linkbutton) dim tour label = ctype(sender.row.findcontrol("label2"), label) dim depart label = ctype(sender.row.findcontrol("label3"), label) test.text = tour.text test1.text = depart.text updatepanel9.update() end sub according code, sender linkbutton . property row won't exist on link button when reference sender.row . that's why error. you want hook selectedindexchanged event, give access row more easily. sub mygridview_selectedindexchanged(byval sender object, byval e eventargs) dim mygrid gridview = trycast(sender, gridview) dim selectedrow gridviewrow = mygrid.selectedrow 'do selected row needed here..... end sub

foreign keys - Grails reverse cascade delete without hasMany or belongsTo -

i have 2 domain-classes. class usersaddthese { string somedata } and class theseareconstantlygenerated { usersaddthese theproblem } is there way delete usersaddthese , automatically delete theseareconstantlygenerated or should add in logic findallbytheproblem , iterate , delete. (i prefer if done automatically can add new generated classes refer usersaddthese , not change delete controller.) alternatively, there way tell gorm, "if else depends on deleting cause error util.jdbcexceptionreporter - cannot delete or update parent row: foreign key constraint fails , delete - recursively." well, seems whole point of referential integrity not you're trying in 2nd part of question. however, can add closure usersaddthese domain class: def beforedelete () { theseareconstantlygenerated.withnewsession { theseareconstantlygenerated.findallbytheproblem(this).each {theseareconstantlygenerated thing -> thing.delete() } } }

c - Stuck with sigwait -

i did wrong in code, other process send sigusr2 signal it: sigset_t sigset; sigemptyset(&sigset); sigaddset(&sigset, sigill); sigaddset(&sigset, sigusr2); sigwait(&sigset, &received); xcode notices siguser2(31) signal received, received = sigill(4) (or minimal signal in set). why so? wrong? now, looks this: sigset_t sigset; sigemptyset(&sigset); sigaddset(&sigset, sigill); sigaddset(&sigset, sigusr2); sigprocmask(sig_block, &sigset, 0); sigwait(&sigset, &received); if(received == sigusr2) { //... } else if(received == sigill) { //... } still not working. sometimes debugger can in way. have seen debuggers interfere signal handling before. try running code without debugger involved. the following code works on os x: #include <signal.h> #include <stdio.h> int main() { sigset_t set; int sig; sigemptyset(&set); sigaddset(&set, sig

c# - DateTime's representation in milliseconds? -

i have sql-server timestamp need convert representation of time in milliseconds since 1970. can plain sql? if not, i've extracted datetime variable in c#. possible millisec representation of ? thanks, teja. you're trying convert unix-like timestamp, in utc: yourdatetime.touniversaltime().subtract( new datetime(1970, 1, 1, 0, 0, 0, datetimekind.utc) ).totalmilliseconds this avoids summertime issues, since utc doesn't have those.

sql - Update Statement in a Stored Procedure -

i have stored procedure called active , code is: create procedure dbo.active ( @id int , @source varchar(25) ) begin declare @sql nvarchar(max) declare @schemaname sysname declare @tablename sysname declare @databasename sysname declare @br char(2) set @br = char(13) + char(10) select @schemaname = source_schema , @tablename = source_table , @databasename = source_database source id = @id set @sql = 'update source_table' + @br + 'set __active = case when rn = 1 1 else 0 end' + @br + 'from ( ' + @br + 'select row_number() on (partition ' + @source + ' order __rec_id desc) rn , * ' + @databasename + '.' + @schemaname + '.' + @tablename + @br + ') source_table' + @br

Getting the ids of multiple inserted hasMany items in CakePHP -

description / explanation: on "add event" page, can add multiple schedules. when saveall(), saves event data , schedule(s) data - working correctly. but then, want process schedule(s) data , build individual rows in "dates" table. event hasmany schedule schedule belongsto event schedule hasmany date date belongsto schedule so - i'm loading date model, , repeating through each schedule passed, , processing/inserting dates (based on repeat, start date...etc etc). my problem / question: i need id of each schedule it's dates ("schedule_id" field). how id's of individual schedules during repeat? currently, i'm doing this: foreach($this->data['schedule'] $i => $value) { $this->data['date']['schedule_id'] = $this->event->schedule->id; //other stuff here $this->date->saveall($this->data['date']); } but gives me same id in every loop. the problem i

design - Many to Many relationships in Django -

i working on design models in django , wanted advice. have model teams, of many users can part of. users can members of many teams, cannot members of same team twice. there separate information want track each team/user combo. on top of that, there user "admin" each team, each team may have single admin. have condensed data model definitions follows: class team(models.model): name = models.charfield() members = models.manytomanyfield(user, through='membership') admin = models.foreignkey(user) class membership(models.model): user = models.foreignkey(user) team = models.foreignkey(team) extra_data = models.charfield() so guess 2 questions are: 1) how make on membership model, no user , team combination appeared more once? 2) there better way signify admin on team, while making sure each team had single one? seems if i'm storing admin this, while enforcing rule of having single admin, becomes cumbersome query team members si

django - How can i combine login to all the site with template inheritance? -

1. have base.html template describe site (the basic simple base.html) 2. have split_screen.html template extends base,html file , this: {% extends "base.html" %} {% block content %} - part changes in base. <div id="top"> here come login form , under logo , top nav pannel </div> <div id="right"> here come static right nav pannel never change, there no need block </div> <div id="main"> {% block main%} main part, thing change every page in (all files) extend split_screen.html (every other page in site). {% endblock %} </div> {% endblock %} ok, guess time question... so, looking , can't find (or maybe can't understand how implement) way use template inheritance , still have login backend view built (using email instead of username) implemented....i can't figure 1 out because every example read referring login page of own, need em

java - How do I create a virtual directory in Tomcat 7? -

tomcat installed @ c:\tomcat7\ want deploy .war files in c:\myapp\xyz. example, might have c:\myapps\xyz\myapp.war , should able reach path http://localhost:8080/myapp . i tried appending bottom of c:\tomcat7\conf\server.xml <host name="myapp" appbase="c:\myapps\xyz\" unpackwars="true" autodeploy="true"> </host> </engine> </service> </server> this doesn't seem work though don't see myapp listed in management console , not able hit url. else need do? also, unrelated but, how can not have name of war file tied context name or url path? example, want http://localhost/coolname point c:\myapps\xyz\myapp.war. unfortunately way tomcat loads war filename tricky limitation. i use different & os-specific approach: "symbolic links". isn't direct answer, may out anyway. caveats: i use linux, is possible in windows vi

c# - Local constant initialised to null reference -

i have read c# allows local constants initialised null reference, example: const string mystring = null; is there point in doing however? possible uses have? my guess because null is valid value can assigned reference types , nullable values types. can't see reason forbid this. there might far off edge cases can useful, example multi targeting , conditional compilation . ie want define constant 1 platform define null due missing functionality. ex, of possible usefull usage: #if (silvelight) public const string defaultname = null; #else public const string defaultname = "win7"; #endif

Is use of @attributes in JSON non-standard or standard? -

we're adding json output existing api outputs xml, make mobilehtml integration easier. however, our developer has queried use of @attributes appearing in json output. our original xml looks like: <markers> <marker id="11906" latitude="52.226578" ... and json comes out as: callbackname({"marker":[{"@attributes":{"id":"11906","latitude":"52.226578" .... our developer has stated: "although '@attributes' legal json, seems break dot notation, can't call data.@attributes. can call data['@attributes'], there's workaround, seems safer avoid @-symbol, unless there's reason it." the xml->json(p) conversion done using: $xmlobject = simplexml_load_string ($data); $data = json_encode ($xmlobject); i want make our api easy-to-integrate possible, , therefore use standard stuff possible. we're using native php json_encode function,

java - How do you get AttributedCharacterIterator to return a run for a given Attribute? -

suppose assign custom characteriterator.attribute first 5 characters of ten-character string. suppose further assign different characteriterator.attribute remaining characters. why then, when call attributedstring.getrunstart(firstattribute) 0 (i expect this) , when call attributedstring.getrunstart(secondattribute) also 0? here's setup code: final attributedstring s = new attributedstring("sq3r9fffff"); final attribute baseid = new attribute("base id") {}; final attribute fs = new attribute("fff") {}; s.addattribute(baseid, "ignored", 0, 5); s.addattribute(fs, "whatever", 5, 10); final attributedcharacteriterator iterator = s.getiterator(); assertnotnull(iterator); and here's code outputs diagnostics: for (char c = iterator.first(); c != done; c = iterator.next()) { system.out.println("character: " + c); system.out.println("character index: " + iterator.getindex()); system.out.pri

Defining variables to pass to Django models -

the following works me -- email_list = emaillist.objects.get(domain=(cd['email'].split('@')[1])) but defining 'domain' variable before not -- domain = cd['email'].split('@')[1] email_list = emaillist.objects.get(domain=domain) when latter, raises "emaillist matching query not exist" . accounts difference?? there nothing accounts difference; python variables not change type when bound name.

c# check if a given Sharepoint path is a root sharepoint path? -

how can check if given sharepoint path through command line argument root sharepoint path? in case running command line tool on server can use server side sharepoint om petr abdulin suggested: new spsite(url).openweb().isrootweb if running code on random machine (that not part of farm) have use web services (http://msdn.microsoft.com/en-us/library/dd878586(v=office.12).aspx ) or client side om sharepoint 2010 - http://msdn.microsoft.com/en-us/library/ee857094.aspx . in case sort of have guess part of path root web - i'd increase prefixes of url till can sharepoint web object corresponding path.

perl - Return all hash key/value pairs with maximum value -

i have hash (in perl) values numbers. need create hash contains key/value pairs first hash value maximum of values. for example, given my %hash = ( key1 => 2, key2 => 6, key3 => 6, ); i create new hash containing: %hash_max = ( key2 => 6, key3 => 6, ); i'm sure there many ways this, looking elegant solution (and opportunity learn!). use list::util 'max'; $max = max(values %hash); %hash_max = map { $hash{$_}==$max ? ($_, $max) : () } keys %hash; or one-pass approach (similar different answer): my $max; %hash_max; keys %hash; # reset iterator while (my ($key, $value) = each %hash) { if ( !defined $max || $value > $max ) { %hash_max = (); $max = $value; } $hash_max{$key} = $value if $max == $value; }

memory - How to keep PHP script running until it finishes? -

i have script looks specific words in environmental news articles. can process 1 article, , maybe 5 more , (no data received) however, have cycle through 30 rss feeds contain 10 articles each, once per week. is there more robust solution? or way have process few , restart itself? my colleague suggested explain happens in script. script loads rss feeds list. 1 one. uses magpie_debug obtain links, title, dates. if date less 60 minutes ago, (fresh article) pulls plaintext (simple_dom) attaches pos tags using brill tagger splits text sentences. builds arrays of capitalized nouns, matches them twelve different word banks including large database of chemicals, companies etc. , generates algorithm of 'total environmental impact' each sentence. moves next sentence in article until completed. each article takes 10 seconds process. moves next article. until articles processed. moves next feed until feeds processed. i can grab plaintext of articles/feeds no problem, once th

sql server - Can I send array of parameter to store procedure? -

i have user table, has userid uniqueidentifier , name varchar , isactive bit . i want create store procedure set isactive false many user, example, if want deactive 2 users, want send guid of users store procedure (prefer array). want know how can it? p.s. i'm working on microsoft sql azure along same lines elian, take @ xml parameters. speaking should have cleaner/safer implementation using xml parsing list of strings. click here code example

database and raw files on an android device -

i have raw folder in res folder contains file. when run application on actual device, not able file. same issue database. do need add file separately onto device? where can find database created on device. you can able see database in ddms perspective. run application. windows->open perspective->other-> ddms at right side .three tabs there .open file explorer can find running application there.just click that.you can find database folder under it.

logging - What are All the Columns in a Google App Engine HTTP Log? -

what of data in google app engine http log mean? example, in following (anonymised) log: 107.10.42.191 - foobiz [10/may/2011:17:26:28 -0700] "get /page.html http/1.1" 500 2297 " http://www.example.com/home.html " "mozilla/5.0 (macintosh; u; intel mac os x 10_5_8; en-us) applewebkit/533.19.4 (khtml, gecko) version/5.0.3 safari/533.19.4,gzip(gfe),gzip(gfe),gzip(gfe)" "www.example.com" ms=364 cpu_ms=23 api_cpu_ms=0 cpm_usd=0.001059 i understand of columns, can fill in columns 2 , 14? ip address: 107.10.42.191 just hyphen, or more?: - logged in user: foobiz request time: [10/may/2011:17:26:28 -0700] http request: "get /page.html http/1.1" http response status code: 500 http response size in bytes: 2297 referring page: " http://www.example.com/home.html " browser info: "mozilla/5.0 (macintosh; u; intel mac os x 10_5_8; en-us) applewebkit/533.19.4 (khtml, gecko) version/5.0.3 safari/533.19.4,gzip(gfe),gz

c - fork() usage not getting the correct output -

i using following code fork execution #include <stdio.h> #include <sys/types.h> int main() { int pid; pid=fork(); if(pid==0) { printf("\n child 1"); pid=fork(); if (pid==0) printf("\n child 2"); } return 0; } the output assume should child1 child2 instead getting child1 child2 child1 cannot understand fork behaviour you need flush stdout: printf( "\n child 1" ) fflush( stdout );

javascript - how to make horizontal dropdown menu with many hierarchy /sub-sub? -

how make dropdown horizontal menu in parkour generation web page sub-sub menu(when hover sub menu, ther appear sub-sub menu horizontal menu). in park our, can see in classes -> outdoor, there sub sub menu menu in vertical. need in horizontal. my pleasure if body knows tutorial or article make menu need. have tried search can't found it many :) this you http://www.dynamicdrive.com/style/csslibrary/item/jquery_drop_line_tabs/ also see more

silverlight - How to paste a text from textbox to some other application without using SIP? -

i have made own keypad.i know copy paste feature of wp7. want paste copied text textbox other application without using sip. issues: copy text using default copy paste feature of wp7. get copied text means can copied text. now don't want use sip paste text because m hiding sip , using own custom keypad. i want paste copied text other application. how this. can done clipboard or through other way. need links so. in current version of framework there no api working clipboard, though silverlight 4 clipboard api coming in next version. however, if matt lacey has produced solution works saving text information in jpeg images. able access virtual clipboard of own applications. http://blog.mrlacey.co.uk/2011/03/wp7clipboard-clipboard-api-for-wp7dev.html

java - Android webview script tag not loading source file -

i'm trying load javascript file script tag in webview, won't load it! here's source html script tag: <script type="text/javascript" src="file:///android_asset/game/tetris.js"></script> and java file: webview webview; /** called when activity first created. */ @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); webview = (webview) findviewbyid(r.id.webview); webview.getsettings().setjavascriptenabled(true); webview.loadurl("file:///android_asset/game/tetris.html"); } i've tried , without "file:///android_asset/game/" , still won't load! any ideas? thanks! i same in applications relative paths, , works fine me. in case i'd use src="tetris.js" in html

vim - Visual mode in gVim on Windows doesn't work the way as it works in Unix -

i'm using gvim version 7.3 on windows. when using gvim in unix, insert common text @ beginning of each line in file, following steps: enter visual mode (ctrl+v). select lines text has inserted @ beginning using arrow keys or hjkl keys. after selection press shift+i. the cursor goes begin of line started. enter text , press esc key. now entire block of lines has text inserted @ beginning. so here's question. how do same thing in gvim on windows? it's not working if follow above on unix. please me out this? if have behave mswin in vimrc of vim mappings modified more "windows-like". in particular need use <ctrl-q> enter block-visual mode. i have behave xterm in windows vimrc eliminates these issues.

are there any odbc drivers that connect to odata or similar web data sources -

i want connect using odbc datasources can expose on webservice odata or custom webservice can accept sql. are there drivers out there can it? unfortunately i'm not aware of provider natively. one option use entity framework custom ' entity framework provider ' supports odbc datasources , use wcf data services' ability expose entity framework model. failing wcf data services has provider model ( see blog series ) allows write custom code expose datasource, other webservices, flat files, nosql database or odbc data source. hope helps

sql server - How to get table name from database id, file id, page id in MS SQL 2008? -

i've deadlock graph in locked resource mentioned these 3 fields db id, file id, page id. there associated objectid. want know table page belongs. tried dbcc page(dbid, fileid, pageid) tableresults doesn't show table name. any idea how this? update: tried select name sys.indexes object_id = 123 , index_id = 456 here 123 m_objid (next objectid ) , 456 m_indexid (next indexid ) output dbcc page command. null. to results dbcc page must enable traceflag 3604, otherwise results go sql server log: dbcc traceon (3604) then try command dbcc page ( dbid, filenum, pagenum , 3) the fourth parameter printopt : the printopt parameter has following meanings: 0 - print page header 1 - page header plus per-row hex dumps , dump of page slot array (unless it's page doesn't > have one, allocation bitmaps) 2 - page header plus whole page hex dump 3 - page header plus detailed per-row interpretation definition here

XML parsing using SAX in android -

i trying parse xml file using httpconnection not getting results right. problem there lot of attributes in xml file. please tell me how parse xml file having attribute sax. <person> <lastname>idris</lastname> <information mobileno="xyz" accountno ="1234"address ="abcdef"phoneno="12345"/> <firstname>nazmul</firstname> <company>the bean factory, llc.</company> <email>xml@beanfactory.com</email> </person> <lastname>idris</lastname> <information mobileno="xyz" accountno ="1234"address ="abcdef"phoneno="12345"/> <firstname>nazmul</firstname> <company>the bean factory, llc.</company> <email>xml@beanfactory.com</email> </person> in handler-class, have 'startelement()'-method, has ' attributes '-parameter. c

php - exception while creating order programmetically with payment method ccsave -

i new magento... while creating order programmatically payment method ccsave(for credit card payment) got folloing exception exception 'mage_core_exception' message 'incorrect credit card expiration date may worng credit card information or set data credit card.. please me out... thanks $quote->addproduct($product, new varien_object(10)); $addressdata = array( 'firstname' => $data[2], 'lastname' => $data[3], 'street' => $data[4], 'city' => $data[6], 'postcode' =>$data[8], 'telephone' => $data[9], 'country_id' => 'us', 'region_id' => $data[7] ); $billingaddress = $quote->getbillingaddress()->adddata($addressdata); $shippingaddress = $quote->getshippingaddress()->adddat

java - Download file from X to Y bytes -

i have couple of doubts regarding downloading of file using java is possible size of file before start downloading ? also possible download x y bytes file ? you can these provided server supports these functions. (its not client) nfs , cifs servers do. http , ftp servers do. how depends on protocol , server using.

c++ - no duplicate function for a lottery program -

right im trying make function checks see if user’s selection in array , , if itll tell choose diff number. how can this? do mean this? bool checknumberisvalid() { for(int = 0 ; < array_length; ++i) { if(array[i] == user_selection) return false; } return true; } that should give clue, @ least.

javascript - How do you check a checkbox without firing a change event? -

i have simple checkbox: r = new ext.form.checkbox({ listeners: { check: function(checkbox, checked) { } } } r.setvalue(true); how check checkbox without fireevent check ( want fireevent check mouse click ) ? (setvalue doesn't work ). you should suspend events before set value , resume events after this. example: mycheckbox.suspendevents(false); // stop events. //be careful it. dont forget resume events! mycheckbox.setvalue(!mycheckbox.getvalue()); // invert value mycheckbox.resumeevents(); // resume events

java - Why won't Eclipse remember my launch configuration? -

i using eclipse 3.6 helios on windows. lately, eclipse install has been behaving erratically when attempt run/debug programs. in past, eclipse launched project used configuration whenever pressed ( ctrl ) f11 while in editor window file within particular project. i've set simple test project (for android app, it's same regular java application) , set proper configuration, each time attempt run/debug it, eclipse asks me kind of application is, , have manually select configuration list (which includes options such "javascript," not apply of projects). what doing wrong? please see this post instructions how set eclipse launch last used configuration. the settings panel configuration @ workspace preferences / run-debug / launching

instant messaging - PC to PC communication using Java -

is there such thing communicate 1 pc pc using java. concept same window live messenger want know if there such thing. if there is, can give example regards have @ smack api uses jabber: http://www.igniterealtime.org/projects/smack/ gettting started guide: http://www.igniterealtime.org/builds/smack/docs/latest/documentation/gettingstarted.html tutorial: http://pauldeng.blogspot.com/2009/09/smack-api-tutorial.html

nested functions are disabled, use -fnested-functions to re-enable-Objective C -

i getting errors when porting map objective c. typedef map<uint32_t,string>eventmaptype; eventmaptype ceventmap; error: nested functions disabled, use -fnested-functions re-enable error: expected '=', ',', ';', 'asm' or ' attribute ' before '<' token error: cannot find protocol declaration 'uint32_t' error: cannot find protocol declaration 'string' error: expected ';' before 'ceventmap' compile source objective-c++ (use mm extension)

iphone - UITableViewCell isn't accessible with standard method? -

i'm working on project has controller, controller , holds logic (i.e. uitableviewdelegate ). have view, view1 subclasses uiview containing uitableview property. my problem want update first row (which sort of header-row) when happens. thought call: uitableviewcell* headcell = (uitableviewcell*) [view1.tableview cellforrowatindexpath:[nsindexpath indexpathforrow:0 insection:0]]; but doesn't seem work. headcell (null) when nslog(@"%@", [headcell description]); my controller calls [view1.tableview setdelegate:self] , trying call [self cellforrow..] got unrecognized selector. nsindexpath should correct, right? i've tried read on this, seems cellforrowatindexpath work, can't. got ideas? edit: did workaround instead, can't accept answers without having tested them. though. workaround create cell referenced in cellforrowatindexpath: -method , tweak manually somewhere else. know it's not best practice, don't have time

Error message: "unexpected termination of script, debugging ended", when debugging PHP with Xdebug and Eclipse -

Image
i'm getting following error when debugging: php.ini settings: xdebug.remote_enable=true xdebug.remote_host=localhost xdebug.remote_port=9000 xdebug.remote_handler=dbgp assuming no syntax errors, make sure not have watches cause script crash debugger attempts evaluate them. from experience, common cause such death. regardless of that, may wish change internal web browser, ie tends provide cryptic error messages, or use external browser session (and use remote debugging).

"My Location" in Google Maps javascript API -

is there way use "my location" button exist on google maps in own webbapplication using javascript api? have read adding controls here google maps javascript api v3 controls haven't found "my locaton" control. there's no geolocation button in google maps api v3. it's not difficult implement 1 yourself. information implementing geolocation can found in google maps javascript api documentation . if want add geolocation button map control, read custom controls section of google maps documentation.

Java read values from text file -

i new java. have 1 text file below content. `trace` - structure( list( "a" = structure(c(0.748701,0.243802,0.227221,0.752231,0.261118,0.263976,1.19737,0.22047,0.222584,0.835411)), "b" = structure(c(1.4019,0.486955,-0.127144,0.642778,0.379787,-0.105249,1.0063,0.613083,-0.165703,0.695775)) ) ) now want is, need "a" , "b" 2 different array list. you need read file line line. done bufferedreader : try { fileinputstream fstream = new fileinputstream("input.txt"); bufferedreader br = new bufferedreader(new inputstreamreader(fstream)); string strline; int linenumber = 0; double [] = null; double [] b = null; // read file line line while ((strline = br.readline()) != null) { linenumber++; if( linenumber == 4 ){ = getdoublearray(strline); }else if( linenumber == 5 ){ b = getdoublearray(strline); } }

Horrific SVN merge - is it possible to import repo to Git and use Git to merge? -

as above, possible export svn repo history new git repo , use git merge branch trunk? once you've merged, then? want import code svn? you'll lose merge information. you can migrate git - there answers on so, , can use git-svn put sort of git front-end svn repo.

wpf - PageBreak in flow documents at runtime -

this first post.... have problem in task…..iam able text file on flow document have divide contents in proper pagebreaks @ runtime i.e if contents huge shud in number of pages @ runtime. please help….. iam attaching initial code: using system; using system.collections.generic; using system.linq; using system.text; using system.windows; using system.windows.controls; using system.windows.data; using system.windows.documents; using system.windows.input; using system.windows.media; using system.windows.media.imaging; using system.windows.navigation; using system.windows.shapes; namespace textonflowdoc { /// <summary> /// interaction logic page1.xaml /// </summary> public partial class page1 : page { public page1() { initializecomponent(); paragraph paragraph = new paragraph(); paragraph.inlines.add(system.io.file.readalltext(@"c:\lis.txt")); paragraph.fontfamily = new fontf

objective c - displaying String in webview -

i'm trying display set of strings webview, know can done, try create own html it, [contentwebview loadhtmlstring:[nsstring stringwithformat:@"<html><head><link rel=\"stylesheet\" href=\"default.css\" type=\"text/css\" /><script type=\"text/javascript\" src=\"default.js\"></script></head><body%@>%@</body></html>", cssfontsizeoverride, webcontent] baseurl:nil]; but result, never show anything, i'm having blank page. 1 know how troubleshoot this? thanx in advance. you're referencing external resources relative urls (default.css, default.js). can loaded if provide base url.

Javascript - Need a moving vertical carousel to display brands -

i need this display brands sell on our online store. 1 doesn't move unless "click" next or "previous" , have specific instructions have moving automatically. anyone know script satisfies needs? i go modifying automatically move javascript skills non-existent. thanks! i think jquery plugin flexible carousels. vertical, horizontal, autoscrolling , on. http://sorgalla.com/projects/jcarousel/ edit: or prototype: http://code.google.com/p/prototype-carousel/

sql server - Do table hints apply to all tables or only the preceding table? -

if have select * tablea, tableb (nolock) does nolock hint apply tableb, or apply both tables? need do select * tablea (nolock), tableb (nolock) for hint apply both tables? table hints apply preceeding table. need select * tablea (nolock), tableb (nolock)

Why is Fast Report VCL in Delphi raising a stack overflow exception when editing a variable? -

i using delphi 5 , fast report 4 make report application. have defined variable "reporttitle" in myreport.f3 @ design time , assigned value @ runtime. why code raising estackoverflow exception? here code sample frxrprt1.loadfromfile('c:\myreport.fr3'); frxrprt1.variables['reporttitle'] := 'sales summary report'; frxrprt1.showreport; use this: frxrprt1.variables['reporttitle'] := '''sales summary report'''; the "variable" values treated full-fledged expressions; if want string, needs standard pascal constant, using single-tick quoting; , since you're doing pascal code, need quote quotes double-quoting. you stack overflow because fast report's scripting engine trying make sense of whatever wrote , runs recursive problem.

java - Why do so many methods use Collection rather than Iterable? -

with c# grew love ienumerable<t> interface. there lot of cases that's want give out , take in. in addition it's useful in .net library. have example constructor on list<t> class takes ienumerable<t> . i have work java @ moment, , naturally wanted use equivalent iterable<t> interface. however, doesn't seem can use anywhere. seems using extended collection<t> interface instead. why this? as example, have arraylist<t> constructor takes collection<t> : constructs list containing elements of specified collection, in order returned collection's iterator. why not take iterable<t> instead? iterable added in java 5. means older methods (most of them) use collections. newer methods take iterable haven't used it. :( i think problem iterable collections.

connect - adding a Facebook Event to a website -

so i've created event in facebook. want add event website (like how can add facebook fan page site). is possible? it's possible using fql: http://developers.facebook.com/docs/reference/fql/event/

apache - A different document root for beta users? -

i have wordpress based php application running on apache on ubuntu server. have developed new version of application, , i'd users access beta. server's structure this: /var/www/site /var/www/betasite i don't want these users run site of different domain/subdomain. both sites supposed run off same wordpress database , hence need same domain. changing wordpress theme based on session/cookie not possibility because have lot of assets/plugins outside wp-content/themes folder. i thinking of giving beta users cookie, , redirect requests cookies new document root. have been trying mess around htaccess's mod_rewrite, after lot of experimentation, figured mod_rewrite cannot redirect stuff outside apache's document root. need virtual host setup based on cookie in request header. ideas? running under separate (sub)domain best option. there no reason cannot use same database across both instances provided both site versions can use same database schema.

NetBeans 7.0 Randomly delete files from server on 'Download' command -

i add new php project remote server i download source files pc when netbeans downloads files, randomly deletes files server. why happen? my configuration is: netbeans 7.0, default configurations. remote sever via ssh. (sftp) this issue has been logged, reproduced , apparently fixed 7.1 target. http://netbeans.org/bugzilla/show_bug.cgi?id=202673 in meantime, after each full download of site, find inside remote log console window dele (match case, whole word) command. identify files deleted , can re upload them. if that's tedious , have time coffee break, re-upload entire directory after downloading it. it seems have upload on save feature, if turn off, presumably issue should go away well. you can grab latest nightly , issue should resolved, according primary committer.

ios - Turn Wifi on/off for iphone from an application -

i need turn on or off wifi in iphone. ways of doing it? or forbidden (private framework) all applications written public sdk sandboxed. have access properties , data apple deems feasible use within sandbox. afraid wi-fi doesn't come in list pls take @ question iphone wi-fi manager sdk , discussion

What's the best jQuery plugin for this job? -

i looking jquery plugin case. a page shows list of products. when product clicked, product detail information displayed div layer @ same page , other things @ background blurred. , users can add product cart there or uses can close , background comes back. it's lightbox plugin function shows general info not image. can suggest plugin this? thanks. sam my personal favourite jquery based fancybox plugin. fancybox plugin link it allow gallery based grouping of image dialogs custom html content displayed per item per requirement. with regards ecommerce aspect, you'd need tweak dialog plugin achieve purpose of dialog plugins specific ui rendering , not designed specific use.

android - Widget 4x2 - appwidget-provider minWidth and minHeight for all resolution -

i'm working on 4x2 widget size, , wonder appwidget-provider declaration, want widget works hdpi - ldpi - mdpi screen : <appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" android:minwidth="294dp" android:minheight="144dp" android:initiallayout="@layout/widget_message" android:configure="fr.cdcorp.homewidget.configurationactivity.wdwidgetconfiguration" android:updateperiodmillis="43200000" /> are these settings ( android:minwidth="294dp" and android:minheight="144dp" ) ldpi , mdpi? do need detect screen size , set programaticaly different minwidth , minheight medium , lowscreen size? the layout use background image 294px x 144px -16bit , need have lower resolution in drawable-hdpi , drawable-mdpi , drawable-ldpi ? furthermore, need change programmaticaly image background, need test screen size , put correct image it? thanks answers ! christophe.

user - Account verification: Only 1 account per person -

in community, every user should have 1 account. so need solution verify specific account 1 user owns . time being, use email verification . don't need users' email adresses. try prevent multiple accounts per person. but doesn't work, of course. people create temporary email addresses or own several addresses, anyway. register using different email addresses , more 1 account - not allowed. so need better solution (easy circumvent) email verification. way, not want use openid, facebook connect etc. the requirements: verification method must accessible users there should no costs user (at least 1$) the verification has safe (safer email approach) the user should not demanded expose private details ... do have ideas approaches? thank in advance! additional information: my community browser game, namely soccer manager game. thing makes multiple accounts attractive users can trade players. if have 2 accounts, can buy weak players excessive prices no &quo

r - loop over colums with semi like columnnames -

i have following variable , dataframe welltypes <- c("lc","hc") qccast <- data.frame( lc_mean=1:10, hc_mean=10:1, bc_mean=rep(0,10) ) now want see welltypes selected(in case lc , hc, different ones.) for(i in 1:length(welltypes)){ qccast$welltypes[i]_mean } this not work, know. how loop on columns? and has happen variable wise, because welltypes of unkown size. the second argument $ needs column name of first argument. haven't run code, expect welltypes[i]_mean syntax error. $ similar [[ , can use paste create column name string , subset via [[ . for example: qccast[[paste(welltypes[i],"_mean",sep="")]] depending on rest of code, may able instead. for(i in paste(welltypes,"_mean",sep="")){ qccast[[i]] }

ios - Setting kABPersonType -

i'm trying set kabpersontype value contact (abaddressbook ios). abrecordsetvalue(person, kabpersontype, [currentcontact persontype], nil);//person type (individual or company [currentcontact persontype] nsnumber. an error gets thrown when reach abaddressbooksave. as follows; *** terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[nscfnumber length]: unrecognized selector sent instance 0x6805ff0' in other cases; e.g. abrecordsetvalue(person, kabpersonnoteproperty, [currentcontact note], nil); the setting of properties fine. any ideas why happening? cheers, rich you cannot set record's record type. record type determined type of record create ( abpersoncreate() or abgroupcreate() ) , cannot changed later. if mean set person record kind (to person or company) instead, have use correct constants: kabpersonkindproperty second argument, , value argument ( nsnumber ) must contain kabpersonkindperson .

json - Fullcalendar jQuery - Possible to retrieve colour from google calendar? -

i know possible set colour events based on source such google calendar, wondering if there way retrieve colour automatically set on google calendar itself? looking through gcal.js, there doesn't seem pushed regarding colour, in google's json api (json-c however), there reference colour. http://code.google.com/apis/calendar/data/2.0/developers_guide_protocol.html#retrievingallcalendars i suppose matter of feature request fullcalendar i'm wondering if missing in there? thank you! the color of calendar not in xml,ical feed. shown in list of calendars available user. lists calendars , uses the: gcal namespace element reference google calendar provides several extension elements use in metafeed (the feed lists user's calendars). these elements in gcal namespace, not google data namespace, because they're specific calendar so unfortunately, gcal.js not support getting list , not color unless use plugin so. in case have been eas

git svn - git svn clone > git svn rebase > Unable to determine upstream SVN information from working tree history -

i trying keep read-only checkout of ,http://googleappengine.googlecode.com/svn/trunk/python git repository, stored remote in github. 1) $git svn clone http://googleappengine.googlecode.com/svn/trunk/python . 2) $git svn rebase -- unable determine upstream svn information working tree history so started reviewing .git/config file fix problem, , at: [svn-remote "svn"] fetch = :refs/remotes/git-svn url = http://googleappengine.googlecode.com/svn/trunk/python [remote "origin"] fetch = +refs/heads/ :refs/remotes/origin/ url = git@github.com:...private_url... [branch "master"] remote = origin merge = refs/heads/master my need fetch , merge last commit, , push changes github. i've been looking solutions , none seem work me far, pointers helpful. thanks in advance :) the best thing clone entire repo (even if gets java stuff don't want): git svn clone -s http://googleappengine.googlecode.com/svn/ (-

android - How to get primary email address on 1.6? -

is there way primary email address on android 1.6 ? if yes, please suggest me. thank in advance. see sohilv's answer this question .he says: download framework.jar from: http://github.com/android/platform_frameworks_opt_com.google.android/ ... , add build path. sort of interface google device functions. call method: com.google.android.googlelogin.googleloginservicehelper.getaccount(activity activity, int requestcode, boolean requiregoogle); where: activity: activity result in onactivityresult() requestcode: code requiregoogle: should true ex. googleloginservicehelper.getaccount(mactivity, 123, true); 3.override onactivityresult() like: protected void onactivityresult(int requestcode, int resultcode, intent data) { super.onactivityresult(requestcode, resultcode, data); if(requestcode == 123){ system.out.println(resultcode); string key = "accounts"; system.out.println

Keyboard events in IE9 html explorer bar -

claim: keyboard events aren't dispatched in ie9 html explorer bars. proof: try running html below in ie9 html explorer bar. expected: alert should shown after pressing key anywhere on document (of explorer bar - note alert shown loading html normal ie9 tab). actual: nothing happens. the question is: can ie9 html explorer bar configured enable keyboard event handling? the html: <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>ie9</title> </head> <body> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.js"></script> <script> $(document).ready(function() { alert("before event registration"); $(document).keydown(function() { alert("inside event handler"); }); }); </script> </body> </html> a

parse xml namespace with php -

this question has answer here: parse xml namespace using simplexml 7 answers i have been trying extract data xml file google calendar not success namespaced stuff. it gd , gcal data having problems - i've searched on , haven't been able work :( any appreciated! :) <?xml version='1.0' encoding='utf-8'?> <entry xmlns='http://www.w3.org/2005/atom' xmlns:gcal='http://schemas.google.com/gcal/2005' xmlns:gd='http://schemas.google.com/g/2005'> <id>http://www.google.com/calendar/feeds/abc%40group.calendar.google.com/private-abc/full/abc</id> <published>2011-05-03t07:45:56.000z</published> <updated>2011-05-03t07:45:56.000z</updated> <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event'/> <title type=&

regex - sed problem. What am I doing wrong? -

i trying replace a[ 'xxx' ] a[ xxx ] using sed: sed -e 's/a[ '\(.*\)' ]/a[ \1 ]/' ./test sed: -e expression #1, char xx: invalid reference \1 on `s' command's rhs what doing wrong? thanks! you need escape [ , ] this: echo "a[ 'xxx' ]" | sed "s/a\[ '\(.*\)' \]/a[ \1 ]/"

javascript - Error adding and removing content to tabPanels - ExtJs -

i have web app built using extjs framework. i have tree in west panel, , in center panel tabpanel. when click on of nodes on tree in west panel attempts add form on center tabpanel, following code called: var center = ext.getcmp("center-panel"); var existingpanel = center.get(panelid); if (existingpanel) { center.setactivetab(existingpanel); } else { var activetab = center.getactivetab(); if (!opennew && activetab) { var removed = center.remove(activetab, true); } center.add(c); center.setactivetab(panelid); center.dolayout(); } this retrieves current component, , checks see if tab attempting load exists, if exist activates tab, otherwise attempt add new one. opennew s flag passed in state whether should opened in new tab (for example if user ctrl+clicks node on tree). without using opennew functionality (e.g. 1 tab) form works correctly, , can navigate between nodes tabs being removed/re-added correctly

android - About extending LinearLayout -

i need create view extends linearlayout contain standard android widget. i've created class mylinearlayout extends linearlayout class; now, how can use element in xml layout file? can't working , haven't been able find info , i'm bit confused... o.o assuming package com.example; public class mylinearlayout extends linearlayout... in xml can use <com.example.mylinearlayout android:id="@+id/mylayout" [rest of attributes go here] > [other stuff here] </com.example.mylinearlayout>

mono - Creating Protocol/Delegate in Monotouch -

i'm bit confused how create custom protocol/delegate type in monotouch. the obj-c equivalent @protocol cellcontroller - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath (nsindexpath *)indexpath; @optional - (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath; @end does implementation have abstract class, interface or what? i'm sure not complicated, can't head around it. code example helpful, getting pointed in right direction still extremely helpful cheers r so ended doing creating interface , using :)

php - RewriteCond: any workaround to match the HTTP_REFERER with HTTP_HOST? -

1) need verify whether connections referred same site or else. 2) can not type http_host manually because .htaccess file meant handled subversion , shared across different development environments different http_host values so goal find workaround make condition work transparently no matter environment is, , keep htaccess handled svn without need of manual fixes. thanks! with apache 2 can this: rewritecond %{http_referer} ^$ [or] rewritecond %{http_referer} ^[^:/?#]+://([^/?#]+) # authority rewritecond %1 ^(?:(?:[a-za-z0-9-._~!$&'()*+,;=:]|%[0-9a-fa-f]{2})*@)?((?:[a-za-z0-9-._~!$&'()*+,;=]|%[0-9a-fa-f]{2})*)(?::\d+)?$ # host name rewritecond %1/%{http_host} !^([^/]+)/\1$ # compare http_host rewriterule ^ … note http_host can empty in case of pre-http/1.1 request.

python - How do I make VirtualEnv use a custom version of setuptools? -

the large corporation work uses custom version of setuptools. private fork of setuptools intended deal networking , security difficulties unique our organization. bottom line neither standard setuptools nor distribute work expected on our environment. id start using ian bicking's excellent virtualenv tool on systems, particularly in our test systems need able set large number of sandboxed areas test-code - e.g. in our continuous integration environment. unfortunately time try build new virtual environment virtualenv tool tries obtain , install latest official version of setuptools. fail reason stated above, , because corporate firewall block action. instead of installing official version: setuptools-0.6c11-py2.4.egg i'd install our customized version might called like: setuptools-foo-0.6c11-py2.4.egg this egg can guaranteed found in system's global site-packages. can guarantee it's present in of our corporate egg servers. can me make virtualenv use

Using LINQ to exctract all hidden inputs from an HTML using C# -

hello have following html webclient code <body onload="window.focus()"> <form name="form1" method="post" action="/www/www.do"> <input type="hidden" name="value1" value="aaaa"> <input type="hidden" name="value2" value="bbbb"> <input type="hidden" name="value3" value="cccc"> <input type="hidden" name="value4" value="dddd"> <input type="hidden" name="value5" value="eeee"> more html..... </body> how can extract names , values input type hidden using c# linq or string functios? using htmlagilitypack, can following: var doc = new htmlweb().load("http://www.mywebsite.com"); var nodes = doc.documentnode.selectnodes("//input[@type='hidden' , @name , @value]"); foreach (var node in nodes) { var inputname = nod

vba - How To Programmatically Wait For Shell Command To Finish Running? -

i sending emails in program so: call shell(smtppath, emailinput...) this works great, except if call function twice, function runs first time, calls shell command, function runs again, , calls shell command again, first shell command not completed, there error because second shell command trying use same smtp file first 1 (that still in use). how can make function wait until shell command has finished running? addendum: or there way can see if file being used, , if is, sleep it, try again? you use wscript.shell , , it's run method: set objshell = createobject("wscript.shell") result = objshell.run(smtppath & " " & emailinput, 0, true)

JQuery datepicker - Selecting the last day of the month -

in report generator wrote user can select date range display results for. since data report generated monthly day portion of date range irrelevant. have requirement change day of selected start date '1' regardless of user has selected. i've done so: $('#textstartdate').datepicker({ maxdate: "+0m", mindate: "-24m", dateformat: 'm/1/yy' }); the second pard of requirement day of selected end date set last day of month regardless of day selected. if user selected end date of 5/16/2011 date field show 5/31/2011. stuck. any appreciated. the consistent technique have found is: add 1 month select day round first day of month subtract 1 day. not pretty, works. plan b: round first of selected month add 1 month subtract 1 day note: working on quick sample code add later

openssl - Creating SSL sertificate with trusted CA -

i'm not quite sure if question applies forum if maybe knows if possible using open ssl create ssl sertificate browsers wouldn't throw warning messadges our created ssl sertificate untrusted? technically possible if have ca's private key sign newly created certificate. don't have key, answer no. go ahead , purchase certificate 1 of cas. if minimal research, find cas offer affordable prices.

jquery - qtip - distinct results on distinct table rows -

i have table few rows, after use hover mouse on row want display qtip ( http://craigsworks.com/projects/qtip/docs/#create ) tooltip. how can refer row id in function, define displayed content: $(document).ready(function() { $('.qtip').qtip({ content: $(this) <-- don't work }); }); i have tables rows this: <td class="qtip" id="pic-<?php echo $item->product_id; ?>"> i want display row id in tooltip. (for example pic-1232) you can use $(this).attr('id') content of qtip plugin. btw not row id cell id id of td element. @pkkid set class on tr element , work on whole row.

jquery autocomplete/type to select from list -

does jquery ui (or other) autocomplete plugin allow me know if text in textbox still item selected list? i want users able type, autocomplete menu , choose item. if continue typing or delete characters etc, need know item has been deselected. is possible without customisation? is there better plugin or approach this? thanks there's facebook style input box, kind of thing after? http://ajaxian.com/archives/facebook-style-input-box edit the jquery ui autocomplete sets data object on input element can access through .data() so: $('input').data('autocomplete').selecteditem.value; fiddle: http://jsfiddle.net/qk3ma/1/

Email all output from Powershell script -

i have powershell script loops through number of files , writes file information console. gets output screen need send via email. the email part easy, can't figure out how capture gets sent screen , send in body. here relevant code. first iteration gets stored in $emailbody variable. edited example: $backuplocations = #list of paths# $emailbody="" $currentfile = "nothing" foreach ($loc in $backuplocations) { $files = get-childitem "$loc\\*" -recurse -include *.bak foreach ($file in $files) { if (test-path $file) { $prop = get-itemproperty -path "$file" write-output $prop | tee-object -variable $currentfile $emailbody += $currentfile } } } # code send $emailbody in email. working fine.# what see on screen pages worth of file information such this: directory: \\directory\directory\directory\myfolder mode lastwritetime length nam

flash of unstyled jQuery UI tabs -

i'm using jquery ui tabs , i'm bothered flash of unstyled content until widget loads. i'm trying display loading image before tabs load can't work. please advise. thanks. $(function() { var loading = "img src='spinner.gif'"; $("#producttabs").html(loading).tabs(); });

Pass Japanese Characters to a SQL Server stored procedure -

i'm trying pass japanese characters stored procedure in sql server. characters converted ???? during execution , hence incoreect results. how pass them such characters? tried using nvarchar accepts unicode, no luck. if not use stored procedure , construct sql query string dynamically in app, things work fine. kindly help update declare @string nvarchar(1000) set @string = @keyword select * table title @string called using exec @return_value = storedprocname @keyword = n'japanese word' update 2 i add following if helps. constructing query dynamically works. if in app write sql = "select * table title '"+[japaneseword]+"'"; works. unable determine unicode failing stored proc solution nvarchar key problem. in case interested knowing how use form freetext search string, here go declare @string nvarchar(100) set @string = 'formsof(inlflectional,"'+@string+'"))' use in query. like select * ta