text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
</serviceBehaviors>
</behaviors>
</system.serviceModel>
``` | [
0.3654096722602844,
0.10509718209505081,
0.16691310703754425,
-0.23537380993366241,
-0.11844248324632645,
-0.03760314732789993,
0.5767767429351807,
0.251424640417099,
-0.1973811239004135,
-0.7820412516593933,
-0.359686940908432,
0.47388797998428345,
-0.2197037637233734,
0.23106124997138977... | |
I need to create some windows service which will execute every N period of time.
The question is:
Which timer control should I use: `System.Timers.Timer` or `System.Threading.Timer` one? Does it influence on something?
I am asking because I heard many evidences to non correct work of `System.Timers.Timer` in wi... | [
0.3283700942993164,
0.14661070704460144,
0.264544278383255,
-0.02431018091738224,
0.27850329875946045,
0.05770755559206009,
0.17461299896240234,
-0.20842032134532928,
-0.3723457455635071,
-0.7588220834732056,
-0.013766642659902573,
0.5534524917602539,
-0.20932728052139282,
0.26729923486709... | |
you are building.
Use [`System.Timers.Timer`](http://msdn.microsoft.com/en-us/library/system.timers.timer.aspx) like the following example (also, make sure that you use a class level variable to prevent garbage collection, as stated in Tim Robinson's answer):
```
using System;
using System.Timers;
public class Timer... | [
0.5991871356964111,
0.05830509215593338,
0.05603346973657608,
-0.021959923207759857,
0.21003411710262299,
-0.08614835143089294,
0.4676453769207001,
-0.1908380091190338,
-0.43634217977523804,
-0.6109235882759094,
-0.1584533452987671,
0.4218851327896118,
-0.3288935422897339,
0.54443049430847... | |
in a long-running method,
// KeepAlive must be used to prevent the JIT compiler
// from allowing aggressive garbage collection to occur
// before the method ends. (See end of method.)
//System.Timers.Timer aTimer;
// Create a timer with a ten second interval.
aTimer ... | [
0.15634721517562866,
-0.13835503160953522,
0.2221253514289856,
-0.13168466091156006,
0.002749435370787978,
0.07386403530836105,
0.4881364405155182,
-0.35188817977905273,
-0.19509732723236084,
-0.2506052553653717,
0.03913862630724907,
0.2709875702857971,
-0.1637052595615387,
0.3348643481731... | |
Hook up the Elapsed event for the timer.
aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
// Set the Interval to 2 seconds (2000 milliseconds).
aTimer.Interval = 2000;
aTimer.Enabled = true;
Console.WriteLine("Press the Enter key to exit the program.");
Console.... | [
0.04736856371164322,
-0.24536561965942383,
0.7947934865951538,
-0.23996970057487488,
0.521344780921936,
0.21063530445098877,
0.31317561864852905,
-0.5457819700241089,
0.018165243789553642,
-0.3783756196498871,
-0.1911575198173523,
0.7189651131629944,
-0.20815140008926392,
0.022756146267056... | |
// KeepAlive to prevent garbage collection from occurring
// before the method ends.
//GC.KeepAlive(aTimer);
}
// Specify what you want to happen when the Elapsed event is
// raised.
private static void OnTimedEvent(object source, ElapsedEventArgs e)
{
Console.WriteLine("Th... | [
0.10511846840381622,
-0.33702999353408813,
0.5326982140541077,
-0.19160453975200653,
0.3368075489997864,
0.017283674329519272,
0.285704106092453,
-0.37876200675964355,
-0.056074220687150955,
-0.30297040939331055,
-0.05474553629755974,
0.6930556297302246,
-0.386597603559494,
0.1144623309373... | |
key to exit the program.
The Elapsed event was raised at 5/20/2007 8:42:27 PM
The Elapsed event was raised at 5/20/2007 8:42:29 PM
The Elapsed event was raised at 5/20/2007 8:42:31 PM
...
*/
```
If you choose [`System.Threading.Timer`](http://msdn.microsoft.com/en-us/library/system.threading.timer.aspx), you can use... | [
-0.4262060225009918,
-0.20018696784973145,
0.8023184537887573,
-0.11679250001907349,
0.23007044196128845,
0.3183775544166565,
0.32290956377983093,
-0.5699805021286011,
-0.21862506866455078,
-0.05215654894709587,
-0.14403343200683594,
0.729214608669281,
-0.26034078001976013,
0.2639745175838... | |
TimerCallback timerDelegate =
new TimerCallback(statusChecker.CheckStatus);
// Create a timer that signals the delegate to invoke
// CheckStatus after one second, and every 1/4 second
// thereafter.
Console.WriteLine("{0} Creating timer.\n",
DateTime.Now.ToSt... | [
0.11021412909030914,
-0.26986604928970337,
0.7502187490463257,
-0.034654997289180756,
0.3966290354728699,
-0.013459731824696064,
0.37199535965919495,
-0.5427744388580322,
-0.35310980677604675,
-0.5655836462974548,
-0.23084932565689087,
0.46247434616088867,
-0.16363485157489777,
0.392980039... | |
new Timer(timerDelegate, autoEvent, 1000, 250);
// When autoEvent signals, change the period to every
// 1/2 second.
autoEvent.WaitOne(5000, false);
stateTimer.Change(0, 500);
Console.WriteLine("\nChanging period.\n");
// When autoEvent signals the second time, dispose... | [
0.09082100540399551,
-0.33041006326675415,
0.6586892604827881,
-0.3103843927383423,
0.5804738402366638,
0.3876614570617676,
0.05158723145723343,
-0.22870415449142456,
-0.32920947670936584,
-0.6164177656173706,
-0.1470131278038025,
0.5881140232086182,
-0.02708636410534382,
0.449205815792083... | |
autoEvent.WaitOne(5000, false);
stateTimer.Dispose();
Console.WriteLine("\nDestroying timer.");
}
}
class StatusChecker
{
int invokeCount, maxCount;
public StatusChecker(int count)
{
invokeCount = 0;
maxCount = count;
}
// This method is called by the timer de... | [
0.11871451884508133,
-0.3233290910720825,
0.11535066366195679,
-0.20898647606372833,
0.5532900094985962,
0.31344395875930786,
0.2881584167480469,
-0.5126001834869385,
-0.21079622209072113,
-0.3090294301509857,
-0.08033833652734756,
0.7562904953956604,
-0.3577733337879181,
0.161780431866645... | |
AutoResetEvent autoEvent = (AutoResetEvent)stateInfo;
Console.WriteLine("{0} Checking status {1,2}.",
DateTime.Now.ToString("h:mm:ss.fff"),
(++invokeCount).ToString());
if(invokeCount == maxCount)
{
// Reset the counter and signal Main.
invokeCo... | [
-0.12114951759576797,
-0.26968416571617126,
0.9174624085426331,
-0.277828574180603,
0.520102322101593,
0.3001460134983063,
0.6794093251228333,
-0.43806615471839905,
-0.02782360650599003,
-0.36738282442092896,
-0.3451569974422455,
0.9592021703720093,
-0.20902416110038757,
0.2672055959701538... | |
autoEvent.Set();
}
}
}
```
Both examples comes from the MSDN pages. | [
-0.0168644767254591,
-0.13661052286624908,
-0.04460084065794945,
-0.09752092510461807,
0.17987558245658875,
-0.14473780989646912,
0.17030172049999237,
0.04473313316702843,
-0.23947492241859436,
-0.6216899156570435,
-0.43759140372276306,
0.7609936594963074,
-0.6967105269432068,
-0.192037031... | |
Why do database guys go on about normalisation?
What is it? How does it help?
Does it apply to anything outside of databases?
Normalization is basically to design a database schema such that duplicate and redundant data is avoided. If the same information is repeated in multiple places in the database, there is the... | [
0.21101143956184387,
-0.22178013622760773,
0.38679325580596924,
0.23175939917564392,
-0.15618959069252014,
-0.19663134217262268,
0.26201292872428894,
0.07880790531635284,
-0.29777345061302185,
-0.3142227232456207,
-0.25712141394615173,
0.042114485055208206,
-0.6118102073669434,
0.205875575... | |
because it is not about redundancy. 1NF disallows nested tables, more specifically columns which allows tables as values. Nested tables are not supported by SQL in the first place, so most normal relational databases will be in 1NF by default. So we can ignore 1NF for the rest of the discussions.
The normal forms 2NF ... | [
-0.11389277875423431,
0.19114872813224792,
0.414345383644104,
0.18293017148971558,
-0.18711340427398682,
-0.10272549092769623,
0.029499517753720284,
-0.13874371349811554,
-0.40780994296073914,
-0.44172465801239014,
-0.3638609051704407,
0.11691064387559891,
-0.39904698729515076,
0.174011781... | |
| Rock
Io | Jupiter | Gas
Europa | Jupiter | Gas
Ganymede | Jupiter | Gas
```
The redundancy is obvious: The fact that Jupiter is a gas planet is repeated three times, one for each moon. This is a waste of space, but much more seriously this schema makes *inconsistent* information possible:
```
Moon(PK) | Pl... | [
0.01219639740884304,
0.7142919898033142,
0.3748435378074646,
0.020438937470316887,
-0.19487886130809784,
0.5416204929351807,
-0.09014978259801865,
0.16215525567531586,
-0.33701759576797485,
-0.03323204442858696,
-0.4472268521785736,
0.37016165256500244,
-0.4289824068546295,
0.5727297663688... | |
no!
Ganymede | Jupiter | Gas
```
A query can now give inconsistent results which can have disastrous consequences.
(Of course a database cannot protect against *wrong* information being entered. But it can protect against *inconsistent* information, which is just as serious a problem.)
The normalized design would s... | [
0.021708611398935318,
0.4708232879638672,
0.7563653588294983,
0.37149372696876526,
-0.061666447669267654,
0.12662024796009064,
-0.18489380180835724,
-0.07708338648080826,
-0.5643671154975891,
-0.06332027167081833,
-0.3616088926792145,
0.1441017985343933,
-0.3938692510128021,
0.519880473613... | |
Jupiter | Gas
Io | Jupiter
Europa | Jupiter
Ganymede | Jupiter
```
Now no fact is repeated multiple times, so there is no possibility of inconsistent data. (It may look like there still is some repetition since the planet names are repeated, but repeating primary key values as foreign keys does not viol... | [
-0.014340223744511604,
0.326645165681839,
0.5741730332374573,
0.035427723079919815,
-0.04065494239330292,
0.31445956230163574,
-0.16109222173690796,
-0.059280745685100555,
-0.6580848097801208,
-0.08591781556606293,
-0.22189947962760925,
0.4393608272075653,
-0.4256848692893982,
0.5360485315... | |
it into more tables. For example the first table has 12 individual values, while the two tables only have 9 individual (non-FK) values. This means we eliminate 3 redundant values.
We know the same information is still there, since we can write a `join` query which return the same data as the original un-normalized tab... | [
-0.11366583406925201,
-0.06491834670305252,
0.648643970489502,
0.35351526737213135,
-0.13363423943519592,
0.19033095240592957,
-0.07001539319753647,
-0.18997713923454285,
-0.6699232459068298,
-0.4310196042060852,
-0.038730792701244354,
0.1001921072602272,
-0.24425333738327026,
0.4048208296... | |
key-association. Normalization issues happen when multiple entities with a one-to-many or many-to-many relationship are represented in the same table row.
**Is normalization it important?** Yes, it is *very* important. By having a database with normalization errors, you open the risk of getting invalid or corrupt data... | [
0.0340571366250515,
-0.164251446723938,
0.25162073969841003,
0.32673972845077515,
0.10795252025127411,
-0.3798485994338989,
0.2865781784057617,
0.1096443384885788,
-0.28974035382270813,
-0.4901062548160553,
-0.13636751472949982,
0.3902950882911682,
-0.36491963267326355,
0.32722949981689453... | |
is 3NF or 5NF which is violated is less important as long as the problem is fixed.
(There are also some additional normal forms like DKNF and 6NF which are only relevant for special purpose systems like data-warehouses.)
**Don't be scared of normalization**. The official technical definitions of the normalization lev... | [
0.2526407539844513,
-0.2051524519920349,
0.503399133682251,
0.27311110496520996,
-0.019540518522262573,
-0.5501402616500854,
0.4639270007610321,
0.1385185867547989,
-0.209043487906456,
-0.3578793406486511,
-0.28376907110214233,
0.3060586154460907,
-0.37625354528427124,
0.20921605825424194,... | |
that normalized databases are slower, and the denormalization improves performance. This is only true in very special cases however. Typically a normalized database is also the fastest.
* sometimes normalization is described as a gradual design process and you have to decide "when to stop". But actually the normalizati... | [
-0.013659261167049408,
-0.21748581528663635,
0.27651768922805786,
0.3740275502204895,
-0.00915947463363409,
-0.25686225295066833,
0.11286546289920807,
0.2865418493747711,
-0.3606267273426056,
-0.4168337285518646,
-0.06603484600782394,
0.27430686354637146,
-0.26810136437416077,
0.1896330714... | |
databases. However the general underlying theme - that you shouldn't have duplicate data if the different instances can get out of sync - can be applied broadly. This is basically the [DRY principle](http://www.artima.com/intv/dry.html). | [
0.4461677670478821,
-0.06823043525218964,
0.19958630204200745,
0.4672313928604126,
0.10126060992479324,
-0.17030537128448486,
0.09762246161699295,
0.05734606459736824,
-0.32937321066856384,
-0.40745410323143005,
-0.16570912301540375,
0.6171757578849792,
-0.5277409553527832,
0.2087714076042... | |
When starting a django application using `python manage.py shell`, I get an InteractiveConsole shell - I can use tab completion, etc.
```
Python 2.5.1 (r251:54863, Apr 15 2008, 22:57:26)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveCo... | [
-0.06368556618690491,
0.40671107172966003,
0.048365212976932526,
-0.10527727007865906,
-0.17107124626636505,
-0.39325952529907227,
0.5144962072372437,
-0.12682640552520752,
0.09610345959663391,
-0.49990445375442505,
0.03056439757347107,
0.7786689400672913,
-0.5200843214988708,
-0.198841825... | |
import readline
except ImportError:
print("Module readline not available.")
else:
import rlcompleter
readline.parse_and_bind("tab: complete")
```
then in your .bashrc file, add
```
export PYTHONSTARTUP=~/.pythonrc
```
That seems to work. | [
-0.0515279546380043,
-0.021624404937028885,
0.5400201082229614,
-0.41190963983535767,
-0.09983953833580017,
-0.289674311876297,
0.13477741181850433,
-0.26581114530563354,
-0.10407020896673203,
-0.12734229862689972,
-0.44225066900253296,
0.8380914926528931,
-0.35291218757629395,
-0.23776127... | |
I have a Spring Interceptor which attempts to add an HTTP header in the postHandle() method.
```
public void postHandle(HttpServletRequest req, HttpServletResponse resp,
Object obj1, ModelAndView mv)
throws Exception {
response.setHeader("SomeHeaderSet", "set");
response.addHeader... | [
0.28857848048210144,
0.07891309261322021,
0.5539902448654175,
-0.01735016517341137,
-0.3339499235153198,
0.02001720294356346,
0.4304485619068146,
-0.13866384327411652,
-0.07139915972948074,
-0.30504536628723145,
-0.02401800826191902,
0.33405038714408875,
-0.4182085394859314,
0.113785512745... | |
out, same issue with Jetty and Tomcat (figured MAYBE it was a container issue). So...
Debugged to ensure that the response object contained the correct header value up until Spring returned back to the container. Result: The HttpServletResponse instance still had the correct header value.
I found in my code I was inv... | [
0.11756591498851776,
-0.08704767376184464,
0.298042893409729,
-0.006487256847321987,
-0.21816052496433258,
-0.22916057705879211,
0.47509151697158813,
-0.12911765277385712,
-0.5245676636695862,
-0.19510996341705322,
-0.0025630926247686148,
0.5199103355407715,
-0.48176026344299316,
0.0429434... | |
headers. | [
0.1000208854675293,
-0.19315989315509796,
-0.1115063950419426,
0.35555219650268555,
0.028580980375409126,
-0.05834672227501869,
-0.05443013459444046,
0.13044384121894836,
-0.133052796125412,
-0.47649770975112915,
-0.15122194588184357,
0.10027254372835159,
-0.4045908451080322,
0.07665190100... | |
I'm using Castle ActiveRecord, but this question applies to NHibernate, too, since a solution that works with NHibernate should work for ActiveRecord. Anyway, what I have is an underlying table structure like this:
TableA -hasMany-> TableB
I have corresponding objects EntityA and EntityB. EntityA has an IList of Enti... | [
-0.23080001771450043,
0.2446421980857849,
0.5110447406768799,
-0.1735479235649109,
-0.11893019825220108,
-0.14791353046894073,
-0.06178576871752739,
-0.11316443234682083,
-0.23416493833065033,
-0.6366970539093018,
0.13308383524417877,
0.3188380300998688,
-0.3351633846759796,
0.192746281623... | |
is:
```
[BelongsTo("tableAid")]
public int ParentId { get; set; }
```
So, EntityB would store only the ID of the parent object, not a reference to the actual object. This is a trivial example, but I have good reasons for wanting to go with this approach. In the application I'm working on, we have pages that display ... | [
0.025142982602119446,
0.21928714215755463,
0.06454087793827057,
-0.025304431095719337,
-0.06121164187788963,
-0.3473165035247803,
-0.09950239211320877,
0.07402092218399048,
-0.011085057631134987,
-0.5956599712371826,
-0.20252159237861633,
0.25835418701171875,
-0.5228186249732971,
0.2117990... | |
It's not a huge deal, but it just seems wasteful. I know I can use lazy-loading, but again, that seems more like a hack to me...
I have tried flagging the foreign key with the [Property] attribute like so:
```
[Property]
public int ParentId { get; set; }
```
The problem with this approach is that EntityB.ParentId r... | [
0.02813899889588356,
-0.038945987820625305,
-0.09820813685655594,
-0.05452599376440048,
0.0011425019474700093,
-0.2895451486110687,
0.5004433393478394,
0.10538788139820099,
-0.06771822273731232,
-0.6108883023262024,
-0.1030704453587532,
0.7157163619995117,
-0.23806758224964142,
0.428398460... | |
want - and it's not a hack either, it's a well tested and baked in part of NHIbernate and an important tool when performance tuning any substantial NHibernate app.
If you were to mark your "parent" EntityA as lazy loaded, referring to EntityB.Parent.Id would not load EntityA at all (as behind the scenes NHIbernate has... | [
0.09710761159658432,
0.14934054017066956,
0.49503374099731445,
-0.014686506241559982,
-0.06562219560146332,
-0.20773647725582123,
-0.07842197269201279,
-0.060458727180957794,
-0.021000750362873077,
-0.553412675857544,
0.2496388703584671,
0.3577047288417816,
-0.1594497412443161,
0.151730120... | |
I have a PHP script that can encode a PNG image to a Base64 string.
I'd like to do the same thing using JavaScript. I know how to open files, but I'm not sure how to do the encoding. I'm not used to working with binary data.
You can use [`btoa()`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalSc... | [
0.2966454327106476,
0.3384692966938019,
0.09995206445455551,
-0.22436115145683289,
0.024913791567087173,
0.2839012145996094,
0.2004355937242508,
-0.008029691874980927,
-0.059918131679296494,
-0.706317126750946,
-0.08463035523891449,
0.6331957578659058,
-0.3959500789642334,
-0.0171655081212... | |
probably break](https://developer.mozilla.org/en-US/docs/Web/API/window.btoa#Unicode_Strings). This isn’t a problem *if* you’re actually treating the string as a byte array, but if you’re trying to do something else then you’ll have to encode it first.
* `atob()` returns a “string” where each character represents an 8-... | [
0.16379578411579132,
0.17069455981254578,
0.19871696829795837,
-0.008432196453213692,
0.13366492092609406,
-0.02516818605363369,
0.34499993920326233,
-0.1521308273077011,
-0.5091119408607483,
-0.2505550980567932,
-0.41490209102630615,
0.6983047723770142,
-0.5259019136428833,
-0.15384908020... | |
both `btoa()` and `atob()`, unless you support really outdated browsers.
Check here:
* <https://caniuse.com/?search=atob>
* <https://caniuse.com/?search=btoa> | [
0.021472269669175148,
0.10568508505821228,
-0.2640950679779053,
-0.18208783864974976,
-0.006145191844552755,
0.24090149998664856,
0.5175440311431885,
0.3408588469028473,
-0.1298649162054062,
-0.506838321685791,
-0.5346356630325317,
0.5462085604667664,
-0.16706416010856628,
-0.2314707487821... | |
A client asked me if I knew anything about the HOME development method. I, together with wikipedia and acronymfinder, drew a complete blank.
Has anyone here heard about a development method called HOME?
The best answer to this is to follow this link and read the shrt description of the method by the authors themselves... | [
0.5425333976745605,
0.33626776933670044,
0.10018964111804962,
-0.32370880246162415,
-0.11801844090223312,
0.006292767357081175,
0.1908421367406845,
-0.08488737791776657,
-0.2714594304561615,
-0.5159828662872314,
0.0004400351317599416,
0.29187503457069397,
0.37863975763320923,
0.10172002762... | |
```
$doba = explode("/", $dob);
$date = date("Y-m-d", mktime(0,0,0, $doba[0], $doba[1], $doba[2]));
```
The above code turns any date i pass through into 1999-11-30 and i know it was working yesterday. Date is correct when I echo $doba. Anyone have any ideas?
Cheers
What is the format of `$doba`? Remember `mktime`'... | [
0.16298218071460724,
0.20401257276535034,
0.13394500315189362,
-0.4574280381202698,
0.14138172566890717,
0.07104566693305969,
0.2281896322965622,
-0.1950623244047165,
-0.3028073012828827,
-0.04663057252764702,
-0.09018494933843613,
0.33890587091445923,
-0.30230382084846497,
0.3522580862045... | |
I recently converted a site from asp to CF. Unfortunately, alot of the old users had the "homepage" bookmarked. www.example.com/homepage.asp
Is there a sort of catch all way I could redirect any traffic from that page to the current index.cfm?
I would normally just delete those files, but the owner(s) wanted to keep ... | [
0.5084567070007324,
0.2624562382698059,
0.664099931716919,
-0.32223036885261536,
-0.24776311218738556,
-0.09706240892410278,
0.3482397198677063,
0.24366392195224762,
-0.4711238145828247,
-0.7314451932907104,
0.22637099027633667,
0.22665846347808838,
-0.22293800115585327,
0.3208480179309845... | |
What is the best way to implement the page view counter like the ones they have here on the site where each question has a "Views" counter?
Factoring in Performance and Scalability issues.
The counter i optimized works like this:
```
UPDATE page_views SET counter = counter + 1 WHERE page_id = x
if (affected_rows == 0... | [
0.18284888565540314,
-0.13225755095481873,
0.6657859683036804,
-0.004844409413635731,
-0.145480677485466,
0.13148273527622223,
0.07378654181957245,
-0.5274195075035095,
-0.11840759217739105,
-0.7448602914810181,
0.12954474985599518,
0.8160972595214844,
-0.4704506993293762,
-0.0182046201080... | |
Say I have a class called PermissionManager which should only exist once for my system and basically fulfills the function of managing various permissions for various actions in my application. Now I have some class in my application which needs to be able to check a certain permission in one of its methods. This class... | [
0.4346208870410919,
0.291635125875473,
0.2028103768825531,
0.04791507124900818,
0.04653952643275261,
-0.26193538308143616,
0.3255617916584015,
-0.06505690515041351,
-0.18584807217121124,
-0.3625633716583252,
0.0884348526597023,
0.5721938610076904,
-0.2735939025878906,
0.5700464844703674,
... | |
was wondering what the better solution would be, since the arguments I have read against singletons seem to make sense (not testable, high coupling, etc.).
So should I actually require API users to pass in a PermissionManager instance in the constructor of the class? Even though I only want a single PermissionManager ... | [
0.5484595894813538,
-0.1270034909248352,
-0.37528830766677856,
-0.0974549725651741,
-0.04701445996761322,
-0.06853097677230835,
0.48236894607543945,
-0.08784686028957367,
-0.1884329617023468,
-0.7195294499397278,
0.06076909601688385,
0.6821495890617371,
-0.3894757628440857,
0.2166997790336... | |
any DI framework like Guice or Spring. (...yet)
If you are using a dependency-injection framework, then the common way to handle this is to either pass in a PermissionsManager object in the constructor or to have a property of type PermissionsManager that the framework sets for you.
If this is not feasible, then havi... | [
0.2714574933052063,
-0.31651878356933594,
-0.03200562298297882,
0.17321449518203735,
-0.13745583593845367,
-0.045722898095846176,
0.11421483010053635,
-0.34991908073425293,
0.12818656861782074,
-0.6387591361999512,
-0.10601085424423218,
0.4617540240287781,
-0.2938852608203888,
0.2401124387... | |
the PermissionManager.
You are correct that it is normally unwieldy for the clients of a class to know where to find the correct PermissionManager instance and pass it in (or even to care about the fact that your class uses a PermissionManager).
One compromise solution I've seen is to give your class a property of ty... | [
0.03754209354519844,
-0.22908931970596313,
-0.09852764755487442,
0.22782492637634277,
0.04629458114504814,
-0.2552950084209442,
0.3026508390903473,
-0.4037274718284607,
-0.010037454776465893,
-0.720826268196106,
-0.21755149960517883,
0.8152214288711548,
-0.4790623188018799,
0.2148005515336... | |
strictly speaking, your PermissionManager should implement some kind of IPermissionManager interface, and **that's** what your other class should reference so a dummy implementation can be substituted more easily during testing. | [
0.48560771346092224,
-0.2761402428150177,
-0.21712958812713623,
0.3605293929576874,
0.021957436576485634,
-0.6691044569015503,
0.20321473479270935,
-0.08330538123846054,
-0.08228927850723267,
-0.5888270139694214,
-0.08420387655496597,
0.538942813873291,
-0.2789095938205719,
-0.154253795742... | |
I want to do something like this:
```
const
MyFirstConstArray: array[0..1] of string = ('Hi', 'Foo');
MySecondConstArrayWhichIncludesTheFirstOne: array[0..2] of string =
MyFirstConstArray + ('Bar');
```
Basically I want the following result:
```
MyFirstConstArray -> ('Hi', 'Foo');
MySecondConstArrayWhichI... | [
0.20896965265274048,
0.27777767181396484,
0.713172435760498,
-0.2241700142621994,
0.1300717294216156,
-0.051752954721450806,
0.36527732014656067,
-0.46407976746559143,
0.07015480101108551,
-0.11238771677017212,
-0.03371104970574379,
0.6406702399253845,
-0.5452332496643066,
0.21337991952896... | |
of string =
(MyConst1, MyConst2, MyConst3);
```
BTW, your syntax is incorrect, you have to precise the type of the array elements. | [
-0.07861156761646271,
0.13374443352222443,
0.17925745248794556,
-0.18684592843055725,
0.1495557427406311,
-0.10458653420209885,
0.2695768177509308,
-0.32970497012138367,
0.0818498283624649,
-0.3986588418483734,
-0.23962467908859253,
0.33886685967445374,
-0.4639047086238861,
0.0407456941902... | |
On Linux, feenableexcept and fedisableexcept can be used to control the generation of SIGFPE interrupts on floating point exceptions. How can I do this on Mac OS X Intel?
Inline assembly for enabling floating point interrupts is provided in <http://developer.apple.com/documentation/Performance/Conceptual/Mac_OSX_Numer... | [
0.11627130955457687,
-0.1825650930404663,
0.4365074932575226,
0.17602083086967468,
0.039535462856292725,
-0.19432313740253448,
0.00542587460950017,
-0.22381491959095,
-0.2043754905462265,
-0.791338324546814,
-0.07249563187360764,
0.876508355140686,
-0.18799787759780884,
0.14373205602169037... | |
I've recently been lifted out of the .Net world into the Java world and I miss my unit tests.
Using Visual Studio I used NUnit and TestDriven.net to run my unit tests.
What is a comparable system for Java Using Eclipse?
I'm looking specifically for the plugins that will get me going, or a guide on how to do it.
I'm... | [
0.40123251080513,
-0.04683894291520119,
0.011460479348897934,
-0.15905940532684326,
-0.3321780264377594,
-0.09477284550666809,
-0.007466399576514959,
-0.039360854774713516,
-0.10704955458641052,
-1.0020971298217773,
0.4265521764755249,
0.5443770289421082,
0.07776754349470139,
-0.0202503297... | |
with them all.
**UPDATE**
Okay I didn't know that JUnit was built into the IDE. Are there any plugins that make using JUnit any easier?
Using JUnit with eclipse is actually very easy. Just go to File->New... and select JUnit Test Case. Eclipse will handle adding the JUnit library and all of the imports. | [
0.657296895980835,
-0.1992156058549881,
0.05578973889350891,
0.23303325474262238,
-0.4930351972579956,
-0.29052355885505676,
-0.10118419677019119,
0.019514523446559906,
0.08600928634405136,
-0.8481479287147522,
0.16920341551303864,
0.9475753903388977,
-0.18556363880634308,
-0.2083546221256... | |
My team is considering building our next web app using the ASP.NET MVC framework. I am slightly hesitant, as are some others, because it is still only in beta. I really want to dive in because it seems to be a great way of providing clear separation of concerns and improving testability.
Should I take the plunge now,... | [
0.7013826966285706,
0.08034943044185638,
0.11039446294307709,
-0.13856253027915955,
0.0850464478135109,
-0.13702304661273956,
0.130862757563591,
0.08751512318849564,
-0.25432491302490234,
-0.5129122734069824,
0.12165579944849014,
0.4512082636356354,
0.06976990401744843,
0.11019668728113174... | |
webforms vs. mvc. The concern is mainly because of the fear that we end up using some functionality in the beta version that gets changed / deprecated / not supported in the final release.
However, I do appreciate the perspective on webforms vs. mvc. It just doesn't get at the heart of my question.
It's a pretty simpl... | [
0.5398756861686707,
-0.09254174679517746,
0.36249396204948425,
0.16302795708179474,
-0.43124833703041077,
-0.15274424850940704,
-0.16156242787837982,
-0.2804560363292694,
-0.06446466594934464,
-0.8086984157562256,
0.07140590250492096,
0.6451877951622009,
-0.4181183874607086,
0.121023252606... | |
(ViewState)
* Don't mind PostBack model
* Prefer components that you can "drag & drop" on a page
For me, the answer will 99% be ASP.NET MVC, because I think it is a much better match for the web. I think the ajax story is much cleaner as well, and I have complete control over my HTML & URLs. On top of all of that, I c... | [
0.3439556062221527,
0.15444660186767578,
0.40241381525993347,
0.35131701827049255,
-0.34514865279197693,
-0.05197087302803993,
0.1133878231048584,
-0.022911831736564636,
-0.18128278851509094,
-0.8610605597496033,
0.07145140320062637,
0.6057868003845215,
0.015767890959978104,
-0.04816524684... | |
in WebForms, but these are all off-the-beaten path approaches. With ASP.NET MVC this stuff is core. That's just the way you do it.
And don't worry about the preview/beta status. The team has always maintained that you don't need a go-live license to deploy it (even though they now offer one). It's purely additive on t... | [
0.8767852783203125,
-0.2608920633792877,
-0.027614571154117584,
-0.137122243642807,
-0.024604549631476402,
-0.4633416533470154,
-0.07112792134284973,
0.27904510498046875,
0.22461678087711334,
-0.4307735562324524,
0.2178817093372345,
0.5899825692176819,
-0.21223177015781403,
-0.043800145387... | |
I'm trying to upload documents to SharePoint using web services attaching custom metadata to the files. I've searched but have not found a good tutorial covering all these topics. Can anybody point me in the right direction?
Here's why I think I need to use web services:
I'm developing on XP and the Sharepoint object ... | [
0.39932775497436523,
0.44688475131988525,
0.18467754125595093,
0.16054195165634155,
-0.10253603756427765,
-0.29224613308906555,
0.2553170919418335,
0.03938926011323929,
-0.2929428517818451,
-0.8061066269874573,
0.08975673466920853,
0.44521859288215637,
0.017979532480239868,
0.3763637542724... | |
sure what my sourceURL should be. Also, since I can't use "Microsoft.Sharepoint" references, I'm wondering what my Fields will look like? (Is this my metadata?) Also, I'm curious as to why only Website projects allow me to add a web service.
Once the file is "in" Sharepoint using that web service, I'll have to use anot... | [
0.7552059888839722,
0.19165992736816406,
0.23820489645004272,
0.1505306512117386,
0.029498238116502762,
-0.4867517054080963,
-0.20133881270885468,
0.3188895881175995,
-0.09484752267599106,
-0.600185215473175,
0.24778622388839722,
0.36297857761383057,
-0.06525453180074692,
0.179285630583763... | |
way because Microsoft wrote it that way :). Some people have written custom web services that combine them, <http://www.sharepointblogs.com/ssa/archive/2006/11/30/wsuploadservice-web-service-for-uploading-documents-into-sharepoint.aspx>
Using the built in web services you have to upload the file and upload CAML which ... | [
0.5822275280952454,
0.000028529542760225013,
0.5302258729934692,
0.2814056873321533,
0.40342918038368225,
-0.27853313088417053,
-0.04885478690266609,
0.06124165281653404,
-0.3879632353782654,
-0.49099934101104736,
0.05508499592542648,
0.37143874168395996,
-0.20170611143112183,
-0.022632492... | |
FORTRAN provides several functions to convert a double precision number to an integral value. The method used for truncation/rounding differs. I am converting complex scientific algorithms which use these.
According to FORTRAN documentation:
**aint(x)** returns the integral value between x and 0, nearest x.
**an... | [
-0.2839885652065277,
-0.07267902046442032,
0.24393634498119354,
-0.24240967631340027,
-0.3157631754875183,
0.11639894545078278,
0.09584656357765198,
-0.49349504709243774,
-0.052610233426094055,
-0.3200373947620392,
0.0957380086183548,
0.5891132354736328,
-0.15191063284873962,
-0.1569174230... | |
tricky getting it right.
(int)x appears to match aint()
Convert.ToInt32(x) does not match any of the above.
Trunc(x) does not match any of the above.
Round(x) might match anint or nint.
The difference between anint and nint seems to be the return type, where anint returns a double precision value but nint... | [
-0.3338462710380554,
-0.24805448949337006,
0.18232987821102142,
-0.08010230213403702,
-0.14027683436870575,
0.02353500947356224,
0.2525905966758728,
-0.4171820282936096,
-0.0963030457496643,
-0.06925440579652786,
-0.030721213668584824,
0.8105152249336243,
-0.1441904902458191,
-0.1860976368... | |
help clarify why the author chose to use both (I am assuming it was intentional).
From your definitions of the calls, **`nint`** and **`anint`** are provided by `Math.Round` using `MidpointRounding.AwayFromZero`.
For **`aint`**, an explicit cast from `double` to `int` will achieve that result. | [
0.09723511338233948,
0.09314575046300888,
-0.038129109889268875,
-0.08964546024799347,
-0.06105223298072815,
0.07960493862628937,
0.27618181705474854,
-0.30568060278892517,
0.04747401922941208,
-0.2953766882419586,
-0.05597556754946709,
0.6486548185348511,
-0.2646730840206146,
-0.127452865... | |
I have an app that is failing on the install. The vendor says I probably have ini\_set() disabled. How can I check this?
I did some research on this, and it turns out that sometimes ini\_set will not return FALSE, but an empty string. This is mentioned in the URL pointed out by gabriel1836. The best way to check if it ... | [
0.341976135969162,
0.1537870466709137,
0.040770672261714935,
-0.10413748770952225,
-0.0293277520686388,
-0.15921056270599365,
0.88923579454422,
-0.08942755311727524,
0.0018423961009830236,
-0.6018479466438293,
-0.2104947417974472,
0.5938229560852051,
-0.3960377275943756,
0.0061813034117221... | |
local column, then you know ini\_set works. | [
-0.15327683091163635,
-0.11470959335565567,
0.3096843957901001,
-0.10900475829839706,
0.00895976647734642,
0.15264029800891876,
0.062283825129270554,
0.23178282380104065,
0.04663047194480896,
-0.7903389930725098,
-0.08551611751317978,
0.6047724485397339,
-0.19323469698429108,
-0.2218946069... | |
I was under the impression that I could run it on any machine, but a guy from our hosting company is saying that the csr has to be generated on the server hosting the site.
Can anyone clear this one up for me?
Thanks.
The bottom line is you do not need to generate CSRs on the server hosting an SSL certificate. A CSR ... | [
0.7043143510818481,
0.3140070140361786,
0.01720683090388775,
0.3624659776687622,
-0.04360280930995941,
-0.46047332882881165,
0.02899182215332985,
0.3084384799003601,
-0.2349705994129181,
-0.5253918766975403,
0.0022934740409255028,
0.23382054269313812,
-0.17752061784267426,
0.13126374781131... | |
the key into the keychain. See if this [KeyTool and OpenSSL tips](http://conshell.net/wiki/index.php/Keytool_to_OpenSSL_Conversion_tips) helps. | [
0.08073566854000092,
-0.1962076723575592,
0.7956345677375793,
0.10631123930215836,
0.24448750913143158,
-0.23092050850391388,
-0.015760479494929314,
-0.5038638710975647,
-0.043303027749061584,
-0.39101946353912354,
-0.3393747806549072,
0.5482304692268372,
0.02006867341697216,
-0.1743011325... | |
A quick search gives me [tawbaware wc](http://www.tawbaware.com/wc.htm), but it does not accept stdout as input stream, meaning I can not use pipe within a *DOS* session.
*Note:*
I can not install cygwin or use powershell (which would have allowed a '`|foreach-object {(get-content $_).count}`')
[unxutils](http://un... | [
0.5181389451026917,
0.03858416527509689,
0.37228646874427795,
-0.024274064227938652,
-0.1415526419878006,
-0.33145418763160706,
0.4932207763195038,
-0.20793721079826355,
-0.038627155125141144,
-0.9290815591812134,
0.10228344053030014,
0.545871376991272,
-0.305107980966568,
0.39933049678802... | |
It seems like there is a lot of overhead involved in rapidly opening and closing sqlconnections. Should I persist a connection (one, per client, per database), or continue declaring a new sqlconnection object whenever I need one, and making sure I clean up after myself?
What have you done? What worked well and what wo... | [
0.35223284363746643,
0.13189920783042908,
0.13905182480812073,
0.2533942759037018,
0.03754016011953354,
-0.3699837923049927,
0.14451158046722412,
0.14086587727069855,
-0.5072667002677917,
-0.48992976546287537,
0.03858906030654907,
0.3868894577026367,
-0.06379932165145874,
0.335452616214752... | |
connectionstring and gives you that instead. When you close the connection, it returns to the connection pool for future use.
If you're using SQL Server: <http://msdn.microsoft.com/en-us/library/8xx3tyca.aspx>
OLE DB, ODBC, Oracle: <http://msdn.microsoft.com/en-us/library/ms254502.aspx>
Dino Esposito article: <http:... | [
-0.06837445497512817,
-0.27943864464759827,
0.36578813195228577,
0.2774050831794739,
0.1955670863389969,
-0.2509484589099884,
-0.20928457379341125,
-0.03046637400984764,
-0.5408973097801208,
-0.6624455451965332,
-0.11087632179260254,
0.3947739601135254,
-0.23455467820167542,
0.485762715339... | |
One of the "best practice" is accessing data via stored procedures. I understand why is this scenario good.
My motivation is split database and application logic ( the tables can me changed, if the behaviour of stored procedures are same ), defence for SQL injection ( users can not execute "select \* from some\_tables"... | [
-0.07293883711099625,
0.047711893916130066,
0.09104576706886292,
0.09140854328870773,
-0.1540694385766983,
-0.296866238117218,
0.21924230456352234,
-0.18900921940803528,
-0.2530158758163452,
-0.6968117356300354,
-0.03250092640519142,
0.7160496115684509,
-0.5705755949020386,
-0.000853898294... | |
TABLE tblProduct (
ProductID uniqueidentifier -- PK
, IDProductType uniqueidentifier -- FK to another table
, ProductName nvarchar(255) -- name of product
, ProductCode nvarchar(50) -- code of product for quick search
, Weight decimal(18,4)
, Volume decimal(18,4)
)
```
then I should create 4 stored ... | [
0.030729081481695175,
0.29975783824920654,
0.5679733157157898,
-0.09559359401464462,
0.15948918461799622,
0.6150846481323242,
-0.24906864762306213,
-0.5015957951545715,
-0.08718249946832657,
-0.34614264965057373,
0.055474650114774704,
0.061149146407842636,
-0.27557092905044556,
0.057078029... | |
... etc ... )
END
```
The stored procedure for "delete" is easy too.
```
CREATE PROC Delete_Product ( @ProductID uniqueidentifier, @IDProductType uniqueidentifier, ... etc ... ) AS BEGIN
DELETE tblProduct WHERE ProductID = @ProductID AND IDProductType = @IDProductType AND ... etc ...
END
```
The stored procedu... | [
-0.10842878371477127,
0.17553706467151642,
0.7667019367218018,
-0.4293420910835266,
0.0593549981713295,
0.39524880051612854,
-0.0283470768481493,
-0.40260493755340576,
-0.043837498873472214,
-0.5807185769081116,
-0.23330657184123993,
0.3124663531780243,
-0.443386048078537,
0.11944504827260... | |
etc ...
WHERE ProductID = @Original_ProductID AND IDProductType = @Original_IDProductType AND ... etc ...
END
```
And the last - stored procedure for "read" is littlebit mystery for me. How pass filter values for complex conditions? I have a few suggestion:
Using XML parameter for passing where condition:
```... | [
-0.029696958139538765,
0.0325574167072773,
0.5479776859283447,
-0.2701129615306854,
0.07432074099779129,
0.22585280239582062,
-0.022320015355944633,
-0.44734227657318115,
-0.05546950921416283,
-0.5733515024185181,
-0.24366962909698486,
0.4301473796367645,
-0.43728402256965637,
0.1456376016... | |
with WHERE condition from passed XML
DECLARE @LEN_SELECT int
SET @LEN_SELECT = LEN( @SELECT )
DECLARE @LEN_WHERE int
SET @LEN_WHERE = LEN( @WHERE )
DECLARE @LEN_TOTAL int
SET @LEN_TOTAL = @LEN_SELECT + @LEN_WHERE
IF @LEN_TOTAL > 4000 BEGIN
-- RAISE SOME CONCRETE ERROR, BECAUSE DYNAM... | [
0.014074161648750305,
-0.5003535151481628,
0.28603529930114746,
-0.08181747794151306,
-0.23899488151073456,
0.4410160183906555,
0.03613170236349106,
-0.5586241483688354,
-0.3572615683078766,
-0.1620795875787735,
-0.10650542378425598,
0.4614233672618866,
-0.17221683263778687,
-0.06671662628... | |
EXEC sp_execsql @SQL
END
```
But, I think the limitation of "4000" characters for one query is ugly.
The next suggestion is using filter tables for every column. Insert filter values into the filter table and then call stored procedure with ID of filters:
```
CREATE TABLE tblFilter (
PKID uniqueidentifier -- PK
... | [
-0.054632194340229034,
-0.15172651410102844,
0.6875913143157959,
0.0828457623720169,
-0.09440767019987106,
0.1331925094127655,
-0.13440057635307312,
-0.44513028860092163,
-0.1151244193315506,
-0.7617400288581848,
0.09790360182523727,
0.2071142941713333,
-0.36612409353256226,
-0.14834652841... | |
NVarCharValue nvarchar(4000)
, GuidValue uniqueidentifier, etc ... )
CREATE TABLE Read_Product ( @Filter_ProductID uniqueidentifier, @Filter_IDProductType uniqueidentifier, @Filter_ProductName uniqueidentifier, ... etc ... ) AS BEGIN
SELECT ProductID, IDProductType, ProductName, ProductCode, Weight, Volume
FR... | [
-0.24280865490436554,
-0.08807391673326492,
0.5395424962043762,
-0.3301321864128113,
-0.12856347858905792,
0.47024431824684143,
-0.25957736372947693,
-0.7592820525169373,
-0.027842694893479347,
-0.8278002738952637,
-0.01625012420117855,
0.25333645939826965,
-0.17020590603351593,
0.22123149... | |
AND ( @Filter_IDProductType IS NULL
OR ( ( IDProductType IN ( SELECT GuidValue FROM tblFilter WHERE IDFilter = @Filter_IDProductType AND FilterType = 1 ) AND NOT ( IDProductType IN ( SELECT GuidValue FROM tblFilter WHERE IDFilter = @Filter_IDProductType AND FilterType = 2 ) )
AND ( @Filter_ProductName... | [
0.1881140023469925,
-0.2293965071439743,
0.37094995379447937,
-0.29044783115386963,
0.25022637844085693,
-0.04488226771354675,
0.10767517983913422,
-0.3632458746433258,
0.11802525818347931,
-0.6223475933074951,
-0.2369478940963745,
0.6298561692237854,
-0.5130594968795776,
0.018313521519303... | |
include the primary key.
Second: for your update routine, do not try to optimize before you have working code. In fact, do not try to optimize until you can profile your application and see where the bottlenecks are. I can tell you for sure that updating one column of one row and updating all columns of one row are ne... | [
0.24349306523799896,
0.05469997599720955,
0.2555195689201355,
0.05877131596207619,
0.09227859973907471,
-0.34334856271743774,
0.43187636137008667,
-0.2579229474067688,
0.014623587019741535,
-0.7626032829284668,
-0.3389264941215515,
0.8544806838035583,
-0.48420050740242004,
0.09565206617116... | |
only the columns that need to change will generally be harder to do and harder to maintain. If you really wanted to get picky, you'd have to compare the speed of figuring out which columns changed compared with just updating every column. If you update them all, you don't have to read any of them.
Third: I tend to wri... | [
0.03257816284894943,
0.06264986097812653,
0.24901363253593445,
0.037287212908267975,
-0.07052234560251236,
0.2993091940879822,
0.037377387285232544,
-0.1866839975118637,
-0.29059067368507385,
-0.6685498356819153,
0.14352180063724518,
0.5562639236450195,
-0.350529283285141,
-0.2214595824480... | |
write code you don't need. I also agree with using views instead of stored procedures, however, you can use a stored procedure to return multiple result sets (in some version of MSSQL) or to change rows into columns, which can be useful.
If you need to get, for example, 7 rows by primary key, you have some options. Yo... | [
0.3086759150028229,
0.00026165624149143696,
0.2446594536304474,
0.09580938518047333,
0.003609821666032076,
0.23072850704193115,
0.47710493206977844,
-0.034288834780454636,
-0.2757357358932495,
-0.8012450933456421,
0.16847455501556396,
0.6253655552864075,
-0.41151776909828186,
-0.0392449870... | |
of IDs at a time, you can write a stored procedure that includes a where clause like "and ID in (arg1, arg2, arg3...)" and make sure that unused arguments are set to NULL. If you decide you need to generate dynamic SQL, I wouldn't bother with a stored procedure because TSQL is just as easy to make a mistake as any othe... | [
0.28666797280311584,
0.05131163448095322,
-0.09223657101392746,
0.14073477685451508,
-0.2565053105354309,
-0.14474855363368988,
0.24046136438846588,
-0.2642243504524231,
-0.03133489936590195,
-0.41441500186920166,
0.13356105983257294,
0.4308561682701111,
-0.4023873209953308,
0.079044803977... | |
I'm using several variants of the Validator controls (RequiredFieldValidator, CompareValidator, etc) and am using the CssClass property of the validator. I can see (via Firebug) that the class is being applied, but the validator control itself is adding a style element to it, namely color: red. But I don't want that. I... | [
0.4878643751144409,
0.08406615257263184,
0.5116690397262573,
-0.061442386358976364,
-0.05984929949045181,
-0.10902412980794907,
0.15080301463603973,
-0.09562201797962189,
0.08772800117731094,
-0.6891265511512756,
0.10074453055858612,
0.7609747648239136,
-0.15579964220523834,
0.096471533179... | |
change all the error message appearances in the future.
Anyone have any clues how to tell the Validator controls to NOT use their default styles?
You can do this in your css file:
```
.validator
{
color: blue !important;
}
```
This will override the inline red style. | [
0.30881157517433167,
0.10350039601325989,
0.21627114713191986,
0.0923958271741867,
0.1623958796262741,
-0.2057924121618271,
0.5002887845039368,
0.41679826378822327,
-0.2009160816669464,
-0.8073186874389648,
-0.09191346168518066,
0.6488730907440186,
-0.3697497546672821,
-0.14045587182044983... | |
Is there a better way to implement copy construcor for matlab for a handle derived class other than adding a constructor with one input and explicitly copying its properties?
```
obj.property1 = from.property1;
obj.property2 = from.property2;
```
etc.
Thanks,
Dani
If you want a quick-and-dirty solution that assum... | [
0.08276732265949249,
-0.11129701137542725,
0.24120327830314636,
0.2763071060180664,
-0.1631452739238739,
-0.0654526799917221,
0.03182882070541382,
-0.2147977203130722,
-0.21108730137348175,
-0.36525437235832214,
0.0574013814330101,
0.6716983914375305,
-0.2616378664970398,
0.261005342006683... | |
default constructor
F.a = rand(1);
else
% copy constructor
fns = properties(rhs);
for i=1:length(fns)
F.(fns{i}) = rhs.(fns{i});
end
end
end
end
end
```
and some test code:
```
f = Foo(); [f.a Foo(f).a] % should print 2 floats with the same value.
... | [
0.15079836547374725,
0.24392373859882355,
0.30368825793266296,
0.021843770518898964,
0.1907372772693634,
-0.01786140725016594,
0.26382365822792053,
-0.7510775327682495,
0.08617951720952988,
-0.41659611463546753,
-0.013079111464321613,
0.7816815972328186,
-0.191048264503479,
0.2436806410551... | |
I have a JAX-RPC (Java) web service that needs to return a complex polymorphic value. To be more specific, the class structure is something like this:
```
abstract class Child {
}
class Question extends Child {
private String name;
// other fields, getters, and setters
}
class Section extends Child {
pri... | [
0.21536216139793396,
0.2163303792476654,
0.003895648056641221,
0.09008528292179108,
-0.0819290429353714,
0.08248957246541977,
-0.005663381423801184,
-0.3107896149158478,
0.20460009574890137,
-0.5252265334129333,
0.07610839605331421,
0.38857993483543396,
-0.16972237825393677,
0.201004981994... | |
Questions and Sections which may contain Questions and other Sections, and so on and so forth. However, when I generate the WSDL, only Child and Quiz make it in. When I call the web service, I get back a Quiz element with the right number of children, but they're all Child elements, and they're all empty.
Is there a g... | [
0.3409138023853302,
-0.2005840390920639,
0.25402456521987915,
0.35738083720207214,
0.028979124501347542,
-0.09141520410776138,
-0.10720378905534744,
-0.22833149135112762,
-0.06546948850154877,
-0.5614949464797974,
-0.1455652117729187,
0.40677085518836975,
-0.20458844304084778,
-0.089749090... | |
well (sounds similar--a project you are taking over from somebody else). The push-back often comes from the user side. They are used to being able to select from a list of items. Unfortunately as the database grows, this becomes less and less feasible.
But when you have 0.5MB of html downloaded on the page (not includ... | [
0.326762855052948,
-0.2555907368659973,
0.41230931878089905,
0.19553403556346893,
-0.1875196248292923,
-0.2915848195552826,
0.22892022132873535,
0.10580457746982574,
-0.4612250030040741,
-0.5848655104637146,
-0.13635940849781036,
0.36780083179473877,
-0.39864081144332886,
0.145625293254852... | |
I have created a setup project using Visual Studio 2008. After the application is finished installing, I would like to have it start up immediately. Any thoughts on how this can be done?
I have used a custom action in [VS 2005](http://www.codeproject.com/KB/install/Installation.aspx). Not sure if this is enhanced in VS... | [
0.9701932072639465,
-0.134514719247818,
0.05555984005331993,
-0.2527254521846771,
-0.1848699301481247,
-0.19472819566726685,
0.08395066112279892,
-0.04371720552444458,
-0.28884896636009216,
-0.6385092735290527,
-0.063128262758255,
0.8208821415901184,
-0.11218336969614029,
-0.34651824831962... | |
We are using Team City and I noticed problem during running Watin test. Sometimes some instance of IE randomly just don't stop in task manager on build server, even if test closes all opened instances. This causes failure of all tests that follows.
We tried with script that kills all instances of ie before this test st... | [
0.39882194995880127,
-0.07523199170827866,
-0.06338920444250107,
0.10530953109264374,
-0.23336094617843628,
-0.40049034357070923,
0.5807401537895203,
-0.1455501914024353,
0.2793247103691101,
-0.9143418669700623,
0.17010562121868134,
0.6168885827064514,
-0.26114776730537415,
-0.039059784263... | |
solution is documented here:
<http://codebetter.com/blogs/james.kovacs/archive/2008/06/18/running-watin-tests-on-vista.aspx>
I think you could be having the same issue. | [
0.3504261076450348,
0.1463576853275299,
-0.015131230466067791,
0.022392522543668747,
0.30079272389411926,
-0.22965502738952637,
0.7368535995483398,
-0.4334352910518646,
-0.1865076869726181,
-0.4495032727718353,
0.20678459107875824,
0.577825665473938,
-0.025745192542672157,
0.08762975782155... | |
Does anyone know of a script that can select all text references to URLs and automatically replace them with anchor tags pointing to those locations?
```
For example:
http://www.google.com
would automatically turn into
<a href="http://www.google.com">http://www.google.com</a>
```
Note: I am wanting this because ... | [
0.34789371490478516,
0.07977578043937683,
0.27014556527137756,
0.1600821167230606,
-0.11837157607078552,
-0.3045004606246948,
0.01619921252131462,
0.09334032982587814,
-0.27604177594184875,
-0.488226056098938,
-0.15053576231002808,
0.6344687938690186,
-0.10789584368467331,
0.08238030225038... | |
guy should have you covered](https://stackoverflow.com/questions/37684/replace-url-with-html-links-javascript). | [
0.10162258893251419,
-0.16821572184562683,
0.5443411469459534,
0.05644167587161064,
0.1359470784664154,
-0.5318871736526489,
0.2904946506023407,
-0.2004442662000656,
-0.5172734260559082,
-0.02666771039366722,
-0.14031705260276794,
0.3007417619228363,
-0.21533970534801483,
-0.22709853947162... | |
I'm loading data into a DataSet from an XML file using the ReadXml method. This results in two tables with the same name. One of the tables has a namespace and the other doesn't. I'm trying to reference the table with the namespace. Can anyone tell me how to do this?
```
Dim reader As XmlTextReader = New XmlTextRe... | [
0.27004459500312805,
-0.22032161056995392,
0.9630827307701111,
0.1270367056131363,
-0.20922203361988068,
-0.14449068903923035,
0.04705929383635521,
-0.3356761038303375,
-0.22695985436439514,
-0.7893629670143127,
-0.20778974890708923,
0.3866083323955536,
-0.31200626492500305,
0.325716644525... | |
city = ds.Tables("Address").Rows(0).Item(2).ToString()
```
Browsers (and Dashcode) provide an XMLHttpRequest object which can be used to make HTTP requests from JavaScript:
```
function httpGet(theUrl)
{
var xmlHttp = new XMLHttpRequest();
xmlHttp.open( "GET", theUrl, false ); // false for synchronous request... | [
0.4085087478160858,
-0.355439692735672,
0.7884102463722229,
0.0716281607747078,
-0.2764803171157837,
-0.10352908819913864,
0.6080582141876221,
-0.15085145831108093,
-0.1612805724143982,
-0.719994843006134,
-0.35383614897727966,
0.22122129797935486,
-0.6988919973373413,
0.17743703722953796,... | |
asynchronous request and handle the response inside an event handler.
```
function httpGetAsync(theUrl, callback)
{
var xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = function() {
if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
callback(xmlHttp.responseText);
}
... | [
-0.113229900598526,
-0.40581241250038147,
0.6812641024589539,
-0.07354336231946945,
-0.13395169377326965,
0.1316104382276535,
0.2504845857620239,
-0.4324992299079895,
-0.23772133886814117,
-0.4492013156414032,
-0.7722223401069641,
0.6590611934661865,
-0.36821988224983215,
-0.09605488181114... | |
SSIS 2005/2008 does fuzzy lookups and groupings. Is there a feature that does the same in T-SQL?
Fuzzy lookup uses a q-gram approach, by breaking strings up into tiny sub-strings and indexing them. You can then then search input by breaking it up into equally sized strings. You can inspect the format of their index and... | [
-0.5917068123817444,
-0.15492184460163116,
0.5102720856666565,
0.11472787708044052,
-0.39311665296554565,
-0.16811886429786682,
0.12607279419898987,
-0.25258904695510864,
-0.20770852267742157,
-0.4436216950416565,
-0.12989665567874908,
0.2860199511051178,
-0.24648210406303406,
-0.080742649... | |
the index when I last looked at it, each q-gram or substring is stored in a row in an table (the index). That row contains an nvarchar column (among other values) that is used as binary data and contains references to the rows that match.
There is also an open feedback suggestion on [Microsoft Connect](https://connect... | [
0.042574699968099594,
-0.014546900056302547,
0.4280492961406708,
-0.024758266285061836,
-0.17007988691329956,
0.2775150537490845,
-0.14227183163166046,
0.013492939993739128,
0.0762261375784874,
-0.41266196966171265,
0.18411415815353394,
0.15063981711864471,
-0.24102015793323517,
0.44827979... | |
I'm trying to access the command line and execute a command, and then return the output to my aspx page. A good example would be running dir on page load of an aspx page and returning the output via Response.Write(). I have tried using the code below. When I try debugging this it runs but never finishes loading and no ... | [
0.1029600277543068,
0.02418641932308674,
0.32854655385017395,
-0.12374578416347504,
-0.10689122974872589,
-0.061334799975156784,
0.4675067365169525,
-0.00958902109414339,
-0.03991134837269783,
-0.8685880303382874,
-0.1586112678050995,
0.7377558946609497,
-0.3555647134780884,
0.116363689303... | |
System.Diagnostics.Process si = new System.Diagnostics.Process();
si.StartInfo.WorkingDirectory = @"c:\";
si.StartInfo.UseShellExecute = false;
si.StartInfo.FileName = "cmd.exe";
si.StartInfo.Arguments = "dir";
si.StartInfo.CreateNoWindow = true;
si.StartInfo.RedirectStan... | [
0.06957129389047623,
-0.10796504467725754,
0.44410207867622375,
0.027490166947245598,
0.24526911973953247,
0.2974557876586914,
0.18346062302589417,
-0.40838807821273804,
-0.10624419152736664,
-0.5618042945861816,
-0.2914870083332062,
0.4391748607158661,
-0.19022852182388306,
0.300722867250... | |
string output = si.StandardOutput.ReadToEnd();
si.Close();
Response.Write(output);
}
}
```
You have a problem with the syntax of commandline arguments to cmd.exe. This is why cmd never exits.
In order to have cmd.exe run a program and then quit, you need to send it the syntax "/c [command]". Try... | [
-0.04586103931069374,
-0.1142464280128479,
0.42778804898262024,
-0.22884052991867065,
-0.11336344480514526,
-0.07140633463859558,
0.2738868296146393,
-0.13810308277606964,
-0.06262165307998657,
-0.41699063777923584,
-0.323477566242218,
0.6858307123184204,
-0.4738323986530304,
0.10606069117... | |
I have a Perl application that parses MediaWiki SQL tables and displays data from multiple wiki pages. I need to be able to re-create the absolute image path to display the images, eg: `.../f/fc/Herbs.jpg/300px-Herbs.jpg`
From MediaWiki Manual:
> Image\_Authorisation: "the [image] path can be calculated easily from ... | [
0.31856244802474976,
0.06612791121006012,
0.6298597455024719,
0.042621269822120667,
-0.04422639682888985,
-0.253676176071167,
0.15783819556236267,
-0.5385470986366272,
-0.15720374882221222,
-0.7056382298469543,
0.13239040970802307,
0.6201902031898499,
0.002450705738738179,
0.07769605517387... | |
you don't want to have all the files in 1 folder, and you want to have the ability to "partition" them across different servers, or a SAN or whatever in an equally-spread-out way.
The MD5 signature is a string of 16 "hex" characters. So our example of "/1f/ff/8a" gives us 256\*256\*256 folders to store the files in. T... | [
0.2570324242115021,
0.033950891345739365,
0.338102251291275,
0.1633290946483612,
0.0037478115409612656,
-0.2824847102165222,
-0.038339827209711075,
-0.11371314525604248,
-0.7413360476493835,
-0.704140841960907,
-0.20050734281539917,
-0.008512444794178009,
-0.145622119307518,
0.256314158439... | |
I mean doing something like this (code examples in Perl):
```
use Digest::MD5 'md5_hex';
my $sig = md5_hex( $file->id );
```
$sig is now 32 alpha-numeric characters long: "1ff8a7b5dc7a7d1f0ed65aaa29c04b1e"
Then build a folder structure like this:
```
my $path = '/usr/local/media';
map { mkdir($path, 0666); $path .... | [
-0.08533533662557602,
-0.05140811204910278,
0.7095451354980469,
-0.29245927929878235,
0.006664777174592018,
-0.17132796347141266,
0.20504389703273773,
-0.23400039970874786,
-0.29100650548934937,
-1.0265755653381348,
-0.4299682378768921,
0.3964079022407532,
-0.29350894689559937,
0.136292845... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.