text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
) ? And a friend of mine wrote the following: ``` function array_unique2($a) { $n = array(); foreach ($a as $k=>$v) if (!in_array($v,$n)) $n[$k]=$v; return $n; } ``` which is twice as fast as the built in one in php. I'd like to know, why? What is the time-complexity of array\_uniq...
[ 0.2890003025531769, 0.10269210487604141, 0.03494958207011223, -0.1738673448562622, -0.10073790699243546, 0.12513186037540436, 0.5388711094856262, -0.5702771544456482, -0.3186897039413452, -0.3124767243862152, 0.3235022723674774, 0.41774624586105347, -0.16024309396743774, 0.0984905883669853...
the native array\_unique function, I can tell you that your friends algorithm is faster because: 1. He uses a single foreach loop as opposed to your double for() loop. 2. Foreach loops tend to perform faster than for loops in PHP. 3. He used a single if(! ) comparison while you used two if() structures 4. The only ad...
[ -0.12345725297927856, 0.013187664560973644, 0.03762431815266609, 0.08973095566034317, -0.4297671616077423, -0.04843898490071297, 0.5329782366752625, -0.40290743112564087, -0.18693488836288452, -0.4465222656726837, 0.4459435045719147, 0.7507146596908569, -0.3509523272514343, -0.063299082219...
take longer than your friends.
[ 0.4169154763221741, 0.21188421547412872, -0.23472389578819275, 0.1361342817544937, -0.3709428310394287, -0.5118190050125122, 0.32708171010017395, 0.4439488649368286, 0.3359522521495819, -0.40310749411582947, 0.32218700647354126, 0.13920116424560547, 0.4969152510166168, -0.34934815764427185...
I have created a function that takes a SQL command and produces output that can then be used to fill a List of class instances. The code works great. I've included a slightly simplified version without exception handling here just for reference - skip this code if you want to jump right the problem. If you have suggest...
[ 0.19898253679275513, -0.14671994745731354, 0.3569883108139038, -0.05694453418254852, 0.12843608856201172, -0.1439128965139389, 0.30852845311164856, -0.06741014122962952, -0.17627957463264465, -0.8605133891105652, -0.09710248559713364, 0.7954821586608887, -0.3993537425994873, 0.295652270317...
SqlDataReader nwReader = myCommand.ExecuteReader(); Type objectType = typeof (T); FieldInfo[] typeFields = objectType.GetFields(); while (nwReader.Read()) { T obj = new T(); foreach (FieldInfo info in typeFields) {
[ 0.06601826846599579, -0.4115760326385498, 0.5335118770599365, -0.12975522875785828, -0.011283136904239655, 0.028985148295760155, 0.34623345732688904, -0.159390389919281, 0.061023611575365067, -0.32363539934158325, 0.01779690943658352, 0.4479709565639496, -0.4091087579727173, 0.463671684265...
for (int i = 0; i < nwReader.FieldCount; i++) { if (info.Name == nwReader.GetName(i)) {
[ 0.12167564779520035, -0.4326711893081665, 0.4159298837184906, -0.03939586505293846, 0.16816672682762146, 0.28107231855392456, 0.4672444760799408, -0.323979914188385, 0.18758633732795715, -0.7931743264198303, -0.08372272551059723, 0.4154892563819885, -0.20180130004882812, 0.2242941111326217...
info.SetValue(obj, nwReader[i]); break; } } } fdList.Add(obj); }
[ -0.02802031673491001, -0.46542009711265564, 0.31688201427459717, -0.11210403591394424, 0.08730542659759521, 0.14874157309532166, 0.4555232524871826, -0.16856800019741058, -0.24195070564746857, -0.8888751864433289, -0.4213845431804657, 0.35200098156929016, -0.6448277235031128, 0.09990422427...
nwReader.Close(); return fdList; } ``` As I say, this works just fine. However, I'd like to be able to call a similar function with an *anonymous class* for obvious reasons. Question #1: it appears that I must construct an anonymous class **instance** in my call to my anonymous version of this function -...
[ 0.2072829157114029, -0.21390952169895172, 0.36809247732162476, -0.2054314762353897, -0.10659290105104446, 0.014112896285951138, 0.28709617257118225, -0.12130165100097656, -0.11071755737066269, -0.7320192456245422, 0.1280788779258728, 0.3311142325401306, -0.21873882412910461, 0.509622871875...
info.SetValue simply does nothing? It doesn't return an error or anything but neither does it change the value of the target field. ``` public List<T> ReturnList<T>(T sample) { List<T> fdList = new List<T>(); myCommand.CommandText = QueryString; SqlDataReader nwReader = myCommand.Execu...
[ 0.31069648265838623, -0.5025278329849243, 0.44002604484558105, 0.0703185498714447, 0.1390516310930252, -0.275435209274292, 0.4070065915584564, -0.40992316603660583, -0.006312227342277765, -0.5100163817405701, -0.07322274148464203, 0.7590489983558655, -0.5843506455421448, 0.1143580302596092...
while (nwReader.Read()) { // No way to create a constructor so this call creates the object without calling a ctor. Could this be a source of the problem? T obj = (T)FormatterServices.GetUninitializedObject(typeof(T)); foreach (PropertyDescriptor info in properties) ...
[ 0.3019866943359375, -0.230263352394104, 0.23106971383094788, 0.10867643356323242, 0.15969327092170715, -0.00010583009861875325, 0.57484370470047, -0.28897133469581604, -0.05002838373184204, -0.5450735092163086, -0.07239552587270737, 0.5154667496681213, -0.22850456833839417, 0.4799707531929...
for (int i = 0; i < nwReader.FieldCount; i++) { if (info.Name == nwReader.GetName(i)) {
[ 0.12167564779520035, -0.4326711893081665, 0.4159298837184906, -0.03939586505293846, 0.16816672682762146, 0.28107231855392456, 0.4672444760799408, -0.323979914188385, 0.18758633732795715, -0.7931743264198303, -0.08372272551059723, 0.4154892563819885, -0.20180130004882812, 0.2242941111326217...
// This loop runs fine but there is no change to obj!! info.SetValue(obj, nwReader[i]); break; } }
[ 0.18689832091331482, -0.32064110040664673, 0.30603906512260437, -0.013991602696478367, 0.04061250388622284, 0.003299195319414139, 0.8322081565856934, 0.01722428947687149, -0.3370102047920227, -0.6640806794166565, -0.1906232237815857, 0.2592465281486511, -0.33556586503982544, 0.062979251146...
} fdList.Add(obj); } nwReader.Close(); return fdList; } ``` Any ideas? **Note:** when I tried to use the FieldInfo array as I did in the function above, the typeFields array had zero elements (even though the objectType shows the field names - strange). Thus, I use TypeDescrip...
[ 0.3782351315021515, 0.04087916016578674, 0.15381941199302673, -0.1383344680070877, 0.11196095496416092, -0.20827680826187134, 0.3457745313644409, -0.07837697118520737, -0.09558115154504776, -0.7948405146598816, 0.07090689241886139, 0.4162536859512329, -0.4184775650501251, 0.260531753301620...
anonymous classes are appropriate here - I'm relatively new to this specific nook of the C# language. UPDATE: I have to thank Jason for the key to solving this. Below is the revised code that will create a list of anonymous class instances, filling the fields of each instance from a query. ``` public List<T> Retur...
[ 0.0858919769525528, -0.22900427877902985, 0.3159017264842987, 0.1709461361169815, -0.07173966616392136, 0.01835290901362896, 0.37442928552627563, -0.23901061713695526, -0.013411647640168667, -0.5959113836288452, -0.0738200768828392, 0.6531727313995361, -0.3193134367465973, 0.00995362084358...
while (nwReader.Read()) { int objIdx = 0; object[] objArray = new object[properties.Count]; foreach (PropertyDescriptor info in properties) objArray[objIdx++] = nwReader[info.Name]; fdList.Add((T)Activator.CreateInstance(sample.GetType(), objArray)); ...
[ 0.026378821581602097, -0.32138049602508545, 0.42548665404319763, -0.08780047297477722, -0.06432697921991348, 0.2728517949581146, 0.5066083669662476, -0.5309736132621765, -0.12818174064159393, -0.5993564128875732, -0.22713692486286163, 0.1788661777973175, -0.3921752870082855, 0.338814496994...
nwReader.Close(); return fdList; } ``` Note that the query has been constructed and the parameters initialized in previous calls to this object's methods. The original code had an inner/outer loop combination so that the user could have fields in their anonymous class that didn't match a field. However, in ...
[ 0.23906226456165314, -0.15714217722415924, -0.15034019947052002, 0.158419668674469, -0.35964104533195496, 0.015653900802135468, 0.41072800755500793, -0.32371780276298523, 0.011393269523978233, -0.6655372977256775, 0.21031402051448822, 0.39367979764938354, -0.32871368527412415, 0.2997735440...
encapsulate a set of *read-only* properties. This explains 1. Why `Type.GetFields` returns an empty array when called on your anonymous type: anonymous types do not have public fields. 2. The public properties on an anonymous type are read-only and can not have their value set by a call to `PropertyInfo.SetValue`. If ...
[ 0.2883439064025879, -0.1569606512784958, 0.07533998787403107, 0.0919242575764656, -0.17311404645442963, -0.2360921949148178, 0.4032852351665497, -0.43415868282318115, -0.10457714647054672, -0.4879533648490906, -0.10271400213241577, 0.45193520188331604, -0.4914707541465759, 0.44328162074089...
problem? T obj = (T)FormatterServices.GetUninitializedObject(typeof(T)); foreach (PropertyDescriptor info in properties) { for (int i = 0; i < nwReader.FieldCount; i++) { if (info.Name == nwReader.GetName(i)) { // This loop runs fine but there is no change to obj!! ...
[ 0.013806858099997044, -0.3434838056564331, 0.670939564704895, -0.1317097395658493, 0.1983787566423416, 0.21433956921100616, 0.5959814190864563, -0.38383999466896057, -0.18025848269462585, -0.7135776877403259, -0.2469210922718048, 0.6250460147857666, -0.33251774311065674, 0.2324155271053314...
break; } } } fdList.Add(obj); } ``` to ``` PropertyInfo[] properties = sample.GetType().GetProperties(); while (nwReader.Read()) { // No way to create a constructor so this call creates the object without calling a ctor. Could this be a source of the problem? T obj = (T)FormatterS...
[ 0.19688917696475983, -0.1654328852891922, 0.32937273383140564, -0.13995206356048584, 0.3060927987098694, -0.0751771628856659, 0.43525585532188416, -0.47937554121017456, -0.2040257304906845, -0.4901714026927948, -0.348417192697525, 0.5603147149085999, -0.3676806390285492, 0.4026750922203064...
i < nwReader.FieldCount; i++) { if (info.Name == nwReader.GetName(i)) { // This loop will throw an exception as PropertyInfo.GetSetMethod fails info.SetValue(obj, nwReader[i], null); break; } }
[ 0.19185863435268402, -0.34614452719688416, 0.3310934603214264, -0.0962102934718132, 0.1238243356347084, 0.07925085723400116, 0.7908785939216614, -0.5125851035118103, 0.013292606920003891, -0.6382561922073364, -0.12746329605579376, 0.3567901849746704, -0.31366220116615295, 0.299823254346847...
} fdList.Add(obj); } ``` you will receive an exception informing you that the property set method can not be found. Now, to solve your problem, what you can do is use `Activator.CreateInstance`. I'm sorry that I'm too lazy to type out the code for you, but the following will demonstrate how to use it. ``` var c...
[ 0.3888493478298187, 0.14448584616184235, 0.34206724166870117, -0.07604485005140305, 0.16147111356258392, 0.1356450617313385, 0.09303811192512512, -0.40404340624809265, -0.048092491924762726, -0.36841389536857605, 0.033281028270721436, 0.7492954134941101, 0.0024178214371204376, 0.3212161958...
`Activator.CreateInstance` and then call `Activator.CreateInstance` when the loop is done. Property order is important here as two anonymous types are the same if and only if they have the same number of properties with the same type and same name in the same order. For more, see the [MSDN page](http://msdn.microsoft....
[ 0.07503475248813629, -0.30654293298721313, 0.31865379214286804, 0.05884164571762085, -0.2588193118572235, -0.18969401717185974, 0.2718142867088318, -0.6435278654098511, -0.0421379916369915, -0.6923693418502808, -0.10661014169454575, 0.38864853978157043, -0.4054625630378723, 0.3594248890876...
// This loop runs fine but there is no change to obj!! info.SetValue(obj, nwReader[i]); break; } } } ``` could be simplified by ``` foreach (PropertyDescriptor info in properties) { info.SetValue(obj, nwReader[info.Name]); } ```
[ 0.1593051552772522, -0.13067562878131866, 0.5397171974182129, -0.09389718621969223, 0.11629392951726913, -0.16605782508850098, 0.4448331296443939, -0.23343776166439056, -0.16757440567016602, -0.8533273339271545, -0.3761119544506073, 0.3800787925720215, -0.29018571972846985, 0.1784645467996...
I'm building a PHP application using CodeIgniter. It is similar to `Let Me Google That For You` where you write a sentence into a text input box, click submit, and you are taken to a URL that displays the result. I wanted the URL to be human-editable, and relatively simple. I've gotten around the CodeIgniter URL routin...
[ 0.226190984249115, 0.26471996307373047, 0.3783377408981323, -0.05498271808028221, -0.18034033477306366, -0.28316453099250793, 0.3539164364337921, 0.022552896291017532, -0.0045575969852507114, -0.5731204748153687, -0.03735587000846863, 0.27824515104293823, -0.3082742989063263, 0.14482420682...
the character is encoded. ``` http://website.com/?q=this+is+a+normal+url? OR http://website.com/?q=this+is+a+normal+url%3F ``` What does work is double-encoding. For example, if I take the question mark, and encode it to `%253F` (where the ? is encoded to %3F and the % sign is encoded to %25). This url works properl...
[ 0.06706634163856506, 0.3965027928352356, 0.42280179262161255, -0.2777307331562042, -0.15224719047546387, 0.38574734330177307, 0.3287917971611023, -0.3689686954021454, 0.06134871765971184, -0.6922060251235962, -0.2337207794189453, 0.31610673666000366, -0.2908374071121216, -0.527977466583252...
have a `index/application/function/parameter` URL setup. I'm feeding the function the full query string right now. If your’re using Apache 2.2 and later, you can use the [B flag](http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriteflags) to force the backreference to be escaped: ``` RewriteCond %{QUERY_STRING...
[ 0.2260306477546692, 0.09613999724388123, 0.5974352955818176, -0.06025145575404167, -0.05024617910385132, -0.21681691706180573, 0.43590614199638367, -0.48122522234916687, -0.1418876051902771, -0.28141698241233826, -0.2602662444114685, 0.5750100612640381, -0.4569057822227478, 0.2941958904266...
I want to create a file using C++, but I have no idea how to do it. For example I want to create a text file named `Hello.txt`. Can anyone help me? One way to do this is to create an instance of the ofstream class, and use it to write to your file. Here's a link to a website that has some example code, and some more ...
[ 0.2538755536079407, 0.3024633526802063, 0.40055394172668457, -0.12043274194002151, -0.03361533209681511, -0.13399352133274078, 0.17839613556861877, -0.14414401352405548, 0.1417570263147354, -0.6917216777801514, 0.01623607985675335, 0.548914909362793, -0.33066096901893616, -0.09057864546775...
to use std::endl to end your lines. An alternative is using '\n' character. These two things are different, std::endl flushes the buffer and writes your output immediately while '\n' allows the outfile to put all of your output into a buffer and maybe write it later.
[ -0.08913315087556839, -0.31891465187072754, 0.48639097809791565, -0.1545129418373108, -0.048356980085372925, 0.04663858190178871, 0.21626530587673187, 0.08339085429906845, -0.06730394810438156, -0.5216279625892639, -0.28856411576271057, 0.12873366475105286, -0.30972009897232056, 0.11963757...
I see the term 'octet' popping up in literature about nonces for hashing, and it seems to be synonymous with 'character', although there *is* a kind of pattern to how the words are used. This leads me to believe that there is a formal distinction between the two. If anyone could enlighten me to what it is, I'd appreci...
[ 0.03499568998813629, -0.042805783450603485, 0.026402881368994713, 0.17412082850933075, -0.25217169523239136, 0.18924866616725922, 0.015733318403363228, 0.19780494272708893, -0.3495648503303528, -0.6870076656341553, -0.2695631980895996, 0.14247742295265198, -0.24316184222698212, -0.16368192...
is often used to be synonymous with a single-byte (non-unicode) character. Octet in this instance means eight bits. A character can be eight or sixteen or even more bits, but an octet is always eight bits.
[ -0.10774541646242142, -0.0289372019469738, -0.10228368639945984, 0.029500560835003853, -0.013301023282110691, 0.63835608959198, 0.005700721405446529, -0.18000321090221405, -0.45515307784080505, 0.05047999694943428, -0.4475785493850708, -0.03580080345273018, -0.2130124419927597, -0.11558754...
The general advice is that you should not call `GC.Collect` from your code, but what are the exceptions to this rule? I can only think of a few very specific cases where it may make sense to force a garbage collection. One example that springs to mind is a service, that wakes up at intervals, performs some task, and ...
[ 0.6378299593925476, -0.3475401997566223, 0.08916732668876648, 0.1350444108247757, 0.07247533649206161, -0.36497488617897034, -0.029321014881134033, 0.19432693719863892, -0.5931356549263, -0.39763161540031433, -0.21708208322525024, 0.5184935927391052, -0.2417333573102951, 0.1973009109497070...
you have good reason to believe that a significant set of objects - particularly those you suspect to be in generations 1 and 2 - are now eligible for garbage collection, and that now would be an appropriate time to collect in terms of the small performance hit. A good example of this is if you've just closed a large ...
[ -0.16378267109394073, -0.2632889747619629, 1.0739024877548218, 0.06995351612567902, 0.05315382406115532, -0.6940302848815918, 0.008574547246098518, 0.029214171692728996, -0.466687947511673, -0.8621550798416138, -0.8482397198677063, 0.5857571959495544, -0.2326669543981552, 0.307122856378555...
entering and leaving either of these modes, it is recommended that you force a full GC with `GC.Collect(2, GCCollectionMode.Forced)`. As of .NET 4.6 - there is the `GC.TryStartNoGCRegion` method (used to set the read-only value `GCLatencyMode.NoGCRegion`). This can itself, perform a full blocking garbage collection in...
[ -0.13680464029312134, -0.26392117142677307, 0.6045954823493958, 0.024585381150245667, 0.02992486208677292, -0.4036775529384613, 0.1613968461751938, -0.13062703609466553, -0.2853114902973175, -0.41038423776626587, -0.5162605047225952, 0.5415393710136414, -0.4402177035808563, -0.048856433480...
I have a canvas with user controls arranged on it. When a tooltip is assigned to the usercontrol or one of its children, that tooltip does not show (open event does not get fired either). I do not explicitly disable any of them. I've placed plenty of tooltips elsewhere in the application and they all show, except the ...
[ 0.20608116686344147, -0.0061140116304159164, 0.3614918887615204, -0.07819818705320358, -0.14293037354946136, 0.24519583582878113, -0.2401164174079895, -0.18977440893650055, -0.28297680616378784, -0.9689152240753174, 0.16041254997253418, 0.16883423924446106, -0.29659661650657654, 0.05668555...
and vertical to show on the grid where I am and the values on the left/bottom), it turns out that when the hit test was being performed, it was hitting those lines and stopping. By setting IsHitTestVisible to false on all unrelevant geometry, my tooltip now shows properly. The reason I was seeing the mouse enter/leave...
[ -0.2397778183221817, -0.05606665462255478, 0.7065389156341553, -0.12074015289545059, -0.17747509479522705, 0.11680607497692108, 0.2817741632461548, -0.31910791993141174, -0.16624870896339417, -0.4840514659881592, 0.23874370753765106, 0.3736197352409363, -0.12645532190799713, 0.121332526206...
Anyone knows how to compile a vb6 webclass dll from a command line? I am trying to build a tool for automating version building, but it fails with an 'Compile Error in File '[file name]', Line xxxx : Variable not defined' alert displayed. [Known bug](http://support.microsoft.com/kb/190165): > ### SYMPTOMS > > > When...
[ 0.410828173160553, 0.2390405684709549, 0.1650170236825943, 0.07917190343141556, -0.05050700530409813, -0.2514387369155884, 0.6173495650291443, 0.04447786882519722, -0.23281100392341614, -0.6604069471359253, 0.013729248195886612, 0.5974614024162292, -0.011448866687715054, 0.2295090109109878...
same directory as the .DSR files, you may encounter errors during the compiling. The .DCA files contain type library information that is necessary to compile the project. > > > ### RESOLUTION > > > Use one of the following workarounds to compile the project without errors: > > > * Open the project in Visual Basic...
[ 0.27372902631759644, 0.14643792808055878, 0.3144131600856781, 0.15325115621089935, -0.035613153129816055, -0.11918757110834122, 0.43884336948394775, -0.2892070710659027, -0.03960363194346428, -0.8488167524337769, -0.41662564873695374, 0.5454264283180237, -0.25494104623794556, 0.13696120679...
files are located. > * Compile the application inside of the Visual Basic Integrated Development Environment (IDE). This also rebuilds the .DCA files for the application. > > > ### STATUS > > > Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article...
[ 0.2770463228225708, 0.2714938819408417, 0.12235554307699203, 0.21506386995315552, 0.235218808054924, -0.41068798303604126, 0.2801611125469208, -0.0053281220607459545, 0.18108363449573517, -0.6890990138053894, -0.38843050599098206, 0.38206565380096436, -0.20957046747207642, 0.14604136347770...
I've singled out a failure on my program that prevents me from assigning a value to the variable `addAntonymAnswer1`. I've tried running `cin.clear()` before the statement to get the thing read my `yes/no` answer, but the code just won't respond. The program bit that's failing is located inside `void dictionaryMenu(v...
[ 0.22715629637241364, 0.286411315202713, 0.24530191719532013, -0.13324710726737976, 0.18988904356956482, 0.16982868313789368, 0.30008748173713684, -0.13484862446784973, -0.020703397691249847, -0.17840616405010223, -0.13458073139190674, 0.646247923374176, -0.24032653868198395, 0.387190967798...
of the program the user has to choose to add a word, and then add a synonym. The input for running the program is: ``` dictionary.txt 1 cute 2 hello 3 ugly 4 easy 5 difficult 6 tired 7 beautiful synonyms 1 7 7 1 3 2 antonyms 1 3 3 1 7 4 5 5 4 7 3 ``` --- ``` #include <iostream> #include <fstream> #include <string>...
[ 0.09830252081155777, 0.07450955361127853, 0.6555766463279724, -0.2947409451007843, 0.13111217319965363, 0.2382717877626419, 0.21724514663219452, -0.025936167687177658, 0.10935188829898834, -0.6797457337379456, -0.24493934214115143, 0.5003316402435303, -0.5260547399520874, -0.03042730130255...
word=newWord; } ~WordInfo() { } int id() const {return myId;} void readWords(istream &in) {
[ -0.2240629494190216, -0.22572548687458038, 0.37566009163856506, -0.35765376687049866, 0.174058735370636, 0.14533253014087677, 0.4941222071647644, -0.27423912286758423, 0.1614222228527069, -0.9636707901954651, -0.3753882348537445, 0.6249176859855652, -0.2749581038951874, 0.3032895028591156,...
in>>myId>>word; } vector <int> & getSynonyms () { return mySynonyms; } vector <int> & getAntonyms() {
[ -0.18279482424259186, -0.2667746841907501, 0.3332783579826355, 0.0730237364768982, 0.13379625976085663, 0.5437483191490173, 0.3470367193222046, -0.05400002747774124, -0.12887758016586304, -0.9817290306091309, -0.544567346572876, 0.38322046399116516, -0.23240497708320618, 0.1664264500141143...
return myAntonyms; } string getWord() { return word; } void dictionaryMenu (vector <WordInfo> &wordInfoVector){
[ -0.11694538593292236, -0.2593327462673187, 0.4263918399810791, -0.23155470192432404, 0.17043384909629822, 0.2595917284488678, 0.3770782947540283, 0.030402319505810738, 0.1226656436920166, -0.7884978652000427, -0.3448250889778137, 0.9373717904090881, -0.21224947273731232, 0.2142896205186844...
cout<<endl<<"Would you like to add a word?"<<endl; cout<<"(yes/no)"<<endl; cout<<">"; string addWordAnswer; cin>>addWordAnswer; if (addWordAnswer=="yes") // case if the guy wants to add a word {
[ -0.09478094428777695, 0.019931625574827194, 0.46215078234672546, -0.31237736344337463, 0.22967442870140076, 0.019856225699186325, -0.08267127722501755, -0.007106544449925423, 0.20051252841949463, -0.377117782831192, -0.4554947018623352, 0.366828590631485, -0.5114426016807556, -0.0216804314...
cout<<endl; cout<<"Please, write the word "<<endl; string newWord; cout<<">"; cin>>newWord;
[ -0.45874732732772827, 0.09084102511405945, 0.5983095765113831, -0.41747167706489563, -0.007795979734510183, 0.06505560129880905, -0.00013101025251671672, 0.20744504034519196, 0.16435611248016357, -0.7911126613616943, -0.8059185147285461, 0.4225371778011322, -0.4612540006637573, 0.054511774...
cout<<endl; WordInfo newWordInfo (newWord); int newWordId = wordInfoVector.size() +1; newWordInfo.myId=newWordId; cout<<"The id of "<<newWordInfo.word<<" is "<<newWordInfo.myId<<endl<<endl; wordInfoVector.push_back(newWordInfo); cout<<"Would yo...
[ -0.4359469413757324, -0.2088613212108612, 0.672599196434021, -0.4223921298980713, 0.20624619722366333, 0.2696141302585602, 0.0726713240146637, -0.137598916888237, 0.046879589557647705, -0.8477424383163452, -0.7163581848144531, 0.3329349756240845, -0.36813056468963623, -0.03465703874826431,...
<<"synonyms of "<<newWordInfo.word<<"?"<<endl; cout<<"(yes/no)"<<endl; string addSynonymAnswer, addAntonymAnswer1, addAntonymAnswer2; cout<<">"; cin>>addSynonymAnswer; if (addSynonymAnswer=="yes") { cout<<endl; cout<<"Please write...
[ -0.22448694705963135, -0.030249742791056633, 0.3306455910205841, -0.07187534123659134, 0.1605919748544693, 0.16568057239055634, 0.07648444175720215, -0.017902271822094917, -0.12505057454109192, -0.4726138114929199, -0.6276177763938904, 0.5712070465087891, -0.23871538043022156, 0.0866077244...
single line the ids for the synonyms of " <<newWordInfo.word<<endl<<"starting with its id, which is "<<newWordInfo.myId<<endl<<endl; cout<<"For example, to define that the synonym of the word 'cute', which has an id 1, is" <<"'beautiful', which has an id 7, you should write: 1 7"<<...
[ -0.20260515809059143, -0.19898277521133423, 0.4396650493144989, 0.07811899483203888, -0.28818637132644653, 0.16909565031528473, 0.3481527268886566, 0.18430715799331665, 0.06567887216806412, -0.6307907104492188, -0.6540040969848633, 0.005720881745219231, -0.34924694895744324, 0.175841584801...
cin.clear(); string lineOfSyns; cout<<">"; cin>>lineOfSyns; newWordInfo.pushSynonyms(lineOfSyns, wordInfoVector); cin.clear(); cout<<"Would you like to define
[ -0.13906548917293549, -0.4157094657421112, 0.589265763759613, -0.2254643589258194, 0.2403443306684494, 0.14397068321704865, 0.061867501586675644, 0.032867275178432465, 0.03977319225668907, -0.6245234608650208, -0.6631216406822205, 0.3336202800273895, -0.5393269658088684, -0.001378185697831...
which words on the existing dictionary are" <<endl <<"antonyms of "<<newWordInfo.word<<"?"<<endl; //##HERE THE CIN READING OF addAntonymAnswer1 FAILS, WHY? cin.clear(); cout<<">";
[ -0.03549930080771446, -0.09357791393995285, 0.4850621521472931, -0.2594405710697174, 0.12895259261131287, -0.005678318906575441, 0.08383040130138397, 0.020975105464458466, 0.04250815510749817, -0.3071656823158264, -0.35861489176750183, 0.6475915908813477, -0.22818191349506378, -0.014223570...
cin>>addAntonymAnswer1; // cin reading STUCK, why!? if (addAntonymAnswer1=="yes"){ } else if (addAntonymAnswer1=="no"){
[ 0.26069703698158264, -0.24627083539962769, 0.2511790692806244, 0.1951339691877365, 0.14907780289649963, 0.04914703965187073, -0.10308487713336945, -0.07021082937717438, -0.21068237721920013, -0.24778050184249878, -0.14553821086883545, 0.5379653573036194, -0.28110677003860474, 0.31551250815...
// END DICTIONARY MENU } } else if (addSynonymAnswer=="no"){
[ -0.031047116965055466, -0.007286406122148037, 0.25237974524497986, -0.2840569019317627, 0.14767836034297943, -0.03099079616367817, 0.4020324945449829, 0.11977732926607132, 0.13897280395030975, -0.5769054889678955, -0.28740179538726807, 0.8168944120407104, -0.016256438568234444, 0.079478681...
cout<<"Would you like to define which words on the existing dictionary are" <<endl <<"antonyms of "<<newWordInfo.word<<"?"<<endl; cout<<">"; cin>>addAntonymAnswer2; if (addAntonymAnswer2=="yes"){ }
[ -0.2692769765853882, -0.06797365099191666, 0.44869062304496765, -0.19452017545700073, 0.31324130296707153, 0.22735488414764404, -0.142608642578125, 0.03970390185713768, 0.1637275218963623, -0.5159859657287598, -0.460745632648468, 0.5217650532722473, -0.25512149930000305, 0.0233701430261135...
else if (addAntonymAnswer2=="no"){ // END DICTIONARY MENU }
[ -0.19145812094211578, -0.04659629613161087, 0.0848584845662117, -0.3332486152648926, 0.1992153525352478, -0.10399088263511658, 0.13949890434741974, -0.05996327102184296, 0.4527910053730011, -0.36507922410964966, -0.34124308824539185, 0.9596942663192749, -0.011203615926206112, -0.1418798565...
} } // if addWordAnswer == "no" else if (addWordAnswer=="no"){ // ######RETURN TO MAIN MENU############ } } void
[ -0.19432394206523895, -0.1304280012845993, 0.23194974660873413, -0.4061615467071533, 0.3225271701812744, 0.016950096935033798, 0.24065983295440674, 0.0864168256521225, 0.19193555414676666, -0.407964825630188, -0.3986259400844574, 0.7486166954040527, -0.3328087031841278, 0.1692482829093933,...
pushSynonyms (string synline, vector<WordInfo> &wordInfoVector){ stringstream synstream(synline); vector<int> synsAux; // synsAux tiene la línea de sinónimos int num; while (synstream >> num) {synsAux.push_back(num);} int wordInfoVector...
[ -0.26678743958473206, -0.6771219968795776, 0.6867682933807373, -0.24882842600345612, -0.07776045054197311, 0.4953545928001404, -0.08346157521009445, 0.08648373186588287, 0.016758693382143974, -0.6615902185440063, -0.46313580870628357, 0.1973334401845932, -0.3647848665714264, 0.014663620851...
int synsAuxCopyIndex; if (synsAux.size()>=2){ // takes away the runtime Error for (wordInfoVectorIndex=0; wordInfoVectorIndex <wordInfoVector.size(); wordInfoVectorIndex++) { if (synsAux[0]==wordInfoVector[wordInfoVectorIndex].id()){ // thi...
[ -0.3843657076358795, -0.16384674608707428, 0.4521162509918213, -0.2972297668457031, 0.19659456610679626, 0.17742383480072021, 0.38423851132392883, -0.2941403090953827, 0.2268790900707245, -0.7851145267486572, -0.2567763030529022, 0.6833316087722778, -0.3575882315635681, -0.0158129706978797...
is the line that's generating a Runtime Error, Why? for (synsAuxCopyIndex=1; synsAuxCopyIndex<synsAux.size(); synsAuxCopyIndex++){
[ -0.13876987993717194, -0.3355538249015808, 0.11188104003667831, -0.125662699341774, 0.2404855638742447, 0.2090476155281067, 0.28344738483428955, -0.1796995848417282, 0.03401017189025879, -0.3581741750240326, -0.15309572219848633, 0.3420189619064331, -0.6248758435249329, 0.07350415736436844...
// won't run yet wordInfoVector[wordInfoVectorIndex].mySynonyms.push_back(synsAux[synsAuxCopyIndex]); }
[ -0.07819713652133942, -0.2268725037574768, 0.41525137424468994, -0.29067370295524597, 0.47010329365730286, 0.21885335445404053, 0.5188083648681641, 0.27892929315567017, 0.19608871638774872, -0.7816957235336304, -0.4078899323940277, 0.3328767418861389, -0.08236552029848099, 0.20492009818553...
} } }// end if size()>=2 } // end pushSynonyms
[ -0.18667976558208466, -0.3886988162994385, 0.3160603642463684, -0.39417001605033875, 0.2348335236310959, 0.031417857855558395, 0.1433134227991104, -0.4608331024646759, -0.059807877987623215, -0.6650159358978271, -0.23784127831459045, 0.28902438282966614, -0.48918968439102173, 0.07685218751...
void pushAntonyms (string antline, vector <WordInfo> &wordInfoVector) { stringstream antstream(antline); vector<int> antsAux; int num; while (antstream >> num) antsAux.push_back(num); int wordInfoVectorIndex;
[ -0.11119738221168518, -0.6220728158950806, 0.604389488697052, -0.5365645289421082, -0.07557887583971024, 0.5102962851524353, 0.250262975692749, -0.3133363425731659, -0.05465654656291008, -0.6826536059379578, -0.398303359746933, 0.40175679326057434, -0.4130343794822693, 0.031551674008369446...
int antsAuxCopyIndex; if (antsAux.size()>=2){ // takes away the runtime Error for (wordInfoVectorIndex=0; wordInfoVectorIndex <wordInfoVector.size(); wordInfoVectorIndex++) { if (antsAux[0]==wordInfoVector[wordInfoVectorIndex].id()){
[ -0.39455530047416687, -0.11416002362966537, 0.20991690456867218, -0.3214271068572998, -0.07615727931261063, 0.3342871367931366, 0.6866844296455383, -0.20579950511455536, -0.21414843201637268, -0.7179843187332153, -0.10871017724275589, 0.4430682063102722, -0.5084642767906189, -0.12797725200...
// this is the line that's generating a Runtime Error, Why? for (antsAuxCopyIndex=1; antsAuxCopyIndex<antsAux.size(); antsAuxCopyIndex++){
[ -0.1638217568397522, -0.27597200870513916, -0.12762753665447235, -0.1745263785123825, 0.09815739840269089, 0.22894376516342163, 0.6629733443260193, -0.1500796377658844, -0.3183405101299286, -0.42610278725624084, -0.013427447527647018, 0.2471328228712082, -0.6594646573066711, -0.02437278255...
// won't run yet wordInfoVector[wordInfoVectorIndex].myAntonyms.push_back(antsAux[antsAuxCopyIndex]); }
[ -0.1361667811870575, -0.1826239377260208, 0.31977206468582153, -0.3110402524471283, 0.27169445157051086, 0.3134813606739044, 0.6613388061523438, 0.22993730008602142, -0.05936502292752266, -0.6428003907203674, -0.26595577597618103, 0.4002355933189392, -0.12126897275447845, 0.134252920746803...
} } }// end if size()>=2 }
[ -0.13533814251422882, -0.07380008697509766, 0.4174220860004425, -0.36606359481811523, 0.2850383520126343, -0.19080699980258942, 0.2221025973558426, -0.2537124454975128, -0.10916890949010849, -0.4008368253707886, -0.2603623569011688, 0.5684314370155334, -0.23741020262241364, 0.1140227839350...
//--dictionary output function void printWords (ostream &out) { out<<myId<< " "<<word; } //--equals operator for String
[ -0.30194026231765747, 0.03895369917154312, 0.5423353314399719, -0.3427588939666748, 0.04724692925810814, 0.5186712145805359, 0.1255067139863968, -0.07660287618637085, 0.21259017288684845, -0.5802823305130005, -0.10724145174026489, 0.6580658555030823, -0.3465816080570221, -0.065352603793144...
bool operator == (const string &aString)const { return word ==aString; } //--less than operator bool operator <(const
[ -0.2928963303565979, -0.3009604215621948, 0.263055682182312, -0.3337785005569458, -0.06353837996721268, 0.03802093118429184, 0.6364026665687561, -0.2947031557559967, 0.15499715507030487, -0.2824721932411194, -0.29607439041137695, 0.7474469542503357, -0.315510630607605, -0.0570603646337986,...
WordInfo &otherWordInfo) const { return word<otherWordInfo.word;} //--more than operator bool operator > (const WordInfo &otherWordInfo)const {return word>otherWordInfo.word;} public: vector<int> mySynonyms;
[ -0.12889929115772247, -0.23518793284893036, 0.4794243574142456, -0.19167183339595795, 0.16461783647537231, -0.04697166755795479, 0.2835482358932495, -0.28878089785575867, 0.0475786067545414, -0.7511503100395203, -0.5661672949790955, 0.6717301607131958, -0.4864124655723572, 0.07331060618162...
vector <int> myAntonyms; string word; int myId; }; //--Definition of input operator for WordInfo istream & operator >>(istream &in, WordInfo &word) {
[ -0.32341861724853516, -0.3890193700790405, 0.4891928732395172, -0.01796216145157814, 0.0021137725561857224, 0.6853604316711426, 0.1438176929950714, -0.07779509574174881, -0.15545232594013214, -0.8165741562843323, -0.2594241797924042, 0.7320501804351807, -0.3638952374458313, 0.0096109816804...
word.readWords(in); } //--Definition of output operator ostream & operator <<(ostream &out, WordInfo &word) { word.printWords(out); } int main() { string wordFile; cout<<"enter name of dictionary file: "<<endl; getline
[ -0.33972787857055664, -0.22631283104419708, 0.5957056879997253, -0.48819735646247864, 0.30066993832588196, 0.3312050402164459, 0.236627995967865, -0.04778362810611725, 0.0910646840929985, -0.8466148376464844, -0.4729142189025879, 0.6388663649559021, -0.35294073820114136, 0.2279366701841354...
(cin,wordFile); ifstream inStream (wordFile.data()); if(!inStream.is_open()) { cerr<<"cannot open "<<wordFile<<endl; exit(1); } vector <WordInfo> wordInfoVector;
[ -0.2432233691215515, -0.3953841030597687, 0.6938703656196594, -0.35745421051979065, 0.14418862760066986, 0.19448113441467285, 0.28743669390678406, 0.09888074547052383, -0.045549482107162476, -0.8553538918495178, -0.5520407557487488, 0.510270893573761, -0.47279152274131775, 0.39525544643402...
WordInfo aword; while (inStream >>aword && (!(aword=="synonyms"))) { wordInfoVector.push_back(aword); } inStream.clear(); vector <int> intVector; string synLine;
[ -0.23154014348983765, -0.6484745740890503, 0.6888669729232788, -0.38872286677360535, 0.08677705377340317, 0.4055350720882416, 0.48002344369888306, -0.023513609543442726, 0.2619074881076813, -0.7289456725120544, -0.6356115937232971, 0.6184027194976807, -0.4302140474319458, 0.159337416291236...
while (getline(inStream, synLine)&&(synLine!=("antonyms"))){ aword.pushSynonyms(synLine, wordInfoVector); } int theIndex; string antLine; while (getline(inStream,antLine)){ aword.pushAntonyms(antLine, wordInfoVector);
[ -0.0860765278339386, -0.6225089430809021, 0.4871898889541626, -0.42097699642181396, 0.10246876627206802, 0.5703572630882263, 0.4878287613391876, -0.08016414195299149, 0.2489071786403656, -0.5954027771949768, -0.545692503452301, 0.3685394823551178, -0.363057941198349, 0.07503975927829742, ...
} cout<<endl<<"the words on the dictionary are: "<<endl; int h=0; while (h<wordInfoVector.size()){ cout<<wordInfoVector[h]<<endl; h++;
[ -0.32646846771240234, 0.109135702252388, 0.7480114698410034, -0.44997501373291016, 0.16103848814964294, 0.11581262946128845, 0.13822561502456665, -0.034058984369039536, 0.283819317817688, -0.6055041551589966, -0.7433209419250488, 0.46880412101745605, -0.33711692690849304, -0.04819811508059...
} aword.dictionaryMenu(wordInfoVector); system("PAUSE"); return 0; } ``` `cin.clear()` doesn't clear the standard input. What it does is clearing error bits, like `eofbit`, `failbit` and others, and sets the stream into a good state. Maybe you expected it to clear out anything in...
[ -0.1109003946185112, -0.10573402047157288, 0.23485025763511658, -0.1555367112159729, 0.2823762893676758, -0.009118781425058842, 0.5953985452651978, 0.2168540507555008, 0.13999132812023163, -0.3392796218395233, -0.32882624864578247, 0.7033737301826477, -0.17513029277324677, 0.13962709903717...
contain ``` no ``` The call to `clear` then clears any error bits being active. Then, your ``` cin>>addAntonymAnswer1; ``` Will read the `no` that wasn't eaten by the previous read, and the action immediately returns, not waiting for new input. What you should do is doing a `clear` followed by an ignore, up to...
[ 0.000613522483035922, 0.0483742281794548, 0.37505486607551575, -0.18019676208496094, 0.3252579867839813, -0.10583699494600296, -0.0011863738764077425, -0.09766682237386703, -0.2312333583831787, -0.40023180842399597, -0.5031176209449768, 0.5750144720077515, -0.4795553386211395, 0.1330727785...
>>` followed by a `getline`: The cin will leave any whitespace (also newlines) after its read token, but `getline` will stop reading after it hits such a newline. I see you have put `clear` after nearly everything. So i want to show you when you need it and when not. You don't need it when you sequence multiple `cin >>...
[ 0.041244588792324066, -0.16209472715854645, 0.5442618131637573, -0.4502994418144226, 0.10860161483287811, -0.0944182500243187, 0.04912266880273819, -0.07340556383132935, -0.2017904669046402, -0.8066246509552002, -0.4896868169307709, 0.17832863330841064, -0.5112380385398865, 0.0280758049339...
skip all whitespace and newlines, so that it can cope with `\n` being at the front of `bar`. Now, you can also sequence multiple `getline` calls: ``` getline(cin, a); getline(cin, b); ``` Getline will throw away the `\n` that it reads at the line end, but won't ignore newlines or whitespace at the begin. So, after t...
[ -0.0622357502579689, -0.04813982546329498, 0.4206084609031677, -0.4340040981769562, 0.024848708882927895, 0.09912799298763275, 0.2436690628528595, -0.034494731575250626, -0.24603115022182465, -0.531646192073822, -0.6082184910774231, 0.310659259557724, -0.6094066500663757, 0.157559037208557...
it read an empty line. Thus, it will immediately continue and not wait for anything, leaving the stream as "bar\n". So, if you have a `getline` after a `cin>>` you should first execute the clear/ignore sequence, to clear out the newline. But between `getline` or `cin>>`'s, you should not do it.
[ -0.0836922749876976, -0.2544448971748352, 0.565560519695282, -0.37702158093452454, 0.05185727775096893, -0.2277699112892151, 0.28213730454444885, 0.14680637419223785, -0.05955849960446358, -0.40771353244781494, -0.49565503001213074, 0.2043571174144745, -0.45386847853660583, 0.2202831804752...
What tools or techniques can I use to remove cached file contents to prevent my performance results from being skewed? I believe I need to either completely clear, or selectively remove cached information about file and directory contents. The application that I'm developing is a specialised compression utility, and i...
[ 0.19528214633464813, 0.3626798987388611, 0.02305210568010807, 0.13733704388141632, 0.21491093933582306, -0.13950611650943756, -0.1044803187251091, -0.06322438269853592, -0.13369403779506683, -0.7681214809417725, -0.19989252090454102, 0.7331234216690063, 0.12854614853858948, 0.1535243690013...
work. I'm primarily interested in solutions for Windows XP, as that is my main development machine, but I can also test using linux, and so am interested in answers for that environment too. I tried SysInternals [CacheSet](http://technet.microsoft.com/en-us/sysinternals/bb897561.aspx), but clicking "Clear" doesn't re...
[ 0.2592322826385498, 0.008547376841306686, 0.500920295715332, -0.016469281166791916, 0.18773093819618225, -0.16013024747371674, 0.4171973466873169, -0.015370388515293598, -0.47743749618530273, -0.7595222592353821, -0.39603346586227417, 0.6246559619903564, -0.014703109860420227, 0.0028543509...
It is possible to add and remove elements from an enum in Java at runtime? For example, could I read in the labels and constructor arguments of an enum from a file? --- @saua, it's just a question of whether it can be done out of interest really. I was hoping there'd be some neat way of altering the running bytecode...
[ 0.5992113947868347, 0.17969492077827454, -0.11252141743898392, -0.13042280077934265, 0.025361374020576477, -0.13897867500782013, 0.043292708694934845, -0.20573580265045166, -0.43623828887939453, -0.4095034599304199, 0.0844489187002182, -0.02286142110824585, 0.035270728170871735, 0.02400115...
an enum if I want to be able to alter the contents safely at runtime. No, enums are supposed to be a complete static enumeration. At compile time, you might want to generate your enum .java file from another source file of some sort. You could even create a .class file like this. In some cases you might want a set of...
[ 0.3093525171279907, -0.21707318723201752, 0.1274992972612381, 0.2777450382709503, 0.014228601939976215, -0.3157714605331421, -0.11172844469547272, -0.1377936601638794, -0.2286628931760788, -0.8346595764160156, -0.12386021763086319, 0.25746509432792664, -0.38153499364852905, 0.2390660494565...
a reference to the `interface`.
[ 0.03766611963510513, 0.03857387974858284, 0.2361402064561844, -0.003708043834194541, -0.14814718067646027, -0.028904499486088753, 0.041290655732154846, 0.28671836853027344, -0.10500228404998779, -0.30276909470558167, -0.25540152192115784, 0.20074529945850372, -0.11617517471313477, 0.150252...
**What is the most bandwidth efficient way to *unidirectionally* synchronise a list of data from one server to many clients?** I have sizeable chunk of data (perhaps 20,000, 50-byte records) which I need to periodically synchronise to a series of clients over the Internet (perhaps 10,000 clients). Records may added, r...
[ 0.6573922038078308, 0.1548590511083603, 0.5327650904655457, 0.17343778908252716, 0.18337851762771606, 0.2171168476343155, 0.14313755929470062, 0.23560354113578796, -0.7379047870635986, -0.5782811045646667, -0.07439294457435608, 0.3568534553050995, 0.0021430805791169405, 0.12802840769290924...
your clients'? Does the data perhaps compress very readily? For raw binary data it's not uncommon to achieve 50% compression, and if the data happens to have a lot of repeated patterns within it then 80%+ is possible. That said, if you really do need a system that can just transfer the changes, my thoughts are: 1. m...
[ 0.5024012327194214, 0.03303399682044983, 0.416571706533432, -0.11174719780683517, 0.23347343504428864, 0.3793093264102936, 0.05800838768482208, -0.18466974794864655, -0.5419697761535645, -0.6121149063110352, -0.09045227617025375, 0.5823582410812378, -0.06793567538261414, 0.0149006713181734...
so you can calculate the deltas 4. ensure that full downloads are possible too, in case clients get out of sync
[ 0.2737049162387848, -0.34690460562705994, 0.47976669669151306, 0.38582712411880493, 0.19824177026748657, -0.0037237517535686493, 0.3617614209651947, -0.0621679425239563, -0.36457276344299316, -0.6388231515884399, -0.0549309179186821, 0.610224187374115, -0.3756848871707916, -0.1182999983429...
What's going on?! Subtraction works fine until I get to 0.1 - 0.1. I'm in visual c# 2008 using the nonoba.com API. ``` Console.WriteLine("hit! " + Users[targetNum].character.health + " : " + player.character.profile.attackPower); Users[targetNum].character.health -= player.character.profile.attackPower; Console.Writ...
[ 0.11243502795696259, 0.3527213931083679, 0.547905445098877, -0.1949489563703537, -0.2351720631122589, -0.0793137326836586, 0.4132204055786133, -0.1062944158911705, -0.21304543316364288, -0.3798869848251343, -0.009447155520319939, 0.7896231412887573, -0.16751070320606232, 0.0744871795177459...
the recommended reading, I'm going to conclude that my folly was due to normally using the ActionScript Number type, which maybe has a decimal rather than binary floating point - anyway, it would never give this output. That seems pretty normal for floating point math... you always have to check against a small delta t...
[ 0.06811869144439697, 0.07034757733345032, 0.11577225476503372, 0.15604658424854279, -0.06287144124507904, 0.08257872611284256, 0.05128151923418045, 0.2532552480697632, -0.20685449242591858, -0.27584728598594666, 0.17956940829753876, 0.29203346371650696, 0.17272433638572693, 0.2091341763734...
get something very nearly zero. With `decimal` you'll usually get more what you expect intuitively. See also Jon Skeet's pages here: * [Binary floating point](http://csharpindepth.com/Articles/General/FloatingPoint.aspx) * [Decimal floating point](http://csharpindepth.com/Articles/General/Decimal.aspx)
[ -0.04062686115503311, -0.08049094676971436, -0.009985409677028656, 0.44234806299209595, -0.015653997659683228, -0.0015478666173294187, -0.1801772564649582, 0.3295155167579651, -0.47053593397140503, 0.12271341681480408, -0.11253904551267624, 0.10866079479455948, 0.28985580801963806, 0.01804...
Is it possible to create/have a non-modal .net OpenFileDialog I have a UI element in the main dialog which always need to be available for the user to press. No, [OpenFileDialog](http://msdn.microsoft.com/en-us/library/system.windows.forms.openfiledialog.aspx) and [SaveFileDialog](http://msdn.microsoft.com/en-us/librar...
[ 0.0992698147892952, -0.22762301564216614, 0.5281510353088379, 0.13639795780181885, 0.08567720651626587, -0.18611593544483185, 0.09193555265665054, 0.11984267085790634, -0.34010574221611023, -0.7350773215293884, -0.12955939769744873, 0.3572814166545868, -0.36940470337867737, -0.187418878078...
Is there a common way to express the usage of arguments in C++? I want to implicitly tell the consumers of my class how the arguments they pass will be used by the class. Examples: 1. I own your argument (will clean it up) 2. I will hold a reference to your argument during my lifetime (so you should NOT delete it wh...
[ 0.7188587188720703, 0.20190399885177612, 0.45039793848991394, -0.08308510482311249, -0.023257026448845863, -0.017147941514849663, 0.35291776061058044, -0.29520463943481445, 0.04027735814452171, -0.27401813864707947, 0.012953739613294601, 0.44037628173828125, -0.2269698679447174, 0.11174745...
sense. In the second case I usually take a pointer to avoid someone passing a value from the stack which would invalidate my reference quickly, or alternatively a shared\_ptr. In the third case I take a reference to allow values from the stack. How do you deal with this? Also is it necessary to rely on smart pointers ...
[ 0.3744417726993561, 0.1257520169019699, 0.02468188852071762, 0.012084944173693657, -0.054467156529426575, -0.3307015895843506, 0.36810585856437683, -0.2518933415412903, 0.032868385314941406, -0.5740901231765747, 0.05380995571613312, 0.7409929037094116, -0.4075920581817627, 0.03947527334094...
use this much.) 2 - shared\_ptr means that the class will probably use the argument for an extended period of time, and in particular may store off its own shared\_ptr to the object. 3 - Plain reference means that the argument will only be used for the duration of the call. We treat this as a coding standard. It isn...
[ 0.32622072100639343, -0.17002056539058685, 0.34383681416511536, 0.008955046534538269, 0.15695694088935852, -0.23298759758472443, 0.24356774985790253, -0.1274430751800537, 0.11825282126665115, -0.2505769431591034, -0.3752315044403076, 0.6700117588043213, -0.27166947722435, -0.06391867250204...
What is the best GRID and TREE control for DELPHI win32. It should also be DB-Aware. I have use the DBGrid but it is very limited and lakes a lot of new features DevExpress as an impressive collection of tools and features, but a very high price. What is your GRID/TREE of choice its pros and cons, and of course its pri...
[ 0.199197456240654, -0.1739751696586609, 0.28658565878868103, 0.23547859489917755, -0.0539751760661602, -0.28628456592559814, -0.08360091596841812, 0.12141260504722595, 0.05216868221759796, -0.6877427697181702, 0.0052719577215611935, 0.7453293204307556, -0.08099052309989929, 0.0165833216160...
learning it so you can understand where the features are controlled. The advantage of the subscription is that you get pre-release betas, and you get everything which means that I've been able to use controls I'd never justify individually but they are in my toolkit so I can use them.
[ 0.5799509286880493, -0.3269098699092865, -0.07035044580698013, 0.29119673371315, 0.16834838688373566, -0.3779967129230499, -0.09968314319849014, 0.21106071770191193, 0.01400029193609953, -0.672954261302948, -0.025669144466519356, 0.5406470894813538, 0.2729782462120056, -0.1491994857788086,...
I am playing around with F# and C#, and would like to call F# code from C#. I managed to get it to work the other way around in Visual Studio by having two projects in the same solution, and adding a reference of the C# code to the F# project. After doing this, I could call C# code and even step through it while debu...
[ 0.47497493028640747, -0.04871182143688202, -0.10674586147069931, 0.18070055544376373, -0.2747001647949219, -0.24614489078521729, 0.027532797306776047, 0.3119928240776062, -0.30655035376548767, -0.6780443787574768, 0.3793084919452667, 0.4345104396343231, -0.44257763028144836, 0.018232969567...
it did before. I would like to know if this is possible without doing it manually. Below is a working example of calling F# from C#. As you encountered, I was not able to add a reference by selecting from the "Add Reference ... Projects" tab. Instead I did have to do it manually, by browsing to the F# assembly in the ...
[ 0.13089926540851593, -0.12600302696228027, 0.6640782952308655, -0.2508712112903595, -0.13348659873008728, -0.2971344292163849, -0.1925794780254364, -0.3503558933734894, -0.20383138954639435, -0.8899129629135132, -0.05741295963525772, 0.712109386920929, -0.3215045928955078, 0.01190007757395...
[b] // Finally use your map function to convert an array of strings to upper case // // Test cases are in TestFoldMapUCase.cs // // Note: F# provides standard implementations of the fold and map operations, but the // exercise here is to build them up from primitive elements... module FoldMapUCase.Zumbro #light let ...
[ -0.09560694545507431, -0.5281078219413757, 0.3713011145591736, -0.38745495676994324, 0.0975947231054306, -0.17521268129348755, 0.028949838131666183, -0.39029353857040405, -0.07190567255020142, -0.6240476369857788, -0.3296206295490265, 0.6009894013404846, -0.33516934514045715, -0.3383153676...
:: lst List.rev (foldl gn [] vals) let ucase vals = map String.uppercase vals ``` ----- C# UNIT TESTS FOR THE MODULE ----- ``` // Test cases for FoldMapUCase.fs // // For this example, I have written my NUnit test cases in C#. This requires constructing some F# // types in order to invoke the F# functions un...
[ 0.1276973932981491, -0.1704183965921402, 0.4333150088787079, -0.30826106667518616, -0.06612149626016617, 0.3458082377910614, 0.314704954624176, -0.7284926176071167, 0.19921337068080902, -0.6491394639015198, -0.2003881335258484, 0.546679675579071, -0.17012520134449005, -0.039203960448503494...