text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
there were significant changes to the implementation of `import` in python. Consider: python searches an import path at run-time with a fail-fast algorithm; java searches a path with an exhaustive algorithm both at compile-time and run-time. Go ahead, try arranging your directories like this: ``` folder_on_path/ ...
[ -0.07867816835641861, -0.14119912683963776, 0.08748128265142441, -0.2926750183105469, -0.2595874071121216, -0.05948467180132866, -0.11611369997262955, -0.008057376369833946, -0.5416641235351562, -0.5310030579566956, -0.3116311728954315, 0.5481632947921753, -0.5570827722549438, -0.304848790...
domain2/ module.py __init__.py ``` Then try: ``` from com.domain1 import module from com.domain2 import module ``` Exactly one of those statements will succeed. Why? Because either `folder_on_path` or `other_folder_on_path` comes higher on the search path. When python sees `from com.` it gr...
[ -0.047957878559827805, -0.14988620579242706, 0.5311983823776245, -0.04558350518345833, -0.04837476834654808, -0.13373704254627228, -0.0895775705575943, -0.1889421045780182, -0.4296194016933441, -0.5406490564346313, -0.18345819413661957, 0.6732555627822876, -0.6718237400054932, 0.0716321393...
point in the flow of the code (although most often at the beginning). Nobody wants an exhaustive tree-walk at that point to verify that there's no possible match. It assumes that if it finds a package named `com`, it is *the* `com` package. Moreover, python doesn't distinguish between the following statements: ``` fr...
[ 0.03953222557902336, 0.0715956836938858, 0.1485711634159088, -0.10238480567932129, -0.10765212774276733, -0.2399194985628128, 0.14661282300949097, -0.15232670307159424, -0.10627029836177826, -0.6382182836532593, 0.015825526788830757, 0.42457687854766846, -0.32348915934562683, -0.0071294833...
an advantage of naming classes and files the same). In python, if you tried to accomplish import with nothing but file system assistance, the first case could (almost) be transparently the same (**init**.py wouldn't run), the second case could be accomplished, but you would lose the initial running of module.py, but th...
[ 0.1871858835220337, -0.1676638275384903, -0.10206787288188934, 0.12154386192560196, -0.29113489389419556, -0.21305306255817413, 0.33462435007095337, -0.11687370389699936, -0.4223339855670929, -0.4574979245662689, -0.24790962040424347, 0.6997372508049011, -0.42561909556388855, -0.0080226939...
for the `com` folder, and then the `domain`, and so on and so on, but this makes packaging considerably harder, destroys drag-and-drop capability, and makes packaging and all-out nuisance.
[ 0.3129892945289612, 0.14385491609573364, 0.244369775056839, 0.10328904539346695, 0.4306503236293793, -0.09048742800951004, -0.2507207989692688, -0.03273693844676018, -0.32365909218788147, -0.5256795287132263, -0.4614853262901306, 0.41449084877967834, -0.07999366521835327, -0.03950352966785...
CDNs seem like a tremendously brute-force approach to improving website performance across the world, since they use some thousands of machines close to the end-user to ensure good throughput. Are there any ways of improving performance over long distances with high latency or slow-ish links (e.g., UK to Australia) ov...
[ 0.24215029180049896, 0.010494915768504143, 0.3771667778491974, 0.39693939685821533, -0.16545799374580383, -0.6169926524162292, 0.3978268504142761, 0.40238872170448303, -0.46685466170310974, -0.6569380164146423, -0.1580042690038681, 0.04621605575084686, -0.15675728023052216, 0.0764309242367...
is reasonably sized (i.e. also use gzip compression) - then see how far you get with that and whether multi-homing is still necessary.
[ 0.14108972251415253, 0.010202376171946526, 0.4264485836029053, 0.05836419388651848, 0.06305545568466187, -0.3552393913269043, 0.29117220640182495, -0.5128177404403687, -0.0763242244720459, -0.6073880195617676, -0.3908907473087311, 0.6907603144645691, 0.07274050265550613, -0.650059342384338...
I have simple application, that shows list of many items, where user can display detail for each item, which is obtained by Ajax. However, if user closes the detail and opens again, application makes another Ajax request, to get the same content again. Is there any simple solution how to prevent this by caching reque...
[ 0.14919964969158173, 0.012994579039514065, 0.20166705548763275, 0.3214564919471741, -0.07102609425783157, -0.08301406353712082, 0.11054828763008118, -0.020305462181568146, -0.35778167843818665, -0.9461662173271179, 0.2730749845504761, 0.49438008666038513, -0.10421445220708847, 0.1500884294...
proxy will just return previous result without making another Ajax request. But I'm looking for some simpler solution, where I won't have to implement all this by myself. Take a look at these jQuery plugins: * <http://plugins.jquery.com/project/cache> * <http://plugins.jquery.com/project/Tache> * <http://plugins.jqu...
[ -0.03640725463628769, -0.02523276023566723, 0.25601211190223694, 0.0719432532787323, -0.055051565170288086, 0.10218019038438797, 0.38240888714790344, 0.017546795308589935, -0.177942156791687, -0.9258645176887512, 0.12305658310651779, 0.39290452003479004, -0.305591881275177, 0.0189835112541...
In Python the interface of an iterable is a subset of the [iterator interface](http://docs.python.org/library/stdtypes.html#iterator-types). This has the advantage that in many cases they can be treated in the same way. However, there is an important semantic difference between the two, since for an iterable `__iter__`...
[ -0.11575920879840851, 0.008077379316091537, 0.01049055252224207, 0.04741246625781059, -0.2611355781555176, 0.25378236174583435, 0.024010784924030304, -0.34004539251327515, -0.358243465423584, -0.36815258860588074, -0.20207014679908752, 0.8011643886566162, -0.16355296969413757, -0.243319556...
when one wants to loop multiple times. If an iterator is given then the second loop will not work since the iterator was already used up and directly raises `StopIteration`. It is tempting to test for a `next` method, but this seems dangerous and somehow wrong. Should I just check that the second loop was empty? Is t...
[ 0.5957831740379333, -0.04227719455957413, -0.13877201080322266, -0.03764790669083595, 0.08109285682439804, -0.08804276585578918, 0.448772668838501, -0.32572221755981445, -0.39546239376068115, -0.2719687819480896, 0.10556221753358841, 0.3901212513446808, -0.4452628195285797, -0.023172399029...
is primarily a problem of wanting to do multiple passes over the iterator, and that one should not do this in the first place. However, in my case the data is very large and depending on the situation has to be passed over multiple times for data processing (there is absolutely no way around this). The iterable is als...
[ 0.21836405992507935, -0.06120806187391281, 0.3375639021396637, 0.43643319606781006, -0.11462985724210739, 0.047570012509822845, 0.16100257635116577, -0.27258795499801636, -0.2713031768798828, -0.45843344926834106, -0.2940751314163208, 0.49470821022987366, -0.09642765671014786, -0.148958623...
iterator when multiple passes are needed. **Edit 2:** Actually this is a very nice Example for [Abstract Base Classes](http://www.python.org/dev/peps/pep-3119/#abcs-for-containers-and-iterators). The `__iter__` methods in an iterator and an iterable have the same name but are sematically different! So `hasattr` is use...
[ -0.3026801645755768, -0.16988658905029297, 0.2938019335269928, 0.06624117493629456, 0.04888323321938515, 0.00796977337449789, 0.17165346443653107, -0.42760130763053894, -0.26999130845069885, -0.35208702087402344, -0.34555783867836, 0.5584997534751892, -0.25131702423095703, 0.00897577870637...
I am having a C++ code which have lot of recursion involved . I am thinking of using register class for my variables . Do you think by doing so I will be saving stack memory and will improve the performance Thanks Sameer I could bet that the compiler is NOT going to honor your request. Say that you have a local vari...
[ 0.3495773375034332, 0.09145251661539078, 0.08176106214523315, 0.22013422846794128, -0.1262865960597992, 0.038153305649757385, 0.6370134949684143, -0.44646987318992615, -0.08926244080066681, -0.4213855266571045, -0.02273976430296898, 0.7409601211547852, -0.26794320344924927, -0.073847800493...
is a difficult problem. Analyze where is the program really spending time and try to optimize there, but be cautious: some decisions can end in no gain, some can end up in worse performance. As it has been mentioned before, compilers are really good at what they do. Forcing a variable into a register means one less reg...
[ 0.0825495645403862, -0.08693116158246994, -0.44071751832962036, 0.39237526059150696, -0.13370834290981293, 0.002377105178311467, 0.24048292636871338, -0.0953516811132431, -0.08640850335359573, -0.6512179374694824, -0.10553343594074249, 0.7177279591560364, -0.18866050243377686, -0.286087483...
I keep getting a 'List does not exist' error whenever I try and use AssetUrlSelector to browse a subfolder in Microsoft Office SharePoint Server (MOSS). To reproduce this behaviour: Add a Summary Link Web Part and add a new link. Click 'Browse' this will open the AssetPortalBrowser.aspx dialog. Browse to a list that c...
[ 0.2420840710401535, -0.003254443174228072, 0.4973244071006775, -0.08476211875677109, -0.2029729038476944, -0.3625439405441284, 0.4752526879310608, 0.29891201853752136, -0.43063679337501526, -0.6648510694503784, 0.004091751761734486, 0.6471187472343445, -0.2374296635389328, 0.29210260510444...
error. I'd be interested to know if anyone else has this issue or if anyone can confirm if this is correct behaviour? I confirm this problem occurs with MOSS 2007 SP2 (April 2009 CU). It works fine with document libraries but not custom lists (I used a links list). You should raise a support call with Microsoft. This...
[ -0.23737457394599915, 0.334247350692749, 0.3581103980541229, -0.19744129478931427, -0.43052029609680176, -0.2571393847465515, 0.359223872423172, 0.46587902307510376, -0.2113279402256012, -0.36667487025260925, 0.13622164726257324, 0.9304416179656982, -0.2169993668794632, 0.16126315295696259...
We currently have batchjobs in Java that proces mulitple (sometimes large) files. These jobs can take some time to run. We run these files directly in the JVM, using Java Threads that continuesly run in a loop. (proces files and then wait a while). Now the company I work for, wants to run these jobs in the Weblogic ap...
[ 0.7458378076553345, 0.06576317548751831, 0.3685050308704376, -0.3062736690044403, 0.3024233877658844, -0.10404802113771439, 0.20229049026966095, 0.042493607848882675, -0.19880571961402893, -0.45287051796913147, 0.337319016456604, 0.3303473889827728, -0.143204003572464, 0.09887523204088211,...
server in FAILED state. What is the best practice to do this in BEA Weblogic? BEA Weblogic monitors only request threads against a certain time. For threads that are generated by request handling code, it does not. We have used Quartz (from OpenSymphony) scheduler to schedule job in Weblogic that used to take upto 3-4...
[ 0.1613118201494217, -0.2565844655036926, 0.3908957242965698, 0.08992478996515274, 0.12482623010873795, -0.09708568453788757, 0.5977057218551636, -0.28042665123939514, -0.16788870096206665, -0.3956548571586609, 0.334964394569397, 0.4630410075187683, 0.025868656113743782, -0.0858407691121101...
I've been running into problem after problem trying to use the a third party HTML editor to do what (I hoped) was a simple operation. Because of these problems, I'm looking for recommendations for an alternative HTML parser I could use to perform the operations. Here's my situation, I have span tags in my html (with a...
[ 0.623367965221405, 0.23722699284553528, 0.3511423170566559, -0.24846197664737701, -0.011166715994477272, 0.117040254175663, 0.20488665997982025, -0.13687178492546082, -0.5502076745033264, -0.8734904527664185, -0.04170186445116997, 0.40297046303749084, -0.06722824275493622, -0.0800400227308...
</body> </html> ``` I've been trying to use the `HTMLDocument` class in `javax.swing.text` like this: ``` Element e; e = doc.getElement(document.getDefaultRootElement(), Attribute.ID, "1"); document.setInnerHTML(element, "John"); e = doc.getElement(document.getDefaultRootElement(), Attribute.ID, "2"); document.setIn...
[ 0.4043455123901367, 0.2146964967250824, 0.5362017750740051, -0.028245097026228905, -0.07218635827302933, -0.30409693717956543, 0.38232988119125366, -0.5501277446746826, -0.08253017067909241, -0.6539955139160156, -0.2294180691242218, 0.5524557828903198, -0.2750338017940521, -0.3949120342731...
the API something along the line of ``` document.replace(e.getStartOffset(), e.getEndOffset()-e.getStartOffset(), "John", null) ``` instead of using setInnerHtml() could work.
[ 0.4398423135280609, -0.3481371998786926, 0.26748332381248474, 0.12760384380817413, -0.05060695484280586, -0.4430900514125824, 0.4528789520263672, -0.13247376680374146, -0.01591355726122856, -0.43555372953414917, -0.473016619682312, 0.48203593492507935, -0.547368049621582, 0.061818595975637...
I'm building a WCF service that will expose BasicHttp and NetTcp bindings. I've also added two corresponding Mex endpoints, i.e. ``` <service name="WCFTest.CalculatorService" behaviorConfiguration="WCFTest.CalculatorBehavior"> <host> <baseAddresses> <add baseAddress = "http://localhost:8000/WCFTest/Calcula...
[ 0.04258621856570244, -0.02201773412525654, 0.8679426312446594, -0.18308183550834656, -0.22745291888713837, 0.011838676407933235, 0.22170552611351013, -0.5647760629653931, -0.05843784287571907, -0.9453929662704468, -0.12710347771644592, 0.49810734391212463, -0.11141400039196014, 0.094096772...
Will clients not just always use the Http mex endpoint for meta data disocvery regardless of whether they're going to communicate using tcp or not? Thanks You should use the build in WCF tracing and logging. Then you can use the WCF Trace Viewer which will piece together logs from service and client so that you can se...
[ 0.14549677073955536, -0.10094142705202103, 0.5536121129989624, 0.18761609494686127, -0.2701430916786194, -0.21498872339725494, 0.39336854219436646, -0.38230082392692566, -0.19657281041145325, -0.6712062954902649, 0.11433438211679459, 0.49329447746276855, -0.4332291781902313, 0.148734703660...
How can I configure a .NET solution (C#, .NET 2.0) to to allow other developers to make use of the same unit tests for the solution using either NUnit or MSTest? Background: In this project, some developers use VS2005 Team Edition, and others make use of VS2005 Pro, so not all of the developers are able to run MSTes...
[ 0.3843996524810791, -0.10499927401542664, -0.02802235074341297, 0.27952057123184204, 0.001159587292931974, -0.2076510190963745, 0.27621644735336304, -0.25255122780799866, -0.04493637755513191, -0.641326367855072, 0.17031019926071167, 0.6645855903625488, 0.004469866398721933, 0.000295002479...
the purchase of licenses, buying either of these products isn't a viable option. Thanks in advance for your help, MagicAndi. The best solution I have found is to make use of a simple piece of code I found in this [article](http://msdn.microsoft.com/en-us/magazine/cc163643.aspx). Simply use this code snippet in the na...
[ 0.47301650047302246, -0.11074677854776382, 0.48301756381988525, 0.28305429220199585, -0.1840541511774063, 0.020998777821660042, 0.7220239639282227, -0.3900788426399231, 0.09202636778354645, -0.766242265701294, -0.2321845293045044, 0.4279155135154724, -0.02790088579058647, 0.001903146272525...
Configuration Manager (via the VS toolbar or the solution properties). Also, you need to replace all instances of the NUnit's Test attribute on your methods to make use of the MSTest TestMethod attribute (or vice versa). EDIT: Updated the code snippet above to include a possible fix for the issue [Jamie Ide](https://s...
[ 0.06901469826698303, 0.024052124470472336, -0.10496194660663605, 0.03611301630735397, -0.18180622160434723, -0.11256975680589676, 0.5927922129631042, -0.073183074593544, -0.2302125245332718, -0.6179399490356445, 0.12477555871009827, 0.5584276914596558, -0.40829330682754517, 0.0349969081580...
I know this isn't specific to PHP, but what's the point of using timezones listed like this :<http://us2.php.net/manual/en/timezones.america.php>? For example "America/Indianapolis" and "America/New\_York". What is the problem with EST, EDT, CST, CDT, &c? This is just a [different timezone format](http://en.wikipedia.o...
[ 0.254494845867157, -0.21284599602222443, 0.6090959310531616, 0.3923354744911194, 0.3661225140094757, -0.0704609826207161, -0.13301801681518555, 0.2885039150714874, -0.40997156500816345, -0.7823576927185059, -0.03491505607962608, 0.044475629925727844, -0.15867064893245697, 0.267785936594009...
**I want to delete/force garbage collection on a class instance from inside itself**. Obviously, `this = null` and `delete this` don't work. Is it any way I can do that, or am I barking up the wrong tree? I'm basically looking for a destructor of some sort.. I have a class instance that attempts to load an XML file, a...
[ 0.4011455178260803, 0.23940083384513855, -0.20184333622455597, -0.052746303379535675, -0.19015321135520935, -0.060584671795368195, 0.5859836935997009, 0.009393570013344288, -0.03220047429203987, -0.6688350439071655, -0.17176425457000732, 0.4909527003765106, -0.2778741717338562, 0.302636951...
an event to the parent and delete the child from there, but I'd prefer to do that only if there's no other way. You shouldn't attempt to remove object from itself - it is a bad practice, and in AS3 you can't do it for sure. Object *may* be deleted (i.e. garbage collected) only if there are no references left to that o...
[ 0.14164376258850098, 0.07214124500751495, 0.20266534388065338, 0.19525626301765442, -0.014555983245372772, -0.27479854226112366, 0.5373028516769409, 0.10664785653352737, -0.2658449709415436, -0.496510773897171, -0.46154412627220154, 0.130022794008255, 0.024409690871834755, 0.45024642348289...
clean up all resources used by an instance. Such method will serve as a destructor, but you'll have to call it manually. Don't forget that event listeners will also prevent garbage collection unless you remove them. There is also a difference between `delete`'ing a property and setting it to `null`. Effectively `delet...
[ -0.09858690947294235, -0.23001739382743835, -0.2912587523460388, 0.0377548523247242, -0.18096309900283813, -0.31969472765922546, 0.8048909902572632, -0.14554843306541443, -0.3305608034133911, -0.6453585624694824, -0.33554986119270325, 0.611783504486084, -0.3855968117713928, 0.4801637232303...
only a property. There are certain hacks that can be used to initiate garbage collection in flash players 9 and older ones. However recently `System.gc()` call got available, which does the same thing. Note, that you can't really rely on the fact that GC will actually be called. This is up to the flash player. **Retu...
[ 0.6127644181251526, -0.05553283914923668, -0.0017957590753212571, 0.24125082790851593, -0.26194027066230774, -0.5737666487693787, 0.5536959171295166, 0.008180589415133, -0.25445228815078735, -0.25069916248321533, -0.1605658382177353, 0.4249362051486969, -0.10701020807027817, -0.00783147104...
nulled. P.S.: Reading Grant Skinner [articles on memory](http://www.gskinner.com/blog/archives/2006/06/as3%5Fresource%5Fma.html) in flash player is actually a good idea.
[ -0.01393081247806549, 0.2891167998313904, -0.12629619240760803, 0.2897530496120453, 0.24734339118003845, -0.1769425868988037, 0.29444819688796997, -0.1512327343225479, -0.28555354475975037, -0.09228145331144333, -0.036531440913677216, 0.19307124614715576, -0.29688477516174316, -0.082074277...
Some of my colleagues are convinced that committing build artefacts to the subversion repository is a good idea. The argument is that this way, installation and update on the test machines is easy - just "svn up"! I'm sure there are weighty arguments against this bad practice, but all I can think of are lame ones like...
[ 0.8123496174812317, 0.3001308739185333, -0.4095880091190338, -0.020820530131459236, -0.15751847624778748, 0.06395086646080017, 0.28028303384780884, 0.00502813933417201, -0.010640810243785381, -0.5593427419662476, 0.024688005447387695, 0.5372603535652161, 0.02293745055794716, -0.16883073747...
add the build artifacts, I mean a commit would look like this: ``` "Added the new Whizbang feature" M src/foo/bar/Foo.java M bin/Foo.jar ``` Each code change has the corresponding generated jar file. In my opinion the code repository should only contain source code as well as third party libraries required to com...
[ 0.49047622084617615, 0.4938020408153534, 0.19284877181053162, -0.1935475617647171, -0.09006772190332413, -0.11769372224807739, 0.4526902735233307, -0.38917309045791626, -0.13339127600193024, -0.615086555480957, 0.08002784103155136, 0.7215190529823303, -0.26407530903816223, 0.02971856109797...
binary from the sources involves some work like starting up eclipse, importing the project, adjusting classpathes, etc... If there are build scripts in place, getting the binaries can be done with a command like: ``` svn update; ant dist ``` I think the most important reason not to checkin the binaries along with t...
[ 0.42966151237487793, 0.08259185403585434, -0.27612772583961487, 0.21244558691978455, -0.13418349623680115, -0.08916876465082169, 0.30521559715270996, -0.004840861540287733, -0.1192164272069931, -0.6389926671981812, -0.08125074207782745, 0.5401462912559509, -0.36843493580818176, 0.136940777...
comparable, so lots of the features of a versioning system do make sense. But you can't easily compare binaries... Also your approach as described above introduces a lot of overhead in my opinion. What if a developer forgets to update a corresponding jar file?
[ 0.42105165123939514, 0.32144349813461304, -0.13874220848083496, 0.27893057465553284, -0.25606411695480347, -0.38937872648239136, 0.4460504949092865, -0.09827687591314316, -0.11867766082286835, -0.7278932929039001, 0.3466782569885254, 0.5803423523902893, -0.16169172525405884, 0.427860617637...
I've just started learning Common Lisp--and rapidly falling in love with it--and I've just moved onto the type system. I seem to be developing a particular fondness for applicative programming. As I understand it, in CL strings and lists are both sequences, but there don't seem to be any standard functions for mapping...
[ 0.015860410407185555, 0.22199465334415436, 0.4280104339122772, 0.0670473501086235, -0.1923387199640274, -0.0600096732378006, -0.07206758856773376, 0.09542344510555267, -0.4447900354862213, -0.6003597974777222, 0.10370831191539764, 0.21712563931941986, -0.449779748916626, -0.098745822906494...
applicative functions at them rather than lists. Or am I completely misunderstandimatifying how it works? **Edit:** What I was feeling particularly confused about was the way that sequences -- the abstraction -- and lists -- an implementation -- seem to be muddled up in CL. The consensus seems to be that this is for ...
[ 0.006852602120488882, 0.08373881876468658, 0.12370814383029938, 0.060984231531620026, -0.05906188488006592, -0.278579980134964, -0.1700551062822342, 0.08568577468395233, -0.2908289134502411, -0.5228118896484375, 0.18892180919647217, 0.5161314010620117, -0.4034038782119751, -0.2174263447523...
that operate only on lists, and functions that do the same thing in a more general way on sequences. As someone who is just learning CL at the moment, I think it would be useful if authors introduced sequences first as the cleaner abstraction, and then bought in lists as the most fundamental implementation of that abst...
[ 0.6844589114189148, 0.1986960619688034, -0.1110440343618393, 0.3223031759262085, -0.10897381603717804, -0.20348197221755981, -0.18743401765823364, -0.060441602021455765, -0.3397277593612671, -0.4235629737377167, -0.08426745235919952, 0.5567377209663391, -0.3806922435760498, -0.326327353715...
Most functions do indeed focus on lists (`mapcar`, `find`, `count`, `remove`, `append` etc.) For a few of these there are equivalent functions for sequences (`concatenate`, `some` and `every` come to mind), and some, where the list-equivalent is outdated (eg. `nth` for lists only vs. `elt` for all sequences). Some func...
[ -0.1994013488292694, 0.0074136690236628056, 0.15198470652103424, 0.054989151656627655, -0.23682086169719696, -0.22181959450244904, 0.021348178386688232, 0.09132973104715347, -0.19211478531360626, -0.4665617048740387, -0.21163630485534668, 0.3989153206348419, -0.3039836883544922, -0.0290723...
functions be methods, that applied as intended on all sequences. CL was simply not built that way. If it were to be built again today, I'm sure this would be considered, and it would look *very* different. That said, you are not left completely in the cold. The `loop` macro works on sequences, as does `iterate` (a sep...
[ 0.12375947833061218, -0.18308335542678833, 0.015455293469130993, 0.11921517550945282, -0.06308382004499435, 0.02824961394071579, 0.22485671937465668, -0.011447933502495289, -0.3083673417568207, -0.39783838391304016, -0.13842444121837616, 0.37308889627456665, -0.5875423550605774, -0.0682414...
sequences in general), who's to stop you from writing it?
[ 0.21538817882537842, -0.08802931010723114, 0.2277332842350006, 0.07001124322414398, 0.34384432435035706, 0.41486865282058716, 0.19783879816532135, -0.06660439819097519, -0.38874250650405884, 0.06741902977228165, -0.27807679772377014, 0.3535946011543274, -0.2969404458999634, 0.2320154309272...
Does `WaitForSingleObject()` with timeout = 0 ms result in thread context switch immediately and the thread to loose its remaining timeslice? The documentation says otherwise. [MSDN: WatiForSingleObject](http://msdn.microsoft.com/en-us/library/ms687032.aspx "WaitForSingleObject"): > If dwMilliseconds is zero, the func...
[ -0.10614185780286789, -0.5365626215934753, 0.7346204519271851, -0.1677876114845276, 0.22310687601566315, -0.00738713750615716, 0.4079248309135437, 0.0010381032479926944, -0.4143262505531311, -0.25740090012550354, -0.3621700704097748, 0.3684766888618469, -0.36674368381500244, 0.443420588970...
We are using MediaWiki inhouse for our software and hardware documentation. It looks like granting / revoking "read access" to parts of the documentation for our external users - customers, project partners - is not easy to achieve. How could we control read access to some areas of the documentation based on user or ro...
[ 0.8533908128738403, 0.1983577013015747, 0.13396894931793213, 0.46780192852020264, 0.2524835169315338, -0.3513911962509155, 0.049520161002874374, -0.0664895549416542, -0.026375355198979378, -0.4066459834575653, -0.04899626597762108, 0.44802525639533997, -0.09589833766222, 0.3011790215969085...
limited access only to their product information, I am afraid that management will drop the whole MediaWiki solution and introduce something "new and better". (this could mean we have to transfer all content to a new system, formatting and hyperlinks would be lost etc. ...). --- Many thanks for the comments and answe...
[ 0.4699954390525818, -0.006313441786915064, 0.14565835893154144, 0.20176149904727936, -0.11818651854991913, -0.3617521822452545, 0.3645172417163849, 0.2726666033267975, -0.40830448269844055, -0.6050500869750977, 0.013264128006994724, 0.4787082374095917, -0.09720055013895035, 0.4154936671257...
page act normally for some users but be invisible to others, as is possible for instance in most forum software, is a very different matter. MediaWiki is designed for two basic access modes: * Everyone can view every single page on the wiki (with the possible exception of a few special pages). This is the mode used by...
[ 0.21523238718509674, -0.20483428239822388, 0.736201822757721, 0.3063414692878723, -0.3469640016555786, -0.4769767224788666, 0.6219324469566345, 0.26948481798171997, -0.40434807538986206, -0.6520424485206604, -0.4102514386177063, 0.33692654967308044, -0.3861351013183594, 0.078251414000988, ...
is why it exists. This is the mode of operation used by certain private wikis such as those used by various Wikimedia committees. My school uses wikis the way you want to. A friend of mine set them up. He had to hack the software extensively to get it to work. From my experience in digging around in MediaWiki, you're ...
[ 1.0347368717193604, -0.11666391044855118, -0.11697229743003845, 0.34897154569625854, 0.12285774201154709, -0.35982826352119446, 0.05535366013646126, 0.3841828405857086, -0.3759154975414276, -0.3969617784023285, -0.07609209418296814, 0.4728701114654541, -0.13696874678134918, 0.0527102574706...
private wiki as described above.
[ 0.5322096943855286, -0.350101500749588, -0.005545258987694979, 0.2669769525527954, -0.09301000088453293, -0.38865751028060913, 0.19279322028160095, 0.2565646469593048, -0.4488629698753357, -0.2814143896102905, -0.4941631555557251, 0.3846096992492676, -0.0497862808406353, 0.2957266569137573...
Is C# able to define macros as is done in the C programming language with pre-processor statements? I would like to simplify regular typing of certain repeating statements such as the following: ``` Console.WriteLine("foo"); ``` No, C# does not support preprocessor macros like C. Visual Studio on the other hand has ...
[ 0.33882850408554077, -0.2362108677625656, 0.3915101885795593, -0.015245581045746803, -0.12254932522773743, 0.11062946915626526, -0.2593413293361664, 0.2065003663301468, -0.3422684967517853, -0.4439131021499634, -0.20064793527126312, 0.5306100845336914, -0.4267352223396301, -0.2493789941072...
I have the following piece of code to write data to an XML file. ``` private void WriteResidentData() { int count = 1; status = "Writing XML files"; foreach (Site site in sites) { try { //Create the XML file
[ 0.39645305275917053, 0.2444467544555664, 0.4631013870239258, -0.2932770252227783, 0.2218535989522934, -0.1850125789642334, 0.30936548113822937, -0.3350076675415039, 0.22242450714111328, -0.7278732061386108, -0.0367896668612957, 0.33636710047721863, -0.2128410041332245, 0.2521187663078308, ...
StreamWriter writer = new StreamWriter(path + "\\sites\\" + site.title + ".xml"); writer.WriteLine("<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>"); writer.WriteLine("<customer_list>"); foreach (Resident res in site.GetCustomers()) {
[ -0.1105131283402443, -0.20787662267684937, 0.8936681151390076, -0.21504423022270203, 0.3065045475959778, 0.0412495881319046, 0.40105608105659485, -0.10186741501092911, 0.10984192788600922, -0.7939379215240479, -0.40726494789123535, 0.41625481843948364, -0.2927619516849518, 0.46854755282402...
bw.ReportProgress((count / customers) * 100); writer.WriteLine("\t<customer>"); writer.WriteLine("\t\t<customer_reference>" + res.reference + "</customer_reference>"); writer.WriteLine("\t\t<customer_name>" + res.name + "</customer_name>"); ...
[ 0.16627031564712524, 0.15444043278694153, 0.5589349865913391, -0.5755754113197327, -0.06457513570785522, 0.4003247022628784, 0.19990649819374084, -0.20503512024879456, 0.14082199335098267, -0.4600571095943451, -0.4496542811393738, 0.3949827253818512, -0.34541404247283936, 0.340842485427856...
writer.WriteLine("\t\t<payment_method>" + res.method + "</payment_method>"); writer.WriteLine("\t\t<payment_cycle>" + res.cycle + "</payment_cycle>"); writer.WriteLine("\t\t<registered>" + CheckWebStatus(res.reference) + "</registered>"); writer.WriteLine("\t<...
[ -0.19672918319702148, -0.14743740856647491, 0.6604353189468384, -0.248810812830925, 0.13822680711746216, 0.2544589340686798, 0.12021508067846298, -0.18823900818824768, -0.03794479742646217, -0.721850574016571, -0.22944210469722748, 0.3628963530063629, -0.36257877945899963, 0.36451184749603...
count++; } writer.WriteLine("</customer_list>"); writer.Close(); } catch (Exception ex) {
[ 0.023783670738339424, -0.22242023050785065, 0.5043348073959351, -0.5810027718544006, 0.15979135036468506, 0.00841329526156187, 0.3598625957965851, -0.3453025817871094, -0.04297482594847679, -0.10273955762386322, -0.3844097852706909, 0.43269339203834534, -0.5555948615074158, 0.1535451561212...
lastException = ex; } } } ``` It's using the same BackgroundWorker that gets the data from the database. My progress bar properly displays the progress whilst it is reading from the database. However, after zeroing the progress bar for the XML writing it simply sits at 0 even though the proces...
[ 0.3457963168621063, 0.20497943460941315, 0.6610724925994873, -0.2891857624053955, 0.16213800013065338, 0.06099145486950874, 0.1540180891752243, -0.08451677858829498, -0.1268986016511917, -0.6881840229034424, -0.10434755682945251, 0.6957956552505493, 0.15482601523399353, 0.07227563112974167...
I'm trying out pylint to check my source code for conventions. Somehow some variable names are matched with the regex for constants (`const-rgx`) instead of the variable name regex (`variable-rgx`). How to match the variable name with `variable-rgx`? Or should I extend `const-rgx` with my `variable-rgx` stuff? e.g. ...
[ 0.15934881567955017, 0.10593143850564957, 0.42036372423171997, 0.007825766690075397, 0.057742126286029816, -0.2537747621536255, 0.04261685907840729, -0.25702765583992004, -0.279092401266098, -0.41641563177108765, -0.15245991945266724, 0.9150809645652771, -0.35243725776672363, 0.00800052192...
Within a masterpage I have a standard DataGrid: ``` <asp:DataGrid ID="dgMyGrid" runat="server" AutoGenerateColumns="false"> <Columns> <asp:TemplateColumn> <HeaderTemplate> <asp:CheckBox CssClass="Checker" ID="cbSelectAll" runat="server" /> </HeaderTemplate>...
[ 0.1507171243429184, 0.18159258365631104, 0.6304006576538086, 0.009951533749699593, -0.15245763957500458, -0.07819802314043045, 0.10540178418159485, -0.31642839312553406, -0.026991283521056175, -0.8044273853302002, -0.18525761365890503, -0.08671616017818451, -0.1290653496980667, 0.246749505...
<asp:CheckBox ID="cbSelect" runat="server" /> </ItemTemplate> </asp:TemplateColumn> </Columns> </asp:DataGrid> ``` Have the following jQuery that makes the header checkbox select all: ``` $(document).ready(function() { $("#ctl00_ContentPlaceHolder1_dgMyGrid_ctl01_cbSelectAll").c...
[ 0.09201280027627945, -0.016195377334952354, 0.6892153024673462, -0.07720498740673065, 0.08420246839523315, -0.3217277526855469, 0.17364034056663513, -0.4217841625213623, 0.004939593840390444, -0.7568304538726807, -0.4164648652076721, 0.567379891872406, -0.27693742513656616, 0.0481008663773...
there a more elegant way for me to get the clientID of my checkbox out of the datagrid? I think it Would be better if I didnt hardcode the clientID like this. Apologies if the answer to this is obvious, it's my first day trying jQuery! :) > Somehow some variable names are matched with the regex for constants (const-rg...
[ -0.009990633465349674, 0.009567763656377792, 0.40171799063682556, 0.030903002247214317, -0.0956011712551117, -0.15541161596775055, 0.2815801203250885, 0.001346273347735405, -0.3045973479747772, -0.50141841173172, 0.1958819031715393, 0.7524288296699524, -0.18460306525230408, -0.095783323049...
I have two obects, A & B for this discussion. I can join these objects (tables) via a common relationship or foreign key. I am using linq to do this join and I only want to return ObjectA in my result set; however, I would like to update a property of ObejctA with data from ObjectB during the join so that the ObjectAs ...
[ 0.03627613186836243, 0.18097549676895142, 0.5396695733070374, -0.1305570751428604, -0.3227624297142029, 0.07116588205099106, 0.12281040847301483, -0.2626064717769623, -0.10005136579275131, -0.5624063014984131, 0.21714845299720764, -0.021692488342523575, -0.3781518340110779, 0.3144492208957...
like objectA.SomeProperty = objectB.AValueIWantBadly I know I could do a new in my select and spin up new OBjectAs, but I would like to avoid that if possible and simply update a field. ``` return from objectA in GetObjectAs() join objectB in GetObjectBs() on objectA.Id equals objectB.AId // ...
[ 0.05016539990901947, 0.12093182653188705, 0.4365089535713196, -0.26074540615081787, 0.14176760613918304, 0.05095665156841278, 0.3707381784915924, -0.24923621118068695, 0.07123466581106186, -0.7990851998329163, -0.10009775310754776, 0.7053958773612976, -0.4483039379119873, 0.161816954612731...
the update return this; } } ``` then use ``` return from objectA in GetObjectAs() join objectB in GetObjectBs() on objectA.Id equals objectB.AId // update object A with object B data before selecting it select objectA.UpdateWithB(objectB); ``` **EDIT**: Or use a local lambda func...
[ -0.4156395196914673, 0.00316445529460907, 0.8743244409561157, -0.3197726011276245, 0.045195065438747406, 0.23614148795604706, 0.2208220660686493, -0.6290472745895386, 0.22032231092453003, -0.7479339241981506, -0.4029150605201721, 0.923511266708374, -0.5019559860229492, -0.09237384796142578...
select f(objectA , objectA ); ```
[ -0.261799156665802, -0.09167572110891342, 0.05961385369300842, -0.237223818898201, 0.070834219455719, 0.1433907449245453, 0.021515659987926483, 0.019691800698637962, 0.2031351774930954, -0.5577004551887512, -0.5758945345878601, 0.6141908764839172, -0.5650569200515747, 0.014156296849250793,...
Every time I do anything, and my while(1) gets called in my main function, my file gets cleared. It's driving me crazy. I've tried EVERYTHING. I try to put my ofstream out("data.dat"); outside the while(1) statement so it isn't called everytime but then nothing is written to the file like the ofstream isn't even workin...
[ 0.45503756403923035, -0.05157360062003136, 0.3262477517127991, -0.11931344866752625, 0.054524555802345276, -0.38400739431381226, 0.4601045548915863, 0.17931076884269714, -0.14649821817874908, -0.24076196551322937, -0.048280019313097, 0.5194465517997742, -0.4768790006637573, 0.1184491738677...
{ string line = ""; cout << "There are currently " << structList.size() << " items in memory."; cout << endl << endl; cout << "Commands: " << endl; cout << "1: Add a new record " << endl; cout << "2: Display a record " << endl; cout
[ -0.1271754950284958, -0.29101383686065674, 0.31244808435440063, -0.22415003180503845, 0.31152206659317017, 0.15305927395820618, -0.039046503603458405, -0.06105993688106537, -0.313735693693161, -0.5712950825691223, -0.5252233147621155, 0.27847445011138916, -0.29690900444984436, 0.2043471336...
<< "3: Edit a current record " << endl; cout << "4: Delete a record " << endl; cout << "5: Save current information " << endl; cout << "6: Exit the program " << endl; cout << endl; cout << "Enter a command 1-6: "; getline(cin , line); int rValue
[ 0.09848365932703018, -0.2241348922252655, 0.7917808294296265, -0.1560768485069275, 0.3906378746032715, 0.04388371482491493, 0.16989192366600037, -0.3487611711025238, -0.03789302706718445, -0.28168556094169617, -0.5259479880332947, 0.6579803228378296, -0.21676360070705414, 0.377654880285263...
= atoi(line.c_str()); system("cls"); switch (rValue) { case 1: structList = addItem(structList); break; case 2:
[ 0.02111021801829338, -0.5493028163909912, 0.46401524543762207, -0.2360367327928543, 0.2622441053390503, 0.20859776437282562, 0.48131588101387024, -0.6348410844802856, -0.15389123558998108, -0.16719435155391693, -0.4277779459953308, 0.6579954028129578, -0.44214215874671936, 0.06348925083875...
displayRecord(structList); break; case 3: structList = editRecord(structList); break; case 4: deleteRecord(structList);
[ -0.5647559762001038, -0.16270692646503448, 0.3679138422012329, -0.14650210738182068, -0.1147649958729744, 0.26420673727989197, 0.2971881926059723, -0.20540477335453033, -0.23673608899116516, -0.37878885865211487, -0.7694802284240723, 0.4409157633781433, -0.1993141621351242, 0.1777413487434...
break; case 5: if (!structList.size()) { cout << "There are no items to save! Enter one first!" << endl << endl; system("pause"); system("cls"); break; } writeVector(out , structList); break;
[ -0.3570418953895569, -0.27931153774261475, 0.3197649121284485, -0.40425610542297363, 0.41302523016929626, 0.10906428098678589, 0.22201590240001678, -0.2009502351284027, -0.1798497587442398, -0.35801419615745544, -0.7228955030441284, 0.38787660002708435, -0.2549106776714325, 0.2089162766933...
case 6: return 0; default: cout << "Command invalid. You can only enter a command number 1 - 6. Try again. " << endl; } out.close(); } ``` And can someone tell me why my check to prevent
[ 0.08951228857040405, 0.2246837168931961, 0.3712402880191803, -0.29487183690071106, 0.3585430681705475, 0.06327802687883377, 0.4190421402454376, -0.264394611120224, -0.02363112010061741, -0.48087406158447266, -0.4418628215789795, 0.6270214319229126, -0.27645355463027954, 0.27016207575798035...
reading of a empty file won't work? **My Check:** ``` bool checkFileEmpty() { ifstream in("data.dat"); if (in.peek() == in.eofbit) { return true; } return false; } ``` I am so sick and tired of my program crashing on startup over and over again because my vector is getting set to a siz...
[ 0.3611324429512024, 0.11187006533145905, 0.4604358971118927, -0.09551238268613815, 0.27002304792404175, 0.15934854745864868, 0.779581606388092, 0.10746484994888306, -0.3426986038684845, -0.6836639046669006, 0.24278239905834198, 0.6697902679443359, -0.48063668608665466, 0.15091419219970703,...
( all night yes ) and i'm ALMOST done. I'm begging you.... **My Code:** ``` #include "stdafx.h" #include <iostream> #include <fstream> #include <string> #include <vector> using namespace System; using namespace std; #pragma hdrstop bool isValidChoice(int size, int choice); bool checkFileEmpty(); template<typename...
[ 0.02700747549533844, -0.3231721818447113, 0.9575254917144775, -0.10993175953626633, 0.24714013934135437, 0.17132309079170227, 0.3972955048084259, -0.33816325664520264, 0.06443918496370316, -0.7870480418205261, -0.35077187418937683, 0.7358377575874329, -0.2757464647293091, 0.107500940561294...
in("data.dat"); if (in.is_open()) { cout << "File \'data.dat\' has been opened successfully." << endl; } else { cout << "Error opening data.dat" << endl;} cout << "Loading data..." << endl; vector<InventoryItem> structList = readVector<InventoryItem>( in ); cout <<"Load complete." << endl << endl; i...
[ -0.3204716742038727, -0.41538888216018677, 0.587430477142334, -0.21887515485286713, 0.24443364143371582, 0.17147605121135712, 0.08445020020008087, -0.39446350932121277, -0.20661407709121704, -0.6736582517623901, -0.7948405146598816, 0.4043378233909607, -0.22300691902637482, -0.034802801907...
cout << endl << endl; cout << "Commands: " << endl; cout << "1: Add a new record " << endl; cout << "2: Display a record " << endl; cout << "3: Edit a current record " << endl; cout << "4: Delete a record " << endl; cout << "5:
[ -0.14671918749809265, 0.1292082518339157, 0.34869202971458435, -0.14352993667125702, 0.3384576737880707, 0.13417299091815948, -0.020990438759326935, -0.13148482143878937, -0.27564290165901184, -0.40494775772094727, -0.48590555787086487, 0.2993941009044647, -0.2862100601196289, 0.2477664053...
Save current information " << endl; cout << "6: Exit the program " << endl; cout << endl; cout << "Enter a command 1-6: "; getline(cin , line); int rValue = atoi(line.c_str()); system("cls"); ofstream out("data.dat"); switch (rValue)
[ 0.026653192937374115, -0.3496982455253601, 0.758335530757904, -0.11171109229326248, 0.5353035926818848, 0.12073119729757309, 0.1401737481355667, -0.14980456233024597, 0.1073489561676979, -0.5513473749160767, -0.4278445243835449, 0.6999518275260925, -0.30828678607940674, 0.2327943742275238,...
{ case 1: structList = addItem(structList); break; case 2: displayRecord(structList); break;
[ -0.41123825311660767, -0.16234922409057617, 0.02976006083190441, -0.4057059586048126, 0.18288274109363556, 0.12629736959934235, 0.4231736958026886, -0.32481250166893005, -0.05256849527359009, -0.37094104290008545, -0.6606658697128296, 0.4283558130264282, -0.4831292927265167, -0.06071348488...
case 3: structList = editRecord(structList); break; case 4: deleteRecord(structList); break; case 5:
[ -0.4357527494430542, -0.27078402042388916, 0.37983477115631104, -0.04210085794329643, 0.16502365469932556, 0.18032430112361908, 0.1976638287305832, -0.2551358938217163, -0.2222941368818283, -0.2685079872608185, -0.7339256405830383, 0.5080986022949219, -0.20799514651298523, 0.03020686842501...
if (!structList.size()) { cout << "There are no items to save! Enter one first!" << endl << endl; system("pause"); system("cls"); break; } writeVector(out , structList); break; case 6: return 0;
[ -0.2398042231798172, -0.22973942756652832, 0.40731170773506165, -0.37287333607673645, 0.3406204879283905, 0.15258760750293732, 0.22728107869625092, -0.25228193402290344, -0.00011528662435011938, -0.3899303376674652, -0.656410276889801, 0.4828982949256897, -0.2960354685783386, 0.19232453405...
default: cout << "Command invalid. You can only enter a command number 1 - 6. Try again. " << endl; } out.close(); } system("pause"); return 0; } template<typename T> void writeVector(ofstream &out, const vector<T> &vec) { out << vec.size(); for(vector<T>::const_...
[ -0.15141735970973969, -0.3782765567302704, 0.71795254945755, -0.3954112231731415, 0.3151099979877472, 0.33065998554229736, 0.2393888682126999, -0.41198763251304626, -0.08662097156047821, -0.5789932608604431, -0.3271339535713196, 0.7053815126419067, -0.435249924659729, 0.05491438880562782, ...
{ out << *i; } cout << "Save completed!" << endl << endl; } ostream &operator<<(ostream &out, const InventoryItem &i) { out << i.Description << ' '; out << i.Quantity << ' '; out << i.wholesaleCost << ' ' << i.retailCost << ' '; out << i.dateAdded << ' '; return out; } istream &...
[ -0.13721522688865662, -0.09416752308607101, 0.7661317586898804, -0.26310646533966064, 0.6334048509597778, 0.5024105906486511, -0.050496552139520645, -0.11749409139156342, -0.02043718844652176, -0.9045425057411194, -0.42019906640052795, 0.38342639803886414, -0.09533267468214035, 0.193632930...
>> i.wholesaleCost >> i.retailCost; in >> i.dateAdded; return in; } template<typename T> vector<T> readVector(ifstream &in) { size_t size; if (checkFileEmpty()) { size = 0; } else { in >> size; } vector<T> vec; vec.reserve(size); for(unsigned int i = 0; i < si...
[ 0.5466926693916321, -0.7147810459136963, 0.6317941546440125, -0.29924485087394714, 0.3429972231388092, 0.3517349064350128, 0.08695236593484879, -0.35870951414108276, -0.0726703479886055, -0.7950223088264465, -0.30531057715415955, 0.581436812877655, -0.4257600009441376, 0.12645021080970764,...
in >> tmp; vec.push_back(tmp); } return vec; } template<typename T> vector<T> addItem(vector<T> &vec) { system("cls"); string word; unsigned int number; InventoryItem newItem; cout << "-Add a new item-" << endl << endl; cout << "Enter the description for the item: "; get...
[ -0.10813590884208679, -0.33622825145721436, 0.7310203313827515, -0.21422523260116577, 0.26062485575675964, 0.5226230025291443, 0.02871481329202652, -0.42605164647102356, -0.23993375897407532, -0.7317388653755188, -0.5139937996864319, 0.4190725088119507, -0.3989456593990326, 0.2659364044666...
for the item: "; getline (cin , word); number = atoi(word.c_str()); newItem.Quantity = number; cout << endl; cout << "Enter the Retail Cost for the item: "; getline (cin , word); number = atoi(word.c_str()); newItem.retailCost = number; cout << endl; cout << "Enter the Wholesal...
[ 0.37612196803092957, -0.2807316780090332, 0.7967526912689209, -0.22909390926361084, 0.18667729198932648, 0.8400354981422424, -0.17474639415740967, -0.2329840213060379, -0.17335960268974304, -0.4877352714538574, -0.4783632457256317, 0.6764277815818787, -0.06967969238758087, 0.47959545254707...
cout << endl; cout << "Enter current date: "; getline (cin , word); newItem.dateAdded = word; vec.push_back(newItem); return vec; } template<typename T> void printItemDescriptions(vector<T> &vec) { int size = vec.size(); if (size) { cout << "---------------------------------"...
[ -0.17351099848747253, -0.30427423119544983, 0.821110725402832, -0.389106422662735, 0.18072429299354553, 0.5015214681625366, -0.043213412165641785, -0.17147602140903473, -0.09611773490905762, -0.7855357527732849, -0.5188963413238525, 0.28428730368614197, -0.17867782711982727, 0.359888911247...
<< "---------------------------------" << endl; cout << "*********************************" << endl; for (int i = 0 ; i < size ; i++) { cout << "(" << i+1 << ")" << ": " << vec[i].Description << endl; } cout << "*********************************" << endl << endl; ...
[ -0.3749293386936188, -0.20247922837734222, 0.7715207934379578, -0.22043156623840332, -0.10965938121080399, 0.30281496047973633, -0.0604187436401844, -0.43468788266181946, -0.0013530930737033486, -0.8518052101135254, -0.4237862229347229, 0.5588152408599854, -0.3554152846336365, -0.154980599...
word = ""; string quit = "quit"; int choice = 1; int size = vec.size(); if (size) { printItemDescriptions(vec); cout << endl; while (1) { cout << "Type \"exit\" to return to the Main Menu." << endl << endl;
[ -0.08824802935123444, -0.3362787663936615, 0.6332998275756836, -0.5902654528617859, 0.2968364357948303, 0.3243997097015381, 0.38719844818115234, -0.09186983108520508, 0.00401989184319973, -0.6677377223968506, -0.6001940369606018, 0.6183116436004639, -0.35559797286987305, 0.3508800268173218...
cout << "Enter \"list\" to re-display the items." << endl << endl; cout << endl; cout << "Pick the number of the item you would like to display: "; getline (cin , word); if (convertToLower(word) == "exit") { system("cls"); return 0; }
[ -0.281467467546463, -0.38199591636657715, 0.8087798953056335, -0.21098828315734863, 0.3052772879600525, 0.3290145993232727, -0.06906450539827347, -0.15683865547180176, -0.19691652059555054, -0.6518429517745972, -0.6106610894203186, 0.24730879068374634, -0.35673561692237854, 0.2626694440841...
if (convertToLower(word) == "list") { system("cls"); displayRecord(vec); } choice = atoi(word.c_str()); choice -= 1; if (isValidChoice(size, choice)) { system("cls"); cout << endl << "[Item ("
[ -0.3382042348384857, -0.35352247953414917, 0.6141480207443237, -0.3692317306995392, 0.19377191364765167, 0.5054795145988464, 0.055791210383176804, -0.555230438709259, -0.2149326205253601, -0.6686527729034424, -0.5617062449455261, 0.573388934135437, -0.2265111804008484, 0.2573283612728119, ...
<< choice << ") details] " << endl << endl; cout << "******************" << endl; cout << "* Description * " << vec[choice].Description << endl; cout << "******************" << endl << endl; cout << "******************" << endl;
[ -0.169990673661232, -0.08769434690475464, 0.3709973394870758, -0.024061094969511032, 0.09555699676275253, 0.3103055953979492, -0.16984234750270844, -0.3316236734390259, 0.028952179476618767, -1.0208542346954346, -0.6485875248908997, 0.6684550642967224, -0.1398289054632187, -0.2728354334831...
cout << "*Quantity On Hand* " << vec[choice].Quantity << endl; cout << "******************" << endl << endl; cout << "******************" << endl; cout << "* Wholesale Cost * " << vec[choice].wholesaleCost << endl;
[ -0.06938978284597397, -0.3975030779838562, 0.24730128049850464, -0.21592901647090912, 0.07264967262744904, 0.7356641292572021, -0.6770085096359253, -0.07662054896354675, 0.05628078803420067, -1.1720447540283203, -0.25505563616752625, 0.7187107801437378, 0.026699265465140343, -0.03466290608...
cout << "****************** " << endl << endl; cout << "******************" << endl; cout << "* Retail Cost * " << vec[choice].retailCost << endl; cout << "****************** " << endl << endl;
[ 0.44883057475090027, 0.1737627387046814, 0.659294068813324, -0.1660560965538025, 0.2225426286458969, 0.48998358845710754, -0.7448418736457825, 0.5324835181236267, -0.02975720353424549, -0.6627527475357056, -0.5145490765571594, 1.1496219635009766, 0.11949686706066132, 0.029538976028561592, ...
cout << "******************" << endl; cout << "* Data Added * " << vec[choice].dateAdded << endl; cout << "****************** " << endl << endl; } else { system("cls"); cout << "That item doesn't exist!" << endl; cout << "Pick another item or enter \"list\" to see availab...
[ -0.2793091833591461, -0.12849538028240204, 0.6907193660736084, 0.0660654753446579, 0.4942988157272339, 0.24931058287620544, -0.1484985053539276, 0.06139283999800682, -0.29788509011268616, -0.6788197755813599, -0.4364268481731415, -0.017250416800379753, -0.3785013258457184, 0.26187694072723...
} } } else { cout << "There are currently no items to display." << endl << endl; system("pause"); system("cls"); return 0; } return 1; } bool isValidChoice(int size, int choice) { for (int i = 0 ; i <= size ; i++) { if (choice == i) { return true; } } return false; } string co...
[ -0.1665685772895813, -0.3472125232219696, 0.7007840275764465, -0.5373785495758057, 0.19408878684043884, 0.34087496995925903, 0.2899022698402405, -0.44775551557540894, -0.1162065789103508, -0.7987035512924194, -0.4960883855819702, 0.46112218499183655, -0.2015015184879303, 0.3762064874172210...
i++) { word[i] = tolower(word[i]); } return word; } bool checkFileEmpty() { ifstream in("data.dat"); if (in.peek() == in.eofbit) { return true; } return false; } template<typename T> vector<T> editRecord(vector<T> &vec) { string word; int choice; printIte...
[ 0.07529641687870026, -0.5068475008010864, 0.6682583093643188, -0.35256630182266235, -0.01772976852953434, 0.3979209363460541, 0.328463613986969, -0.6317136287689209, 0.11893026530742645, -0.7229316830635071, -0.4875522553920746, 0.5927203893661499, -0.5334606766700745, 0.1952219307422638, ...
system("cls"); unsigned int number; InventoryItem newItem; cout << "-Edit an item-" << endl << endl; cout << "Enter the description for the item: "; getline (cin , word); vec[choice-1].Description = word; cout << endl; cout << "Enter the quantity on hand for the item: "; getline ...
[ -0.15516820549964905, -0.19271764159202576, 0.7400158643722534, 0.020078979432582855, 0.31288760900497437, 0.6865463852882385, 0.029352018609642982, -0.22991520166397095, -0.3113953471183777, -0.6311770677566528, -0.47635677456855774, 0.2903209626674652, -0.29305499792099, 0.28887572884559...
cout << "Enter the Retail Cost for the item: "; getline (cin , word); number = atoi(word.c_str()); vec[choice-1].retailCost = number; cout << endl; cout << "Enter the Wholesale Cost for the item: "; getline (cin , word); number = atoi(word.c_str()); vec[choice-1].wholesaleCost = number;...
[ 0.2169932872056961, -0.3578835725784302, 0.7628956437110901, -0.24284863471984863, 0.3989872336387634, 0.6904952526092529, -0.37569141387939453, -0.02965659461915493, -0.02491050772368908, -0.5386769771575928, -0.41702941060066223, 0.390562504529953, 0.01877962052822113, 0.4649214446544647...
cout << "Item edited successfully! " << endl; return vec; } template<typename T> vector<T> deleteRecord(vector<T> &vec) { if (!vec.size()) { cout << "There are no items to delete!" << endl << endl; return vec; } printItemDescriptions(vec); string word; int choice; cout << "Choose item to del...
[ -0.11133165657520294, -0.2727046310901642, 0.7115164399147034, -0.34268516302108765, 0.14098165929317474, 0.4409095048904419, 0.2449652999639511, -0.4768730700016022, -0.08608346432447433, -0.7623992562294006, -0.43425819277763367, 0.6360527873039246, -0.49303537607192993, 0.14175182580947...
at each while iteration. ``` case 5: { ofstream out("data.dat"); writeVector(out , structList); out.close(); } break; ```
[ -0.2606731355190277, -0.24027235805988312, 0.3737344443798065, -0.29828599095344543, 0.33225181698799133, 0.08930958807468414, 0.4277809262275696, -0.23875461518764496, 0.11224910616874695, -0.30075255036354065, -0.09479454904794693, 0.5747712254524231, -0.34646114706993103, -0.10414250940...
***Creating a call stack diagram*** We have just recently been thrown into a big project that requires us to get into the code (duh). We are using different methods to get acquainted with it, breakpoints etc. However we found that one method is to make a **call tree** of the application, what is the easiest /fastest ...
[ 0.3027321696281433, 0.08943364024162292, 0.2633756399154663, 0.15007373690605164, 0.04825838282704353, -0.2990650534629822, 0.2509661316871643, 0.08198105543851852, -0.42460235953330994, -0.5721698999404907, -0.09627794474363327, 0.17066256701946259, -0.19332997500896454, 0.207283213734626...