Posts

Showing posts from January, 2011

jQuery crashing IE -

i have website crashing internet explorer on users computers. i'm lucky enought hat few people h\ve contacted me tell me otherwise wouldnt know anuthing it. it doesnt happen on everyones pc i'm bit lost causing ie crash. website uses jquery 1.4.2. best way ot trapping error can find out what's going on? thanks al first, find computer can reproduce problem. compare browser versions , windows versions. microsoft has script debugger pretty once running, in case, more primitive simple , effective method put alert() source code until point reached things crash.

.net - C# ? : operator -

could explain me following compiler issue error: type of conditional expression cannot determined because there no implicit conversion between 'string' , 'int' // works string text = string.format( "the id {0}", _obj.id.tostring()); // works, without implicit conversion <<< string text = string.format( "the id {0}", _obj.id); // works string text = string.format( "the id {0}", (_obj == null) ? "unknown" : _obj.id.tostring()); // no way <<< string text = string.format( "the id {0}", (_obj == null) ? "unknown" : _obj.id); in last example, there no implicit conversion, well. eric lippert's cast operators not obey distributive law

ggplot2 - R CMD check NOTEs on ggplot, subset, etc -

when using ggplot or subset, r cmd check command on package generates following notes: * checking r code possible problems ... note foo: no visible binding global variable ‘bar’ for mock function such foo <- function(dataframe) { subset(dataframe,bar>10) } that r cmd check section useful when forgetting usage of global variables in package. therfore i'd have clean. is there possibility let r know of special nature of ggplot/subset? that's reason note not warning or error - there's no automated way detect use of non-standard evaluation in function.

java - Maven multi-module project - how to run an operation after all submodules have finished -

i have multi module maven project , i'd able run operation (antrun) after submodules have finished execution. in projects build rpms each sub-module , in deploy phase copy rpms (by ssh) rpm repository. rpm repo requires me run createdb command after adding new rpms can index them. have antrun runs scp , copies rpms repo. runs each submodule produces rpm , hooked maven deploy phase. can after each scp run createrepo command that'd wasteful, have more 10 submodules , each createrepo takes minute i'll wasting precious build time. what i'd after submodules have finished, run createrepo. once. my first attempt hook antrun calls createrepo command parent pom's (the super-pom) deploy phase. did , problem parent's deploy phase runs before submodules' deploy phase. wanted run after can't attach createrepo antrun other later phase since deploy phase last in lifecycle. so question is: there way run "cleanup" antrun or plugin in gene...

apple push notifications - APNS spoof/fake -

i want have standalone network (no internet access) testing. there way spoof apns servers test notifications , mdm. there way create own apns server. sure. apns protocol defined in apple's documentation here: the binary interface , notification formats . basically, it's ssl server speaks simple binary protocol. have implemented mock push server , feedback server our internal testing.

php - prevent mysql MyISAM table crashes -

i've been having problems database repeatedly having crashed tables. luckily it's easy enough fix repairing crashed table, it's hardly practice have watch table crash (or have client tell me) , fix it. crashes tend occur after change has been made database client has access via cms. i noticed recent time table crashed referenced number - found 57 of 89; noticed in cardinality primary key. putting 2 , 2 googled cardinality , found optimising table in way related , thought optimising table regularly, after update, prevent crashes. true or have managed 73 rather 4? i can send mysql functions database when client makes changes via php, perspective great. any other table crashes appreciated. is not true optimize table prevent table crashing in fact, u should not run optimize table (table locked) although designed compact free data try mysqlcheck -c or mysqlcheck -c

How to design cleaner PostMessage chain in WinApi/MFC -

