Posts

Showing posts from August, 2011

data retrieval - Sporadically Slow Calls From .NET Application To SQL Server -

i have table in sql server inherited legacy system thats still in production structured according code below. created sp query table described in code below table create statement. issue that, sporadically, calls .net sp both through enterprise library 4 , through datareader object slow. sp called through loop structure in data layer specifies params go sp purpose of populating user objects. it's important mention slow call not take place on every pass loop structure. fine of day or more, , start presenting makes extremely hard debug. the table in question contains 5 million rows. calls slow, instance, take long 10 seconds, while calls fast take 0 10 milliseconds on average. checked locking/blocking transactions during slow calls, none found. created custom performance counters in data layer monitor call times. essentially, when performance bad, it's bad 1 call. when it's good, it's good. i've been able recreate issue on few different developer mach...

javascript - Remove all classes that begin with a certain string -

i have div id="a" may have number of classes attached it, several groups. each group has specific prefix. in javascript, don't know class group on div. want able clear classes given prefix , add new one. if want remove of classes begin "bg", how do that? this, works: $("#a").removeclass("bg*"); with jquery, actual dom element @ index zero, should work $('#a')[0].classname = $('#a')[0].classname.replace(/\bbg.*?\b/g, '');

indexing - SQL/Oracle: when indexes on multiple columns can be used -

if create index on columns (a, b, c), in order, understanding database able use if search on (a), or (a , b), or (a , b , c), not if search on (b), or (c), or (b , c). correct? there 3 index-based access methods oracle can use when predicate placed on non-leading column of index. i) index skip-scan: http://download.oracle.com/docs/cd/b19306_01/server.102/b14211/optimops.htm#pfgrf10105 ii) fast full index scan: http://download.oracle.com/docs/cd/b19306_01/server.102/b14211/optimops.htm#i52044 iii) index full scan: http://download.oracle.com/docs/cd/b19306_01/server.102/b14211/optimops.htm#i82107 i've seen fast full index scan "in wild", possible.

.net - Visual Studio, Flash & ActiveX pickle -

about 5 years ago wrote touch screen kiosk application in visual studio 2005 (.net 2.0) embedded flash activex movie in it, ran flash application written in flash 6. fast forward present , i've been tasked upgrading our kiosk platform allow video conferencing. requires communicating external application through window messages handles video call , shows incoming video overlaid image. however i've run several (seemingly conflicting) problems getting old visual studio 2005 project run on computer today, under windows 7 , visual studio 2010. attempt 1: windows 7, visual studio 2010, flash 10.1 activex installed begin checked old solution out of svn , loaded visual studio 2010, using upgrade wizard. when run project following exception: system.runtime.interopservices.comexception unhandled message=class not registered (exception hresult: 0x80040154 (regdb_e_classnotreg)) source=system.windows.forms errorcode=-2147221164 stacktrace: @ system.windows.forms...

Set Google Chrome as the Debugging Browser in Visual Studio -

when press f5 in visual studio 2008, want google chrome launched browser asp.net app runs in. may know how can done? right click on .aspx file , click "browse with..." select chrome , click "set default." can select more 1 browser in list if want. there's great wovs default browser switcher visual studio extension .

iphone - Find location of specific character in NSString -

how can find location of specific character in nsstring? i have tried returns empty range (i want find location of '?'): nsrange range = [@"this ? test see if works" rangeofcharacterfromset:[nscharacterset charactersetwithcharactersinstring:@"?"]]; you must doing else wrong. because absolutely correct , returns {10, 1} . @ least on mac ;-)

.net - Serialize Deserialize to/from xlsx -

