text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
[GhostScript](http://www.ghostscript.com/) from your code.
Additionally you might take a look at the [rGhost Gem](http://github.com/shairontoledo/rghost/tree/master) which (as the documentation states) is a "a document creation and conversion API" which essentially should be a GhostScript Wrapper for Ruby. | [
0.26583778858184814,
0.4307240843772888,
0.23957018554210663,
0.0008182306191883981,
-0.32712048292160034,
-0.2779730558395386,
0.5491338968276978,
-0.3287128210067749,
-0.24656909704208374,
-0.25193703174591064,
-0.16298122704029083,
0.4175232946872711,
-0.08998223394155502,
0.24316336214... | |
I'm just getting started with APR and it seems that there are two supported versions developed side-by-side: <http://apr.apache.org/>
The docs don't explain the difference between 1.3.x and 0.9.x... Can anyone please shed light on the matter? Or in short, which should I use?
Unfortunately you can't use delegates as pr... | [
0.32578593492507935,
0.27696192264556885,
0.2669259309768677,
-0.09813811630010605,
-0.4164007902145386,
-0.10468535870313644,
-0.011282142251729965,
-0.3496403098106384,
-0.26637667417526245,
-0.6702748537063599,
0.41511690616607666,
0.39211055636405945,
-0.05070912837982178,
0.0475664362... | |
doing this :( Maybe one day we'll get the `infoof` operator... quite how it would be exposed, I'm not sure. (It would be good to keep the delegate type information in the attribute.) | [
0.5814281702041626,
-0.10939021408557892,
0.05869394913315773,
0.5277884602546692,
0.3030374348163605,
-0.26825040578842163,
0.0552835687994957,
-0.2247980386018753,
-0.26164084672927856,
-0.4217650294303894,
0.21999196708202362,
0.5724655985832214,
0.09264712035655975,
0.00451856525614857... | |
Windows application manifests have a very loose grammar — unrecognized parts are ignored. How can I diagnose which parts are recognized and which are not?
The problem leading to this question is with an application that has a side-by-side UAC manifest with a *requestedExecutionLevel* of *highestAvailable* specified. T... | [
0.21390992403030396,
0.04375437647104263,
0.32890498638153076,
0.2985433340072632,
-0.06124886870384216,
-0.3984376788139343,
0.2933579683303833,
0.11214396357536316,
-0.32653316855430603,
-0.7356370091438293,
-0.18669962882995605,
0.3888295888900757,
-0.3153262436389923,
0.186149552464485... | |
timestamp of executable & manifest?
What does "sxstrace" run from an elevated command prompt return?
Could you post your manifest somewhere? | [
0.2675383687019348,
-0.15487372875213623,
0.46466320753097534,
0.4253215193748474,
0.28204435110092163,
-0.1366713047027588,
-0.0008592708618380129,
0.2752183973789215,
-0.25999537110328674,
-0.5377820730209351,
0.039196643978357315,
0.2523294687271118,
0.020680956542491913,
-0.05774035677... | |
There doesn't seem to be any method of Socket, or ListenSocket that will allow me to conditionally accept connections.
When I recieve a SYN, I want to be able decide if I want this connection depending on the source, if I send a SYN/ACK back (accept connection) or a RST (a forceful reject).
Is there any want to achie... | [
0.19859792292118073,
-0.0026857706252485514,
0.17534364759922028,
0.09570048004388809,
-0.20492570102214813,
-0.023858701810240746,
0.3793817460536957,
-0.03280249238014221,
-0.2647750973701477,
-0.4320201575756073,
-0.1606840044260025,
0.5223128795623779,
-0.07866066694259644,
0.244627952... | |
to conditionally accept using a TCP socket connection. You can only filter a connection once it's been established.
But what exactly are you trying to filter on? At the point you get the SYN packet all you know is the IP address of the source and the port they are trying to connect to. It seems like it would be much b... | [
0.2364605814218521,
-0.3937222361564636,
-0.29214027523994446,
0.18419024348258972,
-0.15363337099552155,
-0.15852060914039612,
0.10455042123794556,
-0.17932596802711487,
-0.08074207603931427,
-0.5829561352729797,
0.2631508409976959,
0.1808398962020874,
-0.4941342771053314,
0.2086846232414... | |
We develop a network library that uses TCP and UDP sockets.
This DLL is used by a testclient, which is started multiple times at the same PC for a load test.
In Windows Vista, it is no problem to start the testclient many times.
In Windows XP, starting it up to 5 times is no problem, but if we start it 6 times or more... | [
0.2675841748714447,
0.05762369558215141,
0.08727245777845383,
0.2968621253967285,
0.13772393763065338,
-0.301604300737381,
0.15051323175430298,
-0.09116712212562561,
-0.22380724549293518,
-0.5703430771827698,
0.006158466450870037,
0.44462671875953674,
-0.3349067270755768,
0.174316868185997... | |
of all of them.
Our DLL is compiled with MSVC and uses Boost and Crypto++ libs (statically linked).
Any idea why the different processes could influence each other?
An idea: You have some bug.
Seriously, there is no way to know what's your problem without any information what so ever.
When a process crashes it u... | [
0.3809475600719452,
0.07135402411222458,
0.06426810473203659,
0.41643664240837097,
0.16499505937099457,
-0.40748143196105957,
0.21035705506801605,
0.10560273379087448,
-0.2715795040130615,
-0.4935879707336426,
-0.07242290675640106,
0.46215856075286865,
-0.5289751291275024,
0.20407198369503... | |
problems, this one is likely to be solved by **"Just debugging it"** | [
-0.12249928712844849,
0.27395784854888916,
0.4696669280529022,
0.3749985992908478,
0.05639057233929634,
0.0364111103117466,
0.1994851529598236,
0.291808158159256,
-0.41174885630607605,
-0.4788338541984558,
-0.1544930338859558,
0.5027124881744385,
-0.04729039594531059,
-0.1398908644914627,
... | |
I realize there are similar questions on SO, but they don't quite solve my problem.
I would like a method that, given a Class object, will invoke the "main" method, that is to say, public static void main, on that Class (if it exists) and capture the console output of that main method. The class doing the invocation i... | [
0.1375289261341095,
0.0262175090610981,
-0.20568035542964935,
0.016777008771896362,
0.11466261744499207,
-0.1162281408905983,
0.03189900144934654,
0.10903975367546082,
-0.011363194324076176,
-0.4254416525363922,
-0.041487086564302444,
0.46220719814300537,
-0.47439369559288025,
0.3675013482... | |
Thread {
private Class testClass;
public Output(Class clazz) {
this.testClass = clazz;
}
private Method getMainMethod(Class clazz) {
Method[] methods = clazz.getMethods();
for (Method method : methods) {
if (isMainMethod(method)) {
return method; | [
0.24361887574195862,
-0.4241359531879425,
0.40452486276626587,
0.018907299265265465,
0.32841211557388306,
0.028909957036376,
0.4208530783653259,
-0.08862920105457306,
-0.11219857633113861,
-0.2370736300945282,
-0.057265933603048325,
0.5022221207618713,
-0.4765388071537018,
0.63179546594619... | |
}
}
return null;
}
private Boolean isMainMethod(Method method) {
return (method.getName().equals("main") &&
Modifier.isStatic(method.getModifiers()) &&
method.getReturnType().equals(Void.class));
}
public void run() {
Method mainMethod =... | [
0.046735141426324844,
-0.31168118119239807,
0.2075803279876709,
-0.12915509939193726,
0.1324639618396759,
0.14457997679710388,
0.5097266435623169,
-0.2561432123184204,
0.02010643482208252,
-0.2615872621536255,
-0.18239594995975494,
0.47594910860061646,
-0.59937584400177,
0.2242758125066757... | |
if ((mainMethod = getMainMethod(this.testClass)) == null) {
//if there's no static void main method, throw exception
throw new YouFuckedItUpException();
}
mainMethod.invoke(this.testClass, new String[0]);
return heresWhereImStuckIWantToCaptureTheConsoleOutputAndReturnIt... | [
0.02197468839585781,
-0.07367576658725739,
0.3082500696182251,
-0.11165859550237656,
0.34951135516166687,
-0.04673071950674057,
0.5816104412078857,
-0.31638020277023315,
-0.008595841005444527,
-0.47427037358283997,
-0.10446551442146301,
0.6360123157501221,
-0.16786564886569977,
0.250060915... | |
the method being invoked. Any help someone can give would be much appreciated.
Thanks in advance!
**EDIT:** This is NOT for testing only, this will eventually be something put into production.
**EDIT 2**: This will need to be thread-safe. Multiple main methods will be invoked by other threads possibly at the same ti... | [
0.35982397198677063,
-0.008231563493609428,
0.18821291625499725,
0.20968477427959442,
-0.02193504199385643,
-0.20581188797950745,
0.2302437722682953,
-0.23093938827514648,
-0.38916248083114624,
-0.5208912491798401,
0.06122846156358719,
0.3495334982872009,
-0.38237687945365906,
-0.069274514... | |
`StdErr` and/or `StdIn`.
*Note* Since everything runs in it's own process, there should be no issues with thread-safety. However you will still have to find the location, the .class file (or at least the root) is located in, so that you can run/create the Process with `java here.goes.your.ClassName`. | [
0.1339287906885147,
0.007051121909171343,
0.011366352438926697,
-0.1406184434890747,
0.03594742342829704,
-0.19288557767868042,
0.5050140023231506,
0.13001684844493866,
-0.3672567903995514,
-0.8151927590370178,
-0.14566835761070251,
-0.03907730430364609,
0.02446570433676243,
0.368658363819... | |
i have a COM object that i am using in dotnet and i have to call it always on the same thread. The issue is that conceptually it is being for multiple things throughout the program. What is the best way for ensuring that all uses of this object on called on this one specific background thread? Example code would be gre... | [
0.5508264303207397,
-0.1681884527206421,
0.34480053186416626,
0.2203330546617508,
0.09480969607830048,
0.23647473752498627,
-0.13782480359077454,
0.15560829639434814,
-0.4449271559715271,
-0.862171471118927,
0.3291378319263458,
0.5629757046699524,
-0.4635871648788452,
0.32640114426612854,
... | |
order to hide the multi-threadedness to callers (ie. expose the wrapped calls as synchronous methods).
If this is a WinForms project, perhaps you could cut corners by simply using the GUI thread and the Control.Invoke method. (But if the calls take a long time, it is not a good idea, since you would be blocking the UI... | [
0.21746207773685455,
-0.4075937867164612,
-0.011909342370927334,
0.4490167796611786,
-0.03515598922967911,
-0.4829176366329193,
0.2978895604610443,
-0.11387099325656891,
-0.04127819463610649,
-0.5950390696525574,
-0.10730455070734024,
0.49615365266799927,
-0.37367692589759827,
0.0549025647... | |
Is there a one line command in `tcsh` to change the extension of a set of files? In the various DOS shells, I used to use the following:
```
ren *.abc *.def
```
This would rename all files ending in `.abc` to end instead with `.def`. In `sed` terms this would perform something like the following:
```
sed -e 's/\(.\... | [
0.39522719383239746,
-0.1277858465909958,
0.3792058527469635,
-0.16211524605751038,
0.033600687980651855,
0.10230360925197601,
0.09593884646892548,
-0.04101339727640152,
-0.2093450278043747,
-0.596254825592041,
-0.3071965277194977,
0.48192694783210754,
-0.46622493863105774,
0.4160802364349... | |
that you are inside the `foreach` loop. You could also turn it into a shell script and call that shell script.
```
foreach n ( `ls *.abc` )
set base = `basename $n .abc`
mv $n $base.def
end
``` | [
0.39564186334609985,
0.3429639935493469,
0.24549922347068787,
-0.6782142519950867,
0.42586538195610046,
0.08880104124546051,
0.13536296784877777,
-0.17925243079662323,
0.030728861689567566,
-0.4187678098678589,
-0.19295039772987366,
0.5777864456176758,
-0.5637906789779663,
0.13781276345252... | |
I have a database table, let's call it Countries. Countries all have names, short names and continents. Let's assume that the longest name of any country in the world is 54 characters long. Should I set the maximum size to 54 or should I set it to e.g. 64 or something else? Will my choice affect queries or storage in a... | [
0.06439786404371262,
0.20571750402450562,
0.03699299320578575,
0.20318590104579926,
-0.010796686634421349,
0.07954462617635727,
0.17085415124893188,
0.15882620215415955,
-0.36990082263946533,
-0.40996286273002625,
-0.032382406294345856,
-0.20217452943325043,
0.04760538786649704,
0.54489845... | |
the database can do better search-optimizations with 64 chars, it will expand the data-field internally automatically. If it doesn't, you will have saved 12 chars per row.
I don't think that's something you should worry about, just write down what you need. | [
0.2287004590034485,
0.28217798471450806,
0.09242530912160873,
0.18566454946994781,
0.05769799277186394,
0.2846927046775818,
0.31474727392196655,
-0.002930919174104929,
-0.37565842270851135,
-0.6389255523681641,
0.39263302087783813,
0.33134010434150696,
0.06177563965320587,
0.25510454177856... | |
As a developer, I've often downloaded and run
```
./configure
./make
./make install
```
to install apps onto my Linux system. But I've never been quite clear on the best place to keep the downloaded directory. My local `Desktop` is the default location, but I'd like to know what the best "official" place to keep it ... | [
0.720170795917511,
0.29358068108558655,
0.3799336850643158,
-0.199452742934227,
0.14217399060726166,
-0.07643718272447586,
0.15151536464691162,
0.4570513367652893,
-0.32429465651512146,
-0.9254615902900696,
-0.33397287130355835,
0.7849123477935791,
-0.08331117779016495,
0.21154643595218658... | |
Hi I'm stuck doing this, not sure how to go about it.
If I have two binary trees, how would I check if the have the same shape? Data in the nodes doesn't matter, just if the tree structures are equal.
Any ideas on how to solve this problem?
You can easily do that with recursion. This following code works because two ... | [
-0.09772952646017075,
-0.07788620889186859,
0.42245736718177795,
-0.11274781823158264,
-0.42109090089797974,
-0.007460020948201418,
0.2427688091993332,
-0.1406179815530777,
-0.13368967175483704,
-0.49798867106437683,
0.3558494746685028,
0.24085429310798645,
-0.28970474004745483,
0.14311945... | |
return true;
// Empty tree is not equal to a non-empty one
if ((lhs == null && rhs != null)
|| (lhs != null && rhs == null))
return false;
// otherwise check recursively
return equalTrees(lhs.left(), rhs.left())
&& equalTrees(lhs.right(), rhs.right())
}
```
To check two trees... | [
-0.3063194155693054,
-0.008450635708868504,
0.2182857096195221,
-0.08778630942106247,
0.12408701330423355,
0.2592734694480896,
0.41421613097190857,
-0.6472131013870239,
-0.18090298771858215,
-0.4557587802410126,
-0.20787033438682556,
0.5339400172233582,
-0.40212610363960266,
-0.17192058265... | |
I have a file "`update.php`" which does some MySQL operations. A cron job executes this file every 5 minutes. Unfortunately, I cannot execute the cron job more often.
So I had the idea that I could add ...
```
<html>
<head>
<meta http-equiv="refresh" content="2; URL=<?php echo $_SERVER['SCRIPT_NAME']; ?>" />
</hea... | [
0.35144057869911194,
0.4820334017276764,
0.9089350700378418,
-0.15926051139831543,
-0.12173489481210709,
0.05837171524763107,
0.3242107331752777,
-0.2192566990852356,
-0.21309609711170197,
-0.5858495235443115,
0.20220761001110077,
0.5296248197555542,
0.11516539007425308,
0.1252322345972061... | |
that won't work, because it's a browser feature to refresh the page.
Question: Why can't you set the cron job to run more frequently that every 5 minutes?
If there is no other option then you could create you're own daemon to do the job more frequently.
e.g.
Your php script could:
* Run
* Wait 60 seconds
* Run
* (... | [
0.2472446709871292,
0.07718710601329803,
0.7734875082969666,
-0.18123435974121094,
0.2056957483291626,
0.04232991486787796,
0.5702431201934814,
-0.1739843785762787,
-0.40210744738578796,
-0.6690053939819336,
-0.19577518105506897,
0.6631441116333008,
-0.2779105305671692,
0.30474838614463806... | |
every 5 minutes.
There seems some confusion about what a cronjob is, and how it is run.
[cron](http://en.wikipedia.org/wiki/Cron) is a daemon, which sits in the background, and run tasks through the shell at a schedule specified in [crontab](http://unixhelp.ed.ac.uk/CGI/man-cgi?crontab+5)s.
Each user has a crontab... | [
0.24361450970172882,
0.0955987274646759,
0.6328422427177429,
-0.07729407399892807,
0.22109344601631165,
0.1065010204911232,
0.1499650627374649,
0.17555131018161774,
-0.6797527074813843,
-0.4930844306945801,
-0.4955236315727234,
0.3838111162185669,
0.11202819645404816,
0.06537385284900665,
... | |
$HOME/bin/monthly
# run at 10 pm on weekdays, annoy Joe
0 22 * * 1-5 mail -s "It's 10pm" joe%Joe,%%Where are your kids?%
23 0-23/2 * * * echo "run 23 minutes after midn, 2am, 4am ..., everyday"
5 4 * * sun echo "run at 5 after 4 every sunday"
```
So to run every five minutes:
```
*/5 * * * * echo "This wi... | [
0.30292215943336487,
0.2626728415489197,
0.5016056895256042,
-0.47328615188598633,
0.3012160658836365,
0.345405250787735,
0.43680539727211,
-0.08890428394079208,
-0.1939590871334076,
-0.6511668562889099,
-0.13237793743610382,
0.5020453333854675,
-0.2355547994375229,
-0.21807733178138733,
... | |
from the commands are emailed to the owner of the crontab (or as specified by MAILTO).
This means if you run something every minute it will email you every minute, unless you ensure all normal output is suppressed or redirected.
The commands are run as the user who owns the crontab, which contrasts with the scripts r... | [
0.10851278156042099,
0.06501311808824539,
0.6620228886604309,
0.15303854644298553,
-0.04584382474422455,
-0.1497955024242401,
0.12202560156583786,
0.3398353159427643,
-0.35833218693733215,
-0.20435108244419098,
-0.7499133348464966,
0.5811541080474854,
-0.2506605386734009,
0.168123617768287... | |
the web-server. Basically you have to ensure that the permissions remain correct.
Now, I'm not sure that this is the system you are refering to. If you mean something else by `cronjob` then the above might not apply.
If you want to do something that your current host is not letting you do, then rather than hacking ar... | [
0.4337352216243744,
0.19277840852737427,
0.2777416408061981,
0.2936791479587555,
-0.015014607459306717,
-0.3083903193473816,
-0.013112800195813179,
0.28051045536994934,
-0.3485872447490692,
-0.5510390400886536,
-0.23904924094676971,
0.7561056613922119,
-0.3833228349685669,
0.38436752557754... | |
[vartec](https://stackoverflow.com/questions/741910/how-can-i-make-my-php-based-cron-job-execute-more-often/755186#755186)'s suggestion. However that may not solve your problems. | [
0.25332942605018616,
-0.06909270584583282,
0.5387530326843262,
0.08782905340194702,
-0.109140545129776,
-0.20098431408405304,
0.49830082058906555,
0.00022319823619909585,
-0.33042263984680176,
-0.3208599090576172,
-0.06222563982009888,
0.7695309519767761,
-0.003321979660540819,
0.019087960... | |
There is a field in the ethernet header called the ethernet type. I am writing a communication library in windows using raw ethernet frames. What should I do to take the Ethernet type into consideration? The one I must use is 0xBEEF. Does this mean I can't use anything like NDIS?
The best thing to do is to [read about ... | [
0.5604568719863892,
0.08524810522794724,
0.38172847032546997,
-0.023108795285224915,
-0.15745681524276733,
-0.24689893424510956,
0.058383166790008545,
-0.24410173296928406,
-0.1275634467601776,
-0.7217507362365723,
0.2620910406112671,
0.4414459764957428,
-0.6079565286636353,
0.186982497572... | |
the frame. You will merely have to have your software installed on the receiving end to interpret the data. | [
0.5202602744102478,
0.04611390084028244,
0.4620780348777771,
0.5872650742530823,
0.13141077756881714,
0.24572300910949707,
-0.07126486301422119,
-0.27074649930000305,
0.005067829042673111,
-0.3662508428096771,
-0.1927361637353897,
0.6740752458572388,
-0.15960228443145752,
-0.02312033250927... | |
I have a "start page" on my application that is just a `QWebView` widget that downloads a page from my server.
When the user clicks on a link I'd like it to open in their default browser, not in the widget.
Is there a way to do this with `QWebView`? Or should I take a different approach?
Just call QWebPage::setLinkD... | [
0.19263173639774323,
0.07293934375047684,
0.5385958552360535,
-0.05714378505945206,
-0.03961034119129181,
-0.02419826202094555,
0.14615659415721893,
-0.041286636143922806,
-0.010289433412253857,
-0.9981702566146851,
0.002512623555958271,
0.5323672294616699,
-0.24525080621242523,
0.36530369... | |
often contains the default.
Or use [QDesktopServices::openUrl](https://doc.qt.io/qt-5/qdesktopservices.html#openUrl) [as suggested by gnud in a comment] | [
-0.06738888472318649,
-0.0259904433041811,
0.2579745948314667,
-0.022461578249931335,
-0.04270520433783531,
-0.33702218532562256,
-0.012982738204300404,
0.15137816965579987,
-0.11524374037981033,
-0.5359441637992859,
-0.7067122459411621,
0.2430713176727295,
-0.3930223286151886,
-0.00476884... | |
How should a latex source code listing look like to produce an output like in known books, for example one for the Spring Framework? I've tried with the latex listings package but wasn't able to produce something that looked as nice as the one below. So I'm primarely interested in the formatting instructions to produce... | [
0.1368206888437271,
-0.26475989818573,
-0.007067196071147919,
0.08518137037754059,
-0.034047774970531464,
0.3641057312488556,
0.0729190781712532,
-0.49515336751937866,
-0.31910550594329834,
-0.402850866317749,
-0.13516026735305786,
0.5166753530502319,
-0.10201621800661087,
-0.4960815608501... | |
% Location of line numbers
numberstyle=\tiny, % Style of line numbers
% stepnumber=2, % Margin between line numbers
numbersep=5pt, % Margin between line numbers and text
tabsize=2, | [
-0.38314223289489746,
0.0648970752954483,
0.5203287601470947,
-0.05967579036951065,
-0.026967396959662437,
0.38430291414260864,
0.5387484431266785,
-0.17140761017799377,
0.15055593848228455,
-0.7317467331886292,
-0.32462143898010254,
-0.0989680290222168,
0.0026884078979492188,
-0.087945051... | |
% Size of tabs
extendedchars=true,
breaklines=true, % Lines will be wrapped
keywordstyle=\color{red},
frame=b,
% keywordstyle=[1]\textbf,
% keywordstyle=[2]\textbf,
% keywordstyle=[3]\textbf,
% keywordstyle=[4]\textbf, \sqrt{\sqrt{}}
stringstyle=\color{white}\ttfamily, %... | [
-0.03736519441008568,
-0.23137469589710236,
0.8384261727333069,
-0.24474717676639557,
-0.17592570185661316,
0.3445889353752136,
0.46007582545280457,
-0.3674289584159851,
-0.1689062863588333,
-0.4075252413749695,
-0.25368231534957886,
0.20492082834243774,
-0.3617238402366638,
-0.09374290704... | |
showstringspaces=false
}
\lstloadlanguages{ % Check documentation for further languages ...
% [Visual]Basic,
% Pascal,
% C,
% C++,
% XML,
% HTML,
Java
}
% \DeclareCaptionFont{blue}{\color{blue}}
% \captionsetup[lstlisting]{singlelinecheck=false, labelfont={blue}, textfont={blue}}
\u... | [
0.2860502004623413,
-0.12256705015897751,
0.4689788222312927,
-0.1642724722623825,
-0.13216470181941986,
-0.10304979979991913,
0.05570440739393234,
0.030495136976242065,
-0.17401458323001862,
-0.7537043690681458,
0.16035817563533783,
0.13599777221679688,
-0.4080829322338104,
-0.09709608554... | |
package, see [the manual (PDF)](http://tug.ctan.org/tex-archive/macros/latex/contrib/caption/caption-eng.pdf). You would probably need to create your own custom caption format, as described in chapter 4 in the manual.
**Edit:** Tested with MikTex:
```
\documentclass{report}
\usepackage{color}
\usepackage{xcolor}
\us... | [
0.22786319255828857,
-0.032886769622564316,
0.5611891746520996,
-0.17498679459095,
0.133919358253479,
-0.4444290101528168,
0.15365208685398102,
-0.5026244521141052,
-0.0006832475191913545,
-0.48640498518943787,
-0.6093892455101013,
0.6424326300621033,
-0.30762991309165955,
-0.2828493416309... | |
We have a SharePoint server that is version something like 12.0.4 and we are trying to import a site collection that was exported from another SharePoint server. The version there is somthing like 12.0.0. We have the export but we no longer have access to the server. How do we import the site from a lower version into ... | [
0.5116955637931824,
-0.08951050043106079,
0.2597106695175171,
0.18141011893749237,
-0.08982833474874496,
-0.3665841519832611,
0.3184886872768402,
0.2318582683801651,
-0.47926145792007446,
-0.5681731104850769,
0.11642316728830338,
0.4949386715888977,
-0.41208523511886597,
0.1032000035047531... | |
This is most easily done using the `caption` package. For instructions how to use this package, see [the manual (PDF)](http://tug.ctan.org/tex-archive/macros/latex/contrib/caption/caption-eng.pdf). You would probably need to create your own custom caption format, as described in chapter 4 in the manual.
**Edit:** Test... | [
-0.01225213147699833,
0.0509050190448761,
0.7435066103935242,
-0.021036246791481972,
0.20816810429096222,
-0.4282730221748352,
0.14542360603809357,
-0.4367590844631195,
-0.1304347664117813,
-0.6316561698913574,
-0.6035308241844177,
0.4989843964576721,
-0.037066876888275146,
-0.178349003195... | |
I want to create a URL shortener service where you can write a long URL into an input field and the service shortens the URL to "`http://www.example.org/abcdef`".
Instead of "`abcdef`" there can be any other string with six characters containing `a-z, A-Z and 0-9`. That makes 56~57 billion possible strings.
My approa... | [
0.598456084728241,
0.1929582804441452,
0.35960566997528076,
-0.1064852625131607,
-0.1654352992773056,
0.4065142273902893,
0.037028200924396515,
-0.25568100810050964,
0.04120568558573723,
-0.4078708589076996,
0.2372627854347229,
0.2967604398727417,
-0.3641397953033447,
0.38667061924934387,
... | |
of it. This hash should then be inserted as "`short`". But what sort of hash should I build? Hash algorithms like MD5 create too long strings. I don't use these algorithms, I think. A self-built algorithm will work, too.
My idea:
For "`http://www.google.de/`" I get the auto-increment id `239472`. Then I do the follow... | [
0.13538198173046112,
0.12897127866744995,
0.2068166434764862,
-0.1878516972064972,
0.09087380766868591,
-0.07679343968629837,
0.12946224212646484,
-0.21176046133041382,
-0.16842585802078247,
-0.19065909087657928,
-0.06514481455087662,
0.46237918734550476,
-0.21238066256046295,
0.1482672989... | |
a better idea?
> *Due to the ongoing interest in this topic, I've [published an efficient solution to GitHub](https://github.com/delight-im/ShortURL), with implementations for [JavaScript](https://github.com/delight-im/ShortURL/blob/master/JavaScript/ShortURL.js), [PHP](https://github.com/delight-im/ShortURL/blob/mast... | [
0.1876128911972046,
-0.07903014868497849,
0.23533384501934052,
-0.021375684067606926,
0.0866285115480423,
0.1779872328042984,
0.1026926040649414,
-0.6708115935325623,
-0.28883597254753113,
-0.5858065485954285,
-0.12087312340736389,
0.30517756938934326,
-0.3517640233039856,
-0.1588241159915... | |
will make *f(x1) = f(x2)*,
* and for every *y* you must be able to find an *x* so that *f(x) = y*.
### How to convert the ID to a shortened URL
1. Think of an alphabet we want to use. In your case, that's `[a-zA-Z0-9]`. It contains *62 letters*.
2. Take an auto-generated, unique numerical key (the auto-incremented `i... | [
0.24419553577899933,
0.10642629116773605,
0.4882018566131592,
-0.011113148182630539,
-0.06006787717342377,
0.22087782621383667,
0.11454173177480698,
-0.48857060074806213,
-0.09961634129285812,
-0.6494097709655762,
-0.2668028771877289,
0.48026710748672485,
-0.23617471754550934,
-0.022994613... | |
pseudo-code example:
```
digits = []
while num > 0
remainder = modulo(num, 62)
digits.push(remainder)
num = divide(num, 62)
digits = digits.reverse
```
Now map the *indices 2 and 1* to your alphabet. This is how your mapping (with an array for example) could look like:
```
0 → a
1 → b
...
25 → z
...
52 → ... | [
0.1463913768529892,
0.24075213074684143,
0.5529203414916992,
-0.18835994601249695,
-0.11060033738613129,
0.18355825543403625,
0.23523762822151184,
-0.3033151626586914,
-0.08742616325616837,
-0.5307720303535461,
-0.22061075270175934,
0.1684819608926773,
-0.3730487823486328,
0.43395617604255... | |
and 0th letter in the alphabet".
e9a62 = `[4,61,0]` = 4×622 + 61×621 + 0×620 = 1915810
2. Now find your database-record with `WHERE id = 19158` and do the redirect.
### Example implementations (provided by commenters)
* [C++](https://gist.github.com/jaytaylor/a11fadf61a869ade0dfe568606b216c8#file-base64-url-shortene... | [
-0.16297604143619537,
0.541669487953186,
0.369236022233963,
-0.05862611532211304,
-0.04550418257713318,
0.30605563521385193,
0.22790692746639252,
-0.20646677911281586,
-0.36254045367240906,
-0.49197807908058167,
-0.4238010346889496,
0.21071107685565948,
-0.35618168115615845,
0.068397358059... | |
Is there any documentation on qpThreads? In what way is it different from pthreads?
Found some documentation finally.
[Sourceforge qpthreads](http://sourceforge.net/docman/display_doc.php?docid=21185&group_id=100112) | [
0.10923925042152405,
0.025257129222154617,
0.41956108808517456,
-0.11764145642518997,
-0.09085319936275482,
0.07041838020086288,
0.15570466220378876,
-0.01707100123167038,
-0.24522998929023743,
-0.4114437401294708,
-0.0026882882229983807,
0.18685205280780792,
-0.05725722387433052,
0.204727... | |
Is there any difference between makefile in Windows and Linux?
If I know how to use it in Linux, is it necessary to learn
something new when in Windows system?
In addition to what [iftrue](https://stackoverflow.com/users/78182/iftrue) note that Microsoft has a `Makefile` based build tool called [`nmake`](http://msdn.... | [
0.451374351978302,
-0.22279837727546692,
-0.1556774079799652,
-0.07069643586874008,
0.2572290599346161,
-0.04380788281559944,
0.16369488835334778,
-0.11540092527866364,
0.0945124551653862,
-0.6248615980148315,
-0.11691552400588989,
0.41148027777671814,
-0.25317227840423584,
0.0034963446669... | |
The company I work for creates applications for the Blackberry platform.
We've been working on a proprietary "analytics system" that allows us to embed code within our applications and have the applications report back some stats to our central servers every time they're run. Currently, the system works ok; however it... | [
0.4521004557609558,
0.4912862181663513,
0.3172646164894104,
-0.02711198851466179,
0.08576329797506332,
0.11740025132894516,
0.3972017765045166,
0.1961471438407898,
-0.0033994819968938828,
-0.2739464342594147,
0.2766641080379486,
0.3034393787384033,
-0.023419689387083054,
-0.163490697741508... | |
thousands of hits per hour without a problem. That's not really a problem.
The problem is showing the stats. We've built a display panel similar to Mint's (haveamint.com), it shows the hits over each hour, the past days, months, weeks, years...etc. The fist version ran straight queries pulling data from the hits table... | [
0.30372655391693115,
0.36983931064605713,
0.4071408212184906,
0.3976247012615204,
-0.23965929448604584,
0.2346406728029251,
0.12704674899578094,
0.10097171366214752,
-0.5393638610839844,
-0.3836996555328369,
0.389852374792099,
0.1384400874376297,
0.11603821814060211,
0.08814895898103714,
... | |
This works amazing and it's incredibly scalable; however, it only works for 1 timezone. Since the entire company has access to this, we're dealing with a few hundred users in various timezones. What I define as "Today" in San Jose is MUCH different than what my colleague in London defines as Today. Since the current so... | [
0.1389257311820984,
0.21071189641952515,
0.4182223677635193,
0.31803014874458313,
0.7586011290550232,
-0.1941433548927307,
0.3572419285774231,
0.3280324935913086,
-0.41779565811157227,
-0.7459885478019714,
-0.09312834590673447,
-0.2341187745332718,
-0.10034961253404617,
0.34697163105010986... | |
data by 40...that's terrible to me and given that the caches can be very large, multiplying it just sounds like a bad idea; plus, when we go to process the queue, it's going to take a lot more CPU time to put them in 40 different caches.
Any one else have a better idea of how to solve this problem?
(Sorry for such a... | [
0.3097052276134491,
-0.1368928998708725,
0.5082539319992065,
0.4641503691673279,
0.2939929962158203,
0.18178164958953857,
0.1327349692583084,
0.05571644380688667,
-0.5606512427330017,
-0.4869026839733124,
0.14857950806617737,
0.41990822553634644,
-0.14051268994808197,
0.24756096303462982,
... | |
normalized to UTC.
With 30-minute buckets, if a user requests hourly data for 1 - 2PM from -4.5 UTC you can fetch data for 5:30 - 6:30PM from your system and show that. If you store data in one-hour increments you can't service requests to users in time zones with N + 0.5 hour differences.
For daily numbers you would... | [
0.1799442023038864,
-0.5305280089378357,
0.8465350270271301,
0.28683510422706604,
-0.06326472014188766,
0.3579862117767334,
0.1559506505727768,
0.058042969554662704,
-0.5508188009262085,
-0.4734748899936676,
0.04000229015946388,
0.39552319049835205,
-0.14213913679122925,
0.1563841700553894... | |
suggest you get the pre-aggregated annual data per UTC time and the subtract aggregate data for the first for 4.5 hours of the year and add aggregate data for the first 4.5 hours of the next year. This will essentially shift the whole year by 4.5 hours and the work is not that much. Working from here, you can tweak the... | [
0.5136509537696838,
-0.29934123158454895,
0.5292708873748779,
0.07528850436210632,
-0.25770270824432373,
0.09007538855075836,
0.48063555359840393,
-0.030852727591991425,
-0.6587352752685547,
-0.08456942439079285,
0.24851833283901215,
-0.09272196888923645,
-0.039428818970918655,
-0.02198202... | |
each time and without requiring one aggregate per country. Aggregate the annual data from Jan 02 - Dec 30. Since the maximum time-zone difference between any two countries is 23 hours, this means that you can take the annual data (Jan 02 - Dec 30) and add a few buckets before and after as appropriate. For example for a... | [
0.24460963904857635,
-0.08612991869449615,
0.658501386642456,
0.26374223828315735,
-0.24180977046489716,
0.34546151757240295,
0.4421035945415497,
-0.050503093749284744,
-0.44238486886024475,
-0.4725501537322998,
0.055537182837724686,
-0.13736917078495026,
-0.07151152938604355,
0.1307270675... | |
I try to be grammatically correct in my naming\*. I've always used `filename` instead of `fileName`. The java convention also seems to use this, but FxCop prefers `fileName`.
There's a [discussion on WikiPedia](http://en.wikipedia.org/wiki/Talk:Filename#.22File_name.22_vs_.22Filename.22) about it. The more I read, the... | [
0.6102098822593689,
0.3395928740501404,
-0.12331590056419373,
-0.08843211829662323,
-0.23737750947475433,
0.015325563959777355,
0.36197131872177124,
0.2637335956096649,
-0.05333928391337395,
-0.5173028111457825,
0.007532094139605761,
0.3222978413105011,
0.08205636590719223,
0.1448467075824... | |
(assuming camelCase or PascalCase).
By the way, you did make a grammatical error in the question--ironically, in the very sentence in which you were expressing your hope that there were no grammatical errors. You said, "I just hope there's no grammar errors in this post!" But "errors" is plural, therefore the "is" of ... | [
-0.04216641187667847,
0.24319927394390106,
-0.17235763370990753,
0.23582705855369568,
-0.09560419619083405,
0.32129377126693726,
0.4736676812171936,
0.5749801993370056,
-0.1300688087940216,
-0.5051423907279968,
-0.3269551396369934,
0.40391454100608826,
0.11409983038902283,
-0.2382800132036... | |
I have a byte[] array received in TCP Client.The array contains a 24-bit RGB Bitmap file.How to create that bitmap file with given Width ,Height and data?
In C++ I use this
```
int WriteBitmapFile(const char *filename, int width, int height, unsigned char *imageData)
{
FILE *filePtr; // file pointe... | [
0.2409287691116333,
-0.05329286307096481,
0.8838897347450256,
-0.108377605676651,
-0.1962709277868271,
0.17958655953407288,
0.04283084720373154,
-0.49177372455596924,
-0.09333111345767975,
-0.7997647523880005,
0.03433733806014061,
0.6916915774345398,
-0.3534850776195526,
0.0786006897687912... | |
// used for swapping RGB->BGR
unsigned char tempRGB; // used for swapping
// open file for writing binary mode
filePtr = fopen(filename, "wb");
if (!filePtr)
return 0;
// define the bitmap file header
bitmapFileHeader.bfSize = sizeof(BITMAPFILEHEADER);
bitmapFileHeader.bfType = 0x4D42;
bitmapFileHe... | [
0.07056839764118195,
-0.08321759849786758,
0.14948199689388275,
-0.11639074236154556,
-0.12276093661785126,
0.33224278688430786,
0.17749670147895813,
-0.7517319917678833,
-0.24074286222457886,
-0.2956037223339081,
-0.41798052191734314,
0.4470171332359314,
-0.7310353517532349,
-0.0133282709... | |
// no compression
bitmapInfoHeader.biSizeImage = width * abs(height) * 4; // width * height * (RGB bytes)
bitmapInfoHeader.biXPelsPerMeter = 0;
bitmapInfoHeader.biYPelsPerMeter = 0;
bitmapInfoHeader.biClrUsed = 0;
bitmapInfoHeader.biClrImportant = 0;
bitmapInfoHeader.biWidth = width; // bitmap... | [
0.14951424300670624,
-0.04793655127286911,
0.6811555027961731,
-0.14275102317333221,
-0.4725135266780853,
0.21318131685256958,
0.2726304531097412,
-0.5101587772369385,
-0.31379634141921997,
-0.2828354239463806,
-0.3875085115432739,
0.33460602164268494,
-0.4066261947154999,
0.26679086685180... | |
imageIdx < bitmapInfoHeader.biSizeImage; imageIdx+=4)
{
tempRGB = imageData[imageIdx];
imageData[imageIdx] = imageData[imageIdx + 2];
imageData[imageIdx + 2] = tempRGB;
}
// write the bitmap file header
fwrite(&bitmapFileHeader, 1, sizeof(BITMAPFILEHEADER), filePtr);
// write the bitmap info header
fwrite... | [
0.2411871701478958,
-0.10947055369615555,
0.7909587025642395,
-0.010784695856273174,
-0.024571368470788002,
0.1221887469291687,
0.13431967794895172,
-0.5532035231590271,
-0.2218647450208664,
-0.46528568863868713,
-0.1673753261566162,
0.6972444653511047,
-0.4506356120109558,
-0.079353563487... | |
= imageData) {
using (Bitmap image = new Bitmap(width, height, stride, PixelFormat.Format24bppRgb, new IntPtr(ptr))) {
image.Save(fileName);
}
}
}
```
The `stride` value is the number of bytes between the scan lines. If there is no padding between the scan lines, it's `width * 3` for a 24bpp f... | [
0.301690012216568,
-0.396156370639801,
0.8510053157806396,
-0.3533301055431366,
-0.17634162306785583,
0.19518987834453583,
-0.05557091906666756,
-0.507319986820221,
-0.4668860137462616,
-0.698853075504303,
-0.11079192906618118,
0.42945826053619385,
-0.31696516275405884,
-0.2833415865898132... | |
array, the `stride` value should be negative, and the pointer should be the start of the last scan line in memory (`ptr + stride * (height - 1)`). | [
-0.1788640320301056,
-0.21671468019485474,
0.3816158175468445,
-0.3410338759422302,
0.11929795891046524,
-0.1046258956193924,
0.06507042050361633,
-0.04388898238539696,
-0.1542142778635025,
-0.39703184366226196,
0.0001274971873499453,
0.3613046109676361,
-0.19195935130119324,
-0.2327996492... | |
I have my website currently hosted on paid server, but i want to transfer it on GAE.
How can i do it? Can anyone please help me in this case.I'd appreciate your help.
Thanks:)
1) First you will have to adapt your website to the GAE framework (python with django or the new Java environment). You can test your work by [d... | [
0.5914553999900818,
0.31475552916526794,
0.33146145939826965,
0.09900417923927307,
-0.24962946772575378,
0.03929538279771805,
0.3134947419166565,
-0.12074519693851471,
-0.1956450194120407,
-0.906197726726532,
0.09260411560535431,
0.35667651891708374,
-0.17990872263908386,
0.028536463156342... | |
domain with your GAE website. [Here](http://code.google.com/appengine/articles/domains.html) is the Google doc. | [
0.4131159484386444,
0.08073113113641739,
0.473854660987854,
-0.058288831263780594,
-0.3140970468521118,
-0.18772591650485992,
-0.13902367651462555,
0.13882924616336823,
-0.3233840763568878,
-0.41407638788223267,
-0.1666470319032669,
0.2003035694360733,
-0.2895396649837494,
0.57581573724746... | |
I'm trying to put together a plugins system with .NET, and I'm not sure if I'm doing it correctly. The basis of the system is that a specific directory ({apppath}/Plugins/) will have a bunch of precompiled DLLs, and I want to look through each one with reflection, and for every class available, if it inherits a specifi... | [
0.4431406557559967,
-0.04081282392144203,
0.5787224173545837,
-0.17768584191799164,
0.1760508269071579,
-0.12576904892921448,
0.06046928092837334,
-0.10258080065250397,
-0.08928193151950836,
-0.9405754208564758,
0.011094982735812664,
0.7738558650016785,
-0.6130967736244202,
0.2184525430202... | |
Dim Files As IO.FileInfo() = Plugins.GetFiles("*.dll")
Dim CryptType As Type = GetType(CryptPluginBase)
Dim PluginsData as List(Of LoadedPluginsInfo)
For Each DllFile As IO.FileInfo In Files
Try
Dim thisAsm As Assembly = Assembly.LoadFrom(DllFile.FullName)
Dim ClassDefs = th... | [
0.2633805274963379,
-0.3935299515724182,
0.5519490838050842,
-0.2991136610507965,
-0.24418476223945618,
0.12684521079063416,
0.41683948040008545,
-0.6287965178489685,
-0.21817684173583984,
-0.34297505021095276,
-0.30788785219192505,
0.543619692325592,
-0.5694352388381958,
0.211353272199630... | |
Dim A As Object
A = ClassDef.Assembly.CreateInstance(ClassDef.Name)
PluginsData.Add(New LoadedPluginsInfo(A.Plugin(), False))
Next
Catch ex As Exception
Continue For
End Try
Next
End Sub
```
The specific | [
0.39887604117393494,
-0.494816392660141,
0.6551771759986877,
-0.3168170750141144,
-0.003266620449721813,
-0.09104733169078827,
0.5541743040084839,
-0.31063970923423767,
-0.16834811866283417,
-0.19762568175792694,
-0.23934009671211243,
0.5713123083114624,
-0.65938800573349,
0.27753159403800... | |
problem I have is, I'm not sure this is the right way to do this. Would the method I'm trying to do work, if it can be assumed that `A.Plugin()` actually exists and any structures and classes referenced here are bug-free? If anyone would need more code in order to help, I can post it.
Overall the strategy should work. ... | [
0.17420344054698944,
0.27161842584609985,
0.07322196662425995,
-0.039307866245508194,
-0.004779925104230642,
-0.15816979110240936,
0.3710636496543884,
-0.0350082702934742,
-0.20764528214931488,
-0.6244908571243286,
0.06572867929935455,
0.659494936466217,
-0.3459726572036743,
0.048253279179... | |
the Activator.CreateInstance method.
```
For Each def As Type in ClassDefs
Dim inst = Activator.CreateInstance(def)
PluginsData.Add(new LoadedPluginsInfo(inst.Plugin(), False))
Next
```
Depending on your goals, another suggestion would be to move the Try/Catch block into the loop instead of out of it. Having th... | [
0.3667094111442566,
-0.37160247564315796,
0.036642055958509445,
0.07464823871850967,
-0.10402724891901016,
-0.08613220602273941,
0.41903603076934814,
-0.4211418926715851,
-0.10761476308107376,
-0.6728315353393555,
-0.1638210415840149,
0.3821992576122284,
-0.6097366213798523,
0.134079530835... | |
First of all I'm sorry for such a question, I look over the internet and google searches but there so many different ideas out there. *In a mail-list I actually see that people claim that one need to buy Mono license to use it in a commercial tool.*
**Can I use Mono XSP in a commercial tool, does licensing permits tha... | [
0.5652275085449219,
0.33281210064888,
-0.02043589949607849,
0.10735631734132767,
-0.3340523838996887,
-0.4612877070903778,
-0.08910232782363892,
-0.0222023893147707,
-0.4519061744213104,
-0.005530145019292831,
0.10434701293706894,
0.6418858170509338,
-0.14881891012191772,
0.170181497931480... | |
the ChangeLog entries.
>
>
>
> ```
> Permission is hereby granted, free of charge, to any person obtaining
> a copy of this software and associated documentation files (the
> "Software"), to deal in the Software without restriction,
>
> ```
>
> including
> without limitation the rights to use, copy, modify, merge... | [
0.4145125448703766,
0.26809796690940857,
0.7595970034599304,
-0.01478163804858923,
0.5701383948326111,
-0.4959074556827545,
0.008988113142549992,
-0.10371042042970657,
-0.18980352580547333,
-0.19842375814914703,
-0.7048324346542358,
0.4725884199142456,
-0.22402209043502808,
0.1594588458538... | |
substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
> NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
> LIABLE FOR AN... | [
0.550449788570404,
0.49035462737083435,
0.5549639463424683,
0.02192874439060688,
0.449005126953125,
-0.4440213441848755,
0.2355170100927353,
0.10740062594413757,
0.05139477178454399,
-0.07353588938713074,
-0.9915687441825867,
0.6607972383499146,
0.04919932782649994,
0.10270439088344574,
... | |
of this file with my distribution"
Am I right?
Yes, you are right. That's the [MIT License](http://www.opensource.org/licenses/mit-license.php) - or see [this Wikipedia entry on the topic](http://en.wikipedia.org/wiki/MIT_License). | [
0.6834904551506042,
0.5030779242515564,
0.2143000364303589,
0.13302955031394958,
0.12824156880378723,
-0.5824543237686157,
-0.11570505797863007,
0.10965020954608917,
-0.11767659336328506,
-0.31861695647239685,
-0.28388020396232605,
0.5745450854301453,
-0.1251050978899002,
0.576194643974304... | |
For sake of simplicity, let's assume I want to write an extension method for the type int? and int:
```
public static class IntExtentions
{
public static int AddOne(this int? number)
{
var dummy = 0;
if (number != null)
dummy = (int)number;
return dummy.AddOne();
}
... | [
0.3881221115589142,
-0.34872153401374817,
0.12136118113994598,
-0.33960777521133423,
0.24539591372013092,
0.33782243728637695,
0.2518762946128845,
-0.5551537275314331,
-0.21974092721939087,
-0.310791552066803,
-0.34240880608558655,
0.6892290711402893,
-0.3481907248497009,
-0.07888082414865... | |
return number + 1;
}
}
```
**Can this be done using only 1 method?**
Unfortunately not. You can make the int? (or whichever nullable type you are using) method call the non nullable method very easily though, so you don't need to duplicate any logic with 2 methods - e.g.
```
public static class IntExtensions
{
... | [
0.08696509152650833,
-0.2820504307746887,
0.23143716156482697,
0.01802276447415352,
0.17365455627441406,
0.23612789809703827,
0.35861194133758545,
-0.42270970344543457,
-0.057767778635025024,
-0.5271599292755127,
-0.2579701840877533,
0.7347544431686401,
-0.43199676275253296,
0.009013535454... | |
return number + 1;
}
}
``` | [
-0.05884082242846489,
0.2476344257593155,
0.0017681410536170006,
-0.2611466646194458,
0.007236692123115063,
-0.1492912918329239,
0.18664859235286713,
-0.10573305189609528,
0.046193744987249374,
-0.16127212345600128,
-0.46435973048210144,
0.5818797945976257,
-0.42050325870513916,
0.25900429... | |
How would you, in C#, determine the name of the variable that was used in calling a method?
Example:
```
public void MyTestMethod1()
{
string myVar = "Hello World";
MyTestMethod2(myVar);
}
public void MyMethod2(string parm)
{
// do some reflection magic here that detects that this method was called using a var... | [
0.20542311668395996,
0.223062664270401,
0.2224823236465454,
-0.10073859989643097,
-0.20555979013442993,
-0.1691155880689621,
0.32127007842063904,
-0.13286210596561432,
-0.01120993122458458,
-0.3279920518398285,
0.011402773670852184,
0.6129863262176514,
-0.3015253245830536,
0.16419467329978... | |
it from the name of the var that they called the method with...
Unfortunately, that's going to be very hard, if not impossible.
Why exactly do you need the name of the variable originally sent in?
Remember that there might not be an actual variable used:
```
MyMethod2(myVar + "! 123");
```
In this case, myVar hold... | [
0.25587567687034607,
0.09400894492864609,
0.1558089256286621,
-0.00395911606028676,
-0.11374690383672714,
-0.11625178158283234,
0.28143787384033203,
-0.22847208380699158,
0.03337082639336586,
-0.09351304173469543,
0.17067080736160278,
0.5534665584564209,
-0.3152919411659241,
0.303995519876... | |
I'm currently developing a program in python and I just noticed that something was wrong with the foreach loop in the language, or maybe the list structure. I'll just give a generic example of my problem to simplify, since I get the same erroneous behavior on both my program and my generic example:
```
x = [1,2,2,2,2]... | [
0.339324027299881,
0.5334843993186951,
0.008446849882602692,
-0.33276528120040894,
-0.10830704122781754,
-0.1732436567544937,
0.4526747465133667,
-0.025508828461170197,
-0.3833010792732239,
-0.4643974006175995,
-0.0667843371629715,
0.519888699054718,
-0.8387901782989502,
0.2068343758583068... | |
get 2 remaining elements in the list.
What am I doing wrong? Thanks for all the help in advance.
Edit: I don't want to empty a list, this is just an example...
This is a well-documented behaviour in Python, that you aren't supposed to modify the list being iterated through. Try this instead:
```
for i in x[:]:
x... | [
0.23317766189575195,
-0.11873418837785721,
-0.12331820279359818,
-0.14716677367687225,
-0.12686294317245483,
-0.21009868383407593,
0.6127799153327942,
-0.09496015310287476,
-0.20362067222595215,
-0.4084632098674774,
-0.29508349299430847,
0.4721072316169739,
-0.6295639276504517,
0.002179769... | |
I have used Vim for coding.
I want to learn Emacs too.
I would like to export at least some of the following customizations in my .vimrc to my .emacs.
**My .vimrc**
```
let Tlist_Auto_Open = 1
" http://stackoverflow.com/questions/165231/vim-dvorak-keybindings-rebinding
" Dvorak it!
no d h
no h j
no t k
no n l
no s... | [
0.18401817977428436,
0.10373681038618088,
0.8464599251747131,
0.06036180257797241,
-0.16784264147281647,
-0.012332928366959095,
0.345375120639801,
-0.502955973148346,
-0.3498038053512573,
-0.5121852159500122,
-0.387816846370697,
0.7101837992668152,
-0.2708114683628082,
-0.00684752129018306... | |
set softtabstop=4
set number
set hlsearch
syntax on
set cursorline
highlight CursorLine guibg=#400000
set ruler
set textwidth=78
set foldcolumn=5
" REQUIRED. This makes vim invoke Latex-Suite when you open a tex file.
filetype plugin | [
0.06577733904123306,
-0.6416029334068298,
1.13498854637146,
-0.028823958709836006,
-0.3039819598197937,
-0.1966562271118164,
0.01923537813127041,
-0.6263731718063354,
-0.016009382903575897,
-0.4346722960472107,
-0.3543538749217987,
1.003857970237732,
-0.29524317383766174,
-0.37417733669281... | |
on
filetype indent on
" IMPORTANT: grep will sometimes skip displaying the file name if you
" search in a singe file. This will confuse Latex-Suite. Set your grep
" program to always generate a file-name.
set grepprg=grep\ -nH\ $*
" OPTIONAL: This enables automatic indentation as you type.
filetype indent on
" OPTI... | [
0.06189623475074768,
0.06668233871459961,
0.8846914172172546,
-0.24764809012413025,
-0.009928937070071697,
0.10156802833080292,
0.18896442651748657,
0.08213344216346741,
-0.15484367311000824,
-0.37082797288894653,
-0.5650983452796936,
0.9175614714622498,
-0.3572876453399658,
0.139693588018... | |
"Use Vim extensions
set backspace=indent,eol,start "More powerful backspacing
set nobackup "No backup file
set showmode "Tell when in insert mode
set showmatch "Show matching () {} etc
set hlsearch | [
0.4640890955924988,
-0.46303442120552063,
0.8837495446205139,
-0.01875942386686802,
0.11852429062128067,
-0.40554437041282654,
0.23863781988620758,
-0.6000780463218689,
0.23006388545036316,
-0.5799875855445862,
-0.4195291996002197,
0.6595568060874939,
-0.4623282551765442,
-0.09554887562990... | |
"Highlight what is searched for
set incsearch "Highlight as you type
if &t_Co > 2
syntax on
endif
set bg=dark
hi clear
if exists("syntax_on")
syntax reset
endif
"Allowable colors: red, yellow, green, blue, magenta,
" cyan, gray, black, gray
hi Normal ctermfg=gray ctermbg=none
h... | [
-0.29319635033607483,
-0.16247941553592682,
0.6370267271995544,
0.12992918491363525,
-0.3078288435935974,
-0.06650207191705704,
0.10235798358917236,
-0.09639168530702591,
0.0388353057205677,
-0.4968111515045166,
-0.5117568373680115,
0.6851038932800293,
-0.5103678107261658,
0.12306389212608... | |
WarningMsg ctermfg=red
hi WildMenu ctermfg=yellow ctermbg=black cterm=none
hi ModeMsg ctermfg=lightblue
hi MoreMsg ctermfg=darkgreen ctermfg=darkgreen
hi Question ctermfg=green cterm=none
hi NonText ctermfg=darkblue
hi StatusLine ctermfg=blue ctermbg=gray cterm=none
hi StatusLineNC ctermfg=black ctermbg=gray cterm=none... | [
-0.5768436193466187,
0.05002801492810249,
0.686346173286438,
0.10061763972043991,
-0.2948930263519287,
-0.030598577111959457,
0.3311401903629303,
-0.285183310508728,
-0.06487619876861572,
-0.5429595112800598,
-0.23878759145736694,
0.7336665987968445,
-0.39301761984825134,
-0.05874016880989... | |
too.
My God -- you really remap your keyboard to Dvorak in your .vim?
Okay, here are some of the others:
> set smartindent
>
> set autoindent
There automagically in programming modes. For text modes, look at 'autoindent-mode" and "filladapt."
> set tabstop=4
>
> set shiftwidth=3
>
> set softtabstop=4
... | [
0.008830059319734573,
-0.03007340244948864,
0.839026153087616,
0.14148344099521637,
0.21568924188613892,
0.20143869519233704,
0.31065571308135986,
-0.12154793739318848,
-0.1475098431110382,
-0.6895818114280701,
-0.22028589248657227,
0.8728485107421875,
-0.3916322886943817,
-0.1146191507577... | |
nil)
```
> set number
There is a way to get numbered lines, but I never use it and don't remember it.
> syntax on
```
(turn-on-font-lock)
```
> set cursorline
There are a pile of cursor settings, look through M-x apropos cursor
Some of the other stuff is also available, these are the things I know of offhand. | [
-0.06444265693426132,
0.2485034316778183,
0.5391976833343506,
-0.012139878235757351,
-0.2708333134651184,
0.27620044350624084,
0.1625792533159256,
0.14634263515472412,
-0.19832192361354828,
-0.6374236941337585,
0.047470107674598694,
0.4557935893535614,
-0.35336318612098694,
0.1005426198244... | |
Hey bloggers out there! I've created Wordpress blog that I am hosting myself, and I'm having the hardest time figuring out the best way to add C# snippets to my blog. What do you all use?
I'm currently using the "SyntaxHighlighter Evolved" plugin, and it works great for the most part - the only problem is that switchi... | [
0.8565405607223511,
0.2122461050748825,
0.512845516204834,
0.21658040583133698,
-0.23119691014289856,
-0.24905303120613098,
0.11156075447797775,
0.4371562600135803,
-0.280547171831131,
-0.819878876209259,
-0.025560352951288223,
0.6866585612297058,
-0.09213608503341675,
0.01994931884109974,... | |
solution, and no luck.
Cheers!
See the [blog post that I wrote](http://ellisweb.net/2008/08/using-syntaxhighlighter-to-format-code-in-wordpress/) on this exact question, which explains how to use [SyntaxHighlighter](http://code.google.com/p/syntaxhighlighter/) and fix TinyMCE so that it doesn't mess up your white space... | [
0.08153145015239716,
0.005140869878232479,
0.47351568937301636,
0.20936264097690582,
0.16228145360946655,
-0.015011819079518318,
0.2832637429237366,
-0.09271582961082458,
-0.27512967586517334,
-0.5802007913589478,
-0.066155806183815,
0.5590872168540955,
0.0703565701842308,
-0.3592350184917... | |
I have a breakpoint action and am using the Log option from the drop down. I'd like to print out the string (summary) value. I'm doing this:
```
the person name is: @p.name@
```
but that prints the memory address. I can switch to the Debugger Command option and do
```
po f.name
```
but then I lose my description,... | [
-0.014478171244263649,
0.17413991689682007,
0.11716722697019577,
-0.14766202867031097,
0.3042130470275879,
0.08912581950426102,
0.21291056275367737,
-0.025004159659147263,
-0.11162809282541275,
-0.5915135741233826,
-0.07347823679447174,
0.7671641707420349,
-0.22130799293518066,
0.186425387... | |
enter `po f.name`.
If you want your log to be more complicated, you could do something more like this:
```
the person name is: @(const char *)[(NSString*)[p.name description] UTF8String]@
```
You best bet is probably to just use the debugger's graphical interface to watch variables. If you want to log messages, use... | [
-0.037729378789663315,
0.05717768147587776,
0.030066121369600296,
-0.09550832211971283,
0.12379972636699677,
0.06107176095247269,
0.11982611566781998,
0.20966830849647522,
-0.19188527762889862,
-0.5428144335746765,
-0.10724037885665894,
0.5707451701164246,
-0.2383078783750534,
-0.084578149... | |
I'd like to reverse the order of lines in a text file (or stdin), preserving the contents of each line.
So, i.e., starting with:
```
foo
bar
baz
```
I'd like to end up with
```
baz
bar
foo
```
Is there a standard UNIX commandline utility for this?
BSD tail:
```
tail -r myfile.txt
```
Reference: [FreeBSD](htt... | [
0.2107362151145935,
0.09298200905323029,
0.5074900984764099,
-0.12910626828670502,
-0.09823808819055557,
0.17473767697811127,
0.1259908378124237,
0.03637915104627609,
-0.2384144812822342,
-0.3736882507801056,
-0.5000340342521667,
0.23121951520442963,
-0.5380563139915466,
0.0074287289753556... | |
With the thousands of implementations of LISP and Scheme available I'm having a very hard time finding just the right one to use for Windows development. I learned these languages in school and found them to be very elegant, however, I don't seem to be able to find an implementation that would be suitable for developin... | [
0.07366373389959335,
0.1364772915840149,
0.11143521219491959,
-0.09798746556043625,
-0.11802617460489273,
0.04420485720038414,
0.10489803552627563,
-0.14629784226417542,
-0.22527261078357697,
-0.6457176804542542,
0.009136239998042583,
0.5378270745277405,
-0.5283598303794861,
-0.28871822357... | |
Lisp](http://www.cormanlisp.com/) could be interesting, but does not support 64bit code (AFAIK).
[Clozure CL](http://trac.clozure.com/openmcl) is just being ported to Windows, so it is probably not very mature and lacks a few things.
[LispWorks](http://www.lispworks.com) and [Allegro CL](http://www.franz.com) are gre... | [
-0.21797366440296173,
0.18724192678928375,
0.5683407187461853,
0.1281294971704483,
-0.16378112137317657,
-0.05424736812710762,
-0.05277146026492119,
-0.014637425541877747,
-0.4374799132347107,
-0.31480833888053894,
-0.05237969011068344,
0.45854389667510986,
-0.6381953954696655,
-0.08703839... | |
I have been tossing around a conceptual idea for a machine (as in a Turing machine) and **I'm wondering if any work has been done on this or related topics.**
The idea is a machine that takes an entropy stream and gives out random symbols in any range without losing any entropy.
I'll grand that is a far from rigorou... | [
0.4711112976074219,
-0.0011185226030647755,
-0.10464633256196976,
0.1535893827676773,
-0.21318024396896362,
0.4112546145915985,
0.10585280507802963,
-0.15603801608085632,
-0.16046716272830963,
-0.6119590997695923,
0.23407778143882751,
0.2142951488494873,
-0.2114255577325821,
0.193068906664... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.