text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
I'd like to be able to show the progress of a file copy operation when copying files using Ruby (currently using FileUtils.cp) I've tried setting the `verbose` option to `true` but that just seems to show me the copy command issued.
I'm running this script from command line at the moment so ideally I'd like to be able... | [
0.7192594408988953,
0.24276244640350342,
0.5564171075820923,
-0.03785746544599533,
-0.31835371255874634,
-0.1812216341495514,
0.30404311418533325,
0.09654632955789566,
-0.29876360297203064,
-0.44020408391952515,
0.07034594565629959,
0.559395432472229,
-0.19009576737880707,
0.28480234742164... | |
I found a [progress bar gem](http://0xcc.net/ruby-progressbar/index.html.en "progress bar gem") which I'm also using in my example. I have tested this and it has worked OK so far, but it could do with some cleaning up:
```
require 'rubygems'
require 'progressbar'
in_name = "src_file.txt"
out_name = "dest_file.... | [
0.18102510273456573,
0.29668790102005005,
0.4068145453929901,
-0.18460558354854584,
-0.26181480288505554,
0.29800131916999817,
0.30857837200164795,
-0.7028837203979492,
-0.2757619619369507,
-0.5427700281143188,
-0.03411954268813133,
0.39590394496917725,
0.06330466270446777,
0.1812729239463... | |
total < in_size do
out_file.syswrite(buffer)
p_bar.inc
total += batch_bytes
if (in_size - total) < batch_bytes
batch_bytes = (in_size - total)
end
buffer = in_file.sysread(batch_bytes)
end
p_bar.finish
``` | [
-0.08345870673656464,
0.07677531987428665,
0.6336652040481567,
-0.29765990376472473,
0.009385100565850735,
0.390783429145813,
0.14494487643241882,
-0.2878897488117218,
-0.383978009223938,
-0.3687625527381897,
-0.3638755977153778,
0.3063780665397644,
-0.1632031500339508,
0.20842936635017395... | |
In Oracle there is a mechanism to generate sequence numbers e.g.;
```
CREATE SEQUENCE supplier_seq
MINVALUE 1
MAXVALUE 999999999999999999999999999
START WITH 1
INCREMENT BY 1
CACHE 20;
```
And then execute the statement
```
supplier_seq.nextval
```
to retrieve the next sequence number.
How w... | [
0.345747709274292,
0.2229601889848709,
0.21525722742080688,
0.16657042503356934,
0.035865917801856995,
0.14402908086776733,
-0.1767294853925705,
-0.3721936047077179,
0.00909434724599123,
-0.37762296199798584,
-0.03391456976532936,
0.4573289155960083,
-0.145976260304451,
0.22826047241687775... | |
no exact match.
The equivalent is IDENTITY that you can set as a datatype while creating a table. SQLSERVER will automatically create a running sequence number during insert.
The last inserted value can be obtained by calling SCOPE\_IDENTITY() or by consulting the system variable @@IDENTITY (as pointed out by Frans)
... | [
0.3049536645412445,
-0.03880172595381737,
0.2628595530986786,
0.09486257284879684,
-0.09257303923368454,
-0.097529336810112,
0.046111151576042175,
-0.100294329226017,
0.07198486477136612,
-0.5425395965576172,
0.29791519045829773,
0.700872004032135,
-0.5630674362182617,
0.0651204064488411,
... | |
you implement sequences in Microsoft SQL Server?](https://stackoverflow.com/questions/282943/how-would-you-implement-sequences-in-microsoft-sql-server) | [
0.5504772663116455,
0.042001765221357346,
0.05932071432471275,
0.20550541579723358,
0.4067198932170868,
-0.2607169449329376,
-0.272758424282074,
-0.4112284183502197,
-0.17423154413700104,
-0.2569969892501831,
0.015810107812285423,
0.2932548522949219,
-0.3998660147190094,
-0.078805550932884... | |
I have a problem with setting validation message. i have two Model in one control and both Model have same property "amount".
So setting validation for one Model.amount will reflect to other Model.amount as well. I have tried to pass different ids to both but not working.
```
<%= Html.TextBox("amount", Model.amount,... | [
0.2537006735801697,
0.1293221414089203,
0.6987705230712891,
-0.08387476950883865,
-0.22684015333652496,
0.08868487179279327,
0.2469472736120224,
-0.7642214894294739,
-0.1609940528869629,
-0.3057534694671631,
0.21501709520816803,
0.60601407289505,
-0.12731559574604034,
-0.03732692077755928,... | |
applied to Eamount as well
What should I do?
This is what i needed to do.......thanks for all the help!!!
```
// Read in Xml-file
XmlDocument doc = new XmlDocument();
doc.Load("C:/Web.config");
//SaveControl tag..........................................................
XmlNode n = do... | [
0.26505398750305176,
0.3440576493740082,
0.8581615686416626,
0.00578928692266345,
-0.08620896935462952,
-0.06400013715028763,
0.3105601668357849,
-0.9299991726875305,
0.12946902215480804,
-0.5705086588859558,
-0.18089523911476135,
0.7750206589698792,
-0.4013911783695221,
-0.323170453310012... | |
elemWeb.SetAttribute("Safe", "True");
XmlElement elemSmartPart = doc.CreateElement("SafeControl");
elemSmartPart.SetAttribute("Assembly", "Machine_Totals");
elemSmartPart.SetAttribute("Namespace", "Machine_Totals");
elemSmartPart.SetAttribute("TypeName", "*");
elemSmartPart.SetA... | [
-0.18304572999477386,
0.18506808578968048,
0.8199892044067383,
0.18145951628684998,
0.09528346359729767,
-0.0047437045723199844,
0.4875131845474243,
-0.5650713443756104,
-0.2525741159915924,
-0.6332606673240662,
-0.9345464110374451,
0.35153114795684814,
-0.15823425352573395,
-0.02197788655... | |
For example:
```
<Grid Name="TestGrid">
<Grid.ColumnDefinitions>
<ColumnDefinition Name="TestColumnName" Width="*" />
</Grid.ColumnDefinitions>
</Grid>
```
I would like to be able to access the column definition in code using the name 'TestColumnName'.
Use the x:Name property instead of Name :) | [
0.10897944867610931,
-0.019241997972130775,
0.14824382960796356,
0.00884287804365158,
0.056413888931274414,
-0.08251183480024338,
-0.012279544956982136,
-0.05381770804524422,
0.0877467542886734,
-0.757403552532196,
-0.008273977786302567,
0.2715197801589966,
-0.052663423120975494,
0.0203028... | |
I've decoupled events in this WPF application in the following way.
What is the best way to continue decoupling?
**Shell.xaml:**
```
<Button x:Name="btnProcess"
Content="Process"
Margin="10"/>
```
**Bootstrapper.cs:**
```
public void Run()
{
Shell shell = new Shell(new Customer());
shell.S... | [
0.17769202589988708,
-0.016458354890346527,
0.429894357919693,
-0.2728376090526581,
0.2232704758644104,
0.2135424166917801,
0.28417232632637024,
-0.24029716849327087,
-0.16811324656009674,
-0.5695962309837341,
-0.3462044596672058,
0.4521411955356598,
-0.38487258553504944,
0.287845522165298... | |
processed.";
}
}
```
The above code successfully decouples the view `Shell` from the model `Customer:IPerson` so that I can swap in e.g. a model `Employee:IPerson` etc. which handles "Processed" in its own way. That was the first goal.
But now:
* **how do I decouple the `Processed` method from talking specifica... | [
0.1548883467912674,
-0.11085131764411926,
0.34002408385276794,
0.055001385509967804,
0.1429978311061859,
0.262469083070755,
-0.23904374241828918,
-0.27675625681877136,
-0.38895413279533386,
-0.5852336883544922,
-0.03855237737298012,
0.5613607168197632,
-0.3177190124988556,
0.17260114848613... | |
the view** other than the sender (Button), e.g. how would I alter the status bar in Shell? I see two ways:
+ I could either **build a container** which holds all views and inject the container in the Customer upon creation, then the customer can look in the container and manipulate the calling view anyway it wants (al... | [
0.07748807221651077,
-0.34788429737091064,
0.5305333733558655,
0.1112094521522522,
-0.11691928654909134,
0.4966980516910553,
-0.1580759584903717,
-0.001581045682542026,
0.004573268350213766,
-0.4498160481452942,
-0.05876372009515762,
0.8984494209289551,
-0.12591414153575897,
0.050449226051... | |
Model would need some way of knowing (via interface) what kinds of regions were available to manipulate at runtime
* **How would you continue** this application in the direction of a more decoupled design?
* **What pattern is this** actually, e.g. MVC, MVP, MVVM? I only see a view (Shell) and a Model (Customer).
+ How... | [
-0.02213449589908123,
-0.3916377127170563,
0.5246875882148743,
0.29025205969810486,
-0.03654417768120766,
-0.02550121769309044,
-0.1737828105688095,
-0.07201699912548065,
-0.5246527791023254,
-0.7114831805229187,
0.20098468661308289,
0.6720221042633057,
-0.23758111894130707,
0.049054276198... | |
your UI inputs (button, menu item...) that their command is [name of your command] and handle all of them in one place. | [
-0.033569879829883575,
-0.07351547479629517,
0.5919294953346252,
0.1925244778394699,
0.013032030314207077,
0.041997894644737244,
-0.04935627058148384,
-0.016066882759332657,
0.07821346819400787,
-0.9241137504577637,
-0.4644310474395752,
0.3552710711956024,
-0.024551041424274445,
0.00481497... | |
I understand that Window's Services have no desktop, and can't access any of the user's desktops directly (indeed, they can run when there is no desktop loaded). Why is it though that launching a form in a Window's Service causes an error?
There's a setting you must enable in order to allow your Windows Service to acce... | [
0.24035687744617462,
0.055279091000556946,
0.5722115635871887,
-0.03018825128674507,
-0.04502014070749283,
0.019025996327400208,
0.3793500065803528,
-0.08558466285467148,
-0.25686800479888916,
-1.00190007686615,
-0.15231361985206604,
0.45391103625297546,
-0.15972523391246796,
0.38833597302... | |
tab there is a checkbox for this setting.
[Here is](http://www.codeproject.com/KB/install/cswindowsservicedesktop.aspx) an article for how to set it programmatically in C#
**[Edit]** As Stephen Martin points out in the comments: this is only valid advice for pre-Vista versions of Windows. | [
0.3542656898498535,
0.1805122196674347,
0.3450840711593628,
-0.058906760066747665,
0.26055124402046204,
-0.4796695411205292,
0.4836147427558899,
0.041410721838474274,
-0.2849108874797821,
-0.4217270612716675,
-0.20382004976272583,
0.6513285040855408,
-0.16602477431297302,
-0.16668558120727... | |
We're having problems with an ASP.NET application which allows users to upload, and crop images. The images are all scaled to fixed sizes afterwards. We basically run out of memory when a large file is processed; it seems that the handling of JPEG is rather inefficient -- we're using System.Drawing.BitMap. Do you have ... | [
0.3271035850048065,
-0.034009095281362534,
0.3208007216453552,
0.2709713578224182,
-0.03004278428852558,
-0.1211482509970665,
-0.22183603048324585,
-0.11803315579891205,
-0.46378031373023987,
-0.6894132494926453,
0.18232491612434387,
0.5264885425567627,
-0.29635167121887207,
0.020267225801... | |
a sample from my library (resizing) :
```
public Bitmap ApplyTo(Bitmap bitmap)
{
using (bitmap)
{
Bitmap newBitmap = new Bitmap(bitmap, CalculateNewSize(bitmap));
using (Graphics graphics = Graphics.FromImage(newBitmap))
{
graphics.SmoothingM... | [
-0.0359579399228096,
-0.37464460730552673,
0.6395969986915588,
-0.18790064752101898,
0.012622379697859287,
0.1392078846693039,
0.172470822930336,
-0.6613322496414185,
-0.06033438444137573,
-0.8146701455116272,
0.009113105945289135,
0.5800037980079651,
-0.2987711429595947,
0.031817335635423... | |
SmoothingMode.None;
graphics.InterpolationMode =
InterpolationMode.HighQualityBicubic;
graphics.CompositingQuality =
CompositingQuality.HighQuality; | [
-0.8007872104644775,
-0.5629470944404602,
0.5599100589752197,
0.15870748460292816,
-0.3680713474750519,
0.4012130796909332,
-0.05250108242034912,
-0.4066186547279358,
-0.15914097428321838,
-0.7446714639663696,
-0.1429462879896164,
0.3162813186645508,
-0.3674539029598236,
-0.210359334945678... | |
graphics.DrawImage(
bitmap,
new Rectangle(0, 0, newBitmap.Width, newBitmap.Height));
}
return newBitmap;
}
}
``` | [
-0.1946343183517456,
-0.2504785358905792,
0.6135233640670776,
-0.11538287252187729,
-0.15047219395637512,
0.1755114197731018,
-0.06570173799991608,
-0.002384481718763709,
-0.2688819468021393,
-0.970114529132843,
-0.29950109124183655,
0.5653176307678223,
-0.36942794919013977,
0.007835372351... | |
i'm using the mshtml dll to develop a helper to ie,
i'm trying to get the position of an htmll element,
i have an object with type of HTMLAnchorElementClass
when i'm trying to get his style.posTop value i get a null ref exception
is there a better way to do it?
maybe other cast?
please help
Here's an example I found... | [
0.05520012602210045,
0.06317175924777985,
0.5017154812812805,
-0.0018591503612697124,
-0.23344364762306213,
-0.08122390508651733,
0.3287142217159271,
-0.19199161231517792,
-0.12999871373176575,
-0.6351534128189087,
-0.2035677433013916,
0.37945717573165894,
-0.6093315482139587,
-0.245980262... | |
(TmpElem != null)
{
ElementLeft = ElementLeft + TmpElem.offsetLeft;
ElementTop = ElementTop + TmpElem.offsetTop;
TmpElem = TmpElem.offsetParent;
}
``` | [
-0.05512510612607002,
-0.31893181800842285,
0.18980181217193604,
0.011478137224912643,
0.20815429091453552,
-0.01245199516415596,
0.002593826036900282,
-0.4028334617614746,
-0.31780123710632324,
-0.16094912588596344,
-0.43317902088165283,
0.6651641130447388,
-0.5817782282829285,
-0.5076809... | |
**How can I repeat a selection of a texture atlas?**
For example, my sprite (selection) is within the texture coordinates:
```
GLfloat textureCoords[]=
{
.1f, .1f,
.3f, .1f,
.1f, .3f,
.3f, .3f
};
```
Then I want to repeat that sprite *N times* to a triangle strip (or quad) defined by:
```
GLfl... | [
-0.10319624096155167,
-0.023017875850200653,
0.8980425596237183,
-0.048154477030038834,
-0.34030860662460327,
0.2264278531074524,
0.16350184381008148,
-0.053137775510549545,
-0.29000967741012573,
-0.8959734439849854,
0.08273262530565262,
0.3572486639022827,
0.05708037316799164,
0.508718848... | |
work: (trying to repeat N = 10)
```
GLfloat textureCoords[]=
{
10.1f, 10.1f,
10.3f, 10.1f,
10.1f, 10.3f,
10.3f, 10.3f
};
```
We're seeing our full texture atlas repeated...
**How would I do this the right way?**
It can't be done the way it's described in the question. OpenGL's texture coordinate... | [
0.1576894223690033,
-0.029469197615981102,
0.515355110168457,
-0.045328859239816666,
-0.20405466854572296,
0.11351566761732101,
0.2800343632698059,
-0.10630231350660324,
-0.505757212638855,
-0.6594713926315308,
-0.1598663479089737,
0.5812574625015259,
-0.12682801485061646,
0.21852311491966... | |
a bigger area, you'd draw a rectangle that's six times as wide as it is tall. Then you'd set the texture coordinates to (0,0)-(6,1), and the texture mode to "repeat". When interpolating across the polygon, the texture coordinate that goes beyond 1 will, due to repeat being enabled, "wrap around" in the texture, causing... | [
0.17606495320796967,
-0.11825268715620041,
0.5152684450149536,
-0.04279573634266853,
-0.21934925019741058,
0.17636866867542267,
0.18987926840782166,
-0.24694116413593292,
-0.5358944535255432,
-0.655278205871582,
-0.2624776065349579,
0.11878464370965958,
-0.046349480748176575,
0.14259473979... | |
the texture, there's no way to specify that larger texture coordinate in a way that makes OpenGL repeat it inside only the sub-rectangle.
You basically have two choices: Either create a new texture that only has the sprite you need from the existing texture or write a GLSL vertex program to map the texture coordinates... | [
-0.3015923798084259,
-0.1713046431541443,
0.6855035424232483,
0.3545233905315399,
-0.39967435598373413,
0.10989180207252502,
0.2660098671913147,
0.20448675751686096,
-0.21787233650684357,
-0.786644697189331,
-0.01157490536570549,
0.38829508423805237,
-0.1736230105161667,
0.1627617329359054... | |
In Winforms I would use Application.ProductVersion to get the version of my code. Is there an equivalent for Silverlight 2.0?
Here is link that may be helpful to you:
[Determine the version of my Silverlight app](https://stackoverflow.com/questions/1226232/determine-the-version-of-my-silverlight-app) | [
0.48189428448677063,
0.01511278934776783,
0.42297977209091187,
-0.22109122574329376,
-0.10610105097293854,
-0.0000910218950593844,
0.08138877898454666,
-0.3821955621242523,
0.049357492476701736,
-0.5958282351493835,
0.14813795685768127,
0.6321973204612732,
-0.33251988887786865,
-0.16657540... | |
I was looking at the slave/pool modules and it seems similar to what I
want, but it also seems like I have a single point of failure in my
application (if the master node goes down).
The client has a list of gateways (for the sake of fallback - all do
the same thing) which accept connections, and one is chosen from
ra... | [
0.2501983046531677,
-0.16871128976345062,
0.0342680960893631,
0.18296143412590027,
0.026118291541934013,
0.19856174290180206,
-0.04954545199871063,
-0.3465406894683838,
-0.37677690386772156,
-0.7569047808647156,
-0.03876141086220741,
0.3156682550907135,
-0.22168895602226257,
0.252927690744... | |
summary, I want all nodes to act as both gateways and to actually
process client requests. The load balancing is only done when the
client initially connects - all of the actual packets and processed on
the client's "home" node.
How would I do this?
I don't know if there is this modules implemented yet but what I can ... | [
0.2438967376947403,
-0.11750800162553787,
0.3653339147567749,
-0.107684426009655,
0.09807921200990677,
0.04367676004767418,
0.14316654205322266,
-0.03976329416036606,
-0.3617611229419708,
-0.9261492490768433,
0.17652268707752228,
0.3801220655441284,
-0.16366548836231232,
0.1955972462892532... | |
are examined to see which has the least load and then the IP of the least- loaded server is forwarded back to the client.
How you know that all those least loaded node will not be highest loaded just in next ms? How you know that all those high loaded nodes which you will not include in list will not drop load just in... | [
0.07207917422056198,
-0.311339408159256,
0.2895895838737488,
0.39419302344322205,
-0.08614791929721832,
-0.012723805382847786,
0.03882715478539467,
-0.09381437301635742,
-0.3300511837005615,
-0.7804702520370483,
-0.142232745885849,
0.5615084767341614,
-0.1208014115691185,
-0.07853455096483... | |
as initial approach. When you set it up, then you can try make up some more sophisticated algorithm. I bet that it will be very hard work to beat this initial approach. Trust me, very hard.
**Edit**: To be more clear in one subtle detail, I strongly argue that you can't predict future load from current and historical ... | [
0.015878664329648018,
-0.37032654881477356,
0.08482275903224945,
0.08964205533266068,
-0.03168570622801781,
0.08093179017305374,
0.1098296269774437,
-0.05791625380516052,
-0.3706949055194855,
-0.8201537728309631,
0.14693544805049896,
0.683975100517273,
0.06829792261123657,
-0.0878570154309... | |
I have a problem when binding a command in a context menu on a usercontrol that is on a tab page.
The first time I use the menu (right-click on the tab) it works great, but if I switch tab the command will use the databound instance that was used the first time.
If I put a button that is bound to the command in the us... | [
0.10562928766012192,
0.30023378133773804,
0.29491257667541504,
-0.2162153422832489,
0.22277963161468506,
-0.1060924082994461,
0.6613717079162598,
-0.021627195179462433,
-0.26543712615966797,
-0.7843815684318542,
-0.18918965756893158,
0.7354652881622314,
-0.6721940040588379,
0.3792870938777... | |
{
base.OnStartup(e);
CompanyViewModel model = new CompanyViewModel();
Window1 window = new Window1();
window.DataContext = model;
window.Show();
}
}
```
Window1.xaml:
```
<Window x:Class="WpfApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/present... | [
-0.2891532778739929,
0.0037188760470598936,
0.940265953540802,
-0.21753038465976715,
-0.13331837952136993,
0.28513357043266296,
-0.18976034224033356,
-0.3396342098712921,
-0.26652052998542786,
-0.2645722031593323,
-0.3161243796348572,
0.38980889320373535,
-0.0313989631831646,
0.08317623287... | |
</StackPanel>
</DataTemplate>
<DataTemplate DataType="{x:Type vw:PersonViewModel}">
<vw:UserControl1/>
</DataTemplate>
</Window.Resources>
<Grid>
<TabControl ItemsSource="{Binding Path=Persons}"
ItemTemplate="{StaticResource HeaderTemplate}"
IsSynchronizedWithCu... | [
-0.7093958258628845,
-0.09266514331102371,
0.47320666909217834,
-0.08737795054912567,
-0.14631471037864685,
0.26486116647720337,
-0.10472982376813889,
-0.6456772089004517,
-0.33772268891334534,
-0.3878902494907379,
-0.1933436393737793,
0.4177476465702057,
0.1549306958913803,
-0.18545420467... | |
<MenuItem Header="Change" Command="{Binding Path=ChangeCommand}"/>
</ContextMenu>
</UserControl.ContextMenu>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Grid.Column="0">Th... | [
-0.3966647982597351,
0.019970744848251343,
0.7855453491210938,
-0.2938863933086395,
0.20886656641960144,
0.17677567899227142,
-0.16113577783107758,
-0.435647189617157,
-0.01807115226984024,
-0.6015116572380066,
-0.2485779970884323,
0.31387433409690857,
-0.1646815985441208,
0.18107537925243... | |
Persons { get; set; }
public CompanyViewModel()
{
Persons = new ObservableCollection<PersonViewModel>();
Persons.Add(new PersonViewModel(new Person { Name = "Kalle" }));
Persons.Add(new PersonViewModel(new Person { Name = "Nisse" }));
Persons.Add(new PersonViewModel(new Person { ... | [
-0.2729475796222687,
-0.2550039291381836,
0.3122818171977997,
0.1060483381152153,
0.05281270295381546,
0.36232465505599976,
0.2579519748687744,
-0.028371423482894897,
-0.19105544686317444,
-0.7949658632278442,
-0.4710846543312073,
0.3359135389328003,
-0.035192735493183136,
0.23104335367679... | |
_person = person;
_testCommand = new TestCommand(this);
}
public ICommand ChangeCommand
{
get
{
return _testCommand;
}
}
public string Name
{
get | [
-0.11060690879821777,
-0.2916751503944397,
-0.08099539577960968,
0.024402402341365814,
0.4052130877971649,
0.0019891473930329084,
0.22926723957061768,
-0.2512158453464508,
0.0871206745505333,
-0.5217944979667664,
-0.31989586353302,
0.4701131582260132,
-0.20662859082221985,
0.47092583775520... | |
{
return _person.Name;
}
set
{
if (value == _person.Name)
return;
_person.Name = value;
OnPropertyChanged("Name"); | [
-0.3153214454650879,
-0.18622305989265442,
0.26608553528785706,
-0.21564073860645294,
0.4896118640899658,
0.29901406168937683,
0.27756133675575256,
-0.17414967715740204,
0.01530851423740387,
-0.200898677110672,
-0.5101322531700134,
0.6215590834617615,
-0.2729450762271881,
0.037318676710128... | |
}
}
void OnPropertyChanged(string propertyName)
{
PropertyChangedEventHandler handler = this.PropertyChanged;
if (handler != null)
{
var e = new PropertyChangedEventArgs(propertyName);
handler(this, e);
}
}
public event PropertyChangedEventHand... | [
0.1894216537475586,
-0.3481118977069855,
0.23974448442459106,
0.020959099754691124,
0.5292559266090393,
-0.11439178138971329,
0.2427760362625122,
-0.3616376221179962,
-0.19737084209918976,
-0.41499826312065125,
-0.40980350971221924,
0.7279379963874817,
-0.13441766798496246,
0.4471268355846... | |
PersonViewModel _person;
public event EventHandler CanExecuteChanged;
public TestCommand(PersonViewModel person)
{
_person = person;
}
public bool CanExecute(object parameter)
{
return true;
}
public void Execute(object parameter)
{
_person.Name = "Changed by... | [
-0.1294136941432953,
-0.5259604454040527,
0.24933043122291565,
-0.04778795316815376,
-0.024234216660261154,
0.38804587721824646,
0.3980233371257782,
-0.06943555921316147,
-0.0682324543595314,
-0.5203083753585815,
-0.2524200975894928,
0.5822703838348389,
-0.08694565296173096,
0.180846482515... | |
thing to remember here is **context menus are not part of the visual tree.**
Therefore they don't inherit the same source as the control they belong to for binding. The way to deal with this is to bind to the placement target of the ContextMenu itself.
```
<MenuItem Header="Change" Command="{Binding
Path=Placeme... | [
-0.24184298515319824,
-0.1694835126399994,
0.39116141200065613,
-0.2220054417848587,
0.19633927941322327,
0.317917138338089,
-0.1050783097743988,
-0.08998386561870575,
-0.16383342444896698,
-0.9466193914413452,
0.08524100482463837,
0.25200366973876953,
-0.2416587769985199,
0.13558381795883... | |
Background:
I have a form with a "clear form" and a "cancel" button. If I have invalid data inside a dropdown and click either of these buttons the dropdown's validating event fires. I've added code to the validating event to succeed when either "clear" or "cancel" are pressed.
Problem:
I would expect that the next t... | [
0.31463199853897095,
0.14751432836055756,
0.3856458067893982,
0.14282216131687164,
0.3194853961467743,
-0.10958526283502579,
0.06407584249973297,
0.07071518898010254,
-0.3237316310405731,
-0.27096545696258545,
0.003197565907612443,
0.6590208411216736,
-0.2583509385585785,
-0.11697624623775... | |
sure what's ailing you, neither Click event should run when you set e.Cancel in a Validating event handler. But there's a better way to do this. Set the buttons' CausesValidation property to False. | [
0.12485276907682419,
-0.17037992179393768,
0.08330098539590836,
0.2517746090888977,
0.07779304683208466,
-0.3398268222808838,
0.5369451642036438,
-0.10375193506479263,
-0.05671566724777222,
-0.6339629292488098,
0.33140379190444946,
0.5441409349441528,
-0.2740793824195862,
-0.04680009931325... | |
In this simplified example I have a generic class, and a method that returns a Map regardless of the type parameter. Why does the compiler wipe out the types on the map when I don't specify a type on the containing class?
```
import java.util.Map;
public class MyClass<T>
{
public Map<String, String> getMap()
... | [
0.13252544403076172,
-0.031139079481363297,
-0.09059862792491913,
-0.13965870440006256,
-0.11362261325120926,
-0.1598258912563324,
0.5111820697784424,
-0.270228773355484,
0.12934009730815887,
-0.8328713178634644,
-0.21035555005073547,
0.44639071822166443,
-0.41019415855407715,
0.2577847242... | |
String s = success.getMap().get("");
MyClass unchecked = new MyClass();
Map<String, String> map = unchecked.getMap(); // Unchecked warning, why?
String s2 = map.get("");
MyClass fail = new MyClass();
String s3 = fail.getMap().get(""); // Compiler error, why?
}
}
```
I g... | [
-0.1760801374912262,
-0.04778898134827614,
0.2943456470966339,
-0.3592863976955414,
0.11480686068534851,
-0.08111602813005447,
0.8402905464172363,
-0.5197985768318176,
-0.309908926486969,
-0.5688498616218567,
-0.5951167345046997,
0.6715915203094482,
-0.49849775433540344,
0.0048243012279272... | |
String s3 = fail.getMap().get(""); // Compiler error
```
Got it. This actually *isn't* a bug, strange as it might seem.
From [section 4.8 (raw types) of the JLS](http://java.sun.com/docs/books/jls/third_edition/html/typesValues.html#110257):
> The type of a constructor (§8.8),
> instance method (§8.8, §9.4), or
> ... | [
-0.17220507562160492,
0.01178385503590107,
0.08648116886615753,
-0.26198050379753113,
-0.18456639349460602,
-0.14946697652339935,
0.673869252204895,
-0.4303903877735138,
-0.24432915449142456,
-0.4769814610481262,
-0.6040553450584412,
0.14359445869922638,
-0.5124026536941528,
0.015623881481... | |
the
> generic declaration corresponding to
> C.
So even though the method's type signature doesn't use any type parameters of the class itself, type erasure kicks in and the signature becomes effectively
```
public Map getMap()
```
In other words, I think you can imagine a raw type as being the same API as the g... | [
0.006974001415073872,
-0.2324785739183426,
0.29396411776542664,
-0.06412025541067123,
-0.08448810130357742,
-0.38822656869888306,
0.5467726588249207,
-0.31769752502441406,
-0.09692305326461792,
-0.7269812822341919,
-0.28633546829223633,
0.4888352155685425,
-0.5369043350219727,
0.3242330849... | |
String>`. You can get the same effect by making an explicit conversion (which does nothing at execution time) in the last case:
```
// Compiles, but with an unchecked warning
String x = ((Map<String, String>)fail.getMap()).get("");
``` | [
0.2803771197795868,
-0.026496049016714096,
0.2899474799633026,
-0.06897714734077454,
0.29463276267051697,
-0.38592785596847534,
0.6678907871246338,
-0.339365154504776,
-0.11977778375148773,
-0.7987145185470581,
-0.5008742809295654,
0.835452675819397,
-0.5115404725074768,
-0.083904303610324... | |
I've developed an app which uses the Microsoft.DirectX.Direct3D namespace. The app runs on computers which have the Managed DirectX SDK installed, but not on those which have only the usual DirectX.
Specifically, it complains that it "Could not load file or assembly 'Microsoft.DirectX.Direct3D [...]".
What's the best... | [
0.35614776611328125,
0.24905064702033997,
0.6092706918716431,
-0.11232136934995651,
-0.17273034155368805,
0.020524436607956886,
0.22868198156356812,
-0.24896292388439178,
-0.09687875211238861,
-0.8292863368988037,
-0.2803507149219513,
0.34391242265701294,
-0.4803710877895355,
-0.0075680422... | |
or superinterfaces is the
> erasure of its type in the generic
> declaration corresponding to C. The
> type of a static member of a raw type
> C is the same as its type in the
> generic declaration corresponding to
> C.
So even though the method's type signature doesn't use any type parameters of the class itsel... | [
-0.02582734078168869,
-0.32231590151786804,
0.34893813729286194,
0.20660726726055145,
-0.19841650128364563,
-0.35396072268486023,
0.378015398979187,
-0.13165102899074554,
-0.24717220664024353,
-0.6199402213096619,
-0.39770686626434326,
0.34453076124191284,
-0.46354493498802185,
0.439874559... | |
the API, not the implementation).
EDIT: This code:
```
MyClass unchecked = new MyClass();
Map<String, String> map = unchecked.getMap(); // Unchecked warning, why?
String s2 = map.get("");
```
compiles because there's an implicit but unchecked conversion from the raw `Map` type to `Map<String, String>`. You can get... | [
0.1248452439904213,
-0.13408324122428894,
0.2116158902645111,
-0.21538592875003815,
0.11806704103946686,
-0.19485309720039368,
0.650067150592804,
-0.4193883240222931,
-0.17475391924381256,
-0.8872494101524353,
-0.4434244930744171,
0.7216475009918213,
-0.495617538690567,
0.011251175776124,
... | |
Any idea how to get the DatePicker to appear at the end of the associated text box instead of directly below it? What tends to happen is that the text box is towards the bottom of the page and the DatePicker shifts up to account for it and totally covers the text box. If the user wants to type the date instead of pick ... | [
0.20453235507011414,
-0.2149672657251358,
0.48871222138404846,
-0.05064288154244423,
0.2522055208683014,
0.024688052013516426,
-0.2562587559223175,
0.23156893253326416,
-0.4108245372772217,
-0.4312014579772949,
0.21381115913391113,
-0.03255162388086319,
-0.13439597189426422,
-0.08246426284... | |
I haven't had any luck tweaking the CSS settings, but I could easily be missing something.
The accepted answer for this question is actually not for the jQuery UI Datepicker. To change the position of the jQuery UI Datepicker just modify .ui-datepicker in the css file. The size of the Datepicker can also be changed in ... | [
0.2160831093788147,
-0.033736616373062134,
0.36273589730262756,
0.03635092079639435,
0.23001544177532196,
0.13635209202766418,
0.06087180972099304,
0.2727862596511841,
-0.259144127368927,
-0.5703704953193665,
0.1738787740468979,
0.40908506512641907,
-0.061271265149116516,
-0.06571125984191... | |
We have a cube that we are populating the data from the source tables. To get the data to reflect we are calling the "Analysis services processing task" component. While the cube is being refreshed we are getting the following error.
Description: OLE DB error: OLE DB or ODBC error: Communication link failure; 08S01. E... | [
0.11183679848909378,
0.11112174391746521,
0.604766309261322,
-0.07236704975366592,
-0.14557504653930664,
0.3143617510795593,
0.30646952986717224,
-0.275764137506485,
-0.2726243734359741,
-0.47226887941360474,
-0.0336364284157753,
0.5985520482063293,
-0.42210209369659424,
0.2950469553470611... | |
SQL server environment and this issue is not happening always.
I put together a fairly lengthy answer to a similar question: [ADO.NET Entity Framework: Decision Making between ORM solutions](https://stackoverflow.com/questions/349718/ado-net-entity-framework-decision-making-between-orm-solutions/349755#349755).
Howev... | [
-0.14422474801540375,
0.04348456487059593,
0.43962687253952026,
0.1519821584224701,
-0.23112687468528748,
-0.3265834450721741,
-0.11750493943691254,
0.09844686090946198,
-0.08181776851415634,
-0.5186459422111511,
0.29071667790412903,
0.5303841829299927,
-0.20902492105960846,
0.099876359105... | |
especially if it's able to consume the revamped SQL Data Services!
If anything, I'd brush up on eSql (Entity SQL) and get used to the syntax for using LINQ to write data queries. Something tells me this will be excellent experience to have handy for the next few years. | [
0.1411241888999939,
0.13665767014026642,
0.3915994465351105,
0.2899215817451477,
-0.030500013381242752,
-0.40757107734680176,
0.0560002438724041,
0.38225916028022766,
-0.1943930834531784,
-0.5342483520507812,
0.16857574880123138,
0.5793746709823608,
0.28562024235725403,
0.00275680352933704... | |
I can't seem to find the "Build" option under "Configuration Properties" folder in the Property Pages of my project. I've been looking everywhere trying to figure out how to do it.
I followed the direations here: <http://msdn.microsoft.com/en-us/magazine/cc302121.aspx>
More specifically here: <http://msdn.microsoft.... | [
0.30758997797966003,
0.40361273288726807,
-0.1244061291217804,
-0.08569994568824768,
-0.19281604886054993,
-0.1346978098154068,
0.1739068627357483,
-0.2624259889125824,
0.02777942270040512,
-0.684260368347168,
0.1310364454984665,
0.34029117226600647,
0.25348320603370667,
0.0251882467418909... | |
need to download any tools? I found GhostDoc but that's not helping me very much.
I'm not sure what you mean by the "Configuration Properties" folder. I don't have anything like that - if I just double click on "Properties" under the project (in Solution Explorer), it comes up with the properties page which has the fol... | [
0.4085536599159241,
-0.20474271476268768,
0.21188858151435852,
0.3628847002983093,
0.13601616024971008,
-0.107759490609169,
0.2592180669307709,
-0.08084974437952042,
-0.2502363324165344,
-0.9393523931503296,
0.07919929176568985,
0.6730788350105286,
0.08297731727361679,
-0.02527524717152118... | |
on "Properties" what do you get? | [
0.8510894775390625,
0.354300856590271,
0.1355089247226715,
0.23808741569519043,
0.07701418548822403,
-0.30568891763687134,
-0.25777897238731384,
-0.07584282010793686,
-0.19021974503993988,
-0.18284626305103302,
-0.038891538977622986,
0.610091507434845,
0.06495767831802368,
-0.0670178607106... | |
Does LINQ and Lambda expressions reduce cyclomatic-complexity? Just curious because CodeRush actually shows a reduction in cc when the VS analyzer increases it.
I suspect that the discrepancy may be due to deferred execution. When you use LINQ with lambda expressions, you're specifying code which will be run *if* you t... | [
0.3714955449104309,
0.13431832194328308,
0.16541336476802826,
0.3120098114013672,
-0.20016248524188995,
-0.0014090656768530607,
0.07079688459634781,
-0.20646436512470245,
-0.4386422336101532,
-0.39007896184921265,
0.16465246677398682,
0.8820870518684387,
-0.2987971007823944,
-0.25249347090... | |
I am working in Java and am wondering, are multi-dimensional arrays like grids where rows are elements and columns are dimensions, or are they hyper-geometric figures that we can't see?
A 1D array is like a list, a 2D array is like a table with columns and rows, a 3D array is like a cube, x, y and z and anything more t... | [
0.293561190366745,
0.027208225801587105,
-0.05070759356021881,
0.2510002553462982,
-0.5414367914199829,
0.1693398505449295,
0.02830064855515957,
-0.07884156703948975,
-0.32353371381759644,
-0.7474533319473267,
0.08855778723955154,
0.1721024513244629,
-0.33958783745765686,
0.213761746883392... | |
I've been using [this](https://stackoverflow.com/questions/92093/removing-leading-zeroes-from-a-field-in-a-sql-statement) for some time:
```
SUBSTRING(str_col, PATINDEX('%[^0]%', str_col), LEN(str_col))
```
However recently, I've found a problem with columns with all "0" characters like '00000000' because it never f... | [
-0.37983784079551697,
0.07892390340566635,
0.5290115475654602,
-0.36318135261535645,
-0.2726282477378845,
0.053926482796669006,
0.15006057918071747,
-0.20792187750339508,
-0.2766761779785156,
-0.2600803077220917,
0.008358713239431381,
0.44493237137794495,
-0.5089678168296814,
0.04446528106... | |
I'm trying to query a datatable to establish the primary key [identity column], by querying each columns autoincrement property. However its always false (for the column which is the Idenity/PK).
Querying the tables primary key collection reveals that the datatable doesn't think it has a PK.;
```
Dim dc As DataColu... | [
0.3385411202907562,
0.03121199645102024,
0.6593634486198425,
0.18626025319099426,
0.038527823984622955,
0.06768123805522919,
0.1675051599740982,
-0.3775254786014557,
-0.07306956499814987,
-0.5888645648956299,
-0.06059053912758827,
0.3094937801361084,
-0.35905495285987854,
0.424218952655792... | |
da.Fill(ds)
Return ds
Catch ex As Exception
MyAppClass.LogWarning(ex, EventLogEntryType.Error)
Throw
End Try
End Using
End Using
End Using
```
The table in question's primary key is : ([myTableId] [int] IDENTITY(1,1) NOT NULL).
and its the pk : CONSTRAINT [PK\_myTablesPK]... | [
-0.6722438335418701,
-0.2176171839237213,
0.5391241908073425,
0.13008280098438263,
-0.2610962390899658,
0.0279877670109272,
0.18418316543102264,
-0.41412562131881714,
-0.10317645221948624,
-0.4980044960975647,
-0.0930444747209549,
0.558381199836731,
-0.26558545231819153,
0.1106219142675399... | |
its something simple i'm missing, does anyone care to enlighten me?
Using fillschema fixes my issue;
```
da.FillSchema(ds, SchemaType.Mapped, table.tableName)
da.Fill(ds, table.tableName)
```
> The DataAdapter object is optimized
> for read-only scenarios by default.
> The Fill method only retrieves the
> amount ... | [
-0.07630877196788788,
-0.20662549138069153,
0.5670499801635742,
-0.00741538917645812,
-0.03651261702179909,
-0.025704452767968178,
0.23664116859436035,
-0.10653688758611679,
-0.3091118633747101,
-0.5210181474685669,
-0.22314050793647766,
0.609693169593811,
-0.19258026778697968,
-0.16273054... | |
the MissingSchemaAction property
> of the DataAdapter.
>
>
> This article describes how to choose
> between these two methods when you
> want to populate updateable DataSet
> objects with the DataAdapter.
[REF : http://support.microsoft.com/kb/310128](http://support.microsoft.com/kb/310128) | [
-0.18804486095905304,
-0.1821133941411972,
0.2184584140777588,
0.4115082323551178,
0.01700197160243988,
-0.07166984677314758,
0.24685236811637878,
-0.3423900604248047,
-0.4318012595176697,
-0.45365074276924133,
-0.3637716472148895,
0.4139053225517273,
-0.364876389503479,
0.1816160380840301... | |
I have to implement a SOAP web service that conforms to a (large) standard schema for the travel industry. Here's an example .XSD file:
<http://www.opentravel.org/2008B/OTA_HotelAvailRQ.xsd>
I think that rules out simply putting a [WebMethod] attribute to a method. How do you recommend implementing an existing schema... | [
0.1525571495294571,
0.23046079277992249,
0.7706220746040344,
0.05867955833673477,
0.18823020160198212,
-0.27369216084480286,
0.4174361526966095,
-0.39451029896736145,
0.08124063163995743,
-0.939241349697113,
-0.057498179376125336,
0.6106417775154114,
-0.26849082112312317,
0.103588365018367... | |
additional schema that are
> necessary to update or validate
> DataSet objects, use one of the
> following methods for DataSet objects
> that are populated by the
> DataAdapater:
>
>
> * Use the [FillSchema](http://msdn.microsoft.com/en-us/library/system.data.common.dbdataadapter.fillschema.aspx) method of the D... | [
-0.2811638414859772,
-0.05150217190384865,
0.3203154504299164,
0.35634881258010864,
-0.025543637573719025,
-0.004254624713212252,
0.14856833219528198,
-0.3252555727958679,
-0.31377628445625305,
-0.6735279560089111,
-0.37523069977760315,
0.364860475063324,
-0.25604361295700073,
0.1710956543... | |
I'm working on a Flex/Rails app. I've got a model with a `has_many :through` association that I'm trying to create. I've got it working with checkboxes on the plain rails pages, with the help of blogs like [Paul Barry's has-many-through-checkboxes](http://paulbarry.com/articles/2007/10/24/has_many-through-checkboxes "P... | [
0.15256322920322418,
-0.32397350668907166,
0.4133593738079071,
-0.367786169052124,
-0.20598217844963074,
-0.025110935792326927,
-0.04939395189285278,
-0.13950714468955994,
-0.4800623953342438,
-0.9797164797782898,
0.2815427780151367,
0.5671607255935669,
-0.25269970297813416,
-0.18873937427... | |
form_for PlayerAction.new do |f| %>
<%= f.hidden_field :player_id, {:value => @player.id} %>
<%= f.collection_select(:action_type_id, ActionType.find(:all), :id, :desc) %>
<ul>
<% @player.hand.deck_cards.each do |deck_card| -%>
<li><%= check_box_tag "player_action[deck_card_ids][]", deck_ca... | [
-0.23405389487743378,
-0.3547240197658539,
0.6329945921897888,
-0.22593118250370026,
0.05982131138443947,
-0.013373457826673985,
0.026098858565092087,
-0.8500843048095703,
-0.32245108485221863,
-0.6974509358406067,
-0.08991330116987228,
0.42047104239463806,
-0.3298546373844147,
-0.10725994... | |
"controller"=>"player_actions", "player_action"=>{"action_type_id"=>"1", "player_id"=>"9", "deck_card_ids"=>["87", "56"]}}
```
Using the TamperData plugin on Firefox, the parameters look like this:
```
player_action[player_id]=9
player_action[action_type_id]=1
player_action[deck_card_ids][]=87
player_action[deck_car... | [
-0.15160061419010162,
-0.34820377826690674,
0.7527998685836792,
0.10140900313854218,
0.06863755732774734,
0.03678582236170769,
0.03721014782786369,
-0.6244166493415833,
-0.6505811214447021,
-0.26853784918785095,
-0.0929761603474617,
0.4761682450771332,
-0.4054662883281708,
-0.0026449707802... | |
suggestions?
I had copied the usage of the params Object in Flex from another service call that does an update (which I modeled after examples in the Flex on Rails book). Taking a fresh look at this, I realized this was a create, looked at another working create service, and ended up creating an xml request instead.
... | [
0.30041033029556274,
-0.24380981922149658,
0.5402799844741821,
0.03327373042702675,
-0.2016908973455429,
0.10364937037229538,
-0.3484199345111847,
-0.529829740524292,
-0.34371417760849,
-0.655244767665863,
0.1976151466369629,
0.20197021961212158,
-0.14863957464694977,
-0.1540663242340088,
... | |
nested within a parent of `<deck_card_ids>`, but that didn't work. I actually use bound variables and curly brackets in there to use the values I want, but the above is the resulting xml. | [
0.33760085701942444,
0.1899053454399109,
0.19240278005599976,
0.20175468921661377,
-0.25070470571517944,
-0.29564908146858215,
-0.2419862300157547,
-0.24807721376419067,
0.09738627821207047,
-0.2549913823604584,
0.423010915517807,
0.2683317959308624,
-0.1548120379447937,
0.0358341932296752... | |
The code below enables a control (a label for instance) to show drag images while the dragging operation.
My problem is that I do **not** want to show the drag image instanly when the dragging begins, I want the image to be displayed **when** the mouse is on specific boundaries of the control - eg. in the right half ... | [
0.06059254705905914,
-0.032094575464725494,
0.5032742023468018,
0.04085211455821991,
-0.26770833134651184,
-0.20647692680358887,
0.008370610885322094,
-0.039337459951639175,
-0.3629901707172394,
-0.5764444470405579,
0.043593041598796844,
0.7025614976882935,
-0.31767791509628296,
0.25172400... | |
before abondoning VCL drag&drop utilities and roll a custom one capturing the mouse.
Here's an example pseudocode to enable drag images for a label..
```
{ turn on dragging }
Label1.DragMode := dmManual;
Label1.ControlStyle := Label1.ControlStyle + [csDisplayDragImage];
type
// VCL needs this for getting drag im... | [
-0.2161974161863327,
-0.4884933829307556,
0.6803901195526123,
-0.2531259059906006,
-0.15585371851921082,
0.181798055768013,
0.05217276141047478,
-0.5140401124954224,
-0.2629782259464264,
-0.48762378096580505,
-0.1214284896850586,
0.7827651500701904,
-0.3895477056503296,
0.2623823583126068,... | |
TForm1.Label1StartDrag(Sender: TObject; var DragObject: TDragObject);
var b : TBitmap;
begin
ImageList1.Clear;
DragObject := TMyDragObject.Create(self);
b := TBitmap.Create;
try
b.Width := ImageList1.Width;
b.Height := ImageList1.Height;
b.LoadFromFile('/path/to/image');
ImageList1.Add(b, nil);... | [
0.34177663922309875,
-0.40018120408058167,
0.9187742471694946,
-0.42864587903022766,
-0.26393717527389526,
0.11193656176328659,
0.24001885950565338,
-0.48120737075805664,
0.007668596692383289,
-0.5034754276275635,
-0.19138559699058533,
0.9340219497680664,
-0.28160378336906433,
0.0506489798... | |
bit over the top for the default VCL drag&drop utilities.
Anyway, to get the desired effect - that is to have more control over dragging operation, here's a way that involves capturing the mouse and processing the messages manually:
```
SetCapture(Handle);
try
while GetCapture = Handle do
{ Process m... | [
0.06256885081529617,
-0.587124228477478,
0.6797267198562622,
0.09309666603803635,
0.0464419461786747,
-0.058316659182310104,
-0.0839599147439003,
-0.2605510950088501,
-0.21001484990119934,
-0.43418747186660767,
-0.16793809831142426,
0.9551107287406921,
-0.31770870089530945,
0.1622276306152... | |
ReleaseCapture;
end;
``` | [
-0.2099570333957672,
-0.012465961277484894,
0.24625562131404877,
-0.29066383838653564,
0.00401388481259346,
0.12625041604042053,
-0.00953951757401228,
0.15011435747146606,
0.06551459431648254,
-0.3388499617576599,
-0.6545562148094177,
0.6559970378875732,
-0.4024014174938202,
0.359032273292... | |
I wrote a Matlab class to implement a database using JDBC and stuff from java.sql.
I need to know how many results were in a ResultSet, so I wrote the following Matlab static function:
```
methods (Static)
function [numRecords] = numRecords(resultSet)
numRecords = 0;
if (~isempty(resultSet))
... | [
-0.3099014163017273,
-0.2330993413925171,
0.47816431522369385,
-0.11032029986381531,
-0.14789964258670807,
-0.02184816263616085,
0.1529456377029419,
-0.33764228224754333,
-0.06945384293794632,
-0.3943425714969635,
-0.08033860474824905,
0.442490816116333,
-0.18689435720443726,
0.24390439689... | |
numRecords = resultSet.getRow();
resultSet.absolute(row);
end
end
end
```
But when I try to call it, I get the following error message:
??? Undefined function or method 'numRecords' for input arguments of type 'org.apache.derby.impl.jdbc.EmbedResultSet40'
There are no other functions called... | [
-0.11964841932058334,
-0.09420578926801682,
0.1404280960559845,
-0.16003595292568207,
-0.2617286741733551,
0.04666435346007347,
0.13055965304374695,
-0.021914459764957428,
-0.12922543287277222,
-0.22665296494960785,
-0.09611073136329651,
0.6601566076278687,
-0.22642774879932404,
0.39177650... | |
replaced the line:
```
trials = zeros(numRecords(rs));
```
with
```
trials = zeros(CMAPSigSimResultsDB.numRecords(rs));
```
and it worked. (Well it didn't, but it called the function at least.)
It's a confusing error message, because Matlab isn't supposed to be typed, but it makes it sound like it is... | [
-0.025774778798222542,
0.19903592765331268,
0.30512407422065735,
-0.024453995749354362,
-0.20227409899234772,
-0.13313649594783783,
0.5400739312171936,
-0.14800509810447693,
-0.30117082595825195,
-0.26296937465667725,
-0.05486420914530754,
0.28945478796958923,
-0.2705044746398926,
-0.00224... | |
Please consider the following snippet:
```
public interface MyInterface {
public int getId();
}
public class MyPojo implements MyInterface {
private int id;
public MyPojo(int id) {
this.id = id;
}
public int getId() {
return id;
}
}
public ArrayList<MyInterface> getMyInte... | [
-0.13055220246315002,
0.11440996080636978,
0.5032133460044861,
-0.2670251429080963,
0.1809636950492859,
0.39000165462493896,
0.3540984094142914,
-0.39312106370925903,
-0.027381693944334984,
-0.5235981345176697,
-0.2402762919664383,
0.38738924264907837,
-0.4696195423603058,
-0.2998258173465... | |
compile. How can I convert the myPojos list to the more generic list, **without having to go through each item of the list**?
Thanks
Change your method to use a wildcard:
```
public ArrayList<? extends MyInterface> getMyInterfaces() {
ArrayList<MyPojo> myPojos = new ArrayList<MyPojo>(0);
myPojos.add(new M... | [
0.13187777996063232,
0.053747013211250305,
0.48715940117836,
-0.059182215481996536,
0.19671595096588135,
0.12811484932899475,
0.522484302520752,
-0.3986092507839203,
-0.22125637531280518,
-0.7201710939407349,
0.030554117634892464,
0.5232363343238831,
-0.7166938781738281,
-0.231852874159812... | |
ArrayList<MyInterface>(0);
myPojos.add(new MyPojo(0));
myPojos.add(new MyPojo(1));
return myPojos;
}
```
As discussed in the comments:
* Returning wildcarded collections can be awkward for callers
* It's usually better to use interfaces instead of concrete types for return types. So the suggested signat... | [
-0.03183983266353607,
-0.12312423437833786,
0.5048690438270569,
0.03922838345170021,
0.025460997596383095,
0.10167177021503448,
0.3660862445831299,
-0.36380425095558167,
-0.35159188508987427,
-0.5266132354736328,
-0.25814124941825867,
0.4574519395828247,
-0.4337575137615204,
-0.07911764085... | |
I've got a simple routine that populates a record in a table. I have fields that I only want to update if an actual change has taken place. The function could get called even if the user did not change anything. Is there an easy way to tell if changes have taken place? Here's the function:
```
Sub Edit(ByVal key as In... | [
0.21890248358249664,
0.050577327609062195,
0.7456396818161011,
-0.23019099235534668,
-0.019407114014029503,
0.0911683663725853,
0.11163609474897385,
-0.35056886076927185,
-0.32211992144584656,
-0.513983428478241,
-0.04090249538421631,
0.6201686263084412,
-0.2780737280845642,
0.341074347496... | |
= myval2
If [???] Then
form.mod_date = Now
End If
db.SubmitChanges()
End Function
```
This is a little simplified - I'd rather not check each relationship between field1 and myval1, field2 and myval2, etc., because there could be many fields, and you have to take Nothing into account for each o... | [
0.43856891989707947,
0.04572639986872673,
0.5697410106658936,
-0.3512463867664337,
-0.06017233058810234,
-0.3809519410133362,
0.38249313831329346,
-0.42605453729629517,
-0.11955074220895767,
-0.6149221658706665,
-0.08815275877714157,
0.4952089190483093,
-0.07579902559518814,
0.395042598247... | |
to me before I commit the change?
You can take care of that kind of thing on the DataContext itself.
For example, you can use the UpdateXXX methods to catch changes to objects and record your date.
So to relate to your example (assuming you have a class named MyTable), on your DataContext:
```
Private Sub UpdateMyTa... | [
0.3466627299785614,
-0.15253853797912598,
0.6721800565719604,
-0.08254341781139374,
0.18021251261234283,
-0.09319887310266495,
0.12022608518600464,
0.18433690071105957,
-0.37378790974617004,
-0.6519882678985596,
-0.1382308453321457,
0.40477433800697327,
-0.13448935747146606,
0.428990453481... | |
We've got an application where users can enter "notes" into a rich edit control (Telerik's RedEditor, but that doesn't matter here). We had a user enter notes from w/in Safari that had a `<span></span>` in the middle of the note, and that span had a style on it specifying `white-space:pre` The HTML of the note was in t... | [
0.19286882877349854,
0.1573716700077057,
0.5754443407058716,
-0.008994131349027157,
-0.12266416847705841,
0.3453829288482666,
-0.15769268572330475,
-0.24390453100204468,
-0.4116589426994324,
-0.7075961828231812,
0.07476851344108582,
0.05971524864435196,
-0.06852182000875473,
-0.36582925915... | |
spaces in the resulting output.
Here's the problem. IE seems to apply that `white-space: pre;` style not only to the span, but to the enclosing div! Therefore, this long line that should have wrapped since it's not in the span, now pushed the document out until the line fits on the page.
What am I missing. I know IE ... | [
0.05823324993252754,
0.1050337702035904,
0.235438272356987,
-0.08546311408281326,
-0.12373412400484085,
-0.11160797625780106,
0.01921808533370495,
-0.049881819635629654,
-0.237923264503479,
-0.4560909569263458,
-0.27524533867836,
0.45358002185821533,
-0.26956993341445923,
0.151631966233253... | |
And it's entered from a mac w/Safari and being viewed in IE.
Edit: The doctype on the page in question is:
`<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">`
You can take care of that kind of thing on the DataContext itself.
For example, you ca... | [
0.07161607593297958,
0.08996984362602234,
0.7687719464302063,
-0.10294336080551147,
0.11166192591190338,
-0.24918532371520996,
0.01498098112642765,
0.08299727737903595,
-0.3352615237236023,
-0.8122622966766357,
-0.49320903420448303,
0.2448345124721527,
-0.13128986954689026,
0.1217712834477... | |
place and only call that method for actual updates (but I could be wrong on this one, I'll check). | [
0.4055621027946472,
0.04713549092411995,
0.3740959167480469,
0.039854951202869415,
0.29909783601760864,
-0.3917653560638428,
0.4786269962787628,
0.0841834545135498,
-0.20570574700832367,
-0.198796808719635,
-0.12114889919757843,
0.6055921912193298,
0.18948552012443542,
-0.1369059681892395,... | |
I am having problems using the Visual Studio 2008 Javascript debugger. I can’t set the breakpoint on the first line of an anonymous function. Given that most Javascript is written using namespaces these days, this means that you can’t set the breakpoint on the first line of most Javascript function.
Looking on google ... | [
0.3045613467693329,
0.4434623420238495,
0.2820363938808441,
-0.2545408308506012,
-0.3936443626880646,
-0.28906679153442383,
0.2984026074409485,
0.11612685024738312,
-0.2260219305753708,
-0.4711554944515228,
0.058022234588861465,
0.6256941556930542,
-0.08294409513473511,
0.123212069272995,
... | |
debuger for the Javascript, so am forced to use Visual Studio 2008 Javascript’s debugger. I think the application will also work with IE7, but our IT department will not let us install IE7 without a very good reason, as most of our customers are still on IE6 – hence I am starting to wish I was a java developer rather t... | [
0.00007253664807649329,
0.24657851457595825,
0.18744482100009918,
-0.15642976760864258,
-0.360389769077301,
-0.09781331568956375,
0.5014740824699402,
-0.21565669775009155,
-0.005310110282152891,
-0.3926135301589966,
-0.18722854554653168,
0.6503346562385559,
-0.47729772329330444,
0.21362923... | |
### Duplicate
> [Best ASP.net WYSIWYG](https://stackoverflow.com/questions/308685/best-asp-net-wysiwyg)
>
> [What's the best WYSIWYG editor when using the ASP.NET MVC Framework?](https://stackoverflow.com/questions/590960/whats-the-best-wysiwyg-editor-when-using-the-asp-net-mvc-framework)
>
> [How to make a WYSI... | [
-0.2060929238796234,
0.05073891207575798,
0.4899865388870239,
0.21486596763134003,
-0.1361159384250641,
-0.10793313384056091,
0.17141684889793396,
-0.39153796434402466,
-0.09865746647119522,
-0.48222455382347107,
-0.17246830463409424,
0.4276665151119232,
-0.19090639054775238,
-0.1982199102... | |
When using Rhino Commons UnitOfWork (in a UnitOfWorkApplication for ASP-MVC), I like to use the Rhino Repository static class to save entities like this:
```
Repository<Car>.Save(new Car(Id = 1));
```
I find that I can then get the entity out immediately after that call using:
```
Car car = Repository<Car>.Get(1);
... | [
-0.00472469674423337,
0.13686750829219818,
0.33117762207984924,
0.08950594067573547,
-0.09060413390398026,
0.18101143836975098,
-0.014070425182580948,
-0.4016341269016266,
-0.5170093178749084,
-0.410480797290802,
0.05475326254963875,
0.7617924213409424,
-0.08630401641130447,
0.369386196136... | |
this. I don't understand why, given that behind the scenes I assume that both retrieval methods are querying the same session / unit of work. Does this mean that you should call UnitOfWork.Current.Flush() after every save to the database? Shouldn't NHibernate be able to work out when to flush itself? Or am I misunderst... | [
0.2483985424041748,
0.08231742680072784,
0.34788697957992554,
0.34356433153152466,
0.13795816898345947,
-0.013781713321805,
-0.1006055697798729,
-0.137167826294899,
-0.2019181102514267,
-0.6325367093086243,
0.1848096400499344,
0.7339147925376892,
-0.06793534755706787,
0.41150638461112976,
... | |
= (from rep in UnitOfWork.CurrentSession.Linq<Car>()
select rep).ToList(); // Does not work, even if it is in the same code block and even though it uses the same session
```
So best practice is any database changes (save, update, delete, insert) should be followed by:
```
UnitOfWork.Session.Flush(), ... | [
0.09889692813158035,
-0.21883854269981384,
0.4599716067314148,
0.05157952383160591,
0.40435791015625,
0.3874315023422241,
0.16559036076068878,
-0.5070573687553406,
-0.5570787191390991,
-0.7121837735176086,
-0.07178445905447006,
0.6714722514152527,
-0.32853469252586365,
-0.05318357795476913... | |
There is a [Checkstyle](http://checkstyle.sourceforge.net/) rule [DesignForExtension](http://checkstyle.sourceforge.net/config_design.html#DesignForExtension). It says: if you have a public/protected method which is not abstract nor final nor empty it is not "designed for extension". Read the [description for this rule... | [
0.2908514440059662,
-0.09907736629247665,
0.36831119656562805,
-0.054610271006822586,
0.3230034112930298,
-0.09211309254169464,
0.013932927511632442,
-0.2612491250038147,
-0.08111043274402618,
-0.2624872922897339,
-0.18871112167835236,
0.39068424701690674,
-0.359702467918396,
0.25191274285... | |
throw new IllegalArgumentException("No roots!");
if (trunk == null) throw new IllegalArgumentException("No trunk!");
}
public abstract void grow();
}
```
I have also a subclass of Plant:
```
public class Tree extends Plant {
private List<String> leaves;
// setters go here
@Overrides
... | [
0.1375831961631775,
-0.1441761702299118,
0.32364800572395325,
-0.19325222074985504,
0.37861770391464233,
0.0939386636018753,
0.5087686777114868,
-0.376413494348526,
-0.5954142212867737,
-0.03124069981276989,
-0.370937317609787,
0.5819376111030579,
-0.48757404088974,
0.1942177712917328,
0... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.