given following assemblage of classes (contrived): public class school { [primarykey] public string name {get; set;} [set] public ilist<teacher> teachers {get; set;} public class teacher { [primarykey] public string name {get; set;} i'd have object hierarchy serialized single sheet of xlsx file, like school.name teacher.name waldorf college ms. briggs waldorf college mr. smith starfleet academy mr. spock starfleet academy mr. sulu starfleet academy mr. kirk i'd deserialize (sensible) modifications xlsx file, creating new copy of school, , associated teachers. does know of similar doesn't require touching openxml libraries much? thanks. you can use ado.net , linq. using ado.net create , alter excel file... <= first link found helps.

loading Java classes from a signed applet -

if i'm running signed java applet, can load additional classes remote sources (in same domain, maybe same host) , run them? i'd without changing pages or stopping current applet. of course, total size of classes large load them @ once. is there way this? , there way signed applets , preserve "confidence" status? i think classes lazy loaded in applets. being loaded on demand. anyway, if classes outside of jar can use applet classloader , load them name. ex: classloader loader = this.getclass().getclassloader(); class clazz = loader.loadclass("acme.appletaddon"); if want load classes jar think need create new instance of urlclassloader url(s) of jar(s). url[] urls = new url[]{new url("http://localhost:8080/addon.jar")}; urlclassloader loader = urlclassloader.newinstance(urls,this.getclass().getclassloader()); class clazz = loader.loadclass("acme.appletaddon"); by default, applets forbidden create new classloaders....

asp.net membership - WCF Service creates wcf Client proxy, starts transaction, calls proxy method but fails on Message Security -

i calling wcf service wcf proxy(client) withing wcf service follows: client -> service1 -> proxy.method -> service2 i use aspnet compatability everywhre asp.net membership configured , working everywhere. if call service2 proxy using transactionsope message security error on service2 unable verify message. looking @ wcf service trace (below) looks problem seems sqlprovider in service2. can think somehow transaction might deadlocked calls other services before transaction have completed , don't use transactions @ all. if don't wrap service call in transactionscope works fine! got idea please? brian 131075 3 0 2 brianfurlong-hp http://msdn.microsoft.com/en-ie/library/system.servicemodel.diagnostics.throwingexception.aspx throwing exception. /lm/w3svc/1/root/nad.checkoutservices.host-20-129243786426619315 system.servicemodel.security.messagesecurityexception, system.servicemodel, version=3.0.0.0, culture=neutral, publickeytoken=b...

bug tracking - Do you know a service like uservoice.com for bug reports? -

is there service, similar uservoice.com bug reports? it should very easy use normal, non-techie users be free be maintainable http://lighthouseapp.com/ want. it's used github , bunch of other sites. although think might need pay more advanced features.

javascript - grab CSS value with Regex -

i hoping can me regex, need grab test2 , between { } .test1 {font-family: arial, helvetica, sans-serif; color: #42bf32; font-size: 14px; } .test2 {font-family: arial, helvetica, sans-serif; color: #42bf32; font-size: 14px; } .test3 {font-family: arial, helvetica, sans-serif; color: #42bf32; font-size: 14px; } i using asp , javascript i have feeling regex test2.replace(/\.test(.*?)\{(.*?)\}/ig, '.test3'); any appreciated thanks steward works fine .replace(/.test *{[^}]*/ig, ''); test2[[:space:]]*{[^}]*} but should use real css parser instead.

Firebird database replication -

i have reached point i've decided replace custom-built replication system system has been built else, reliability purposes. can recommend replication system worth it? fibre good? what need might little away generic system, though. have 5 departments each having it's own copy of database, , master in remote location. departments have sporadic internet connection, master online. data has flow , forth master, meaning departments need equal master (when internet connection available), , upload changes made during network outage later distributed other departments master. i have used copycat create replication project. allows create own replication client/server configuration using codegear delphi. allows complete flexibilty how want replication work. if don't use delphi, or need prefabricated solution, copytiger same thing configured.

F# - performing non-deterministic groupings on lists -

i’m working on problem know can solve c#. prove boss f# able solve in more succinct way. understanding of functional programming still immature. the problem: i’m working list of ‘trade’ classes. definition of class follows: type trade(brokerid : string, productid : string, marketid : string, buysideid : string, tradedate : string, ruleid : int) = class member this.brokerid = brokerid member this.productid = productid member this.marketid = marketid member this.buysideid = buysideid member this.tradedate = tradedate end i need able group trades , apply rule each of resulting groups of data. however cannot guarantee grouping of data i.e. rule determining grouping potentially change every time program run - instance may have group by: tradedate, brokerid tradedate only tradedate, brokerid, accountid ... , on. once have distinct groups easy (i think) apply rule (such ‘is total tradeamount greater 10,000’). any / pointers creating functional or...

asp.net mvc 2 - Caching Entity Framework EntityTypes -

i have entitytypes generated database using entity framework 4. use cache store of these entitytypes performance reasons. safe following provided object used read-only actions: context.students.mergeoption = mergeoption.notracking; var students = context.students.where(s => s.name == "adam").tolist(); cache["students"] = students; thanks. one way use ef cache provider . use web server's cache. make sure not prematurely optimizing, or optimizing wrong thing. doing make life miserable. better optimize web site front end caching.

java - How to convert a Reader to InputStream and a Writer to OutputStream? -

is there easy way avoid dealing text encoding problems? you can't avoid dealing text encoding issues, there existing solutions: reader inputstream : readerinputstream writer outputstream : writeroutputstream you need pick encoding of choice.

flex - Is Red5 production-ready? -

i'm considering using red5 instead of wowza , flash media interactive server. looks new project , hasn't reached full v1, i'm worried using in production environment. has used in real production environment , share experience , document others? version numbers on open source products tricky. can said red5 hasn't had 1.0 release. or they've had 5 major version releases. wiki ; 5 "final" releases. with commercial software, there business reason 1.0 [ready or not]; open source software not have such pressures. fact active project enough people. for specific examples, pretty sure ribbit using red5 in backend; don't know how [or i] verify that. red5 regarded in community de facto alternative flash media server. download , test specific use case.

Can you animate a custom dependency property in Silverlight? -

i might missing obvious. i'm trying write custom panel contents laid out according couple of dependency properties (i'm assuming have dps because want able animate them.) however, when try run storyboard animate both of these properties, silverlight throws catastophic error. if try animate 1 of them, works fine. , if try animate 1 of properties , 'built-in' property (like opacity) works. if try animate both custom properties catastrophic error. anyone else come across this? edit: the 2 dps scalex , scaley - both doubles. scale x , y position of children in panel. here's how 1 of them defined: public double scalex { { return (double)getvalue(scalexproperty); } set { setvalue(scalexproperty, value); } } /// <summary> /// identifies scalex dependency property. /// </summary> public static readonly dependencyproperty scalexproperty = dependencyproperty.register( ...

c# - Implementing CollectionConstraints across NUnit versions -

we've implemented collectionconstraint nunit in version 2.4.3 in c#. of our developers have upgraded version 2.4.7 though, , project creation errors when compiling. error domatch: no suitable method found override any advice on how constraint compiles version-agnostically? unfortunately constraint api changed in incompatible ways custom constraints in 2.4.6. nunit 2.4.5 , earlier used iconstraint interface , in 2.4.6 changed constraint abstract base class. there optional constraint base class in 2.4.5 , earlier, class not consistent between versions. therefore there no way make compiled dll work both versions of nunit. should upgrade same version of nunit. sorry i'm sure not answer you're looking for. sam

c++ - Is destructor called when removing element from STL container? -

say have 2 containers storing pointers same objects: std::list<foo*> foolist; std::vector<foo*> foovec; let's remove object 1 of these containers via 1 if methods: std::vector<foo*>::iterator itr = std::find( foovec.begin(), foovec.end(), ptoobj ); foovec.erase( itr ); cppreference says calls object's destructor. mean pointer object in foolist dangling pointer? i'd prefer not use reference counted pointers. how can problem handled? no. when remove pointer container, you've done take pointer value container, nothing deleted. (i.e.: pointers have no destructor.) however, it's dangerous have pointers of things in containers. consider: std::vector<int*> v; v.push_back(new int()); v.push_back(new int()); v.push_back(new int()); if never go through container , delete each one, you've leaked. worse it's not exception safe. should use pointer container , delete things points when erased. (and erased when con...

c# - Generic method: instantiate a generic type with an argument -

this question has answer here: passing arguments c# generic new() of templated type 13 answers i have generic method takes in type t, need able call constructor on requires single xmlnode. currently, trying having abstract base class has constructors want (plus parameterless 1 don't have edit "subclasses" other add actual subclassing) , constraining that. if try instantiate 1 of these classes, complains it: cannot create instance of variable type 't' because not have new() constraint and if add new() constraint, get: 't': cannot provide arguments when creating instance of variable type how can want? c# lawyer: how create instance of generic type parameters c# generics problem - newing generic type parameters in constructor

project management - I need this baby in a month - send me nine women! -

under circumstances - if - adding programmers team speed development of late project? the exact circumstances specific project ( e.g. development team, management style, process maturity, difficulty of subject matter, etc.). in order scope bit better can speak in sweeping oversimplifications, i'm going restate question: under circumstances, if any, can adding team members software development project running late result in reduction in actual ship date level of quality equal if existing team allow work until completion? there number of things think necessary , not sufficient, occur (in no particular order): the proposed individuals added project must have: at least reasonable understanding of problem domain of project be proficient in language of project , specific technologies use tasks given their proficiency must /not/ less or greater weakest or strongest existing member respectively. weak members drain existing staff tertiary problems while new per...

c# - What is the best process for a new ASP.NET web app from the ground up? -

i re-building our poorly designed web application scratch, , wanted tdd , "do things right" kind of learning project. tools, processes, , resources recommended "right" start? working alone architect , developer, backup of business analyst , business owners usability testing , use cases. edit: right use sourcesafe source control, there reason technologically i'd want try switch subversion? edit #2: looks consensus is: cruise control.net subversion(if want stop using sourcesafe) asp.net mvc nunit unit testing resharper i highly recommend take @ mvc asp.net if want make unit testing high priority in development process. sounds perfect trying do. i recommend cruisecontrol.net continuous integration (this important if team going grow). subversion favorite source control system when working on small teams. use tortoise svn windows explorer integration.

c++ - What does {0} mean when initializing an object? -

when {0} used initialize object, mean? can't find references {0} anywhere, , because of curly braces google searches not helpful. example code: shellexecuteinfo sexi = {0}; // do? sexi.cbsize = sizeof(shellexecuteinfo); sexi.hwnd = null; sexi.fmask = see_mask_nocloseprocess; sexi.lpfile = lpfile.c_str(); sexi.lpparameters = args; sexi.nshow = nshow; if(shellexecuteex(&sexi)) { dword wait = waitforsingleobject(sexi.hprocess, infinite); if(wait == wait_object_0) getexitcodeprocess(sexi.hprocess, &returncode); } without it, above code crash on runtime. what's happening here called aggregate initialization. here (abbreviated) definition of aggregate section 8.5.1 of iso spec: an aggregate array or class no user-declared constructors, no private or protected non-static data members, no base classes, , no virtual functions. now, using {0} initialize aggregate trick 0 entire thing. because when using aggregate initialization y...

Analytics for 3rd party JavaScript widgets -

i'm trying find best approach analyics on 3rd party javascript widgets - i.e. tools , content distributed number of arbitrary users, include widgets html snippets tags. on same domain note widgets do not load iframe element has document loaded external site. instead, load content dom of host page - i.e. treated being on same domain host. analytics fragment of host page so, essentially, want track stats (such widget views , user clicks , custom interactions within widget), want track stats fragment of host page widget. don't want track clicks on host page outside widget. i want stats collated together, stats widget on site aggregated of widget on site b , site c, etc. questions is possible use google analaytics in custom way satisfies these requirements? or not possible separate ga rest of data collected on host page? if possible use google analytics, there problem if host page uses ga (with different ga profile id), or possible keep them safely apart? ...

c++ - Are POD types always aligned? -

for example, if declare long variable, can assume aligned on "sizeof(long)" boundary? microsoft visual c++ online says so, standard behavior? some more info: a. possible explicitely create misaligned integer (*bar): char foo[5] int * bar = (int *)(&foo[1]); b. apparently, #pragma pack() affects structures, classes, , unions. c. msvc documentation states pod types aligned respective sizes (but or default, , standard behavior, don't know) as others have mentioned, isn't part of standard , left compiler implement sees fit processor in question. example, vc implement different alignment requirements arm processor x86 processors. microsoft vc implements called natural alignment size specified #pragma pack directive or /zp command line option. means that, example, pod type size smaller or equal 8 bytes aligned based on size. larger aligned on 8 byte boundary. if important control alignment different processors , different compiler...

openxml sdk - What exactly does the Open XML SDK v2 take care of that you would have to do manually when coding by hand with an XML library? -

this closely related question asked: is there functionality not exposed in open xml sdk v2? i working open xml files manually. had @ sdk , surprised find looked pretty low level, quite similar in fact helper classes have created myself. question sdk v2 take care of have manually when coding hand xml library? for example, automatically patch _rels files when deleting powerpoint slide? in addition otaku's links, this shows example (near bottom) of navigating openxml document using io.packaging namespace versus sdk. just microsoft states on download page sdk : the open xml sdk 2.0 microsoft office built on top of system.io.packaging api , provides typed part classes manipulate open xml documents. sdk uses .net framework language-integrated query (linq) technology provide typed object access xml content inside parts of open xml documents. the open xml sdk 2.0 simplifies task of manipulating open xml packages , underlying open xml s...

database - Good PHP ORM Library? -

is there object-relational-mapping library php? i know of pdo /ado, seem provide abstraction of differences between database vendors not actual mapping between domain model , relational model. i'm looking php library functions way hibernate java , nhibernate .net. look doctrine . doctrine 1.2 implements active record. doctrine 2+ datamapper orm. also, check out xyster . it's based on data mapper pattern. also, take @ datamapper vs. active record .

javascript - When a 'blur' event occurs, how can I find out which element focus went *to*? -

suppose attach blur function html input box this: <input id="myinput" onblur="function() { ... }"></input> is there way id of element caused blur event fire (the element clicked) inside function? how? for example, suppose have span this: <span id="myspan">hello world</span> if click span right after input element has focus, input element lose focus. how function know myspan clicked? ps: if onclick event of span occur before onblur event of input element problem solved, because set status value indicating specific element had been clicked. pps: background of problem want trigger ajax autocompleter control externally (from clickable element) show suggestions, without suggestions disappearing because of blur event on input element. want check in blur function if 1 specific element has been clicked, , if so, ignore blur event. hmm... in firefox, can use explicitoriginaltarget pull element clicked on. exp...

What is the most efficient way to deep clone an object in JavaScript? -

what efficient way clone javascript object? i've seen obj = eval(uneval(o)); being used, that's non-standard , supported firefox . i've done things obj = json.parse(json.stringify(o)); question efficiency. i've seen recursive copying functions various flaws. i'm surprised no canonical solution exists. note: reply answer, not proper response question. if wish have fast object cloning please follow corban's advice in answer question. i want note .clone() method in jquery clones dom elements. in order clone javascript objects, do: // shallow copy var newobject = jquery.extend({}, oldobject); // deep copy var newobject = jquery.extend(true, {}, oldobject); more information can found in jquery documentation . i want note deep copy smarter shown above – it's able avoid many traps (trying deep extend dom element, example). it's used in jquery core , in plugins great effect.

How do I calculate number of days between two dates using Python? -

if have 2 dates (ex. '8/18/2008' , '9/26/2008' ) best way number of days between 2 dates? if have 2 date objects, can subtract them. from datetime import date d0 = date(2008, 8, 18) d1 = date(2008, 9, 26) delta = d0 - d1 print delta.days the relevant section of docs: https://docs.python.org/library/datetime.html

language agnostic - What exactly does the word Patch mean when referring to 'submitting a patch'? -

what word patch mean when referring 'submitting patch'? i've seen used lot, in open source world. what mean , involved in submitting patch? it's file list of differences between code files have changed. it's in format generated doing diff -u on 2 files. version control systems allow easy creation of patches it's in same format. this allows code change applied else's copy of source code using patch command. for example: let's have following code: <?php $foo = 0; ?> and change this: <?php $bar = 0; ?> the patch file might this: index: test.php =================================================================== --- test.php (revision 40) +++ test.php (working copy) @@ -3,7 +3,7 @@ <?php - $foo = 0; + $bar= 0; ?>

javascript - JSON to string variable dump -

is there quick function convert json objects received via jquery getjson string variable dump (for tracing/debugging purposes)? yes, json.stringify , can found here , it's included in firefox 3.5.4 , above. a json stringifier goes in opposite direction, converting javascript data structures json text. json not support cyclic data structures, careful not give cyclical structures json stringifier. https://web.archive.org/web/20100611210643/http://www.json.org/js.html var myjsontext = json.stringify(myobject, replacer);

Visual Studio debugger tips & tricks for .NET -

i've been working years vs's debugger, every , come across feature have never noticed before, , think "damn! how have missed that? it's so useful!" [disclaimer: these tips work in vs 2005 on c# project, no guarantees older incarnations of vs or other languages] keep track of object instances working multiple instances of given class? how can tell them apart? in pre-garbage collection programming days, easy keep track of references - @ memory address. .net, can't - objects can moved around. fortunately, watches view lets right-click on watch , select 'make object id'. watches view http://img403.imageshack.us/img403/461/52518188cq3.jpg this appends {1#}, {2#} etc. after instance's value, giving instance unique label. looks this: numbered instance http://img383.imageshack.us/img383/7351/11732685bl8.jpg the label persisted lifetime of object. meaningful values watched variables by default, watched variabl...

javascript - font-replacement services for Helvetica Neue -

a project i'll working on in near future requires me font replacement headings , small portions of copy (blockquotes, etc) the catch designer wants use helvetica neue. i've looked @ typekit, fontdeck, google fonts, , fontsquirrel , don't seem have said font nor comparable. i'm aware use sifr or cufon, , haven't ruled out. are there services on web font can purchased/rented/etc from? you can host fonts on server, , use css @font-face rule display fonts on web site. however, need check font license carefully. fonts hosted google , others tend chosen because have open license. fonts helvetica have strict commercial licenses. although buy 1 of helvetica variants around $30, might not able use on web site. article may of assistance: http://fontfeed.com/archives/new-end-user-licence-agreement-for-fontfont/ you might want have @ helvetica neue: ugly truth , describes how browsers have trouble rendering designer's font of choice. it may...

"PHP-ext" -like PHP widget libraries? -

i've asked a similar question while (actually 1 year)...back looking widget library, generated server-side in php. interesting candidate find php-ext , project seems pretty dead. so 1 year later, there new open source project of kind ? or widget (php-driven) use , find useful ? edit : make clear, i'm looking set of standalone (that can use without having embrace whole framework) php classes or libraries handle generation of client-side (html+css+js) widgets. technically, php cannot "widgets" in itself. must use javascript framework (i.g. jquery ui) create widgets , use php handle requests between client , server. use zend/zendx jquery , works fine. it's big framework small projects, still use coding practices. in short, suggest use jquery ui , write requests handlers manually. it's simpler , concise way.

objective c - How much does it cost to develop an iPhone application? -

how can developer charge iphone app twitterrific ? i want know because need such application same functionality new community website. can ruby have no experience objective-c. interesting me if should start reading books iphone programming or outsource work iphone programmer. i'm 1 of developers twitterrific , honest, can't tell how many hours have gone product. can tell upvoted estimate of 160 hours development , 40 hours design fricken' high. (i'd use phrase, first post on stack overflow, i'm being good.) twitterrific has had 4 major releases beginning ios 1.0 (jailbreak.) that's lot of code, of in bit bucket (we refactor lot each major release.) one thing interesting @ amount of time had work on ipad version. apple set product release date gave 60 days development. (that later extended week.) we started ipad development scratch, lot of our underlying code (mostly models) re-used. development done 2 experienced ios developers. 1 of them ha...

visual studio 2008 - Can I safely install .Net framework 3.5 SP1 without requiring my customers to upgrade their .Net Framework distributable? (currently running 3.5) -

can safely download , install .net framework 3.5 sp1 without requiring customers upgrade .net framework distributable? edit: , without changing build script edit: i'm running 3.5 from hanselman , on .net 3.5 side of things, since sp (service pack), yes, stuff goes in gac , gets changed. however, changes additive. means if api's method signature has changed, that's bug need fix. compatible service pack release. shouldn't break of existing code.

c# - ASP.NET : getting 'currentStyle' is null or not an object when adding webpanel dynamicly -

i added dynamicly infragistics webpanel in codebehind using : placeholder.controls.add(ctlwebpanel); got javascript error in asp.net page in runtime : 'currentstyle' null or not object how set style remove error ? thanks brian concern. find out missing css style class. setted property cssclass dynamicly when creating control , works ! still don't understand why it's mandatory set dynamicly when don't have if added directly in design.

flex - How to get command line arguments for a running process -

in program, have been receiving error when use command-line compile command mxmlc. error related embedded font name not being correctly identified flex in system fonts list. however, on whim, decided copy code flex builder , compile there. surprise, worked, , found proper font using same system name had given (pmingliu). i suspected problem may locale one, , system cannot correctly identify font name because of locale considerations. i've tried setting locale of compile code en_us, no avail. ask if here knows how flex builder invokes mxml compiler , differences there compared running mxmlc directly? know it's not using mxmlc.exe directly, since tried replacing mxmlc our own executable capture command line parameters. if matters, os used windows xp. although don't have exact answer question (what command line arguments flex builder passes mxmlc.exe), have meta-answer you. can find command line using 1 of 2 methods. the first platform-agnostic require ...

performance - Is this prime generator inefficient C++? -

is seen in efficient prime number generator. seems me pretty efficient. use of stream makes program run slower? i trying submit spoj , tells me time limit exceeded... #include <iostream> #include <sstream> using namespace std; int main() { int testcases, first, second, counter = 0; bool isprime = true; stringstream out; cin >> testcases; (int = 0; < testcases; i++) { // next 2 numbers cin >> first >> second; if (first%2 == 0) first++; // find prime numbers between 2 given numbers (int j = first; j <= second; j+=2) { // go through , check if j prime (int k = 2; k < j; k++) { if (j%k == 0) { isprime = false; break; } } if (isprime) { out << j << "\n"; } isprime = true; } ...

javascript - Using AJAX for page items while still allowing them to be opened in a new tab/window -

i'm looking @ using ajax allow content within part of page reloaded without reloading entire web page (eg things overview, reviews, specifications, etc pages single item). the problem still want allow users open these items in new tab or window (using normal systems web browser such right clicking link , picking "open link in new tab) rather left clicking link). is @ possible this, or best practice reload entire page in cases this? it's doable. need provide href , onclick in links. the href activate if user has no js, or if user decides open link in special way (new tab, etc.) the onclick activate on "normal" clicks of link. can cancel default action (by returning false or using js lib of choice's way it) , ajax stuff.

theory - When is theoretical computer science useful? -

in class, learned halting problem, turing machines, reductions, etc. lot of classmates saying these abstract , useless concepts, , there's no real point in knowing them (i.e., can forget them once course on , not lose anything). why theory useful? ever use in day-to-day coding? when graduated college, assumed on par else: "i have bs in cs, , lot of other people, , can same things." discovered assumption false. stood out, , background had lot it--particularly degree. i knew there 1 "slight" difference, in had "b.s." in cs because college 1 of first (supposedly #2 in 1987) in nation receive accreditation cs degree program, , graduated in second class have accreditation. @ time, did not think mattered much. i had noticed during high school , in college did particularly @ cs--much better peers , better many of teachers. asked lot, did tutoring, asked research project, , allowed independent study when no 1 else was. happy able help,...

c++ - Can the overall implementation of a component be divided in two objects? -

i've seen microsoft com , xpcom, @ least i've read , gathered far, implementations of interfaces in component have in single class derives virtual interfaces. correct? missing? is there way have multiple objects (possibly in separate dll's) each provide functionality , still able freely transition between them using queryiterface? what i'm looking have component functionality, still allow external client code create new extensions of component (possibly) new interfaces. ideally should happen without divulging current source of component , implementation. this should possible, although not supported standard high-level wrappers. of wrappers (atl, mfc, etc.) support mapping com object single class. however, queryinterface allowed return different pointer , calls com object code, first com object load different dll, instantiate different object, , return pointer it's interface (vtable). it's possible far know, you'll writing lot of low-level ...

c# - Get Current Index for Removal in String Collection -

i have string collection populated id's --> 12345 23456 34567 and on. need @ user's request, , when parameters met, go through list, starting @ top, , perform method() using id. if successful remove list , move on. i, embarrassingly, have never worked collection before in manner. can point me in right direction. examples seem of console.writeline(""); variety. my base, ignorant, attempt looks --> var driups = settings.default.driupdates.getenumerator(); while (driups.movenext()) { var wassuccessfull = performdriupdate(driups.current); if (wassuccessfull) { driups.current.remove(driups.current.indexof(driups.current)); } } the part concerned remove(); isn't there better way current index? , tips, hints, criticism, pointers, etc....welcome. thanks! you quite right concerned 'remove' during enumeration. how somethign this: int i...

python - Set PYTHONPATH in Emacs on MacOS? -

emacs not recognize correct python path. think general problem emacs not recognizing environment variables. have gnu emacs 22.1.1 (i386-apple-darwin8.9.1, carbon version 1.6.0) of 2007-06-17 installed. i have set pythonpath in ~/.bashrc . maybe should set somewhere else? .bashrc gets read when shell starts; won't affect carbon emacs. instead, use setenv in .emacs : (setenv "pythonpath" "path_string_here") you can set pythonpath entire mac os session, adding ~/.macosx/environment.plist (more here ). don't want unless have xcode (and property list editor) installed. ( via procrastiblog )

When removing an item from a ListView, how do I highlight the item that relaces it in VB.NET? -

i have listview in project has dynamically added/edited/deleted items. when user deletes item, want item replaces deleted item highlighted. tried storing deleted item's index highlighting item there ( list.items(index).selected = true ). works unless item deleted last item in listview (both literally , sequentially). i'm having issues today logic , can't quite come code checks these kinds of cases. could me? feel incredibly stupid brain falls apart today. if index = list.items.count ' deleted index @ end of list , thing else list.items(index).selected = true end if

svn - Do I really need version control? -

i read on internet (various sites , blogs) version control. how great , how developers need use because useful. here question: need this? i'm front-end developer (usually html/css/javascript) , never had problem "wow, files yesterday!". i've tried use it, installed subversion , tortoisesvn , understand concept behind version control but... can't use (weird me). ok, so... bad? work alone (freelancer) , had no client asked me use subversion (but never late this, right?). so, should start , struggle learn use subversion (or similar?) or it's waste of time? related question: good excuses not use version control . here's scenario may illustrate usefulness of source control if work alone. your client asks implement ambitious modification website. it'll take couple of weeks, , involve edits many pages. work. you're 50% done task when client calls , tells drop you're doing make urgent more minor change site. you'...