text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
Post Scenarios](http://weblogs.asp.net/scottgu/archive/2007/12/09/asp-net-mvc-framework-part-4-handling-form-edit-and-post-scenarios.aspx) | [
0.016774673014879227,
-0.05856829509139061,
0.29374995827674866,
-0.011197591200470924,
0.13352887332439423,
0.036420032382011414,
0.3296130299568176,
-0.3485018312931061,
-0.25628796219825745,
-0.2674715220928192,
-0.3117285370826721,
0.3629017174243927,
-0.31335800886154175,
-0.233918160... | |
I want to do something very simple in C++ but i can't find how.
I want to create a function like a for loop where i will ideally enter a variable for the times the iteration should happen and some functions inside brackets my function will execute. I hope i was clear enough. Thanks...
Example
```
superFor (1)
{
//c... | [
0.45071443915367126,
-0.029721353203058243,
0.31046369671821594,
-0.1898086816072464,
-0.020183242857456207,
-0.10109280794858932,
0.4328148066997528,
-0.3666026294231415,
-0.02733096107840538,
-0.43994638323783875,
0.019223254173994064,
0.7413169741630554,
-0.5014630556106567,
0.029356876... | |
or function object to your function. The STL offers many examples of this. Consider:
```
void out(int x) {
cout << x << ' ';
}
vector<int> xs;
xs.push_back(42);
xs.push_back(23);
for_each(xs.begin(), xs.end(), out);
```
This passes a pointer to function `out` to the function [`for_each`](http://cppreference.co... | [
-0.23361434042453766,
-0.07093176245689392,
0.5091899037361145,
-0.4014381468296051,
-0.11328910291194916,
0.36730554699897766,
-0.08526459336280823,
-0.3030296564102173,
-0.2034294307231903,
-0.4595436751842499,
-0.4272303283214569,
0.5271872282028198,
-0.5033590197563171,
0.0762254521250... | |
What does the "bus error" message mean, and how does it differ from a [segmentation fault](https://en.wikipedia.org/wiki/Segmentation_fault)?
Bus errors are rare nowadays on x86 and occur when your processor cannot even attempt the memory access requested, typically:
* using a processor instruction with an address tha... | [
-0.05051953345537186,
-0.17467942833900452,
-0.2041790634393692,
-0.06254083663225174,
-0.03743637725710869,
0.2206571251153946,
0.3753760755062103,
0.39249861240386963,
-0.3961070477962494,
-0.6000339984893799,
0.06805074214935303,
0.06084703281521797,
-0.2371475100517273,
0.3966139256954... | |
the pointer itself that will cause issues. It's accessing the memory it points to (dereferencing). | [
-0.0149582764133811,
0.2555199861526489,
0.4357156753540039,
0.16924476623535156,
0.0950874537229538,
-0.04468695446848869,
0.1936805546283722,
-0.0685921311378479,
-0.01715485379099846,
-0.5987388491630554,
-0.12039247155189514,
0.3160044252872467,
-0.06289021670818329,
0.3445125222206116... | |
I use an XML file in App\_Data in conjunction with a Repeater on the main page of an intranet application allow me to display messages to users when they logon about application status, maintenance, etc. To test the functionality, it would be nice to have the file in the App\_Data folder under development, but if I do ... | [
0.4302213191986084,
0.3145272135734558,
0.37568745017051697,
-0.3188592493534088,
-0.22091716527938843,
0.043572839349508286,
0.16725419461727142,
-0.09811826795339584,
-0.3584589958190918,
-0.5614333152770996,
0.15888626873493195,
0.6806027293205261,
-0.49277263879776,
-0.1645639836788177... | |
see a checkbox labeled "Include files from the App\_Data folder", which defaults to checked. Have you tried publishing with that checkbox unchecked?
**EDIT:** Seeing as how that checkbox isn't available for your project, I would look into using the [VS2005 Web Deployment add-on](http://weblogs.asp.net/scottgu/archive/... | [
0.3463272452354431,
-0.07722210884094238,
-0.17396174371242523,
-0.0015941228484734893,
-0.0015162610216066241,
-0.27946600317955017,
0.2414577752351761,
0.13336364924907684,
-0.4826623797416687,
-0.5142079591751099,
0.06887376308441162,
0.6322842836380005,
-0.3834068775177002,
-0.22492177... | |
Is there a good way to have a `Map<String, ?>` get and put ignoring case?
TreeMap extends Map and supports custom comparators.
String provides a default case insensitive comparator.
So:
```
final Map<String, ...> map = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
```
The comparator does not take locale into accou... | [
-0.4645904004573822,
-0.3825266659259796,
0.23204398155212402,
-0.22748544812202454,
-0.02418026514351368,
-0.1370844542980194,
0.22868865728378296,
-0.0767364576458931,
-0.1319383680820465,
-0.7490561008453369,
-0.3685831129550934,
0.347275972366333,
-0.36973339319229126,
-0.0151721313595... | |
I'm trying to write some SQL that will delete files of type '.7z' that are older than 7 days.
Here's what I've got that's not working:
```
DECLARE @DateString CHAR(8)
SET @DateString = CONVERT(CHAR(8), DATEADD(d, -7, GETDATE()), 1)
EXECUTE master.dbo.xp_delete_file 0,
N'e:\Database Backups',N'7z', ... | [
0.20407839119434357,
0.08454835414886475,
0.42672932147979736,
-0.22594472765922546,
0.11205257475376129,
-0.15687276422977448,
0.40420424938201904,
-0.19939325749874115,
-0.3498239517211914,
-0.49967408180236816,
-0.11767842620611191,
0.5264814496040344,
-0.430184930562973,
0.296146899461... | |
is an undocumented extended stored procedure that's a holdover from SQL 2000. It checks the first line of the file to be deleted to verify that it is either a SQL backup file or a SQL report file. It doesn't check based on the file extension. From what I gather its intended use is in maintenance plans to cleanup old ba... | [
0.1407993882894516,
-0.09518523514270782,
0.10114669054746628,
0.1702449470758438,
0.2532772719860077,
-0.24938438832759857,
0.2555121183395386,
0.07806319743394852,
-0.2848478853702545,
-0.409980446100235,
-0.08624028414487839,
0.30938979983329773,
-0.25523146986961365,
0.1500096619129181... | |
extension to look for. The user that SQL Server runs as also needs to have delete permissions on the folder.
```
DECLARE @DeleteDate datetime
SET @DeleteDate = DateAdd(day, -7, GetDate())
EXECUTE master.sys.xp_delete_file
0, -- FileTypeSelected (0 = FileBackup, 1 = FileReport)
N'D:\SQLbackups\', -- folder path (trail... | [
0.04405691474676132,
0.012392898090183735,
0.7097258567810059,
-0.19919897615909576,
0.29817822575569153,
0.013097682036459446,
0.19382815062999725,
-0.15426771342754364,
-0.3787720799446106,
-0.5960803031921387,
-0.2680794298648834,
0.3620363175868988,
-0.26850470900535583,
0.191534236073... | |
xp\_delete\_file may go away or change in future versions of SQL Server. Many sites recommend a shell script to do the deletions instead. | [
0.2182534635066986,
0.20835278928279877,
0.4452407658100128,
-0.053484223783016205,
0.11792084574699402,
-0.2942527234554291,
0.48925909399986267,
0.09695988148450851,
-0.11977779865264893,
-0.5540814995765686,
-0.4127970039844513,
0.46249890327453613,
-0.3169920742511749,
0.23288403451442... | |
Should a method that implements an interface method be annotated with `@Override`?
The [javadoc of the `Override` annotation](http://java.sun.com/javase/6/docs/api/java/lang/Override.html) says:
> Indicates that a method declaration is intended to override a method declaration in a superclass. If a method is annotat... | [
0.0898779034614563,
0.16084226965904236,
0.26837363839149475,
0.006444649305194616,
-0.020501699298620224,
-0.45474278926849365,
0.3586902320384979,
-0.33798304200172424,
-0.05054676905274391,
-0.40914687514305115,
-0.10815253108739853,
0.5618970990180969,
-0.5186057686805725,
0.0441452078... | |
// code ...
}
}
```
This doesn't compile because it doesn't properly override [`public boolean equals(Object obj)`](http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html#equals(java.lang.Object)).
The same will go for methods that implement an interface (**1.6 and above only**) or override a Super class... | [
-0.08059224486351013,
0.11114074289798737,
0.4972689747810364,
-0.020479639992117882,
-0.0451546311378479,
-0.09918204694986343,
0.3219130039215088,
-0.40603315830230713,
0.0950092151761055,
-0.5768597722053528,
0.007555522955954075,
0.3836876153945923,
-0.5721795558929443,
-0.101923435926... | |
Within a stored procedure, another stored procedure is being called within a cursor. For every call, the SQL Management Studio results window is showing a result. The cursor loops over 100 times and at that point the results window gives up with an error. Is there a way I can stop the stored procedure within the cursor... | [
0.0579652301967144,
0.052202008664608,
0.5455296635627747,
-0.011728555895388126,
0.14849823713302612,
-0.02675669454038143,
0.3286733031272888,
-0.3166526257991791,
-0.3420770764350891,
-0.44966551661491394,
0.042857538908720016,
0.7185060977935791,
-0.3682519495487213,
0.1875658184289932... | |
the results into a temp table, then drop the temp table
```
create table #tmp (columns)
while
...
insert into #tmp exec @RC=dbo.NoisyProc
...
end
drop table #tmp
```
otherwise, can you modify the proc being called to accept a flag telling it not to output a result-set? | [
0.3206249475479126,
-0.025681814178824425,
0.42700567841529846,
-0.08293747901916504,
0.102898970246315,
0.0844070240855217,
0.21991848945617676,
-0.33517712354660034,
-0.17336533963680267,
-0.20958341658115387,
-0.48572686314582825,
0.42515501379966736,
-0.6898583173751831,
-0.01094338856... | |
Does anyone know of a Jabber library for Lua? I've found the 'Lua Messaging Library' for AIM, although I can't find a download for it, it appears to be abandoned.
Something like that for Lua would be helpful.
---
I'm sorry I didn't state this originally, I meant a 'pure Lua' library.
I'm familiar with Verse, but do... | [
0.7276328802108765,
0.318562388420105,
0.05658679082989693,
-0.15440714359283447,
-0.34292998909950256,
0.39725154638290405,
0.24791711568832397,
0.3216198682785034,
-0.09702235460281372,
-0.30269119143486023,
0.25499624013900757,
0.2372010052204132,
-0.37012970447540283,
-0.03909473493695... | |
become a "pure Lua" XMPP library descended from it.
It will of course need to depend on the usual LuaSocket, LuaExpat, etc. but no generated bindings will be involved as is currently the case. | [
0.2723609209060669,
-0.19751593470573425,
0.4310937821865082,
-0.08134602755308151,
0.02582797221839428,
-0.42783334851264954,
-0.054022856056690216,
-0.12990042567253113,
-0.09463298320770264,
-0.41883522272109985,
-0.4225118160247803,
0.058999668806791306,
-0.6170274019241333,
0.24753688... | |
I was recommeded a book called:
Accelerated C++ Practical Programming by Example
by Andrew Koenig and Barbara E. Moo
Addison-Wesley, 2000
ISBN 0-201-70353-X
The basis of this book is that Object Oriented Programming is highly wasteful memory-wise, and that most source-code should not be written this way, rather t... | [
0.24414215981960297,
0.5045677423477173,
-0.24674709141254425,
-0.047951798886060715,
-0.12859006226062775,
0.14532510936260223,
0.2518964111804962,
-0.18016046285629272,
-0.009448351338505745,
-0.1572875827550888,
0.37734147906303406,
0.4532639682292938,
-0.06011347472667694,
-0.455046236... | |
code just for a speed boost?
Or is it worth it just to make the application run on a client's really old machine? Or to be able to run more servers on a single box?
I haven't read the book, but I have trouble believe that they wrote a book whose "basis ...is that Object Oriented Programming is highly wasteful memory-w... | [
0.6213664412498474,
0.43493396043777466,
-0.41430947184562683,
0.23633800446987152,
0.17845265567302704,
0.0024849476758390665,
0.40119636058807373,
0.15307742357254028,
-0.42244961857795715,
-0.2924429476261139,
0.07794349640607834,
0.4385446608066559,
-0.03542863205075264,
-0.18782304227... | |
he would be the first to argue that as a general rule OO designs are no more or less wasteful that any other style of programming.
The argument that OO designs are wasteful largely came from the fact that the EXEs of C++ "hello world" programs tend to be larger that the EXEs of C "hello world" programs. This is mostl... | [
0.07154199481010437,
0.3878955543041229,
-0.08232764154672623,
0.09454115480184555,
0.00512747373431921,
0.1188800260424614,
-0.027899231761693954,
0.16149842739105225,
-0.1722046136856079,
-0.5271297097206116,
-0.3013681471347809,
0.10585399717092514,
-0.48817887902259827,
-0.008016190491... | |
What is the best way to reset a PIC18 using C code with the HiTech Pic18 C compiler?
Edit:
I am currenlty using
```
void reset()
{
#asm
reset
#endasm
}
```
but there must be a better way
There's a [FAQ here](http://www.microchipc.com/HiTechCFAQ/index.php#_Toc475127553).
Q: How do I reset the micro?
> One way ... | [
0.119550921022892,
-0.007985961623489857,
0.42019715905189514,
0.25242161750793457,
0.10317707061767578,
0.12095469981431961,
-0.0893489196896553,
-0.17927154898643494,
-0.29349076747894287,
-0.7278811931610107,
0.1396169662475586,
0.7222467064857483,
-0.01684735342860222,
0.07416529953479... | |
16x series micros
> have 8 stack levels. Each time a
> procedure is called, one stack level
> is used up for the return address. It
> is a circular buffer, so even if the
> micro is 7 procedure levels deep and
> in an interrupt when a reset is
> called, this is the new start of the
> stack buffer, and the micro... | [
0.09442678093910217,
-0.0432012565433979,
0.6885079145431519,
-0.0744815543293953,
0.1818608194589615,
0.3242264986038208,
0.008824905380606651,
-0.3413828909397125,
-0.25295141339302063,
-0.47555097937583923,
0.0888049453496933,
0.39922985434532166,
-0.24699491262435913,
0.075682818889617... | |
When you want the micro to
> reset, stop clearing the watchdog bit
> and the micro will reset after around
> 18ms to 2 seconds depending on the
> prescaler. | [
0.4777623116970062,
-0.30439895391464233,
0.6119755506515503,
-0.000719431322067976,
0.5177109837532043,
0.04842205345630646,
0.539556086063385,
-0.17112219333648682,
-0.06324238330125809,
-0.767769992351532,
0.05087645724415779,
0.563589870929718,
-0.27354711294174194,
0.21787872910499573... | |
Using subversion 1.5 I have branch B which was branched off of branch A. After doing work in both branches I go to merge changes from A into B (using `svn merge http://path/to/A` in the working directory of B) and get `svn: Target path does not exist`. What does this mean?
It means that there was a change in a file in ... | [
0.2476852983236313,
-0.5231968760490417,
0.33759409189224243,
-0.18528373539447784,
-0.3001575767993927,
-0.16562633216381073,
0.38913464546203613,
-0.1538262963294983,
-0.32234057784080505,
-0.8246277570724487,
0.1908097267150879,
0.11166917532682419,
-0.6873050332069397,
0.20211160182952... | |
B
Now the change in README cannot be applied in branch B, because the file has been removed there.
EDIT: This will result in a **tree conflict** in Subversion 1.6. | [
0.21511316299438477,
-0.17249225080013275,
0.08280394226312637,
-0.21005085110664368,
-0.16311535239219666,
-0.2938172221183777,
0.5984458923339844,
0.0778685212135315,
-0.26674172282218933,
-0.1257522702217102,
-0.3403962254524231,
0.21629850566387177,
-0.5640195608139038,
0.1231117621064... | |
I've got a web site sending someone a confirmation email.
Now in the email I would like to have a link the user has to click to confirm he received the mail.
I'd like to include the user's password (or some random code) into the confirmation address, so the user does not need to enter it by hand again, but if I do th... | [
0.6985313892364502,
0.2657015025615692,
0.4441949427127838,
0.1468300074338913,
0.05345677584409714,
-0.23506450653076172,
-0.06741963326931,
0.1927964836359024,
-0.14927531778812408,
-0.5624855756759644,
0.1234358549118042,
0.09506015479564667,
-0.042019620537757874,
0.14791396260261536,
... | |
in the link somehow?
Is it, for example, possible to have an input form in an email and send the password as POST instead of GET?
The way this usually works is that the confirmation email contains a link that includes a GUID (Globally Unique Identifier) of some sort. The GUID is associated with the user's account. W... | [
0.42097383737564087,
-0.02295675314962864,
0.4881122410297394,
0.40574151277542114,
0.06103988364338875,
-0.18595050275325775,
-0.020829414948821068,
0.211008220911026,
0.06192762032151222,
-0.5298805236816406,
-0.0561886727809906,
0.145614355802536,
-0.1360209882259369,
0.4683961570262909... | |
It seems
```
import Queue
Queue.Queue().get(timeout=10)
```
is keyboard interruptible (ctrl-c) whereas
```
import Queue
Queue.Queue().get()
```
is not. I could always create a loop;
```
import Queue
q = Queue()
while True:
try:
q.get(timeout=1000)
except Queue.Empty:
pass
```
but thi... | [
-0.18589487671852112,
-0.08663318306207657,
0.501887321472168,
-0.08232753723859787,
0.21595023572444916,
0.036924149841070175,
0.1515035182237625,
0.054578106850385666,
-0.46405690908432007,
-0.3648284673690796,
-0.093761146068573,
0.39390161633491516,
-0.5706639885902405,
0.3322968780994... | |
can monkeypatch the `Queue` class. For example:
```
def interruptable_get(self):
while True:
try:
return self.get(timeout=1000)
except Queue.Empty:
pass
Queue.interruptable_get = interruptable_get
```
This would let you say
```
q.interruptable_get()
```
instead of
```
... | [
-0.05960790812969208,
-0.055937301367521286,
-0.14333227276802063,
-0.14306990802288055,
0.005710885860025883,
-0.1747552752494812,
0.5907222032546997,
0.2591608464717865,
-0.3663562536239624,
-0.30361270904541016,
-0.2871800661087036,
0.283153235912323,
-0.7455752491950989,
0.001901386305... | |
I have now worked on two different teams that use the Agile/Scrum approach in the last two years and both teams were eager to improve the way they approach software development. In the first team, we could easily convince our product owner to get time for internal things like improving the build system, setting up bett... | [
0.271709144115448,
0.02383129857480526,
-0.47738921642303467,
-0.15741737186908722,
-0.12595298886299133,
0.04660152271389961,
-0.2106325775384903,
-0.062045227736234665,
-0.30851513147354126,
-0.6076683402061462,
0.28249114751815796,
0.6997243762016296,
0.3129976689815521,
-0.003389074467... | |
teams handle this? Do you create an improvement story and put it on the table during planning or do you keep a "bucket" of time around for such things? How difficult is it in your experience to convince the product owner to do get time for improving? After all these kind of improvements will benefit the team, but not d... | [
0.20347023010253906,
-0.08099334686994553,
-0.08812915533781052,
0.382994145154953,
-0.11874214559793472,
-0.24786055088043213,
0.3541853427886963,
-0.26787999272346497,
-0.3851386308670044,
-0.579025387763977,
0.09463408589363098,
0.6419340968132019,
0.14031657576560974,
-0.43445286154747... | |
database calls in the view layer of our application, cuz that caused us to waste time in this past iteration... somebody should do a search through the code to make sure we're not doing that someplace else."
2) process improvements (e.g. "folks aren't coming to the standups on time... lets start a $1 for charity donat... | [
0.4260208308696747,
-0.2639859616756439,
0.18402478098869324,
0.1896783858537674,
0.06888275593519211,
-0.26090914011001587,
0.2524663209915161,
-0.34257104992866516,
-0.20117098093032837,
-0.6087049245834351,
-0.05311157554388046,
0.7368007302284241,
-0.1475651115179062,
-0.18824175000190... | |
category should be handled/driven by the iteration manager, project manager, scrum manager, etc. I (as a Scrum Master or Project Manager) usually list them on a project wiki and talk about them in retrospectives, check them off when they're addressed, and report to the team on status. I keep the fire lit.
I think the ... | [
0.2674497365951538,
0.13632433116436005,
-0.11099109798669815,
-0.028870048001408577,
-0.2033434510231018,
-0.12192998081445694,
0.23014403879642487,
-0.2613600492477417,
-0.19037200510501862,
-0.2549634277820587,
-0.1688453108072281,
0.7213001251220703,
0.014909527264535427,
0.00227204407... | |
if necessary). So - improving the build system might start with a technical task or a spike to assess options.
We also need to break-down and prioritize technical tasks (e.g. maybe "better integration tests" could start with a technical task of defining the current integration coverage, or assessing the percentage of ... | [
0.3931659162044525,
0.08969071507453918,
0.07905842363834381,
0.18868552148342133,
0.3270352780818939,
-0.07712852954864502,
0.1624191701412201,
-0.15165260434150696,
0.07767848670482635,
-0.7079744935035706,
-0.143560528755188,
0.8923065066337585,
0.08358073979616165,
-0.3109652101993561,... | |
buckets to spend on anything... but having the conversation with the product owner with crisp requirements, ROI, and acceptance criteria is key. | [
0.4520692229270935,
0.1058243066072464,
0.001976381056010723,
0.3491215109825134,
-0.24504616856575012,
0.025721566751599312,
-0.33691632747650146,
-0.26066315174102783,
0.05148068815469742,
-0.4629175662994385,
0.2182956039905548,
0.8055325150489807,
0.06491605937480927,
-0.23401504755020... | |
What I want to do is the following:
1. read in multiple line input from `stdin` into variable `A`
2. make various operations on `A`
3. pipe `A` without losing delimiter symbols (`\n`,`\r`,`\t`,etc) to another command
The current problem is that, I can't read it in with `read` command, because it stops reading at newl... | [
0.06096448376774788,
0.07899628579616547,
0.46642908453941345,
-0.3630189299583435,
-0.00642506405711174,
0.04820546880364418,
0.3203692138195038,
-0.4086678624153137,
-0.12932796776294708,
-0.7343912124633789,
0.07551128417253494,
0.5027928948402405,
-0.42888304591178894,
0.35970813035964... | |
cat ${A} | /usr/local/sbin/nextcommand
fi
```
This is working for me:
```
myvar=`cat`
echo "$myvar"
```
The quotes around `$myvar` are important. | [
-0.01250804215669632,
0.2241249829530716,
0.38872984051704407,
-0.49250560998916626,
0.05208720266819,
-0.21426549553871155,
0.09410124272108078,
-0.21652889251708984,
0.022676480934023857,
-0.6707161664962769,
-0.1655217558145523,
0.5295999050140381,
-0.25782209634780884,
0.17234383523464... | |
I have a class library with some extension methods written in C# and an old website written in VB.
I want to call my extension methods from the VB code but they don't appear in intelisense and I get compile errors when I visit the site.
I have got all the required *Import*s because other classes contained in the same... | [
0.352131187915802,
0.13687293231487274,
0.10001377016305923,
-0.06481006741523743,
-0.007955297827720642,
0.01657009683549404,
0.0820113867521286,
-0.0439768061041832,
-0.17674407362937927,
-0.6192931532859802,
-0.07660207897424698,
0.5215833783149719,
-0.23451480269432068,
0.2792202234268... | |
string q (this string s){
return s + " " + s;
}
}
}
```
and my usage like this
```
Imports x.y
'...'
Dim r as string = "greg"
Dim s as string = r.q() ' does not show in intelisense
' and throws error : Compiler Error Message: BC30203: Identifier expected.
```
It w... | [
0.08063403517007828,
-0.05491301044821739,
0.36340853571891785,
-0.21171507239341736,
0.036115605384111404,
-0.08090829104185104,
0.5475481748580933,
-0.24016475677490234,
0.1395067274570465,
-0.35157907009124756,
-0.2467602640390396,
0.6592131853103638,
-0.28987449407577515,
-0.0492527335... | |
of quirks. First, I created a C# class library targeting .NET 3.5. Here's the only code in the project:
```
using System;
namespace ExtensionLibrary
{
public static class Extensions
{
public static string CustomExtension(this string text)
{
char[] chars = text.ToCharArray();
Array.Reverse(char... | [
0.5118165612220764,
-0.04676612839102745,
0.5054628849029541,
-0.18483611941337585,
0.032957807183265686,
0.26339781284332275,
0.23791702091693878,
-0.4597839415073395,
-0.09263279289007187,
-0.2595039904117584,
0.12570981681346893,
0.7632045149803162,
-0.5496069192886353,
0.08649559319019... | |
Sub Main()
Console.WriteLine("Hello".CustomExtension())
End Sub
End Module
```
This compiles and runs. (I would have called the method Reverse() but I wasn't sure whether VB might magically have reverse abilities already somewhere - I'm not a VB expert by a long chalk.)
Initially, I wasn't offered Exten... | [
0.10303584486246109,
-0.09586639702320099,
0.6848981976509094,
-0.357263445854187,
0.014599602669477463,
0.13926944136619568,
0.4658440947532654,
0.10649527609348297,
-0.07613653689622879,
-0.6698447465896606,
-0.13924537599086761,
0.4583245813846588,
-0.23608167469501495,
0.37577581405639... | |
long story short, it can be done, and it should work just fine. I don't suppose the problem is that you're either using an old version of VB or your project isn't targeting .NET 3.5?
As noted in comments: there's one additional quirk, which is that [extension methods won't be found when the compile-time type of the ta... | [
0.37186697125434875,
-0.08498997986316681,
0.12207254767417908,
0.28464174270629883,
0.12230085581541061,
-0.4032786190509796,
0.030446192249655724,
-0.0415433906018734,
-0.4454219937324524,
-0.10259495675563812,
-0.1834772229194641,
0.6391612887382507,
-0.0597543939948082,
0.1208523735404... | |
> **Possible Duplicate:**
>
> [C++ difference of keywords ‘typename’ and ‘class’ in templates](https://stackoverflow.com/questions/2023977/c-difference-of-keywords-typename-and-class-in-templates)
When defining a function template or class template in C++, one can write this:
```
template <class T> ...
```
or on... | [
0.23246680200099945,
0.03113459050655365,
0.01391050685197115,
-0.025989726185798645,
-0.16659007966518402,
0.051930688321590424,
0.21886388957500458,
-0.12367704510688782,
-0.16807956993579865,
-0.6559003591537476,
0.05083964392542839,
0.6304556131362915,
-0.2829669713973999,
-0.012004339... | |
reasons to use both.
* Some people don't care which one they use.
Note, however, that before C++17 in the case of *template template* parameters, use of `class` instead of `typename` was required. See [user1428839's answer](https://stackoverflow.com/a/11311432/3964522) below. (But this particular case is not a matter ... | [
0.5028476119041443,
0.12522439658641815,
-0.24486763775348663,
-0.12945537269115448,
-0.08741483092308044,
-0.2694874107837677,
0.07766249775886536,
-0.3475576937198639,
-0.15092261135578156,
-0.17596730589866638,
-0.10054419934749603,
0.4825795888900757,
-0.6468576192855835,
0.09163253009... | |
resolve syntactic ambiguity, and decided to let it also be used to specify template types to reduce confusion, but for backward compatibility, `class` kept its overloaded meaning. | [
0.010058946907520294,
-0.23445163667201996,
-0.4901706576347351,
0.05092037469148636,
-0.14372305572032928,
0.14420795440673828,
0.28249335289001465,
-0.013790594413876534,
0.11081020534038544,
-0.26309120655059814,
-0.3304908573627472,
0.1482381373643875,
-0.3859310448169708,
-0.072930581... | |
We're running into issues with how we specify font sizes. If we specify the font sizes using pt, they don't always look the same across browsers/platforms. If we specify font sizes using px, IE6 users can't resize the text.
[An article on A List Apart](http://www.alistapart.com/articles/howtosizetextincss/) (November 2... | [
0.2740510404109955,
-0.2515731155872345,
0.5524663925170898,
-0.024373341351747513,
-0.1705288589000702,
0.3081893026828766,
0.3175605237483978,
-0.6740173697471619,
0.08302433043718338,
-0.713596761226654,
0.0007407137891277671,
0.5302544832229614,
-0.17196400463581085,
-0.400474399328231... | |
and use as a best practice for sizing text in CSS that satisfies both designers and readers.
They provided [screen shots](http://www.alistapart.com/d/howtosizetextincss/ss-test-6.html) of how this technique looks in most popular browsers. Here is the code they used:
```
<style type="text/css">`
body {
font-size:1... | [
0.25380560755729675,
0.1872597485780716,
0.6047319769859314,
-0.03559476509690285,
-0.298963725566864,
0.2964113652706146,
0.1668781042098999,
-0.5283523797988892,
-0.12628616392612457,
-0.7477989196777344,
-0.23206807672977448,
0.3176693022251129,
0.205862894654274,
-0.43429699540138245,
... | |
Can I safely download and install .Net framework 3.5 SP1 without requiring my customers to upgrade their .Net Framework distributable?
EDIT: And without changing my build script
EDIT: I'm currently running 3.5
[From hanselman](http://www.hanselman.com/blog/VS2008AndNet35SP1BetaShouldYouFearThisRelease.aspx),
On the ... | [
0.4146274924278259,
0.07517409324645996,
0.5741223096847534,
-0.04258476570248604,
-0.16652603447437286,
-0.2656134068965912,
0.6493164300918579,
-0.39782676100730896,
-0.018295645713806152,
-0.7171231508255005,
0.0261974073946476,
0.6885707974433899,
0.0371616892516613,
-0.234899431467056... | |
I am trying to debug a strange issue with users that have [LogMeIn](https://secure.logmein.com/home.asp) installed. After a few days, some of my dialogs that my app opens can end up offscreen. If I could reliable detect that, I could programmatically move the dialogs back where they are visible again.
Note: this has t... | [
0.5729005336761475,
0.16478531062602997,
0.30349016189575195,
-0.0822468250989914,
0.09428296238183975,
-0.47782865166664124,
0.6851900815963745,
0.2956932485103607,
-0.37102627754211426,
-0.8881909251213074,
-0.07932611554861069,
0.3027186691761017,
-0.1104939803481102,
0.3524011373519897... | |
screen saver go, then log in remotely with LogMeIn, then try to open a dialog from your app, you will have trouble if you use wxDisplay::GetFromPoint(pos) or wxWindowBase::Center() to position the dialog.
Simply use MonitorFromWindow with the MONITOR\_DEFAULTTONULL flag. If the return value is null, your window is not ... | [
-0.11527495086193085,
-0.29178473353385925,
0.7390236854553223,
0.040841713547706604,
0.1626652032136917,
-0.16817979514598846,
0.41726595163345337,
0.2559823989868164,
-0.25562968850135803,
-1.0653005838394165,
-0.33792904019355774,
1.0971628427505493,
-0.22802789509296417,
-0.00900404900... | |
I'm trying to pass one method to another in elisp, and then
have that method execute it. Here is an example:
```
(defun t1 ()
"t1")
(defun t2 ()
"t1")
(defun call-t (t)
; how do I execute "t"?
(t))
; How do I pass in method reference?
(call-t 't1)
```
First, I'm not sure that naming your function `t` is he... | [
0.23346854746341705,
0.011772237718105316,
0.22717948257923126,
-0.15755769610404968,
-0.22317256033420563,
-0.15594807267189026,
0.6130658984184265,
-0.3248646557331085,
0.18729142844676971,
-0.2770484387874603,
-0.24715332686901093,
0.8109786510467529,
-0.2716503441333771,
-0.28825479745... | |
'funcall', which triggers the actual function call. | [
-0.2220829874277115,
-0.5333607792854309,
0.42474228143692017,
-0.001029197359457612,
-0.23544155061244965,
-0.18413713574409485,
0.028829682618379593,
0.28044769167900085,
-0.041361868381500244,
0.20631639659404755,
-0.9373222589492798,
0.8207151293754578,
-0.2620597779750824,
-0.13244925... | |
window.scrollMaxY can be set via that property in IE and older versions of Firefox, but when trying in FF3 it says "Cannot set this property as it only has a getter".
What is my alternative?
EDIT:
The reason why I'm asking is that I'm fixing some very horrible JS written by someone else, it has a function to keep a ... | [
0.4543590545654297,
0.03659221902489662,
0.5703775882720947,
-0.09342978894710541,
-0.04331458359956741,
-0.18344467878341675,
0.3163074851036072,
-0.01991017907857895,
-0.08997482061386108,
-0.8321483135223389,
-0.05893475189805031,
0.7124082446098328,
-0.49019622802734375,
0.074323140084... | |
your function `t` is helping as 't' is used as the [truth value](http://www.mcs.vuw.ac.nz/cgi-bin/info2www?(elisp)nil+and+t) in lisp.
That said, the following code works for me:
```
(defun test-func-1 () "test-func-1"
(interactive "*")
(insert-string "testing callers"))
(defun func-caller (callee)
"Execute ... | [
0.2595572769641876,
-0.07077844440937042,
0.21490846574306488,
-0.02779967710375786,
-0.14016351103782654,
-0.31545671820640564,
0.5188734531402588,
-0.07403608411550522,
0.1646963506937027,
-0.188803568482399,
-0.3319810926914215,
1.0801012516021729,
-0.27728787064552307,
-0.4385188221931... | |
I'm storing an ArrayList of Ids in a processing script that I want to spit out as a comma delimited list for output to the debug log. Is there a way I can get this easily without looping through things?
EDIT: Thanks to Joel for pointing out the List(Of T) that is available in .net 2.0 and above. That makes things TONS... | [
0.5380815267562866,
0.061364367604255676,
0.23367586731910706,
0.08012983202934265,
-0.05311407148838043,
-0.20284824073314667,
0.40072566270828247,
-0.08273041248321533,
-0.2501416802406311,
-0.7587383985519409,
-0.013191097415983677,
0.5717180371284485,
-0.2633798122406006,
-0.1341917365... | |
must have the items stored as Strings if you're using Option Strict to make sure the conversion takes place properly.
EDIT: If you're using .net 2.0 or above, simply create a List(Of String) type object and you can get what you need with. Many thanks to Joel for bringing this up!
```
String.Join(",", TargetList.ToArr... | [
0.44713887572288513,
-0.20022940635681152,
0.09720371663570404,
0.06358599662780762,
-0.04691280052065849,
-0.31557634472846985,
0.26677510142326355,
-0.12502871453762054,
-0.255156546831131,
-0.8485652804374695,
-0.25804904103279114,
0.5327568650245667,
-0.25086867809295654,
0.00686002755... | |
I have a generic class in C# with 2 constructors:
```
public Houses(params T[] InitialiseElements)
{}
public Houses(int Num, T DefaultValue)
{}
```
Constructing an object using int as the generic type and passing in two ints as arguments causes the 'incorrect' constructor to be called (from my point of view).
E.g. ... | [
0.09426146000623703,
0.15652385354042053,
0.22761760652065277,
-0.11412530392408371,
-0.43733081221580505,
0.21049751341342926,
0.34276098012924194,
-0.5161904692649841,
-0.19115671515464783,
-0.5577297806739807,
-0.2529584765434265,
0.23708821833133698,
-0.5027698874473572,
0.250921577215... | |
two static factory methods. If you put these into a nongeneric class, you can also benefit from type inference:
```
public static class Houses
{
public static Houses<T> CreateFromElements<T>(params T[] initialElements)
{
return new Houses<T>(initialElements);
}
public Houses<T> CreateFromDefau... | [
0.4561114013195038,
-0.02650480903685093,
0.23818054795265198,
-0.27560681104660034,
-0.09667046368122101,
0.5675841569900513,
0.25891146063804626,
-0.6809642910957336,
-0.42601388692855835,
-0.4579768478870392,
-0.2820340394973755,
0.30566808581352234,
-0.5638536214828491,
0.2998609542846... | |
no confusion. | [
0.19074836373329163,
0.13044308125972748,
-0.2687488794326782,
0.2855076193809509,
-0.2850969731807709,
-0.3588133156299591,
0.10536980628967285,
0.1845632791519165,
-0.0978151261806488,
-0.5029510855674744,
-0.23690693080425262,
0.4196876585483551,
-0.37793415784835815,
-0.404168665409088... | |
Is it possible to create Eclipse plugins that auto-discover eachother?
I am developing a set of plugins that need to operate in two primary situations:
* individually
* in concert with each other.
When run individually, the plugins should "just work" but when in concert, they will be sharing some of the same model c... | [
0.5614732503890991,
0.013721255585551262,
-0.07301794737577438,
-0.15043313801288605,
-0.2914455831050873,
-0.0044583603739738464,
0.03032509796321392,
-0.23761576414108276,
-0.01958577334880829,
-0.609024703502655,
0.154835507273674,
0.5436757802963257,
-0.5173300504684448,
-0.33519911766... | |
Don't share
Does Eclipse offer any internal publication / detection methods that would facilitate this sort of auto-detection of other plugins?
The answer should be through [Declarative Service](http://www.infoq.com/news/2008/01/eclipse-osgi-comparison), which combines the advantages of both eclipse xml extensions and... | [
0.5260389447212219,
0.11063766479492188,
0.49888908863067627,
0.03334296867251396,
-0.6394597291946411,
-0.04967678710818291,
0.24772001802921295,
-0.11631094664335251,
-0.016096509993076324,
-0.15397244691848755,
0.13931384682655334,
0.5722575187683105,
-0.48140639066696167,
0.08389312773... | |
or 1, indicates the optionality, the second one, 1 or n, indicates the multiplicity.
In practice, those [DS (Declarative Services)](http://wiki.eclipse.org/PDE/Incubator/DS) are not easy to use, as you have to access the BundleContext, meaning keeping track of the BundleActivator, [which is not always easy](http://dev... | [
0.2859591245651245,
-0.6578393578529358,
0.5471824407577515,
0.17683133482933044,
-0.45127493143081665,
0.14507035911083221,
0.13500092923641205,
-0.40973415970802307,
-0.2839231789112091,
-0.4518166184425354,
-0.4320896565914154,
0.3967704772949219,
-0.0849275067448616,
-0.078972928225994... | |
I am trying to create a new instance of Excel using VBA using:
```vb
Set XlApp = New Excel.Application
```
The problem is that this new instance of Excel doesn't load all the addins that load when I open Excel normally...Is there anything in the Excel Application object for loading in all the user-specified addins?
... | [
0.49857017397880554,
0.556837260723114,
0.18953947722911835,
-0.24167044460773468,
-0.46132487058639526,
-0.08534760773181915,
0.06545645743608475,
-0.1678715944290161,
-0.21313884854316711,
-0.7094281911849976,
0.06297572702169418,
0.5717033743858337,
-0.5415588021278381,
0.17809535562992... | |
seems to have all the addins listed in the Tools->Addins menu, with a boolean value stating whether or not an addin is installed. So what seems to work for me now is to loop through all addins and if .Installed = true then I set .Installed to False and back to True, and that seems to properly load my addins.
```
Funct... | [
0.17145012319087982,
-0.17295236885547638,
0.8667735457420349,
-0.1864050179719925,
0.07579214870929718,
0.04181063547730446,
0.238543301820755,
-0.25413236021995544,
-0.09832572191953659,
-0.2924254238605499,
-0.15095150470733643,
0.5672563314437866,
-0.5170073509216309,
0.233797326683998... | |
CurrAddin.Installed = False
CurrAddin.Installed = True
End If
Next CurrAddin
End Function
``` | [
-0.26996108889579773,
-0.06559634208679199,
0.8909114003181458,
-0.04713371396064758,
0.012958451174199581,
-0.17627501487731934,
0.45906683802604675,
0.06512914597988129,
0.254312664270401,
-0.14633993804454803,
-0.444852352142334,
0.5575962066650391,
-0.6056098341941833,
0.86451399326324... | |
At work we have two competing theories for salts. The products I work on use something like a user name or phone number to salt the hash. Essentially something that is different for each user but is readily available to us. The other product randomly generates a salt for each user and changes each time the user changes... | [
0.29926368594169617,
0.2655028998851776,
0.21901054680347443,
-0.009789012372493744,
-0.06236511841416359,
-0.15222705900669098,
-0.045802365988492966,
-0.20226052403450012,
0.3374384343624115,
-0.7052127718925476,
0.32470083236694336,
0.05157475173473358,
-0.0533117838203907,
0.2819381654... | |
point of view. Right now to authenticate a user, the salt must be unencrypted and applied to the login information.
After thinking about it, I just don't see a real security gain from this approach. Changing the salt from account to account, still makes it extremely difficult for someone to attempt to brute force the... | [
0.01711108535528183,
0.37158140540122986,
0.21480301022529602,
-0.032395556569099426,
0.017560020089149475,
-0.28478434681892395,
0.562622606754303,
-0.09453856945037842,
-0.13126224279403687,
-0.5466408729553223,
0.20453178882598877,
0.2652501165866852,
0.03686070069670677,
0.199344575405... | |
two digits is significantly easier than finding the correct hash of passwords which are 8 digits). Am I incorrect in my logic, or is there something that I am missing?
**EDIT:** Okay so here's the reason why I think it's really moot to encrypt the salt. (lemme know if I'm on the right track).
For the following expla... | [
-0.21179747581481934,
0.259673148393631,
0.08404552936553955,
0.09585104137659073,
-0.057895660400390625,
0.08225718140602112,
0.6767427325248718,
-0.003969665616750717,
-0.1465572714805603,
-0.5767735242843628,
0.24512635171413422,
0.5167218446731567,
0.19525863230228424,
0.06528766453266... | |
(actually technically I could if I had one of sufficient size, but let's ignore that for the moment). This is the real key to the salt from what I understand, because to crack every account I have to reinvent the wheel so to speak for each one. Now if I know how to apply the correct salt to a password to generate the h... | [
-0.05010753124952316,
0.575108528137207,
0.24611973762512207,
-0.0873890370130539,
0.10394882410764694,
-0.11846994608640671,
0.3589228391647339,
-0.00590116623789072,
-0.018956167623400688,
-0.34459513425827026,
0.2919501066207886,
0.5208107829093933,
0.28573304414749146,
0.32327559590339... | |
+ salt from 13^26 to 8^26 because I know what the salt is. Now that makes it easier, but still really hard.
So onto encrypting the salt. If I know the salt is encrypted, I wouldn't try and decrypt (assuming I know it has a sufficient level of encryption) it first. I would ignore it. Instead of trying to figure out ho... | [
-0.4427202045917511,
0.4349859058856964,
0.3377487063407898,
-0.26120564341545105,
-0.4202328026294708,
0.13019810616970062,
0.3647342920303345,
-0.10845781117677689,
-0.11536741256713867,
-0.5375285148620605,
0.0017522216076031327,
0.20132577419281006,
-0.10008509457111359,
0.146991178393... | |
add the monumental task of trying to crack the salt encryption first. That's why I don't think it's worth it. Thoughts?
Here is a link describing how long passwords will hold up under a brute force attack:
<http://www.lockdown.co.uk/?pg=combi>
The answer here is to ask yourself what you're really trying to protect fro... | [
0.2656664550304413,
0.33584165573120117,
-0.02550686150789261,
0.26639777421951294,
-0.005215583369135857,
-0.1629299819469452,
0.6413394212722778,
-0.1029297336935997,
0.02705617994070053,
-0.4669235050678253,
0.21864382922649384,
0.5091314911842346,
0.17061792314052582,
0.234894424676895... | |
it so it isn't possible to form a rainbow table to crack your entire password database in one go if it gets broken into. From that point of view, so long as each salt is unique there is no difference, a brute force attack would be required with your salts or the encrypted salts for each password individually. | [
0.06140941381454468,
0.2369513362646103,
-0.14974261820316315,
0.21097590029239655,
-0.30958932638168335,
-0.24291114509105682,
0.4243527352809906,
-0.43959417939186096,
-0.40371471643447876,
-0.4921817183494568,
0.16241247951984406,
-0.003065975848585367,
-0.25611066818237305,
0.297384351... | |
What are the Win32 APIs to use to programically delete files and folders?
**Edit**
[DeleteFile](http://msdn.microsoft.com/en-us/library/aa363915(VS.85).aspx) and [RemoveDirectory](http://msdn.microsoft.com/en-us/library/aa365488(VS.85).aspx) are what I was looking for.
However, for this project I ended up using [SH... | [
-0.09183520823717117,
-0.040803395211696625,
0.004647803492844105,
0.0410943329334259,
-0.07116222381591797,
0.05336854234337807,
0.2615213096141815,
-0.13864867389202118,
-0.19846488535404205,
-0.47318360209465027,
-0.21054832637310028,
0.4967033565044403,
-0.49815836548805237,
0.06902497... | |
I have tree tables, Customer, Invoice and InvoiceRow with the standard relations.
These I have to export in one fixed field length file with the first two characters of each row identifying the row type. The row types have different specifications.
I could probably do it with a nested loop in a script block, but thi... | [
-0.010533394291996956,
0.13484163582324982,
0.19937890768051147,
-0.13790209591388702,
-0.18295319378376007,
0.2795487344264984,
0.08123784512281418,
0.05676955357193947,
-0.10158752650022507,
-0.7662490606307983,
0.015131711028516293,
0.7272152304649353,
-0.37836116552352905,
-0.043483063... | |
doesn't jive with SSIS well. I don't consider this a beginner package. If you must use SSIS then I'd start by inner joining all the data so there is one row for each InvoiceRow, containing the data needed from all three tables.
CustomerCols, InvoiceCols, RowCols
Then, in the script destination component you'll need t... | [
-0.32039472460746765,
-0.16305388510227203,
0.5062693357467651,
0.021178187802433968,
-0.02841973304748535,
0.1331431269645691,
0.02714613638818264,
0.16164392232894897,
-0.1130603700876236,
-1.0586059093475342,
0.2968185245990753,
0.5075377821922302,
-0.006017869804054499,
0.0628975927829... | |
So, I've started to create some Ruby unit tests that use [Selenium RC](http://selenium-rc.openqa.org/) to test my web app directly in the browser. I'm using the [Selenum-Client](http://github.com/ph7/selenium-client/tree/master) for ruby. I've created a base class for all my other selenium tests to inherit from.
This ... | [
0.6533451080322266,
0.2782347500324249,
0.06657914817333221,
0.1704634130001068,
-0.35294145345687866,
0.11250012367963791,
0.25454050302505493,
-0.43701356649398804,
0.24009454250335693,
-0.6203008890151978,
0.1564534604549408,
0.4539653956890106,
-0.19366678595542908,
0.26833075284957886... | |
Selenium::SeleniumDriver.new("localhost", 4444, browser, "http://localhost:3003", 10000)
end
start
open start_address
end
def teardown
stop
end
#sub-classes should override this if they want to change it
def start_address
"http://localhost:3003/"
end
# Overrides standard "open" m... | [
-0.19988498091697693,
-0.2185916155576706,
0.5308506488800049,
-0.39863941073417664,
-0.10326588898897171,
0.02335316874086857,
0.16471779346466064,
-0.20946186780929565,
0.1424371600151062,
-0.8236200213432312,
-0.638805627822876,
0.13433173298835754,
-0.30781877040863037,
0.1864327341318... | |
optionLocator)
method_missing 'select', inputLocator, optionLocator
end
def method_missing(method_name, *args)
@seleniums.each do |selenium_driver|
if args.empty?
selenium_driver.send method_name
else
selenium_driver.send method_name, *args
end
end
end
end
```
Thi... | [
-0.17681151628494263,
-0.43137556314468384,
0.2365095466375351,
-0.10394137352705002,
0.224856436252594,
0.2684269845485687,
0.03562433272600174,
0.05007500201463699,
-0.3344169557094574,
-0.7573005557060242,
-0.2972792685031891,
0.5130689144134521,
-0.33839648962020874,
0.0264018569141626... | |
details you need. I may be wrong, as I didn't use it for quite a while. | [
0.2066567838191986,
-0.3181956708431244,
0.011582414619624615,
0.6005953550338745,
0.06401551514863968,
-0.4070778489112854,
-0.11281999945640564,
0.5016190409660339,
-0.12294565141201019,
-0.5339922308921814,
0.0757322832942009,
0.6007382273674011,
0.09722165018320084,
0.03002664446830749... | |
Before you answer, this question is complicated:
1. We are developing in asp.net / asp.net mvc / jQuery but I'm open to solutions on any platform using any framework
2. I think logic like sorting / hiding columns / re-arranging columns / validation (where it makes sense) should be on the client-side
3. I think logic l... | [
0.20298275351524353,
0.11802367866039276,
0.2043977826833725,
-0.00012113414413761348,
-0.1924392729997635,
-0.1789403259754181,
0.016212834045290947,
-0.252312570810318,
-0.18624000251293182,
-0.902180016040802,
0.11811612546443939,
0.15696585178375244,
-0.38265261054039,
0.01838720031082... | |
in different contexts. I understand that I can use a JavaScript file + object oriented JavaScript, I'm looking for the pattern that makes it all easier.
One solution proposed was to have an MVC model on both the client and server side, where we can encapsulate JavaScript functionality in client side controllers, then ... | [
0.40199294686317444,
0.06634360551834106,
0.4897705912590027,
0.10108232498168945,
0.09808788448572159,
-0.35612815618515015,
0.2204822301864624,
-0.22580981254577637,
-0.32781684398651123,
-0.49552515149116516,
0.12028324604034424,
0.5165197253227234,
-0.3715783357620239,
0.08223825693130... | |
can find a way to manipulate the DB on the client side that would be impressive ;)
I don't know how ASP.net works though, so I am solely speaking from my PHP experience.
I would write controls that are paired by server and client code. Each control needs a form, client side logic and server side logic. The form is wr... | [
0.3364332318305969,
-0.19465969502925873,
0.23874813318252563,
0.4344542920589447,
-0.3581153452396393,
0.05081212893128395,
-0.07401174306869507,
-0.32866260409355164,
0.1331988126039505,
-0.44792163372039795,
0.2863730192184448,
0.45103853940963745,
-0.34219565987586975,
-0.1581746190786... | |
side logic to a specific action/controller, so be sure to define an interface that can be used to talk to your control instead...
Then for each form I would write a class in javascript that instances your controls. For example; you may have a control:
```
{include file = "list_view.php" id = "ListView1" data = $Data.... | [
-0.02552025020122528,
-0.35134556889533997,
0.7592489123344421,
0.272598534822464,
-0.30900314450263977,
0.011599813587963581,
0.015011626295745373,
-0.4588125944137573,
-0.015524298883974552,
-0.49047955870628357,
0.3481512665748596,
0.5413733720779419,
-0.25428950786590576,
-0.0546566806... | |
page button - and also handles columns and sorting (which will also delegate to the server). | [
-0.49245256185531616,
-0.10875706374645233,
0.841044008731842,
0.1790512353181839,
-0.08580104261636734,
0.09067443013191223,
-0.20903098583221436,
0.0687451958656311,
-0.40813642740249634,
-0.7170052528381348,
-0.3960678279399872,
0.02222423441708088,
-0.3549816608428955,
0.08913609385490... | |
Is it possible to pass a App setting "string" in the web.config to a Common C# class?
Of course it's possible - but the thing to keep in mind is that a properly designed class (unless it's explicitly designed for ASP.NET) shouldn't know or care where the information comes from. There should be a property (or method, bu... | [
0.2941189408302307,
-0.07186208665370941,
0.233982115983963,
0.3188299834728241,
0.13143987953662872,
-0.4441726505756378,
0.0003480509913060814,
0.023854894563555717,
-0.21198077499866486,
-0.42151203751564026,
-0.3199087679386139,
0.5075744390487671,
-0.20291049778461456,
-0.306479275226... | |
My MySQL database contains several tables using different storage engines
(specifically myisam and innodb). How can I find out which tables are
using which engine?
```
SHOW TABLE STATUS WHERE Name = 'xxx'
```
This will give you (among other things) an `Engine` column, which is what you want. | [
-0.15920445322990417,
0.33603793382644653,
0.3164583146572113,
0.24718965590000153,
0.12597554922103882,
0.14674623310565948,
-0.11196431517601013,
0.2780907154083252,
-0.11300348490476608,
-0.7881643772125244,
0.2701945900917053,
0.28976067900657654,
-0.174345463514328,
0.2172641903162002... | |
I have written an Excel VBA macro which imports data from a HTML file (stored locally) before performing calculations on the data.
At the moment the HTML file is referred to with an absolute path:
```
Workbooks.Open FileName:="C:\Documents and Settings\Senior Caterer\My Documents\Endurance Calculation\TRICATEndurance... | [
0.3884914219379425,
0.3128078281879425,
0.5664793252944946,
-0.4953140318393707,
0.02837410941720009,
0.016251767054200172,
0.16006453335285187,
-0.11339312791824341,
-0.1394587755203247,
-0.7456376552581787,
-0.08065668493509293,
0.6369462609291077,
-0.001852125395089388,
-0.0073002646677... | |
just completely unable to do it. I have searched on the web and the suggested solutions have all appeared very complicated.
I am using Excel 2000 and 2002 at work, but as I plan to distribute it I would want it to work with as many versions of Excel as possible.
Any suggestions gratefully received.
Just to clarify wh... | [
0.26159095764160156,
0.16941839456558228,
0.10637044161558151,
0.1351637840270996,
0.2873990535736084,
-0.1641441136598587,
0.30509430170059204,
-0.010739726945757866,
-0.07557040452957153,
-0.7000547647476196,
-0.056885961443185806,
0.4899339973926544,
-0.07460226118564606,
-0.01763497106... | |
I have embedded a Python interpreter in a C program. Suppose the C program reads some bytes from a file into a char array and learns (somehow) that the bytes represent text with a certain encoding (e.g., ISO 8859-1, Windows-1252, or UTF-8). How do I decode the contents of this char array into a Python string?
The Pyth... | [
0.14799511432647705,
0.32264572381973267,
-0.007464410737156868,
-0.19148409366607666,
-0.04449549317359924,
0.058415621519088745,
0.15391114354133606,
-0.3568848967552185,
0.10530403256416321,
-0.5240343809127808,
-0.18789713084697723,
0.39652732014656067,
-0.3199596405029297,
0.037524253... | |
main(int argc, char *argv[])
{
char c_string[] = { (char)0x93, 0 };
PyObject *py_string;
Py_Initialize();
py_string = PyString_Decode(c_string, 1, "windows_1252", "replace");
if (!py_string) {
PyErr_Print();
return 1;
}
return 0;
}
```
The error message is `Uni... | [
-0.5346335768699646,
-0.04099251329898834,
0.36210906505584717,
-0.23755402863025665,
0.3292272090911865,
0.4585058391094208,
0.3626369535923004,
0.05324775353074074,
-0.4523972272872925,
-0.1932753026485443,
-0.6099022626876831,
0.22206220030784607,
-0.333339124917984,
0.2268267124891281,... | |
even though we specify `windows_1252` in the call to `PyString_Decode`.
The following code works around the problem by using `PyString_FromString` to create a Python string of the undecoded bytes, then calling its `decode` method:
```
#include <Python.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
cha... | [
-0.1082422211766243,
0.021317850798368454,
0.40140196681022644,
-0.3171425759792328,
0.07374270260334015,
0.09814421832561493,
0.03887075185775757,
-0.48015138506889343,
-0.20405791699886322,
-0.21716086566448212,
-0.35196149349212646,
0.5333653688430786,
-0.40969422459602356,
0.0809768810... | |
Py_DECREF(raw);
printf("Decoded: ");
PyObject_Print(decoded, stdout, 0);
printf("\n");
return 0;
}
```
PyString\_Decode does this:
```
PyObject *PyString_Decode(const char *s,
Py_ssize_t size,
const char *encoding,
const char *errors)
{
PyObject *v, *s... | [
-0.28035205602645874,
-0.11127679795026779,
0.34530794620513916,
-0.2984117865562439,
0.016161823645234108,
0.5630877017974854,
0.2813536822795868,
-0.48836877942085266,
-0.32286784052848816,
-0.40563657879829407,
-0.6895596981048584,
0.4758297801017761,
-0.3952789604663849,
0.032479327172... | |
return NULL;
v = PyString_AsDecodedString(str, encoding, errors);
Py_DECREF(str);
return v;
}
```
IOW, it does basically what you're doing in your second example - converts to a string, then decode the string. The problem here arises from PyString\_AsDecodedString, rather than PyString\_AsDecodedObject. P... | [
-0.08564633131027222,
-0.017092345282435417,
-0.09574712812900543,
-0.3114563226699829,
-0.045682381838560104,
-0.15131516754627228,
0.3522592782974243,
-0.19820909202098846,
-0.1573672890663147,
-0.5998283624649048,
-0.32912659645080566,
0.6192668676376343,
-0.44391578435897827,
-0.070806... | |
<Python.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
char c_string[] = { (char)0x93, 0 };
PyObject *py_string, *py_unicode;
Py_Initialize();
py_string = PyString_FromStringAndSize(c_string, 1);
if (!py_string) {
PyErr_Print();
return 1;
}
py_unicode ... | [
-0.12333042174577713,
-0.027672389522194862,
0.3616733253002167,
-0.27122825384140015,
0.04651942849159241,
0.2823250889778137,
0.23441533744335175,
-0.3471311926841736,
-0.3129645884037018,
-0.1147441640496254,
-0.5983307361602783,
0.48710206151008606,
-0.5654976963996887,
-0.133966997265... | |
way is. A [very old thread on python-dev](http://mail.python.org/pipermail/python-dev/2001-May/014547.html) seems to indicate that it has something to do with chaining the output, but since the Python methods don't do the same, I'm not sure if that's still relevant. | [
0.31423258781433105,
-0.40741440653800964,
0.5584571957588196,
0.23555919528007507,
0.019768616184592247,
-0.35077837109565735,
0.09050042182207108,
0.0025561198126524687,
-0.29294562339782715,
-0.28617390990257263,
0.05167095363140106,
0.19916634261608124,
-0.13975799083709717,
0.17185999... | |
I'm writing a sample console service host and I want to plug into WCF stack to be able to print a message to console when new message arrives, even if it won't get processed by the service at the moment (because service is working on previous calls).
This is based on my assumption that messages arriving get queued by t... | [
0.08414866775274277,
-0.08710214495658875,
0.6154241561889648,
-0.0801517516374588,
0.05983860418200493,
-0.047484561800956726,
0.17331327497959137,
-0.2691476345062256,
-0.23535624146461487,
-0.6167715787887573,
0.002372708870097995,
0.3538447618484497,
-0.4235535264015198,
0.103884033858... | |
const char *encoding,
const char *errors)
{
PyObject *v, *str;
str = PyString_FromStringAndSize(s, size);
if (str == NULL)
return NULL;
v = PyString_AsDecodedString(str, encoding, errors);
Py_DECREF(str);
return v;
}
```
IOW, it does basically what you're doing in your secon... | [
-0.3722575604915619,
-0.24854549765586853,
0.24153931438922882,
-0.32875239849090576,
-0.1759023219347,
0.10693326592445374,
0.32699307799339294,
-0.4436327815055847,
-0.11152956634759903,
-0.5648473501205444,
-0.3116771876811981,
0.4694570004940033,
-0.3965494632720947,
0.1148256435990333... | |
the resulting unicode object into a string object with the default encoding (for you, looks like that's ASCII). That's where it fails.
I believe you'll need to do two calls - but you can use PyString\_AsDecodedObject rather than calling the python "decode" method. Something like:
```
#include <Python.h>
#include <std... | [
-0.196011021733284,
0.008434251882135868,
0.3514031767845154,
-0.3178029954433441,
0.07169260829687119,
0.32796868681907654,
0.13412947952747345,
-0.3194510340690613,
-0.07993888854980469,
-0.5820143818855286,
-0.5567510724067688,
0.4700931906700134,
-0.43068113923072815,
-0.04327762871980... | |
return 1;
}
py_unicode = PyString_AsDecodedObject(py_string, "windows_1252", "replace");
Py_DECREF(py_string);
return 0;
}
```
I'm not entirely sure what the reasoning behind PyString\_Decode working this way is. A [very old thread on python-dev](http://mail.python.org/pipermail/python-dev/2001-M... | [
-0.06270605325698853,
-0.23634859919548035,
0.4572134017944336,
-0.2082653045654297,
-0.29067784547805786,
-0.10542567819356918,
0.02453548274934292,
-0.21732261776924133,
-0.294236421585083,
-0.1215105727314949,
-0.4526996612548828,
0.49869200587272644,
-0.5755573511123657,
0.283723324537... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.