text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
Can source code examples be kept in a SQL database **while retaining all formatting** (tabs, newlines, etc.)? If so what data type would be used? Yes, use a `TEXT` type (or `MEDIUMTEXT` or `LONGTEXT` - you get the idea)
[ 0.5422356724739075, 0.35727015137672424, -0.08786829560995102, 0.42254963517189026, 0.00017382617807015777, -0.1597415953874588, 0.07011430710554123, -0.026323366910219193, -0.0958385169506073, -0.6062764525413513, -0.10712393373250961, 0.5213972330093384, -0.3317110240459442, -0.042142372...
I can't find any proper documentation on how to specify relations using the declarative syntax of SQLAlchemy.. Is it unsupported? That is, should I use the "traditional" syntax? I am looking for a way to specify relations at a higher level, avoiding having to mess with foreign keys etc.. I'd like to just declare "ad...
[ 0.27851566672325134, 0.22667941451072693, 0.18435518443584442, -0.0810868889093399, -0.22555115818977356, -0.25955596566200256, 0.38793206214904785, 0.12979938089847565, -0.08465175330638885, -0.5114949345588684, 0.013785470277071, 0.49828195571899414, -0.1969962865114212, 0.29481014609336...
say is documented with examples: ``` class User(Base): __tablename__ = 'users' id = Column('id', Integer, primary_key=True) addresses = relation("Address", backref="user") class Address(Base): __tablename__ = 'addresses' id = Column('id', Integer, primary_key=True) user_id = Column('user_id'...
[ -0.22703677415847778, 0.32758790254592896, 0.5472517609596252, -0.11777801066637039, 0.0170280821621418, 0.14421482384204865, 0.001291131367906928, -0.3782043755054474, -0.052205346524715424, -0.49297818541526794, -0.020253265276551247, 0.32571879029273987, -0.19525499641895294, 0.53894799...
I'm auditing a project that uses what is called a [Rules Engine](http://en.wikipedia.org/wiki/Business_rules_engine). In short, it's a way to externalize business logic from application code. This concept is entirely new to me and I'm pretty skeptical about it. After hearing people talk about [Anemic Domain Models](h...
[ 0.7970737218856812, 0.29755130410194397, 0.18568988144397736, -0.019907968118786812, 0.027603713795542717, -0.25899970531463623, 0.36554840207099915, -0.23052185773849487, -0.3876994848251343, -0.30514436960220337, 0.427657812833786, 0.5649487376213074, -0.1534135639667511, 0.3399021327495...
the Android app to interact with the Rules Engine as well, I'm going to have to miss out on whatever business logic was already written. As I don't have any experience with them yet, just curiosity, I was interested to hear about the pros and cons are in using a Rules Engine? The only pro that I can think of is that ...
[ 0.5027140378952026, 0.11721089482307434, -0.01170388050377369, 0.39062491059303284, 0.12929125130176544, -0.0388549268245697, 0.32379454374313354, 0.027930965647101402, -0.3457399904727936, -0.6542220711708069, 0.24627093970775604, 0.7866647839546204, -0.2418164610862732, -0.13800281286239...
like putting a band-aid over a shotgun wound. UPDATE - since writing this, the god himself, Martin Fowler, has [blogged about using a Rules engine](http://martinfowler.com/bliki/RulesEngine.html). Most rule engines that I have seen are viewed as a black box by system code. If I were to build a domain model, I would p...
[ 0.7068802714347839, 0.5957136154174805, 0.0683460533618927, -0.0013876617886126041, -0.03341452032327652, -0.16426517069339752, 0.7524324059486389, -0.4631410539150238, -0.3727261424064636, -0.5510868430137634, 0.10596705973148346, 0.34663185477256775, -0.48287299275398254, 0.0611210539937...
domain model, but this appears to weaken my domain model (as was pointed out in the question). Why? Because instead of consistently enforcing my business rules across all systems at all times, I am relying on system programmers to determine when the business rules should be enforced (by calling the rule service). This ...
[ 0.421784907579422, 0.05007224529981613, 0.3076378107070923, 0.3025189936161041, -0.07686149328947067, -0.41244566440582275, 0.2779987156391144, -0.1439024806022644, -0.4751288592815399, -0.6213891506195068, -0.036749739199876785, 0.6642738580703735, -0.47967463731765747, 0.0619435720145702...
an insurance company may need to classify the risk of underwriting an applicant and arrive at a premium. You could place these types of business rules in your domain model, but a centralized decision for scenarios like this are usually desirable and, actually, fit quite well into a service-oriented architecture. This d...
[ 0.6158042550086975, 0.1054798811674118, 0.20301002264022827, 0.28468379378318787, 0.32709506154060364, -0.39433223009109497, 0.04039183259010315, -0.26427215337753296, -0.33148378133773804, -0.5907087326049805, 0.09164275974035263, 0.7008230686187744, -0.0688246563076973, -0.02133468538522...
without restarting your system or deploying new executable code (regardless of what promises you receive from a vendor, do make sure you test your changes in a non-production environment because, even if the rule engine is flawless, humans are still changing the rules). If you're thinking, "I can do that by using a dat...
[ 0.615510880947113, 0.03593766689300537, -0.07009680569171906, 0.47168615460395813, 0.1527608186006546, -0.48341256380081177, 0.46515095233917236, -0.2631126642227173, -0.3607364594936371, -0.4386792480945587, 0.024347534403204918, 0.6501538753509521, -0.08422841876745224, 0.143457770347595...
this a step further by letting you create templates so that business users can fill in the blanks instead of learning a rule language. One parting caution about templates: templates can never take less time than writing a rule without a template because the template must, at the bare minimum, describe the rule. Plan ...
[ 0.7157057523727417, -0.01874851994216442, -0.04399038106203079, 0.4593448340892792, 0.18910783529281616, -0.5064876079559326, 0.2795141637325287, -0.24962875247001648, -0.2906266450881958, -0.7715668082237244, 0.21546342968940735, 0.6958612203598022, -0.1525290161371231, -0.071970343589782...
I'm a web developer with no formal computing background behind me, I've been writing code now some years now, but every time I need to create a new class / function / variable, I spend about two minutes just deciding on a name and then how to type it. For instance, if I write a function to sum up a bunch of numbers. S...
[ 0.5701326727867126, 0.2981671988964081, -0.008594298735260963, -0.0967894122004509, -0.1837952435016632, 0.13448360562324524, 0.17058053612709045, -0.11414188891649246, -0.22093917429447174, -0.599656343460083, -0.0861932635307312, 0.2525119185447693, -0.02527133747935295, 0.22684673964977...
in camel notation with the first letter capitalized ``` public class MyClass ``` Functions and Methods in C# should act in a similar fashion except for private methods ``` public void MyMethod() private void myPrivateMethod() ``` Variables I tend to do a little differently: Member Variables ``` private int _cou...
[ -0.010070041753351688, -0.05621069297194481, 0.12249608337879181, 0.13074526190757751, -0.2577816843986511, 0.15318968892097473, -0.06352707743644714, 0.08292865753173828, 0.11485949903726578, -0.49469825625419617, -0.1081579253077507, 0.7135224938392639, -0.3801863193511963, 0.13505615293...
I've seen various options for URL rewriting here on Stack Overflow, and other places on the web, but was curious to see if there were other options. This is speculation, as Cookies and URL Rewriting are the big two, but technologically, I think it'd be possible to: * do some massive hackery with javascript that captur...
[ 0.5805801153182983, 0.22540530562400818, -0.019535962492227554, 0.2796379327774048, -0.15853005647659302, -0.270287424325943, 0.23783241212368011, 0.10412446409463882, -0.29020562767982483, -0.5444182753562927, -0.004264547489583492, 0.5306546092033386, -0.037235476076602936, 0.03846979141...
I have an archiving process that basically deletes archived records after a set number of days. Is it better to write a scheduled SQL job or a windows service to accomplish the deletion? The database is mssql2005. Update: ------- To speak to some of the answers below, this question is regarding an in house applicati...
[ 0.058469176292419434, 0.14000284671783447, 0.4133519232273102, 0.1835879683494568, 0.27439096570014954, -0.2875215411186218, 0.15819789469242096, 0.09685925394296646, -0.5607926249504089, -0.6384133696556091, 0.13297352194786072, 0.4159505069255829, -0.0796518549323082, 0.5026652216911316,...
to resources outside the database. So it depends on what you want to do,,,
[ 0.738736093044281, -0.03782418370246887, 0.21529056131839752, 0.4468492567539215, 0.49264803528785706, 0.06370380520820618, -0.1691586673259735, 0.007525390945374966, -0.22613491117954254, -0.6381148099899292, 0.14249365031719208, 0.7336956858634949, 0.19552534818649292, -0.011055042035877...
I'd like something like ``` int minIndex = list.FindMin(delegate (MyClass a, MyClass b) {returns a.CompareTo(b);}); ``` Is there a builtin way to do this in .NET? Try looking at these: [Min](http://msdn.microsoft.com/en-us/library/bb909313.aspx) [Max](http://msdn.microsoft.com/en-us/library/bb909073.aspx) As long...
[ 0.10639515519142151, -0.2202080488204956, 0.15787899494171143, 0.0832526907324791, 0.183611661195755, -0.04318526014685631, 0.10429561138153076, 0.0494413748383522, -0.1102491244673729, -0.9012011289596558, 0.11575454473495483, 0.3315011262893677, -0.274178147315979, 0.4178965985774994, ...
In the following code, used to get a list of products in a particular line, the command only returns results when I hard code (concatenate) `productLine` into the SQL. The parameter substitution never happens. ``` + "lineName = '@productLine' " + "and isVisible = 1 "; ...
[ 0.32653743028640747, -0.27994629740715027, 0.5540857911109924, -0.36560675501823425, 0.24665890634059906, -0.054749198257923126, 0.21109305322170258, -0.40301862359046936, 0.15751229226589203, -0.28935182094573975, -0.1805407851934433, 0.4155089259147644, -0.18922805786132812, 0.2831312716...
new MySqlDataAdapter(sql, msc); adap.SelectCommand.Parameters.Add("@productLine", productLine); ``` ``` + "lineName = ?productLine " + "and isVisible = 1 "; MySqlDataAdapter adap = new MySqlDataAdapter(sql, msc); adap.SelectCommand.Parameters.Add("?productLine", p...
[ -0.1331862211227417, -0.2341427057981491, 0.5174176096916199, -0.11761032789945602, -0.048164378851652145, 0.35990527272224426, 0.21289639174938202, -0.4210222363471985, -0.11101260781288147, -0.3766930401325226, -0.3982803225517273, 0.1976531445980072, -0.5301153659820557, 0.3227169811725...
I'd trying to style my ComboBoxes to match the rest of the UI but I'm having problems with the IsMouseOver highlighting. It highlights with the color I specify for a second and then fades back to the default color, kind of a cool effect but not what I'm going for. Here is my style: ``` <Style TargetType="ComboBox"> ...
[ 0.39756226539611816, -0.46480411291122437, 0.3554307520389557, -0.27131256461143494, 0.018716588616371155, -0.0024626259692013264, 0.02260465733706951, -0.5280134081840515, 0.05672973394393921, -1.0024949312210083, 0.028485935181379318, 0.603106677532196, -0.3005830943584442, -0.2831772863...
to make the background color stay? The problem is indeed due to the default template for the ComboBox. If you use [Reflector](http://www.red-gate.com/products/reflector/) to open the PresentationFramework.Aero assembly you can take a look at the ButtonChrome class. There is a method called OnRenderMouseOverChanged that...
[ 0.5619942545890808, -0.20800797641277313, 0.5152956247329712, -0.04606535658240318, -0.03886917978525162, -0.198465034365654, -0.04748186841607094, -0.3985508382320404, -0.06779709458351135, -0.796914279460907, -0.02472534589469433, 0.6328381299972534, -0.31763672828674316, 0.0126531468704...
TargetType="{x:Type ComboBox}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ComboBox}"> <!-- Template Here --> </ControlTemplate> </Setter.Value> </Setter> </Style> ```
[ 0.23868010938167572, -0.2388729304075241, 0.2855498492717743, 0.005264118779450655, -0.07899551838636398, -0.05887198448181152, -0.22038602828979492, -0.48244962096214294, 0.38379305601119995, -0.6250428557395935, -0.04792751371860504, 0.5298384428024292, -0.2566295862197876, -0.0681422129...
I'm currently using [Magpie RSS](http://magpierss.sourceforge.net/) but it sometimes falls over when the RSS or Atom feed isn't well formed. Are there any other options for parsing RSS and Atom feeds with PHP? Your other options include: * [SimplePie](http://simplepie.org/) * [Last RSS](http://lastrss.oslab.net/) * [P...
[ 0.5673879981040955, -0.047575198113918304, 0.2856295704841614, -0.04717101901769638, -0.20516261458396912, -0.13221155107021332, 0.30745917558670044, 0.05508154258131981, -0.47981423139572144, -0.6663237810134888, 0.022898858413100243, 0.4695504605770111, -0.6744466423988342, -0.0324557349...
I have the following HTML node structure: ``` <div id="foo"> <div id="bar"></div> <div id="baz"> <div id="biz"></div> </div> <span></span> </div> ``` How do I count the number of immediate children of `foo`, that are of type `div`? In the example above, the result should be two (`bar` and `baz`). ``` $("...
[ -0.10551169514656067, 0.16470900177955627, 0.4087492823600769, -0.46834221482276917, -0.22707213461399078, 0.3600940704345703, 0.16894489526748657, -0.39762234687805176, 0.08018545806407928, -0.6686816215515137, -0.13567154109477997, 0.15186645090579987, -0.40678671002388, 0.01090705674141...
I'm looking for a good JavaScript RegEx to convert names to proper cases. For example: ``` John SMITH = John Smith Mary O'SMITH = Mary O'Smith E.t MCHYPHEN-SMITH = E.T McHyphen-Smith John Middlename SMITH = John Middlename SMITH ``` Well you get the idea. Anyone come up with a comprehensive solution? Something...
[ 0.24577133357524872, 0.21959061920642853, 0.07670607417821884, -0.31163957715034485, 0.15735426545143127, 0.5309891104698181, 0.47283121943473816, -0.26489514112472534, -0.2945575714111328, -0.5613024234771729, -0.032508328557014465, 0.46948328614234924, -0.37001046538352966, 0.42487117648...
ret.push(prefix.substr(1).toLowerCase()); } ret.push(word.charAt(0).toUpperCase()); ret.push(word.substr(1).toLowerCase()); return ret.join(''); } var pattern = /\b(ma?c)?([a-z]+)/ig; return name.replace(pattern, replacer); } ```
[ -0.037905801087617874, -0.20150811970233917, 0.8236961960792542, -0.7817996740341187, 0.13370515406131744, 0.4204725921154022, 0.6662464737892151, -0.46141329407691956, -0.2841765582561493, -0.5066606402397156, -0.8056924343109131, 0.3359047770500183, -0.52079838514328, 0.31364211440086365...
If I grant execute permissions to a role via ``` GRANT EXECUTE ON [DBO].[MYPROC] TO MY_ROLE ``` what's the equivalent syntax to remove them? REVOKE EXECUTE ON [DBO].[MYPROC] TO MY\_ROLE
[ -0.029813334345817566, 0.009477066807448864, 0.3226420283317566, -0.35372865200042725, 0.31872451305389404, 0.09692184627056122, 0.39554494619369507, -0.3520232141017914, 0.06432171911001205, -0.3127456307411194, -0.47228381037712097, 0.5034148097038269, -0.3512569069862366, 0.056954015046...
I'm trying to export a Crystal Report to an HTML file, but when I call the Export method, I immediately get this error: > **Source**: Crystal Reports ActiveX Designer > > > **Description**: Failed to export the report. I have tried both crEFTHTML40 and crEFTHTML32Standard as export format types - and both result i...
[ -0.26062068343162537, 0.3163006901741028, 0.47523391246795654, -0.3763680160045624, -0.42584264278411865, 0.016085881739854813, 0.37086209654808044, -0.19364111125469208, -0.3191938102245331, -0.5813570022583008, -0.15903612971305847, 0.6106457114219666, -0.5685600638389587, 0.166252970695...
what you have in the `[...]` section but your code should include a call to open the report with an instance of the CRAXDRT Application. ``` Dim objCRReport As CRAXDRT.Report '*********************************** Dim objCRApp As New CRAXDRT.Application objCRReport = objCRApp.OpenReport("<YOUR REPORT FILENAME>", 1) '*...
[ -0.1678188443183899, 0.3332897126674652, 0.8395954966545105, 0.00327025237493217, -0.06696820259094238, -0.09737344086170197, 0.17462176084518433, -0.394902765750885, -0.38267871737480164, -0.47394058108329773, -0.41506949067115784, 0.7585737705230713, -0.349448561668396, 0.081949263811111...
I'm writing an application using Qt4. I need to download a very short text file from a given http address. The file is short and is needed for my app to be able to continue, so I would like to make sure the download is blocking (or will timeout after a few seconds if the file in not found/not available). I wanted to...
[ 0.2776159346103668, -0.025847770273685455, 0.15792472660541534, 0.01972445473074913, -0.015100626274943352, -0.09207803010940552, 0.518653392791748, 0.28010985255241394, 0.031119780614972115, -0.8291746377944946, -0.22800013422966003, 0.4468863010406494, -0.33724865317344666, 0.26693496108...
after a timeout. But I cannot make it work : ``` class JSHttpGetterThread : public QThread { Q_OBJECT public: JSHttpGetterThread(QObject* pParent = NULL); ~JSHttpGetterThread(); virtual void run() { m_pHttp = new QHttp(this); connect(m_pHttp, SIGNAL(requestFinished(int, bool)), this, SLOT(onReques...
[ 0.04604284465312958, -0.2223370522260666, 0.7401571869850159, -0.1257845014333725, 0.3998165726661682, 0.1465388536453247, 0.6069731116294861, -0.4127877950668335, -0.20426422357559204, -0.5690596699714661, -0.7495068907737732, 0.6612919569015503, -0.3434416651725769, 0.22527264058589935, ...
m_DownloadedFileContent.append(m_GetBuffer.buffer()); } }; ``` In the method creating the thread to initiate the download, here is what I'm doing : ``` JSHttpGetterThread* pGetter = new JSHttpGetterThread(this); pGetter->start(); pGetter->wait(); ``` But that doesn't work and my app keeps waiting. It looks lit t...
[ -0.02755763754248619, -0.05774370953440666, 0.8610694408416748, -0.18735572695732117, 0.29703330993652344, -0.059582047164440155, 0.5401889681816101, -0.12348466366529465, -0.3415403962135315, -0.7570350170135498, -0.30992332100868225, 0.677998423576355, -0.5192763805389404, 0.317063838243...
I realize this would violate convention, but I'm curious to know if you can do this through configuration. **Edit: I understand why I wouldn't want to do this. BUT, I do want to understand the internals of this time of project.** No you cannot rename this folder and have it actually contain executable code. The web pr...
[ 0.6519096493721008, 0.11378713697195053, -0.20785149931907654, 0.22684168815612793, 0.11204887926578522, -0.4181336462497711, 0.2940981686115265, 0.340121328830719, -0.23094849288463593, -0.8011261224746704, -0.04729332774877548, 0.41249188780784607, 0.036501478403806686, 0.334156572818756...
Assuming a table of tags like the stackoverflow question tags: > TagID (bigint), QuestionID (bigint), Tag (varchar) What is the most efficient way to get the 25 most used tags using LINQ? In SQL, a simple GROUP BY will do: ``` SELECT Tag, COUNT(Tag) FROM Tags GROUP BY Tag ``` I've written some LINQ that works: ``...
[ 0.0418538935482502, 0.013450325466692448, 0.3861316442489624, 0.1888837069272995, -0.12467622756958008, -0.16307693719863892, -0.016813993453979492, -0.6509403586387634, -0.011610686779022217, -0.5106633305549622, -0.050201788544654846, 0.526665985584259, -0.43170127272605896, -0.312404125...
Isn't this mega-verbose? The sad thing is that I'm doing this to save a massive number of queries, as my Tag objects already contain a Frequency property that would otherwise need to check back with the database for every Tag if I actually used the property. So I then parse these anonymous types *back* into Tag object...
[ 0.36684587597846985, 0.21005237102508545, 0.4670405089855194, 0.08537861704826355, 0.11612783372402191, -0.2499941885471344, 0.14339540898799896, -0.4173935651779175, -0.2098931074142456, -0.4016202986240387, -0.05395914614200592, 0.5669693946838379, -0.3864535391330719, 0.0670996978878974...
and will send to your db will look just like the SQL you started with, so while you're doing a bit more typing, your database isn't doing any more work.
[ 0.37987464666366577, -0.07152355462312698, 0.32612279057502747, 0.2955334186553955, -0.10313066095113754, -0.24312041699886322, -0.025784309953451157, -0.030801493674516678, 0.06422413140535355, -0.6989264488220215, 0.1907261312007904, 0.36361363530158997, -0.20554092526435852, 0.181692704...
I've heard that there are some things one cannot do as a computer programmer, but I don't know what they are. One thing that occurred to me recently was: wouldn't it be nice to have a class that could make a copy of the source of the program it runs, modify that program and add a method to the class that it is, and the...
[ 0.6073583960533142, 0.0727795660495758, -0.07865707576274872, 0.15471558272838593, -0.030202828347682953, 0.01755988411605358, 0.0799315795302391, -0.03334731236100197, -0.21699465811252594, -0.5028365254402161, 0.2867600619792938, 0.46497589349746704, -0.39369669556617737, 0.1563026458024...
[self-modifying code](http://en.wikipedia.org/wiki/Self-modifying_code). Here's a quine (formatted, use the output as the new input): ``` #include<stdio.h> main() { char *a = "main(){char *a = %c%s%c; int b = '%c'; printf(a,b,a,b,b);}"; int b = '"'; printf(a,b,a,b,b); } ``` Now if you're just looking for thi...
[ -0.01581989787518978, 0.402537077665329, 0.06776227802038193, -0.3907840847969055, -0.23020215332508087, 0.2168983668088913, 0.5843084454536438, -0.24182899296283722, -0.25884947180747986, -0.0985443964600563, -0.4253014624118805, 0.7651057243347168, -0.7002977132797241, 0.1601538360118866...
I have an SQLite table that contains a BLOB I need to do a size/length check on. How do I do that? According to documentation `length(blob)` only works on texts and will stop counting after the first NULL. My tests confirmed this. I'm using SQLite 3.4.2. I haven't had this problem, but you could try `length(hex(glob))...
[ 0.033177636563777924, 0.17651759088039398, 0.8439491987228394, -0.3640430271625519, -0.19261212646961212, 0.19750124216079712, 0.09090108424425125, -0.04072418063879013, -0.35382336378097534, -0.39213547110557556, 0.28188279271125793, 0.5057215094566345, -0.47057199478149414, 0.16318263113...
I read all over the Internet (various sites and blogs) about version control. How great it is and how all developers NEED to use it because it is very useful. Here is the question: do I really need this? I'm a front-end developer (usually just HTML/CSS/JavaScript) and I NEVER had a problem like "Wow, my files from yes...
[ 0.50057053565979, 0.14530710875988007, -0.02334609068930149, -0.012531952001154423, -0.3190373480319977, -0.4139363169670105, 0.1652076691389084, 0.5371402502059937, -0.3911946415901184, -0.3923667371273041, -0.027791688218712807, 0.6622014045715332, -0.22216057777404785, 0.294763892889022...
(but it never is too late for this, right?). So, should I start and struggle to learn to use Subversion (or something similar?) Or it's just a waste of time? --- Related question: [Good excuses NOT to use version control](https://stackoverflow.com/questions/132520/good-excuses-not-to-use-version-control#132522). Here...
[ 0.4683079421520233, 0.009007264859974384, 0.42080315947532654, 0.2306165099143982, 0.07189467549324036, -0.34224915504455566, 0.36805954575538635, 0.03459766507148743, -0.47470906376838684, -0.45389053225517273, -0.228444904088974, 0.5076978802680969, -0.10083645582199097, 0.14739280939102...
you're doing to make an urgent but more minor change to the site. You're not done with the larger task, so it's not ready to go live, and the client can't wait for the smaller change. But he also wants the minor change to be merged into your work for the larger change. > > > Maybe you are working on the large task in...
[ 0.5036850571632385, -0.1916412115097046, 0.1178610771894455, -0.01591193862259388, 0.1855783760547638, 0.01285548135638237, 0.08668425679206848, 0.056043531745672226, -0.5551173090934753, -0.7474761009216309, 0.0646231546998024, 0.48858681321144104, -0.10755180567502975, 0.0592621043324470...
The client calls back with further refinement requests. You do this too and deploy it. All is well. > > > Now you have to merge it into the work in progress for the major change. What did you change for the urgent work? You were working too fast to keep notes. And you can't just diff the two directories easily now th...
[ 0.29308077692985535, -0.3404040038585663, 0.462979793548584, 0.27144792675971985, 0.13621973991394043, -0.04981909319758415, -0.008306225761771202, 0.012968243099749088, -0.6380988359451294, -0.6484020948410034, -0.13684876263141632, 0.6562780141830444, 0.10457884520292282, 0.1113119125366...
merge the branch back into the main line when it's done. * You can compare whole sets of files to other branches or to past revisions to see what's different. * You can track work over time (which is great for reporting and invoicing by the way). * You can recover any revision of any file based on date or on a mileston...
[ 0.2074570208787918, -0.3661527931690216, 0.17213819921016693, 0.39916911721229553, 0.027236048132181168, -0.24189037084579468, 0.24447129666805267, -0.07506384700536728, -0.5422450304031372, -0.3980328440666199, -0.27857914566993713, 0.3989371657371521, 0.010729086585342884, 0.037661787122...
by Mike Mason or "[Pragmatic Version Control Using Git](http://www.pragprog.com/titles/tsgit/pragmatic-version-control-using-git)" by Travis Swicegood.
[ -0.0815330520272255, 0.16950921714305878, -0.034889426082372665, 0.28769969940185547, -0.08540201187133789, 0.3145330250263214, 0.467263400554657, 0.12044019252061844, 0.03514137119054794, -0.3375095725059509, -0.6478742361068726, 0.44903647899627686, -0.06227704882621765, -0.2306843400001...
I am in a process of designing a custom SharePoint application. On a previous project, all the data was kept in SharePoint lists and that's the way I've been trying now. But, I'm getting to the point where the data model grows and I feel a need to normalize it and split one logical entity into several physical lists. I...
[ 0.3951704204082489, 0.04733261093497276, 0.532021164894104, 0.2016841471195221, -0.03660321980714798, -0.03506068140268326, 0.024439522996544838, -0.15785807371139526, -0.5353412628173828, -0.7995725870132446, 0.24028538167476654, 0.30817899107933044, -0.10929597914218903, 0.48128768801689...
suffer once I have to query joined data (if it stays in `SPList`s). If you have any insight or experience with this problem, please share. Thanks. It depends on your requirements, but from my experience here are the cases when you should use database instead of lists: 1) When you have a many-to-many relationship in...
[ 0.1183403953909874, -0.12011227756738663, 0.36802974343299866, 0.1304766982793808, -0.4700203835964203, -0.1273466795682907, 0.252837598323822, -0.239994615316391, -0.5176191329956055, -0.8977044224739075, 0.2052169144153595, 0.5578581094741821, -0.2943519055843353, 0.055207666009664536, ...
should stick to your own database. When you are using database entities the best approach is to develop your own web parts since BDC is expensive and very limited for most cases. You can also check 3rd party web parts (e.g. Bamboo Web Parts) --- Here are the reasons to use SharePoint lists over database: * Permiss...
[ 0.597969651222229, 0.150647833943367, -0.10388632863759995, 0.4538266956806183, 0.02782575786113739, -0.22539281845092773, 0.10290289670228958, -0.19387339055538177, -0.36742284893989563, -0.34380340576171875, -0.02167908102273941, 0.15309378504753113, 0.029300851747393608, -0.241088375449...
Here is the question: **Can TortoiseSvn work on Windows 2008 without turning off User Account Control?** Here is the story: I just moved my test server to Windows 2008 and I am having problems with TortoiseSvn. I am logged on as an administrator, but when I go to update some code from the Subversion repository, I ...
[ -0.062222424894571304, 0.3403499722480774, 0.1653027981519699, -0.2672693431377411, -0.02589796483516693, 0.07521263509988785, 0.5603415369987488, -0.02684677392244339, -0.39597567915916443, -0.297290176153183, 0.08336155116558075, 0.8542144894599915, 0.15067215263843536, 0.034764084964990...
that I have a permissions problem. Running **svn status** from a command prompt shows me that the directories are locked and running **svn cleanup** fails just like the tortoise cleanup did. But when I launch the command prompt as an administrator, I can run **svn cleanup** with out a problem and I can run **svn up** a...
[ -0.02240917645394802, 0.33735963702201843, 0.2750391960144043, -0.09915309399366379, 0.08574026077985764, -0.20759044587612152, 0.4700886607170105, 0.020500890910625458, -0.5066044330596924, -0.4621036648750305, -0.28704407811164856, 0.7876426577568054, -0.31816568970680237, 0.363472282886...
it run as administrator. Any suggestions? right-click on your working copy c:\dev folder, select "properties" from the context menu. In the properties dialog, go to the security tab. You will notice that the Admin user doesn't have full access (the user is not listed there). Add the Admin user and give it full access...
[ 0.28030267357826233, -0.022996515035629272, 0.5304335951805115, 0.2608162760734558, 0.14839598536491394, -0.42854341864585876, 0.04950762167572975, 0.10598429292440414, -0.08074535429477692, -0.7503272294998169, -0.4005691707134247, 0.7335387468338013, -0.2704746723175049, 0.29419785737991...
that user manually.
[ 0.23970933258533478, 0.3801327049732208, 0.11424680799245834, 0.18239957094192505, 0.07032817602157593, 0.07228460162878036, 0.23913492262363434, 0.042291246354579926, 0.1578742414712906, -0.2607736885547638, -0.31626132130622864, 0.7129412293434143, -0.044908080250024796, -0.0023713405244...
I tried this: ``` ALTER TABLE My.Table DROP MyField ``` and got this error: -MyField is not a constraint. -Could not drop constraint. See previous errors. There is just one row of data in the table and the field was just added. **EDIT:** Just to follow up, the sql was missing COLUMN indeed. Now I get even more s...
[ -0.09491103887557983, 0.3200432062149048, 0.2976878583431244, 0.062215786427259445, -0.002641546307131648, -0.10814671963453293, 0.08646667003631592, -0.043260782957077026, -0.5895516872406006, -0.4833334684371948, 0.22240357100963593, 0.693764328956604, -0.36683058738708496, -0.2397703230...
solved your original problem - for your new problem (The object 'some\_object\_\_somenumbers' is dependent on column 'MyField') it means you have a dependancy issue. Something like an index, foreign key reference, default value, etc. To drop the constraint use: ``` ALTER TABLE TableName DROP ConstraintName ``` Also ...
[ -0.44643694162368774, 0.06749837845563889, 0.5113649368286133, 0.12579099833965302, 0.24623651802539825, 0.04017340764403343, 0.04045771807432175, 0.022318726405501366, -0.6297999620437622, -0.09785085171461105, -0.3568495512008667, 0.5257172584533691, -0.568997323513031, 0.085595138370990...
I use Eclipse with "external" projects - i.e. projects created from existing source. Poking around in the workspace files, I cannot find any reference to these projects. My question is: how does Eclipse keep track of these projects? I'd like to be able to add such a project to the workspace automatically (by generati...
[ 0.5789037346839905, 0.2663674056529999, 0.009665059857070446, -0.09243501722812653, -0.2196318507194519, -0.164500430226326, -0.0169559083878994, -0.28286656737327576, -0.3256705701351166, -0.3261302709579468, -0.2981893718242645, 0.5771452784538269, -0.04726496338844299, -0.01268624607473...
afterwards.
[ -0.09320729970932007, -0.05130957439541817, 0.05685623735189438, 0.03413723036646843, 0.07776056230068207, 0.21708205342292786, 0.23099158704280853, 0.18150989711284637, -0.1962430775165558, -0.1642887443304062, -0.1480376422405243, 0.3322431445121765, 0.34385040402412415, 0.00914218742400...
I am developing an iPhone application that persists data to a SQLite3 database. For each row I persist I wish to include a 'created date' and a 'last modified date' My question is what is the recommend approach for storing this information in a table? The properties are represented as NSDate in my application but ...
[ 0.1961519867181778, 0.29104968905448914, 0.40004757046699524, -0.19766157865524292, 0.08558431267738342, 0.0711212307214737, 0.4474138915538788, -0.046366821974515915, -0.3197891414165497, -0.5673397183418274, 0.08012568205595016, 0.05753133445978165, -0.3826511800289154, 0.245416760444641...
timeIntervalSince1970]); ``` where dateObject is an NSDate\*. Then, when getting the data out of the DB, use ``` [NSDate dateWithTimeIntervalSince1970:doubleValueFromDatabase]; ```
[ 0.05212023854255676, -0.3216627836227417, 0.4315687119960785, -0.4035665988922119, 0.1301296055316925, -0.11296990513801575, 0.19843511283397675, -0.2400219738483429, -0.0789751410484314, -0.6451294422149658, -0.31490394473075867, 0.1896398812532425, -0.2161707729101181, 0.2704498469829559...
In C++, a function's signature depends partly on whether or not it's const. This means that a class can have two member functions with identical signatures except that one is const and the other is not. If you have a class like this, then the compiler will decide which function to call based on the object you call it o...
[ 0.18200013041496277, -0.17524223029613495, -0.08452268689870834, -0.11433196812868118, -0.04111507162451744, -0.16733354330062866, -0.042978279292583466, -0.07971782237291336, 0.013943564146757126, -0.26587188243865967, -0.2803858518600464, 0.47071176767349243, -0.5491585731506348, -0.1426...
only makes sense when the member function returns a pointer or a reference to a data member of your class (or a member of a member, or a member of a member of a member, ... etc.). Generally returning non-const pointers or references to data members is frowned upon, but sometimes it is reasonable, or simply very conveni...
[ -0.015146446414291859, -0.20477294921875, 0.31587743759155273, 0.32612380385398865, 0.01786564476788044, -0.32193875312805176, 0.16751137375831604, 0.10518915951251984, -0.13595694303512573, -0.4948585033416748, -0.42094483971595764, 0.6075335144996643, -0.43563345074653625, 0.206562578678...
it const or non-const.
[ -0.5220729112625122, 0.03895139694213867, 0.539848268032074, 0.06354167312383652, -0.11375159025192261, -0.0006040470907464623, -0.10476084053516388, 0.19320560991764069, 0.030847152695059776, -0.3409225344657898, -0.22046661376953125, 0.3621250092983246, -0.29073306918144226, 0.1930911689...
I am developing a C# program, and i have one function that consumes too much CPU. I would like to know a way to control this by code (not with any external application) and restrict the percentage of CPU usage. For example, if it uses 90% of the CPU usage, to make my app consume only a 20%, even if it becomes slower. ...
[ 0.550800085067749, 0.21059460937976837, -0.06746704876422882, 0.11193543672561646, 0.1243082582950592, 0.1649479866027832, 0.2512861490249634, 0.1639750599861145, -0.1247360110282898, -0.6329125761985779, 0.06983483582735062, 0.6564912796020508, -0.29924583435058594, 0.04538213089108467, ...
the [Priority](http://msdn.microsoft.com/en-us/library/system.threading.thread.priority.aspx) property. You would set that by: ``` Thread.CurrentThread.Priority = ThreadPriority.Lowest; ``` Also, I don't think you really want to cap it. If the machine is otherwise idle, you'd like it to get busy on with the task, ri...
[ -0.16557496786117554, -0.3316894471645355, 0.42284059524536133, 0.06298186630010605, 0.25693902373313904, -0.025418315082788467, -0.30096378922462463, 0.23732471466064453, -0.6194228529930115, -0.40845489501953125, -0.14930002391338348, 0.37522226572036743, -0.20946137607097626, 0.45164763...
I want to fade out an element and all its child elements after a delay of a few seconds. but I haven't found a way to specify that an effect should start after a specified time delay. ``` setTimeout(function() { $('#foo').fadeOut(); }, 5000); ``` The 5000 is five seconds in milliseconds.
[ 0.41560882329940796, -0.14768023788928986, 0.6214034557342529, -0.3065756857395172, 0.3613535761833191, 0.16254670917987823, 0.3425842523574829, -0.4612802267074585, 0.030248546972870827, -0.2706160843372345, -0.09481530636548996, 0.29809412360191345, -0.16738495230674744, 0.17528240382671...
I'm trying to figure out why my app's TCP/IP connection keeps hiccuping every 10 minutes (exactly, within 1-2 seconds). I ran Wireshark and discovered that after 10 minutes of inactivity the other end is sending a packet with the reset (RST) flag set. A google search tells me "the RESET flag signifies that the receiver...
[ 0.43496057391166687, 0.04320518299937248, 0.49501124024391174, 0.09613785892724991, -0.048839304596185684, -0.2703145444393158, 0.6293764710426331, 0.3091905117034912, -0.4678559899330139, -0.3355659246444702, -0.028709469363093376, 0.15420638024806976, -0.4127170741558075, 0.2797458171844...
from the other endpoint? **Edit:** There is a router (specifically a Linksys WRT-54G) sitting between my computer and the other endpoint -- is there anything I should look for in the router settings? A 'router' could be doing anything - particularly NAT, which might involve any amount of bug-ridden messing with traffi...
[ 0.51348477602005, 0.07971885055303574, 0.3382932245731354, 0.15498189628124237, -0.0994592234492302, -0.32345107197761536, 0.13858763873577118, 0.1677553653717041, -0.43082886934280396, -0.3112659752368927, -0.15504704415798187, 0.3493151068687439, -0.5087125897407532, 0.16990990936756134,...
attempt to block traffic. (Some 'national firewalls' work like this, for example.)
[ 0.789186418056488, 0.1928977221250534, 0.297128826379776, 0.044838547706604004, -0.05302931368350983, -0.11114896088838577, 0.598293662071228, 0.17892678081989288, -0.37806785106658936, -0.5636342763900757, -0.5027880668640137, 0.1683986932039261, -0.3824504017829895, -0.13668446242809296,...
Ok I have an `apache IBM HTTP Server WAS 6.1` setup I have my `certs` correctly installed and can successfully load `http` and `https` pages. After a successful `j_security_check` authentication via `https`, I want the now authorized page (and all subsequent pages) to load as `http`. I want this all to work with `m...
[ 0.33983275294303894, 0.3307536840438843, 0.7815952897071838, -0.11789499968290329, -0.049111831933259964, -0.3286193013191223, 0.6524303555488586, -0.3833617866039276, -0.23589961230754852, -0.7899594306945801, -0.24599263072013855, 0.6361475586891174, -0.1645759791135788, 0.14767749607563...
<<-- this rule is working RewriteCond %{HTTPS} =on RewriteCond %{THE_REQUEST} !login\.jsp.*action=init [OR] RewriteCond %{THE_REQUEST} !login\.jsp.*action=submit RewriteRule .* http://%{SERVER_NAME}%{REQUEST_URI} [R,L] <--- this rule is not working or the condition is not returning true ``` I know the `[R,L]` will f...
[ 0.11062268167734146, -0.10917282849550247, 0.7961812615394592, -0.15403343737125397, 0.2859225869178772, -0.21684204041957855, 0.7678695917129517, -0.22128397226333618, -0.23850832879543304, -0.5818834900856018, -0.28281721472740173, 0.585105299949646, -0.4607890546321869, 0.14632961153984...
by a VirtualHost container. In this example, the mod_rewrite configuration will be ignored for requests which are received on port 443: RewriteEngine On RewriteRule ^index.htm$ index.html <VirtualHost *:443> existing vhost directives </VirtualHost> Unlike most configurable features, the mod_rewr...
[ -0.056736841797828674, -0.2455747127532959, 0.7760645151138306, -0.10817085206508636, 0.4525347650051117, -0.1667308807373047, 0.4870154559612274, -0.434822678565979, -0.2256578654050827, -0.82113116979599, -0.5000476837158203, 1.0051642656326294, -0.25187936425209045, 0.26199138164520264,...
Inherit </VirtualHost> ``` Adding the Inherit declaration to my single `virtualhost` declaration that points to the machine ip and `port 443` did NOT help one bit. Now I know that my app server communicates on `9080` and `9443` respectively but I can't find a single `virtualhost` in the web server `httpd.conf`. ...
[ 0.1374373584985733, 0.054617926478385925, 0.10646190494298935, 0.24241945147514343, 0.04293131083250046, -0.46078377962112427, 0.21157383918762207, -0.35720810294151306, -0.18133385479450226, -0.7577992677688599, 0.29757454991340637, 0.6070697903633118, -0.12284453958272934, 0.276275038719...
everything somehow. This is the solution for http to https to http You have to put the condition and the rewrite rule in the virtual host like the arcticle said but for some reason inheritance didn't want to work. ``` RewriteEngine on RewriteCond %{HTTPS} !=on RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /path/login\.jsp\...
[ 0.05729792267084122, 0.022881006821990013, 0.5984253883361816, 0.24701662361621857, 0.1013127788901329, -0.18462300300598145, 0.7203612923622131, -0.11674750596284866, -0.34759727120399475, -0.7321802377700806, -0.13679422438144684, 0.4064367115497589, -0.3214315176010132, 0.31027442216873...
RewriteEngine On RewriteCond %{REQUEST_URI} /path/secure/index.jsf RewriteRule ^(.*)$ http://url/path/secure/index.jsf [R,L] </VirtualHost> ```
[ -0.07843390107154846, 0.02638241834938526, 0.9409584999084473, -0.16047358512878418, 0.18721815943717957, 0.1485414355993271, 0.6454803943634033, -0.2828824520111084, -0.31808555126190186, -0.770420253276825, -0.2241147756576538, 0.5107835531234741, -0.24936601519584656, 0.3731901943683624...
I noticed the specificaition for Collections.sort: ``` public static <T> void sort(List<T> list, Comparator<? super T> c) ``` Why is the "`? super`" necessary here? If `ClassB` extends `ClassA`, then wouldn't we have a guarantee that a `Comparator<ClassA>` would be able to compare two `ClassB` objects anyway, withou...
[ -0.022103959694504738, -0.1851692944765091, -0.1811182051897049, -0.098538838326931, -0.22553081810474396, 0.147282212972641, 0.2013929933309555, -0.4007038176059723, -0.33621424436569214, -0.42974868416786194, -0.32196328043937683, 0.26744160056114197, -0.3399633765220642, 0.0264677181839...
which you may find interesting. It talks about a mnemonic called "Pecs" (producer `extends`, consumer `super`), which explains why you use `? extends T` and `? super T` in your input parameters (only; never for return types), and when to use which.
[ 0.6888159513473511, -0.02345975488424301, 0.22838005423545837, 0.031063757836818695, 0.173401340842247, 0.07615669816732407, -0.1909317821264267, -0.05062345042824745, 0.00977299828082323, -0.34174731373786926, -0.5596216320991516, 0.518196702003479, 0.08373110741376877, 0.2693185210227966...
When I try to use `curl` or `file_get_contents` to read something like <http://example.com/python/json/> from <http://example.com/> I should be getting a JSON response, but instead I get a 404 error. Using curl or any other method outside my own domain works perfectly well. ``` echo file_get_contents('http://example.c...
[ 0.14219795167446136, 0.16143526136875153, 0.30438846349716187, -0.10926086455583572, -0.16385452449321747, -0.3009682893753052, 0.3621158301830292, -0.14367498457431793, -0.32480937242507935, -0.649375319480896, -0.42523106932640076, 0.45435217022895813, -0.4204666018486023, -0.00012555012...
'http://example.com/'); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $result = curl_exec($curl); curl_close($curl); ``` Alternatively the /etc/hosts file sets the wrong IP address for example.com.
[ 0.05574314296245575, 0.23211465775966644, 0.5510734915733337, -0.23255117237567902, 0.1026027575135231, -0.1792955845594406, 0.2606191635131836, 0.248271644115448, -0.182508647441864, -0.6365835070610046, -0.39201390743255615, 0.08231699466705322, -0.5403994917869568, 0.4651315212249756, ...
I want to get the size of a drive (or UNC path pointing to a partition would be nice, but not required), as well as free space for said drive (or UNC path). This doesn't need to work cross platform; only in Windows. I know it's easy to do in Java 6, but that's not an option; I'm stuck with Java 5. I can get the free ...
[ 0.1303110420703888, 0.19175156950950623, 0.16955941915512085, -0.010817071422934532, -0.05209122225642204, -0.2519402503967285, 0.23241852223873138, 0.02758951112627983, -0.3398715853691101, -0.7866766452789307, 0.005473122000694275, 0.4332168996334076, -0.24591153860092163, 0.177465781569...
total drive size. Any suggestions? One way to do it would be to use fsutil on the command line. It returns something like this: ``` D:\>fsutil fsinfo ntfsinfo c: NTFS Volume Serial Number : 0xd49cf9cf9cf9ac5c Version : 3.1 Number Sectors : 0x0000000004a813ff Total Cluste...
[ -0.3544829189777374, 0.04988942667841911, 0.5669772028923035, 0.03430815413594246, 0.10110580176115036, 0.21496517956256866, -0.309988409280777, 0.1892373412847519, -0.38304927945137024, -0.6923312544822693, -0.37476038932800293, 0.47916343808174133, -0.1614760011434555, 0.4345368146896362...
0x000000000095027f Free Clusters : 0x00000000002392f5 Total Reserved : 0x0000000000000490 Bytes Per Sector : 512 Bytes Per Cluster : 4096 Bytes Per FileRecord Segment : 1024 Clusters Per FileRecord Segment : 0 Mft Valid Data Length :
[ -0.4097331464290619, 0.14085926115512848, 0.3276796042919159, 0.18592481315135956, 0.31621813774108887, 0.4094991683959961, -0.1336500644683838, -0.025159941986203194, -0.3886072635650635, -0.46741655468940735, -0.39057984948158264, 0.1816807985305786, 0.1445690393447876, 0.336545169353485...
0x000000000e70c000 Mft Start Lcn : 0x00000000000c0000 Mft2 Start Lcn : 0x0000000000000010 Mft Zone Start : 0x0000000000624ea0 Mft Zone End : 0x0000000000643da0 ``` Multipy your number of sectors times
[ -0.19020266830921173, -0.254403680562973, 0.6946538090705872, -0.18199019134044647, 0.25613266229629517, 0.1351243406534195, -0.27309831976890564, -0.07089319080114365, -0.7412969470024109, -0.6352772116661072, -0.23467124998569489, 0.2196534276008606, -0.19017323851585388, 0.4247786104679...
the bytes per sector to get your size.
[ 0.28757205605506897, -0.02108442224562168, 0.23313669860363007, -0.003115053055807948, -0.08365442603826523, 0.14076712727546692, -0.4925675094127655, 0.2292274832725525, -0.6589321494102478, -0.3670559525489807, 0.029582682996988297, 0.46176615357398987, 0.1328856498003006, 0.192923069000...
Is there a way of ordering a list of objects by a count of a property which is a collection? For arguments sake let's say I have a question object with a question name property, a property that is a collection of answer objects and another property that is a collection of user objects. The users join the question tab...
[ 0.10310419648885727, 0.08193742483854294, 0.20335017144680023, 0.13286620378494263, -0.27690306305885315, -0.09048812836408615, -0.23021093010902405, -0.2931990921497345, -0.45885545015335083, -0.37446919083595276, 0.09326279908418655, 0.5552906394004822, -0.3002026379108429, 0.30360388755...
= nhelper.NHibernateSession .CreateQuery("Select q from Question q left join q.Answers a group by q,a order by count(a)") .List<Question>(); ``` but i get ``` "column Question.Name is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause" ```...
[ -0.5242850184440613, 0.28420403599739075, 0.24537695944309235, -0.29370036721229553, -0.17497991025447845, -0.06285678595304489, 0.35898518562316895, -0.5054790377616882, -0.011699724942445755, -0.2780010998249054, -0.1167408674955368, 0.33663779497146606, -0.42024052143096924, 0.374139696...
``` Question.Users.UserId ``` which doesn't solve it if included. any ideas? Forget about the term "best". No matter which hash algorithm anyone might come up with, unless you have a very limited set of data that needs to be hashed, every algorithm that performs very well on average can become completely useless if...
[ -0.0301855206489563, 0.40853509306907654, -0.11735773086547852, 0.16707605123519897, -0.006714738439768553, -0.4630228877067566, 0.43723437190055847, 0.18407760560512543, -0.1779305338859558, -0.7121409177780151, -0.17402559518814087, 0.5084284543991089, -0.18105298280715942, -0.0315599367...
a table and all strings in this table (that had a collision) are sorted alphabetically, you can search within a bucket table using binary search (which is only O(log n)) and that means, even when every second hash bucket has 4 collisions, your code will still have decent performance (it will be a bit slower compared to...
[ -0.25930503010749817, -0.05659155920147896, 0.071938656270504, 0.1535971611738205, -0.2722383737564087, 0.0528675802052021, 0.329104483127594, -0.2922627627849579, -0.6109427809715271, -0.8223505020141602, -0.037535976618528366, 0.1865629255771637, -0.2398213893175125, 0.06807227432727814,...
search can stop comparing strings after maybe one or two characters on average; making every compare very fast). Actually I had a situation myself before where searching directly within a sorted table using binary search turned out to be faster than hashing! Even though my hash algorithm was simple, it took quite some...
[ -0.4365249574184418, -0.29884883761405945, 0.4131503701210022, 0.1007499098777771, -0.27800530195236206, -0.06105099245905876, 0.42426326870918274, -0.11489792168140411, -0.38914719223976135, -0.8160824179649353, 0.027769900858402252, 0.41214168071746826, 0.01886182278394699, -0.1796963512...
showed that on every system, every CPU, the binary search was faster. Here, the fact that usually already comparing the first byte of the data was enough to lead to the next bsearch iteration (as the data used to be very different in the first one to two byte already) turned out as a big advantage. So to summarize: I'...
[ -0.22994768619537354, 0.2548825740814209, -0.06760886311531067, 0.35663938522338867, -0.19295020401477814, -0.05628278851509094, 0.20361949503421783, 0.03689570724964142, -0.3984604775905609, -0.5425231456756592, 0.13527493178844452, 0.4830450415611267, -0.0789187103509903, 0.0077538345940...
collisions do occur (and they will! They will unless your hash space is at least equal or bigger than your data space and you can map a unique hash value to every possible set of data).
[ -0.3815310001373291, 0.05584421381354332, 0.3385530412197113, 0.1969212293624878, -0.06366558372974396, -0.255321741104126, 0.3219732344150543, 0.43223005533218384, -0.38215306401252747, -0.7254354357719421, -0.49223798513412476, 0.06752683222293854, -0.4008854031562805, 0.1034852713346481...
Lets say I have an EJB application which defines some entities and relations among them. I figured the DB schema can easily be created from the entities. So now the app works but after a while a need to change some relations, e.g. a one-to-one needs to become a one-to-many, can I upgrade my DB to do so WITHOUT losing t...
[ 0.33517318964004517, 0.06523796170949936, -0.07210902869701385, 0.13490867614746094, -0.37668853998184204, -0.2143402248620987, 0.11028404533863068, -0.07406456768512726, -0.2690517008304596, -0.531403124332428, 0.11595412343740463, 0.3261317014694214, -0.18777747452259064, 0.0919092148542...
I've been a C# programmer for about 2 years total, and professionally for a little more than 1. I work at a company as a developer on an application that began before the days of .NET 2. My question is this: What is the benefit to use databinding from sql queries directly to a control over querying and manually adding...
[ 0.5684356689453125, 0.21908222138881683, -0.03987022116780281, -0.015690645202994347, -0.1766585409641266, -0.20642323791980743, 0.03236815333366394, -0.01073584333062172, -0.27533185482025146, -0.3672643303871155, 0.4001328647136688, 0.5578285455703735, -0.0129869244992733, -0.09908424317...
been assigned some bugs that deal with some controls that populate themselves based off query results, and would love to clean up unnecessary logic and push that off to the libraries to handle instead of me. Note: We are using .NET 2.0 I personally find that using the ``` control.DataSource = YourSource; control.Dat...
[ 0.02192787081003189, -0.16300436854362488, 0.21491104364395142, 0.13805949687957764, 0.11436247080564499, -0.3564298152923584, 0.30340591073036194, -0.04214022681117058, -0.2215021550655365, -0.7111350297927856, -0.0478651262819767, 0.6240413188934326, -0.22647595405578613, 0.0043425052426...
The [MSDN documentation](https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2012/c5kehkcz(v=vs.110)) says that ``` public class SomeObject { public void SomeOperation() { lock(this) { //Access instance variables } } } ``` is "a problem if the instance can be access...
[ 0.1661328822374344, -0.16162362694740295, 0.21727228164672852, -0.026738639920949936, 0.12458569556474686, -0.23138214647769928, 0.32577693462371826, 0.30004969239234924, -0.5212612748146057, -0.4186546504497528, -0.36250612139701843, 0.5112183690071106, -0.39649975299835205, 0.20446711778...
taken to consider possible deadlock situations, and having an unknown number of lock entry points hinders this. For example, any one with a reference to the object can lock on it without the object designer/creator knowing about it. This increases the complexity of multi-threaded solutions and might affect their correc...
[ 0.17246684432029724, 0.137945294380188, 0.009447574615478516, 0.20761968195438385, 0.15738500654697418, -0.42945340275764465, 0.5866057276725769, -0.07051309943199158, -0.29759088158607483, -0.26746469736099243, -0.5469278693199158, 0.31923696398735046, -0.2637377977371216, 0.2180626839399...
`this` unless it has been documented. Even then, relying on documentation to prevent a problem is sub-optimal. Finally, there is the common misconception that `lock(this)` actually modifies the object passed as a parameter, and in some way makes it read-only or inaccessible. This is **false**. The object passed as a p...
[ 0.2727243900299072, 0.28690552711486816, 0.09663186967372894, 0.13291244208812714, 0.16087572276592255, -0.4727831780910492, 0.5169128179550171, -0.09952452778816223, -0.34099721908569336, -0.2841455340385437, -0.4811413884162903, 0.4164160490036011, -0.2426566630601883, 0.4529242813587188...
the application. You should use a private variable instead, an `Object` instance will do nicely. Run the following C# code as an example. ``` public class Person { public int Age { get; set; } public string Name { get; set; } public void LockThis() { lock (this) { System....
[ 0.29908135533332825, 0.14624138176441193, 0.264334112405777, -0.1505747139453888, 0.5314639210700989, -0.00010670116898836568, 0.1584681123495102, -0.10753802955150604, -0.32068517804145813, -0.7330456376075745, -0.3271414041519165, 0.6061202883720398, -0.196550652384758, 0.409656941890716...
static void Main(string[] args) { var nancy = new Person {Name = "Nancy Drew", Age = 15}; var a = new Thread(nancy.LockThis); a.Start(); var b = new Thread(Timewarp); b.Start(nancy); Thread.Sleep(10); var anotherNancy = new Person { Name = "Nancy Drew", Age = ...
[ -0.1425144225358963, -0.33268070220947266, 0.3506190776824951, -0.41104739904403687, 0.5553762912750244, 0.32232004404067993, 0.3444420099258423, 0.23466771841049194, -0.47093793749809265, -0.4295099973678589, -0.47970280051231384, 0.034068990498781204, -0.42742952704429626, 0.870054125785...
var c = new Thread(NameChange); c.Start(anotherNancy); a.Join(); Console.ReadLine(); } static void Timewarp(object subject) { var person = subject as Person; if (person == null) throw new ArgumentNullException("subject"); // A lock does not make the object re...
[ -0.01824924349784851, -0.33695730566978455, 0.34814193844795227, -0.3117075264453888, 0.30945852398872375, 0.24609747529029846, 0.5591201186180115, -0.23943659663200378, -0.3064132332801819, -0.2248806357383728, -0.322233110666275, 0.31959444284439087, -0.4488658010959625, 0.71752208471298...
{ while (person.Age <= 23) { // There will be a lock on 'person' due to the LockThis method running in another thread if (Monitor.TryEnter(person, 10) == false)
[ 0.06948839873075485, -0.11295359581708908, 0.09432588517665863, -0.00968698225915432, 0.5996694564819336, 0.2694406509399414, 0.6461532711982727, -0.09816119074821472, -0.32802730798721313, -0.34930020570755005, -0.05886486545205116, 0.2268308848142624, -0.0620809867978096, 0.3191578090190...
{ Console.WriteLine("'this' person is locked!"); } else Monitor.Exit(person); person.Age++; if(person.Age == 18)
[ -0.1615137755870819, -0.21474336087703705, 0.4168231785297394, -0.19374491274356842, 0.7935095429420471, 0.09210018813610077, 0.502609133720398, -0.09956404566764832, -0.06912591308355331, -0.43438440561294556, -0.4142744541168213, 0.3870354890823364, -0.03661783039569855, 0.36727288365364...
{ // Changing the 'person.Name' value doesn't change the lock... person.Name = "Nancy Smith"; } Console.WriteLine("{0} is {1} years old.", person.Name, person.Age);
[ -0.038693420588970184, 0.11486287415027618, 0.18672187626361847, -0.0940387099981308, 0.7447457313537598, 0.13264930248260498, 0.35690951347351074, 0.0020429971627891064, 0.0012000956339761615, -0.10311537235975266, -0.21169273555278778, 0.18405799567699432, 0.15176407992839813, 0.65094155...