text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
Dim UrlEncoded As New System.Text.StringBuilder
Dim reserved() As Char = {ChrW(63), ChrW(61), ChrW(38)}
urlWebRequest.Expect = Nothing
If (strMethod = "POST") Then
If objBody <> Nothing Then
Dim intICounter As Integer = 0 | [
0.1545509397983551,
-0.36017128825187683,
0.7202197313308716,
-0.4095456600189209,
-0.16962558031082153,
0.1272100955247879,
0.5658321380615234,
-0.17171397805213928,
0.06004933640360832,
-0.3073301315307617,
-0.17131337523460388,
0.4071653187274933,
-0.3820175528526306,
0.2453212141990661... | |
Dim intJCounter As Integer = 0
While intICounter < objBody.Length
intJCounter = _
objBody.IndexOfAny(reserved, intICounter) | [
-0.16897791624069214,
-0.2286699116230011,
0.67821204662323,
-0.34204813838005066,
-0.12082024663686752,
0.24171777069568634,
0.36739036440849304,
-0.45166200399398804,
-0.18304255604743958,
-0.31338629126548767,
-0.03281852602958679,
0.44647929072380066,
-0.4486849009990692,
0.20180192589... | |
If intJCounter = -1 Then
UrlEncoded.Append(System.Web.HttpUtility.UrlEncode(objBody.Substring(intICounter, _
objBody.Length - intICounter)))
Exit While | [
-0.5083455443382263,
0.1145293265581131,
0.8474871516227722,
-0.20573759078979492,
0.1481231153011322,
0.1055666133761406,
0.38623154163360596,
0.06880991160869598,
-0.0018465821631252766,
-0.6034696102142334,
-0.32225877046585083,
0.1331327110528946,
-0.2593920826911926,
0.541822910308837... | |
End If
UrlEncoded.Append(System.Web.HttpUtility.UrlEncode(objBody.Substring(intICounter, _
intJCounter - intICounter)))
UrlEncoded.Append(objBody.Substring(intJCounter, 1)) | [
-0.5100107192993164,
-0.16937623918056488,
0.7379506230354309,
-0.008014168590307236,
0.08946260064840317,
0.034978803247213364,
0.23122447729110718,
-0.04169798642396927,
0.08130411803722382,
-0.5742157697677612,
-0.5254495143890381,
0.09485522657632828,
-0.23188650608062744,
0.3795157968... | |
intICounter = intJCounter + 1
End While
bytBytes = _
System.Text.Encoding.UTF8.GetBytes(UrlEncoded.ToString())
urlWebRequest.ContentLength | [
-0.2922697961330414,
-0.016442086547613144,
0.701475977897644,
-0.04323012754321098,
-0.06731149554252625,
-0.1302867829799652,
0.40665745735168457,
-0.10315258800983429,
-0.18779651820659637,
-0.6364718675613403,
-0.3325884938240051,
0.059012770652770996,
-0.37923628091812134,
0.653431773... | |
= bytBytes.Length
strmRequestStream = urlWebRequest.GetRequestStream
strmRequestStream.Write(bytBytes, 0, bytBytes.Length)
strmRequestStream.Close()
Else
urlWebRequest.ContentLength = | [
0.06119072064757347,
0.24111182987689972,
0.7909582853317261,
-0.11292166262865067,
-0.06106891483068466,
-0.22933337092399597,
0.3234449625015259,
-0.3079502582550049,
-0.06968339532613754,
-0.6113057732582092,
0.0213607270270586,
0.1806401014328003,
-0.19604039192199707,
0.47308242321014... | |
0
End If
End If
rspResult = urlWebRequest.GetResponse()
strmReceiveStream = rspResult.GetResponseStream()
encode = System.Text.Encoding.GetEncoding("utf-8")
sr = New System.IO.StreamReader(strmReceiveStream, encode)
Dim read(256) As Char | [
-0.19018737971782684,
-0.025071904063224792,
0.7422564029693604,
-0.38979101181030273,
0.13531354069709778,
0.06094452738761902,
0.49770882725715637,
-0.3023436963558197,
-0.14532005786895752,
-0.36749470233917236,
-0.4384916126728058,
0.2029142528772354,
-0.31239989399909973,
0.3743905127... | |
Dim count As Integer = sr.Read(read, 0, 256)
Do While count > 0
Dim str As String = New String(read, 0, count)
strResponseText = strResponseText & str
count = sr.Read(read, 0, 256) | [
0.1893417239189148,
-0.3424946367740631,
0.695664644241333,
-0.52171790599823,
-0.5524331331253052,
0.164397731423378,
0.7170912027359009,
-0.7153632044792175,
-0.2887217402458191,
-0.09946764260530472,
-0.10795358568429947,
0.36864954233169556,
-0.3729250431060791,
0.19971151649951935,
... | |
Loop
Catch exp As Exception
SetErrStatusText("Error while sending parameters")
WritetoLog(exp.ToString)
End Try
End Sub
'Setting header values...
Public Overridable Sub setRequestHeader(ByVal bstrHeader _
As String, ByVal bstrValue As String)
... | [
0.029953300952911377,
-0.31169965863227844,
0.18226665258407593,
-0.08895103633403778,
0.22794707119464874,
-0.07713310420513153,
0.6642109751701355,
-0.40972182154655457,
0.13762563467025757,
-0.0900702252984047,
-0.3536781966686249,
0.2483416199684143,
-0.5485169291496277,
0.221415981650... | |
bstrHeader
Case "Referer"
urlWebRequest.Referer = bstrValue
Case "User-Agent"
urlWebRequest.UserAgent = bstrValue
Case "Content-Type"
urlWebRequest.ContentType = bstrValue | [
-0.26479557156562805,
0.25941231846809387,
0.622855007648468,
-0.14734356105327606,
-0.4321717917919159,
-0.270804226398468,
0.38566917181015015,
-0.11099045723676682,
-0.011924910359084606,
-0.6993659734725952,
-0.4277172386646271,
0.2547984719276428,
-0.467791885137558,
0.454571515321731... | |
Case Else
urlWebRequest.Headers(bstrHeader) = bstrValue
End Select
End Sub
Private Function UpdateProxy()
Try
If Not (IsNothing(uriAddress)) Then
If ((Not IsNothing(_ProxyName)) And _
(_ProxyName.Length > | [
-0.16117532551288605,
-0.08531565219163895,
0.6745302081108093,
-0.14486266672611237,
0.11856865137815475,
-0.23022052645683289,
0.4552377164363861,
-0.2603023648262024,
0.24549151957035065,
-0.48117220401763916,
-0.06941668689250946,
0.3326248824596405,
-0.26307204365730286,
0.59175461530... | |
0) And (_ProxyPort > 0)) Then
proxyObject = New WebProxy(_ProxyName, _ProxyPort)
Dim strByPass() As String = Split(strByPassList, "|")
If strByPass.Length > 0 Then
proxyObject.BypassList | [
0.04004139080643654,
-0.4266885221004486,
0.9577983021736145,
-0.29717525839805603,
-0.21821768581867218,
-0.04515627771615982,
0.4294750392436981,
-0.1787780523300171,
-0.30576884746551514,
-0.5761449933052063,
-0.2403365969657898,
0.5627029538154602,
-0.37636974453926086,
0.1671226471662... | |
= strByPass
End If
proxyObject.BypassProxyOnLocal = True
If blnNetworkCredentials Then
If strDomain <> "" Then | [
0.19503404200077057,
-0.15479068458080292,
0.54981529712677,
-0.12993837893009186,
-0.009649936109781265,
-0.029202038422226906,
0.8225963711738586,
0.10429394245147705,
-0.038349054753780365,
-0.4903332591056824,
-0.39568015933036804,
0.6473281979560852,
-0.24358953535556793,
0.0096689108... | |
proxyObject.Credentials = New _
NetworkCredential(strUserName, _
strPwd, strDomain) | [
-0.3985125720500946,
0.07509175688028336,
0.18689094483852386,
0.12289578467607498,
-0.18676859140396118,
0.007113628555089235,
0.5536676645278931,
0.2334943264722824,
-0.16980622708797455,
-0.7816991806030273,
0.11673775315284729,
0.21884281933307648,
-0.19710086286067963,
0.5604485869407... | |
Else
proxyObject.Credentials = New _
NetworkCredential(strUserName, _
strPwd) | [
-0.182613343000412,
0.037998393177986145,
0.14269036054611206,
0.027239486575126648,
-0.007074752822518349,
-0.08625486493110657,
0.49272236227989197,
0.08259611576795578,
-0.08420369774103165,
-0.8142639398574829,
0.19019077718257904,
0.35471510887145996,
-0.040765419602394104,
0.24095921... | |
End If
End If
End If
End If
Catch exp As Exception
SetErrStatusText("Error while updating proxy configurations") | [
-0.3386198878288269,
-0.26531872153282166,
0.2577493488788605,
0.09791294485330582,
0.025359423831105232,
-0.21399150788784027,
0.4215097725391388,
0.16496193408966064,
-0.046150825917720795,
-0.5113304853439331,
-0.6260946989059448,
0.16279222071170807,
-0.34627607464790344,
0.29858568310... | |
WritetoLog(exp.ToString)
End Try
End Function
'Property for setting the Responsetext
Public Overridable ReadOnly Property ResponseText() As String
Get
ResponseText = strResponseText
End Get
End Property
Private urlWebRequest As System.Net.HttpWebRequest
Private urlWebR... | [
-0.18165694177150726,
0.18194296956062317,
0.5174914002418518,
-0.11457530409097672,
-0.18707019090652466,
-0.022151879966259003,
0.5362947583198547,
-0.30301764607429504,
0.2604687809944153,
-0.33603471517562866,
-0.3626334071159363,
0.3561391532421112,
-0.32668358087539673,
0.27397856116... | |
Private intCount As Integer
Private uriAddress As Uri
Private _ProxyName As String
Private _ProxyPort As Integer
End Class
``` | [
-0.40531283617019653,
0.2868403494358063,
0.3457111716270447,
-0.027560973539948463,
-0.15532994270324707,
0.2276405543088913,
0.07224536687135696,
0.30034324526786804,
0.056985847651958466,
-0.3846292793750763,
-0.108810655772686,
0.35710227489471436,
-0.07299374788999557,
0.5199304223060... | |
I know of the following:
* The venerable `getopt(3)`
* The extended `getopt_long`
* glibc's [`argp`](http://www.gnu.org/software/libtool/manual/libc/Argp.html) parser for Unix-style argument vectors
* [popt](http://developer.gnome.org/arch/misc/popt.html) from the GNOME project (or its spiritual successor in [Glib](ht... | [
-0.12826724350452423,
0.09085963666439056,
0.4539393186569214,
-0.223871648311615,
-0.3485139012336731,
0.05997901409864426,
0.13288216292858124,
-0.12760712206363678,
-0.46672090888023376,
-0.38614633679389954,
-0.3453451097011566,
0.7686634063720703,
-0.36326271295547485,
-0.266093850135... | |
to use (thanks to being so flexible), and the code to support it is quite verbose (as are many things in C).
What do you use, and why?
Yes, I mean C rather than C++. There are a ton of C++ parsers, but I don't use C++.
John Millikin notes that `popt` is no longer maintained. I list it because many programs still use... | [
0.4937305748462677,
0.2653447985649109,
0.02451269142329693,
-0.1276087462902069,
-0.07097265124320984,
0.0693536326289177,
0.05148448422551155,
0.1866713911294937,
-0.24077089130878448,
-0.49550995230674744,
0.08406854420900345,
0.7449385523796082,
-0.589073657989502,
-0.10505902022123337... | |
C++?](https://stackoverflow.com/questions/253556/what-parameter-parser-libraries-are-there-for-c)*
GNU has [gengetopt](http://www.gnu.org/software/gengetopt/) which generates code for an options data structure and the `getopt_long` code to parse the command line and fill the structure.. It's fairly easy to learn and wo... | [
0.11629537492990494,
-0.28309953212738037,
0.20501257479190826,
0.041637443006038666,
-0.259645938873291,
-0.28157201409339905,
-0.3198932111263275,
0.026537587866187096,
-0.41956591606140137,
-0.4601939022541046,
-0.2640121877193451,
0.5977925658226013,
-0.42355799674987793,
-0.1718041598... | |
An idiom commonly used in OO languages like Python and Ruby is instantiating an object and chaining methods that return a reference to the object itself, such as:
```
s = User.new.login.get_db_data.get_session_data
```
In PHP, it is possible to replicate this behavior like so:
```
$u = new User();
$s = $u->login()-... | [
0.11816133558750153,
0.10622122138738632,
0.20061556994915009,
-0.15824319422245026,
-0.6058518886566162,
-0.20630232989788055,
0.2656431794166565,
0.056619223207235336,
-0.23525896668434143,
-0.3666341006755829,
-0.3095133900642395,
0.4405863881111145,
-0.5762324333190918,
0.1207864359021... | |
purpose?
If I do decide to use static methods, **is it too sorcerous to have a class's static method return an instantiation of the class itself**? (Effectively writing my own constructor-that-isn't-a-constructor?) It feels kind of dirty, but if there aren't too many scary side effects, I might just do it.
I guess I ... | [
0.43308553099632263,
0.1213730126619339,
-0.08637780696153641,
0.07908336073160172,
-0.3605721592903137,
-0.16694769263267517,
0.8360011577606201,
-0.13493655622005463,
-0.17812691628932953,
-0.34570127725601196,
0.08805467933416367,
0.44632118940353394,
-0.3164201080799103,
-0.01313930470... | |
madness.
I would just use:
```
$u = new User();
$s = $u->login()->get_db_data()->get_session_data();
```
It is clear, relatively concise and involves no *black magic* that can introduce errors.
And of course, you could always move to Ruby or Python. It will change your life.
* And yeah, I am harsh on PHP. I use ... | [
0.3943137228488922,
0.005454277154058218,
0.2728150188922882,
0.055810604244470596,
-0.1412537693977356,
-0.21032464504241943,
0.607992947101593,
0.14975616335868835,
-0.28812816739082336,
-0.33878177404403687,
0.3425709903240204,
0.6674817204475403,
-0.46320420503616333,
0.219383269548416... | |
I've studied C programming in college some years ago and have developed some medium applications back then (nothing serious). Now I have to develop some more 'advanced' C applications (involving POSIX threads and RPC), but right now I'm a little rusty even with the basics.
Can anyone recommend me good online C referen... | [
0.4193654954433441,
0.3353850543498993,
0.2379346340894699,
0.052791573107242584,
0.06282331794500351,
-0.27120986580848694,
0.12890826165676117,
0.22743038833141327,
-0.32423847913742065,
-0.4950701594352722,
0.126352921128273,
0.7720666527748108,
0.28265801072120667,
0.044679686427116394... | |
the original posters, but unfortunately cannot seem to find that question. | [
0.5570970177650452,
0.21033117175102234,
0.2592647671699524,
0.004198059905320406,
0.2992047369480133,
0.12085117399692535,
-0.0769687071442604,
-0.059221405535936356,
-0.44801226258277893,
-0.4250633120536804,
0.09973715990781784,
0.03955179825425148,
-0.017400093376636505,
0.384189099073... | |
I have a large int[] array and a much smaller int[] array. I want to fill up the large array with values from the small array, by repeat copying the small array into the large array until it is full (so that large[0] = large[13] = large[26] ... = small[0] etc.). I already have a simple method:
```
int iSource = 0;
for... | [
0.10929276794195175,
-0.12887980043888092,
0.3639424741268158,
-0.03222883865237236,
0.2746160328388214,
0.2851312756538391,
0.3727477490901947,
-0.5104461908340454,
0.08387500047683716,
-0.9013451933860779,
0.09192946553230286,
0.46321359276771545,
-0.262920618057251,
0.26979029178619385,... | |
destArray[i] = sourceArray[iSource++];
}
```
But I need something more elegant, and hopefully faster.
Some threads do background tasks, like sending keepalive packets, or performing periodic garbage collection, or whatever. These are only useful when the main program is running, and it's okay to kill them off once th... | [
0.7099191546440125,
-0.012155129574239254,
-0.03649372234940529,
0.1839366853237152,
-0.03958289697766304,
-0.10619686543941498,
0.612001359462738,
-0.12231328338384628,
-0.25468480587005615,
-0.9703903794288635,
-0.05103469640016556,
0.8120331764221191,
-0.511486828327179,
0.4513483941555... | |
Given a table structure like this:
```
CREATE TABLE `user` (
`id` int(10) unsigned NOT NULL auto_increment,
`name` varchar(32) NOT NULL,
`username` varchar(16) NOT NULL,
`password` char(32) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`)
);
```
Is there any use in using the LIMIT keywor... | [
-0.048525210469961166,
0.1892576515674591,
0.4056810140609741,
-0.0218401737511158,
0.12475849688053131,
0.019696053117513657,
0.08459294587373734,
-0.3924946188926697,
-0.11940822005271912,
-0.4762250483036041,
-0.3054293394088745,
0.387198269367218,
-0.18298688530921936,
0.13950176537036... | |
been enlightening. It seems like, even though it's unnecessary, putting `LIMIT 1` on the query doesn't hurt, and probably increases readability (you don't have to go looking into the DB schema to know that only one is going to be returned). Special shoutout for JR's answer - I didn't even know you could do that with in... | [
0.09467519819736481,
-0.017580658197402954,
0.1923682540655136,
0.14741377532482147,
-0.3250975012779236,
-0.3999898135662079,
0.2499474585056305,
-0.25063610076904297,
-0.37982693314552307,
-0.44805824756622314,
-0.024101095274090767,
0.5145459175109863,
-0.1942383497953415,
0.10789799690... | |
you're probably right it doesn't make a difference, but I think it's better just to always do than always deciding and leaving it out one time when you need it. | [
0.8201403617858887,
0.3579666018486023,
-0.534369707107544,
0.07987269014120102,
-0.023876924067735672,
0.041723866015672684,
0.018906094133853912,
0.29164737462997437,
0.11065060645341873,
-0.216966450214386,
0.7478110194206238,
0.27870818972587585,
0.12696562707424164,
0.1053406819701194... | |
Does anyone have some good information on the usage of the .SaveChanges() method?
I am experiencing a variety of issues when attempting to use the .SaveChanges() method on my data context object. I am taking data from an existing data source, creating the appropriate EntityFramework/DataService objects, populating tho... | [
0.2841900587081909,
0.06710740178823471,
0.28150177001953125,
0.08827535808086395,
0.1868705153465271,
0.3075808584690094,
-0.015722200274467468,
0.03604515269398689,
-0.25289231538772583,
-0.6905536651611328,
0.2927400767803192,
0.6885302662849426,
-0.3375958502292633,
0.00208448292687535... | |
objects, attaching them to the context as they go. (note: three objects a "member" and two "addresses" that are attached via a SetLink call) - basically this is a conversion tool to take data from one data store and massage it into a data store that is exposed by Data Services.
* Call .SaveChanges() without any parame... | [
0.06175132468342781,
-0.11747301369905472,
0.28463470935821533,
0.2634553015232086,
0.004082093480974436,
0.2551749646663666,
0.5519686937332153,
-0.178918719291687,
-0.17267794907093048,
-0.6812535524368286,
0.2215491235256195,
0.4934817850589752,
-0.29723435640335083,
0.24247190356254578... | |
what is there to run out of memory on?
* Call .SaveChanges() without any parameters once per loop
+ This works, but takes absolutly forever (8 hours for 90,000 saves)
* Call .SaveChanges(SaveChangesOption.Batch) once at the end of the foreach loop
+ Same OutOfMemory error, but without any saves to the database
* Call... | [
-0.013909886591136456,
-0.007825203239917755,
0.3036825656890869,
0.10429082810878754,
0.3451628088951111,
0.3031195402145386,
0.5746084451675415,
-0.17900735139846802,
-0.2608320713043213,
-0.5612208843231201,
0.038062166422605515,
0.7147762179374695,
-0.11065371334552765,
-0.078060209751... | |
it as a private member variable that is available.
+ Differing results, unable to quantify, none really that good
What is the prefered method of calling .SaveChanges() from a client object when doing a large data load like this? Is there something I'm not getting about how .SaveChanges() works? Can anyone provide mor... | [
0.21086880564689636,
-0.17928019165992737,
0.2798343300819397,
0.16432835161685944,
-0.1205449253320694,
0.09884511679410934,
0.1579291969537735,
0.11498843878507614,
-0.3640037178993225,
-0.44088810682296753,
0.16415096819400787,
0.6754294037818909,
-0.32446637749671936,
0.142640665173530... | |
EntityFramework (just some random experiment), have you tried calling .SaveChanges() every n iterations?
I mean something like this:
```
int i = 0;
foreach (var item in collection)
{
// do something with your data
if ((i++ % 10) == 0)
context.SaveChanges();
}
context.SaveChanges();
```
I know it's u... | [
0.17892129719257355,
0.003388516139239073,
0.1572674810886383,
-0.00980596523731947,
0.23921935260295868,
0.1863383650779724,
0.3683793842792511,
-0.19279882311820984,
-0.18462559580802917,
-0.5847148299217224,
0.5384765863418579,
0.5406140089035034,
-0.5668784976005554,
0.2988332808017730... | |
I want to use data binding with an XML document to populate a simple form that shows details about a list of people. I've got it all set up and working like so right now:
```
<Window x:Class="DataBindingSample.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.... | [
0.10514234006404877,
0.08063668012619019,
0.6955378651618958,
-0.18216164410114288,
-0.005249394103884697,
-0.10178372263908386,
-0.16332805156707764,
-0.3994315266609192,
-0.029568420723080635,
-0.6085891127586365,
-0.11244256049394608,
0.4024049639701843,
0.01618097350001335,
0.113283678... | |
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<GroupBox Header="GroupBox" Name="groupBox1" DataContext="{Binding ElementName=personList, Path=SelectedItem}">
<Grid>
<TextBox Name="nameText" Text="{Binding XPath=Name}"/>
<ComboBox Name="genderCombo" Text="{Binding XP... | [
-0.29730546474456787,
-0.11185580492019653,
0.18846333026885986,
0.012566554360091686,
-0.1942775547504425,
0.4885503947734833,
-0.060630109161138535,
-0.7639126181602478,
-0.11081069707870483,
-0.5957995653152466,
-0.18145853281021118,
0.17435356974601746,
-0.3012494444847107,
-0.08323557... | |
<ComboBoxItem>Female</ComboBoxItem>
</ComboBox>
</Grid>
</GroupBox>
</Grid>
</Window>
```
(All position/layout elements have been removed for clarity)
Now this works great! If I provide it with some XML that matches the paths provided I get a list of names in the listbox that show both the na... | [
-0.30373847484588623,
-0.16427446901798248,
0.3606591820716858,
-0.1679476499557495,
-0.29486799240112305,
0.06678002327680588,
0.23145535588264465,
-0.5341065526008606,
-0.22707165777683258,
-0.4583908021450043,
0.04766208305954933,
0.3767985701560974,
-0.20947784185409546,
-0.10191072523... | |
<XmlNamespaceMapping Uri="http://www.mynamespace.com" Prefix="mns"/>
</XmlNamespaceMappingCollection>
<XmlDataProvider x:Key="xmlProvider" XmlNamespaceManager="{StaticResource namespaceMappings}" XPath="mns:People" Source="c:\someuriwithnamespaces.xml"/>
</Window.Resources>
<Grid>
<ListBox Name="per... | [
-0.5156292915344238,
0.05456665903329849,
0.5948866009712219,
-0.1264224648475647,
-0.32439422607421875,
0.17912442982196808,
-0.09385254979133606,
-0.681483805179596,
-0.27266430854797363,
-0.608866810798645,
-0.2562904953956604,
0.4041249752044678,
0.0654856488108635,
0.17580309510231018... | |
</ListBox>
<GroupBox Header="GroupBox" Name="groupBox1" DataContext="{Binding ElementName=personList, Path=SelectedItem}">
<Grid>
<TextBox Name="nameText" Text="{Binding XPath=mns:Name}"/>
<ComboBox Name="genderCombo" Text="{Binding XPath=mns:Gender}">
<ComboBoxItem>... | [
-0.43426674604415894,
-0.17813271284103394,
0.12178675085306168,
-0.16438482701778412,
-0.18238630890846252,
0.4759732484817505,
0.21019281446933746,
-0.7479134202003479,
-0.2669696807861328,
-0.4885663390159607,
-0.24823163449764252,
0.13606563210487366,
-0.45790189504623413,
0.0109669817... | |
</Grid>
</GroupBox>
</Grid>
</Window>
```
With this code (and the appropriately namespaced xml, of course) the Listbox still displays the names properly, but clicking on those names no longer updates the Name and Gender fields! My suspicion is that somehow the xml namespace is reacting adversely to the groupbox's... | [
0.13359372317790985,
0.22197173535823822,
0.41972097754478455,
-0.11428356170654297,
-0.3160192668437958,
-0.03062315098941326,
0.12889069318771362,
-0.23472541570663452,
-0.1088259145617485,
-0.7504045367240906,
-0.18912248313426971,
0.564058244228363,
-0.2723282277584076,
-0.102091766893... | |
I am currently developing a Rails application using a database that was designed before I was aware of Rails existence.
I have currently created some migrations to add some new tables and new columns to existing tables.
I would like to have the migrations to recreate the full database.
Which steps should I follow?... | [
0.35402101278305054,
0.0585184246301651,
0.007718096487224102,
-0.0702323392033577,
0.012500366196036339,
0.03452059626579285,
0.31345513463020325,
-0.16684943437576294,
-0.10234181582927704,
-0.8496626615524292,
0.23915724456310272,
0.3179684281349182,
-0.29063159227371216,
0.082533836364... | |
probably already have a `db/schema.rb` file if you have been using migrations. That file will contain the ruby representation of the database you have configured for development. To get the ruby representation of another database pass in RAILS\_ENV to the rake command (ie `RAILS_ENV=production rake db:schema:dump`)
Yo... | [
0.543144166469574,
0.15542474389076233,
0.23051635921001434,
0.0653315931558609,
0.08170207589864731,
-0.08250604569911957,
0.19108355045318604,
-0.32263675332069397,
-0.18582120537757874,
-0.6909430027008057,
0.1795179396867752,
0.27234628796577454,
-0.3333004117012024,
0.2919275760650635... | |
How do you keep the spoken languages strings in your program up to date?
Is there an inexpensive way? Where can you find people to do the conversions over time?
There are companies which will translate resource files in the standard formats for fees; I think that's how most large companies do it.
I asked a similar que... | [
0.4190952181816101,
0.09911907464265823,
-0.11488740146160126,
0.10264928638935089,
-0.028564773499965668,
0.13950957357883453,
0.31844085454940796,
0.2695314884185791,
-0.2582700252532959,
-0.5857976078987122,
-0.19514308869838715,
0.5823884606361389,
0.14136910438537598,
-0.1329144537448... | |
to them by ID in the code, and have the file translated.
See .rc files for Windows C++, .resx files for .NET, not sure what exists for Linux/Mac/other, but I'm sure there are equivalents. | [
0.7127962112426758,
0.1882004588842392,
0.2494128942489624,
0.24528580904006958,
0.05095065385103226,
-0.2388055920600891,
-0.12235596776008606,
0.2522859573364258,
-0.30568063259124756,
-0.37745270133018494,
-0.23531989753246307,
0.6804822683334351,
-0.08457008004188538,
0.119334734976291... | |
I am trying to generate equivalent MD5 hashes in both JavaScript and .Net. Not having done either, I decided to use against a third party calculation - this [web site](http://www.johnmaguire.us/tools/hashcalc/index.php?strtohash=password&mode=hash) for the word "password". I will add in salts later, but at the moment, ... | [
-0.02899361588060856,
0.4116590619087219,
0.2816324830055237,
-0.20082834362983704,
-0.1567838191986084,
-0.17055371403694153,
0.3334674835205078,
-0.21074150502681732,
-0.11583080887794495,
-0.7099885940551758,
0.1039658710360527,
0.12627167999744415,
0.032204922288656235,
0.2669750154018... | |
one of the methods I have tried, which results in this hash which i have commonly received:
```
7c6a180b36896a0a8c02787eeafb0e4c
```
Edit: Sadly, I've accidentally been providing different source strings to the two different implementations. EBSAK. :-/ Still be interested to hear your answer to the follow-up.
Bonu... | [
0.13769172132015228,
0.18518996238708496,
-0.026934027671813965,
0.055961139500141144,
-0.007803291082382202,
-0.1883610486984253,
0.387472540140152,
-0.03159584105014801,
-0.19541501998901367,
-0.7000461220741272,
-0.03556439280509949,
0.6450198888778687,
-0.2662978768348694,
0.2432749420... | |
// Create a new instance of the MD5CryptoServiceProvider object.
MD5 md5Hasher = MD5.Create();
// Convert the input string to a byte array and compute the hash.
byte[] data = md5Hasher.ComputeHash(Encoding.Default.GetBytes(input));
// Create a new Stringbuilder to colle... | [
0.01838153600692749,
0.10113824903964996,
0.1641441434621811,
-0.24747303128242493,
-0.15428562462329865,
0.19895869493484497,
0.2755383551120758,
-0.5032959580421448,
-0.37984922528266907,
-0.32345718145370483,
-0.09417730569839478,
0.17599795758724213,
-0.37561389803886414,
0.44709345698... | |
and create a string.
StringBuilder sBuilder = new StringBuilder();
// Loop through each byte of the hashed data
// and format each one as a hexadecimal string.
for (int i = 0; i < data.Length; i++)
{ | [
0.06411804258823395,
-0.10930228233337402,
0.36520472168922424,
-0.30804869532585144,
0.11564743518829346,
0.20939312875270844,
0.4281090199947357,
-0.7486956119537354,
-0.07588332891464233,
-0.3161260187625885,
-0.12640568614006042,
0.030088350176811218,
-0.42421862483024597,
0.2534447014... | |
sBuilder.Append(data[i].ToString("x2"));
}
// Return the hexadecimal string.
return sBuilder.ToString();
}
static void Main(string[] args)
{
System.Console.WriteLine(getMd5Hash("password"));
}
```
returns:
```
5f4dcc3b5aa765d61d8327deb... | [
-0.3941994309425354,
0.041087184101343155,
0.5004842877388,
-0.4153297543525696,
0.19821326434612274,
0.13083884119987488,
0.6104217767715454,
-0.33829987049102783,
-0.14115741848945618,
-0.41785094141960144,
-0.4377775490283966,
0.37716540694236755,
-0.4873824417591095,
0.3168395459651947... | |
Assume my objects are in perfect working order (i.e. TDD makes me think they work).
I have a list that I create like this (except indented properly):
```
var result = from v in vendors
from p in v.Products
orderby p.Name
select p;
```
This works - I get all products from all v... | [
0.23202510178089142,
0.22952313721179962,
0.25871676206588745,
-0.18393908441066742,
0.11196009814739227,
0.2699749767780304,
0.01989002898335457,
-0.30929991602897644,
0.05257590487599373,
-0.5808891654014587,
-0.23389914631843567,
0.6977460980415344,
-0.25908687710762024,
0.1697268486022... | |
them:
```
foreach (Attribute a in requiredAttributes)
{
result = result.Where(p => p.Attributes.Contains(a));
}
```
This may be primitive, but I thought it'd work. However, after this foreach loop is finished, when you enumerate "result" it will contain all products that has the LAST Attribute of the requiredAtt... | [
0.38763949275016785,
0.14655804634094238,
0.3795528709888458,
-0.033741891384124756,
0.017158979550004005,
-0.13496071100234985,
0.23463627696037292,
-0.6527929306030273,
-0.02711443603038788,
-0.5878809094429016,
-0.06842920184135437,
0.6886581182479858,
-0.09317940473556519,
-0.181588411... | |
AND, giving me only those products that has ALL the required attributes?
(Edited for clarity.)
The problem is the foreach loop, and the fact that the "a" variable is being captured and then changed each time. Here's a modification which will work, by effectively introducing a "new" variable for each iteration of the l... | [
0.2822220027446747,
0.08737954497337341,
0.2645288407802582,
0.004532839171588421,
0.06597900390625,
0.009905827231705189,
0.12643568217754364,
-0.41159993410110474,
-0.29222092032432556,
-0.4336913228034973,
-0.16094838082790375,
0.691338837146759,
-0.44578421115875244,
0.1784751564264297... | |
more about the issue in [this closures article](http://csharpindepth.com/Articles/Chapter5/Closures.aspx) - scroll down to "Comparing capture strategies: complexity vs power". | [
-0.05251574143767357,
-0.3816404938697815,
0.032241128385066986,
0.1510523408651352,
-0.004468950908631086,
-0.16703644394874573,
0.08524607867002487,
0.011037779971957207,
-0.7610430717468262,
-0.40927815437316895,
-0.2170090675354004,
0.22927512228488922,
-0.24944131076335907,
0.18221402... | |
```
inline int factorial(int n)
{
if(!n) return 1;
else return n*factorial(n-1);
}
```
As I was reading [this](https://rads.stackoverflow.com/amzn/click/com/0201543303), found that the above code would lead to "infinite compilation" if not handled by compiler correctly.
How does the compiler decide whether t... | [
0.09659310430288315,
0.12841050326824188,
0.2772082984447479,
0.07705508917570114,
-0.22213822603225708,
-0.038272831588983536,
0.43752264976501465,
-0.27567097544670105,
0.20609654486179352,
-0.3424263000488281,
0.041335221379995346,
0.772395670413971,
-0.6103242635726929,
-0.019067695364... | |
the level to which it will "unroll" the function.
An optimizing compiler might turn this code:
```
inline int factorial(int n)
{
if (n <= 1)
{
return 1;
}
else
{
return n * factorial(n - 1);
}
}
int f(int x)
{
return factorial(x);
}
```
into this code:
```
int factorial... | [
-0.05520239844918251,
-0.25792330503463745,
0.3776073455810547,
-0.2197139412164688,
0.0698789581656456,
-0.036506399512290955,
0.3116225004196167,
-0.4035439193248749,
0.04462537169456482,
-0.5059866309165955,
-0.4927799701690674,
0.8301626443862915,
-0.5818032622337341,
0.016911532729864... | |
}
else
{
return n * factorial(n - 1);
}
}
int f(int x)
{
if (x <= 1)
{
return 1;
}
else
{
int x2 = x - 1;
if (x2 <= 1)
{ | [
-0.18543939292430878,
-0.3700558543205261,
0.029539167881011963,
-0.16757328808307648,
0.11352129280567169,
0.1929233819246292,
0.2853701412677765,
-0.40482568740844727,
0.07883536070585251,
-0.3992539346218109,
-0.6663974523544312,
0.7315340042114258,
-0.43137985467910767,
-0.332421749830... | |
return x * 1;
}
else
{
int x3 = x2 - 1;
if (x3 <= 1)
{
return x * x2 * 1; | [
-0.04236035794019699,
-0.13330145180225372,
0.005196549464017153,
-0.4160277545452118,
-0.26160964369773865,
-0.07156869769096375,
0.49403950572013855,
-0.25903597474098206,
0.15501002967357635,
-0.16776205599308014,
-0.662574052810669,
0.3806525468826294,
-0.5929611921310425,
-0.164289519... | |
}
else
{
return x * x2 * x3 * factorial(x3 - 1);
}
}
}
}
```
In this case, we've basically inlined the function 3 times. Some compilers *do* perform this optimization. I recall MSVC++ | [
0.17335914075374603,
0.11278945952653885,
0.4299216568470001,
-0.3561965227127075,
-0.08418621867895126,
-0.16547101736068726,
0.5011465549468994,
-0.32433566451072693,
-0.09972114115953445,
-0.4116848409175873,
-0.039646588265895844,
0.7087864875793457,
-0.4950990378856659,
0.010341102257... | |
having a setting to tune the level of inlining that would be performed on recursive functions (up to 20, I believe). | [
-0.10775857418775558,
-0.020363720133900642,
-0.05785594508051872,
0.23795650899410248,
0.11880159378051758,
-0.1272992491722107,
0.10545659065246582,
-0.3757632374763489,
-0.01511098351329565,
-0.5589346885681152,
-0.04856571927666664,
0.531201958656311,
-0.0006089411326684058,
-0.5986163... | |
Searching for a string within a string is extremely well supported in .NET but what do you do when the data you need to search isn't a string?
I have binary data arriving in regular chunks via a NetworkStream. Packets are binary but they all start with a signature sequence of bytes. I accumulate the chunks into a larg... | [
0.11479730904102325,
-0.12453727424144745,
0.10487771779298782,
0.15428601205348969,
-0.14406941831111908,
-0.19243885576725006,
0.33016735315322876,
0.16630835831165314,
-0.4872739613056183,
-0.8241435885429382,
0.11984064429998398,
0.23558174073696136,
-0.31316640973091125,
0.30802702903... | |
to you!
---
As suggested, Array.IndexOf(byte) will at least save me an explicit loop. Since posting, it occurred to me to find the first signature byte, then probe ahead for a match where the last signature byte should be, then if they both match try a brute-force comparison for the rest of the string. This approach ... | [
0.19965684413909912,
0.11961925774812698,
0.2694823145866394,
0.11143778264522552,
-0.12078732252120972,
-0.033880338072776794,
0.3807143270969391,
-0.11750095337629318,
-0.29263949394226074,
-0.4405048191547394,
-0.10990356653928757,
0.3435121476650238,
-0.10207707434892654,
-0.0692751035... | |
name on it it's probably greased lightning, on the downside why is it that whenever I have a good idea Donald Knuth thought of it 25 years ago?
Since I can't award the points to Donald Knuth I guess they go to Nelson.
You can use Array.IndexOf to find a single byte.
However, I would caution you that some valid data m... | [
0.4821988344192505,
0.6468352675437927,
0.32383838295936584,
0.4876485764980316,
-0.16727027297019958,
-0.16787227988243103,
0.15526774525642395,
-0.10701530426740646,
-0.5590307116508484,
-0.00888871680945158,
0.4073140025138855,
0.05605144053697586,
-0.17408278584480286,
0.34952390193939... | |
buffer of that packet.
If you are using TCP it is completely acceptable to kick a client off if they lie about packet size or request a stupid amount of memory :) | [
0.022018058225512505,
-0.12106485664844513,
0.0647132620215416,
0.20954689383506775,
-0.08191034197807312,
-0.2727804481983185,
0.09579861909151077,
-0.03786959871649742,
-0.28396037220954895,
-0.529819905757904,
-0.04315704107284546,
0.36974242329597473,
-0.47275662422180176,
0.1325854659... | |
How do I test the concrete methods of an abstract class with PHPUnit?
I'd expect that I'd have to create some sort of object as part of the test. Though, I've no idea the best practice for this or if PHPUnit allows for this.
Unit testing of abstract classes doesn't necessary mean testing the interface, as abstract cla... | [
0.5735723376274109,
0.033444371074438095,
-0.11861871927976608,
0.34547314047813416,
-0.16788984835147858,
-0.3270566463470459,
0.2920614778995514,
-0.22447767853736877,
-0.06407546252012253,
-0.5169053673744202,
0.3419678807258606,
0.5316392183303833,
0.034566350281238556,
-0.129319250583... | |
code is tested, you need means to UT the concrete methods of abstract classes.
Personally, I use PHPUnit, and it has so called stubs and mock objects to help you testing this kind of things.
Straight from [PHPUnit manual](https://phpunit.de/manual/current/en/test-doubles.html#test-doubles.stubs):
```
abstract class ... | [
0.677997887134552,
0.05412169173359871,
-0.20382487773895264,
0.057361751794815063,
-0.19212457537651062,
-0.06039201468229294,
0.5688534379005432,
-0.435600221157074,
0.20047762989997864,
-0.5560874938964844,
0.0931931883096695,
0.5356495380401611,
-0.306355357170105,
-0.15633858740329742... | |
->method('abstractMethod')
->will($this->returnValue(TRUE));
$this->assertTrue($stub->concreteMethod());
}
}
```
Mock object give you several things:
* you are not required to have concrete implementation of abstract class, and can get away with stub instead
* you may call concrete methods ... | [
0.24900361895561218,
0.14296770095825195,
0.1994950771331787,
-0.12201078236103058,
-0.2955377995967865,
0.11598888039588928,
0.5397927761077881,
-0.45511648058891296,
0.1732429713010788,
-0.2828724980354309,
0.09893099218606949,
0.6144447922706604,
-0.3035363256931305,
-0.1232045963406562... | |
What are the best practices for modeling inheritance in databases?
What are the trade-offs (e.g. queriability)?
(I'm most interested in SQL Server and .NET, but I also want to understand how other platforms address this issue.)
There are several ways to model inheritance in a database. Which you choose depends on you... | [
0.37685397267341614,
-0.06732151657342911,
-0.17300750315189362,
0.457002729177475,
-0.0684623271226883,
0.07455267012119293,
-0.13919773697853088,
-0.26824209094047546,
-0.15431466698646545,
-0.4403291344642639,
0.13324479758739471,
0.44752171635627747,
-0.17694273591041565,
0.00577138690... | |
table's class contains only the different elements.
So for example:
```
class Person {
public int ID;
public string FirstName;
public string LastName;
}
class Employee : Person {
public DateTime StartDate;
}
```
Would result in tables like:
```
table Person
------------
int id (PK)
string firstnam... | [
-0.5945402979850769,
0.0699344202876091,
0.3006257712841034,
-0.04649868980050087,
-0.024673383682966232,
0.20276768505573273,
-0.19051221013069153,
-0.29253795742988586,
-0.21647228300571442,
-0.675798237323761,
-0.14790265262126923,
0.04304245114326477,
0.006421583704650402,
0.3316825032... | |
(PK)
int rowtype (0 = "Person", 1 = "Employee")
string firstname
string lastname
datetime startdate
```
For any rows which are rowtype 0 (Person), the startdate will always be null.
**Table-Per-Concrete (TPC)**
Each class has its own fully formed table with no references off to any other tables.
Given the classes ... | [
-0.2573043406009674,
-0.02834782749414444,
0.3744411766529083,
-0.20044398307800293,
-0.17253100872039795,
0.295137882232666,
-0.06460274010896683,
-0.045108307152986526,
-0.10897811502218246,
-0.4412606656551361,
-0.2549886405467987,
-0.025737596675753593,
0.07330937683582306,
0.284165322... | |
An interesting issue came up recently. We came across some code that is using `hashCode()` as a salt source for MD5 encryption but this raises the question: will `hashCode()` return the same value for the same object on different VMs, different JDK versions and operating systems? Even if its not guaranteed, has it chan... | [
0.22030720114707947,
-0.07282190769910812,
0.17525066435337067,
-0.13207420706748962,
-0.08351018279790878,
-0.4480498433113098,
0.03293861076235771,
-0.2968112826347351,
-0.2603888511657715,
-0.5069222450256348,
0.022690119221806526,
0.46405139565467834,
-0.20983606576919556,
0.2701355814... | |
once during an
> execution of a Java application,
> hashCode must consistently return the
> same integer. The integer may be
> positive, negative, or zero. This
> integer does not, however, have to
> remain consistent from one Java
> application to another, or from one
> execution of an application to another
>... | [
-0.08940503001213074,
-0.08583727478981018,
0.2658901512622833,
-0.13100826740264893,
-0.11476566642522812,
-0.16502682864665985,
0.5280923843383789,
-0.38827988505363464,
-0.180067777633667,
-0.8228484392166138,
-0.10601238906383514,
0.34033966064453125,
-0.34922435879707336,
-0.031029190... | |
I am trying to store more than 1 data item at a single index in my linked-list. All of the examples in my textbook seem to illustrate adding only 1 piece of data per index. I'm assuming it is possible to add more?
For example, using the Collections API to store an integer I would do the following:
```
LinkedList <Int... | [
0.26036909222602844,
0.13685351610183716,
0.10049422830343246,
0.20991824567317963,
-0.1644195020198822,
0.025943046435713768,
0.014327813871204853,
-0.03781668096780777,
-0.6448206901550293,
-0.9325321316719055,
0.022903408855199814,
0.2678634226322174,
-0.2824288308620453,
0.387322157621... | |
linked lists work. Essentially, a linked list is composed of nodes, each of which contains one datum (an object, which itself can contain several member variables, to be precise), and a link to the next node in the list (or a null pointer if there is no such next node). You can also have a doubly-linked list, where eac... | [
0.4105663597583771,
-0.18527857959270477,
0.27771317958831787,
0.5505446791648865,
-0.06655830144882202,
-0.20243893563747406,
0.10786747187376022,
0.0056215086951851845,
-0.5637243986129761,
-0.7385777831077576,
-0.23280620574951172,
-0.0848076120018959,
-0.5583927035331726,
0.30123266577... | |
linked list into an N-ary *tree*.
To add multiple pieces of data onto the end of the list, in the manner most commonly associated with a linked list, just do:
```
LinkedList <Integer>linky = new LinkedList<Integer>();
int num1 = 2, num2 = 22, num3 = 25, num4 = 1337;
linky.add(num1);
linky.add(num2);
linky.add(num3);
... | [
-0.22533158957958221,
-0.15200956165790558,
0.3867323696613312,
0.14370989799499512,
0.014078234322369099,
0.01965729519724846,
0.11233102530241013,
-0.28942427039146423,
-0.42408981919288635,
-0.7038249373435974,
-0.35495859384536743,
0.05677390843629837,
-0.6434820890426636,
0.2571198642... | |
public GroupOfFourInts(int a, int b, int c, int d)
{
myInt1 = a; myInt2 = b; myInt3 = c; myInt4 = d;
}
}
class someOtherClass
{
public static void main(String[] args)
{
LinkedList<GroupOfFourInts> linky = new LinkedList<GroupOfFourInts>();
GroupOfFourInts group1 = new GroupOfFourInts(1,2,3,4);
... | [
-0.4238192141056061,
-0.20699121057987213,
0.5670280456542969,
-0.20262573659420013,
0.007579014636576176,
0.14305715262889862,
0.2808097004890442,
-0.1403307169675827,
-0.4207301437854767,
-0.5951108336448669,
-0.18391701579093933,
0.08735080063343048,
-0.6270720362663269,
0.2733179330825... | |
pattern should be used whenever you want to store a bunch of data together as a unit. You create a class that has member variables for every piece of data you want to be stored together, then create any Java Collections type (ArrayList, LinkedList, TreeList, ...) of that type.
Be sure that you want to use a linked lis... | [
0.22988638281822205,
-0.3517301678657532,
0.1690250039100647,
0.06524690985679626,
-0.026993541046977043,
-0.2983831465244293,
0.01692744717001915,
-0.2716459035873413,
-0.594806969165802,
-0.9073776602745056,
-0.03259868547320366,
0.0680176392197609,
-0.7449312210083008,
-0.18349546194076... | |
and delete. TreeLists provide O(log n) insertion, deletion, and lookup. The tradeoffs between these depend on the amount of data you have and how you're going to be modifying and accessing the data structure.
Of course, none of this matters if you'll only have, say, <100 elements in your list ;-)
Hope this helps! | [
0.04980744048953056,
0.04895052686333656,
0.22780804336071014,
0.11693406850099564,
0.2971012592315674,
0.21001338958740234,
0.5781677961349487,
-0.1814127415418625,
-0.5260821580886841,
-0.5087124705314636,
-0.38442370295524597,
0.3185168504714966,
-0.2139296680688858,
-0.1779616475105285... | |
How do you use the **CSS** `content` property to add **HTML** entities?
Using something like this just prints ` ` to the screen instead of the non-breaking space:
```css
.breadcrumbs a:before {
content: ' ';
}
```
You have to use the escaped unicode :
Like
```css
.breadcrumbs a:before {
content: '\00... | [
-0.11748690158128738,
0.19025106728076935,
0.096712127327919,
0.08957470953464508,
0.04071535915136337,
0.03172625973820686,
0.03569290414452553,
-0.2546676695346832,
-0.5325334072113037,
-0.5827125310897827,
-0.25893592834472656,
0.36056554317474365,
-0.36995747685432434,
0.01154273469001... | |
My motivation for trying out git-svn is the effortless merging and branching. Then I noticed that man git-svn(1) says:
> Running git-merge or git-pull is NOT recommended on a branch you plan
> to dcommit from. Subversion does not represent merges in any
> reasonable or useful fashion; so users using Subversion cann... | [
0.2192501425743103,
-0.4115503132343292,
0.03758387267589569,
0.13361617922782898,
-0.2910608947277069,
-0.2006864994764328,
0.26860103011131287,
0.12431715428829193,
-0.2656697928905487,
-0.7739940285682678,
0.10173474997282028,
0.43043747544288635,
-0.5380007028579712,
0.2216290533542633... | |
away, merge back into svn/trunk, then dcommit? I understand that svn users will see the same mess that merges in svn pre 1.5.x have always been, but are there any other drawbacks? That last sentence worries me, too. Do people routinely do these kinds of things?
Actually, I found an even better way with the `--no-ff` op... | [
0.3433559536933899,
-0.15929459035396576,
0.2134406864643097,
0.1567138135433197,
0.2823936939239502,
-0.09489832818508148,
0.026869239285588264,
0.23032832145690918,
-0.10939621925354004,
-0.6080378890037537,
-0.1816520392894745,
0.18069252371788025,
-0.27474868297576904,
0.43355306982994... | |
have a standard SVN layout in the repository `trunk/`, `branches/`, and `tags/`):
```
git svn clone [-s] <svn-url>
```
* I work on a local branch "work" (`-b` creates the branch "work")
```
git checkout -b work
```
* commit locally into the "work" branch (`-s` to sign-off your commit message). In the sequel, I assu... | [
0.07664737105369568,
0.0971546620130539,
0.8173141479492188,
-0.29717838764190674,
0.05965004116296768,
-0.106411874294281,
0.4188905358314514,
0.010205923579633236,
-0.45706844329833984,
-0.8285745978355408,
-0.4449811577796936,
0.5908118486404419,
-0.1254880279302597,
0.33159056305885315... | |
main file just because you want to accelerate the compilation and focus on a given feature)
```
(work)$> git stash
```
* rebase the master branch with the SVN repository (to update from the SVN server)
```
(work)$> git checkout master
(master)$> git svn rebase
```
* go back to the work branch and rebase with master... | [
0.13524526357650757,
-0.1622226983308792,
0.5654169917106628,
-0.03478771075606346,
0.22087469696998596,
-0.24686606228351593,
0.16157148778438568,
0.1067376583814621,
-0.567531943321228,
-0.6412912011146545,
-0.36944884061813354,
0.5134173035621643,
-0.3644159734249115,
0.2391034364700317... | |
logs:
```
(master)$> git log --graph --oneline --decorate
* 56a779b (work, master) Merge branch 'work'
|\
| * af6f7ae msg 3
| * 8750643 msg 2
| * 08464ae msg 1
|/
* 21e20fa (git-svn) last svn commit
```
* Now you probably want to edit (`amend`) the last commit for your SVN dudes (otherwise they will only see a s... | [
0.15283960103988647,
0.32186996936798096,
0.7369928359985352,
-0.034104615449905396,
-0.006472503300756216,
-0.04500691592693329,
0.6135116815567017,
-0.21718454360961914,
-0.7935359477996826,
-0.5800197124481201,
-0.40774792432785034,
0.4786961078643799,
-0.046418480575084686,
0.392912298... | |
I asked [here](https://stackoverflow.com/questions/188043/security-crytography-stupid-challege-response-protocol) about a protocol that I was asked to implement, and how secure it was. Since it seemed clear from the very beginning that it was shit. Being so I ask:
Can you guys point me to some very simple login protoc... | [
0.5186611413955688,
0.18354490399360657,
0.15557006001472473,
0.13495221734046936,
-0.0809936597943306,
-0.14368467032909393,
0.4169822037220001,
-0.23817656934261322,
-0.046929825097322464,
-0.4302106201648712,
-0.12935777008533478,
0.15055282413959503,
-0.4596320390701294,
-0.18361549079... | |
of the password in plain text
2. If possible, not a too long interchange of messages. The shorter, the better.
Check out [Challenge Response Authentication](http://en.wikipedia.org/wiki/Challenge-response_authentication)
* Server includes a random challenge string in the login form
* When you login, javascript hashes ... | [
0.0009147284436039627,
0.07013503462076187,
0.28240591287612915,
-0.04141375049948692,
-0.4242861568927765,
-0.34872621297836304,
0.24432054162025452,
-0.1744106560945511,
-0.044478803873062134,
-0.7470511794090271,
-0.26708802580833435,
0.3625495135784149,
-0.239315465092659,
-0.039484549... | |
I've been working on a project in Delphi 7 where I wanted to have forms inherit components from other forms. I was able to get this working, but came across the following issues (and I'm going to post the solutions to hopefully help others in the future):
1. In the .pas file of a form, I would change the form to inher... | [
0.32361236214637756,
-0.15391503274440765,
0.16001306474208832,
-0.1682310551404953,
-0.05160945653915405,
-0.31626400351524353,
0.3759888708591461,
-0.265512079000473,
0.12930743396282196,
-0.7981963753700256,
0.08822877705097198,
0.18333576619625092,
-0.336311012506485,
0.048070382326841... | |
found." I would have to first manually open the ancestor form, and then I could open the descendant form.
First, for those who don't know how to inherit a form visually, you create the ancestor form as usual. Then go to File > New > Other. Select the tab with the name of the current project, and choose the form you wan... | [
0.4382335841655731,
-0.17398786544799805,
0.19633419811725616,
0.4225369989871979,
0.48498693108558655,
-0.22021473944187164,
-0.2773376405239105,
0.10553061962127686,
0.09392932802438736,
-0.9560983180999756,
0.021836567670106888,
0.27753838896751404,
0.10481393337249756,
0.38856154680252... | |
New > Other and select that form from the appropriate tab.
Given that, I came across issues because some of the descendant forms were already created, so I couldn't follow the process above. Also, I made some changes to forms from the standard code Delphi creates. I was able to resolve all issues with visual form inhe... | [
0.24394381046295166,
-0.34448468685150146,
0.375245600938797,
-0.12600481510162354,
-0.04679014906287193,
-0.19227775931358337,
0.24984335899353027,
-0.3568612039089203,
0.2474721074104309,
-0.9864572286605835,
-0.25222310423851013,
0.4688262939453125,
-0.10397636145353317,
0.0750876963138... | |
of `object`, e.g.:
`inherited MyForm: TMyForm`
* **EDIT: After double checking, the following is NOT required:** *The .pas file of the ancestor form must have the standard global variable that Delphi creates, e.g.:
`var AncestorForm: TAncestorForm;`*
* The `uses` section of the .dpr file of the project must have ... | [
0.0058672744780778885,
-0.1352257877588272,
0.3876853287220001,
0.03777250647544861,
0.14642758667469025,
-0.020718412473797798,
0.08427581191062927,
-0.14816395938396454,
0.013865301385521889,
-0.7513031363487244,
-0.576358437538147,
0.4345509111881256,
-0.038664560765028,
0.2563079595565... | |
descendant form to the ancestor form's value, right click on the property in the Object Inspector, and choose Revert to inherited.
* To revert all property values of a component to the ancestor's values, right click the component and choose Revert to inherited. | [
-0.19211289286613464,
-0.3649795949459076,
0.25260066986083984,
0.33667054772377014,
0.14591839909553528,
0.03226388618350029,
0.16979269683361053,
-0.2569190263748169,
0.2654213309288025,
-0.5321586728096008,
-0.25828713178634644,
0.2759256958961487,
-0.15006114542484283,
0.63875579833984... | |
I would like to access micro-state accounting timers programmatically on Linux. I guess the first part of the question is where are these available? Which kernel versions and distros? Which hardware platforms? The second part is how to actually go about accessing the timers? What is the system call?
Here is a (somewha... | [
0.40227529406547546,
0.26459944248199463,
0.1693812906742096,
-0.043661002069711685,
-0.04440158233046532,
0.2759450674057007,
-0.1406146138906479,
-0.04261590540409088,
-0.3542729914188385,
-0.5984163880348206,
0.2253291755914688,
0.5871931314468384,
-0.07438686490058899,
0.22093202173709... | |
In the following code, both `amp_swap()` and `star_swap()` seems to be doing the same thing. So why will someone prefer to use one over the other? Which one is the preferred notation and why? Or is it just a matter of taste?
```
#include <iostream>
using namespace std;
void amp_swap(int &x, int &y)
{
int temp = ... | [
0.454982191324234,
-0.13416001200675964,
0.27698713541030884,
-0.37648147344589233,
0.30787596106529236,
0.22045744955539703,
-0.10144751518964767,
-0.43919333815574646,
-0.265272855758667,
-0.16356664896011353,
-0.24827519059181213,
0.8560218811035156,
-0.7945568561553955,
-0.259511232376... | |
= 20;
cout << "Using amp_swap(): " << endl;
amp_swap(a, b);
cout << "a = " << a << ", b = " << b << endl;
cout << "Using star_swap(): " << endl;
star_swap(&a, &b);
cout << "a = " << a << ", b = " << b << endl;
return 0;
}
```
Thanks for your time!
---
See Also
[**Difference between poin... | [
-0.1298995018005371,
-0.054246269166469574,
0.6693466901779175,
-0.27518466114997864,
0.18724988400936127,
0.19991274178028107,
-0.1958674043416977,
-0.4572685956954956,
-0.08380831778049469,
-0.4450090527534485,
-0.31059402227401733,
0.7366757988929749,
-0.3849078416824341,
-0.24371045827... | |
with references, because you can't pass a NULL reference (whereas you can pass a NULL pointer).
So if you do:
```
star_swap(NULL, NULL);
```
Your application will crash. Whereas if you try:
```
amp_swap(NULL, NULL); // This won't compile
```
Always go with references unless you've got a good reason to use a poin... | [
0.2691206634044647,
0.30947569012641907,
0.581943929195404,
-0.0012280837399885058,
0.26454538106918335,
-0.3702112138271332,
0.40557026863098145,
-0.26000016927719116,
-0.313141405582428,
-0.2398761361837387,
-0.35668638348579407,
0.6772782802581787,
-0.8228629231452942,
0.204148262739181... | |
*When using threads I sometimes visualise them as weaving together 3 or more dimensional interconnections between Objects in a Spatial context. This isn't a general use case scenario, but for what I do it is a useful way to think about it.*
### Are there any APIs which you use which aid threading?
### Have you used t... | [
0.24218212068080902,
0.079581618309021,
-0.08550283312797546,
-0.04954562336206436,
-0.2713615894317627,
0.25647199153900146,
0.3000451922416687,
0.03362308815121651,
-0.891734778881073,
-0.6980427503585815,
0.05255957320332527,
0.3971427381038666,
-0.3015376031398773,
0.0983535498380661,
... | |
threads in a manner which doesn't conceptualise as thread being a process?**
Yes, to the extent that threads doesn't conceptualise at all. Take an asynchronous task-runner for instance. It uses threads under the covers but I don't see them and I don't care about them. They are fully managed by the task-runner.
Under ... | [
0.5650085806846619,
0.05277351662516594,
0.08720393478870392,
0.4745504856109619,
-0.04654204845428467,
0.09942196309566498,
0.20500588417053223,
0.13777904212474823,
-0.6080339550971985,
-0.7541892528533936,
-0.0809704139828682,
-0.00849659088999033,
0.06758957356214523,
0.385810583829879... | |
reach for a higher level of abstraction.
Agents/Actors is a common way to do this. An Actor is like a thread that has a lump of state, and then you can send it some code and say "do this to your state when you have time" or something along those lines. | [
0.4262130558490753,
-0.5772390961647034,
-0.14081215858459473,
0.519865870475769,
0.17685572803020477,
0.1223330944776535,
0.0918087288737297,
0.12070988118648529,
-0.21971198916435242,
-0.7713841795921326,
0.17770449817180634,
0.3125738501548767,
-0.28312623500823975,
0.12905456125736237,... | |
I'm creating some text boxes on my form programmatically which I need to reference later using FindControl.
I've put the FindControl instruction in the page load method after the code which creates them but get an error:
> **Object reference not set to an instance of an object.**
I assume this is because the textbox... | [
0.25501465797424316,
0.01949577033519745,
0.2561762034893036,
0.33366140723228455,
0.2366211712360382,
-0.17016661167144775,
0.10900159180164337,
-0.07283426821231842,
0.06936533004045486,
-0.7575153112411499,
-0.016173113137483597,
0.5344894528388977,
-0.23914504051208496,
-0.072588056325... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.