text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
set { this.n = value; } } public int Birthyear { get { return this.byear; } set { if (value >= 1970 && value <= 1990) this.byear = value;
[ 0.5650320649147034, -0.0598287433385849, 0.46444666385650635, -0.49586591124534607, 0.16242852807044983, 0.377278596162796, 0.051648326218128204, -0.09938517957925797, 0.08848744630813599, -0.08565425127744675, -0.2328072339296341, 0.42206069827079773, -0.10829200595617294, 0.3400342166423...
else this.byear = 0; } } public double Salary { get { return this.sal; } set { if (value >= 5000 && value <= 50000) this.sal = value; else this.sal = 0;
[ 0.3192608058452606, -0.25602009892463684, 0.41738173365592957, -0.16077104210853577, 0.00765562430024147, 0.4206014573574066, 0.1857101023197174, -0.36729758977890015, -0.08499271422624588, -0.33735737204551697, -0.051957037299871445, 0.7120116949081421, -0.044000428169965744, 0.0657845810...
} } public bool Gender { get { return this.gen; } set { this.gen = value; } } public bool Married { get { return this.mar; } set { this.mar = value; } } public int NChildren {
[ -0.30156800150871277, -0.08638014644384384, 0.05959942936897278, -0.3118155002593994, -0.2653909921646118, 0.29326415061950684, 0.38741397857666016, -0.1435464769601822, -0.08908131718635559, -0.027605319395661354, -0.37294086813926697, 0.5082795023918152, -0.22811691462993622, 0.409848302...
get { return this.child; } set { if (value >= 0 && value <= 12) this.child = value; else this.child = 0; } } public double getAge() { return 2008 - this.Birthyear; }
[ 0.319155216217041, -0.07668929547071457, 0.17692525684833527, -0.15060657262802124, 0.2398010939359665, 0.31152549386024475, 0.2936650514602661, -0.15313826501369476, -0.016386305913329124, -0.18685393035411835, -0.11308702826499939, 0.5716428160667419, 0.0677238255739212, 0.17621423304080...
public double getNet() { double net = getFamilyBonus() + this.Salary - getTax(); return net; } public double getFamilyBonus() { if (this.Married == true) familybonus += 300; if (this.NChildren == 1) familybonus += 200; else if (this.NChildren == 2) f...
[ 0.4040803015232086, -0.5630791783332825, 0.4193631708621979, -0.11084259301424026, 0.2427513301372528, 0.16476628184318542, 0.42898663878440857, -0.32214418053627014, -0.2652125656604767, -0.41868022084236145, -0.1816132515668869, 0.41999030113220215, -0.38944756984710693, 0.23937912285327...
+= 350; else if (this.NChildren >= 3) familybonus += 450; return familybonus; } public double getTax() { if (Salary < 10000) tax = 0; if (Salary <= 10000 && Salary >= 20000) tax += Salary * 0.05;
[ 0.493405282497406, -0.3250557780265808, 0.20762516558170319, -0.24674148857593536, 0.23245972394943237, 0.3041146397590637, 0.18790647387504578, -0.5453045964241028, -0.0334792397916317, -0.15570861101150513, -0.1749996542930603, 0.594076931476593, -0.057398051023483276, 0.2683806717395782...
else tax += Salary * 0.1; return tax; } public void ReadEmployee() { Console.Write("Enter Employee Name: "); Ename = Console.ReadLine(); Console.Write("Enter Employee birth date: "); Birthyear = int.Parse(Console.ReadLine()); while (Birthyear < 1970 || Birt...
[ 0.33841440081596375, 0.1668226718902588, 0.08687561005353928, -0.4239354133605957, 0.2610683739185333, 0.3177640438079834, 0.02651931717991829, -0.09247583150863647, 0.12896238267421722, -0.0695708617568016, -0.08441939204931259, 0.3446800708770752, 0.13393059372901917, 0.2573682963848114,...
Console.WriteLine("Invalid Birthyear!"); Console.Write("Enter Employee Birth date: "); Birthyear = int.Parse(Console.ReadLine()); } string g = null; while (g != "M" && g != "m" && g != "F" && g != "f") {
[ -0.2678290903568268, 0.0909939557313919, 0.262973815202713, -0.31183427572250366, 0.4406837522983551, 0.2461390197277069, 0.30392080545425415, -0.07455891370773315, 0.2139536738395691, -0.3350970149040222, -0.3756621778011322, 0.5848051309585571, -0.11767888814210892, 0.37078338861465454, ...
Console.Write("Enter Employee Gender (M/F)"); g = Convert.ToString(Console.ReadLine()); } if (g == "M" || g == "m") Gender = true; else Gender = false; Console.Write("Enter Employee Salary: "); Salary = Double.Parse(Console.ReadLine());
[ -0.3594430685043335, -0.1457090973854065, 0.2410404235124588, -0.3138553202152252, 0.18551471829414368, 0.5178725719451904, 0.11305874586105347, -0.2831665873527527, 0.16598866879940033, -0.6341387629508972, -0.25815191864967346, 0.7710698246955872, -0.20270012319087982, 0.1111104041337966...
while (Salary < 5000 || Salary > 50000) { Console.WriteLine("Invalid Salary!"); Console.Write("Enter Employee Salary: "); Salary = int.Parse(Console.ReadLine()); } string m = null; while (m != "true" && m != "True" &&
[ 0.0674029290676117, 0.020724177360534668, 0.36236512660980225, -0.2934512197971344, 0.09106402099132538, 0.5044803023338318, 0.20701691508293152, -0.5010564923286438, 0.0191670972853899, -0.2669318914413452, -0.10358662903308868, 0.7061886191368103, -0.0058288052678108215, 0.32511270046234...
m != "false" && m != "False") { Console.Write("Married (true/false)"); m = Console.ReadLine(); } if (m == "true") this.Married = true; else this.Married = false;
[ -0.09267909079790115, 0.12201419472694397, 0.7843223810195923, -0.3194437623023987, 0.5975157618522644, 0.02018488384783268, 0.5638003349304199, -0.6447015404701233, 0.27092602849006653, -0.2436603456735611, -0.5593144297599792, 0.7655877470970154, -0.1928553432226181, 0.29006412625312805,...
Console.Write("Enter Employee Children count: "); NChildren = int.Parse(Console.ReadLine()); while (NChildren < 0 || NChildren > 12) { Console.WriteLine("Invalid NChildren!"); Console.Write("Enter Employee Children count: "); NChildren = int.Parse(Console.Re...
[ -0.2640301287174225, 0.15098273754119873, 0.3508399426937103, -0.11257759481668472, 0.2956668436527252, 0.18914777040481567, 0.3388140797615051, -0.2871762812137604, -0.1052912101149559, -0.3212662935256958, -0.2691172957420349, 0.4490998387336731, -0.2317543774843216, 0.337189644575119, ...
public void PrintEmployee() { Console.Write("Hello "); { if (Gender == true) Console.Write("Mr. "); else Console.Write("Mrs. "); Console.WriteLine(Ename);
[ -0.23791180551052094, 0.0033509323839098215, 0.46542784571647644, -0.1708235889673233, 0.5506419539451599, 0.31672659516334534, 0.3742213845252991, -0.009411671198904514, 0.16215288639068604, -0.6124117374420166, -0.636642575263977, 0.3129521608352661, -0.19703859090805054, 0.6095320582389...
} Console.WriteLine("You are {0} years old", getAge()); Console.WriteLine("Salary= {0}", Salary); Console.WriteLine("Tax= {0}", getTax()); Console.WriteLine("Family bonus= {0}", getFamilyBonus()); Console.WriteLine("Net= {0}", getNet()); } } ``` I took the existing code, and...
[ 0.19483260810375214, -0.048237863928079605, 0.5621399283409119, -0.10997306555509567, 0.20086923241615295, 0.24380576610565186, 0.04454907029867172, -0.3288975656032562, -0.14035306870937347, -0.4799308776855469, -0.1203886941075325, 0.7124679684638977, 0.3018225431442261, 0.27418926358222...
- i.e. treating fields as variables: ``` public double getTax() { if (Salary < 10000) tax = 0; if (Salary <= 10000 && Salary >= 20000) tax += Salary * 0.05; else tax += Salary * 0.1; return tax; } ``` OK - and what does `tax` start at if `Salary >= 10000`, etc. Likewise `familyBouns` ...
[ 0.33452242612838745, -0.01886129565536976, 0.11406037956476212, -0.021876180544495583, -0.02335510216653347, 0.2153785526752472, -0.06265982240438461, -0.26724737882614136, 0.03770744800567627, -0.11976935714483261, -0.2137962430715561, 0.6801946759223938, -0.20904360711574554, 0.331515878...
Console.WriteLine("Tax= {0}", getTax()); Console.WriteLine("Tax= {0}", getTax()); Console.WriteLine("Tax= {0}", getTax()); ``` Which shows: > Tax= 3000 Tax= 6000 Tax= 9000 My advice would be: don't store calculated values unless you know the math is so complex that it is worth it. Just calculate them as nee...
[ 0.1200626865029335, 0.10154169797897339, 0.2410563826560974, 0.08973775058984756, 0.14588114619255066, 0.09885572642087936, 0.16981031000614166, 0.04174017906188965, 0.05282406508922577, -0.5287799835205078, 0.08343800157308578, 0.6235432028770447, 0.1579023003578186, -0.010085977613925934...
``` import sys words = { 1 : 'one', 2 : 'two', 3 : 'three', 4 : 'four', 5 : 'five', 6 : 'six', 7 : 'seven', 8 : 'eight', 9 : 'nine', 10 : 'ten', 11 : 'eleven', 12 : 'twelve', 13 : 'thirteen', 14 : 'fourteen', 15 : 'fifteen', 16 : 'sixteen',
[ -0.06974900513887405, 0.2050301432609558, 0.280478835105896, -0.24972321093082428, 0.19003699719905853, 0.5304098129272461, 0.21270574629306793, 0.07095766067504883, 0.08111413568258286, -0.3295125365257263, -0.5011571645736694, 0.559962809085846, -0.34764793515205383, -0.10420503467321396...
17 : 'seventeen', 18 : 'eighteen', 19 : 'nineteen' } tens = [ '', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety', ] placeholders = [ '', 'thousand', 'million', 'billion', 'trillion', 'quadrillion' ] # segMag = segment m...
[ -0.030136754736304283, -0.12089888006448746, 0.36558103561401367, -0.26621097326278687, -0.13025660812854767, 0.7211549282073975, -0.1690942347049713, -0.13534551858901978, -0.3325437605381012, -0.3991486430168152, -0.24946847558021545, 0.18128494918346405, 0.10946165025234222, 0.595270454...
# convertDuo(number[1:3]) def convertDuo(number): #if teens or less if int(number[0]) == 1: return words[int(number)] #twenty-five else: return tens[int(number[0]) - 1] + '-' + words[int(number[1])] if __name__ == "__main__": string = [] numeralSegments = [] numeral = sys....
[ 0.24679529666900635, -0.13573767244815826, 0.2836337387561798, -0.38755398988723755, -0.08691877126693726, 0.3446129262447357, 0.19613362848758698, -0.5087611079216003, -0.016862422227859497, -0.38747990131378174, -0.1343526542186737, 0.814288318157196, 0.15384064614772797, -0.157706916332...
into lists, grouped in threes for i in range (0, len(numeral), 3): numeralSegments.append(numeral[i:i+3]) numeralSegments.reverse() # for every segment, convert to trio word and append thousand, million, etc depending on magnitude for i in range (len(numeralSegments)): ...
[ -0.29554036259651184, 0.05299165099859238, 0.5327090620994568, -0.1771661639213562, -0.6171308159828186, 1.0452433824539185, 0.33300885558128357, -0.5088754296302795, -0.6025878190994263, -0.5167977809906006, -0.3129703998565674, -0.06923345476388931, -0.12625974416732788, 0.09089554846286...
the list of strings before concatenating to commas string.reverse() print ', '.join(string) ``` **Warning**: I'm a total python novice. I'm aware there are probably many times more efficient ways of doing things. I'd appreciate any pointers to them. **Edit**: The code currently only works for...
[ 0.25275903940200806, 0.01012734416872263, 0.12753760814666748, -0.16698098182678223, -0.1862318217754364, 0.08672793209552765, 0.5921069979667664, 0.13351859152317047, -0.47581756114959717, -0.19548916816711426, 0.02942076325416565, 0.5846328735351562, -0.2584460377693176, 0.01177598629146...
work out well. You'll have to write the same algorithm for inserting digit separators. You start from the right, picking off segments of digits. What's left over (on the left, get it?) will be 1, 2 or 3 digits. You've got convertTrio and convertDuo, which handle 3 and 2 digits, respectively. Somewhere in there is a co...
[ -0.22769427299499512, -0.10267238318920135, 0.17518237233161926, -0.21627990901470184, 0.0582301951944828, 0.3215022087097168, -0.023091914132237434, -0.4416433870792389, -0.3254287540912628, -0.6405279040336609, -0.16907648742198944, 0.5723404884338379, 0.0395723395049572, -0.291475445032...
n= n[:-3] segList.insert( 0, n ) return segList ``` Edit To be more Pythonic, package this as a tidy, reusable module. The stuff inside the `if __name__ == "__main__"` does two things, which should be separated. Your command-line parsing (anything having to do with `sys.argv` is one thing. The actual "convert...
[ -0.052406590431928635, 0.13233819603919983, 0.14820240437984467, -0.3056508004665375, 0.11577184498310089, 0.034927695989608765, 0.1528129279613495, -0.23851965367794037, -0.21109166741371155, -0.5655298829078674, -0.14801576733589172, 0.5017886757850647, -0.4647582769393921, -0.0693617537...
of this module.
[ 0.20871655642986298, 0.19231802225112915, 0.18472981452941895, 0.08994273841381073, 0.25741973519325256, -0.2844970226287842, -0.06923353672027588, -0.4534156620502472, -0.16605091094970703, -0.24692751467227936, -0.31789064407348633, 0.43112316727638245, -0.045560967177152634, 0.176193863...
Our coding standards ask that we minimise the use of C# var (suggests limiting it's use to being in conjunction with Linq). However there are times when using generics where it's reasonably convenient e.g. ``` Dictionary<DateTime, Dictionary<string, float>> allValues = ... // ... foreach (var dateEntry in allValue) `...
[ 0.4780030846595764, 0.038840342313051224, 0.20212991535663605, -0.13123849034309387, -0.011612138710916042, -0.1659686118364334, 0.19147774577140808, -0.2618383765220642, -0.021632427349686623, -0.5822582244873047, -0.14699336886405945, 0.5447731614112854, -0.3649025559425354, 0.0082573257...
go in the opposite direction). I've got ReSharper 4.1, and it does offer this option (in either direction). Actually, I'd recommend challenging the standard... the former is far more readable than the latter (especially if you call the variable `pair` or something similar). I would't use "var" for `var i = 0`, but it ...
[ 0.36516761779785156, -0.1565677374601364, 0.3437154293060303, -0.19319531321525574, -0.19876287877559662, -0.11134277284145355, 0.23844821751117706, -0.4111665189266205, -0.029628651216626167, -0.6400325894355774, -0.14082671701908112, 1.0097450017929077, -0.2826714515686035, 0.02256388776...
style = Always use explicit type and run...
[ 0.5575464367866516, 0.18667729198932648, 0.046187788248062134, -0.04270928353071213, -0.015430211089551449, -0.42465996742248535, 0.558876633644104, -0.16126804053783417, 0.20855149626731873, -0.45477211475372314, -0.10215660184621811, 0.7416903376579285, -0.5176482200622559, -0.1668705940...
In the past I've always gone and called my namespace for a particular project the same as the project (and principle class) e.g.: ``` namespace KeepAlive { public partial class KeepAlive : ServiceBase {... ``` Then from other projects whenever i've called that class its always been: ``` KeepAlive.KeepAlive(...
[ 0.6805129647254944, 0.17942515015602112, 0.10625192523002625, -0.3682282269001007, -0.0006012185476720333, -0.06823664158582687, 0.1598004847764969, 0.13312016427516937, -0.22569893300533295, -0.2663237452507019, -0.09088339656591415, 0.3211287260055542, -0.27457553148269653, 0.41617757081...
CompanyName.ProductName.Web ``` etc. And inside divided per module and/or functionality, which normally correspond to folders ``` CompanyName.ProductName.Web.Shop CompanyName.ProductName.Web.Newsletter ``` etc. BTW: You can find answers to similar questions here: * [.NET namespaces](https://stackoverflow.co...
[ 0.01636994257569313, 0.40881842374801636, 0.49201881885528564, -0.015232735313475132, 0.27212485671043396, 0.03111308440566063, -0.3131200969219208, -0.2335149496793747, -0.4141559898853302, -0.5885105133056641, -0.4925321936607361, 0.21320661902427673, -0.14989161491394043, 0.290180712938...
I use the app.config file to store some values (path to a mapping database, data connection selections). These settings differ on the user machines and I would like the installer to set them right. Is there an installer that can work with .NET config files during setup and allow me to create some dialogs that would hel...
[ 0.3133242726325989, 0.06263536214828491, 0.4911710023880005, -0.026823535561561584, 0.12606649100780487, 0.10313472151756287, 0.1282859891653061, -0.3308550715446472, -0.263447105884552, -0.6105222702026367, -0.011594760231673717, 0.7007749676704407, -0.4105706810951233, -0.308491706848144...
that using WIX is one option, but I feel like cracking a walnut with a sledgehammer. It may be the only solution, but I still hope for something simple. We use WIX to change the application's configuration file. It works really well, you'll need to add wixUtilExtension.dll in the reference. WIX sample: ``` <Component...
[ -0.032053373754024506, -0.036722201853990555, 0.7131993174552917, 0.09050632268190384, 0.19572991132736206, 0.04221770912408829, 0.1484992951154709, -0.1127205342054367, -0.28369393944740295, -1.1169753074645996, -0.17239747941493988, 0.6482311487197876, -0.5513526797294617, -0.01156188733...
Value="Your Connection string values here" /> </Component> ``` It actually depends on what you are using to create the installer, What are you using ? Have alook at the [WIX Tutorial](http://www.tramontana.co.hu/wix/).
[ 0.6249207854270935, -0.36547181010246277, 0.5377649068832397, 0.04666850343346596, -0.06781607866287231, -0.18133290112018585, 0.30041706562042236, -0.00428512878715992, -0.024510860443115234, -0.42824041843414307, 0.11133256554603577, 0.7467669248580933, -0.40290433168411255, -0.009245477...
I have an arraylist that contains items called Room. Each Room has a roomtype such as kitchen, reception etc. I want to check the arraylist to see if any rooms of that type exist before adding it to the list. Can anyone recommend a neat way of doing this without the need for multiple foreach loops? (.NET 2.0) --- I ...
[ 0.5208884477615356, 0.3608839511871338, 0.6911916732788086, -0.24610374867916107, -0.007421365939080715, -0.260542631149292, -0.02795138768851757, -0.3403676748275757, -0.2835773825645447, -0.6708294153213501, -0.04154430329799652, 0.1333334743976593, -0.2454041838645935, 0.307692527770996...
rooms.Exists(delegate(Room room) { return room.Type == roomType; }); ``` Or with C# 3.0 (still targetting .NET 2.0) ``` bool exists = rooms.Exists(room => room.Type == roomType); ``` Or with C# 3.0 and either [LINQBridge](http://www.albahari.com/nutshell/linqbridge.aspx) or .NET 3.5: ``` bool exists = rooms.Any(r...
[ 0.2495160847902298, 0.336303174495697, 0.780963659286499, -0.17936019599437714, 0.4547770023345947, -0.2803574204444885, 0.1849737912416458, -0.27382007241249084, -0.2576095759868622, -0.7380045652389526, -0.25279363989830017, 0.22401078045368195, -0.47279083728790283, 0.3853217363357544, ...
I've written a program that counts lines, words, and characters in a text: it does this with threads. It works great sometimes, but not so great other times. What ends up happening is the variables pointing to the number of words and characters counted sometimes come up short and sometimes don't. It seems to me that t...
[ 0.32156312465667725, 0.15700799226760864, 0.0026967732701450586, 0.23373238742351532, 0.012517309747636318, 0.09682681411504745, 0.2689339220523834, 0.08281195908784866, -0.3805485963821411, -0.38358166813850403, 0.11462860554456711, 0.24366965889930725, -0.25350937247276306, 0.05206709355...
countText() { try { reader = new BufferedReader(new FileReader("this.txt")); while (true) { final String line = reader.readLine(); if(line == null) {break;} lines++; new Thread(new Runnable() {public void run() {chars += characterCounter(line);}}).start(); new Thread(new Runnable...
[ 0.09284719824790955, -0.435062050819397, 0.717546820640564, -0.35830241441726685, 0.05453461408615112, 0.18503333628177643, 0.3841261863708496, -0.0803668200969696, -0.20113542675971985, -0.5537537932395935, -0.42183685302734375, 0.49545222520828247, -0.4551665186882019, 0.4117114841938019...
I don't want to use StackOverflow in place of google and wikipedia and am worried that this isn't an appropriate question? I tried to make the question more general so that I'm not just asking for help with my code... but, is there another website where this kind of question might be more appropriate?) A different thre...
[ 0.34340593218803406, 0.20509128272533417, 0.2736140489578247, -0.12450522184371948, -0.20314057171344757, -0.29718244075775146, 0.25128522515296936, -0.17263177037239075, -0.39107823371887207, -0.6092352867126465, 0.018770301714539528, 0.38478824496269226, -0.20112711191177368, 0.106402426...
you're multithreading this code to learn threads rather than to speed up counting words, but that's a very inefficient way to use threads. You're creating two threads *per line* - two thousand threads for a thousand line file. Creating a thread (in modern JVMs) uses operating system resources and is generally fairly ex...
[ 0.3539413511753082, 0.07670442759990692, 0.01499988790601492, 0.29601165652275085, 0.09644049406051636, 0.016602445393800735, 0.4040759801864624, -0.22548907995224, -0.6327518820762634, -0.38373714685440063, -0.08100967109203339, 0.3970555067062378, -0.5026360154151917, 0.2488686740398407,...
but it will also make the effect of contention much worse. I'm pretty sure it will go slower than a single-threaded algorithm. I suggest having just one long-lived thread which looks after `chars`, and one for `words`, each with a work queue to which you submit jobs each time you want to add a new number. This way onl...
[ 0.42305073142051697, 0.1335369199514389, 0.008725474588572979, 0.26274266839027405, -0.010972294956445694, 0.41252997517585754, 0.23122470080852509, 0.03428718075156212, -0.3785429000854492, -0.5389219522476196, 0.0948321744799614, 0.4459227919578552, -0.2880256772041321, 0.287033736705780...
loop. It's also important, once you've read all the lines in the file, to *wait* for all the threads to finish before you actually print out the values of the counters, otherwise you lose the updates from threads that haven't finished yet. With your current design you'd have to build up a big list of threads you creat...
[ 0.5667287707328796, -0.2805037796497345, 0.049244482070207596, -0.0889456570148468, -0.2196671962738037, -0.029686961323022842, 0.11858852207660675, -0.07717496156692505, -0.3995707929134369, -0.45136791467666626, 0.2325407713651657, 0.22428691387176514, -0.5569181442260742, 0.038831565529...
to implement: check out [java.util.concurrent.Executors.newSingleThreadExecutor](http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/Executors.html#newSingleThreadExecutor). It also makes it easy to add more concurrency later on (assuming proper locking etc), as you can just switch to a thread pool rather than...
[ 0.3400074243545532, -0.06208134815096855, 0.37572479248046875, 0.1773906797170639, 0.07430079579353333, -0.5220519304275513, 0.1849580854177475, 0.10585694760084152, -0.622513473033905, -0.6412569284439087, -0.0865694209933281, 0.13573375344276428, -0.10638696700334549, 0.1926623433828354,...
how come this work ``` public IQueryable<Category> getCategories(int postId) { subnusMVCRepository<Categories> categories = new subnusMVCRepository<Categories>(); subnusMVCRepository<Post_Category_Map> postCategoryMap = new subnusMVCRepository<Post_Category_Map>(); var query = from c in categori...
[ -0.43760743737220764, -0.2689739465713501, 0.7409094572067261, 0.014446700923144817, -0.2455175518989563, -0.09385996311903, -0.025837939232587814, -0.333458811044693, -0.4094828963279724, -0.4447372257709503, -0.27254024147987366, 0.42106643319129944, -0.2176063358783722, 0.20544382929801...
select new Category { Name = c.Name, CategoryId = c.CategoryId }; return query; } ``` but this does not ``` public
[ -0.3738352954387665, -0.1723533570766449, 0.30521726608276367, -0.11603259295225143, 0.042876534163951874, -0.23207978904247284, 0.07395758479833603, -0.008572413586080074, -0.25054582953453064, -0.3770903944969177, -0.6696453094482422, 0.4339715540409088, -0.5037821531295776, 0.5178303718...
IQueryable<Category> getCategories(int postId) { subnusMVCRepository<Categories> categories = new subnusMVCRepository<Categories>(); subnusMVCRepository<Post_Category_Map> postCategoryMap = new subnusMVCRepository<Post_Category_Map>(); var query = from c in categories.GetAll() join pcm in postCat...
[ -0.8191729187965393, -0.3215020000934601, 0.7863280177116394, 0.12112164497375488, -0.3873026669025421, 0.16663718223571777, 0.06450901925563812, -0.23090313374996185, -0.20917218923568726, -0.3492908775806427, -0.28210729360580444, 0.4509016275405884, -0.35541436076164246, 0.1498868167400...
Name = c.Name, CategoryId = c.CategoryId }; return query; } ``` The issue is most likely in the implementation of the query provider. pcm.PostId == 1 and pcm.PostId == postId actually have a big difference. In the expression tree the first is generated as a ConstantExpre...
[ -0.2920180559158325, -0.17388111352920532, 0.3623673915863037, 0.06135628744959831, -0.11438717693090439, -0.09431971609592438, -0.061044033616781235, 0.051213040947914124, 0.06216054782271385, -0.3441610038280487, -0.15794344246387482, 0.40028563141822815, -0.47520139813423157, 0.36238059...
need to be evaulated. With the second, the compiler actually generates an inner class here (this is the \_DisplayClassX that you see). This class will have a property (will most likely be the same name as your parameter) and the expression tree will create a MemberAccessExpression which points to the auto-generated Di...
[ -0.21797451376914978, -0.05049179494380951, 0.27703577280044556, 0.04410303011536598, 0.0656437948346138, -0.08815710991621017, 0.24602006375789642, -0.3659757375717163, -0.1854477971792221, -0.4409937858581543, 0.001895360299386084, 0.693070650100708, -0.5430200099945068, -0.0046778973191...
During our build process we run `aspnet_compiler.exe` against our websites to make sure that all the late-bound stuff in ASP.NET/MVC actually builds (I know nothing about ASP.NET but am assured this is necessary to prevent finding the failures at runtime). Our sites are fairly large in size, with a few hundred pages/v...
[ 0.5964072942733765, 0.2861449122428894, 0.1709245890378952, -0.03808101266622543, -0.012157639488577843, 0.009364636614918709, 0.6961067318916321, -0.15777945518493652, 0.07554823160171509, -0.7392444014549255, 0.03329801931977272, 0.6075857877731323, 0.17428049445152283, -0.28216913342475...
Intel chip, with 4GB RAM and a WD Velociraptor 10,000rpm hard disk. And part of what's odd is that the EXE doesn't seem to be using much CPU (1-5%) and doesn't seem to be doing an awful lot of I/O either. So... is this a known issue? Why is it so slow? And is there any way to speed it up? **Note:** To clarify a coupl...
[ 0.44203537702560425, 0.009780568070709705, -0.07150435447692871, 0.2694547474384308, -0.16151537001132965, 0.05483809486031532, -0.17039798200130463, 0.04423919692635536, 0.009789020754396915, -0.6406248807907104, -0.04720310866832733, 0.6196718215942383, 0.014209509827196598, -0.151955381...
problem is the pre-compilation of the site *after* these projects have already been compiled ([see this MSDN page for more details](http://msdn.microsoft.com/en-us/library/ms229863.aspx)) as part of the dev build script. We are performing in-place pre-compilation, not copying the files to a target directory. 1. Compile...
[ 0.34944474697113037, 0.05309183895587921, -0.016194671392440796, 0.051863640546798706, -0.2633602023124695, -0.17251671850681305, 0.3573331832885742, -0.3633258044719696, -0.1663835495710373, -1.0105242729187012, -0.09831681102514267, 0.4381536543369293, -0.31439679861068726, -0.1049037799...
Does anyone have some sample code showing how to POST to a URL using wxWidgets? The documentation and discussion forums imply that it's possible but the methods in wxHTTP are very low-level compared to what you find in .NET and scripting languages like Perl and Ruby. Do I actually have to create the HTTP request myself...
[ 0.5824467539787292, 0.08789993822574615, -0.08029767870903015, 0.1376502960920334, -0.42117682099342346, -0.35014820098876953, 0.3812224864959717, 0.06416957825422287, -0.41364040970802307, -0.2973645329475403, 0.13343706727027893, 0.16160038113594055, -0.22311612963676453, 0.3461804389953...
The assembly it's trying to find isn't the root assembly - it's a referenced one, but it's in the same folder, and Directory.GetCurrentDirectory() is the folder with all of the files in. I'm stuck - any suggestions? You can either: 1. Create a new `AppDomain` to load the assembly (and set the `AppDomain`'s base direc...
[ 0.3973984122276306, 0.14161528646945953, 0.5732405781745911, 0.09493099898099899, 0.11114805191755295, 0.17474471032619476, 0.24832402169704437, -0.11235012859106064, -0.18638020753860474, -0.5361367464065552, -0.23865151405334473, 0.3290121257305145, -0.523283839225769, 0.2026265859603881...
See the [probe](http://msdn.microsoft.com/en-us/library/823z9h8w.aspx) element for more info.
[ -0.046527229249477386, -0.04363813251256943, 0.10921410471200943, 0.263508141040802, -0.046618372201919556, -0.2023722380399704, 0.02091924287378788, 0.033600810915231705, -0.12054353952407837, -0.6097468137741089, -0.13881134986877441, 0.07122556120157242, -0.13876016438007355, 0.23933231...
I know what I'm looking for is probably a security hole, but since I managed to do it in Oracle and SQL Server, I'll give it a shot: I'm looking for a way to execute a shell command from a SQL script on MySQL. It is possible to create and use a new stored procedure if necessary. Notice: I'm not looking for the SYSTEM...
[ 0.13134445250034332, 0.22436417639255524, 0.1108170598745346, 0.004659850616008043, 0.1047540009021759, -0.220064178109169, 0.3095579445362091, 0.17380963265895844, -0.17451290786266327, -0.700319230556488, -0.0828380361199379, 0.4420035183429718, -0.22413820028305054, 0.1978638470172882, ...
consider writing your scripts in a more featureful scripting language, like Perl, Python, PHP, or Ruby. All of these languages have libraries to run SQL queries. There is no built-in method in the stored procedure language for running shell commands. This is considered a bad idea, not only because it's a security hole...
[ 0.32516029477119446, 0.24888615310192108, -0.03089342638850212, 0.002551296493038535, 0.08384726941585541, -0.08768624812364578, 0.43703654408454895, 0.19887344539165497, -0.04637911170721054, -0.5307015180587769, -0.1493256688117981, 0.6256434917449951, -0.3378162086009979, -0.22656610608...
roll back. I would recommend doing your SQL work in the stored procedure, and do other work in the application that calls the stored procedure.
[ 0.18821386992931366, 0.34114688634872437, 0.02915310114622116, 0.16062983870506287, 0.08260750770568848, -0.20773766934871674, -0.4724755883216858, 0.4035881757736206, 0.09262599050998688, -0.6333618760108948, -0.000006623206445510732, 0.9185689687728882, 0.1279853880405426, -0.25368773937...
I have a need to populate a Word 2007 document from code, including repeating table sections - currently I use an XML transform on the document.xml portion of the docx, but this is extremely time consuming to setup (each time you edit the template document, you have to recreate the transform.xsl file, which can take up...
[ 0.18410557508468628, 0.1438189446926117, 0.5450639128684998, 0.07651478797197342, -0.16220976412296295, 0.04442066699266434, 0.5611423254013062, -0.21444180607795715, 0.17273512482643127, -0.5629044771194458, 0.0036055436357855797, 0.6218708753585815, -0.14219021797180176, 0.16159451007843...
[**Aspose Words**](http://www.aspose.com/categories/file-format-components/aspose.words-for-.net-and-java/default.aspx) and am quite happy with that component. It doesn't need Microsoft Word on the machine. *"Aspose.Words enables .NET and Java applications to read, modify and write Word® documents without utilizing M...
[ 0.24925388395786285, 0.14290033280849457, 0.5886250734329224, -0.2612973749637604, -0.1261741816997528, 0.16041605174541473, -0.00003117879532510415, -0.04106615111231804, 0.0708610862493515, -0.8899678587913513, -0.05745840072631836, 0.3836855888366699, 0.15112154185771942, 0.255494356155...
I am trying to FTP some apple DMG files, if we do it by hand through Safari or IE it ends up at the destination just fine and uncorrupted. However, if I use a freeware FTP client that we had been using with great success for zip's and exe's or if I use a Powershell script I finished off (adapted from another stackover ...
[ 0.4719155430793762, 0.2501373887062073, 0.3109169900417328, -0.03774861618876457, 0.003803386352956295, -0.08674398809671402, 0.43781059980392456, 0.21808332204818726, -0.2234194129705429, -0.7019803524017334, 0.13212113082408905, 0.6029538512229919, -0.23041024804115295, 0.215684115886688...
far all I have tried is gzipping the dmg before sending and that accomplished nothing. Again, anything but a dmg gets transmitted just fine. FYI I am using binary mode transfers, so that is not it..thx though Just so everyone knows. It must have been the client I was using had the exact same issue as my PowerShell scr...
[ 0.203388974070549, -0.06044677644968033, 0.39928755164146423, 0.13674674928188324, -0.2235051393508911, -0.23331280052661896, 0.2466680258512497, 0.43804407119750977, -0.2417391687631607, -0.6995483636856079, 0.11729488521814346, 0.7120596766471863, -0.1996590495109558, 0.44144511222839355...
I would like to create a simple program (in Java) which edits text files - particularly one which performs inserting arbitrary pieces of text at random positions in a text file. This feature is part of a larger program I am currently writing. Reading the description about java.util.RandomAccessFile, it appears that an...
[ 0.1841864436864853, -0.3159469962120056, 0.1913873255252838, -0.034966930747032166, -0.3238195478916168, -0.3448656499385834, 0.08578591048717499, 0.09427336603403091, -0.15243515372276306, -0.8118026852607727, 0.15724772214889526, 0.5073453783988953, -0.2788256108760834, 0.143567889928817...
don't know why they aren't mentioned anywhere when dealing with the problem of replacing or inserting content in files. [FileChannels](http://docs.oracle.com/javase/6/docs/api/java/nio/channels/FileChannel.html) are fast, use them. Here's an example (ignoring exceptions and some other stuff): ``` public void insert(S...
[ 0.16040484607219696, -0.3691611886024475, 0.6924752593040466, -0.329350084066391, -0.12409428507089615, 0.22475823760032654, 0.02293061837553978, -0.440613329410553, -0.16990385949611664, -0.6067532300949097, -0.1751878261566162, 0.62154620885849, -0.21601030230522156, 0.21497830748558044,...
targetChannel.close(); } ```
[ 0.006073374766856432, -0.1424761563539505, 0.5004982352256775, -0.35235878825187683, -0.03491661325097084, -0.18988637626171112, 0.00836690329015255, 0.23100419342517853, 0.1108076348900795, -0.6395535469055176, -0.10777454078197479, 0.6069400310516357, -0.22002816200256348, -0.07528596371...
I want to automate tests on my web application, and it uses postgresql. Does anyone know how define a restore point on a postgresql database and restore to an earlier state? I heard something about point in time recovery, but i dont if this is what i need. Thanks in advance I use [SQL Alchemy](http://www.sqlalchemy.or...
[ 0.29015445709228516, 0.1774238497018814, 0.07324147969484329, 0.13934803009033203, -0.3021300435066223, 0.08712120354175568, 0.23341676592826843, -0.11407461017370224, 0.16208063066005707, -0.5422923564910889, 0.18436217308044434, 0.7267598509788513, -0.02578013762831688, 0.181062683463096...
those, you'll need [pyodbc](http://pyodbc.sourceforge.net/), but that's a pretty simple install. Of course, if you want to write straight SQL and not use an ORM, you just need pyodbc.
[ 0.5512210130691528, 0.190725639462471, 0.22071866691112518, 0.42468133568763733, 0.17177778482437134, -0.41802069544792175, -0.18671032786369324, 0.13264457881450653, -0.3138284683227539, -0.33129218220710754, -0.364718496799469, 0.7794108986854553, -0.10270657390356064, -0.163363918662071...
In C++, is the return type considered part of the function signature? and no overloading is allowed with just return type modified. Normal functions do not include the return type in their signature. (*note*: i've rewritten this answer, and the comments below don't apply to this revision - see the edit-history for det...
[ 0.2556633949279785, -0.06709567457437515, 0.20517612993717194, -0.18870754539966583, -0.1721401959657669, -0.3812170624732971, 0.020636701956391335, -0.15033486485481262, -0.03974112123250961, -0.2631150186061859, -0.281624436378479, 0.48849689960479736, -0.41606926918029785, -0.0856041163...
an explicit specialization of a function template (with all arguments specified), or a declaration of an ordinary function. If a template entity is declared, then you are declaring a primary function template, or an explicit specialization where some arguments are not specified. (This is very similar to the relation of...
[ 0.09533721953630447, -0.2604118287563324, 0.2124396562576294, -0.0057834177277982235, 0.09139873832464218, -0.15911124646663666, -0.14736433327198029, -0.277591735124588, -0.0436883270740509, -0.5008660554885864, -0.42634883522987366, 0.7429921627044678, -0.390245646238327, 0.0265736728906...
class member, the cv- qualifiers (if any) on the function itself and the class in which the member function is declared. The signature of a function template specialization includes the types of its template arguments. (14.5.5.1) It's missing the return type in this definition, which *is* part of the signature of a fu...
[ -0.0012679327046498656, -0.16772650182247162, 0.16758842766284943, 0.0414946973323822, 0.043319057673215866, -0.08570632338523865, -0.09760493040084839, -0.22910341620445251, 0.000045457858504960313, -0.2866039574146271, -0.3142094314098358, 0.4884116053581238, -0.3612211346626282, 0.17515...
of the function template and of the actual template arguments (whether explicitly specified or deduced). > > > The signature of a function template consists of its function signature, its return type and its template parameter list. ### So what exactly does a signature contain, again? So, when we ask about the sign...
[ 0.18524350225925446, -0.28937795758247375, 0.1567370593547821, 0.15462805330753326, 0.014293610118329525, -0.11816421151161194, -0.16999268531799316, -0.24844639003276825, -0.04720066487789154, -0.6449041366577148, -0.24386915564537048, 0.5365461707115173, -0.41555774211883545, -0.13191109...
of the type of a function. That is, the following is not valid: ``` void f(); int (*pf)() = &f; // different types! ``` ### When is an overload invalid if only the return type differs? Major compilers currently reject the following code: ``` int f(); double f(); // invalid ``` But accept the following code: ```...
[ 0.08226027339696884, 0.2243966907262802, 0.059501998126506805, -0.1784893125295639, -0.10240752249956131, -0.008003140799701214, 0.3245181441307068, -0.3772706389427185, -0.1526222974061966, -0.2532978057861328, -0.5167439579963684, 0.4886186420917511, -0.6114534139633179, 0.17712786793708...
What is a function declaration: `7/2` and `7/5` * What is the signature of a function template/specialization: `14.5.5.1` For reference, here is what the most recent C++0x draft n3000 says about "signature" in `1.3.11`, which is much more complete in its coverage of the different type of entities: > the name and the ...
[ 0.28761300444602966, -0.146170973777771, 0.2392011135816574, -0.038413312286138535, 0.031757596880197525, -0.2966775596141815, -0.1387712061405182, -0.18343724310398102, -0.13977180421352386, -0.18217012286186218, -0.4068724513053894, 0.716618001461029, -0.06681229919195175, 0.032513100653...
The signature of a function template additionally includes its return type and its template parameter list. The signature of a function template specialization includes the signature of the template of which it is a specialization and its template arguments (whether explicitly specified or deduced). [ Note: Signatures a...
[ 0.31697526574134827, -0.07447180151939392, 0.16208802163600922, 0.11232353746891022, 0.18477463722229004, -0.04068255051970482, -0.25327998399734497, -0.2445281445980072, -0.014968521893024445, -0.3527272641658783, -0.4100038707256317, 0.5344186425209045, -0.3323074281215668, -0.1060212552...
I've some experiences on build application with Asp.Net, but now MVC frameworks become more popular. I would like to try building new multilingual web application using with Asp.Net MVC or Castle MonoRail but I don't know which one is good for me. I don't like the web form view engine, but I like routing feature in Asp...
[ 0.5171548128128052, -0.15430529415607452, 0.0494939424097538, 0.18021462857723236, -0.3657379746437073, 0.03887014091014862, 0.5422998070716858, -0.10066136717796326, -0.32168954610824585, -0.7945662140846252, 0.3173867166042328, 0.6793944835662842, -0.25983309745788574, 0.1098668500781059...
fact that ASP.NET MVC is going to become the default architecture within three years should probably swing it. This equation was different a year ago, simply because the default architecture had serious productivity problems compared to MonoRail. If you want to talk technical advantages and disadvantages: * ASP.NET A...
[ 0.27422282099723816, -0.2069779634475708, 0.48169487714767456, 0.27589383721351624, -0.3147602677345276, -0.36246785521507263, 0.29510265588760376, 0.29981666803359985, -0.5520706176757812, -0.7962724566459656, 0.008995919488370419, 0.5358426570892334, 0.004648506175726652, -0.174881473183...
and more obvious than Monorail). Also, don't dismiss the standard view engine out of hand. You don't have to throw controls at it like you did with ASP.NET, you can code it in a pretty similar manner to Brail, only using C# instead of Boo. There are things that are just plain ugly \* the number of methods that take...
[ -0.040085408836603165, -0.18769128620624542, 0.09696896374225616, 0.45085108280181885, -0.5274551510810852, -0.10096804797649384, 0.1159474179148674, 0.17014269530773163, -0.10086444765329361, -0.6387531757354736, 0.20688609778881073, 0.448552668094635, -0.2697494924068451, 0.1964867115020...
no abstraction for validation or paging in ASP.NET, for instance. Also, there's not really any help for binding to a model. The helpers have very little functionality compared to their Monorail equivalents. Overall, though, I think ASP.NET MVC is a winner.
[ -0.021479226648807526, -0.18139205873012543, 0.2540070712566376, 0.5958656668663025, -0.28949442505836487, -0.24558842182159424, 0.27190279960632324, -0.11675722151994705, -0.21743904054164886, -0.6107261180877686, 0.08880946785211563, 0.3851172626018524, -0.18555311858654022, -0.049989745...
Does anyone know of a Java library that provides a useful abstraction for analyzing and manipulating arbitrary relational database schemata? I'm thinking of something that could do things like ``` LibraryClass dbLib = ...; DbSchema schema = dbLib.getSchema("my_schema"); List<DbTable> tables = schema.getTables(); ``` ...
[ 0.18160589039325714, 0.16013556718826294, 0.3641595244407654, 0.2494695484638214, 0.05711129307746887, -0.26483768224716187, 0.03594079241156578, -0.006530701648443937, -0.37559083104133606, -0.6797783970832825, 0.03928210586309433, 0.4599166214466095, -0.3135116696357727, 0.22228956222534...
to/from XML (in Torque format) or a live database, or even define the database schema in pure Java. Better yet, read the on-line doco, it's quite good.
[ 0.6720453500747681, -0.014461004175245762, 0.13448438048362732, 0.22269587218761444, -0.06318289786577225, -0.3278360962867737, -0.09794201701879501, 0.1380000114440918, 0.18668361008167267, -0.4931342601776123, -0.1774878352880478, 0.8253458142280579, 0.1694759577512741, -0.24964611232280...
I have a script that takes a command and executes it on a remote host. It works fine, for example: ``` $ rexec "ant build_all" ``` will execute the "ant build\_all" command on the remote system (passing it through SSH, etc). Because I'm lazy, I want to set up an alias for this command (and ultimately, several other...
[ 0.31068435311317444, 0.17442156374454498, -0.023103607818484306, -0.22015152871608734, -0.0815257579088211, -0.1690802127122879, 0.3593093156814575, 0.20513653755187988, 0.03341134637594223, -0.9119787812232971, 0.03980915620923042, 0.7670767307281494, -0.6042696833610535, 0.32584285736083...
-Dtarget=Win32 (interpreted as:) $ rexec "ant" build_all -Dtarget=Win32 ``` This fails, because rexec really takes just one argument, and ignores the others. I could probably do this with a bash wrapper script, but I was wondering if bash had any built-ins for doing this for me, perhaps a named-argument version of a...
[ 0.17036578059196472, 0.04647693410515785, 0.1590774655342102, -0.271815687417984, -0.07678865641355515, -0.06084253638982773, 0.45355603098869324, 0.06960850954055786, 0.06676757335662842, -0.6094775795936584, 0.02843024581670761, 1.0396236181259155, -0.6141772270202637, -0.025645906105637...
In which cases would you use which? Is there much of a difference? Which I typically used by persistence engines to store booleans? A TINYINT is an 8-bit integer value, a BIT field can store between 1 bit, BIT(1), and 64 bits, BIT(64). For a boolean values, BIT(1) is pretty common.
[ 0.09848318248987198, -0.299272358417511, 0.2817102074623108, 0.16658423840999603, 0.008012873120605946, 0.2225559651851654, 0.035482898354530334, -0.09430309385061264, -0.1322154849767685, -0.28329429030418396, 0.28337207436561584, 0.31664136052131653, -0.1703486442565918, 0.13153313100337...
I'm advising a friend who manages a SQL 2k5 box that has several users who have dbo access to multiple databases. The problem is: 1. These users haven't had their passwords changed for some months, 2. These users put their IDs into applications and the applications run as DBO. So - aside from the obvious dbo rights t...
[ 0.35809966921806335, 0.36168360710144043, 0.13411308825016022, -0.01245922688394785, 0.14918524026870728, -0.3627023696899414, 0.1210673451423645, -0.05293485149741173, -0.21238143742084503, -0.2281101793050766, -0.11362998932600021, 0.36342450976371765, -0.14949654042720795, 0.28350049257...
DBO affect other resources not directly connected to that database? --- As a clarification, this was SQL Server 2005, and by default xp\_cmdShell wasn't authorized for DBO users. I'm still wondering if there are risks beyond the obvious CRUD. What can someone do with DBO? yes. dbo has rights to do whatever it wants o...
[ 0.21796312928199768, 0.21844132244586945, 0.38442718982696533, 0.03543810173869133, -0.17021752893924713, -0.6696882843971252, 0.1421341896057129, 0.134210467338562, -0.3623483180999756, -0.08425139635801315, -0.09563382714986801, 0.4034138023853302, -0.31861627101898193, 0.231506735086441...
How is the guest account in SQL Server (2000, 2005, 2008) supposed to be used? What is it good for? I've tried enabling the account but I still can't get certain users to be able to refresh Excel 2007 PivotTables attached to views which I have given SELECT rights to GUEST. What am I missing? Via the JDK: `transformer....
[ -0.09830398112535477, 0.09976956993341446, 0.29895395040512085, 0.13398534059524536, -0.08084277808666229, -0.058991286903619766, 0.16222505271434784, -0.00011257363803451881, -0.260153591632843, -0.2125164419412613, 0.23325631022453308, 0.6219131946563721, -0.11776193976402283, 0.10737159...
How can I go through all external links in a div with javascript, adding (or appending) a class and alt-text? I guess I need to fetch all objects inside the div element, then check if each object is a , and check if the href attributen starts with http(s):// (should then be an external link), then add content to the a...
[ 0.08273304998874664, -0.03881922736763954, 0.611405074596405, -0.20279592275619507, -0.13246475160121918, -0.08888420462608337, 0.44059666991233826, -0.3652690351009369, 0.007893402129411697, -0.8785682320594788, -0.08494950830936432, 0.6395223140716553, -0.3120572566986084, -0.03306408971...
var currentHref = window.location.href.replace(re, '$1'); var reLocal = new RegExp('^' + currentHref.replace(/\./, '\\.')); var linksDiv = document.getElementById("Links"); if (linksDiv == null) return; var links = linksDiv.getElementsByTagName("a"); for (var i = 0; i < links.length; i++) { var href = ...
[ -0.21087953448295593, -0.22243529558181763, 0.9634197354316711, -0.3944928050041199, 0.23671147227287292, 0.2026238739490509, 0.5382754802703857, -0.468450129032135, -0.22384293377399445, -0.4982594847679138, -0.5743893980979919, 0.38656264543533325, -0.3436923921108246, 0.3944560289382934...
links[i].className = 'AddedClass'; } if (links[i].title != undefined && links[i].title != '') { links[i].title += ' (outside link)'; } else { links[i].title = 'Outside link'; } } } </script> <div id="Links"> <a name="_Links"></a> <a href="/foo.asp">FOO</a> <a href="ftp://FTP.o...
[ 0.19388513267040253, 0.12126848846673965, 0.37903377413749695, -0.2671613395214081, 0.049036573618650436, -0.06358511745929718, 0.22351372241973877, -0.37982726097106934, -0.28792604804039, -0.4648647606372833, -0.3803207576274872, 0.02205764129757881, 0.08499377965927124, 0.20254074037075...
might want to hard-code the URL to go beyond the top level. On the other hand, you might want to alter the RE if you want <http://foo.my-server.com> and <http://bar.my-server.com> marked as local. [UPDATE] Improved robustness after good remarks... I don't highlight FTP or other protocols, they probably deserve a di...
[ 0.49355217814445496, 0.04733021557331085, 0.49565431475639343, -0.23993675410747528, -0.3191846013069153, -0.03340953588485718, 0.5072008371353149, 0.05273321643471718, -0.38016456365585327, -0.6778765916824341, -0.30918097496032715, 0.5233836770057678, -0.2750829756259918, 0.3681008815765...
Out of curiosity, anyone knows the particulars of the internal implementation of ``` ListControl.SelectedIndex = (int) <new valueIndex> ``` VS ``` ListControl.SelectedValue = <new value>.ToString() ``` I'm having difficulties with a custom validation object we've built here to process all validation in one swee...
[ 0.32304295897483826, -0.02966422215104103, 0.2740910053253174, -0.08965019136667252, -0.18531721830368042, -0.18098880350589752, 0.11918159574270248, -0.6209351420402527, -0.4058457016944885, -0.41708558797836304, 0.051188912242650986, 0.2614678740501404, -0.4059572219848633, 0.07931011915...
how many times it's been called. Here's the code for my counter tag. ``` class CounterNode(template.Node): def __init__(self): self.count = 0 def render(self, context): self.count += 1 return self.count @register.tag def counter(parser, token): return CounterNode() ```
[ 0.16236095130443573, -0.0868244543671608, 0.2455022782087326, -0.40434303879737854, -0.1512719988822937, 0.1910606473684311, 0.39970090985298157, -0.32400721311569214, -0.2290448397397995, -0.48752298951148987, 0.02938074618577957, 0.4727148413658142, -0.08998364210128784, 0.16355067491531...
I would want to do something like: ``` >>> lst = [1, 2, 3, 4, 5] >>> lst.find(lambda x: x % 2 == 0) 2 >>> lst.findall(lambda x: x % 2 == 0) [2, 4] ``` Is there anything nearing such behavior in Python's standard libraries? I know it's very easy to roll-your-own here, but I'm looking for a more standard way. You can...
[ 0.14297182857990265, -0.07421623915433884, -0.05101446807384491, -0.2424410581588745, -0.11778981983661652, -0.0914820209145546, 0.012991718016564846, -0.22384001314640045, -0.16418351233005524, -0.5856046080589294, -0.026651587337255478, 0.4944014847278595, -0.6435323357582092, -0.3054964...
could try: ``` >>> next(x for x in lst if x % 2 == 0) 2 ``` Though that would throw an exception if nothing matches, so you'd probably want to wrap it in a try/catch. The () brackets make this a generator expression rather than a list comprehension. Personally though I'd just use the regular filter/comprehension an...
[ -0.029699595645070076, -0.25406381487846375, 0.0528651624917984, -0.10140297561883926, -0.076997309923172, -0.058879949152469635, 0.1501338928937912, -0.29552191495895386, -0.28941261768341064, -0.6576884388923645, -0.21702353656291962, 0.5009657144546509, -0.5959687829017639, -0.313620448...
== 0][:1] ```
[ 0.10071681439876556, 0.2595793902873993, 0.32512593269348145, -0.3543719947338104, -0.05791962146759033, -0.24378252029418945, 0.2498326450586319, -0.3184152841567993, 0.10337448865175247, 0.08036505430936813, -0.3463946580886841, 0.5289812088012695, -0.5981488227844238, 0.2408275008201599...
Currently I'm tasked with doing the daily build. We have an ASP.NET 2005 website with a SQL Server 2005 backend. Our current source control is Visual Source Safe 2005. At this point, I use the brute-force method of daily builds. 1. Get Latest version of source code 2. Get Latest version of Database release script 3. ...
[ 0.4978450536727905, 0.4521244764328003, 0.2705015242099762, -0.30126702785491943, -0.17655733227729797, -0.047967564314603806, 0.7196170687675476, -0.05230211094021797, 0.10255447030067444, -0.5860099196434021, 0.15576237440109253, 0.5514629483222961, 0.3441592752933502, 0.0232935622334480...
Server. Looking at the idea of automated builds intrigues me since it means that I do less each morning. How would you recommend I proceed? I want to have a fully fleshed out idea before I present it to my boss. [Ditch VSS, move to Subversion, and check out CruiseControl.NET.](http://jamesstory.wordpress.com/category/...
[ 0.7102389931678772, -0.08791527897119522, 0.5512998104095459, 0.03717988356947899, -0.17864803969860077, -0.306238055229187, 0.2873276472091675, -0.02050088532269001, -0.2565552890300751, -0.7192950248718262, -0.027561897411942482, 0.7641220688819885, -0.026786142960190773, -0.012048143893...
What im wondering how to do is when someone edits a list item and it goes through my event code that is fired when a change is made and save is hit, i dont want anyone to be able to edit that list item itself while its still processnig that request. So i was wondering if while in that event i can disable the individual...
[ 0.6817201375961304, 0.05283030867576599, 0.17173948884010315, -0.007588718552142382, -0.09767573326826096, -0.0935126543045044, 0.20194004476070404, -0.10883579403162003, -0.30397143959999084, -0.39481666684150696, 0.22323283553123474, 0.44846874475479126, -0.37832608819007874, -0.13058051...
or content type to use as a flag. When you enter your event code, make sure you check the flag first and if not set, set it and do your stuff. After you have done your stuff, unset the flag. Here is some code to illustrate. Note that I have used a column named "updating". You can use the properties of the SPListItem ...
[ 0.2636725902557373, -0.46156933903694153, 0.5346306562423706, 0.14429901540279388, 0.1858464628458023, -0.6355663537979126, 0.3713659942150116, -0.1016923114657402, -0.1742614209651947, -0.657141387462616, -0.18837563693523407, 0.747416615486145, -0.3628169894218445, -0.11943517625331879, ...
loop on your hands. .b ``` public override void ItemAdding(SPItemEventProperties properties) { if (properties.ListItem["updating"].ToString() == "updating") { properties.Cancel = true; properties.ErrorMessage = "Item is currently updating, please try again later"; ...
[ 0.22169555723667145, -0.2873672842979431, 0.5708714723587036, -0.06027965247631073, 0.3268846869468689, 0.0863778218626976, 0.641676664352417, -0.5307788252830505, -0.3901711106300354, -0.35015395283699036, -0.08304698020219803, 0.49377772212028503, -0.4502581059932709, 0.3131352663040161,...
properties.ListItem["updating"] = "updating"; this.DisableEventFiring(); properties.ListItem.Update(); this.EnableEventFiring(); // do your stuff properties.ListItem["updating"] = ""; this.DisableEventFiring(); properties.ListItem.Upd...
[ 0.15840394794940948, 0.004093620460480452, 1.00823974609375, -0.3089900314807892, 0.6479605436325073, -0.4044409692287445, 0.5025841593742371, -0.6054790616035461, -0.3646051287651062, -0.6954347491264343, -0.6012957692146301, 0.7844576239585876, -0.5161882638931274, 0.0005135303945280612,...
this.EnableEventFiring(); } } ```
[ -0.054966509342193604, 0.05085323750972748, 0.5046136379241943, -0.4201112687587738, 0.43371227383613586, -0.4099542200565338, 0.36180469393730164, -0.11498696357011795, 0.1071339026093483, -0.5502231121063232, -0.36633774638175964, 0.7866905331611633, -0.4935932457447052, 0.05620827898383...
Similar to [this](https://stackoverflow.com/questions/288794/does-c-optimize-the-concatenation-of-string-literals) question, but for VB.NET since I learned this is a language thing. For instance, would the compiler know to translate > Dim s As String = "test " + "this " + > "function" to ``` Dim s As String = "tes...
[ 0.05382714793086052, -0.25920382142066956, 0.3111279010772705, -0.177955761551857, -0.29110783338546753, -0.31059136986732483, 0.5233044624328613, -0.30854982137680054, -0.0513627752661705, -0.27586546540260315, -0.16428233683109283, 0.6210865378379822, -0.21562781929969788, -0.16942563652...