text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
break;
}
else
{
index -= q.Count;
}
}
}
}
```
This should be fairly uniform over the | [
-0.047742221504449844,
-0.046873223036527634,
0.13347235321998596,
-0.22691050171852112,
0.11857926100492477,
-0.3403034508228302,
0.11206301301717758,
-0.28189319372177124,
-0.18026761710643768,
-0.22275114059448242,
-0.40104037523269653,
0.4579404592514038,
-0.33448028564453125,
0.023025... | |
entire set. The trick here is that by treating the queues as a single large queue, the tendency is that the queue's with lots of items will get dequeued more quickly (since there is more chance of getting an index in their range). This means that it should automatically balance consumption between the queues so that th... | [
0.018483955413103104,
-0.34842318296432495,
0.35674428939819336,
0.0036272627767175436,
0.1834331601858139,
0.002755888504907489,
0.001071391860023141,
-0.04618566855788231,
-0.6215168833732605,
-0.5140016674995422,
-0.3651355803012848,
0.2301754653453827,
-0.5404971837997437,
0.2433132678... | |
Build(1,2,3,4,5), Build(6,7,8), Build(9,10,11,12,13)
};
foreach (int i in GetItems(queues))
{
Console.WriteLine(i);
}
}
static Queue<T> Build<T>(params T[] items)
{
Queue<T> queue = new Queue<T>();
foreach (T item in items)
{
queue.Enqueue(item);
}
return queue;
}
``... | [
-0.14994269609451294,
-0.16450195014476776,
0.6803485155105591,
-0.19133293628692627,
0.23581713438034058,
0.7027842402458191,
0.29009705781936646,
-0.27413278818130493,
-0.3948572874069214,
-0.5732455849647522,
-0.41676637530326843,
0.1855662316083908,
-0.1935122162103653,
0.5208557844161... | |
What would be a nice algorithm to remove dupes on an array like below...
```
var allwords = [
['3-hidroxitiramina', '3-hidroxitiramina'],
['3-hidroxitiramina', '3-hidroxitiramina'],
['3-in-1 block', 'bloqueo 3 en 1'],
['abacterial', 'abacteriano'],
['abacteriano', 'abacteriano'],
['ab... | [
0.06457468122243881,
-0.18833811581134796,
0.3568115830421448,
-0.08645911514759064,
0.13228309154510498,
0.3447536826133728,
-0.029290320351719856,
-0.3002140522003174,
-0.32319095730781555,
-0.606643557548523,
0.019119931384921074,
0.359866738319397,
-0.7285963892936707,
-0.0932986885309... | |
probably reduce the randomness.
How are you doing it? Personally I'd do something like:
```
static IEnumerable<T> GetItems<T>(IEnumerable<Queue<T>> queues)
{
int remaining = queues.Sum(q => q.Count);
Random rand = new Random();
while (remaining > 0)
{
int index = rand.Next(remaining);
... | [
-0.01918579451739788,
-0.4865376055240631,
0.31550371646881104,
0.1349157840013504,
0.14744189381599426,
-0.004687906708568335,
-0.08444803953170776,
-0.22008320689201355,
-0.45670321583747864,
-1.0595933198928833,
0.23898133635520935,
0.4558930993080139,
0.007983033545315266,
0.1260906755... | |
{
yield return q.Dequeue();
remaining--;
break;
}
else
{ | [
-0.24395164847373962,
-0.22828303277492523,
-0.008598650805652142,
-0.295551061630249,
0.3464375436306,
0.11279336363077164,
0.4944668114185333,
-0.4373428523540497,
0.2750859260559082,
0.012045756913721561,
-0.5057823657989502,
0.7819826006889343,
0.07284984737634659,
0.15879212319850922,... | |
index -= q.Count;
}
}
}
}
```
This should be fairly uniform over the entire set. The trick here is that by treating the queues as a single large queue, the tendency is that the queue's with lots of items will get dequeued more quickly (since there is more chance of getting an index in their ra... | [
-0.042234569787979126,
-0.20211294293403625,
0.22439800202846527,
0.09286344051361084,
-0.03742712363600731,
0.10454332083463669,
-0.11527005583047867,
-0.14416712522506714,
-0.4131964445114136,
-0.6746009588241577,
-0.09601635485887527,
0.20482812821865082,
-0.38319793343544006,
0.3981703... | |
time. If you don't have LINQ, just change the first line:
```
int remaining = 0;
foreach(Queue<T> q in queues) {remaining += q.Count;}
```
Example usage:
```
static void Main()
{
List<Queue<int>> queues = new List<Queue<int>> {
Build(1,2,3,4,5), Build(6,7,8), Build(9,10,11,12,13)
};
foreach (int... | [
0.07500174641609192,
-0.3641067147254944,
0.5944709181785583,
-0.19093340635299683,
0.37450623512268066,
0.527838945388794,
0.2370612621307373,
-0.27133333683013916,
-0.45376554131507874,
-0.8203644752502441,
-0.39158937335014343,
0.2197272628545761,
-0.366301566362381,
0.39223796129226685... | |
queue.Enqueue(item);
}
return queue;
}
``` | [
-0.16601450741291046,
-0.057593345642089844,
0.34078291058540344,
-0.0005018546362407506,
0.11067131161689758,
0.3969862461090088,
0.007654938846826553,
0.20318667590618134,
-0.47210004925727844,
-0.4963964521884918,
-0.297088623046875,
0.5966163873672485,
-0.5416185259819031,
0.6264302134... | |
is there any sort of XY-Layout to Java?
So I can set a Button at the X and Y cordinate and that it is suppose to be that big etc.... Because this border layout and grid and panel thing is driven me crazy. :)
They are flowing every were and getting strecht up. And to make them small you have to put panel in panel in... | [
0.1241273432970047,
-0.11513976007699966,
0.3399730920791626,
0.05941576510667801,
-0.20029735565185547,
0.049107037484645844,
0.08720565587282181,
-0.1764032244682312,
-0.20359432697296143,
-0.7927144169807434,
-0.03537246212363243,
0.30572208762168884,
-0.3585565984249115,
0.147253185510... | |
for example, don't get their preferred size you run into mayor problems when your application supports multiple languages), so **my advice for you is to rather write a specialized layout manager for your specific needs**.
Writing your custom layout manager is quite easy, all you have to do is to be able to calculate t... | [
0.2906210720539093,
-0.06600771844387054,
0.196271613240242,
0.15532758831977844,
-0.028905296698212624,
0.06370971351861954,
-0.18217509984970093,
-0.14914405345916748,
-0.483844131231308,
-0.9715027213096619,
0.2949222922325134,
0.5424857139587402,
-0.312710702419281,
-0.1171240508556366... | |
of a custom layout, that layouts pairs of key and value components:
```
public class KeyValueLayout implements LayoutManager {
public static enum KeyAlignment {
LEFT, RIGHT;
}
private KeyAlignment keyAlignment = KeyAlignment.LEFT;
private int hgap;
private int vgap;
public KeyValue... | [
-0.11139170825481415,
-0.0189496036618948,
0.12967798113822937,
-0.3375798463821411,
0.18869143724441528,
0.39272987842559814,
0.18965519964694977,
-0.2800244092941284,
-0.1476302295923233,
-0.998436689376831,
-0.42398640513420105,
0.772156834602356,
-0.47969722747802734,
0.095891453325748... | |
public KeyValueLayout (int hgap, int vgap) {
this(KeyAlignment.LEFT, hgap, vgap);
}
public KeyValueLayout (KeyAlignment keyAlignment, int hgap, int vgap) {
this.keyAlignment = keyAlignment != null ? keyAlignment : KeyAlignment.LEFT;
this.hgap = hgap;
this.vgap = vgap;
}
... | [
-0.11527768522500992,
-0.05347522348165512,
0.558585524559021,
-0.04043611139059067,
0.2649056315422058,
0.4125961363315582,
0.22065921127796173,
-0.2380092889070511,
0.08300741761922836,
-0.4959946870803833,
-0.5165521502494812,
0.9623261094093323,
-0.4165824353694916,
0.22119157016277313... | |
{
}
public void removeLayoutComponent (Component comp) {
}
public void layoutContainer (Container parent) {
Rectangle canvas = getLayoutCanvas(parent);
int ypos = canvas.y;
int preferredKeyWidth = getPreferredKeyWidth(parent);
for (Iterator<Component> iter = new Compon... | [
0.09765388816595078,
-0.5184922218322754,
0.9538081288337708,
-0.07083337754011154,
0.005480877123773098,
0.29801490902900696,
0.13937725126743317,
-0.43877655267715454,
-0.3909614682197571,
-0.42915260791778564,
-0.18145599961280823,
0.4827679395675659,
-0.07600031793117523,
0.56200671195... | |
Component value = iter.hasNext() ? (Component) iter.next() : null;
int xpos = canvas.x;
int preferredHeight = Math.max(key.getPreferredSize().height, value != null ? value.getPreferredSize().height : 0);
if (keyAlignment == KeyAlignment.LEFT)
key.setBounds(xpos, ypos... | [
0.03455083444714546,
-0.34666967391967773,
0.9317967295646667,
0.04349982738494873,
-0.19468218088150024,
0.29753854870796204,
0.485412061214447,
-0.7403172850608826,
-0.3151310086250305,
-0.22224199771881104,
-0.3097894787788391,
0.7425999641418457,
-0.02738053910434246,
-0.11419670283794... | |
key.setBounds(xpos + preferredKeyWidth - key.getPreferredSize().width, ypos, key.getPreferredSize().width,
key.getPreferredSize().height);
xpos += preferredKeyWidth + hgap;
if (value != null)
value.setBounds(xpos, ypos, canvas.x + canvas.width - xpos, preferr... | [
-0.113072469830513,
-0.3680560290813446,
0.8506661057472229,
-0.32703450322151184,
-0.27066439390182495,
0.17228010296821594,
0.12724867463111877,
-0.45670685172080994,
-0.16297221183776855,
-0.5379477143287659,
-0.4322030246257782,
0.460310161113739,
-0.14936667680740356,
-0.1098672226071... | |
ypos += preferredHeight + vgap;
}
}
public Dimension minimumLayoutSize (Container parent) {
int preferredKeyWidth = getPreferredKeyWidth(parent);
int minimumValueWidth = 0;
int minimumHeight = 0;
int lines = 0;
for (Iterator<Component> iter = new ComponentIterato... | [
-0.029298100620508194,
-0.48320555686950684,
0.9186053276062012,
-0.04922546446323395,
0.10226650536060333,
0.3161548376083374,
0.014977098442614079,
-0.3603121042251587,
-0.14620910584926605,
-0.4475037157535553,
-0.1659732609987259,
0.3109774589538574,
-0.02521185204386711,
0.41504007577... | |
Component key = (Component) iter.next();
Component value = iter.hasNext() ? (Component) iter.next() : null;
minimumHeight += Math.max(key.getPreferredSize().height, value != null ? value.getMinimumSize().height : 0);
minimumValueWidth = Math.max(minimumValueWidth, value != null ? val... | [
-0.20481286942958832,
-0.6287550926208496,
0.7372985482215881,
0.12333013117313385,
-0.023199092596769333,
0.2708965539932251,
0.6340053081512451,
-0.40591850876808167,
-0.41073331236839294,
-0.4315791130065918,
-0.3234867453575134,
0.6994295716285706,
0.0030912470538169146,
0.254210710525... | |
int minimumWidth = insets.left + preferredKeyWidth + hgap + minimumValueWidth + insets.right;
minimumHeight += insets.top + insets.bottom;
if (lines > 0)
minimumHeight += (lines - 1) * vgap;
return new Dimension(minimumWidth, minimumHeight);
}
public Dimension preferredLayo... | [
-0.27774274349212646,
-0.5649643540382385,
0.9390342831611633,
-0.04894089698791504,
0.09494775533676147,
0.12771885097026825,
-0.008120727725327015,
-0.16535621881484985,
-0.15381066501140594,
-0.5977587699890137,
-0.07846968621015549,
0.4721772372722626,
0.14465433359146118,
0.4130515456... | |
0;
int preferredHeight = 0;
int lines = 0;
for (Iterator<Component> iter = new ComponentIterator(parent); iter.hasNext();) {
lines++;
Component key = (Component) iter.next();
Component value = iter.hasNext() ? (Component) iter.next() : null;
prefe... | [
-0.14559446275234222,
-0.6756856441497803,
0.9517947435379028,
-0.09618726372718811,
-0.20296400785446167,
0.32197192311286926,
0.38079002499580383,
-0.5696224570274353,
-0.08457545191049576,
-0.2685827612876892,
-0.1393827646970749,
0.35099324584007263,
0.006025280337780714,
0.22800591588... | |
value != null ? value.getPreferredSize().height : 0);
preferredValueWidth = Math.max(preferredValueWidth, value != null ? value.getPreferredSize().width : 0);
}
Insets insets = parent.getInsets();
int preferredWidth = insets.left + preferredKeyWidth + hgap + preferredValueWidth + in... | [
-0.32817715406417847,
-0.453803688287735,
0.8117194771766663,
0.03519577533006668,
0.03632776066660881,
0.11377318948507309,
0.4310795068740845,
-0.23443791270256042,
-0.17335374653339386,
-0.48950517177581787,
-0.3280137777328491,
0.2628283202648163,
-0.09787928313016891,
0.01696578226983... | |
preferredHeight += (lines - 1) * vgap;
return new Dimension(preferredWidth, preferredHeight);
}
public Dimension maximumLayoutSize (Container target) {
return preferredLayoutSize(target);
}
private int getPreferredKeyWidth (Container parent) {
int preferredWidth = 0;
f... | [
-0.09191498160362244,
-0.6736199259757996,
1.129274845123291,
-0.07850701361894608,
-0.17999733984470367,
0.2561143934726715,
-0.07657940685749054,
-0.4322446286678314,
-0.13450182974338531,
-0.4137735366821289,
0.06723254919052124,
0.3313369154930115,
0.10931556671857834,
0.41466769576072... | |
if (iter.hasNext())
iter.next();
preferredWidth = Math.max(preferredWidth, key.getPreferredSize().width);
}
return preferredWidth;
}
private Rectangle getLayoutCanvas (Container parent) {
Insets insets = parent.getInsets();
int x = insets.left;
... | [
-0.25467756390571594,
-0.5886151790618896,
0.8316078782081604,
-0.05277613177895546,
0.08810260891914368,
0.21206720173358917,
-0.12821908295154572,
-0.30649101734161377,
-0.36634010076522827,
-0.6227559447288513,
-0.2675498425960541,
0.24111931025981903,
0.04662807285785675,
0.33005917072... | |
= insets.top;
int width = parent.getSize().width - insets.left - insets.right;
int height = parent.getSize().height - insets.top - insets.bottom;
return new Rectangle(x, y, width, height);
}
private class ComponentIterator implements Iterator<Component> {
private Container co... | [
-0.027249140664935112,
-0.5541378855705261,
0.7378461360931396,
0.0811997726559639,
0.04712633788585663,
0.4148372709751129,
-0.12850014865398407,
-0.4467751085758209,
-0.20488916337490082,
-0.07019318640232086,
-0.29499781131744385,
0.4767232835292816,
-0.2772093117237091,
0.5631830692291... | |
this.container = container;
}
public boolean hasNext () {
return index < container.getComponentCount();
}
public Component next () {
return container.getComponent(index++);
}
public void remove () { | [
0.05641435459256172,
-0.5428379774093628,
0.6397905349731445,
-0.2672516107559204,
0.17736315727233887,
0.006342499051243067,
-0.11688050627708435,
-0.15740716457366943,
-0.5215138792991638,
-0.4636084735393524,
-0.4517260789871216,
0.2601716220378876,
-0.2515357434749603,
0.45308536291122... | |
}
}
}
```
Just set the layout and add alternatingly labels and value components. It's easy to use, especially compared to GridBagLayout or nested panels with custom layouts. | [
0.3975665271282196,
-0.029773131012916565,
0.17521986365318298,
-0.00020783573563676327,
0.08875206112861633,
-0.10613168030977249,
-0.40273794531822205,
0.04994936287403107,
-0.0794065073132515,
-0.8896475434303284,
0.25311732292175293,
0.6270024180412292,
-0.394634872674942,
-0.087504938... | |
Is there any elegant way of applying a certain style to all `<input type="text">` elements under IE6? I can do it with some JavaScript, but I was wondering if there was a more elegant way of doing it.
Note - I cannot apply a certain class to all textboxes by hand. And I'd like to [avoid CSS expressions](https://stacko... | [
0.08184672892093658,
0.21258960664272308,
0.22095300257205963,
-0.09408272802829742,
-0.1899612843990326,
-0.251528799533844,
0.28672343492507935,
-0.32103297114372253,
-0.17261071503162384,
-0.5187861323356628,
-0.11117005348205566,
0.6203789710998535,
-0.2037026733160019,
-0.244744434952... | |
bad. | [
0.2168804258108139,
0.36180904507637024,
-0.0779612734913826,
0.013079514726996422,
-0.00020453317847568542,
-0.18240070343017578,
0.32517534494400024,
0.2645343840122223,
-0.1005609780550003,
-0.3828897178173065,
-0.0009016033727675676,
0.41954538226127625,
-0.25451403856277466,
0.2972126... | |
I'm having headache with Time values and multiple time zones.
I'm storing new DateTime values in UTC time, but I face problem when I try to modify them using LinqDataSource and GridView.
I can easily show correct time in
```
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# TimeManager.ToLocalTime((D... | [
0.07487647235393524,
0.10309053957462311,
0.6351950764656067,
-0.06717430800199509,
-0.20742495357990265,
-0.11018701642751694,
0.48439905047416687,
-0.5557723045349121,
-0.09337443858385086,
-0.9416645169258118,
0.08013196289539337,
0.5262162685394287,
-0.12114865332841873,
0.394841521978... | |
record time value would be smaller for one hour.
Comparing old and new values also is not great because user can modify date portion of datetime and not time, which is influenced by time zones?
If I had way to show local time in gridview's all states then I could easily use OnUpdating of LinqDataSource.
Please share... | [
0.32757440209388733,
0.07000754773616791,
0.3815121054649353,
0.13993559777736664,
0.21456806361675262,
-0.3552704155445099,
-0.011987569741904736,
0.23722824454307556,
-0.37145254015922546,
-0.5654194951057434,
0.05665973201394081,
0.558341920375824,
-0.11977705359458923,
0.32347786426544... | |
public DateTime LocalOrderDate
{
get { return TimeManager.ToLocalTime(OrderDate); }
set { OrderDate = TimeManager.ToUTCTime(value); }
}
}
```
Now instead of binding to OrderDate, bind to LocalOrderDate. This will automatically make the UTC / Local Time conversion to the OrderDate.
(Note: I'm ... | [
0.018812241032719612,
-0.3441682457923889,
0.5136154294013977,
-0.24297606945037842,
0.25238993763923645,
-0.16223081946372986,
0.24520516395568848,
-0.061404015868902206,
-0.2282421737909317,
-0.667971134185791,
-0.13905294239521027,
0.56299889087677,
-0.2215481996536255,
0.25186875462532... | |
I have created a 'control' using jQuery and used jQuery.extend to assist in making it as OO as possible.
During the initialisation of my control I wire up various click events like so
```
jQuery('#available input',
this.controlDiv).bind('click', this, this.availableCategoryClick);
```
Notice that I am ... | [
-0.27235865592956543,
-0.10039422661066055,
0.27012741565704346,
0.02029268443584442,
-0.07909747958183289,
0.08115339279174805,
-0.030438074842095375,
-0.06882883608341217,
0.2088456004858017,
-0.47653692960739136,
0.02365497499704361,
0.4368584156036377,
-0.3609006702899933,
0.0054834838... | |
past, I remember a bind syntax that allowed you to control what the value of 'this' was in the event.
What is the jQuery way?
You can use [`jQuery.proxy()`](http://api.jquery.com/jQuery.proxy/) with anonymous function, just a little awkward that 'context' is the second parameter.
```
$("#button").click($.proxy(funct... | [
0.07557915896177292,
-0.21085448563098907,
0.26927605271339417,
0.04546225443482399,
-0.11803460121154785,
-0.21896709501743317,
0.0234045572578907,
0.06020640581846237,
-0.3612076938152313,
-0.5147848129272461,
0.07828450947999954,
0.4603872299194336,
-0.23773697018623352,
0.0685761049389... | |
I want to get the distinct values in a list, but not by the standard equality comparison.
What I want to do is something like this:
```
return myList.Distinct( (x, y) => x.Url == y.Url );
```
I can't, there's no extension method in Linq that will do this - just one that takes an `IEqualityComparer`.
I can hack aro... | [
-0.1403917521238327,
0.08635561168193817,
0.2941190302371979,
-0.06783246994018555,
-0.1990196406841278,
-0.11465877294540405,
0.07107566297054291,
-0.2992962598800659,
-0.11459753662347794,
-0.4359181821346283,
-0.010522086173295975,
0.36934250593185425,
-0.12729522585868835,
0.2659267783... | |
this IEnumerable<T> input, Func<T,T,bool> compare )
{
//write my own here
}
```
But that does seem rather like writing something that should be there in the first place.
Anyone know why this method isn't there?
Am I missing something?
It's annoying, certainly. It's also part of my "MoreLINQ" project which I mus... | [
-0.05877283215522766,
-0.22429780662059784,
0.40401872992515564,
0.2111891359090805,
-0.18292854726314545,
-0.016902407631278038,
-0.0031255297362804413,
0.08802247047424316,
-0.18739211559295654,
-0.6380288004875183,
-0.06383873522281647,
0.4638673663139343,
-0.22879526019096375,
0.128813... | |
etc. Here's my implementation if you're interested:
```
public static IEnumerable<TSource> DistinctBy<TSource, TKey>
(this IEnumerable<TSource> source,
Func<TSource, TKey> keySelector)
{
return source.DistinctBy(keySelector,
EqualityComparer<TKey>.Defau... | [
-0.4915454089641571,
0.04379485920071602,
0.2577257752418518,
-0.16303490102291107,
0.031545016914606094,
-0.005524782929569483,
-0.042656540870666504,
0.019840212538838387,
-0.104616679251194,
-0.7353653907775879,
-0.14799408614635468,
0.3246311843395233,
-0.2175009846687317,
0.2364643216... | |
(this IEnumerable<TSource> source,
Func<TSource, TKey> keySelector,
IEqualityComparer<TKey> comparer)
{
if (source == null)
{
throw new ArgumentNullException("source");
}
if (keySelector == null)
{ | [
-0.4915770888328552,
-0.19240614771842957,
0.4664052724838257,
-0.15164899826049805,
0.04971964657306671,
0.1558728665113449,
0.2790549099445343,
-0.33275076746940613,
0.1711122989654541,
-0.5920938849449158,
-0.22443202137947083,
0.7433326840400696,
-0.20558549463748932,
0.240390017628669... | |
throw new ArgumentNullException("keySelector");
}
if (comparer == null)
{
throw new ArgumentNullException("comparer");
}
return DistinctByImpl(source, keySelector, comparer);
}
private static IEnumerable<TSource> DistinctByImpl<TSource, TKey>
(IEnumer... | [
-0.747545599937439,
-0.15353268384933472,
0.381626695394516,
-0.15844228863716125,
-0.2303943634033203,
0.2547246217727661,
0.15158598124980927,
-0.23906460404396057,
-0.048232391476631165,
-0.48735731840133667,
-0.3199387490749359,
0.32916179299354553,
0.017156971618533134,
0.387646645307... | |
IEqualityComparer<TKey> comparer)
{
HashSet<TKey> knownKeys = new HashSet<TKey>(comparer);
foreach (TSource element in source)
{
if (knownKeys.Add(keySelector(element)))
{
yield return element;
} | [
-0.4788814187049866,
-0.19958166778087616,
0.4254871904850006,
-0.23153400421142578,
-0.028712257742881775,
-0.025345738977193832,
0.4156078100204468,
-0.49731823801994324,
0.35596007108688354,
-0.6060230731964111,
-0.1115521490573883,
0.7601235508918762,
-0.3326939046382904,
-0.1503012925... | |
}
}
``` | [
0.17493881285190582,
0.41805654764175415,
0.05209751054644585,
-0.04864929988980293,
0.437467485666275,
-0.15825650095939636,
0.13202530145645142,
0.5446501970291138,
0.35430577397346497,
-0.4846813380718231,
-0.2295716553926468,
0.546978771686554,
-0.3188462555408478,
0.2798506021499634,
... | |
I would like to create a lookup table in OCaml. The table will have 7000+ entries that, upon lookup (by int), return a string. What is an appropriate data structure to use for this task? Should the table be externalized from the base code and if so, how does one go about "including" the lookup table to be accessible fr... | [
0.107149139046669,
0.05395229905843735,
0.1133476123213768,
-0.13309279084205627,
-0.012462803162634373,
-0.11684107035398483,
-0.024087607860565186,
-0.1782388538122177,
-0.11780813336372375,
-0.7699666619300842,
-0.07253656536340714,
0.5737993717193604,
-0.5293685793876648,
-0.2419235706... | |
let compare = compare
end ;;
module IntMap = Map.Make(Int) ;;
```
If the table is too large to store in memory, you could store it in an external database and use bindings to [dbm](http://caml.inria.fr/pub/docs/manual-ocaml/libref/Dbm.html), bdb, [sqlite](http://www.ocaml.info/home/ocaml_sources.html#toc13),... | [
0.05097832530736923,
0.04913521558046341,
0.4821261465549469,
-0.2246919721364975,
0.021963991224765778,
0.02706105262041092,
0.0369422473013401,
-0.4666590392589569,
-0.04528212547302246,
-0.7295130491256714,
-0.25021952390670776,
0.4422946572303772,
-0.3273548185825348,
0.124611757695674... | |
I get a DataTable from a DataSet and then bind that DataTable to a DataGridView. Once the user edits the information on the DataGridView how do I take those changes and put them back into a DataTable that was used that I can then put back into my DataSet?
I want to make a Save Button on my DataGrid that when pressed a... | [
0.6381188631057739,
0.016907652840018272,
0.45447230339050293,
0.23428811132907867,
0.01624481752514839,
-0.16490592062473297,
0.03504825010895729,
-0.08324936777353287,
-0.2124169021844864,
-0.8179264664649963,
0.18849216401576996,
0.5672048926353455,
-0.09796468168497086,
0.1391204595565... | |
you are *already* updating the `DataTable` / `DataSet`. If you mean changes down to the database, then that is where adapters come into play.
Here's an example:
```
using System;
using System.Data;
using System.Linq;
using System.Windows.Forms;
static class Program
{
[STAThread]
static void Main()
{
... | [
0.2931823134422302,
-0.22054407000541687,
0.7146587371826172,
-0.2321455180644989,
0.4339544475078583,
0.10995781421661377,
0.10123643279075623,
-0.3404286801815033,
-0.37771791219711304,
-0.7512619495391846,
-0.5641226768493652,
0.7495004534721375,
-0.5451561212539673,
0.14799651503562927... | |
Button btn;
using (Form form = new Form
{
Text = "DataGridView binding sample",
Controls =
{
new DataGridView { | [
0.1092253252863884,
-0.543883204460144,
0.44155919551849365,
-0.1875554919242859,
0.18744075298309326,
0.049133896827697754,
0.214834064245224,
-0.33825039863586426,
-0.19095584750175476,
-0.6760328412055969,
-0.2951711416244507,
0.33201998472213745,
-0.47215428948402405,
0.138171896338462... | |
Dock = DockStyle.Fill,
DataMember = "MyTable",
DataSource = set
},
(btn = new Button { | [
0.15763427317142487,
-0.4002349376678467,
0.6681076288223267,
-0.2435482293367386,
0.47396811842918396,
0.41246333718299866,
0.041549935936927795,
-0.04682576656341553,
-0.7324148416519165,
-0.7496684193611145,
-0.06655272096395493,
0.5642087459564209,
-0.13032692670822144,
0.4398104548454... | |
Dock = DockStyle.Bottom,
Text = "Total"
})
}
})
{
btn.Click += delegate
{ | [
0.38882434368133545,
-0.31165313720703125,
0.4694766104221344,
-0.028892748057842255,
0.2844066917896271,
0.11476252228021622,
0.06438091397285461,
-0.29603469371795654,
-0.598568320274353,
-0.6199257969856262,
-0.07754464447498322,
0.5659044981002808,
-0.21347559988498688,
0.3348467946052... | |
form.Text = table.AsEnumerable().Sum(
row => row.Field<int>("Foo")).ToString();
};
Application.Run(form);
}
}
}
``` | [
-0.09995520114898682,
0.06880573183298111,
0.6780796051025391,
-0.4836188852787018,
0.046229489147663116,
-0.15213629603385925,
0.41593536734580994,
-0.41433048248291016,
-0.10623046010732651,
-0.3892984688282013,
-0.555146336555481,
0.633704662322998,
-0.6311890482902527,
0.18036624789237... | |
What are unit tests, integration tests, smoke tests, and regression tests? What are the differences between them and which tools can I use for each of them?
For example, I use [JUnit](https://en.wikipedia.org/wiki/JUnit) and [NUnit](https://en.wikipedia.org/wiki/NUnit) for *unit testing* and *integration testing*. Are... | [
0.6573994159698486,
0.17992180585861206,
-0.1610877811908722,
0.17859570682048798,
0.067198246717453,
0.29767000675201416,
0.23666363954544067,
-0.4857396185398102,
0.2200559377670288,
-0.6611217856407166,
0.23075737059116364,
0.762545108795166,
0.16059668362140656,
0.07899045199155807,
... | |
is whole spectrum there, from testing integration between two classes, to testing integration with the production environment.
* **Smoke test (aka** ***sanity*** **check)**: A simple integration test where we just check that when the system under test is invoked it returns normally and does not blow up.
+ Smoke testi... | [
0.7078729271888733,
0.06413111090660095,
-0.024143878370523453,
0.04795672371983528,
0.06990867853164673,
-0.33439669013023376,
0.23985996842384338,
-0.7175816893577576,
0.25844135880470276,
-0.23373830318450928,
-0.16235008835792542,
0.6463443636894226,
-0.1173967495560646,
-0.01755295693... | |
was written when a bug was fixed. It ensures that this specific bug will not occur again. The full name is "non-regression test". It can also be a test made prior to changing an application to make sure the application provides the same outcome.
To this, I will add:
* **Acceptance test**: Test that a feature or use c... | [
0.4561367630958557,
-0.17261414229869843,
-0.07347416877746582,
0.11320604383945465,
-0.05077769607305527,
-0.17144355177879333,
0.21494999527931213,
-0.025562217459082603,
0.085555799305439,
-0.2195526659488678,
-0.05522385612130165,
0.560943603515625,
-0.25409775972366333,
0.147997334599... | |
stubbed during the test (otherwise it would be more of an integration test).
* **Pre-flight check**: Tests that are repeated in a production-like environment, to alleviate the 'builds on my machine' syndrome. Often this is realized by doing an acceptance or smoke test in a production like environment. | [
1.0333003997802734,
0.38266468048095703,
-0.06610637903213501,
0.12288937717676163,
0.37059640884399414,
0.013282543048262596,
0.533731997013092,
0.0842784121632576,
0.10269157588481903,
-0.43190911412239075,
-0.05227838084101677,
0.38487350940704346,
0.07910358160734177,
-0.21797554194927... | |
I read [This article](http://jacobcarpenter.wordpress.com/2008/01/02/c-abuse-of-the-day-functional-library-implemented-with-lambdas/) and i found it interesting.
To sum it up for those who don't want to read the entire post. The author implements a higher order function named Curry like this (refactored by me without ... | [
-0.20082390308380127,
0.12808896601200104,
0.3203388452529907,
-0.11638548225164413,
-0.3047730028629303,
-0.12683893740177155,
0.33772069215774536,
-0.34501826763153076,
-0.13349539041519165,
-0.5102725028991699,
-0.12970304489135742,
0.2274468094110489,
-0.42535653710365295,
0.1139503344... | |
the ability to take an expression like F(x, y)
eg.
```
Func<int, int, int> add = (x, y) => x + y;
```
and call it in the F.Curry()(x)(y) manner;
This part i understood and i find it cool in a geeky way. What i fail to wrap my head around is the practical usecases for this approach. When and where this technique i... | [
0.10951913893222809,
-0.24047620594501495,
0.31114959716796875,
-0.003930649254471064,
0.006351463496685028,
-0.15808062255382538,
0.3343544900417328,
-0.20114204287528992,
-0.028393805027008057,
-0.43063676357269287,
-0.28082728385925293,
0.7029201984405518,
0.009703518822789192,
-0.32208... | |
evalued.
I made this little test in C# (keep in mind that i'm only interested in the C# implementation and not the curry theory in general):
```
public static void Main(string[] args)
{
Func<Int, Int, string> concat = (a, b) => a.ToString() + b.ToString();
Func<Int, Func<Int, string>> concatCurry = concat.Curr... | [
-0.11764254420995712,
-0.066428042948246,
0.6374164819717407,
-0.36422643065452576,
0.19421708583831787,
0.24622254073619843,
0.5198793411254883,
-0.5438539981842041,
-0.49244070053100586,
-0.1575504094362259,
-0.2657008171081543,
0.4871523082256317,
-0.35253778100013733,
0.256984800100326... | |
override string ToString()
{
return Value.ToString();
}
public static implicit operator Int(int value)
{
return new Int { Value = value };
}
}
```
On the 2 consecutive calls to curryConcatWith100 the ToString() evaluation for the value 100 is calle... | [
-0.13321059942245483,
-0.12079427391290665,
0.7505632638931274,
-0.5028803944587708,
0.39839914441108704,
0.12043911963701248,
0.2861984968185425,
-0.8080833554267883,
0.22402381896972656,
-0.29191169142723083,
-0.1082223653793335,
0.6693729758262634,
-0.2774147391319275,
-0.15876562893390... | |
twice (once for each call) so i dont see any gain in evaluation here. Am i missing something ?
Its easier to first consider fn(x,y,z). This could by curried using fn(x,y) giving you a function that only takes one parameter, the z. Whatever needs to be done with x and y alone can be done and stored by a closure that the... | [
0.28099891543388367,
-0.16467732191085815,
0.356011301279068,
-0.19992774724960327,
-0.17195363342761993,
0.27205029129981995,
-0.03284167870879173,
-0.5759671330451965,
-0.18088215589523315,
-0.48830676078796387,
0.11878151446580887,
0.7248689532279968,
-0.007622996810823679,
0.2046338915... | |
a function that takes say 2 parameters into a function that only takes 1. The result of calling this curried function with a parameter is the same as calling the original with the 2 parameters.
With Lambdas present in C# this has limited value since these can provide this effect anyway. Although it you are use C# 2 th... | [
0.28652632236480713,
-0.32514479756355286,
-0.098603256046772,
-0.12607891857624054,
0.2316645085811615,
0.023488061502575874,
-0.1112838014960289,
-0.47994324564933777,
-0.17547854781150818,
-0.525215744972229,
0.1326403170824051,
0.47555139660835266,
-0.2365114390850067,
-0.1963932812213... | |
function.
This type of currying isn't truely possible in C#, it really takes a functional language that can natively curry any of its functions to acheive.
Conclusion
----------
Parameter reduction via the Curry you mention is useful in C# 2 but is considerably de-valued in C# 3 due to Lambdas. | [
-0.1473318636417389,
-0.31158679723739624,
0.30530625581741333,
0.019481368362903595,
-0.33264732360839844,
0.08093877881765366,
0.08085524290800095,
-0.39626574516296387,
0.07426466047763824,
-0.5188220143318176,
-0.10569881647825241,
0.6713153123855591,
-0.29885566234588623,
-0.190801158... | |
For example my table is here>>
```
CREATE TABLE tProject(
name nvarchar(1000),
Goal ntext,
Activities ntext,
Result ntext,
MonName nvarchar(1000),
MonGoal ntext,
MonActivities ntext,
MonResult ntext,
TotalFund nvarchar(100))
```
how to search from all ntext and nvarchar fields in onetime.
help me please
```
$ ir... | [
-0.1626896858215332,
0.004607922863215208,
0.6195905804634094,
-0.08487110584974289,
-0.029638931155204773,
0.12291587889194489,
0.41918280720710754,
-0.09628159552812576,
-0.008714219555258751,
-0.8298323750495911,
-0.2670081853866577,
0.8338132500648499,
-0.15864692628383636,
0.022813975... | |
I have a number of slots and pegs arranged in a straight line. The pegs can be moved and need to be moved to a slot each. A slot can be left empty only if all pegs are taken. When a peg is moved, it is not allowed to go past another peg. In other words the order of the pegs must be maintained. Preferably, the total dis... | [
0.6945706009864807,
0.19472666084766388,
0.18161708116531372,
-0.030432162806391716,
0.3147330582141876,
0.40942633152008057,
-0.15663404762744904,
-0.16998708248138428,
-0.4232195019721985,
-0.6867506504058838,
0.1327739953994751,
-0.014881405979394913,
-0.19946278631687164,
0.38591423630... | |
mathematics deals with such a problem? What are the names of any well known algorithms which deal with similar problems? I am looking for Google fodder. Some keywords.
```
+--oooo-+--+---+---o--+------+--+-ooo+o-+-------o--+-----o-o-+-o
+ - Slots
o - Pegs
```
**EDIT:** I think that this visualization makes more sen... | [
-0.0892348662018776,
0.41039329767227173,
0.07497887313365936,
0.24495282769203186,
0.03646763786673546,
0.013825447298586369,
-0.09869707375764847,
-0.17956647276878357,
-0.37466761469841003,
-0.6337504386901855,
-0.07003286480903625,
0.686286985874176,
-0.12969794869422913,
0.01730138063... | |
search term on that wikipedia page.
The key insight is this:
Imagine you have your pegs as a list of peg positions (peg1:more pegs) and slots as a list of slot positions (slot1:more slots). Call this problem (peg1:pegs, slot1:slots). Then the solution is either peg1 in slot1 & the solution to (pegs, slots), or it is... | [
-0.4297114908695221,
0.01573765277862549,
0.2702544331550598,
0.08997546881437302,
0.12479954212903976,
0.22917692363262177,
-0.04874972999095917,
-0.5603672862052917,
-0.44758298993110657,
-0.8402746319770813,
-0.2385004460811615,
0.2635048031806946,
-0.19281797111034393,
0.08932900428771... | |
a = solution(peg:pegs, slots) and b=(peg,slot):solution(pegs, slots)
```
This solution should be made more efficient by combining the distance into the data structure. | [
-0.01588962785899639,
0.1830958127975464,
0.18091104924678802,
-0.04046747088432312,
0.1330488920211792,
0.2133161574602127,
-0.1893007606267929,
-0.6887010335922241,
-0.26205089688301086,
-0.7555396556854248,
0.10236018151044846,
-0.18007323145866394,
-0.0336393341422081,
0.30243018269538... | |
Do you know any way that I could programmatically or via scrirpt transform a set of text files saved in ansi character encoding, to unicode encoding?
I would like to do the same as I do when I open the file with notepad and choose to save it as an unicode file.
You can use iconv. On Windows you can use it under Cygwin... | [
0.18595553934574127,
0.13728667795658112,
0.4738311171531677,
-0.06665479391813278,
-0.03963366150856018,
-0.04139690101146698,
0.06368272006511688,
0.18756458163261414,
-0.3848915100097656,
-0.9812368750572205,
-0.1295965015888214,
0.6981108784675598,
-0.1926528662443161,
0.01579384319484... | |
I have a stored procedure that returns an object as XML. How do I handle the case where the object doesn't exist?
I can't return null or empty string as the XmlReader complains that it is not valid XML.
If I return an empty Tag, how do I tell if it is just an empty object or no object?
Well, a common approach is some... | [
0.1744154840707779,
0.057095710188150406,
0.005106013733893633,
0.12907473742961884,
-0.2063068300485611,
-0.26860305666923523,
0.16763430833816528,
-0.11167888343334198,
0.05271879583597183,
-0.481975257396698,
-0.059970490634441376,
0.22698740661144257,
-0.09922051429748535,
0.2592082619... | |
I have been trying to access a .NET Assembly that I have created in classic ASP using
```
dim foo
set foo = Server.CreateObject("TestAssembly.MyClass")
```
The problem is I'm getting an error:
```
Server object error 'ASP 0177 : 800401f3'
Server.CreateObject Failed
/test.asp, line 4
Invalid class string
```
I ... | [
0.37501105666160583,
0.16326376795768738,
0.21483519673347473,
-0.3426494002342224,
-0.012643847614526749,
-0.05707904323935509,
0.385930597782135,
-0.28161612153053284,
-0.13679490983486176,
-0.7454198002815247,
-0.11798122525215149,
0.5246418714523315,
-0.23483367264270782,
0.41120189428... | |
classic ASP site to .NET
Another thing to check: make sure your .Net assembly is set to be COM Visible. | [
0.33704182505607605,
-0.4947449266910553,
0.29542937874794006,
0.17223644256591797,
0.05289135128259659,
-0.47363975644111633,
0.4675518274307251,
0.284288227558136,
-0.4540398418903351,
-0.7892987132072449,
-0.21310321986675262,
0.5721916556358337,
-0.15461353957653046,
-0.258561253547668... | |
I can easily select all comments from XML by
```
select @XML.query('comment()')
```
but can't find how to delete them. Is there appropriate syntax for @XML.modify('delete ...')?
```xquery
set @XML.modify('delete comment()')
select @XML
```
Here it is. | [
0.10058069229125977,
0.17335465550422668,
0.45043373107910156,
0.05894973501563072,
-0.4558965265750885,
-0.2086348682641983,
-0.25425049662590027,
0.07829013466835022,
0.09338060766458511,
-0.7315018773078918,
-0.08242416381835938,
0.4040745794773102,
-0.3731359541416168,
0.26018801331520... | |
In jQuery I need to do an if statement to see if $this doesn't contain the class '.selected'.
```
$(".thumbs").hover(function(){
$(this).stop().fadeTo("normal", 1.0);
},function(){
$(this).stop().fadeTo("slow", 0.3);
});
```
Basically when this function is run (on hover) I don't want to perform the fades if the cl... | [
0.11875826865434647,
-0.3743305206298828,
0.8138510584831238,
-0.21188007295131683,
0.1773185133934021,
-0.03342174366116524,
0.15910948812961578,
0.06935954093933105,
0.11127935349941254,
-0.6341187357902527,
-0.280720978975296,
0.680725634098053,
-0.2125791758298874,
-0.08356872200965881... | |
Can anyone point me to some information on .NET assemblies spanning multiple files?
I've found this remark on MSDN ([here](http://msdn.microsoft.com/en-us/library/ms973231.aspx#assenamesp_topic4)):
> Although it's technically possible to create assemblies that span
> multiple files, you're not likely to use this tec... | [
0.6846871376037598,
-0.019624676555395126,
-0.16115425527095795,
0.18033874034881592,
0.09133456647396088,
0.059698376804590225,
0.11084349453449249,
-0.08994612842798233,
-0.5612327456474304,
-0.6922750473022461,
0.12267441302537918,
0.2351590096950531,
0.05382794886827469,
0.186460524797... | |
the other. Still can't see private.
MSDN - <http://msdn.microsoft.com/en-us/library/0tke9fxk(VS.80).aspx> | [
0.003269562730565667,
-0.16327442228794098,
0.28179121017456055,
0.22604385018348694,
0.34813088178634644,
-0.03656819835305214,
0.12674088776111603,
0.06382638216018677,
-0.26709434390068054,
-0.5077897310256958,
-0.18864676356315613,
0.48312732577323914,
-0.14200082421302795,
0.204074054... | |
Is it possible to find all classes or interfaces in a given package? (Quickly looking at e.g. [`Package`](http://java.sun.com/javase/6/docs/api/java/lang/Package.html), it would seem like no.)
Due to the dynamic nature of class loaders, this is not possible. Class loaders are not required to tell the VM which classes i... | [
0.27849456667900085,
-0.23934434354305267,
-0.0250009186565876,
0.2061537355184555,
-0.1487065702676773,
-0.23105120658874512,
0.22215032577514648,
-0.08092477172613144,
-0.4228505790233612,
-0.56352299451828,
-0.046382077038288116,
0.5449334383010864,
-0.36157312989234924,
0.1140247657895... | |
libraries that can help you do this.
If there are classes that get generated, or delivered remotely, you will not be able to discover those classes.
The normal method is instead to somewhere register the classes you need access to in a file, or reference them in a different class. Or just use convention when it comes... | [
0.49952375888824463,
-0.1273670196533203,
0.05937430262565613,
0.4210364520549774,
-0.12977290153503418,
-0.06021110713481903,
0.136058509349823,
-0.0470057874917984,
-0.26132485270500183,
-0.8180798888206482,
0.029349103569984436,
0.3793211281299591,
-0.2474869191646576,
0.175749689340591... | |
In CSS the margin order is: **top right bottom left**
In XAML the margin order is: **left top right bottom**
Is there a reason why the WPF team didn't align this to the CSS norm?
I imagine this is because margins in WinForms were declared as left, top, right, bottom. They likely thought it would be more likely to hav... | [
-0.15861722826957703,
0.30988040566444397,
0.43456247448921204,
0.01817416213452816,
-0.37608933448791504,
-0.07247897237539291,
-0.10595084726810455,
-0.010729741305112839,
-0.16919703781604767,
-0.6488201022148132,
-0.2245144098997116,
0.0039028755854815245,
-0.007380433846265078,
0.1216... | |
I have a couple of classes that I have created for my web project and I am going to store them in the App\_Code folder. I don't want to store all the classes in the top level (no namespace) but want to organize them into namespaces. So far this does not seem possible because when I use the "using XXXX;" namespace state... | [
0.3088058829307556,
0.3995332717895508,
0.002192614832893014,
-0.13623231649398804,
0.10984848439693451,
0.27766525745391846,
0.3971406817436218,
0.1144421398639679,
-0.2214827686548233,
-0.7705101370811462,
0.1042572632431984,
0.5221325159072876,
-0.5217834115028381,
0.19653485715389252,
... | |
my code behind page for default.aspx I have
```
.
.
.
using foo
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
bar NewBar = new bar();
}
}
```
The above DOES NOT work for me I have to use
```
foo.bar NewBar = new foo.bar();
```
Does... | [
0.3611336648464203,
0.3621789813041687,
0.6153720021247864,
-0.4478764533996582,
-0.3182835280895233,
-0.2294478863477707,
0.6163415908813477,
-0.266213983297348,
-0.1590830534696579,
-0.5729153156280518,
0.07495009154081345,
0.7338382005691528,
-0.46012255549430847,
0.08983165770769119,
... | |
Sorry for the worry. It was because I had the namespace and the class name the same so it could not differentiate and needed the fully qualified name. As soon as I changed the class name everything worked as expected. | [
0.2931557297706604,
-0.0002758985501714051,
-0.01381110493093729,
-0.011761513538658619,
-0.07114230841398239,
-0.07295874506235123,
0.3160059452056885,
0.23502904176712036,
-0.037405408918857574,
-0.44142258167266846,
0.15838681161403656,
0.44448259472846985,
0.10497180372476578,
0.135729... | |
We have a list of (let's say 50) reports that get dumped into various folders depending on certain conditions. All the reports have standard names eg. D099C.LIS, D18A0.LIS etc.
Sometimes a report can exist in up to 5 different locations, and I need to generate a list of all the locations of the most recent version of ... | [
0.5065420269966125,
0.0930095687508583,
0.18608905375003815,
0.2518617510795593,
0.08670295029878616,
-0.11568954586982727,
-0.02804684266448021,
-0.19093269109725952,
-0.0628068819642067,
-0.6320090889930725,
-0.1043037474155426,
0.2641664445400238,
-0.07543658465147018,
0.159474462270736... | |
so far in PowerShell (I've done something similar using bash) is:
```
ls -r -fi *.lis | sort @{expression={$_.Name}}, @{expression={$_.LastWriteTime};Descending=$true} | select Directory, Name, lastwritetime
```
That will recursively list all files with \*.lis extension, then sort it by name (asc) and date (desc), a... | [
-0.17803017795085907,
-0.019078318029642105,
0.6673179268836975,
-0.2714368402957916,
0.4610770046710968,
-0.12105292081832886,
0.2123768925666809,
-0.3485267460346222,
-0.3576526343822479,
-0.9458250403404236,
-0.2934769093990326,
0.7711921334266663,
-0.1945093721151352,
0.122616015374660... | |
27/01/2009 10:50:21
C:\reports\ALID D075A.LIS 04/02/2009 12:34:12
C:\reports\JCSW D075B.LIS 05/02/2009 10:07:15
C:\reports\ALID D075B.LIS | [
-0.24228456616401672,
0.6210535764694214,
0.403873473405838,
-0.23947767913341522,
-0.029653828591108322,
0.3399827182292938,
0.5879400968551636,
0.12983129918575287,
-0.39223605394363403,
-0.47256699204444885,
-0.1701468676328659,
0.537356436252594,
-0.053826022893190384,
-0.0656177550554... | |
30/01/2009 09:14:57
C:\reports\BMA3 D081A.LIS 01/09/2008 14:51:36
```
What I obviously need to do now is remove the files that aren't the most recent versions, so that the output looks like this (not too worried about formatting yet):
```
C:\reports\LESE D057A.LIS ... | [
-0.06969717144966125,
0.647835373878479,
0.5178377628326416,
0.014823827892541885,
0.10372622311115265,
-0.17792542278766632,
0.4610399305820465,
0.1305890530347824,
-0.4241732060909271,
-0.7939825654029846,
-0.3503139913082123,
0.7705205678939819,
-0.27097731828689575,
0.01403146144002676... | |
D075B.LIS 05/02/2009 10:07:15
C:\reports\BMA3 D081A.LIS 01/09/2008 14:51:36
```
Anyone have any ideas?
[edit]
Some good ideas and answers to this question. Unfortunately I can't mark all as accepted, but EBGreen's (edited) answer worked without modification. I'll add work... | [
0.056363385170698166,
0.5195745825767517,
0.1479092687368393,
0.008863539434969425,
-0.019684087485074997,
-0.1511995494365692,
0.5833426713943481,
-0.03458068519830704,
-0.25280308723449707,
-0.5280072689056396,
-0.3097935914993286,
0.45457693934440613,
-0.22653783857822418,
-0.1204772070... | |
'BEGIN{OFS="\t"}{print $5,$6,$7,$8}' | grep ".LIS" | sort -k4 -k2r -k3r | uniq -f3
ls -lR --time-style=long-iso | awk 'BEGIN{OFS="\t"}{print $5,$6,$7,$8}' | grep ".LIS" | sort -k4 -k2r -k3r | awk '!x[$4]++'
```
PowerShell:
```
ls -r -fi *.lis | sort @{expression={$_.Name}}, @{expression={$_.LastWriteTime};Descend... | [
-0.6808183789253235,
-0.014092037454247475,
0.5221849679946899,
-0.38337641954421997,
0.1996312141418457,
0.2335672676563263,
0.28193068504333496,
-0.4219290316104889,
-0.13503696024417877,
-0.6160180568695068,
-0.7198156714439392,
0.42541033029556274,
-0.34790024161338806,
0.0241354927420... | |
| %{$_.Group | Select -first 1}
``` | [
-0.22084656357765198,
0.2336830049753189,
0.04187570512294769,
-0.23078471422195435,
0.010992024093866348,
-0.13588014245033264,
0.27661409974098206,
-0.2000402808189392,
0.29575344920158386,
-0.2460823506116867,
-0.4234418272972107,
0.40967363119125366,
-0.5931642651557922,
-0.00993409380... | |
I am currently calling a web service that returns a service defined class which I am interpreting in my application. I'm considering asking the vendor of this web service to add a property to this class which will make my life as well as their other clients lives a lot easier. To be clear I'm not asking them to modify ... | [
0.6052525639533997,
0.21000142395496368,
0.2170048952102661,
-0.07360108196735382,
0.05373967066407204,
0.1441708356142044,
0.49699363112449646,
-0.19238604605197906,
-0.2586327791213989,
-0.4226827919483185,
-0.002857720013707876,
0.49315962195396423,
-0.19412656128406525,
0.5419194698333... | |
the unexpected property from the server
* the server may barf when not receiving the expected property from old clients
It can also work... it just needs testing / planning.
A safer option (if you have complex deployment that can't all go at once) is to consider the API sealed and add a new "v2" end-point etc. | [
0.2784843146800995,
-0.15640109777450562,
0.3775007128715515,
0.04452434554696083,
0.002353403251618147,
-0.23278121650218964,
0.4319855868816376,
-0.4264707863330841,
-0.3071548342704773,
-0.40343040227890015,
-0.15855996310710907,
0.5081250071525574,
-0.14226321876049042,
0.1514176428318... | |
I have 3 images and have a function so that on mouse rollover they fade in and out. I don't want to do this if the image being rolled over has the class 'selected'.
So far I have this code:
```
$(".thumbs").hover(function(){
if (!($(this).hasClass(".selected")){
$(this).stop().fadeTo("normal", 1.0);
},function(){
$... | [
0.40976476669311523,
-0.05156927928328514,
0.7848193049430847,
-0.268063485622406,
0.10402290523052216,
0.10319864749908447,
0.21467113494873047,
-0.05741085857152939,
0.10014019161462784,
-0.7438396215438843,
-0.028943680226802826,
0.5498026609420776,
-0.09615936875343323,
0.0863213539123... | |
// ...
})
``` | [
0.2319299876689911,
0.4182470738887787,
0.25077903270721436,
-0.10909026116132736,
0.06832292675971985,
-0.021094869822263718,
0.28232529759407043,
0.17180326581001282,
0.126926988363266,
-0.6165958642959595,
-0.32816022634506226,
0.616998553276062,
-0.24028804898262024,
0.2906934916973114... | |
I've been upgrading our solutions from VS 2005 to VS 2008; still targeting the .net 2.0 framework. The conversion wizard is simple and I've never had a conversion failure. The only beef that I've had so far is that I can't immediately compile after the upgrade because VS has changed some of my namespaces causing naming... | [
-0.05561992898583412,
-0.15623921155929565,
0.3774028718471527,
-0.16266611218452454,
-0.26032039523124695,
0.31104496121406555,
0.19103260338306427,
-0.043803006410598755,
-0.11823368817567825,
-0.9802749156951904,
0.16942837834358215,
0.7798031568527222,
-0.24532757699489594,
0.401381194... | |
{
}
}
```
During the conversion process, VS is changing my designer class and adding the folder name to the end of the namespace so now it looks like this:
```
namespace MyNameSpace.Clients
{
public partial class dsClient : global::System.Data.DataSet
{
}
}
```
The problem with this is that I have ... | [
-0.03360036015510559,
-0.19282138347625732,
0.43556976318359375,
0.13753564655780792,
-0.08939915895462036,
0.03729286789894104,
0.10504753887653351,
-0.0388435460627079,
-0.33793574571609497,
-1.0953961610794067,
-0.06181223317980766,
0.5355010032653809,
-0.32245194911956787,
0.7181524038... | |
VS changes the namespace name to the name of the dataset rather than the name of the folder.
Is this a config thing in the conversion wizard? I'd like to have the wizard just update the project files and leave the code alone.
You can fix this by providing the namespace the code should be generated in:
Open the prope... | [
0.7262497544288635,
-0.36441951990127563,
0.4808073341846466,
0.3989286720752716,
-0.3069573938846588,
-0.3456050753593445,
0.1844235062599182,
-0.1373373568058014,
-0.23442450165748596,
-0.921511709690094,
0.1358085721731186,
0.829851508140564,
0.020382702350616455,
0.28209102153778076,
... | |
I'm writing a Java Desktop App using NetBeans 6.5 and a Swing Patterns that keeps repeating. Each and every one of my dialogs has a `Save Button` and `Close Button` with mostly different behavior behind the Save Button and identical code behind the close button.
How can I reuse this code without copying and pasting an... | [
0.30549561977386475,
0.19900494813919067,
0.3882052004337311,
-0.15087851881980896,
-0.005255389027297497,
0.2566884756088257,
0.23889131844043732,
-0.20428502559661865,
-0.11763910949230194,
-0.7841368317604065,
0.11474011838436127,
0.67002272605896,
-0.39129629731178284,
-0.1958009749650... | |
the GUI builder code to execute the appropriate Action. | [
0.10806301236152649,
-0.09836335480213165,
0.16248196363449097,
0.1045936718583107,
-0.07793061435222626,
-0.21451236307621002,
0.11483189463615417,
-0.11485275626182556,
0.29734984040260315,
-0.6286625862121582,
-0.5139844417572021,
1.046552062034607,
-0.025792619213461876,
-0.38945129513... | |
I have a database with some stored procedures.
My question is: Is there a problem to do this:
GRANT EXECUTE ON [dbo].[StoredProcedureXPTO] TO [Public]
i.e. grant permission of execution to public?? Or is thar a security issue?
The answer entirely depends on what your Stored Procedure does and whether you want every ... | [
0.674466073513031,
0.3460013270378113,
-0.0698162093758583,
-0.021541504189372063,
0.05943071469664574,
-0.02530227042734623,
0.40487003326416016,
-0.6058511734008789,
-0.23960928618907928,
-0.14975006878376007,
-0.0631314218044281,
0.35509926080703735,
-0.22895126044750214,
0.177885070443... | |
I have a spreadsheet which cells in are colored meaningfully.
Does any body know how i can return the background color value of a current cell in Excel sheet?
You can use `Cell.Interior.Color`, I've used it to count the number of cells in a range that have a given background color (ie. matching my legend). | [
0.4360487759113312,
0.23270437121391296,
0.15614192187786102,
-0.04312087967991829,
0.3574126660823822,
0.23780620098114014,
-0.06628021597862244,
-0.043891359120607376,
-0.3786432147026062,
-0.7082672715187073,
0.15102556347846985,
0.10402743518352509,
-0.03274509310722351,
0.041798491030... | |
I have a context menu with a few items. One of the items has a submenu (or whatever it's called) with a few items (depends on what files it finds).
What I want to do is when I left click one of the sub-items I want one thing to happen, and when I right click I want another thing to happen.
My problem is that when I u... | [
-0.03347171097993851,
-0.10039984434843063,
0.3999648988246918,
0.16692428290843964,
0.13532114028930664,
0.12139149010181427,
0.14079852402210236,
-0.03319050744175911,
-0.3215901851654053,
-0.6383730173110962,
0.22603149712085724,
0.5443220734596252,
-0.11720430105924606,
0.3601715862751... | |
some error then.
Does anyone know how I can fix this? So I can find out what mouse button was used to click the sub-item (which is a ToolStripMenuItem)?
Thanks
edit: here is the code I use to create the sub items:
```
IPHostEntry ipE = Dns.GetHostEntry(Dns.GetHostName());
IPAddress[] IpA = ipE.AddressList;
for (int... | [
-0.21692803502082825,
0.10500339418649673,
0.7328042387962341,
0.16932331025600433,
0.22806034982204437,
0.2690102458000183,
0.4236253499984741,
-0.4367021918296814,
-0.43931514024734497,
-0.7265293002128601,
-0.24106529355049133,
0.4318319261074066,
-0.4620194435119629,
-0.185428172349929... | |
{
ToolStripMenuItem item1 = new ToolStripMenuItem("Menu1");
ToolStripMenuItem subMenuitem1 = new ToolStripMenuItem("SubMenu");
item1.DropDownItems.Add(subMenuitem1);
this.contextMenuStrip1.Items.Add(item1);
subMenuitem1.MouseDown += new MouseEventHandler(subMenuitem1_MouseDown);
... | [
-0.3656655251979828,
-0.4799504280090332,
0.5591441988945007,
-0.1923198103904724,
0.08161363750696182,
0.3518103361129761,
0.37889596819877625,
-0.5693763494491577,
-0.12277937680482864,
-0.5761301517486572,
-0.5091114640235901,
0.6991742253303528,
-0.3310416340827942,
0.00425681006163358... | |
}
```
That should help get you started.
RE: You're edit:
The problem is, you're just saying new ToolStripMenuItem(IpA[i].ToString()) without keep a reference to it. Here's how you need to do it:
```
IPHostEntry ipE = Dns.GetHostEntry(Dns.GetHostName());
IPAddress[] IpA = ipE.AddressList;
for (int i = 0; i... | [
-0.014966360293328762,
0.24414707720279694,
0.729069173336029,
-0.0416707918047905,
0.24197694659233093,
-0.12257131934165955,
0.31775519251823425,
-0.34541818499565125,
-0.2419011890888214,
-0.9027796387672424,
-0.5688695907592773,
0.5568283796310425,
-0.2965368926525116,
-0.0875410065054... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.