text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
JVM implementations? Can I make
> programs share variables (i. e.
> directly through the JVM rather than
> the usual IPC mechanisms)? Are there
> more exotic one-process JVMs for
> special purposes?
Like a poster said, there are projects like Terracota that facilitate this for you. A general approach for this kin... | [
0.5261933207511902,
-0.01776452362537384,
-0.2096513956785202,
0.32168522477149963,
-0.04830874875187874,
-0.38647010922431946,
0.041555359959602356,
0.1708933413028717,
-0.26461127400398254,
-0.6584274172782898,
0.18479304015636444,
0.25536245107650757,
-0.32438769936561584,
0.15496410429... | |
When I want to remove a Cookie I try
```
unset($_COOKIE['hello']);
```
I see in my cookie browser from firefox that the cookie still exists. How can I really remove the cookie?
You May Try this
```
if (isset($_COOKIE['remember_user'])) {
unset($_COOKIE['remember_user']);
setcookie('remember_user', null, -1... | [
0.0032494773622602224,
0.13459402322769165,
0.47501474618911743,
-0.30091235041618347,
0.42606455087661743,
-0.11429862678050995,
0.5905994176864624,
-0.026327744126319885,
-0.24812914431095123,
-0.5905606150627136,
-0.4662516117095947,
0.7166815996170044,
-0.41255125403404236,
0.004810470... | |
I want to change the foreground color of cells that hold negative numbers, but I don't know how to specify the DataTrigger that would let me. I'm using something like this:
```
<Style x:Key="NumberCellStyle" BasedOn="{StaticResource CellStyle}">
<Style.Triggers>
<DataTrigger Binding="{Binding Converter={St... | [
0.3675236403942108,
-0.10213109850883484,
0.4794495105743408,
-0.22516152262687683,
-0.005746025126427412,
0.10899539291858673,
-0.02430087700486183,
-0.5647512078285217,
-0.06627734005451202,
-0.7914137244224548,
0.2192147970199585,
0.49208730459213257,
-0.4477888345718384,
-0.00442166812... | |
across the app, without me needing to specify the correct Path for each binding.
Thank you very much!
Better way, write a custom column.
The code follows for anyone that's in the same situation:
```
public class DataGridDecimalColumn : DataGridTextColumn
{
Binding foregroundBinding;
DecimalBru... | [
0.13968481123447418,
-0.008724491111934185,
1.0263663530349731,
0.083522267639637,
-0.011691134423017502,
0.35425224900245667,
-0.0412338525056839,
-0.5260477662086487,
-0.16709837317466736,
-0.4388333857059479,
0.2872937321662903,
0.39333221316337585,
-0.2442309856414795,
0.10552265495061... | |
};
protected override FrameworkElement
GenerateElement(DataGridCell cell, object dataItem)
{
var element = base.GenerateElement(cell, dataItem) as TextBlock;
element.SetBinding(TextBlock.ForegroundProperty, GetForegroundBinding());
return element;
}
Binding
GetForegrou... | [
-0.01593783311545849,
-0.1482166200876236,
0.4847182631492615,
-0.2536036968231201,
0.04654033109545708,
0.08059429377317429,
0.511604905128479,
-0.7451485395431519,
0.07497535645961761,
-0.37401190400123596,
-0.3286665976047516,
0.2736976444721222,
-0.6367483139038086,
0.3154490292072296,... | |
= (Binding)Binding;
foregroundBinding = new Binding {
Path = binding.Path,
Converter = BrushConverter,
};
}
return foregroundBinding;
}
public DecimalBrushConverter | [
-0.021693699061870575,
-0.36817288398742676,
0.8078839778900146,
-0.020520592108368874,
-0.10907372087240219,
0.37784314155578613,
0.011337822303175926,
-0.7434688806533813,
0.09387575834989548,
-0.3874128758907318,
0.3022797405719757,
0.2394881397485733,
-0.250648558139801,
0.168256774544... | |
BrushConverter
{
get { return brushConverter; }
set { brushConverter = value; }
}
}
```
DecimalBrushConverter simple takes a decimal? and converts it to one of the specified brushes depending on its value. | [
0.09276055544614792,
-0.11073338985443115,
0.4261529743671417,
-0.09163625538349152,
-0.04508199542760849,
0.4113013744354248,
-0.38595372438430786,
-0.587401270866394,
0.2671731114387512,
-0.14305806159973145,
0.20162974298000336,
0.5734822750091553,
-0.14230088889598846,
-0.0580860078334... | |
I have a tableView that needs to be updated after information has been inserted from another view. If I perform a
```
[self.tableView reloadData];
```
The very next time I insert more information in another view and try to reload the table, all the currently visible rows are duplicated.
In other words, when I star... | [
0.16646331548690796,
0.31082862615585327,
0.7415653467178345,
-0.1147398129105568,
0.13746118545532227,
0.004823072347790003,
0.19941532611846924,
-0.025768373161554337,
-0.44527044892311096,
-1.0076144933700562,
0.009611915796995163,
0.7088912129402161,
-0.1739814430475235,
0.175182566046... | |
just added
Row 1
Row 2
```
My numberOfRowsInSection implementation looks like this:
```
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [ItemsController sharedItemsController].count;
}
```
My cellForRowAtIndexPath implementation looks like this:
```
- ... | [
-0.03455432131886482,
-0.43871498107910156,
0.924601674079895,
-0.139665886759758,
-0.020173605531454086,
0.0949636697769165,
0.014844413846731186,
-0.3863222897052765,
-0.46176740527153015,
-0.8641061186790466,
-0.010733834467828274,
0.3900587558746338,
-0.21729667484760284,
0.45985236763... | |
if( recentCellData == nil )
recentCellData = [[NSMutableDictionary alloc] initWithCapacity:[indexPath length]];
if( [recentCellData count] > 0 )
cell = [recentCellData objectForKey:[NSString stringWithFormat:@"%d", row]];
if (cell == nil) {
UIViewController * view1 =... | [
-0.4938499927520752,
-0.7812979817390442,
1.0561330318450928,
-0.22178082168102264,
0.08223620802164078,
0.06496751308441162,
0.17667676508426666,
-0.5288163423538208,
0.07257207483053207,
-0.7126326560974121,
-0.41425710916519165,
0.5688247084617615,
-0.051772136241197586,
0.2461058050394... | |
[recentCellData setObject:cell forKey:[NSString stringWithFormat:@"%d",row]];
}
// do some other stuff here
}
// Set up the cell
return cell;
}
```
What's the best way to update the table and avoid duplicating the currently visible rows.
Thank in advance for all the help!
The error isn't i... | [
-0.24683496356010437,
0.02070724032819271,
0.7251812219619751,
-0.1387203484773636,
0.36194878816604614,
-0.14487336575984955,
0.14753010869026184,
-0.16922909021377563,
-0.014615228399634361,
-0.7663707733154297,
-0.04637904837727547,
0.4091401696205139,
-0.14527377486228943,
0.0741002932... | |
rows to see where you're going wrong. | [
0.36971384286880493,
0.213161900639534,
0.42054465413093567,
0.09753865748643875,
-0.09723439812660217,
0.4863293170928955,
-0.3649066388607025,
0.3626731336116791,
-0.4292442500591278,
-0.37303945422172546,
0.13239257037639618,
0.5797404050827026,
-0.16578267514705658,
0.4097304046154022,... | |
For IIS6 I can use the IIS helpers in Wix to install a web application like this:
```
<iis:WebAppPool
Id="AP_MyApp"
Name="My Application Pool"
Identity="networkService" />
<iis:WebApplication
Id="WA_MyApp"
Name="MyApp"
WebAppPool="AP_MyApp">
<iis:WebApplicationExtension
CheckP... | [
0.028176112100481987,
0.05545660853385925,
0.5692839622497559,
-0.17252084612846375,
-0.03709710016846657,
0.032290443778038025,
0.4105869233608246,
-0.3546041250228882,
-0.23641493916511536,
-0.7852516770362854,
-0.1434841901063919,
0.6271061301231384,
-0.3106548488140106,
0.0375074557960... | |
request routing. The app pool created by this script is in Classic mode not Integrated mode so none of the handlers get run correctly.
How can I correctly install an MVC app on IIS 7?
The IIS extensions for WIX don't support IIS7. The IIS team keep rewriting the metabase between versions. There are quite a few things ... | [
0.07466918230056763,
-0.21954035758972168,
0.621863067150116,
0.08578866720199585,
-0.08990221470594406,
0.10548662394285202,
0.6371013522148132,
-0.5497588515281677,
-0.41277047991752625,
-0.6949223875999451,
0.012032363563776016,
0.739257276058197,
-0.5627028346061707,
-0.227605447173118... | |
at the moment as you can do this within a component and tie it to a feature. | [
0.7417666912078857,
-0.05964139103889465,
0.42212316393852234,
0.35069409012794495,
0.17889128625392914,
0.009753324091434479,
-0.13492771983146667,
-0.2376037836074829,
-0.031910240650177,
-0.594338059425354,
-0.029120923951268196,
0.30637040734291077,
0.25140491127967834,
0.1160098686814... | |
Is there an accepted maximum allowed size for HTTP headers? If so, what is it? If not, is this something that's server specific or is the accepted standard to allow headers of any size?
No, HTTP does not define any limit. However most web servers do limit size of headers they accept. For example in [Apache default limi... | [
-0.05136839672923088,
-0.3596540689468384,
0.4566722810268402,
0.1048378199338913,
-0.06983738392591476,
-0.41890960931777954,
0.3918268084526062,
-0.19262562692165375,
-0.5672723650932312,
-0.3753270208835602,
-0.3253656327724457,
0.04472165182232857,
-0.2500070631504059,
0.16564625501632... | |
Im working on this large DB which has a lot of the business knowledge embedded in the SPs[I know!] and there is a lot of chaining between the SPs. i.e one stored proc calling another.
Im want to find out a list of stored procedures which update a particular column. How would I do that.
Using showplan\_All as outline... | [
0.24133014678955078,
0.1872503161430359,
0.40608280897140503,
0.013262120075523853,
-0.2268996238708496,
-0.15792253613471985,
0.26524144411087036,
-0.46797704696655273,
-0.10461254417896271,
-0.5279573202133179,
0.027646906673908234,
0.6123811602592468,
-0.3069840669631958,
0.071917206048... | |
how can I find this informaion?
Have you tried this : `EXEC sp_depends @objname = [table name of the column you are interested in]`.
So for example, if you had a column named `Price` in a table named `Product`, you would execute this: `EXEC sp_depends @objname = N'Product'`.
Simply executing this would give you list ... | [
0.4570920765399933,
-0.12955819070339203,
0.5011688470840454,
0.0372895747423172,
-0.022734619677066803,
0.050432238727808,
-0.23546507954597473,
-0.2066832333803177,
-0.2270815372467041,
-0.507361114025116,
0.1762516051530838,
0.5859853625297546,
-0.17519503831863403,
0.09748736023902893,... | |
Let's say I have a socket connection, and the 3rd party listener on the other side expects to see data flowing in a very structured manner. For example, it looks for an unsigned byte that denotes a type of message being sent, followed by an unsigned integer that denotes the length of message, then another unsigned byte... | [
0.47761666774749756,
0.15905079245567322,
-0.15925797820091248,
0.057627707719802856,
-0.40200406312942505,
-0.011320902965962887,
0.18991081416606903,
0.07643365114927292,
-0.2134869545698166,
-0.3235102593898773,
0.12044525891542435,
0.5240520238876343,
-0.20288234949111938,
0.1618065983... | |
byte rather than say a signed integer or worse, a string).
Use the [struct](http://docs.python.org/library/struct.html) module to build a buffer and write that. | [
0.0006594132864847779,
-0.030030034482479095,
0.2453845739364624,
-0.018308863043785095,
0.009797971695661545,
0.11481257528066635,
-0.06474180519580841,
-0.06422820687294006,
-0.1385672241449356,
-0.3375912606716156,
-0.20817022025585175,
0.2727337181568146,
-0.1802142709493637,
-0.124897... | |
I have a custom Panel which upon resizing has its LayoutUpdated event and ArrangeOverride called twice.
So initially MeasureOverride and ArrangeOverride do their thing once upon open of the client window. Then, if I maximize the window each are called twice. The Available and Final Sizes respectively are not different... | [
0.23209431767463684,
-0.16564974188804626,
0.6448319554328918,
-0.267642080783844,
-0.09712543338537216,
0.22614169120788574,
-0.0017396823968738317,
-0.2298152893781662,
-0.3505471646785736,
-1.0719894170761108,
0.40579113364219666,
0.6545871496200562,
0.12299437820911407,
0.2730909287929... | |
What value do you think named and default parameters will add in C#.Net 4.0?
What would be a good use for these (that hasn't already been achieved with overloading and overriding)?
It can make constructors simpler, especially for immutable types (which are important for threading) - [see here for a full discussion](h... | [
0.14461898803710938,
-0.007893755100667477,
0.2679288983345032,
-0.12850192189216614,
-0.042057812213897705,
-0.001572211622260511,
0.09628495573997498,
-0.08082415908575058,
-0.2248881608247757,
-0.4203955829143524,
0.08265066891908646,
0.7300218343734741,
-0.2918549180030823,
0.005105399... | |
idea of simplifying overloads, but in *most* cases I'd prefer overloads that advertise the legal combinations. Constructors are a bit different, IMO, since you are just (typically) defining the initial state.
The COM side of things is also important to a lot of people, but I simply don't use much COM interop - so this... | [
0.04248460754752159,
0.08037250488996506,
0.1472240388393402,
0.1531604379415512,
-0.15430378913879395,
0.07682094722986221,
0.05667239427566528,
-0.18705342710018158,
-0.18648496270179749,
-0.6992362141609192,
-0.10879732668399811,
0.5029332041740417,
-0.33299949765205383,
-0.095149271190... | |
the ctor, "foo"), and one named assignment. So suppose we use this for regular named arguments:
```
SomeMethod("foo", SecondArg = "bar");
```
(which could also be a constructor; I've used a method for simplicity)
Now... what if we have a variable or a property called `SecondArg`? This would be ambiguous between usi... | [
-0.013964368030428886,
-0.017686348408460617,
0.15713141858577728,
-0.2211383581161499,
-0.08228116482496262,
-0.21710745990276337,
-0.13551242649555206,
0.05977252125740051,
0.004061021842062473,
-0.21321377158164978,
-0.2232298105955124,
0.5585330724716187,
-0.6452019810676575,
0.2549001... | |
string SecondArg;
SomeMethod("foo", SecondArg = "bar");
}
```
Obviously, SecondArg could be a property, field, varialble, etc...
The alternative syntax doesn't have this ambiguity.
---
```
[AttributeUsage(AttributeTargets.Class)]
public sealed class SomeAttribute : Attribute
{
public SomeAttribute(... | [
-0.2176005244255066,
-0.3532058596611023,
-0.03523242846131325,
-0.276236891746521,
-0.30829983949661255,
-0.16813687980175018,
0.2955974340438843,
-0.004877501167356968,
0.23161345720291138,
-0.4563034176826477,
-0.4075777232646942,
0.39489004015922546,
-0.29401567578315735,
0.04263448342... | |
true ambiguity: When you add an attribute, and only in this case
* there would be no way without a new syntax to use named arguments with attributes.
* This is a particular problem because attributes are a prime candidate for
* constructor simplification for immutable data types.
*/
// This calls the constructor w... | [
-0.0946936085820198,
-0.041900407522916794,
0.04415787756443024,
-0.06770027428865433,
-0.13842259347438812,
0.050708577036857605,
0.23297463357448578,
-0.19505450129508972,
-0.01650194264948368,
-0.3561753034591675,
-0.14525173604488373,
0.9595395922660828,
-0.20868955552577972,
-0.085020... | |
We need to compile our code after check - ins, be notified if compile fails, run tests, be notified of test results and publish our application (publish a website or create an msi file for a desktop app) on a daily basis.
We are using SVN and were considering using TeamCity or CruiseControl.NET for continuous integrat... | [
0.4446653425693512,
-0.08437685668468475,
0.4573820233345032,
0.33340075612068176,
0.3757225275039673,
-0.2032712996006012,
0.16160210967063904,
-0.09435153007507324,
-0.2943859398365021,
-0.5344162583351135,
-0.08752520382404327,
0.6004319787025452,
-0.11506663262844086,
-0.45045730471611... | |
of customers who integrate QC defect and test tracking into pipelined continuous integration. But QC is not driving the process, it's being integrated into the CI and CID process. | [
0.36176756024360657,
0.2540595531463623,
0.30260169506073,
-0.009630804881453514,
0.09058837592601776,
-0.03947862610220909,
0.09648159891366959,
0.07986488938331604,
-0.17935363948345184,
-0.3367311358451843,
-0.14735949039459229,
0.6965299844741821,
0.08043371140956879,
0.118870936334133... | |
Following my earlier [question](https://stackoverflow.com/questions/684931/content-of-binary-output-file-created-with-output-stream). Is there a way to write a string in a compressed/bit version using C++ native idiom. I am thinking something like Perl's native [pack and unpack](http://perldoc.perl.org/functions/pack.h... | [
0.0929073765873909,
-0.05468740686774254,
0.41165652871131897,
-0.16797113418579102,
0.017799224704504013,
-0.11009562015533447,
0.27231737971305847,
-0.215664342045784,
-0.2676450312137604,
-0.5823830366134644,
-0.34884586930274963,
0.4481697082519531,
-0.4674655497074127,
-0.078776910901... | |
In my current project I've been inherited with lots of long (1200+ lines) SQL Server stored procedures with some horrible indentation and formatting which makes them almost unreadable. Is there some tool that I can use to automatically format these and make them more readable? I don't want to go through it manually and... | [
0.2948959767818451,
0.31533050537109375,
0.29827502369880676,
0.1857479214668274,
-0.042890045791864395,
-0.19377672672271729,
0.3514534831047058,
0.1503698080778122,
-0.4039776027202606,
-0.5032396912574768,
0.10508866608142853,
0.3534303307533264,
0.048552073538303375,
0.1175615936517715... | |
I have a program that requires fast performance. Within one of its inner loops, I need to test the type of an object to see whether it inherits from a certain interface.
One way to do this would be with the CLR's built-in type-checking functionality. The most elegant method there probably being the 'is' keyword:
```
... | [
0.2199820727109909,
-0.007972168736159801,
0.16119058430194855,
0.04257003962993622,
-0.23935344815254211,
-0.21820683777332306,
0.16850484907627106,
-0.06498682498931885,
0.00105344841722399,
-0.708260178565979,
-0.1731935441493988,
0.5154731273651123,
-0.3417949974536896,
0.0782985314726... | |
instruction specifically for the 'is' keyword, but that doesn't mean it executes fast when translated into native assembly. Can anyone share some insight into the performance of 'is' versus the other method?
**UPDATE:** Thanks for all the informed answers! It seem a couple helpful points are spread out among the answe... | [
0.29110831022262573,
-0.18137435615062714,
-0.28363311290740967,
0.4170982241630554,
-0.09757089614868164,
0.16308271884918213,
0.5153033137321472,
-0.2328023761510849,
0.02322233095765114,
-0.4933859705924988,
-0.26753735542297363,
0.35431531071662903,
0.1406746804714203,
-0.4830127656459... | |
type, you cast to that type. `is` actually casts the object to the type you are checking so any subsequent casting is redundant.
If you are going to cast anyway, here is a better approach:
```
ISpecialType t = obj as ISpecialType;
if (t != null)
{
// use t here
}
``` | [
0.24194063246250153,
-0.09143967926502228,
0.1282811015844345,
-0.2146165668964386,
-0.21371598541736603,
0.10832348465919495,
0.3268289864063263,
-0.17064456641674042,
0.02985466830432415,
-0.5336498022079468,
-0.136460080742836,
0.5717529058456421,
-0.5752500891685486,
-0.064758472144603... | |
I am writing a program where I need to delete duplicate points stored in a matrix. The problem is that when it comes to check whether those points are in the matrix, MATLAB can't recognize them in the matrix although they exist.
In the following code, `intersections` function gets the intersection points:
```
[points... | [
-0.50227290391922,
0.20452558994293213,
0.7216386198997498,
-0.07550768554210663,
-0.3667370676994324,
0.39695894718170166,
0.18634796142578125,
-0.26959317922592163,
-0.47012826800346375,
-0.7284061312675476,
-0.011177688837051392,
0.019102908670902252,
-0.5076136589050293,
0.319930434226... | |
vertex2 =
33
24
```
Two points (`vertex1` and `vertex2`) should be eliminated from the result. It should be done by the below commands:
```
points = points((points(:,1) ~= vertex1(1)) | (points(:,2) ~= vertex1(2)), :);
points = points((points(:,1) ~= vertex2(1)) | (points(:,2) ~= vertex2(2)), :);
```
After... | [
-0.7552794218063354,
0.07352988421916962,
0.5349943041801453,
-0.3886963129043579,
-0.2750193774700165,
0.09180155396461487,
0.4711202383041382,
-0.41090458631515503,
-0.23826000094413757,
-0.7496682405471802,
-0.35060811042785645,
0.16582484543323517,
-0.10416128486394882,
-0.001978650223... | |
0
>> points(2) ~= vertex2(2)
ans =
1 % <-- It means 24.0000 is not equal to 24.0000?
```
What is the problem?
---
More surprisingly, I made a new script that has only these commands:
```
points = [12.0000 15.0000
33.0000 24.0000
33.0000 24.0000];
vertex1 = [12 ; 15];
vertex2 = [3... | [
-0.5122600793838501,
-0.03650030866265297,
0.690264105796814,
-0.039454925805330276,
-0.20319169759750366,
0.0903075784444809,
0.5305830836296082,
-0.42953920364379883,
0.06218624487519264,
-0.7609368562698364,
-0.22384275496006012,
0.14889371395111084,
-0.05489605292677879,
-0.06094782799... | |
points
points =
Empty matrix: 0-by-2
```
The problem you're having relates to how [floating-point numbers](https://www.mathworks.com/help/matlab/matlab_prog/floating-point-numbers.html) are represented on a computer. A more detailed discussion of floating-point representations appears towards the end of my answer... | [
-0.2777212858200073,
0.48874953389167786,
0.41130331158638,
0.16111649572849274,
-0.12517358362674713,
0.08282984048128128,
-0.18550916016101837,
-0.17774838209152222,
-0.5433599352836609,
-0.5988770127296448,
-0.019450845196843147,
0.23860561847686768,
0.1659722924232483,
0.17688024044036... | |
are *displayed* in the same manner, it turns out that they actually differ by very small decimal amounts in this case. You don't see it because MATLAB [only displays 4 significant digits by default](https://www.mathworks.com/help/matlab/ref/format.html), keeping the overall display neat and tidy.** If you want to see t... | [
0.041715048253536224,
0.2009764015674591,
0.5567370057106018,
0.030441710725426674,
-0.08019596338272095,
0.16698485612869263,
0.07142508029937744,
-0.3214972913265228,
-0.4855855107307434,
-0.4461386203765869,
-0.16060304641723633,
0.23550523817539215,
0.04950985312461853,
0.2193177789449... | |
it's possible for a computation to result in a value that falls between two of these representations. In such a case, the result has to be rounded off to one of them. This introduces a small [machine-precision error](https://en.wikipedia.org/wiki/Machine_epsilon). This also means that initializing a value directly or b... | [
0.05383916571736336,
-0.002562228823080659,
-0.0030372689943760633,
-0.11019649356603622,
-0.21545815467834473,
0.1706600934267044,
-0.002144679194316268,
-0.49529871344566345,
-0.05990881472826004,
-0.48087912797927856,
-0.03798393905162811,
0.3163473308086395,
-0.050762925297021866,
0.26... | |
% Sum 10 0.1s
>> b=1; % Initialize to 1
>> a == b
ans =
logical
0 % They are unequal!
>> num2hex(a) % Let's check their hex representation to confirm
ans =
3fefffffffffffff
>> num2hex(b)
ans | [
-0.10859940201044083,
0.18776953220367432,
0.27479806542396545,
-0.3647419214248657,
-0.2841489613056183,
0.2069169282913208,
0.6290695667266846,
-0.615845799446106,
0.03626144304871559,
-0.4277677834033966,
-0.07180707156658173,
0.21661312878131866,
-0.15257881581783295,
0.024076586589217... | |
=
3ff0000000000000
```
How to correctly handle floating-point comparisons
--------------------------------------------------
Since floating-point values can differ by very small amounts, any comparisons should be done by checking that the values are within some range (i.e. tolerance) of one another, as opposed to ex... | [
0.05713749676942825,
0.2473324090242386,
0.755739688873291,
-0.33576536178588867,
-0.23483560979366302,
0.15095402300357819,
0.2511499226093292,
-0.7594825029373169,
-0.3600791096687317,
-0.3411898910999298,
0.19982287287712097,
0.3361716568470001,
-0.1636643260717392,
0.11765027046203613,... | |
for floating-point arithmetic](https://en.wikipedia.org/wiki/IEEE_floating_point)) is [*What Every Computer Scientist Should Know About Floating-Point Arithmetic*](http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html) by David Goldberg.
A binary floating-point number is actually represented by three integers... | [
-0.21399858593940735,
0.19777773320674896,
0.60713130235672,
0.11988471448421478,
-0.2592219412326813,
0.49554067850112915,
-0.375832736492157,
-0.3683817982673645,
-0.44817641377449036,
-0.2771279215812683,
-0.19302929937839508,
-0.1435822695493698,
-0.14808011054992676,
0.168704107403755... | |
=
1.797693134862316e+308
```
Since there are a finite number of bits used to represent a floating-point number, there are only so many finite numbers that can be represented within the above given range. Computations will often result in a value that doesn't exactly match one of these finite representations, so t... | [
-0.0027985882479697466,
0.3334771692752838,
0.23448823392391205,
0.02766519784927368,
0.06772717833518982,
0.3211405575275421,
0.03417004644870758,
-0.41364777088165283,
-0.33177947998046875,
-0.3365924656391144,
0.011713502928614616,
0.36438116431236267,
-0.07282806187868118,
0.1512986421... | |
number to the next largest floating-point representation:
```
>> eps(1)
ans =
2.220446049250313e-16
>> eps(1000)
ans =
1.136868377216160e-13
```
Notice that the precision is *relative* to the size of a given number being represented; larger numbers will have larger distances between floating-point represen... | [
-0.17827625572681427,
0.05116654187440872,
0.391873836517334,
-0.0829298198223114,
-0.08020631968975067,
0.2172844558954239,
-0.01226541493088007,
-0.5477579236030579,
-0.28906509280204773,
-0.4939512312412262,
-0.13586440682411194,
0.29540199041366577,
0.17428332567214966,
0.1655463278293... | |
% Get 10 random values between 0 and 1
>> a = mean(x) % Take the mean
a =
0.587307428244141
>> b = mean(x+10000)-10000 % Take the mean at a different scale, then shift back
b =
0.587307428244458
```
Note that when we shift the values of `x` from the range `[0 1]` to the range `[10000 10001]`, comp... | [
0.05693370848894119,
-0.21916179358959198,
0.3850157558917999,
-0.12842996418476105,
0.027599338442087173,
0.5156734585762024,
0.3610342741012573,
-0.37483829259872437,
0.12276548892259598,
-0.5570988655090332,
-0.004176279995590448,
0.31358611583709717,
-0.11743241548538208,
0.22535175085... | |
data can change the accuracy of calculations performed on it, which is something that has to be accounted for with certain problems. | [
0.09690888971090317,
0.013612651266157627,
0.31385117769241333,
0.8917795419692993,
0.41775181889533997,
-0.2201678454875946,
-0.21378211677074432,
0.016010288149118423,
-0.14347240328788757,
-0.3233780860900879,
-0.06524698436260223,
0.20541077852249146,
0.08801332116127014,
0.08954415470... | |
I need to get unmanaged Windows C++ clients to talk to a WCF service. C++ clients could be running on Win2000 and later. I have a control over both WCF service and which C++ API is being used. Since it's for a proprietary application, it is preferable to use Microsoft stuff where possible, definitely not GNU licensed A... | [
0.4171256422996521,
0.11310188472270966,
0.34381532669067383,
0.010537691414356232,
-0.27685391902923584,
-0.291665643453598,
0.4249330461025238,
-0.1670137196779251,
0.0078530078753829,
-0.8043175339698792,
-0.034983716905117035,
0.7503423094749451,
-0.23581178486347198,
0.049676626920700... | |
reference. I followed the steps outlined (remove policy refs and flatten WSDL), however the resulting WSDL is still not usable by sproxy
Any more ideas? Please answer only if you actually have it working yourself.
***Edit1***: I apologize for anyone who I might have confused: what I was looking for was a way to call ... | [
0.5240253210067749,
0.15341538190841675,
0.5443472862243652,
0.1569908708333969,
-0.433704674243927,
-0.3713485896587372,
0.41347023844718933,
-0.28854304552078247,
-0.15786105394363403,
-0.6523445248603821,
0.041907377541065216,
0.6966801285743713,
-0.42625972628593445,
0.2045938670635223... | |
the only one which works with ATL Server:
```
var svc = new Service1();
Uri uri = new Uri("http://localhost:8200/Service1");
ServiceHost host = new ServiceHost(typeof(Service1), uri);
var binding = new BasicHttpBinding();
ServiceEndpoint endpoint = host.AddServiceEndpoint(type... | [
-0.1993553787469864,
-0.2527584135532379,
0.6590357422828674,
-0.23143817484378815,
-0.2510490417480469,
0.1184636577963829,
0.6711974740028381,
-0.3994581401348114,
-0.22081230580806732,
-0.8874947428703308,
-0.37572067975997925,
0.6073884963989258,
-0.4299052059650421,
0.3544770181179046... | |
var mex = host.AddServiceEndpoint(typeof(IMetadataExchange), MetadataExchangeBindings.CreateMexHttpBinding(), "mex");
host.Open();
Console.ReadLine();
```
code for InlineXsdInWsdlBehavior could be found [here](http://www.winterdom.com/weblog/2006/10/03/InlineXSDInWSDLWithWCF.aspx) . One important cha... | [
-0.16554467380046844,
-0.020562265068292618,
0.6725775003433228,
-0.23424887657165527,
-0.17031733691692352,
-0.004850770812481642,
0.6436411738395691,
-0.1422833800315857,
-0.2375117540359497,
-0.5150195956230164,
0.033267438411712646,
0.5386142730712891,
-0.4377564489841461,
0.4236648976... | |
{
int tnsCount = 0;
XmlSchemaSet schemaSet = exporter.GeneratedXmlSchemas;
foreach (WsdlDescription wsdl in exporter.GeneratedWsdlDocuments)
{
//
// Recursively find all schemas imported by this wsdl
// and then add them. In the process, remove any | [
-0.003995439037680626,
-0.3627239465713501,
0.5091155171394348,
-0.07344888895750046,
0.163828507065773,
0.04122408106923103,
0.06585097312927246,
-0.37132492661476135,
-0.3242994248867035,
-0.4386020004749298,
-0.3671717047691345,
0.6226250529289246,
-0.4899420440196991,
0.147228255867958... | |
// <xsd:imports/>
//
List<XmlSchema> importsList = new List<XmlSchema>();
foreach (XmlSchema schema in wsdl.Types.Schemas)
{
AddImportedSchemas(schema, schemaSet, importsList, ref tnsCount);
} | [
0.13201904296875,
-0.35480642318725586,
0.7075189352035522,
-0.23904401063919067,
0.05760838836431503,
0.15401850640773773,
-0.169095978140831,
-0.5081982612609863,
-0.4623536765575409,
-0.6991854310035706,
-0.47204747796058655,
0.5731416940689087,
-0.3996357321739197,
0.047715261578559875... | |
wsdl.Types.Schemas.Clear();
foreach (XmlSchema schema in importsList)
{
RemoveXsdImports(schema);
wsdl.Types.Schemas.Add(schema);
}
}
}
private void AddImportedSchemas(XmlSchema | [
-0.016669519245624542,
-0.0907403826713562,
0.6165487766265869,
-0.20487995445728302,
0.005444225389510393,
-0.056338146328926086,
0.01105581410229206,
-0.3709799349308014,
-0.15564098954200745,
-0.4578593969345093,
-0.4084697961807251,
0.4645724594593048,
-0.5870073437690735,
0.1112058311... | |
schema, XmlSchemaSet schemaSet, List<XmlSchema> importsList, ref int tnsCount)
{
foreach (XmlSchemaImport import in schema.Includes)
{
ICollection realSchemas = schemaSet.Schemas(import.Namespace);
foreach (XmlSchema ixsd in realSchemas)
{
if (!imp... | [
-0.09203057736158371,
-0.2958186864852905,
0.7998069524765015,
0.11312749981880188,
0.2572377920150757,
0.2504774034023285,
0.08954667299985886,
-0.3496595025062561,
-0.36427125334739685,
-0.4645698666572571,
-0.2956957519054413,
0.6667575836181641,
-0.32729536294937134,
0.0596068315207958... | |
{
var new_namespaces = new XmlSerializerNamespaces();
foreach (var ns in ixsd.Namespaces.ToArray())
{
var | [
-0.11287505179643631,
-0.28692829608917236,
0.48631584644317627,
-0.13959020376205444,
0.03969744220376015,
0.4788515567779541,
0.37218940258026123,
-0.18731898069381714,
-0.2691201865673065,
-0.6934556365013123,
-0.3016979396343231,
0.6114146709442139,
-0.1754678636789322,
0.3193508684635... | |
new_pfx = (ns.Name == "tns") ? string.Format("tns{0}", tnsCount++) : ns.Name;
new_namespaces.Add(new_pfx, ns.Namespace);
}
ixsd.Namespaces = new_namespaces;
importsList.Add(ixsd); | [
0.01419788971543312,
-0.2942354381084442,
0.689037561416626,
-0.3197280466556549,
0.09840818494558334,
0.4172312021255493,
-0.1714199036359787,
-0.3949909508228302,
-0.5707431435585022,
-0.8119062185287476,
-0.5580874085426331,
0.4199589192867279,
-0.46628621220588684,
0.2581096589565277,
... | |
AddImportedSchemas(ixsd, schemaSet, importsList, ref tnsCount);
}
}
}
}
```
Next step is to generate C++ header:
```
sproxy.exe /wsdl http://localhost:8200/Service1?wsdl
```
and then C++ program looks like this:
```
using namespace Service1;
CoInitializeEx( NULL, COINIT_M... | [
0.08143041282892227,
-0.1482839584350586,
0.5907286405563354,
-0.4017825126647949,
-0.060400303453207016,
0.030705688521265984,
-0.07159214466810226,
-0.2247292846441269,
-0.1897001713514328,
-0.5650807023048401,
-0.44598573446273804,
0.35580235719680786,
-0.391789972782135,
0.012284489348... | |
//todo: analyze hr
}
CoUninitialize();
return 0;
```
Resulting C++ code handles complex types pretty decently, except that it cannot assign NULL to the objects. | [
-0.15784527361392975,
0.0198309738188982,
0.02195078507065773,
-0.22683538496494293,
-0.14134515821933746,
-0.1411939263343811,
0.36720746755599976,
-0.244928777217865,
0.35251542925834656,
-0.2523846924304962,
-0.259066641330719,
0.5965593457221985,
-0.4782862961292267,
-0.112851187586784... | |
I have a gigantic QuickBooks SDK .XSD schema file which defines XML requests/responses that I can send/receive from QuickBooks.
I'd like to be able to easily generate Java classes from these .XSD files, which I could then use to marshal XML to Java objects, and Java objects to XML.
Is there an easy way to do this...... | [
0.33023571968078613,
-0.04763523489236832,
0.41416099667549133,
-0.05288698151707649,
-0.23065702617168427,
-0.2784373462200165,
-0.08776004612445831,
0.1080336719751358,
-0.0832795724272728,
-1.2078430652618408,
-0.004708406515419483,
0.478227436542511,
-0.2702522575855255,
-0.28995537757... | |
I'm trying to bind a Byte array from my databse to a WPF Image.
My XAML:
```
<Window.Resources>
<local:BinaryImageConverter x:Key="imgConverter" />
</Window.Resources>
...
<Image Source="{Binding Path=ImageData, Converter={StaticResource imgConverter}}" />
```
I've modified code published by [Ryan Cromwell](htt... | [
0.0981825739145279,
-0.040776800364255905,
0.5071088671684265,
-0.2811540365219116,
-0.17878209054470062,
0.0932655856013298,
0.3485957980155945,
-0.3228487968444824,
-0.16896632313728333,
-0.6166641116142273,
-0.17139510810375214,
0.4855598509311676,
-0.45528772473335266,
0.30690875649452... | |
TryCast(value, Byte())
Dim stream As New MemoryStream(bytes)
Dim image As New BitmapImage()
image.BeginInit()
image.StreamSource = stream
image.EndInit()
Return image
End If | [
0.19989746809005737,
-0.7046182751655579,
0.6783454418182373,
-0.021765051409602165,
0.16212306916713715,
-0.05828803777694702,
0.18348708748817444,
-0.17542576789855957,
-0.020954085513949394,
-0.6166199445724487,
-0.3735487163066864,
0.6059509515762329,
-0.30881673097610474,
0.1840916126... | |
Return Nothing
End Function
Private Function ConvertBack(ByVal value As Object, ByVal targetType As Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.ConvertBack
Throw New Exception("The method or operation is not implemented.")
... | [
-0.006512617692351341,
0.07715325057506561,
0.47629791498184204,
-0.17340534925460815,
-0.15732598304748535,
-0.11684457957744598,
0.4508081078529358,
-0.2785283923149109,
0.11207476258277893,
-0.3599863052368164,
-0.30918434262275696,
0.8350341320037842,
-0.34961438179016113,
0.1800225377... | |
the bytes coming out of the database. There must have been a problem with the way I was putting them in.
See my working code below.
Thanks for all your help. I've now got it working. I'm still not sure exactly what the problem was.
This is how I put images into my database…
```
Private Sub ButtonUpload_Click(ByVal s... | [
0.17694857716560364,
-0.21191443502902985,
0.7743161916732788,
0.057787083089351654,
-0.039924707263708115,
0.07037588953971863,
0.23053836822509766,
-0.2101622074842453,
-0.6241689920425415,
-0.7817239165306091,
-0.04452865943312645,
0.6425712704658508,
-0.34364020824432373,
0.13639910519... | |
"All Files (*.*)|*.*"
FileBox.FilterIndex = 1
FileBox.Multiselect = False
Dim FileSelected As Nullable(Of Boolean) = FileBox.ShowDialog(Me)
If FileSelected IsNot Nothing AndAlso FileSelected.Value = True Then
Try
FileOpenStream = FileBox.OpenFile()
If (FileOpenStream IsNo... | [
0.20079892873764038,
-0.43917426466941833,
0.7002972960472107,
-0.2270975410938263,
0.16134725511074066,
-0.2711942493915558,
0.5006301999092102,
-0.06841453164815903,
-0.30170220136642456,
-0.6935511827468872,
-0.1952863335609436,
0.6282514333724976,
-0.5659618973731995,
0.236387699842453... | |
Dim ByteArray As Byte()
Using br As New BinaryReader(FileOpenStream)
ByteArray = br.ReadBytes(FileOpenStream.Length)
End Using
Dim g As New ZackGraphic | [
-0.10804242640733719,
-0.018638063222169876,
0.6710625886917114,
-0.18375349044799805,
-0.5399987697601318,
0.16609948873519897,
0.10393168032169342,
-0.21016666293144226,
-0.31447291374206543,
-0.006027367897331715,
-0.3698507249355316,
0.7222789525985718,
-0.31585654616355896,
0.08565553... | |
g.Id = Guid.NewGuid
g.ImageData = ByteArray
g.FileSize = CInt(ByteArray.Length)
g.FileName = FileBox.FileName.Split("\").Last
g.FileExtension = "." + FileBox.FileName.Split(".").Last.ToLower
g.DateAdded = Now | [
0.03466629981994629,
-0.5562009811401367,
0.6426377892494202,
0.06970824301242828,
0.11880034953355789,
0.06794224679470062,
-0.18775498867034912,
-0.1253707855939865,
-0.40583282709121704,
-0.5968015789985657,
-0.1778850555419922,
0.21991021931171417,
-0.1323358714580536,
0.58713155984878... | |
Dim bmp As New BitmapImage
bmp.BeginInit()
bmp.StreamSource = New MemoryStream(ByteArray)
bmp.EndInit()
bmp.Freeze()
g.PixelWidth = bmp.PixelWidth | [
0.3136517405509949,
-0.5741637945175171,
0.6302538514137268,
-0.04565822705626488,
-0.41045352816581726,
0.14083363115787506,
0.1927918642759323,
-0.47002336382865906,
-0.3811001479625702,
-0.2618989944458008,
-0.16413666307926178,
0.3579283356666565,
-0.5682781338691711,
0.162497043609619... | |
g.PixelHeight = bmp.PixelHeight
db.AddToZackGraphic(g)
db.SaveChanges()
End If
Catch Ex As Exception
MessageBox.Show("Cannot read file from disk. " & Ex.Message, "Add a New Image", MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK) | [
0.05691560357809067,
-0.042941395193338394,
0.4820680320262909,
-0.15617868304252625,
-0.3629513680934906,
0.23582622408866882,
0.34840601682662964,
-0.33555638790130615,
-0.22589358687400818,
-0.6546775698661804,
-0.17858710885047913,
0.40968748927116394,
-0.648169755935669,
0.17652927339... | |
Finally
If (FileOpenStream IsNot Nothing) Then
FileOpenStream.Close()
End If
End Try
End If
End Sub
```
This is my value converter used to bind a Byte array to an Image…
```
Class BinaryImageConverter
Implements IValueConverter
Private Function Convert(ByVa... | [
-0.10808504372835159,
-0.26755622029304504,
0.6617411971092224,
-0.27245283126831055,
-0.04112246260046959,
-0.16850166022777557,
0.12008137255907059,
-0.14134612679481506,
0.1005210429430008,
-0.6697105765342712,
0.06621751934289932,
0.7672002911567688,
-0.39997321367263794,
0.16883894801... | |
ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.Convert
If value IsNot Nothing AndAlso TypeOf value Is Byte() Then
Dim ByteArray As Byte() = TryCast(value, Byte())
Dim bmp As New BitmapImage()
bmp.BeginInit()
... | [
0.21077069640159607,
-0.4225575923919678,
0.6951426863670349,
-0.046706486493349075,
-0.16081194579601288,
0.12670248746871948,
0.16388271749019623,
-0.40025755763053894,
-0.15310154855251312,
-0.6158211827278137,
-0.20978857576847076,
0.5027769207954407,
-0.3720829486846924,
0.48559001088... | |
bmp.EndInit()
Return bmp
End If
Return Nothing
End Function
Private Function ConvertBack(ByVal value As Object, ByVal targetType As Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.ConvertBack
Throw New E... | [
0.03439514338970184,
0.05313382297754288,
0.6651647686958313,
-0.0958738923072815,
-0.18798828125,
-0.04366017132997513,
0.07824567705392838,
-0.053986694663763046,
-0.10219089686870575,
-0.5613877177238464,
-0.25772276520729065,
0.5019664764404297,
-0.5153529644012451,
0.4439750015735626,... | |
<Window.Resources>
<local:BinaryImageConverter x:Key="imgConverter" />
</Window.Resources>
...
<Image Source="{Binding Path=ImageData, Converter={StaticResource imgConverter}}" />
``` | [
-0.100374735891819,
-0.14313136041164398,
0.6181645393371582,
-0.22335082292556763,
-0.06685350090265274,
0.1066814661026001,
-0.019529186189174652,
-0.03571168705821037,
-0.3196980953216553,
-0.8107525110244751,
-0.22453975677490234,
0.5779045224189758,
-0.4784090220928192,
0.193897902965... | |
I have a WCF service (basicHttpBinding) hosted in II7 on Vista that I expect to handle many requests concurrently. I'm attempting to load test the service by spawing 200 threads in a test app and calling the WCF service. I've run this test app on the same machine as the server as well as multiple other computers and I ... | [
0.4142912030220032,
0.000813863065559417,
0.24951380491256714,
0.014984861016273499,
-0.18107256293296814,
-0.21586497128009796,
0.5650759339332581,
-0.29889318346977234,
-0.17436936497688293,
-0.8148298859596252,
-0.04006374999880791,
0.3812647759914398,
-0.3718911111354828,
0.21453011035... | |
service behavior, look in msdn for maxConcurrentCalls and maxConcurrentSessions configuration. I think the limit is 10, but I could be wrong. | [
0.038259729743003845,
-0.16076672077178955,
0.5089852213859558,
0.03849567845463753,
0.012310922145843506,
-0.12016664445400238,
0.6467886567115784,
0.3007510006427765,
-0.17133668065071106,
-0.6515741348266602,
0.09993508458137512,
0.7657273411750793,
-0.09973050653934479,
-0.129853442311... | |
I am trying to use a return type of `const MyClass * const`. However, I get a warning:
> Warning: #815-D: type qualifier on return type is meaningless.
Is this not a valid type? I want a pointer than cannot be changed, and I want the thing it points to to not be changed either.
The pointer itself has value type, so i... | [
0.1361212432384491,
0.10335471481084824,
0.2552820146083832,
-0.1765567511320114,
0.029779057949781418,
-0.31282079219818115,
0.3801354169845581,
-0.039454083889722824,
0.08507039397954941,
-0.5366532802581787,
-0.0704738050699234,
0.5897831320762634,
-0.4992249011993408,
0.380671948194503... | |
int value (not a reference). It goes to a register, then the caller function receives it and does whatever it wants with it. | [
-0.15508109331130981,
-0.02955019660294056,
0.2501320242881775,
-0.13034766912460327,
-0.02823939360678196,
0.17447011172771454,
-0.04281679540872574,
-0.006300769280642271,
0.16241121292114258,
-0.19857044517993927,
-0.24857103824615479,
0.3484148681163788,
-0.300252765417099,
0.067205369... | |
I'm trying to access the parent window document from a popup.
```
<script type='text/javascript'>
$(document).ready(function(){
var summary = window.parent.document.getElementById('summary');
var content = summary.innerHTML;
});
</script>
```
Is it even possible? Is there a jQuery specific wa... | [
0.3393067419528961,
0.08232663571834564,
0.4878217577934265,
-0.05534272640943527,
-0.031297579407691956,
-0.034149691462516785,
0.4588507413864136,
0.021087568253278732,
-0.06743015348911285,
-0.8415154218673706,
-0.3364318311214447,
0.3568328022956848,
-0.17319589853286743,
0.27306860685... | |
I know this sounded stupid. But I gotta be doing something wrong here.
Say,
```
struct lala
{
private bool state1;
public lala(bool state1)
{
this.state1 = state1;
}
public void SetState1ToTrue()
{
this.state1 = true;
}
public bool GetState1()
{
return th... | [
0.26922211050987244,
-0.06611516326665878,
0.5032759308815002,
-0.37801000475883484,
0.1687324494123459,
0.15670444071292877,
0.7691546678543091,
-0.508201539516449,
-0.19369377195835114,
-0.4069220721721649,
-0.36721327900886536,
0.3382191061973572,
-0.4021909832954407,
0.2808931171894073... | |
it False???
Console.WriteLine(lalas[0].GetState1());
```
Are there any workarounds to this except changing it to:
```
List<lala> lalas = new List<lala>();
lalas.Add(new lala(false));
lalas.Add(new lala(false));
lala newLala = lalas[0];
newLala.SetState1ToTrue();
lalas[0] = newLala;
// It's True, finally.
Console.... | [
0.13194899260997772,
0.023827778175473213,
0.6522934436798096,
-0.21493272483348846,
0.17455817759037018,
0.07478979974985123,
0.5176315307617188,
-0.3485410809516907,
-0.07976000756025314,
-0.33881038427352905,
-0.3563152253627777,
0.4246330261230469,
-0.4039233326911926,
0.14074756205081... | |
same. It's the same as doing this:
```
lala newLala = lalas[0];
newLala.SetState1ToTrue();
```
If you make lala a class not a struct, so that it becomes a reference type, then the temporary variable (explicit or implicit) is a reference to the lala within the list. | [
0.1273769587278366,
-0.13378240168094635,
0.3578413724899292,
-0.3213520646095276,
-0.08158852159976959,
0.07364513725042343,
0.16288143396377563,
-0.14262472093105316,
-0.2053096890449524,
-0.49167272448539734,
-0.322098970413208,
0.18456244468688965,
-0.5952818989753723,
0.40889456868171... | |
It seems like there's no way to manipulate the columns of a Gridview if AutoGenerateColumns = true. Here's my scenario:
I've got a generic GridView that displays the results of various different LINQ queries depending upon what the user selects. I like the fact that the AutoGenerateColumns works like it should and I d... | [
0.24640700221061707,
-0.005080814938992262,
0.5444586277008057,
-0.008846952579915524,
-0.0868876576423645,
0.15892238914966583,
-0.13183246552944183,
-0.281237930059433,
-0.09518197923898697,
-0.7082251906394958,
0.3269933760166168,
0.5594062805175781,
-0.27590683102607727,
0.160597845911... | |
counts those that are programmed, not autogenerated, so I can't rearrange the columns I want around. I can hook the RowDataBound event and "hide" something if necessary, but I can't rearrange.
Do I just have to give up AutoGeneratedColumns=true, and lay them out with BoundFields for each query? Is there anything I ca... | [
0.043223004788160324,
0.03211691230535507,
0.387506365776062,
-0.12285519391298294,
-0.020369865000247955,
0.1362140029668808,
0.13244380056858063,
-0.4133261740207672,
-0.14322035014629364,
-0.47348910570144653,
0.013218830339610577,
0.47433802485466003,
-0.45958101749420166,
0.1064567118... | |
add your special column)
End If
End If
End Sub
```
You'd have to create your own header to but it's very doable. | [
0.19853298366069794,
-0.013133147731423378,
0.39270833134651184,
0.07125833630561829,
-0.28301310539245605,
-0.2904185354709625,
0.10892018675804138,
-0.24514296650886536,
-0.03685339167714119,
-0.4204237163066864,
-0.13451388478279114,
0.11330215632915497,
-0.3669191896915436,
0.040698897... | |
What is the best for sorting a data table in c#, both from a performance and a code-readability point-of-view:
```
personsDT.OrderBy(person => person.PersonName);
```
or:
```
personsDT.DefaultView.Sort = "PersonName ASC";
```
The personsDT is build from a SharePoint list, so it is impossible to use SQL (I am awar... | [
-0.14283591508865356,
-0.20895588397979736,
-0.1556319296360016,
-0.045392028987407684,
0.04343382269144058,
0.09272374212741852,
-0.09308120608329773,
-0.43029794096946716,
-0.1600961685180664,
-0.6170971393585205,
0.012937870807945728,
0.48370301723480225,
-0.20638765394687653,
-0.495860... | |
second one.
2) In the first case you are using a strongly type way to sort your entity which is good.
3) On the second case you are passing the field and the order in a string mmmm dont like it.
Go Lambdas!!!
Regards! | [
-0.17998960614204407,
-0.3197411596775055,
0.4027809202671051,
0.019537081941962242,
-0.18087752163410187,
-0.09074342995882034,
0.12278522551059723,
-0.06288152933120728,
0.08886472135782242,
-0.4377841353416443,
-0.14829455316066742,
0.508655846118927,
-0.6020495891571045,
-0.17988249659... | |
The executeTime below is 30 seconds the first time, and 25 seconds the next time I execute the same set of code. When watching in SQL Profiler, I immediately see a login, then it just sits there for about 30 seconds. Then as soon as the select statement is run, the app finishes the ToList command. When I run the genera... | [
0.3873661160469055,
-0.15060187876224518,
0.5535969734191895,
-0.04456472024321556,
0.04269419237971306,
0.06241711229085922,
0.5441759824752808,
-0.47484418749809265,
-0.20054267346858978,
-0.5819551348686218,
0.023199910297989845,
0.5853620767593384,
-0.031183786690235138,
-0.11030284315... | |
is happening in the 30 seconds before the database call is made?
If entity framework is this slow, it is not possible for us to use it. Is there something I am doing wrong or something I can change to speed this up dramatically?
**UPDATE:**
All right, if I use a Compiled query, the first time it take 30 seconds, and ... | [
0.20465248823165894,
-0.16570435464382172,
0.7369418740272522,
0.03515561670064926,
0.36714237928390503,
-0.2845137119293213,
0.42181527614593506,
-0.21443967521190643,
-0.09622684121131897,
-0.8712972402572632,
-0.03550262004137039,
0.7138153910636902,
-0.2011284977197647,
0.1177154108881... | |
var groupQuery = (from g in context.Groups.Include("DealContract")
.Include("DealContract.Contracts")
.Include("DealContract.Contracts.AdvertiserAccountType1")
.Include("DealContract.Contracts.ContractItemDetails")
.Include("DealContrac... | [
0.13417662680149078,
0.1282685399055481,
0.5393056273460388,
-0.3518703877925873,
-0.3109947443008423,
0.30370810627937317,
-0.028808673843741417,
-0.49381375312805176,
-0.15945427119731903,
-0.2655280828475952,
-0.2037106305360794,
0.6543667912483215,
-0.2848520576953888,
0.03745263069868... | |
.Include("DealContract.Contracts.Agencies")
.Include("DealContract.Contracts.AdvertiserAccountType2")
.Include("DealContract.Contracts.ContractProductLinks.Products")
.Include("DealContract.Contracts.ContractPersonnelLinks")
.Include("D... | [
0.23489713668823242,
0.047292910516262054,
0.32225748896598816,
-0.24603065848350525,
-0.13493578135967255,
0.16484799981117249,
0.0612616203725338,
-0.4614039659500122,
-0.34546998143196106,
-0.5205177664756775,
-0.46968570351600647,
0.5926455855369568,
-0.220049187541008,
-0.209886834025... | |
.Include("DealContract.Contracts.Advertisers")
where g.GroupKey == 6
select g).OfType<Deal>();
sw.Stop();
var queryTime = sw.Elapsed;
sw.Reset();
sw.Start();
var groups = groupQuery.ToList();
sw.Stop();
var executeTime | [
0.02714577503502369,
-0.3605189025402069,
0.6920048594474792,
-0.5250194072723389,
0.13715898990631104,
0.1004474088549614,
0.22246678173542023,
-0.6947231292724609,
-0.28987833857536316,
-0.5307403206825256,
-0.5652416944503784,
0.5826470851898193,
-0.5497347712516785,
-0.0913519337773323... | |
= sw.Elapsed;
}
```
I had this exact same problem, my query was taking 40 seconds.
I found the problem was with the `.Include("table_name")` functions. The more of these I had, the worse it was. Instead I changed my code to Lazy Load all the data I needed right after the query, this knocked the total time down to a... | [
-0.018178313970565796,
-0.08156213164329529,
0.327609121799469,
-0.38919997215270996,
-0.0233328677713871,
-0.03180745989084244,
0.4381446838378906,
-0.3637593388557434,
-0.3973296582698822,
-0.49888813495635986,
0.0024653824511915445,
0.3778832256793976,
-0.4603992998600006,
0.11287415027... | |
where g.GroupKey == 6
select g).OfType<Deal>();
var groups = groupQuery.ToList();
foreach (var g in groups)
{
// Assuming Dealcontract is an Object, not a Collection of Objects
g.DealContractReference.Load();
if (g.DealContract != null)
{
foreach (var d in g.DealContract)
... | [
-0.11908358335494995,
-0.16087275743484497,
0.4733003079891205,
-0.3563648462295532,
0.041538335382938385,
-0.045793041586875916,
0.018668336793780327,
-0.7413603663444519,
-0.3641780912876129,
-0.2937816381454468,
-0.4478054940700531,
0.5279806852340698,
-0.6655956506729126,
-0.1618150025... | |
".Load"
// if it is an object, you call ".Load" on the refence instead like with "g.DealContractReference" above
d.Contracts.Load();
foreach (var c in d.Contracts)
{
c.AdvertiserAccountType1Reference.Load(); | [
0.5384402871131897,
-0.08743346482515335,
0.7255880832672119,
-0.5841314792633057,
-0.06831763684749603,
-0.05043836310505867,
0.17704030871391296,
-0.35525965690612793,
0.05175692215561867,
-0.41629108786582947,
-0.45084840059280396,
0.7927624583244324,
-0.6974027156829834,
0.183576956391... | |
// etc....
}
}
}
}
```
Incidentally, if you were to add this line of code above the query in your current code, it would knock the time down to about 4-5 seconds (still too ling in my option) From what I understand, the `MergeOption.NoTracking` option disables a lot of the tracking overhead fo... | [
-0.10870816558599472,
-0.02871403656899929,
0.3995702266693115,
-0.11128818988800049,
0.3328855633735657,
-0.2151181399822235,
0.3639366626739502,
-0.06631319969892502,
-0.09580015391111374,
-0.6873244643211365,
-0.1587168574333191,
0.29626521468162537,
-0.2148260921239853,
-0.044381849467... | |
I'm kind of new to unit testing, using `Microsoft.VisualStudio.TestTools.UnitTesting`;
The `0.GetType()` is actually `System.RuntimeType`, so what kind of test do I need to write to pass `Assert.IsInstanceOfType(0.GetType(), typeof(int))`?
--- following up, this is my own user error... `Assert.IsInstanceOfType(0, typ... | [
0.38598743081092834,
0.12861868739128113,
0.5772050619125366,
-0.029449833557009697,
-0.0377197302877903,
-0.09429173171520233,
0.5716184377670288,
-0.5690593123435974,
0.24064354598522186,
-0.658648669719696,
0.04864818975329399,
0.6991501450538635,
-0.17924778163433075,
0.134862795472145... | |
I searched if JavaScript offers a mean to define symbolic constants, but didn't find anything. Did I miss something ?
Is it a common practices to use const var instead ?
```
var const MAXIMUM_VALUE = 100;
```
Thanx.
`const` is not supported by IE, so if you want to support IE that is out of the question.
As far... | [
0.4156600832939148,
0.1605154275894165,
0.10044722259044647,
-0.13841260969638824,
-0.12489109486341476,
-0.0648735761642456,
0.40207335352897644,
0.21015577018260956,
-0.08990880846977234,
-0.42254501581192017,
0.21134984493255615,
0.6477389931678772,
-0.36088088154792786,
0.3557538688182... | |
for the most part. Alternatively, you could use a function:
```
function myConst() { return 'myValue'; }
```
This can of course still be overridden but I've seen it used.
Also see:
> * [Are there constants in Javascript?](https://stackoverflow.com/questions/130396/are-there-constants-in-javascript)
> * [Is it poss... | [
-0.24907509982585907,
0.10285686701536179,
0.26031017303466797,
0.10185518860816956,
-0.09771167486906052,
0.05143268033862114,
0.11491985619068146,
0.16420644521713257,
-0.5216407179832458,
-0.30151814222335815,
-0.03475119173526764,
0.6060124635696411,
-0.2572835385799408,
0.123127318918... | |
I have an ASP.NET MVC Partial View that contains a Html.TextBox that is configured to use the datepicker from JQueryUI. This is done by ensuring the style is set to .datepicker. This all worked fine. However I have changed my forms to Ajax.BeginForm and included a Ajax.ActionLink that displays it after clicking on the ... | [
0.21695315837860107,
-0.2417602390050888,
0.67665696144104,
-0.19188222289085388,
-0.31045153737068176,
-0.02922622486948967,
0.2786270081996918,
0.038707152009010315,
-0.13485704362392426,
-0.9052278995513916,
0.14670519530773163,
0.6090033650398254,
-0.13964451849460602,
-0.1526816785335... | |
I really am confused, can someone please help?
Examples shown below
```
<div id="claims">
<div id="divViewClaims">
<% Html.RenderPartial("ViewClaim", Model.Claims ?? null); %>
</div>
<br /><br />
<div id="claim">
<% Html.RenderPartial("AddEditClaim", new Claim()... | [
0.17626437544822693,
-0.038063518702983856,
0.3790396749973297,
0.14761580526828766,
0.06540567427873611,
0.04334656894207001,
0.3302869200706482,
0.033818818628787994,
-0.19914332032203674,
-0.48983386158943176,
0.0712863877415657,
0.7209271192550659,
0.08312790095806122,
0.21430836617946... | |
</div>
```
Action Link, when clickon calls Controller Action to return PartialView, The JavaScript called on the OnSuccess fires but nothing else, that previously was hooked up by the document.ready function. All my scripts are in seperate files and referenced in master page.
```
<%= Ajax.ActionLink(string.Format("A... | [
0.18791189789772034,
-0.26385048031806946,
0.7482317686080933,
-0.14426252245903015,
-0.029792780056595802,
0.14008589088916779,
0.07343562692403793,
-0.22557175159454346,
-0.08301326632499695,
-0.6755009293556213,
-0.10799704492092133,
0.7523754835128784,
-0.09470179677009583,
-0.19558496... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.