Posts

Showing posts from July, 2010

What happens in memory when a C++ class is instantiated -

i'm interested in nuts , boltw of c++ , wondered changes when object instantiated. i'm particularly interested if functions added memory, if there runtime or if never stored in memory @ all. if direct me site on of core bolts of c , c++, i'd love too. thanks, jo a common case is: memory allocated calling operator new . function in memory, it's needed lot. the constructor of class called. code in memory. if not, call function page-faults. os notes, , loads appropriate page executable ram. tells os retry. ( 2a. ctor arranges virtual functions callable - writing vtable pointer ) chances page constructor contains other members of class. can called too. if on page, calling them may cause page fault , load. if compiler put vtable on different page, use of vtable may cause page fault. the advantage of such load-on-demand mechanism os can avoid loading code class cprinter if user never intends print document.

Visual studio 2005 crashes attempting to add new project setting in Project Settings pane. How to fix? -

while trying add new user or application setting project properties pane of project, visual studio 2005 hangs , prompts after minute debug or restart. have tried deleting app.config , user.config files no avail. have tried resetting ide's application settings. have tried hitting sychronize under pane. there corrupt file causing mess? solution? more info: visual basic development, vista, vs 2005. i've had problems before. approach like: install latest service pack if you've got time, reinstall worst-case, manually edit project file add settings

javascript - Appending an extra request to JSON callback -

my problem i trying load json encoded data remote site using jquery, when jquery tries call url appends correct function callback=? it's callback=jsonp1256856769 adds _=1256856769 url. url ends being http://www.example.com/link/to/file.php?format=json&lang=en&callback=jsonp1256856769&_=1256856769 now problem that file using calls can't interpret _=1234234 , can't change have fix jquery problems my question how can jquery not appened _= url calls what have done try figure out problem removed other javascript libraries page tried several different versions of jquery my code function getdata(){ url = "http://www.example.com/link/to/file.php"; url += "?format=json&lang=en"; $.getjson(url+"&callback=?",function(data){formatdata(data);}); } *above snippet of javascript using *note domain using not example.com update: added code the _= part there, because jsonp request cache: fals...

saas - Building a webportal which will be rented to customers. Need an Architecture Suggestion -

iam building web portal rented customers on hosted model (saas), using entire portal features on own domains own branding. now don't want them files of web-portal, still able use custom branded portal. one solution suggested here host branded version on server , via iframe on customer's domain. didn't idea much. one second approach researched , found host portal on fresh ip in server , ask customer point domain ip. the webportal sold lot of customers , have separate user interfaces , brandings, needed. please suggest me feel approach or if guys have better idea in mind please pour in suggestions. we're running saas application supports branding, , dynamically serving css. if of customers have unique domain name pointed @ server, select css files domain name: if customer logs in @ "http://portal.customer.com/login", can have html link file "/stylesheets/portal.customer.com.css", , forth. alternatively, can create subdomain e...

uploading zip files in codeigniter won't work -

i have created helper requires parameters , should upload file, function works images not zip files. searched on google , added my_upload.php -> http://codeigniter.com/bug_tracker/bug/6780/ however still have problem used print_r display array of uploaded files, image fine zip array empty: array ( [file_name] => [file_type] => [file_path] => [full_path] => [raw_name] => [orig_name] => [file_ext] => [file_size] => [is_image] => [image_width] => [image_height] => [image_type] => [image_size_str] => ) array ( [file_name] => 2385b959279b5e3cd451fee54273512c.png [file_type] => image/png [file_path] => i:/wamp/www/e-commerce/sources/images/ [full_path] => i:/wamp/www/e-commerce/sources/images/2385b959279b5e3cd451fee54273512c.png [raw_name] => 2385b959279b5e3cd451fee54273512c [orig_name] => 1269770869_art_artdesigner.lv_.png [file_ex...

.net - Boyer-Moore Practical in C#? -

boyer-moore fastest non-indexed text-search algorithm known. i'm implementing in c# black belt coder website. i had working , showed expected performance improvements compared string.indexof() . however, when added stringcomparison.ordinal argument indexof , started outperforming boyer-moore implementation. sometimes, considerable amount. i wonder if can me figure out why. understand why stringcomparision.ordinal might speed things up, how faster boyer-moore? because of the overhead of .net platform itself, perhaps because array indexes must validated ensure they're in range, or else altogether. algorithms not practical in c#.net? below key code. // base search classes abstract class searchbase { public const int invalidindex = -1; protected string _pattern; public searchbase(string pattern) { _pattern = pattern; } public abstract int search(string text, int startindex); public int search(string text) { return search(text, 0); } } /// <su...

java - Tomcat in Eclipse: It runs but time out during startup anyway -

i'm running java web app in eclipse (helios) using tomcat 7. server startups (duration indicated) eclipse's progress bar still spins saying tomcat starting up. timeout reached , error thrown. i believe tomcat fine i've taken command uses , ran manually in shell. tomcat runs fine , i'm able hit web app @ expected url. can hit after it's started , before timeout occurs. i've reinstalled eclipse, ran clean, deleted/recreated server. nothing has worked. have clues? i had issue, seems eclipse calls application url after start make sure running. a proxy client (pshione) had changed system proxy eclipse not call start page , thinks application not starting yet!! i removed proxy , works fine now! edited: this can happen when start tomcat ssl, ssl certification not valid. when make call , invalid ssl certification site, browser confirm if want go 1 or not, eclipse can not connect invalid ssl site! suggest test site normal http instead of https. ...

matlab - Simple data processing -

