text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
I have a custom object that maps a boolean value from a legacy database to a C# bool (and back again).
My custom bool object looks like this:
```
public class S2kBool : IUserDefinedType {
public bool Value { get; set; }
public Type SupportedType { get { return typeof(string); } }
// These are the values... | [
0.1551140397787094,
0.04786742478609085,
0.36719220876693726,
-0.18819989264011383,
0.0897323489189148,
-0.08299809694290161,
0.3988473117351532,
-0.16435116529464722,
-0.13954521715641022,
-0.4905446767807007,
-0.11549179255962372,
0.5311315655708313,
-0.3034082353115082,
0.22531856596469... | |
get { return new S2kBool(true); }
}
public static S2kBool False {
get { return new S2kBool(false); }
}
public S2kBool() : this(false) { }
public S2kBool(bool value) {
this.Value = value;
}
// Called when a property of this type is populated from the database
public vo... | [
-0.03310695290565491,
-0.08049564808607101,
0.3651583194732666,
-0.1451307237148285,
0.3771303594112396,
-0.2520436942577362,
0.6295678615570068,
-0.21356655657291412,
-0.15790891647338867,
-0.38276219367980957,
-0.6384532451629639,
0.6087803244590759,
-0.31344074010849,
0.0883279964327812... | |
= value.ToString() == TrueValue;
}
// Called when a property of this type is inserted into the database
public object ToSimpleDataType() {
return this.Value ? TrueValue : FalseValue;
}
}
```
I would like to be able to do something like this:
```
public class TestObject {
public S2kBool I... | [
0.28493911027908325,
0.007794588804244995,
0.05969029292464256,
-0.1659211367368698,
0.23546402156352997,
-0.24917981028556824,
0.650304913520813,
-0.3913964033126831,
0.20386333763599396,
-0.522078275680542,
-0.06557339429855347,
0.6607353091239929,
-0.29408323764801025,
-0.11892816424369... | |
sure of which one to use.
EDIT: Better yet, would it be possible to do something like the following and have C# treat the S2kBool object as an actual Boolean during comparison? It should also allow comparisons with other S2kBool objects, as well.
```
if (tObj.IsActive == true) { ... }
```
There are 2 things to look ... | [
-0.06554631143808365,
0.0567854642868042,
0.1161370649933815,
-0.05583753064274788,
-0.14485132694244385,
-0.04580763727426529,
0.3849402070045471,
-0.3814809024333954,
0.11381828784942627,
-0.5529713034629822,
-0.16897930204868317,
0.853803813457489,
-0.36832141876220703,
-0.1764755845069... | |
use `if(tObj.IsActive)`
---
conversion operator:
```
public static implicit operator bool(S2kBool x) {
return x.Value;
}
```
works likewise
---
You might also add a conversion in the other direction:
```
public static implicit operator S2kBool(bool x)
{
return new S2kBool(x);
}
```
Then you can assign... | [
-0.15921448171138763,
0.0790616050362587,
0.3154185116291046,
-0.42180609703063965,
0.0016448342939838767,
0.036357466131448746,
0.48648741841316223,
-0.2921885550022125,
0.1888100802898407,
-0.6027117371559143,
-0.34962186217308044,
0.7027434706687927,
-0.3380005359649658,
-0.126393690705... | |
print?
```
This prints false, because both `IsActive` fields point to the same *instance* of `S2kBool`. If that was the intent, then fine. But if it was me, I'd make it immutable (whether class or struct). But since it doesn't really have any state other than a bool, I'd argue that this fits well as a struct.
To be ... | [
0.5065746903419495,
0.23192720115184784,
0.20730207860469818,
-0.0933295488357544,
0.03571217879652977,
-0.23014602065086365,
0.27129098773002625,
0.016847839578986168,
-0.21876084804534912,
-0.3752312660217285,
-0.1299111396074295,
0.4424099028110504,
-0.5485280752182007,
0.07669799029827... | |
I'm looking two do two things:
1. Check if a week has gone by (based on the day of the week)
2. Check if a day has gone by (based on the date)
I'm not sure what the best way to solve this is, since when comparing two NSDates (one at 1/1/09 at 21:30 and another at 1/2/09 at 00:30) I can't just see if 24 hours has gone... | [
0.4888659417629242,
-0.12428773194551468,
0.3999102711677551,
-0.09204031527042389,
-0.0420340858399868,
0.07179704308509827,
0.2937098741531372,
0.16576595604419708,
-0.6021801829338074,
-0.7335401177406311,
0.44092705845832825,
0.20663221180438995,
-0.06024543568491936,
0.401978999376297... | |
that I saw.
For the other issue, I don't know how to know what day of the week it is given a date. I'd like to if 1/1/09 is a Tuesday, Monday, etc... Is there any library that let's you calculate this? This obviously needs to take into account leap years and a tons of other stuff... Maybe there's an objective-c libra... | [
0.32159432768821716,
-0.08323867619037628,
0.6445518732070923,
0.12707407772541046,
-0.2036115676164627,
0.07492562383413315,
0.275684118270874,
0.0908665657043457,
-0.36354270577430725,
-0.39768123626708984,
0.10885962098836899,
0.09224658459424973,
0.03898244723677635,
0.3072860538959503... | |
year];
[components month];
[components day];
```
Or, you can construct a new NSDate object using `NSCalendar`'s `dateFromComponents` method, and compare the two `NSDate` objects. | [
0.17484471201896667,
-0.3252483904361725,
0.3723638653755188,
-0.0322297029197216,
-0.09624847024679184,
0.0936158150434494,
0.1197168380022049,
0.004321585409343243,
-0.232493057847023,
-0.31597957015037537,
-0.015166881494224072,
0.016251016408205032,
-0.09690183401107788,
0.362156242132... | |
I have a UserControl which contains voting buttons inside an UpdatePanel, and outside a Repeater, it works perfectly. In the repeater, clicking the button fires off the appropriate event. That event is supposed to update the text of a control within the User Control, and that update should be reflected when the UpdateP... | [
0.12921279668807983,
-0.08699055761098862,
0.5092297792434692,
0.06553030014038086,
-0.1454247236251831,
0.030499575659632683,
0.11996325105428696,
-0.08660932630300522,
0.0020894526969641447,
-0.6884180903434753,
0.27211520075798035,
0.6505604386329651,
-0.006681429222226143,
-0.114163786... | |
do with the update panel, but with the postback loosing track of your UserControl. Possibly assigning unique IDs to your user controls may help. | [
0.22880399227142334,
0.006661376915872097,
0.30218032002449036,
0.28400903940200806,
0.16763152182102203,
-0.42204856872558594,
0.2296985238790512,
-0.10252905637025833,
-0.23711703717708588,
-0.6557348370552063,
-0.1882147341966629,
0.6523768305778503,
-0.048511967062950134,
-0.2845843136... | |
Let's say I have two existing tables, "dogs" and "cats":
```
dog_name | owner
---------+------
Sparky | Bob
Rover | Bob
Snoopy | Chuck
Odie | Jon
cat_name | owner
---------+------
Garfield | Jon
Muffy | Sam
Stupid | Bob
```
How do I write a query with this output?
```
owner | num_dogs... | [
-0.17838962376117706,
0.2885320484638214,
0.48841556906700134,
0.07198110967874527,
0.20732691884040833,
-0.0959651991724968,
-0.08396871387958527,
-0.008821293711662292,
-0.13698221743106842,
-0.4839189648628235,
-0.0827963799238205,
0.2026575654745102,
-0.485632985830307,
0.0926801338791... | |
0
Sam | 0 | 1
Jon | 1 | 1
```
**The answer I've got is the next query**
```
select owner, sum(num_dogs), sum(num_cats) from
(select owner, 1 as num_dogs, 0 as num_cats from dogs
union
select owner, 0 as num_dogs, 1 as num_cats from cats)
group by owner
```
**but the problem is tha... | [
-0.27756360173225403,
0.01585291139781475,
0.554871141910553,
-0.30741259455680847,
-0.0794052705168724,
0.24207133054733276,
0.08678516000509262,
-0.5124906301498413,
-0.309474378824234,
-0.6070559024810791,
-0.4498646855354309,
0.14189495146274567,
-0.40170592069625854,
0.279051363468170... | |
myself to have temporary table or a table
created with "select into" clause. I need some workaround for the
proposed solution where a nested select clause is formed in this way.
What's your opinion?
Cheers
My SQL does, just need to name the table... What database are you using?
```
select owner, sum(num_dogs), su... | [
0.2654845416545868,
0.3047964870929718,
0.3106866478919983,
-0.04719695821404457,
-0.01732698455452919,
0.25784653425216675,
-0.1513427048921585,
-0.36893826723098755,
-0.2173141986131668,
-0.5515968203544617,
0.07538866251707077,
0.31902360916137695,
-0.23327112197875977,
0.39258706569671... | |
I'm currently using Quartz Scheduler as a replacement for Cron on our Windows 2003 Server Box.
I have two specific Jobs that needed to be started in a new VM, so I'm using the ProcessBuilder object in Java 5 to get my "Process" object.
The problem I'm running into is when our Quartz Scheduler JVM stops, the 2 jobs in... | [
0.06397045403718948,
-0.050788503140211105,
0.4691881835460663,
-0.22246962785720825,
-0.0282340906560421,
-0.059725094586610794,
0.3464632034301758,
-0.06757766008377075,
-0.39478975534439087,
-0.5598706603050232,
0.07476327568292618,
0.786767840385437,
-0.3318762183189392,
0.332828462123... | |
while (true)
{
Thread thread1 = new Thread(new ReaderThread(process.getInputStream()));
Thread thread2 = new Thread(new ReaderThread(process.getErrorStream()));
thread1.start();
thread2.start(); | [
-0.05587387457489967,
-0.2378237545490265,
0.7569810748100281,
-0.22832661867141724,
0.2771855592727661,
0.23573076725006104,
0.5002442002296448,
-0.03688710927963257,
-0.10775620490312576,
-0.46614956855773926,
-0.28907233476638794,
0.4519774615764618,
-0.33432286977767944,
0.638605177402... | |
thread1.join();
thread2.join();
```
Is there a way to Kill these threads when the parent JVM associated with my Quartz Scheduler dies? Even if I knew of a way to kill them from a different process manually, I could figure out how to do it through Quartz.
Thank you in advance
If the Quartz JVM exits n... | [
0.6877098679542542,
0.12697790563106537,
0.3167419731616974,
0.07206258922815323,
0.1707586944103241,
-0.1176048070192337,
0.6398583054542542,
0.01605510339140892,
-0.2812648117542267,
-0.04564051702618599,
-0.05606992915272713,
0.3744543790817261,
-0.4936307370662689,
0.3709130883216858,
... | |
JVM termination. The Runtime javadocs state,
> If the virtual machine aborts then no guarantee can be made about whether or not any shutdown hooks will be run.
Here is the modified code (I've added a timeout and a method call to wait for the process to exit)
```
private static final long TIMEOUT_MS = 60000;
... | [
0.2649320662021637,
-0.18076714873313904,
0.5322434306144714,
-0.33614581823349,
0.29580265283584595,
-0.07148998230695724,
0.6277657151222229,
-0.2794950604438782,
-0.23860442638397217,
-0.2962811589241028,
-0.36793163418769836,
0.530228853225708,
-0.2867874205112457,
0.33103853464126587,... | |
Thread thread1 = new Thread(new ReaderThread(process.getInputStream()));
Thread thread2 = new Thread(new ReaderThread(process.getErrorStream()));
thread1.start();
thread2.start();
process.waitFor();
thread1.join(TIMEOUT_MS);
thread2.join(TIMEOUT_... | [
-0.29830676317214966,
-0.376720666885376,
0.8981142640113831,
-0.3290388584136963,
0.2970768213272095,
0.4545537531375885,
0.17181099951267242,
-0.0062327198684215546,
-0.5249151587486267,
-0.6841811537742615,
-0.3230607807636261,
0.08777644485235214,
-0.45466363430023193,
0.74869489669799... | |
}
} finally {
process.destroy();
}
```
In general I've found that processes spawned from Java are clunky and not very resilient, as you've probably discovered given the need for the two ReaderThreads. In particular, subprocesses that freeze up can be difficult to terminate from within Java. As a last ... | [
0.057686079293489456,
0.044262804090976715,
0.028169983997941017,
-0.13182957470417023,
0.26032453775405884,
-0.3275684118270874,
0.34601783752441406,
0.1198490634560585,
-0.28706151247024536,
-0.6395706534385681,
-0.28950002789497375,
0.4775761067867279,
-0.21755902469158173,
0.3535310626... | |
I'm using an Adorner in .NET 3.5, and I'm able to draw by overriding OnRender, but I need the ability to redraw the adorner to change its appearance.
Essentially I'm looking for a way to clear the drawing context and call OnRender again. What's the best way to do this, or is there a better approach?
```
public class ... | [
0.2769855856895447,
-0.28814971446990967,
0.8194870948791504,
-0.19201712310314178,
-0.2540716230869293,
0.4975619614124298,
0.25021642446517944,
-0.7549247741699219,
0.11369931697845459,
-0.7507006525993347,
0.22613586485385895,
0.513358473777771,
-0.4380037784576416,
0.3721289336681366,
... | |
// redraw..?
}
protected override void OnRender(System.Windows.Media.DrawingContext drawingContext)
{
// some drawing code...
drawingContext.DrawRectangle(
brush,
null,
new Rect(AdornedElement.DesiredSize));
}
}
```
The answer to your question is u... | [
-0.13286857306957245,
0.03896980360150337,
0.6503810286521912,
0.08284098654985428,
0.06296885758638382,
0.0627199113368988,
0.26204124093055725,
-0.35271400213241577,
-0.2950388193130493,
-0.4405864179134369,
-0.5272780060768127,
0.43684956431388855,
-0.3668724596500397,
0.214878380298614... | |
called again
However, I would suggest instead of doing custom drawing on OnRender yourself to use the standard styling and visual tree templating to build the actual visual of the adorner. This also means you can run standard XAML animations inside it with storyboards.
If you want to go with this approach, in your ad... | [
0.5294097065925598,
-0.25746601819992065,
0.3164239525794983,
0.3552609384059906,
-0.20431461930274963,
0.38763076066970825,
0.01834026351571083,
-0.33947890996932983,
-0.17548467218875885,
-0.7950218915939331,
0.024786384776234627,
0.32844844460487366,
0.03270997852087021,
0.0279646124690... | |
visual tree;
* override `GetCisualChild(int index)` to return a particular child.
You can take a look at the [ResizingAdorner](http://msdn.microsoft.com/en-us/library/ms771714.aspx) MSDN sample for more info. | [
-0.050550609827041626,
-0.3216845393180847,
-0.05548693612217903,
0.2634785771369934,
-0.010920314118266106,
0.34122103452682495,
0.46906545758247375,
0.21943479776382446,
-0.26352959871292114,
-0.7083596587181091,
-0.3860644996166229,
0.33681806921958923,
0.04164581373333931,
0.0748974904... | |
In my early coding days, I would tend to group classes that functioned in a similar way. For example:
* Data transfer objects
+ Object A
+ Object B
* Dialogs
+ Dialog A
+ Dialog B
After a while, it started to frustrate me that when I was working on a particular part of the application, I would have to jump all ar... | [
0.4405805468559265,
0.019344059750437737,
-0.39228835701942444,
0.18751776218414307,
-0.07598314434289932,
0.08461001515388489,
0.23290863633155823,
-0.05818246677517891,
-0.2124527543783188,
-0.799202561378479,
-0.12186885625123978,
-0.0720098614692688,
-0.36796292662620544,
0.00090122042... | |
Dialog 1
* Page B
+ images
+ Resource 2
+ Dialog 2
Is this the best way to do it? Does anyone have a good rule of thumb to follow?
For Java, packages are the unit of reuse.
For Python, modules (as well as packages) are the unit(s) of reuse.
The package should be a stand-alone thing.
If you put all data transfer... | [
0.10954153537750244,
-0.04928020387887955,
0.24623341858386993,
0.11100165545940399,
-0.08752579987049103,
-0.3260127604007721,
0.1673092097043991,
-0.30686524510383606,
-0.3538917005062103,
-0.670048177242279,
-0.40117430686950684,
0.5234462022781372,
-0.5477873086929321,
-0.4076653718948... | |
module that can be shared in other applications. | [
0.3530132472515106,
-0.28187626600265503,
0.03316910192370415,
0.46330398321151733,
0.3609733581542969,
-0.3727298378944397,
-0.20592130720615387,
-0.2898080348968506,
-0.22132660448551178,
-0.5555223226547241,
-0.39935770630836487,
0.1874908059835434,
-0.12476515024900436,
0.0087769348174... | |
I am trying to reset IIS on a set of servers all at one time instead of looping through and resetting each one individually, but I can't seem to figure out how to do it. Could someone please give me an example? Thank you
I am using System.Diagnostics
```
With m_Process.StartInfo
.FileName... | [
0.23351062834262848,
0.19033625721931458,
0.13203132152557373,
-0.03664497286081314,
0.2572194039821625,
0.12504136562347412,
0.46660318970680237,
-0.14316019415855408,
-0.42864638566970825,
-1.000840425491333,
0.0904274731874466,
0.4640839993953705,
-0.2736373245716095,
0.1523223519325256... | |
.UseShellExecute = False
.CreateNoWindow = True
.RedirectStandardError = True
.RedirectStandardOutput = True
End With
```
I don't think anyone can authoritatively answer no to this question, but I've never heard of a | [
0.47282153367996216,
0.4664995074272156,
0.5164694786071777,
0.13049083948135376,
-0.10017406195402145,
-0.5140734910964966,
0.36800673604011536,
-0.2731632590293884,
0.11601965874433517,
-0.23967492580413818,
-0.16008353233337402,
0.5254628658294678,
-0.03518584743142128,
0.31901836395263... | |
Javascript WYSIWYG editor that does diffs.
Stack Overflow does diffs on the server side. You'll probably have better luck if you look for a server-side component to do the job. If you need to show the diff as the user types, or something like that, you could use AJAX to hand off the diff work to the server. | [
0.09250598400831223,
-0.09753900021314621,
0.060377974063158035,
0.03375225514173508,
-0.43025922775268555,
-0.2991046607494354,
0.12337949126958847,
-0.007457859814167023,
-0.19063803553581238,
-0.7856670618057251,
-0.2723042368888855,
0.5090381503105164,
-0.517751932144165,
-0.1078898310... | |
I'm trying to create a program to clone multiple bugs at a time through the web interface of our defect tracking system. How can I wait before a page is completely loaded before I continue?
```
//This is pseudo code, but this should give you an idea of what I'm trying to do. The
//actual code uses multi-threading and... | [
0.4660246670246124,
0.2738397419452667,
0.16719476878643036,
-0.021872352808713913,
0.41234681010246277,
0.056148070842027664,
0.5577011108398438,
-0.0019956897012889385,
-0.16172663867473602,
-0.6643493175506592,
-0.1590811163187027,
0.5835123658180237,
-0.8556951284408569,
0.404973417520... | |
Event:
```cs
webBrowser.DocumentCompleted +=
new WebBrowserDocumentCompletedEventHandler(webBrowser_DocumentCompleted);
void webBrowser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
webBrowser.Document.GetElementById("product").SetAttribute("value", product);
webBrowser.Docume... | [
0.019643282517790794,
-0.10324303060770035,
0.42696020007133484,
-0.24097523093223572,
0.10363831371068954,
0.0035763236228376627,
0.4481196105480194,
-0.3344748616218567,
-0.06865054368972778,
-0.3658551573753357,
-0.6991438269615173,
0.7350547313690186,
-0.11652317643165588,
0.3894815444... | |
I'm learning JAX-RS (aka, JSR-311) using Jersey. I've successfuly created a Root Resource and am playing around with parameters:
```
@Path("/hello")
public class HelloWorldResource {
@GET
@Produces("text/html")
public String get(
@QueryParam("name") String name,
@QueryParam("birthDate") Da... | [
0.22418589890003204,
-0.21638967096805573,
0.6309922337532043,
-0.08788854628801346,
0.3502788841724396,
-0.005287440028041601,
0.28819361329078674,
0.3928561210632324,
-0.0262572281062603,
-0.7901332378387451,
0.045049529522657394,
0.17196883261203766,
0.42396286129951477,
0.1570892333984... | |
if I supply a value which is invalid or not understood, I get a 404 response.
For example:
```none
GET /hello?name=Mark&birthDate=X
404 Not Found
```
How can I customize this behavior? Maybe a different response code (probably "400 Bad Request")? What about logging an error? Maybe add a description of the problem ... | [
0.22308386862277985,
-0.08304893970489502,
0.021679731085896492,
0.11191309243440628,
-0.02122802473604679,
-0.016182228922843933,
0.3831551671028137,
-0.038039036095142365,
-0.30528849363327026,
-0.5715581774711609,
-0.12376359105110168,
0.6297137141227722,
-0.3516496419906616,
0.11584484... | |
NotAuthorizedException extends WebApplicationException {
public NotAuthorizedException(String message) {
super(Response.status(Response.Status.UNAUTHORIZED)
.entity(message).type(MediaType.TEXT_PLAIN).build());
}
}
```
And to throw this newly create Exception you simply:
```
@Path("ac... | [
0.21976298093795776,
-0.2590404152870178,
0.45741453766822815,
0.11458180099725723,
0.2888653576374054,
-0.22664575278759003,
0.5457351803779602,
-0.3091847896575928,
-0.14021992683410645,
-0.5748190879821777,
-0.37819236516952515,
0.5257201790809631,
-0.3144182562828064,
0.073008596897125... | |
return a 401 response to the client.
The second and easier approach is to simply construct an instance of the `WebApplicationException` directly in your code. This approach works as long as you don't have to implement your own application Exceptions.
Example:
```
@Path("accounts/{accountId}/")
public Item getItem(@... | [
0.10662079602479935,
-0.11506447196006775,
0.2381075620651245,
0.20898114144802094,
-0.04085297882556915,
0.20077723264694214,
0.18634045124053955,
-0.3048039972782135,
-0.2646780014038086,
-0.6090854406356812,
0.014869287610054016,
0.6830990314483643,
-0.17209944128990173,
-0.214055418968... | |
to wrap an existing Exception, perhaps an `ObjectNotFoundException` with an small wrapper class that implements the `ExceptionMapper` interface annotated with a `@Provider` annotation. This tells the JAX-RS runtime, that if the wrapped Exception is raised, return the response code defined in the `ExceptionMapper`. | [
0.24349147081375122,
-0.2171386033296585,
0.21052248775959015,
-0.05847086012363434,
-0.03849627077579498,
-0.22478637099266052,
0.21114175021648407,
-0.27573055028915405,
0.01767417974770069,
-0.4237949848175049,
-0.3233315944671631,
0.6685606837272644,
-0.3253657817840576,
-0.22688096761... | |
Here is what I need to be able to do:
I need to match the following tag:
```
<SPAN style="TEXT-DECORATION: underline">text sample</SPAN>
```
I need to replace the span with an html3 compliant tag, but keep the text in between. The final tag should look like this after replacement:
```
<u>text sample</u>
```
I'm ... | [
0.31858140230178833,
0.15982146561145782,
0.7146906852722168,
-0.005766996182501316,
-0.03955213353037834,
-0.1604989767074585,
0.40288659930229187,
-0.5922653675079346,
-0.12044192105531693,
-0.6016899943351746,
-0.11928366124629974,
0.7239219546318054,
-0.01333627849817276,
-0.3480415940... | |
, '<u>$1</u>'
, $MyString
);
```
But this is flawed in many ways, and you are much better off using a tool designed for manipulating tags instead.
**Have a look at [DOMDocument->loadHTML()](http://www.phpbuilder.com/manual/en/function.dom-domdocument-loadhtml.php) and [related functions](http://phpbuilder.co... | [
-0.04187536612153053,
-0.1277952492237091,
0.5883229970932007,
0.003943511750549078,
0.06816615909337997,
-0.1334926337003708,
0.2277287095785141,
-0.47557345032691956,
-0.2510259449481964,
-0.44899287819862366,
-0.31485843658447266,
0.7094057202339172,
-0.24686241149902344,
0.070313416421... | |
I'm using a **strongly typed `DataSet`** for which manually adding rows will be error prone. I'm providing **factory methods** to create rows properly. I'd like to guide consumers of my class away from the generated `Add*Row` methods on the `*Table` classes.
**Adding [Obsolete attributes](http://dotnettipoftheday.org... | [
0.22908031940460205,
0.0028723508585244417,
0.3371201455593109,
0.08219549059867859,
0.15531079471111298,
0.011592495255172253,
0.08977657556533813,
0.1884535253047943,
-0.14588096737861633,
-0.8115667700767517,
0.20725257694721222,
0.4132199287414551,
-0.1310984343290329,
0.29713031649589... | |
[Obsolete("Please use the factory method.")] here.
// I can't use a partial method, as this method isn't partial.
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public ShelfRow NewShelfRow()
return ((ShelfRow)(this.NewRow()));
}
}
```
Is there some way I can add an `Obsolete` ... | [
0.0223405659198761,
0.18227313458919525,
0.08864621073007584,
-0.14796893298625946,
0.13004015386104584,
-0.1433609575033188,
0.49954867362976074,
0.11738146841526031,
-0.1510280966758728,
-0.6439419984817505,
-0.02187667228281498,
0.3979438841342926,
-0.276607871055603,
0.4674020707607269... | |
here.
// I can't use a partial method, as this method isn't partial.
[Obsolete("Please use the factory method.")]
public ShelfRow NewShelfRow(); // ERROR: member already defined.
}
```
Is there some other way I can **mark the generated method `Obsolete`?**
How else could I **warn consumers** away from ... | [
0.6606712937355042,
0.18774285912513733,
0.3563869595527649,
-0.07283316552639008,
-0.012556900270283222,
-0.4005551338195801,
0.13830450177192688,
0.26569822430610657,
-0.30073463916778564,
-0.777652382850647,
0.090614452958107,
0.5763276815414429,
-0.17225326597690582,
0.6121987700462341... | |
setting the field "Custom Tool" from "MSDataSetGenerator" to empty. This way, you control when your code is generated. But this is error prone, as you may forget to do this in the future...
* You can create your own custom tool that will call the xsd.exe tool, and place the attribute you want at the appropriate places,... | [
0.38962239027023315,
-0.43407946825027466,
0.4614064395427704,
0.14237384498119354,
-0.2608572244644165,
-0.0034521978814154863,
0.13366299867630005,
-0.20517289638519287,
-0.21730291843414307,
-0.6554954051971436,
0.06365945935249329,
0.6423742175102234,
-0.26640865206718445,
0.0678825750... | |
set of public interfaces that you can allow your clients to use. Your Dataset classes will not be usable directly anywhere from outside your assemblies, but your interfaces will.
The latter is a bit less "automagic", as you will need to reflect changes in the DataSet schema in your interfaces, but you control everythi... | [
0.3913898766040802,
-0.08557899296283722,
-0.032772861421108246,
0.4238424599170685,
-0.13002926111221313,
-0.09367606788873672,
0.027980193495750427,
-0.10735516995191574,
-0.3285128176212311,
-0.9412700533866882,
-0.10424777120351791,
0.35865160822868347,
-0.5096882581710815,
0.036523114... | |
Should you use pointers in your C# code? What are the benefits? Is it recommend by The Man (Microsoft)?
From "The Man" himself:
The use of pointers is rarely required in C#, but there are some situations that require them. As examples, using an unsafe context to allow pointers is warranted by the following cases:
* D... | [
0.26011890172958374,
0.5840380787849426,
-0.12837260961532593,
0.10206019878387451,
-0.1592143476009369,
-0.3288620114326477,
0.46855589747428894,
-0.06919009983539581,
-0.24239689111709595,
-0.47516968846321106,
-0.07195501774549484,
0.8245259523391724,
-0.2570638954639435,
-0.36348912119... | |
using an unsafe context cannot be verified to be safe, so it will be executed only when the code is fully trusted. In other words, unsafe code cannot be executed in an untrusted environment. For example, you cannot run unsafe code directly from the Internet.
[Reference](http://msdn.microsoft.com/en-us/library/aa288474... | [
0.45331576466560364,
0.28899168968200684,
-0.07688723504543304,
0.11156792938709259,
0.2754436433315277,
-0.4306601583957672,
0.8503891825675964,
-0.10367049276828766,
0.02775106392800808,
-0.3586244583129883,
-0.1688888967037201,
0.3703554570674896,
-0.5418186783790588,
0.1216831356287002... | |
I'm trying to create a datagrid with a variable number of columns and rows. I can create the columns but I don't know how to insert the content.
```
_dataGrid.Columns.Add(new DataGridTextColumn { Header = "Column 0",
Binding = new Binding("0") | [
0.18026597797870636,
0.20344774425029755,
0.6399713754653931,
-0.0809059664607048,
0.019917819648981094,
-0.052102334797382355,
0.19041739404201508,
-0.29514816403388977,
-0.11596731096506119,
-0.5760409235954285,
0.08731769770383835,
0.440781831741333,
-0.48342984914779663,
0.284614264965... | |
}
);
```
I have all of the data that I want to | [
0.18317395448684692,
0.31073641777038574,
0.3147725462913513,
-0.0016969641437754035,
0.4953392446041107,
-0.06506256759166718,
0.07803285121917725,
0.2576667070388794,
0.12675178050994873,
-0.4656738042831421,
-0.2716476321220398,
0.5876445770263672,
-0.3403048813343048,
0.207816377282142... | |
add in a string[,]. I don't understand how to prepare a data structure that implements IEnumerable so that I can set
```
_dataGrid.ItemsSource = GenerateData();//I'd expect to return a Dictionary["0"]=List<string>(){"1","2","3"} to bind to but it doesn't work
```
What is the data structure that I need to return fro... | [
0.26078328490257263,
-0.1324816793203354,
0.3306141793727875,
-0.05708641558885574,
-0.2697984576225281,
-0.04169608652591705,
0.06861089915037155,
-0.26481762528419495,
-0.19293344020843506,
-0.5330750346183777,
0.07476252317428589,
0.34329813718795776,
-0.5331391096115112,
0.006929673720... | |
= "Foo",
Binding = new Binding("Foo")
});
grid.Columns.Add(new DataGridTextColumn {
Header = "Bar",
Binding = new Binding("Bar")
});
grid.ItemsSource = new [] {
new { Foo = "asdf", Bar = "asdf" },
new { Foo = "asdf", Bar = "asdf" },
new { Foo = "asdf", Bar = "asdf" }
}
``` | [
-0.10539589077234268,
-0.22321060299873352,
0.9793302416801453,
-0.37955817580223083,
-0.24432462453842163,
0.26816508173942566,
0.2685752809047699,
-0.6496955752372742,
-0.3940563499927521,
-0.6168456673622131,
-0.605412483215332,
0.25862014293670654,
-0.49222469329833984,
0.0886655822396... | |
I'm having an issue trying to NOT select a tablerow with the function:
```
$("tr").click(function(e) {
var row = jQuery(this)
//rest of code left off
});
```
Basically it finds all tablerows and adds click functionality that will open a edit modal that has a row with textboxes that are populated with info from the... | [
-0.08588321506977081,
-0.013446914032101631,
0.5020204186439514,
-0.02775169536471367,
-0.025377074256539345,
-0.0388382226228714,
0.010909026488661766,
-0.27533429861068726,
-0.17432242631912231,
-0.7348247170448303,
0.07539321482181549,
0.7329182028770447,
-0.3400665819644928,
0.24821260... | |
using:
```
$("tr").not('trEdit').click(function(e) {
var row = jQuery(this)
```
and
```
$("tr not:'trEdit').click(function(e) {
var row = jQuery(this)
```
I've also played around with trying the second table and then not selecting it's table rows, but the tables aren't besides each othe... | [
-0.16600389778614044,
-0.19253785908222198,
0.45872172713279724,
0.10084781795740128,
0.0561518594622612,
-0.029583269730210304,
0.04159875214099884,
-0.19012905657291412,
-0.30494898557662964,
-0.6823915839195251,
-0.13495272397994995,
0.8151244521141052,
-0.48515784740448,
-0.03894678130... | |
...
})
``` | [
0.20354829728603363,
0.3630911707878113,
0.27278780937194824,
-0.1317400485277176,
0.09997763484716415,
-0.13451313972473145,
0.2634679675102234,
0.14422006905078888,
0.24455220997333527,
-0.6622867584228516,
-0.2847658693790436,
0.6166889667510986,
-0.38031038641929626,
0.3199296593666076... | |
I'm starting a project where I need to display my wife's picture books on her blog. I've got the books' data on a database - couchdb - and I want to write a *player* she can easily embed in her blog. I've got most of the player written in Html, JavaScript & jQuery.
Next, I need to write the html and javascript code to... | [
0.6758344173431396,
0.3777020275592804,
0.6160734295845032,
0.13400045037269592,
0.188470259308815,
-0.2470369189977646,
-0.2981138825416565,
0.09965267032384872,
-0.36069396138191223,
-0.57933509349823,
0.11421047896146774,
0.554771363735199,
0.07658883184194565,
0.2232971340417862,
0.2... | |
between three things:
1. installation media,
2. product keys, and
3. licenses.
The third one (licenses) is certainly the fuzziest, but my read of the latest MSDN subscription license terms doesn't spot any restriction on how many VMs you could use, so long as you're using them for development purposes such as those y... | [
0.6046186685562134,
-0.07722208648920059,
0.5193362236022949,
0.3819291889667511,
-0.15966826677322388,
-0.11245127767324448,
-0.3972475826740265,
0.10391070693731308,
-0.4358648359775543,
-0.49824053049087524,
0.09934452921152115,
0.7684674859046936,
-0.14892102777957916,
0.20548516511917... | |
if I prepared and activated one image, and then copied that activated base image once for each separate VM instance that I needed, I only had to activate the very first time no matter how many copies I made. This makes it easier to avoid running over the 10 machine activation limit that applies to most MSDN product key... | [
0.27451375126838684,
-0.00958576612174511,
0.3871408700942993,
0.04209798201918602,
-0.009661613032221794,
0.04885395988821983,
0.3421132266521454,
-0.03681862726807594,
-0.31324267387390137,
-0.46682941913604736,
0.0446176715195179,
0.7406224012374878,
-0.21106773614883423,
-0.01516761258... | |
The [HTML spec](http://www.w3.org/TR/REC-html40/types.html#type-name) says
> ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by **any number of** letters, digits ([0-9]), hyphens ("-"), underscores ("\_"), colons (":"), and periods (".").
And even though the [SGML declaration](http://www.w3... | [
0.2021760493516922,
0.07026313990354538,
0.559555172920227,
-0.09380917251110077,
-0.15938475728034973,
0.1124223843216896,
0.12232864648103714,
-0.34386056661605835,
-0.2143634557723999,
-0.4413183927536011,
-0.24936805665493011,
0.11954975128173828,
0.12464987486600876,
0.112965226173400... | |
longer IDs could become hard to remember. | [
0.807446300983429,
-0.23330290615558624,
0.04790828749537468,
0.3945763409137726,
0.023178482428193092,
-0.337295264005661,
0.12738095223903656,
-0.12408735603094101,
-0.2899080514907837,
0.015368298627436161,
0.3200507164001465,
0.022991469129920006,
0.1724288910627365,
-0.272271156311035... | |
I am emailing unhandled exception details from global.asax. How can I get the path and/or filename of the aspx file or assembly file where an exception was not handled.
This info was showing up in the exception's stack trace when I was developing & testing. When I deployed the global.asax to production, this info is n... | [
0.24069255590438843,
-0.1143694743514061,
0.09533704072237015,
0.14431045949459076,
-0.09828319400548935,
-0.15925833582878113,
0.1866445541381836,
0.2655333876609802,
-0.5754666924476624,
-0.7454497814178467,
0.11950137466192245,
0.14295727014541626,
-0.3447823226451874,
-0.02351560816168... | |
would give you the file name of where the error occurred.
```
protected void Application_Error(object sender, EventArgs e)
{
MailMessage msg = new MailMessage();
HttpContext ctx = HttpContext.Current;
msg.To.Add(new MailAddress("me@me.com"));
msg.From = new MailAddress("from@me.com");
msg.Subject ... | [
-0.1625232994556427,
-0.13510259985923767,
0.6258158087730408,
-0.17943009734153748,
0.05474364385008812,
0.2468036413192749,
0.6747117042541504,
-0.6697026491165161,
-0.3476838171482086,
-0.654607355594635,
-0.40401697158813477,
0.38141319155693054,
-0.6284042596817017,
0.360294908285141,... | |
msg.Body = sb.ToString();
//CONFIGURE SMTP OBJECT
SmtpClient smtp = new SmtpClient("myhost");
//SEND EMAIL
smtp.Send(msg);
//REDIRECT USER TO ERROR PAGE
Server.Transfer("~/ErrorPage.aspx");
}
``` | [
-0.29842203855514526,
-0.05491120368242264,
0.721556544303894,
-0.07316561043262482,
-0.18421705067157745,
0.16018374264240265,
0.6883024573326111,
-0.2658105492591858,
-0.4607771933078766,
-0.6662092804908752,
-0.38314419984817505,
0.09653226286172867,
-0.6487066745758057,
0.3790884017944... | |
I have a resultset structure like this
```
ID Value Name
1 Oranges Reponse
1 42 Count
2 Apples Reponse
2 65 Count
3 Figs Reponse
3 74 Count
```
and I | [
-0.2404288798570633,
0.3741442561149597,
0.22849459946155548,
-0.23230674862861633,
-0.1919698268175125,
0.6324039101600647,
0.1346426159143448,
0.04838746786117554,
-0.3241943120956421,
-0.505203902721405,
-0.11857623606920242,
0.46510761976242065,
-0.14171427488327026,
-0.284559667110443... | |
want to get to this:
```
ID Response Count
1 Oranges 42
2 Apples 65
3 Figs 74
```
using SQL. Is there a way to do this? thanks!
```
SELECT a.ID, a.Value AS [Response], b.Value AS [Count]
FROM your_table AS a
INNER JOIN your_table AS b
ON a.ID = b.ID
WHERE a.Na... | [
0.1281196027994156,
0.029135670512914658,
0.3556976616382599,
-0.13898085057735443,
-0.2246844619512558,
0.43674296140670776,
0.07217036187648773,
-0.17154498398303986,
-0.41074901819229126,
-0.4851547181606293,
0.014298157766461372,
0.6982446908950806,
-0.3115694224834442,
-0.296281546354... | |
AND b.Name = 'Count'
``` | [
0.007708894554525614,
0.5414889454841614,
0.37437203526496887,
-0.19144977629184723,
-0.27503952383995056,
-0.1883191019296646,
-0.03334320709109306,
-0.03021758608520031,
-0.1212482750415802,
-0.12614794075489044,
-0.5907763838768005,
-0.0011393496533855796,
-0.20620761811733246,
0.165506... | |
i have a *very* interesting problem.
**background**
i've used TTreeView for years but only now am using it with a docking library (from AutomatedQA). i've learned that when the parent of the TTreeView is changed, all the handles are recreated. this is something the docking library does during normal activites.
i've... | [
0.09503459930419922,
-0.025325702503323555,
0.4980581998825073,
0.09029703587293625,
-0.169027179479599,
0.18652169406414032,
0.05909092351794243,
0.36736777424812317,
-0.5111035108566284,
-0.771571934223175,
0.14586950838565826,
0.6131594777107239,
0.35179468989372253,
0.13778424263000488... | |
parent changed (auto-hide & show window), my application works perfectly.
**the problem**
what i find is that once the parent has changed, my object attached to the tree node's Data property now contains references to the wrong tree node or a stale pointer.
i tried it another way "MyTreeViewContainer.Parent:=Somewhe... | [
0.1969502866268158,
-0.03325378894805908,
0.19228734076023102,
0.10077600926160812,
0.017196711152791977,
0.1442437320947647,
0.5316000580787659,
0.32003670930862427,
-0.2828962504863739,
-0.7133629322052002,
0.2749005854129791,
0.3421800434589386,
-0.011470354162156582,
0.6495605111122131... | |
"pattern" for using the tree view...
thank you for your help!
i think i've found the answer. use the OnAddition event of the TTreeView to reconnect the node & object as follows:
procedure TForm1.TreeView1Addition(Sender: TObject; Node: TTreeNode);
begin
TMyObject(Node.Data).TreeNode:=Node;
end; | [
-0.005140169523656368,
-0.5420682430267334,
0.503197193145752,
-0.13628628849983215,
0.10890036076307297,
-0.13904622197151184,
0.46852198243141174,
-0.13211846351623535,
-0.10043928027153015,
-0.7000465393066406,
-0.18012988567352295,
0.3074074387550354,
-0.40257349610328674,
0.0568800531... | |
As the title suggests, I would like to see if this is something people are happy with.
I have several projects, where I will dedicate some time in experimenting with different kinds of technologies web service related, preferably alternatives to SOAP which would be well integrated inside/with dotnet.
I would like to ... | [
0.8330078721046448,
-0.08390722423791885,
0.08156462758779526,
0.18171823024749756,
0.021527044475078583,
-0.15034884214401245,
0.17367921769618988,
-0.010265128687024117,
-0.005710770841687918,
-0.7599407434463501,
0.17953407764434814,
0.4358307123184204,
0.40388232469558716,
-0.192616865... | |
members who are new to
> both SOAP and REST, and I am balancing
> which one to motivate them/myself on.
.
> I personally am not too enthusiastic
> about SOAP, but just like my aversion
> to SQL I blame my own lack of
> experience on the subject more than on
> the technology itself.
So in looking for some other... | [
0.5716261267662048,
0.046202488243579865,
0.23716120421886444,
-0.15585285425186157,
-0.3731009364128113,
-0.0705457404255867,
0.2549530863761902,
0.031379323452711105,
-0.31612375378608704,
-0.4783974587917328,
0.09248007088899612,
0.48819848895072937,
0.2841034531593323,
0.04265788570046... | |
bit beyond the original question, comments on REST as a whole for distributed hypermedia in replacement of SOAP and from people who would like to defend SOAP are also welcomed.
*Sorry if this is a dupe, I did look around and didn't find anything quite like what I would like to know.*
Thanks,
Ric
I spent about two we... | [
0.639885663986206,
-0.09493269771337509,
0.17184701561927795,
0.06882288306951523,
-0.4848630428314209,
-0.13414058089256287,
0.43816012144088745,
0.14099723100662231,
-0.15750616788864136,
-0.39006108045578003,
0.07883645594120026,
0.567030668258667,
0.09878913313150406,
0.077837608754634... | |
bolt an HTTP emulation layer on top of a layer that's designed to abstract away HTTP and it's messy as a result.
For reference, the prototype included implementing CRUD functionality, the `X-HTTP-Method-Override` header, custom translation of any errors into a standard error block, support for both XML and JSON as bot... | [
0.4184190034866333,
-0.0145801967009902,
0.33751577138900757,
-0.04099266603589058,
-0.1456308811903,
0.006075009237974882,
0.2407131791114807,
-0.1535533368587494,
0.12343437969684601,
-0.4276926517486572,
-0.03550731763243675,
0.5363329648971558,
-0.39067327976226807,
-0.1968690305948257... | |
the above list was difficult (I was stumped on the header for a while, but [the solution turned out to only be 10 lines of code or so](https://stackoverflow.com/questions/467535/is-it-possible-to-implement-x-http-method-override-in-asp-net-mvc/490733#490733)). ASP.NET MVC is fairly close to the underlying HTTP protocol... | [
-0.0000439324758190196,
0.07699870318174362,
0.613420844078064,
-0.14220435917377472,
-0.2628880441188812,
-0.2903326451778412,
0.3164787292480469,
-0.012160057201981544,
-0.04931073635816574,
-0.586928129196167,
-0.25851139426231384,
0.3734881281852722,
-0.2494848072528839,
-0.05162941664... | |
At work, we use Team Foundation Server for source control. I work from home a lot, though, and external access to our Team Foundation Server isn't possible now or in the foreseeable future. I'm utterly fed up of using email/usb source control - almost as bad as no source control at all - so I was thinking about bringin... | [
0.6377620100975037,
0.1442873328924179,
0.05857500433921814,
0.0495169460773468,
0.0024951437953859568,
-0.05097077041864395,
0.051611386239528656,
-0.017520949244499207,
-0.12298902869224548,
-0.659191370010376,
0.045741863548755646,
0.33284908533096313,
0.10118632763624191,
-0.3275682032... | |
and pick them up from home).
Installing a local Team Foundation Server and editing the appropriate files to point to it would be possible as I have an MSDN license, but somehow I don't think that would work (and I don't even know where the address of the Team Foundation Server is stored, and I've looked in the obvious... | [
0.27581650018692017,
-0.24951019883155823,
0.18919223546981812,
-0.07428820431232452,
-0.26077935099601746,
0.011819498613476753,
0.09194876253604889,
0.08784805983304977,
-0.156524658203125,
-0.5909582376480103,
0.10537353157997131,
0.4304106831550598,
-0.32337653636932373,
-0.05147514492... | |
AnkhSVN in Visual Studio, then use TortoiseSVN's Export function to get a clean copy of the project to take back to work to check in. What I'm worried about are conflicts arising from a project being managed by two source control providers. Is this even possible in Visual Studio (2008)? It gets cross enough that the Te... | [
0.11366936564445496,
-0.005327938590198755,
0.2349422574043274,
-0.20883092284202576,
-0.3313480019569397,
-0.18982473015785217,
0.43444696068763733,
-0.14671869575977325,
-0.3928857743740082,
-0.440719872713089,
-0.08793706446886063,
0.39187270402908325,
-0.3398391306400299,
-0.0175831671... | |
work for the same reasons I can't access the Team Foundation Server remotely. I surely would like to..
I think yes is the answer to your question.
Personally I was going through the same USB SVN etc hell.
Currently I am using the [Live Mesh](https://www.mesh.com/Welcome/default.aspx) Beta to have a folder sync'ed be... | [
0.45673662424087524,
-0.010570908896625042,
0.39396023750305176,
-0.16290533542633057,
0.11841008812189102,
-0.05846618488430977,
0.26779237389564514,
0.09253420680761337,
-0.448302298784256,
-0.8546189665794373,
0.17236527800559998,
0.7281366586685181,
-0.1571791172027588,
0.0829028487205... | |
this morning to work and its here, because of the syncing, independently, I can commit/rollback/diff at any time with Git, from any machine, not having to worry about the server/service from other machines.
Because its automatically synced by Mesh, I don't even have to submit/push changes. Just using the version contr... | [
0.44689255952835083,
-0.22736266255378723,
0.6670616269111633,
-0.007279574871063232,
-0.1398361176252365,
-0.02350611612200737,
0.0013152470346540213,
0.018363559618592262,
-0.286398321390152,
-0.974873960018158,
0.0120628010481596,
0.7271897196769714,
-0.15051859617233276,
-0.04839397594... | |
window to
> perform commits, but I use it with
> Projects for which I use Visual Studio
> to develop with.
I just thought about giving you my success story because it might be helpful to you. | [
0.27970707416534424,
-0.17104120552539825,
0.14348448812961578,
0.13578331470489502,
-0.18845854699611664,
-0.2867414951324463,
0.18610447645187378,
0.3092420697212219,
-0.072076715528965,
-0.7954925298690796,
0.17554233968257904,
0.5361969470977783,
0.08983082324266434,
0.0358729474246501... | |
The question pretty much already says everything.
I'm starting to add some features to my [weekend project](http://www.my-clock.net). It's a small app for me and a couple of friends, as we're exchange students it's kinda useful for us.
But the thing is the following, I'm doing this in php and structuring everything w... | [
1.275190830230713,
0.20330505073070526,
0.04246865212917328,
-0.007992328144609928,
-0.14014104008674622,
0.032686688005924225,
0.24062301218509674,
0.09488853812217712,
-0.3453606963157654,
-0.3783149719238281,
0.5940082669258118,
0.16171737015247345,
0.08539721369743347,
-0.2139752656221... | |
at all.
[It's actually considered good practice to put your script tags as late as possible in the page](http://developer.yahoo.com/performance/rules.html#js_bottom). | [
0.29469364881515503,
-0.12242360413074493,
0.24512088298797607,
0.040913451462984085,
0.13650313019752502,
-0.47288239002227783,
0.4474775791168213,
-0.014165684580802917,
-0.25134405493736267,
-0.5108585357666016,
-0.28760871291160583,
0.4310067892074585,
0.24072782695293427,
-0.473756641... | |
I'd like to create a data table given a List using the CopyToDataTable method available in DataTableExtensions. I've previously asked the question [How do I transform a List into a DataSet?](https://stackoverflow.com/questions/523153/how-do-i-transform-a-listt-into-a-dataset) and got an [exceptional answer](https://sta... | [
0.17778067290782928,
-0.2679866850376129,
0.31655237078666687,
-0.05181296169757843,
-0.26131823658943176,
0.014356374740600586,
0.015068741515278816,
-0.3019440472126007,
-0.35987287759780884,
-0.5926730632781982,
-0.04947841912508011,
0.3669176995754242,
-0.12674884498119354,
0.229553729... | |
that I'd have to maintain myself.
Unfortunately, I'm having a bit of trouble figuring out how to use it.
I can take my IList and say myListofMyClass.CopyToDataTable() but I get a compile error that says "The type 'MyClass' must be convertible to 'System.Data.DataRow' in order to use it as parameter 'T' in the generic... | [
0.07836423814296722,
0.05282629281282425,
0.22532373666763306,
0.03403644636273384,
-0.09365157037973404,
-0.13889843225479126,
0.11463034152984619,
-0.017172321677207947,
-0.14341548085212708,
-0.5179628133773804,
0.386366605758667,
0.40180960297584534,
-0.07680270820856094,
0.40146315097... | |
though, so check it out. | [
0.6683633923530579,
0.2362070381641388,
-0.1438010036945343,
0.06905519962310791,
0.2624067962169647,
-0.4993427097797394,
0.1725131869316101,
0.29796385765075684,
-0.23679986596107483,
-0.1880079209804535,
0.32961952686309814,
0.19419170916080475,
0.21964384615421295,
-0.00455347169190645... | |
I have a routine
```
public void SomeRoutine(List<IFormattable> list) { ... }
```
I then try to call this routine
```
List<Guid>list = new List<Guid>();
list.Add(Guid.NewGuid());
SomeRoutine(list);
```
And it fails with a compile-time error. System.Guid implements IFormattable, but the error I get is
> cannot co... | [
0.22220847010612488,
0.07702085375785828,
0.3320249319076538,
-0.2836383879184723,
-0.09174385666847229,
-0.2243928164243698,
0.4940800070762634,
-0.30201369524002075,
-0.20667505264282227,
-0.502684473991394,
-0.02769065834581852,
0.6150369644165039,
-0.5118135213851929,
0.159518972039222... | |
of IFormattable, but when I try to expand that to a collection (a generic list, or an array, or anything else), I get a conversion error?
I have had a heck of a time finding an answer, and I figured this would be the best place to go.
This is that whole covariance thing everyone talks about. It will work in .NET 4.0.... | [
-0.0306716188788414,
0.04612504690885544,
0.25937706232070923,
-0.2559785544872284,
-0.1426636427640915,
0.16904720664024353,
-0.020578956231474876,
-0.5007093548774719,
-0.5549395084381104,
-0.32122835516929626,
0.16653917729854584,
0.6600050330162048,
-0.4319773018360138,
-0.164855226874... | |
I am trying to prevent user controls from having and <% ... %> on them. I have sub-classed PageParserFilter in an attempt to use the ProcessCodeConstruct() method to detect when a code block is being parsed and cause an error. Using the debugger I was able to see that the other methods of my overriden PageParserFilter ... | [
0.38134658336639404,
0.29253244400024414,
0.2835479974746704,
-0.0948413759469986,
-0.19525101780891418,
-0.3518717586994171,
0.40646588802337646,
-0.1072523221373558,
-0.11072655767202377,
-0.634678840637207,
0.0013489866396412253,
0.40748852491378784,
-0.5682750344276428,
0.2018074542284... | |
it to work as intended. | [
0.29111748933792114,
-0.023155277594923973,
0.2519511282444,
0.06940560042858124,
-0.10784672945737839,
0.27960917353630066,
0.3746141493320465,
0.08007514476776123,
0.28109416365623474,
-0.4123559892177582,
0.012504776939749718,
0.5518223643302917,
-0.13325832784175873,
-0.020218688994646... | |
I have some Javascript which "animates" a colour change on an HTML element, as follows:
```
var element = document.getElementById("someid");
while (i < 255) {
element.style.color = 'rgb(' + i + ',' + i + ',' + i + ')';
i++;
slowMeDown(); // This function runs for a few ms to slow the process down
}
```
A... | [
0.3271741271018982,
0.0640212893486023,
0.4104083180427551,
-0.5212589502334595,
0.10670550167560577,
0.046032629907131195,
0.4693298637866974,
-0.0413837768137455,
-0.05772216245532036,
-0.9702314138412476,
-0.014173471368849277,
0.379019170999527,
-0.3873867094516754,
0.2983554005622864,... | |
(Chrome and IE - not tested on Firefox yet) only refreshes at the end of the function, so the color simply changes from black to white. Does anyone know how to make the browser repaint during the loop so that I can see the text fade?
```
function changeColor()
{
changeColorIncremental(0);
}
function changeColorInc... | [
0.24063098430633545,
-0.07917951792478561,
0.7392284870147705,
-0.4227869510650635,
0.17558728158473969,
0.09983273595571518,
0.40716058015823364,
-0.26432472467422485,
0.0872611328959465,
-0.7639549374580383,
-0.0533696785569191,
0.6477170586585999,
-0.279821515083313,
0.07783973962068558... | |
Decrease this to speed up
// the transition, and increase it to slow it down.
setTimeout('changeColorIncremental(' + (i + 1) + ')', 50);
}
}
``` | [
0.23966579139232635,
-0.24718177318572998,
0.6416816711425781,
-0.24795575439929962,
0.461643248796463,
-0.11229894310235977,
0.03190542012453079,
-0.29430535435676575,
0.02549949288368225,
-0.6732099056243896,
-0.30302730202674866,
0.6128223538398743,
-0.4088013172149658,
-0.0968284979462... | |
Stuck on a (rather simple) regex problem in PHP.
Buried in a mess of text is this section:
```
<tr>
<td id="descriptionArea">
Customer request to remove "Intro - 01/13/09" video clip.
<br/>
</td>
</tr>
```
I want whateve... | [
0.06630169600248337,
0.3396230936050415,
0.3133002817630768,
-0.03093932382762432,
0.19326528906822205,
0.13659799098968506,
0.5444274544715881,
0.07329463958740234,
-0.07723040878772736,
-0.1684499979019165,
-0.3388954997062683,
0.1626533716917038,
-0.5087364315986633,
0.40644893050193787... | |
modifier 'q'
```
I suppose the second question is whether preg\_match is the correct PHP function for this, also. Should I be using ereg instead? Thanks for your help.
When using the `preg_*` functions, the first character or the pattern is treated as delimiter:
> The expression must be enclosed in the delimiters, a... | [
-0.027514301240444183,
0.06604193150997162,
0.4385567605495453,
-0.05793764442205429,
-0.164244145154953,
0.0424119271337986,
0.43120813369750977,
-0.10764948278665543,
0.028814008459448814,
-0.4305585026741028,
-0.16269353032112122,
0.6326119899749756,
-0.3200232982635498,
-0.120122261345... | |
`[]`, and `<>` matching delimiters.
>
> — [Regular Expressions (Perl-Compatible) – Introduction](http://docs.php.net/manual/en/intro.pcre.php)
So you don’t need to escape or replace the `&` characters as others said. Instead use proper delimiters and escape those characters inside the expression:
```
'/<td id=... | [
-0.038404837250709534,
0.13487745821475983,
0.5434263944625854,
-0.07142270356416702,
0.18140938878059387,
0.0805395171046257,
0.44581174850463867,
-0.34733182191848755,
0.06393375247716904,
-0.3720378279685974,
-0.6327073574066162,
0.7093706130981445,
-0.47250476479530334,
-0.300815463066... | |
Using OpenGL I'm attempting to draw a primitive map of my campus.
Can anyone explain to me how panning, zooming and rotating is usually implemented?
For example, with panning and zooming, is that simply me adjusting my viewport? So I plot and draw all my lines that compose my map, and then as the user clicks and drag... | [
0.3833737075328827,
-0.09463623911142349,
0.5423623919487,
0.20604604482650757,
-0.1743333339691162,
-0.0981738418340683,
-0.11622290313243866,
0.024837758392095566,
-0.022642314434051514,
-0.8510626554489136,
0.07528959959745407,
0.7210635542869568,
-0.1808764636516571,
-0.026955137029290... | |
campus map? Won't this be expensive to do on the fly on a decent sized map?
Or, is the viewport left the same and panning/zooming/rotation is done in some otherway?
---
For example, if you go to this [link](http://www.codeproject.com/KB/GDI-plus/maps_map_net_gis.aspx?display=Print) you'll see him describe panning an... | [
0.39638110995292664,
-0.343273401260376,
0.44410163164138794,
0.18738102912902832,
-0.019474545493721962,
-0.22930023074150085,
-0.19301961362361908,
0.11662697046995163,
-0.34951403737068176,
-0.6605861783027649,
-0.08817877620458603,
0.5640765428543091,
-0.13083399832248688,
-0.072560511... | |
your camera: position and direction.
gluLookAt takes the position, destination, and up vector.
If you implement a vector class, `destinaion = position + direction` should give you a destination point.
Again to make things simple, you can assume the up vector to always be (0,1,0)
Then, before rendering anything in... | [
0.2170477658510208,
-0.2801819145679474,
0.92955082654953,
0.04584719240665436,
0.041958365589380264,
0.3837733566761017,
-0.2654140591621399,
-0.016814423725008965,
-0.4258524179458618,
-0.48827698826789856,
0.14349733293056488,
0.6191056966781616,
-0.5171776413917542,
0.08675915002822876... | |
direction vector. Assuming that what you're rotating is the camera, not some object in the scene.
One problem is, if you only have a direction vector "forward" how do you move it? where is the right and left?
My approach in this case is to just take the cross product of "direction" and (0,1,0).
Now you can move the ... | [
-0.10003005713224411,
-0.2656141221523285,
0.7111951112747192,
0.017813852056860924,
-0.09684357792139053,
0.3247930109500885,
-0.5489352345466614,
-0.19048450887203217,
-0.49904561042785645,
-0.4315767288208008,
0.3618486225605011,
0.5459951758384705,
-0.3670867085456848,
0.15189775824546... | |
get the forward vector the same way we got the right vector:
```
forward = cross( up, right )
```
To be honest, this is somewhat of a hackish approach.
The proper approach is to use a more "sophisticated" data structure to represent the "orientation" of the camera, not just the forward direction. However, since you... | [
0.18199709057807922,
0.09323878586292267,
0.3289027512073517,
0.12139483541250229,
-0.014169066213071346,
0.06480877101421356,
-0.18881838023662567,
-0.2101926952600479,
-0.06624593585729599,
-0.48200345039367676,
0.3159279525279999,
0.5510997772216797,
-0.12266206741333008,
-0.16767303645... | |
Which techniques or paradigms normally associated with functional languages can productively be used in imperative languages as well?
e.g.:
* Recursion can be problematic in languages without tail-call optimization, limiting its use to a narrow set of cases, so that's of limited usefulness
* Map and filter have found... | [
0.03457015007734299,
0.031800054013729095,
-0.37416544556617737,
0.15133637189865112,
-0.13220205903053284,
0.1542423963546753,
0.519909143447876,
-0.027644643560051918,
-0.12160513550043106,
-0.5080336928367615,
-0.051400162279605865,
0.712981104850769,
-0.0957980826497078,
-0.37949892878... | |
returned from functions.
Even though functions aren't first class values, I can wrap one in an object in Java say, and pass that into another method. Like Functional programming, just less fun.
So, for veterans of functional programming, when you program in imperative languages, what ideas from FP have you applied su... | [
0.081809863448143,
-0.0748148038983345,
0.23948055505752563,
0.05977586284279823,
-0.19128087162971497,
0.22223898768424988,
0.15067371726036072,
-0.06436072289943695,
-0.2213209718465805,
-0.4292141795158386,
-0.22292755544185638,
0.6251444220542908,
-0.08068037778139114,
-0.3083436489105... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.