text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
sure we have our terminology straight, an "SSL certificate" in common parlance is really composed of two components: * A public certificate * A private key The public certificate component is signed by your chosen CA (certificate authority), after which it can be freely distributed. It does not need to be secured or ...
[ 0.3918810486793518, 0.09613926708698273, 0.462733656167984, 0.3798043429851532, 0.20679925382137299, -0.7057418823242188, 0.13832664489746094, 0.03904811665415764, -0.06613055616617203, -0.33987998962402344, -0.4697228670120239, 0.18596407771110535, -0.04526006057858467, 0.1486537307500839...
-- hardware security modules) to store the private key. These range from smart-card based solutions to multi-key, network enabled appliances with m/n controls etc etc. There are risks (not to mention costs) associated with HSMs that I will not go into here. Many applications simply retain the private key on disk. Ther...
[ 0.40876126289367676, 0.15538430213928223, 0.44969797134399414, 0.2826867401599884, 0.1542932242155075, -0.3822052776813507, 0.21587549149990082, -0.18037450313568115, -0.2812266945838928, -0.5733492970466614, -0.4883585572242737, 0.716929018497467, 0.024968281388282776, 0.16750401258468628...
servers. (If you're rolling your own using the OpenSSL API, pick one of the obvious native key formats). As always, there is a security trade-off. In particular, if you are using password-protected encryption on the private key file and you experience an unexpected application restart (eg power outage), then somebody ...
[ 0.051147688180208206, 0.03931461647152901, 0.45593366026878357, 0.31979233026504517, 0.11905474960803986, -0.3771848678588867, 0.08213528990745544, 0.16843439638614655, -0.588184654712677, -0.4399568736553192, -0.3991069495677948, 0.45477256178855896, -0.2634117901325226, -0.03907987847924...
key file unencrypted but if you are the sole admin/techy in a small shop, you should definitely consider what might happen if the server reboots when you are not available, and what the costs might be to your business.
[ 0.4099279046058655, -0.10449068993330002, 0.03432076796889305, 0.46653980016708374, 0.5073675513267517, -0.322787880897522, 0.3644372522830963, 0.1043323278427124, -0.48698657751083374, -0.334378182888031, -0.34757572412490845, 0.5592560172080994, 0.119557686150074, 0.2954997420310974, -...
The code below is checking performance of three different ways to do same solution. ``` public static void Main(string[] args) { // for loop { Stopwatch sw = Stopwatch.StartNew(); int accumulator = 0; for (int i = 1; i <= 100000000; ++i)
[ 0.31358131766319275, -0.3303963840007782, 0.5325390100479126, -0.3800697922706604, 0.3046543598175049, 0.2858341634273529, 0.513593852519989, -0.24689872562885284, -0.3004969656467438, -0.3348493278026581, -0.09743530303239822, 0.3646329939365387, -0.5655279159545898, 0.36465421319007874, ...
{ accumulator += i; } sw.Stop(); Console.WriteLine("time = {0}; result = {1}", sw.ElapsedMilliseconds, accumulator); } //Enumerable.Range {
[ -0.026419851928949356, -0.4388747215270996, 0.9278885722160339, -0.19553644955158234, 0.42522192001342773, 0.20799267292022705, 0.1627221256494522, -0.4620739817619324, 0.06369350850582123, -0.3219456672668457, -0.11236739158630371, 0.39645910263061523, 0.015357485972344875, 0.256461590528...
Stopwatch sw = Stopwatch.StartNew(); var ret = Enumerable.Range(1, 100000000).Aggregate(0, (accumulator, n) => accumulator + n); sw.Stop(); Console.WriteLine("time = {0}; result = {1}", sw.ElapsedMilliseconds, ret); } //self-made IEnumerable<int> { ...
[ 0.1386529505252838, -0.4922040104866028, 0.9941674470901489, -0.31967073678970337, 0.1334296613931656, 0.3238559365272522, 0.47361060976982117, -0.2610812783241272, -0.12348587065935135, -0.46520575881004333, -0.03201843425631523, 0.5062589049339294, -0.13421687483787537, 0.196835145354270...
var ret = GetIntRange(1, 100000000).Aggregate(0, (accumulator, n) => accumulator + n); sw.Stop(); Console.WriteLine("time = {0}; result = {1}", sw.ElapsedMilliseconds, ret); } } private static IEnumerable<int> GetIntRange(int start, int count) { int end = start + co...
[ -0.21318884193897247, -0.39259275794029236, 0.7888830900192261, -0.3113826513290405, 0.2363218516111374, 0.39487943053245544, 0.5290501713752747, -0.4487638771533966, -0.07003560662269592, -0.425703763961792, -0.23502808809280396, 0.6369966864585876, -0.0929185152053833, 0.2185849696397781...
i = start; i < end; ++i) { yield return i; } } } ``` The results are: ``` time = 306; result = 987459712 time = 1301; result = 987459712 time = 2860; result = 987459712 ``` It is not surprising that the "for loop" is faster than the other two solutions, because Enumerable.Aggregate ...
[ -0.14444416761398315, -0.07378249615430832, 0.34049615263938904, -0.20789922773838043, -0.03308621048927307, 0.13964253664016724, 0.5111923813819885, -0.6165351271629333, -0.02686123736202717, -0.541803240776062, 0.19709259271621704, 0.7087137699127197, -0.22005175054073334, 0.072537004947...
the simple GetIntRange method. What are the possible reasons for this? Why should `Enumerable.Range` be any slower than your self-made `GetIntRange`? In fact, if `Enumerable.Range` were defined as ``` public static class Enumerable { public static IEnumerable<int> Range(int start, int count) { var end = s...
[ -0.15155039727687836, -0.617364227771759, 0.5282081961631775, 0.032476428896188736, -0.0061666714027523994, -0.16029085218906403, 0.3121595084667206, -0.527607262134552, -0.08986260741949081, -0.3226306736469269, -0.15605714917182922, 0.7726603746414185, -0.337173193693161, -0.046437758952...
as fast as your self-made `GetIntRange`. This is in fact the reference implementation for `Enumerable.Range`, absent any tricks on the part of the compiler or programmer. You may want to compare your `GetIntRange` and `System.Linq.Enumerable.Range` with the following implementation (of course, compile in release mode,...
[ 0.20319774746894836, -0.3323472738265991, 0.30097857117652893, 0.1727839708328247, 0.14911703765392303, -0.10366228967905045, 0.39875495433807373, -0.3340415060520172, -0.21037578582763672, -0.4916794002056122, -0.2295486479997635, 0.7522158026695251, -0.1692410111427307, -0.25527879595756...
class RangeEnumerable : IEnumerable<int> { private int _Start; private int _Count; public RangeEnumerable(int start, int count) { _Start = start; _Count = count; } public virtual IEnumerator<int> GetEnumerator() { return new RangeEnumerator(_St...
[ 0.0842333436012268, -0.3262987434864044, 0.4756490886211395, -0.13695679605007172, 0.18083086609840393, 0.18884824216365814, 0.34522175788879395, -0.35522764921188354, 0.29102760553359985, -0.7292894124984741, -0.3066492974758148, 0.8514230847358704, -0.3717019557952881, 0.1599424928426742...
_Count); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } private class RangeEnumerator : IEnumerator<int> { private int _Current; private int _End; public RangeEnumerator(int start, int count) { _Current = start
[ 0.052613671869039536, -0.3434986174106598, 0.6458997130393982, -0.40652036666870117, 0.233799010515213, 0.11118826270103455, 0.31380268931388855, -0.4954623281955719, 0.02690284699201584, -0.4909748136997223, -0.3238016664981842, 0.7550074458122253, -0.3931282162666321, 0.19478821754455566...
- 1; _End = start + count; } public virtual void Dispose() { _Current = _End; } public virtual void Reset() { throw new NotImplementedException(); }
[ 0.39324524998664856, -0.26432275772094727, -0.009664586745202541, -0.20266710221767426, 0.39952871203422546, 0.10210508853197098, 0.1616808921098709, -0.23824264109134674, -0.2235129177570343, -0.5335973501205444, -0.17667075991630554, 0.4185766279697418, -0.26524531841278076, 0.5068154931...
public virtual bool MoveNext() { ++_Current; return _Current < _End; } public virtual int Current { get { return _Current; } } object IEnumerator.Current { get { return Current; } } } } ```
[ -0.18380968272686005, -0.3595837354660034, 0.6808112859725952, -0.010826102457940578, 0.23436938226222992, -0.027739908546209335, -0.08065292239189148, 0.1898534595966339, -0.18481968343257904, -0.5653281211853027, -0.34171029925346375, 0.4519454836845398, -0.2066567987203598, 0.5246166586...
The MySQL documentation isn't very clear on this. I want to add an index to an existing table. The table is a user table with the login id and password and I want to create an index for this to optimize logging in. This is how I thought I would try it: ``` mysql> ALTER TABLE `users` ADD INDEX(`name`,`password`); ``...
[ -0.514625608921051, 0.2695627212524414, 0.667529821395874, 0.3126528561115265, 0.028550028800964355, -0.10977697372436523, 0.025662994012236595, -0.005690654274076223, -0.0941164419054985, -0.585075855255127, -0.08576735109090805, 0.3999941051006317, -0.35711032152175903, 0.219769611954689...
0 | PRIMARY | 1 | id | A | 2 | NULL | NULL | | BTREE | | | users |
[ 0.02260664477944374, 0.29467687010765076, 0.10986479371786118, -0.2215331792831421, -0.11345746368169785, 0.04418698325753212, 0.4044803977012634, -0.16944752633571625, 0.22298161685466766, -0.13742861151695251, -0.24019180238246918, 0.4455285370349884, -0.5541044473648071, 0.3524563312530...
1 | name | 1 | name | A | 2 | NULL | NULL | | BTREE | | | users |
[ -0.03821852058172226, 0.34900686144828796, 0.005375504493713379, -0.20268885791301727, -0.0834071934223175, -0.10930375754833221, 0.5613882541656494, -0.1285320222377777, -0.07055734843015671, -0.08103857934474945, -0.300198495388031, 0.33935606479644775, -0.5881915092468262, 0.31923452019...
1 | name | 2 | password | A | 2 | NULL | NULL | YES | BTREE | | +-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+ ``` Did this achieve what I was trying to do? (Optimiz...
[ 0.11508524417877197, 0.09635447710752487, 0.2201300412416458, 0.03663603588938713, 0.2574816644191742, -0.260638028383255, 0.7405862212181091, -0.3629476726055145, -0.14458751678466797, -0.12367206811904907, -0.15187853574752808, 0.5789451003074646, -0.4522985517978668, -0.1940317898988723...
Previously I only had a primary key on an a field called 'id'. Yes, this achieved creating an index. The index is named "`name`" (if you don't give the index a name, it tries to use the first column you specify in the index). The index is a composite of two columns: `name` in position 1, and `password` in position 2. ...
[ 0.09347343444824219, 0.22980670630931854, 0.19281214475631714, 0.2591451406478882, -0.037712644785642624, -0.11018896847963333, 0.16410115361213684, -0.1824503242969513, 0.11605709791183472, -0.7071892023086548, 0.13462956249713898, 0.35131093859672546, -0.1143265813589096, 0.4831580519676...
a good blog on the subject: "[You're Probably Storing Passwords Incorrectly](http://www.codinghorror.com/blog/archives/000953.html)"
[ 0.7436044216156006, 0.03427129611372948, -0.5269743204116821, 0.3183053731918335, 0.40120232105255127, -0.4593413472175598, 0.4386966824531555, 0.2559506595134735, -0.2915007174015045, -0.3937045931816101, -0.2244262844324112, 0.28206586837768555, 0.17695355415344238, -0.2869202196598053, ...
Does anyone know how to take a swf (version 7) and use the SwfLoader or something similar to access a root variable in the swf from a Flex application? I have tried many things with no success. I don't want to clutter this post with all of my failed attempts, but I will post them later if I see that they are needed as ...
[ 0.5455657839775085, -0.1321870982646942, 0.4643331468105316, -0.028984539210796356, -0.05830567702651024, -0.5122418403625488, 0.3984636068344116, 0.09065164625644684, -0.20819924771785736, -0.7254173755645752, -0.010711083188652992, 0.8256083726882935, -0.26265501976013184, -0.09610579162...
need to access variables in the swf. I don't care how it is done, As long as I can do it. Doesn't matter if I am bubbling an event or using the LocalConnection or directly accessing the variables, I have had no luck doing any of that up till this point. (The swf does load though... and shows up in my Flex app). Oh, an...
[ -0.05667668208479881, -0.08236072957515717, 0.6038236618041992, -0.15857775509357452, -0.324306458234787, -0.07464707642793655, 0.4342432916164398, 0.25482282042503357, -0.2665315568447113, -0.6343991756439209, -0.0031506747473031282, 0.7783569097518921, -0.4223610460758209, -0.11568502336...
variable to a javascript function from the swf and have that javascript function pass that same variable to a function in the FLEX app. I dont want to write all the code unless this sounds like it may be the answer you are looking for, in which case let me know and I will write out the code for you, or just ... Check ...
[ 0.2135111689567566, -0.13313420116901398, 0.46123623847961426, -0.10493236780166626, -0.10870924592018127, 0.04787608981132507, 0.25387173891067505, -0.265898197889328, -0.07698611170053482, -0.3965747058391571, 0.01969209313392639, 0.7007800936698914, -0.4624946415424347, -0.2650713622570...
I have to call domain A.com (which sets the cookies with http) from domain B.com. All I do on domain B.com is (javascript): ``` var head = document.getElementsByTagName("head")[0]; var script = document.createElement("script"); script.src = "A.com/setCookie?cache=1231213123"; head.appendChild(script); ``` This sets...
[ 0.26084253191947937, 0.4491686522960663, 0.48022887110710144, -0.39460694789886475, -0.1834162026643753, -0.22328683733940125, 0.5099162459373474, -0.35332733392715454, -0.1259259134531021, -0.6660881042480469, -0.10964073240756989, 0.5805833339691162, -0.2653260827064514, 0.02739804610610...
and fail. I have found no way to get around this. If it's worth anything, Chrome doesn't set the cookies either if you use the `<script`> appending method, but if you have a hidden `<img`> with the same source, Chrome works in addition to the rest of the browsers (except, again, Safari)
[ 0.586515486240387, 0.37515029311180115, 0.014147638343274593, 0.02966650202870369, -0.0547051727771759, -0.20584027469158173, 0.837390124797821, 0.08455409109592438, 0.016813354566693306, -0.6158522367477417, -0.07331518083810806, 0.7767625451087952, -0.19658595323562622, -0.42151230573654...
I currently develop with Django, but want to be ready when a future client inevitably requests a site done in ASP.NET MVC. While most of the structure and flow of ASP.NET MVC is more or less identical to Django and RoR, the one part I'm not sure about is the Apps methodology Django employs to make code reuse easier. I...
[ 0.5280770063400269, 0.17741356790065765, 0.30158311128616333, -0.14992153644561768, -0.1726568043231964, -0.34894484281539917, -0.11945725977420807, -0.0556483156979084, -0.19761665165424347, -0.7073286175727844, 0.039643920958042145, 0.7035968899726868, -0.18411122262477875, -0.2411930114...
required to integrate it? Perhaps some kind of plugin or module system? Django doesn't follow the traditional MVC pattern, since they advocate that in the Web world, their MTV is more suitable. In the overall, I prefer Django over Rails because of the django apps. You can do almost the same in RoR with the Rails vendor...
[ 0.48163872957229614, 0.22812145948410034, 0.3078622817993164, -0.07991872727870941, -0.39665284752845764, -0.34691938757896423, 0.10958821326494217, 0.12207462638616562, -0.4021758437156677, -0.6003662943840027, 0.17971152067184448, 0.6772181987762451, -0.34618571400642395, -0.050735894590...
reusable app, as a separated project, include references for that project in your main one, and in your Route file, just redirect to the other project's controllers.
[ -0.01911802589893341, -0.2905018627643585, 0.38408249616622925, 0.43848952651023865, 0.3415163457393646, 0.022421956062316895, 0.08369027078151703, 0.2045440822839737, -0.25532758235931396, -0.8443807363510132, -0.5232434272766113, 0.20744141936302185, -0.34059083461761475, -0.059919964522...
I have the following XAML code, which displays a *picture* (image inside borders) and a logo. Right now, the logo appears below the picture. This is expected, however **my goal is to have the logo on top of the picture** (precisely at the bottom-right corner). **Does someone has an idea how to do that?** Do we have lay...
[ 0.3676407039165497, 0.05330684036016464, 1.041875958442688, 0.20092160999774933, 0.1967809945344925, -0.26524481177330017, 0.03132612630724907, -0.4361206889152527, -0.31210803985595703, -0.9584741592407227, 0.10164118558168411, 0.15284495055675507, 0.04749929904937744, 0.09835212677717209...
<Image Source="http://farm1.static.flickr.com/2/1703693_687c42c89f_s.jpg" Stretch="Uniform" /> </Border> </Border> </Border> <Image Source="http://l.yimg.com/g/images/flickr_logo_gamma.gif.v59899.14" Height="10" /> </WrapPanel> ``` You should be able to do something along the lines of: ```...
[ 0.027968380600214005, -0.08881847560405731, 0.6137310266494751, -0.021898729726672173, -0.033073753118515015, 0.032666273415088654, -0.05338262766599655, -0.33599552512168884, -0.49184754490852356, -0.8269255757331848, 0.10220187157392502, 0.22359362244606018, 0.254599004983902, 0.00886426...
<Border BorderBrush="LightGray" BorderThickness="0.5"> <Image Source="http://farm1.static.flickr.com/2/1703693_687c42c89f_s.jpg" Stretch="Uniform" /> </Border> </Border> </Border> <Image Margin="5" HorizontalAlignment="Right" VerticalAlignment="Bottom" Sou...
[ -0.12253955751657486, -0.24083738029003143, 0.8494855761528015, 0.0547260120511055, 0.017815591767430305, 0.3263513743877411, -0.10658984631299973, -0.2605705261230469, -0.4695096015930176, -0.6614395380020142, -0.02005269192159176, 0.18068844079971313, 0.13163059949874878, 0.1426710188388...
stacks them on top of each other. The second image has Horizontal and Vertical alignment set to make it appear in the bottom right, and I've added a margin to the 2nd image to bump it up a bit, otherwise it sits on the border which I assume is not what you wanted?
[ 0.07939093559980392, -0.030934041365981102, 0.5328774452209473, 0.30454668402671814, 0.25671833753585815, -0.013957995921373367, -0.4936090409755707, 0.16373971104621887, -0.5570273399353027, -0.4294408857822418, 0.332074373960495, 0.42326074838638306, -0.012661723420023918, 0.033578801900...
``` typeof(int).Name ``` Will return System.Int32 does anyone know of a way to return "int" There aren't many types that are C# keywords (int, double, string) ... so perhaps you can write your own mapping function, from the System type name to the corresonding C# keyword.
[ -0.2313760221004486, -0.06272954493761063, 0.20761333405971527, 0.02706272155046463, -0.08780805766582489, -0.08071263134479523, 0.06310202181339264, 0.02200678363442421, 0.06837949901819229, -0.7111868858337402, -0.00028346641920506954, 0.47147899866104126, -0.33015576004981995, 0.1218199...
I have an ASP.net project I'm looking at and they want to use MySQL. I'm used to SQL server but using mySQL shouldn't be a problem. Normally the control would like a SqlDataSource to bind to but that's not available with MySQL (from other posts on this site). What's the best way to connect MySQL and the DevExpress AS...
[ 0.5558753609657288, -0.024474838748574257, 0.47255659103393555, 0.3662179410457611, 0.024656489491462708, -0.23941878974437714, -0.11759921163320541, 0.013859049417078495, -0.13798178732395172, -0.6832948923110962, 0.4792186915874481, 0.7096211910247803, -0.17538407444953918, 0.33052673935...
Can anyone give me a scenario where they think busy cursors are justified? I feel like they're always a bad idea *from a user's perspective*. Clarification: by busy cursors, I mean when the user can no longer interact with the application, they can only move their hourglass mouse pointer around and whistle a tune. I th...
[ 0.45037853717803955, 0.10997434705495834, 0.06130096688866615, 0.21861544251441956, -0.1368999481201172, -0.26217928528785706, 0.37227290868759155, 0.372758150100708, -0.6189773678779602, -0.6158151030540466, -0.0920824483036995, 0.6364317536354065, -0.17513656616210938, -0.105251587927341...
hang with no busy cursor and no hope. But in that case, a busy cursor probably wouldn't help much either...but I think you're right: busy cursors are from a non-multithreading era for apps. In Flex apps, for instance, EVERYTHING is automatically event-driven callbacks, so setting a busy cursor would just be meaningless...
[ 0.41480153799057007, -0.16180419921875, 0.3297194242477417, 0.35844358801841736, -0.020274251699447632, -0.3652893006801605, -0.27775445580482483, 0.44435805082321167, -0.5399957895278931, -0.22671791911125183, -0.02686157636344433, 0.49117276072502136, -0.31497809290885925, -0.22149790823...
I have a wxPython application that relies on an external config file. I want provide friendly message dialogs that show up if there are any config errors. I've tried to make this work by wrapping my app.MainLoop() call in a try/except statement. The code below works for the init code in my MainWindow frame class, but ...
[ 0.2536563277244568, 0.05047927051782608, 0.48445791006088257, -0.06714639812707901, 0.11701358109712601, -0.09912990778684616, 0.5505072474479675, 0.2502310276031494, -0.3257501721382141, -0.6123814582824707, -0.2714046537876129, 0.6133421659469604, -0.5068954229354858, 0.00512129534035921...
app.MainLoop() except ConfigParser.Error, error_message: messagebox = wx.MessageDialog(None, error_message, 'Configuration Error', wx.OK | wx.ICON_ERROR) messagebox.ShowModal() ``` I've read some mention of an OnExceptionInMainLoop method that can be overridden in the wx.App class, but the source ...
[ -0.26544150710105896, 0.17816007137298584, 0.5539239645004272, -0.253597229719162, -0.056835636496543884, 0.08145105093717575, 0.6699427366256714, 0.07230985909700394, -0.5832981467247009, -0.6215425729751587, -0.2715664207935333, 0.4678151309490204, -0.8074333667755127, -0.022000337019562...
and not terminate the app. The sys.excepthook solution is too low level and doesn't play nice with the wxPython mainloop thread. While the link to the other answer does the same try/except wrapping around the mainloop which doesn't work due, once again, to wxPython spawning a different thread for the app/ui. I coded s...
[ 0.42859533429145813, 0.11380868405103683, 0.05930856615304947, 0.1287255883216858, 0.19268140196800232, -0.2340562492609024, 0.5286561846733093, -0.11303646862506866, -0.04787059873342514, -0.24805450439453125, -0.1807287633419037, 0.6071270108222961, -0.5346378684043884, 0.105764918029308...
Breakpad I believe) feature if you will. To do this in wxPython, you need to provide redirect parameter to wx.App. This will pop up [wx.PyOnDemandOutputWindow](http://www.wxpython.org/docs/api/wx.PyOnDemandOutputWindow-class.html) (you will probably want to override it to provide a nicer looking implementation). The ...
[ 0.051535990089178085, 0.2452797293663025, 0.5064091682434082, 0.07418487966060638, 0.06623318791389465, 0.20327213406562805, 0.5679566860198975, -0.25642648339271545, -0.024678537622094154, -0.4894828796386719, -0.146619513630867, 0.6001298427581787, -0.3935251533985138, -0.351394653320312...
I've seen this questions [here](https://stackoverflow.com/questions/159366/is-there-a-best-coding-style-for-identations-same-line-next-line). I'm wondering if there exists an official name for the following indent style: ``` void fooBar(String s) { while (true) { // ... do something } } ``` When ...
[ 0.3401316702365875, 0.40845564007759094, 0.1414192169904709, -0.3353300094604492, -0.04488092660903931, -0.053491055965423584, 0.4938001334667206, -0.10071199387311935, -0.10201554745435715, -0.24204771220684052, -0.4692207872867584, 0.4284340739250183, -0.42105430364608765, 0.088693305850...
<http://en.wikipedia.org/wiki/Indent_style>
[ 0.4204072654247284, -0.38772574067115784, 0.05887552350759506, -0.17414383590221405, 0.11924643814563751, -0.12710675597190857, 0.3736203908920288, 0.18978452682495117, -0.42278778553009033, -0.6152879595756531, -0.350209504365921, 0.22864371538162231, 0.17623735964298248, 0.05529304593801...
I need to store Python structures made of lists / dictionaries, tuples into a human-readable format. The idea is like using something similar to [pickle](http://docs.python.org/library/pickle.html), but pickle is not human-friendly. Other options that come to my mind are [YAML](http://en.wikipedia.org/wiki/Yaml) (throu...
[ 0.300433874130249, 0.09078982472419739, 0.02931816503405571, -0.20909620821475983, 0.008792690932750702, 0.27516064047813416, 0.07171055674552917, -0.012010677717626095, -0.2687669098377228, -0.5674813985824585, -0.2487720400094986, 0.15357115864753723, -0.09146248549222946, -0.14825250208...
3, ... 4, ... 5], ... 'subdict': { ... 'first': 1, ... 'second': 2, ... 'third': 3 ... } ... } >>> >>> from pprint import
[ -0.4744192063808441, -0.23807384073734283, 0.7719541788101196, -0.06258441507816315, -0.08725648373365402, 0.19414465129375458, -0.03095434419810772, -0.20809589326381683, -0.1450691670179367, -0.5498100519180298, -0.627292811870575, 0.45980942249298096, -0.5118955373764038, -0.00782318692...
pprint >>> pprint(d) {'age': 27, 'name': 'Joe', 'numbers': [1, 2, 3, 4, 5], 'subdict': {'first': 1, 'second': 2, 'third': 3}} >>> ``` I would think twice about fixing two requirements with the same tool. Have you considered using pickle for the serializing and then pprint() (or a more fancy object viewer) for hum...
[ 0.07479982078075409, -0.11590373516082764, 0.7258702516555786, 0.09181533008813858, -0.052852947264909744, 0.18791399896144867, -0.0688154324889183, -0.16785822808742523, -0.3762531578540802, -0.48290058970451355, -0.23080600798130035, 0.15893509984016418, -0.0767131820321083, -0.003139853...
Are there any preprocessor symbols which allow something like ``` #if CLR_AT_LEAST_3.5 // use ReaderWriterLockSlim #else // use ReaderWriterLock #endif ``` or some other way to do this? I don't think there are any predefined 'preprocessor' symbols. However you can achieve what you want like this: 1. Create differen...
[ 0.15659278631210327, -0.081549271941185, 0.372918963432312, 0.139423206448555, 0.09167125076055527, -0.05355769768357277, -0.00040458637522533536, -0.1962163895368576, -0.1530114859342575, -0.4599824845790863, -0.13321079313755035, 0.5322543382644653, -0.4880518317222595, -0.17201119661331...
i want to add tracking to my website. I saw google analytics which seems to track what i need. So do i stick the google analytics snippet in each page, in a master page, just in my default page? what is the best practice here to get the best metrics. The google analytics code snippet has to be on every page you want ...
[ 0.5991536378860474, 0.01767674647271633, 0.3314211368560791, 0.40578705072402954, 0.07692874222993851, 0.06714047491550446, 0.14996932446956635, 0.09187376499176025, -0.08136526495218277, -0.6803410649299622, 0.3279871940612793, 0.5312587022781372, -0.10319733619689941, -0.4978559315204620...
using a server-side include, e.g: ``` <!-- #include file="file_containing_google_analytics_code.js" --> ```
[ 0.1484735608100891, 0.37020599842071533, -0.03264760971069336, -0.13919641077518463, -0.012028319761157036, -0.22036373615264893, 0.38076746463775635, -0.17155402898788452, 0.14224457740783691, -0.5152662992477417, -0.41681113839149475, 0.21847577393054962, -0.6220098733901978, -0.13074477...
We are using MySQL version 5.0 and most of the tables are InnoDB. We run replication to a slave server. We are thinking of backing up the MySQL log files on a daily basis. Questions ========= * Is there any other way of doing an incremental backup without using the log files? * What are the best practices when doing ...
[ 0.3858616352081299, -0.048136137425899506, 0.40870511531829834, 0.224209263920784, 0.25153449177742004, -0.058940302580595016, 0.19022005796432495, 0.1203300878405571, -0.38281697034835815, -0.6072899103164673, 0.08269718289375305, 0.627113401889801, -0.272715300321579, -0.0152001995593309...
backing up data. Since you have a slave for replication, I assume the backup is primarly for reverting data in case of accidental deletion? I would probably rotate the logs every 1 hour and take a backup of it. Meaning, restoring would leave the data at most 1 hour old, and you can restore to any point in time since t...
[ 0.26589328050613403, -0.14074909687042236, 0.3316100537776947, 0.45995402336120605, 0.025767814368009567, 0.1736491620540619, 0.17757438123226166, 0.0500156432390213, -0.4057005047798157, -0.07586964964866638, 0.09802574664354324, 0.6744072437286377, 0.09774240851402283, 0.1831998676061630...
I have a controller action which I would like to call another controller action. Is this a valid thing to do. Is it possible? `Controller.RedirectToAction`
[ 0.08053961396217346, -0.3549264073371887, 0.659136950969696, 0.11693528294563293, 0.09393070638179779, -0.2657143175601959, 0.019640762358903885, -0.07077693194150925, -0.3740239143371582, -0.5729859471321106, -0.08943045139312744, 0.3764820396900177, -0.4058459997177124, 0.143264308571815...
I've never written functional specs, I prefer to jump into the code and design things as I go. So far its worked fine, but for a recent personal project I'm writing out some specs which describe all the features of the product, and how it should 'work' without going into details of how it will be implemented, and I'm f...
[ 1.0996668338775635, 0.31585854291915894, -0.05852670967578888, 0.0625687912106514, 0.20312000811100006, 0.17524762451648712, 0.0895732045173645, 0.20610374212265015, -0.05307033658027649, -0.555850625038147, 0.4219639003276825, 0.6690680980682373, 0.3466218411922455, -0.14782941341400146, ...
a map. But... If you're driving to a place you've never been before in another state, you probably do. If you're driving around at random for the fun of driving, you probably don't need a map. But... If you're trying to get somewhere in the most effective fashion (minimize distance, minimize time, make three specifi...
[ 0.4122235178947449, 0.16467079520225525, 0.10697060823440552, 0.31390905380249023, 0.04095260053873062, -0.2283434420824051, 0.4200567305088043, 0.26652851700782776, -0.4726223647594452, -0.7295277118682861, -0.08586472272872925, 0.20773902535438538, -0.20631596446037292, -0.13487842679023...
and all need to make food and overnight lodging stops together, and need to arrive together, you probably do. If you think I'm not talking about programming, you probably don't need a functional spec, story cards, narrative, CRCs, etc. But... If you think I am, you might want to consider at least one of the above. ;...
[ 0.3423551619052887, 0.18530593812465668, -0.043151386082172394, 0.5050609111785889, 0.400796115398407, -0.2482926994562149, 0.19277141988277435, 0.1800721287727356, -0.3423451781272888, -0.5187646746635437, -0.30524298548698425, 0.43521448969841003, -0.11896718293428421, -0.042898274958133...
When doing a simple performance measurement, I was astonished to see that calling `String.IndexOf(char)` was actually slower than doing it manually! Is this really true?! Here is my test code: ``` const string str = @"91023m lkajsdfl;jkasdf;piou-09324\\adf \asdf\45\ 65u\ 86\ 8\\\;"; static int testIndexOf() { return s...
[ 0.2685834467411041, -0.0679844468832016, 0.31169018149375916, -0.08116523176431656, 0.019707435742020607, 0.20595329999923706, 0.7521613836288452, -0.513264000415802, 0.08927234262228012, -0.4903430938720703, 0.2014388144016266, 0.6599414944648743, 0.024602441117167473, -0.1849574744701385...
version was consistently 25% faster than the other one. Any thoughts?! --- **Edit 2:** Running the tests on a different machine with .NET 4.0 yields results very similar to those in Marc Gravell's answer. **`String.IndexOf(char)`** *is faster* than manual searching. --- **Edit:** Today (Jan 4 '09) I wanted to chec...
[ 0.06473454087972641, 0.0750122144818306, 0.33791598677635193, 0.02279362827539444, -0.30951613187789917, -0.11441341787576675, 0.5816856622695923, -0.08197462558746338, -0.1893073171377182, -0.7334519624710083, 0.09915454685688019, 0.6123878359794617, -0.3766641318798065, -0.11970704793930...
MyString.InternIndexOf : 00:00:06.1191796 - MyString.PublicIndexOf2: 00:00:09.1363687 - MyString.InternIndexOf2: 00:00:09.1182569 ``` I ran these tests at least 20 times, getting almost the same results every time. My machine is XP SP3, VS 2008 SP1, P4 3.0 GHz with no hyper-threading and 1 GB RAM. I find the resu...
[ -0.05517283082008362, 0.34216758608818054, 0.750201404094696, 0.30635231733322144, -0.16283908486366272, 0.20013678073883057, 0.5901554226875305, -0.027696050703525543, -0.2565537393093109, -0.6643094420433044, 0.04407207667827606, 0.5479245781898499, 0.04827623441815376, 0.043713223189115...
the repeated code, but I found that using a delegate showed different timings, with the `public` and `internal` methods taking the same time.) ``` public static class MyString { public static int PublicIndexOf(string str, char value) { for (int i = 0; i < str.Length; ++i) if (str[i] == value) r...
[ 0.20103739202022552, -0.15391145646572113, 0.5881999731063843, -0.07819167524576187, -0.07233661413192749, 0.11803906410932541, 0.6417896747589111, -0.6943286657333374, -0.24727994203567505, -0.29473409056663513, -0.2331830859184265, 0.5963255167007446, -0.280708372592926, 0.48289600014686...
for (int i = 0; i < str.Length; ++i) if (str[i] == value) return i; return -1; } public static int PublicIndexOf2(string str, char value, int startIndex) { if (startIndex < 0 || startIndex >= str.Length) throw new ArgumentOutOfRangeException("startIndex"); for (;...
[ -0.37747812271118164, -0.2201506346464157, 0.3902418911457062, -0.3441564738750458, 0.14941748976707458, 0.3269822597503662, 0.4812453091144562, -0.4995141923427582, 0.08672378957271576, -0.360017865896225, -0.43472954630851746, 0.5712160468101501, -0.25787535309791565, 0.22155068814754486...
if (str[startIndex] == value) return startIndex; return -1; } internal static int InternIndexOf2(string str, char value, int startIndex) { if (startIndex < 0 || startIndex >= str.Length) throw new ArgumentOutOfRangeException("startIndex"); for (; startIndex < str.Length; ++s...
[ -0.5654352307319641, -0.13703306019306183, 0.42183682322502136, -0.3913246989250183, 0.10197582840919495, 0.31806302070617676, 0.40765661001205444, -0.4552600085735321, 0.18110638856887817, -0.46900954842567444, -0.5840537548065186, 0.5497868657112122, -0.19095008075237274, 0.1762469261884...
return -1; } } class Program { static void Main(string[] args) { int iterations = 100 * 1000 * 1000; // 100 millions char separator = '\\'; string str = @"91023m lkajsdfl;jkasdf;piou-09324\\adf \asdf\45\ 65u\ 86\ 8\\\;"; Stopwatch watch = new Stopwatch(); // test String...
[ 0.01655348390340805, -0.34231293201446533, 0.6056397557258606, -0.2866417169570923, 0.30705100297927856, 0.530153751373291, 0.297204852104187, -0.219936802983284, -0.2601082921028137, -0.3055444061756134, -0.06009316444396973, 0.37834450602531433, -0.38148462772369385, 0.3049617111682892, ...
watch.Start(); for (int i = 0; i < iterations; ++i) sum += str.IndexOf(separator); watch.Stop(); Console.WriteLine(" String. IndexOf : ({0}, {1})", watch.Elapsed, sum); // test MyString.PublicIndexOf sum = 0; watch.Reset(); watch.Start();
[ -0.17605654895305634, -0.49111703038215637, 0.716438889503479, -0.35803043842315674, 0.46649640798568726, 0.1846303790807724, 0.4645400941371918, -0.3025255799293518, -0.16081607341766357, -0.40879112482070923, -0.18200860917568207, 0.4463145136833191, -0.35221296548843384, 0.1864590644836...
for (int i = 0; i < iterations; ++i) sum += MyString.PublicIndexOf(str, separator); watch.Stop(); Console.WriteLine("MyString.PublicIndexOf : ({0}, {1})", watch.Elapsed, sum); // test MyString.InternIndexOf sum = 0; watch.Reset(); watch.Start(); for (int i = ...
[ -0.2798593044281006, -0.3894639015197754, 0.7797355651855469, -0.3902581036090851, 0.3646637797355652, 0.3909662961959839, 0.510525643825531, -0.5427699089050293, -0.11399120837450027, -0.4069501757621765, -0.060494959354400635, 0.4227190315723419, -0.24637487530708313, 0.1635790914297104,...
sum += MyString.InternIndexOf(str, separator); watch.Stop(); Console.WriteLine("MyString.InternIndexOf : ({0}, {1})", watch.Elapsed, sum); // test MyString.PublicIndexOf2 sum = 0; watch.Reset(); watch.Start(); for (int i = 0; i < iterations; ++i) sum += MyStr...
[ -0.23072995245456696, -0.3117452561855316, 0.9138949513435364, -0.5569125413894653, 0.26605382561683655, 0.40789011120796204, 0.5530698299407959, -0.6080141067504883, -0.10404583066701889, -0.3433661162853241, -0.0806003212928772, 0.3601989150047302, -0.23497185111045837, 0.271000236272811...
Console.WriteLine("MyString.PublicIndexOf2: ({0}, {1})", watch.Elapsed, sum); // test MyString.InternIndexOf2 sum = 0; watch.Reset(); watch.Start(); for (int i = 0; i < iterations; ++i) sum += MyString.InternIndexOf2(str, separator,0); watch.Stop(); Console.W...
[ -0.0714108794927597, -0.1312619000673294, 1.116080641746521, -0.2838667929172516, 0.503107488155365, 0.16067856550216675, 0.2548915147781372, -0.36672136187553406, -0.23283250629901886, -0.5579994320869446, 0.048236578702926636, 0.6693675518035889, 0.06200942397117615, 0.07361283898353577,...
below, which are in line with what I would expect: ``` String. IndexOf : (00:00:06.3134669, -994967296) MyString.PublicIndexOf : (00:00:07.0769368, -994967296) MyString.InternIndexOf : (00:00:08.3463652, -994967296) MyString.PublicIndexOf2: (00:00:12.0049268, -994967296) MyString.InternIndexOf2: (00:00:12.4344756...
[ -0.035567063838243484, 0.09722074866294861, 0.43702688813209534, -0.07103759050369263, 0.29043903946876526, -0.027706600725650787, 0.4911879003047943, -0.4254947900772095, -0.15584558248519897, -0.5428501963615417, 0.22517861425876617, 0.7850536108016968, -0.0844435766339302, -0.0087656406...
int chk1 = 0, chk2 = 0; Stopwatch watch1 = Stopwatch.StartNew(); for (int i = 0; i < LOOP; i++) { chk1 += testIndexOf(); } watch1.Stop(); Stopwatch watch2 = Stopwatch.StartNew(); for (int i = 0; i < LOOP; i++) { chk2 += testManualIndexOf(); } watch2.Stop(); C...
[ 0.30098995566368103, -0.36857888102531433, 0.8104795217514038, -0.22395437955856323, 0.11955005675554276, 0.40863150358200073, 0.45262500643730164, -0.27922964096069336, -0.20527394115924835, -0.39874011278152466, -0.05841774120926857, 0.47996971011161804, -0.35899728536605835, 0.085187233...
Console.WriteLine("{0}ms, ({1})", watch2.ElapsedMilliseconds, chk2); } ```
[ -0.209816113114357, 0.015621311031281948, 0.8120644688606262, 0.039281390607357025, 0.5536745190620422, 0.026315832510590553, 0.26543042063713074, 0.07526852190494537, 0.22869634628295898, -0.7138227224349976, -0.052556686103343964, 0.5565053820610046, -0.02428823709487915, 0.3957569003105...
I want to create a view that has different displays according to the role the user is in. Should I create a different view for different roles or should I check the roles on the Veiw page itself rather than in the actions? How would I check the role on the view page? > Or should i use check the roles on the > Veiw ...
[ 0.1281963735818863, -0.26019057631492615, 0.19633840024471283, 0.1698439121246338, -0.22961561381816864, 0.2523367702960968, 0.1470368355512619, -0.27053070068359375, -0.16509881615638733, -0.6125621199607849, 0.24780690670013428, 0.6479734778404236, -0.25537338852882385, -0.10431578010320...
roles on views to enable/disable specific controls. Within your view page the long form of checking a role is ``` HttpContext.Current.User.IsInRole("Administrator") ``` many developers will create page helper methods so you can end up with something more concise for your application like ``` public static bool IsA...
[ -0.19786930084228516, -0.2197703868150711, 0.6992182731628418, -0.09919720143079758, -0.24187885224819183, 0.22424332797527313, 0.161762997508049, -0.17705784738063812, -0.11120977252721786, -0.5963466763496399, 0.14763802289962769, 0.5598834156990051, -0.27586063742637634, -0.121772803366...
First, let me say that I'm a complete beginner at Python. I've never learned the language, I just thought "how hard can it be" when Google turned up nothing but Python snippets to solve my problem. :) I have a bunch of mailboxes in Maildir format (a backup from the mail server on my old web host), and I need to extrac...
[ 0.05119847506284714, 0.3271324634552002, -0.26476073265075684, -0.030533790588378906, 0.20036153495311737, 0.05654793232679367, 0.10728253424167633, 0.5203726887702942, -0.4154060482978821, -0.5636382699012756, -0.128440260887146, 0.9701976776123047, -0.3955078721046448, -0.476896911859512...
even have this little code snippet doing exactly what I need: ``` src = mailbox.Maildir('maildir', factory=None) dest = mailbox.mbox('/tmp/mbox') for msg in src: #1 dest.add(msg) #2 ``` *Except* it doesn't work. And here's where my complete lack of knowledge about Python sets in. On a few messages, I get a Un...
[ -0.011393704451620579, 0.22286184132099152, 0.3362361788749695, 0.0014436146011576056, -0.18530568480491638, 0.08013254404067993, 0.41203683614730835, 0.2515614628791809, -0.3856503665447235, -0.683607280254364, 0.009840658865869045, 0.36142638325691223, -0.40090662240982056, -0.0039138891...
the mailbox (For that matter, I don't know what the encoding should be either, but I can probably figure that out once I find a way to actually specify an encoding). I get stack traces similar to the following: ``` File "E:\Python30\lib\mailbox.py", line 102, in itervalues value = self[key] File "E:\Python30\...
[ 0.04598185792565346, 0.18521152436733246, 0.4912039637565613, -0.19859568774700165, 0.04816916957497597, 0.3101585805416107, 0.12120425701141357, -0.16034387052059174, -0.37105756998062134, -0.9464352130889893, -0.03955066204071045, 0.21662479639053345, -0.4111834764480591, -0.191376268863...
File "E:\Python30\lib\email\__init__.py", line 46, in message_from_file return Parser(*args, **kws).parse(fp) File "E:\Python30\lib\email\parser.py", line 68, in parse data = fp.read(8192) File "E:\Python30\lib\io.py", line 1733, in read eof = not self._read_chunk() File "E:\Python30\lib\io.py", line ...
[ -0.6210901737213135, 0.24123713374137878, 0.23930709064006805, -0.14196555316448212, 0.16944314539432526, 0.6854588389396667, 0.5162597298622131, -0.2653869390487671, -0.09518839418888092, -0.25893619656562805, -0.858277440071106, 0.4796859323978424, -0.23888519406318665, -0.44415491819381...
return self.as_string() File "E:\Python30\lib\email\message.py", line 136, in as_string g.flatten(self, unixfrom=unixfrom) File "E:\Python30\lib\email\generator.py", line 76, in flatten self._write(msg) File "E:\Python30\lib\email\generator.py", line 108, in _write self._write_headers(msg) File "E:\...
[ -0.14026117324829102, 0.4345269203186035, 0.35740700364112854, -0.24202075600624084, 0.19024670124053955, 0.41221871972084045, 0.616876482963562, -0.50752192735672, -0.1530625969171524, -0.5799108743667603, 0.15351326763629913, 0.6030561327934265, -0.13543114066123962, -0.27070319652557373...
solutions not involving Python are obviously welcome too. I just need a way to access get import the mails from these Maildir files. *Updates:* sys.getdefaultencoding returns 'utf-8' I uploaded sample messages which cause both errors. [This one](http://jalf.dk/python_problem/1187691008.H199308P14265.c1p.hostingzoom....
[ -0.47620099782943726, 0.24655966460704803, 0.26457300782203674, -0.0997801199555397, 0.08333304524421692, 0.19860908389091492, 0.49573183059692383, -0.3708235025405884, -0.44073694944381714, -0.4793727397918701, -0.13231711089611053, 0.5337243676185608, -0.5862791538238525, -0.047819148749...
TypeError('Invalid message type: %s' % type(message)) TypeError: Invalid message type: <type 'instance'> ``` > Or should i use check the roles on the > Veiw page its self rather than on > actions, if so can someone plz show me > how do check that on view page You need to do both. Check roles on actions as a securi...
[ -0.17217442393302917, -0.12192410230636597, 0.6426693797111511, -0.008607727475464344, -0.2909226715564728, -0.07679664343595505, 0.4346325397491455, -0.39417001605033875, -0.02772502973675728, -0.5472298860549927, 0.10746998339891434, 0.5586551427841187, -0.46557947993278503, -0.052086025...
pg) { return pg.Page.User.IsInRole("Administrator") } ``` then in your view you can just use *this.IsAdmin()* To keep your view clutter down look into using partial views ``` <% if (IsAdmin()) { Html.RenderPartial("AdminPanel"); } else { Html.RenderPartial("UserPanel"); } %> ```
[ -0.2577279508113861, -0.07609619945287704, 0.9648338556289673, -0.09719377756118774, -0.016815243288874626, 0.23824550211429596, 0.209708109498024, -0.01841703988611698, -0.2838572859764099, -0.48433640599250793, -0.16977551579475403, 0.3694848418235779, -0.2464611679315567, 0.127964660525...
I have a byte array that represents a complete TCP/IP packet. For clarification, the byte array is ordered like this: (IP Header - 20 bytes)(TCP Header - 20 bytes)(Payload - X bytes) I have a `Parse` function that accepts a byte array and returns a `TCPHeader` object. It looks like this: ``` TCPHeader Parse( byte[] ...
[ -0.008657974191009998, 0.323373019695282, 0.6719661951065063, -0.05509673058986664, -0.18740904331207275, -0.010366320610046387, 0.04420839995145798, -0.4164583384990692, -0.07126317173242569, -0.6147822737693787, 0.13430708646774292, 0.28720375895500183, -0.48421892523765564, 0.2464185208...
TCP/IP packet, to the `Parse` function without extracting it to a new byte array first? In C++, I could do the following: ``` TCPHeader tcp = Parse( &packet[ 20 ] ); ``` Is there anything similar in C#? I want to avoid the creation and subsequent garbage collection of the temporary byte array if possible. A common ...
[ 0.176256462931633, 0.09002913534641266, 0.2755606770515442, 0.0015230681747198105, -0.009226798079907894, -0.2909095883369446, -0.16252587735652924, -0.17771615087985992, -0.2510669231414795, -0.4619337320327759, 0.08473116904497147, 0.4885357916355133, -0.5783443450927734, -0.040077473968...
to pass a pointer like in C++ - the array shouldn't be modified or else it may result in undefined behavior if you are not sure when exactly the data will be used. But this is no problem if you are no longer going to be modifying the array.
[ 0.199545755982399, -0.19208554923534393, 0.28565943241119385, 0.20499923825263977, -0.319014310836792, -0.3669627606868744, 0.4066455066204071, -0.20232069492340088, -0.13544794917106628, -0.5512377023696899, -0.011860542930662632, 0.2035669982433319, -0.4560430347919464, 0.092220500111579...
Would you recommend using a [datetime](https://dev.mysql.com/doc/refman/5.0/en/datetime.html) or a [timestamp](https://dev.mysql.com/doc/refman/5.0/en/datetime.html) field, and why (using MySQL)? I'm working with PHP on the server side. Timestamps in MySQL are generally used to track changes to records, and are often...
[ 0.3275872468948364, -0.28139492869377136, 0.3735809028148651, -0.015137127600610256, 0.2341940551996231, -0.1197078749537468, -0.29780519008636475, -0.05808879807591438, -0.23754727840423584, -0.6271730065345764, 0.035038623958826065, 0.40930989384651184, -0.0810309424996376, -0.0418127477...
of the value to a UNIX timestamp `("SELECT UNIX_TIMESTAMP(my_datetime)")` when you query the record if you want to operate on it with PHP.
[ 0.17709986865520477, 0.09722373634576797, 0.4217289388179779, -0.03965122625231743, 0.4791998863220215, -0.23669740557670593, -0.2502586841583252, 0.08336837589740753, -0.32567909359931946, -0.2172175496816635, -0.0507076121866703, 0.23423519730567932, -0.12161275744438171, 0.1365038305521...
I've used clusters in industrial and academic settings, but they were owned by the organizations I worked for. I've never purchased time from a company that sells cluster/cloud/grid time. Suppose I want to run some compute intensive program like as a large simulation or a data mining application. Or maybe I want to op...
[ 0.3072848618030548, 0.2678745985031128, -0.07380052655935287, 0.24163715541362762, 0.27700722217559814, 0.26892149448394775, -0.17321807146072388, 0.30207279324531555, -0.4119853973388672, -0.7328408360481262, -0.006269690115004778, 0.30166205763816833, 0.08771747350692749, 0.0677386671304...
build-your-own-cluster solution using the fast, cheap hardware available these days, but I'm specifically interested in an outsourced solution. You might want to check out Amazon's EC2 service: <http://aws.amazon.com/ec2/> Some people have already done some work in regards to clustering with EC2: [http://www.google....
[ 0.05966382101178169, 0.16035787761211395, 0.2834704518318176, 0.032929908484220505, 0.0322561152279377, -0.05823405459523201, -0.18791744112968445, 0.18502038717269897, -0.1658230572938919, -0.65470951795578, -0.20795053243637085, 0.21911537647247314, 0.05364182963967323, 0.004067081492394...
Has anyone taken advantage of the automatic vectorization that gcc can do? In the real world (as opposed to example code)? Does it take restructuring of existing code to take advantage? Are there a significant number of cases in any production code that can be vectorized this way? I have yet to see either GCC or Intel ...
[ 0.10207688063383102, -0.056249238550662994, -0.18308119475841522, 0.182647705078125, -0.13250546157360077, -0.2125406116247177, -0.041815727949142456, 0.11634474992752075, -0.4211892783641815, -0.29159218072891235, 0.03980133682489395, 0.7452728152275085, -0.21289458870887756, -0.210901066...
be very difficult for a C/C++ compiler to 'prove' to itself that a vectorization would be safe, even if you as the programmer know that it is. Most compilers (sensibly) prefer to not optimize code rather than risking miscompiling it. This is one area where higher level languages have a real advantage over C, at least i...
[ -0.07734674215316772, 0.05918654426932335, -0.04948928579688072, 0.3474453091621399, -0.07362630218267441, -0.21533843874931335, 0.034605491906404495, 0.02390708401799202, 0.15408852696418762, -0.4810672104358673, 0.06731302291154861, 0.7786004543304443, -0.20679613947868347, -0.4577012360...
was the bread and butter of most vector machines before a few years ago (when, between CUDA/OpenCL, Altivec/SSE, and the STI Cell, vector programming in various forms became widely available in commercial systems). It's fairly unlikely that code written for a scalar processor in mind will be easy for a compiler to vec...
[ -0.04368804395198822, -0.1337510645389557, 0.1395673304796219, 0.10701195150613785, -0.47178444266319275, 0.11754900217056274, -0.22495746612548828, 0.6206503510475159, -0.2523622512817383, -0.605707049369812, 0.2054496705532074, 0.44443538784980774, -0.23009714484214783, 0.156176239252090...
Do you think it may be OK for a person to have more than one role in a software development company that wants to use SCRUM? E.g. is it ok/possible if a person is * SCRUM master and team member * Product owner and team member * SCRUM master and product owner Which combinations do you think are possible? Do you work ...
[ 0.24176612496376038, -0.10269662737846375, -0.4071401357650757, 0.18420451879501343, 0.11815023422241211, 0.14753608405590057, -0.06858917325735092, -0.20831972360610962, -0.6037089228630066, -0.22569820284843445, 0.04389040172100067, 0.2781948745250702, -0.34142908453941345, -0.2482834607...
remove the reminder from my profile page.
[ 0.411128431558609, 0.485164999961853, -0.31692832708358765, -0.013151608407497406, -0.17269983887672424, -0.19969886541366577, 0.44457852840423584, 0.5779239535331726, 0.24218152463436127, -0.5214423537254333, -0.38123810291290283, 0.13758529722690582, -0.03839829936623573, 0.2552529275417...
I have a VB6 application that I am converting to .net. I am doing this in phases so clients will have both VB6 and .net applications at the same. Part of the application caches ADO 2.8 COM recordsets to a table in SQL Server and retrieves them as needed. The .net application uses that same persisted recordsets. I have ...
[ 0.24176625907421112, 0.33951571583747864, 0.460602730512619, -0.11926327645778656, -0.16054989397525787, 0.09908200800418854, 0.28199630975723267, -0.3957709074020386, 0.08195304125547409, -0.7857627272605896, 0.14960986375808716, 0.4769894778728485, -0.5223186016082764, 0.4166590571403503...
cmd = null; SqlDataReader dr = null; string cmdText; int bytesReturned; int chunkSize = 65536; int offSet = 0; UnicodeEncoding readBytes; try { cmdParameter = new SqlParameter(parameterName, idParamter); cmdText = sqlString; cmd = new SqlCommand(); cmd.CommandType = CommandType.Text; cmd.Comman...
[ -0.4229443669319153, -0.2579561173915863, 0.6133343577384949, -0.1426616758108139, -0.02583167888224125, 0.3726631700992584, 0.4176987111568451, -0.4656356871128082, -0.35196229815483093, -0.4598919749259949, -0.5191502571105957, 0.43044549226760864, -0.20347712934017181, 0.290748476982116...
byte[] byteChunk = new byte[chunkSize]; adoStream = new Stream(); adoStream.Type = StreamTypeEnum.adTypeText; adoStream.Open(Type.Missing, ConnectModeEnum.adModeUnknown, StreamOpenOptionsEnum.adOpenStreamUnspecified, "", ""); do { bytesReturned = (int)dr...
[ -0.1848871409893036, -0.026226092129945755, 0.4373031258583069, -0.11978208273649216, 0.03470110148191452, 0.29950186610221863, 0.2737947404384613, -0.30233731865882874, -0.067969411611557, -0.4936940371990204, -0.36045217514038086, 0.5367028713226318, -0.30556032061576843, 0.2879137098789...
size += bytesReturned; if (bytesReturned > 0) { if (bytesReturned < chunkSize) { Array.Resize(ref byteChunk, bytesReturned);
[ 0.03360949456691742, -0.14067739248275757, 0.34022417664527893, -0.47887617349624634, -0.013390664011240005, 0.0835784450173378, 0.10969720780849457, -0.5822052359580994, -0.21403658390045166, -0.32456037402153015, -0.4352782070636749, 0.48616015911102295, -0.11036457121372223, 0.250484675...
} adoStream.WriteText(readBytes.GetString(byteChunk), StreamWriteEnum.stWriteChar); adoStream.Flush(); } offSet += bytesReturned; } while
[ -0.02537502348423004, -0.05182884633541107, 0.37159264087677, -0.2715725004673004, 0.18091538548469543, 0.1835843026638031, 0.09239271283149719, -0.2700921893119812, -0.03675268590450287, -0.6599454283714294, -0.11898939311504364, 0.5781426429748535, -0.42609354853630066, 0.232318297028541...
(bytesReturned == chunkSize); } } catch (Exception exLoadResultsFromDB) { throw (exLoadResultsFromDB); } finally { if (dr != null) { if (!dr.IsClosed) { dr.Close(); } dr.Dispose(); } if (cmd != null) { cmd.Dispose(); } } ``` This is...
[ 0.04503553733229637, 0.02272741310298443, 0.46159061789512634, -0.22205811738967896, 0.1609625667333603, -0.21886666119098663, 0.18034063279628754, -0.3377743065357208, -0.23428553342819214, -0.4735049903392792, -0.39323562383651733, 0.36723417043685913, -0.3300850987434387, 0.218611642718...
that converts the ado stream to a datasets -- ``` adoStream = LoadTextFromDBToADODBStream(resultID, "@result_id", "some sql statement", ref size); if (adoStream.Size == 0) { success = false; } else { adoStream.Position = 0; DataTable table = new DataTable(); Recordset rs = new Recordset(); rs....
[ -0.07846061140298843, 0.2412000149488449, 0.8008208274841309, -0.2511436939239502, 0.23116621375083923, 0.1630861610174179, 0.08427449315786362, -0.4991396963596344, -0.08890123665332794, -0.38809189200401306, -0.390598863363266, 0.44789189100265503, -0.6514825820922852, 0.3417873084545135...
null; } source.SourceRows = rs.RecordCount; table.TableName = "Source"; source.Dataset = new DataSet(); source.Dataset.Tables.Add(table); OleDbDataAdapter adapter = new OleDbDataAdapter(); adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey; adapter.Fill(source.Dataset.Tables[...
[ -0.3601326048374176, 0.001477356068789959, 0.7847045660018921, -0.4537445902824402, 0.19523242115974426, 0.2410411536693573, 0.33030757308006287, -0.6361117959022522, -0.30159538984298706, -0.6317853927612305, -0.5288422107696533, 0.4674795866012573, -0.6151483058929443, 0.4567317962646484...
adoStream = null; } if (rs != null) { if (rs.State == 1) { rs.Close(); } rs = null; } } ``` Thanks all EDIT: I added a bounty to see if anyone can make the code more efficient. Generally speaking, you aren't taking enough advantage of the
[ 0.3492301106452942, 0.37208718061447144, 0.7134857177734375, -0.109852634370327, -0.011897641234099865, -0.2025989592075348, 0.3801693618297577, -0.3304253816604614, 0.04469318687915802, -0.35551443696022034, -0.07563168555498123, 0.5536845922470093, -0.5902836322784424, 0.3404873311519623...