text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
using statement and handling it all yourself. Unfortunately, you are doing it the wrong way, in that if you have an implementation of IDisposable which throws an exception on the call to Dispose, the other calls to Dispose do not take place. If you use the using statement, all implementations of IDisposable.Dispose wil...
[ 0.47824957966804504, -0.09561054408550262, -0.08568432927131653, 0.12614163756370544, -0.159216046333313, -0.390371710062027, 0.25052621960639954, -0.05255341902375221, -0.17720521986484528, -0.39648371934890747, 0.002482783515006304, 0.6124115586280823, -0.6361579298973083, 0.038017299026...
case here. So let's assume you create your connection in a separate method, like this: ``` SqlConnection CreateConnection() { // Create the connection here and return it. return ...; } ``` You are also going to need the following structure to properly manage your COM references: ``` struct ComReference<T> ...
[ -0.055190104991197586, 0.08330055326223373, 0.450676292181015, 0.23355206847190857, 0.023488624021410942, -0.09123465418815613, 0.015596653334796429, -0.2593012750148773, -0.09028194099664688, -0.850337564945221, 0.18671709299087524, 0.5301429033279419, -0.543020486831665, 0.59372049570083...
ComReference<T> retVal = new ComReference<T>(); // Set the reference. retVal.reference = new T(); // Return. return retVal; } public ComReference<T> Release() { // Create a copy for return. // Note, this is copied on the stack. ComReference<T> retVa...
[ 0.5113444328308105, -0.1697251945734024, 1.2420318126678467, 0.05498385429382324, 0.049376558512449265, -0.0932895615696907, 0.03405599668622017, -0.5917637944221497, -0.47417065501213074, -0.3854513466358185, -0.45971134305000305, 0.7539695501327515, -0.5692125558853149, 0.487595021724700...
// Set this reference to null; this.reference = null; // Return the reference. return retVal; } public void Dispose() { // If there is a reference, then release. Marshal.ReleaseComObject(reference); } } ``` You want to manage your COM references with this so t...
[ 0.8667680621147156, 0.17683348059654236, 0.38739779591560364, 0.03182533010840416, 0.34579432010650635, -0.453107088804245, 0.38280177116394043, -0.7076389193534851, -0.3798563778400421, -0.43741825222969055, -0.2734537422657013, 0.736044704914093, -0.3756696283817291, 0.5882676243782043, ...
with them, not through garbage collection. COM relies on deterministic finalization, and you don't get to ignore that just because you are in .NET. The structure above leverages IDisposable (and the fact it is a structure and the nuances that come with it) to help do so in a deterministic way. The type parameter `T` w...
[ -0.0615374855697155, -0.17029941082000732, 0.27267584204673767, 0.04570331051945686, -0.13202354311943054, -0.2744079530239105, 0.11820632219314575, -0.25529244542121887, 0.05912049859762192, -0.6916437745094299, -0.008996395394206047, 0.7595068216323853, -0.4727228879928589, 0.13286677002...
int chunkSize = 65536; int offSet = 0; // Create the command. using (SqlCommand cmd = new SqlCommand()) { // Set the parameters. cmd.CommandType = CommandType.Text; cmd.CommandTimeout = 0; cmd.CommandText = sqlString; // See (1). using (SqlConnection con...
[ 0.0008943091379478574, -0.31146204471588135, 0.40152573585510254, -0.12710002064704895, -0.008685166947543621, 0.1262032389640808, 0.04521798714995384, -0.343909353017807, -0.12016590684652328, -0.3649984896183014, -0.39449307322502136, 0.43375226855278015, -0.3593819737434387, 0.034166652...
{ // Set the connection on the command. cmd.Connection = connection; // Create the parameter and add to the parameters. SqlParameter cmdParameter = new SqlParameter( parameterName, idParameter); cmd.Parameters.Add(cmdParameter);
[ -0.4012133479118347, -0.30245500802993774, 0.6494072675704956, 0.25307878851890564, 0.04503298178315163, 0.24980060756206512, 0.04552217945456505, -0.5056118369102478, -0.06830405443906784, -0.5544649362564087, 0.21287043392658234, 0.4078918993473053, -0.4169867932796478, 0.304510712623596...
// Create the reader. using (SqlDataReader dr = cmd.ExecuteReader( CommandBehavior.SequentialAccess)) { dr.Read(); // See (2)
[ -0.13598543405532837, -0.14769063889980316, 0.31330183148384094, -0.020711470395326614, 0.0442645400762558, 0.222765251994133, 0.36159148812294006, -0.13398443162441254, -0.06874055415391922, -0.5942988395690918, -0.03948783501982689, 0.5553888082504272, -0.5255630016326904, 0.092716984450...
if (!dr.HasRows) { // Return an empty instance. return new ComReference<StreamClass>(); }
[ -0.05233190581202507, -0.2197900116443634, 0.31733328104019165, 0.013516959734261036, 0.20329055190086365, -0.13527712225914001, 0.4006184935569763, -0.04340539127588272, -0.07195330411195755, -0.6355260014533997, -0.03956461325287819, 0.641740620136261, -0.4321557283401489, 0.607520818710...
// Create the stream here. See (3) using (ComReference<StreamClass> adoStreamClass = ComReference<StreamClass>.Create()) { // Get the stream.
[ 0.05536064878106117, -0.21324358880519867, 0.3358194828033447, -0.05004364252090454, 0.09678657352924347, -0.029122840613126755, 0.20098257064819336, 0.046404071152210236, 0.07733521610498428, -0.7642837166786194, -0.03162997215986252, 0.530704915523529, -0.3280629813671112, 0.262473970651...
StreamClass adoStream = adoStreamClass.Reference; // Open the stream. adoStream.Type = StreamTypeEnum.adTypeText; adoStream.Open(Type.Missing,
[ -0.13060671091079712, 0.014410315081477165, 0.17379902303218842, 0.006399925798177719, 0.10956858843564987, 0.04989410564303398, 0.39069095253944397, 0.07658827304840088, 0.17203077673912048, -0.6605564951896667, -0.2758978307247162, 0.30132603645324707, -0.44497883319854736, 0.68667370080...
ConnectModeEnum.adModeUnknown, StreamOpenOptionsEnum.adOpenStreamUnspecified, "", ""); // Create the byte array. byte[] byteChunk = new byte[chunkSize];
[ -0.06077174097299576, -0.25475290417671204, 0.19404487311840057, 0.0932842269539833, 0.08778122812509537, -0.007285366300493479, 0.29754242300987244, 0.05932912603020668, -0.04420102760195732, -0.56805419921875, -0.08854654431343079, 0.3114364743232727, -0.48973143100738525, 0.249741360545...
// See (4) Encoding readBytes = Encoding.Unicode; // Cycle. do
[ 0.30814123153686523, 0.08155377209186554, -0.07345908880233765, -0.1540430635213852, 0.11242034286260605, 0.19326426088809967, 0.14104673266410828, -0.04850078374147415, -0.3809621334075928, -0.8868475556373596, -0.5730279088020325, 0.14835475385189056, -0.4041731059551239, -0.230819374322...
{ bytesReturned = (int)dr.GetBytes(0, offSet, byteChunk, 0, chunkSize); size += bytesReturned;
[ -0.08339209109544754, 0.052601005882024765, 0.35806959867477417, -0.1421503871679306, 0.05145435035228729, 0.24787947535514832, 0.14309900999069214, -0.33095234632492065, -0.19529575109481812, -0.403347373008728, -0.45139622688293457, 0.5137616395950317, -0.1618218719959259, 0.203477248549...
if (bytesReturned > 0) { if (bytesReturned < chunkSize) {
[ -0.10011982172727585, -0.18479357659816742, -0.1682795137166977, -0.06883542239665985, 0.05689264088869095, -0.0753236636519432, -0.069976806640625, -0.051464568823575974, 0.20609310269355774, -0.21626245975494385, -0.4277363121509552, 0.238677978515625, -0.062039487063884735, 0.0768394470...
Array.Resize(ref byteChunk, bytesReturned); }
[ 0.07587951421737671, -0.3057076930999756, 0.0006249673315323889, -0.19689354300498962, -0.029844248667359352, 0.2105047106742859, 0.10624470561742783, -0.20414458215236664, -0.12251637130975723, -0.4235134422779083, -0.030683893710374832, 0.6839627027511597, -0.2863345146179199, 0.18452440...
adoStream.WriteText( readBytes.GetString(byteChunk), StreamWriteEnum.stWriteChar);
[ -0.20178338885307312, 0.2962379455566406, 0.30340608954429626, -0.15555283427238464, -0.26110002398490906, 0.22736002504825592, 0.2708781659603119, 0.04104054719209671, 0.15931808948516846, -0.6445855498313904, -0.3167296350002289, 0.2618962228298187, -0.5399230122566223, 0.284372419118881...
adoStream.Flush(); } offSet += bytesReturned; } while (bytesReturned == chunkSize);
[ -0.10305236279964447, -0.06427346169948578, 0.2950330078601837, -0.3168051838874817, -0.05365711823105812, 0.35567957162857056, -0.07892043888568878, -0.21259690821170807, -0.005474023520946503, -0.4798741936683655, -0.2826351225376129, 0.3063242733478546, -0.2846558392047882, 0.2170755267...
// Release the reference and return it. // See (5). return adoStreamClass.Release(); } } } } }
[ 0.19789743423461914, 0.24785172939300537, 0.5914488434791565, -0.21639510989189148, 0.18843206763267517, -0.06997077167034149, 0.08433794975280762, -0.2819734811782837, 0.14661994576454163, -0.38907384872436523, -0.4073336720466614, 0.7197234630584717, -0.49692854285240173, 0.6242011785507...
``` Notes: 1. This is where you want to create your connection. You want to use it in a using statement because you want to be assured that your resources are cleaned up, on success or failure. 2. It's easier to short-circuit the code here and return a new instance of `ComReference<StreamClass>`. When you create this...
[ 0.1947183609008789, 0.25824904441833496, 0.28757283091545105, -0.08583211898803711, -0.06188329681754112, -0.2649945020675659, 0.1950930505990982, -0.19473642110824585, -0.1671200841665268, -0.7136408090591431, 0.10265052318572998, 0.3190191984176636, -0.6594879031181335, 0.476718127727508...
something goes wrong, this is disposed of upon release (since it is a COM interface implementation, and dependent on deterministic finalization). 4. There is no need to create a new UnicodeEncoding. You can just use the Unicode property on the Encoding class to use a premade instance. 5. In calling release, you set the...
[ 0.012346194125711918, -0.14262497425079346, 0.2811955213546753, 0.1235889121890068, 0.04836437106132507, -0.35960260033607483, 0.25037679076194763, -0.04338677227497101, -0.16788677871227264, -0.6676039695739746, -0.2792895436286926, 0.4727564752101898, -0.2509131133556366, 0.2740519046783...
the code that calls LoadTextFromDBToADODBStream: ``` // See (1) using (ComReference<StreamClass> adoStreamClass = LoadTextFromDBToADODBStream(resultID, "@result_id", "some sql statement", ref size)) { // Set to the class instance. See (2) StreamClass adoStream = adoStreamClass.Reference; if (adoS...
[ -0.3057352304458618, 0.010316381230950356, 0.654899537563324, -0.3565952181816101, 0.12872706353664398, -0.11625749617815018, 0.13458305597305298, -0.4158973693847656, 0.061848949640989304, -0.5388694405555725, -0.16704875230789185, 0.7694191336631775, -0.433526873588562, 0.172550812363624...
// See (3) using (ComReference<RecordsetClass> rsClass = ComReference<RecordsetClass>.Create()) { Recordset rs = rsClass.Reference; rs.Open(adoStream, Type.Missing, CursorTypeEnum.adOpenStatic, LockTypeEnum.adLockBatchOptimistic, -1); i...
[ 0.1564016491174698, 0.1894909292459488, 0.6691172122955322, -0.30333542823791504, 0.09124794602394104, 0.09034734219312668, 0.43236881494522095, -0.5679699778556824, -0.24003101885318756, -0.544934093952179, -0.23857004940509796, 0.34354040026664734, -0.6302068829536438, 0.3278458416461944...
!= null) { adoStream.Close(); adoStream = null; } source.SourceRows = rs.RecordCount; table.TableName = "Source"; source.Dataset
[ -0.37850266695022583, 0.08826787769794464, 0.7157069444656372, -0.26118308305740356, 0.25054940581321716, -0.0017608883790671825, 0.26835164427757263, -0.4170837700366974, -0.37808525562286377, -0.3008803129196167, -0.4054795801639557, 0.2604486644268036, -0.45175227522850037, 0.4439251422...
= new DataSet(); source.Dataset.Tables.Add(table); // See (4) using (OleDbDataAdapter adapter = new OleDbDataAdapter()) { adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey;
[ -0.22007551789283752, -0.10867206007242203, 0.29831284284591675, -0.32674112915992737, 0.2601289451122284, 0.09229064732789993, 0.4644054174423218, -0.536052942276001, -0.439151793718338, -0.566420316696167, -0.5066014528274536, 0.5941866636276245, -0.6930043697357178, 0.21286813914775848,...
adapter.Fill(source.Dataset.Tables[0], rs); } } } } ``` 1. This is going to receive the return value of the call to Release in LoadTextFromDBToADODBStream. It will contain the live reference to the ADODB.Stream created there, and the using statement will guarantee it is cleaned up when the sco...
[ 0.1618778109550476, -0.13017497956752777, 0.9489163756370544, -0.37513303756713867, 0.06286943703889847, -0.2955424189567566, 0.18597981333732605, -0.49605560302734375, 0.014475765638053417, -0.6922743916511536, -0.1354389786720276, 0.7318577170372009, -0.8018674850463867, 0.20207858085632...
time `ComReference<RecordsetClass>`. 4. Let the compiler do the dirty work for you. In using the using statement more, you can clean up a lot of the code that was making it very difficult to read. Also, in general, you were cleaning up some resource issues that would have cropped up in the face of exception, as well a...
[ 0.3537197709083557, 0.12891806662082672, -0.07622482627630234, 0.3745969235897064, -0.14647243916988373, -0.34740081429481506, 0.4471256136894226, -0.06271208077669144, -0.18199463188648224, -0.7924903631210327, 0.006816106382757425, 0.7182555198669434, -0.23581571877002716, -0.06427937000...
I have a Python function in which I am doing some sanitisation of the input parameters: ``` def func(param1, param2, param3): param1 = param1 or '' param2 = param2 or '' param3 = param3 or '' ``` This caters for the arguments being passed as *None* rather than empty strings. Is there an easier/more conci...
[ 0.18021290004253387, 0.3196519613265991, 0.2088528275489807, -0.2810177505016327, -0.4089314639568329, 0.6211066246032715, 0.39954903721809387, -0.6448213458061218, -0.4110283851623535, -0.2218075841665268, -0.01319364458322525, 0.34573888778686523, -0.4470342993736267, -0.0149689773097634...
return func(*[arg or '' for arg in args], **dict((k, v or '') for k,v in kwds.iteritems())) sfunc.func_name = func.func_name sfunc.func_doc = func.func_doc return sfunc ``` You would use this on your function like so: ``` @sanitized def func(param1, param2, param3): print param1, ...
[ -0.022033551707863808, 0.38993412256240845, 0.29168573021888733, -0.21351946890354156, -0.1296427696943283, 0.3348396420478821, 0.12950871884822845, -0.5522512197494507, -0.14085792005062103, -0.06369327753782272, -0.1612132042646408, 0.5485721230506897, -0.6005182266235352, -0.04393823072...
up the function signature as Ned Batchelder points out in his answer. To fix that you could use [Michele Simionato's decorator module](http://pypi.python.org/pypi/decorator)-- I think you'd just need to add a `@decorator` before the definition of `sanitized`)
[ 0.3993273973464966, 0.0728863999247551, 0.026692569255828857, 0.012366840615868568, 0.3783199191093445, 0.04878213629126549, 0.14147689938545227, -0.534828245639801, -0.3008498549461365, -0.405148446559906, -0.054337721318006516, 0.390798419713974, -0.4997057616710663, -0.09468290209770203...
I can use Firebug and it will show lots of info about files that are loaded and even http return codes but it doesn't seem to show all of them. For example i visit a page that loads a flash file. In firebug it will show that the file is loaded, but if that swf itself loads other swf's and accesses other resources th...
[ 0.5097250938415527, 0.09305962920188904, 0.29341399669647217, 0.15251219272613525, -0.3778960108757019, -0.5727735757827759, 0.2902352809906006, 0.13204127550125122, -0.27765968441963196, -0.8161817789077759, -0.006646851543337107, 0.8070709705352783, -0.2936142683029175, 0.042117662727832...
where, etc... One of the tools I use for inspecting requests and responses is [Fiddler](http://www.fiddlertool.com/fiddler/). It works very well and it is free. From their homepage <http://www.fiddlertool.com/fiddler/> > Fiddler is a HTTP Debugging Proxy > which logs all HTTP traffic between > your computer and the ...
[ -0.06107727810740471, 0.1535121649503708, 0.5550345182418823, -0.002880366984754801, -0.1855209767818451, -0.255826473236084, 0.31510859727859497, -0.0394490621984005, -0.3145359456539154, -0.7697651386260986, 0.346823126077652, 0.3799290657043457, 0.05988854914903641, 0.10881233215332031,...
I wrote an application recently, which relies on OpenID for authentication. A lot of web applications these days are moving to OpenID, insofar that they *already* have userid/password authentication scheme, and OpenID is just an add-on. Since my application is a new one, I decided that it makes no sense to program sepa...
[ 0.3798411786556244, 0.208835631608963, -0.05433625727891922, -0.004116090014576912, 0.06981471180915833, 0.16837583482265472, 0.3686208426952362, -0.09613234549760818, -0.21605561673641205, -0.2662205100059509, 0.4303649961948395, 0.37717148661613464, -0.10494094341993332, 0.09141669422388...
users create their own OpenID if they don't already have one. I kind-of had a pre-made response to that, which was: "You can always run your own OpenID server". I guess I didn't put too much thought into this answer though, since many implementations of OpenID server are pretty raw and need a lot of work before they c...
[ 0.42505165934562683, -0.02977299690246582, -0.1455610692501068, 0.10193715244531631, -0.18276527523994446, -0.19362574815750122, 0.18403683602809906, 0.18883861601352692, -0.286542147397995, -0.6002493500709534, -0.0009888005442917347, 0.3446585237979889, -0.18089258670806885, 0.0146823152...
user accounts * Self-served password resets through verification email * Administrative features (lock/unlock/disable accounts, troubleshoot, etc) * Presentable look there are ready to use frameworks. you only need to put them together. this can be fast done. you didn't wrote about your platform, but if you like to us...
[ 0.260069340467453, 0.08859852701425552, 0.14312994480133057, 0.3066038191318512, -0.18531686067581177, -0.24916762113571167, 0.3097185492515564, 0.01077961828559637, -0.2322549670934677, -0.8147746920585632, 0.1493646651506424, 0.4577343761920929, -0.0493643544614315, -0.26566746830940247,...
I want to get the size of the phone drive. I'm using "Nokia-PC-Connectivity"., and with respect to File System API I found on CONADifinition function called CONA\_Folder\_Info but this function doens't support FreeSize and Total Size but there is CONA\_Folder.Info2 and its instance support these variables. But when I ...
[ -0.13623739778995514, 0.18761608004570007, 0.26144301891326904, 0.055714309215545654, 0.2896997034549713, 0.1411375254392624, 0.15069329738616943, -0.3772359788417816, -0.21149727702140808, -0.5414023995399475, -0.09340521693229675, 0.7444983124732971, -0.05832487717270851, 0.0955773517489...
if (FolderInfo.pstrName[0].ToString() != "C" && level == 0) { } ``` I get this exception: > FatalExecutionEngineError was detected > Message: The runtime has encountered a > fatal error. The address of the error > was at 0x7a0ba769, on thread 0x1278. > The error code is 0xc0000005. This > error may be a bu...
[ -0.19720013439655304, 0.33523842692375183, 0.3273414969444275, -0.16240812838077545, 0.18437229096889496, -0.14322857558727264, 0.3015640676021576, 0.055320896208286285, -0.2590910792350769, -0.584122359752655, -0.19994638860225677, 0.5541024208068848, -0.19079993665218353, 0.3265815675258...
more explanations please ask me. It is correct that you get the exception when you try and convert the data in the buffer to a different type of structure than was originally created by CONAFileSystem.CONAFindNextFolder. You are trying to force a data structure of type CONADefinitions.CONAPI\_FOLDER\_INFO into a struc...
[ 0.2912237048149109, -0.02755042538046837, 0.09993744641542435, 0.08356136828660965, -0.020865056663751602, -0.00234264531172812, 0.160755455493927, -0.12734493613243103, -0.27565762400627136, -0.5789493918418884, 0.05433541163802147, 0.307341068983078, -0.4534294903278351, 0.32861739397048...
have created a newer version of the CONADefinitions.CONAPI\_FOLDER\_INFO structure (i.e. CONADefinitions.CONAPI\_FOLDER\_INFO2). Assuming this is correct there are 3 likelihoods: 1) There is an enum parameter to the first function which specifies which version of the output structure is to be created. 2) There is a ...
[ 0.35014045238494873, -0.18458899855613708, 0.6771219372749329, 0.006059094797819853, -0.08944708853960037, 0.12592852115631104, -0.03560570999979973, -0.32445424795150757, 0.05269812420010567, -0.5727341175079346, -0.09292801469564438, 0.42791882157325745, -0.4231071472167969, 0.1020150780...
This question originally asked which is the best method for uploading files via SFTP or FTPS in SSIS. It now just lists the pros and cons of each solution. I personally use CozyRoc's SFTP library these days, but I've used each of the below solutions at one point or another. SSIS COMPONENT LIBRARY Method: Install a SS...
[ 0.12207111716270447, 0.09689205884933472, 0.5982809662818909, 0.10440097004175186, 0.07648033648729324, 0.020435690879821777, 0.020940829068422318, -0.3027448058128357, -0.21964943408966064, -0.7229189872741699, -0.518421471118927, 0.16704705357551575, -0.3096047639846802, -0.1078971773386...
sensitive information and allows you all the normal options for protecting the sensitive information instead of just storing it in clear text in a non-secure manner. Works well with other SSIS tasks such as ForEach Loop Containers. Errors out when uploads and downloads fail. Works well when you don't know the names of ...
[ -0.013010063208639622, 0.02440001629292965, 0.32404589653015137, 0.49584299325942993, 0.05915473774075508, -0.3871322274208069, 0.3476991653442383, -0.2770625352859497, -0.0893455445766449, -0.7618587017059326, -0.509025514125824, 0.6942565441131592, -0.1360674947500229, -0.070895940065383...
production machine. If it is the Codeplex solution, then you are using software that isn't supported by any specific vendor. This also makes you dependent upon the vendor to update their libraries between each version. For instance, before 2008 RTM'd, I was developing a new server on a CTP version of 2008 and the CozyR...
[ 0.41088399291038513, 0.16842509806156158, 0.29907000064849854, -0.25616654753685, -0.055305324494838715, -0.008073759265244007, -0.037474289536476135, -0.12621407210826874, -0.4037666618824005, -0.29894882440567017, -0.3088677227497101, 0.516365647315979, -0.4384593367576599, -0.0854471847...
it either by running a batch file or operating system process task. Instructions for doing this via WinSCP are listed [here](http://www.codeproject.com/KB/database/SSIS_SFTP.aspx). Pros: Free, free, and free. You can be sure it is secure if you are using Putty since numerous GUI FTP clients appear to use Putty under t...
[ 0.5990524888038635, -0.18617728352546692, 0.3720332384109497, 0.023810798302292824, 0.03564614802598953, -0.3781976103782654, 0.12543028593063354, -0.15517157316207886, -0.3598295748233795, -0.37020421028137207, -0.40352264046669006, 0.5262471437454224, -0.19619128108024597, -0.21832725405...
of the code is encapsulated in text files instead of SSIS itself. Difficult to use if you don't know the exact name of the file you are uploading or downloading. A 3RD PARTY C# or VB.NET LIBRARY Method: Install a SFTP or FTPS library and use a Script Task that references the library to upload the files. (I've never t...
[ 0.25160378217697144, -0.016977684572339058, -0.06998870521783829, 0.31554263830184937, 0.029118334874510765, -0.24613508582115173, 0.20467478036880493, 0.06890121847391129, -0.21372121572494507, -0.7102254629135132, -0.2961968779563904, 0.4388595223426819, -0.4579246938228607, -0.217755883...
uploading or downloading. Cons: It's a script task combined with .NET libraries. If you are using SSIS, then you probably are more comfortable with SSIS tasks then .NET code. Script tasks are also difficult to troubleshoot since they don't have the same debugging tools and features as regular .NET projects. Creates a ...
[ 0.12734602391719818, -0.06142326816916466, 0.016784705221652985, 0.32694211602211, -0.38472428917884827, -0.27456408739089966, 0.08815564960241318, 0.3116121292114258, -0.38646331429481506, -0.7755176424980164, 0.07746856659650803, 0.580000102519989, -0.4902500510215759, 0.1363369375467300...
VB.NET library that does this as of yet. So if anyone knows of one, then please let me know! The following question might be of use: [What would be a recommended choice of SSIS component to perform SFTP or FTPS task?](https://stackoverflow.com/questions/152981/recommend-one-favorite-ssis-component-that-does-sftp-ftps)...
[ 0.4375331997871399, -0.19526362419128418, 0.42780184745788574, -0.11717243492603302, -0.4632423520088196, -0.545680820941925, 0.11451387405395508, -0.13890188932418823, -0.46160948276519775, -0.4268178939819336, -0.13259084522724152, 0.39284250140190125, -0.2546149492263794, -0.05244837701...
so. <http://msdn.microsoft.com/en-us/library/system.net.ftpwebrequest.enablessl.aspx>
[ 0.15046294033527374, -0.39910146594047546, 0.7401964068412781, 0.22813865542411804, 0.27501142024993896, -0.1749921441078186, 0.29693666100502014, -0.34701916575431824, -0.2009992003440857, -0.553654670715332, -0.341312974691391, 0.1398611068725586, -0.047417622059583664, -0.09950730204582...
This particular example relates to Django in Python, but should apply to any language supporting exceptions: ``` try: object = ModelClass.objects.get(search=value) except DoesNotExist: pass if object: # do stuff ``` The Django model class provides a simple method *get* which allows me to search for *one...
[ 0.07759544998407364, -0.02471892535686493, 0.1301007866859436, -0.14402703940868378, -0.19010226428508759, -0.4371337890625, 0.09704512357711792, -0.08295958489179611, -0.38976821303367615, -0.4531905949115753, -0.005858763586729765, 0.5131109952926636, -0.37806907296180725, -0.02358552441...
averse to exceptions?** To me the exception seems a little wasteful, at a guess, a quarter-to-a-half of the time will be 'exceptional'. I'd much prefer a function that returns *None* on failure. Would I be better to use Django's *filter* method and process the list myself? The clue is in the name - exceptions should be...
[ 0.27836430072784424, 0.2630499303340912, -0.24318324029445648, -0.03146021440625191, -0.3706795871257782, -0.025497693568468094, 0.2541772425174713, -0.17862102389335632, -0.3505176901817322, -0.39414381980895996, 0.05116620287299156, 0.7152405381202698, -0.32848119735717773, -0.1361771672...
you indicated that between 1 in 2 and 1 in 4 are expected not to exist, I'd definitely write a wrapper around `filter`, as that's definitely not an exceptional case.
[ 0.30811169743537903, -0.0044398256577551365, -0.21654005348682404, -0.04094522446393967, 0.1493011713027954, -0.0409017913043499, 0.03112267144024372, -0.042187292128801346, -0.017044195905327797, -0.37855640053749084, -0.030252736061811447, 0.23124884068965912, -0.31549903750419617, -0.05...
I have three buttons and need to save some data. I have a idea, I have to set an ID to every button and then let the JS determinate witch button that has been pressed, like: ``` $("#mySpecifikButton").click(function() { ....some code here... }); ``` but then Im stuck. For example I have 9 users. All they have an ID ...
[ 0.1815820336341858, 0.19931398332118988, 0.6968944668769836, -0.19819501042366028, -0.5206204056739807, 0.4503946304321289, 0.3774266839027405, -0.5673203468322754, 0.009819692932069302, -0.7096253633499146, 0.43912822008132935, 0.2740302085876465, -0.3738378584384918, 0.4081500470638275, ...
with JS (jquery)? Im I thinking right or is there better ways? If I didn't described it well, ask me. From what I can see, you can use Ajax to send the value of the button that has been pressed to the php script. Search the [jQuery site](http://jquery.com) for documentation on $.get and $.post. :) Edit: Now that I'm...
[ -0.059780485928058624, 0.11940868943929672, 0.4614832103252411, -0.2959507703781128, -0.0098643833771348, 0.053116440773010254, 0.2337091565132141, -0.10571599006652832, -0.319268137216568, -0.7683093547821045, -0.05321275442838669, 0.7994660139083862, -0.3161962628364563, -0.3255596160888...
//d is the response from the PHP page. //Do something with it! }); }); </script> ```
[ 0.07198487222194672, -0.22873342037200928, 0.3706488311290741, -0.36717572808265686, -0.3044988214969635, -0.04042128846049309, 0.34041261672973633, -0.3356642723083496, 0.16849423944950104, -0.5561883449554443, -0.629766047000885, 0.4151351749897003, -0.3147927522659302, 0.022004492580890...
Please let me know what architecture do VoIP applications use, P2P or Client-Server? Thank you. Some of each in general. There are three protocols involved, usually. One of them, for example SIP, is used to establish the connection. you need a server for that because someone has to establish the original connection; t...
[ 0.13114480674266815, -0.15169551968574524, 0.6887356042861938, 0.3851329982280731, 0.08390720188617706, -0.24940697848796844, 0.047458384186029434, 0.15070918202400208, -0.3013024926185608, -0.6947324275970459, -0.384639173746109, 0.3990267515182495, -0.27659085392951965, -0.05309979617595...
This is a complex question, please consider carefully before answering. Consider this situation. Two threads (a reader and a writer) access a single global `int`. Is this safe? Normally, I would respond without thought, yes! However, it seems to me that Herb Sutter doesn't think so. In his articles on effective concu...
[ 0.08507073670625687, 0.16551652550697327, 0.04118168726563454, 0.114766426384449, -0.009466329589486122, -0.1417214721441269, 0.2888484001159668, -0.12304168194532394, -0.3756324350833893, -0.2947746515274048, 0.07180464267730713, 0.4287450909614563, -0.4502319395542145, 0.3159253597259521...
scenario. I fully agree that the only way to ***guarantee*** correct multithreaded behavior on all platforms present and future is to use atomics(AKA memory barriers) or mutexes. My question; is write re-odering ever a problem on real hardware? Or is the multithreaded paranoia just being pedantic? What about classi...
[ 0.0036217966116964817, 0.0006346219452098012, 0.1430254727602005, 0.19556276500225067, -0.008078650571405888, 0.1585635244846344, 0.2979229986667633, 0.027731740847229958, -0.32260847091674805, -0.6923695802688599, 0.05152251198887825, 0.562585175037384, -0.07529067993164062, 0.03324227035...
the hardware can still mess up the code in practice. Your idea of inspecting the assembly is not good enough; the reordering can happen at the hardware level. To answer your question "is this ever a problem on read hardware:" **Yes!** In fact I've run into that problem myself. Is it OK to skirt the issue with uniproc...
[ 0.5672178864479065, 0.2667238712310791, -0.08483202010393143, 0.10837633162736893, 0.42787230014801025, -0.08834420144557953, 0.23168352246284485, 0.18356716632843018, -0.39781734347343445, -0.5395845174789429, -0.2302960604429245, 0.5507040619850159, 0.1415652632713318, 0.107530377805233,...
control over the hardware. In fact I have "cheated" like this in those situations on e.g. an ARM processor.
[ -0.03212625905871391, 0.1389973908662796, 0.14769010245800018, 0.5671486258506775, 0.044317927211523056, 0.06485933065414429, -0.41173070669174194, 0.13893325626850128, -0.19815638661384583, -0.3474581241607666, 0.21761785447597504, 0.5544111728668213, 0.059128981083631516, -0.114172920584...
I notice that when http requests are made from clients through a proxy server, then the IP address of the requests is always that of the proxy. So if many clients from a huge corporation with a proxy server access a web site, I cannot tell if the requests are from unique clients or not. Is there any way to determine un...
[ 0.25109028816223145, 0.3026745319366455, 0.25994181632995605, 0.2537890076637268, 0.11384447664022446, -0.08649680763483047, 0.03202417492866516, 0.16477486491203308, -0.4315101206302643, -0.6432158350944519, 0.06105070188641548, 0.2632113993167877, -0.10846367478370667, 0.5123308300971985...
cookie on the response, and check it in the request. If it's there, then you've seen that client before (and you could include some identification in the cookie). Of course, this relies on the clients being cookie-aware and the user not having disabled cookies (or clearing them manually). There's also the issue of som...
[ 0.41879770159721375, 0.07064148783683777, -0.01038549654185772, 0.19544164836406708, 0.02459079958498478, -0.10834241658449173, 0.2481181025505066, 0.0892094299197197, -0.5475448966026306, -0.747309684753418, -0.2874962389469147, 0.5778611898422241, 0.10059220343828201, 0.06660134345293045...
I do not want to alienate my users, but having multiple ways to sign in to the site defeats the purpose of having an OpenID implementation. This is not a brand new site and has about 3k users which are somewhat diehards (we have a great community), but not all of them are and I do not want to lose anyone due to a sign ...
[ 0.6508753299713135, 0.31415513157844543, 0.1600959151983261, -0.0024236731696873903, -0.08500902354717255, -0.1926540583372116, 0.7824146747589111, 0.06400551646947861, -0.10832913964986801, -0.7768341898918152, 0.32178953289985657, 0.11672752350568771, -0.1960061639547348, 0.4269402921199...
need to offer your own identity provider service to have control over these users. And that might require more work than having two authentication ways. I suggest you offer both ways, it's how most sites handle this issue.
[ 0.4002811908721924, 0.012045574374496937, 0.03321274369955063, 0.24116940796375275, 0.11246898770332336, -0.3159930408000946, 0.04527010768651962, 0.13454987108707428, -0.034818556159734726, -0.5673248767852783, 0.29439952969551086, 0.5164733529090881, -0.16997408866882324, -0.338623464107...
I would like to be able to switch this... `My sample [a id="keyword" href="someURLkeyword"] test keyword test[/a] link this keyword here.` To... `My sample [a id="keyword" href="someURLkeyword"] test keyword test[/a] link this [a href="url"]keyword[/a] here.` I can't simply replace all instances of "keyword" becaus...
[ 0.34542298316955566, 0.048739638179540634, 0.06953888386487961, -0.04003039747476578, -0.07141081243753433, -0.40517401695251465, 0.38332822918891907, 0.043096691370010376, -0.02565889060497284, -0.4625699818134308, -0.1448356956243515, 0.5055587887763977, -0.1703118532896042, 0.1370664834...
I'm trying to get my head around tuples (thanks @litb), and the common suggestion for their use is for functions returning > 1 value. This is something that I'd normally use a struct for , and I can't understand the advantages to tuples in this case - it seems an error-prone approach for the terminally lazy. [Borrow...
[ -0.03514651954174042, -0.020613567903637886, 0.36940187215805054, -0.16752101480960846, -0.20698237419128418, 0.04747520759701729, 0.31822845339775085, -0.015257656574249268, -0.20005373656749725, -0.3810364305973053, -0.2894936501979828, 0.53769451379776, -0.39110812544822693, -0.00041436...
have no idea which int is quotient and vice-versa. It seems rather like... ``` struct divide_result { int results[2]; // 0 is quotient, 1 is remainder, I think }; ``` ...which wouldn't fill me with confidence. So, what *are* the advantages of tuples over structs that compensate for the ambiguity? ### tuples I...
[ -0.1961955577135086, 0.03269236907362938, 0.2930266261100769, -0.1380959153175354, -0.19486750662326813, 0.05500952526926994, 0.23295873403549194, -0.2496359646320343, 0.0830795168876648, -0.2625243067741394, -0.25486457347869873, 0.33434903621673584, -0.285002201795578, 0.2698590755462646...
can become confusing if you have to return more values at once. Once the caller's programmer has looked up the documentation of `div`, he will know what position is what, and can write effective code. As a rule of thumb, i would say not to return more than 4 values at once. For anything beyond, prefer a struct. ### o...
[ -0.3761962354183197, 0.10448107123374939, 0.42339441180229187, -0.06001676246523857, -0.1998850256204605, 0.08851023763418198, 0.5055647492408752, -0.3410131335258484, -0.02246052213013172, -0.48440974950790405, -0.35746821761131287, 0.526076078414917, -0.24419164657592773, -0.041690018028...
Worse, we leave the reader of that code in doubt on what could be the *actual* return value of `div` be. There *are* wonderful examples when output parameters are useful. In my opinion, you should use them only when you've got no other way, because the return value is already taken and can't be changed to either a tupl...
[ 0.2581404149532318, -0.1401144117116928, 0.06094304472208023, -0.05145363137125969, -0.16204191744327545, -0.11806797981262207, 0.29337894916534424, 0.0269645843654871, -0.21516719460487366, -0.4373480975627899, -0.2623564302921295, 0.8018088936805725, -0.4207584857940674, 0.16823934018611...
crystal clear, i recommend you to use pointers, to signal at the call side that the object is actually used as an output parameter, in addition to comments where appropriate. ### returning a struct The third option is to use a struct: ``` div_result d = div(10, 3); ``` I think that definitely wins the award for **...
[ -0.08450326323509216, 0.06359905004501343, 0.5839450359344482, 0.015958033502101898, -0.38810575008392334, -0.2630477845668793, 0.12571795284748077, 0.22485186159610748, -0.13606442511081696, -0.32760968804359436, -0.21728143095970154, 0.7424309849739075, -0.14652717113494873, 0.0857142210...
generic as possible. So, say you have got a function that can print out tuples. You can just do ``` cout << div(10, 3); ``` And have your result displayed. I think that tuples, on the other side, clearly win for their **versatile** nature. Doing that with div\_result, you need to overload operator<<, or need to out...
[ -0.03849116340279579, -0.37326371669769287, 0.30333411693573, 0.008313235826790333, -0.4001602828502655, -0.002089246641844511, 0.305647075176239, 0.14108864963054657, -0.24036261439323425, -0.560644268989563, -0.26956674456596375, 0.42019733786582947, -0.7377417683601379, 0.31134808063507...
Im new into that asp.net thing, but here goes. I got at ImageButton, and when its clicked i want the image displayed in another window. If I can avoid using ajax i would like to do that. If possible would like to make the window modal, but still avoid ajax, since Im not ready to mix more technolgies yet. IMHO the best...
[ 0.8016422390937805, 0.11816651374101639, 0.4043632447719574, -0.18032528460025787, -0.35578757524490356, -0.174027219414711, 0.05112404748797417, -0.10723882168531418, -0.15015369653701782, -0.9972298741340637, 0.1471800059080124, 0.3920116722583771, -0.12280586361885071, -0.11539759486913...
I want place ads in my website, but I'm unsure about the common practices to place thes ads. By example, some cool asp.net articles sites shows ads in the middle of the article! So you read 2-3 paragraphs, read some ad, then finish the article reading... Another worry is about sabotage. One of mine customers get their...
[ 0.9811758399009705, 0.4846932888031006, 0.4103492498397827, -0.1046631708741188, -0.1504526436328888, -0.45482566952705383, 0.487189382314682, 0.08155287802219391, -0.08718235790729523, -0.5194703340530396, -0.013857059180736542, 0.45445096492767334, -0.20493073761463165, 0.086127117276191...
article about where to place ads](https://www.google.com/adsense/support/bin/answer.py?hl=en&answer=17954). Personally, I have the ads on my C# articles right at the bottom - by the time you get there, you've received all the benefit of the page already. That way I don't feel I'm disrupting my users. Then again, I'm n...
[ 0.7285308241844177, 0.42924705147743225, 0.5286999940872192, -0.06410292536020279, -0.13018085062503815, -0.24216729402542114, 0.16262347996234894, 0.10868647694587708, -0.2015494555234909, -0.4139966070652008, 0.25223633646965027, 0.42385390400886536, -0.2241387963294983, -0.1121298670768...
I can send any windows application key strokes with `PostMessage` api. But I can't send key strokes to Game window by using `PostMessage`. Anyone know anything about using Direct Input functions for sending keys to games from C#. An alternate way would be to hook the DirectInput API directly - Microsoft Research has p...
[ 0.2532337009906769, 0.10825155675411224, 0.41480502486228943, -0.08618646115064621, -0.36381784081459045, -0.08268558233976364, 0.009585833176970482, 0.11530113220214844, 0.09141767770051956, -0.7545040845870972, 0.1046501025557518, 0.6390954852104187, -0.24877546727657318, 0.3224481940269...
thread in the background and simply intercepts window messages before passing them along back to the application. It's one of the reasons why Microsoft no longer recommends the use of DirectInput - and it means that messaging APIs like PostMessage *should* work just fine.
[ 0.38165944814682007, -0.25552746653556824, 0.2416771799325943, 0.06268636137247086, -0.05775364488363266, -0.2279733419418335, 0.06348226219415665, 0.6321427822113037, -0.14219218492507935, -0.40332165360450745, -0.11547539383172989, 0.06527137011289597, -0.37594959139823914, 0.54643493890...
I'm trying to work this out. In my project, i have a file called 'Hello.java' which is the file with the main() argument and which is called when the program is compiled. And I have another file called MyObj.java which has got just a random class I made up to test java's OO features. I'm trying to do this: ``` class ...
[ -0.15818241238594055, 0.303244411945343, 0.059950508177280426, -0.5566631555557251, -0.027416061609983444, 0.03604593873023987, 0.17996639013290405, 0.2235381156206131, -0.3157186210155487, -0.7148183584213257, -0.19460438191890717, 0.35688555240631104, -0.6754063963890076, 0.1768759489059...
public void setObj() { this.an_obj.set_size(7); say("size is " + this.an_obj.get_size()); } } ``` In the MyObj.java class i have this code: ``` public class MyObj { private int size; public MyObj() { //do nothing } public void set_size(int new_size) { ...
[ 0.33289486169815063, -0.09139655530452728, 0.6381269097328186, -0.6018046140670776, 0.2464885115623474, -0.20340371131896973, 0.5204653143882751, -0.3050282895565033, -0.44039982557296753, -0.7161160707473755, -0.6123875379562378, 0.7639225125312805, -0.5341132879257202, 0.0453069955110549...
get_size() { return this.size; } } ``` This however gives the error: > "Cannot make a static reference to > non-static method setObj() from the > type Hello". If I add 'static' to the declaration of setObj, i.e ``` public static void setObj() ``` Then I get: > Cannot make a static reference...
[ -0.10475246608257294, -0.02104203961789608, 0.5665466785430908, -0.14484615623950958, 0.16766268014907837, 0.01967383548617363, 0.42178875207901, -0.41179293394088745, -0.3083369731903076, -0.5357201099395752, -0.472102552652359, 0.5524933338165283, -0.3414451777935028, -0.1042948439717292...
static methods?? In what, how can I do anything at all with this limitation of being able to call static methods only????? You can either add "static" to the member variable as well, or instantiate the class from within your main method. Here is some example code for both approaches: ``` /* Static */ class Hello { ...
[ 0.016156835481524467, -0.33337345719337463, 0.3164786696434021, -0.13821762800216675, -0.24574026465415955, 0.02911916933953762, 0.2427433729171753, -0.042050719261169434, -0.4403771162033081, -0.18313536047935486, -0.13842903077602386, 0.4800927937030792, -0.7469719648361206, 0.2324109971...
{ this.an_obj.set_size(7); say("size is " + this.an_obj.get_size()); } } /* Non-Static */ class Hello { public MyObj an_obj; public static void main(String[] args) { Hello hello = new Hello(); hello.setObj(); } public void setObj() { this.an_obj....
[ -0.3192841112613678, -0.20200009644031525, 0.7463539242744446, -0.8510653376579285, 0.1975097954273224, 0.27064794301986694, 0.5052139759063721, 0.1446698009967804, -0.5717598795890808, -0.5940284729003906, -0.6530166864395142, 0.6440739035606384, -0.6173374652862549, 0.41437554359436035, ...
say("size is " + this.an_obj.get_size()); } } ``` The primary difference between these two approaches is that in the first, "an\_obj" is static--that is to say, there is only one variable for the entire program. If you were to instantiate multiple Hello objects, they would all have the same "an obj" reference. In...
[ -0.13156229257583618, 0.026637379080057144, 0.3245485723018646, -0.19474448263645172, -0.2034243792295456, 0.13410592079162598, 0.073451466858387, -0.09894070029258728, -0.37473031878471375, -0.5533739924430847, -0.289639413356781, 0.5165044069290161, -0.6621994376182556, 0.263930052518844...
when possible.
[ 0.12471244484186172, 0.011115931905806065, 0.005660396069288254, 0.16787245869636536, 0.25359076261520386, -0.05979226529598236, 0.3293994069099426, 0.2485756129026413, -0.034713491797447205, -0.14202812314033508, -0.2686070501804352, 0.4242382347583771, -0.1049690842628479, -0.17142030596...
I have code where I schedule a task using `java.util.Timer`. I was looking around and saw `ExecutorService` can do the same. So this question here, have you used `Timer` and `ExecutorService` to schedule tasks, what is the benefit of one using over another? Also wanted to check if anyone had used the `Timer` class and...
[ 0.3456266522407532, -0.30254605412483215, 0.14511410892009735, -0.09741711616516113, -0.07875806093215942, -0.10920324176549911, -0.07201538234949112, -0.1383831799030304, -0.4536060690879822, -0.7683878540992737, 0.3648659884929657, 0.5967851877212524, -0.2674335241317749, 0.0066543952561...
number of threads. Furthermore, you have full control over created threads, if you want (by providing `ThreadFactory`). * Runtime exceptions thrown in `TimerTask` kill that one thread, thus making `Timer` dead :-( ... i.e. scheduled tasks will not run anymore. `ScheduledThreadExecutor` not only catches runtime exceptio...
[ 0.12108318507671356, -0.1944565623998642, 0.09961174428462982, -0.044037558138370514, 0.14102645218372345, -0.2096351534128189, 0.3491465747356415, -0.05817082151770592, -0.6754034757614136, -0.47651317715644836, -0.09522275626659393, 0.2281934767961502, -0.4908035099506378, 0.291427224874...
(`java.util.concurrent`) to Java 1.2, 1.3, 1.4](http://backport-jsr166.sourceforge.net/), which has the `ScheduledThreadExecutor` class.
[ 0.16532258689403534, -0.25382164120674133, 0.30394691228866577, -0.016446484252810478, 0.09773646295070648, -0.08501050621271133, 0.21148894727230072, 0.07591033726930618, -0.44514167308807373, -0.21564365923404694, -0.2647143006324768, 0.27000945806503296, -0.44838884472846985, 0.18102461...
I've noticed on OSX, installation is frequently a drag and drop one file kinda deal. I assume that file is an archive of all the applications necessary bits and that the application runs directly from it. Where does the application store configuration data, particularly per user settings when there are multiple users? ...
[ 0.5890363454818726, 0.15404830873012543, 0.1467353254556656, 0.3237100839614868, 0.28091585636138916, -0.2592540979385376, -0.12515172362327576, 0.16615301370620728, -0.46898648142814636, -0.7039605379104614, -0.38205334544181824, 0.3387129306793213, -0.15325184166431427, 0.154374316334724...
under `/Library`. These however seem to be used very little by applications as such, for obvious reasons. The format of the preferences for OSX-native applications are usually .plist (property-list) files with a name given in reverse-domain name syntax. There is a standalone application called Property List Editor whi...
[ 0.41859200596809387, 0.08943566679954529, 0.11907404661178589, 0.16066084802150726, 0.0835334062576294, -0.32493922114372253, -0.16823653876781464, 0.0660499855875969, -0.2620779275894165, -0.7423521280288696, -0.26534831523895264, 0.29633915424346924, -0.19325236976146698, 0.1690576374530...
If you're writing software for the Mac and you're using the Cocoa framework, then Apple has this document for the part of the Cocoa API that deals with storing and retrieving preference settings: [User Defaults Programming](https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/UserDefaults/Introduction...
[ -0.006463211961090565, 0.27303561568260193, 0.15364058315753937, 0.03682664409279823, 0.28276196122169495, 0.12518134713172913, -0.15305252373218536, -0.06188718602061272, -0.24389031529426575, -0.6517938375473022, -0.26233765482902527, 0.5437584519386292, -0.02333439514040947, -0.45026195...
The [yield](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/yield) keyword is one of those [keywords](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/) in C# that continues to mystify me, and I've never been confident that I'm using it correctly. Of the following...
[ 0.1756429672241211, 0.07123231887817383, 0.5954795479774475, -0.1050274595618248, 0.03885640576481819, -0.2525367736816406, 0.13364389538764954, -0.3300418555736542, 0.21012265980243683, -0.4995201826095581, -0.4518062174320221, 0.7006099224090576, 0.15266476571559906, 0.18392516672611237,...
foreach (Product product in products) { yield return product; } } } ``` **Version 2:** Return the list ``` public static IEnumerable<Product> GetAllProducts() { using (AdventureWorksEntities db = new AdventureWorksEntities()) { var products = from product in db.Product...
[ 0.04026602581143379, -0.14016136527061462, 0.7076817750930786, -0.41325923800468445, 0.2955172657966614, -0.10121966153383255, 0.2328575700521469, -0.44841477274894714, 0.049882300198078156, -0.4568200707435608, -0.804797887802124, 0.6494667530059814, -0.07877224683761597, 0.18262904882431...
return products.ToList<Product>(); } } ``` I tend to use yield-return when I calculate the next item in the list (or even the next group of items). Using your Version 2, you must have the complete list before returning. By using yield-return, you really only need to have the next item before returning. Among ot...
[ 0.23352350294589996, -0.1657390296459198, 0.680662989616394, -0.2972053289413452, -0.09554329514503479, -0.21918007731437683, -0.025428732857108116, -0.22444036602973938, -0.02235759049654007, -0.7643669247627258, -0.09554082155227661, 0.6255690455436707, -0.25489991903305054, -0.082311823...
list. Another case where yield-return is preferable is if the IEnumerable represents an infinite set. Consider the list of Prime Numbers, or an infinite list of random numbers. You can never return the full IEnumerable at once, so you use yield-return to return the list incrementally. In your particular example, you...
[ 0.0440458320081234, -0.21556362509727478, 0.5075917840003967, -0.24762730300426483, -0.29877763986587524, -0.16600604355335236, -0.028748609125614166, -0.2434564083814621, -0.13296321034431458, -0.7127799391746521, -0.08037089556455612, 0.7833072543144226, -0.30290696024894714, -0.04396318...
What's your prefered method to name your software releases? Like Microsoft: alpha - beta - final - service pack... Like Google: gmail beta - beta - beta - beta - :) Like some softwares: 0.2 - 0.3 - 0.9999... Major.Minor.Release.Build While Release and Build increments should not contain "breaking changes" (for example...
[ 0.4878010153770447, -0.14342325925827026, 0.13294284045696259, 0.0379912294447422, -0.10369917750358582, -0.2863761782646179, 0.1832728087902069, 0.21602647006511688, -0.15562398731708527, -0.5126058459281921, -0.12358564138412476, 0.42030027508735657, -0.13507182896137238, 0.3064606189727...
that there aren't any (major) bugs left. Final: There could be still bugs, but i have to release at some point ;-).
[ 0.32236528396606445, 0.12536394596099854, 0.2884484529495239, 0.293344646692276, 0.45087239146232605, 0.0343225859105587, 0.2998497784137726, 0.16287349164485931, -0.3535139858722687, -0.19044287502765656, -0.21806201338768005, 0.36185532808303833, -0.3121182322502136, 0.1619563102722168, ...
I'm the developer of the trash-cli project. The trash-cli project is a opensource implementation of the FreeDesktop.org Trash Specification that provides a command line interface to manage the trashcan. Ideally trash-cli provides these commands: * trash *(trashes files and directories)* * trash-empty *(empty the tra...
[ 0.6817248463630676, 0.17835873365402222, 0.46555131673812866, -0.17129206657409668, 0.21043390035629272, -0.1726263463497162, -0.31042981147766113, -0.18068639934062958, -0.26572829484939575, -0.5542668104171753, -0.15811873972415924, 0.6235617399215698, -0.29026755690574646, 0.23716121912...
case I think a good choice keep the trash-\* form because it exploit the shell TAB completion. In the beginning I was persuaded to rename the 'trash' command in 'trash-file' but I don't like it very much, and as Christoph Bloch [pointed out](https://bugs.launchpad.net/ubuntu/+source/trash-cli/+bug/310088/comments/3):...
[ 0.0905354842543602, 0.1769721806049347, 0.0641663521528244, -0.24209371209144592, 0.19029772281646729, -0.24971595406532288, 0.16434979438781738, -0.10211974382400513, -0.04264402016997337, -0.6135808229446411, -0.1903754323720932, 0.5747754573822021, -0.34743472933769226, 0.06071968749165...
> Just "trash" was much better. I collected some ideas for renamng the 'trash' command. Would you like help me to choose the best one? Do you know a better name? Here the alternatives (some of them are ugly, I know it, but maybe they help you to find a better name) : * trash-put * trash-put-in * trash-trash * trash-...
[ 0.2920528054237366, -0.10829570889472961, 0.15865789353847504, 0.15835806727409363, -0.2292432188987732, -0.15526887774467468, 0.021991165354847908, -0.020619839429855347, 0.05258825048804283, -0.6717743873596191, -0.20792131125926971, 0.6687551140785217, 0.038989558815956116, -0.348716616...
One of the advantages of Flash/Flex is that you can use vector graphics (SVG), which is nice. I did a bit of searching around and came across this [Javascript vector graphics library](http://www.walterzorn.com/jsgraphics/jsgraphics_e.htm). It's pretty simple stuff but it got me thinking: is there any possibility of usi...
[ 0.3877648711204529, -0.16864846646785736, 0.4595390260219574, -0.09390338510274887, -0.3832908570766449, -0.07501668483018875, -0.20708106458187103, -0.02154228277504444, -0.3426443338394165, -0.8582046031951904, 0.03747425973415375, 0.8226587176322937, -0.11562637984752655, -0.12384743243...
In response to question, how can I (or find more information to) **automate** certain **functionality** without user intervention, from a C++ (or C) using: * ATL * Or Automation code directly in C/C++ Regards If the application exposes a type library (and Microsoft Office applications do), then you can get at it from...
[ 0.5478346943855286, 0.03142321854829788, 0.11285588145256042, 0.2181181013584137, -0.21860702335834503, -0.24923965334892273, -0.013696478679776192, -0.16968631744384766, -0.13501296937465668, -0.717583954334259, -0.27833276987075806, 0.5191484093666077, -0.3963569402694702, 0.114995814859...
consult the documentation for the specific application, because discovering (and understanding) type libraries is quite complicated. The Windows SDK includes a tool, "OLE/COM Viewer" that can display typelibrary information for a COM object in the registry, or from a .TLB file or resource. If you want to play with an...
[ 0.4062446653842926, 0.06606704741716385, 0.3941771984100342, 0.03149392828345299, 0.02987271547317505, -0.17598706483840942, -0.05614311993122101, 0.17752805352210999, -0.18368574976921082, -0.6150707006454468, -0.07597063481807709, 0.6960647702217102, -0.4018871784210205, 0.14244298636913...
I'd like a way to show natural times for dated items in Python. Similar to how Twitter will show a message from "a moment ago", "a few minutes ago", "two hours ago", "three days ago", etc. Django 1.0 has a "humanize" method in django.contrib. I'm not using the Django framework, and even if I were, it's more limited th...
[ 0.1753007173538208, -0.041875578463077545, 0.12827132642269135, -0.012313688173890114, 0.015065842308104038, -0.26383769512176514, 0.1311049908399582, 0.08575011044740677, 0.10684170573949814, -0.769465982913971, 0.023178687319159508, 0.4945923686027527, -0.40243208408355713, -0.1095838919...