text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
I have a question about using `new[]`.
Imagine this:
```
Object.SomeProperty = new[] {"string1", "string2"};
```
Where SomeProperty expects an array of strings.
I know this code snippet will work. But i want to know what it does under the hood. Does `new[]` makes an instance of the class `object` and in `SomePrope... | [
0.3157285749912262,
-0.0007152816979214549,
0.2610108256340027,
-0.056250639259815216,
0.02966734953224659,
-0.07477469742298126,
0.3536674380302429,
-0.1302879899740219,
-0.2752038538455963,
-0.43441322445869446,
-0.14960819482803345,
0.8639984130859375,
-0.3183101415634155,
0.07645971328... | |
"string1", "string2" };
```
and o would still be a reference to a string array.
Basically, the compiler looks at an expression like this:
```
new[] { A, B, C, D, ... }
```
(where A, B, C, D etc are expressions) and tries to work out the correct array type to use. It only considers the types of A, B, C and D (etc)... | [
0.1300286054611206,
0.09950975328683853,
0.23153653740882874,
-0.1733604222536087,
-0.07742749899625778,
0.03702520206570625,
0.298275351524353,
-0.31825825572013855,
-0.0567127987742424,
-0.6231480240821838,
-0.3172343969345093,
0.4374898672103882,
-0.4645848572254181,
0.08052413910627365... | |
new MemoryStream() }
```
will not compile - neither `MemoryStream` nor `Form` is convertible to the other. However:
```
new[] { GetSomeIDisposable(), new MemoryStream() }
```
will be treated as an `IDisposable[]` because there's an implicit conversion from `MemoryStream` to `IDisposable`. Likewise:
```
new[] { 0,... | [
-0.08935197442770004,
-0.053406912833452225,
0.5427510142326355,
-0.02929205447435379,
0.1674981266260147,
-0.06373202055692673,
0.12979435920715332,
-0.33764684200286865,
0.09612066298723221,
-0.5968336462974548,
-0.11929505318403244,
0.5670167207717896,
-0.3051672577857971,
0.13533093035... | |
What would be the best way to display & program simple game board (say chess, checkers and such) in C#? In terms of controls and underlying game logic.
An idea that came to my mind was to use **Picture Box** (or class inheriting from it) with Board & Field classes.
* Is that a decent solution after all?
* How would... | [
0.024197351187467575,
-0.018495256081223488,
0.14888593554496765,
0.4285427927970886,
-0.16848497092723846,
0.015518544241786003,
-0.184244304895401,
-0.07418403029441833,
-0.5104199051856995,
-0.7280980944633484,
0.11663170158863068,
0.34724536538124084,
-0.24751761555671692,
-0.013545467... | |
to Board, Field and PictureBox.
Extendability - designing it properly would easily allow to implement any other board game (or even card game) as it's all about board with modifiable fields after all.
In an object-oriented approach, think about the objects involved in your game (e.g. the board, the pieces) … let them... | [
0.3093583285808563,
-0.24862229824066162,
0.1731012910604477,
0.23734213411808014,
-0.08346018195152283,
-0.06271185725927353,
-0.5279799103736877,
-0.23585160076618195,
-0.5407909154891968,
-0.6202713847160339,
0.05373390391469002,
0.4225958287715912,
-0.23280729353427887,
-0.165107354521... | |
it won't depend on the kind of control.
In general, *don't* use workarounds with different controls. These might be nice for a conventional GUI. Not so much for games (or any kind of graphics-heavy application). | [
0.40398097038269043,
0.04638127237558365,
-0.07994666695594788,
0.4749718904495239,
-0.02439638040959835,
-0.22038839757442474,
0.23882801830768585,
0.2934834063053131,
-0.11641094088554382,
-0.7586127519607544,
-0.05327409505844116,
0.701919436454773,
0.06595173478126526,
-0.2722933292388... | |
You are given a heap of code in your favorite language which combines to form a rather complicated application. It runs rather slowly, and your boss has asked you to optimize it. **What are the steps you follow to most efficiently optimize the code?**
What strategies have you found to be **unsuccessful** when optimiz... | [
0.3243931233882904,
-0.008214800618588924,
0.0007266015163622797,
0.2744051516056061,
0.05940031632781029,
0.06839665025472641,
0.2552976608276367,
0.07700878381729126,
-0.49519792199134827,
-0.6730177998542786,
-0.22884178161621094,
0.47232574224472046,
-0.13255487382411957,
-0.1034486144... | |
times out of 10, the time won't be consumed where you might guess it is.
The usual unsuccessful strategy is micro-optimisation, when what is actually required is the appropriate algorithm.
Obligatory Donald Knuth quote:
> *"We should forget about small efficiencies, say about 97% of the time: premature optimization ... | [
0.23021000623703003,
0.25296908617019653,
-0.022094495594501495,
0.1316523402929306,
0.19657622277736664,
0.11538530141115189,
0.5168855786323547,
0.14425991475582123,
-0.18779541552066803,
-0.4516175389289856,
-0.14355339109897614,
0.5757958292961121,
-0.3297214210033417,
0.20938278734683... | |
I just set up SSHd through Cygwin on a Windows XP Pro box overseas using a RAT and discluded the openssh package from the install.
I ran the cywin shell (from c:\cywin) and ran
Now, It's under a port I know is safe and fowarded properly, but I won't share it's number. It's not a common port, but it's under 40000.
Firew... | [
0.3675835430622101,
0.46292680501937866,
0.4754481315612793,
-0.30534929037094116,
-0.23780249059200287,
-0.15886153280735016,
0.7333818674087524,
-0.27857425808906555,
0.17414502799510956,
-0.6677362322807312,
-0.06373646855354309,
0.7219593524932861,
-0.25821298360824585,
0.1028414666652... | |
mkpasswd -cl > /etc/passwd
mkgroup --local > /etc/group`
I can connect locally, but not externally.
I know my ports etc are fine.
Any possible problems, as i really need this tunnel up :P
Profile before attempting any optimisation.
9 times out of 10, the time won't be consumed where you might guess it is.
The ... | [
-0.05141995847225189,
0.04610763117671013,
0.30332061648368835,
0.028363071382045746,
-0.006084313150495291,
0.06244227662682533,
0.912642776966095,
-0.03320075944066048,
-0.25460085272789,
-0.6650335788726807,
0.06415815651416779,
0.599646270275116,
-0.4218294620513916,
-0.005986072588711... | |
I need to validate a certain property to one of my classes. When I set the property, the class should validate the input and if incorrect, set the object to an invalid state.
Question : The property value must be in a certain mask/format eg. &&&&-&&&&-&&&&. I cannot use regular expressions. Is it possible to validate ... | [
0.04999279975891113,
0.058488477021455765,
0.1810671091079712,
0.21801535785198212,
-0.09462356567382812,
-0.09736457467079163,
0.6128993630409241,
-0.1446610391139984,
-0.039931636303663254,
-0.276718407869339,
-0.24513225257396698,
0.8251758217811584,
-0.25377944111824036,
-0.21185816824... | |
I am trying to make a form in which the user fills in values. It is quite long. I wish to use an expandable tree to fit it into my one form. Is there any way to give each TreeView Node a TextBox by its side? Having the node text edited by itself is not enough.
Is the textbox for editing the node? or for secondary data?... | [
0.32013869285583496,
-0.045275405049324036,
0.37371405959129333,
0.22452899813652039,
-0.04722902551293373,
0.1359049677848816,
0.023212235420942307,
0.04418531060218811,
-0.20341899991035461,
-0.8079056739807129,
0.22385279834270477,
0.18344208598136902,
-0.34784623980522156,
0.1068765223... | |
node. That may text-boxes is going to be confusing!
Alternatively, there are some treeview/grid combined controls available from 3rd parties. Might be a good fit. [Here's](http://www.binarymission.co.uk/) (look for `TreeListView`) a quick search hit (not a specific recommendation - just a search result). | [
0.11442618072032928,
-0.36521831154823303,
0.243611142039299,
0.15649792551994324,
-0.05317557603120804,
-0.4276891052722931,
0.6200557947158813,
0.1464475691318512,
-0.28206485509872437,
-0.5232036113739014,
-0.4126984477043152,
0.32161280512809753,
-0.19809874892234802,
-0.05900788307189... | |
I am having trouble getting my ASP.NET application to start an application. For example when I type:
<http://my.domain.com/virtualdir> or
<http://my.domain.com/virtualdir/default.aspx>
My application will start but I cannot get ASP.NET to start when I type <http://my.domain.com>.
I have tried to set the default ... | [
0.2282348871231079,
-0.010492533445358276,
0.4392911493778229,
-0.009434042498469353,
-0.25055748224258423,
-0.16597509384155273,
0.2581736147403717,
0.3184240758419037,
-0.3878049850463867,
-0.9541258215904236,
-0.01397383026778698,
0.2783319056034088,
-0.1544417440891266,
0.6249809265136... | |
the current selected node. That may text-boxes is going to be confusing!
Alternatively, there are some treeview/grid combined controls available from 3rd parties. Might be a good fit. [Here's](http://www.binarymission.co.uk/) (look for `TreeListView`) a quick search hit (not a specific recommendation - just a search r... | [
0.03390231728553772,
-0.37694013118743896,
0.5818089246749878,
0.11169399321079254,
0.08032801002264023,
-0.4111461341381073,
0.4337098300457001,
0.1241118386387825,
-0.28682151436805725,
-0.5593248605728149,
-0.5342894792556763,
0.17952312529087067,
-0.07914292812347412,
0.050906050950288... | |
In SQL, How we make a check to filter all row which contain a column data is null or empty ?
For examile
```
Select Name,Age from MEMBERS
```
We need a check Name should not equal to null or empty.
This will work in all sane databases (*wink, wink*) and will return the rows for which name is not null nor empty
... | [
0.28449422121047974,
0.010053346864879131,
0.12293130904436111,
0.14838378131389618,
-0.0724780410528183,
-0.3200214207172394,
0.17393387854099274,
-0.12351488322019577,
0.08183478564023972,
-0.616690456867218,
-0.08270470798015594,
0.33395230770111084,
-0.33466729521751404,
0.001789980917... | |
```
% rails
...
General Options:
...
-c, --svn Modify files with subversion. (Note: svn must be in path)
-g, --git Modify files with git. (Note: git must be in path)
```
What do these "Modify files" options do for me?
Edit: It is unclear to me what using one (or both?) o... | [
0.10875362902879715,
-0.0488036647439003,
0.3332033157348633,
0.15201598405838013,
-0.014899276196956635,
-0.010564898140728474,
0.20237627625465393,
0.07067766040563583,
-0.16491739451885223,
-0.6343288421630859,
-0.05342790484428406,
0.7967141270637512,
-0.36367446184158325,
0.0199961829... | |
workflow? What svn/git commands would I then not be issuing myself, or possibly what type of more esoteric commands will I now end up having to issue? Fundamentally, where are the docs on this feature?
Looks like `--git` was added in [r8772](http://dev.rubyonrails.org/changeset/8772) in response to [ticket #10690](http... | [
0.11398252099752426,
-0.15797556936740875,
0.5657697916030884,
-0.018068166449666023,
0.04891902208328247,
-0.2714136838912964,
0.35109731554985046,
-0.36094504594802856,
-0.17644622921943665,
-0.5369988679885864,
-0.11512276530265808,
0.7604904770851135,
-0.25485172867774963,
-0.247647434... | |
by the VCS.
Oh, and `--git` is also [broken for the rails app generator](https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/3896-generatorcommandscreatefile-git-broken-with-app-generator), at least through rails 2.3.5. | [
0.02200535126030445,
-0.03432941809296608,
0.39428627490997314,
0.22964692115783691,
-0.06737901270389557,
-0.09016624093055725,
0.5860298275947571,
0.20760560035705566,
-0.3644561469554901,
-0.2342487871646881,
-0.44504716992378235,
0.2793482542037964,
-0.28298693895339966,
0.254685968160... | |
I am using oracle wallet to store the oracle database passwords,
the batch file to create the wallet asks for password when you run it.
is there any way to modify the batch file , and provide the password before hand
so that i can avoid inputtting the password every time i run that.
so to generalize the problem, is ... | [
0.3396715819835663,
0.1862182915210724,
-0.16352474689483643,
-0.06677444279193878,
0.3240467309951782,
0.054671116173267365,
0.10317787528038025,
-0.08046209067106247,
0.2591143846511841,
-0.6549524664878845,
0.18140247464179993,
0.8063115477561951,
-0.3732626438140869,
-0.064808137714862... | |
works both on unix and windows platforms.
In your example you would have a script doing just
```
echo mypassword
```
and you would run this from the command line:
```
myscript | wallet
```
I assume that your script would be called myscript.bat, and the wallet program wallet.exe, change these accordingly. | [
0.24967437982559204,
0.18708446621894836,
0.27705705165863037,
-0.26611199975013733,
-0.16595444083213806,
-0.055402640253305435,
-0.0771455392241478,
0.01881241239607334,
0.10628710687160492,
-0.9008422493934631,
0.133164182305336,
0.6500165462493896,
-0.2031504511833191,
-0.1292274445295... | |
I am a newbie for Visual Basic 6 project. I downloaded some tutorials for testing; however, I am not able to drag, move, or edit the UI form designer objects in those projects.
Does anybody know there is an object lock function in VB6?
If there is, how can I unlock it?
In this case I wouldn't go for an enum, I'd go... | [
0.38708019256591797,
0.2790057957172394,
0.6817277669906616,
0.05086328461766243,
-0.20339857041835785,
0.07994698733091354,
0.4431312382221222,
-0.34061428904533386,
-0.16608810424804688,
-0.5415217280387878,
-0.21902114152908325,
0.44107839465141296,
0.20257484912872314,
0.07638932019472... | |
you a % per question.
Access isn't really a database, so don't listen to your boss ;) | [
0.2626905143260956,
0.12694330513477325,
0.13782332837581635,
0.558225691318512,
0.08444986492395401,
0.16299542784690857,
0.09108386188745499,
0.12181591987609863,
-0.05802959203720093,
-0.07536793500185013,
-0.00019241894187871367,
0.7544510364532471,
-0.27277374267578125,
0.264468044042... | |
Is there any way to throw errors or warnings in a KornShell (ksh) script to prevent the use of unset variables?
Let's assume I have a temporary folder that I want to remove.
```
TEMP_FILES_DIR='/app/myapp/tmp'
rm -Rf $TEMP_FILE_DIR #notice the misspelling
```
How to prevent this kind of mistakes before they actuall... | [
0.2518227696418762,
0.46001341938972473,
0.1055159643292427,
0.04221635311841965,
0.23006638884544373,
-0.27082186937332153,
0.5221478939056396,
0.2201509326696396,
-0.23382851481437683,
-0.5058059096336365,
-0.22840194404125214,
0.4949735105037689,
-0.3125201463699341,
0.3431589901447296,... | |
command
```
set -u
```
Will cause POSIX *sh*(1) and its derivatives to grouse when an attempt to expand an unset variable is made.
Example:
```
$ echo $foo
$ set -u
$ echo $foo
sh: foo: parameter not set
``` | [
0.2678075134754181,
0.10093413293361664,
0.33600354194641113,
-0.43196994066238403,
-0.07795534282922745,
-0.3668971359729767,
0.3010755181312561,
-0.3519788086414337,
-0.10409443825483322,
0.0603085421025753,
-0.5000213980674744,
0.5659683346748352,
-0.7841700315475464,
0.0093874884769320... | |
I have strange problem with sharepoint and ajax functionality. We have an UpdatePanel placed inside webpart. When partial postback occurs, page title gets missing.
We have found that temporary partial solution is to write title element into one line and not use any spaces or controls inside it..not even a literal cont... | [
0.3518027663230896,
0.2272125631570816,
0.3585938811302185,
0.3166106939315796,
-0.1595660150051117,
-0.22469429671764374,
0.049941983073949814,
0.31201639771461487,
-0.14313672482967377,
-0.646666407585144,
0.17227321863174438,
0.2816070020198822,
-0.010258294641971588,
0.2417525798082351... | |
workaround I have used in the past is to hard code the title on the page - the metadata title being lost is part of the bug.
When hardcoding wasn't possible, I have used javascript to change the page title: document.title = "title fixup here";
Supposedly microsoft plans to fix this problem in the next sharepoint rel... | [
0.14840079843997955,
0.3263978958129883,
0.3109859824180603,
0.08142642676830292,
0.32478758692741394,
-0.4459850490093231,
0.4275217354297638,
0.10310245305299759,
-0.2048047035932541,
-0.6899507641792297,
-0.044753216207027435,
0.6703504920005798,
-0.15984369814395905,
0.2570672035217285... | |
I've a python script that has to launch a shell command for every file in a dir:
```
import os
files = os.listdir(".")
for f in files:
os.execlp("myscript", "myscript", f)
```
This works fine for the first file, but after the "myscript" command has ended, the execution stops and does not come back to the python... | [
0.2675837576389313,
0.18664231896400452,
0.4778306484222412,
-0.30730459094047546,
0.02821824699640274,
0.04715187847614288,
0.22045744955539703,
-0.11584433168172836,
0.03295387700200081,
-0.7327840924263,
-0.2033206671476364,
0.6870521903038025,
-0.36177054047584534,
0.19943767786026,
... | |
I want a way to list files in a directory and putting a check box beside each one of them so I can select some of them and perform operations with each selected file, what's the best way to do this?
Drop a CheckedListBox control onto the form, then populate the contents using the DirectoryInfo and FileSystemInfo classe... | [
0.3991415202617645,
0.06806495040655136,
0.6219918727874756,
0.12990179657936096,
0.4550856053829193,
0.15444134175777435,
-0.12074141204357147,
-0.17327526211738586,
-0.1449102759361267,
-0.7785845994949341,
0.05338582396507263,
0.43176668882369995,
-0.3757847845554352,
0.3304470181465149... | |
What is the masked text provider used for? Why is it different from regex?
Is it possible to translate the regex format to mask or vise versa ?
Thanks
A masked edit area forces the user to fill the field in a certain way: e.g. a mask that looks like ### will only allow a maximum of 3 numbers to be entered.
A regular... | [
0.31687021255493164,
-0.15194781124591827,
0.5870062708854675,
0.27024418115615845,
-0.1860969215631485,
-0.12589412927627563,
0.4597354233264923,
-0.10841169208288193,
-0.021569913253188133,
-0.41388389468193054,
-0.27236199378967285,
0.4818973243236542,
-0.296185702085495,
-0.33032143115... | |
I am trying to comment an API (.Net) that I am exposing to a customer.
I am doing this by using XML comments, and extracting via SandCastle.
This is all fine and dandy, however I have unittesting for the API, and thought the code from these would be good to place in the example tags.
So does anyone know of a good way... | [
0.6698184013366699,
0.12657636404037476,
0.07604806870222092,
0.1528017818927765,
-0.27012932300567627,
-0.018809402361512184,
-0.01646490767598152,
0.016662543639540672,
0.06349687278270721,
-0.5624331831932068,
0.11919211596250534,
0.6616758108139038,
0.07368895411491394,
0.0100394636392... | |
Sandcastle Help File Builder. Please take a look at Sandcastle Help File Builder documentation about The Code Block Component.
Here is an example how I place unit tests code in the example tag:
```
/// <summary>
/// Returns a string representation of an object.
/// </summary>
/// <returns>Comma separa... | [
-0.047784365713596344,
0.147227942943573,
0.36909767985343933,
-0.08420421183109283,
-0.10411076992750168,
-0.06924610584974289,
0.3868151605129242,
-0.6310383677482605,
-0.140762060880661,
-0.7871922850608826,
-0.05948873236775398,
0.6082674264907837,
-0.11817429959774017,
0.2619628012180... | |
}
```
Here is a referenced unit test (CSVDataRowTests.cs) (it should be inside the #region section):
```
#region ToString_a
[Test]
public void ToString_a()
{
CSVDataRow res = new CSVDataRow
{
Data = "1;2;3"
};
Assert.AreEqual(res.ToString(), res.Data);
... | [
-0.16175928711891174,
-0.27854225039482117,
0.6866188049316406,
0.01615162193775177,
0.2355785071849823,
-0.1933259814977646,
0.5052658915519714,
-0.31689390540122986,
0.2547815144062042,
-0.9640257954597473,
-0.2798512578010559,
0.5946332216262817,
0.18485724925994873,
0.3764795958995819,... | |
I'm wanting to write a method that I can use to initialise a Map. First cut:
```
Map map(Object ... o) {for (int i = 0; i < o.length; i+=2){result.put(o[i], o[i+1])}}
```
Simple, but not type-safe. Using generics, maybe something like:
```
<TKey, TValue> HashMap<TKey, TValue> map(TKey ... keys, TValue ... values)
... | [
0.03934895992279053,
-0.3153841197490692,
0.6904348134994507,
-0.25849366188049316,
-0.2552614212036133,
-0.05338121950626373,
0.08507685363292694,
-0.5468639135360718,
-0.17025089263916016,
-0.8337153196334839,
-0.35036030411720276,
0.47200411558151245,
-0.41381707787513733,
0.08548270165... | |
map.put(pair.getKey(), pair.getValue());
}
return map;
}
public static <TKey, TValue> HashMap<? super TKey, ? super TValue> map(Pair<? extends TKey, ? extends TValue> ... pairs) {
return map(new HashMap<TKey, TValue>(), pairs);
}
public static <TKey, TValue> Pair<TKey, TValue> pair(TKey key, TValue value)... | [
-0.09644381701946259,
-0.6972691416740417,
0.7397090196609497,
-0.324391633272171,
-0.17705599963665009,
0.016578910872340202,
0.19516444206237793,
-0.3822541832923889,
-0.15349125862121582,
-1.131225824356079,
-0.8929920196533203,
0.7258370518684387,
-0.48165059089660645,
0.12534701824188... | |
public TValue getValue() {return value;}
}
```
But when I try it out, I need to cast it:
```
private static final Map<? extends Class<? extends Serializable>, ? super TypeHandler<? extends Serializable > > validCodeTypes =
/* (Map<? extends Class<? extends Serializable>, ? super TypeHandler<? extends Serializabl... | [
0.39368322491645813,
-0.4437589645385742,
0.885577917098999,
-0.09249340742826462,
-0.1532791554927826,
-0.042443402111530304,
0.2262057363986969,
-0.2583426237106323,
-0.19070102274417877,
-0.8546634316444397,
-0.4505566358566284,
0.7269755601882935,
-0.5246333479881287,
0.057736728340387... | |
IntHandler implements TypeHandler<Integer> {}
private static class StringHandler implements TypeHandler<String> {}
```
Can anyone tell me how to code my map() methods so that it is entirely general yet doesn't need to be casted?
To make life easier for yourself, never use a return type that contains wildcards. Wildca... | [
-0.07003273814916611,
-0.41931983828544617,
0.351472944021225,
-0.04493972659111023,
-0.31889858841896057,
-0.08708382397890091,
0.12213388085365295,
-0.47111976146698,
-0.155183807015419,
-0.7524599432945251,
-0.18729931116104126,
0.39542341232299805,
-0.4224128723144531,
-0.0909418016672... | |
return map;
}
public static <TKey, TValue> HashMap<TKey, TValue> map(Pair<? extends TKey, ? extends TValue>... pairs) {
return map(new HashMap<TKey, TValue>(), pairs);
}
```
I haven't tested it, but give it a go and see how you fare.
P.S., rather than using a made-up `Pair` type, you may find it easier to use `... | [
-0.11353462189435959,
-0.5370277166366577,
0.3354385793209076,
-0.13114510476589203,
-0.033885400742292404,
-0.2391340732574463,
0.1351448893547058,
-0.22510743141174316,
-0.1961601823568344,
-0.9815667867660522,
-0.444637656211853,
0.5792768001556396,
-0.41082069277763367,
-0.026199758052... | |
I've a table with two columns are a unique key together and i cannot change the schema.
I'm trying to execute an update using psql in which i change the value of one of the column that are key. The script is similar to the following:
```
BEGIN;
UPDATE t1 SET P1='23' where P1='33';
UPDATE t1 SET P1='23' where P1='55';... | [
0.3768823444843292,
0.11184102296829224,
0.7574641108512878,
-0.39037516713142395,
0.039654169231653214,
-0.059224314987659454,
0.20323526859283447,
-0.14341382682323456,
-0.30050888657569885,
-0.9542977213859558,
-0.22960470616817474,
0.35376137495040894,
-0.32840269804000854,
0.309733450... | |
a dba it seems to me that i'm missing something obvious.
Thanks
One of the examples which was loaned straight from this [Aspect Oriented Programming: Radical Research in Modularity, Youtube video](http://www.youtube.com/watch?v=cq7wpLI0hco) was painting to a display. In the example you have a drawing program, which c... | [
0.4498898983001709,
-0.22370918095111847,
0.010882223024964333,
-0.162045419216156,
-0.4680335521697998,
0.09899143874645233,
0.3973901569843292,
-0.3300955891609192,
-0.39241331815719604,
-0.42975905537605286,
0.012214785441756248,
0.28246933221817017,
-0.4651426672935486,
0.1599152386188... | |
with business logic. With aspects you can modularize these concerns to aspects. One of the examples was logging but there are bunch of different things you might end up repeating. It has been evolving since and it's not any more about aspect-oriented programming but there's also aspect-oriented modelling.
More informa... | [
-0.12763434648513794,
0.2884780764579773,
0.2480170577764511,
0.040737271308898926,
-0.275930792093277,
0.10022135078907013,
0.07554320991039276,
-0.3338153064250946,
-0.49131539463996887,
0.006505081430077553,
-0.2722572982311249,
0.8650832176208496,
0.12484532594680786,
-0.20770238339900... | |
Aspect Oriented Programming: Radical Research in Modularity](http://www.youtube.com/watch?v=cq7wpLI0hco)
+ [Youtube - Aspect-Oriented Modeling - what it is and what it's good for](http://www.youtube.com/watch?v=tzjRr3usV6I) | [
-0.06381577253341675,
-0.36448127031326294,
0.28468817472457886,
0.15004341304302216,
-0.13297031819820404,
-0.041793882846832275,
-0.26346656680107117,
-0.1188139095902443,
-0.19726042449474335,
-0.2539597749710083,
-0.2933781147003174,
0.8827858567237854,
-0.16734108328819275,
-0.3586916... | |
I write a Text Editor with Java , and I want to add Undo function to it
but without UndoManager Class , I need to use a Data Structure like Stack or LinkedList but the Stack class in Java use Object parameters e.g : push(Object o) , Not Push(String s)
I need some hints or links .
Thanks
Assuming you are using Java 5,... | [
-0.009878567419946194,
-0.03125260770320892,
0.2643680274486542,
-0.28466013073921204,
-0.09665339440107346,
-0.18501853942871094,
0.18875515460968018,
-0.2696397304534912,
-0.21515221893787384,
-0.730636477470398,
-0.009987843222916126,
0.49470454454421997,
-0.46872013807296753,
-0.216423... | |
can still push String objects into the stack. Only that you will need to explicitly downcast them when you pop() them out, like so:
```
Stack stack = new Stack();
String string = "someString";
stack.push(string);
String popString = (String) stack.pop(); // pop() returns an Object which needs to be downcasted
``` | [
-0.10901553928852081,
-0.3812676668167114,
0.6390417218208313,
-0.22543814778327942,
0.19536840915679932,
-0.2137625813484192,
0.15472079813480377,
-0.1116366907954216,
-0.5750586986541748,
-0.3661887049674988,
-0.4850371479988098,
0.38570648431777954,
-0.3068510591983795,
0.10960184037685... | |
By definition algorithms are independent from the medium they run on. E.g. I use Excel tables to play with data structures and to do some move/shuffling/marking experiments before implementing an algorithm in a programming language.
What tools and techniques do you use to design and simulate the function of an algori... | [
0.3582213819026947,
0.23714213073253632,
0.13345199823379517,
0.4115792512893677,
0.1565454602241516,
0.09179377555847168,
-0.1722285896539688,
-0.15125054121017456,
-0.38111212849617004,
-0.8062171936035156,
-0.01662381924688816,
0.3464154005050659,
-0.19341863691806793,
-0.02661785297095... | |
you've expressed it in Excel.
UML diagrams are a language for expressing an algorithm. A sketch on paper is a language for expression. It's hard to separate the platonic ideal algorithm from all concrete representations. No matter what you do, you're expressing it in some language.
The trick is to separate the algori... | [
0.02228216640651226,
0.144768625497818,
0.31336671113967896,
0.13553115725517273,
-0.1459309309720993,
0.26723846793174744,
0.03199046850204468,
0.2341688722372055,
-0.15572553873062134,
-0.9213298559188843,
-0.11484671384096146,
0.10964717715978622,
-0.1242642030119896,
-0.232291191816329... | |
something where formatting is a distractor.
For really complex things, a little supplemental mathematics helps put formal assertions around the state of the program.
Also, UML diagrams help. I use [Argo UML](http://argouml.tigris.org/) -- cheap and effective.
For more on this topic, you want to read about [formal ve... | [
0.4361371695995331,
-0.029166502878069878,
0.07948868721723557,
0.408234566450119,
0.044745173305273056,
-0.412460058927536,
0.24601036310195923,
0.08636292070150375,
-0.185766339302063,
-0.4957675337791443,
-0.16779465973377228,
0.6081221103668213,
0.10192551463842392,
-0.2472645789384842... | |
I want to build a secure web-service betweeen a Java producer and a Java consumer. I want to authenticate using Active Directory using the domain accounts that the producer and consumer are running under.
Could you give me an example of this?
(ie: AD trusted automated alternative to manual keystores.)
Look at [Spri... | [
0.37649133801460266,
0.24436171352863312,
0.19310449063777924,
-0.09882691502571106,
0.032446980476379395,
0.06871059536933899,
0.17479127645492554,
-0.3475949466228485,
-0.12166488915681839,
-0.3844248652458191,
-0.06729850172996521,
0.42163896560668945,
-0.0994497537612915,
0.17309170961... | |
What is the best tool for Java for aspect-oriented programming?
The requirements for a tool are of course IDE support, expressiveness and proper documentation.
JBossAOP and AspectJ are two commonly used, mature frameworks for AOP. Another popular choice is Spring AOP, but it lacks some of the features of the other tw... | [
0.03974291682243347,
-0.006896111182868481,
0.19034701585769653,
0.07896494120359421,
-0.20763248205184937,
0.07391323149204254,
0.10382866859436035,
-0.3514704406261444,
-0.18334996700286865,
-0.5366594195365906,
-0.1471772938966751,
0.6061570048332214,
-0.01985420286655426,
-0.4871729016... | |
(ie, code that is injected before and after method invocations), and it proved to be a more lightweight alternative to JBossAOP. ASM is cleanly-designed and well-documented. | [
-0.1034596636891365,
-0.29895690083503723,
0.26984167098999023,
-0.07582646608352661,
-0.09842680394649506,
-0.2951296865940094,
0.410603791475296,
-0.3570259213447571,
-0.24444681406021118,
-0.49312493205070496,
-0.398264080286026,
0.2744329571723938,
-0.1679103970527649,
-0.2973365187644... | |
Java 1.5, Linux
I do have a screen which contains different textareas and textfields.
I do have acess to the application frame, but not to the components inside the frame, because i only get an implementation of an interface.
When i try to add german umlauts i see a rectangle in the text component, because the charac... | [
-0.08976087719202042,
0.12960921227931976,
0.18117675185203552,
-0.21911394596099854,
-0.05540242791175842,
-0.11307264119386673,
0.42674556374549866,
0.06386343389749527,
-0.05018574744462967,
-0.865592896938324,
0.016763094812631607,
0.5911998748779297,
-0.4657295346260071,
-0.4600121676... | |
write those characters in a normal texteditor in your linux distro?
* Are those characters from input files in your java application or is it from the source, if so what OS did you use to write the source?
* If they are from a source file or resource file, have you checked that the characters is actually readable in th... | [
0.3072304129600525,
-0.122873954474926,
0.17691591382026672,
0.16940349340438843,
-0.13116015493869781,
-0.11139858514070511,
0.27945399284362793,
0.4792335033416748,
-0.10157979279756546,
-0.7833571434020996,
-0.007062847260385752,
0.500536322593689,
-0.1026684045791626,
-0.15428045392036... | |
we may have a better idea of what is wrong. :)
**UPDATE:**
The reason I wanted you to check this is that I know the so called "windows encoding" can create problems in other OS'es. You say you can write umlauts on the console but not in vi, what do you get instead, squares?
It does't matter that users isn't supposes... | [
0.06538387387990952,
-0.04608483240008354,
0.5852359533309937,
0.29285240173339844,
0.0751195102930069,
0.013953049667179585,
0.15766917169094086,
0.35463467240333557,
-0.08489257842302322,
-0.8549240827560425,
-0.0400426872074604,
0.766875147819519,
-0.15283985435962677,
0.222217470407485... | |
"Western" or "Windows" or "Latin-1" etc. may cause problems.
If everything is UTF-8, readable everywhere except in your application I would start to suspect a missing font issue. | [
0.1092275008559227,
0.2882155776023865,
0.24725091457366943,
0.08291582018136978,
0.13981638848781586,
-0.335868775844574,
0.6271603107452393,
0.4669519364833832,
-0.07857254892587662,
-0.6734523177146912,
-0.5573617815971375,
0.5016454458236694,
-0.22029496729373932,
0.09788930416107178,
... | |
The following code produces an error hr=0x80020005 (wrong type).
```
#import <msi.dll>
using namespace WindowsInstaller;
main()
{
::CoInitialize(NULL);
InstallerPtr pInstaller("WindowsInstaller.Installer");
DatabasePtr pDB = pInstaller->OpenDatabase(
"c:\\foo\\bar.msi",
msiOpe... | [
-0.10888656228780746,
-0.18584750592708588,
0.5873172879219055,
-0.1347142606973648,
0.18314482271671295,
0.16099688410758972,
0.1785343885421753,
-0.12416237592697144,
-0.40156030654907227,
-0.6492207646369934,
-0.12818916141986847,
0.5132335424423218,
-0.5254220366477966,
0.1773228496313... | |
with the good inner type as second argument. The `_variant_t` constructor does many checks, so I can't disguise an int into
a char\* so easily.
Has anyone tried to use this method in C++?
**Edit:**
My version of msi.dll is 3.1.4000.2805, my system is XP SP 2, and the code is supposed to run on any machine with XP or... | [
-0.08403889834880829,
0.2767927646636963,
0.9942476749420166,
-0.14405618607997894,
0.024604560807347298,
-0.05767037719488144,
0.5738171935081482,
-0.025940226390957832,
-0.1446128785610199,
-0.8630430698394775,
-0.17897774279117584,
0.6699639558792114,
-0.3515164256095886,
0.167675241827... | |
"c:\\foo\\bar.msi",
(long)msiOpenDatabaseModeTransact);
``` | [
0.04027295485138893,
0.22715874016284943,
0.7259355783462524,
-0.33396273851394653,
0.42923951148986816,
0.07713852822780609,
0.010954877361655235,
-0.03028085269033909,
-0.04055691510438919,
-0.2422298938035965,
-0.5073177814483643,
0.5758954882621765,
-0.5729432106018066,
0.2466777414083... | |
I've heard from someone that they´re using a business process automation tool (like Weblogic Integration) as a programming language (what sounds like something kind of stupid) to make things declarative. Then they put all the logic inside a process, every single `if` and `while`.
But, isn´t a process a how to step-by-... | [
0.3030245900154114,
0.2231808602809906,
-0.22157345712184906,
0.19042083621025085,
-0.35039860010147095,
-0.1754167079925537,
0.6127524375915527,
0.1095854714512825,
-0.05857401341199875,
-0.17346292734146118,
-0.0907888114452362,
0.4652215838432312,
-0.2355322539806366,
0.0418391041457653... | |
I need a Guid property in some attribute class like this:
```
public class SomeAttribute : Attribute {
private Guid foreignIdentificator;
public Guid ForeignIdentificator {
get { return this.foreignIdentificator; }
set { this.foreignIdentificator = value; }
}
}
```
But in attribute defini... | [
-0.017934871837496758,
0.035374872386455536,
0.19476866722106934,
-0.08620119839906693,
-0.013030455447733402,
-0.2645852565765381,
0.043585844337940216,
-0.0242672897875309,
0.2785657048225403,
-0.5650753974914551,
-0.03201262280344963,
0.8877744674682617,
-0.1492006778717041,
0.059914872... | |
private string foreignIdentificator;
public string ForeignIdentificator {
get { return this.foreignIdentificator; }
set { this.foreignIdentificator = value; }
}
public Guid ForeignIdentificatorGuid {
get { return new Guid( ForeignIdentificator ); }
}
}
```
Unahppily I loose che... | [
-0.10387313365936279,
0.021658407524228096,
0.3156464695930481,
-0.20497718453407288,
0.29714104533195496,
-0.2728291451931,
0.10102120041847229,
0.06559531390666962,
0.1696518063545227,
-0.3639879822731018,
-0.31936851143836975,
0.6969009637832642,
-0.36397498846054077,
0.1965522319078445... | |
for "System.Runtime.InteropServices.GuidAttribute" for "Guid compatibility". This check is exactly what I need, but I don't know if this check i hardcoded in compiler or can me explicitly defined ( and how ).
Do you know some way, how to secure "Guid compatibilty" check for attributes? Or some another way, how to reac... | [
0.12366382777690887,
0.015972865745425224,
0.3446638882160187,
0.33856871724128723,
-0.04365675523877144,
-0.2772524058818817,
0.3189164102077484,
-0.3931758999824524,
-0.13229398429393768,
-0.5910220146179199,
0.08752305805683136,
1.002090573310852,
-0.2949793040752411,
-0.141893327236175... | |
it in a plug-in architecture, so our customers have been the ones to use the interface. If you look at what Microsoft does when they need to do the same thing, they do that.
It hasn't been a problem to do it this way. Not once, have we seen this as an issue from the field.
You might want to name that string field GUI... | [
0.3551045358181,
0.06195109337568283,
0.0941142663359642,
0.06957490742206573,
-0.27001166343688965,
-0.14466889202594757,
-0.1738625168800354,
0.36965954303741455,
0.06737441569566727,
-0.7557822465896606,
0.22418393194675446,
0.7315776944160461,
-0.4455215632915497,
0.03903224691748619,
... | |
as it seems there is no type-safe solution. | [
0.26782482862472534,
0.2718172073364258,
0.17645440995693207,
0.079823799431324,
0.4708642363548279,
-0.05997268855571747,
0.5897722840309143,
0.005200588144361973,
-0.10713350772857666,
-0.24286963045597076,
0.02422207221388817,
0.24903759360313416,
-0.1753934919834137,
0.2299537062644958... | |
Here is the scenario. 2 web servers in two separate locations having two mysql databases with identical tables. The data within the tables is also expected to be identical in real time.
Here is the problem. if a user in either location simultaneously enters a new record into identical tables, as illustrated in the tw... | [
-0.29585903882980347,
-0.12256313860416412,
0.16747546195983887,
0.1316976696252823,
0.23080457746982574,
-0.09998948127031326,
0.19040560722351074,
-0.019445879384875298,
-0.7226176261901855,
-0.8244872093200684,
0.06965185701847076,
0.3604024350643158,
-0.4922170341014862,
0.242702007293... | |
the third table below regardless of where the updates take place? That way in the illustrations below instead of ending up with 3 rows in each table, the new records are replicated bi-directionally and they are inserted in both tables to create 2 identical tables again with 4 columns this time?
```
Server A in Locatio... | [
-0.32104799151420593,
0.1729988306760788,
0.7759907245635986,
-0.3391728699207306,
-0.01444824319332838,
0.3842812478542328,
0.7069779634475708,
-0.32909032702445984,
-0.5235770344734192,
-0.6938440203666687,
-0.2568885087966919,
0.3241228759288788,
-0.45918169617652893,
-0.168228015303611... | |
ID| NAME |
|-----------|
| 1 | Tom |
| 2 | Scott |
| 3 | Peter |
| 4 | John |
|-----------|
```
There isn't much performance to be gained from replicating your database on two masters. However, there is a nifty bit of failover if you code your application correct.
Master-Master setup is essentially the same as th... | [
0.07138986140489578,
0.07000232487916946,
0.15768946707248688,
0.22873055934906006,
0.027571523562073708,
0.06548415124416351,
0.2084331214427948,
-0.47114133834838867,
0.025879226624965668,
-0.6498857140541077,
0.16195161640644073,
0.8002817630767822,
-0.27936890721321106,
0.1331717073917... | |
key for some reason, they do not duplicate and kill the replication. Instead of incrementing by 1, any auto-increment field will by default increment by 2. On one box it will start offset from 1 and run the sequence 1 3 5 7 9 11 13 etc. On the second box it will start offset at 2 and run along 2 4 6 8 10 12 etc. From c... | [
0.17604844272136688,
-0.1465185284614563,
0.2950965464115143,
0.10827583074569702,
0.2509024441242218,
-0.048512063920497894,
0.19031529128551483,
-0.34253162145614624,
-0.3191242218017578,
-0.3555448651313782,
-0.14701180160045624,
0.28116950392723083,
-0.3705081641674042,
0.4687245190143... | |
Server 2 inserts the 4th, it will be given the key of 6 (not 2, which is left unused).
Once you've set that up, start both of them up as Slaves.
Then to check both are working ok, connect to both machines and perform the command `SHOW SLAVE STATUS` and you should note that both `Slave_IO_Running` and `Slave_SQL_Run... | [
-0.05882507935166359,
-0.2395070642232895,
0.4445294141769409,
0.07317983359098434,
-0.021696651354432106,
-0.2564600110054016,
0.19665667414665222,
-0.1121259480714798,
-0.06122420355677605,
-0.8102263808250427,
0.04305083304643631,
0.21017901599407196,
-0.43584826588630676,
0.14610558748... | |
ensure that you can perform all the standard applications on each box with it replicating to the other.
It's relatively simple once it's going.
But as has been mentioned, MySQL does discourage it and advise that you ensure you are mindful of this functionality when writing your application code.
**Edit:** I suppos... | [
1.1485495567321777,
-0.14470437169075012,
-0.09684319794178009,
0.19982755184173584,
0.014345141127705574,
-0.2593696117401123,
0.032732944935560226,
-0.3034796118736267,
-0.2180665135383606,
-0.6382167339324951,
0.13922280073165894,
0.6412744522094727,
-0.24093914031982422,
-0.09318913519... | |
I am attempting to integrate an existing payment platform into my webshop. After making a succesful transaction, the payment platform sends a request to an URL in my application with the transaction ID included in the query parameters.
However, I need to do some post-processing like sending an order confirmation, etc.... | [
0.007924048230051994,
0.3253801763057709,
0.4855389893054962,
-0.20744812488555908,
0.18860545754432678,
0.006600984837859869,
0.10126342624425888,
-0.19574208557605743,
-0.04808718338608742,
-0.6025504469871521,
-0.21515393257141113,
0.4578789472579956,
-0.26968687772750854,
0.34418225288... | |
from the XML response
session_id($sessionId);
session_start();
```
The above code works fine, but `$_SESSION` is still empty. Am I overlooking something or this simply not possible?
**EDIT:**
Thanks for all the answers. The problem has not been solved yet. As said, the strange thing is that I can succesfully start ... | [
0.059681400656700134,
0.1942635029554367,
0.24481123685836792,
-0.00994412787258625,
-0.2807278037071228,
-0.12488691508769989,
0.5519716143608093,
-0.07808925211429596,
-0.30944398045539856,
-0.4152587056159973,
-0.10395900905132294,
0.5740589499473572,
-0.16808786988258362,
0.14424866437... | |
session data after restarting an old session from another client. However, I use [Suhosin](http://www.hardened-php.net/suhosin/index.html) to patch and prevent some security issues. Suhosin's default behaviour is to [encrypt session data based on the User Agent](http://www.hardened-php.net/suhosin/configuration.html#su... | [
-0.2599121332168579,
-0.07658752799034119,
0.20692244172096252,
-0.06062883138656616,
0.1174858883023262,
-0.37966176867485046,
0.905242919921875,
0.08529534935951233,
-0.3322022259235382,
-0.5913610458374023,
-0.5361754894256592,
0.7209437489509583,
-0.2728763818740845,
0.1553544849157333... | |
I have a php page that displays rows from a mysql db as a table. One of the fields contains HTML markup, and I would like to amke this row clickable and the html would open in a new popup window. What is the best way to do it, and is there a way to do it without writing the html to a file?
edit: this php page is actua... | [
0.271994411945343,
0.2959883213043213,
0.2575533390045166,
0.10156244039535522,
-0.4061632454395294,
-0.17822745442390442,
0.10906898230314255,
0.13538075983524323,
-0.17970064282417297,
-0.6387338042259216,
0.38197240233421326,
0.40580523014068604,
-0.3275441527366638,
0.03542618826031685... | |
the example below, and have failed. I know my script tag is wrong, but I am just echoing out row2 at the moment, so I think my logic is wrong before it ever gets to the javascript.
```
$sql="SELECT * FROM Auctions WHERE ARTICLE_NO ='$pk'";
$sql2="SELECT ARTICLE_DESC FROM Auctions WHERE ARTICLE_NO ='$pk'";
$htmlset = m... | [
-0.0032483891118317842,
0.22102244198322296,
0.4643591642379761,
-0.18613547086715698,
0.21824827790260315,
0.13616466522216797,
0.37053629755973816,
-0.6566006541252136,
-0.26065370440483093,
-0.5934656262397766,
-0.3380080759525299,
0.6752126812934875,
-0.22337783873081207,
0.03242320939... | |
I've been using a 3G wireless card for a while and every time I connect, my anti-virus fires up the updates.
I'm wondering what is the Win32 API set of functions that I can use to, either, get notified or query about the event of an Internet Connection coming up?
And is there already a set of ported headers for Delph... | [
0.45370596647262573,
0.16554869711399078,
0.36895623803138733,
0.20323719084262848,
0.1945793330669403,
-0.25068211555480957,
0.0349762924015522,
0.03634723275899887,
-0.3983874022960663,
-0.6592514514923096,
0.13929201662540436,
0.4346312880516052,
-0.20120885968208313,
0.3490439057350158... | |
notification, [see here for how to do that in Delphi](http://delphi.about.com/od/kbwinshell/l/aa052003a.htm)
The registry notification was on `HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces`. This notification event fires every time Windows obtains a new IP address, or makes any type of change to a... | [
-0.22605590522289276,
0.08823001384735107,
0.6339074969291687,
-0.14243873953819275,
-0.05509268492460251,
0.18496373295783997,
0.11729280650615692,
-0.08327499032020569,
-0.41584721207618713,
-0.7330462336540222,
-0.13851048052310944,
0.5662961602210999,
-0.35017478466033936,
0.3175868690... | |
= 0;
MAXLEN_IFDESCR = $100;
MAXLEN_PHYSADDR = 8;
MIB_IF_OPER_STATUS_NON_OPERATIONAL = 0;
MIB_IF_OPER_STATUS_UNREACHABLE = 1;
MIB_IF_OPER_STATUS_DISCONNECTED = 2;
MIB_IF_OPER_STATUS_CONNECTING = 3;
MIB_IF_OPER_STATUS_CONNECTED = 4;
MIB_IF_OPER_STATUS_OPERATIONAL = 5;
MIB_IF_TYPE_OTHER = 1;
M... | [
-0.31758108735084534,
-0.1366036981344223,
0.8174334764480591,
-0.09582545608282089,
0.30723875761032104,
0.07543481886386871,
0.4100155532360077,
-0.29752692580223083,
-0.43451282382011414,
-0.7413713932037354,
-0.5693409442901611,
0.1782972514629364,
-0.23792174458503723,
0.2773392796516... | |
MIB_IF_ADMIN_STATUS_TESTING = 3;
_MAX_ROWS_ = 20;
ANY_SIZE = 1;
type
MIB_IFROW = record
wszName: array[0 .. (MAX_INTERFACE_NAME_LEN * 2 - 1)] of ansichar;
dwIndex: longint;
dwType: longint;
dwMtu: longint;
dwSpeed: longint;
dwPhysAddrLen: longint;
bPhysAddr: arra... | [
-0.10242591053247452,
-0.13399671018123627,
0.23698365688323975,
-0.3212215006351471,
0.14331704378128052,
0.3432405889034271,
0.30834272503852844,
-0.36135128140449524,
-0.07722508162260056,
-0.40311896800994873,
-0.4300388991832733,
0.30913835763931274,
-0.12331081926822662,
0.3357563316... | |
longint;
dwInOctets: longint;
dwInUcastPkts: longint;
dwInNUcastPkts: longint;
dwInDiscards: longint;
dwInErrors: longint;
dwInUnknownProtos: longint;
dwOutOctets: longint;
dwOutUcastPkts: longint;
dwOutNUcastPkts: longint;
dwOutDiscards: longint;
dwOutErrors: longint;
dw... | [
-0.24487705528736115,
-0.6559509634971619,
0.35505786538124084,
-0.3040623664855957,
0.008076696656644344,
0.34102311730384827,
0.5278717279434204,
-0.4763960838317871,
-0.14374449849128723,
-0.4278087019920349,
-0.3548086881637573,
0.3976728916168213,
-0.1008184626698494,
0.32672849297523... | |
dwIndex: longint;
dwMask: longint;
dwBCastAddr: longint;
dwReasmSize: longint;
unused1: word;
unused2: word;
end;
type
_IfTable = record
nRows: longint;
ifRow: array[1.._MAX_ROWS_] of MIB_IFROW;
end;
type
_IpAddrTable = record
dwNumEntries: longint;
table: ... | [
-0.34010937809944153,
-0.11162986606359482,
0.734917163848877,
-0.4506066143512726,
0.09635131806135178,
0.4700935184955597,
0.3579710125923157,
-0.552790105342865,
-0.43243518471717834,
-0.6066722273826599,
-0.4895481467247009,
0.2429751604795456,
-0.32961052656173706,
0.2099524885416031,... | |
longint): longint; stdcall;
function Get_if_type(iType: integer): string;
function Get_if_admin_status(iStatus: integer): string;
function Get_if_oper_status(iStatus: integer): string;
implementation
function GetIfTable; stdcall; external 'IPHLPAPI.DLL';
function GetIpAddrTable; stdcall; external 'IPHLPAPI.DLL';
fu... | [
-0.24083591997623444,
-0.4441463053226471,
0.5768797397613525,
0.011071723885834217,
0.05767287313938141,
0.24875803291797638,
0.3264128267765045,
-0.4979267418384552,
-0.2372354418039322,
-0.29247796535491943,
-0.5001856088638306,
0.2921130955219269,
-0.4484096169471741,
0.021397342905402... | |
:= 'ATM';
71: sResult := 'IEEE 802.11';
131: sResult := 'Tunnel';
144: sResult := 'IEEE 1394 (Firewire)';
end;
Result := sResult;
end;
function Get_if_admin_status(iStatus: integer): string;
var
sResult: string;
begin
sResult := 'UNKNOWN';
case iStatus of
1: sResult := 'UP';
2: sResult... | [
-0.05491865798830986,
0.07943287491798401,
0.2666720151901245,
-0.024186236783862114,
0.3396783471107483,
0.10479888319969177,
0.5327609777450562,
-0.44189533591270447,
-0.12826396524906158,
-0.4136715233325958,
-0.6039259433746338,
0.3269316852092743,
-0.4471355378627777,
0.03588313609361... | |
:= 'UNREACHABLE';
2: sResult := 'DISCONNECTED';
3: sResult := 'CONNECTING';
4: sResult := 'CONNECTED';
5: sResult := 'OPERATIONAL';
end;
Result := sResult;
end;
end.
```
To use this unit from another unit, I created the following function, which populated a custom type called `TAdapterInfo` (dec... | [
-0.08446701616048813,
-0.17574891448020935,
0.5333470106124878,
0.11885226517915726,
0.22157169878482819,
0.12484639883041382,
0.5082412362098694,
-0.5291486978530884,
-0.2513335645198822,
-0.2817041575908661,
-0.2602402865886688,
0.28044867515563965,
-0.1494828760623932,
0.623094499111175... | |
dwPhysAddrLen: longint;
bPhysAddr: string;
dwAdminStatus: longint;
dwOperStatus: longint;
dwLastChange: longint;
dwInOctets: longint;
dwInUcastPkts: longint;
dwInNUcastPkts: longint;
dwInDiscards: longint;
dwInErrors: longint;
dwInUnknownProtos: longint;
dwOutOctets: longint... | [
-0.04564046487212181,
-0.7215964794158936,
0.13279101252555847,
-0.2801381051540375,
-0.22979959845542908,
0.38657698035240173,
0.5654236078262329,
-0.3574300706386566,
-0.1469794064760208,
-0.4086742401123047,
-0.582233190536499,
0.4183383285999298,
0.03257414326071739,
0.2753184139728546... | |
string;
sIpAddress: string;
sIpMask: string;
end;
```
//////////
```
function Get_EthernetAdapterDetail(var AdapterDataFound: TAdapterInfo): boolean;
var
pIfTable: ^_IfTable;
pIpTable: ^_IpAddrTable;
ifTableSize, ipTableSize: longint;
tmp: string;
i, j, k, m: integer;
ErrCode: longint;... | [
-0.18008774518966675,
-0.406923770904541,
0.7049986124038696,
-0.12613758444786072,
0.19490838050842285,
0.2805486023426056,
0.30860060453414917,
-0.16852080821990967,
-0.19919440150260925,
-0.6636325716972351,
-0.4827845096588135,
0.630765974521637,
-0.5320965647697449,
-0.218162193894386... | |
get the buffer size.
// TableSize returns the size needed.
ifTableSize := 0; // Set to zero so the GetIfTabel function
// won't try to fill the buffer yet,
// but only return the actual size it needs.
GetIfTable(pIfTable, ifTableSize, 1);
if (ifTableSize < SizeOf(MIB_IFROW) + Sizeof(longint)) th... | [
-0.2644858658313751,
-0.12194916605949402,
0.7090969085693359,
-0.46255195140838623,
0.3296031951904297,
0.18048593401908875,
0.5096369981765747,
-0.34579092264175415,
-0.3358447849750519,
-0.6164482831954956,
-0.431350439786911,
0.4092593193054199,
-0.2263023555278778,
0.08893624693155289... | |
end;
ipTableSize := 0;
GetIpAddrTable(pIpTable, ipTableSize, 1);
if (ipTableSize < SizeOf(MIB_IPADDRROW) + Sizeof(longint)) then
begin
bResult := False;
Result := bResult;
Exit; // less than 1 table entry?!
end;
// Second:
// allocate memory for the buffer and retrieve t... | [
-0.5625661015510559,
-0.09168551862239838,
0.6530854105949402,
-0.27846333384513855,
0.2859649062156677,
0.3270242512226105,
0.305195689201355,
-0.37472474575042725,
-0.2063511610031128,
-0.6028809547424316,
-0.5603911876678467,
0.22521278262138367,
-0.18800923228263855,
0.0619976036250591... | |
if ErrCode <> ERROR_SUCCESS then
begin
bResult := False;
Result := bResult;
Exit; // OK, that did not work.
// Not enough memory i guess.
end;
GetMem(pIpTable, ipTableSize);
ErrCode := GetIpAddrTable(pIpTable, ipTableSize, 1);
if ErrCode <> ERROR_SUCCESS then
begin
... | [
-0.4611697494983673,
-0.05194855481386185,
0.4609711170196533,
-0.3718436360359192,
0.24639028310775757,
0.22583352029323578,
0.5061352252960205,
-0.30199509859085083,
-0.0006112160626798868,
-0.6012015342712402,
-0.3338945508003235,
0.6274181008338928,
-0.14068618416786194,
-0.02029838971... | |
Exit;
end;
for k := 1 to pIpTable^.dwNumEntries do
begin
sAddr.S_addr := pIpTable^.table[k].dwAddr;
sMask.S_addr := pIpTable^.table[k].dwMask;
sIPAddressLine := Format('0x%8.8x', [(pIpTable^.table[k].dwIndex)]) +
'=' + Format('%s', [inet_ntoa(sAddr)]);
sIPMaskLine := For... | [
-0.6805135011672974,
-0.20966319739818573,
0.8217682242393494,
-0.14739087224006653,
0.11026262491941452,
0.4634751081466675,
0.4848727285861969,
-0.23483355343341827,
-0.1968691647052765,
-0.6203340888023376,
-0.6228368878364563,
0.1720443069934845,
-0.03428954631090164,
0.228619337081909... | |
SetLength(AdapterDataFound, pIfTable^.nRows); //initialize the array or records
for i := 1 to pIfTable^.nRows do
try
//if pIfTable^.ifRow[i].dwType=MIB_IF_TYPE_ETHERNET then
//begin
m := i - 1;
AdapterDataFound[m].dwIndex := 4;//(pIfTable^.ifRow[i].dwIndex);
AdapterData... | [
0.17258986830711365,
-0.746428906917572,
0.9113525152206421,
-0.07409099489450455,
0.1808810532093048,
-0.042716313153505325,
0.2670595049858093,
-0.6937671303749084,
-0.2782650291919708,
-0.7379246354103088,
-0.3515430986881256,
0.6374921202659607,
-0.3900904357433319,
0.04955022409558296... | |
IPAddresses.Values[Format('0x%8.8x', [(pIfTable^.ifRow[i].dwIndex)])];
AdapterDataFound[m].sIpMask :=
IPMasks.Values[Format('0x%8.8x', [(pIfTable^.ifRow[i].dwIndex)])];
AdapterDataFound[m].dwMtu := (pIfTable^.ifRow[i].dwMtu);
AdapterDataFound[m].dwSpeed := (pIfTable^.ifRow[i].dwSpeed);... | [
-0.5633265972137451,
-0.44387996196746826,
0.7645549774169922,
-0.03316571190953255,
0.05637628957629204,
0.5126935839653015,
0.4817145764827728,
-0.24213330447673798,
-0.4869045615196228,
-0.9969586730003357,
-0.6110920906066895,
0.5442880392074585,
-0.30764347314834595,
-0.10110130906105... | |
AdapterDataFound[m].dwInErrors := (pIfTable^.ifRow[i].dwInErrors);
AdapterDataFound[m].dwInUnknownProtos := (pIfTable^.ifRow[i].dwInUnknownProtos);
AdapterDataFound[m].dwOutNUcastPkts := (pIfTable^.ifRow[i].dwOutNUcastPkts);
AdapterDataFound[m].dwOutUcastPkts := (pIfTable^.ifRow[i].dwOutUcastPkt... | [
-0.33889099955558777,
-0.4073095917701721,
0.5922485589981079,
-0.23587894439697266,
-0.0018103395123034716,
0.40261662006378174,
0.3570440411567688,
-0.5690492391586304,
-0.22089384496212006,
-0.7488667964935303,
-0.7854776978492737,
0.6500358581542969,
-0.2624196410179138,
0.011363869532... | |
begin
if Length(tmp) > 0 then
tmp := tmp + '-' + format('%.2x', [pIfTable^.ifRow[i].bPhysAddr[j]])
else
tmp := tmp + format('%.2x', [pIfTable^.ifRow[i].bPhysAddr[j]]);
end;
if Length(tmp) > 0 then
begin | [
0.10999367386102676,
-0.07328883558511734,
0.5424006581306458,
-0.4014662504196167,
0.0237016212195158,
0.5643343925476074,
0.5776228308677673,
-0.42388325929641724,
-0.32441017031669617,
-0.46199607849121094,
-0.7312516570091248,
0.39219167828559875,
-0.33446627855300903,
-0.0454292297363... | |
AdapterDataFound[m].bPhysAddr := tmp;
end;
except
bResult := False;
Result := bResult;
Exit;
end;
finally
if Assigned(pIfTable) then
begin
FreeMem(pIfTable, ifTableSize);
end;
FreeAndNil(IPMasks);
FreeAndNil(IPAddresses);
end;
Result := bRes... | [
-0.20070087909698486,
-0.1541583091020584,
0.7374204993247986,
-0.1495230495929718,
0.12074398994445801,
0.3034282326698303,
0.32023876905441284,
-0.38419109582901,
-0.39060071110725403,
-0.5631656050682068,
-0.6511807441711426,
0.37937676906585693,
-0.4065527617931366,
-0.1089619323611259... | |
used this unit and almost exact same code to create a duplicate of `ifconfig -a`, which [can be found on github](https://github.com/MicksMix/ifconfig). I mainly did it as an exercise in teaching myself how to accomplish this task. | [
0.04035431891679764,
0.08776448667049408,
0.10030505806207657,
-0.3156801462173462,
-0.07163025438785553,
0.2904917597770691,
0.04369194805622101,
0.3695506155490875,
-0.41011175513267517,
-0.29953068494796753,
0.320462167263031,
0.2857091426849365,
-0.22593195736408234,
0.0228805057704448... | |
I use an SQL statement to remove records that exist on another database but this takes a very long time.
Is there any other alternative to the code below that can be faster? Database is Access.
email\_DB.mdb is from where I want to remove the email addresses that exist on the other database (table Newsletter\_Subscri... | [
0.16322118043899536,
0.4285377264022827,
0.45474302768707275,
-0.27421021461486816,
-0.08922453224658966,
-0.11195378005504608,
0.0850539356470108,
-0.3290391266345978,
-0.2868328392505646,
-0.5645238161087036,
0.23762384057044983,
0.4881473481655121,
-0.25866439938545227,
0.42572128772735... | |
Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = NewsletterConn
MM_editCmd.CommandText = SQLRemoveDupes
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
Set MM_editCmd = Nothing
```
EDIT: Tried the SQL below from one of the answers but I keep getting an error when running it:
SQL: DELETE FROM N... | [
0.2348601371049881,
0.2545318007469177,
0.7866494655609131,
-0.11206267029047012,
-0.23438909649848938,
-0.10634756088256836,
0.22275005280971527,
-0.3692844808101654,
-0.2407214641571045,
-0.895995557308197,
0.2725863456726074,
0.4725998640060425,
-0.4061558246612549,
0.41151323914527893,... | |
up a registry notification, [see here for how to do that in Delphi](http://delphi.about.com/od/kbwinshell/l/aa052003a.htm)
The registry notification was on `HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces`. This notification event fires every time Windows obtains a new IP address, or makes any type ... | [
-0.08481158316135406,
0.14071998000144958,
0.7445811033248901,
-0.01052090059965849,
-0.015213603153824806,
0.10596565157175064,
-0.09474946558475494,
-0.05813942849636078,
-0.6641494035720825,
-0.8351956009864807,
-0.1644202172756195,
0.4331880211830139,
-0.3301355838775635,
0.36246457695... | |
$100;
ERROR_SUCCESS = 0;
MAXLEN_IFDESCR = $100;
MAXLEN_PHYSADDR = 8;
MIB_IF_OPER_STATUS_NON_OPERATIONAL = 0;
MIB_IF_OPER_STATUS_UNREACHABLE = 1;
MIB_IF_OPER_STATUS_DISCONNECTED = 2;
MIB_IF_OPER_STATUS_CONNECTING = 3;
MIB_IF_OPER_STATUS_CONNECTED = 4;
MIB_IF_OPER_STATUS_OPERATIONAL = 5;
MIB_I... | [
-0.3025793731212616,
-0.049677833914756775,
0.7012952566146851,
0.009196607396006584,
0.3275972008705139,
0.03921527415513992,
0.48791831731796265,
-0.2659028470516205,
-0.36887508630752563,
-0.7635001540184021,
-0.424944132566452,
0.2390047013759613,
-0.26033562421798706,
0.24494235217571... | |
= 2;
MIB_IF_ADMIN_STATUS_TESTING = 3;
_MAX_ROWS_ = 20;
ANY_SIZE = 1;
type
MIB_IFROW = record
wszName: array[0 .. (MAX_INTERFACE_NAME_LEN * 2 - 1)] of ansichar;
dwIndex: longint;
dwType: longint;
dwMtu: longint;
dwSpeed: longint;
dwPhysAddrLen: longint;
bPhysAddr... | [
0.051652099937200546,
-0.25717872381210327,
0.3788022994995117,
-0.2947423756122589,
-0.03406215086579323,
0.3277111053466797,
0.2530795931816101,
-0.4638327956199646,
-0.20518401265144348,
-0.3781818151473999,
-0.33580726385116577,
0.43221986293792725,
-0.136203333735466,
0.32823175191879... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.