text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
big deal, I can just duplicate the code (or perhaps just remove the AddVector method since I never call it directly) but it will nag me a lot in the future when I decide to create a method for something, like splitting up a large method into several smaller ones. Don't assume that `struct` is the right choice for perfo...
[ 0.32767340540885925, 0.05402291566133499, 0.1380728781223297, 0.1317790001630783, -0.16957098245620728, -0.4417461156845093, 0.5874572396278381, 0.13715283572673798, -0.500412106513977, -0.32670655846595764, -0.012230456806719303, 0.45370912551879883, -0.24110698699951172, 0.29560658335685...
disable JIT optimizations, making your performance measurements invalid. * Compiling in Debug mode also makes performance measurements invalid.
[ 0.27401450276374817, 0.2763761281967163, -0.26065853238105774, 0.16261060535907745, -0.031586237251758575, -0.17464154958724976, 1.0844231843948364, 0.2423170953989029, -0.08662855625152588, -0.5062859654426575, -0.199336975812912, 0.5048409700393677, -0.29959872364997864, 0.01573221571743...
I need to be able to read a file format that mixes binary and non-binary data. Assuming I know the input is good, what's the best way to do this? As an example, let's take a file that has a double as the first line, a newline (0x0D 0x0A) and then ten bytes of binary data afterward. I could, of course, calculate the pos...
[ 0.5194403529167175, -0.05573613941669464, 0.2359904944896698, 0.11495839059352875, 0.21029675006866455, 0.14681242406368256, -0.003791043534874916, 0.02373577654361725, -0.18075557053089142, -0.7232954502105713, 0.25144830346107483, 0.4385306239128113, 0.03577106073498726, 0.24351313710212...
what type of data you are going to be reading before you call any of the Read methods. ``` Read(byte[], int, int) Read(char[], int, int) Read() Read7BitEncodedInt() ReadBoolean() ReadByte() ReadBytes(int) ReadChar() ReadChars() ReadDecimal() ReadDouble() ReadInt16() ReadInt32() ReadInt64() ReadSByte() ReadSingle() Rea...
[ -0.048497289419174194, 0.09315825998783112, 0.366441547870636, 0.14158907532691956, 0.2740587890148163, 0.041334982961416245, 0.24918337166309357, -0.16739878058433533, -0.23692774772644043, -0.7515084743499756, -0.17299725115299225, 0.6184935569763184, -0.1998034566640854, -0.016926364973...
Given the tables: role: roleid, name permission: permissionid, name role\_permission: roleid, permissionid I have a set of permissions, and I want to see if there is an existing role that has these permissions, or if I need to make a new one. Note that I already know the permissionid, so really the permissio...
[ -0.14094190299510956, -0.1259651780128479, 0.31113550066947937, 0.04517914354801178, 0.12596939504146576, 0.26020580530166626, -0.08196914941072464, -0.34324270486831665, -0.07404574006795883, -0.5546629428863525, 0.21817998588085175, 0.650667667388916, -0.13881617784500122, 0.120644465088...
over every role, and seeing if it has the exact permissions? Note, I'm looking for a role that has the exact set of permissions - no more, no less. You can select all roles that have the subset of permissions you are looking for. Count the number of permissions and see if it's exactly equal to the number of permission...
[ -0.29644134640693665, -0.2142823040485382, 0.49146768450737, -0.043403737246990204, 0.15015289187431335, 0.35455259680747986, -0.05407269299030304, -0.7304216027259827, -0.22302667796611786, -0.6195922493934631, -0.177679181098938, 0.7136974930763245, -0.22671979665756226, -0.0526557601988...
of permissions ```
[ 0.2518133819103241, 0.6351059675216675, 0.2851470708847046, 0.05873870477080345, 0.2761305570602417, -0.3394310176372528, 0.11793985962867737, -0.18196457624435425, -0.19632017612457275, -0.2279062569141388, -0.45973220467567444, 0.5765230059623718, -0.07313376665115356, -0.036333773285150...
I'd appreciate people's thoughts on a dilemma I've been struggling with ever since ASP.NET came out. In classic ASP, the layers of code were minimal. The ASP page contained HTML and script combined. The COM components contained business logic and [DAO](http://en.wikipedia.org/wiki/Data_access_object) infrastrcuture. T...
[ 0.143715038895607, -0.18655191361904144, -0.027674786746501923, 0.32931673526763916, -0.34285229444503784, -0.006089530419558287, -0.0024586718063801527, 0.13256582617759705, -0.4316689968109131, -0.6772264838218689, -0.19524337351322174, 0.4511552155017853, -0.23385469615459442, -0.352813...
/ user interfaces, lots of database interaction, etc. These used to be a piece of cake to understand. Now I will often encounter 5 to 10 layers of code to create a fairly simple web page. These may include ASP, code-behind, control classes, [DTO](http://en.wikipedia.org/wiki/Data_transfer_object) classes, ORM objects, ...
[ 0.30069130659103394, 0.22690944373607635, 0.22219200432300568, 0.5101521611213684, 0.13548928499221802, 0.023114092648029327, 0.15610909461975098, 0.10771408677101135, -0.44732409715652466, -0.7875634431838989, -0.3471880257129669, 0.14265279471874237, 0.15770679712295532, 0.23118416965007...
has to trace back through an inheritance hiearchy including 3 or more levels of objects and interfaces. Here is the crux: Previously, I looked at 1 ASP page and say 1 or 2 smallish objects, a few SQL queries, these got the job done and were fairly simple to maintain and understand. Now, for the same page, there may b...
[ 0.4861449897289276, 0.15619753301143646, 0.14284250140190125, 0.4621354937553406, 0.016034461557865143, 0.20572538673877716, 0.11625180393457413, -0.13209907710552216, -0.4819467067718506, -0.7859880328178406, -0.007292683236300945, 0.16052523255348206, 0.1006598100066185, 0.21158656477928...
there a way to effectively use design patterns without creating so many objects that it becomes worse spaghetti code than the old procedural paradign?* Please share your thoughts. Setting aside the possibility that these levels of abstraction are required by the organization (unlikely, but it does happen), it is very ...
[ 0.5096654891967773, 0.03495482727885246, -0.3230416476726532, 0.5080075860023499, -0.097689189016819, -0.37957003712654114, 0.4002670645713806, 0.24219833314418793, -0.42700839042663574, -0.8330414891242981, 0.22788365185260773, 0.39761778712272644, -0.0275607630610466, -0.1181823387742042...
that. Also, many mediocre developers wrongly believe that maximizing layers of abstraction and pattern use makes them better developers. Finally, many mediocre developers have been taught that they should use layers, abstractions and patterns, but have not been taught well enough to know how, when or why. So they go ...
[ 0.39909636974334717, 0.3112064301967621, -0.22214210033416748, 0.3984229862689972, 0.1857493817806244, -0.1574612408876419, 0.7903172373771667, 0.16054975986480713, -0.35008329153060913, -0.8130082488059998, -0.17190653085708618, 0.7408076524734497, 0.024218030273914337, 0.0364228151738643...
a pattern or best practice in your toolbox** that is right for the task, just like you have the right wrench for a nut. Best practices and patterns are tools - you don't get out a hammer and start swinging until you have a nail that needs to be pounded. Likewise with software development.
[ 0.625016987323761, 0.23932746052742004, -0.4623333215713501, 0.10543113201856613, -0.11451956629753113, -0.024023273959755898, 0.49643033742904663, -0.1644270122051239, -0.2865942120552063, -0.7379500269889832, 0.0818488597869873, 0.6433703303337097, 0.2953003942966461, -0.1636989861726761...
I've used [Lucene.net](http://incubator.apache.org/lucene.net/) to implement search functionality (for both database content and uploaded documents) on several small websites with no problem. Now I've got a site where I'm indexing 5000+ documents (mainly PDFs) and the querying is becoming a bit slow. I'm assuming the ...
[ 0.27072781324386597, 0.13926589488983154, 0.20745977759361267, 0.2130981683731079, -0.3658069968223572, -0.3424797058105469, -0.016163324937224388, 0.13795696198940277, -0.18189463019371033, -0.8568811416625977, -0.010515334084630013, 0.2098546326160431, 0.03135266900062561, 0.253212332725...
creating highlights for the entire results set at once, instead of just the 'page' I was displaying. Oops. I'm going to make a big assumption here and assume you're not hanging onto your index searchers in-between calls to query the index. If that's true, then you should definitely share index searchers for all querie...
[ 0.40112099051475525, -0.23051795363426208, 0.13737158477306366, 0.32788869738578796, -0.35555022954940796, -0.3372613787651062, 0.09170404821634293, 0.222587451338768, -0.6936556696891785, -0.42693233489990234, 0.27195513248443604, 0.37668702006340027, -0.21716995537281036, -0.026231937110...
parser class (it isn't thread safe). BTW, the Java docs are (I've found) just as applicable to the .net version. For more info on your problem, see here: <http://wiki.apache.org/lucene-java/ImproveSearchingSpeed>
[ -0.2920127213001251, 0.07589133083820343, 0.012884973548352718, 0.07847172021865845, -0.3166249096393585, -0.1380784809589386, 0.5577842593193054, -0.0009253164171241224, -0.18109793961048126, -0.6473104357719421, 0.05608071759343147, 0.7824341058731079, -0.3250424563884735, -0.08568404614...
I can't seem to find any way to add a horizontal separator in a MenuStrip. Visual Studio complains Cannot add ToolStropSeparator to MenuStrip. Any idea's how I can do this? I'm able to run code like this: ``` this.menuMain.Items.Add(new ToolStripSeparator()); ``` without any trouble... What kind of error are you ge...
[ 0.3782188892364502, 0.13065950572490692, 0.5019404292106628, -0.06999125331640244, -0.05274081602692604, 0.081343874335289, 0.2418612837791443, 0.0030775372870266438, -0.32747647166252136, -0.88785719871521, 0.19829638302326202, 0.736649751663208, -0.22680436074733734, 0.0741686150431633, ...
I'm trying to generate a CSS class that will help me define a "page break". I know that if I use `@media:print .MyDiv{ width:100%; height:100%; }`, I can then set the class of a `div` to `MyDiv` and it will be -- as best as possible -- 1 page of print. This is great, but I have encountered a new item that I don't kno...
[ 0.2394603192806244, 0.03988758474588394, 0.6904200315475464, -0.011539858765900135, -0.11283498257398605, -0.1982056051492691, 0.1753401756286621, 0.012193432077765465, -0.3209964334964752, -0.807193398475647, -0.2477540671825409, 0.25210797786712646, -0.13658858835697174, 0.25765269994735...
width: 100%; height: *; /* space left on current page */ } @media screen .PageBreak { border-bottom: 1px solid black; } </style> <!-- ... --> <div>This should appear on the first page.</div> <div class="PageBreak"><!-- This DIV should stretch itself out so that the next piece of content appears on ...
[ 0.1050693541765213, -0.267815500497818, 0.774011492729187, -0.19591103494167328, -0.14457249641418457, -0.07003451883792877, 0.13391456007957458, -0.048218902200460434, -0.43953609466552734, -0.8078587651252747, -0.2411271184682846, 0.34319695830345154, -0.012256034649908543, 0.05467578768...
I have a `List<T>` that I want to search not for a given item but for an item satisfying a given condition. Given an item in the list I can test which of 4 conditions is true: * the desired item must be to the left * the desired item must be to the right * this is the desired item * the desired can't be in the list A...
[ 0.17057490348815918, -0.17487077414989471, 0.16551703214645386, 0.07595089077949524, -0.1131633073091507, 0.019139567390084267, 0.2955741286277771, -0.03954102843999863, -0.3130396604537964, -0.6991774439811707, -0.016824595630168915, 0.456924706697464, -0.35960859060287476, 0.228048413991...
correctly Edit: BinarySearch looks almost right but in my case I don't have an item to compare with. I'd use Jon Skeet's solution and ignore one arg, but I'm not sure that I can count on it always being the same arg. **New edit:** I'll leave the extra binary searches below, as they'll be useful for others, and here's ...
[ 0.1161590963602066, 0.16987796127796173, 0.3027702867984772, 0.18641258776187897, -0.10620187222957611, 0.3114720284938812, 0.12476079910993576, -0.11401109397411346, -0.47575613856315613, -0.4231107831001282, -0.15188835561275482, 0.576551079750061, -0.021700412034988403, -0.0777962654829...
it's just right. ``` public static int BinarySearchForMatch<T>(this IList<T> list, Func<T,int> comparer) { int min = 0; int max = list.Count-1; while (min <= max) { int mid = (min + max) / 2; int comparison = comparer(list[mid]); if (comparison == 0) { r...
[ -0.04188655689358711, -0.39361029863357544, 0.7608912587165833, -0.20041103661060333, 0.01592397503554821, 0.4005972445011139, -0.0061377109959721565, -0.2162470817565918, -0.051380712538957596, -0.5264431834220886, -0.18192408978939056, 0.5919601917266846, -0.0420084223151207, 0.218181192...
} if (comparison < 0) { min = mid+1; } else { max = mid-1; } } return ~min; } ``` **Old edit:** I'll leave the original answer below, but
[ -0.028247877955436707, 0.039955832064151764, 0.5037388801574707, -0.228174090385437, 0.13479095697402954, 0.15279054641723633, 0.28155073523521423, -0.08459653705358505, 0.1768323928117752, -0.6510050892829895, -0.3598807752132416, 0.6670072674751282, 0.16929516196250916, 0.470856100320816...
here are two other options. The first takes a projection from the source data to a key type, and specifies the key to find. The comparison itself is just done in the default way for that key type: ``` public static int BinarySearchBy<TSource,TKey>(this IList<TSource> list, Func<TSource,TKey> projection, TKey key...
[ -0.24589385092258453, -0.44645875692367554, 0.34967219829559326, -0.09888765215873718, 0.22322826087474823, 0.19982470571994781, -0.28504642844200134, -0.3459613621234894, 0.03089101053774357, -0.7112997174263, -0.26001864671707153, 0.5493060350418091, -0.08693196624517441, 0.1346476674079...
projection(list[mid]); int comparison = Comparer<TKey>.Default.Compare(midKey, key); if (comparison == 0) { return mid; } if (comparison < 0) { min = mid+1; }
[ -0.30495718121528625, -0.6509350538253784, 0.6865584254264832, -0.09738720953464508, -0.07735471427440643, 0.7951406240463257, -0.2032264918088913, -0.12998148798942566, 0.13924893736839294, -0.819290816783905, -0.26777637004852295, 0.4215405583381653, 0.11090534180402756, 0.42486411333084...
else { max = mid-1; } } return ~min; } ``` The second takes a Func instead, to compare an item from the list with the key we're looking for. The code is almost exactly the same, of course - it's just the comparison which changes: ``` public static int BinarySearchBy<TSource,TKey>(...
[ -0.32274237275123596, -0.35403817892074585, 0.2950190305709839, -0.10385710746049881, 0.1321040540933609, 0.2289862334728241, -0.20541919767856598, -0.3158460855484009, -0.03645695373415947, -0.6427646279335022, -0.18644878268241882, 0.6695011258125305, -0.10127855837345123, -0.04662588983...
= list.Count-1; while (min <= max) { int mid = (min + max) / 2; int comparison = comparer(list[mid], key); if (comparison == 0) { return mid; } if (comparison < 0) {
[ -0.18241778016090393, -0.48911941051483154, 0.5918383598327637, -0.2066343128681183, -0.2708173096179962, 0.6765173673629761, 0.13976068794727325, -0.5004412531852722, 0.09548673033714294, -0.6706551909446716, -0.22561903297901154, 0.4149332344532013, -0.09969259798526764, 0.42116913199424...
min = mid+1; } else { max = mid-1; } } return ~min; } ``` These are both untested, but do at least compile :) **Original answer:** You can use `List<T>.BinarySearch` with an `IComparer<T>`. You don't have to write your own implementation of `IComparer<T>` - I've g...
[ -0.20042864978313446, -0.2464013248682022, 0.2953342795372009, 0.19485369324684143, 0.21766364574432373, 0.27100884914398193, 0.14299790561199188, 0.03515074774622917, -0.1118113100528717, -0.5797922015190125, -0.3093591630458832, 0.4304114282131195, 0.16085878014564514, -0.002008963841944...
which builds an `IComparer<T>` from a `Comparison<T>` delegate. That only spots the first three conditions, but the binary search will work out the last one from the rest. In fact, the code is so short I might as well paste it here (sans comments, admittedly). ``` public sealed class ComparisonComparer<T> : IComparer...
[ -0.08977556973695755, 0.0836743712425232, 0.31456708908081055, 0.06885175406932831, -0.1555805206298828, 0.5118879079818726, 0.0711827427148819, -0.49578166007995605, -0.034894488751888275, -0.6788938641548157, 0.03417471796274185, 0.4500163197517395, -0.38241565227508545, 0.54851150512695...
} this.comparison = comparison; } public int Compare(T x, T y) { return comparison(x, y); } } ``` So you might do something like: ``` var comparer = new ComparisonComparer<Person>((p1, p2) => p1.ID.CompareTo(p2.ID)); int index = list.BinarySearch(employee, comparer); ``` MiscUtil a...
[ -0.14214177429676056, -0.24584269523620605, 0.19041705131530762, 0.15387879312038422, -0.10789784044027328, 0.3866751790046692, -0.12480562925338745, -0.10864310711622238, -0.02989588864147663, -0.6768220067024231, -0.057578787207603455, 0.5001000761985779, -0.28050360083580017, 0.16481281...
I am posting a very simple form using a method I have used frequently in the past. It may be easier to show my code rather than type a lengthy explanation. Here's the HTML: ``` <% Html.BeginForm("CreateMarketingType", "ListMaintenance"); %> <div id="ListMaintenanceContainer"> <table> <tr> ...
[ 0.8588125705718994, 0.028847746551036835, 0.6500110030174255, -0.2859923541545868, -0.24958555400371552, -0.17730943858623505, -0.14105023443698883, 0.22400698065757751, 0.0027669882401823997, -0.50765061378479, 0.14367279410362244, 0.49633654952049255, -0.12337175011634827, 0.087372832000...
</tr> <%foreach (MarketingType marketingType in ViewData.Model.MarketingTypes) %> <%{ %> <tr>
[ 0.005514107644557953, -0.06427348405122757, 0.5298634767532349, -0.12387224286794662, -0.07996858656406403, 0.38980045914649963, -0.2330218404531479, -0.0823417603969574, -0.1419227570295334, -0.5884671807289124, -0.20262596011161804, 0.5311873555183411, -0.2580382823944092, 0.015262948349...
<td><%= marketingType.MarketingTypeId.ToString() %></td> <td><%= marketingType.MarketingTypeName %></td> </tr> <%} %> </table> <div>
[ 0.33273088932037354, -0.30965080857276917, 0.6242062449455261, -0.32363468408584595, -0.3480692505836487, 0.3378942608833313, 0.0023180374410003424, -0.5357492566108704, 0.07197108864784241, -0.48899516463279724, -0.17585992813110352, 0.5770946741104126, -0.2399081438779831, 0.110367953777...
<fieldset id="fsSaveNewMarketingType"> <legend>Add New Marketing Type</legend> <label for="txtNewMarketingTypeName">New Marketing Type Name:</label> <input type="text" id="txtNewMarketingTypeName" /> <input type="submit" value="Save" id="CreateMarketingTyp...
[ 0.541865885257721, 0.07736703008413315, 0.5787792801856995, -0.44372323155403137, -0.21250155568122864, 0.1923556923866272, -0.24234351515769958, -0.09117875248193741, -0.04683716595172882, -0.2992705702781677, -0.24648240208625793, 0.7755721807479858, -0.1353541910648346, 0.24577896296977...
</div> </div> <% Html.EndForm();%> ``` And here's the controller code: ``` [AcceptVerbs(HttpVerbs.Post)] public ActionResult CreateMarketingType(FormCollection form) { string newMarketingTypeName = Request.Form["txtNewMarketingTypeName"].ToString(); MarketingType newMarketingType = n...
[ 0.3864380717277527, -0.19115212559700012, 0.8132288455963135, -0.30843818187713623, -0.4768874943256378, 0.14750836789608002, -0.3530285656452179, -0.22826816141605377, 0.09993962943553925, -0.1636001318693161, 0.16311734914779663, 0.8753193616867065, -0.26702407002449036, -0.1392229944467...
something here? None of your inputs have a name attribute. No name = not in the FormCollection.
[ -0.0032924606930464506, -0.015705417841672897, -0.1750519573688507, 0.3769131302833557, -0.034176502376794815, -0.1250620037317276, 0.17716538906097412, 0.24686378240585327, -0.3058149218559265, -0.5298128724098206, 0.032257940620183945, 0.317780077457428, -0.24453850090503693, 0.317123293...
I have been wondering whether there is any code out there that enables representing SQL in the form of some object tree that can be assembled, modified and then finally rendered to valid SQL? Off the top of my head it could look something like that... ``` var stmnt = new Statement(); stmnt .AddMaster("Customer") ...
[ 0.3628518879413605, 0.1699710637331009, 0.5260405540466309, -0.14822722971439362, -0.3111284375190735, 0.10704655200242996, 0.11689979583024979, -0.39557579159736633, -0.18808697164058685, -0.5697938799858093, 0.004649531561881304, 0.3115496337413788, -0.3087294399738312, 0.289560616016387...
yes, I'd love to hear what is out tere in that respect. UPDATE: I am aware of the numerous possibilities of using ORM technologies to get my results from the DB, but I was after a model for the SQL itself. I know that the level of abstraction is pretty low, but it could possibly allow a situation where multiple colla...
[ 0.46005311608314514, 0.12341204285621643, 0.1630277782678604, 0.014927403070032597, -0.008129888214170933, -0.2369440197944641, 0.1940571367740631, -0.030400022864341736, -0.21525220572948456, -0.38062116503715515, -0.03620322048664093, 0.5533650517463684, -0.061778273433446884, 0.10173411...
post c# and .net, but I thought you might like to see what else is out there] Here is some example code: ``` from sqlalchemy import Table, Column, Integer, String, MetaData, ForeignKey from sqlalchemy.sql import select metadata = MetaData() # Make a basic customer table. Customer = Table('Customer', ...
[ 0.21494464576244354, 0.1679384410381317, 0.4112388789653778, 0.1126876249909401, 0.06994803249835968, -0.020713411271572113, -0.3244663178920746, -0.11618901044130325, -0.04537668824195862, -0.21545743942260742, -0.12269605696201324, 0.48559701442718506, -0.39100754261016846, 0.24256435036...
Column('LastName', String)) # Make a basic address table Address = Table('Address', metadata, Column('ID', Integer, primary_key=True), Column('City', String), Column('Street', String),
[ -0.13628412783145905, -0.002353845164179802, 0.6509639024734497, 0.10487385094165802, 0.0011613015085458755, 0.25383204221725464, 0.08040556311607361, -0.2812480628490448, 0.3328973650932312, -0.749963104724884, -0.41410350799560547, 0.06869392842054367, -0.33749473094940186, 0.14904715120...
Column('CustomerID', None, ForeignKey('Customer.ID'))) # Generate some sql stmt = select([Customer.c.FirstName, Customer.c.LastName, Address.c.Street, Address.c.City], from_obj=Customer.join(Address), whereclause=Address.c.City == 'Wellington') ...
[ -0.2149067372083664, 0.039542943239212036, 0.5732868313789368, -0.08124171942472458, -0.14962778985500336, 0.41683289408683777, -0.03216017782688141, -0.2324276715517044, 0.11945920437574387, -0.43497851490974426, -0.10640908777713776, 0.43113112449645996, -0.27271768450737, -0.03599522262...
"Address"."CustomerID" WHERE "Address"."City" = :City_1 # note that SQLAlchemy picked up the join condition from the foreign key. # you can specify other join conditions if you want. ``` Typically, you would execute the statement by using SQLAlchemy to connect to a database. Then you can do: ``` for row in stmt.ex...
[ 0.3443513512611389, 0.026613017544150352, 0.4610365033149719, -0.0007590596214868128, -0.21316032111644745, -0.14540226757526398, 0.07323285937309265, -0.04460253193974495, -0.013092937879264355, -0.44950687885284424, -0.10815130174160004, 0.3020336329936981, -0.49699917435646057, 0.303436...
So i just received a connection string to a Cube in our one of our SQL databases. I'm supposed to create a report that can be emailed to 30 something people off of this data. I would much rather write a stored procedure and just let SSRS send it out whenever its supposed to. The problem is that the database is extreme...
[ 0.5700114965438843, 0.16668924689292908, 0.04197289049625397, 0.3220341205596924, -0.0704391822218895, -0.0062674726359546185, 0.19100616872310638, 0.2676732540130615, -0.49062609672546387, -0.5476937890052795, 0.5092840194702148, 0.11791720241308212, -0.2551426887512207, 0.539791882038116...
the database and the cube are on the same SQL server. Any information about cubes would be helpful. I know that they to some pre-calculations based on what they will probably be used the most for. Thanks [Try OpenQuery and/or OpenRowset and pass through the MDX](http://sqlblogcasts.com/blogs/drjohn/archive/2008/09/27...
[ 0.1731925904750824, 0.1493673324584961, 0.40550610423088074, 0.09129872173070908, -0.2026224136352539, -0.07389630377292633, -0.020446723327040672, 0.024601683020591736, -0.3389362096786499, -0.6209529042243958, 0.1609811782836914, 0.2278226763010025, -0.01502628531306982, 0.30106455087661...
I have a ``` List<InputField> ``` but I need a ``` List<IDataField> ``` Is there a way to cast this in c#? Or use Linq to get same result? I have two classes that implement the same interface: ``` interface IDataField { } class InputField : IDataField { } class PurchaseField : IDataField { } ``` This Lis...
[ 0.37562647461891174, 0.026903517544269562, 0.1170930415391922, -0.09375287592411041, -0.08537547290325165, 0.11883451789617538, -0.3440335988998413, -0.55350261926651, 0.3093147873878479, -0.624285876750946, 0.20814107358455658, 0.7051306366920471, -0.4313100278377533, 0.1079779639840126, ...
type. list.Cast() **casts** all items in the original list to type T, and throws an exception for items which cannot be cast to that type. In your case both would give the same result, but using .Cast() would communicate your intent a lot more clearly, so I would recommend using that. ``` List<InputField> list = (fr...
[ 0.46645301580429077, -0.13848017156124115, 0.17214204370975494, -0.3267289400100708, 0.09739867597818375, -0.038409341126680374, 0.17747054994106293, -0.5117430090904236, -0.04062746465206146, -0.6517881155014038, -0.17965926229953766, 0.6860569715499878, -0.6903606653213501, -0.0414420217...
I am working on both parts of a data layer. I get to create the procs, and the business object layer that will consume the procs. Is there a best practice for determining where a delete should occur? Here's the scenario. I have a table Book with foreign key to a child table Pages. If I delete the book, I also want to...
[ -0.15429002046585083, 0.038558781147003174, 0.29935213923454285, 0.07437103986740112, 0.43128296732902527, 0.12643778324127197, -0.010602695867419243, -0.1484999805688858, -0.2556248605251312, -0.6094515323638916, -0.22986248135566711, 0.5147995352745056, 0.027752764523029327, 0.2798039615...
proc (again in a transaction)? Or does it matter? I would say it depends where you store your "logic" for the data. 1) If your stored procedures are mostly "dumb" ones with simple Inserts/Update/Delete. I would put the deletes in the data layer object where you would have more complex code. 2)IF you have written ma...
[ 0.1222333312034607, -0.12426132708787918, 0.254214882850647, 0.09147531539201736, 0.09831355512142181, 0.06420154124498367, -0.1208326518535614, -0.06988361477851868, -0.396689236164093, -0.20278890430927277, -0.04363951459527016, 0.8479428291320801, -0.43383604288101196, -0.22113609313964...
be a bitch.
[ 0.12328613549470901, 0.2539553642272949, -0.51334148645401, -0.05099096521735191, -0.3214731812477112, 0.06193511560559273, 0.35521116852760315, 0.4508703649044037, 0.030822336673736572, -0.19991621375083923, 0.1461912840604782, 0.33618369698524475, -0.2955768406391144, 0.22169701755046844...
Has anyone of you ever implemented a [Fibonacci-Heap](http://en.wikipedia.org/wiki/Fibonacci_heap)? I did so a few years back, but it was several orders of magnitude slower than using array-based BinHeaps. Back then, I thought of it as a valuable lesson in how research is not always as good as it claims to be. However...
[ 0.47518569231033325, -0.00838565919548273, -0.2830754518508911, 0.24021166563034058, -0.13067162036895752, -0.13885310292243958, -0.025395072996616364, 0.07393443584442139, -0.6653006076812744, -0.37935519218444824, 0.07809492200613022, 0.3941996693611145, -0.025748221203684807, -0.2206587...
include an implementation of Fibonacci heaps in `boost/pending/fibonacci_heap.hpp`. This file has apparently been in `pending/` for years and by my projections will never be accepted. Also, there have been bugs in that implementation, which were fixed by my acquaintance and all-around cool guy Aaron Windsor. Unfortunat...
[ 0.4129328727722168, 0.1702045202255249, 0.08871418237686157, 0.1253015100955963, -0.03566143661737442, -0.13808749616146088, 0.05930472910404205, -0.16557839512825012, -0.5031386017799377, -0.3725418746471405, -0.3019372820854187, 0.2848305404186249, -0.6268924474716187, -0.030589286237955...
[dijkstra\_heap\_performance.cpp](http://svn.boost.org/svn/boost/trunk/libs/graph/test/dijkstra_heap_performance.cpp) against a modified version of [dijkstra\_shortest\_paths.hpp](http://svn.boost.org/svn/boost/trunk/boost/graph/dijkstra_shortest_paths.hpp) to compare Fibonacci heaps and binary heaps. (In the line `typ...
[ -0.45065662264823914, -0.23501960933208466, 0.2839348614215851, 0.15436521172523499, -0.21918214857578278, 0.2040727287530899, 0.3233261704444885, -0.5350790023803711, -0.5360060930252075, -0.7390927672386169, -0.13489629328250885, 0.17130668461322784, -0.2905687987804413, -0.1955995708703...
far as I understand, this touches at the fundamental differences between Fibonacci heaps and binary heaps. The only real theoretical difference between the two data structures is that Fibonacci heaps support decrease-key in (amortized) constant time. On the other hand, binary heaps get a great deal of performance from ...
[ 0.09590908139944077, -0.06683020293712616, -0.004932819865643978, -0.00033343941322527826, -0.18345487117767334, 0.13729915022850037, 0.18897177278995514, -0.2778315246105194, -0.4113737940788269, -0.512688934803009, -0.17735382914543152, 0.4807754456996918, -0.4743463695049286, -0.0598511...
applications could be intrinsically decrease\_key-intense; I wanted to try [the Nagomochi-Ibaraki minimum-cut algorithm](http://www.cs.amherst.edu/ccm/challenge5/p_queue/index.html) because apparently it generates lots of decrease\_keys, but it was too much effort to get a timing comparison working. *Warning*: I may h...
[ -0.11076219379901886, -0.11807044595479965, 0.06155441701412201, 0.08880175650119781, -0.1017196923494339, -0.050544802099466324, 0.10759855061769485, -0.2721487879753113, -0.347751259803772, -0.5616533160209656, -0.16937749087810516, 0.6812937259674072, -0.429612934589386, -0.136430770158...
also have insert in amortized constant time. Merge in constant time is fantastic, but not relevant to this application. *Personal note*: A friend of mine and I once wrote a paper explaining a new priority queue, which attempted to replicate the (theoretical) running time of Fibonacci heaps without their complexity. Th...
[ 0.2004336416721344, -0.24968461692333221, -0.21585972607135773, 0.2916838526725769, 0.06011812761425972, 0.11482437700033188, -0.14246004819869995, 0.18903395533561707, -0.4311394989490509, -0.717962384223938, -0.0075501068495213985, 0.33996132016181946, -0.3796702027320862, 0.128742098808...
a situation where comparison cost exceeds overhead. Unfortunately, I do not have the code available, and presumably in your situation comparison is cheap, so these comments are relevant but not directly applicable. Incidentally, I highly recommend trying to match the runtime of Fibonacci heaps with your own data struc...
[ 0.22351181507110596, -0.17261753976345062, -0.06970798224210739, 0.3074805736541748, -0.0052639697678387165, 0.03272536024451256, 0.1854238212108612, 0.0037531296256929636, -0.11317609995603561, -0.8977245092391968, -0.06276252120733261, 0.37673133611679077, -0.27420574426651, 0.1865017712...
This question might be kind of elementary, but here goes: I have a SQL Server database with a 4 GB log file. The DB is 16GB and is backed up nightly. Can I truncate the log regularly because the entire DB+Log is backed up each night? you can something like this to you maintenance schedule to run every night before th...
[ 0.27389058470726013, 0.20938339829444885, 0.519995391368866, 0.0625523030757904, 0.0020640224684029818, -0.034488823264837265, 0.1802838295698166, -0.3604485094547272, -0.323009192943573, -0.5324257612228394, 0.06460250169038773, 0.7350569367408752, -0.18149596452713013, 0.1941031515598297...
Okay, this is the code: ``` [lblMessage setText: txtEnter.text]; [lblMessage sizeToFit]; scrollingTextView.contentSize = lblMessage.frame.size; float width = (lblMessage.frame.size.width) + (480); [UIView beginAnimations:@"pan" context:nil]; [UIView setAnimationDuration:durationValue]; [UIView setAnimationRepeatCoun...
[ -0.01921839453279972, -0.12952378392219543, 1.060118317604065, 0.046249862760305405, 0.22113648056983948, 0.08293471485376358, 0.24091218411922455, -0.352865606546402, -0.29501020908355713, -0.6410725712776184, -0.19482605159282684, 0.7648699283599854, 0.06472107768058777, -0.0412315689027...
text etc etc ? Core Animation animations are performed on a separate thread. When you enclose the change in contentOffset in a beginAnimations / commitAnimations block, that change will be animated gradually. The scrolling text view rotation that occurs next, outside of the animation block, will be performed instantly....
[ 0.3487485349178314, -0.09999604523181915, 0.7490983009338379, 0.18080532550811768, -0.0659184679389, -0.018565038219094276, 0.10292228311300278, 0.04851881042122841, -0.2583383023738861, -0.5598258972167969, -0.18128235638141632, 0.4713638722896576, -0.2667500078678131, 0.14387789368629456...
after the offset change animation has completed, set up a callback delegate method. You can use code in the beginning of your animation block similar to the following: ``` [UIView setAnimationDelegate:self]; [UIView setAnimationDidStopSelector:@selector(contentOffsetAnimationHasFinished:finished:context:)]; ``` whic...
[ 0.10428494960069656, 0.04622512683272362, 0.6503092646598816, -0.014011101797223091, -0.2396586835384369, 0.21208597719669342, -0.17965224385261536, -0.6110669374465942, -0.22956380248069763, -0.7107659578323364, 0.052647996693849564, 0.5738831162452698, -0.17224612832069397, -0.2007247060...
the text. Rather than apply the rotation transform to the scroll view every time you click the button, I have it start rotated and stay that way. I thought it might be a layer size issue, as the iPhone has a 1024 x 1024 texture size limit (after which you need to use a CATiledLayer to back your UIView), but I was abl...
[ 0.49910682439804077, -0.23524540662765503, 0.6400581002235413, -0.11274641752243042, -0.009308237582445145, -0.0829196497797966, 0.17878255248069763, -0.33438512682914734, -0.17955997586250305, -0.34548866748809814, 0.22677400708198547, 0.7741855382919312, -0.14287248253822327, -0.19421507...
you present here.
[ -0.11358653753995895, 0.41529354453086853, -0.07129648327827454, -0.07131990045309067, -0.19635449349880219, -0.280222088098526, 0.32215675711631775, 0.14413097500801086, -0.14427880942821503, -0.5698712468147278, -0.04987940564751625, 0.5381304025650024, -0.11583414673805237, -0.041428275...
I am developing a chained installer including the .msi installation of Crystal Reports Basic (10.5) using Inno Setup. I cannot find any deployment guidance to determine if this is already installed on the target PC, though it appears I can call the .msi multiple times and it always attempts to install (never goes to th...
[ 0.30757108330726624, 0.27475249767303467, 0.3905976712703705, -0.17089033126831055, -0.034857913851737976, -0.22457346320152283, 0.24503813683986664, -0.13004422187805176, -0.16960249841213226, -0.7578293085098267, -0.22213955223560333, 0.7224798798561096, -0.30711111426353455, 0.039552025...
that out. My question is: Is option either recommended? Is there a better option than either of these? Core Animation animations are performed on a separate thread. When you enclose the change in contentOffset in a beginAnimations / commitAnimations block, that change will be animated gradually. The scrolling text vie...
[ 0.2549492418766022, -0.19585548341274261, 0.39889296889305115, 0.200792133808136, -0.0792432352900505, 0.027471154928207397, 0.04582677781581879, 0.014505834318697453, -0.2049637883901596, -0.6266685128211975, -0.13197050988674164, 0.5645855069160461, -0.12765102088451385, 0.14096789062023...
code to within the animation block. If you want to have the rotation occur after the offset change animation has completed, set up a callback delegate method. You can use code in the beginning of your animation block similar to the following: ``` [UIView setAnimationDelegate:self]; [UIView setAnimationDidStopSelector...
[ 0.057998690754175186, 0.07134920358657837, 0.5503317713737488, -0.021463807672262192, -0.2512289583683014, 0.0625448152422905, 0.10131087154150009, -0.4794993996620178, -0.20003972947597504, -0.7905635237693787, -0.011588400229811668, 0.483623206615448, -0.09850553423166275, 0.022563472390...
I removed all extraneous calls to layout the buttons, etc., and only animate the text. Rather than apply the rotation transform to the scroll view every time you click the button, I have it start rotated and stay that way. I thought it might be a layer size issue, as the iPhone has a 1024 x 1024 texture size limit (a...
[ 0.5936940312385559, -0.3711674213409424, 0.5439521670341492, -0.2647881805896759, 0.12480244040489197, 0.01532774604856968, 0.17156147956848145, -0.45922574400901794, 0.033043719828128815, -0.5626396536827087, 0.37994185090065, 0.6064247488975525, -0.04647345468401909, -0.09408234059810638...
know what your issue is, but it's not with the text animating code you present here.
[ 0.391495943069458, 0.33053040504455566, -0.14331741631031036, 0.31568047404289246, -0.11106707900762558, -0.3992859721183777, 0.07926908135414124, 0.20795749127864838, -0.16252994537353516, -0.3263060748577118, 0.27524641156196594, 0.604009747505188, -0.15358367562294006, -0.00218220287933...
I recorded a script using the Selenium IDE extension for Firefox, and I would like to add the command waitForCondition. I see it takes two arguments: script and timeout. In Selenium IDE, I have 3 text fields for each command: the command name (I assume "waitForCondition"), the target, and the value. Where and how shoul...
[ 0.4114893078804016, 0.01053160522133112, 0.5607454180717468, -0.34060999751091003, 0.21611490845680237, 0.09468825906515121, 0.05145799368619919, -0.3302737772464752, 0.20090533792972565, -0.5956822633743286, -0.14376330375671387, 0.7667604684829712, -0.36493566632270813, -0.00267898989841...
I'm creating an XML document and I want to store URLs inside the a node like so: ``` <ns:url>http://example.com</ns:ulr> ``` My question is, do I need to encode/escape the URL in anyway? If I do, the will the .Net XmlDocument object handle this for me? In general most DOM implementations (including XmlDocument) sho...
[ -0.11796028167009354, 0.026301512494683266, 0.21323290467262268, -0.012355663813650608, 0.06645063310861588, -0.24518360197544098, 0.41117703914642334, -0.27818015217781067, -0.1660720705986023, -0.4332100749015808, -0.5101563334465027, 0.31650272011756897, -0.22553421556949615, 0.27058467...
I don't understand what could be the uses of lvalue subroutines? What is it that I can't accomplish with normal subroutines? Could you please post some examples? Thanks LValues are recommended to be avoided. They're fun and all, but they confuse new users who make assumptions about how all subs work, and thus it shoul...
[ 0.4703309237957001, 0.1732025444507599, 0.10507611185312271, 0.11870294064283371, -0.13250616192817688, -0.1542092263698578, 0.43472424149513245, 0.17018182575702667, 0.007843065075576305, -0.5319448709487915, -0.012238339520990849, 0.5276480317115784, -0.4443190395832062, 0.16312505304813...
$start, $stop , 'somevalue' ); ``` The difference here being mostly the former has significantly more expressive power, as it delegates the behaviour to the code that uses it instead of the function itself. For instance: ``` substr( $string, $start, $stop ) =~ s/a/b/g ``` Would require you to do ``` my $x = ...
[ -0.06849197298288345, 0.055692847818136215, 0.1754455715417862, -0.3457893431186676, -0.2059081494808197, -0.09759144484996796, 0.5143534541130066, -0.07301238179206848, 0.003253743052482605, -0.35315412282943726, -0.663860023021698, 0.6110283136367798, -0.3597695231437683, -0.013150816783...
LValue sub). I don't think it does, but Its ambiguous enough I have to check the manual to remember whether it does or not, and that's bad.
[ 0.01659482531249523, -0.009221096523106098, 0.6058005094528198, -0.16222117841243744, -0.1366071254014969, 0.03692437708377838, 0.30872076749801636, 0.4918931722640991, 0.1559174656867981, -0.6593673825263977, -0.13874773681163788, 0.5455992817878723, -0.1739853024482727, 0.002293759491294...
In Javascript, I have a certain string, and I would like to somehow measure how much space (in pixels) it will take within a certain element. Basically what I have is an element that will float above everything else (like a tooltip), and I need to set its width manually through Javascript, so it will adjust to the tex...
[ 0.5256621241569519, -0.026671776548027992, 0.29336389899253845, -0.19484443962574005, -0.03258751332759857, 0.07877323031425476, -0.04668377712368965, -0.18775954842567444, -0.29409337043762207, -0.8174005746841431, 0.011096258647739887, 0.31220415234565735, -0.18709148466587067, 0.0446540...
decent way, what approach do you believe is feasible? (Like, trying out different widths and checking the height to make sure it didn't go over a certain threshold). The less "pixel values" I can hardcode in my JS the better, obviously. try this <http://blog.mastykarz.nl/measuring-the-length-of-a-string-in-pixels-usi...
[ 0.4075815975666046, -0.2630789577960968, 0.20706579089164734, 0.12114816904067993, -0.2768521308898926, -0.08800006657838821, 0.37294358015060425, -0.0799165740609169, -0.16685019433498383, -0.9092609882354736, 0.2980669140815735, 0.40900808572769165, 0.2478170245885849, -0.464626371860504...
I’m maintaining a site in ASP, one of the tasks is to set the focus on textbox on a page. Here is what I have tried: ``` <script type="text/javascript"> <!-- document.psForm['password'].focus(); //AND document.getElementById("password").focus(); --> </script> ``` I didn't think this would work... and it doesn't: `...
[ 0.31774792075157166, 0.057258691638708115, 0.7429489493370056, -0.30604782700538635, -0.07895853370428085, 0.05476761236786842, 0.3287440240383148, -0.3981950581073761, -0.14563482999801636, -0.8641599416732788, -0.23036298155784607, 0.4687996208667755, -0.056554995477199554, -0.2397614121...
</td> </tr> </table> </form> ``` Try this: Add: ``` id="password" ``` to the input tag, then use: ``` document.getElementById("password").focus(); ```
[ 0.37970271706581116, -0.12304021418094635, 0.45027831196784973, 0.0037982205394655466, 0.27396225929260254, -0.399253785610199, 0.0034581392537802458, -0.3534497320652008, 0.11771193146705627, -0.6328163743019104, -0.7218644022941589, 0.8094529509544373, -0.20631510019302368, -0.2389405071...
So lets say I have this interface: ``` public interface IBox { public void setSize(int size); public int getSize(); public int getArea(); //...and so on } ``` And I have a class that implements it: ``` public class Rectangle implements IBox { private int size; //Methods here } ``` If I wanted to ...
[ 0.23653148114681244, 0.2150411456823349, 0.5149636268615723, -0.13198654353618622, -0.12116161733865738, 0.2187402844429016, 0.10844580084085464, -0.11208770424127579, -0.10014650225639343, -0.9045484662055969, 0.10944997519254684, 0.31813162565231323, -0.7903754115104675, 0.11003660410642...
of interfaces is to make sure that the class which implements an interface has got the correct methods in it as described by an interface? Or is there any other use of interfaces? Interfaces are a way to make your code more flexible. What you do is this: ``` Ibox myBox=new Rectangle(); ``` Then, later, if you decide...
[ 0.286122590303421, 0.03196583688259125, 0.18786592781543732, 0.2189982533454895, -0.10128243267536163, -0.06325533986091614, -0.13497598469257355, -0.1882256716489792, -0.2220015972852707, -1.0077412128448486, 0.1919473111629486, 0.5979799628257751, -0.6674197316169739, -0.2930683791637420...
want to create a list of boxes and perform some operation on each one, but you want the list to contain different kinds of boxes. On each box you could do: ``` myBox.close() ``` (assuming IBox has a close() method) even though the actual class of myBox changes depending on which box you're at in the iteration.
[ 0.21181750297546387, -0.0201907716691494, 0.10718413442373276, -0.0981186255812645, 0.12292352318763733, 0.1750038117170334, -0.0930195078253746, -0.12947912514209747, 0.061784062534570694, -0.6843287348747253, -0.02508208155632019, 0.15130968391895294, -0.39645057916641235, 0.199639871716...
I am looking for a way to do daily deployments and keep the database scripts in line with releases. Currently, we have a fairly decent way of deploying our source, we have unit code coverage, continuous integration and rollback procedures. The problem is keeping the database scripts in line with a release. Everyone...
[ 0.6057095527648926, 0.21056847274303436, 0.263691782951355, 0.011090281419456005, 0.12860554456710815, -0.17926079034805298, 0.10034774988889694, -0.07959965616464615, -0.03501685708761215, -0.6671040058135986, 0.14536698162555695, 0.616240382194519, 0.022214988246560097, -0.07170779258012...
anywhere, generally everyone "attempts" to put them into a Subversion folder but some of the lazier people just run the script on live and most of the time no one knows who has done what to the database. The second issue is that we have 4 test databases and they are ALWAYS out of line and the only way to truly line th...
[ 0.704289972782135, 0.1375149041414261, -0.002104169921949506, 0.30791378021240234, 0.2573918402194977, -0.2081262320280075, 0.49571532011032104, 0.08587732166051865, -0.11206026375293732, -0.5512571930885315, 0.2605208456516266, 0.29035234451293945, -0.04650646448135376, 0.0678886175155639...
them. What I am looking for are techniques/ideas that make it EASY for the developer to want to record their database scripts so they can be ran as part of a release procedure. **A process that the developer would want to follow**. Any stories, use cases or even a link would helpful. For this very problem I chose to...
[ 0.43648087978363037, 0.34581276774406433, 0.40200355648994446, 0.04503685235977173, 0.2318323701620102, 0.424858033657074, -0.19385749101638794, -0.16731512546539307, -0.730583131313324, -0.9508049488067627, -0.13333076238632202, 0.26636454463005066, -0.6900815963745117, 0.3274426758289337...
//add it nullable Database.AddColumn("Customers", new Column("DateCreated", DateTime) ); //seed it with data Database.Execute("update Customers set DateCreated = getdate()"); //add not-null constraint Database.AddNotNullConstraint("Customers", "DateCreated"); } public void ...
[ 0.0336073599755764, -0.06452672928571701, 0.5216332674026489, -0.09157662093639374, 0.381663978099823, 0.04329343140125275, -0.202628493309021, 0.011532329022884369, -0.33641931414604187, -0.33663052320480347, -0.22666501998901367, 0.5927447080612183, -0.3439280390739441, 0.266894847154617...
existing data. This can be automated easily, and you can easily go up and down between versions. This has been a really valuable addition to our build, and has streamlined the process **immensely**. I posted a comparison of the various migration frameworks in .NET here: <http://benscheirman.com/2008/06/net-database-m...
[ 0.3275890052318573, -0.009654444642364979, 0.4492959976196289, 0.024246111512184143, 0.28990060091018677, -0.08232017606496811, -0.08980627357959747, -0.30998319387435913, -0.6344957947731018, -0.6623099446296692, -0.20275196433067322, 0.27268871665000916, 0.018043579533696175, 0.192491129...
I have two tables named `foo` and `bar`, hypothetically speaking. foo has columns `foo_id`, `foo_fluff` bar has columns `bar_id`, `foo_id`, `timestamp` I need a query which will retrieve return one row for any foo\_id that the table bar contains, with the latest timestamp. So, if bar has three rows, two of which hav...
[ 0.11614180356264114, 0.3551497757434845, 0.7537704110145569, -0.3739796578884125, 0.013478077948093414, 0.35005664825439453, -0.1497298777103424, -0.27568116784095764, -0.0508442223072052, -0.6828417181968689, 0.2234182059764862, 0.3154648542404175, -0.32185205817222595, 0.3475705087184906...
from foo inner join bar on foo.foo_id = bar.foo_id group by foo.foo_fluff ```
[ -0.05970507115125656, 0.48823586106300354, 0.5007919669151306, -0.5970968008041382, -0.09719771146774292, 0.06243890896439552, 0.2464641034603119, -0.5524407625198364, 0.015289518982172012, -0.2695210874080658, -0.3814446032047272, 0.31601887941360474, -0.5614373683929443, 0.23782064020633...
For a while now, I have been using UltraEdit on my Windows box. The ability to write scripts with a familiar language (JavaScript) has proved to be extremely useful. The only problem is that I cannot use it on my Linux box at work. Is there a comparable text editor that runs on Linux and has an integrated scripting eng...
[ -0.2773984968662262, -0.5410857796669006, 0.1894584745168686, 0.4054535925388336, -0.7232416868209839, 0.06391677260398865, -0.35481569170951843, 0.09297390282154083, -0.5252386331558228, -0.7036519646644592, -0.036409892141819, 0.2677559554576874, -0.18317940831184387, 0.05974354222416878...
Edit. SciTE is something I've used before, and Lua is not that difficult; [SciTE's API](http://www.scintilla.org/SciTELua.html) though does not seem as extensive as [Komodo Edit's API](http://docs.activestate.com/komodo/5.0/komodo-js-api.html). Eclipse Monkey is something I am definitely going to use, but it requires E...
[ 0.19530899822711945, -0.5675029158592224, 0.47836604714393616, 0.03610680252313614, -0.48188459873199463, -0.3474488854408264, 0.09927759319543839, 0.3090313971042633, -0.31618982553482056, -0.9949861168861389, -0.0278383307158947, 0.6463155150413513, -0.5174066424369812, -0.30579331517219...
Is it safe and predictable to reuse pointers after freeing the data they point to? For example: ``` char* fileNames[] = { "words.txt", "moreWords.txt" }; char** words = NULL; int* wordsCount = NULL; for ( i = 0; i < 2; ++i ) { data = fopen( fileNames[i], "r" ); words = readWords( data ); wordsCount = coun...
[ -0.053614530712366104, -0.20939573645591736, 0.3334411680698395, -0.3379017114639282, 0.25071051716804504, -0.14627331495285034, 0.6979564428329468, -0.538784921169281, 0.0731935203075409, -0.38567686080932617, -0.4436843693256378, 0.6811609864234924, -0.5144866704940796, -0.19260565936565...
data ); } ``` \*error checking omitted I am running the code and it appears to run (no warnings, errors, or memory problems) but I am wondering if this is safe and predictable to use in most environments (specifically in a typical Linux environment)? If this isn't 'safe and predictable', what is the best way to acc...
[ 0.25798651576042175, 0.002515071537345648, 0.3718883991241455, 0.04234423488378525, 0.19307728111743927, -0.2464028000831604, 0.4128286838531494, -0.014210466295480728, -0.13878889381885529, -0.5955118536949158, 0.03462827950716019, 0.879699170589447, -0.3492559492588043, -0.18675796687602...
works perfectly (it works as intended, memory is being freed correctly and such). I cannot change the spec. for this assignment. Thanks! What you're doing is fine: because, after you release a pointer, you're reinitializing it before you reuse it. If the question is "is it safe to reuse a pointer **value** after fre...
[ 0.22429193556308746, -0.062485650181770325, 0.2352212369441986, 0.09977687895298004, 0.2954217791557312, -0.4431501626968384, 0.5950513482093811, -0.3006556034088135, -0.11707416921854019, -0.18985609710216522, -0.04196087643504143, 0.9683464169502258, -0.060358401387929916, -0.29755377769...
I am creating an abstract class. I want each of my derived classes to be forced to implement a specific signature of constructor. As such, I did what I would have done has I wanted to force them to implement a method, I made an abstract one. ``` public abstract class A { abstract A(int a, int b); } ``` However I...
[ 0.2292388379573822, 0.12448066473007202, -0.05437198653817177, 0.0292728990316391, -0.12707507610321045, 0.012924693524837494, 0.40796545147895813, -0.32126161456108093, -0.2193155586719513, -0.43071794509887695, -0.08494512736797333, 0.2793620526790619, -0.6270913481712341, 0.540531575679...
//Some other awesome code. } } ``` This is all C# .NET code. Can anyone help me out? **Update 1** I wanted to add some things. What I ended up with was this. ``` private A() { } protected A(int a, int b) { //Code } ``` That does what some folks are saying, default is private, and the class needs to impl...
[ 0.27213793992996216, 0.17025791108608246, -0.03492811694741249, 0.032273657619953156, 0.03561766818165779, -0.3263903558254242, 0.36904004216194153, 0.14349597692489624, -0.2313183844089508, -0.6530762314796448, 0.009603898040950298, 0.6630933284759521, -0.37991464138031006, -0.04332535341...
be clear, to work around this I made my default constructor private, and my other constructor protected. I am not really looking for a way to make my code work. I took care of that. I am looking to understand why C# does not let you do this. You cannot have an abstract constructor because abstract means you must overri...
[ 0.3722490072250366, 0.11076997965574265, -0.28811249136924744, 0.11786115169525146, 0.13733504712581635, -0.26084795594215393, 0.3258078992366791, 0.16897036135196686, -0.04597054049372673, -0.21542911231517792, -0.11676986515522003, 0.6368958353996277, -0.3131687343120575, 0.0610299669206...
way in C# to enforce a specific constructor signature is by using the **new()** generic constraint, which enforces the existence of a parameterless constructor for the type parameter.
[ 0.12383197247982025, -0.05948680639266968, 0.07032889872789383, -0.08084713667631149, 0.014069786295294762, -0.3505515456199646, 0.062047746032476425, -0.16522856056690216, -0.25263917446136475, -0.21943272650241852, -0.35180819034576416, 0.40323758125305176, -0.5567172169685364, 0.0314047...
I'm trying to read/write to a `FM24CL64-GTR FRAM` chip that is connected over a I2C bus on address `0b 1010 011`. When I'm trying to write 3 bytes (data address 2 bytes, + data one byte), I get a kernel message (`[12406.360000] i2c-adapter i2c-0: sendbytes: NAK bailout.`), as well as the write returns != 3. See code b...
[ -0.29293641448020935, 0.007061947602778673, 0.25053903460502625, -0.08956129848957062, 0.1573830246925354, 0.4630279541015625, 0.550299346446991, -0.2292550802230835, -0.06637745350599289, -0.8942768573760986, -0.45701315999031067, 0.536403477191925, -0.21194234490394592, 0.175247445702552...
= dataAddr & 0xff; buf[2] = val; if (write(file, buf, 3) != 3) exit(3); ... ``` However when I write 2 bytes, then write another byte, I get no kernel error, but when trying to read from the FRAM, I always get back 0. Here is the code to read from the FRAM: ``` uint8_t val; if ((file = open(filename,O_RDWR)) ...
[ -0.33113425970077515, -0.055865418165922165, 0.5771968960762024, -0.428104043006897, 0.22341515123844147, 0.1469857394695282, 0.524492621421814, -0.3773326575756073, -0.16931870579719543, -0.6232568621635437, -0.5468579530715942, 0.7428430318832397, -0.26526740193367004, 0.0116611504927277...
it with: ``` #include <linux/i2c.h> struct i2c_rdwr_ioctl_data work_queue; struct i2c_msg msg[2]; uint8_t ret; work_queue.nmsgs = 2; work_queue.msgs = msg; work_queue.msgs[0].addr = addr; work_queue.msgs[0].len = 2; work_queue.msgs[0].flags = 0; work_queue.msgs[0].buf = &dataAddr; work_queue.msgs[1].addr = addr; w...
[ -0.5312420725822449, -0.18706144392490387, 0.3978048264980316, 0.15944717824459076, -0.06659761071205139, 0.09815429151058197, 0.27487432956695557, -0.28444892168045044, -0.3493874669075012, -0.3177550435066223, -0.27730733156204224, 0.2530641257762909, -0.057184673845767975, 0.42202612757...
address followed by data-bytes is successful (first code segment). For reading the address can be written out first (using write()), and then sequential data can be read starting from that address.
[ -0.23637637495994568, 0.17442862689495087, 0.25486862659454346, 0.2130243182182312, 0.040731098502874374, 0.30135244131088257, -0.06664193421602249, -0.25616273283958435, 0.03288177773356438, -0.5840655565261841, -0.4662293791770935, 0.38848090171813965, -0.046270955353975296, 0.1504568904...
I am currently in my final year at school, studying for a Higher National Diploma in Computer Studies, and basically in this final semester, we need to develop a Software Project, that basically incorporates a *whole* system. Now, what I'm thinking of doing is something along the lines of [Robocode](https://robocode.s...
[ 0.5460180044174194, 0.21753115952014923, 0.17539554834365845, 0.12317711114883423, 0.3650575280189514, -0.08739013969898224, 0.15864962339401245, 0.5379239320755005, -0.2597765028476715, -0.39845743775367737, 0.17791374027729034, 0.3808971345424652, 0.40649110078811646, -0.0881776064634323...