text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
LinkButton. The example on MSDN wires up a similar bit of JavaScript to the links to trigger server-side events on the GridView.
The more practical uses are when you want to handle postbacks in a custom control. Your control implements [IPostBackEventHandler](http://msdn.microsoft.com/en-us/library/system.web.ui.ipost... | [
0.09211315214633942,
-0.2963951826095581,
0.4458445906639099,
0.22658252716064453,
-0.24465015530586243,
-0.22851401567459106,
0.03311175853013992,
-0.0036168580409139395,
-0.4338066577911377,
-0.7204998731613159,
-0.02030283957719803,
0.16602477431297302,
-0.4398795962333679,
0.1582653820... | |
This very simple code gives me tons of errors:
```
#include <iostream>
#include <string>
int main() {
std::string test = " ";
std::cout << test;
}
```
I tried to compile it on linux by typing **gcc -o simpletest simpletest.cpp** on the console. I can't see why it isn't working. What is happening?
Try using ... | [
0.01037744339555502,
0.21985477209091187,
0.24968338012695312,
-0.21483927965164185,
0.13274845480918884,
-0.09260410815477371,
0.5416430234909058,
0.09861326962709427,
-0.07449944317340851,
-0.4606902003288269,
0.1344877928495407,
0.677790641784668,
-0.6278276443481445,
0.0777999088168144... | |
I started out with a generic interface called ILogin. The interfaces requires that you implement two properties: UserID and Password. I have many login-type classes that implement this interface. As my project grew and grew, I found that many classes repeated the UserID and Password code. Now I decide that I need a bas... | [
0.29017841815948486,
-0.1334974616765976,
-0.05615190044045448,
0.10325104743242264,
-0.2085527777671814,
0.02768406644463539,
-0.053694456815719604,
0.04409711807966232,
0.06989847868680954,
-0.7649011611938477,
0.3528154790401459,
0.521077036857605,
-0.5064370632171631,
0.312563657760620... | |
I started think that ILogin was probably unneeded because it'll likely only ever be implemented by my abstract class.
Is there a benefit to keeping both the abstract class and the interface around?
Thanks!
Definitely. Let's think of a concrete example.
Say we have an abstract class `Animal`.
Say, we make some subcla... | [
0.6469573974609375,
0.13553765416145325,
-0.11091312021017075,
0.18117234110832214,
-0.0144371148198843,
0.22186845541000366,
0.11533485352993011,
0.09685742855072021,
-0.26187601685523987,
-0.9447999000549316,
0.16418348252773285,
0.6081072688102722,
-0.6402394771575928,
0.060262329876422... | |
it wouldn't be easy to come up with a common ancestor for the two that we can have as an abstract class. This would best be implemented by an interface `IFly`.
The `IFly` interface can have a `Fly()` method to be implemented. Both `Mosquito` and `Eagle` classes can both be subclasses of the abstract class `Animal` and... | [
0.5176413655281067,
0.012526851147413254,
-0.1272687166929245,
0.17870064079761505,
0.009255019016563892,
0.1930970847606659,
-0.11739815771579742,
-0.021586855873465538,
-0.05229930952191353,
-1.1205850839614868,
0.23924845457077026,
0.2571340501308441,
-0.47541117668151855,
0.43521952629... | |
Why is the dropdown not showing my blank item first? Here is what I have
```
drpList.Items.Add(New ListItem("", ""))
With drpList
.DataSource = myController.GetList(userid)
.DataTextField = "Name"
.DataValueField = "ID"
.DataBind()
End With
```
Edit ~ I am binding to a Generig List, could this be th... | [
0.014432946220040321,
-0.17193841934204102,
0.35596370697021484,
0.052930787205696106,
0.13061769306659698,
-0.04294482618570328,
0.18128179013729095,
-0.262608140707016,
-0.09543707221746445,
-0.5191830992698669,
-0.0927954614162445,
0.21747297048568726,
-0.43592220544815063,
0.3845202028... | |
I’m trying to implement a dictionary for use with WCF. My requirements are:
* actual (private variable or base
class) type equivalent to
Dictionary
* Comparer
= `System.StringComparer.InvariantCultureIgnoreCase`
* Custom (override/new) Add(key,
value) method (to include
validations).
* Override ToString()
* Use of the... | [
0.39354193210601807,
0.07828042656183243,
0.6996939182281494,
-0.10182727873325348,
-0.12866660952568054,
0.10346148908138275,
0.24631594121456146,
-0.4796302616596222,
0.12798158824443817,
-0.6549983620643616,
0.14083553850650787,
0.4818255603313446,
-0.19622129201889038,
0.33628624677658... | |
ResultClass
{
public object Value{ get; set; }
/* More properties */
}
public class ParmData
{
public object Value{ get; set; }
/* More properties */
}
[DataContract]
[KnownType(typeof(MyDictionary))]
[KnownType(typeof(object[]))]
[KnownType(typeof(double[]))]
[KnownType(typeof(string[]))]
[KnownType(typeof(Dat... | [
-0.06916362047195435,
-0.11428643763065338,
0.515184223651886,
-0.08286552131175995,
-0.15995047986507416,
0.03137492015957832,
0.39583873748779297,
-0.4639364778995514,
-0.058195799589157104,
-0.5350092649459839,
-0.018041063100099564,
0.47089728713035583,
-0.1497730016708374,
0.380644708... | |
for is to either fix my failed attempt, or a completely different way to achieve my stated requirements. Any solution should not involve copying one dictionary to another.
Thanks
* Use the `CollectionDataContract` attribute as jezell suggested
* Manually generate the reference (proxy) code with SvcUtil, using the /col... | [
0.4700399339199066,
0.018306968733668327,
0.4711076319217682,
0.11545099318027496,
-0.07326390594244003,
-0.21332895755767822,
0.34858736395835876,
-0.32451555132865906,
-0.2546047568321228,
-0.49074786901474,
0.02936767227947712,
0.5437760353088379,
-0.13439828157424927,
0.116719104349613... | |
I'm working on an ASP.Net application and working to add some Ajax to it to speed up certain areas. The first area that I am concentrating is the attendance area for the teachers to report attendance (and some other data) about the kids. This needs to be fast.
I've created a dual-control set up where the user clicks o... | [
0.37282705307006836,
-0.1242382675409317,
0.3225468695163727,
0.3534797728061676,
-0.010983924381434917,
-0.09056703746318817,
0.007863699458539486,
0.39736443758010864,
-0.17438308894634247,
-0.9131775498390198,
-0.10758935660123825,
0.280778706073761,
0.15439467132091522,
-0.138168081641... | |
and ignore the audio background).
It's slower than I would like at 2-3 seconds in Firefox and Chrome for each "popping up", but it's entirely unworkable in IE, taking easily 7-8 seconds for each time it pops up and loads. And that disregards any time that is needed to save the data after it's been changed.
Here's the... | [
0.07521393150091171,
-0.0882883369922638,
0.8416569828987122,
-0.3503427803516388,
-0.06730464845895767,
-0.2065250277519226,
0.41508567333221436,
-0.3281230926513672,
-0.03166640177369118,
-0.8776850700378418,
-0.3825719952583313,
0.8671488165855408,
-0.294418066740036,
-0.047819834202528... | |
guid == displayIDFld.value)) {
myStyle.display = 'none';
} else {
// Get a reference to the PageRequestManager.
var prm = Sys.WebForms.PageRequestManager.getInstance();
// Unblock the form when a partial postback ends.
prm.add_endRequest(function() {
$('#" + this... | [
-0.1921326369047165,
-0.19969788193702698,
1.020190954208374,
-0.331270694732666,
-0.09138816595077515,
0.2482973039150238,
0.4170812666416168,
-0.1996472328901291,
0.06360587477684021,
-0.7835096120834351,
-0.3677047789096832,
0.30968979001045227,
-0.5154280066490173,
0.39722153544425964,... | |
var domEl = Sys.UI.DomElement;
//Move it into position
var loc = domEl.getLocation(callingControl);
var width = domEl.getBounds(callingControl).width;
domEl.setLocation(myPnl, loc.x + width, loc.y - 200);
//Show it and block it until we finish loading the data
myStyle.di... | [
0.49631625413894653,
-0.2803075611591339,
1.1111079454421997,
-0.33713001012802124,
0.17904509603977203,
0.23922376334667206,
0.15253514051437378,
-0.2060908079147339,
-0.20416860282421112,
-0.6392269134521484,
-0.42664897441864014,
0.36192014813423157,
-0.5730696320533752,
0.2830483913421... | |
'0.7'} });
//Load the data
if(guid != '') { displayIDFld.value = guid; }
__doPostBack('" + UpdatePanel1.ClientID + @"','');
}
}}
```
First, I don't understand why the \_\_doPostBack() introduces such a delay in IE. If I take that and the prm.add\_endRequest out, it's VERY speedy as no p... | [
-0.0313795767724514,
0.1389295607805252,
0.745123565196991,
-0.13813242316246033,
0.18596796691417694,
-0.016009347513318062,
0.2656233608722687,
-0.21518166363239288,
0.022579040378332138,
-0.6906917691230774,
-0.07846301794052124,
0.5359143614768982,
-0.006495911628007889,
0.215986981987... | |
haven't been able to figure out how to do it with a Web Service/static page method. As you can see this control is loaded many times on the same page so page size and download speed is an issue.
I'd appreciate any ideas?
Edit: It's the same in IE 6 or 7. I'm thinking it has to do with IE's handling of the UpdatePanel... | [
0.43908628821372986,
-0.043895646929740906,
0.4120722711086273,
0.14068248867988586,
-0.45188385248184204,
-0.26600149273872375,
0.29991045594215393,
0.254854291677475,
-0.16010428965091705,
-0.8345181345939636,
-0.026643790304660797,
0.8264138102531433,
-0.26360857486724854,
-0.1348276138... | |
among other crap, and forces the page to go through the whole life cycle every time (even though the user doesn't see this).
You should be able to (relatively easily) use PageMethods to accomplish your task.
```
// In your aspx.cs define the server-side method marked with the
// WebMethod attribute and it must be pu... | [
0.2152523398399353,
0.1256953775882721,
0.692625105381012,
-0.0980624333024025,
0.07720421254634857,
-0.26234373450279236,
0.6092970371246338,
0.3652515113353729,
-0.2877053916454315,
-0.6731131076812744,
-0.2550702393054962,
0.32566455006599426,
-0.4778798520565033,
0.4722472131252289,
... | |
I'd like to write a Silverlight app that has 2 or more browser windows that "interact".
An example would be a parent/details display where selecting an item in the "Parent" list (in one browser window) will display the details of the item in another window.
The main point is so that on a multiple-monitor setup the ... | [
0.5653500556945801,
-0.02408892847597599,
0.14487318694591522,
0.18941320478916168,
-0.21436677873134613,
-0.11101347953081131,
0.17895394563674927,
-0.09255079180002213,
-0.09434424340724945,
-1.1289963722229004,
0.23630228638648987,
0.28662508726119995,
-0.3253960907459259,
0.13434942066... | |
you could use javascript to spawn a new window with the url of the child window. At that point you could continue to use javascript to communicate between the two windows. Something like this: <http://codepunk.hardwar.org.uk/bjs12.htm> | [
0.7810532450675964,
-0.13784918189048767,
0.048616115003824234,
0.02303183823823929,
-0.23581823706626892,
0.16310712695121765,
0.34555327892303467,
0.16658297181129456,
-0.1571853756904602,
-0.5292470455169678,
-0.03695313632488251,
0.5264666676521301,
-0.058046698570251465,
0.04132960364... | |
I have seen 3d surface plots of data before but i do not know what software i could use to make it.
I have 3 series of data (X, Y, Z) basically i want each of the rows on the table to be a point in 3d space, all joined as a mesh. The data is currently csv, but i can change the format, as it is data i generated myself.... | [
0.19241982698440552,
0.19811753928661346,
0.7596981525421143,
0.2299593836069107,
0.010588397271931171,
0.21626970171928406,
-0.35963353514671326,
-0.06183861568570137,
-0.352459192276001,
-0.8990172147750854,
0.28791478276252747,
0.010578139685094357,
-0.051542360335588455,
0.696269750595... | |
so that x(r:r+1,c:c+1) and y(r:r+1,c:c+1) define a quadrilateral on your mesh, for each row r and column c.
If your data do not lie on a grid, but you know what the faces should be, look at the PATCH function.
If you only have points and you don't know anything about the surface, you need to first solve the [surface ... | [
0.10833657532930374,
0.10604361444711685,
0.43822818994522095,
-0.11052126437425613,
-0.2434290051460266,
0.3497079908847809,
-0.11653720587491989,
-0.2293238788843155,
-0.18381386995315552,
-1.009063959121704,
0.026634464040398598,
0.43113234639167786,
-0.21918436884880066,
0.035516437143... | |
We need to handle this event in the base form, regardless of which controls currently have focus. We have a couple of global key commands that need to work regardless of control focus.
This works by handling the PreviewKeyDown event in the form normally. When we add a user control to the form, the event no longer fire... | [
0.12559452652931213,
-0.2294895499944687,
0.45096448063850403,
0.34797903895378113,
-0.2738546133041382,
-0.44240865111351013,
0.45682665705680847,
-0.1855982393026352,
0.01404920220375061,
-0.4838879704475403,
-0.0023293830454349518,
0.7589316368103027,
-0.17649142444133759,
-0.0917507261... | |
setting up a hidden menu item by setting:
```
ToolStripMenuItem.Visible = false
```
(Thanks to [this article)](http://blogs.msdn.com/jfoscoding/archive/2005/01/24/359334.aspx).
It appears that the Main Menu of a form always gets searched for your shortcut key combination. This works regardless of whick control has ... | [
0.00033986399648711085,
-0.2684437930583954,
0.16872477531433105,
0.0031159454956650734,
0.1711718738079071,
-0.08895718306303024,
0.7114888429641724,
-0.133658766746521,
-0.2454954832792282,
-0.5088573098182678,
-0.32284530997276306,
0.6785964965820312,
-0.36719921231269836,
-0.0835237130... | |
I would like to write an application that will copy MP3 files to a SanDisk Sansa M240. The SanDisk doesn't have a drive letter and uses MTP for file transfer.
I stumbled through the sample of connecting to the device at : <http://blogs.msdn.com/dimeby8/archive/2006/09/27/774259.aspx>
but once connected, I can't figur... | [
0.1342109739780426,
0.08262889832258224,
0.16764192283153534,
0.16249608993530273,
-0.16572408378124237,
-0.12059645354747772,
0.21133634448051453,
-0.2548670172691345,
-0.3953157663345337,
-0.6605687141418457,
0.0028449082747101784,
0.4596586227416992,
-0.36049944162368774,
0.316025376319... | |
part 2](https://learn.microsoft.com/en-us/archive/blogs/dimeby8/sending-mtp-commands-through-wpd-part-2-data-to-the-device)
[Sending MTP commands through WPD part 3](https://learn.microsoft.com/en-us/archive/blogs/dimeby8/sending-mtp-commands-through-wpd-part-3-data-from-device) | [
-0.4021676778793335,
-0.22902847826480865,
0.6401015520095825,
-0.06689498573541641,
-0.06407950073480606,
0.08636482059955597,
0.2761092483997345,
-0.5631527900695801,
-0.28437474370002747,
-0.3692873418331146,
-0.5352716445922852,
0.3738439679145813,
-0.2591700255870819,
-0.1690225750207... | |
It seems if I do something like
```
$file = fopen($filepath, "w");
$CR = curl_init();
curl_setopt($CR, CURLOPT_URL, $source_path);
curl_setopt($CR, CURLOPT_POST, 1);
curl_setopt($CR, CURLOPT_FAILONERROR, true);
curl_setopt($CR, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($CR, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($CR, C... | [
0.23432916402816772,
-0.11307137459516525,
0.5349234342575073,
-0.2551015317440033,
0.12317683547735214,
-0.19667036831378937,
0.7176398634910583,
-0.2925368845462799,
-0.16629283130168915,
-0.616293728351593,
-0.3013113737106323,
0.31445613503456116,
-0.38387224078178406,
0.12262013554573... | |
Despite an earlier question ([asked here](https://stackoverflow.com/questions/223894/opengl-rotation-using-gldrawpixels)), our project is constrained to using glDrawPixels, so we have to do some hackery.
One of the feature requirements is to be able to have a magnified view show up on a clicked region of an image; so,... | [
-0.036401767283678055,
-0.13099782168865204,
0.6877976655960083,
0.13980057835578918,
0.0484565906226635,
-0.2213820368051529,
0.07030799239873886,
-0.1077382043004036,
-0.18627849221229553,
-0.5554535984992981,
-0.14486977458000183,
0.7970574498176575,
-0.36386552453041077,
0.023065738379... | |
Gl.glClearColor(0.1f, 0.1f, 0.1f, 0.0f);
Gl.glPixelStorei(Gl.GL_UNPACK_ALIGNMENT, 2);
Gl.glPolygonMode(Gl.GL_FRONT_AND_BACK, Gl.GL_LINE);
Gl.glDisable(Gl.GL_SCISSOR_TEST);
Gl.glDisable(Gl.GL_ALPHA_TEST);
Gl.glDisable(Gl.GL_STENCIL_TEST);
Gl.glDisable(Gl.GL_DEPTH_TEST);
... | [
-0.07044170796871185,
-0.34987974166870117,
0.9531598091125488,
0.009444698691368103,
-0.3113487660884857,
0.50296950340271,
0.27596569061279297,
-0.14658553898334503,
-0.1152767464518547,
-0.5820052027702332,
-0.3605562448501587,
0.4307726323604584,
-0.5144006013870239,
0.1540346741676330... | |
Gl.glDisable(Gl.GL_TEXTURE_1D);
Gl.glDisable(Gl.GL_TEXTURE_2D);
Gl.glPixelTransferi(Gl.GL_MAP_COLOR, Gl.GL_TRUE);
Gl.glPixelTransferf(Gl.GL_RED_SCALE, 1.0f);
Gl.glPixelTransferi(Gl.GL_RED_BIAS, 0);
Gl.glPixelTransferf(Gl.GL_GREEN_SCALE, 1.0f);
Gl.glPixelTransferi(Gl.GL_GR... | [
-0.36842238903045654,
-0.1852431744337082,
0.9351619482040405,
-0.1664406657218933,
-0.27359244227409363,
0.30564314126968384,
0.259805291891098,
-0.3467696011066437,
-0.47782406210899353,
-0.935538113117218,
-0.6788163781166077,
0.5983462929725647,
-0.467633992433548,
0.09796742349863052,... | |
make the smaller-but-zoomed image looks like
```
int width = (int)((this.Width * 0.2)/2.0);
Gl.glReadBuffer(Gl.GL_FRONT_AND_BACK);
Gl.glRasterPos2i(0, 0);
Gl.glBitmap(0, 0, 0, 0, mStartX - (width*2), mStartY, null);
Gl.glPixelZoom(2.0f, 2.0f);
Gl.glCopyPixels(mStartX - ... | [
-0.19761396944522858,
-0.3781338632106781,
0.9407860040664673,
-0.0823308452963829,
-0.08058270066976547,
0.2709695100784302,
0.33088743686676025,
0.05364159867167473,
-0.2745414674282074,
-0.6596506834030151,
-0.2984168827533722,
0.6104800701141357,
-0.4713474214076996,
0.0637438073754310... | |
the image down to essentially a black-and-white binary image (ie, no shades of grey).
The data is a black-and-white unsigned short array, and is set with this code:
```
float step = (65535.0f / (float)(max - min));
mColorTable = new ushort[65536];
int i;
for (i = 0; i < 65536; i++)
... | [
0.18751077353954315,
0.08564837276935577,
0.9025130867958069,
-0.06619098037481308,
0.5565701723098755,
0.3914567530155182,
0.23996827006340027,
-0.3759928047657013,
-0.020385753363370895,
-0.5527690649032593,
-0.3763481080532074,
0.5034950375556946,
-0.1993424892425537,
0.3304831385612488... | |
min)
mColorTable[i] = 0;
else if (i > max)
mColorTable[i] = 65535;
else
mColorTable[i] = (ushort)((float)(i - min) * step);
} | [
0.04136093333363533,
-0.2751620411872864,
0.8172973990440369,
-0.20389506220817566,
0.5273372530937195,
0.5750300288200378,
0.7100306153297424,
-0.9575077891349792,
-0.2605499029159546,
-0.3773435652256012,
-0.25603538751602173,
0.712492823600769,
-0.03765498846769333,
0.057719599455595016... | |
.... //some irrelevant code
Gl.glPixelMapusv(Gl.GL_PIXEL_MAP_R_TO_R, 65536, mColorTable);
Gl.glPixelMapusv(Gl.GL_PIXEL_MAP_G_TO_G, 65536, mColorTable);
Gl.glPixelMapusv(Gl.GL_PIXEL_MAP_B_TO_B, 65536, mColorTable);
```
Now, according to [this documentation](http://www.ugrad.cs.ubc.ca/~cs414/op... | [
-0.052764877676963806,
-0.030767042189836502,
0.7702526450157166,
-0.08630970865488052,
-0.09100235253572464,
0.33256375789642334,
-0.2371819168329239,
0.0455683097243309,
-0.651846170425415,
-0.6666056513786316,
-0.3152458071708679,
0.345214307308197,
-0.42963674664497375,
0.0416636019945... | |
I avoid the clamping of the magnified view? Should I make a second control that follows the cursor and gets filled in with data from the first control? That approach seems like it would take the array copies outside of the graphics card and into C#, which would almost by definition be slower, and so make the control no... | [
-0.10347063839435577,
0.10641342401504517,
0.714657723903656,
-0.1069999411702156,
-0.10080642253160477,
-0.05154354125261307,
0.05501022934913635,
-0.3826087415218353,
-0.2536611557006836,
-0.5064411163330078,
-0.189865380525589,
0.9724240303039551,
-0.37159207463264465,
-0.13002754747867... | |
is removed.
@thing2k-- your solution causes the copy to happen outside the graphics card, so slows down the drawing on mouse drag, but doesn't fix the double clamp. | [
0.25482988357543945,
-0.033306580036878586,
0.5409429669380188,
0.30648040771484375,
0.3101058900356293,
-0.07581543177366257,
0.39143577218055725,
-0.09442279487848282,
-0.07842627167701721,
-0.31079643964767456,
-0.408583402633667,
0.21794748306274414,
-0.14831678569316864,
0.00579457264... | |
I'm am building my asp.net web application using MVC (Preview 5),
and am also using the Master pages concept.
My PageA and PageB are both content pages. I'm doing a form submit
in a method via JavaScript from PageA to PageB.
PageB has its PreviousPageType attribute set to PageA, but when I access the
PreviousPage ... | [
0.3868120610713959,
0.08262566477060318,
0.6757408976554871,
-0.12171407788991928,
-0.3079151213169098,
0.12457231432199478,
0.20278702676296234,
-0.37146127223968506,
0.03191547840833664,
-0.9940732717514038,
0.19328387081623077,
0.3100240230560303,
-0.22834287583827972,
0.218776077032089... | |
= 1
while ($index <= $maxIndex)
printf "%-20s %s\n" "$correctList[$index]" "$wrongList[$index]"
@ index++
end
``` | [
-0.030874771997332573,
0.10900616645812988,
0.500909686088562,
-0.35854485630989075,
0.13883215188980103,
0.12172753363847733,
0.1825244426727295,
-0.12484364956617355,
-0.16435682773590088,
-0.28947702050209045,
-0.33030983805656433,
0.3477078080177307,
-0.3766779899597168,
0.130199730396... | |
At what point is it better to switch from java.net to java.nio? .net (not the Microsoft entity) is easier to understand and more familiar, while nio is scalable, and comes with some extra nifty features.
Specifically, I need to make a choice for this situation: We have one control center managing hardware at several r... | [
0.32634666562080383,
0.14202819764614105,
0.09003503620624542,
0.01790030114352703,
0.0038318554870784283,
-0.0825108215212822,
-0.06336066126823425,
-0.08454617112874985,
0.03036348521709442,
-0.801693320274353,
0.10194414854049683,
0.6980950236320496,
-0.28402987122535706,
0.151314556598... | |
From my understanding, NIO is meant for one server, many clients, but what I'm thinking of is one client, many servers.
I suppose a third option is to use MINA, but I'm not sure if that's throwing too much at a simple problem.
---
Each remote server will have up to 8 connections, all from the same client (to contro... | [
0.2173217386007309,
-0.35528767108917236,
0.23190155625343323,
0.246215358376503,
0.027819989249110222,
0.348109632730484,
0.003936893306672573,
-0.17437489330768585,
-0.3872397541999817,
-0.5343398451805115,
0.06274715065956116,
0.1002533957362175,
-0.15811263024806976,
0.3501705229282379... | |
better to go multi-threaded io on the client side of things and configure the servers differently?
---
Actually, since the remote machines serve only to interact with other hardware, would RMI or IDL/CORBA be a better solution? Really, I just want to be able to send commands and receive telemetry from the hardware, a... | [
0.5015760064125061,
-0.10868195444345474,
0.07160226255655289,
0.24368511140346527,
-0.21117901802062988,
-0.01760699413716793,
0.14884372055530548,
-0.057367268949747086,
-0.3974205553531647,
-0.8499399423599243,
0.15140797197818756,
0.6546865105628967,
-0.367336630821228,
-0.076923750340... | |
many connections you expect to be handling. If it's relatively few (say, < 100), I'd go with java.net. | [
0.026958482339978218,
0.1301804929971695,
-0.03553897514939308,
0.051135074347257614,
0.01646380126476288,
-0.23929372429847717,
0.015736231580376625,
0.17548270523548126,
-0.2956322431564331,
-0.8259927034378052,
0.08818403631448746,
0.22504152357578278,
-0.3382667601108551,
-0.1467349827... | |
I'm trying to create an OS X Service. I found [Providing System Services](http://developer.apple.com/documentation/Cocoa/Conceptual/SysServices/Tasks/providing.html#//apple_ref/doc/uid/20000853) in Apple's documentation, however I'm finding it less than clear on what exactly I need to do. I'm currently using an applica... | [
0.3581301271915436,
0.40533512830734253,
0.19327016174793243,
-0.2736106514930725,
0.022761907428503036,
0.23263044655323029,
0.5243399739265442,
0.30083805322647095,
-0.25780805945396423,
-0.7605617642402649,
-0.04781525954604149,
0.2557390332221985,
-0.19109824299812317,
0.31381341814994... | |
addition to what is listed in that doc), but I'm not able to find anything.
Thanks in advance. :)
Edit: Here is my NSServices dictionary from my Info.plist file:
```
<key>NSServices</key>
<array>
<dict>
<key>NSPortName</key>
<string>POPrlTest</string>
<key>NSMessage</key>
<str... | [
-0.13532796502113342,
-0.0709465891122818,
0.5548094511032104,
-0.10131470113992691,
0.033915337175130844,
0.07479478418827057,
0.2338016927242279,
-0.1510806530714035,
-0.12176439166069031,
-0.8546383380889893,
-0.03390399366617203,
0.2616617977619171,
-0.11124498397111893,
-0.01499940175... | |
<key>NSMenuItem</key>
<dict>
<key>default</key>
<string>Shorten URL</string>
</dict>
</dict>
</array>
```
Make sure you are launching your app first to get the system to see the Service.
Make sure you are registering the services handler in your app using
- setServicesProvid... | [
0.36300942301750183,
-0.08777116239070892,
0.5068918466567993,
-0.06945540755987167,
0.05469530448317528,
-0.24123263359069824,
0.4993848502635956,
0.08811292797327042,
-0.17592979967594147,
-0.9501947164535522,
-0.48629629611968994,
0.7267481684684753,
-0.07082648575305939,
-0.22937461733... | |
The Dragon Book includes an exercise on converting integers to roman numerals using a syntax-directed translation scheme.
How can this be completed?
I would consider parsing from right-to-left.
First, I would map the units column:
```
0 -> ''
1 -> 'I'
2 -> 'II'
3 -> 'III'
4 -> 'IV'
...
9 -> 'IX'
```
Then, if there... | [
-0.4209626019001007,
0.21175293624401093,
0.44687896966934204,
-0.08358251303434372,
-0.4781179428100586,
0.25685349106788635,
0.03269832581281662,
-0.5038596987724304,
0.1215575784444809,
-0.724004864692688,
-0.12917713820934296,
0.27417731285095215,
0.15605692565441132,
-0.41514030098915... | |
I've heard it said that the Entity Framework is overkill or that it's difficult to learn compared to LinqToSql.
I am wondering in what way? I used LinqToSql and like it. So, I am trying the EF and for the things I'm doing they seem almost exactly the same. Namespaces and method names are different but so far I don't s... | [
0.151512011885643,
0.1058870404958725,
0.23380176723003387,
0.06723400950431824,
-0.2685515284538269,
-0.2298150211572647,
0.18945768475532532,
0.14493782818317413,
-0.15144333243370056,
-0.7393297553062439,
0.3211171329021454,
0.6271229982376099,
-0.03625641018152237,
0.09591861069202423,... | |
plus for the EF just in case I do want to do something more complex.
Does the EF use more resources than LinqToSql so much so that I should not use it if all I need is LinqToSql-like functionality?
Update:
I did some tests and my tests seems to point to Linq to Entities performing better than Linq to SQL.
I first de... | [
0.26341676712036133,
-0.278117299079895,
0.7496612071990967,
0.18405264616012573,
-0.16052506864070892,
0.05161099508404732,
0.017701297998428345,
-0.40947458148002625,
-0.20733433961868286,
-0.5870673656463623,
0.13948090374469757,
0.4909149706363678,
-0.14019395411014557,
-0.176350772380... | |
support another post:
[Linq To Sql vs Entity Framework Performance](https://stackoverflow.com/questions/257016/linq-to-sql-vs-entity-framework-performance)
Update 2:
Thanks for the replies. It appears to me that Linq to Entities isn't really overkill versus Linq to SQL. After researching more I think going with Linq ... | [
0.12763969600200653,
0.1609051525592804,
0.3977636992931366,
0.4079647958278656,
-0.33708855509757996,
-0.3154977560043335,
0.2537502348423004,
-0.18235518038272858,
-0.18413178622722626,
-0.28735262155532837,
0.00986122339963913,
0.7755018472671509,
0.01336964126676321,
-0.328374296426773... | |
might make someone feel as though Linq to Entities is more complicated. But once you learn how to do things it seems Linq to Entities is no more complicated than Linq to SQL.
My answer: Do a simple comparsion of the time taken to perform a simple Get/Edit/Update sequence. I think you will find that LINQ to SQL is twice... | [
-0.01052827574312687,
-0.05251266807317734,
0.5924977660179138,
0.3259531259536743,
-0.09836200624704361,
-0.07503895461559296,
0.1549263596534729,
-0.46684443950653076,
-0.17989115417003632,
-0.40880709886550903,
0.21056881546974182,
0.5792860984802246,
0.020354190841317177,
-0.1544067114... | |
Linq-Sql - Entity Framework didn't even factor into it!
[link text](http://hackprogrammer.blogspot.com/2008/08/entity-framework-verses-linq-to-sql.html "entity framework verses linq to sql") | [
0.07016678154468536,
0.3491643965244293,
0.49135005474090576,
0.13600121438503265,
-0.18789654970169067,
-0.3994373679161072,
0.3966529071331024,
-0.24717575311660767,
0.1984046846628189,
0.007110510021448135,
0.07281852513551712,
0.6313058137893677,
-0.2744563817977905,
-0.224927723407745... | |
I have a file with data listed as follows:
```
0, 2, 10
10, 8, 10
10, 10, 10
10, 16, 10
15, 10, 16
17, 10, 16
```
I want to be able to input the file and split it into three arrays, in the process trimming all excess spaces and converting each element to integers.
F... | [
0.28407368063926697,
0.5462946891784668,
0.22255203127861023,
-0.2984924614429474,
0.1845759153366089,
0.6606696248054504,
-0.10817929357290268,
-0.5828048586845398,
-0.2450634092092514,
-0.1544964611530304,
0.12486068904399872,
0.26700878143310547,
-0.1355198621749878,
0.21029743552207947... | |
I can't find an easy way to do this in c++. The only success I've had is by inputting each line into an array, and then regexing out all the spaces and then splitting it up. This entire process took me a good 20-30 lines of code and its a pain to modify for say another separator(eg. space), etc.
This is the python equ... | [
0.0917617678642273,
-0.12667027115821838,
0.37159639596939087,
-0.2322501540184021,
-0.20411869883537292,
0.2191137820482254,
0.17550869286060333,
-0.40765008330345154,
-0.11740050464868546,
-0.5712572932243347,
-0.08365077525377274,
0.49633222818374634,
-0.30256131291389465,
-0.1532702594... | |
inbase.append(int(bits[1].strip()))
outbase.append(int(bits[2].strip()))
```
The ease of use of doing this in python is one of the reasons why I moved to it in the first place. However, I require to do this in C++ now and I would hate to have to use my ugly 20-30 line code.
Any help would be appreciated, thanks!... | [
0.2758439779281616,
-0.0454610250890255,
0.42787572741508484,
-0.4201265871524811,
-0.3098263740539551,
-0.03415176272392273,
0.2141595482826233,
-0.17696307599544525,
0.04363538697361946,
-0.6692701578140259,
0.011803914792835712,
0.6893616318702698,
-0.6300132870674133,
-0.31636437773704... | |
vx.push_back(x);
vy.push_back(y);
vz.push_back(z);
}
fclose(fp);
``` | [
-0.012342963367700577,
-0.2259092926979065,
0.9066608548164368,
-0.4208655059337616,
0.2630722224712372,
0.08769336342811584,
-0.0016337165143340826,
-0.10233849287033081,
-0.14214922487735748,
-0.3076052665710449,
-0.5695816278457642,
0.6505100131034851,
-0.5020586848258972,
0.40395417809... | |
I would like to read/write encrypted XML files using LINQ to XML. Does anyone know how to use encryption algorithms built into the .NET Framework to encrypt the Stream used by the XDocument object?
I did try it, but you can't set the CryptoStream to Read/Write access. It only support Read or Write, which causes LINQ t... | [
0.27847540378570557,
0.17780284583568573,
0.38990557193756104,
0.3769710063934326,
0.10623534768819809,
-0.5333011150360107,
-0.011649283580482006,
-0.21028640866279602,
0.07134633511304855,
-0.44422203302383423,
-0.08602453768253326,
0.7392008304595947,
-0.21400494873523712,
-0.0979614108... | |
then XDocument.Save(). From a quick test app (go easy on non-disposed resources):
```
XDocument writeContacts = new XDocument(
new XElement("contacts",
new XElement("contact",
new XElement("name", "Patrick Hines"),
new XElement("phone", "206-555-0144",
new XAttribute("type", "ho... | [
0.21565128862857819,
0.12296543270349503,
0.6855809092521667,
0.01898803748190403,
0.47962313890457153,
0.2533349096775055,
0.09879135340452194,
-0.043722350150346756,
0.17539195716381073,
-0.642618715763092,
-0.4291735887527466,
0.5878273248672485,
-0.3934401273727417,
-0.0145080797374248... | |
XElement("address",
new XElement("street1", "123 Main St"),
new XElement("city", "Mercer Island"),
new XElement("state", "WA"),
new XElement("postal", "68042")
)
)
)
);
Rijndael RijndaelAlg = Rijndael.Create();
FileStream writeStream = File.Open("data.... | [
0.19989527761936188,
-0.04387369379401207,
0.5544173717498779,
-0.007870286703109741,
0.1265326738357544,
0.06414151936769485,
0.46939700841903687,
-0.2807099223136902,
-0.16183899343013763,
-0.7206361889839172,
-0.5639087557792664,
0.12051562964916229,
-0.21330948173999786,
0.187550440430... | |
new StreamWriter(cStream);
writeContacts.Save(writer);
writer.Flush();
writer.Close();
FileStream readStream = File.OpenRead("data.xml");
cStream = new CryptoStream(readStream,
RijndaelAlg.CreateDecryptor(RijndaelAlg.Key, RijndaelAlg.IV),
CryptoStreamMode.Read);
XmlTextReader reader = new XmlTextReader(cStream... | [
-0.056565310806035995,
-0.2928611934185028,
0.6697080731391907,
0.17227496206760406,
0.23156659305095673,
0.014549757353961468,
-0.0047687082551419735,
-0.3864016532897949,
-0.0002522231952752918,
-0.749047577381134,
-0.3039688766002655,
0.45737993717193604,
-0.3170425593852997,
0.31288474... | |
I know that you can use a dummy "int" parameter on `operator++` and `operator--` to override the postfix versions of those operators, but I vaguely recall something about a dummy parameter that you could declare on a destructor. Does anyone know anything about that, and if so, what that dummy parameter did?
This was i... | [
0.3413356840610504,
0.05958680436015129,
-0.18325307965278625,
-0.06972778588533401,
-0.11496669054031372,
-0.3936973512172699,
0.3372146189212799,
0.23933418095111847,
-0.32039740681648254,
-0.10087188333272934,
0.15303920209407806,
0.6336617469787598,
-0.23743385076522827,
0.008811742067... | |
thinking of the placement and nothrow forms of operator delete, which have the signatures:
```
void operator delete(void *, void *) throw();
void operator delete(void *, const std::nothrow_t&) throw();
void operator delete[](void *, void *) throw();
void operator delete[](void *, const std::nothrow_t&) throw();
```
... | [
0.2088412344455719,
0.0333673395216465,
0.10074803978204727,
-0.30338263511657715,
0.07557407021522522,
0.0765439048409462,
0.43336570262908936,
-0.5200320482254028,
-0.4096025228500366,
-0.393370658159256,
-0.5159170031547546,
0.3645518124103546,
-0.2706301212310791,
0.29108545184135437,
... | |
you are overloading placement new and need a corresponding operator.
The second argument is not really used, and just distinguishes the signature for the ordinary:
```
void operator delete(void *)
```
These aren't special dummy arguments the way the operator++ ones are, though. They're just an instance of the gener... | [
0.15749919414520264,
-0.16350241005420685,
0.22250813245773315,
-0.33030346035957336,
-0.008246004581451416,
0.1651228964328766,
0.24166160821914673,
-0.459477961063385,
-0.30890101194381714,
-0.427443265914917,
-0.22310318052768707,
0.6030722856521606,
-0.4721156060695648,
-0.042001716792... | |
operator delete(raw,x,y,z);
throw;
}
``` | [
-0.1532224416732788,
-0.46086302399635315,
-0.08028215169906616,
-0.1533232480287552,
0.12705488502979279,
0.012520337477326393,
0.22837650775909424,
-0.15906424820423126,
-0.012303503230214119,
-0.2436661720275879,
-0.6030226349830627,
0.7343942523002625,
-0.41470229625701904,
0.190307691... | |
Are there any good source-code analyses tools for OSX. I am particularly interested in tools that are capable of diagramming function-call hierarchies for C and C++ source files.
You might take a look at [doxygen](http://www.doxygen.nl/) | [
0.1860681176185608,
0.06410139799118042,
-0.25980088114738464,
0.013892944902181625,
0.06250820308923721,
-0.29950863122940063,
-0.06847452372312546,
0.1336016207933426,
-0.3388485312461853,
-0.3398610055446625,
-0.016066202893853188,
0.5474281311035156,
-0.24182331562042236,
-0.1474262177... | |
I have a table that saves some account limits like users. For most rows this value will be an integer. However I will also need to support storing unlimited (infinite) as a value. This might seem silly but is there a common integer value that represents unlimited (infinite)? I'd like to keep storing the values as integ... | [
-0.1763104498386383,
0.05384213849902153,
0.34125420451164246,
0.08351657539606094,
0.024219287559390068,
0.10043833404779434,
0.1009000614285469,
0.09323372691869736,
-0.4867345988750458,
-0.5858650803565979,
0.23298029601573944,
0.4178997874259949,
-0.29727816581726074,
-0.01666972227394... | |
bit field) to signify 'unlimited'. | [
0.11279836297035217,
-0.7515761256217957,
0.21371835470199585,
0.29456278681755066,
0.12673304975032806,
0.12906897068023682,
0.04578584060072899,
-0.09287502616643906,
-0.14746496081352234,
0.011190852150321007,
-0.4568631947040558,
0.27793893218040466,
-0.644547700881958,
0.4934375286102... | |
I asked this question before, [Here](https://stackoverflow.com/questions/264441/does-a-native-php-5-function-exist-that-does-the-following-in-1-line) however I think I presented the problem poorly, and got quite a few replies that may have been useful to someone but did not address the actual question and so I pose the... | [
0.2337138056755066,
0.4262615442276001,
-0.010555204935371876,
-0.0732053592801094,
-0.1245921403169632,
-0.20792856812477112,
0.26389938592910767,
-0.37135881185531616,
-0.10777102410793304,
-0.3275179862976074,
0.03759226202964783,
0.16062867641448975,
-0.12700119614601135,
0.17980389297... | |
a syntax error, however ideally it would be great if this worked!
Currently, it seems unavoidable that one must create a temporary array, ie
**The following is what I want to avoid:**
```
$temporary_places_array = explode(",",loadFile("csvOf20000places.txt"));
$rand_place = $temporary_places_array[rand(0,1000)];
``... | [
0.24869702756404877,
0.27275457978248596,
-0.04727919399738312,
-0.2694774270057678,
0.16263017058372498,
-0.24694404006004333,
0.3760251998901367,
-0.0670587420463562,
-0.3174222409725189,
-0.49437186121940613,
-0.09794310480356216,
0.33913514018058777,
-0.3484666645526886,
0.256507396697... | |
want access into it without having to create a temporary variable.
**NATIVELY NATIVELY NATIVELY, i know i can create a function that does it.**
**No, there is no way to do that natively.**
You can, however:
1.- Store the unavoidable array instead of the string. Given PHP's limitation this is what makes most sense in... | [
0.16178934276103973,
0.050456151366233826,
0.015428788959980011,
-0.029906976968050003,
0.004073342774063349,
-0.15555252134799957,
0.5148671865463257,
0.01859709620475769,
-0.12126985937356949,
-0.7150585055351257,
-0.14093488454818726,
0.46059271693229675,
-0.1993933767080307,
0.05129578... | |
I have been given two different Microsoft Word document that my virus scanner has warned me contains macros. These should be simple text files, and the person who sent them doesn't even know what a macro is; they may be a mistake on his part, but they might be signs of a malicious infection. My installation of OpenOffi... | [
0.3738517165184021,
0.1405373066663742,
0.15869691967964172,
-0.027266215533018112,
0.22221262753009796,
-0.10633698850870132,
0.2949972152709961,
0.5981956720352173,
-0.3704056739807129,
-0.901299238204956,
0.007223102729767561,
0.5409497618675232,
-0.5094080567359924,
0.1879354566335678,... | |
my system to any malicious intent from those macros, in order to tell the person who sent me the documents whether or not he is spreading an infection.
Just open the document without activating macros, then open the code editor to see what they do. | [
0.5175423622131348,
0.2749525010585785,
0.3690907061100006,
0.18607856333255768,
0.23185423016548157,
-0.20326663553714752,
0.551744282245636,
0.3060360848903656,
-0.004550623707473278,
-0.8716088533401489,
-0.029944492504000664,
0.5783644914627075,
-0.13431154191493988,
0.0650036484003067... | |
Using jquery how do I focus the first element (edit field, text area, dropdown field, etc)
in the form when the page load?
Something like:
```
document.forms[0].elements[0].focus();
```
but using jquery.
Another requirement, don't focus the first element when the form has class="filter".
For the background I used ... | [
0.30331385135650635,
-0.2776734232902527,
0.4765768349170685,
-0.06269388645887375,
-0.26373913884162903,
-0.2005801647901535,
0.2718137800693512,
-0.06499723345041275,
-0.0498102605342865,
-0.9144665598869324,
-0.10705124586820602,
0.6458261609077454,
-0.4123614728450775,
-0.4364573061466... | |
Background
I have been asked by a client to create a picture of the world which has animated arrows/rays that come from one part of the world to another.
The rays will be randomized, will represent a transaction, will fade out after they happen and will increase in frequency as time goes on. The rays will start in o... | [
0.6387565732002258,
-0.06259258836507797,
0.43454405665397644,
0.3217463195323944,
0.15460704267024994,
0.37109196186065674,
-0.2718850374221802,
0.38841015100479126,
-0.689552903175354,
-0.6846250295639038,
0.295264333486557,
-0.13047413527965546,
-0.7328212261199951,
0.004746547434478998... | |
also be a year showing on the image that will increment every n seconds.
The randomization, summation and incrementing are not a problem for me, but I am at a loss as to how to approach the animation of the arrows/rays.
**My question is what is the best way to do this? What frameworks/libraries are best suited for th... | [
0.5058029890060425,
0.03606409579515457,
0.2370562106370926,
0.0337805449962616,
-0.030156251043081284,
0.09288394451141357,
0.3427409827709198,
0.10403676331043243,
-0.2960881292819977,
-0.755181610584259,
0.2160690426826477,
0.5051539540290833,
0.18752017617225647,
-0.24033935368061066,
... | |
OpenGL :)
You can draw bezier curves in 3d space on top of a textured plane (earth map), you can specify a thickness for them and you can draw a point (small cone) at the end. It's easy and it looks nice, problem is learning the basics of OpenGL if you haven't used it before but that would be fun and probably useful i... | [
0.24832899868488312,
-0.14573125541210175,
0.5748849511146545,
0.3421039879322052,
-0.4100406765937805,
0.09654100984334946,
-0.20456793904304504,
0.206760436296463,
-0.23488575220108032,
-0.72887122631073,
-0.17026494443416595,
0.7490707635879517,
-0.27646103501319885,
-0.1712279766798019... | |
put onto a presentation slide. | [
0.14031782746315002,
-0.11068397015333176,
0.00816450547426939,
0.3812611699104309,
0.1195218488574028,
-0.23737215995788574,
-0.1885981410741806,
0.2923789620399475,
-0.12317852675914764,
-0.4543578624725342,
-0.4049583971500397,
0.16592632234096527,
-0.059185583144426346,
0.1465106159448... | |
Is it possible to inspect the return value of a function in gdb assuming the return value is **not** assigned to a variable?
I imagine there are better ways to do it, but the [finish](http://www.chemie.fu-berlin.de/chemnet/use/info/gdb/gdb_6.html#SEC37) command executes until the current stack frame is popped off and p... | [
0.2092253565788269,
0.0852433368563652,
0.3591200113296509,
-0.10091928392648697,
-0.06643817573785782,
-0.2387416958808899,
0.1331043541431427,
-0.2700640857219696,
-0.33557015657424927,
-0.16099251806735992,
-0.4366912841796875,
0.4614921510219574,
-0.24580709636211395,
0.186953216791152... | |
return 42;
(gdb) finish
Run till exit from #0 fun () at test.c:2
main () at test.c:7
7 return 0;
Value returned is $1 = 42
(gdb)
```
The `finish` command can be abbreviated as `fin`. Do NOT use the `f`, which is abbreviation of `frame` command! | [
0.30182337760925293,
0.039164360612630844,
0.7340003848075867,
-0.44979095458984375,
0.5656763315200806,
-0.06203923374414444,
0.22142477333545685,
-0.4257887005805969,
-0.1901150792837143,
-0.029778769239783287,
-0.3559415340423584,
0.9960756301879883,
-0.22213278710842133,
0.151064038276... | |
I use FTP on a daily basis to work on multiple websites, but when I try to work from home, my darned satellite internet has a latency of about 1000ms. (Its craptastic service, I know, but there are no alternatives where I live.) Thus, I was wondering if there is a way that I can connect to my web server and transfer fi... | [
0.16297510266304016,
-0.147393137216568,
0.6684824228286743,
0.16297835111618042,
0.24775263667106628,
-0.19488878548145294,
0.5793555378913879,
0.271955668926239,
-0.3205847442150116,
-0.844892680644989,
-0.12859390676021576,
0.40538153052330017,
-0.15761777758598328,
-0.15523095428943634... | |
is done. The transfer itself goes very fast as expected, but the handshake process does not, as the server/client seem to need to do a lot of communication to negotiate the transfer. Worse, it seems to need to do this handshake thing for every individual file, which certainly doesn't help.
Is there any way I can modif... | [
0.19110801815986633,
0.1610666811466217,
0.744515061378479,
0.24140264093875885,
0.31702321767807007,
-0.2953709363937378,
0.12299443036317825,
-0.3255751132965088,
-0.26901233196258545,
-0.3114999532699585,
-0.13394618034362793,
0.3665390610694885,
0.11934494972229004,
0.20528031885623932... | |
there's not a lot I've been able to find that I can do about it...
Thanks
Sounds like a good case for using UDP rather than TCP-based protocols - e.g. [uftp](http://uftp-multicast.sourceforge.net)
A quote from the linked site: "especially useful for data distribution over a satellite link (with two way communication)... | [
0.27456507086753845,
-0.08545733243227005,
0.3242882788181305,
0.0314977765083313,
-0.21920301020145416,
-0.3051203191280365,
0.015819039195775986,
0.13930010795593262,
-0.6465069055557251,
-0.6013223528862,
-0.1535145789384842,
0.07054121047258377,
-0.12029872089624405,
0.3220901787281036... | |
Is it possible to replicate selected objects (accounts) in an Active Directory Domain. We have a need to replicate selected accounts through our firewall to a DC sitting in the DMZ. We don't want to replicate *all* accounts to this machine, in case it is compromised.
Any suggestions, help or products suggested most ap... | [
0.45025354623794556,
0.2218027412891388,
0.2040175199508667,
0.45728740096092224,
0.19694139063358307,
-0.2294425368309021,
0.22240851819515228,
0.25987008213996887,
-0.35275763273239136,
-0.422818124294281,
0.07814434170722961,
0.4309619069099426,
-0.030930975452065468,
-0.061092130839824... | |
on the DMZ - not so.
Again, apologies, but it turned out to be rather simple.
Thanks for replying. | [
0.5890482068061829,
0.06169852986931801,
0.36044472455978394,
0.37317129969596863,
-0.14894607663154602,
-0.16609667241573334,
0.3114769160747528,
0.7787291407585144,
0.19700367748737335,
-0.23002475500106812,
-0.10363548249006271,
0.09584478288888931,
-0.0035473310854285955,
0.06388495117... | |
I'm writing code to do Xml serialization. With below function.
```
public static string SerializeToXml(object obj)
{
XmlSerializer serializer = new XmlSerializer(obj.GetType());
using (StringWriter writer = new StringWriter())
{
serializer.Serialize(writer, obj);
return writer.ToString();
... | [
0.1784464418888092,
0.22821573913097382,
0.6923320889472961,
-0.20449446141719818,
-0.053025633096694946,
0.15989649295806885,
0.4901081323623657,
-0.3118259906768799,
-0.17644821107387543,
-0.6391696929931641,
-0.13979820907115936,
0.2976686954498291,
-0.5276458859443665,
0.29315450787544... | |
MemberInfo sourc e, Boolean
> directReference, Boolean throwOnError)
> at
> System.Xml.Serialization.ModelScope.GetTypeModel(Type
> type, Boolean direct Reference) at
> System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(Type
> type , XmlRootAttribute root, String
> defaultNamespace) at
> System.Xm... | [
-0.23891016840934753,
-0.194807767868042,
0.442084938287735,
0.20987004041671753,
-0.045934561640024185,
-0.14276298880577087,
0.16942362487316132,
-0.22470426559448242,
-0.3942621052265167,
-0.1280587613582611,
-0.08601440489292145,
0.24343594908714294,
-0.5761352777481079,
0.258213400840... | |
populate.
You can make your constructor `private` or `internal` if you want, just so long as it's parameterless. | [
0.5363995432853699,
-0.17236587405204773,
0.5419554114341736,
0.38310858607292175,
0.10369925200939178,
0.1262616366147995,
-0.40599820017814636,
0.6531105637550354,
-0.23313531279563904,
-0.5035709738731384,
-0.44628775119781494,
0.09491439163684845,
-0.5570136904716492,
0.219163417816162... | |
So I've been trying to learn the boost::asio stuff to communicate to a serial device using RS232. The documementation is sparse and the examples are non-existent. Can't figure out exactly how to communicate with the device. The device can't send data so all I need to do is write, but other projects require actual back ... | [
0.1699041873216629,
0.2925952672958374,
0.4614250659942627,
-0.20439088344573975,
-0.021278608590364456,
0.29675835371017456,
0.2395467460155487,
-0.33541393280029297,
-0.4471125304698944,
-0.519187867641449,
-0.07937192171812057,
0.5685110092163086,
-0.4088309109210968,
0.1306656301021576... | |
char commands[4] = { 1, 128, 240, 0 };
// write the commands to the device
return 0;
}
```
In short: need help with the io part of the serial\_port.
In addition to the baud rate, you may also need to set other options like: character\_size, flow\_control, parity and stop\_bits. To write your data to the ser... | [
-0.04950268939137459,
0.20504817366600037,
0.6225398778915405,
-0.21122130751609802,
0.04621472209692001,
0.4487278461456299,
-0.018232978880405426,
-0.27062147855758667,
-0.2911248207092285,
-0.508276641368866,
-0.0412701740860939,
0.7503699660301208,
-0.0946493074297905,
-0.0031237790826... | |
I'm impressed with the simplicity of Microsoft's Virtual Earth Street Address search service.
My requirement is to type rough address info with no comma separators into a simple text box, press a find button, wait a few seconds and then observe a result picklist.
I mocked up something [here](http://www.garyrusso.org/... | [
0.13159720599651337,
0.05539596080780029,
0.5741845965385437,
0.3618748188018799,
-0.051291875541210175,
0.03341887518763542,
-0.031876351684331894,
-0.0724848210811615,
-0.03541926294565201,
-0.7271308302879333,
0.02048574760556221,
0.6825003027915955,
-0.021953336894512177,
0.23825502395... | |
of buffer types is very flexible and you may want to read further on that topic here: [Buffers](http://www.boost.org/doc/libs/1_36_0/doc/html/boost_asio/overview/core/buffers.html). | [
0.11775685846805573,
0.05241722613573074,
0.1301960051059723,
-0.09744752198457718,
-0.06991193443536758,
0.132656529545784,
-0.3199131190776825,
-0.15844659507274628,
-0.4375929534435272,
-0.22877813875675201,
-0.1572987139225006,
0.39081716537475586,
-0.3713306784629822,
-0.2644104361534... | |
I need to connect to an asmx webservice using javascript. the webservice accepts and returns a soap response. im looking for an example bit of code of how i can connect to the webservice using javascript. it returns lat and long details which i'll then use to plot markers on a google map. i also have the issue of cross... | [
0.592069685459137,
0.03794950619339943,
0.3291581869125366,
0.18739831447601318,
-0.5276685357093811,
0.0827488899230957,
0.16623617708683014,
-0.1880195438861847,
0.21702155470848083,
-0.9107735753059387,
0.2946554124355316,
0.47788289189338684,
0.010382994078099728,
-0.022660912945866585... | |
I'm trying to figure out the best way to insert a record into a single table but only if the item doesn't already exist. The KEY in this case is an NVARCHAR(400) field. For this example, lets pretend it's the name of a *word* in the Oxford English Dictionary / insert your fav dictionary here. Also, i'm guessing i will ... | [
0.3286465108394623,
0.3777924180030823,
0.24969495832920074,
0.2037954330444336,
0.17618794739246368,
-0.043123818933963776,
-0.10618185251951218,
-0.13040871918201447,
-0.2861943542957306,
-0.5221973061561584,
-0.1826217919588089,
0.2190157175064087,
-0.05367646366357803,
0.39354458451271... | |
i would try the following (pseudo code)
```
SELECT WordID FROM Words WHERE Word = @Word
IF WordID IS NULL OR WordID <= 0
INSERT INTO Words VALUES (@Word)
```
ie. *If the word doesn't exist, then insert it.*
Now .. the problem i'm worried about is that we're getting LOTS of hits .. so is it possible that the wor... | [
-0.052743032574653625,
0.022362977266311646,
-0.24130508303642273,
-0.14259421825408936,
0.17109796404838562,
0.3229280114173889,
0.37721115350723267,
-0.05020180344581604,
0.4381313621997833,
-0.7688554525375366,
0.0650879442691803,
0.6682802438735962,
-0.34466007351875305,
0.037887953221... | |
@Word
WHERE NOT EXISTS (SELECT WordID FROM Words WHERE Word = @Word)
```
basically, *insert a word when it doesn't exist.*
Bad syntax aside, i'm not sure if this is bad or good because of how it locks down the table (if it does) and is not that performant on a table that it getting massive reads and plenty of writes... | [
0.27676305174827576,
0.10432226210832596,
-0.013119474053382874,
0.04005613550543785,
0.17315788567066193,
-0.352580189704895,
0.5933754444122314,
0.1399712711572647,
0.10541068017482758,
-0.7960786819458008,
0.06152040883898735,
0.6585074663162231,
-0.42945006489753723,
0.0559350363910198... | |
as good as it gets. You could simplify it to this:
```
INSERT INTO Words (Word)
SELECT @Word
WHERE NOT EXISTS (SELECT * FROM Words WHERE Word = @Word)
```
...because EXISTS doesn't actually need to return any records, so the query optimiser won't bother looking at which fields you asked for.
As you mention, how... | [
0.1956464946269989,
0.23596897721290588,
0.3807302713394165,
-0.052985016256570816,
0.2764984369277954,
-0.20295096933841705,
0.38861724734306335,
0.030379170551896095,
-0.10758636891841888,
-0.6992385387420654,
-0.10558054596185684,
0.6933531165122986,
-0.12977859377861023,
0.027956794947... | |
load and look at the performance with SQL Server Profiler. As with any other field, premature optimisation is a bad thing. Define acceptable performance metrics, and then measure before doing anything else.
If that's still not giving you adequate performance, then there's a bunch of techniques from the data warehousin... | [
0.3624780774116516,
-0.047114163637161255,
0.003730728989467025,
0.4107467532157898,
-0.17244267463684082,
-0.39208829402923584,
-0.06075087562203407,
-0.04540450870990753,
0.09095381945371628,
-0.4397110641002655,
0.15820443630218506,
0.8056334853172302,
0.0012451678048819304,
-0.04851629... | |
(Note: This is for MySQL's SQL, not SQL Server.)
I have a database column with values like "abc def GHI JKL". I want to write a WHERE clause that includes a case-insensitive test for any word that begins with a specific letter. For example, that example would test true for the letters a,c,g,j because there's a 'word' ... | [
0.2307770997285843,
0.4163701832294464,
0.06100910156965256,
-0.060716141015291214,
-0.21432773768901825,
-0.18702200055122375,
0.45834654569625854,
-0.14071504771709442,
0.001037625246681273,
-0.4784415364265442,
0.1148446723818779,
0.42039257287979126,
-0.32423555850982666,
0.14860591292... | |
`body` REGEXP '[[:<:]][acgj]'
```
It returns records where column body contains words starting with a,c,g or i (case insensitive)
Be aware though: this is not a very good idea if you expect any heavy load (not using index - it scans every row!) | [
-0.035597216337919235,
0.30680185556411743,
0.5066118836402893,
0.06459662318229675,
-0.2448205202817917,
-0.08381208777427673,
0.2060883343219757,
-0.1004604771733284,
-0.18814776837825775,
-0.3648795783519745,
-0.051244720816612244,
0.3988110423088074,
-0.22658728063106537,
-0.1557526290... | |
When we perform a fork in Unix, open file handles are inherited, and if we don't need to use them we should close them. However, when we use libraries, file handles may be opened for which we do not have access to the handle. How do we check for these open file handles?
If the libraries are opening files you don't know... | [
0.16221188008785248,
0.04866465553641319,
0.12475366145372391,
0.17595073580741882,
0.15302176773548126,
-0.30928951501846313,
-0.04561648517847061,
-0.04353880137205124,
-0.38335350155830383,
-0.5489948391914368,
-0.26124972105026245,
0.40214893221855164,
-0.15188078582286835,
0.401972174... | |
of code closing its file handles behind its back will lead to subtle hard to debug problems since the library will error unexpectedly when it attempts to work with a handle it knows it opened correctly, but did not close. | [
-0.06852658838033676,
0.45126813650131226,
0.1663733869791031,
0.07239775359630585,
0.13911260664463043,
-0.24692046642303467,
0.6190991401672363,
-0.1997511237859726,
-0.30204373598098755,
-0.3110494017601013,
-0.4888996183872223,
0.32105132937431335,
-0.1332663595676422,
0.33104792237281... | |
I have written a Windows service that allows me to remotely run and stop applications. These applications are run using CreateProcess, and this works for me because most of them only perform backend processing. Recently, I need to run applications that present GUI to the current log in user. How do I code in C++ to all... | [
0.05451349914073944,
0.2030961960554123,
0.22452306747436523,
0.03381601721048355,
0.30228206515312195,
-0.017917843535542488,
0.18414127826690674,
-0.10283520072698593,
-0.1999504268169403,
-0.33873629570007324,
-0.09351863712072372,
0.4694328010082245,
0.016777345910668373,
-0.0331147052... | |
of the [STARTUPINFO](http://msdn.microsoft.com/en-us/library/ms686331.aspx) structure) is correct.
However, I would *strongly* recommend against doing this. In some environments, such as Terminal Server hosts with many active users, determining which desktop is the 'active' one isn't easy, and may not even be possible... | [
0.053791336715221405,
0.12969070672988892,
0.373197466135025,
-0.07726392149925232,
0.4272727966308594,
-0.2784241735935211,
0.05871094763278961,
0.4663112163543701,
-0.48322731256484985,
-0.6777711510658264,
-0.4722082316875458,
0.4755558669567108,
-0.19950233399868011,
0.0544169731438159... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.