text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
I am creating a custom WPF control that let's say for simplicity sake has a vertical stack panel with a "title" TextBlock, followed by a ContentPresenter. I want the font size for the "title" to be 5 Points LARGER than the size used in the content, which is inherited by whatever container the user places this control i...
[ 0.3889019787311554, -0.06288259476423264, 0.6612630486488342, 0.16457252204418182, -0.02213200181722641, -0.10665939748287201, 0.05149463191628456, -0.4125847816467285, -0.02073764055967331, -0.5737093687057495, 0.09364350140094757, 0.5408250093460083, -0.03508074954152107, 0.2163308709859...
mixed results (the text block scaled fine but the orientation was modified - I had the text right-justified and it moved "off the control" area when scaled). Also, I am not sure if scale transform would be approprite here. I did it with an IValueConverter as follows: Created a class FontSizeConverter that derives from...
[ -0.2703826427459717, -0.1371900737285614, 0.6097557544708252, -0.23054362833499908, -0.2558489143848419, 0.3469191789627075, 0.18812964856624603, -0.3852044343948364, 0.04070792719721794, -0.668691098690033, -0.1239929273724556, 0.5461021065711975, -0.18800456821918488, 0.20322643220424652...
return (double)value + 12.0; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { return (double)value - 12.0; } #endregion } ``` Next, I declaried an instance of this class in the XAML template for the control: ``` <St...
[ -0.0374404601752758, -0.14980904757976532, 0.5586397647857666, -0.23462873697280884, -0.12405811250209808, 0.1873188316822052, 0.02056177146732807, -0.13623298704624176, -0.03343024477362633, -0.6583976149559021, -0.1479724645614624, 0.34389781951904297, -0.4450043737888336, 0.210239425301...
Grid.Row="0" Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Date.Day}" HorizontalAlignment="Right" VerticalAlignment="Top" Padding="2" Margin="2" > </TextBlock> ``` This works. But I still do not know if this is the correct answer. Let me know if there is a b...
[ -0.05909527465701103, -0.27848976850509644, 0.8606095910072327, 0.06582581996917725, 0.25814089179039, 0.10327929258346558, -0.009244498796761036, -0.38723185658454895, 0.024182019755244255, -1.000327706336975, 0.1651238352060318, 0.27691543102264404, -0.017068753018975258, 0.0836551263928...
It seems to me that the key USP of Flash/Silverlight is the ability to provide access (albeit indirectly) to the graphics subsystem of the client, enabling video, smooth transitions and "fancy" visual effects. This sounds like a good idea, and a natural evolution/extension of HTML. But surely it would be better if som...
[ 0.3270869553089142, 0.14526431262493134, 0.37526461482048035, 0.20069682598114014, -0.20311826467514038, -0.3334336578845978, -0.19157950580120087, 0.20222902297973633, -0.5070673227310181, -0.5028306245803833, -0.3231419324874878, 0.46250611543655396, -0.03621014952659607, 0.0270297415554...
(or creating another technology) in the Flash/Silverlight "direction" when it seems obvious (to Adobe & MS at least), and an open standard platform would be preferable. The W3C has no real authority to "take a role" in the development of a proprietary technology. They can only be **given** such a role if the company th...
[ 0.6440333127975464, 0.1866036355495453, 0.23087157309055328, 0.21738071739673615, 0.07056544721126556, -0.37311503291130066, -0.2515771985054016, 0.1944943219423294, -0.14316688477993011, 0.17050614953041077, -0.5658281445503235, 0.39238443970680237, 0.13508202135562897, 0.0813211053609848...
I don't think that this is specific to a language or framework, but I am using xUnit.net and C#. I have a function that returns a random date in a certain range. I pass in a date, and the returning date is always in range of 1 to 40 years before the given date. Now I just wonder if there is a good way to unit test th...
[ 0.5416674613952637, 0.1951843649148941, 0.29285895824432373, 0.05179602652788162, 0.0754968449473381, 0.06130499020218849, 0.13634508848190308, 0.12238841503858566, -0.01933295466005802, -0.34237730503082275, 0.23459796607494354, -0.0964796170592308, 0.13318951427936554, 0.4357118308544159...
current approach. I also realize that unless I am able to control my Random generator, there will not be a perfect solution (after all, the result IS random), but I wonder what approaches you take when you have to test functionality that returns a random result in a certain range? In addition to testing that the funct...
[ -0.046439576894044876, -0.18254968523979187, 0.2292787730693817, 0.15642616152763367, 0.1577916294336319, -0.05902109295129776, 0.13012941181659698, -0.3010912537574768, -0.1656145304441452, -0.5778959393501282, 0.08895544707775116, 0.5720369815826416, -0.10936401784420013, 0.3362740278244...
stays in the desired range, I would also try to assess the distribution, perhaps by putting the results in buckets and checking that the buckets have roughly equal numbers of results after you are done. You may need more than 100 calls to get stable results, but this doesn't sound like an expensive (run-time wise) func...
[ 0.34881913661956787, -0.3395891785621643, 0.4719202220439911, 0.1922345608472824, 0.03285479173064232, -0.07590051740407944, 0.3831408619880676, -0.11988935619592667, -0.19319824874401093, -0.44142642617225647, 0.4441542327404022, 0.7251121401786804, -0.037269286811351776, 0.13208711147308...
I am looking for a tool like [ltrace](http://linux.die.net/man/1/ltrace) or [strace](http://linux.die.net/man/1/strace) that can trace locally defined functions in an executable. ltrace only traces dynamic library calls and strace only traces system calls. For example, given the following C program: ``` #include <stdi...
[ 0.3568085730075836, -0.050740502774715424, 0.2619982957839966, -0.2971746027469635, 0.10092687606811523, -0.04806618019938469, 0.24266012012958527, -0.3799150288105011, 0.11488036811351776, -0.613726019859314, 0.030024167150259018, 0.485521525144577, -0.3968558609485626, 0.0750810727477073...
printf, and the shutdown code, but I want something that will show me that the function `triple` was called. Assuming that the local functions have not been inlined by an optimizing compiler and that the binary has not been stripped (symbols removed), is there a tool that can do this? **Edit** A couple of clarificati...
[ 0.6891031265258789, 0.035902295261621475, -0.0651482492685318, 0.20479333400726318, 0.004834162071347237, -0.2562527060508728, 0.3399171829223633, -0.05951545760035515, -0.18919630348682404, -0.44564515352249146, 0.13169850409030914, 0.796002209186554, -0.33907249569892883, -0.186546474695...
to attach to existing processes like I can with ltrace/strace. Assuming you only want to be notified for specific functions, you can do it like this: compile with debug informations (as you already have symbol informations, you probably also have enough debugs in) given ``` #include <iostream> int fac(int n) { ...
[ -0.10092726349830627, 0.02338889241218567, 0.5858757495880127, -0.28051331639289856, 0.380790114402771, -0.07525937259197235, 0.22149743139743805, -0.4877386689186096, -0.2739211618900299, -0.44231054186820984, -0.20067709684371948, 0.1797974556684494, -0.6622911691665649, 0.11724196374416...
file test.cpp, line 4. (gdb) commands 1 Type commands for when breakpoint 1 is hit, one per line. End with a line saying just "end". >silent >bt 1 >c >end (gdb) run Starting program: /home/js/cpp/a.out #0 fac (n=0) at test.cpp:4 1 #0 fac (n=1) at test.cpp:4 #0 fac (n=0) at test.cpp:4 1 #0 fac (n=2) at test.cpp:4 #0...
[ -0.03956276550889015, 0.23268912732601166, 0.5079995393753052, -0.13282518088817596, 0.059444740414619446, 0.27501994371414185, 0.3901965320110321, -0.43111130595207214, -0.2623871862888336, -0.19288262724876404, -0.3248486816883087, 0.18669316172599792, -0.34581640362739563, 0.04492304474...
0) { print "# code for " $NF; print "b *0x" $2; print "commands"; print "silent"; print "bt 1"; print "c"; print "end"; print ""; } }' > $tmp; gdb --command=$tmp ./a.out; rm -f $tmp ``` Note that instead of just printing the current frame(`bt 1`), you can do anything you ...
[ 0.5103007555007935, -0.06366731971502304, 0.44555985927581787, -0.5345589518547058, 0.037475768476724625, 0.08614539355039597, 0.3116975724697113, -0.4297070801258087, -0.2905949056148529, -0.41178980469703674, -0.39764025807380676, 0.5041120052337646, -0.678134024143219, 0.019093807786703...
the `fatal_bomb_exploded` function :) Sadly, gcc outputs some "Current Language changed" messages in between. But that's easily grepped out. No big deal.
[ 0.027505580335855484, 0.24750718474388123, 0.4295618534088135, 0.2036810964345932, -0.13547345995903015, -0.3065683841705322, 0.5395609736442566, 0.719906210899353, -0.15099617838859558, -0.09783133864402771, -0.25672534108161926, 0.41523027420043945, -0.446249395608902, 0.1265503764152526...
I often hear the terms 'statically linked' and 'dynamically linked', often in reference to code written in [C](http://en.wikipedia.org/wiki/C_%28programming_language%29), [C++](https://en.wikipedia.org/wiki/C++) or [C#](http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29). What are they, what exactly are th...
[ 0.562774121761322, 0.02076880633831024, 0.0199262835085392, 0.2425747960805893, 0.01460892241448164, -0.25215014815330505, -0.025815658271312714, 0.12014532834291458, -0.3977945148944855, -0.36485087871551514, -0.3441011309623718, 0.33888718485832214, -0.34133750200271606, 0.17217998206615...
their source code (such as libraries for database access, network communications and graphical user interfaces), or for compiling code in different languages (C and assembly code for example) and then linking them all together. When you *statically* link a file into an executable, the contents of that file are include...
[ 0.4332275986671448, 0.1824209988117218, 0.03003590740263462, 0.29978254437446594, 0.2839360535144806, -0.20695200562477112, 0.026151344180107117, 0.24833664298057556, -0.1010030135512352, -0.8808268308639526, -0.5559834241867065, 0.29535147547721863, -0.3115484118461609, 0.3853577375411987...
are not included at link time. It's only when you later *run* the executable that these dynamically linked files are brought in and they're only brought into the in-memory copy of the executable, not the one on disk. It's basically a method of deferred linking. There's an even *more* deferred method (called late bindi...
[ -0.00345172849483788, -0.11340176314115524, 0.48238053917884827, 0.2984917461872101, 0.3486184775829315, -0.26469752192497253, 0.028554152697324753, 0.3498743772506714, -0.5114783644676208, -0.6877917647361755, -0.5580541491508484, 0.39291009306907654, -0.49729278683662415, 0.5505576729774...
the file on the disk. This allows updates to functionality without having to re-link the code; the loader re-links every time you run it. This is both good and bad - on one hand, it allows easier updates and bug fixes, on the other it can lead to programs ceasing to work if the updates are incompatible - this is some...
[ 0.24529464542865753, -0.030691303312778473, 0.28613224625587463, 0.5160618424415588, 0.05408019199967384, -0.5026525855064392, 0.43349334597587585, 0.1099839136004448, -0.5890159010887146, -0.42141905426979065, -0.3849656879901886, 0.7165182828903198, -0.419910728931427, 0.3586393594741821...
by the way). --- As an *example*, let's look at the case of a user compiling their `main.c` file for static and dynamic linking. ``` Phase Static Dynamic -------- ---------------------- ------------------------ +---------+ +---------+ | main.c |
[ -0.2814171016216278, -0.14987072348594666, 0.48460426926612854, 0.009288417175412178, 0.09254228323698044, -0.30002570152282715, 0.008696021512150764, 0.36943337321281433, -0.36725547909736633, -0.1520584672689438, -0.2712109684944153, 0.38941705226898193, -0.6445350050926208, 0.3452233672...
| main.c | +---------+ +---------+ Compile........|.........................|................... +---------+ +---------+ +---------+ +--------+ | main.o | | crtlib | | main.o | | crtimp | +---------+ +---------+ +---------+ +--------+ Link...........|........
[ -0.8122406005859375, 0.564484715461731, 0.8571562170982361, 0.06334391981363297, -0.10678748786449432, 0.020386986434459686, 0.0779464915394783, 0.3220912218093872, -0.46193933486938477, -0.4510432481765747, -0.4086640775203705, 0.595743715763092, -0.4701313376426697, 0.4373391270637512, ...
| | +-----------+ | | | +---------+ | +---------+ +--------+
[ -0.5053937435150146, 0.23104509711265564, 0.43481969833374023, 0.1038939580321312, -0.21192137897014618, 0.37072232365608215, 0.2884387969970703, -0.4482061564922333, 0.3699410557746887, -0.2279442697763443, -0.3249008059501648, 0.30343347787857056, -0.17961587011814117, 0.2895750403404236...
| main |-----+ | main | | crtdll | +---------+ +---------+ +--------+ Load/Run.......|.........................|..........|........ +---------+ +---------+ | | main in |
[ -0.9334412813186646, 0.20028163492679596, 0.7807583808898926, -0.017234468832612038, 0.046204134821891785, 0.03423357754945755, 0.1511276513338089, 0.16895319521427155, -0.4175243675708771, -0.39891648292541504, -0.3871188461780548, 0.35257488489151, -0.436491459608078, 0.38018062710762024...
| main in |-----+ | memory | | memory | +---------+ +---------+ ``` You can see in the static case that the main program and C runtime library are linked together at link time (by the developers). Since the user typically cannot re-link the executable, they're
[ 0.05385768041014671, 0.23547206819057465, 0.193414106965065, 0.050512515008449554, 0.23321060836315155, -0.24888218939304352, 0.17424078285694122, 0.11119973659515381, -0.15433257818222046, -0.305355429649353, -0.4875797927379608, 0.594099223613739, -0.5216928720474243, 0.23312318325042725...
stuck with the behaviour of the library. In the dynamic case, the main program is linked with the C runtime import library (something which declares what's in the dynamic library but doesn't actually *define* it). This allows the linker to link even though the actual code is missing. Then, at runtime, the operating s...
[ 0.2289796620607376, -0.2272205948829651, 0.3394521474838257, 0.0590924397110939, -0.06920263171195984, -0.2540779709815979, 0.11580415070056915, 0.15682990849018097, -0.47356390953063965, -0.3028457760810852, -0.5114522576332092, 0.4077531695365906, -0.6929131150245667, 0.47307974100112915...
both advantages and disadvantages.
[ -0.3114592432975769, 0.21594807505607605, -0.25924018025398254, 0.29357582330703735, -0.08616707473993301, 0.3481428325176239, -0.23936694860458374, -0.22311988472938538, 0.12984611093997955, -0.7341372966766357, 0.023472683504223824, 0.5369338393211365, 0.3743373155593872, 0.1869511753320...
I have a syntax highlighting function in vb.net. I use regular expressions to match "!IF" for instance and then color it blue. This works perfect until I tried to figure out how to do comments. The language I'm writing this for a comment can either be if the line starts with a single quote ' OR if anywhere in the lin...
[ 0.39544352889060974, 0.276192307472229, 0.12593786418437958, -0.1315387487411499, -0.2742075026035309, -0.081828773021698, 0.31809744238853455, 0.2890283465385437, -0.10294823348522186, -0.7074699401855469, -0.051499202847480774, 0.42099204659461975, -0.39912474155426025, 0.001731944503262...
the way to the end of the line so i can color the entire comment green and not just the single quotes. You shouldn't need the code but here is a snippet just in case it helps. ``` For Each pass In frmColors.lbRegExps.Items RegExp = System.Text.RegularExpressions.Regex.Matches(LCase(rtbMain.Text), LCase(p...
[ 0.03408217430114746, -0.20256401598453522, 0.8052170276641846, 0.11608624458312988, 0.0863795056939125, 0.2112577259540558, 0.05113707482814789, -0.4938194155693054, -0.2764643430709839, -0.6823956966400146, -0.359639048576355, 0.29794034361839294, -0.3142392337322235, -0.11658316850662231...
Next PassNumber += 1 Next ``` Something along the lines of: ``` ^(\'[^\r\n]+)$|(''[^\r\n]+)$ ``` should give you the commented line (of part of the line) in group n° 1 Actually, you do not even need group ``` ^\'[^\r\n]+$|''[^\r\n]+$ ``` If it finds something, it is a comment. ``` "(^'|'').*$" ```...
[ -0.4213971197605133, -0.3283490538597107, 0.6098814010620117, -0.07270076870918274, -0.3412055969238281, -0.046394217759370804, 0.22385750710964203, -0.39831480383872986, 0.0568184033036232, -0.8471958637237549, -0.42913204431533813, 0.35561200976371765, -0.4963638186454773, -0.18242001533...
to '.': it avoids any dependency to the mode of the pattern. Even in 'Dotall' mode, it still works and avoids trying any match on the next line.
[ 0.4428071975708008, -0.41358718276023865, 0.6048044562339783, -0.09860070049762726, -0.1080484539270401, -0.15312767028808594, 0.4508967697620392, -0.1769648939371109, 0.140168696641922, -0.6227908134460449, -0.24119751155376434, 0.4492371082305908, -0.4054338335990906, -0.1022716835141182...
Is there any good way to unit test destructors? Like say I have a class like this (contrived) example: ``` class X { private: int *x; public: X() { x = new int; } ~X() { delete x; } int *getX() {return x;} const int *getX() const {return x;} }; ``` Is there an...
[ 0.13177432119846344, -0.16015830636024475, 0.001589023508131504, 0.11969558894634247, -0.02598256804049015, -0.035257525742053986, 0.38813143968582153, -0.21468491852283478, 0.08727793395519257, -0.6435093879699707, -0.321095734834671, 0.8433689475059509, -0.2664898931980133, 0.25636497139...
deleted without cluttering up my hpp file with #ifdef TESTs or breaking encapsulation? The main problem that I'm seeing is that it's difficult to tell if x really got deleted, especially because the object is out of scope at the time the destructor is called. There may be something to be said for dependency injection. ...
[ 0.548172116279602, 0.03107510320842266, 0.13269488513469696, 0.007997964508831501, -0.008685844019055367, 0.08898336440324783, 0.1990816295146942, 0.08872668445110321, -0.2249099165201187, -0.5239858031272888, -0.17521917819976807, 0.5349552631378174, -0.5206553936004639, 0.164358362555503...
constructor of X. Then when you're unit testing, you pass in a mock object (or a mock factory which creates mock objects), and the destructor records the fact that it has been called. The test fails if it isn't. Of course you can't mock (or otherwise replace) a builtin type, so in this particular case it's no good, b...
[ 0.4464995563030243, 0.4514535069465637, 0.01829158142209053, 0.24897372722625732, -0.2853672504425049, 0.13748501241207123, 0.38654741644859314, -0.32689931988716125, -0.016459397971630096, -0.6151891350746155, -0.1717289388179779, 0.5011083483695984, -0.33472079038619995, 0.23621788620948...
*right* destructor was called. So it wouldn't e.g. catch a missing "virtual" declaration on the destructor of the type of the x member (again, not relevant if it's just an int).
[ 0.20538882911205292, -0.14193095266819, 0.27789920568466187, 0.11898143589496613, -0.31739291548728943, -0.17143504321575165, 0.2970559597015381, 0.08093219995498657, -0.26978600025177, -0.24609266221523285, -0.2872510850429535, 0.18802696466445923, -0.24479013681411743, 0.2751146554946899...
I am trying to create a custom accordion for my page to that display my posts. I have it in list format using HTML and I am trying to create an effect when you click each header to expand to show more information. But I don't want to have say six blocks of code for six of the `<li>` elements I have on the page. Is th...
[ -0.10460677742958069, 0.03619888797402382, 0.6752957701683044, -0.16458384692668915, -0.2184947282075882, 0.22264443337917328, -0.06911551207304001, -0.12654873728752136, -0.6704057455062866, -0.6371448636054993, 0.09346144646406174, 0.29534605145454407, -0.10855758190155029, 0.19540105760...
conditions to achieve this. ``` <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $(document).ready(function() { //hide the all of the element with class msg_body $(".msg_body").hide(); //toggle the componenet with class msg_body $(".msg_head").click(function() { $(...
[ -0.008384449407458305, -0.2558072805404663, 0.7986188530921936, -0.21456824243068695, 0.2189836949110031, 0.07417932152748108, 0.029043681919574738, -0.23801782727241516, -0.4199468493461609, -0.7439316511154175, -0.32415589690208435, 0.4663535952568054, -0.39269548654556274, 0.07857993990...
I'm writing a simple IDictionary abstraction in C# that wraps a Dictionary<K, ICollection<V>>. Basically, it maps multiple values to one key. I can't decide whether to remove a key and its empty list when the last item in a values list is removed, or leave it (to avoid instantiating a new collection if the key is reus...
[ 0.20363479852676392, -0.04275599867105484, -0.02440575137734413, 0.20726212859153748, -0.010811949148774147, 0.04748916253447533, 0.0005760811036452651, -0.37222573161125183, -0.20708130300045013, -0.4197629392147064, 0.09722097218036652, 0.42232808470726013, -0.4678015410900116, 0.2679956...
behaves differently depending on whether a key was previously in the MultiMap or not. Does Clear() remove the the Collections? You may also create an unintended memory leak if you do not remove the collections. A developer may add many items, then remove them. Memory usage (after GC) should return to the same amount ...
[ 0.3645637035369873, -0.013295058161020279, 0.2078729122877121, 0.36068955063819885, 0.05428479239344597, -0.2984997630119324, 0.2527858316898346, -0.32214879989624023, -0.41484326124191284, -0.30662235617637634, -0.3199174702167511, 0.5380617380142212, -0.418884813785553, 0.332108318805694...
behavior. Don't fall into the trap of premature optimization.
[ 0.20512162148952484, 0.06975637376308441, -0.30242499709129333, 0.49840736389160156, -0.09290939569473267, -0.03414382413029671, 0.573758065700531, 0.11497463285923004, 0.13340608775615692, -0.7877228260040283, -0.15966862440109253, 0.7530779242515564, -0.4017164409160614, -0.2214646637439...
So I just spent 5 hours troubleshooting a problem which turned out to be due not only to the [old unreliable](https://web.archive.org/web/20141209040727/http://classicasp.aspfaq.com/general/what-is-wrong-with-isnumeric.html) `ISNUMERIC` but it looks like my problem only appears when the UDF in which `ISNUMERIC` is decl...
[ -0.16739997267723083, 0.1473855972290039, 0.2659377157688141, -0.1854265034198761, 0.031086836010217667, -0.2932487726211548, 0.43197739124298096, -0.1210666373372078, -0.1995423287153244, -0.3284725546836853, -0.0026518222875893116, 0.714115560054779, -0.13192951679229736, 0.0979678034782...
because on this project, I'm restricted to SQL Server because this is a high-volume SQL Server to SQL Server data processing task)? You can use the T-SQL functions TRY\_CAST() or TRY\_CONVERT() if you're running SQL Server 2012 as Bacon Bits mentions in the comments: ``` SELECT CASE WHEN TRY_CAST('foo' AS INT) IS NULL...
[ 0.42078685760498047, 0.05467331409454346, 0.055610522627830505, -0.17554327845573425, -0.10775352269411087, -0.005677000619471073, 0.2423563003540039, -0.37132197618484497, -0.04165048152208328, -0.5221807956695557, 0.02616656757891178, 0.45055922865867615, -0.2407936155796051, 0.119419448...
i m trying to design a mmo game using python... I have evaluated stackless and since it is not the general python and it is a fork, i dont want to use it I am trying to chose between pysage candygram dramatis and parley any one try any of these libraries? Thanks a lot for your responses I would go for [pysage](http...
[ 0.27535778284072876, 0.016609884798526764, 0.11125442385673523, 0.17678242921829224, -0.3724615275859833, 0.14387524127960205, -0.33561956882476807, 0.17547349631786346, -0.3976544737815857, -0.6377228498458862, 0.21341732144355774, 0.705914318561554, -0.34171977639198303, -0.2355935871601...
trying to build an MMO via python! It has great OpenGL bindings when you want to add graphics which is great! Hope that helps.
[ 0.33936572074890137, 0.14271663129329681, 0.029665838927030563, 0.37671563029289246, -0.23792476952075958, -0.07497406005859375, 0.15256226062774658, 0.4959430396556854, -0.546103298664093, -0.5167292356491089, 0.003055959939956665, 0.5827630758285522, -0.24581100046634674, -0.310980975627...
I know how to do this using for loops. Is it possible to do something like this using LINQ or lambdas? ``` int[] a = { 10, 20, 30 }; int[] b = { 2, 4, 10 }; int[] c = a * b; //resulting array should be { 20, 80, 300 } ``` EDIT: The code below will work, but it's not as readable as using an explicit method. LINQ is gr...
[ 0.4706785976886749, 0.08246723562479019, 0.3963325321674347, 0.09577237814664841, 0.07663294672966003, -0.09218183159828186, 0.036999210715293884, -0.32923200726509094, -0.2456822395324707, -0.49016499519348145, 0.07271352410316467, 0.47038012742996216, -0.2652145028114319, -0.180173635482...
it's simpler to just use dot notation: ``` int[] result = Enumerable.Range(0, a.Length) .Select(i => a[i] * b[i]) .ToArray(); ``` An alternative is to use the form of Select which takes an index: ``` int[] result = a.Select((value, index) => value * b[index])
[ 0.14606596529483795, -0.39926841855049133, 0.3407685160636902, -0.43062084913253784, -0.04730123281478882, 0.12224163115024567, 0.04462476074695587, -0.7071917653083801, -0.06603700667619705, -0.5225819945335388, -0.09592163562774658, 0.44405779242515564, -0.33072781562805176, 0.1044734120...
.ToArray(); ```
[ -0.24194812774658203, 0.396526962518692, -0.12419038265943527, -0.3568267524242401, -0.03241877257823944, 0.0669606477022171, 0.2501881420612335, 0.14093877375125885, -0.0200247410684824, -0.48490360379219055, -0.5490116477012634, 0.7228118777275085, -0.4161035120487213, 0.2141575962305069...
Getting started with jquery and having trouble getting hello world type example going for asp.net mvc. I get a runtime error "object expected" when trying to load a page with this script. A. Where should script tags be placed in a master page? B. What might I be doing wrong? There are definitely "a" elements in my pa...
[ -0.07573678344488144, -0.10784544795751572, 0.3297766447067261, -0.11212082952260971, -0.4335766136646271, -0.37134483456611633, 0.18796023726463318, -0.048729028552770615, -0.424534410238266, -0.7103480100631714, 0.2532994747161865, 0.3670303225517273, -0.2967517077922821, -0.094137437641...
$(document).ready(function() { $("a").click(function(event) { alert("Thanks for visiting!"); }); }); </script> ``` B) I checked
[ 0.26668426394462585, 0.08680181205272675, 0.6575505137443542, -0.3834575414657593, 0.30581268668174744, -0.2879762351512909, 0.5180561542510986, -0.1921890527009964, -0.08629447221755981, -0.2614576816558838, -0.3877207934856415, 0.7918534278869629, -0.2646368443965912, -0.0365817025303840...
your inline script on quick test page and it works ok, so i advice using **Firefox** with **FireBug** plugin installed for finding the problem: * In Firebug's "script" tab use the Watch window on the right to insert and check parts of your script and see what do they return. * I'd start with putting `$` in watch windo...
[ 0.2994632422924042, 0.05509047210216522, 0.5759389400482178, -0.041509851813316345, -0.20315666496753693, -0.166505828499794, 0.44430768489837646, -0.10043922066688538, 0.09109888225793839, -0.8184543251991272, 0.05350980907678604, 0.9477167129516602, -0.32247644662857056, -0.0671655610203...
you encounter something wrong
[ 0.3743506371974945, 0.29788365960121155, -0.3317966163158417, 0.09602855890989304, -0.372759073972702, -0.4272395968437195, 0.2880345284938812, 0.3986704349517822, -0.21139009296894073, -0.8133637309074402, 0.025175245478749275, 0.11833623051643372, 0.14614862203598022, 0.07558855414390564...
How would I go about implementation the queries required for pagination? Basically, when page 1 is requested, get the first 5 entries. For page 2, get the next 5 and so on. I plan to use this via the couchdb-python module, but that shouldn't make any difference to the implementation. The [CouchDB Guide](http://guide....
[ -0.006635882426053286, 0.05619116500020027, 0.6413204073905945, -0.04058709368109703, -0.03830580413341522, 0.217443585395813, -0.1220892071723938, -0.16782738268375397, -0.21173958480358124, -1.1777985095977783, 0.08935020118951797, 0.25831055641174316, -0.17639420926570892, 0.03576318919...
others to create the previous link N.B.: The proper way to fetch pages in CouchDB is by specifying a starting key, not a starting index like you might think. But how do you know what key to start the 2nd page on? The clever solution: "Instead of requesting 10 rows for a page, you request 11 rows, but display only 10 a...
[ -0.010498969815671444, -0.09595722705125809, 0.5755849480628967, 0.28661656379699707, -0.20012739300727844, -0.014236170798540115, -0.024235069751739502, -0.22949932515621185, -0.3318204879760742, -0.7245271801948547, 0.03676946461200714, 0.49974364042282104, -0.11819244921207428, 0.039666...
`startkey` alone will no longer be sufficient to uniquely identify a row. Those parameters are useless if you don't provide a `startkey`. In fact, CouchDB will first look at the `startkey` parameter, then it will use the `startdocid` parameter to further redefine the beginning of the range if multiple potential staring...
[ -0.17509819567203522, -0.041990410536527634, 0.5549559593200684, -0.10080888122320175, -0.051115576177835464, -0.026684066280722618, -0.16591542959213257, -0.024137139320373535, -0.18244007229804993, -0.7208533883094788, -0.11617172509431839, 0.3797024190425873, -0.1394173502922058, 0.3223...
I've seen quite a few developer job postings recently that include a sentence that reads more or less like this: "Must have experience with N-Tier architecture", or "Must be able to develop N-Tier apps". This leads me to ask, what is N-Tier architecture? How does one gain experience with it? [Wikipedia](http://en.wiki...
[ 0.2363283485174179, 0.28761592507362366, 0.11729666590690613, 0.21335308253765106, 0.11267903447151184, 0.011597106233239174, 0.15676352381706238, -0.08490722626447678, -0.41299742460250854, -0.7443192005157471, -0.35091713070869446, 0.33099982142448425, -0.11319940537214279, 0.33105376362...
a user and a database employs > multi-tier architecture. The most > widespread use of "multi-tier > architecture" refers to three-tier > architecture. It's debatable what counts as "tiers," but in my opinion it needs to at least cross the process boundary. Or else it's called layers. But, it does not need to be in...
[ 0.09843172878026962, 0.3560310900211334, 0.23630793392658234, 0.2667694687843323, 0.13285411894321442, -0.2090558111667633, 0.0696791410446167, -0.3853383958339691, -0.32437580823898315, -0.9564283490180969, -0.044268280267715454, 0.3257771134376526, -0.31518131494522095, 0.263641744852066...
slow, and/or insecure network. This is very different from simple Desktop application where the data lives on the same machine as files or Web Application where you can hit the database directly. For n-tier programming, you need to package up the data in some sort of transportable form called "dataset" and fly them ov...
[ 0.27643242478370667, -0.4029087722301483, 0.18850407004356384, 0.4370504319667816, 0.16776159405708313, -0.22908945381641388, 0.17882882058620453, 0.05026867613196373, -0.36601459980010986, -0.6570867896080017, -0.07001569867134094, 0.3009242117404938, -0.49636751413345337, 0.0469620414078...
When working with PDFs, I've run across the MIME types `application/pdf` and `application/x-pdf` among others. Is there a difference between these two types, and if so what is it? Is one preferred over the other? I'm working on a web app which must deliver huge amounts of PDFs and I want to do it the correct way, if...
[ 0.1184128075838089, 0.24123752117156982, 0.8133159875869751, 0.3433076739311218, 0.07488268613815308, -0.28099873661994934, -0.2402602881193161, -0.20845380425453186, -0.07632597535848618, -0.6141306757926941, -0.4840485751628876, 0.4715730547904968, -0.2498299479484558, 0.0364902541041374...
body, The [Internet Assigned Numbers Authority](http://www.iana.org/ "IANA") (IANA). This is the same organization that manages the root name servers and the IP address space. The use of `x-pdf` predates the standardization of the Media Type for PDF. Media Types in the `x-` namespace are considered experimental, just ...
[ 0.25805437564849854, 0.13697172701358795, 0.372930645942688, 0.3971807658672333, -0.3404689133167267, -0.5486462116241455, -0.287518709897995, -0.10379641503095627, -0.07648106664419174, -0.2507587969303131, -0.24321168661117554, 0.1680625081062317, -0.07668323814868927, 0.4425962865352630...
document.body.offsetWidth returns the innerwidth value from left hand side to the left side of the vertical scrollbar in firefox. In IE it doesn't, instead it returns from left hand side to the right side of the vertical scrollbar. Does anyone know a sensible way I could make a veriable such as "var = offsetw;" for off...
[ -0.0873955637216568, 0.09802061319351196, 0.8989542722702026, -0.23084284365177155, 0.1103944256901741, 0.10497258603572845, 0.09589792042970657, -0.5373001098632812, -0.12894219160079956, -0.8010982871055603, 0.06195954233407974, 1.0086190700531006, -0.38303422927856445, -0.31355464458465...
16; } if (navigator.appName.indexOf("Microsoft")!=-1) { winW = 20; winH = 20; } if (navigator.appName.indexOf("Mozilla")!=-1){ winW = 0; winH = 0; } } ``` Firefox currently uses the 16 value and not the zero declared by the Mozilla line, which indicates it is wrong....
[ -0.009966826997697353, 0.4830045700073242, 0.681659460067749, -0.42814627289772034, 0.4095454216003418, 0.160203754901886, 0.21878276765346527, -0.39081186056137085, -0.3411027789115906, -0.31159862875938416, -0.2596181035041809, 0.892463207244873, -0.6736725568771362, 0.03458550572395325,...
for each browser only if those browsers don't subtract the scrollbar from document.body.offsetWidth automatically Thanks :) Check if you have "support for script debugging" enabled in Console. Its disabled by default for performance reasons.
[ -0.06620103865861893, -0.043579164892435074, 0.503973126411438, 0.29635095596313477, 0.005584516562521458, -0.311917245388031, 0.6276299953460693, 0.01793520525097847, 0.005833945702761412, -0.8276976943016052, -0.3090488612651825, 0.717054545879364, 0.18790851533412933, -0.133939787745475...
I have been trying to find information on how to retrieve attachments from a gmail account in either python or PHP, I'm hoping that someone here can be of some help, thanks. Related: * [How can I download all emails with attachments from Gmail?](https://stackoverflow.com/questions/348630/how-can-i-download-all-emails...
[ 0.1328195482492447, 0.17670419812202454, 0.5358257293701172, 0.07026385515928268, -0.23454591631889343, -0.07144039124250412, 0.23160891234874725, 0.11846818029880524, -0.26862549781799316, -0.7067654728889465, -0.1741282194852829, 0.6472636461257935, -0.21070894598960876, 0.16964301466941...
For my programming class I have to write a linked list class. One of the functions we have to include is next(). This function would return the memory address of the next element in the list. ``` #include <iostream> using namespace std; class Set { private: int num; Set *nextval; bool empt...
[ -0.15760527551174164, -0.02296631969511509, 0.32656610012054443, -0.3521074652671814, 0.42823147773742676, -0.03737102076411247, 0.22430551052093506, -0.2666149437427521, -0.11172416061162949, -0.6870472431182861, -0.22621138393878937, 0.528874397277832, -0.523664653301239, 0.0482288822531...
Set *current; current = this; return current->next; } int main() { Set a, *b, *c; for (int i=50;i>=0;i=i-2) a.insert(i); // I've ommited since it does not pertain to my question // Test the next_element() iterator b = a.next(); c = b->next(); cout << "Third element of b = " << c->value...
[ 0.03060687705874443, -0.1529434472322464, 0.5419477820396423, -0.3306889235973358, 0.47560596466064453, 0.14750510454177856, 0.20088182389736176, -0.45395928621292114, -0.08044201880693436, -0.3225744366645813, -0.28867706656455994, 0.5433337092399597, -0.28932100534439087, 0.0639108940958...
the next element in the list. My question is what kind of return type would I use? I've tried putting Set and Set\* in place of but get compiler errors. Any help is greatly appreciated. `Set*` is correct. You are suffering from a rather silly bug in this function: ``` Set* Set::next() { Set *current; current =...
[ -0.0654401108622551, -0.2630809545516968, 0.5770277380943298, -0.0977126881480217, 0.31570637226104736, -0.0930241271853447, 0.21534334123134613, 0.034026969224214554, -0.10554536432027817, -0.7681009769439697, -0.12265937775373459, 0.62835294008255, -0.3943859040737152, 0.0081535577774047...
I have looked on FaceBook Developer page and found that it's possible to create a FaceBook application, however this application must be hosted by you! I'm new, does any one have an experience on that? I don't really see a question. Surely a lot developers created such an application (see all the available apps in fac...
[ 0.5875135660171509, 0.514039933681488, 0.1328759491443634, 0.16051794588565826, -0.10628107935190201, -0.1926279366016388, 0.29017767310142517, 0.10272572189569473, -0.3202528953552246, -0.2895848751068115, 0.24942722916603088, 0.3533427119255066, 0.2321140170097351, -0.06032353639602661, ...
I know I can access environment variables in PowerShell using `$Env`. For example, I can access `FOO` with `$Env:FOO`. I can't figure out how to access the environment variable called `FOO.BAR`. `$Env:FOO.BAR` doesn't work. How can I access this from within PowerShell? To access any kind of PowerShell variable where ...
[ 0.23065875470638275, 0.17058038711547852, 0.44236209988594055, 0.11707203835248947, 0.3016805648803711, -0.22353307902812958, 0.22086438536643982, -0.055087409913539886, 0.13851071894168854, -0.7192192673683167, 0.14093489944934845, 0.6636627912521362, -0.3452615439891815, 0.57269161939620...
> **Possible Duplicate:** > > [What's wrong with Delphi's “with”](https://stackoverflow.com/questions/71419/whats-wrong-with-delphis-with) I am have a problem debugging code that uses a ‘WITH’ statement in BDS 2006 The debugger will not show the values of the variables with in a class or record. Am I doing somethin...
[ -0.15139102935791016, -0.04795760288834572, 0.4475986957550049, -0.22673170268535614, 0.02551095560193062, -0.07502996176481247, 0.5752856731414795, -0.3505297899246216, -0.391763299703598, -0.19813452661037445, -0.33559224009513855, 0.6117430329322815, -0.5850316882133484, 0.1743899732828...
Num := Num +1 ; /// Num is not seen by the debugger MyNumber.Num := Num +1 ; /// MyNumber.Num is seen but Num is not seen by the debugger end; end; ``` EDIT: Sure one can use the full name of the variable But things become very messy if you have a complex structure with more than one level `With...
[ -0.03487926349043846, -0.00794148351997137, 0.053115781396627426, -0.034403711557388306, 0.018835948780179024, -0.3585939407348633, 0.37360459566116333, 0.1454007625579834, -0.14942355453968048, -0.3421153128147125, -0.31770116090774536, 0.3991798758506775, -0.08876721560955048, 0.18481151...
to use it" category. There are *very* few occasions where I'd give it house-room - I've found one or two cases where it's use is essential when using extremely complex multi-level structures where the compiler doesn't do quite as you'd expect without it and it is easier to include, but in 10 years of coding Delphi I th...
[ 0.3805779814720154, 0.07649733126163483, -0.060710106045007706, 0.10246218740940094, -0.0956871509552002, -0.21904779970645905, 0.2751431167125702, -0.08711478114128113, -0.19794057309627533, -0.5171502828598022, -0.32412704825401306, 0.5509315729141235, -0.042475625872612, -0.181791260838...
of a structure when reviewing code you didn't write or haven't used for a period easily outweighs that. The known issues with the debugger on every version of Delphi I've ever used is the clincher.
[ 0.07438819855451584, 0.5587066411972046, -0.10188335180282593, 0.08831002563238144, -0.15533441305160522, -0.17776672542095184, 0.002767941216006875, -0.03111451491713524, -0.10576563328504562, -0.2759651839733124, -0.06767251342535019, 0.44985443353652954, -0.019584840163588524, 0.1170316...
Pretty much as the question asks. Answers preferably in pseudo code and referenced. The correct answer should value speed over simplicity. See [Intersections of Rays, Segments, Planes and Triangles in 3D](http://www.softsurfer.com/Archive/algorithm_0105/algorithm_0105.htm). You can find ways to triangulate polygons. I...
[ 0.013709141872823238, -0.06259766966104507, 0.7758288979530334, 0.26936352252960205, -0.26230373978614807, 0.08122608065605164, 0.1922779381275177, -0.10020807385444641, -0.4414326846599579, -0.7618315815925598, -0.014223880134522915, 0.40193772315979004, -0.22849471867084503, -0.168145656...
d) ``` > If the denominator `|n_p DOT d| < epsilon`, where `epsilon` is very small > number, then the ray is considered > parallel to the polygon plane and no > intersection occurs. Otherwise, the > intersection point, `p`, of the ray and > the polygon plane is computed: `p = o + td`. Thereafter, the problem of ...
[ -0.22063858807086945, 0.041179556399583817, 0.3345334827899933, 0.025173209607601166, -0.2389419674873352, 0.27392420172691345, 0.18283919990062714, -0.6403555870056152, 0.08991341292858124, -0.8621168732643127, -0.36442846059799194, 0.4835708737373352, -0.33942800760269165, 0.057094532996...
After attending a talk on Oslo/M I am struggling a bit to see the advantages of using it over existing methods and in what situation it would be useful. I know its quite new and not all details have been released etc but can some one give me some advantages and when you might use it? Thanks, Alex This questions seem...
[ 0.6197111010551453, 0.15515640377998352, -0.2657102048397064, 0.05936288833618164, -0.041232697665691376, -0.13484296202659607, 0.11106056720018387, 0.1873280256986618, -0.13601522147655487, -0.5171622037887573, 0.4382994472980499, 0.49040699005126953, 0.17861907184123993, 0.08920583873987...
need Oslo?](http://social.msdn.microsoft.com/Forums/en-US/oslo/thread/ae08521d-c61b-4622-9a12-3d572bd97b6a)
[ 0.17174191772937775, 0.26050010323524475, 0.4211645722389221, 0.050249043852090836, 0.0026274605188518763, -0.05361092463135719, 0.6812493801116943, -0.20087963342666626, -0.3632258176803589, -0.5285507440567017, -0.2496904879808426, -0.03994640335440636, -0.11165820807218552, -0.179696828...
I am trying to set the `fieldValue` of the check box to a value I got from the property tag. I am having trouble with the syntax. This is what I have tried: ``` <s:form id="myForm" method="post" action="removeUser" enctype="multipart/form-data"> <s:iterator value="myList"> <tr> <td><s:proper...
[ 0.23142556846141815, 0.205277681350708, 0.32749849557876587, -0.3469085693359375, 0.1041269525885582, 0.0077869947999715805, 0.23319600522518158, -0.4430622458457947, -0.09477843344211578, -0.595398485660553, -0.08755674958229065, 0.5275704860687256, -0.26131176948547363, 0.160002604126930...
<td><s:checkbox label="delete" name="delete" fieldValue="<s:property value='id'/>"/></td> </tr> </s:iterator> <s:submit id="saveForm" value="Delete users"></s:submit> </s:form> ``` However, it keeps on returning me `true` as the `fieldValue` Can someone familiar with struts please help me? Thanks...
[ 0.17604227364063263, -0.2024102360010147, 0.34576117992401123, -0.1297501027584076, -0.3644379675388336, 0.05970079079270363, 0.6678463220596313, -0.6665610671043396, 0.10792618244886398, -0.23353582620620728, 0.10110186785459518, 0.9674686193466187, -0.3457199037075043, -0.318202972412109...
How do I split a list of arbitrary length into equal sized chunks? --- See [How to iterate over a list in chunks](https://stackoverflow.com/q/434287) if the data result will be used directly for a loop, and does not need to be stored. For the same question with a string input, see [Split string every nth character?]...
[ 0.1052759513258934, -0.3777540326118469, 0.14224441349506378, -0.2550261318683624, -0.2088131457567215, 0.2020644098520279, 0.06709198653697968, -0.6237621903419495, -0.3511596918106079, -0.2720673680305481, -0.3780217170715332, 0.4053884446620941, -0.2896997332572937, -0.1221078485250473,...
75), 10))) [[10, 11, 12, 13, 14, 15, 16, 17, 18, 19], [20, 21, 22, 23, 24, 25, 26, 27, 28, 29], [30, 31, 32, 33, 34, 35, 36, 37, 38, 39], [40, 41, 42, 43, 44, 45, 46, 47, 48, 49], [50, 51, 52, 53, 54, 55, 56, 57, 58, 59], [60, 61, 62, 63, 64, 65, 66, 67, 68, 69], [70, 71, 72, 73, 74]] ``` For Python 2, using `x...
[ -0.0849391520023346, 0.09320005774497986, 0.17163638770580292, -0.3568720817565918, -0.25942865014076233, 0.4668024778366089, 0.3509809970855713, -0.1631590723991394, -0.36471083760261536, -0.2629649043083191, -0.5193521976470947, 0.25520387291908264, -0.3032550513744354, -0.06574989110231...
yield lst[i:i + n] ``` --- Below is a list comprehension one-liner. The method above is preferable, though, since using named functions makes code easier to understand. For Python 3: ``` [lst[i:i + n] for i in range(0, len(lst), n)] ``` For Python 2: ``` [lst[i:i + n] for i in xrange(0, len(lst), n)] ```
[ -0.15525148808956146, 0.011825337074697018, 0.2055075764656067, -0.5115989446640015, -0.14343242347240448, 0.1367117464542389, 0.2520432770252228, -0.5017678141593933, 0.11187610775232315, -0.4161369204521179, -0.2609814405441284, 0.7621877789497375, -0.20638763904571533, -0.38390964269638...
I am looking for a Java open source beautifier or reformatter for SQL that I can use to clean up DDL statements that I am generating with [openArchitectureWare](http://www.openarchitectureware.org). Nothing in the answer to "[Online Code Beautifier And Formatter](https://stackoverflow.com/questions/206441/online-code-...
[ 0.02322237938642502, 0.23961949348449707, 0.6247668266296387, -0.1266741156578064, -0.1820542961359024, 0.015208708122372627, 0.34068793058395386, -0.16354969143867493, -0.16204962134361267, -0.6130281686782837, -0.12603960931301117, 0.3688121736049652, -0.12116912007331848, 0.179390072822...
`org.hibernate.pretty.Formatter` ``` String formattedSQL = new Formatter(sql).format(); ```
[ 0.3757125437259674, 0.20990049839019775, 0.7975689768791199, -0.23888461291790009, -0.08231519162654877, -0.29007527232170105, 0.3653123676776886, -0.16273243725299835, -0.19798444211483002, -0.36323273181915283, -0.2636559307575226, 0.42874616384506226, -0.48017019033432007, 0.19481998682...
I have a Windows GUI application that's using the Qt framework (currently version 3.3.5, might change to Qt4). I want to combine other Windows GUI applications in the main application. I can't use the widgets directly in the main application due to several constrains which I can't control. The final layout should look...
[ -0.04364399239420891, 0.026969486847519875, 0.7621040940284729, -0.28077489137649536, 0.13728396594524384, 0.07573191076517105, 0.11522894352674484, -0.3468768000602722, -0.21093563735485077, -0.956504225730896, -0.10164065659046173, 0.5332419276237488, -0.0055355834774672985, 0.1867648810...
on the child windows. Is there a better or more generic mechanism for doing this? Some suggested that I use ActiveX, but I'm not familiar enough with this technology. Here is how some Windows applications deal with this problem: If the widget application *must* be in it's own EXE, then you could use OLE document obje...
[ 0.3294459879398346, 0.06872984021902084, 0.46505075693130493, 0.04259782284498215, 0.1408633142709732, 0.09495765715837479, 0.19602839648723602, 0.1257251650094986, 0.03989296779036522, -0.9487309455871582, -0.1053374633193016, 0.46303752064704895, -0.1587856560945511, 0.3773265480995178, ...
programs ***unless*** the frameworks you're building on top of support this automatically. MFC did a nice job with this... (man, did I just compliment MFC??) A better solution would be to use some type of in-process solution. Have all the widgets be DLLs. This is how ActiveX works. If widgets needed to run out of proc...
[ 0.36605605483055115, -0.14668741822242737, 0.26755908131599426, 0.34635505080223083, -0.1726902425289154, -0.2235906422138214, 0.2139679342508316, 0.17321202158927917, -0.2896289527416229, -0.8488749265670776, -0.23279868066310883, 0.46966272592544556, -0.5266190767288208, -0.0957657769322...
make nearly any "sane" implementation impossible...
[ 0.3815387785434723, 0.35101187229156494, -0.01751069910824299, 0.07318606227636337, 0.24689394235610962, -0.4253638684749603, 0.5328265428543091, 0.214597687125206, 0.37574252486228943, -0.36490336060523987, -0.17657646536827087, 0.21746282279491425, -0.2381334751844406, 0.2438481003046035...
I know that [buffer overruns](http://en.wikipedia.org/wiki/Buffer_overflow) are one potential hazard to using C-style strings (char arrays). If I know my data will fit in my buffer, is it okay to use them anyway? Are there other drawbacks inherent to C-style strings that I need to be aware of? **EDIT:** Here's an exam...
[ 0.24687474966049194, 0.15943267941474915, 0.23058918118476868, -0.1548856645822525, 0.1108330711722374, -0.053234267979860306, 0.286197304725647, -0.2705457806587219, -0.24272339046001434, -0.5885728597640991, -0.0700162798166275, 0.5375178456306458, -0.3391239047050476, 0.0531343966722488...
`popen("df")` command. I'm trying to run Linux commands and parse their output to get information about the operating system. Is there anything wrong (or dangerous) with setting the buffer to some arbitrary size this way? C strings lack the following aspects of their C++ counterparts: * Automatic memory management: yo...
[ 0.2665903866291046, 0.11518251150846481, 0.096806101500988, -0.2501694858074188, -0.30305352807044983, 0.00410406943410635, 0.3053398132324219, -0.08379994332790375, -0.23994483053684235, -0.4236581325531006, -0.2548488974571228, 0.6134956479072571, -0.2547405958175659, 0.15020902454853058...
don't need a special value to mark their end. * Sensible comparison and assignment operators: even though comparison of C string pointers is permitted, it's almost always *not* what was intended. Similarly, assigning C string pointers (or passing them to functions) creates ownership ambiguities.
[ 0.22044220566749573, 0.08330821990966797, 0.027671879157423973, 0.15536603331565857, 0.1371561884880066, -0.3107368052005768, 0.1532617062330246, -0.07718461006879807, -0.09566725790500641, -0.37125101685523987, -0.3376469314098358, 0.494235634803772, -0.22017154097557068, 0.06297411024570...
Folks, TIBCO has announced support for WCF channels back in April - has anything of that materialized by now?? Where and how can I download either these new WCF channel bits, or where can I get my hands on a current .NET 2.0/3.5 version of the "TIBCO.EMS .NET client library" ?? We're a small ISV without any ties to...
[ 0.5253159403800964, 0.2219689041376114, 0.8930085897445679, 0.00869075208902359, -0.07376846671104431, -0.45370399951934814, 0.10812694579362869, 0.1874726116657257, -0.3615468144416809, -0.6573905944824219, 0.13391751050949097, 0.48890024423599243, -0.04813984036445618, 0.1557766497135162...
of you using TIBCO EMS - how do you interface with it, e.g. communicate and send data back and forth?? **UPDATE** (April 2010) I've had an opportunity to check out the "native" TIBCO.EMS.dll from .NET, as well as their WCF implementation, and my conclusion is: use the native API. It's easy, it's simple, it works. ...
[ 0.11662093549966812, 0.2679296135902405, 0.572849690914154, -0.22874362766742706, -0.008854685351252556, -0.09143402427434921, 0.3542744517326355, -0.2379360944032669, -0.08929465711116791, -0.920214831829071, 0.033271655440330505, 0.6054047346115112, -0.3379541039466858, -0.04513251781463...
had expected more from a company the size and reputation of TIBCO.... Your communication stack will be a lot simpler if you simply use Tibco EMS .NET client directly. It's styled after JMS, which is widely used in enterprise software development. Hence there are a lot of tech books on how to do JMS programming. Java an...
[ 0.3612307906150818, 0.23031063377857208, 0.3513854742050171, 0.03313473239541054, -0.049750592559576035, -0.14842142164707184, -0.11231435090303421, -0.19045133888721466, -0.16595600545406342, -0.8650103211402893, 0.0020455827470868826, 0.8217149972915649, -0.25593313574790955, -0.04067394...
trouble-free in operation. The problem with abstraction layers of the ilk of WCF is that there is almost always a leaky abstraction issue lurking somewhere.
[ 0.4467374086380005, 0.1666676253080368, 0.2595250606536865, 0.33160462975502014, -0.11531516164541245, -0.7001178860664368, 0.13416899740695953, -0.09024467319250107, -0.07671038806438446, -0.3159041106700897, -0.25685155391693115, 0.7026681900024414, -0.3166753351688385, 0.012115312740206...
I am not a mathematician. I enjoy a good math puzzle, but I admit my weaknesses whole heartedly. That said, I've always had an interest in Neural Networks, and while I understand them enough to implement them from scratch, I hit a wall when I need to understand any concept that I can only find mathematic proofs for. Wh...
[ 0.2524949908256531, -0.04076303914189339, -0.09712307155132294, 0.11612693220376968, -0.07091673463582993, -0.10672420263290405, 0.2634223699569702, -0.03817974403500557, 0.027673708274960518, -0.48996052145957947, 0.2782064974308014, 0.49232217669487, 0.14958667755126953, 0.15996402502059...
about a checkers-playing AI developed by the author. It's not *completely* without programming references, but it does a great job of explaining how the algorithms work without getting into the code of the solution.
[ 0.3184777796268463, 0.22134004533290863, -0.2428392767906189, 0.3163948059082031, 0.1980946809053421, -0.411407470703125, 0.45136505365371704, 0.42933475971221924, 0.13080593943595886, -0.5012131929397583, 0.08386024832725525, -0.023928308859467506, -0.1834205985069275, -0.1096809208393096...
``` if __name__=='__main__': parser = OptionParser() parser.add_option("-i", "--input_file", dest="input_filename", help="Read input from FILE", metavar="FILE") (options, args) = parser.parse_args() print options ``` result is ``` $ python convert.py -i vid...
[ 0.12157031893730164, 0.16414310038089752, 0.6432980298995972, -0.2162143588066101, 0.05155481770634651, 0.027850478887557983, 0.1788448691368103, -0.22013859450817108, -0.4974154829978943, -0.564612627029419, -0.23822622001171112, 0.8295173645019531, -0.2420566827058792, 0.1108729466795921...
-- it's the shell. Call ``` $ python convert.py -i 'video_*' ``` and it will pass in that wildcard. The other six values were passed in as args, not attached to the `-i`, exactly as if you'd run `python convert.py -i video_1 video_2 video_3 video_4 video_5 video_6`, and the `-i` only attaches to the immediate next...
[ 0.3089054226875305, 0.02758229896426201, 0.6494978070259094, 0.15364232659339905, 0.3120346963405609, 0.1597360372543335, -0.18597808480262756, -0.05071158707141876, -0.11557992547750473, -0.2203892469406128, -0.017414327710866928, 0.815854012966156, -0.15693125128746033, 0.250423103570938...
This happens repeatedly and is very annoying. I upload some PHP code to a client's server. A few weeks pass. They ask for a change to be made and I re-download the code as they've made some changes. However, my code which used to be neat and tidy the last time I looked at it now has an extra lines of whitespace added e...
[ 0.614840567111969, 0.11605044454336166, 0.5436880588531494, -0.031006168574094772, -0.1328209638595581, -0.002743953373283148, 0.675881028175354, 0.09224586188793182, -0.3704056739807129, -0.6899489760398865, 0.4845148026943207, 0.01667306385934353, -0.2520046532154083, 0.21103793382644653...
they're all scattered around now and there's no way to distinguish them. Is there any program/utility to fix this? Upload in binary mode instead of ascii. Ascii mode is changing all your linefeeds (unix end of line character) into carriage returns + linefeeds (Windows end of line characters).
[ 0.1897432655096054, -0.4171026945114136, 0.5078639388084412, 0.26849693059921265, 0.08893723040819168, 0.25582972168922424, 0.11035973578691483, 0.11923224478960037, -0.3110675513744354, -0.44027507305145264, -0.18980072438716888, 0.28474515676498413, -0.313775897026062, 0.4270312786102295...
**(Scroll down to bottom of post to find solution.)** Got a asp.net page which contains a Datalist. Inside this datalist, there is a template containing a dropdownlist and each time the datalist is filled with an item, a ItemCreatedCommand is called. The itemCreatedCommand is responsible for databinding the dropdownli...
[ -0.10006991773843765, -0.08839000016450882, 0.3937128186225891, -0.0842847153544426, 0.12479609996080399, -0.08340173959732056, 0.2397528737783432, -0.17008395493030548, -0.44220539927482605, -0.5683045387268066, -0.4856095016002655, 0.4403202533721924, -0.47668278217315674, 0.277201533317...