text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
We're writing a records management product for schools and one of the requirements is the ability to manage course schedules. I haven't looked at the code for how we deal with this (I'm on a different project at the moment), but nonetheless I started wondering how best to handle one particular part of this requirement,... | [
0.9324977993965149,
0.1524130254983902,
-0.006854378152638674,
0.21024541556835175,
0.4719092845916748,
-0.28101515769958496,
0.004484855104237795,
0.07820724695920944,
-0.2545618414878845,
-0.18919335305690765,
0.128835991024971,
0.14765794575214386,
0.20933789014816284,
0.008783713914453... | |
Example Data
------ ------------
DeptPrefix ;MATH, ENG, CS, ...
Number ;101, 300, 450, ...
Title ;Algebra, Shakespeare, Advanced Data Structures, ...
Description ;...
DaysOfWeek ;Monday, Tuesday-Thursday, ...
StartTime
EndTime
```
What I'm wondering is, wha... | [
-0.23148144781589508,
0.26590797305107117,
0.5723955035209656,
0.15637363493442535,
0.28396090865135193,
0.2966972887516022,
0.1895156353712082,
0.040985431522130966,
-0.3283819854259491,
-0.503983736038208,
-0.3824983835220337,
0.41203612089157104,
-0.3041083812713623,
-0.0911024510860443... | |
in this (contrived) example? The problem I'm having with it is that is a multi-valued field: that is, you can have a course on any day of the week, and the same course can take be held on more than one day. I know certain databases natively support multi-value columns, but is there a "best practice" to handle this assu... | [
0.14332887530326843,
-0.13792042434215546,
0.42685744166374207,
0.30085626244544983,
-0.21083718538284302,
-0.12521955370903015,
-0.06793056428432465,
0.2452525496482849,
-0.4275752007961273,
-0.1420210748910904,
0.044405363500118256,
0.269588440656662,
-0.1803920567035675,
0.2969588041305... | |
head (I'm not sure if that's a good thing or not...). In this solution, `DaysOfWeek` would be defined as a byte, and the first 7 bits would be used to represent the days of week (one bit for each day). A 1 bit would indicate that a class was held on corresponding day of the week.
**Pros**: Easy to implement (the appli... | [
-0.009133216924965382,
-0.12636223435401917,
0.6699379086494446,
0.18156935274600983,
-0.07404499500989914,
0.04999685287475586,
0.3625629246234894,
-0.060029447078704834,
-0.330610454082489,
-0.3281098008155823,
-0.09669258445501328,
0.4274350702762604,
-0.09901107847690582,
0.09216993302... | |
simplify this), breaks relational database model.
### Possible Solution #2: Store DaysOfWeek as a string of characters
This is essentially the same approach as using a bit field, but instead of dealing with raw bits, you assign a unique letter to each day of the week, and the `DaysOfWeek` column just stores a sequenc... | [
0.07783032208681107,
-0.013478381559252739,
0.4289749562740326,
0.14087098836898804,
-0.005893978290259838,
0.2131202071905136,
0.24863658845424652,
-0.13944806158542633,
-0.36172157526016235,
-0.26732388138771057,
-0.29399392008781433,
0.308395117521286,
-0.2785560190677643,
0.11694745719... | |
M
Tuesday T
Wednesday W
Thursday R
Friday F
Saturday U
```
In this case, a course held on Monday, Tuesday, and Friday would have have the value `'MTF'` for `DaysOfWeek`, while a class held only on Wednesdays would have a `DaysOfWeek` value of `'W'`.
**Pros**: Easier to deal with in queries (i.e... | [
0.035181932151317596,
-0.4275110065937042,
0.429638147354126,
0.09444785863161087,
-0.18595834076404572,
-0.0487745963037014,
0.3577571213245392,
0.05419372767210007,
-0.3470199406147003,
-0.30026471614837646,
-0.3898918032646179,
0.42891815304756165,
0.09224644303321838,
0.137738615274429... | |
Also friendlier to look at, and easy to see at a glance what is happening in queries that use the `DaysOfWeek` column.
**Cons**: The only real "con" is that, like the bitfield approach, this breaks the relational model by storing a variable number of values in a single field.
### Possible Solution #3: Use a Lookup Ta... | [
0.21126605570316315,
0.18777820467948914,
0.34897899627685547,
0.17183175683021545,
-0.09436148405075073,
0.05833565443754196,
0.1971515268087387,
0.025942280888557434,
-0.2669881582260132,
-0.47346457839012146,
0.02416747622191906,
0.519095778465271,
-0.4333747923374176,
0.164399832487106... | |
only considered it because it seemed like the The Relational WayTM to do things.
**Pros**: It's the only solution that is "pure" from a relational database point of view.
**Cons**: It's inelegant and cumbersome. For example, how would you design the user interface for assigning corresponding weekdays to a given cours... | [
0.2805127203464508,
0.12244205176830292,
0.08387931436300278,
0.22566519677639008,
-0.020900515839457512,
0.17949721217155457,
0.2518945634365082,
-0.016648108139634132,
-0.12147121876478195,
-0.28918981552124023,
0.298920214176178,
0.7008886337280273,
-0.28462332487106323,
0.0526571385562... | |
solutions suffice? For what it's worth, I think my second solution is probably the best of the three possible solutions that I outlined here, but I'd be curious to see if someone has a different opinion (or indeed a different approach altogether).
I would avoid the string option for the sense of purity: it adds an extr... | [
-0.030564840883016586,
-0.11843046545982361,
0.5145601034164429,
0.13201703131198883,
0.09622862935066223,
0.29508280754089355,
0.24561026692390442,
-0.153299480676651,
-0.5228931307792664,
-0.4832196533679962,
-0.24948284029960632,
0.17296108603477478,
-0.4324615001678467,
0.0377233438193... | |
also be useful if the tool is ever used in countries where the workweek starts on different days.
I would avoid the lookup because that would be over-normalization. Unless your set of lookup items is not obvious or could possibly change, it's overkill. In the case of days-of-the-week (unlike US states, for example), I... | [
0.6561089158058167,
-0.16822059452533722,
0.14214353263378143,
0.487434983253479,
0.14993825554847717,
-0.4100419282913208,
0.49176326394081116,
0.5100298523902893,
-0.4161871373653412,
-0.40323662757873535,
-0.03818786144256592,
0.07701601088047028,
0.20301388204097748,
0.1905581653118133... | |
with their schedules where they "swap days" to balance out an equal number of weekdays of each type over the semester despite holidays. I am not clear about your system, but perhaps the best approach would be to store a table of the actual dates in which the course is expected to take place. This way, if there are two ... | [
0.6928513646125793,
-0.28902608156204224,
0.057238075882196426,
0.3323030471801758,
0.0954827293753624,
0.05189352482557297,
0.08547116070985794,
0.4042951762676239,
-0.6390365958213806,
-0.2863922119140625,
0.1872255802154541,
0.4029759168624878,
0.06034086272120476,
0.0835619866847992,
... | |
I'm moving from Eclipse to Visual Studio .NET and have found all my beloved hotkeys except two:
* in Eclipse you can press `ALT`-`←` and `ALT`-`→` to visit recent changes you have made, something I use frequently to go back to where I was in some other file and then return. Apparently in VS.NET the `CTRL`-`-` and `CTR... | [
0.6479668617248535,
-0.2808643579483032,
0.40882205963134766,
-0.1879129260778427,
-0.3440456688404083,
-0.08198435604572296,
0.05650616064667702,
0.24283012747764587,
-0.10294120013713837,
-1.1087149381637573,
0.20326058566570282,
0.6924540400505066,
0.015847617760300636,
0.10032068938016... | |
to work and rely on it daily, etc.?
* in Eclipse, to move a line up or down you press `ALT`-`uparrow` or `ALT`-`downarrow` and you just move it through the code until you get it to where you want it, very nice. Also to make a copy of a line, you can press `SHIFT`-`ALT`-`uparrow` or `SHIFT`-`ALT`-`downarrow`. Both of th... | [
0.44143855571746826,
-0.5892925262451172,
0.3347204923629761,
0.029546551406383514,
-0.2575967609882355,
0.012979765422642231,
-0.171387180685997,
-0.12739327549934387,
-0.24871541559696198,
-1.0347950458526611,
-0.1108747348189354,
0.5554319620132446,
-0.08636484295129776,
-0.334178745746... | |
the bottom line here up into the for loop. In Eclipse, you would put the cursor on the Console.WriteLine and then press ALT-(uparrow), I use that all the time: one key stroke to move lines up and down.
```
for (int i = 0; i < 10; i++) {
}
Console.WriteLine(i);
```
Ok, extrapolating Charlie's idea with no-selection-... | [
-0.08091606199741364,
-0.25368058681488037,
0.7294093370437622,
-0.230070099234581,
-0.2650902271270752,
0.20015761256217957,
0.03219865262508392,
-0.2626989185810089,
-0.07299355417490005,
-0.6263990998268127,
-0.06477423012256622,
0.6489518284797668,
-0.3895305097103119,
-0.1878124475479... | |
currently selected characters, and they do not allow the user to operate upon a range of lines. Here is a solution I came up with that preserves the paste buffer, the current character selection, and works with or without a selection (that may or may not span multiple rows):
```
'' Duplicates the current line (or sele... | [
-0.15055689215660095,
0.006287095602601767,
0.6859230995178223,
-0.12791530787944794,
0.19159509241580963,
0.37362435460090637,
0.15057435631752014,
-0.254374235868454,
-0.2202187478542328,
-0.6585255861282349,
-0.4444637596607208,
0.17000126838684082,
-0.3209789991378784,
0.13170346617698... | |
cursor position
Dim topPoint As TextPoint = objSel.TopPoint
Dim bottomPoint As TextPoint = objSel.BottomPoint
Dim lTopLine As Long = topPoint.Line
Dim lTopColumn As Long = topPoint.LineCharOffset
Dim lBottomLine As Long = bottomPoint.Line
Dim lBottomColumn As Long = bottomPoint.LineCharOffset()
... | [
-0.7803048491477966,
-0.17599627375602722,
1.256911039352417,
-0.1207776591181755,
-0.29262271523475647,
0.23879940807819366,
0.3883192539215088,
-0.2632562816143036,
-0.08561703562736511,
-0.18157462775707245,
-0.530208945274353,
0.33180850744247437,
-0.4109644293785095,
0.038954850286245... | |
<> lBottomLine) Or (lTopColumn <> lBottomColumn))
If (selectionPresent And (lBottomColumn = 1)) Then
' A selection is present, but the cursor is in front of the first character
' on the bottom line. exclude that bottom line from the copy selection.
endLine = lBottomLine
End If
' fig... | [
-0.12374839186668396,
-0.2050105184316635,
0.6631015539169312,
0.038724567741155624,
0.11498682200908661,
0.22492368519306183,
-0.13524729013442993,
-0.2469376027584076,
-0.155263751745224,
-0.3780546188354492,
-0.629995584487915,
0.3819414973258972,
-0.34107255935668945,
-0.23844370245933... | |
Dim verticalOffset As Integer = 0
If (movingDown) Then
verticalOffset = endLine - lTopLine
End If
' copy each line, one at a time.
' The Insert command doesn't handle multiple lines well, and we need
' to use Insert to avoid autocompletions
Dim insertLine As Long = endLine
While (re... | [
-0.02972683124244213,
-0.6559791564941406,
1.078694462776184,
-0.2100088894367218,
0.011363252066075802,
0.06204475834965706,
0.06706783920526505,
-0.15399684011936188,
-0.15451045334339142,
-0.4133005738258362,
-0.09285973012447357,
0.5200157761573792,
-0.24741514027118683,
0.124385796487... | |
line
objSel.MoveToLineAndOffset(readLine, 1)
objSel.EndOfLine(True) 'extend to EOL
Dim lineTxt As String = objSel.Text.Clone
' move to the destination position, and insert the copy
objSel.MoveToLineAndOffset(insertLine, 1)
objSel.Insert(lineTxt)
objSel.NewLine()
... | [
-0.3813367486000061,
-0.4480222165584564,
1.0934990644454956,
-0.3444339334964752,
0.17306721210479736,
0.2932652533054352,
0.19820626080036163,
-0.37949514389038086,
-0.04736095294356346,
-0.4184434413909912,
-0.8605704307556152,
0.12650522589683533,
-0.5254116058349609,
0.018156401813030... | |
+ 1
insertLine = insertLine + 1
End While
' restore the cursor to original position and selection
objSel.MoveToLineAndOffset(lBottomLine + verticalOffset, lBottomColumn)
objSel.MoveToLineAndOffset(lTopLine + verticalOffset, lTopColumn, True)
DTE.UndoContext.Close()
End Sub
'' Duplicates th... | [
-0.5439531803131104,
-0.040151797235012054,
1.0380412340164185,
-0.23559346795082092,
0.13003282248973846,
0.29393863677978516,
0.2659410238265991,
-0.36572903394699097,
-0.2866293787956238,
-0.3240402042865753,
-0.9163929224014282,
0.14671333134174347,
-0.5847440958023071,
-0.162968441843... | |
Sub
'' Moves the selected lines up one line. If no line is
'' selected, the current line is moved.
''
Sub MoveLineUp()
DTE.UndoContext.Open("MoveLineUp")
Dim objSel As TextSelection = DTE.ActiveDocument.Selection
' store the original selection and cursor position
Dim topPoint As TextPoint = objSel.TopP... | [
-0.7102805376052856,
-0.5496300458908081,
1.165518045425415,
-0.28761541843414307,
-0.0913529098033905,
0.41117534041404724,
0.44616344571113586,
-0.36816591024398804,
-0.23941928148269653,
-0.4982180893421173,
-0.929520308971405,
-0.2348022311925888,
-0.5522880554199219,
0.162490725517272... | |
Dim textLineAbove As TextSelection = DTE.ActiveDocument.Selection
textLineAbove.MoveToLineAndOffset(lTopLine - 1, 1, False)
textLineAbove.MoveToLineAndOffset(lTopLine, 1, True)
Dim indentChange As Integer = CountIndentations(textLineAbove.Text) * -1
' If multiple lines are selected, but the bottom line... | [
-0.21464787423610687,
-0.47953101992607117,
1.120646595954895,
-0.3877943456172943,
-0.2143094390630722,
0.14323467016220093,
0.46212393045425415,
-0.5026549100875854,
0.006650160066783428,
-0.40441974997520447,
-0.660197377204895,
0.44738540053367615,
-0.3822036683559418,
-0.0344494916498... | |
the line above the top line
objSel.MoveToLineAndOffset(lTopLine - 1, 1)
' and move it down, until its below the bottom line:
Do
DTE.ExecuteCommand("Edit.LineTranspose")
Loop Until (objSel.BottomPoint.Line >= lEffectiveBottomLine)
' Since the line we are on has moved up, our location in the f... | [
-0.4402651786804199,
-0.43638595938682556,
1.1036856174468994,
-0.13359196484088898,
0.4014338254928589,
0.28758034110069275,
0.05988911911845207,
-0.1639024168252945,
-0.23529736697673798,
-0.48904934525489807,
-0.7328628897666931,
-0.024125851690769196,
-0.30787020921707153,
0.0807109549... | |
lines down one line. If no line is
'' selected, the current line is moved.
''
Sub MoveLineDown()
DTE.UndoContext.Open("MoveLineDown")
Dim objSel As TextSelection = DTE.ActiveDocument.Selection
' store the original selection and cursor position
Dim topPoint As TextPoint = objSel.TopPoint
Dim bottomPo... | [
-0.5689976215362549,
-0.6173349618911743,
1.0825189352035522,
-0.17329226434230804,
-0.10338091850280762,
0.3846173882484436,
0.3437560498714447,
-0.17761467397212982,
-0.28188320994377136,
-0.44337397813796997,
-0.8288504481315613,
0.008969306945800781,
-0.45153170824050903,
0.15812797844... | |
are selected, but the bottom line doesn't
' have any characters selected, don't count it as selected
Dim lEffectiveBottomLine = lBottomLine
If ((lBottomColumn = 1) And (lBottomLine <> lTopLine)) Then
lEffectiveBottomLine = lBottomLine - 1
End If
Dim textLineBelow As TextSelection = DTE.Acti... | [
-0.2881641685962677,
-0.47052597999572754,
0.9935116767883301,
-0.36532843112945557,
0.04524656757712364,
0.218606099486351,
0.18597565591335297,
-0.610969603061676,
0.03343036025762558,
-0.44004014134407043,
-0.8613537549972534,
0.3073510229587555,
-0.27447810769081116,
-0.176876664161682... | |
objSel.MoveToLineAndOffset(lEffectiveBottomLine, 1)
' and move it down, which effectively moves the line below it up
' then move the cursor up, always staying one line above the line
' that is moving up, and keep moving it up until its above the top line:
Dim lineCount As Long = lEffectiveBottomLine - l... | [
-0.44325771927833557,
-0.5188049077987671,
1.0229212045669556,
-0.327725887298584,
-0.006437016185373068,
0.10000263899564743,
0.2664434313774109,
-0.3889833390712738,
-0.2624121606349945,
-0.5336259007453918,
-0.6221107244491577,
0.2520104646682739,
-0.30674582719802856,
-0.25267887115478... | |
Loop Until (lineCount < 0)
' Since the line we are on has moved down, our location in the file has changed:
lTopLine = lTopLine + 1
lBottomLine = lBottomLine + 1
IndentBlockAndRestoreSelection(objSel, lBottomLine, lBottomColumn, lTopLine, lTopColumn, indentChange)
DTE.UndoContext.Close()
End Sub
... | [
-0.21679969131946564,
-0.23008993268013,
0.9570789337158203,
-0.2392091304063797,
0.23539318144321442,
0.2935883104801178,
0.45566079020500183,
-0.2777070701122284,
-0.10542981326580048,
-0.192802295088768,
-0.5073289275169373,
0.029098568484187126,
-0.33416375517845154,
0.0498226284980773... | |
lBottomColumn As Long, ByVal lTopLine As Long, ByVal lTopColumn As Long, ByVal indentChange As Integer)
' restore the cursor to original position and selection
objSel.MoveToLineAndOffset(lBottomLine, lBottomColumn)
objSel.MoveToLineAndOffset(lTopLine, lTopColumn, True)
If (indentChange = 0) Then
... | [
-0.5884679555892944,
-0.2868906855583191,
1.122995376586914,
-0.46237149834632874,
0.25266826152801514,
0.4302271604537964,
0.09989359229803085,
-0.4021513760089874,
-0.020712420344352722,
-0.42476001381874084,
-0.6600178480148315,
0.43144354224205017,
-0.2937869131565094,
-0.2275412529706... | |
objSel.StartOfLine()
Else
objSel.StartOfLine()
objSel.WordRight()
End If
End If
objSel.Indent(indentChange)
' Since the selected text has changed column, adjust the columns accordingly:
' restore the cursor to original position and selection
Dim lNewBottomCol... | [
-0.650725245475769,
-0.145535409450531,
0.8407841324806213,
-0.3194524049758911,
-0.027993090450763702,
0.3069514334201813,
0.5463019013404846,
-0.09920677542686462,
-0.29284921288490295,
-0.6583278179168701,
-0.8147636651992798,
0.04521126672625542,
-0.2412833422422409,
-0.025587260723114... | |
lNewTopColumn As Long = (lTopColumn + indentChange)
' ensure that we we still on the page.
' The "or" clause makes it so if we were at the left edge of the line, we remain on the left edge.
If ((lNewBottomColumn < 2) Or (lBottomColumn = 1)) Then
' Single line selections, or a bottomColumn that is al... | [
-0.0035616448149085045,
-0.27037346363067627,
0.9017336368560791,
-0.17508333921432495,
0.24374674260616302,
0.13948582112789154,
0.05985747650265694,
-0.18366670608520508,
-0.15268702805042267,
-0.5403785705566406,
-0.542887806892395,
0.18422414362430573,
-0.25395411252975464,
-0.16842499... | |
lNewBottomColumn = 1
Else
' If we have multiple lines selected, don't allow the bottom edge to touch the left column,
' or the next move will ignore that bottom line.
lNewBottomColumn = 2
End If
End If | [
-0.16074775159358978,
-0.283991277217865,
0.5210068821907043,
-0.3620559573173523,
-0.048789072781801224,
0.035751327872276306,
0.14390093088150024,
-0.22466570138931274,
-0.22202150523662567,
-0.46384990215301514,
-0.48834261298179626,
-0.2729725241661072,
-0.5322051644325256,
-0.08670614... | |
If ((lNewTopColumn < 2) Or (lTopColumn = 1)) Then
lNewTopColumn = 1
End If
' restore the selection to the modified selection
objSel.MoveToLineAndOffset(lBottomLine, lNewBottomColumn)
objSel.MoveToLineAndOffset(lTopLine, lNewTopColumn, True)
End Sub
'' This method counts the indentation changes... | [
-0.4474133253097534,
-0.28745025396347046,
0.7232978940010071,
-0.47522592544555664,
0.1965513825416565,
0.25278934836387634,
0.26102516055107117,
-0.6051642298698425,
-0.03894219547510147,
-0.47380656003952026,
-0.6032123565673828,
0.42915216088294983,
-0.25620442628860474,
-0.07538013905... | |
Dim endOfLine As Integer = Text.IndexOf("\n", 2)
If (Equals(endOfLine, -1)) Then
' The remaining text is all on one line, so the '//' terminates our search
' Ignore the rest of the text
Exit While | [
-0.0011313902214169502,
-0.25822222232818604,
1.186790108680725,
-0.3897601068019867,
0.2527977228164673,
-0.024727432057261467,
0.5713520050048828,
-0.2366703450679779,
0.005383395589888096,
-0.25429028272628784,
-0.3391607999801636,
0.4814428687095642,
-0.4503176510334015,
0.224745437502... | |
End If
' continue looking after the end of line
Text = Text.Substring(endOfLine + 1)
End If
If (Text.StartsWith("/*")) Then
Dim endComment As Integer = Text.IndexOf("*/", 2)
If (Equals(endComment, -1)) Then | [
-0.14896506071090698,
-0.12553372979164124,
1.1520828008651733,
-0.5488181710243225,
0.19098906219005585,
-0.006966206710785627,
0.44538402557373047,
-0.18950466811656952,
-0.01218924019485712,
-0.41230103373527527,
-0.4771447479724884,
0.36721885204315186,
-0.4285672605037689,
0.067819930... | |
' This comment continues beyond the length of this line.
' Ignore the rest of the text
Exit While
End If
' continue looking after the end of this comment block | [
0.374589741230011,
0.24414736032485962,
0.33860573172569275,
0.012526731006801128,
-0.2706295847892761,
-0.17327803373336792,
0.5645714998245239,
0.40060776472091675,
-0.08002684265375137,
-0.20182520151138306,
-0.6893740892410278,
-0.07139644026756287,
-0.2999148666858673,
0.3814950585365... | |
Text = Text.Substring(endComment + 1)
End If
If (Text.StartsWith("{")) Then
indent = indent + 1
Else
If (Text.StartsWith("}")) Then
indent = indent - 1
End If | [
-0.5362083911895752,
-0.27465805411338806,
0.927661657333374,
-0.39169594645500183,
0.10596952587366104,
0.08876320719718933,
0.4210304617881775,
-0.2490473836660385,
-0.003784382017329335,
-0.5105835795402527,
-0.5286064743995667,
0.6738837361335754,
-0.3562026917934418,
-0.04179041460156... | |
End If
Text = Text.Substring(1)
End While
Return indent
End Function
```
I edited this post to add the UndoContext mechanism (suggested by Nicolas Dorier) at the beginning of the MoveLineUp() and MoveLineDown() methods and closing it at their end.
11/23/11 - I updated this again to allow the moved lin... | [
-0.29714396595954895,
0.014006171375513077,
0.711010754108429,
-0.3323378264904022,
0.012953649275004864,
0.045896608382463455,
0.10536085069179535,
-0.29386359453201294,
-0.07740943878889084,
-0.390717089176178,
-0.4713459014892578,
0.09722548723220825,
-0.4708084464073181,
0.007180456072... | |
I am a Winforms and business engine developer who is using asp.net for the first time in over 2 years, and in that time I have noticed a few convention changes.
What is the logic behind the anti-'tables for layout' movement?
Is it to allow css classes to be used to handle layout, and if so, should this really be an i... | [
0.5112112760543823,
0.14137953519821167,
0.13487963378429413,
0.07414650917053223,
-0.31513041257858276,
-0.3909168839454651,
0.21190352737903595,
0.3380051553249359,
-0.44412392377853394,
-0.8047866225242615,
0.24817678332328796,
0.2972586154937744,
-0.2157408893108368,
0.2145111709833145... | |
So if you need to, put a little table in there. It won't kill you.
* The major "evil" of table-based layouts was the kind of deeply-nested mess that used to be the only way to get precise control over the page. You would have tables within tables within tables, and transparent images strategically placed to control spa... | [
0.558784544467926,
0.08909817039966583,
0.1914270967245102,
0.3427341878414154,
0.09184356033802032,
-0.26894402503967285,
0.2368713617324829,
0.2567550241947174,
-0.680586576461792,
-0.7055054306983948,
-0.07363282889127731,
0.17280857264995575,
-0.38984161615371704,
-0.030197978019714355... | |
version of HTML doesn't go very far toward reaching it. As a result, you will ALWAYS have plenty of tags in your pages that are just there for layout, with no other meaning. That doesn't mean you shouldn't try to separate content and layout as much as possible; it just means you won't get there 100%. | [
0.2914064824581146,
-0.2794203758239746,
0.7189532518386841,
0.1118096262216568,
-0.29466915130615234,
-0.578626811504364,
0.5165908336639404,
0.38027477264404297,
-0.4042440354824066,
-0.8667381405830383,
-0.10345382988452911,
-0.1975831836462021,
-0.36839771270751953,
-0.13167804479599,
... | |
It's been awhile since my algorithms class in school, so forgive me if my terminology is not exact.
I have a series of actions that, when run, produces some desired state (it's basically a set of steps to reproduce a bug, but that doesn't matter for the sake of this question).
My goal is to find the shortest series... | [
0.20830972492694855,
0.05802358314394951,
0.047045137733221054,
-0.019251596182584763,
0.21414415538311005,
0.49386170506477356,
0.5972208976745605,
-0.12136621028184891,
-0.3770345151424408,
-0.7097613215446472,
0.08687548339366913,
0.17291490733623505,
-0.12752936780452728,
0.12970837950... | |
The naive approach I'm taking is to take the entire series and try removing each action. If I successfully can remove one action (without altering the final state), I start back at the beginning of the series. This should be O(n^2) in the worst case.
I'm starting to play around with ways to make this more efficient, b... | [
0.03358075022697449,
-0.12903152406215668,
0.2815687954425812,
-0.14248120784759521,
-0.09344177693128586,
0.2929079234600067,
0.3603527545928955,
-0.11784140020608902,
-0.3161207437515259,
-0.6840043067932129,
-0.167953759431839,
-0.04285307228565216,
-0.30864429473876953,
0.3382323384284... | |
helpful.
Update: Several people have pointed out that even my naive algorithm won't find the shortest solution. This is a good point, so let me revise my question slightly: any ideas about approximate algorithms for the same problem? I'd rather have a short solution that's near the shortest solution quickly than take ... | [
0.06538551300764084,
-0.20139330625534058,
0.08479586988687515,
0.3247929811477661,
-0.1044037863612175,
-0.09670478850603104,
0.32278019189834595,
0.25893884897232056,
-0.14893624186515808,
-0.7993062734603882,
0.038979288190603256,
0.6372268199920654,
0.009700915776193142,
-0.05883148312... | |
have to look at all subsets", but anyway...)
For example, suppose you are currently running steps 12345, and you start trying to remove each of them individually. Then you might find that you can't remove 1, you can remove 2 (so you remove it), then you look at 1345 and find that each of them is essential -- none can ... | [
0.25607383251190186,
-0.1967039257287979,
-0.1593111753463745,
-0.08414643257856369,
0.06782610714435577,
-0.0268874354660511,
0.38792532682418823,
-1.0400670766830444,
-0.47063779830932617,
-0.571244478225708,
-0.42872729897499084,
0.40591853857040405,
-0.37638214230537415,
-0.11963935196... | |
of actions work, then so will any superset), then you can prove that there is no way of finding the shortest sequence without looking at all subsets. | [
-0.2341432273387909,
-0.17541125416755676,
-0.08847618848085403,
-0.04472202807664871,
-0.1039363369345665,
0.265676885843277,
0.7009294629096985,
-0.4752049148082733,
-0.39367517828941345,
-0.7221872806549072,
-0.272483229637146,
0.20562627911567688,
-0.6910393834114075,
-0.02626060694456... | |
Is it possible to write a user interface in Java for an application written in C#?
I am working on a user interface of a project that is written in C#, but I have no experience with C# and I am an avid Java user. Is it possible to build the user interface in Java using Java's Swing and AWT libraries that operates an a... | [
0.340760737657547,
0.15844780206680298,
-0.021966474130749702,
0.025366241112351418,
0.2432277500629425,
0.05424318090081215,
0.3149943947792053,
0.13908210396766663,
-0.28959062695503235,
-0.30478912591934204,
0.3826676607131958,
0.9207162857055664,
-0.10675124078989029,
-0.12541776895523... | |
.NET platform. Currently it supports .Net 3.5 only (not Mono). | [
0.22840046882629395,
-0.08540791273117065,
0.18596617877483368,
-0.013659542426466942,
-0.13921791315078735,
-0.2778246998786926,
0.3217729330062866,
0.2021537870168686,
-0.07624989002943039,
-0.5482831001281738,
-0.3294083774089813,
0.4925158619880676,
-0.40385228395462036,
0.313298612833... | |
Does anyone have a Powershell script to change the credentials used by a Windows service?
Bit easier - use WMI.
```
$service = gwmi win32_service -computer [computername] -filter "name='whatever'"
$service.change($null,$null,$null,$null,$null,$null,$null,"P@ssw0rd")
```
Change the service name appropriately in the f... | [
0.03836590051651001,
0.10559450089931488,
0.2712503969669342,
-0.08170238882303238,
0.17062121629714966,
-0.15847407281398773,
0.5350697040557861,
-0.012488694861531258,
-0.1527237743139267,
-0.8678821325302124,
-0.2564506232738495,
0.6403462886810303,
-0.40443578362464905,
0.2222259938716... | |
How can I differentiate a Workflow system from a normal application that automates some work? Are there any specific feature a system must have to be categorized as a workflow system?
Workflow systems manage objects (often logically or actual electronic replacements for documents) that have an associated state. The sta... | [
-0.011439747177064419,
-0.24279460310935974,
0.10096599161624908,
0.32951122522354126,
0.17023321986198425,
0.13894106447696686,
0.326565146446228,
0.07420902699232101,
-0.2529962360858917,
-0.7804734706878662,
-0.274614155292511,
-0.03940523415803909,
-0.2537105083465576,
0.41074484586715... | |
so consider an example: bug tracking software. A bug report probably starts out unvalidated, and as such is in a QA tester's queue. The QA tester will validate the report and make sure the steps are clear, grade the report for severity etc., and assign it to a developer or developer group. It is then in the developer's... | [
0.4670908451080322,
-0.018250850960612297,
0.021729685366153717,
0.1884976029396057,
0.1725607067346573,
-0.14506074786186218,
0.10398276150226593,
-0.13860487937927246,
-0.1626511961221695,
-0.44470468163490295,
-0.40274783968925476,
0.3725091814994812,
-0.11096377670764923,
0.09681165218... | |
trivial implementation of the above is to use an enumeration for the state associated with every object, and make everybody's inbox be a query for objects with a state of a particular enumeration value.
That's the gist of it, but things can get more complex, such as splitting off new objects, reacting to non-human eve... | [
0.14379198849201202,
-0.10604635626077652,
-0.29345786571502686,
0.3652968108654022,
0.011903628706932068,
-0.2561561167240143,
0.3383389413356781,
0.05360035598278046,
-0.23555469512939453,
-0.3815942704677582,
-0.1518567055463791,
0.1919063776731491,
-0.430976927280426,
0.012569853104650... | |
Is there a way to set "work offline" in TFS without having to try opening a solution, waiting for it to time out, and then having Visual Studio work out that it has failed?
It seems a touch ridiculous that I can't just tick a box to tell it myself, seeing as I'm probably the one most qualified to know when I'm not in ... | [
0.20022471249103546,
0.06006169691681862,
0.26070860028266907,
0.05753275007009506,
0.16450649499893188,
0.004382050130516291,
0.2758658826351166,
-0.3973627984523773,
-0.25757381319999695,
-0.684485912322998,
-0.22265757620334625,
0.5298126339912415,
-0.09632507711648941,
-0.2651572823524... | |
configuration of how and when the client connects to a
Team Foundation Server. This includes client certificates, auto
reconnect, offline, compression, maximum connections, timeouts,
and bypassing the proxy.
``` | [
-0.005795561708509922,
0.03143440932035446,
0.10658828914165497,
0.3009198009967804,
0.3748617470264435,
-0.07043047994375229,
0.11121466010808945,
-0.04790845513343811,
-0.10522319376468658,
-0.8926210999488831,
-0.3719806373119354,
0.27157366275787354,
-0.07570415735244751,
-0.2479600459... | |
We have two branches:
1. HEAD - the latest version (AKA Trunc)
2. PROD - the released version
When you fix bugs in the released version, which of these do you do:
1. Fix it in PROD, then merge to HEAD
2. Fix it in HEAD, then merge to PROD
The advantage of (1) is that this way you absolutely cannot harm the released ... | [
0.43207594752311707,
-0.24427852034568787,
0.5358743071556091,
0.018693620339035988,
0.23893681168556213,
-0.21810078620910645,
0.060756389051675797,
-0.24034585058689117,
-0.06279179453849792,
-0.47529682517051697,
-0.24413898587226868,
0.660698413848877,
-0.24827565252780914,
-0.30874958... | |
you fix only in PROD you might not find all such usages and so slip bugs into HEAD.
I'm personally for (1). What do you think?
Bug fixes should be applied to the branch and merged to the the main line of development. You need to do this to avoid bringing new features into a production release that are not intended to ... | [
0.5933375954627991,
-0.18053241074085236,
0.12669846415519714,
0.10888601094484329,
0.12093531340360641,
0.10297413915395737,
-0.05557526275515556,
0.18420308828353882,
-0.2967316508293152,
-0.5227903127670288,
-0.01646391488611698,
0.8507906198501587,
-0.3041011095046997,
-0.1081542149186... | |
For a certain inputform, I'd like to make it possible to do input with the keyboard. I know how to read the keys through KeyPressed and KeyUp, but the problem is that when a control has got the focus and the user presses the Enter key, that control receives the a Click event. Is it possible to prevent that behaviour ? ... | [
-0.06330754607915878,
-0.2508160471916199,
0.39926958084106445,
-0.05388890206813812,
0.06958090513944626,
-0.06502033025026321,
0.2182660698890686,
-0.19357362389564514,
-0.26597049832344055,
-0.39941927790641785,
-0.2938830256462097,
0.6136168241500854,
-0.2402983456850052,
0.03660789504... | |
I have a incoming stream of bytes (unsigned char) from either a file or network. I need this data placed in a class, and is looking for a NET-way of doing this.
I bet some does this all the time, so I guess there is a better method to do this than using BitConverter.
I realize I supplied too litle information. Let ... | [
0.2817078232765198,
-0.11200208961963654,
0.3184655010700226,
0.04529895633459091,
0.08858592063188553,
0.2172228991985321,
0.06891603767871857,
-0.1333773285150528,
0.001509236404672265,
-0.7069251537322998,
-0.05454755574464798,
0.5679922699928284,
-0.22593562304973602,
0.399120599031448... | |
data on the other end
As Jon mentioned, it's not clear, what you need. Maybe you are talking about maybe it is [Binary serialization](http://msdn.microsoft.com/en-us/library/72hyey7b(VS.71).aspx) what you are looking for? | [
0.2567107379436493,
-0.19810989499092102,
0.06057136878371239,
0.4076268672943115,
0.32879313826560974,
-0.293613463640213,
0.07020282745361328,
0.563358724117279,
-0.47543567419052124,
-0.4390643239021301,
-0.12013714760541916,
0.2143058031797409,
-0.4164485037326813,
-0.05129404738545418... | |
I am working on localization for an app where custom patterns are used to format the date-time.
one example is:
dd-MM HH:mm
I need to get localized versions of this custom format for dates, so that I get the date using numbers, and the time, basically using the local order (dd MM or MM dd) and the local seperator fo... | [
0.5322518944740295,
0.15782736241817474,
0.5750936269760132,
0.11358475685119629,
-0.251171350479126,
-0.1132344976067543,
0.1427067518234253,
0.2477538138628006,
-0.31898146867752075,
-0.7921327352523804,
-0.1554187536239624,
0.151786208152771,
-0.16246770322322845,
0.26955902576446533,
... | |
DateTime.ToString("ES-es"), I get too much info - I need only month+day, but with the default ToString, I get year+month+day
Edit again:
I see how I can change the ShortDate pattern for each CultureInfo object I use. However, I also need the default ShortDate pattern in some situations, so changing that would, unfortu... | [
0.1313726156949997,
-0.10191959142684937,
0.8146244883537292,
0.032992586493492126,
0.16306625306606293,
0.0047246129252016544,
0.1623348593711853,
0.01189629640430212,
-0.03680599853396416,
-0.7770073413848877,
-0.11872909218072891,
0.2246570736169815,
-0.18601368367671967,
0.207042142748... | |
ShortDatePattern. | [
0.12769190967082977,
-0.6253860592842102,
0.11456697434186935,
-0.04272844269871712,
-0.34645792841911316,
0.0655805692076683,
0.07665911316871643,
0.3311026394367218,
-0.25230875611305237,
-0.15613067150115967,
0.07677123695611954,
0.08621882647275925,
-0.062455836683511734,
-0.1800568848... | |
I want to redirect from an action in one controller to an action in a second controller. Normally I would use RedirectToAction("actionName", "controllerName", objects);
The method I want to redirect to has two overloads:
* One for HttpVerbs.Get that is used for direct linking
* One for HttpVerbs.Post accepting referen... | [
-0.11338377743959427,
-0.6950330138206482,
0.523960530757904,
0.2860508859157562,
-0.22372761368751526,
0.14581219851970673,
0.26574739813804626,
-0.28381288051605225,
-0.4592285454273224,
-0.6283286809921265,
0.04016627371311188,
0.46918538212776184,
-0.6080462336540222,
0.064222924411296... | |
I want to redirect to fills the viewData based on the parameters and then calls the correct view.
```
public ActionResult OverView(SearchBag searchBag, IngredientBag ingredientBag) {
```
It has a second version for Gets so it can work by GET too:
```
[AcceptVerbs(HttpVerbs.Get)]
public ActionResult OverView(int col... | [
-0.2775759696960449,
-0.6206327676773071,
0.7235237956047058,
-0.28432562947273254,
-0.17613911628723145,
0.21573872864246368,
0.0912342518568039,
-0.3242020308971405,
-0.22429686784744263,
-0.7469663023948669,
-0.006498824805021286,
0.6478955149650574,
-0.49368569254875183,
-0.25476244091... | |
pre-calculations, fetches the information needed and then does the exact same thing as the previous actions. I could replicate the code from the first action, but I would rather just call that action.
```
[AcceptVerbs(HttpVerbs.Post)]
public RedirectToRouteResult ReCalculate(SearchBag searchBag, IngredientBag ingredie... | [
-0.05771353095769882,
-0.3059765696525574,
0.5436331033706665,
0.1379275918006897,
-0.08871057629585266,
-0.04974011331796646,
0.3791942596435547,
-0.2781827449798584,
-0.25489917397499084,
-0.8263699412345886,
0.03235531970858574,
0.5717903971672058,
-0.5518986582756042,
-0.07287766784429... | |
details about the target action that you would like to redirect the user to we can provide better answers for you. Please update your question with the signature of the target action and details on what you want to provide as parameter values so people can provide decent guidance.
I'm guessing what you want to do is t... | [
0.24140208959579468,
-0.3140913248062134,
0.40409332513809204,
0.16674108803272247,
-0.2441261261701584,
0.040824923664331436,
0.22266504168510437,
-0.2083340585231781,
-0.0968150794506073,
-0.4434720575809479,
-0.0661751925945282,
0.4308718740940094,
-0.27331939339637756,
-0.3704171180725... | |
We host the .NET runtime as part of a Win32 program, and lately it has begun to consistently break at a specific address, in mscorwks.dll.
At the specified address, there is a 0xCC byte, which is a INT 3 instruction, which fires the debugger.
Has anyone else seen this?
I can't see enough information in the dll to kn... | [
0.032196901738643646,
0.13026943802833557,
0.49198463559150696,
0.05820418894290924,
0.05758339539170265,
-0.40999940037727356,
0.5502405762672424,
-0.14346376061439514,
-0.06530141085386276,
-0.8351374864578247,
-0.478903204202652,
0.542100191116333,
-0.5094857811927795,
0.163854807615280... | |
+ 0x5f
:7e42ce7c USER32.SetLayeredWindowAttributes + 0x6a
```
The address it fails on is 0x7A04F029, disassembly in memory looks like this:
```
7A04F020 call $7a14be35
7A04F025 cmp [esi],ebx
7A04F027 jz $7a04f02a
7A04F029 int 3 <-- here's the culprit
7A04F02A mov byte ptr [ebp-$04],$02
7A04F02E ... | [
-0.22477035224437714,
0.5389299392700195,
0.3545774817466736,
-0.08348022401332855,
0.3251899182796478,
0.10789913684129715,
0.6698817610740662,
-0.07563383877277374,
-0.2408304661512375,
-0.4333077371120453,
-0.24685096740722656,
0.701282262802124,
-0.31416207551956177,
0.2322234362363815... | |
itself, but I'm not sure that's a good idea either. I've verified that the CC byte is part of the dll, found the surrounding byte pattern with a hex editor.
Any tips on how to fix this? Anyone else seen this?
Solved
------
As mentioned in the answers, this was a LoaderLock problem. A DLL that was built in Win32 need... | [
0.2978479564189911,
0.07909708470106125,
0.07316279411315918,
0.26246073842048645,
-0.09714504331350327,
-0.38850781321525574,
0.13152079284191132,
0.09761282801628113,
-0.40378034114837646,
-0.17426703870296478,
0.12602218985557556,
0.5053929686546326,
-0.3129590153694153,
0.2014120817184... | |
added lots and lots of code that was useful in an application, but not for this DLL.
Separating out the functions I needed reduced the size of the DLL from 7MB to around 100KB and got rid of the LoaderLock as well.
There's a discussion about a similar problem [here](http://social.msdn.microsoft.com/forums/en-US/netfxb... | [
-0.17134343087673187,
-0.3764476180076599,
0.478041410446167,
-0.0033317534253001213,
-0.5459699630737305,
-0.16047978401184082,
0.442903995513916,
-0.005004154052585363,
-0.7319945693016052,
-0.5916303396224976,
0.16448162496089935,
0.3611757159233093,
-0.4374648332595825,
0.2761475145816... | |
How do you modify a propertygrid at runtime in every way? I want to be able to add and remove properties and add "dynamic types", what I mean with that is a type that result in a runtime generated dropdown in the propertygrid using a TypeConverter.
I have actually been able to do both those things (add/remove properti... | [
0.2920469641685486,
-0.08274251222610474,
0.25469112396240234,
-0.06928595155477524,
-0.08760111033916473,
-0.11674609780311584,
0.1600220799446106,
-0.26815298199653625,
-0.26756662130355835,
-0.5292588472366333,
-0.05136512219905853,
0.6708639860153198,
-0.3570147156715393,
0.28723493218... | |
myProperties = new CustomClass();
public Form1()
{
InitializeComponent();
myProperties.Add(new CustomProperty("Name", "Sven", typeof(string), false, true));
myProperties.Add(new CustomProperty("MyBool", "True", typeof(bool), false, true));
myProperties.Add(new CustomProperty("CaptionPosition", "Top", ... | [
0.08128419518470764,
-0.1480361372232437,
0.9370593428611755,
-0.021657394245266914,
0.38259434700012207,
0.4772826135158539,
0.21457244455814362,
-0.4527416527271271,
-0.3606454133987427,
-0.3159770369529724,
-0.5026958584785461,
0.5930152535438538,
-0.22615773975849152,
0.166582733392715... | |
base.List.Add(Value);
}
/// <summary>
/// Remove item from List
/// </summary>
/// <param name="Name"></param>
public void Remove(string Name)
{
foreach(CustomProperty prop in base.List)
{
if(prop.Name == Name)
{ | [
0.12378969043493271,
-0.21769197285175323,
0.41683465242385864,
-0.23477758467197418,
0.06050771102309227,
0.45139166712760925,
0.2645763158798218,
-0.7268713712692261,
-0.3132234811782837,
-0.007251134607940912,
-0.45375779271125793,
0.44144952297210693,
-0.4552060067653656,
0.20967990159... | |
base.List.Remove(prop);
return;
}
}
}
```
etc...
```
public enum CaptionPosition
{
Top,
Left
}
```
My complete solution can be downloaded [here](http://helgo.net/salle/misc/PropertyGrid_2005.zip).
It works fine when I add strings, bools or enums, but when I try to a... | [
0.1312505453824997,
-0.1567581593990326,
0.5495610237121582,
0.0035042420495301485,
0.24177908897399902,
-0.0890408307313919,
0.4858740270137787,
-0.2950403690338135,
-0.2351878434419632,
-0.6152253150939941,
-0.17760321497917175,
0.5404974222183228,
-0.3127385973930359,
0.1265164762735366... | |
private string[] _States = { "Alabama", "Alaska", "Arizona", "Arkansas" };
public override System.ComponentModel.TypeConverter.StandardValuesCollection
GetStandardValues(ITypeDescriptorContext context)
{
return new StandardValuesCollection(_States);
}
public override bool GetStandardValues... | [
0.37281909584999084,
0.0646752193570137,
0.3246130645275116,
0.03374185413122177,
0.3449772894382477,
-0.09422869235277176,
0.6766902208328247,
-0.3685198426246643,
-0.13705351948738098,
-0.2533129155635834,
-0.36777475476264954,
0.5186761617660522,
-0.5472824573516846,
0.3575516641139984,... | |
try to add the property at runtime, for example [this code](http://www.megasolutions.net/cSharp/PropertyGrid-dynamic-Dropdown-List-4124.aspx) works without any problem, but I want to be able to do both.
Please take a look at [my project](http://helgo.net/salle/misc/PropertyGrid_2005.zip).
Thanks!
What you do, is addin... | [
0.32542526721954346,
-0.10517618060112,
0.19309872388839722,
0.07299381494522095,
0.06539961695671082,
-0.5229473114013672,
0.2636394500732422,
-0.06854570657014847,
-0.41111287474632263,
-0.7924084663391113,
-0.007677433080971241,
0.5267136693000793,
-0.18780988454818726,
0.11050141602754... | |
How to find and remove unused Delphi runtime packages from a project that uses packages?
I have a Delphi project that is made up of several packages, in the requires part of the packages there are several Borland/3rd party packages listed (rtl.dcp, vcl.dcp ect) I know I need most of them, but there are ones I know I d... | [
0.22037747502326965,
0.03259281441569328,
-0.15988095104694366,
0.23453395068645477,
0.19544850289821625,
-0.31768566370010376,
0.15556415915489197,
-0.34326258301734924,
-0.20791643857955933,
-0.465260773897171,
-0.03354215994477272,
0.5768073201179504,
-0.24914045631885529,
-0.1714183688... | |
are not needed will they still need to be distributed with the final application or have any impact on the size/ memory requirement of the app?
I am trying to make it all as streamline as possible.
If you specify a package to be used as runime package, all the packages that package requires need to be deployed as runt... | [
0.4331018328666687,
-0.08577553182840347,
0.3074473440647125,
-0.04377393797039986,
0.21013742685317993,
-0.44541046023368835,
0.07294288277626038,
-0.15834936499595642,
-0.01734950579702854,
-0.7767688632011414,
-0.6273102760314941,
0.8110657930374146,
-0.5531097650527954,
-0.344987958669... | |
are sure of you need and the rest will be added by the compiler. Then you only need to check what packages you need to deploy in the end. | [
0.5738328099250793,
0.0018270110012963414,
0.08240590244531631,
0.2799105942249298,
0.43112796545028687,
-0.2628708779811859,
-0.23930242657661438,
-0.0692446306347847,
0.1202072724699974,
-0.6417834758758545,
-0.16656704246997833,
0.7503807544708252,
0.012364721857011318,
-0.4682531356811... | |
I have a space delimited list of files names, where spaces in the file names are prefixed by '\'
e.g. "first\ file second\ file"
How can I get my regex to match each file name?
```
(\\ |[^ ])+
```
Everything except spaces, except when they're escaped. Should work, sorry for misunderstanding your question initially. | [
-0.05561312288045883,
0.11454232782125473,
0.3044118881225586,
0.16746041178703308,
0.21375970542430878,
0.08983395248651505,
-0.04513339698314667,
-0.024612661451101303,
-0.14585837721824646,
-0.660385012626648,
-0.22901207208633423,
0.34793561697006226,
-0.28251251578330994,
0.1978937983... | |
I need to get execution time in milliseconds.
> I originally asked this question back in 2008. The accepted answer then was to use [`new Date().getTime()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) However, we can all agree now that using the standard [`performance.... | [
0.17797183990478516,
0.1322997361421585,
0.7030541896820068,
-0.2635262608528137,
0.08860308676958084,
-0.05862821638584137,
0.3204582631587982,
-0.6220691800117493,
0.0330156609416008,
-0.8259513974189758,
-0.12528350949287415,
0.7409240007400513,
0.24730634689331055,
-0.01282231230288744... | |
you're measuring time for
console.timeEnd('doSomething')
```
***Note:***
The string being passed to the `time()` and `timeEnd()` methods must match
(*for the timer to finish as expected*).
> ### `console.time()` documentations:
>
>
> * [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/API/Con... | [
0.2945243716239929,
-0.11980295926332474,
0.5495981574058533,
0.08771880716085434,
0.41508156061172485,
-0.1331644356250763,
0.14533434808254242,
-0.4238365590572357,
-0.08865609019994736,
-0.9686586260795593,
0.10348916053771973,
0.4966984987258911,
0.12421981245279312,
0.1414872854948043... | |
Using ICU 4.0 regex library, I find that the following regex is exhibiting exponential time:
```
actual: "[^<]*<\?"
C code: "[^<]*<\\?"
```
Aim: find "<?" where there is no other "<" before it
When running this regex on plain text with no "<" characters at all it appears to take exponential time. If the text has at... | [
-0.21239638328552246,
0.01047633495181799,
0.45155972242355347,
0.03157943859696388,
0.12076810002326965,
0.11423359811306,
0.3756110370159149,
-0.2658034563064575,
-0.08048469573259354,
-0.6607829928398132,
0.09448690712451935,
0.7703299522399902,
-0.4723943769931793,
0.07244525104761124,... | |
a "<" then it would give up because the pattern obviously can't match.
Is this a bug in the ICU regex or is it expected?
You will find an explanation at [Regular Expression Matching Can Be Simple And Fast](http://swtch.com/~rsc/regexp/regexp1.html "Regular Expression Matching Can Be Simple And Fast (but is slow in Ja... | [
-0.1392422467470169,
-0.18477791547775269,
0.4411104619503021,
-0.030388327315449715,
-0.04503832757472992,
0.03439389169216156,
0.32270359992980957,
-0.02484806254506111,
0.05862416326999664,
-0.697166383266449,
-0.37370648980140686,
0.7153652906417847,
-0.49178072810173035,
-0.1428039819... | |
I'm currently using the following SQL for retrieving the last seven days worth of entries from a table:
```
purchased >= date_sub(now() ,interval 7 day)
```
However, I need to change this so it retrieves the last full weeks worth of entries (midnight Saturday to midnight Saturday). So basically, throughout the week ... | [
0.31043121218681335,
0.30292993783950806,
0.5383086800575256,
-0.00750210415571928,
0.13291089236736298,
-0.07037162780761719,
0.377614289522171,
0.0895267128944397,
-0.4384823143482208,
-0.4591430127620697,
0.1796993762254715,
0.40405210852622986,
0.06748133897781372,
0.3797776699066162,
... | |
[YEARWEEK()](http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_yearweek).
So you could do something like
```
SELECT * FROM table WHERE YEARWEEK(purchased) = YEARWEEK(NOW());
```
You can change the starting day of the week by using a second mode parameter
What might be better however is ... | [
0.13149352371692657,
-0.11526013910770416,
0.7899914383888245,
-0.013351349160075188,
-0.02933569811284542,
0.13037815690040588,
-0.1751212626695633,
0.15110482275485992,
-0.3824197053909302,
-0.30193594098091125,
0.05406371131539345,
0.5930740833282471,
0.025468694046139717,
0.29124069213... | |
This is a contrived example, but lets say I have declared objects:
```
CustomObj fooObj;
CustomObj barObj;
CustomObj bazObj;
```
And I have an string array:
```
string[] stringarray = new string[] {"foo","bar","baz"};
```
How can I programmatically access and instantiate those objects using the string array, iter... | [
-0.08026926964521408,
0.17515474557876587,
0.4249573051929474,
-0.3264766037464142,
-0.10949712991714478,
0.062233731150627136,
0.21316088736057281,
-0.26755762100219727,
-0.30491748452186584,
-0.45384639501571655,
-0.23493970930576324,
0.696793794631958,
-0.4201613962650299,
0.12099504470... | |
via an execution-time-determined name except via reflection.
It sounds like you *really* just want a `Dictionary<string, CustomObj>`:
```
Dictionary<string, CustomObj> map = new Dictionary<string, CustomObj>();
foreach (string name in stringArray)
{
map[name] = new CustomObj(name);
}
```
You can then access th... | [
0.017489485442638397,
-0.3149837553501129,
0.34382230043411255,
-0.05322766676545143,
-0.07685606181621552,
0.010975857265293598,
0.3127364218235016,
-0.2673891484737396,
-0.3321019411087036,
-0.6693274974822998,
-0.1154056042432785,
0.7239987254142761,
-0.3148583173751831,
0.0178207959979... | |
I have a function which searches an STL container then returns the iterator when it finds the position, however I am getting some funny error messages, can tell me what I am doing wrong?
Function:
```
std::vector< CClass >::iterator CClass::SearchFunction( const std::string& strField )
{
...
return it;
...
}
``... | [
-0.21523065865039825,
0.13159698247909546,
0.5316580533981323,
-0.042911071330308914,
0.06493856757879257,
0.15095004439353943,
0.13723696768283844,
-0.15988551080226898,
-0.1056167483329773,
-0.6811577677726746,
-0.10667739808559418,
0.4388311803340912,
-0.4085708260536194,
0.404627561569... | |
through the iterator.
EDIT: after seeing your update, it seems the problem is your iterator (it) has a different type than your function return. They should be the same.
```
std::vector< CClass >::iterator it;
``` | [
-0.13284781575202942,
-0.13715511560440063,
0.6247674226760864,
-0.051940351724624634,
-0.0032369294203817844,
0.0631466880440712,
0.018467405810952187,
0.062062472105026245,
-0.15932856500148773,
-0.6432325839996338,
-0.3523816764354706,
0.7792069911956787,
-0.43919825553894043,
0.1569360... | |
I know questions of this kind [have](https://stackoverflow.com/questions/24298/best-solution-for-authentication-in-ruby-on-rails) [been](https://stackoverflow.com/questions/13254/open-id-authentication-in-ruby-on-rails) [asked](https://stackoverflow.com/questions/38901/strange-rails-authentication-issue) before, but my... | [
-0.05430152639746666,
0.2657252848148346,
0.28258028626441956,
0.04403187707066536,
-0.0293682012706995,
-0.15995800495147705,
0.2907157838344574,
-0.34090274572372437,
-0.049736879765987396,
-0.39898180961608887,
-0.06869406253099442,
0.3051968514919281,
-0.139260396361351,
0.167596146464... | |
of stuffs on authentication/authorization plugins
<http://metautonomo.us/2008/09/30/easy-role-based-authorization/> | [
-0.041917260736227036,
-0.13711145520210266,
0.1989019513130188,
0.34403732419013977,
0.5630404949188232,
-0.26830753684043884,
-0.017923172563314438,
-0.21950046718120575,
-0.16155685484409332,
-0.2822750210762024,
-0.01729872263967991,
0.9044596552848816,
-0.3298790454864502,
-0.66513741... | |
**Is there a way that I can configure Visual Studio 2008 to understand CamelCase?** Specifically, I'd like to be able to get `Ctrl + right` or `left` cursor to take me to a subsection of a variable or type name.
i.e., if my cursor was at the start of this line:
```cs
LongNamedExampleClass longNamed = new LongNamedExa... | [
-0.1395445168018341,
-0.19234143197536469,
0.31217703223228455,
-0.04093572869896889,
-0.26832059025764465,
-0.06614591181278229,
0.10322095453739166,
0.21913400292396545,
-0.157114639878273,
-0.5938050746917725,
0.1359845995903015,
0.6145305633544922,
-0.12742359936237335,
0.0392208024859... | |
a lot, and find it difficult to unlearn something so ingrained.
Thanks to those who suggested Resharper. This gives me another reason to love it even more. Just to be specific about where this lives - JetBrains call it [**CamelHumps**](http://www.jetbrains.com/resharper/features/navigation_search.html#CamelHumps) (cute... | [
-0.07036660611629486,
-0.4286852180957794,
0.5807446241378784,
0.2983541786670685,
0.11660131812095642,
-0.21351851522922516,
-0.06478621810674667,
0.3532904386520386,
-0.1515389233827591,
-0.7991942167282104,
-0.26864928007125854,
0.848402738571167,
-0.1909288614988327,
-0.149899140000343... | |
How can I make this java generic cast ?
```
public interface IField {
}
class Field implements IField { // package private class
}
public class Form {
private List<Field> fields;
public List<IField> getFields() {
return this.fields;
}
}
```
The return statement throws a compiler error (I know the re... | [
0.4336090385913849,
0.11714626848697662,
0.010910679586231709,
-0.06746193766593933,
-0.3666260242462158,
-0.12620526552200317,
0.5373810529708862,
-0.6821558475494385,
-0.005635635461658239,
-0.5695160031318665,
0.13305483758449554,
0.4276733100414276,
-0.6964107751846313,
0.1035713106393... | |
that return statement ?
Thanks in advance.
A better solution, IMO, is to change the signature of your method to use a bounded wildcard:
```
public List<? extends IField> getFields()
```
This will let the caller treat anything coming "out" of the list as an IField, but it won't let the caller add anything into the l... | [
0.11052162945270538,
-0.20057997107505798,
0.31296834349632263,
-0.02548857405781746,
-0.01585363782942295,
-0.2779844105243683,
0.07852364331483841,
-0.38275137543678284,
-0.10479982197284698,
-0.3602082431316376,
-0.16846361756324768,
0.4699203670024872,
-0.5077793002128601,
-0.076831951... | |
I have to work on several VB6 legacy projects and despite some good VB6 plugins (CodeSMART for example) I hate the IDE more and more, especially now where I have the opportunity to work with Java/Netbeans on a new project. Unfortunatly it will stay that way at least the next few years.
So I'm asking myself: Can the Ne... | [
0.4740849733352661,
0.28738218545913696,
0.14600011706352234,
-0.30559080839157104,
-0.1337098926305771,
-0.45384079217910767,
0.4838925004005432,
0.15755249559879303,
-0.3965487778186798,
-0.6455057859420776,
0.003735510166734457,
0.4263868033885956,
-0.21324512362480164,
0.56588560342788... | |
explicit` for example")
* Code generators (like in Java for getters and setters)
* Integrated debugging (But I assume this is virtually impossible)
* Auto-formatting of code
Can it be done? Has someone experience with Netbeans and a custom language? What's the best way to start?
EDIT: I want to do this myself as I'm ... | [
0.46858999133110046,
0.10639077425003052,
-0.06344807893037796,
0.03681160882115364,
-0.2397007793188095,
-0.21851742267608643,
0.5181245803833008,
-0.25197088718414307,
-0.13034096360206604,
-0.5387496948242188,
-0.10117164254188538,
0.9891855716705322,
-0.3626754581928253,
-0.40074983239... | |
to take a look at [Schliemann - Easy Integration of Scripting Languages in NetBeans IDE 6.0](http://www.netbeans.org/community/magazine/html/03/schliemann/). This article provides information on how langauge support works in Netbeans 6 along with a how-to on adding new languages.
You may also want to check out the [Ge... | [
0.114505335688591,
0.15477199852466583,
0.24690216779708862,
0.06542988121509552,
-0.10482849180698395,
-0.2637486755847931,
0.3882458508014679,
-0.11654680967330933,
-0.20074187219142914,
-0.3048229217529297,
-0.4333415925502777,
0.4970618486404419,
-0.3819641172885895,
-0.212395012378692... | |
may come handy on your quest:
* [Contributing Modules](http://www.netbeans.org/community/contribute/modules.html) - First, check to be sure that there are no other plugins that will suite your needs.
* [NetBeans Plugin Quick Start](http://platform.netbeans.org/tutorials/60/nbm-google.html) - Introduction to adding fea... | [
0.22526802122592926,
-0.019421668723225594,
0.31927433609962463,
0.02060887962579727,
0.03168870881199837,
-0.44758886098861694,
0.6337801218032837,
0.18554556369781494,
-0.25960999727249146,
-0.6985275149345398,
-0.5822482109069824,
0.22709941864013672,
-0.008523952215909958,
-0.160188779... | |
Consider the following use of template template parameters...
```
#include <iostream>
template <typename X>
class A
{
X _t;
public:
A(X t)
:_t(t)
{
}
X GetValue()
{
return _t;
}
};
template <typename T, template <typename T> class C >
class B
{
C<T> _c;
public:
B(T... | [
0.08743897825479507,
-0.290407657623291,
0.10862188041210175,
-0.18544892966747284,
0.26531729102134705,
0.07732941210269928,
0.27421584725379944,
-0.376057893037796,
-0.036654457449913025,
-0.5583117604255676,
-0.4611878991127014,
0.7767565250396729,
-0.6178317666053772,
-0.17994704842567... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.