Image
let's got set of data. after sorting distribution can drawn out below. m=[-99 -99 -44.5 -7.375 -5.5 -1.666666667 -1.333333333 -1.285714286 0.436363636 2.35 3.3 4.285714286 5.052631579 6.2 7.076923077 7.230769231 7.916666667 9.7 10.66666667 16.16666667 17.4 19.2 19.6 20.75 24.25 34.5 49.5] my question how find out values among middle range , record indices. using normal distribution or else? appreciate help! picture jonas' assuming mid range [-10 10] indices be: > find(-10< m & m< 10) ans = 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 please note can acces values logical indexing, like: > m(-10< m & m< 10) ans = columns 1 through 15: -7.37500 -5.50000 -1.66667 -1.33333 , on ... and mid range, just: > q= quantile(m(:), [.25 .75]) q = -1.3214 17.0917 > find(q(1)< m & m< q(2)) ans = 8 9 10 11 12 13 14 15 ...

javascript events - dojo eventListener via dojo.connect attach to multiple objects with same id -

so trying attach onclick event set of links same id("linktodisplay") , doesn't seem triggering onclick event code follows: var handle = []; var link = dojo.query('#linktodisplay a').foreach(function(node, index, array){ handle.push(dojo.connect(node, "onclick", null, function(evt) { console.log("mouseup detected, firring off server request"); dojo.xhrget({url:'default/data/getpagecontent?main=true&pageid='+evt.target.name, ...

c# - WPF/Silverlight AutoCompleteBox with ability to add new values to list -

i use autocompletebox list of values, add new values list if user enters 1 isn't present. i have string property in view model called 'comment'. bound textbox in view - user types comment , view model updated. simple. to save time, customer autocomplete previous values, way thought like: viewmodel public string comment; public observablecollection<string> commentslist { ... } (populate commentslist when viewmodel created) view <autocompletecombobox itemssource="{binding commentslist}" selecteditem="{binding comment, mode=twoway/> so when user selects value, saves value in comment property. works fine if user selects item in list, if user types in new value, comment property not updated (it null because selected item not in list). is possible autocompletebox? thanks in advance, will found solution... i needed use text property, not selecteditem. text contains current text user has entered or selected. selecte...

linq to entities - "Next number" scenarios using Entity Framework -

i have been playing entity framework , far using lot. i've done far assumes optimistic locking works me in cases. however, have following scenario: a sql server table 1 row holds application-wide data the row contains column named "nextavailablenumber" the application needs read number, increment 1, , update it the above has guarantee competing process has wait number until first transaction has completed. have done using table locks (since there's 1 row), know how should done using linq entities? thanks, jim k. i think need implement in stored procedure because , use explicit row locking (or table locking mentioned). call procedure ef. don't think can handled application code unless using serializable transaction every time work special table. can have huge negative impact on application's performance. we doing similar our table contains plenty of rows different sequences i'm using stored procedure row lock , update lock. first ...

mysql - how can I dump certain tables -

i want dump tables begin 'ji' et 'qrtz' searched in strackoverflow, way using --ignore-table, have hundreds tables ignore... any tools job done? thanks one way use script this. for example, create php script queries tables in database , creates .bat/.sh file can run job.

actionscript 3 - How to pass a variable into an Event.COMPLETE function? -