i have mfc gui app has multiple frames (sort of outlook'ish behavior main window, , message/appointment windows being created in new frames, or skype multi frame syncronization), , need postmessage malloc'ed data through window hierarchy. say, string, _wcsdup it, postmessage(wm_newstring, ...), and, control somewhere deep down hierarchy processes it, or if there no subscribers, message get's cleaned. what looking now, messages posted application thread, thread finds active frame or best fit frame, passes message it, frame passes message it's view, view passes message subview , on, if there no view process message, get's free'd. the problem these chaining commands pretty tiring write, have duplicate message forwarding code in each cwnd class have. @ same time, resource cleanup pretty unpleasant, because if there no window catch message, has call free. therefore posting message main message pump without handling, hoping catch it, not valid approach. post...

Changing UIPickerView's font size from HTML5 -

how set uipickerview's (in iphone/itouch)font size html5. situation writing mobile web page has dropdown. drop down text seems spill out of uipickerview show when user selects dropdown. there way control spill? solution decrease font size of uipickerview control. not sure if can control native control html. suggestions helpful. thanks in advance.

html - Random behaviour of anchor tags -

i have anchor tag in html used javascript event. code looks this <a href="#" onclick="myscript()">run</a> however, when click script, first time links clicked reloads page. second , subsequent clicks, executes javascript. my first thought was url my url is http://localhost/mypage.php?someid=1234567 but, after clicking javascript link first time, changes to http://localhost/mypage.php# my solution @ moment change anchor tag span, , mimic behaviour using javascript , css, hacked solution. why happening? there way prevent this? my application java struts application, , runs inside frame. the reason don't stop default action of link, go url # . return false event: <a href="#" onclick="myscript();return false;">run</a>

javascript - Is it possible to programmatically detect the caret position within a <input type=text> element? -

assuming regular <input type=text> text-box data in it. is possible detect (via javascript) position of text-coursor inside text-box? i able detect arrow left or arrow right keydown event - how detect cursor location? why need this: i have dynamic text-box here: http://vidasp.net/tinydemos/dynamic-textbox.html works great, there 2 scenarios fix: when cursor @ beginning of text-box , user presses backspace when cursor @ end of text-box , user presses delete (in both cases, text-box must contain data effect observable.) i've done quite lot of work on this. following works in major browsers (including ie 6) text <input> s , <textarea> s , work in situations, including when there leading , trailing spaces (which many solutions, including a-tools, fall down). there's background code in question: ie's document.selection.createrange doesn't include leading or trailing blank lines you can following part of jquery input/tex...

jquery - problems with google map displaying images in new window when using fancybox -

i having few issues fancybox , google maps(v3) when displaying contents of kml file. when displaying balloon contains description, have thumbnail of image want display when clicked using fancybox. problem have when thumbnail clicked the fancybox displays browser spawns new window displaying full size image. i know when kml file parsed href tags have target attribute added, i've tried remove once map has loaded, during same time attach fancybox link. i ensure map has loaded before try: i.e. function updatemap(surveyid){ var map; var myoptions = { zoom: 5, maptypeid: google.maps.maptypeid.hybrid }; var url = "https://myurl/feed/kml.php?action=survey&id=" + surveyid; map = new google.maps.map(document.getelementbyid("googlemap"), myoptions); var kmllayer = new google.maps.kmllayer(url); kmllayer.setmap(map); google.maps.event.addlistener(map, "tilesloaded", function(){ attach...

Trigger silverlight datagrid to resize -

i have situation i'm using datagrid display 2 different sets of columns based on data being displayed. hide/display columns based on data , 1 type has more columns displayed. example of type of setup have is: type1 columns: name, dob, address, height, weight, occupation, years experience. type2 columns: name, dob, address, height, occupation, marital status, hair color, eye color, ethnicity. my datagrid columns union of these 2 sets. when display type1, 7 columns of equal width. when switch type2, set weight , years experience collapsed , set marital status, hair color, eye color, , ethnicity visible. first 3 columns retain width , last 6 columns scrunched down fit. know how trigger resize of columns? edit: i'm using width="*" columns call updatelayout on grid

entity framework 4 - EF CTP4 when to call context.SaveChanges -

i'm trying replicate many of practices use nhibernate in ef ctp4. currently have generic repository interface (ctp4 makes quite easy dbcontext.set). we passing in context , using structuremap scope per httprequest. with nhibernate pass in isession (again created using structuremap) use actionfilter (unitofwork) commit transaction @ end of request. do have equivalent transactions in ef ctp4? if not, should use same filter call context.savechanges() or inside repository. on side note, what's easiest way of testing see whether entity new or not. nh have luxury of calling isession.saveorupdate. note entities use guid identifier. perhaps check default(guid)? thanks. i know late answer have figured out guess useful people searching. rob conery has great post on using actionfilter , ef create transactions per request scope. rob c article oh , yes create updateinsert() method on generic repository test default(guid).

Xpath expression for getting an attribute value fails in Java -

i trying attribute value xml file, code fails exception below: 11-15 16:34:42.270: debug/xpathutil(403): exception = javax.xml.xpath.xpathexpressionexception: javax.xml.transform.transformerexception: illegal tokens: '@', 'source' here code use node list: private static final string xpath_source = "array/extconsumer@source"; mdocument = xpathutils.createxpathdocument(xml); nodelist fullnamenodelist = xpathutils.getnodelist(mdocument, xpath_fullname); and here xpathutils class: public class xpathutils { private static xpath xpath = xpathfactory.newinstance().newxpath(); private static string tag = "xpathutil"; public static document createxpathdocument(string xml) { try { log.d(tag , "about create document builder factory"); documentbuilderfactory docfactory = documentbuilderfactory .newinstance(); log.d(tag , "about create...

debugging - Check if object exists in JavaScript -

how verify existence of object in javascript? the following works: if (!null) alert("got here"); but fails: if (!maybeobject) alert("got here"); error: maybeobject not defined. you can safely use typeof operator on undefined variables. if has been assigned value, including null, typeof return other undefined. typeof returns string. therefore if (typeof maybeobject != "undefined") { alert("got there"); }

asp.net - My ajax request times out (or is really slow) -

my first forray ajax webpages causing me problems. my basic structure have table on page, want reload without refreshing entire page. so on clicking button on page fires of this: function refreshmissionsajax() { //fade out old table. $(clientid('missionsdisplay')).fadeout(500); //request new value page (calls getincompletemissions() method in missionviewer.aspx.cs page) $.ajax({ type: "post", url: "missionviewer.aspx/getincompletemissions", data: "{}", contenttype: "application/json; charset=utf-8", datatype: "json", success: function (msg) { $(clientid('missionsdisplay')).html(msg.d); $(clientid('missionsdisplay')).fadein(500); }, error: function (xhr, ajaxoptions, thrownerror) { $(clientid('missionsdisplay')).html('an error occured while trying refresh page data.'); $(clientid('missionsdisplay'))...

java - Profiler plugin for eclipse -

does know 64 bit profiler jvisualvm exists or not eclipse ? have tried lot search on net. please suggest if know profiler tools eclipse .... thanks.... i've been using jprofiler current project , it's helpful. here site: http://www.ej-technologies.com/products/jprofiler/overview.html

jquery assigning click function from a plugin -

it's old project i'm updating not th prettiest of coding. i trying adapt plugin specific needs, plugin in question simple colapsible panel plugin. i want able style each panel different color depending on rel assigned div. its php code generates css , code div, call jquery apply collapsible panel plugin. it styles ok click function not work, pointers helpfull: thinking need apply .delegate() somewhere not sure how to. the url: http://www.reelfilmlocations.co.uk/new%20search/fullsearch_rework.php test results: click [choose all] above select borough selector , click search button. the code creates panel: //all wrapped in php loop: <style type="text/css"> .c_<?php echo $mycurrentborough ?>_color{ color:<?php echo $row_rs_myboroughs['color']; ?>; font-family: arial, helvetica, sans-serif; font-size:12px; letter-spacing:1px; text-transform:up...

list - PHP Order in alphabetical order -

Image
i'm trying make simple alphabetical list order items in database. thing can't figure out how list it. i same format have on miniclip.com here's image i looked around, couldnt find answer really. (i finish @ end of each vertical column, except last 1 sure) any welcome! in mysql: select * table order name asc in php: $fruits = array("lemon", "orange", "banana", "apple"); sort($fruits); foreach ($fruits $key => $val) { echo "fruits[" . $key . "] = " . $val . "\n"; } fruits[0] = apple fruits[1] = banana fruits[2] = lemon fruits[3] = orange

version control - SVN in NetBeans - Initial checkout not getting .svn directories -

i've run through netbeans svn project setup described here: http://netbeans.org/kb/docs/ide/subversion.html however once it's checked out , imported project, files aren't recognized "versioned files" , cannot make commits or compare, etc. when right click file in project there no "subversion" menu item. in fact, there no .svn directories found. any ideas on i'm doing wrong? i have recent version of netbeans mac osx fixed it. had set proper preferences in netbeans specifying svn home folder (/usr/bin).

objective c - iphone - A good json framework -

i've been using sbjson parse json on project. framework has way many leaks. there better framework/library can use parse json? what about: https://github.com/schwa/touchcode .

Embracing the DRY principle in XML -

we have product each customer has xml config file containing sets of ui options , sub-options. example, 1 type of users (call them a's) have 1 set of options , type of users (b's) have different set of options. the problem have , b share of options, though when share option, 1 or more of sub-options differ. now we're getting customers with, instead of 2 types of users, 30 types of users, , customer's config files bloated same piece of information repeated 30 times, creating maintenance nightmare development. which ways recommend apply dry principle situation? you need implement form of inheritance, inheritance in object-oriented programming languages or css, in start set of common options, , allow overridden other options in more specific sets. you establish hierarchy of sets of options, starting @ top options common users, sets of options have identified being common many types of users, , user-specific options. needs represented tree in xml confi...

sql - Please explain the syntax the SQLServer uses to create a check constraint -

when right click on default constraint , ask sql server create create script it, generates following code: alter table [dbo].[tbleventturnjudgestartvalues] nocheck add constraint [tbleventturnjudgestartvalues_executiontoggle] check (([executiontoggle]=(1) or [executiontoggle]=(0) or [executiontoggle]=(-1))) go alter table [dbo].[tbleventturnjudgestartvalues] check constraint [tbleventturnjudgestartvalues_executiontoggle] for record, understand first alter statement not understand the second alter statement does. tried google "check constraint" phrase got hits on add constraint syntax. thanks. seth update joe answer. found link helps. http://blog.sqlauthority.com/2009/11/12/sql-server-disable-check-constraint-enable-check-constraint/ i did not know enable , disable constraints. cool! seth the first statement creates constraint, since created nocheck, existing data not validated @ time of creation. the second statement turns constraint ...

dot net nuke uploading files -

i"m working on dot net nuke site client, wanting upload files of 60mbs. have changed web.config file allow files 65 mbs in size wiggle room. httpruntime usefullyqualifiedredirecturl="true" maxrequestlength="66560" requestlengthdiskthreshold="66560" executiontimeout="1080000" /> this code in web.config file. have tried mp3 files ranging 40 mbs - 60 mbs in size no luck. module upload files of 28mbs or less. using live content module if helps. the connection getting reset. not getting 18 minute timeout have given it, if set 3 minute timeout same error. when uploading file 86% restart when gets 86% again when gets error. <system.webserver> <security> <requestfiltering> <requestlimits maxallowedcontentlength="2000000000" /> </requestfiltering> </security> actually fixed it, dot net nuke set upload files 8mbs, iis set allow files 30mbs. adding code web.config file all...

mercurial - Useful TortoiseHg extensions -

guys, please describe tortoisehg extensions comes installation package? these , use on daily basis? more useful? this list tortoisehg v1.1.5 windows. [extensions] ; extensions shipped mercurial default ; ;acl = ;bookmarks = ;bugzilla = ;children = ;churn = ; warning: color extension not recommended windows ;color = ;convert = ;extdiff = ;fetch = ;gpg = ;graphlog = ;hgcia = ;hgk = ;highlight = ;interhg = ;keyword = ;mq = ;notify = ;pager = ;parentrevspec = ;patchbomb = ;progress = ;purge = ;rebase = ;record = ;schemes = ;transplant = ;win32mbcs = ;win32text = ;zeroconf = ; extensions bundled tortoisehg ;fold = ;hgcr-gui = ;perfarce = ;hgeol = ;mercurial_keyring = my personal favorites: graphlog ascii graph next changesets visualize branching. mq handle local changes series of patches can edited. purge mass delete of unrevisioned files (and ignored files --all). rebase transplant branch onto different changeset. transplant copy changes...

html - Custom data in XHTML 1.0 Strict -

i use custom attributes in html, jquery stuff. saw there data-xyz attributes in html5, need xhtml 1.0 strict. other options have? you can use jquery metadata plugin allows write data in class attribute in json format: <li class="someclass {some: 'data'} anotherclass">...</li> then in jquery, @ data: var data = $('li.someclass').metadata(); if ( data.some && data.some == 'data' ) alert('it worked!'); this should meet requirements of being xhtml 1.0 strict, , allows use plug-and-play solution :)

php - $_GET Breaks XML -

i'm using simpleviewer flash image gallery on site, , uses xml file information images displays. for site, need dynamically generate xml, i'm using php file text/xml content-type declared. however, reason when access 1 of variables in $_get array simpleviewer tells me there no images in gallery, though when view source looks exact same , well-formed. here's code: $photos = array( "1" => array("house1_1.jpg") ); foreach($photos[$_get["hid"]] $p){ echo ''; } if replace $_get["hid"] "1" works fine, when make reference $_get returns error. is there reason why accessing variable cause scripts linking xml (the simpleviewer flash) malfunction, , there way around this? *note: "hid" variable 100% sure set "1", , there no php error. also, output looks same when use $_get["hid"] versus "1", difference simpleviewer script refuses see images there. also, stuff in empt...

silverlight - Should I duplicate my Entity Model? -

let me set lob scenario. i re-writing our core business app. requirements create internally usable app (i'd use silverlight) our employees use on daily basis. need provide soap service can used input orders, invoices, etc. i doing in pieces, when update record in new sql server database, need make sure update our legacy sql server well. so, makes sense create dal pull data new sql server, write 2 data stores. it make sense create bll can used both silverlight/ria , wcf web services. i have created data entity of new database in it's own project , used in other projects. problem here ria seems require create right inside asp.net project in order metadata silverlight. without this, need manually re-create metadata silverlight access correctly. my question then, should create duplicates of entity model? 1 ria , 1 else? there better way this? should forego using ria , have silverlight access wcf services? or should continue duplicate metadata in ria? ...

visual studio - What is counterpart of SIGKILL(in POSIX) in WIN32 -

what counterpart of sigkill(in posix) in win32. vs cannot recognize sigkill. api function terminateprocess closest. sigkill special anyway in posix , not signal. need open process handle openprocess , close afterwards closehandle.

javascript - Read first party cookie using flash/AS3 -

is possible read first party cookies flash? it should noted have complete access javascript via externalinterface class. so, question - can access first party cookie javascript? our javascript code loaded website not hosted us. makes cookies created website - first party cookies. how can access these "first" party cookies? as long have access javascript going reading , writing cookies using external interface javascript problem. this page may useful you: http://www.quirksmode.org/js/cookies.html whatever domain javascript & flash application served domain owns cookies.

C# code to run a batch file works in console application, but same code doesnt work in WCF Service -

this following code pretty simple , works in console application. reason not work in wcf service. directory has batch file has full permissions. can me? missing? try { processstartinfo psi = new processstartinfo(); //specify name , arguements want pass psi.filename = configurationmanager.appsettings["batchfilelocation"]; psi.arguments = filepath; //create new process , set starting information process p = new process(); p.startinfo = psi; //set can tell when process has completed p.enableraisingevents = true; p.start(); //wait until process has completed while (!p.hasexited) { system.threading.thread.sleep(1000); } //check see exit code if (p.exitcode != 0) { logger.write(p.exitcode); } } cat...

VB.NET - Nullable DateTime and Ternary Operator -

i'm having problems nullable datetime in vb.net (vs 2010). method 1 if string.isnullorempty(lastcalibrationdatetextbox.text) gauge.lastcalibrationdate = nothing else gauge.lastcalibrationdate = datetime.parse(lastcalibrationdatetextbox.text) end if method 2 gauge.lastcalibrationdate = if(string.isnullorempty(lastcalibrationdatetextbox.text), nothing, datetime.parse(lastcalibrationdatetextbox.text)) when given empty string method 1 assigns null (nothing) value gauge.lastcalibrationdate method 2 assigns datetime.minvalue. in other places in code have: lastcalibrationdate = if(isdbnull(dr("lastcalibrationdate")), nothing, dr("lastcalibrationdate")) this correctly assigns null (nothing) ternary operator nullable datetime. what missing? thanks! i admit i'm not expert on this, apparently stems 2 things: the if ternary operator can return 1 type, in case date type, not nullable date type the vb.net nothing value not nul...

linq to entities - Implementing if-not-exists-insert using Entity Framework without race conditions -

using linq-to-entities 4.0, there correct pattern or construct safely implementing "if not exists insert"? for example, have table tracks "user favorites" - users can add or remove articles list of favorites. the underlying table not true many-to-many relationship, instead tracks additional information such date favorite added. create table userfavorite ( favoriteid int not null identity(1,1) primary key, userid int not null, articleid int not null ); create unique index ix_userfavorite_1 on userfavorite (userid, articleid); inserting 2 favorites same user/article pair results in duplicate key error, desired. i've implemented "if not exists insert" logic in data layer using c#: if (!entities.favoritearticles.any( f => f.userid == userid && f.articleid == articleid)) { favoritearticle favorite = new favoritearticle(); favorite.userid = userid; favorite.articleid = articleid; favori...

php - cURL issues with Google Voice "APIs" running on XAMPP/Windows 7 -

i'm using aaronpk's google voice apis send , receive sms messages in google voice. i've uncommented "extension=php_curl.dll" line in php.ini , have confirmed curl working. i'm stuck @ point , keep receiving error: uncaught exception 'exception' message 'could not parse galx token' i've checked basic things. username , password on account correct. thing can see curl not writing cookie files. i know script has linux path cookiejar / cookiefile default. i've tried changing windows directory, including full path. code snippet i'm using is: $this->_cookiefile = dirname(__file__) . "\cookies.txt"; even code modification, script not writing cookies.txt file. i've uploaded these scripts linux host , work fine, proving me windows issue. sadly, don't have linux server production environment. i'm looking guidance working within windows. right i'm developing on windows 7 machine run...

bash du with byte size in decimals to the nearest thousandth -

is possible in bash " du " command byte size shown in decimals. for example, have following files (numbers in bytes): 12345 file1 2345 file2 6491 file3 i " du " command in linux output following instead: 12.3 file1 2.3 file2 6.5 file3 note: " -h " flag not work. you should able use awk this, like: du -b * | awk '{printf "%10.1f %s\n", $1/1000, $2}' as in following transcript: pax> ls -l total 3092 -rwxrwxrwx 1 pax pax 807 2008-09-14 08:26 combo.pl* -rwxrwxrwx 1 pax pax 236 2008-09-14 08:26 match.pl* -rwxrwxrwx 1 pax pax 754 2008-09-14 08:26 mkdb.pl* -rwxrwxrwx 1 pax pax 689 2008-09-14 08:26 nine.pl* -rwxrwxrwx 1 pax pax 2089522 2008-05-25 21:06 words.db* -rwxrwxrwx 1 pax pax 1044761 2008-05-25 21:06 words.txt* pax> du -b * 807 combo.pl 236 match.pl 754 mkdb.pl 689 nine.pl 2089522 words.db 1044761 words.txt pax> du -b * | awk ...

ruby on rails - paperclip doesn't create thumbnails on heroku -

i've been trying paperclip upload images amazon s3, original file being uploaded. no thumbnails generated. model has in it: has_attached_file :screenshot, :styles => { :thumb => "100x80>", :medium => "195x150>", :large => "390x300>" }, :storage => :s3, :s3_credentials => "#{rails_root}/config/s3.yml", :path => ":attachment/:id/:style.:extension" the original file in fact uploaded, none of thumbnails appear. if copy src of thumb format image, instance, <error> <code>nosuchkey</code> <message>the specified key not exist.</message> <key>screenshots/8/thumb.png</key> <requestid>b8a408560070e836</requestid> − <hostid> hahucunxgkvdvqe3gnhgt1rcbgfguxa35kqxmyre+ii60djs6r22chdr22coecea </hostid> </error> this running on heroku, forces me use service amazon. not problem documentation can find makes straightfo...

Why concurrency contention tool in vs 2010 doesn't use managed thread ids? -

Image
if have used concurrency contention profile tool provided in vs 2010, notice thread ids used in report not managed thread ids, annoying. want know thread 1 , how can map thread ids (usually 4-digit id) used in report against managedthreadid value can code? thank you. if use 'collect resource contention data' option (see below), able see managed threads names. this described on john robbin's blog , may enough identify managed threads. unfortunately can't mapping managed thread ids.

php request url without waiting for response -

i'm trying variation of file_get_content without waiting content. i'm requesting php script in different url download large file, don't want wait file finish loading. has idea? thank you! try on script download file: //erase output buffer ob_end_clean(); //tell browser connection's closed header("connection: close"); //ignore user's abort. ignore_user_abort(true); //extend time limit 30 minutes set_time_limit(1800); //extend memory limit 10mb ini_set("memory_limit","10m"); //start output buffering again ob_start(); //tell browser we're serious... there's //nothing else receive page. header("content-length: 0"); //send output buffer , turn output buffering off. ob_end_flush(); //yes... flush again. flush(); //close session. session_write_close(); // download script goes here !!! stolen from: http://andrewensley.com/2009/06/php-redirect-and-continue-without-abort/

java - What is a good resource for help on codes to use for App? -

i novice programmer when comes java, have java:how program 7th ed. reading. major computer science have little bit of knowledge yo application. trying make game app , wandering source reference various things inside of app game play. i'm not experienced programmer myself, general idea read framework topics in dev guide on d.android.com completely. gives view of possible within android. it's not complete guide on how-to though, it's see android capable of before start anything. plus indeed online tutorials, careful there lot of tutorials older versions of android, have deprecated stuff in them. , found tutorials wrong , had lot of errors in them, it's idea @ comments on article. general internet knowledge ;) plus there books game development android. (beginning android games mario zechner, instance. don't have book title seems need ;) ) if want, can use adobe air develop games newer versions of android. good luck.

android - Loading a Webpage from my emulator -

in application want load webpage ckicking textview. how can this? please help. thank you. one of way webview........ http://www.androidpeople.com/android-webview-example-part-1/

Want to start with Windows Phone 7 development -

as now, heard windows phone 7 development. know following things regarding windows phone 7: from can start windows phone 7 development? best books/article/code blog/tutorial, etc. which tools should need/download start windows phone 7 development? update: i found helpful: http://www.devx.com/vs_2010/article/45898/9851 you can started downloading tools , registering publish here: http://create.msdn.com/en-us/home/getting_started there lot of tutorials out there. recommend channel9's windows phone 7 training course , windows phone 7 absolute beginner . there's book available free pdf download: programming windows phone 7 charles petzold .

java - Expand inline tags in custom Javadoc taglet -

i wrote custom javadoc taglet adds new note tag: ... public boolean isinlinetag() { return false; } public string tostring(tag tag) { return "<pre class='note'>" + tag.text() + "</pre>"; } it works far, inline tags not expanded. here example comment: /** * @note test note {@link someclass} // @link tag not expanded * @param name - here {@link someclass} works // works standard 'param' tag */ the {@link} inline tag not expanded. however, works fine built-in param javadoc tag. is there way expand nested inline tags in custom javadoc taglet? thanks! the taglet overview says: taglets can written either block tags, such @todo, or inline tags, such {@underline}. block taglets not support inline tags in text. in fact, taglet api bit minimal, supports tostring() method. you inside method retrieve subtags of parameter tag (with .inlinetags() ), have format them yourself, since don't ha...

bash - Find max number of concurrent events -

i'd print max number of concurrent events given start time , end time of each event in "hhmm" format (example input below) $ cat input.txt 1030,1100 1032,1100 1032,1033 1033,1050 1034,1054 1039,1043 1040,1300 for this, would sort start time (column 1) use awk/sed iterate on values in column 2 (i.e end time) find count of end times preceeding event greater current value (i.e find running events). elaborate, assuming line 3 being processed awk ... end time 10:33. end times of preceding 2 events 11:00 , 11:00. since both these values greater 10:33 (i.e. still running @ 10:33), third column (i.e. number of concurrent jobs) contain 2 line the expected output of awk script find concurrent events input be 0 1 2 2 2 4 0 find max value of third column. my awk rudimentary @ best , having difficulty implementing step 2. i'd pure script without resorting heavy weight language java. hence awk gurus highly appreciated. non-awk linux 1 liners welcome. ...

Simple user/password protection in asp.net MVC -

a simple problem, maybe has tip mvc beginner me. want password protect mvc application - on user / password necessary - did via aspnetdb , sqlmembershipprovider, there should easier way - in webforms did via adding user / password web.config. do need write own xmlmembershipprovider solve problem? if yes, know simple existing xmlmembershipprovider can me? many in advance.. you don´t need use membership provider in order password protect application. have provide service validate user credentials. can here idea on how that. basically, need generate salt , hash user password using salt (and password provided). store salt , hashed password in db. try it, not difficult. after have validated user´s credentials, can use code wrote in question use forms authentication. cheers!

Jquery-ajax control data post -

i not understand why when use .post() function data posted more 1 time how can control , stop think? in advance. best regards that's code: case "mod" : $.post("./php/"+eti[indice]+".php", {azione: "carica", contratto:contratto}, function(xml) { if ($("status", xml).text()=="1") { scorridati(xml); $.post("./php/"+eti[indice]+".php", {azione: "vedi", contratto: contratto }, function(xml) { if ($("status", xml).text()=="1") { var lun=$("#"+eti[indice]+"_"+indice).length; if (lun == 0) ...

profanity - How to handle flagged content in a community? -

on multi-lingual community user-generated content, there commonly used way treat flagged content (profanity, racism, general illegal stuff etc)? as there lot non-english content, way handle flagging crowdsourcing community , somehow automaticly hide/delete flagged stuff @ threshold. method used stop abuse? e.g. "i don't him, lets report , deleted" another option might consider allow users "hide" other users, i.e. not see content of hidden users. this allows people "remove" other users don't feel contribute community. you allow users report bad posts, , allow human decide whether or not hide or delete post. have have community rules effective.

indexing - Multiple column indexes optimization for multiple column queries on SQL Server -

i have 1 table [table] 2 columns needs filtered: [column1] , [column2]. in program execute query like: select * [table] [column1] = 'foo' , [column2] = 'bar'; which faster: creating 2 indexes, 1 on each column. ([column1] , [column2]) creating 1 index containing both columns. ([column1]+[column2]) this question have been bugging me while, have no idea how query optimization works , how sql server uses created indexes speed queries. second 1 always faster this query - need put more selective 1 first (in order of indexes) benefit more. exception if performance reasons, sql decides use clustered index ignores non-clustered. the combination of 2 values create more selective criteria. helps performance since there no bookmark lookup required on covering index. bookmark lookups source of major performance degradation , why covering index better 2 indexes. update bear in mind, if have index column1+coulmn2, searches on column2 cannot use in...

gcc - handling GUI with assembly language in Linux -

i new assembly programming language. have little experience masm works on windows. want know how deal gui in linux.(i have done simple programs in assembly on linux using gcc) if 1 can give me resources particularly coding samples. thanks !! you'll want: nasm: cross platform assembler gtk+: c gui library ubuntu: popular desktop linux distribution an example of gtk in use nasm on linux

php - Joomla - Automatically log users in using $_GET variables -

i know sounds dumb, have client sends out newsletters. target market extremely computer illiterate, client requires embed login details in urls on newsletter users can logged in automatically in joomla front-end. what have propsed script gets username , password url using $_get , how can pass $my object gets created once user logs in through joomla login page? obviously, i'm not getting here code-related, concept stays same, want automatically log people in using url , if redirect them page wanted go, in 1 sweep. thanks in advance comments & advice. this terrible in terms of security, you'd need pass login.php?username=x&password=y and change login accept $_request instead of $_post $username = $_request['username']; $password = $_request['password']; $loggedin = user::login($username, $password); but again, terrible security standpoint. if need fast way this, should consider emailing them hash of salt , username , logging t...

Trying to find a syntax highlighter for ColdFusion in Notepad++ -

i use cfeclipse of projects , heavy lifting find need quick fix on pages outside project scope easier accomplish in simple text editor. i have googled can't seem find answer either link download or link how build own awesome. thanks. nppcoldfusion actively maintained

jquery - Setting the background colour or a div failing when inside a fieldset -

i'm hoping here can me out, i'm relatively new css , jquery, can't seem wrap head around i'm doing wrong in case. i've got form, labels, inputs , selects. found helpful tutorial showing me how add background colour parent div when entered input or select, removed when moved on. tutorial here, http://css-tricks.com/improved-current-field-highlighting-in-forms/ the css using simple: .curfocus {background-color: #fdecb2} when used simple jquery worked wonderfully. $("input").focus(function() { $(this).parent().addclass("curfocus"); }); $("input").blur(function() { $(this).parent().removeclass("curfocus") }); however, placed labels , inputs inside fieldset, , now, css no longer gets enabled. this example works: <div class="row"> <label for="username">your name:</label> <input type="text" name="username" id="username"/> </div...

c# - How to abort a thread started inside another function? -

monitor moni = new monitor(); thread t = new thread(() => moni.currusage(nics,200)); t.start(); i start thread named 't' inside 'form1_load' function. have added button. when click on button thread 't' should stop executing , create new thread these parameters. monitor moni = new monitor(); thread t = new thread(() => moni.currusage(nics,950)); t.start(); i know in form_load event can use the t.abort(); by making t member of form, can reference later on in button-click event handler. graceful abort. although t.abort() gets job done, might left half-processed data in thread t . can catch threadabortexception in thread t gracefully end processing. beware of overlap. second problem thread might not have aborted yet while new thread has started already. can prevent calling t.join() after calling t.abort() . hope helps.

Can you use Java Reflection api in GWT client -

is possible use java reflection api in gwt client side? want use reflections find value of property on javabean. possible? i've been there , solution indeed use deferred binding , generators. can see use of generators overcome lack of reflection in gwt client here: http://jpereira.eu/2011/01/30/wheres-my-java-reflection/ hope helps.

Android button loses text alignment after setText -

i'm using xml draw spinning progress indicator along text. in bottom of screen have tablelayout 2 buttons, centered in page each text centered. <relativelayout android:id="@+id/progresscontainer" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center_horizontal"> <progressbar android:id="@+id/progress_bar" style="?android:attr/progressbarstylesmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerinparent="true" android:paddingright="10dp" /> <textview android:id="@+id/progress_text" android:layout_torightof="@id/progress_bar" android:layout_width="wrap_content" android:layout_height="wrap_c...

c# - What methods exist for local remote procedure call? -

i working on 2 separate c# applications, , i'm trying determine best way create remote procedure call 1 app other. webservices not necessary in case because applications run on same machine (windows os). types of rpc available in c# , .net can use? i recommend wcf netnamedpipebinding interprocess communication. here's example . there's remoting has been around since .net 1.0 becoming obsolete in favor of wcf.

android - Passing arguments to AsyncTask, and returning results -

i have application long calculations, , show progress dialog while done. far have found threads/handlers, didn't work, , found out asynctask . in application use maps markers on it, , have implemented ontap function call method have defined. method creates dialog yes/no buttons, , call asynctask if yes clicked. question how pass arraylist<string> asynctask (and work there), , how new arraylist<string> result asynctask ? the code of method looks this: string curloc = current.tostring(); string itemdesc = item.mdescription; arraylist<string> passing = new arraylist<string>(); passing.add(itemdesc); passing.add(curloc); arraylist<string> result = new arraylist<string>(); new calc_stanica().execute(passing,result); string minim = result.get(0); int min = integer.parseint(minim); string glons = result.get(1); string glats = result.get(2); double glon = double.parsedouble(glons); double glat = double.parsedouble(glats); geopoint g ...

emacs - Display compilation in inactive buffer -

gnu emacs 23.2.1 i using emacs on netbook 10" screen size. if have 2 buffers open vertically each other. when compile compilation show in new vertical buffer. however, have 3 buffers. however, small screen there no room see errors. i wondering if there way show compilation in inactive buffer. i using following display vertical buffer: ; split vertiacally (setq split-width-threshold 0) (setq split-height-threshold nil) many suggestions, try (setq split-width-threshold (ceiling (frame-width) 2)) edit (nov 24): maybe do: (defun display-on-side (buffer &optional not-this-window frame) (let* ((window (or (minibuffer-selected-window) (selected-window))) (display-buffer-function nil) (pop-up-windows nil)) (with-selected-window (or window (error "display-on-side")) (when (one-window-p t) (split-window-horizontally)) (display-buffer buffer not-this-window frame)))) (setq displa...

vba - How do I make an Access Form automatically open to a user's data? -

i trying write vb code allow access recognize computer id of person opening database, open form, , filter records assigned user. know how accomplish that? an api user name better using environ . if name available in table, can use dlookup id, can used the argument of openform method of docmd object open filtered list.

Currency table in CSS -

i have table , need format currency in order . displayed under each other. this table: <table class="data" cellspacing="0" cellpadding="5" border="0"> <thead> <tr> <th>date</th> <th>description</th> <th>field1</th> <th>field2</th> <th>balance</th> </tr> </thead> <tbody> <tr class="verticaldivider"></tr> <tr> <td>08 april 2010</td> <td>value 1</td> <td>gbp 20.00</td> <td>&nbsp;</td> <td>gbp 20.00</td> </tr> <tr> <td>08 may 2010</td> <td>value 2</td> <td>gbp 100.00</td> <td>&nbsp;</td> <td>gbp 1020.00</td> </tr> ...

facebook - fb:google-analytics , does it work for you? -

i have facebook fan page, , tabs in it. 1 of static fbml 1 besides having , img tag has following <fb:google-analytics uacct="ua-19191919-4" /> problem is.... facebook ignores tag , see no evidence of google analytics code being executed... any ideas ? use iframe apps regular analytic code. facebook doesn't use fbml anymore.

plsql - Dynamic Sql, problem with binding -

i have block: declare stmnt varchar2(100); rol varchar2(10); --role name tab_name varchar2(10); --table name begin rol := '&role_name'; stmnt := 'create role ' || rol; execute immediate stmnt; stmnt := 'grant :p on ' || '&tab_name' || ' ' || rol; execute immediate stmnt using '&privilege'; end; when execute block, after enetering privilege select, oracle gives me error missing or invalid privilege ora-00990: missing or invalid privilege why doesn't bind variable? you cannot bind oracle names, data values. instead: declare stmnt varchar2(100); rol varchar2(10); --role name tab_name varchar2(10); --table name begin rol := '&role_name'; stmnt := 'create role ' || rol; execute immediate stmnt; stmnt := 'grant &privilege. on &tab_name. ' || rol; execute immediate stmnt; end;

c# - Can I filter which type of document (ex just pdf) to load in a System.Windows.Forms.WebBrowser? -

i have system.windows.forms.webbrowser control on form, how can load pdf files it? can determine before loading browser control? use navigating event: http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.navigating.aspx if not pdf ( application/pdf ), set e.cancel = true; in navigating event. check file extension using fileinfo. edit get file's mime content type: http://kseesharp.blogspot.com/2008/04/c-get-mimetype-from-file-name.html edit if pdf files local, check mime content type using: using .net, how can find mime type of file based on file signature not extension

html - How to I get in xpath the value of the option and not the display value? -

consider example <select> <option value="http://www.test1.com"> 1 </option> <option value="http://www.test2.com"> 2 </option> <option value="http://www.test3.com"> 3 </option> </select> how in xpath value of option , not display? meaning, want value of option element - http://www.test1.com example , not 1, 2 or 3. by position: /select/option[1]/@value by content: /select/option[.=1]/@value or /select/option[normalize-space()='1']/@value

c++ - Row Background Color GtkTreeView Widget -

Image
i'm attempting color disabled rows in gtk tree view widget light gray color. i've read, i'm supposed set background-gdk property of corresponding cellrenderer , bind model column. sort of works. gtk::cellrenderertext* textrenderer = manage(new gtk::cellrenderertext()); textrenderer->property_editable() = false; gtk::treeviewcolumn *col = manage(new gtk::treeviewcolumn("column1", *textrenderer)); col->add_attribute(*textrenderer, "background-gdk", m_treeview_columns.m_back_color); my_treeview.append_column(*col); gtk::treemodel::row row; (int = 0; < number_of_rows; ilane++){ row = *(treeview_liststore->append()); row[m_worklistcolumns.m_back_color] = gdk::color("#cccccc"); } in end though, cells colored properly. ugly white-space in between cells. know of way fix or better way achieve effect i'm after? could set background of row match cell background or set bakground of tree view ? or maybe cell cel...

sql - Are there any free/open source databases which can properly store arrays? -

i looking free/open source database can store (multi-dimensional) arrays. once array stored in database, items in array should searchable within database. means, don't want serialize it. it should able run under linux (suse), , want use python , php. in standard sql, can do create table myarray ( rowindex integer, colindex integer, value /* whatever type array elements have */, unique (rowindex, colindex) );

css float - IE7: floating divs clearing text -

i have div containing multiple divs , text. inner divs alternately floated left , right , text flows along side them in browsers (including ie8) except ie7. in ie7 text pushed bottom aligned top of final inner div. have tried sorts of solutions , have read a article on subject however, i'm still unable prevent text being cleared in ie7. here's relavent html (please note div nested within html table specified width legacy site. have tried pulling div out of table, same behaviour occurs anyway): <div> <div class="left"></div> <div class="right"></div> text goes here <br /> text goes here </div> and css: .left { float:left; } .right { float: right;} i have tried applying display:inline, display: inline-block, clear: none, overflow: hidden, specifying widths, position: relative containing div, various hacks such ie7 conditional zoom: 1, min-width: 1% - hours of pulling hair out , d...

What is android:layout_gravity="clip_vertical" exactly -

the property android:layout_gravity="clip_vertical|horizontal" following mentioned in sdk documentation: additional option can set have top and/or bottom edges of child clipped container's bounds. clip based on vertical gravity: top gravity clip bottom edge, bottom gravity clip top edge, , neither clip both edges. but can't see of in applications so purpose of property ? thanks short version: clip_horizontal , clip_vertical apply measurements of view itself, before contents (such image in bitmapdrawable) rendered. long version: i've run similar confusion on clip_horizontal , clip_vertical. (in case, related android:gravity bitmapdrawable, it's similar enough applicable.) from documentation thought android:gravity="top|left|clip_vertical" on bitmap cause image's top left corner positioned @ view's top left corner, , that, if bitmap taller view, "clipped" @ bottom edge of view. in othe...

html - Absolutely positioned div over a p causes links in the p to not be clickable -

i have absolutely positioned div on p, , causes links in p not clickable, , none of text selectable either. the div doesn't have background, border. how can fix this? you can change z-index of <div> . should drop behind <p>

linux - Get list of images in web using shell script -

is there possibility images, or better image list web (i type variable) using shell script? thanks have here . fetches images google search given keyword. should enough started.

Is there a way to query Sphinx for records that have a particular field that is not empty? -

i'm using sph_match_extended2 match mode sphinx 0.9.9 , want write search query finds records have in particular field. have tried following no success: @myfield * @myfield !"" i figure can add field index checks , query against that, i'd prefer have more flexibility that--it nice able through query syntax. any thoughts? you can without updating/changing db -- modifying sql_query index/source built off of. e.g. sql_query = select id, \ if(title!='',title,'this_field_is_actually_blank') \ table then running off of previous poster's comment, use negation in sphinx query. alternatively, create dynamic sphinx attribute filter against. e.g. sql_query = select id, \ title, \ if(title!='',1,0) title_is_not_blank \ table sql_attr_uint = title_is_not_blank then make sure filter on title_is_not_blank=1 every search. or, depending on applicati...

c# - Performing bitwise left shifts on "signed" data in Java -- better to move to JNI? -

i've been asking questions on hex , bitwise manipulation (here , elsewhere) past week trying wrap head around representation in java. after googling , chagrin must ask 1 final time how perform logical arithmetic on bits ought unsigned, represented signed in java. okay: porting c# program java. program deals bitmap manipulation, , such of data in app represented byte , unsigned 8-bit integer. there many suggestions instead use short data type in java in order "mimic" close possible unsigned 8-byte integer. i don't believe that's possible me c# code performing various many shifting , and operations byte data. example, if data byte array, , block of code exists in c#: int cmdtype = data[pos] >> 5; int len = (data[pos] & 0x1f) + 1; if (cmdtype == 7) { cmdtype = (data[pos] & 0x1c) >> 2; len = ((data[pos] & 3) << 8) + data[pos + 1] + 1; pos++; } it's not simple matter of casting data short , being done work ...