text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
So I have an object graph, let's just say it's an order. You have the order class, line item class, tracking number class, payment class. You get the idea.
Now the business requirement is any user can change the order, but order changes must be approved by the manager. Until the manger approves nothing changes. Manage... | [
0.3296235203742981,
-0.007202588953077793,
0.4369544982910156,
-0.058345746248960495,
0.004331772681325674,
0.14397825300693512,
-0.17399078607559204,
0.11049061268568039,
-0.6694626808166504,
-0.6685908436775208,
0.03543166443705559,
0.6139010190963745,
-0.36504843831062317,
0.22700421512... | |
table. It would have a record for each pending change. It would reference the order table.
So an order would get created but have a pending change; a record would be inserted into the orders table, with a status column of pending, and a record would be insterted into the OrderTransaction table.
For every change anoth... | [
0.009769069962203503,
0.1841043382883072,
0.6697964072227478,
-0.052057065069675446,
0.36394253373146057,
0.5095914602279663,
-0.4716889560222626,
0.01062831375747919,
-0.6298891305923462,
-0.705009400844574,
0.10567449033260345,
0.28073033690452576,
-0.2806715667247772,
0.1668222993612289... | |
So I'm a newbie to TDD, and I successfully created a nice little sample app using the MVP pattern. The major problem to my current solution is that its blocking the UI thread, So I was trying to setup the Presenter to use the SynchronizationContext.Current, but when I run my tests the SynchronizationContext.Current is ... | [
-0.023369107395410538,
-0.1560518443584442,
0.702582597732544,
-0.19466736912727356,
0.04810842499136925,
-0.07884498685598373,
0.4440191090106964,
-0.0024178652092814445,
-0.3202926516532898,
-0.6824607253074646,
-0.014933251775801182,
0.3489164710044861,
-0.3682979345321655,
0.2847878932... | |
{
var settings = new FtpAuthenticationSettings()
{
Site = _view.FtpSite,
Username = _view.FtpUsername,
Password = _view.FtpPassword
}; | [
-0.1742146611213684,
-0.42022889852523804,
0.7698008418083191,
-0.2698564827442169,
0.48192331194877625,
0.13908125460147858,
0.34879007935523987,
0.281436562538147,
-0.4079689383506775,
-0.6279943585395813,
-0.5332856178283691,
0.8276559114456177,
-0.42121651768684387,
0.13681650161743164... | |
var files = _ftpService.GetFiles(settings);
_view.FilesDataSource = files;
_view.StatusMessage = Messages.Done;
}
catch (Exception ex)
{
_view.StatusMessage = ex.Message;
}
} | [
-0.10212237387895584,
-0.4807569980621338,
0.4974707365036011,
-0.28509843349456787,
0.3240804970264435,
0.15380486845970154,
0.4522663354873657,
-0.18546484410762787,
-0.5950351357460022,
-0.3160325884819031,
-0.4721164107322693,
0.5258212685585022,
-0.429648756980896,
0.0929001197218895,... | |
...
}
```
Test Before Threading
```
[TestMethod]
public void Can_Get_Files()
{
var view = new FakeFtpView();
var presenter = new FtpPresenter(view, new FakeFtpService(), new FakeFileValidator());
view.GetFiles();
Assert.AreEqual(Messages.Done, view.StatusMessage);
}
```
Now after I added a Synchro... | [
0.24958238005638123,
0.1860378533601761,
0.7763878703117371,
-0.047149110585451126,
0.16184230148792267,
-0.0973796397447586,
0.6212804913520813,
-0.16146990656852722,
-0.23804804682731628,
-0.6007158160209656,
-0.18565984070301056,
0.5988496541976929,
-0.4984738826751709,
0.24335679411888... | |
do instead?
Presenter After Threading
```
public class FtpPresenter : IFtpPresenter
{
...
void _view_GetFilesClicked(object sender, EventArgs e)
{
_view.StatusMessage = Messages.Loading;
try
{
var settings = new FtpAuthenticationSettings()
{
... | [
-0.0414324626326561,
-0.37311282753944397,
0.7630492448806763,
-0.3663845360279083,
0.09512531757354736,
0.14760880172252655,
0.5826210975646973,
0.05608738213777542,
-0.5703502297401428,
-0.5543473362922668,
-0.4180448353290558,
0.45000478625297546,
-0.3822559714317322,
0.1976767629384994... | |
Username = _view.FtpUsername,
Password = _view.FtpPassword
};
// Wrap the GetFiles in a ThreadStart
var syncContext = SynchronizationContext.Current;
new Thread(new ThreadStart(delegate | [
-0.06446728855371475,
-0.24216735363006592,
0.7511167526245117,
0.019994983449578285,
0.4914742410182953,
0.0622745007276535,
0.33093777298927307,
-0.21170185506343842,
-0.39723560214042664,
-0.6710436940193176,
-0.178643137216568,
0.21822157502174377,
-0.42552056908607483,
0.4620618820190... | |
{
var files = _ftpService.GetFiles(settings);
syncContext.Send(delegate
{
_view.FilesDataSource = files;
_view.StatusMessage = Messages.Done; | [
0.11674126237630844,
-0.34109047055244446,
0.5523316860198975,
-0.01937630958855152,
0.48396503925323486,
-0.09991487860679626,
0.7727733850479126,
-0.3790273070335388,
-0.288850873708725,
-0.6943226456642151,
-0.4531193971633911,
0.5510789752006531,
-0.42960110306739807,
0.260130345821380... | |
}, null);
})).Start();
}
catch (Exception ex)
{
_view.StatusMessage = ex.Message;
}
}
...
}
```
Test after threading
```
[TestMethod]
public void Can_Get_Files()
{
var view = new FakeFtpView();
var presenter | [
0.4722016751766205,
-0.14507713913917542,
0.5094977021217346,
-0.08527137339115143,
0.02066449075937271,
-0.26347580552101135,
0.689365029335022,
-0.13634003698825836,
-0.24520093202590942,
-0.5024846196174622,
-0.26474902033805847,
0.43746188282966614,
-0.15634222328662872,
0.338259607553... | |
= new FtpPresenter(view, new FakeFtpService(), new FakeFileValidator());
view.GetFiles();
view.GetFilesWait.WaitOne();
Assert.AreEqual(Messages.Done, view.StatusMessage);
}
```
Fake View
```
public class FakeFtpView : IFtpView
{
...
public AutoResetEvent GetFilesWait = new AutoResetEvent(false);... | [
0.33962488174438477,
-0.3190630078315735,
0.556669294834137,
-0.23779739439487457,
0.1338908076286316,
0.003355687018483877,
0.6775511503219604,
-0.3579859733581543,
-0.3534890115261078,
-0.3448548913002014,
-0.37169694900512695,
0.8362165689468384,
-0.23940317332744598,
0.0038839923217892... | |
get { return _statusHistory; }
}
public string StatusMessage
{
get
{
return _statusHistory.LastOrDefault();
}
set
{
_statusHistory.Add(value);
if (value != | [
-0.3384002149105072,
-0.5253136157989502,
0.45416656136512756,
-0.15982986986637115,
0.4655459523200989,
0.005258380435407162,
0.24731668829917908,
-0.054502569139003754,
-0.13615481555461884,
-0.48562607169151306,
-0.5478495955467224,
0.6666772961616516,
-0.07653763145208359,
-0.121037609... | |
Messages.Loading)
GetFilesWait.Set();
}
}
...
}
```
I've run into similar problems with ASP.NET MVC where it is the HttpContext that is missing. One thing you can do is provide an alternate constructor that allows you to inject a mock SynchronizationContext or expose a public setter tha... | [
0.09141989052295685,
-0.03530808910727501,
0.310039222240448,
0.04346125200390816,
0.05295348912477493,
-0.15727359056472778,
0.6084491610527039,
0.021358922123908997,
-0.29719844460487366,
-0.7433106899261475,
-0.2298005223274231,
0.6029586791992188,
-0.6352760195732117,
0.107672505080699... | |
property throughout your code. In your alternate constructor, you can assign the mock context to the property -- or you can assign to it directly if you give it a public setter.
public class FtpPresenter : IFtpPresenter
{
public SynchronizationContext CurrentContext { get; set; }
```
public FtpPresenter() : this... | [
0.1633543074131012,
-0.18201321363449097,
0.5041528940200806,
-0.0014808387495577335,
0.23861068487167358,
-0.007021761033684015,
0.412314236164093,
-0.40844467282295227,
-0.4730849266052246,
-0.7240052223205566,
-0.18513000011444092,
0.5970632433891296,
-0.18100470304489136,
0.58949303627... | |
{
var files = _ftpService.GetFiles(settings);
this.CurrentContext.Send(delegate
{
_view.FilesDataSource = files;
_view.StatusMessage = Messages.Done;
}, null); | [
0.09409787505865097,
-0.26408880949020386,
0.45777347683906555,
-0.05382136255502701,
0.4392183721065521,
0.01613515242934227,
0.6345525979995728,
-0.33022546768188477,
-0.37501731514930725,
-0.6054419279098511,
-0.4976966083049774,
0.4710959494113922,
-0.35935914516448975,
0.3931888341903... | |
})).Start();
...
}
```
One other observation that I would make is that I would probably have your presenter depend on an interface to the Thread class rather than on Thread directly. I don't think that your unit tests should be creating new threads but rather interacting with a mock class that just ensures th... | [
0.1955522894859314,
-0.0474441796541214,
0.36168161034584045,
-0.042863473296165466,
-0.08596231788396835,
-0.3083222806453705,
0.030096473172307014,
-0.0028810633812099695,
-0.23840707540512085,
-0.5767144560813904,
-0.030803292989730835,
0.7540376782417297,
-0.5197197198867798,
0.4335539... | |
I have an animation and I want it to play it just only once. From where can I set so when I export to SWF the default will be AUTO LOOPING disabled.
Thanks
Insert a keyframe in the last frame and put a stop(); there? | [
0.32442986965179443,
-0.06752574443817139,
0.6075111031532288,
-0.0447402261197567,
0.16410978138446808,
0.08807932585477829,
0.35567331314086914,
0.18385349214076996,
-0.2977459132671356,
-0.8718652129173279,
-0.19598816335201263,
0.34042346477508545,
-0.08132907003164291,
0.0747631266713... | |
I want to otherwise block code execution on the main thread while still allowing UI changes to be displayed.
I tried to come up with a simplified example version of what I'm trying to do; and this is the best I could come up with. Obviously it doesn't demonstrate the behavior I'm wanting or I wouldn't be posting the q... | [
0.25605300068855286,
-0.11859560757875443,
0.2193703055381775,
-0.2611529231071472,
0.014804172329604626,
0.03167934715747833,
0.36020147800445557,
0.12634596228599548,
-0.32304129004478455,
-0.6447902917861938,
0.03140480816364288,
0.5461980104446411,
-0.33908769488334656,
0.2348292768001... | |
{
AutoResetEvent autoResetEvent = new AutoResetEvent(false);
new Thread(delegate()
{
// do something that takes a while.
Thread.Sleep(1000);
// Update UI w/BeginInvoke
this.BeginInvoke(new ThreadStart( | [
0.2558242082595825,
-0.2619669437408447,
0.5029085874557495,
-0.17557071149349213,
0.6826221942901611,
-0.02204115130007267,
0.5854634046554565,
-0.4579038918018341,
-0.2968536913394928,
-0.7568421959877014,
-0.13633015751838684,
0.7258914113044739,
-0.18270623683929443,
0.2677521705627441... | |
delegate() {
this.Text = "Working... 1";
this.Refresh();
Thread.Sleep(1000); // gimme a chance to see the new text
})); | [
0.2915859520435333,
-0.29953181743621826,
0.35896632075309753,
-0.0528605692088604,
0.6129482388496399,
-0.17544879019260406,
0.48495885729789734,
-0.32225409150123596,
-0.35385268926620483,
-0.8064764142036438,
-0.27211397886276245,
0.5061081051826477,
-0.2343561053276062,
0.4238360524177... | |
// do something else that takes a while.
Thread.Sleep(1000);
// Update UI w/Invoke
this.Invoke(new ThreadStart(
delegate() {
this.Text = "Working... 2"; | [
0.4410270154476166,
-0.4314318895339966,
0.4234469532966614,
-0.16532820463180542,
0.5013825297355652,
-0.27501460909843445,
0.5690371990203857,
-0.4511489272117615,
-0.2755362391471863,
-0.9293625950813293,
-0.20099832117557526,
0.5326101779937744,
-0.15179553627967834,
0.2507418096065521... | |
this.Refresh();
Thread.Sleep(1000); // gimme a chance to see the new text
}));
// do something else that takes a while.
Thread.Sleep(1000); | [
0.020449191331863403,
-0.31910404562950134,
0.7440447807312012,
-0.2944581210613251,
0.5327535271644592,
-0.09300274401903152,
0.37969663739204407,
-0.015400862321257591,
-0.15328583121299744,
-1.0196902751922607,
-0.34802085161209106,
0.5488268733024597,
-0.2146064043045044,
0.14493522047... | |
autoResetEvent.Set();
}).Start();
// I want the UI to update during this 4 seconds, even though I'm
// blocking the mainthread
if (autoResetEvent.WaitOne(4000, false))
{
this.Text = "Event Signalled";
}
else | [
0.08955685049295425,
-0.22954875230789185,
0.7517389059066772,
-0.161232590675354,
0.3658173978328705,
0.007387736812233925,
0.714384138584137,
-0.43969884514808655,
-0.18820416927337646,
-0.6251040101051331,
-0.20318345725536346,
0.9124138951301575,
-0.22552704811096191,
-0.10712700337171... | |
{
this.Text = "Event Wait Timeout";
}
Thread.Sleep(1000); // gimme a chance to see the new text
this.Refresh();
}
```
If I didn't set a timout on the WaitOne() the app would deadlock on the Invoke() call.
---
As to why I'd want to do this, I've been tasked with moving one sub... | [
0.3165014088153839,
-0.21847636997699738,
0.6015999913215637,
-0.19197194278240204,
0.3912370800971985,
0.09464884549379349,
0.3902187943458557,
-0.1565534472465515,
-0.45065832138061523,
-0.7049995064735413,
-0.18651436269283295,
0.7891594171524048,
-0.28126779198646545,
0.045284576714038... | |
workflow (the main thread) only sometimes and for certain types of work related to that subsystem only.
I went with something I haven't seen posted yet which is to use MessageQueues.
* The MainThread blocks while waiting for the next message on a queue.
* The background thread posts different types of messages to the ... | [
0.274737685918808,
-0.11057008057832718,
0.38523614406585693,
-0.11729150265455246,
-0.4087166488170624,
-0.10779397189617157,
0.2617695927619934,
0.36081135272979736,
-0.3084403872489929,
-0.781373143196106,
0.04379170760512352,
0.30145829916000366,
-0.20449665188789368,
0.026676809415221... | |
Between [Yahoo! UI Compressor](http://developer.yahoo.com/yui/compressor/), [Dean Edwards Packer](http://dean.edwards.name/packer/) and [jsmin](http://www.crockford.com/javascript/jsmin.html), which produces better results, both in terms of resulting footprint and fewer errors when obfuscating.
Better is a bit subjecti... | [
0.1156250387430191,
0.026374531909823418,
0.15870411694049835,
-0.1015867292881012,
-0.23136956989765167,
0.14895939826965332,
0.039825137704610825,
-0.5622592568397522,
-0.09773803502321243,
-0.6719822287559509,
-0.18052805960178375,
0.41248467564582825,
-0.2890084385871887,
0.16835235059... | |
any problems reported.
* The style and size of the code itself will affect the results, of course.
* And finally, it's worth keeping in mind that server-side gzip compression will always result in a smaller download than any code compression, although some code compression tools will combine with gzip more effectivel... | [
0.11979015171527863,
0.2227230668067932,
0.4855181872844696,
0.17710521817207336,
-0.05685354769229889,
0.027345910668373108,
0.20624011754989624,
-0.03748246654868126,
-0.19521519541740417,
-0.8504852652549744,
-0.31658750772476196,
0.7883820533752441,
0.030614178627729416,
-0.04315287619... | |
I have two Sharepoint lists:
- Assignments
- Activities
The activities list has a lookup field to the assignments list as activities (e.g. monthly review of X) are related to an assignment.
My question is, how would I display other fields from Assignments in a view of Activities using standard Sharepoint 2007 (we h... | [
0.6155762672424316,
0.051384951919317245,
0.2616751194000244,
0.13575245440006256,
-0.28391605615615845,
0.010384977795183659,
-0.39546874165534973,
-0.3448537290096283,
-0.34211546182632446,
-0.2536202073097229,
0.25427818298339844,
0.6871634721755981,
0.02459825575351715,
-0.175268426537... | |
Bill
```
**Activities**
```
Assignment Date Action
Read X 2-Mar-08 No actions needed
Read X 3-Apr-08 Adjust Y
```
**Desired SharePoint List (to view/sort/filter)**
```
Assignment Frequency Area Assigned To Date Action
Read X Monthly Finance Bill | [
0.3524104356765747,
-0.16088394820690155,
0.7037202715873718,
-0.135290265083313,
0.03739297389984131,
0.24264085292816162,
-0.37361249327659607,
-0.47843435406684875,
-0.37707746028900146,
-0.3116527199745178,
-0.21008558571338654,
0.716195285320282,
-0.06765563786029816,
-0.1272742599248... | |
2-Mar-08 No actions needed
Read X Monthly Finance Bill 3-Apr-08 Adjust Y
```
If you can't use the Data View Web Part from SPD, then I think you are going to have to use a content editor webpart and do this all in javascript. [intro article](http://www.cleverworkarounds.com/2008/02/28/mor... | [
0.515761137008667,
-0.07558195292949677,
0.5076438784599304,
-0.027338329702615738,
-0.3603985905647278,
-0.2575143277645111,
0.14834757149219513,
-0.39965733885765076,
-0.020227085798978806,
-0.3383300304412842,
0.06980207562446594,
0.6318010687828064,
0.04630162566900253,
-0.221666291356... | |
From what I understand, in TDD you have to write a failing test first, then write the code to make it pass, then refactor. But what if your code already accounts for the situation you want to test?
For example, lets say I'm TDD'ing a sorting algorithm (this is just hypothetical). I might write unit tests for a couple ... | [
0.5229088068008423,
-0.04227713495492935,
-0.11686380207538605,
-0.00438870582729578,
-0.2009919285774231,
0.10500002652406693,
0.31445348262786865,
-0.27306851744651794,
0.10270784795284271,
-0.5280600190162659,
0.13088737428188324,
0.3549126088619232,
-0.3907775282859802,
0.1981439441442... | |
refactor and replace it with the more efficient merge-sort algorithm. Later, I realize that we need it to be a stable sort, so I write a test for that too. Of course, the test will never fail because merge-sort is a stable sorting algorithm! Regardless, I still need this test incase someone refactors it again to use a ... | [
0.20199891924858093,
0.21122083067893982,
0.3323024809360504,
0.06740442663431168,
0.024913281202316284,
-0.10253559798002243,
0.2817533314228058,
-0.19284501671791077,
0.024472787976264954,
-0.7166268229484558,
0.21482501924037933,
0.45797353982925415,
-0.35975903272628784,
0.084769107401... | |
often do you come across a similar situation and what do you do?
There are two reasons for writing failing tests first and then making them run;
The first is to check if the test is actually testing what you write it for. You first check if it fails, you change the code to make the test run then you check if it runs. ... | [
0.6465358734130859,
0.1590343564748764,
-0.48553743958473206,
0.33197060227394104,
-0.11324530839920044,
-0.17601396143436432,
0.5949581265449524,
-0.05080730840563774,
-0.11933141201734543,
-0.5518215894699097,
0.37179896235466003,
0.4781991243362427,
-0.12635654211044312,
-0.187885016202... | |
most important reason is to prevent you from writing too much tests. Tests reflect your design and your design reflects your requirements and requirements change. You don't want to have to rewrite lots of tests when this happens. A good rule of thumb is to have every test fail for only one reason and to have only one t... | [
0.5085073709487915,
0.22450114786624908,
0.14944760501384735,
0.29107150435447693,
0.1339212954044342,
-0.37515899538993835,
0.4398418664932251,
-0.055791329592466354,
-0.25215834379196167,
-0.3978666067123413,
-0.1586325466632843,
0.5672588348388672,
-0.2943633794784546,
0.054126027971506... | |
rules are made in the first place you can be flexible with them. For example when you find that you have tests that test more than one thing you can split it up. Effectively you have written two new tests that you havent seen fail before. Breaking and then fixing your code to see your new tests fail is a good way to do... | [
0.7818224430084229,
-0.0617801807820797,
-0.4832433760166168,
0.41370564699172974,
0.07913987338542938,
-0.6843935251235962,
0.4560394585132599,
-0.37107428908348083,
-0.4537791311740875,
-0.5388556122779846,
0.18866077065467834,
0.35989901423454285,
-0.3094744384288788,
-0.178542599081993... | |
What is the syntax to concatenate text into a binding expression for an asp.net webpage (aspx).
For example if I had a hyperlink that was being bound like this:
```
<asp:HyperLink id="lnkID" NavigateUrl='<%# Bind("Link") %>' Target="_blank"
Text="View" runat="server"/>
```
How do you change... | [
-0.13703583180904388,
-0.18184350430965424,
0.5409675240516663,
-0.08203444629907608,
-0.26949647068977356,
-0.10363846272230148,
0.01376086100935936,
-0.10031642764806747,
-0.034242790192365646,
-0.7224557995796204,
-0.10597706586122513,
0.29415276646614075,
-0.40303871035575867,
0.141505... | |
tag if using a template field:
```
<asp:TemplateField HeaderText="Name" SortExpression="sortName">
<ItemTemplate>
<asp:LinkButton ID="lbName" runat="server" OnClick="lbName_Click" CommandArgument='<%# Eval("ID") %>'>
<%--Enter any text / eval bindind you want between the tags--%>
<%# Eval("Name") ... | [
-0.03572816774249077,
-0.1609526425600052,
0.5373502969741821,
-0.1721448302268982,
-0.09662032872438431,
-0.005496847443282604,
0.020360078662633896,
-0.793636679649353,
-0.09861411154270172,
-0.7281571626663208,
-0.3441183567047119,
0.3745446503162384,
-0.42911258339881897,
-0.1512096077... | |
What is domain logic? The Wikipedia page for domain logic redirects to business logic. Are they the same thing, and, if not, how do they differ?
The domain is what you are modelling.
If you are modelling a business problem, they are the same thing.
If you are modelling something else, physics for instance, there is p... | [
0.09817950427532196,
-0.2003009021282196,
0.11007151752710342,
0.4445832371711731,
-0.20272544026374817,
0.03937308117747307,
-0.25789743661880493,
0.2670709490776062,
-0.4183371365070343,
-0.4274759888648987,
0.1591576337814331,
0.41622018814086914,
-0.3861401379108429,
0.3941974639892578... | |
Up till now I have been developing my personal and school
projects at home without using any form of revision control
software to handle my changes and whatnot.
My question is, **how feasible is it to use a Version
Control application** (such as [TortoiseSVN](http://en.wikipedia.org/wiki/TortoiseSVN)) **for
personal p... | [
0.19282057881355286,
0.27003148198127747,
0.4191017150878906,
0.10716913640499115,
0.25025492906570435,
-0.1897316575050354,
0.47689592838287354,
-0.022371307015419006,
-0.574726402759552,
-0.30692586302757263,
-0.1511698216199875,
0.7899125218391418,
0.5249959826469421,
0.1254179030656814... | |
want to mark a set of files and revisions as being a specific software version.
* **You train for your professional life.** Putting in your head the work methodology associated with using source control prepares you professionally.
* **Storage efficiency.** Current source control systems store revisions as a delta diff... | [
0.597105860710144,
0.1458890587091446,
0.4642741084098816,
0.2310798317193985,
0.353058785200119,
-0.025311635807156563,
0.03953316807746887,
-0.4038529396057129,
-0.42395642399787903,
-1.043029546737671,
-0.04042426124215126,
0.7091056108474731,
0.2541992962360382,
0.18437305092811584,
... | |
can branch to experiment.** If you have some experiments in mind you can create a branch (a new independent development line) and test it. In the end, if you are satisfied with the results, merge it in the HEAD (main development line). You get all this for free without having to create a copy and receive the same benef... | [
0.8363454341888428,
-0.36685577034950256,
0.022079337388277054,
0.6065747737884521,
0.38091376423835754,
-0.09417939186096191,
-0.0809440091252327,
0.0898742824792862,
-0.20448419451713562,
-0.31499484181404114,
-0.1148262545466423,
0.21872931718826294,
0.018083633854985237,
0.423828125,
... | |
I'm looking for a tool (or a set of tools) for Windows that will perform the following:
1. Capture UDP packets from a specific network interface to a file.
2. Play a stream of packets from a file through a network interface.
3. In addition to 2: replay the original packets to a different host than the original one.
I... | [
0.40946730971336365,
-0.2498251050710678,
0.4830017685890198,
0.1305927336215973,
-0.15670154988765717,
-0.43017709255218506,
-0.03785313293337822,
-0.15854699909687042,
-0.4924312233924866,
-0.6638911962509155,
0.1694255918264389,
0.5551114678382874,
-0.5214267373085022,
0.238082855939865... | |
XP SP2/3.
The **BitTwist** (<http://bittwist.sourceforge.net>) editor commandline program (`bittwiste`) allows you to change the destination IP address (and port number) amongst other things.
See a similar question (and worked answer) at the Super User site: [Replay UDP Packet Capture](https://superuser.com/questions/... | [
0.3594561219215393,
-0.1516595482826233,
0.8111539483070374,
-0.01584523171186447,
-0.13770927488803864,
-0.3155316114425659,
0.3171994984149933,
-0.32340115308761597,
-0.40635958313941956,
-0.43537217378616333,
-0.39291688799858093,
0.6152387857437134,
-0.22820422053337097,
-0.08432350307... | |
I have been working on this for the greater part of the day and I cant seem to make this part of my code work. The intent of the code is to allow the user to input a set of values in order to calculate the missing value. As an additional feature I placed a CheckBox on the form to allow the user to do further calculatio... | [
0.3166823387145996,
0.554695725440979,
-0.07949250936508179,
-0.16415274143218994,
0.13795053958892822,
-0.0585767887532711,
0.7123239636421204,
-0.057186372578144073,
0.11908335238695145,
-0.49706682562828064,
0.44264960289001465,
0.6575114727020264,
-0.6128260493278503,
-0.02997480705380... | |
the answer does not change like it should. Please reference the attached code. If a jpg image is needed of the formula I can e-mail it.
```
void Calc3Click(object sender, EventArgs e)
{
if (String.IsNullOrEmpty(tb3_skv.Text) | String.IsNullOrEmpty(tb3_kva.Text) | String.IsNullOrEmpty(tb3_z.Text))
{
... | [
-0.10072587430477142,
-0.009966799058020115,
0.7677413821220398,
-0.14593879878520966,
0.14169463515281677,
0.16633249819278717,
0.30601799488067627,
-0.40188226103782654,
0.038420651108026505,
-0.5445069670677185,
-0.16012704372406006,
0.4775708317756653,
-0.3792000412940979,
0.0813080072... | |
if (!String.IsNullOrEmpty(tb3_skv.Text) & !String.IsNullOrEmpty(tb3_kva.Text) & !String.IsNullOrEmpty(tb3_z.Text))
{ //If motor load check box is not checked and required values are entered calculate AIC based on formula.
int y;
decimal x, z, a;
x = decimal.Parse(tb3_skv.Te... | [
0.040053967386484146,
0.02684803120791912,
0.49344557523727417,
0.10275808721780777,
0.1567072719335556,
0.23438602685928345,
0.3534103035926819,
-0.46280816197395325,
0.05742862820625305,
-0.16434411704540253,
-0.27530041337013245,
0.7171052694320679,
-0.19102659821510315,
-0.039645038545... | |
a = decimal.Parse(tb3_z.Text);
z = (y * 1000) / (x * 1.732050808m) / (a / 100); //the m at the end of the decimal allows for the multiplication of decimals
tb3_aic.Text = z.ToString();
tb3_aic.Text = Math.Round(z,0).ToString();
}
if (cb3_ml.Checked==true) | [
-0.23306190967559814,
0.29483160376548767,
0.26604411005973816,
-0.2801339626312256,
0.08008673042058945,
0.3462933897972107,
0.12709593772888184,
-0.31610119342803955,
-0.28705933690071106,
0.13402464985847473,
-0.24709616601467133,
0.3912239372730255,
-0.07414659857749939,
0.145724669098... | |
{//If Motor Load CB is checked calculate the following
int y, b;
decimal x, z, a;
x = decimal.Parse(tb3_skv.Text);
y = int.Parse(tb3_kva.Text);
a = decimal.Parse(tb3_z.Text);
b = int.Parse(tb3_ml.Text); | [
0.34096887707710266,
0.31001561880111694,
0.19990243017673492,
-0.08897963911294937,
-0.2169739156961441,
0.3931400179862976,
0.1436222493648529,
-0.4658927321434021,
-0.12954682111740112,
-0.01671999879181385,
-0.1877848505973816,
0.5535823702812195,
-0.35333043336868286,
0.25819563865661... | |
z = ((y * 1000) / (x * 1.732050808m) / (a / 100))+((b / 100)*(6*y)/(x*1.732050808m)*1000);
tb3_aic.Text = z.ToString();
tb3_aic.Text = Math.Round(z,5).ToString();
}
}
```
I am grateful for any help that can be provided.
Thank you,
Greg Rutledge
Without really knowing what the p... | [
-0.006450964603573084,
0.6516305208206177,
0.07947448641061783,
0.2958560287952423,
0.09797226637601852,
-0.11447884142398834,
0.389581561088562,
-0.10329145938158035,
-0.12908124923706055,
-0.4307534992694855,
0.15778397023677826,
0.5963327884674072,
-0.2720077335834503,
0.198933079838752... | |
unexpected results unless you really know what you are doing. I suggest using only decimals (or doubles, which are way faster and usually have enough precision for engineering computations).
* You also set tb3\_aic.Text twice, I assume you decided on rounding later and forgot to remove the first one.
**Edit: This is a... | [
-0.045624684542417526,
-0.21525058150291443,
0.018142202869057655,
-0.011963408440351486,
-0.042269859462976456,
0.10247855633497238,
0.27098506689071655,
-0.21499979496002197,
-0.3178712725639343,
-0.33308306336402893,
0.14681492745876312,
0.792942225933075,
0.11660601198673248,
-0.282844... | |
:) | [
-0.11804179102182388,
0.13728010654449463,
0.17982403934001923,
0.07065879553556442,
0.008272250182926655,
0.4008978307247162,
0.19919633865356445,
-0.4948277771472931,
-0.11189078539609909,
0.012069443240761757,
-0.22117410600185394,
0.509800136089325,
-0.22204074263572693,
0.175080463290... | |
I have a table (SQL 2000) with over 10,000,000 records. Records get added at a rate of approximately 80,000-100,000 per week. Once a week a few reports get generated from the data. The reports are typically fairly slow to run because there are few indexes (presumably to speed up the INSERTs). One new report could reall... | [
0.3386411964893341,
0.43854284286499023,
0.43363964557647705,
-0.04788356274366379,
0.07957971841096878,
-0.3091672360897064,
-0.05407823994755745,
0.014531913213431835,
-0.42233142256736755,
-0.6785532236099243,
0.29809242486953735,
0.2732391953468323,
-0.05762619525194168,
0.357334613800... | |
definition:
```
ID, int, PK
Source, char(3) <--- column I want indexed
...
About 20 different varchar fields
...
CreatedDate, datetime
Status, tinyint
ExternalID, uniqueidentifier
```
My test query is just:
```
select top 10000 [field list] where Source = 'abc'
```
You need to look at the query plan and see if it... | [
0.15371480584144592,
0.11418269574642181,
0.3138161897659302,
0.13843339681625366,
0.13308636844158173,
0.15212824940681458,
0.062173254787921906,
-0.2415383905172348,
-0.11395042389631271,
-0.7798243165016174,
0.06271100044250488,
0.2839655578136444,
-0.06871026009321213,
0.18166209757328... | |
it should read that out pretty fast. | [
0.2643633186817169,
0.21014627814292908,
0.17493940889835358,
0.09547560662031174,
0.017233647406101227,
-0.26327061653137207,
0.0549757182598114,
0.3940524160861969,
0.007808201014995575,
-0.0809517428278923,
0.18055124580860138,
0.1691516786813736,
0.2009357213973999,
-0.0764536410570144... | |
I have a menu of report links in my master page. I need to append an ID to the end of each whenever the user changes a value on the child page. What's a good way to accomplish this?
UPDATE: I should have mentioned that the child update is happening inside an UpdatePanel, meaning the master page is not reloaded when th... | [
0.3048545718193054,
-0.05678241699934006,
0.361726850271225,
0.15200117230415344,
0.02511027455329895,
0.018817905336618423,
0.20458829402923584,
-0.10187704861164093,
-0.1997913271188736,
-0.8064239621162415,
-0.1499890387058258,
0.5152113437652588,
0.023083781823515892,
-0.05026436597108... | |
returning the right value for fields that have been AJAXed. | [
-0.3601085841655731,
-0.2126171886920929,
0.09904243797063828,
0.3839794099330902,
-0.4928492307662964,
-0.21200230717658997,
0.03652413189411163,
0.27563610672950745,
-0.05332983657717705,
-0.5981075167655945,
-0.3017156720161438,
0.22638165950775146,
-0.018078051507472992,
-0.29408967494... | |
I am looking to get a list of the column names returned from a Model. Anyone know how this would be done, any help would be greatly appreciated.
Example Code:
```
var project = db.Projects.Single(p => p.ProjectID.Equals(Id));
```
This code would return the Projects object, how would I get a list of all the column n... | [
0.1896311342716217,
0.0583830289542675,
0.3004100024700165,
0.04739905893802643,
-0.24883083999156952,
0.09191323071718216,
0.04270142316818237,
-0.2510479986667633,
-0.1207941547036171,
-0.9843814373016357,
0.014002651907503605,
0.24494202435016632,
-0.30477774143218994,
0.091364488005638... | |
a `MetaType` which has the [`GetDataMember`](http://msdn.microsoft.com/en-us/library/system.data.linq.mapping.metatype.getdatamember.aspx) method, which takes a [`MemberInfo`](http://msdn.microsoft.com/en-us/library/system.reflection.memberinfo.aspx) parameter. You will have to use reflection on your `Projects` object ... | [
0.17652785778045654,
0.10834673047065735,
0.3774332106113434,
0.2048770934343338,
-0.11184382438659668,
0.05948329716920853,
0.22548554837703705,
-0.3657931387424469,
-0.2919481694698334,
-0.6370503902435303,
-0.14724679291248322,
0.33591166138648987,
-0.27033889293670654,
0.13229855895042... | |
Can anyone explain the differences between **Protocols** and **Categories** in Objective-C? When do you use one over the other?
A protocol is the same thing as an interface in Java: it's essentially a contract that says, **"Any class that implements this protocol will also implement these methods."**
A category, on th... | [
0.2789665758609772,
0.005522281397134066,
-0.17269425094127655,
0.1103251576423645,
-0.4050542116165161,
-0.281777024269104,
0.07232101261615753,
-0.20558017492294312,
-0.3722153604030609,
-0.4933331310749054,
0.0461181104183197,
0.38958513736724854,
-0.43707075715065,
-0.1241929680109024,... | |
class will implement; a category adds methods to an existing class.
The proper use of each, then, should be clear: **Use protocols to declare a set of methods that a class must implement, and use categories to add methods to an existing class.** | [
0.32098454236984253,
-0.20864230394363403,
-0.11223134398460388,
0.19719724357128143,
0.026797927916049957,
-0.19783630967140198,
0.35325688123703003,
-0.3481484651565552,
0.0009680294897407293,
-0.668592631816864,
-0.2886592149734497,
0.2923554480075836,
-0.34189358353614807,
-0.009503795... | |
I want to make a WPF Window that behaves like a context menu.
So, for instance - when I show the wpf window, I want it to be the topmost window and from there on out, if the user clicks anything outside of that window I want the window to be hidden again.
So far I have tried quite a few techniques but the only one th... | [
0.275384783744812,
-0.10154129564762115,
0.5016399025917053,
-0.5771279335021973,
0.1542651355266571,
-0.3012358546257019,
0.3178020119667053,
-0.13703373074531555,
-0.007162278052419424,
-0.7200317978858948,
-0.2762063145637512,
0.4972390830516815,
-0.4765695035457611,
0.23748238384723663... | |
this.CaptureMouse();
}
void Window_MouseDown(object sender, MouseButtonEventArgs e)
{
/// TODO: Check if they clicked outside the window here!
this.ReleaseMouseCapture();
this.Hide();
}
```
I also tried just handling the Deactivated event, but it also only works the first time for some reason.
Is [PopUp]... | [
0.3164106607437134,
-0.20755356550216675,
0.4767625629901886,
-0.20968323945999146,
0.2276628464460373,
-0.3161672353744507,
0.45685964822769165,
-0.3023141026496887,
-0.3498852550983429,
-0.49958375096321106,
-0.25008270144462585,
0.5363242030143738,
-0.6385271549224854,
0.056438039988279... | |
I recently [asked a question](https://stackoverflow.com/questions/353912/functional-programming-state-vs-reassignment) about functional programming, and received (good!) answers that prompted more questions (as seems to be the case with learning, sometimes). Here are a couple examples:
1. One answer made reference to ... | [
0.4702206254005432,
-0.02308790571987629,
0.0856376513838768,
-0.09853062033653259,
0.053324904292821884,
-0.14442315697669983,
0.020826071500778198,
-0.10792367905378342,
-0.6529126763343811,
-0.4261045753955841,
-0.04856162890791893,
0.26059943437576294,
-0.22953227162361145,
0.458865135... | |
changes, in the case that two people changed the same stuff. It seems like this issue could certainly come up in a multithreaded scenario... so how is "merging" done when it's important that threads see the most recent data?
2. [This answer](https://stackoverflow.com/questions/353912/functional-programming-state-vs-rea... | [
0.12236057221889496,
-0.2629161477088928,
0.3735513985157013,
0.025021947920322418,
0.5201390385627747,
-0.09952985495328903,
0.09660792350769043,
-0.22994603216648102,
-0.6871804594993591,
-0.5610546469688416,
-0.10014967620372772,
0.5248298048973083,
-0.4512101709842682,
0.23189935088157... | |
an event that would (in C# for example) do something like `bankAccount.InterestRate = newRateFromUser`. I feel like I'm being dense here, but hopefully my example makes sense: there has to be some way that the object is updated, right? Several other things may depend on the the new data.
Anyway, if you can help me get... | [
0.20383909344673157,
-0.08179090172052383,
-0.07969513535499573,
0.1142956018447876,
0.10940922796726227,
-0.21335865557193756,
0.09850253909826279,
0.3558449149131775,
-0.3181140124797821,
-0.5127258896827698,
-0.026214919984340668,
0.35290706157684326,
-0.14668412506580353,
0.12587282061... | |
allow the results of two thread's updates to be combined. There are two major strategies for that: the pessimistic and the optimistic. If you're pessimistic, you assume it's quite likely that two threads will want to update the same piece of data at the same time. So you employ locking, such that the second thread will... | [
0.4958554804325104,
0.08832844346761703,
0.16196469962596893,
0.28977563977241516,
0.3774213492870331,
-0.09929084032773972,
0.2574627697467804,
-0.0906602069735527,
-0.5004094839096069,
-0.3020719885826111,
-0.06296800076961517,
0.4136730432510376,
-0.5241609215736389,
0.2481362521648407,... | |
has to start again from the beginning - only now it starts from the results of the first thread's changes. This expensive restarting only happens occasionally though, so over all it performs better due to the lack of locking (although this is only true if your optimism was well placed about how rarely a clash occurs).
... | [
0.09332392364740372,
-0.10420544445514679,
0.10898222774267197,
0.02110855095088482,
0.15612855553627014,
-0.04033559933304787,
0.6392914056777954,
0.09295816719532013,
-0.05318576097488403,
-0.4378056228160858,
-0.27473264932632446,
0.5097383856773376,
-0.22061783075332642,
-0.00673831114... | |
operations that operate on an object representing that state. In an absurd example, consider the computer's file system. Every time a program modifies the contents of a file (even by a single byte) it has created a new "version" of the entire file system. And by extension, a new version of the entire universe. But let'... | [
-0.2570924460887909,
0.07513315975666046,
-0.18023495376110077,
0.053018540143966675,
0.1859549582004547,
-0.09882723540067673,
0.22949013113975525,
0.003858026349917054,
-0.5433678030967712,
-0.48024171590805054,
-0.4497470557689667,
0.5829851031303406,
-0.5853725075721741,
0.022046929225... | |
version of the file system. Then because this would be tedious to manually deal with, it turns the requirement inside out and says that if a function wants to be able to do IO, it must return a sort of container object. Inside the container is the value the function wants to return. But the container serves as evidence... | [
-0.024181319400668144,
-0.07654119282960892,
0.13456997275352478,
0.006585940718650818,
-0.07256399095058441,
-0.14463169872760773,
0.3858794867992401,
0.12025599181652069,
0.11717701703310013,
-0.3002195656299591,
-0.03274080157279968,
0.32054901123046875,
-0.5130219459533691,
-0.04296310... | |
Today I ran into a problem were I needed to remote-debug a program. The program was launched from another system, so I really don't have an opportunity to interact with it on the command line. I could change its source easily though.
What I needed to happen was for the program to start normally, and then wait for me t... | [
0.3129814565181732,
0.23499566316604614,
-0.016597319394350052,
0.1836315393447876,
0.24939949810504913,
0.0797807052731514,
0.2814115583896637,
0.10013984888792038,
-0.3180375099182129,
-0.4265446066856384,
0.0012705600820481777,
0.49791210889816284,
-0.4669014811515808,
0.258999615907669... | |
"set next statement" with the debugger, but it seemed awkward and rude.
```
Console.ReadLine();
```
Seemed odd to type since there wasn't actually a Console for me to press **enter** at. (It didn't work, either. Set next statement and then run takes you back into the ReadLine() wait.)
So what kind of code can I ins... | [
0.3641715347766876,
-0.17231595516204834,
0.40610772371292114,
-0.02368168905377388,
0.18444466590881348,
-0.190447598695755,
0.05890250578522682,
-0.20810967683792114,
0.031749263405799866,
-0.49907615780830383,
-0.19280774891376495,
0.6744760274887085,
-0.43188437819480896,
0.18993701040... | |
{
static void Main(string[] args)
{
Console.WriteLine("Waiting for debugger to attach");
while (!Debugger.IsAttached)
{
Thread.Sleep(100);
} | [
0.17562025785446167,
-0.2529732286930084,
0.47530660033226013,
-0.4614091217517853,
0.7373538613319397,
0.22395850718021393,
0.35132965445518494,
-0.07225209474563599,
-0.14792662858963013,
-0.447993665933609,
-0.2866922914981842,
0.5678872466087341,
-0.35265278816223145,
0.425478249788284... | |
Console.WriteLine("Debugger attached");
}
}
}
``` | [
-0.2994731664657593,
0.11427328735589981,
0.2949952781200409,
-0.09551744163036346,
0.4355357885360718,
-0.3591262698173523,
0.2021305114030838,
0.3108307719230652,
0.35928934812545776,
-0.6009082198143005,
-0.3068370819091797,
0.7952423691749573,
-0.3297884464263916,
0.33112654089927673,
... | |
In [this question,](https://stackoverflow.com/questions/346838/can-dataset-filtering-be-done-from-outside-the-dataset) I asked about breaking a dataset into subsets, and got a good response. Now I have the opposite problem. I've got two different datasets, representing objects of two different subclasses of a common an... | [
-0.09669824689626694,
-0.3040658235549927,
-0.11110395938158035,
0.03156525269150734,
-0.16861827671527863,
-0.010143423452973366,
0.21606017649173737,
-0.3243652284145355,
-0.36597421765327454,
-0.5246562957763672,
-0.08411122113466263,
0.25409093499183655,
-0.46603360772132874,
0.0897885... | |
to search. Does anyone know how I could get data from both datasets to appear together in the combo box?
Create your own TDBLookupComboBox that takes multiple data sources. . . . I've created DB aware controls before (specifically drop down combo boxes). They are pretty easy to do and give you all the control you need. | [
0.4562438726425171,
-0.3788618743419647,
-0.025200944393873215,
0.47515395283699036,
-0.2161298245191574,
-0.27247631549835205,
0.35817962884902954,
-0.1288217306137085,
0.07153338938951492,
-0.7524315714836121,
0.1261064112186432,
0.6131136417388916,
-0.3848533630371094,
-0.00796984788030... | |
I have a table where I store customer sales (on periodicals, like newspaper) data. The product is stored by issue. Example
```
custid prodid issue qty datesold
1 123 2 12 01052008
2 234 1 5 01022008
1 123 1 | [
0.33489128947257996,
0.46893298625946045,
0.6894547939300537,
-0.16131632030010223,
-0.0566675178706646,
0.3429763615131378,
-0.23972688615322113,
-0.042745985090732574,
-0.032811734825372696,
-0.05448616296052933,
-0.07380460202693939,
0.33658120036125183,
-0.0022397285792976618,
0.375100... | |
5 01012008
2 444 2 3 02052008
```
How can I retrieve (whats a faster way) the get last issue for all products, for a specific customer? Can I have samples for both SQL Server 2000 and 2005? Please note, the table is over 500k rows.
Thanks
Assuming that "latest" is determined by date (rath... | [
0.14239947497844696,
-0.015009315684437752,
0.612217366695404,
0.2737596035003662,
-0.16457046568393707,
-0.043089404702186584,
0.009189151227474213,
-0.17428505420684814,
-0.18995200097560883,
-0.2775755226612091,
-0.09132545441389084,
0.38710856437683105,
0.028081286698579788,
0.12121969... | |
T1.issue
FROM
Sales T1
LEFT OUTER JOIN dbo.Sales T2 ON
T2.custid = T1.custid AND
T2.prodid = T1.prodid AND
T2.datesold > T1.datesold
WHERE
T1.custid = @custid AND
T2.custid IS NULL
```
Handling 500k rows is something that a laptop can probably handle without trouble, let alone a real ser... | [
-0.02208304964005947,
0.24546687304973602,
0.34523805975914,
0.14200793206691742,
0.08769958466291428,
0.18452008068561554,
0.19119495153427124,
-0.050503041595220566,
-0.2591555714607239,
-0.30707496404647827,
-0.129192516207695,
0.28252747654914856,
-0.022891048341989517,
0.3601019382476... | |
this doesn't specifically handle cases where two issues have the same exact datesold. You might need to tweak it based on your business rules for that situation. | [
0.2306249737739563,
0.17461737990379333,
0.02923073060810566,
0.091488778591156,
0.49765756726264954,
-0.38468098640441895,
-0.2565566897392273,
0.15431329607963562,
-0.3635214567184448,
-0.48396337032318115,
0.49464309215545654,
0.1195807158946991,
-0.05897681042551994,
0.0851290076971054... | |
I made an html file called test.html then I navigated to it as "<http://site.com/test.html?test1=a>" but the textbox stayed blank. Why is this?
Super simple code
```
<html>
<head>
<title>Test</title>
</head>
<body >
<input type=text name="test1">
</body>
</html>
```
The file should be a PHP file, so test.php.
The... | [
0.8479179739952087,
0.1043224111199379,
0.09607682377099991,
0.09219920635223389,
-0.32203409075737,
-0.1758297085762024,
0.4665312170982361,
-0.3445494771003723,
0.02559485100209713,
-0.6523113250732422,
0.20951758325099945,
0.18343330919742584,
-0.21577028930187225,
0.04941495880484581,
... | |
it to the [htmlspecialchars](http://us2.php.net/htmlspecialchars) function will help prevent [cross-site scripting](http://en.wikipedia.org/wiki/Cross-site_scripting). | [
0.007958028465509415,
-0.0038907453417778015,
0.6031278371810913,
-0.04164852201938629,
-0.08172855526208878,
-0.25594794750213623,
0.3138199746608734,
0.13303233683109283,
-0.125987246632576,
-0.7646204233169556,
-0.3797912895679474,
0.17136454582214355,
-0.10969415307044983,
-0.093075126... | |
I have a cookie which is generated from a servlet and that I would like to be persistent - that is, set the cookie, close down IE, start it back up, and still be able to read the cookie. The code that I'm using is the following:
```
HttpServletResponse response =
(HttpServletResponse) FacesContext.getCurrentInsta... | [
0.12218620628118515,
0.1873365193605423,
0.7104343771934509,
-0.23755551874637604,
0.1160910502076149,
-0.14957483112812042,
0.47764745354652405,
-0.08004410564899445,
-0.09540162980556488,
-0.976154088973999,
-0.2661404311656952,
0.6465385556221008,
-0.33504554629325867,
0.052194099873304... | |
out what would be causing the cookie to be deleted. As far as I know, calling setMaxAge with a positive number makes the cookie persistent. Any ideas why this would be going wrong?
**Edit**
I have verified, using the more info trick suggested by Olaf, that the cookie is attempting to be set as a session cookie, not a... | [
0.4644254446029663,
0.3199995756149292,
0.6477285623550415,
-0.0860162302851677,
0.02924957312643528,
-0.4116992950439453,
0.6231870651245117,
0.025433635339140892,
-0.28220921754837036,
-0.5476323962211609,
-0.26842939853668213,
0.7190951704978943,
-0.12571901082992554,
-0.031415916979312... | |
going on.
I know nothing of Java or servlets, but IE will only persist a cookie if it has an Expires date, setting max-age is not sufficient, IE will continue to treat it as a session cookie. | [
0.5996935963630676,
0.13704624772071838,
0.48844775557518005,
-0.2455594837665558,
0.4205600619316101,
-0.4207671284675598,
0.43500348925590515,
0.20410603284835815,
-0.47002360224723816,
-0.39056533575057983,
-0.019143080338835716,
0.30783864855766296,
0.08235722780227661,
0.3616090416908... | |
How do I get the sequence number of the row just inserted?
insert ... returning.
```
declare
s2 number;
begin
insert into seqtest2(x) values ('aaa') returning seq into s2;
dbms_output.put_line(s2);
end;
```
"seq" here refers to the name of the column whose value you want to store into variable s2.
in py... | [
-0.10042477399110794,
0.25119221210479736,
0.4310169517993927,
-0.34714430570602417,
0.2527329921722412,
0.059795595705509186,
0.3191855847835541,
-0.4740988612174988,
0.06332084536552429,
-0.6754143238067627,
-0.25525298714637756,
0.5186140537261963,
-0.3098348379135132,
0.096818879246711... | |
When using the 'as' keyword in C# to make a cast which fails, null gets returned. What's going on in the background? Is it simply suppressing an exception so I don't have to write handling code for a failure?
I'm interested in the performance characteristics of it compared to a typical cast wrapped in a try-catch.
It'... | [
0.4195424020290375,
0.014723991975188255,
-0.09331467747688293,
-0.15521253645420074,
-0.1918841153383255,
-0.030441949144005775,
0.28818798065185547,
-0.455578476190567,
0.0000328243404510431,
-0.5371732711791992,
-0.16263742744922638,
0.4621928632259369,
-0.29907041788101196,
-0.11346112... | |
just suppress an exception, and is orders of magnitude faster than doing so.
Note that there are some differences in behaviour between the `isinst` instruction and `castclass` - the main one being that `isinst` does not take into account user-defined cast operators, it only considers direct inheritance hierarchy, e.g.... | [
0.3401923179626465,
-0.35385966300964355,
0.013790843077003956,
-0.20700150728225708,
0.18824222683906555,
-0.36178797483444214,
0.5660474896430969,
-0.4125133156776428,
-0.08777960389852524,
-0.3194271922111511,
-0.12271501868963242,
0.7909101843833923,
-0.5037845373153687,
-0.15076361596... | |
B { Foo = a.Foo };
}
}
```
Then the following will succeed:
```
var a = new A { Foo = 3 };
var b = (B)a;
Console.WriteLine(b.Foo); // prints 3
```
However the following does not compile, with the error 'Cannot convert type 'A' to 'B' via a reference conversion, boxing conversion, unboxing conversion, wrapping ... | [
0.31301307678222656,
0.28049707412719727,
0.18931829929351807,
-0.43565991520881653,
-0.024026526138186455,
0.08475959300994873,
0.5823180675506592,
-0.6907040476799011,
-0.05803515762090683,
-0.5928409099578857,
-0.09979897737503052,
0.5315618515014648,
-0.5616092681884766,
0.026677183806... | |
this difference. | [
0.14407140016555786,
-0.007762932684272528,
-0.07856180518865585,
-0.006592651829123497,
-0.33910393714904785,
0.21321454644203186,
-0.12154505401849747,
-0.2962745428085327,
-0.04320237785577774,
-0.8674889206886292,
0.5053747296333313,
0.054914411157369614,
-0.053579773753881454,
0.20130... | |
I'm trying to build my first generic list and have run into some problems. I understand the declaration looks like " `List<T>` ", and I have `using System.Collections.Generic;` at the top of my page. However, Visual Studio doesn't recognize the `T` variable.
What am I missing?
`List<T>` means `List<WhateverTypeYouWan... | [
0.2643422782421112,
-0.07812861353158951,
0.12433557957410812,
-0.017442820593714714,
-0.3110799789428711,
-0.0008231308893300593,
0.07034790515899658,
-0.165466770529747,
-0.46348997950553894,
-0.577472984790802,
-0.07147398591041565,
0.44476568698883057,
-0.4570600390434265,
0.2609686553... | |
= new Employee();
employeeList.Add(emp1);
employeeList.Add(emp2);
```
`employeeList` now holds `emp1` and `emp2` as objects.
There are several facets to generic collections, the most important being they provide an object independent way of having a... well... collection of objects. They are type-safe; which means ... | [
0.2501906752586365,
0.01655150204896927,
0.06015172228217125,
0.05733174458146095,
-0.20608244836330414,
0.051269423216581345,
0.17751853168010712,
-0.36560049653053284,
-0.6301484107971191,
-0.3996173143386841,
-0.10560736805200577,
0.3632994294166565,
-0.4785560071468353,
0.3093006014823... | |
provides another way to reuse code -- independent of any class hierarchy or implementation details of a specific class.
More information [here](http://missingmanuals.com/pub/a/dotnet/2005/06/20/generics.html). | [
0.33436933159828186,
-0.21648508310317993,
0.02114088460803032,
0.06240256130695343,
-0.1303744614124298,
-0.14409905672073364,
0.5916757583618164,
0.038664285093545914,
-0.7940938472747803,
0.026756681501865387,
-0.1164623275399208,
0.12092780321836472,
-0.4150049686431885,
0.327117979526... | |
I have three DIVs, something like this:
```
<div id="header">
...
</div>
<div id="content">
<div id="popup">
...
</div>
</div>
```
DIV#header is "position: fixed" and used as a non-scrolling header at the top of the screen. DIV#content has some content in it and is "position: relative". DIV#popup... | [
0.009619547985494137,
-0.1369449347257614,
0.8915724158287048,
-0.16725818812847137,
-0.11740156263113022,
-0.08339192718267441,
-0.03448539227247238,
0.037413809448480606,
0.07908263802528381,
-0.8818767070770264,
-0.10823405534029007,
0.5547353029251099,
-0.3539904057979584,
0.0082752378... | |
popups are behind the header. I can fix this by setting the z-index of DIV#content to be higher than the header, but then of course DIV#content will also be displayed above DIV#header when they overlap, which I don't want.
It sounds like I might be affected by what is described on [this page](http://annevankesteren.nl... | [
-0.10794650763273239,
0.06934696435928345,
0.6687088012695312,
-0.07751432061195374,
-0.07123926281929016,
-0.11230824142694473,
0.02220134623348713,
0.12680459022521973,
-0.3981735110282898,
-0.6200572848320007,
-0.07169102877378464,
0.2561953067779541,
-0.6100623607635498,
0.103287406265... | |
Firefox (such that Firefox now behaves like IE).
What's the real deal with z-indexes in IE?
Turns out that the edit control (At least in my development environment) is a combo box, so `EM_SETLIMITTEXT` isn't appropriate.
Instead, I tracked down the combo box using `GetDlgCtrl` on the parent of the file open dialog (... | [
0.21043746173381805,
0.04694695398211479,
0.6871621012687683,
-0.116104356944561,
0.2589799463748932,
-0.345472127199173,
0.16249865293502808,
-0.15024390816688538,
-0.1107410117983818,
-0.7313036918640137,
-0.1303967386484146,
0.7158302068710327,
-0.6608381271362305,
0.010614574886858463,... | |
`OPENFIILENAME.nMaxFile` value that is passed in. | [
-0.2086993157863617,
0.09153842180967331,
0.4333486557006836,
-0.07060811668634415,
0.28240877389907837,
-0.2083156257867813,
0.08575845509767532,
-0.09667468070983887,
-0.02774304524064064,
-0.7175760865211487,
-0.3313971161842346,
0.0981433242559433,
-0.391986608505249,
0.345877647399902... | |
Our issue is that our project has files being downloaded using wget to the file system. We are using ruby to read the downloaded files for data.
How is it possible to tell if the file is completely downloaded so we don't read a half complete file?
I asked a [very similar question](https://stackoverflow.com/questions... | [
0.5092729330062866,
0.007639741990715265,
0.12638963758945465,
0.43063583970069885,
0.18104515969753265,
-0.38575583696365356,
0.15720339119434357,
-0.21423394978046417,
-0.09789115190505981,
-0.4601482152938843,
-0.20111021399497986,
0.4595884382724762,
0.05676231533288956,
-0.06977303326... | |
and see if its size has stopped increasing;
* check the file's permissions (some download processes block reads during download);
* use another method like in-thread download by the Ruby process.
To quote Martin Cowie, "This is a middleware problem as old as the hills"... | [
0.1970273107290268,
0.2510863244533539,
-0.023426787927746773,
-0.1418672502040863,
0.2774985730648041,
-0.21833370625972748,
0.3049735128879547,
-0.040395379066467285,
-0.38375553488731384,
-0.13740777969360352,
-0.3849286139011383,
0.42247068881988525,
-0.18424533307552338,
0.35892799496... | |
I am using jQuert .ajax function to call a page method. The site is using FormsAuthentication. So when an authentication ticket expires a call to the page method will obviously cause a redirect to the login page.
Now, the geniuses that wrote the System.Web.Handlers.ScriptModule decided that if for some reason a REST ... | [
0.3275703191757202,
0.17922420799732208,
0.3644827902317047,
0.028880788013339043,
0.025394730269908905,
-0.3677841126918793,
0.48633873462677,
-0.012535272166132927,
-0.03506382182240486,
-0.5689655542373657,
0.04251059144735336,
0.3405632972717285,
-0.11121898144483566,
0.117901816964149... | |
in their username and password, which means nothing, because FormsAuthentication is used. Finally, when the user clicks Cancel, the 401 comes through to the error handler.
So, the question is, how can one disable the browser's login UI prompt in any way? Some people on the web suggest to use a username and password i... | [
0.33546900749206543,
0.1397407501935959,
0.27458542585372925,
0.24461238086223602,
0.43593671917915344,
-0.12855662405490875,
0.28042301535606384,
0.24361421167850494,
-0.0073905023746192455,
-0.4653915762901306,
-0.08589332550764084,
0.7084121108055115,
-0.07428918778896332,
-0.2046294510... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.