i running loop pull thumbs containing movieclip xml list. want have thumb's parent movieclip fade in after done loading, can't figure out how reference parent once it's loaded. my code(which doesn't work way want it): var vsthumb:articlebox; var currentarticlex:number = 0; var articlelinkurl:string; var articleimageurl:string; var articletext:string; var vsthumbloader:loader; var next_x:number; next_x = 9; var thumbalphatween:tween; var articlevsthumb:array = new array(); function loadarticleheadlines():void { (var i:int = 0; < egarticlexml.articlelist.articleitem.length(); i++) { vsthumb = new articlebox(); vsthumb.alpha = 0; vsthumbloader = new loader(); vsthumbloader.load(new urlrequest(egarticlexml.articlelist.articleitem[i].articlethumbnail)); articlelistcontainter.addchild(vsthumb); vsthumb.articleimage.addchild(vsthumbloader); vsthumb.articletitle.text = egarticlexml.articlelist.articleit...

design patterns - How should I lay-out my PHP login class? -

so, there going 1 login form; 1 of 3 types of members signing in member_type_a, member_type_b, member_type_c of whom have of same properties, , whom may have specific methods and/or properties them. want class saved session variable use member area pages. any suggestions on applicable design patterns? gordon: access control isn't issue... understand how control user allowed go. question on how structure login class; when user signs in, method search 3 tables valid username , password. when found, know type of user , able redirect them member page accordingly. i'm trying debate how can keep classes loosely coupled in such way, if had add more member types down line, endlessly scalable. for example, 1 difference redirect url i feel problem not login class user class. why don't use inheritance , create parent user class, create 3 sub-user classes. example: class user { $email; $password; $etc; } class usertypea extends user { $specifi...

user interface - How to change the icon in the title bar in R? -

i installed r 2.11.0-x64 onto windows 7 professional machine. with previous installations of r (2.10.1 32 bit recent) little icon appeared in title bar , in taskbar @ bottom of windows r "r." however, icon looks small windows task manager. i know isn't code issue, affects me flip between windows. is there way put "r" icon in there? r setting or windows setting? it bug fixed yesterday. per this daily r devel news entry post : 2.11.0 patched new features (windows) * rgui console, pagers , editor on 64-bit build have title bar icon. so upgrading '2.11.0 patched' build may help.

What benefits are there to storing Javascript in external files vs in the <head>? -

i have ajax-enabled crud application. if display record database shows record's values each column, including primary key. for ajax actions tied buttons on page able set calls printing id directly onclick functions when rendering html server-side. example, save changes record may have button follows, '123' being primary key of record. <button type="button" onclick="saverecord('123')">save</button> sometimes have pages javascript generating html , javascript. in of these cases primary key not naturally available @ place in code. in these cases took shortcut , generate buttons so, taking primary key place happens displayed on screen visual consumption: ... <td>primary key: </td> <td><span id="prim_key">123</span></td> ... <button type="button" onclick="saverecord(jquery('#prim_key').text())">dosomething</button> this works, seems wron...

touch - Blackberry custom slideshow-style BitmapField manager -

right now, i'm trying figure out how implement following: suppose have custom manager has 10 or bitmapfields layed out in horizontal manner (similar slideshow contained in hfm ) . want achieve able move image hfm via touchevent horizontally, bitmapfield take focus on left-hand side of custom manager. in other words, have give value sethorizontalscroll , if so, matter of incrementing value when user makes left or right touch event. also, how can focus of field within given position on screen (i.e. left-most field on hfm) when hfm scrolling sideways via touchevent? 1 - yes, sethorizontalscroll should work, don't forget use horizontal_scroll in manager constructor 2 - try test each field getcontentrect() eventtouch getx(int) , gety(int) update to simplify global field position calculation use public xypoint getglobalxy(field field) { xypoint result = new xypoint(field.getleft(), field.gettop()); if (field.getmanager() != null) { ...

ruby on rails - Spork won't Find RoR Framework -

i learning rails following rails tutorial under ubuntu. have been using spork , autotest , following tdd suggested book. at point (which can't tell) autotest stopped refreshing on it's own , killed it, alongside spork reboot them both (the book happens , should reboot them) had done couple of times before. this time spork won't load , give me error: "i can't find testing frameworks use. running me project directory?" , there doesn't seem documentation whatsoever. what be? p.s. running project directory. tried bundle install , bundle update commands, uninstalled spork gem gem uninstall spork , reinstalled bundler... nothing (rebooting computer nothing xd). i using "rspec" run test alongside "autotest". seems @ point accidentally removed rspec_helper.rb file (or that, can't recall name of file) , keeping both "spork" , "autotest" off. just had re-run generate scripts rspec , voilà. worke...

How to return a IList in json format in a WCF RESTful service? -

is possible have method signature in wcf 3.5 service (offer custom class datacontractattribute , datamemberattribute): [operationcontract] [webget(uritemplate = "getoffers", responseformat = webmessageformat.json, bodystyle = webmessagebodystyle.bare)] ilist<offer> getoffers(); because if type in web browser corresponding url, serialization error (i think it's because ilist doesn't have serializable attribute json serializer unable serialize it). the workaround use method signature one: [operationcontract] [webget(uritemplate = "getoffers", responseformat = webmessageformat.json, bodystyle = webmessagebodystyle.bare)] list<offer> getoffers(); resulting in same serialized output (a simple json array), first 1 works xml, wondering if there way make work in json, keeping same signature. edit: ok not work xml serialization either, behavior seems normal. question still stands, possible keep signature , change serializer behavior make w...

forms - Zend framework multiple Validators in an array -

i want create form in zend framework. using code below field: $this->addelement('text', 'username', array( 'label' => 'username:', 'required' => true, 'filters' => array('stringtrim'), 'validators' => array( 'alnum' ) )); this works. want add new validator. in case strinlength $element->addvalidator('stringlength', false, array(6, 20)); how can add validator in array have? tnx in advanced doesn't work: <?php $this->addelement('text', 'username', array( 'label' => 'username:', 'required' => true, 'filters' => array('stringtrim'), 'validators' => array( 'alnum', array('stringlength', false, array(6,20)) ) )); similar the example given in manual

visual studio 2010 add reference version missing -

in vs2008 when add reference dll e.g log4net following in csproj <reference include="log4net, version=1.2.10.0, culture=neutral, publickeytoken=1b44e1d426115821, processorarchitecture=msil"> <specificversion>false</specificversion> <hintpath>..\..\lib\log4net\log4net.dll</hintpath> </reference> in vs2010 when add reference dll first time e.g log4net following in csproj (i.e no version number etc) <reference include="log4net"> <hintpath>..\..\lib\log4net\log4net.dll</hintpath> </reference> if remove reference , add second time same details in vs2008 there (version etc) anyone know why version number etc not present first time add reference , why present on secound time reference added? both snippets equal - log4net assembly not qualified this seems problem serialization don't worry should work s

database - Need Help Choosing development tool for Oracle DB, -

we looking development tool oracle db. most of our work on db done pl/sql procedures, need debug them. need minor administration capabilities, monitoring session. we got recommendation use toad. there several versions. version of toad suites most? there other noteworthy tools? what recommend? thanks. i have used , particularly likes following two: pl/sql developer - paid software, simple ui, great creating/editing/debugging pl/sql admin activities. oracle sql developer - free, java based, right oracle. great pl/sql creation/debug. good luck!

asp.net mvc - NerdDinner difficulties -

i'm having problem create method of nerddinner tutorial, btw. as can see here http://nerddinnerbook.s3.amazonaws.com/part5.htm in create method, removed id field of aspx page. i did too, cannot add dinners because primary key violation. how nerddinner controlling ids of each dinner? revised tutorial , not see references identity fields on sql database. i created method me highest id in table: public int gethighestdinnerid() { int resultado = (from dinner in datacontext.dinners select dinner.dinnerid).max(); return resultado; } which not work either. any thoughts? thank you heya, i'm speculating here assume primary key should have auto-generated value property set true don't have explicitly set it, gets generated on insert. should able configure within dbml. edit: looked through nerddinner tutorial , if @ step 2, talks setting id column identity column value auto-generated want configure it...

objective c - Move Object to Touch - iPhone -

i have sprite in iphone game, how can make that sprite moves location of touch? needs transition there, not switch immediately. sprite ccsprite cocos2d. hope can help, thanks. assuming want implement using uikit's animation support (and sprite implemented view), 1 way of doing it. on touch event, location of touch, , based on current location of sprite, determine how long take sprite there inside animation block, change frame of sprite view touch location, , specify duration , other options want. apple's 'view programming guide' explains need know take approach.

perl - How do I split Chinese characters one by one? -

if there no special character(such white space , : etc) between firstname , lastname. then how split chinese characters below. use strict; use warnings; use data::dumper; $fh = \*data; $fname; # 小三; $lname; # 张 ; while(my $name = <$fh>) { $name =~ ??? ; print $fname"/n"; print $lname; } __data__ 张小三 output 小三 张 [update] winxp. activeperl5.10.1 used. you have problems because neglect decode binary data perl strings during input , encode perl strings binary data during output. reason regular expressions , friend split work on perl strings. (?<=.) means "after first character". such, program not work correctly on 复姓/compound family names; keep in mind rare, exist. in order correctly split name family name , given name parts, need use dictionary family names. linux version: use strict; use warnings; use encode qw(decode encode); while (my $full_name = <data>) { $full_name = decode('utf-8...

Using SimpleModal (jQuery plugin) to display a popup iFrame without unnecessary scrollbars -

i'm using simplemodal: http://www.ericmmartin.com/projects/simplemodal/ and displaying iframe, per example: // display external page using iframe var src = "http://365.ericmmartin.com/"; $.modal('<iframe src="' + src + '" height="450" width="830" style="border:0">', { closehtml:"", containercss:{ backgroundcolor:"#fff", bordercolor:"#fff", height:450, padding:0, width:830 }, overlayclose:true }); and popup has two sets of scrollbars, 1 perhaps html element representing popup, , 1 iframe. try demo see: http://www.ericmmartin.com/projects/simplemodal/#examples ideally i'd no scrollbars if content fits, otherwise single vertical scrollbar. any ideas? thanks! alex this work sample code content i.e "eric.martin.com", not sure if can control width other external content, can't :) co...

osx - Changing alpha of window background, not the whole window -

so have quick question have method below sets alpha value of window depending on value slider, content of window becomes translucent , disappears window. is there way change alpha value of window , not content view inside it? - (ibaction)changetransparency:(id)sender { // set window's alpha value. cause views in window redraw. [self.window setalphavalue:[sender floatvalue]];} thanks, sami. apple's docs gives way this. key set window's backgroundcolor 's alpha desired value. must make sure set window's opaque property no (which yes default.) e.x. // @ point in code... [window setopaque:no]; // in changetransparency: method... nscolor *backgroundcolor = [window backgroundcolor]; backgroundcolor = [backgroundcolor colorwithalphacomponent:[sender floatvalue]]; [window setbackgroundcolor:backgroundcolor];

python - Help with filetype association! -

i have actual association part down, when open file associated python program, how filepath of file opened? i think sys.argv? returns path python program, not associated file. the contents of sys.argv platform-dependent, noted in sys.argv . know sys.argv[0] full path on windows when open .py files using shell double-clicking on it. using command line results in script name. the os module provides platform-independent solutions. full path script should available following code: import os.path import sys print os.path.abspath(sys.argv[0])

myspace sdk for iphone -

hi working on myspace sdk iphone , want know how set callback url myspace application iphone. but in twitter register new app ask (demand) give call url, had given clients home page url. in twitter show app info app tweet came link. users can see clients web page when clicked on it. myspace had given clients home page url . not made issue upto now. so u can me.

windows 7 - Registering a dll returns 0x80020009 error -

i trying register regsvr32.exe prnadmin.dll (on win7 target machine) error 0x80020009 any suggestions please? regsvr32.exe needs run administrator. maybe cause?

How can I generate an XML using Perl and XSLT? -

i want generate xml file using perl , xslt. possible achieve updating xslt dynamically uusing values hash? or there better solution wirting simple xml file using perl? the answer "it depends" "simple" xml can printed directly perl data structiures using xml::simple module's xmlout. for more complicated use xml::writer. you can read more on handling of xml in perl (including printing it) in perl , xml o'reilly book - examples see chapter 3 online (xml::writer part): http://oreilly.com/catalog/perlxml/chapter/ch03.html also @ perl-xml faq: http://perl-xml.sourceforge.net/faq/

Are Ruby formatted strings and interpolated strings identical in behaviour? -

do following 2 lines of code behave in same way despite different implementations values.map{ |k,v| __send__('%s=' % k.to_s, v) } values.map{ |k,v| __send__("#{k.to_s}=", v) } the second line more common ruby idiom wondering why other method used when in rails core expect use idiomatic ruby. they not absolutely identical. instance, first example call string#% , if method redefined strange reason, might different result. standard definition of string#% , strings computed same, both expressions have same result. btw, there's no need to_s in example, , assuming send has not been redefined (and equivalent __send__ ): values.map{ |k,v| send("#{k}=", v) }

iphone - NSOperation exists on NSOperationQueue -

does know way of telling if nsoperation on nsoperationqueue without having list of operations , compare each of items? thanks in advance, you have list, it's not taxing. if queue , operation objects: [[queue operations] containsobject:operation];

jQuery selecrors. help for newbie -

i have code, open new jquery-ui dialog , hide dialog's titlebar. <div id="keyboard" class="keyboard dialogs">...</div>   $("#keyboard").dialog({ width: 1136, height: 437, position: ['center',400], closeonescape: false, autoopen: false, resizable: false, open: function(event, ui) { $(".ui-dialog-titlebar").hide(); // <-- selector want change } }); but $(".ui-dialog-titlebar") select titlebars. how have change selector hide titlebar? to titlebar can this: $(this).prev('.ui-dialog-titlebar').hide(); the dialog looks in html: <div class="ui-dialog"> <div class="ui-dialog-titlebar"></div> <div id="keyboard" class="ui-dialog-content"> <!-- "this" element --> stuff </div> </div> there more classes , such of course, n...

javascript - window.onbeforeunload ajax request in Chrome -

i have web page handles remote control of machine through ajax. when user navigate away page, i'd automatically disconnect machine. here code: window.onbeforeunload = function () { bas_disconnect_only(); } the disconnection function send http request php server side script, actual work of disconnecting: function bas_disconnect_only () { var xhr = bas_send_request("req=10", function () { }); } this works fine in firefox. chrome, ajax request not sent @ all. there unacceptable workaround: adding alert callback function: function bas_disconnect_only () { var xhr = bas_send_request("req=10", function () { alert("you're been automatically disconnected."); }); } after adding alert call, request sent successfully. can see, it's not work around @ all. could tell me if achievable chrome? i'm doing looks legit me. thanks, i having same problem, chrome not sending ajax request server in window.unload eve...

javascript - jQuery Image Hover on top of multiple dynamic images -

ok have full table of images , want display small icon on bottom right of every image on hover. ideas how this? right have this, , showing hover image in same spot every time...it needs show on top of image hovered. thanks! .enlargeimage { background:url(images/xxx) no-repeat; position:absolute; width:16px; height:14px; z-index:200; display:none; } $('.table_imagethumbs a').mouseover(function(){ $(this).show('.enlargeimage'); }); <div class="enlargeimage"></div> <table width="408" class="table_imagethumbs"> <tr> <td width="102" class="td_thumb"><a><image width="75" height="97" class="img_vertthumb"></a></td> <td width="102"><a><image width="75" height="97" class="img_vertthumb"></a><...

Testing "Login" with watir -

i'm starting use watir. need create test script login in application. the code bellow script page. i saw examples buttons , links, don't know how "submit"("onclick=submitform() type=button value="sign in") information. if post html of form tell more. i guess should work: browser.button(:value => "sign in").click there buttons page in watir tutorial .

Use jquery ':contains' to find specific javascript within a span -

this first time here, hope clear. so have code similar this. <span class="mediasource ui-draggable" id="purchseplay7915504"> <a href="" onclick="return popup_window(this, 'mediaview', 850, 680)" class="control" enter code hereid="genericlink"></a> <img id="any_71" alt="media source" src="images/9672web.gif" class="mediastationicons mediawin"/> <img class="player" alt="media source" src="images/playmedia.gif" style="display: none;"/> </span> the href portion generated on backend, , have no access it. i need modify existing jquery code based on 'onclick' function is(there different ones e.g. popup_window1,popup_window2 etc.) . i tried this: $('.segmentleft span.mediasource').click(function(){ if ($('span:contains("popup_window")').length ...

tfs2010 - Add a build number to TFS 2010 -

i have lot of legacy delphi 5 & 6 code. want test code using new microsoft test manager (part of vs2010) to track testing using tool need use build numbers. delphi 5 or 6 building in tfs build 2010 huge task. 1 not sure want take on. is there way can insert build numbers in tfs? build numbers stored in global list build process adds each time runs. can download global list tfs, edit , republish updated version server. i'd suggest using tfs 2010 power tools ( link )

jquery flip plugin show and hide content -

actually not programmer, designer...many reply case..... i have difficulties applying show , hide content on flip plugin..... var init = function(){ $("#fliptop").click(function(e){ $("#flipbox").flip({ dir: "top", endcolor: "white", duration:777, onend: function(){ $("#flipbox").html(top); $("#flipbox").css(); } }); }); $("#flipright").click(function(e){ $("#flipbox").flip({ dir: "right", endcolor: "yellow", duration:777, onend: function(){ $("#flipbox").html("right"); $("#flipbox").css({ ...

String array logic question with java I/O -

i need read line file: 5 chair 12.49 edit: want able have more lines of data. i need separate each word/number different data types. first 1 int, second string, third double. need have them formatted this: item: chair price: $12.49 quantity: 5 now know how format, problem having parsing string elements respected data types (int, string, double). i've tried: string [] lines = lineinput.split(" "); for(string displaylines : lines) { bufferedwriter.write(displaylines); bufferedwriter.newline(); system.out.println(displaylines); } but separates each string new line , couldn't life of me figure out how have each line check if it's int, string or double. then messing substring, couldn't work. thought of using mod % function , if: if(lines.length % 2 == 0) {it's string}; but work first line. please believe me when i've tried on own , not making half-trying effort. giving up. stackoverflow, you're hope :( if have...

linux - Good development themes/environments for Gnome/kde/whatever? -

i've searched forever themes or customized versions of type of x-server designed development in terms of web productions/programming kind of stuffs. features such simplified workspace overviews, tabbing support etc. multimedia "ubuntustudio" exists, , programming instead. i know it's possible customize myself don't have skills make happen. reason why it's hard me customize not know make me. i've looked gnome-shell , has (according me) superb workspace overview functions, lacks in other spaces instead. any in finding solution me in case appreciated. if of have had problem , found solution works you, please tell me how did :) love solve once! it depends on tastes , on suite needs. for examples i'm fine window manager, dozen of terminal windows , emacs session.

jasper reports - Run a JasperServer reprt via PHP and pass over the querystring -

i'm using web services run reports created in ireport on jasperreports server. inside .jrxml file can see xml holds sql report. possible pass querystring on jasperserver via web services, instead of hard coding definition inside .jrxml file. string build in php, pass on jasperreports server used in execution of report. <querystring> <![cdata[select * table j=2]]> </querystring> basically, i'm trying find way dynamically create sql in php, pass sql on jasper run report. possible? found out setting parameter $p!{query} instead of using $p{query}. "!" makes difference. hope helps else comes along same problem.

.net - MoqAutoMocker and primitive constructor parameters -

i avid user of structuremap moqautomocker, sometimes, however, run "old friend" of ours. assume class "validator" public class validator { private string _connectionstring; private ieventmachine _eventmachine; public validator(string connectionstring, ieventmachine eventmachine) { _connectionstring = connectionstring; _eventmachine = eventmachine; } } the class above doesn't matter, in fact, raise few eyebrows, i'm making post, not think of better example off tip of nose. point contains mix of primitive datatypes ( connectionstring ) , interfaces ( eventmachine ) - during unit testing, typically set expectations, such as: [testmethod] public void validate_whencalled_publishesenterevent() { // arrange var instance = new moqautomocker<validator>(); var eventmachinemock = mock.get(automock.get<ieventmachine>()); // act instance.validate(); // assert eventmachinemock.verify(m =>...

Android TabHost with only selected tab on stack -

i have tabhost 4 tabs. need selected tab activity available on stack. when user changes tab, how finish activity under previous tab. tried following code. here showing code first tab. similar remaining tabs: spec = tabhost.newtabspec("tab1").setindicator("tab1", res.getdrawable(r.drawable.ic_tab_tab1)) .setcontent(new intent(this, tab1.class) .addflags(intent.flag_activity_no_history | intent.flag_activity_clear_top)); but above code deleting tab1 activity on stack/heap when user comes again tab not when user changes new tab. i've had @ this, reason this? how know what's on stack? depending on ondestroy() or something? i haven't got full answer can see tab active: let class implement ontabchangelistener public class yourclass extends tabactivity implements ontabchangelistener { @override protected void oncreate(bundle savedinstancestate) { // load normal objects tabhost // ma...

winapi - How to find working directory which works between different computers. - C -

i running 2 processes,process opened process b using following example: createprocesshandle = createprocess( text("c:\\users\jamie\\documents\\application\\debug\\processa.exe"), text(""), null, null, false, 0, null, null, &startupinfo, &process_information ); as can see process reliant on path given it, problem have if change location of processa.exe (such backup/duplicate) it's tiresome process keep recoding path. want able make run no matter without having recode path manually. can suggest solution this? edit: not have access path environment variable there 2 options. use relative path. put directory in path environment variable. in case, use lpcommandline, not lpapplicationname.

Problems with jQuery .not() and the draggable ui -

okay, when draggable, given class .ui-draggable , when disabled being draggable .ui-draggable-disabled i want select items draggable. i'm using following selector, doesn't seem work. disabled draggable items still doing on hover. ideas why? $('.ui-draggable').not('.ui-draggable-disabled').hover(function() { // rest of code thanks try: // selector means "doesn't have", ':not(:has(selector))' $(".ui-draggable:not(:has(.ui-draggable-disabled))").hover(function() { ... or: $('.ui-draggable').not(':has(.ui-draggable-disabled)').hover(function() { or test presence of disabled class within hover mouseover/mouseout functions: $(".ui-draggable").hover(function() { if(!$(this).hasclass("ui-draggable-disabled")) { // stuff } }, function() { if(!$(this).hasclass("ui-draggable-disabled")) { // stuff } });

iphone - trouble with section headers in UITableView -

im having problem setting section headers in uitableview, simple cant work out. instead of displaying different headers different sections displays same header each section help me please :) - (nsinteger)numberofsectionsintableview:(uitableview *)tableview { worldcupappdelegate *appdelegate = [uiapplication sharedapplication].delegate; return [appdelegate.matchfixtures count]; } - (nsstring *)tableview:(uitableview *)tableview titleforheaderinsection:(nsinteger)section { worldcupappdelegate *appdelegate = [uiapplication sharedapplication].delegate; fixtures *fixtures = [appdelegate.matchfixtures objectatindex:section]; return fixtures.matchdate; } your original code looks okay. i'm betting appdelegate.matchfixtures doesn't contain data think does. modify code this: - (nsinteger)numberofsectionsintableview:(uitableview *)tableview { worldcupappdelegate *appdelegate = [uiapplication sharedapplication].delegate; nslog(@...

iphone - Add blank cell at end of UITable -

i'm trying add additional cell custom content last cell in tableview, without altering dictionary creates other content of table. think place add in cellforrowatindexpath rather adding 1 numberofrowsinsection , crashes if do. i cellcount dictionary creates data table, in cellforrowatindexpath , have: if (indexpath.row == cellcount) { ... stuff goes here return cell; } of course, never gets called. if if (indexpath.row == cellcount -1) overwrites last cell content. i can work if add blank entry xml populating dictionary, that's ugly. example code neat! the problem here tableviews designed , accurately display contents of data-model , you've decided don't want that. you're fighting api. the straight forward way put check in numberofrowsinsection such adds 1 row count when want display input row. in cellforrowatindexpath: need check if table view asking input row , return appropriate type of...

javascript - How to get a reference to a Module? -

i trying encapsulate code using module pattern. problem can't reference it. following error message: 'plannertab.getconfig' null or not object line: 14 char: 5 code: 0 code /* document ready */ $(function () { /* config */ var config = plannertab.getconfig; }); /* module */ var plannertab = (function () { var config = { tableid: '#plannertable' }; return { getconfig: config }; })(); you're victim of automatic semicolon insertion. this: return { getconfig: config }; should written like: return { getconfig: config };

android - What exactly does onDestroy() destroy? -

i've been bothered "characteristics": when use button leave app, can tell ondestroy() called, next time run app, static members of activity class still retain values. see code below: public class helloandroid extends activity { private static int mvalue; // static member here public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); textview tv = new textview(this); tv.settext((mvalue != 0) ? ("left-over value = " + mvalue) : "this new instance"); setcontentview(tv); } public void ondestroy() { super.ondestroy(); mvalue++; } } the above code displays left-over value in mvalue, , increments when session ends know sure ondestroy() called. i found useful answer on forum, , understand in above code mvalue class member, instead of instance member. isn't true that, in particular case, have 1 single helloandroid activity, , when dies, cleaned up, , next time come back, starts o...

sql server - adding one time options to items -

i'm building event registration site. given event, we'll have handful of items choose from. have table these items. each event might have special options users. example, 1 of events new users buy item not available other users. may not apply events. other events might have other restriction on items. checking programmatically on application side. though, set column containing flag in items table. don't find feasible because condition may apply 1 particular event. don't want future items have column. approach take in such situation? should create special "restrictions" table , join? how handle on application side? yes, going need additional table list of items have special rules. sounds 'special options' idea still evolving, it's know whether think of containing 'restrictions' or 'bonuses' and of course you'll need table maps items particular groups of users. general advice in sort of situation: sho...

How do I rotate an image in the frequency domain? -

Image
i've heard should possible lossless rotation on jpeg image. means rotation in frequency domain without idct. i've tried google haven't found anything. bring light this? what mean lossless don't lose additional information in rotation. , of course that's possible when rotating multiples of 90 degrees. you not need idct image rotate losslessly (note lossless rotation raster images possible angles multiples of 90 degrees). the following steps achieve transposition of image, in dct domain: transpose elements of each dct block transpose positions of each dct block i'm going assume can following: grab raw dct coefficients jpeg image (if not, see here ) write coefficients file (if want save rotated image) i can't show full code, because it's quite involved, here's bit idct image (note idct display purposes only ): size s = coeff.size(); mat result = cv::mat::zeros(s.height, s.width, cv_8uc1); (int = 0; < s.height - dcts...

nvidia - GPU shared memory size is very small - what can I do about it? -

the size of shared memory ("local memory" in opencl terms) 16 kib on nvidia gpus of today. have application in need create array has 10,000 integers. amount of memory need fit 10,000 integers = 10,000 * 4b = 40kb. how can work around this? is there gpu has more 16 kib of shared memory ? think of shared memory explicitly managed cache. need store array in global memory , cache parts of in shared memory needed, either making multiple passes or other scheme minimises number of loads , stores to/from global memory. how implement depend on algorithm - if can give details of trying implement may more concrete suggestions. one last point - aware shared memory shared between threads in block - have way less 16 kb per thread, unless have single data structure common threads in block.

security - Can the SHA-256 hash be derived from the SHA-512hash of the same data? -

i applying sha-512 on data. theoretically/practically possible derive sha-256 hash original data sha-512 hash? since have different number of rounds, different size of internal state , different block-size i'm pretty sure result of sha-256 , sha-512 different can't derive either of them other. but if paranoid append/prepend different data different hash-functions. i.e. calculate sha-256("a"+data+"b") , sha-512("d"+data+"e") (of course longer strings instead of abcd). the possibility see if set of possible input values small brute-force possible values until hit known hash , calculate other hash. if conditions attacker can reverse known hash, can calculate other hash.

php, for each, syntax error -

code image http://img43.imageshack.us/img43/6435/phperra.png . hi, code, don't know why have stupid syntax error,on marked line. please bring light php nob. parse error: syntax error, unexpected ')', expecting ';' in /var/www/stats/upd_tr_stats.php on line 38 you need use while loop instead of for .

crash - Android 2.3 emulator crashes when updating location -

i using eclipse write , debug android application. 1 of things need update location of device, , have tried use location controls panel in emulator control window. on manual tab, select decimal, enter valid latitude , longitude, , click send. unfortunately, happens next emulator crashes (logcat output below). known issue, , if so, there workaround? help, martin 02-13 08:54:23.128: info/debug(30): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 02-13 08:54:23.128: info/debug(30): build fingerprint: 'generic/sdk/generic:2.3.3/gri34/101070:eng/test-keys' 02-13 08:54:23.138: info/debug(30): pid: 74, tid: 219 >>> system_server <<< 02-13 08:54:23.138: info/debug(30): signal 11 (sigsegv), code 1 (segv_maperr), fault addr 00000000 02-13 08:54:23.138: info/debug(30): r0 00000000 r1 4081c038 r2 41ae0114 r3 473d9c74 02-13 08:54:23.148: info/debug(30): r4 0000012e r5 00000000 r6 4081c038 r7 41ae0114 02-13 08:54:23.148: info/debug(30): r8 ...

flex - Cross-domain policy issues after redirect in Flash -

i'm having trouble cross-domain policy. i'm using as3 loader fetch image; i'm making load policy file, : var ploader : loader = new loader(); var pcontext : loadercontext = new loadercontext(); pcontext.checkpolicyfile = true; ploader.load(new urlrequest(surl), pcontext); this works fine long image directly accessible; however , when server sends redirect, loader follows loses checkpolicyfile flag, resulting in securityexception - is, doesn't check cross-domain policy of redirected url. i've found solution here ( http://www.stevensacks.net/2008/12/23/solution-as3-security-error-2122-with-300-redirects ) looks fragile (that is, looks fail if there's more 1 redirect). correct way of doing this? edit : best solution use new loader if accessing content throws securityexception , loaded url different 1 requested originally... works, feels hack. you can try this: http://www.arpitonline.com/blog/2008/06/17/debugging-crossdomain-issue...

json - Rails as_json include parent object? -

hello i'm trying use as_json output parent object include. here code : photo.as_json(:include => [:comments, :likes]) this code works, 1 doesn't : photo.as_json(:include => [:comments, :likes, :user]) i error : nomethoderror: undefined method `macro' nil:nilclass any 1 ? :) try user = user.find(1) user.as_json(:include => {:photos => {:include => [:comments, :likes]}})

.net - Windows Phone 7 XNA GUI Framework -

i write application on xna windows phone 7. need use gui controls combobox, listbox, radiobutton, etc. xna standart doesn't contains gui control. there frameworks or libraries gui control xna windows phone 7 application? here app hub faq page on subject . lists many options, including: xpf - full layout engine. no price details yet. works on phone too orbui - 27 controls, 3.1 , 4.0 support on pc , xbox nuclex framework has skinnable ui neoforce controls discontinued source pc/xna 4.0 available on codeplex 2dna gui valentin xwinforms guimanager simple gui window system xna controls zunehd xna interface elements

javascript - iPad doesn't trigger resize event going from vertical to horizontal? -

Image
has noticed behavior? i'm trying write script trigger upon resize. works fine on normal browsers, works fine on iphone, on ipad, trigger going horizontal vertical viewport, not vice versa. here's code: $(window).resize( function() { var agent=navigator.useragent.tolowercase(); var is_iphone = ((agent.indexof('iphone') != -1)); var is_ipad = ((agent.indexof('ipad') != -1)); if(is_iphone || is_ipad){ location.reload(true); } else { /* stuff. */ }; }); if understood correctly, want when user tilts ipad. here go: window.onorientationchange = function(){ var orientation = window.orientation; // @ value of window.orientation: if (orientation === 0){ // ipad in portrait mode. } else if (orientation === 90){ // ipad in landscape mode. screen turned left. } else if (orientation === -90){ // ipad in landscape mode. screen turned right. } }...

mysql - MySQLdb for Python - incompatible library version error? -

i am, many others, trying mysqldb python run on mac snow leopard (10.6.x) , i've been able install 64-bit mysql dmg recommended various blogs/forum posts, , i've been able install setuptools , mysqldb using the archflags='-arch 86_64' python2.7 setup.py clean archflags='-arch 86_64' python2.7 setup.py build sudo archflags='-arch 86_64' python2.7 setup.py install as can see above have upgraded python 2.7 , seems fine; except when try import mysqldb python shell. >>> import mysqldb traceback (most recent call last): file "<stdin>", line 1, in <module> file "build/bdist.macosx-10.6-universal/egg/mysqldb/__init__.py", line 19, in <module> file "build/bdist.macosx-10.6-universal/egg/_mysql.py", line 7, in <module> file "build/bdist.macosx-10.6-universal/egg/_mysql.py", line 6, in __bootstrap__ importerror: dlopen(/users/ad/.python-eggs/mysql_python-1.2.3c1-py2.6-macosx-...

Photo printing API system? -

i looking options provide customers on website way order prints photos. (it photo sharing site, needs automated, don't want portfolio sites require uploads , not). basically needs send them photos, address, (and possibly billing info) , make prints , mail them out. i have searched on place such system, none seem offer want. i tried hacking snapfish (which worked, says "return picasa" on buttons, makes sort of lame...) any ideas? you may have found http://fotomoto.com seems fit requirements.

javascript - call a java script function in a js file from a function of another js file -

my problem have 2 js file (1.js, 2.js), in both has same functionality , methods(or copy of file). want call function (like _finish() ) 1 js(1.js) file js file(2.js) file. can give solution. i agree jandy. in case must use namespaces. example, if have script 1 defining variable a , second script defining it's own variable a , when 2 scripts put together, last script executed browser overwrites a variable : //script 1 var = 'script 1 value'; // ... //script2 var = 'script 2 value'; // ... alert(a); when execute above example, you'll see second script has redefined a variable. so, best way without having name conflicts using namespaces: //script 1 script1namespace.a = 'script 1 value'; // ... //script2 script2namespace.a = 'script 2 value'; // ... alert(script1namespace.a); alert(script2namespace.a);

c# - What is dependent property in silverlight/wpf -

as titles says. dependent property in silverlight/wpf. there no such thing in c#. guess talking dependency properties , wpf concept. see dependent properties , msdn .