text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
4: break; default: throw new Error('illegal argument count') } // do stuff } ``` This has the downside that the programmer's intention is not (visually) obvious and uses 'magic numbers'; it is therefore possibly error prone.
[ 0.4371049106121063, 0.49813055992126465, -0.009292666800320148, -0.22835218906402588, 0.0756814181804657, -0.38022059202194214, 0.7157707810401917, -0.17264355719089508, -0.22905977070331573, -0.0030675821471959352, -0.9180876612663269, 0.5043564438819885, -0.4059869647026062, -0.044541921...
What's the best practice for setting up a subversion repository on a linux development machine. External users need to be able to access a specific repository, but nothing else on the machine. I know one answer is to set up a dedicated repository, but I'm looking for a single machine solution: location of repositories,...
[ 0.360353022813797, -0.04090533405542374, 0.06438596546649933, 0.1507483720779419, 0.20892693102359772, -0.06069805473089218, 0.054970160126686096, 0.14336639642715454, -0.48559579253196716, -0.27180641889572144, -0.3088091313838959, 0.39881810545921326, 0.0067671253345906734, 0.19279256463...
a ReadyNAS shared filesystem. Accounts: All our customers use LDAP. Either OpenLDAP server running on a master host, but sometimes Active Directory because some customers have a Windows domain in their office, which we can configure as well. Developers get access to the "SCM" group (usually svn, git or devel), and the...
[ 0.23062986135482788, -0.3578752875328064, 0.4220006763935089, 0.28246015310287476, 0.26757001876831055, -0.17928467690944672, 0.09703322499990463, -0.12883397936820984, -0.2871056795120239, -0.4174101948738098, -0.5747167468070984, 0.41126078367233276, -0.26903390884399414, -0.180221721529...
/srv/svn /srv/svn_backups/$(date +%Y%m%d) ``` For access to the repo, it's usually simple svn+ssh. Some customers already have an Apache setup, but not many. I recommend SSH. Developers push their public ssh keys out and all is well. There's little to no maintenance with LDAP user management (the **only** way to go).
[ 0.14588241279125214, -0.1904868334531784, 0.7601032853126526, -0.0010531950974836946, -0.19888296723365784, -0.3980795443058014, 0.3304923176765442, -0.21554690599441528, -0.3015308678150177, -0.3984525501728058, -0.474428653717041, 0.9569692611694336, -0.1549062281847, -0.1582377701997757...
I'm reading some code in the [Ogre3D](http://www.ogre3d.org) implementation and I can't understand what a `void *` type variable means. What does a pointer to `void` mean in C++? A pointer to void, `void*` can point to any object: ``` int a = 5; void *p = &a; double b = 3.14; p = &b; ``` You can't dereference, incr...
[ 0.21252699196338654, 0.24358506500720978, 0.19671489298343658, -0.1451909989118576, -0.14008226990699768, 0.0481887012720108, 0.1269388496875763, 0.1410979926586151, -0.09208928048610687, -0.31567683815956116, -0.12207730859518051, 0.48306259512901306, -0.379834920167923, 0.356344550848007...
I have a `Repeater` with a `Button` inside the `ItemTemplate`. I added the `CommandName` property to the button and registered and event handler for the `ItemCommand` event on the `Repeater`. My problem is that when I click the button, I get an `ArgumentException` with a message saying something about `EnableEventVali...
[ -0.06745448708534241, 0.07511849701404572, 0.49313658475875854, -0.017162352800369263, 0.034026749432086945, 0.04775908216834068, 0.4974044859409332, -0.07602770626544952, 0.03650213032960892, -0.37074387073516846, 0.05042261630296707, 0.8174247145652771, -0.1290232390165329, 0.29203397035...
`ClientScriptManager.RegisterForEventValidation` if I trust the client (which I do). The problem is I can't make sense of the documentation for that method. lookout for the binding problem pointed out by Steve Robbins and you may also want to take a look at [this](http://aspalliance.com/1343_Handling_Events_within_a_Re...
[ 0.17595545947551727, -0.04660557210445404, -0.048178769648075104, 0.001721795997582376, -0.1989981234073639, -0.3375222980976105, 0.45046481490135193, -0.1175275519490242, -0.5333870053291321, -0.30213937163352966, 0.002125850412994623, 0.5161836743354797, -0.30561399459838867, -0.09717617...
In bash one can escape arguments that contain whitespace. ``` foo "a string" ``` This also works for arguments to a command or function: ``` bar() { foo "$@" } bar "a string" ``` So far so good, but what if I want to manipulate the arguments before calling `foo`? This does not work: ``` bar() { for arg...
[ 0.24880249798297882, 0.4705285429954529, 0.41957396268844604, -0.5910218954086304, 0.024387717247009277, -0.16577813029289246, 0.5722360014915466, -0.5146604776382446, -0.4673135578632355, -0.18235857784748077, -0.13014791905879974, 1.042840838432312, -0.3601505160331726, -0.20537832379341...
# foo "$args" would just be silly } bar a b c ``` So how do you build argument lists when the arguments contain whitespace? There are (at least) two ways to do this: 1. Use an array and expand it using `"${array[@]}"`: ``` bar() { local i=0 args=() for arg in "$@" do args[$i]="prefix $arg" ...
[ 0.1687418520450592, 0.2553249001502991, 0.5212822556495667, -0.29625818133354187, -0.04222280904650688, -0.06768610328435898, 0.23082776367664337, -0.40414515137672424, -0.2510691285133362, -0.5008478760719299, -0.12105950713157654, 0.6736295819282532, -0.424486368894577, -0.14092671871185...
want to use arrays you need to use `eval`: ``` bar() { local args=() for arg in "$@" do args="$args \"prefix $arg\"" done eval foo $args } ```
[ -0.12838345766067505, 0.33197131752967834, 0.3514954447746277, -0.4612981677055359, -0.15754498541355133, 0.23810459673404694, 0.27993565797805786, -0.3550556004047394, -0.41591498255729675, -0.1898449957370758, -0.13112972676753998, 0.6106629967689514, -0.6385390758514404, -0.267098903656...
Please take a look on the following pseudo-code: ``` boolean blocked[2]; int turn; void P(int id) { while(true) { blocked[id] = true; while(turn != id) { while(blocked[1-id]) /* do nothing */;
[ 0.3338882029056549, -0.10624492913484573, 0.2013235092163086, -0.2589268088340759, 0.36455753445625305, -0.3110613524913788, 0.5792048573493958, -0.18401390314102173, -0.1304115504026413, -0.2597091495990753, -0.6090406179428101, 0.4877552390098572, -0.3052390217781067, 0.10118751972913742...
turn = id; } /* critical section */ blocked[id] = false; /* remainder */ } } void main() { blocked[0] = false; blocked[1] = false;
[ -0.04958304017782211, -0.1667603701353073, 0.05438333749771118, -0.32395699620246887, 0.20647400617599487, 0.014233378693461418, 0.7122286558151245, -0.05097682401537895, 0.03982798382639885, -0.242552250623703, -0.3676091432571411, 0.22153842449188232, -0.40620890259742737, 0.312484502792...
turn = 0; parbegin(P(0), P(1)); //RUN P0 and P1 parallel } ``` I thought that a could implement a simple Mutual - Exclution solution using the code above. But it's not working. Has anyone got an idea why? Any help would really be appreciated! Mutual Exclusion is in this exemple not guaranteed because of the fo...
[ -0.12906767427921295, 0.03091735951602459, 0.2713797092437744, -0.17873504757881165, 0.00035665094037540257, 0.08655328303575516, 0.4664311110973358, -0.22336705029010773, -0.38363727927207947, -0.3302191495895386, -0.22506488859653473, 0.2641219198703766, -0.43323859572410583, 0.159316837...
execute the critical section. And when P1 executes, it sets turn to 1, and is also ready to execute the critical section. Btw, this method was originally invented by Hyman. He sent it to Communications of the Acm in 1966
[ 0.3221171200275421, 0.2508879601955414, 0.3807409405708313, -0.10677812248468399, -0.029076145961880684, 0.30448344349861145, 0.14980629086494446, -0.3329750895500183, -0.20852552354335785, -0.05356594920158386, -0.3707553744316101, 0.2457456886768341, -0.38009682297706604, -0.001384598785...
When I implement objects that I want to compare using the [`IEquatable<T>` interface](https://learn.microsoft.com/en-us/dotnet/api/system.iequatable-1?view=netstandard-2.0): 1. Why do I have to override `Equals(object)` method if I already implemented `Equals(T)`? 2. Can I use `==` and `!=` operators once I implement ...
[ -0.16512304544448853, -0.045075587928295135, 0.42994803190231323, -0.09118741750717163, -0.17718055844306946, -0.2697226107120514, 0.36282312870025635, -0.4291657507419586, 0.06415586918592453, -0.73236083984375, -0.07068372517824173, 0.7140786647796631, -0.41699016094207764, 0.00300445337...
method on your class. In addition, > you should overload the `op_Equality` > and `op_Inequality` operators. > This ensures that all tests for equality > return consistent results. 2. No, [operators do not use the Equals method](https://stackoverflow.com/a/1849288/712526). They must be [overloaded separately](https:...
[ -0.15061116218566895, -0.00663173571228981, 0.2728053033351898, 0.2351437509059906, -0.04390657693147659, -0.15802623331546783, 0.479412317276001, -0.3010292649269104, -0.2852952480316162, -0.386226087808609, -0.08204811066389084, 0.37034350633621216, -0.49066397547721863, -0.1455539911985...
Is a postback (asp.net) considered as a pageview by google ads or CPM ads or it is ignored? How does google ads differentiate between a postback and a pageview? (**Update**: Sorry I mixed google adsense with google analytics. Not sure if this works the same way for adsense.) Since the google analytics code snippet ru...
[ 0.3084706664085388, 0.014405054040253162, 0.5683438181877136, 0.15000756084918976, -0.3194844722747803, -0.03367942199110985, 0.3206816017627716, -0.07869577407836914, -0.38966113328933716, -0.5417360663414001, -0.06721434742212296, 0.19569538533687592, -0.31920143961906433, 0.106514140963...
put the google code snippet into a user control and set the control's Visible property to false in the case of a postback.
[ 0.3289109170436859, -0.1394680142402649, 0.0733267217874527, 0.2990929186344147, 0.014124271459877491, -0.15361613035202026, 0.43227824568748474, 0.0910307839512825, 0.297648161649704, -0.354906290769577, -0.22014287114143372, 0.28074246644973755, -0.2246798872947693, 0.08244816213846207, ...
I've got a PHP script on a shared webhost that selects from ~300 'feeds' the 40 that haven't been updated in the last half hour, makes a cURL request and then delivers it to the user. ``` SELECT * FROM table WHERE latest_scan < NOW() - INTERVAL 30 MINUTE ORDER BY latest_scan ASC LIMIT 0, 40; // Make cURL request and p...
[ 0.5182583928108215, 0.48862871527671814, 0.9904459714889526, -0.09478507936000824, -0.021565532311797142, -0.08528204262256622, 0.17455127835273743, -0.22176191210746765, -0.17696361243724823, -0.632253110408783, -0.08264186233282089, 0.5917750000953674, -0.06533526629209518, -0.0276028960...
limit the number of fetches per run? To how many? It would be a good thing to "rate" how often each feed actually changes so if something has an average time of 24 hours per change, then you just fetch is every 12 hours. Just store #changes and #try's and pick the ones you need to check... you can run the script every...
[ 0.8659167289733887, -0.7843339443206787, 0.5266037583351135, 0.3393964469432831, -0.17906196415424347, -0.07932791113853455, 0.3121430277824402, -0.031141726300120354, -0.3453036844730377, -0.4520869553089142, 0.5565171837806702, 0.6108583807945251, -0.1505473256111145, -0.0171224344521760...
Is there an automatic way to add base classes to Linq2Sql entities? I know I can define a partial and implement that but there has to be an automated way, right? The LINQ-to-SQL code-generator supports this directly. The base-class for the data-context can be set in the designer, as the `Base Class` property. Alterna...
[ 0.16544245183467865, 0.31753218173980713, 0.3509363830089569, 0.0659460797905922, -0.2054138481616974, -0.1708211749792099, -0.06463770568370819, -0.3300233781337738, 0.17789718508720398, -0.19875678420066833, -0.20977085828781128, 0.5947226881980896, -0.27292194962501526, -0.1236563324928...
because it is very literal, you can also use this approach to make your entities implement an interface - for example, when my classes have properties like `LastUpdated` and `UpdatedBy`, I might have an `IAuditable` interface that defines these. Then I can put code in my data-context's `SubmitChanges` (override) that c...
[ 0.31475913524627686, -0.10753901302814484, 0.34592658281326294, 0.22882391512393951, -0.07930350303649902, -0.011346422135829926, 0.05672852322459221, 0.24505673348903656, 0.1721269190311432, -0.7232939004898071, 0.051417190581560135, 0.707912027835846, 0.19453035295009613, 0.2037170380353...
How do you like your CRUD programs. Code-generated, framework-driven, or manually written? My experience with code generators is that they're a good start but after the changes have settled down I usually want to rewrite the modules by hand. Of course, that can become a maintenance problem. But it really turns into a "...
[ 0.8953525424003601, -0.18045039474964142, 0.039085086435079575, 0.2272450476884842, 0.10355188697576523, -0.2353413701057434, 0.26722609996795654, -0.025402627885341644, -0.39411625266075134, -0.5361855030059814, 0.29392731189727783, 0.5602585673332214, 0.23662053048610687, 0.1052783876657...
Take the method System.Windows.Forms.Control.Invoke(Delegate method) Why does this give a compile time error: ``` string str = "woop"; Invoke(() => this.Text = str); // Error: Cannot convert lambda expression to type 'System.Delegate' // because it is not a delegate type ``` Yet this works fine: ``` string str = "...
[ 0.12001501023769379, -0.23422186076641083, 0.2566409707069397, -0.12407536804676056, 0.1634172946214676, -0.10929220169782639, 0.32821255922317505, -0.5933470129966736, -0.10181021690368652, -0.16000284254550934, -0.15803498029708862, 0.5491653680801392, -0.38839417695999146, -0.1159303039...
type of the object referred to by `x` to be? Yes, the compiler *could* generate a new delegate type with an appropriate signature, but that's rarely useful and you end up with less opportunity for error checking. If you want to make it easy to call `Control.Invoke` with an `Action` the easiest thing to do is add an ex...
[ 0.1337786465883255, -0.05168626829981804, -0.06684377044439316, 0.1473901867866516, 0.04480263218283653, -0.17112621665000916, 0.10361282527446747, -0.16868075728416443, -0.15121622383594513, -0.2979529798030853, -0.29479822516441345, 0.25576624274253845, -0.4662172198295593, 0.21192589402...
I am trying to learn ASP.NET MVC and I hit this problem: I have a "view product details" form that I want to reuse as an add/edit form. (When you look at the product details, if you have the rights to do it an Edit link should appear; it should redisplay the same form, but with the textbox fields enabled this time.) R...
[ 0.2841114401817322, -0.25301074981689453, 0.5884087085723877, -0.1855895072221756, -0.11390239000320435, 0.009578678756952286, -0.016133088618516922, -0.14017964899539948, -0.20821067690849304, -0.8428211808204651, 0.11037071794271469, 0.6050115823745728, -0.15275883674621582, 0.4412686824...
</tr> ``` Is there a way I could reuse it without putting too much logic in the view? For example, I will need to remove the `disabled = "disabled"` part (but the `size` part needs to stay there), to put everything inside a form and so on. If it can't be done, that's fine, I'm just trying not to repeat the same thin...
[ 0.19973896443843842, -0.09931262582540512, 0.39158695936203003, 0.02809401974081993, 0.04835706204175949, -0.01928054168820381, 0.1372784823179245, -0.0934528112411499, -0.32795894145965576, -0.6816647052764893, -0.0044653331860899925, 0.6838033199310303, -0.20511819422245026, 0.2813576757...
of just using Product ``` public class ProductViewData { public Product Product {get; set;} public bool CanEdit {get; set;} } ```
[ 0.5828243494033813, -0.24763135612010956, 0.21908432245254517, -0.2753323018550873, 0.19745182991027832, 0.16700902581214905, 0.04249677434563637, -0.04491083323955536, 0.18141412734985352, -0.5369361639022827, -0.26115721464157104, 0.7196674346923828, -0.41520246863365173, 0.0152901485562...
OS X 10.5.6. My Eclipse 3.4 is going crazy lately. After innocent operations like typing text or moving some files in Navigator view or saving, it sometimes starts "waiting on background operation", and eats one CPU core, shuffling back and forth tens of megabytes of memory. I suspect some of plug-ins went rogue. ...
[ 0.07877983152866364, 0.23210786283016205, 0.3169836699962616, -0.32435259222984314, -0.21489442884922028, 0.005271398928016424, 0.48701193928718567, 0.057683415710926056, 0.004620202351361513, -0.7872992753982544, -0.08044546097517014, 0.6172155141830444, -0.7294073104858398, -0.2209445685...
display properly. If you're trying to display them on the console, forget it; the console on most machines is way too limited. I suggest you either write your output to a file and use a good text editor to read it, or display the output in a Swing component like a JTextPane.
[ 0.42510631680488586, 0.04061213880777359, 0.3565348982810974, 0.17158159613609314, -0.16726459562778473, -0.13966630399227142, -0.024066684767603874, 0.005550882313400507, -0.118405282497406, -0.850204348564148, -0.10729347914457321, 0.6755982041358948, 0.026093771681189537, -0.28702214360...
On a program of me, the [splint](http://www.splint.org/) checker warns: ``` expat-test.c:23:1: Function exported but not used outside expat-test: start A declaration is exported, but not used outside this module. Declaration can use static qualifier. (Use -exportlocal to inhibit warning) expat-test.c:38:1: Defi...
[ 0.39914146065711975, 0.2510857880115509, 0.14055919647216797, -0.2341790646314621, -0.11603915691375732, -0.32850033044815063, 0.21997879445552826, -0.09377601742744446, -0.04572831094264984, -0.08361759781837463, -0.6939592957496643, 0.4811677038669586, -0.4928528070449829, 0.111927911639...
you call `XML_SetElementHandler()` in the same translation unit (normally the .c source file) in which `start()` is defined? If so, the warning might be correct: Add `static` to the function definition and check if your application still links without errors.
[ 0.2756928503513336, -0.094871386885643, 0.21617591381072998, -0.08126933127641678, 0.009171855635941029, -0.637729823589325, 0.04221014678478241, 0.0848776251077652, -0.16531945765018463, -0.1648542284965515, -0.6273476481437683, 0.4619269371032715, -0.4111572504043579, 0.02515505813062191...
I am trying to write a static function to Or two expressions, but recieve the following error: > The parameter 'item' is not in scope. > > > Description: An unhandled exception > occurred during the execution of the > current web request. Please review the > stack trace for more information about > the error and...
[ -0.10195529460906982, 0.15773245692253113, 0.2885235548019409, -0.09684218466281891, -0.013340919278562069, 0.04198095574975014, 0.40312933921813965, -0.3576045334339142, -0.012788680382072926, -0.6139492988586426, -0.18103203177452087, 0.4730784296989441, -0.5060770511627197, 0.0538686625...
param = Expression.Parameter(typeof(T), "item"); var filterExpression = Expression.Lambda<Func<T, bool>> (Expression.Or( left.Body, right.Body ), param); // Build the expression and return it return (filterExpression); } ``` **edit**: adding more info The exp...
[ 0.1416739523410797, -0.3803228735923767, 0.4111084043979645, -0.0052928919903934, -0.0018067974597215652, 0.2835051715373993, 0.3770686686038971, -0.6944279074668884, -0.1842011958360672, -0.5161921381950378, -0.5003994703292847, 0.5463821887969971, -0.6413195729255676, -0.2223218530416488...
am all ears. Also, I do not know how many are being or'd in advance. ``` public static Expression<Func<T, bool>> FilterExpression(string filterBy, object Value, FilterBinaryExpression binaryExpression) { // Define the parameter to use var param = Expression.Parameter(typeof(T), "item"); // Filter expressi...
[ 0.21154893934726715, 0.021191077306866646, 0.6163089871406555, -0.23384025692939758, -0.053948696702718735, -0.00473540835082531, 0.4210242033004761, -0.8276087641716003, -0.004724147729575634, -0.6015775799751282, -0.20201846957206726, 0.9761341214179993, -0.31089815497398376, -0.03824089...
"Is the parameter equal to the value" by employing reflection var filterExpression = Expression.Lambda<Func<T, bool>> (Expression.Equal( Expression.Convert(Expression.Property(param, filterBy), typeof(TVal)), Expression.Constant(Value)
[ -0.1335614025592804, -0.4331379532814026, 0.39703452587127686, -0.18888938426971436, -0.3072473704814911, 0.19661477208137512, 0.14725662767887115, -0.8061909079551697, -0.15203166007995605, -0.4375622570514679, 0.03316742554306984, 0.6443560719490051, -0.6798516511917114, -0.1465884745121...
), param); // Build the expression and return it return (filterExpression); } ``` **edit**: adding even more info Alternatively, is there a better
[ 0.12314791232347488, -0.29604849219322205, 0.38272833824157715, -0.0672040656208992, 0.14738069474697113, 0.06687121838331223, 0.3535853922367096, -0.43216192722320557, -0.09485604614019394, -0.6142292022705078, -0.5006119012832642, 0.6711092591285706, -0.7288839221000671, -0.2066706866025...
way to do an or? Currently the .Where(constraint) works just fine where constraint is of type Expression>. How can i do where(constraint1 or constraint2) (to the constraint n'th) Thanks in advance! The issue is that the Expression you're creating in the method OrExpressions reuses the body of the two expressions. Thos...
[ 0.08297407627105713, 0.00762308482080698, 0.5585799813270569, 0.2154325693845749, 0.08158168196678162, 0.13321930170059204, 0.011949259787797928, -0.1088232547044754, -0.1556474268436432, -0.39496704936027527, 0.09700632840394974, 0.5838091373443604, -0.23357032239437103, -0.16864833235740...
parameter.
[ -0.264731228351593, -0.0685574859380722, 0.2681765556335449, 0.1641710251569748, -0.058538731187582016, 0.293312668800354, -0.3359314203262329, -0.3901222348213196, -0.1548876166343689, -0.5866694450378418, -0.019322331994771957, 0.633078932762146, 0.022459538653492928, 0.11919290572404861...
Is it possible to have a variable number of fields using django forms? The specific application is this: A user can upload as many pictures as they want on the image upload form. Once the pictures are uploaded they are taken to a page where they can give the pictures a name and description. The number of pictures wil...
[ 0.8137776851654053, 0.02673441357910633, 0.45340049266815186, 0.041696444153785706, -0.35275590419769287, -0.32113581895828247, -0.16480854153633118, -0.09433252364397049, -0.4540465474128723, -0.5603455305099487, 0.4197706878185272, 0.5414214730262756, -0.37853172421455383, 0.004254835192...
mentioned in jeff bauer's answer](http://www.b-list.org/weblog/2008/nov/09/dynamic-forms/) was written. Namely this line of code which doesn't seem to work: ``` # BAD CODE DO NOT USE!!! return type('ContactForm', [forms.BaseForm], { 'base_fields': fields }) ``` So here is what I came up with... The Answer I used:...
[ 0.2748475968837738, 0.1108466312289238, 0.39695030450820923, -0.1238349974155426, -0.12742109596729279, -0.10757054388523102, 0.09355217963457108, -0.8922554850578308, 0.09399958699941635, -0.42064976692199707, 0.03921518474817276, 0.45753827691078186, -0.761621356010437, -0.35739549994468...
fields[id+'_description'] = forms.CharField(widget=forms.Textarea) return type('tagPhotos', (forms.BaseForm,), { 'base_fields': fields }) ``` note tagging is not part of django, but it is free and very useful. check it out: [django-tagging](http://code.google.com/p/django-tagging/) Yes, it's possible to create f...
[ 0.20303286612033844, 0.022606851533055305, 0.41921648383140564, -0.03979400172829628, -0.23216168582439423, -0.31562313437461853, 0.15383480489253998, -0.2731523811817169, -0.14600399136543274, -0.3729640245437622, -0.23310767114162445, 0.7513796091079712, -0.4479926526546478, -0.306273609...
fields here ... date_requested = DateField() ``` For a better elaboration of this technique, see James Bennett's article: **So you want a dynamic form?** <http://www.b-list.org/weblog/2008/nov/09/dynamic-forms/>
[ 0.10081092268228531, -0.36228251457214355, 0.27305978536605835, -0.17833848297595978, -0.08432220667600632, -0.21423158049583435, 0.022955507040023804, -0.13573136925697327, -0.45293086767196655, -0.3286316990852356, -0.4594327211380005, 0.4721899926662445, -0.4878883361816406, -0.02631716...
Without having the full module path of a Django model, is it possible to do something like: ``` model = 'User' [in Django namespace] model.objects.all() ``` ...as opposed to: ``` User.objects.all(). ``` EDIT: I am trying to make this call based on command-line input. Is it possible to avoid the import statement, ...
[ -0.09975609183311462, 0.2424473762512207, 0.2386673539876938, -0.1940058469772339, -0.14665740728378296, -0.3738493025302887, 0.2620043158531189, -0.04102233424782753, -0.44946515560150146, -0.4451996386051178, -0.023342901840806007, 0.918093204498291, -0.6757778525352478, 0.03971602395176...
safely get a model without first knowing what app it belongs to. Look at the source code to loading.py if you want to test your luck at iterating over all the apps' models.) **Update for Django 1.7+:** According to Django's [deprecation timeline](https://docs.djangoproject.com/en/dev/internals/deprecation/#deprecation...
[ -0.11663936823606491, 0.5398984551429749, 0.783379077911377, -0.06607875227928162, 0.6469237804412842, -0.3616251051425934, 0.32599329948425293, -0.34665894508361816, 0.0518433079123497, -0.4297164976596832, -0.19552581012248993, 0.9020848274230957, -0.24414463341236115, -0.433892011642456...
My application needs to execute a fairly complicated series of queries against a database. Normally I would just dump everything into a stored procedure and execute it that way. But I do not have access to the database I'm trying to access so I can't create a stored procedure. Is there a better way of doing this inst...
[ 0.4374958872795105, 0.2727515697479248, 0.15081475675106049, 0.10235285758972168, 0.07421065121889114, 0.0013608922017738223, 0.42967087030410767, -0.08052948117256165, -0.3792833685874939, -0.6464375853538513, 0.3031616806983948, 0.27944400906562805, -0.37214186787605286, 0.20414611697196...
joining 10 tables if that's ultimately what you need to do. Generally SQL is good at this kind of thing. However, if there isn't that tight of a coupling between your 5-6 queries, then run them separately. If you choose to break up the query, hitting the DB 5-6 times is fine--absolutely nothing wrong with that. Your a...
[ 0.19635546207427979, -0.01788613758981228, 0.19336630403995514, 0.2398509830236435, -0.3503027558326721, -0.030968181788921356, 0.20973517000675201, -0.2285078465938568, -0.4026878774166107, -0.6863194704055786, 0.18098264932632446, 0.37573128938674927, -0.5197471976280212, 0.1873122602701...
This is in continuation with the question posted here: [Finding the center of mass on a 2D bitmap](https://stackoverflow.com/questions/408358/finding-the-center-of-mass-on-a-2d-bitmap) which talked about finding the center of mass in a boolean matrix, as the example was given. Suppose now we expand the matrix to this ...
[ -0.08147527277469635, 0.08486074954271317, 0.5115349888801575, -0.06053027883172035, 0.0912971943616867, 0.14811071753501892, -0.4724004566669464, -0.09971772134304047, -0.38837504386901855, -0.32051461935043335, -0.42223265767097473, -0.2473364919424057, -0.14074189960956573, 0.4441705346...
. . . . . 7 . X . . . . . . . 8 . . . . X X . . . 9 . . . . X X . . . ``` As you can see we now have 4 centers of mass, for 4 different clusters. We already know how to find a center of mass given that only one exists, if we run that algorithm on this matrix we'll get some point in the middle of the matrix which doe...
[ 0.15413296222686768, 0.5934768319129944, 0.8241471648216248, 0.2180507630109787, -0.019834153354167938, 0.27195480465888977, -0.18595361709594727, 0.3663230836391449, -0.7617972493171692, -0.6050265431404114, -0.29025352001190186, 0.030650809407234192, -0.23586469888687134, 0.8641032576560...
check each point in the matrix and figure out it's mass based on it's neighbours. The mass for points would fall with say the square of the distance. You could then pick the top four points with a minimum distance from each other. Here's some Python code I whipped together to try to illustrate the approach for finding...
[ -0.03082353062927723, 0.0847192034125328, 0.37809738516807556, -0.09078565984964371, 0.004796070512384176, 0.37307241559028625, -0.2112908810377121, -0.45388850569725037, -0.5711162090301514, -0.4426408112049103, 0.12881729006767273, 0.18134650588035583, 0.08895029127597809, 0.328279197216...
for a given point: ``` def distance(x1, y1, x2, y2): 'Manhattan distance http://en.wikipedia.org/wiki/Manhattan_distance' return abs(y1 - y2) + abs(x1 - x2) def mass(m, x, y): _mass = m[y][x] for _y in range(max(0, y - Y_RADIUS), min(HEIGHT, y + Y_RADIUS)): for _x in range(max(0, x - X_RADIUS), min(WIDTH,...
[ 0.05704884231090546, -0.06500659883022308, 0.4282078742980957, -0.04006760194897652, 0.17263241112232208, 0.48232606053352356, -0.020202644169330597, -0.36452338099479675, -0.17809665203094482, -0.6139984726905823, -0.3735150396823883, 0.2786431908607483, -0.017471635714173317, 0.164026036...
added accuracy using Euclidian distances is worth the cost of calling sqrt(). Iterating through our matrix and building up a list of tuples like (x, y, mass(x,y)): ``` point_mass = [] for y in range(0, HEIGHT): for x in range(0, WIDTH): point_mass.append((x, y, mass(matrix, x, y))) ``` Sorting the list on the...
[ -0.5926186442375183, -0.001793967094272375, 0.7597394585609436, 0.12005501240491867, -0.06551752239465714, 0.4955829083919525, 0.025060171261429787, -0.5531067848205566, -0.3030873239040375, -0.7830203175544739, -0.18406622111797333, 0.35281774401664734, 0.1412080079317093, 0.0347097851336...
to already seen points we'll get (I'm doing it manually since I've run out of time now to do it in code...): ``` (6, 2, 6.1580555555555554) (2, 1, 5.4861111111111107) (1, 4, 4.5938888888888885) (4, 7, 4.4480555555555554) ``` Which is a pretty intuitive result from just looking at your matrix (note that the coordina...
[ -0.1260599046945572, 0.09543317556381226, 0.8854867219924927, -0.08779589831829071, 0.02307586558163166, 0.28295817971229553, 0.03205569460988045, -0.17058274149894714, -0.5186144709587097, -0.6137088537216187, 0.10874312371015549, 0.45802879333496094, 0.10969763994216919, 0.34010952711105...
This is an erlang problem, it seems. I have this code to test the client sending data, written in Actionscript 3: ``` var socket:Socket=new Socket("localhost", 2345); socket.addEventListener(Event.CONNECT, connected); private function connected(event:Event):void { socket.writeInt(12); //packet length, should be c...
[ -0.29041343927383423, -0.038449011743068695, 0.5483218431472778, -0.14274923503398895, -0.08647812902927399, -0.04791197180747986, 0.19039317965507507, -0.3461495041847229, -0.3155254125595093, -0.6976612210273743, 0.3178118169307709, 0.43756622076034546, -0.45844006538391113, 0.0904734805...
{active, true}, {packet_size, 128}]), {ok, Socket} = gen_tcp:accept(Listen), gen_tcp:close(Listen), receive_data(Socket, []). receive_data(Socket, SoFar) -> receive {tcp,Socket,Bin} -> receive_data(Socket, [Bin|SoFar]); {tcp_closed,Socket} -> Bytes=list_t...
[ -0.12407112866640091, -0.3051440119743347, 0.7687289118766785, 0.01572849042713642, -0.025905106216669083, 0.32934585213661194, 0.058597732335329056, -0.4612332284450531, -0.08511792123317719, -0.5469202995300293, -0.40333884954452515, 0.477014422416687, -0.23752503097057343, 0.46963828802...
io:format("~p~n",[Bytes]) end. ``` Now, no matter what I send from the client, I ALWAYS get `[<<0,0,0,4,0,0,0,32>>]` as the response. I can try writing bytes to the socket directly instead of ints, and I get the same thing. I can write more or less data, same result. UTF strings same result. Even when specifying ...
[ 0.2888406217098236, -0.040110472589731216, 0.3973117172718048, -0.0248910803347826, -0.47953686118125916, 0.19889546930789948, 0.089090496301651, -0.09048202633857727, -0.3989827036857605, -0.7444672584533691, 0.07324575632810593, 0.7213842868804932, -0.4389449656009674, 0.1437146216630935...
find out that Flash was indeed sending the wrong packet. Although I don't know the significance of what the packet data actually was, I know what the problem was. I guess it was because I opened the Flash socket and the Erlang socket on the same machine - normally this wouldn't be a problem, but I believe that since Fl...
[ -0.0895078182220459, 0.09939871728420258, 0.2271675020456314, 0.2569405436515808, -0.14427952468395233, -0.27700158953666687, 0.2837367355823517, 0.19530515372753143, -0.21685433387756348, -0.5283657312393188, 0.2184586226940155, 0.5925958156585693, -0.40877220034599304, 0.0206978283822536...
socket, but you can receive it too, so that seemed to be the source of the problem. I tested running the Flash program on my laptop and the server on my PC and it worked fine.
[ 0.445434033870697, -0.03815799951553345, -0.06126168370246887, 0.0739065483212471, -0.6771937012672424, 0.12859056890010834, 0.014335370622575283, 0.5990602970123291, -0.08004985749721527, -0.34383144974708557, 0.20157447457313538, 0.6940467953681946, -0.13474668562412262, -0.0934533402323...
What are some of the biggest design flaws in C# or the .NET Framework in general? Example: there is no non-nullable string type and you have to check for DBNull when fetching values from an IDataReader. I agree emphatically with [this post](https://stackoverflow.com/questions/411906/c-net-design-flaws/413093#413093) (...
[ 0.10738691687583923, 0.1357627660036087, 0.053666066378355026, 0.05309908464550972, -0.39960503578186035, 0.023548411205410957, 0.4551054835319519, -0.15992605686187744, 0.011589791625738144, -0.29151538014411926, -0.052663665264844894, 0.7579041123390198, -0.2923448085784912, -0.023550668...
another poster here that requested arbitrary constructor signatures when used as constraints, ie. where `T : new(string)`, or where `T : new(string, int)` 5. I also agree with another poster here about fixing events, both for empty event lists and in the concurrent setting (though the latter is tricky), 6. operators sh...
[ -0.008579690009355545, -0.3896618187427521, 0.09614817053079605, 0.10472054779529572, -0.10970152169466019, -0.22104765474796295, 0.04776138439774513, -0.2576303780078888, -0.4107944369316101, -0.40709975361824036, -0.17457744479179382, 0.5839404463768005, -0.3808213174343109, -0.383340597...
the "object initializer" syntax only usable when creating an object? Why not make it available at any time, ie. `var e = new Foo(); e { Bar = baz };` 10. [fix quadratic enumerable behaviour](https://github.com/dotnet/csharplang/issues/378), 11. all collections should have immutable snapshots for iteration (ie. mutating...
[ -0.09814175963401794, -0.10032161325216293, 0.22331233322620392, -0.018422536551952362, -0.13169915974140167, -0.030522111803293228, 0.37751227617263794, -0.08982056379318237, -0.2579270303249359, -0.5013976097106934, -0.4695693850517273, 0.45994067192077637, -0.4730874300003052, -0.113931...
them with exhaustive pattern matching support, and don't allow invalid cases, 13. I'd love support for pattern matching in general, but at the very least for object type testing; I also kinda like the switch syntax proposed in another post here, 14. I agree with another post that the `System.IO` classes, like `Stream`,...
[ 0.3644145131111145, -0.07145155966281891, -0.07910971343517303, 0.34250345826148987, -0.29343608021736145, -0.19017574191093445, 0.23281820118427277, -0.10271018743515015, -0.10434675961732864, -0.8055679798126221, 0.04244156926870346, 0.5180956721305847, -0.4132026433944702, -0.2142906785...
I would prefer a form of checked exceptions better than that available in Java (see the research on type and effect systems for how this can be done), 18. fix various annoying corner cases in generic method overload resolution; for instance, try providing two overloaded extension methods, one that operates on reference...
[ 0.10368447750806808, -0.1501917541027069, 0.047289907932281494, 0.23947446048259735, -0.15172739326953888, -0.23157113790512085, 0.1272955685853958, -0.2886964976787567, -0.19795438647270203, -0.7106756567955017, 0.05093250051140785, 0.6277483701705933, -0.25032851099967957, -0.06294936686...
takes a lambda with a `MemberExpression`, ie. `() => Foo`, but that's not very efficient, * Update: C# 6.0 added the `nameof()` operator for single member names, but it doesn't work in generics (`nameof(T) == "T"` instead of the actual type-argument's name: you still need to do `typeof(T).Name`)) - nor does it allow y...
[ 0.20803305506706238, -0.21501809358596802, 0.16674883663654327, -0.09264164417982101, -0.09802944213151932, -0.14358358085155487, 0.30790263414382935, -0.43709927797317505, -0.013489286415278912, -0.36529606580734253, -0.0300020482391119, 0.6757030487060547, -0.4791911542415619, -0.1343587...
annotating immutable fields and make the type checker enforce it (just treat it as getter-only property fer chrissakes, it's not hard!); in fact, unify fields and properties in a more sensible way since there's no point in having both; C# 3.0's automatic properties are a first step in this direction, but they don't go ...
[ 0.004941844847053289, -0.07770387083292007, 0.19942504167556763, 0.0039844755083322525, -0.4204195737838745, -0.4386863708496094, 0.36673322319984436, -0.2793436646461487, -0.12763869762420654, -0.5310891270637512, -0.2169070988893509, 0.9679363965988159, -0.27600744366645813, -0.286046802...
of the class name is better at least, That's enough for now I suppose. These are all irritations I've run into in the past week. I could probably go on for hours if I really put my mind to it. C# 4.0 is already adding named, optional and default arguments, which I emphatically approve of. Now for one unreasonable req...
[ 0.27260008454322815, -0.06306548416614532, 0.18830277025699615, -0.014010419137775898, -0.20390570163726807, -0.1914970725774765, 0.3388501703739166, 0.31000176072120667, -0.30651697516441345, -0.31320706009864807, -0.11971922218799591, 0.6892469525337219, -0.1901131570339203, 0.3787056803...
We're getting a number of warnings in the Application Event Viewer on our IIS installation. We have an AppPool set up which contains two websites (both ColdFusion sites, not .NET). The Event Viewer shows the following warning: ``` A process serving application pool 'HighPriorityApps' exceeded time limits during shut...
[ 0.1859448403120041, 0.2551098167896271, 0.17553585767745972, 0.199576735496521, 0.15444980561733246, -0.30562883615493774, 0.34650757908821106, 0.002189754042774439, -0.05976910889148712, -0.7200124263763428, -0.014612854458391666, 0.16003181040287018, -0.48170143365859985, 0.1531743705272...
company we always split the separate sites into separate Application pools with ColdFusion running on them For each Pool we have the following settings set up. Right click on your Pools in Application pools Recycle worker process (in minutes) 1740, everything else clear We also make sure that Maximum number of work...
[ 0.34497591853141785, 0.27835211157798767, 0.7295756936073303, -0.12743012607097626, 0.33914801478385925, 0.042986173182725906, 0.3024503290653229, 0.14116863906383514, -0.311411589384079, -0.38270771503448486, -0.022169286385178566, 0.21093574166297913, 0.030574126169085503, 0.203299984335...
site properties box/Home Directory/Configuration you have both the Extensions for .cfm set to the JRUN/CF dll as well as the wildcard application map. We removed the wildcard application map as we found that jrun was getting polled on images and all sorts only to say it wouldn't process them. Also in Web Site proper...
[ 0.4623379409313202, -0.012338211759924889, 0.35961365699768066, 0.07336083799600601, -0.14683672785758972, -0.5732933282852173, 0.07652458548545837, 0.06159106642007828, -0.3282025456428528, -1.0478558540344238, 0.1251695454120636, 0.2849397659301758, -0.09758113324642181, 0.25300940871238...
out Fusion Reactor to find problems here. It could be that your web site is just too busy, I doubt this though as CF would be blowing up before IIS.
[ 0.5646541714668274, 0.12975060939788818, 0.24984140694141388, 0.07926806062459946, -0.11478390544652939, -0.5612562894821167, 0.17722129821777344, 0.4412817358970642, -0.32477912306785583, -0.33318719267845154, 0.1208697035908699, 0.15915797650814056, -0.10953091084957123, 0.39911881089210...
I am in the early stages of planning and designing a custom accounting application for my firm. My goal is to utilize an open source relational database for the data storage portion and I'm aware of two solid databases that are widely supported: MySQL and PostgreSQL. For a system that will require transactions, stored...
[ 0.18743011355400085, 0.5072186589241028, 0.04588589817285538, 0.06458017230033875, 0.12923111021518707, 0.01822701096534729, -0.17893224954605103, -0.022174246609210968, -0.11235706508159637, -0.4785059690475464, 0.3065764605998993, 0.5223798751831055, -0.044645536690950394, 0.000599376508...
to license costs. *Let me add: This is not an accounting need like Quickbooks or Peachtree. This is basically a system that handles accounting for a specific business service we provide. There are maybe two or three systems that cater to this need, are priced in the six figure range before any customization, and would...
[ 0.9466102123260498, 0.4094439148902893, 0.1639605313539505, 0.23277603089809418, 0.03390458598732948, 0.052644994109869, 0.1332605481147766, -0.04040997102856636, -0.01622874103486538, -0.47039490938186646, 0.29976221919059753, 0.7360534071922302, 0.13222680985927582, -0.10865948349237442,...
the vendor failed miserably. Sometimes you just need to do the job yourself and this particular project and budget warrants it.* Thanks for everyone's replies thus far. There are four main open-source relational database management systems of note that might be appropriate to this sort of application: Postgresql, MySQ...
[ 0.37567052245140076, 0.21193739771842957, 0.10483493655920029, 0.4636434316635132, -0.1551567018032074, -0.008170975372195244, 0.098908931016922, 0.2866130471229553, -0.3335459232330322, -0.505746603012085, -0.046550121158361435, 0.5400112867355347, -0.10852983593940735, 0.0504081659018993...
a lack of apparent vendor commitment. An example of a system that has this type of issue is [SAP-DB.](http://en.wikipedia.org/wiki/MaxDB) [Postgresql](http://www.postgresql.org/) has the best feature set of any of the open-source databases, and support for XA transactions, which you will probably want if your applicat...
[ -0.14388804137706757, -0.13450734317302704, 0.09163481742143631, 0.1356506198644638, -0.3917723000049591, 0.00973234698176384, 0.04328414425253868, 0.07684122771024704, -0.1053219810128212, -0.38823866844177246, -0.01718425191938877, 0.3243177533149719, -0.42937421798706055, 0.045596368610...
by Informix. Greenplum is a mofified version designed for data warehousing applications. EnterpriseDB is a company that provides supported commercial versions of PostgreSQL with some value-added software. [MySQL](http://www.mysql.com/) 5.x has a feature set that supports a reasonable cross section of capabilities, but...
[ 0.14200210571289062, 0.08655668050050735, 0.4629402756690979, 0.08553314208984375, -0.20654545724391937, -0.3497740924358368, -0.31789353489875793, 0.022048037499189377, -0.11888691037893295, -0.048190921545028687, -0.36139217019081116, 0.2193990796804428, -0.22044743597507477, 0.303096473...
generated [code forks](http://news.oreilly.com/2008/07/mysql-forks-could-drizzle-be-t.html) and the MySQL landscape is [somewhat messy,](http://ronaldbradford.com/blog/understanding-the-various-mysql-products-variants-2009-03-13/) with controversy about [quality issues in the 5.1 release.](http://monty-says.blogspot.co...
[ 0.40223395824432373, 0.024488911032676697, 0.4371318221092224, -0.1180122122168541, -0.2578143775463104, -0.38896840810775757, 0.12640871107578278, 0.0874500423669815, -0.37553003430366516, -0.2808992564678192, 0.03457223251461983, 0.4025413990020752, -0.1382901966571808, -0.02105511352419...
but what I could find was not specific on whether it supported the XA protocol. The documentation implies that the JDBC driver does have support for two-phase commits. An interesting variant on this system is [Fyracle](http://www.janus-software.com/fb_fyracle.html), which is designed to offer a degree of compatibilit...
[ 0.11979665607213974, 0.11876652389764786, 0.26118388772010803, -0.16635380685329437, -0.32650038599967957, -0.051054202020168304, -0.11529325693845749, 0.09508024901151657, -0.06951064616441727, -0.4470211863517761, 0.03340347856283188, 0.23635496199131012, -0.2895418107509613, 0.201555505...
I know people who were doing INGRES apps in 1990, and it dates back to the 1980s.
[ 0.35935452580451965, 0.5014088153839111, 0.5174349546432495, 0.026784829795360565, 0.14683161675930023, -0.04471921548247337, -0.3127298057079315, 0.5309277772903442, -0.06508921086788177, -0.3116001784801483, 0.4063139259815216, 0.10631532222032547, 0.07624121755361557, -0.042392719537019...
I've been profiling an application all day long and, having optimized a couple bits of code, I'm left with this on my todo list. It's the activation function for a neural network, which gets called over a 100 million times. According to dotTrace, it amounts to about 60% of the overall function time. How would you opti...
[ 0.28691041469573975, -0.05401027575135231, 0.4226761758327484, -0.04729602113366127, -0.03390001133084297, 0.10094445198774338, 0.49799808859825134, -0.3676159381866455, -0.0240014735609293, -0.5135552883148193, 0.24121850728988647, 0.8546309471130371, -0.3299734592437744, -0.1373349726200...
about 43% faster than your method, and this mathematically-equivalent code is the teeniest bit faster (46% faster than the original): ``` public static float Sigmoid(double value) { float k = Math.Exp(value); return k / (1.0f + k); } ``` **EDIT 2:** I'm not sure how much overhead C# functions have, but if yo...
[ 0.1415921151638031, 0.003980813082307577, 0.49579155445098877, 0.010645684786140919, -0.022395124658942223, 0.10484538227319717, 0.30408674478530884, -0.4131534695625305, -0.17699742317199707, -0.4479335844516754, -0.07195789366960526, 0.44036543369293213, -0.24837110936641693, -0.13545835...
if you're doing millions of calls, the function-calling overhead might be a problem. Try making an inline function and see if that's any help.
[ 0.48280054330825806, -0.04275837168097496, -0.06533211469650269, 0.2870430052280426, -0.06751450896263123, -0.03770988807082176, 0.22498132288455963, 0.0347864143550396, -0.2548338770866394, -0.3917997181415558, 0.27603021264076233, 0.8563863039016724, -0.31125327944755554, 0.0185763984918...
Let's say I have a table *tbl* with columns *id* and *title*. I need to change all values of title column: 1. from 'a-1' to 'a1', 2. from 'a.1' to 'a1', 3. from 'b-1' to 'b1', 4. from 'b.1' to 'b1'. Right now, I'm performing two UPDATE statements: ``` UPDATE tbl SET title='a1' WHERE title IN ('a-1', 'a.1') UPDATE tb...
[ 0.1879463791847229, 0.15775959193706512, 0.30065080523490906, -0.1399182379245758, -0.14741888642311096, 0.004063541069626808, 0.2826525568962097, -0.44269758462905884, -0.30356502532958984, -0.6873412132263184, -0.06506609916687012, 0.6640956401824951, -0.3803400695323944, 0.0381996370851...
statement completes in about 90 seconds), and I have a huge number of updates to perform. So, is it possible to merge the updates so it would only scan the table once? Or perhaps, there's a better way to deal with in a situation like this. EDIT: Note, that the real data I'm working with and the changes to the data I ...
[ 0.03993196040391922, -0.12354444712400436, 0.4872840344905853, 0.09191980957984924, -0.250340074300766, 0.09651902318000793, 0.7189565896987915, -0.22017164528369904, -0.34049636125564575, -0.5330950021743774, -0.21594122052192688, 0.36264342069625854, 0.0017206575721502304, 0.065972998738...
could be many hundreds of mappings to each of the new values, you would create a separate table of the old and new values, and then use that in the UPDATE statement. In one dialect of SQL: ``` CREATE TEMP TABLE mapper (old_val CHAR(5) NOT NULL, new_val CHAR(5) NOT NULL); ...multiple inserts into mapper... INSERT INTO ...
[ -0.13268136978149414, -0.07240287214517593, 0.27375712990760803, -0.058633867651224136, 0.04924938455224037, 0.036041196435689926, 0.07831370830535889, -0.5826370120048523, -0.027503885328769684, -0.671644926071167, -0.25786301493644714, 0.485400915145874, -0.29191216826438904, 0.056518014...
is a correlated sub-query (not necessarily fast, but faster than most of the alternatives if the mapper table has thousands of rows) that pulls the new value out of the mapping table that corresponds to the old value. The second ensures that only those rows which have a value in the mapping table are modified; this is ...
[ -0.29012197256088257, -0.3423424959182739, 0.14184409379959106, 0.3882753252983093, -0.07580870389938354, -0.2210836261510849, 0.07198044657707214, -0.25453734397888184, -0.07018119841814041, -0.4366898536682129, -0.06326796859502792, 0.42939284443855286, -0.2014102041721344, 0.14017322659...
thousands or millions of mappings to perform, then you are likely to exceed the limits of the SQL statement length in your DBMS.
[ 0.11263991892337799, 0.17460288107395172, 0.31268584728240967, 0.2793491780757904, 0.1819944977760315, -0.3368084132671356, 0.2878166437149048, -0.14770308136940002, -0.15697816014289856, -0.7292587161064148, -0.03623771667480469, 0.28114885091781616, 0.036850396543741226, 0.14366820454597...
For the purposes of unit testing I'd like to create an iPhone project target in Xcode that includes all of the release application files, plus some additional files containing code useful for UI unit testing. I can do this by duplicating the original application target; however, the problem with this is that every tim...
[ 0.35015520453453064, 0.1077888160943985, 0.1505081206560135, 0.16770435869693756, -0.05397181212902069, 0.00688378419727087, 0.21446700394153595, -0.2818126380443573, 0.1850387156009674, -0.6044720411300659, 0.13682448863983154, 0.5258333683013916, -0.43810588121414185, -0.1811410784721374...
every file added to the original app target is also auto added the unit test target? In Xcode, you can create targets which have direct dependencies on each other. There are a number of non-product building targets that can help with this in the *Other* category when adding a new target, depending on how simple or comp...
[ 0.8913669586181641, 0.09150996804237366, 0.020992882549762726, 0.25379812717437744, -0.018025264143943787, 0.1270061880350113, 0.06411206722259521, -0.108683742582798, -0.12061074376106262, -0.7097907662391663, -0.07394292950630188, 0.5131979584693909, -0.464645653963089, 0.065771512687206...
tweaking on the new, UI testing target, but once it's set up, it will be very easy to maintain. Not knowing your exact situation, it's impossible to give you a step-by-step answer, but here are the general guidelines (tweak to suit your situation): 1. Create the copy of your original target since most of your settings...
[ 0.5930423736572266, -0.3167886734008789, 0.5943862795829773, 0.261553019285202, -0.077228844165802, -0.18269534409046173, 0.2938370108604431, -0.4152533710002899, -0.05602991208434105, -0.6641992330551147, -0.20464082062244415, 0.310967355966568, -0.37451574206352234, -0.20389597117900848,...
can also drag your original target (from under the **Targets** disclosure triangle) into your new target and it will automatically set up the dependency. Now, select your testing target as the active target and it will always build with those rules. Also, if you add/change source in the main target, it will properly b...
[ 0.6868882179260254, 0.03379835560917854, 0.3933218717575073, 0.17714017629623413, -0.05462316423654556, -0.2506614625453949, 0.1394822746515274, -0.28382962942123413, 0.1662610024213791, -1.0485841035842896, 0.07198656350374222, 0.6446110010147095, -0.2811746299266815, -0.06098512187600136...
really helps make using the product a lot more efficient. There are a lot of nifty things that can be done fairly easily in Xcode if you know how, even with very large or complex projects.
[ 0.9388954639434814, 0.1436552107334137, -0.14761632680892944, 0.5141744017601013, -0.06246332451701164, -0.1996113508939743, -0.025214428082108498, 0.524520754814148, 0.08494628965854645, -0.5137373208999634, 0.26299089193344116, 0.13815414905548096, -0.16907130181789398, 0.122021637856960...
Is it possible to get statistics about each users contributions, total line count etc? You can get basic statistics by using "Show Log..." and then "Statistics" (Button at the bottom IIRC)
[ 0.3264767825603485, -0.17395588755607605, 0.3475632071495056, 0.5859866738319397, -0.019579803571105003, -0.19346235692501068, -0.026330765336751938, 0.17552684247493744, -0.27422744035720825, -0.6220802068710327, 0.12957118451595306, 0.29865795373916626, 0.033230967819690704, -0.079494841...
``` int[] mylist = { 2, 4, 5 }; IEnumerable<int> list1 = mylist; list1.ToList().Add(1); // why 1 does not get addedto list1?? ``` Why would it? ToList() generates a new List and the value '1' gets added to it. Since you don't store the return, the new list then gets tossed when it's out of scope. ToList() doesn't ch...
[ 0.21045346558094025, 0.03977486491203308, 0.35991933941841125, -0.3920154571533203, 0.1544504165649414, -0.023014722391963005, 0.1768617033958435, -0.45124348998069763, -0.41548019647598267, -0.5747418403625488, -0.4419286251068115, 0.40008753538131714, -0.6136674284934998, 0.0610874965786...
Back in the ITAR era, there was a [popular sig that performed Diffie-Hellman key exchange](http://www.cypherspace.org/adam/rsa/perl-dh.html): ``` #!/usr/bin/perl -- -export-a-crypto-system-sig Diffie-Hellman-2-lines ($g,$e,$m)=@ARGV,$m||die"$0 gen exp mod\n";print`echo "16dio1[d2%Sa2/d0<X+d *La1=z\U$m%0]SX$e"[$g*]\Esz...
[ -0.18637704849243164, -0.17025010287761688, 0.3168196380138397, 0.10863593965768814, -0.3195391595363617, 0.12281297892332077, 0.04846610128879547, -0.3975580632686615, -0.4820273220539093, 0.2561272084712982, -0.3522705137729645, 0.3022076487541199, -0.6207422614097595, 0.0327323079109191...
(or Perl): all the program does, if you run it as "`program g x m`", is output gx(mod m), where g, x, and m are given in hexadecimal. E.g. ``` ./dh.pl 10 2 9 4 ``` because 10 is sixteen and 102 is two-hundred-and-fifty-six, which is 4 mod 9. And the `dc` command `16dio???|p` says: * push **sixteen** onto the stack...
[ -0.06488445401191711, 0.12841908633708954, 0.5674747228622437, -0.17230132222175598, -0.05235860124230385, 0.5719786882400513, 0.05202261731028557, -0.5108975172042847, -0.38746029138565063, -0.02685554325580597, -0.31980282068252563, 0.4181624948978424, -0.3525114357471466, -0.01849754340...
pushed onto the stack), * do the exponentiation gx(mod m), * **p**rint it. Given that `dc` has a one-character command "`|`" for computing "gx(mod m)" which is precisely the problem, I find it highly unlikely that it can be improved upon in any programming language. `dc` just happens to be a tool for exactly this prob...
[ -0.08708275854587555, 0.09059561789035797, 0.4386645555496216, -0.11611682176589966, -0.13254192471504211, 0.14637558162212372, -0.0441795215010643, -0.20865389704704285, -0.36213868856430054, -0.4836380183696747, -0.36715200543403625, 0.6832635998725891, -0.2579271197319031, 0.17057022452...
numbers in three different lines (at least on the `dc` I have here), so it ***can be improved*** to something that can handle them all on the same line :-) `dc -e '16dio?|p'`
[ 0.22144770622253418, 0.07342640310525894, 0.660217821598053, 0.06880979239940643, -0.08764476329088211, 0.3859986662864685, 0.06871084123849869, -0.2186843603849411, -0.519195556640625, -0.3759896755218506, -0.33016836643218994, 0.5935893654823303, -0.5938823819160461, -0.0624147467315197,...
I'm trying to implement the Media Player custom field control described in this MSDN article: <http://msdn.microsoft.com/en-us/library/aa981226.aspx> I created a custom site column (of type Link) in a custom content type and followed all the instructions to deploy the solution into SharePoint and add the control to a ...
[ 0.1768898069858551, 0.02884511649608612, 0.39396023750305176, 0.08108676970005035, -0.0743134394288063, -0.21302826702594757, -0.010409184731543064, -0.06985597312450409, -0.09494180977344513, -0.6165487766265869, 0.14765924215316772, 0.7450312972068787, -0.33998191356658936, 0.24346497654...
does not exist. If you've implemented this control, did you have to implement anything other than what the article details? Pretty sure I don't need an ASCX here because the control is handling rendering the media player. Thank you Figured this out ... I had added the SafeControl entry manually at first to my web....
[ -0.19461391866207123, -0.033267829567193985, 0.4304661154747009, 0.2989872395992279, -0.07799917459487915, -0.3151474893093109, 0.15034610033035278, 0.13618861138820648, -0.13872097432613373, -0.8183529376983643, -0.11547810584306717, 0.7122772336006165, -0.2851600646972656, 0.350037872791...
I'm working on a new project and I'm using the repository pattern, I have my repository that pulls the data from the database and a "service" class which uses the repository and does all the business logic. something similar to the following; ``` public class UserRepository : IUserRepository { public IQueryable<U...
[ 0.18396173417568207, -0.019503001123666763, 0.3196738362312317, 0.06760233640670776, -0.06938827782869339, 0.18709494173526764, 0.17982326447963715, -0.17864060401916504, -0.2570776045322418, -0.6905001997947693, -0.14688043296337128, 0.535364031791687, -0.33581459522247314, 0.286485314369...