unified_texts
stringlengths
32
30.1k
OpenStatus_id
int64
0
4
input_ids
list
token_type_ids
list
attention_mask
list
can i use bdb(berkeley db) file created by c implementation by oracle berkeley db java edition? === I have a berkeley db file (*.bdb) which is created by the most widely used C implementation. Is it possible to read this file by a pure java implementation of Berkeley Db? I tried to read it using berkeley db java edition (je) but could not. je throws out an exception saying that it could not detect the berkeley database. Are berkeley db files not inter operable across different implementations? If so, why?
0
[ 2, 92, 31, 275, 334, 9007, 5, 15371, 62, 631, 13, 9007, 6, 3893, 679, 34, 272, 6123, 34, 15759, 8039, 13, 9007, 8247, 1322, 60, 800, 3726, 3726, 31, 57, 21, 8039, 13, 9007, 3893, 13, 5, 2483, 9, 220, 9007, 6, 56, 25, 679, 34...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
How do you mock classes that use RAII in c++ === Here's my issue, I'd like to mock a class that creates a thread at initialization and closes it at destruction. There's no reason for my mock class to actually create and close threads. But, to mock a class, I have inherit from it. When I create a new instance of my mock class, the base classes constructor is called, creating the thread. When my mock object is destroyed, the base classes destructor is called, attempting to close the thread. How does one mock an RAII class without having to deal with the actual resource?
0
[ 2, 184, 107, 42, 10506, 2684, 30, 275, 6623, 49, 19, 272, 20512, 800, 3726, 3726, 235, 22, 18, 51, 1513, 15, 31, 22, 43, 101, 20, 10506, 21, 718, 30, 9695, 21, 9322, 35, 2104, 1829, 17, 543, 18, 32, 35, 5203, 9, 80, 22, 18, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Can require_once be used with symbolic links? === On a CentOS LAMP box, trying to get require_once to work inside a script in PHP5. If the file to be included is not a in symlinked directory, it works fine, but if the file to be required is in a directory found via a symbolic link, it fails to find it. Is this a limitation of require_once and symbolic links?
0
[ 2, 92, 4077, 1, 13120, 44, 147, 29, 12882, 6271, 60, 800, 3726, 3726, 27, 21, 5802, 759, 6792, 1649, 15, 749, 20, 164, 4077, 1, 13120, 20, 170, 572, 21, 3884, 19, 13, 26120, 264, 9, 100, 14, 3893, 20, 44, 506, 25, 52, 21, 19...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Type casting a char string to its underlying data type. === I have a string(char*), and i need to find its underlying datatype such as int, float, double, short, long, or just a character array containing alphabets with or with out digits(like varchar in SQL). For ex: char* str1 = "12312" char* str2 = "231.342" char* str3 = "234234243234" char* str4 = "4323434.2432342" char* str5 = "i contain only alphabets" **Given these strings, i need to find that the first string is of type int and typecast it to an int, and so on** ex: int no1 = atoi(str1) float no2 = atof(str2) long no3 = atol(str3) double no4 = strtod(str4) char* varchar1 = strdup(str5)
0
[ 2, 1001, 9087, 21, 4892, 3724, 20, 82, 10974, 1054, 1001, 9, 800, 3726, 3726, 31, 57, 21, 3724, 5, 5433, 2483, 6, 15, 17, 31, 376, 20, 477, 82, 10974, 1054, 4474, 145, 28, 19, 38, 15, 11510, 15, 1494, 15, 502, 15, 175, 15, 5...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Why would waveOutWrite() cause an exception in the debug heap? === While researching this issue, I found multiple mentions of the following scenario online, invariably as unanswered questions on programming forums. I hope that posting this here will at least serve to document my findings. First, the symptom: While running pretty standard code that uses waveOutWrite() to output PCM audio, I sometimes get this when running under the debugger: ntdll.dll!_DbgBreakPoint@0() ntdll.dll!_RtlpBreakPointHeap@4() + 0x28 bytes ntdll.dll!_RtlpValidateHeapEntry@12() + 0x113 bytes ntdll.dll!_RtlDebugGetUserInfoHeap@20() + 0x96 bytes ntdll.dll!_RtlGetUserInfoHeap@20() + 0x32743 bytes kernel32.dll!_GlobalHandle@4() + 0x3a bytes wdmaud.drv!_waveCompleteHeader@4() + 0x40 bytes wdmaud.drv!_waveThread@4() + 0x9c bytes kernel32.dll!_BaseThreadStart@8() + 0x37 bytes While the obvious suspect would be a heap corruption somewhere else in the code, I found out that that's not the case. Furthermore, I was able to reproduce this problem using the following code (this is part of a dialog based MFC application:) void CwaveoutDlg::OnBnClickedButton1() { WAVEFORMATEX wfx; wfx.nSamplesPerSec = 44100; /* sample rate */ wfx.wBitsPerSample = 16; /* sample size */ wfx.nChannels = 2; wfx.cbSize = 0; /* size of _extra_ info */ wfx.wFormatTag = WAVE_FORMAT_PCM; wfx.nBlockAlign = (wfx.wBitsPerSample >> 3) * wfx.nChannels; wfx.nAvgBytesPerSec = wfx.nBlockAlign * wfx.nSamplesPerSec; waveOutOpen(&hWaveOut, WAVE_MAPPER, &wfx, (DWORD_PTR)m_hWnd, 0, CALLBACK_WINDOW ); ZeroMemory(&header, sizeof(header)); header.dwBufferLength = 4608; header.lpData = (LPSTR)malloc(4608); waveOutPrepareHeader(hWaveOut, &header, sizeof(header)); waveOutWrite(hWaveOut, &header, sizeof(header)); } afx_msg LRESULT CwaveoutDlg::OnWOMDone(WPARAM wParam, LPARAM lParam) { HWAVEOUT dev = (HWAVEOUT)wParam; WAVEHDR *hdr = (WAVEHDR*)lParam; waveOutUnprepareHeader(dev, hdr, sizeof(WAVEHDR)); free(hdr->lpData); ZeroMemory(hdr, sizeof(*hdr)); hdr->dwBufferLength = 4608; hdr->lpData = (LPSTR)malloc(4608); waveOutPrepareHeader(hWaveOut, &header, sizeof(WAVEHDR)); waveOutWrite(hWaveOut, hdr, sizeof(WAVEHDR)); return 0; } Before anyone comments on this, yes - the sample code plays back uninitialized memory. Don't try this with your speakers turned all the way up. Some debugging revealed the following information: waveOutPrepareHeader() populates header.reserved with a pointer to what appears to be a structure containing at least two pointers as its first two members. The first pointer is set to NULL. After calling waveOutWrite(), this pointer is set to a pointer allocated on the global heap. Normally, the header is returned to the application by waveCompleteHeader(), a function internal to wdmaud.dll. waveCompleteHeader() tries to deallocate the pointer allocated by waveOutWrite() by calling GlobalHandle()/GlobalUnlock() and friends. Sometimes, GlobalHandle() bombs, as shown above. Now, the reason that GlobalHandle() bombs is not due to a heap corruption, as I suspected at first - it's because waveOutWrite() returned without setting the first pointer in the internal structure to a valid pointer. I suspect that it frees the memory pointed to by that pointer before returning, but I haven't disassembled it yet. This only appears to happen when the wave playback system is low on buffers, which is why I'm using a single header to reproduce this. At this point I have a pretty good case against this being a bug in my application - after all, my application is not even running. Has anyone seen this before?
0
[ 2, 483, 83, 2367, 1320, 23716, 5, 6, 1679, 40, 5391, 19, 14, 121, 16254, 15414, 60, 800, 3726, 3726, 133, 527, 68, 48, 1513, 15, 31, 216, 1886, 10292, 16, 14, 249, 12705, 2087, 15, 27913, 28, 29920, 2346, 27, 3143, 5691, 18, 9, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
linq to xml in F# === How can i use linq to xml in F# to extract all the < a > tags in a website. can someone point me in the right direction ?
0
[ 2, 6294, 1251, 20, 23504, 19, 398, 5910, 800, 3726, 3726, 184, 92, 31, 275, 6294, 1251, 20, 23504, 19, 398, 5910, 20, 10962, 65, 14, 13, 1, 21, 13, 1, 3383, 18, 19, 21, 2271, 9, 92, 737, 454, 55, 19, 14, 193, 1400, 13, 60, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
what would be the impediments to creating an "Europanto" type universal scripting language? === After switching back and forth between several scripting languages this week, I found myself thinking how similar they all are. Yet I'm always reaching for Google (or nowadays SO) to remember details like what the local equivalents of "instanceof" and "endswith" are, or the right syntax to declare an interface, or whatever. This reminded me of the (human) language [Europonto][1]. Just pick some vaguely English syntax and some vaguely Romance/Germanic/Slavic vocabulary, and it's all good! So what would happen if we tried to do the same thing with a scripting language. In the mood for Python-style indented blocks today? Fine! Want to use a prototype object? Ok! Can only remember how to spell the PHP names of some library function? No problem! Anyway, that's the wild and crazy idea. Since we need a question that admits concrete answers, let's tighten it up like this: What would be the most significant conflicts in creating a scripting language that permitted all the native syntax and library functions of [Python, Ruby, PHP, and JavaScript], such that you could freely intermix code blocks and function names between languages? And let's say that any particular construction should be consistent at the statement level. So we'll allow: foreach( $foo as $bar ) { if $foo == 2: print "hi" } but not, say, foreach( $foo as $bar ) { if $foo == 2: print "hi" endif end Conflicts can include: parser ambiguities; name collision; conflicting semantics for objects or functions or closures; etc. I'm guessing that scope will be a ginormous issue, but you tell me. I'll start this as "community wiki" from the get go, so if you think it's a fun question but want to make it more rigorous, feel free to edit. [1]: http://en.wikipedia.org/wiki/Europanto
0
[ 2, 98, 83, 44, 14, 5420, 69, 49, 6601, 20, 2936, 40, 13, 7, 62, 6521, 3206, 262, 7, 1001, 4172, 3884, 68, 816, 60, 800, 3726, 3726, 75, 13027, 97, 17, 5882, 128, 238, 3884, 68, 2556, 48, 877, 15, 31, 216, 992, 1440, 184, 835...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Design: Large archive file editor, file mapping === I'm writing an editor software for large archive files (4GB+), in native+managed C++. For accessing the files, I'm using file mapping like any sane person. This is absolutely great for reading data, but a problem arises in actually editing the archive. File mapping does not allow resizing a file while it's being accessed, so I don't know how I should proceed when the user wants to insert new data in the file (which would exceed the file's original size, when it was mapped.) Should I remap the whole thing every time? That's bound to be slow. However, I'd want to keep the editor real-time with exclusive file access, since that simplifies the programming a lot, and won't let the file get screwed by other applications while being modified. I wouldn't want to spend an eternity working on the editor; It's just a simple dev-tool for the actual project I'm working on. So I'd like to hear how you've handled similar cases, and what other archiving software and especially other games do to solve this?
0
[ 2, 704, 45, 370, 9250, 3893, 1835, 15, 3893, 13305, 800, 3726, 3726, 31, 22, 79, 1174, 40, 1835, 2306, 26, 370, 9250, 6488, 13, 5, 300, 11400, 2430, 6, 15, 19, 1275, 2430, 177, 8030, 272, 20512, 9, 26, 1381, 68, 14, 6488, 15, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
How can I gain root access on a Macintosh OSX system without wiping the OS? === My father died recently and I've inherited his Mac. I'd love to put it to use in my own life but I don't want to wipe its brains out just so I can reconfigure it to use in my network, etc. His old files are historically important to me - I trust you can understand my desire to keep them. I can log in as I had an account on the machine before he passed, but that's about it. Thanks for the help.
0
[ 2, 184, 92, 31, 3288, 5900, 1381, 27, 21, 24024, 13, 759, 396, 329, 366, 16740, 14, 13, 759, 60, 800, 3726, 3726, 51, 321, 440, 1989, 17, 31, 22, 195, 7179, 33, 1572, 9, 31, 22, 43, 339, 20, 442, 32, 20, 275, 19, 51, 258, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
shared library problems on linux === I'm trying to compile/link a **very** old piece of software on a linux system and I can't for some reason link with a shared library that's installed on my system. I get the following error from the linker: /usr/bin/ld: cannot find -lXaw However, the lib itself is installed. If I run ldconfig -v | grep libXaw I get (among other things) this hit: libXaw.so.7 -> libXaw7.so.7.0.0 The library and the links to it are in /usr/lib btw. So nothing special. So the library is there and ldconfig finds it. What could ld cause ld from not finding the library during link-time? As you may have already guessed I'm quite new to the shared library stuff. Any ideas?
0
[ 2, 2592, 1248, 1716, 27, 13024, 800, 3726, 3726, 31, 22, 79, 749, 20, 26561, 118, 6258, 21, 13, 1409, 7864, 1409, 315, 1855, 16, 2306, 27, 21, 13024, 329, 17, 31, 92, 22, 38, 26, 109, 1215, 3508, 29, 21, 2592, 1248, 30, 22, 18...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
I can't connect to my server over the internet === I can run the server on my local machine and connect to it on the same machine, but when i try to connect to it from a different computer over the internet, there is not sign of activity on my server, nor a response from the server on the computer im testing on. Ive tried both XP and vista/turn off firewalls/opened ports/run as admin; nothing is working :( Here is my code that im used to accept an incoming connection:<pre><code> int port = 3326; Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); try { TcpListener listener = new TcpListener(new IPEndPoint(IPAddress.Any, port)); listener.Start(); Console.WriteLine("Server established\nListening on Port: {0}\n", port); while (true) { socket = listener.AcceptSocket(); socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.SendTimeout, outime); socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.KeepAlive, true); socket.DontFragment = true; NewConnection pxy = new NewConnection(socket); Thread client = new Thread(new ThreadStart(pxy.Start)); client.IsBackground = true; client.Start(); } }</code></pre> Please help! C#.NET3.5
0
[ 2, 31, 92, 22, 38, 6379, 20, 51, 8128, 84, 14, 2620, 800, 3726, 3726, 31, 92, 485, 14, 8128, 27, 51, 375, 1940, 17, 6379, 20, 32, 27, 14, 205, 1940, 15, 47, 76, 31, 1131, 20, 6379, 20, 32, 37, 21, 421, 1428, 84, 14, 2620, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Hidden folder copied during unit test run on VS2008 === I've found that when running a VS2008 unit test that a hidden .svn subversion folder is copied under the Out folder that the unit test creates. This is because I've labeled a Resources folder in my unit test as "Additional File and Folder to deploy." Anybody know if you can mark a folder (in this case the .svn folder) as an exclude?
0
[ 2, 3689, 19294, 18225, 112, 1237, 1289, 485, 27, 4611, 2753, 800, 3726, 3726, 31, 22, 195, 216, 30, 76, 946, 21, 4611, 2753, 1237, 1289, 30, 21, 3689, 13, 9, 18, 16578, 972, 10898, 19294, 25, 18225, 131, 14, 70, 19294, 30, 14, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Open Source Software using jQuery === I'm looking for some open source software projects that I can reference to get more depth in my knowledge of programming jQuery. Can you please recommend projects that make heavy use of the jQuery library.
0
[ 2, 368, 1267, 2306, 568, 487, 8190, 93, 800, 3726, 3726, 31, 22, 79, 699, 26, 109, 368, 1267, 2306, 2314, 30, 31, 92, 2801, 20, 164, 91, 5204, 19, 51, 1918, 16, 3143, 487, 8190, 93, 9, 92, 42, 2247, 12360, 2314, 30, 233, 1278,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0...
Problems to delete XML elements with PHP DOM === Here's the XML file i'm working on: <list> <activity>swimming</activity> <activity>running</activity> <activity>soccer</activity> </list> The index.php, page that shows the list of activities with checkboxes, a button to delete the checked activities, and a field to add new activities: <html> <head></head> <body> <?php $xmldoc = new DOMDocument(); $xmldoc->load('sample.xml', LIBXML_NOBLANKS); $count = 0; $activities = $xmldoc->firstChild->firstChild; //prints the list of activities, with checkboxes on the left for each item //the $count variable is the id to each entry if($activities!=null){ echo '<form name=\'erase\' action=\'delete.php\' method=\'post\'>' . "\n"; while($activities!=null){ $count++; echo " <input type=\"checkbox\" name=\"activity[]\" value=\"$count\"/>"; echo ' '.$activities->textContent.'<br/>'."\n"; $activities = $activities->nextSibling; } echo ' <input type=\'submit\' value=\'erase selected\'>'; echo '</form>'; } ?> //section used for inserting new entries. this feature is working as expected. <form name='input' action='insert.php' method='post'> insert activity: <input type='text name='activity'/> <input type='submit' value='send'/> <br/> </form> </body> </html> the delete.php, which is not working as expected: <?php $xmldoc = new DOMDocument(); $xmldoc->load('sample.xml', LIBXML_NOBLANKS); $atvID = $_POST['activity']; foreach($atvID as $id){ $delnode = $xmldoc->getElementsByTagName('activity'); $xmldoc->firstChild->removeChild($delnode->item($id)); } $xmldoc->save('sample.xml'); ?> I've tested the deletion routine without the loop, using an hard-coded arbitrary id, and it worked. I also tested the $atvID array, and it printed the selected id numbers correctly. When it is inside the loop, here's the error it outputs: > Catchable fatal error: Argument 1 > passed to DOMNode::removeChild() must > be an instance of DOMNode, null given > in > /directorypath/delete.php > on line 9 What is wrong with my code?
0
[ 2, 1716, 20, 27448, 23504, 2065, 29, 13, 26120, 11859, 800, 3726, 3726, 235, 22, 18, 14, 23504, 3893, 31, 22, 79, 638, 27, 45, 13, 1, 5739, 1, 13, 1, 19348, 1, 18, 3976, 3363, 68, 1, 118, 19348, 1, 13, 1, 19348, 1, 11325, 1,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
In search of jQuery Month Picker === I'm in search of a JavaScript month selection tool. I'm already using jQuery on the website, so if it were a jQuery plugin, that would fit nicely. I'm open to other options, as well. Basically, I'm after a simplified version of the [jQuery UI Date Picker][1]. I don't care about the day of the month, just the month and year. Using the Date Picker control feels like overkill and a kludge. I know I could just use a pair of select boxes, but that feels cluttered, and then I also need a confirmation button. I'm envisioning a grid of either two rows of six columns, or three rows of four columns, for month selection, and current and future years across the top. (Maybe the ability to list a few years? I can't see anyone ever needing to go more than a year or two ahead, so if I could list the current and next two years, that would be swell) It's really just a dumbed down version of the DatePicker. Does something like this exist? [1]:http://docs.jquery.com/UI/Datepicker
0
[ 2, 19, 2122, 16, 487, 8190, 93, 1617, 2036, 106, 800, 3726, 3726, 31, 22, 79, 19, 2122, 16, 21, 8247, 8741, 1617, 3155, 5607, 9, 31, 22, 79, 614, 568, 487, 8190, 93, 27, 14, 2271, 15, 86, 100, 32, 46, 21, 487, 8190, 93, 1092...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
What's the easiest way/best tutorials to get familiar with SQLAlchemy ? === What are best resources/tutorials for starting up with SQLAlchemy? Maybe some simple step by step stuff like creating a simple table and using it and going up from there.
0
[ 2, 98, 22, 18, 14, 27237, 161, 118, 4936, 29724, 18, 20, 164, 3694, 29, 4444, 10834, 2569, 915, 13, 60, 800, 3726, 3726, 98, 50, 246, 2566, 118, 2473, 9819, 192, 18, 26, 1422, 71, 29, 4444, 10834, 2569, 915, 60, 913, 109, 1935, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
What is the worst thing you did or had to do under pressure? === ... which you probably wouldn't have done or done much better if you wouldn't have been under time pressure or basically any form of stress. And what the outcome or repurcussions of that thing were. Examples: - You wrote a terrible "won't touch this ever again" piece of code you end up extending and supporting the next 3 years. - Yelled at a fellow coworker, only to find out it was your fault all along. - Quit your job in affection over a dispute of coding style or the use of one API over another. - You had to come in to fix a severe bug only hours before your honeymoon flight was scheduled for take off. Did you still catch it? I want to hear about the thing(s) you did, the circumstances that caused stress and pressure and how it affected your judgement/behavior. And finally, what the outcome or repurcussions of it were. Disclaimer: I know this question is similar to [Confessions of your worst WTF moment][1] but i'm only interested in the stories that were caused by working under pressure, and what was actually causing the stress and pressure. [1]: http://stackoverflow.com/questions/63668/confessions-of-your-worst-wtf-moment-what-not-to-do
0
[ 2, 98, 25, 14, 4126, 584, 42, 144, 54, 41, 20, 107, 131, 1859, 60, 800, 3726, 3726, 13, 9, 9, 9, 56, 42, 910, 1265, 22, 38, 57, 677, 54, 677, 212, 574, 100, 42, 1265, 22, 38, 57, 74, 131, 85, 1859, 54, 11374, 186, 505, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
How to initialise a rather complex char array in C? === Assuming Visual C/C++ 6, I have a complex data structure of 22399 elements that looks like this: { { "(SAME", "AS", "U+4E18)", "HILLOCK", "OR", "MOUND"}, { "TO", "LICK;", {1, 1, 0}, "TASTE,", "A", "MAT,", "BAMBOO", "BARK"}, { "(J)", "NON-STANDARD", "FORM", "OF", "U+559C", ",", {1, 1, 0}, "LIKE,", "LOVE,", "ENJOY;", {1, 1, 4}, "JOYFUL", "THING"}, { "(AN", "ANCIENT", {1, 2, 2}, {1, 2, 3}, "U+4E94)", "FIVE"}, ... } What's the best way to declare this? I've tried things like char * abbrevs3[22399][] = { ... }; and char * abbrevs3[22399][][] = { ... }; but the compile whinges something chronic.
0
[ 2, 184, 20, 2104, 2628, 21, 864, 1502, 4892, 7718, 19, 272, 60, 800, 3726, 3726, 11704, 3458, 272, 118, 150, 20512, 400, 15, 31, 57, 21, 1502, 1054, 1411, 16, 13, 20836, 3483, 2065, 30, 1879, 101, 48, 45, 13, 1, 13, 1, 13, 7, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
switch case vs if else === I was wondering if there was any difference in the way the following code was compiled into assembly. I've heard that switch-case is more efficient than if else, but in this example I am not quite sure if that would be the case. if(x=1){ ... }else if(x=2){ ... }else{ ... } and switch(x){ case 1: ... break; case 2: ... break; default: ... }
0
[ 2, 5521, 610, 4611, 100, 962, 800, 3726, 3726, 31, 23, 5712, 100, 80, 23, 186, 2841, 19, 14, 161, 14, 249, 1797, 23, 9316, 77, 1475, 9, 31, 22, 195, 752, 30, 5521, 8, 10325, 25, 91, 8243, 119, 100, 962, 15, 47, 19, 48, 823, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Is it possible to develop a Powerful WEB Search Engine using Erlang, Mnesia & YAWS??? === I am thinking of developing A Web search Engine using Erlang, Mnesia & YAWS. Is it possible to make powerful & fastest WEB SEARCH ENGINE using these???? What will it need to accomplish this & HOW to start with???? If you have any suggestions, I'll be greatful to you.
0
[ 2, 25, 32, 938, 20, 2803, 21, 2177, 2741, 2122, 1406, 568, 13, 106, 9949, 15, 307, 2696, 549, 279, 2167, 10268, 60, 60, 60, 800, 3726, 3726, 31, 589, 1440, 16, 3561, 21, 2741, 2122, 1406, 568, 13, 106, 9949, 15, 307, 2696, 549, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Test Driven Design for iPhone Native apps === I'm experimenting with the iPhone SDK and doing some TDD ala Dr. Nic's rbiPhoneTest project. I'm wondering how many, if any, have been successful using this or any other testing framework for iPhone/Cocoa? More important, I'd like to know how to best assert a proprietary binary request/response protocol. The idea is to send a binary request over the network and receive a binary response. Requests and responses are created using byte and'ing and or'ing. I'm using the golden copy pattern to test my request. Here's what I have so far. Don't laugh as I'm new to btoh Objective C and Ruby: require File.dirname(__FILE__) + '/test_helper' require 'fileutils' require 'io' require "MyModel.bundle" OSX::ns_import :MyModel module MyTestExtensions def is_absolute_path(path) return /^\/.*/.match(path) end def parent_directory(file) dir = file if(! is_absolute_path(dir)) dir = File.expand_path(dir) end dir = File.dirname(dir) assert is_absolute_path(dir), "Expecting an absolute path with #{dir}" return dir end def assert_NSData_contains_bytes_from_file(file, data) assert_not_nil data, "Data should not be nil." assert data.bytes, "data should have bytes" data.length.times { |i| expected = file.getc assert_not_nil expected, "Expected only #{i} bytes. Actual data contains more." actual = data.bytes.int8_at(i) assert_equal expected, actual, "Bytes should be equal at offset #{i} expected #{expected.chr} but was #{actual.chr}" } expected = file.getc raise AssertionFailedError, "Expecting #{expected.chr} at offset #{data.length}" unless expected == nil end end class TestMyModel < Test::Unit::TestCase include OSX include MyTestExtensions def this_files_dir return parent_directory(__FILE__) end def setup @expectedReq = File.new("#{this_files_dir}/ExpectedMyReq") # @expectedReq = File.new("#{this_files_dir}/hello.txt") assert File.exist?("#{this_files_dir}/ExpectedMyReq"), "The file [#{@expectedReq.path}] should exist." end def test_my_model_class_exists MyModel end def test_can_init_instance assert MyModel.instancesRespondToSelector(:init), "MyModel Should define :init" end def test_my_model_can_request_my_data myModel = MyModel.alloc.init data = myModel.requestMyData 'Some query text' assert_NSData_contains_bytes_from_file @expectedReq, data end end
0
[ 2, 1289, 5355, 704, 26, 21024, 1275, 4865, 18, 800, 3726, 3726, 31, 22, 79, 5737, 68, 29, 14, 21024, 13, 18, 43, 197, 17, 845, 109, 15596, 43, 21, 531, 744, 9, 13, 4796, 22, 18, 13, 9002, 7709, 10543, 669, 9, 31, 22, 79, 571...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
What's the best way to use memcache with a single-server app? === For a single-server LAMP site (which is usually under quite high load), what is best way to use memcache? Does it make sense to run the memcache daemon on the same server as the application, or is that just going to take valuable memory away from MySQL, giving a net performance loss. Does it even make sense to use memcache in this scenario- or is the best solution to always have dedicated servers for memcache? I appreciate that profiling the site before and after would be required to really answer this question, but I would rather not do that at this stage on the live site. Especially as someone out there certainly knows the answer off the top of their head.
0
[ 2, 98, 22, 18, 14, 246, 161, 20, 275, 55, 4829, 9616, 29, 21, 345, 8, 10321, 106, 4865, 60, 800, 3726, 3726, 26, 21, 345, 8, 10321, 106, 6792, 689, 13, 5, 2140, 25, 951, 131, 1450, 183, 6305, 6, 15, 98, 25, 246, 161, 20, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
What factors should be taken into consideration when writing a custom exception class? === When are **custom Exception classes** most-valuable? Are there cases when they should or should not be used? What are the benefits? **Related questions:** 1. **[Performace Considerations for throwing Exceptions][1]** 2. **[Do you write exceptions for specific issues or general exceptions?][2]** [1]: http://stackoverflow.com/questions/6891/performance-considerations-for-throwing-exceptions [2]: http://stackoverflow.com/questions/21652/do-you-write-exceptions-for-specific-issues-or-general-exceptions
0
[ 2, 98, 4776, 378, 44, 658, 77, 9888, 76, 1174, 21, 5816, 5391, 718, 60, 800, 3726, 3726, 76, 50, 13, 1409, 4636, 6015, 5391, 2684, 1409, 127, 8, 3377, 291, 579, 60, 50, 80, 1871, 76, 59, 378, 54, 378, 52, 44, 147, 60, 98, 50...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
CruiseControl [.Net] vs TeamCity for continuous integration? === i would like to ask you which automated build environment you consider better, based on practical experience. i'm planning to do some .Net and some Java development, so i would like to have a tool that supports both these platforms. i've been reading around and found out about CruiseControls(.Net), used on stackoverflow development, and the TeamCity with its support for build agents on different OS-platforms and based on different programming languages. so, if you have some practical experience on both of those, which one you prefer and why. currently, i'm mostly interested in the ease of use and management of the tool, much less in the fact that CC is open source, and TC is a subject to licensing at some point when you have much projects to run (because, i need it for a small amount of projects). also, if there is some other tool that meets the above-mentioned and you believe it's worth a recommendation - feel free to include it in the discussion.
0
[ 2, 6581, 12898, 636, 9, 2328, 500, 4611, 173, 5788, 26, 6357, 8078, 60, 800, 3726, 3726, 31, 83, 101, 20, 1349, 42, 56, 14904, 1895, 2307, 42, 3563, 574, 15, 432, 27, 5713, 1496, 9, 31, 22, 79, 2334, 20, 107, 109, 13, 9, 2328,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
whats the main differences between xhtml and html? which one is better in your opinion and why? === whats the main differences between xhtml and html? which one is better in your opinion and why?
0
[ 2, 98, 18, 14, 407, 4921, 128, 993, 15895, 17, 13, 15895, 60, 56, 53, 25, 574, 19, 154, 4052, 17, 483, 60, 800, 3726, 3726, 98, 18, 14, 407, 4921, 128, 993, 15895, 17, 13, 15895, 60, 56, 53, 25, 574, 19, 154, 4052, 17, 483, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
Capture which step of an animated system cursor is being shown on Windows === I want to capture as a bitmap the system cursor on Windows OSes as accurately as possible. The provided API for this is to my knowledge GetCursorInfo, DrawIconEx. The simple chain of actions is: - Get cursor by using GetCursorInfo - Paint the cursor in a memory DC by using DrawIconEx. Here is how the code looks roughly. CURSORINFO CursorInfo; (VOID)memset(&CursorInfo, 0, sizeof(CursorInfo)); CursorInfo.cbSize = sizeof(CursorInfo); if (GetCursorInfo(&CursorInfo) && CursorInfo.hCursor) { // ... create here the memory DC boError |= !DrawIconEx(hCursorDC, // device context 0, // xLeft 0, // yTop CursorInfo.hCursor, // cursor handle 0, // width, use system default 0, // height, use system default 0, // step of animated cursor !!!!!!!!! NULL, // flicker free brush, don't use it now DI_MASK | DI_DEFAULTSIZE); // flags // ... do whatever we want with the cursor in our memory DC } Now, anyone knows how I could get which step of the animated cursor is being drawn? Currently the above code obviously always renders only the first step of an animated cursor. I suspect this can not be easily done, but it's worth asking anyway.
0
[ 2, 3683, 56, 1424, 16, 40, 5784, 329, 29588, 25, 142, 1721, 27, 1936, 800, 3726, 3726, 31, 259, 20, 3683, 28, 21, 1142, 15022, 14, 329, 29588, 27, 1936, 13, 6641, 18, 28, 16353, 28, 938, 9, 14, 1173, 21, 2159, 26, 48, 25, 20, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Saving XML-Data in UserSettings === I'm trying to save some XML-Data in my UserSettings (Properties.Settings.Default.UserSettings) in a .NET Winforms Project. Is there a Possibility to do that or would it be better to save this Data in a seperated File? Thanks for your Answers!
0
[ 2, 7599, 23504, 8, 18768, 19, 4155, 19831, 18, 800, 3726, 3726, 31, 22, 79, 749, 20, 2079, 109, 23504, 8, 18768, 19, 51, 4155, 19831, 18, 13, 5, 10890, 106, 3915, 9, 19831, 18, 9, 13862, 9708, 9, 16704, 19831, 18, 6, 19, 21, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
How to find full path of Outlook .pst file? === Is there a way to programmatically find the location of the current user's Outlook .pst file(s) through an API call or registry entry?
0
[ 2, 184, 20, 477, 503, 2013, 16, 19837, 13, 9, 1919, 38, 3893, 60, 800, 3726, 3726, 25, 80, 21, 161, 20, 625, 6732, 1326, 477, 14, 1474, 16, 14, 866, 4155, 22, 18, 19837, 13, 9, 1919, 38, 3893, 5, 18, 6, 120, 40, 21, 2159, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
Spinlock Versus Semaphore! === What is the basic differences between Semaphores & Spinlock? & In what best situations or conditions, we can use these.
0
[ 2, 3310, 3966, 5706, 13, 18, 5996, 11093, 62, 187, 800, 3726, 3726, 98, 25, 14, 2125, 4921, 128, 13, 18, 5996, 11093, 160, 279, 3310, 3966, 60, 279, 19, 98, 246, 8329, 54, 2039, 15, 95, 92, 275, 158, 9, 3, 0, 0, 0, 0, 0, 0...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
Writing Quality Tests === we know that code coverage is a poor metric to use when gauging the quality of test code. we also know that testing the language/framework is a waste of time. on the other hand, what metrics can we use to identify quality tests? are there any best practices or rules of thumbs that you've learned to help you identify and write higher quality tests?
0
[ 2, 1174, 2190, 4894, 800, 3726, 3726, 95, 143, 30, 1797, 5245, 25, 21, 1696, 11544, 20, 275, 76, 6540, 2762, 14, 2190, 16, 1289, 1797, 9, 95, 67, 143, 30, 4431, 14, 816, 118, 8361, 3783, 25, 21, 4600, 16, 85, 9, 27, 14, 89, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Multiple forms in an HTML page posting to itself === I need to have multiple forms in the same webpage, all of them POSTing to itself and then performing different actions depending on the type of form. What's the best way to achieve this? To be more specific, the page shows the details of an event, with a form to subscribe (a drop-down box) and another form for each of the subscribed persons that allows them to unsubscribe (it's just a button).
0
[ 2, 1886, 1997, 19, 40, 13, 15895, 2478, 15669, 20, 1145, 800, 3726, 3726, 31, 376, 20, 57, 1886, 1997, 19, 14, 205, 2741, 6486, 15, 65, 16, 105, 15669, 20, 1145, 17, 94, 2955, 421, 3078, 4758, 27, 14, 1001, 16, 505, 9, 98, 22,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Committing binaries to SVN === I've searched around a bit, but haven't found a satisfactory answer, so I'd like to hear your opinions on this. I have a couple of tools which I have to update and deploy to a few servers every now and then. The source is managed in a SVN repository. To save myself the bother of copying the binaries to the production servers by ftp or similar means (I have no means of building the projects on the servers), I'm thinking of creating an area in the repository to commit them as well. I could then simply retrieve the most current version of the executables from the svn server whenever I need them. Since I don't necessarily want to update/commit the binaries every time I work on the source, I would not create the folder for the binaries as a subfolder of my project. Committing the binaries would then (and should) be a separate, conscious act. --- trunk --- project1 --- project2 --- built --- project1 --- project2 As far as I can see, there should be no problems with this setup. What I'd really like is to then give both the source revision and the binaries a single tag, so as to be able to retrieve everything that belongs together at once. --- tags/project1/release2/ includes files from --- trunk/project1/ revision 487 and --- built/project1/ revision 488 Is what I'm after possible, and how would I achieve it? Should I instead be looking at some other way of solving this problem?
0
[ 2, 19524, 4511, 11301, 20, 13, 18, 16578, 800, 3726, 3726, 31, 22, 195, 9036, 140, 21, 1142, 15, 47, 2933, 22, 38, 216, 21, 25549, 1623, 15, 86, 31, 22, 43, 101, 20, 990, 154, 11900, 27, 48, 9, 31, 57, 21, 1335, 16, 4672, 56...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
What is with the fascination with code metrics? === I've seen a number of 'code metrics' related questions on SO lately, and have to wonder what the fascination is? Here are two recent examples: * [what code metrics convince you that provided code is crappy](http://stackoverflow.com/questions/187289/what-code-metrics-convince-you-that-provided-code-is-crappy) * [when if ever is number of lines of code a useful metric](http://stackoverflow.com/questions/184071/when-if-ever-is-number-of-lines-of-code-a-useful-metric) * [writing quality tests](http://stackoverflow.com/questions/195856/writing-quality-tests) In my mind, no metric can substitute for a code review, though: * some metrics sometimes may indicate places that need to be reviewed, and * radical changes in metrics over short time frames may indicate places that need to be reviewed but i cannot think of a single metric that by itself always indicates 'good' or 'bad' code - there are always exceptions and reasons for things that the measurements cannot see. Is there some magical insight to be gained from code metrics that I've overlooked? Are lazy programmers/managers looking for excuses not to read code? Are people presented with giant legacy code bases and looking for a place to start? What's going on? Note: I have asked some of these questions on the specific threads both in answers and comments and got no replies, so I though I should ask the community in general as perhaps I am missing something. It would be nice to run a metrics batch job and not actually have to read other people's code (or my own) ever again, I just don't think it is practical!
0
[ 2, 98, 25, 29, 14, 22364, 29, 1797, 11544, 18, 60, 800, 3726, 3726, 31, 22, 195, 541, 21, 234, 16, 13, 22, 9375, 11544, 18, 22, 1597, 2346, 27, 86, 10434, 15, 17, 57, 20, 2666, 98, 14, 22364, 25, 60, 235, 50, 81, 1764, 3770,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Removing files when uninstalling Wix === When uninstalling my app, I'd like to configure the wix setup to remove all the files that were added **after the original installation**. It seems like the uninstaller removes only the directories and files that were originally installed from the MSI file and it leaves everything else that was added later in the app folder. In another words, I'd like to purge the directory when uninstalling. How do I do that? thanks
0
[ 2, 9096, 6488, 76, 367, 108, 21300, 68, 4807, 396, 800, 3726, 3726, 76, 367, 108, 21300, 68, 51, 4865, 15, 31, 22, 43, 101, 20, 1065, 15951, 14, 4807, 396, 18161, 20, 4681, 65, 14, 6488, 30, 46, 905, 13, 1409, 5162, 14, 501, 7...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Change an elements CSS class with Javascript === I want to change a CSS class of an html element in response to an onClick event using javascript.
0
[ 2, 753, 40, 2065, 272, 18, 18, 718, 29, 8247, 8741, 800, 3726, 3726, 31, 259, 20, 753, 21, 272, 18, 18, 718, 16, 40, 13, 15895, 4520, 19, 1627, 20, 40, 27, 150, 10129, 807, 568, 8247, 8741, 9, 3, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
Generating random number excluding range === How do you generate a random number within a range while excluding certain range(s). Eg. range 1-10 but not in 2-4 or 7. Solutions I've used so far: - Generate a random an test if it is within the dis-allowed range. Based on result either output the number or try again. - Map allowed ranges to a uniform range. Get a random between 1 and 6 and then map back (ie. 6 becomes 10). - Create allowed ranges (1-1,5-6,8-10). Randomly choose a range (optionally use weights) and a number in chosen range. What is your solution?
0
[ 2, 13500, 5477, 234, 13, 14938, 978, 800, 3726, 3726, 184, 107, 42, 7920, 21, 5477, 234, 363, 21, 978, 133, 13, 14938, 1200, 978, 5, 18, 6, 9, 12369, 9, 978, 137, 8, 1036, 47, 52, 19, 172, 8, 300, 54, 453, 9, 6776, 31, 22, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Validating Web Pages === I have been developing websites for a couple years now and I almost never check if my pages are valid html and css. My check is by using a site such as browsershots.org and checking how it looks in all the different browsers. However recently I have been taking a college course and the prof wants us to validate every thing we turn in. It got me to thinking. should I care if my pages validate or not?
0
[ 2, 7394, 1880, 2741, 4434, 800, 3726, 3726, 31, 57, 74, 3561, 13931, 26, 21, 1335, 122, 130, 17, 31, 557, 243, 2631, 100, 51, 4434, 50, 7394, 13, 15895, 17, 272, 18, 18, 9, 51, 2631, 25, 34, 568, 21, 689, 145, 28, 16495, 7868,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
How to make a char string from a C macros value? === For example, how to avoid writing the 'func_name' twice? #ifndef TEST_FUN # define TEST_FUN func_name # define TEST_FUN_NAME "func_name" #endif
0
[ 2, 184, 20, 233, 21, 4892, 3724, 37, 21, 272, 9069, 18, 1923, 60, 800, 3726, 3726, 26, 823, 15, 184, 20, 2658, 1174, 14, 13, 22, 16638, 150, 1, 7259, 22, 2088, 60, 6926, 821, 103, 13862, 1289, 1, 16638, 6926, 9267, 1289, 1, 16...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Best way to implement tab stops in valid XHTML? === For explanation imagine a simple address. Written in a HTML paragraph with line breaks it would like this: Street: Example Street 1 City: Vienna Zip Code: 1010 Country: Austria Most of the time that's completely okay, but sometimes I have to achieve the following output: Street: Example Street 1 City: Vienna Zip Code: 1010 Country: Austria My thoughts so far: 1. Should be valid XHTML and work or degrade gracefully in all major browsers 2. Using tags in a semantically correct way is strongly preferred 3. Because of point two: I hope there's a better solution than tables 4. The problem is not limited to addresses - would be useful in other situation too How do you achieve this output (using HTML and/or CSS)?
0
[ 2, 246, 161, 20, 8713, 6523, 6604, 19, 7394, 993, 15895, 60, 800, 3726, 3726, 26, 5764, 4382, 21, 1935, 3218, 9, 642, 19, 21, 13, 15895, 20599, 29, 293, 7947, 32, 83, 101, 48, 45, 446, 45, 823, 446, 137, 136, 45, 4945, 12133, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
which library better for faster java application swt or swing? === which library better for faster java application swt or swing?
0
[ 2, 56, 1248, 574, 26, 4233, 8247, 3010, 8783, 38, 54, 5587, 60, 800, 3726, 3726, 56, 1248, 574, 26, 4233, 8247, 3010, 8783, 38, 54, 5587, 60, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
Unique random numbers in O(1)? === The problem is this: I'd like to generate unique random numbers between 0 and 1000 that never repeat (I.E. 6 doesn't come out twice), but that doesn't resort to something like an O(N) search of previous values to do it. Is this possible?
0
[ 2, 2619, 5477, 2116, 19, 635, 5, 165, 6, 60, 800, 3726, 3726, 14, 1448, 25, 48, 45, 31, 22, 43, 101, 20, 7920, 2619, 5477, 2116, 128, 713, 17, 6150, 30, 243, 6830, 13, 5, 49, 9, 62, 9, 400, 1437, 22, 38, 340, 70, 2088, 6, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
JavaScript slider === I need to create a 'slider' for a client's site. The slider should allow people to select how many items they want of x item, and show what the price will be based on that. The weird(ish) part is that the ratio of the price increase will go down as the amount of items goes up: - 1 item: $100 - 2 items: +90 = $190 - 3 items: + 80 = $270 - 4 items: + 70 = $340 - 5 items: + 60 = $400 - 6 items: + 50 = $450 - 7 items: + 50 = $500 And all increases from then on are +50. This probably seems like an overly simplistic question, but does anyone know how I could go about doing this? I have almost no experience with JavaScript :(
0
[ 2, 8247, 8741, 3295, 106, 800, 3726, 3726, 31, 376, 20, 1600, 21, 13, 22, 18, 1210, 1157, 22, 26, 21, 6819, 22, 18, 689, 9, 14, 3295, 106, 378, 1655, 148, 20, 5407, 184, 151, 3755, 59, 259, 16, 993, 9101, 15, 17, 298, 98, 14...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Is there a more accurate way to create a Javascript timer than setTimeout? === Something that has always bugged me is how unpredictable the `setTimeout()` method in Javascript is. In my experience, the timer is horribly inaccurate in a lot of situations. By inaccurate, I mean the actual delay time seems to vary by 250-500ms more or less. Although this isn't a huge amount of time, when using it to hide/show UI elements the time can be visibly noticeable. Are there any tricks that can be done to ensure that `setTimeout()` performs accurately (without resorting to an external API) or is this a lost cause?
0
[ 2, 25, 80, 21, 91, 8137, 161, 20, 1600, 21, 8247, 8741, 85, 139, 119, 309, 891, 1320, 60, 800, 3726, 3726, 301, 30, 63, 550, 6256, 6430, 55, 25, 184, 24421, 14, 13, 1, 3554, 891, 1320, 5, 6, 1, 2109, 19, 8247, 8741, 25, 9, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
How can i split a PHP script that takes a long time to run into smaller chunks? === I have a PHP script that initialises an image gallery. It loops through all images, checks if they are thumbnailed and watermarks them. My shared hosting account only lets me have 30 seconds of execution per script, as set in the php.ini settings. I can't change that. What can I do to get round this? Currently I refresh the page after every 5 images, this prevents the script timing out, but the browser recognises that the script won't complete and gives an error. That's ok, but it's not really user friendly. Any suggestions?
0
[ 2, 184, 92, 31, 2132, 21, 13, 26120, 3884, 30, 1384, 21, 175, 85, 20, 485, 77, 2012, 15009, 18, 60, 800, 3726, 3726, 31, 57, 21, 13, 26120, 3884, 30, 2104, 2628, 18, 40, 1961, 2246, 9, 32, 19661, 120, 65, 3502, 15, 16602, 100,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Code formatting across Windows and Unix. === What Visual Studio settings and .emacs macros improve the likelihood that code written on Windows (in visual studio) will still look good in Emacs (and vice versa)? I've recently taken to turning off tabs in emacs (so tabs are rendered via spaces) and this at least makes the code look the same (tho people who like certain tab sizes are out of luck). Is there a better way?
0
[ 2, 1797, 2595, 1203, 464, 1936, 17, 22540, 9, 800, 3726, 3726, 98, 3458, 1120, 12410, 17, 13, 9, 62, 6893, 18, 9069, 18, 3545, 14, 19096, 30, 1797, 642, 27, 1936, 13, 5, 108, 3458, 1120, 6, 129, 174, 361, 254, 19, 13, 62, 6893...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
How can I access a public static member of a Java class from Coldfusion? === I think the above question says it all.
0
[ 2, 184, 92, 31, 1381, 21, 317, 12038, 322, 16, 21, 8247, 718, 37, 1191, 9818, 60, 800, 3726, 3726, 31, 277, 14, 784, 1301, 898, 32, 65, 9, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
Which database has the best XML support? === I have a system which generates a large number of XML documents every day (of the order of 1 million) and I would like to be able to store and index these so that I can, for example, search for all documents with a certain field set to a given value. I understand that there are fundamentally two types of XML database, those that provide XML support on top of a conventional relational database and those that are "native" XML database. Given that I am open to using either, what would you recommend?
0
[ 2, 56, 6018, 63, 14, 246, 23504, 555, 60, 800, 3726, 3726, 31, 57, 21, 329, 56, 7920, 18, 21, 370, 234, 16, 23504, 4374, 352, 208, 13, 5, 1041, 14, 389, 16, 137, 507, 6, 17, 31, 83, 101, 20, 44, 777, 20, 1718, 17, 4348, 15...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
When generating html, do you including formatting such as newlines and tabs? === Sometimes I add a \n at the end, and the relevant number of \t the beginning, and sometimes not - what's the recommended way to do this?
0
[ 2, 76, 13500, 13, 15895, 15, 107, 42, 215, 2595, 1203, 145, 28, 78, 7939, 17, 6523, 18, 60, 800, 3726, 3726, 1030, 31, 3547, 21, 13, 1, 103, 35, 14, 241, 15, 17, 14, 7480, 234, 16, 13, 1, 38, 14, 997, 15, 17, 1030, 52, 13,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0...
Best Way to Handle Multiple Scrolling Columns === I am in the process of developing a web application that consists visually of a header above a body containing four columns of variable-height content. The design gods have decreed it to be fixed height, mainly because each of the columns can potentially get very long, and so (being designers) they are wanting iframes with independent scrollbars. Four (potential) scrollbars are bad enough, but if the overall page height is fixed higher than the browser window then it'll end up with five! The 'normal' solution in a case like this of course is to fix the overall page height at something like 700 pixels to give it the 'best chance' of fitting vertically, but I don't want to do that for various reasons which I'd hope would be obvious. So my question is: What would be the best way to have a body container that fills the available (vertical space) with each of the columns doing the same thing? Is it even practical/possible? Bonus question: Can I reliably use the CSS overflow property for the columns or do I need nasty iframes? I have lots of CSS experience, but next to none with using percentage dimensions (especially when combined with pixel dimensions as I'll need for the header). Also, this must be standards-compliant and backwards-compatible to IE6. TIA.
0
[ 2, 246, 161, 20, 3053, 1886, 13, 28166, 7498, 800, 3726, 3726, 31, 589, 19, 14, 953, 16, 3561, 21, 2741, 3010, 30, 2043, 20747, 16, 21, 157, 106, 784, 21, 358, 3503, 222, 7498, 16, 7612, 8, 252, 7748, 2331, 9, 14, 704, 4769, 5...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Small problem with painting scroll bars with MFC === In an MFC application there is a small rectangular region where the scroll bars meet (bottom right of the window). It seems that this region only invalidates when the frame is resized. On other occasions (for example, if another window is dragged over it), this region does not repaint. I've been able to reproduce it in VS 6 and 2008 on newly created projects. I've also seen some commercial apps with the same problem. To recreate it: 1. Create a new SDI project with a CScrollView derived view. 2. Resize the window so that both scroll bars are shown. 3. Drag another window over that rectangle to see the repaint problem. Any ideas how to get rid of this?
0
[ 2, 284, 1448, 29, 2469, 12159, 6062, 29, 307, 7061, 800, 3726, 3726, 19, 40, 307, 7061, 3010, 80, 25, 21, 284, 11354, 632, 113, 14, 12159, 6062, 1255, 13, 5, 22389, 193, 16, 14, 1463, 6, 9, 32, 2206, 30, 48, 632, 104, 16671, 7...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
What is a component === I listen to the podcast java posse, on this there is often discussion about components (note components are not (clearly) objects). They lament the fact that Java does not have components, and contrast with .NET that does. Components apparently makes developing applications (not just GUI apps) easier. I can figure from the discussion certain qualities that a component has, its something to-do with decoupling (substituting one component for another is just a matter of plumbing). It has something to-do with properties, it definitely has something to-do with events and delegates. So to the questions: ./ can anyone explain to me what a component is. (and why java beans are not components). ./ can anyone explain why they help development. ./ can anyone explain why java does not have them if they are so useful.
0
[ 2, 98, 25, 21, 5912, 800, 3726, 3726, 31, 3834, 20, 14, 15124, 8247, 25801, 15, 27, 48, 80, 25, 478, 5460, 88, 5090, 13, 5, 10280, 5090, 50, 52, 13, 5, 18600, 102, 6, 3916, 6, 9, 59, 16786, 14, 837, 30, 8247, 630, 52, 57, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Coercing template class with operator T* when passing as T* argument of a function template === Assume I have a function template like this: template<class T> inline void doStuff(T* arr) { // stuff that needs to use sizeof(T) } Then in another `.h` filee I have a template class `Foo` that has: public: operator T*() const; Now, I realize that those are different Ts. But If I have a variable `Foo<Bar> f` on the stack, the only way to coerce it to *any* kind of pointer would be to invoke `operator T*()`. Yet, if call `doStuff(f)`, GCC complains that `doStuff` can't take `Foo<Bar>` instead of automatically using operator `T*()` to coerce to `Bar*` and then specializing the function template with `Bar` as `T`. Is there anything I can do to make this work with two templates? Or does either the argument of the template function be a real pointer type or the template class with the coercion operator be passed to a non-template function?
0
[ 2, 326, 106, 6302, 22894, 718, 29, 6022, 13, 38, 2483, 76, 2848, 28, 13, 38, 2483, 5476, 16, 21, 1990, 22894, 800, 3726, 3726, 7158, 31, 57, 21, 1990, 22894, 101, 48, 45, 22894, 1, 1898, 13, 38, 1, 19, 1143, 11364, 107, 384, 5...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
How can I find out what enums are defined by a class? === I know I can get the public static members of a class by doing something like: <code>obj.getClass().getFields()</code> but this doesn't get me the enums. I'd like to be able to get them from the Class object returned by the getClass method. Any ideas?
0
[ 2, 184, 92, 31, 477, 70, 98, 1957, 723, 18, 50, 2811, 34, 21, 718, 60, 800, 3726, 3726, 31, 143, 31, 92, 164, 14, 317, 12038, 443, 16, 21, 718, 34, 845, 301, 101, 45, 13, 1, 9375, 1, 111, 11741, 9, 3060, 1898, 5, 6, 9, 3...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Flex media framework === Does anybody know of a good media framework for Flex?<br/> I'd like to be able to create apps that can play not only those formats that the Flex framework provides support for, but other formats as well (like wav, wma, ogg and other...).
0
[ 2, 14409, 941, 6596, 800, 3726, 3726, 630, 11181, 143, 16, 21, 254, 941, 6596, 26, 14409, 60, 1, 5145, 118, 1, 31, 22, 43, 101, 20, 44, 777, 20, 1600, 4865, 18, 30, 92, 418, 52, 104, 273, 13767, 30, 14, 14409, 6596, 1927, 555,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Why do I get "permission denied" in PHP when trying to rename a directory? === I chmod'ed the directory to 777, same with the directory contents. Still, I get a "permission denied" error. Does PHP throw this error if apache is not the group/owner, regardless of the file permissions? Here's the call that's failing: rename('/correct/path/to/dir/1', '/correct/path/to/dir/2');
0
[ 2, 483, 107, 31, 164, 13, 7, 1432, 12385, 5265, 7, 19, 13, 26120, 76, 749, 20, 302, 7259, 21, 16755, 60, 800, 3726, 3726, 31, 6193, 13670, 22, 69, 14, 16755, 20, 13, 25081, 15, 205, 29, 14, 16755, 8478, 9, 174, 15, 31, 164, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
SharePoint does not find my custom RenderingTemplate === So I've created a custom RenderingTemplate and deployed it to CONTROLTEMPLATES\MyControlTemplates\ It basically dictates how a custom content type that i've created should be rendered when displayed. For that I've added this: <FormTemplates xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms"> <Display>CustomDispForm</Display> </FormTemplates> However, SharePoint does not find my custom RenderingTemplate when it's located in a subdirectory of CONTROLTEMPLATES. But if I move it to the root of CONTROLTEMPLATES\ SharePoint will find it. According to documentation SharePoint should also look in subdirectories but this seems not to be the case. So is this a bug maybe? I'd like to see if I've missed something because I really prefer putting custom stuff in root/&lt;Custom&gt; directories. Thanks.
0
[ 2, 1891, 3132, 630, 52, 477, 51, 5816, 15307, 9577, 6554, 800, 3726, 3726, 86, 31, 22, 195, 679, 21, 5816, 15307, 9577, 6554, 17, 6698, 32, 20, 569, 9577, 6554, 18, 1, 915, 12898, 9577, 6554, 18, 1, 32, 11374, 25250, 18, 184, 21...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
malloc() and the C/C++ heap === I'm working on designing the kernel (which I'm going to actually call the "core" just to be different, but its basically the same) for an OS I'm working on. The specifics of the OS itself are irrelevant if I can't get multi-tasking, memory management, and other basic things up and running, so I need to work on that first. I've some questinos about designing a malloc routine. I figure that malloc() is either going to be a part of the kernel itself (I'm leaning towards this) or a part of the program, but I'm going to have to write my own implementation of the C standard library either way, so I get to write a malloc. My question is actually rather simple in this regard, how does C (or C++) manage its heap? What I've always been taught in theorey classes is that the heap is an ever expanding piece of memory, starting at a specified address, and in a lot of senses behaving like a stack. In this way, I know that variables declared in global scope are at the beginning, and more variables are "pushed" onto the heap as they are declared in their respective scopes, and variables that go out of scope are simply left in memory space, but that space is marked as free so the heap can expand more if it needs to. What I need to know is, how on earth does C actually handle a dynamically expanding heap in this manner? Does a compiled C program make its own calls to a malloc routine and handle its own heap, or do I need to provide it with an automatically expanding space? Also, how does the C program know where the heap begins? Oh, and I know that the same concepts apply to other languages, but I would like any examples to be in C/C++ because I'm most comfortable with that language. I also would like to not worry about other things such as the stack, as I think I'm able to handle things like this on my own. So I suppose my real question is, other than malloc/free (which handles getting and freeing pages for itself, etc) does a program need the OS to provide anything else? Thanks!
0
[ 2, 3668, 2499, 5, 6, 17, 14, 272, 118, 150, 20512, 15414, 800, 3726, 3726, 31, 22, 79, 638, 27, 15026, 14, 17007, 13, 5, 2140, 31, 22, 79, 228, 20, 1121, 645, 14, 13, 7, 10375, 7, 114, 20, 44, 421, 15, 47, 82, 11374, 14, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Is the a way I can retrieve sa password in sql server 2005 === I just forgot the password. Can anyone help me how to get back the passowrd.
0
[ 2, 25, 14, 21, 161, 31, 92, 11917, 1929, 20884, 19, 4444, 255, 8128, 812, 800, 3726, 3726, 31, 114, 9564, 14, 20884, 9, 92, 1276, 448, 55, 184, 20, 164, 97, 14, 1477, 3581, 897, 9, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
Java version names in Sun's bug database === In http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6525150 it says Release Fixed 7(b14), 6u2(b01) (Bug ID:2147561) What does 6u2 mean? (Am I right in assuming it as 1.6.0_02 ?)
0
[ 2, 8247, 615, 1817, 19, 939, 22, 18, 6256, 6018, 800, 3726, 3726, 19, 7775, 6903, 16254, 18, 9, 7843, 9, 960, 118, 16254, 18768, 8436, 118, 4725, 1, 16254, 9, 537, 60, 16254, 1, 1340, 3726, 3577, 1811, 9839, 32, 898, 830, 3535, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Oracle 10gr2: prevent any dates that fall on a Sunday? === Is it possible to use a CHECK constraint to prevent any date that falls on a Sunday? I don't want to use a trigger.
0
[ 2, 15759, 332, 8807, 135, 45, 2501, 186, 4076, 30, 1080, 27, 21, 2608, 60, 800, 3726, 3726, 25, 32, 938, 20, 275, 21, 2631, 28804, 20, 2501, 186, 1231, 30, 2564, 27, 21, 2608, 60, 31, 221, 22, 38, 259, 20, 275, 21, 7286, 9, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
How I do I make controls/elements move with inertia? === Modern UI's are starting to give their UI elments nice inertia when moving. Tabs slide in, page transitions, even some listboxes and scroll elments have nice inertia to them (the iphone for example). What is the best algorythm for this? It is more than just gravity as they speed up, and then slow down as they fall into place. I have tried various formulae's for speeding up to a maximum (terminal) velocity and then slowing down but nothing I have tried "feels" right. It always feels a little bit off. Is there a standard for this, or is it just a matter of playing with various numbers until it looks/feels right?
0
[ 2, 184, 31, 107, 31, 233, 8671, 118, 27567, 18, 780, 29, 25847, 60, 800, 3726, 3726, 773, 13, 5661, 22, 18, 50, 1422, 20, 590, 66, 13, 5661, 931, 6601, 2210, 25847, 76, 1219, 9, 6523, 18, 6464, 19, 15, 2478, 4513, 18, 15, 166,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Is LINQ to SQL InsertOnSubmit() subject to SQL Injection Attack? === I have code like this: var newMsg = new Msg { Var1 = var1, Var2 = var2 }; using (AppDataContext appDataContext = new AppDataContext(ConnectionString)) { appDataContext.CClass.InsertOnSubmit(newMsg); appDataContext.SubmitChanges(); } After reading [this post][1] I believe that the same logic applies. Does anyone think that this is subject to SQL Injection Attack? [1]: http://stackoverflow.com/questions/157924/does-linqs-executecommand-provide-protection-from-sql-injection-attacks
0
[ 2, 25, 6294, 1251, 20, 4444, 255, 19, 18, 10931, 7563, 5130, 5, 6, 1550, 20, 4444, 255, 13646, 991, 60, 800, 3726, 3726, 31, 57, 1797, 101, 48, 45, 4033, 78, 79, 18, 263, 800, 78, 4235, 263, 13, 1, 4033, 165, 800, 4033, 165, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Shift reduce conflict === I'm having a problem understanding the shift/reduce confict for a grammar that I know has no ambiguity. The case is one of the if else type but it's not the 'dangling else' problem since I have mandatory END clauses delimiting code blocks. Here is the grammar for gppg (Its a Bison like compiler compiler ... and that was not an echo): %output=program.cs %start program %token FOR %token END %token THINGS %token WHILE %token SET %token IF %token ELSEIF %token ELSE %% program : statements ; statements : /*empty */ | statements stmt ; stmt : flow | THINGS ; flow : '#' IF '(' ')' statements else ; else : '#' END | '#' ELSE statements '#' END | elseifs ; elseifs : elseifs '#' ELSEIF statements else | '#' ELSEIF statements else ; Here is the conflict output: // Parser Conflict Information for grammar file "program.y" Shift/Reduce conflict on symbol "'#'", parser will shift Reduce 10: else -> elseifs Shift "'#'": State-22 -> State-23 Items for From-state State 22 10 else: elseifs . -lookahead: '#', THINGS, EOF 11 elseifs: elseifs . '#' ELSEIF statements else Items for Next-state State 23 11 elseifs: elseifs '#' . ELSEIF statements else // End conflict information for parser I already switched arround everything, and I do know how to resolve it, but that solution involves giving up the left recursion on 'elseif' for a right recursion. Ive been through all the scarse documentation I have found on the internet regarding this issue (I post some links at the end) and still have not found an elegant solution. I know about ANTLR and I don't want to consider it right now. Please limit your solution to Yacc/Bison parsers. I would appreciate elegant solutions, I managed to do It by eleminating the /* empty */ rules and duplication everything that needed an empty list but in the larger grammar Im working on It just ends up like 'sparghetti grammar syndrome'. Here are some links: [http://nitsan.org/~maratb/cs164/bison.html][1] [http://compilers.iecc.com/comparch/article/98-01-079][2] [GPPG, the parser I'm using][3] [Bison manual][4] [1]: http://nitsan.org/~maratb/cs164/bison.html [2]: http://compilers.iecc.com/comparch/article/98-01-079 [3]: http://plas.fit.qut.edu.au/gppg/ [4]: http://www.gnu.org/software/bison/manual/index.html
0
[ 2, 4471, 4136, 2930, 800, 3726, 3726, 31, 22, 79, 452, 21, 1448, 3260, 14, 4471, 118, 99, 16041, 1065, 15261, 38, 26, 21, 7207, 30, 31, 143, 63, 90, 28335, 9, 14, 610, 25, 53, 16, 14, 100, 962, 1001, 47, 32, 22, 18, 52, 14, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
How to avoid blinking when updating page from ajax === I've got a table with a header, a row with input fields, rows with data. ![Like this.][1] If somebody enters something into an input field I want to filter the data with an ajax query. After receiving the new table I change the content of the old one: `div.innerHTML = req.responseText;` and it blinks. How to avoid that? [1]: http://brow.hu/sitegen/stackoverflow_table_example.png
0
[ 2, 184, 20, 2658, 18015, 76, 71, 43, 1880, 2478, 37, 20624, 800, 3726, 3726, 31, 22, 195, 330, 21, 859, 29, 21, 157, 106, 15, 21, 3131, 29, 6367, 2861, 15, 11295, 29, 1054, 9, 13, 187, 2558, 1403, 48, 9, 500, 2558, 165, 500, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
struts setup sample application on eclipse === I am new to strut/web programming and I thought I could learn alot by reading a sample app. On google, I searched and found a sample app at http://www.roseindia.net/struts/struts2/struts2tutorial.zip The tutorial is really nice and it gives a sample login page. However, I couldn't run this sample app. I tried posting on the roseindia.net site and got no help either. There is no error logged during the start of the server, but when I try and open one of the helloworld's link the following is outputted I am getting this error <pre>SEVERE: Could not find action or result There is no Action mapped for action name HelloWorld. - [unknown location]</pre> The folder structure of this thing on my eclipse is /WebContent/WEB-INF/java/net/roseindia/Struts2HelloWorld.java /WebContent/pages/HelloWorld.jsp /WebContent/WEB-INF/struts.xml while in strut.xml the sample had.. <package name="roseindia" namespace="/roseindia" extends="struts-default"> <action name="HelloWorld" class="net.roseindia.Struts2HelloWorld"> <result>/pages/HelloWorld.jsp</result> </action> I am suspecting something in the strut.xml is wrong? I am using eclipse J2EE and tomcat6 I have already tried posting on roseindia's site and got no help.
0
[ 2, 18316, 18, 18161, 5717, 3010, 27, 11652, 800, 3726, 3726, 31, 589, 78, 20, 18316, 118, 14113, 3143, 17, 31, 289, 31, 110, 2484, 21, 5639, 34, 1876, 21, 5717, 4865, 9, 27, 8144, 15, 31, 9036, 17, 216, 21, 5717, 4865, 35, 7775,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
MySQLdb execute timeout === Sometimes in our production environment occurs situation when connection between service (which is python program that uses MySQLdb) and mysql server is flacky, some packages are lost, some black magic happens and .execute() of MySQLdb.Cursor object never ends (or take great amount of time to end). This is very bad because it is waste of service worker threads. Sometimes it leads to exhausting of workers pool and service stops responding at all. So the question is: Is there a way to interrupt MySQLdb.Connection.execute operation after given amount of time?
0
[ 2, 51, 18, 22402, 9007, 15644, 85, 1320, 800, 3726, 3726, 1030, 19, 318, 637, 2307, 3690, 1858, 76, 2760, 128, 365, 13, 5, 2140, 25, 20059, 625, 30, 2027, 51, 18, 22402, 9007, 6, 17, 51, 18, 22402, 8128, 25, 398, 16573, 93, 15, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Combining different javascript objects rendered by multiple components === I have a component which writes/generates javascript from a server side renderer. This component can be used in multiple times in a same page. However, once the page is loaded I have to collect all the variables or JSO written by this multiple components in the page. How can I do this so that I will have a collection of all the variables or JSO? For e.g. If this component (lets say <so:foo .../> ) is used twice in the page then it emits two javascript block on client/browser - <script> var arr1 = new Array['First', 'Second']</script> and <script> var arr2 = new Array['Third', 'Fourth']. In order to make a final rendering I have to combine these two arrays.
0
[ 2, 12803, 421, 8247, 8741, 3916, 10877, 34, 1886, 5090, 800, 3726, 3726, 31, 57, 21, 5912, 56, 6215, 118, 17083, 7759, 8247, 8741, 37, 21, 8128, 270, 16535, 106, 9, 48, 5912, 92, 44, 147, 19, 1886, 436, 19, 21, 205, 2478, 9, 207...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Secure access to files in a directory identified by an environment variable? === Can anyone point to some code that deals with the security of files access via a path specified (in part) by an environment variable, specifically for Unix and its variants, but Windows solutions are also of interest? *This is a big long question - I'm not sure how well it fits the SO paradigm.* Consider this scenario: **Background:** * Software package PQR can be installed in a location chosen by users. * The environment variable $PQRHOME is used to identify the install directory. * By default, all programs and files under $PQRHOME belong to a special group, pqrgrp. * Similarly, all programs and files under $PQRHOME either belong to a special user, pqrusr, or to user root (and those are SUID root programs). * A few programs are SUID pqrusr; a few more programs are SGID pqrgrp. * Most directories are owned by pqrusr and belong to pqrgrp; some can belong to other groups, and the members of those groups acquire extra privileges with the software. * Many of the privileged executables must be run by people who are not members of pqrgrp; the programs have to validate that the user is permitted to run it by arcane rules that do not directly concern this question. * After startup, some of the privileged programs have to retain their elevated privileges because they are long-running daemons that may act on behalf of many users over their lifetime. * The programs are not authorized to change directory to $PQRHOME for a variety of arcane reasons. **Current checking:** * The programs currently check that $PQRHOME and key directories under it are 'safe' (owned by pqrusr, belong to pqrgrp, do not have public write access). * Thereafter, programs access files under $PQRHOME via the full value of environment variable. * In particular, the G11N and L10N is achieved by accessing files in 'safe' directories, and reading format strings for printf() etc out of the files in those directories, using the full pathname derived from $PQRHOME plus a known sub-structure (for example, $PQRHOME/g11n/en_us/messages.l10n). Assume that the 'as installed' value of $PQRHOME is /opt/pqr. **Known attack:** - Attacker sets PQRHOME=/home/attacker/pqr. - This is actually a symlink to /opt/pqr, so when one of the PQR programs, call it pqr-victim, checks the directory, it has correct permissions. - Immediately after the security checking is completed successfully, the attacker changes the symlink so that it points to /home/attacker/bogus-pqr, which is clearly under the attacker's control. - Dire things happen when the pqr-victim now accesses a file under the supposedly safe directory. **Given that PQR currently behaves as described, and is a large package (multiple millions of lines of code, developed over more than a decade to a variety of coding standards, which were frequently ignored, anyway), what techniques would you use to remediate the problem?** *Known options include:* 1. Change all formatting calls to use function that checks actual arguments against the format strings, with an extra argument indicating the actual types passed to the function. (This is tricky, and potentially error prone because of the sheer number of format operations to be changed - but if the checking function is itself sound, works well.) 2. Establish the direct path to PQRHOME and validate it for security (details below), refusing to start if it is not secure, and thereafter using the direct path and not the value of $PQRHOME (when they differ). (This requires all file operations that use $PQRHOME to use not the value from getenv() but the mapped path. For example, this would require the software to establish that /home/attacker/pqr is a symlink to /opt/pqr, that the path to /opt/pqr is secure, and thereafter, whenever a file is referenced as $PQRHOME/some/thing, the name used would be /opt/pqr/some/thing and not /home/attacker/pqr/some/thing. This is a large code base - not trivial to fix.) 3. Ensure that all directories on $PQRHOME, even tracking through symlinks, are secure (details below, again), and the software refuses to start if anything is insecure. 4. Hard-code the path to the software install location. (This won't work PQR; it makes testing hell, if nothing else. For users, it means they can have but one version installed, and upgrades etc require parallel running. This does not work for PQR.) *Proposed criteria for secure paths:* * For each directory, the owner must be trusted. (*Rationale: the owner can change permissions at any time, so the owner must be trusted not to make changes at random that break the security of the software.*) * For each directory, the group must either not have write privileges (so members of the group cannot modify the directory contents) or the group must be trusted. (*Rationale: if the group members can modify the directory, then they can break the security of the software, so either they must be unable to change it, or they must be trusted not to changed it.*) * For each directory, 'others' must have no write privilege on the directory. * By default, the users root, bin, sys, and pqrusr can be trusted (where bin and sys exist). * By default, the group with GID=0 (variously known as root, wheel or system), bin, sys, and pqrgrp can be trusted. Additionally, the group that owns the root directory (which is called admin on MacOS X) can be trusted. The POSIX function `realpath()` provides a mapping service that will map /home/attacker/pqr to /opt/pqr; it does not do the security checking, but that need only be done on the resolved path. **So, with all that as background, is there any known software which goes through vaguely related gyrations to ensure its security? Is this being overly paranoid? (If so, why - and are you really sure?)**
0
[ 2, 4315, 1381, 20, 6488, 19, 21, 16755, 2889, 34, 40, 2307, 7612, 60, 800, 3726, 3726, 92, 1276, 454, 20, 109, 1797, 30, 10342, 29, 14, 1221, 16, 6488, 1381, 1197, 21, 2013, 9931, 13, 5, 108, 141, 6, 34, 40, 2307, 7612, 15, 35...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
LINQ to SQL - where does your DataContext live? === I'm using Linq to SQL in a data access object library. The library is used in both web (web app/web service) and non-web (windows service) contexts. Initially, I stored the DataContext on the current HttpContext since it permitted me to manage a fairly small unit of work (one web request) and avoided global objects in a web app. Obviously, this doesn't work in a Windows Service. Rick Strahl has a nice article on managing the DataContext's lifetime: [http://www.west-wind.com/weblog/posts/246222.aspx][1]. Unfortunately, I can't make up my mind on the best approach. A global DataContext doesn't work for reasons he mentions, a per-Thread DataContext seems complicated and potentially more trouble than it's work, and a per-object instance seems fussy - you lose some elegance when you attach the DataContext used to create a DAO to that DAO so it can update or delete later - not to mention, there's something unpleasantly chicken-and-eggish about the relationship. Does anyone have personal experience that suggests one approach is better than another? Or better yet, does anyone have a fourth or fifth approach I'm not seeing? Where is the best place to store and manage your DataContext? Thanks. [1]: http://www.west-wind.com/weblog/posts/246222.aspx
0
[ 2, 6294, 1251, 20, 4444, 255, 13, 8, 113, 630, 154, 1054, 1126, 11969, 515, 60, 800, 3726, 3726, 31, 22, 79, 568, 6294, 1251, 20, 4444, 255, 19, 21, 1054, 1381, 3095, 1248, 9, 14, 1248, 25, 147, 19, 156, 2741, 13, 5, 14113, 48...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
What is a catamorphism and can it be implemented in C# 3.0? === I'm trying to learn about catamorphisms and I've read [the Wikipedia article][1] and the first couple posts in [the series of the topic for F#][2] on the _Inside F#_ blog. I understand that it's a generalization of folds (i.e., mapping a structure of many values to one value, including a list of values to another list). And I gather that the fold-list and fold-tree is a canonical example. Can this be shown to be done in C#, using LINQ's `Aggregate` operator or some other higher-order method? [1]: http://en.wikipedia.org/wiki/Catamorphism [2]: http://lorgonblog.spaces.live.com/Blog/cns!701679AD17B6D310!256.entry
0
[ 2, 98, 25, 21, 13, 9709, 13348, 17, 92, 32, 44, 6807, 19, 272, 5910, 203, 9, 387, 60, 800, 3726, 3726, 31, 22, 79, 749, 20, 2484, 88, 13, 9709, 13348, 18, 17, 31, 22, 195, 1302, 636, 124, 20169, 2002, 500, 2558, 165, 500, 17...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Custom php template engine: Am i finally on the right track === Since I keep showing up late for answering questions tagged php where i actually know the answer i figured i'd try asking a question myself. I've been working on so many complete rewrites of a custom template engine in php for so long and so many times that i thought i'd ask for opinions. In short, this is the most important part i have implemented so far: 1. Any http request is routed to <php>handler.php</code> 2. based on the requested URL a controller is instantiated and a method on that controller is called. 3. The controller method must return an <code>IView</code> compatible class instance ( <code>IView</code> defines a <code>Render()</code> method) 1. The template engine does some xpath for every namespace that ends in 'serverside' <code>sprintf('//%s:*[@runat="server"]', $namespaceprefix )</code> 2. For every found tag, it looks up the php class identified by <code>$tag.localName</code> and instantiates one and attaches it to the original template. 3. Once attached, the original template node is fed to the 'ServerTag' so it can initialize properly 4. the fully complete IView compatible instance is assigned to a temporary variable in the controller method. 4. The controller asks pushes data from a Model class to the view which does some nifty xpath DOM replacement. 5. The controller returns the completely filled view to <code>main()</code>the handler, which renders it. I am basing my template on xml. a simple template currently looks like: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:red="http://www.theredhead.nl/serverside"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Title will be filed by the View depending on the Controller</title> <link rel="stylesheet" type="text/css" href="/Stylesheet/Get/Main/" /> </head> <body> <!-- the entire body may be reset by the view using it, using XPath and DOM functions --> <!-- Usually the PageHeader and PageFooter would be put back after clearing the body --> <div id="PageHeader"> <img src="/Image/Get/theredhead_dot_nl.png" alt="Site Logo" /> </div> <h1>www.theredhead.nl :: Test Template</h1> <p> Lorum ipsum dolar sit amet. blah blah blah yackadee schmackadee. </p> <div id="PageFooter"> Built by <br /> <red:UserProfileLink runat="server" Username="kris" /> </div> </body> </html> At current, this outputs (including the broken indentation): <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:red="http://www.theredhead.nl/serverside"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <title>Welcome to my site</title> <link rel="stylesheet" type="text/css" href="/Stylesheet/Get/Main/"/> <link rel="stylesheet" type="text/css" href="/Stylesheet/Get/Custom/"/> <link rel="stylesheet" type="text/css" href="/Stylesheet/Get/Profile/"/> </head> <body> <!-- the entire body may be reset by the view using it, using XPath and DOM functions --> <!-- Usually the PageHeader and PageFooter would be put back after clearing the body --> <div id="PageHeader"> <img src="/Image/Get/theredhead_dot_nl.png" alt="Site Logo"/> </div> <h1>www.theredhead.nl :: ModelViewController</h1> <p> Lorum ipsum dolar sit amet. blah blah blah yackadee schmackadee. </p> <div id="PageFooter"> Built by <br/> <div><div xmlns:profile="http://www.theredhead.nl/profile" class="ProfileBadge" style="font-size : .8em;"> <a style="text-decoration : none; border: none;" href="/Profile/View/kris"> <img style="float : left;" src="http://www.gravatar.com/avatar/5beeab66d6fe021cbd4daa041330cc86?d=identicon&amp;s=32&amp;r=pg" alt="Gravatar"/> &#xA0;Kris </a> <br/> <small> &#xA0;Rep:&#xA0;1 </small> </div></div> </div> </body> </html> - I've only touched on the tip of the iceberg here and yes, I will be stripping unused xmlns attributes from the output once I'm happy with the functionality - I'm looking for input on must-have functionality. - there are currently just over 200 classes in my mvc and core frameworks I am aware there are existing solutions that can do similar things, but I want to build my own. Thanks in advance for any and all input. Kris P.S. if anyone is interested in the complete source-code, please leave a comment, I will be providing it on my site when I reach reasonable developer usability levels.
0
[ 2, 5816, 13, 26120, 22894, 1406, 45, 589, 31, 722, 27, 14, 193, 792, 800, 3726, 3726, 179, 31, 643, 3187, 71, 456, 26, 11777, 2346, 27945, 13, 26120, 113, 31, 1121, 143, 14, 1623, 31, 5700, 31, 22, 43, 1131, 3379, 21, 1301, 992,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Progress button for Windows Forms === .NET newbie here... I'd like to make a button in a Windows form that displays a progress or "cooldown" effect. That is, when the button is pressed, it becomes disabled. As some event or timer is progressing, the button shows the progress graphically. When the progress is finished, the graphic completes and the button becomes enabled. Similar effects can be seen in many games. I'd considered using a combination of the built in Button class, and the GDI+ DrawPath function, but the complexity scales poorly, and I get the nagging feeling that there must be an easier way. Any ideas? Thanks.
0
[ 2, 3455, 5167, 26, 1936, 1997, 800, 3726, 3726, 13, 9, 2328, 78, 5893, 235, 9, 9, 9, 31, 22, 43, 101, 20, 233, 21, 5167, 19, 21, 1936, 505, 30, 9412, 21, 3455, 54, 13, 7, 17743, 2968, 7, 1590, 9, 30, 25, 15, 76, 14, 5167, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
OSX lacks memalign === I'm working on a project in C and it requires memalign(). Really, posix_memalign() would do as well, but darwin/OSX lacks both of them. What is a good solution to shoehorn-in memalign? I don't understand the licensing for posix-C code if I were to rip off memalign.c and put it in my project- I don't want any viral-type licensing LGPL-ing my whole project.
0
[ 2, 13, 759, 396, 1792, 18, 55, 3482, 9693, 800, 3726, 3726, 31, 22, 79, 638, 27, 21, 669, 19, 272, 17, 32, 4781, 55, 3482, 9693, 5, 6, 9, 510, 15, 2353, 6742, 1, 790, 3482, 9693, 5, 6, 83, 107, 28, 134, 15, 47, 11210, 118,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Should I only store fixed-size data elements in a database? === If the amount of data stored in a given field of a DB is unknown and could be very large, should I not store it in the DB, but instead in an external file?
0
[ 2, 378, 31, 104, 1718, 3535, 8, 10454, 1054, 2065, 19, 21, 6018, 60, 800, 3726, 3726, 100, 14, 2006, 16, 1054, 8214, 19, 21, 504, 575, 16, 21, 13, 9007, 25, 2562, 17, 110, 44, 253, 370, 15, 378, 31, 52, 1718, 32, 19, 14, 13,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0...
How to check if a string in Python is in ASCII? === I am fighting with Python to understand how do I check whether a string is in ASCII or not. I am aware of ord(), however when I try ord('é'), I have TypeError: ord() expected a character, but string of length 2 found. I understood it is caused by the way I built Python (as explained here http://pyref.infogami.com/ord). So my question is simple: is there another way to check for this?
0
[ 2, 184, 20, 2631, 100, 21, 3724, 19, 20059, 25, 19, 28, 1892, 49, 60, 800, 3726, 3726, 31, 589, 1849, 29, 20059, 20, 1369, 184, 107, 31, 2631, 1472, 21, 3724, 25, 19, 28, 1892, 49, 54, 52, 9, 31, 589, 3854, 16, 54, 43, 5, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Making iTerm to translate 'meta-key' in the same way as in other OSes === In bash shell with emacs key-binding, you can use key combination like M-f, M-b to move one word forward or backward on the shell prompt respectively. Usually, the meta key is mapped to Alt key on Windows and Linux. However, in iTerm, I could not find a way to map this meta key to either Option or Command key on my MacBook Pro. It seems that in OS X, the meta key is by default mapped to ESC key. So you can use ESC-f, ESC-b on iTerm. However, ESC key is apparently not practical to use. In addition, iTerm does have option that allow you to modifier mapping for the meta key (Bookmarks > Profiles > Keyboard Profiles > Global > Option Key as...), this setting does not seem to work at all. Therefore, if anyone know what is the solution to this problem, please let me know. I have upgraded to the latest release, 0.9.6.1012, and this behavior is still persist.
0
[ 2, 544, 31, 3964, 20, 20628, 13, 22, 5909, 58, 8, 4237, 22, 19, 14, 205, 161, 28, 19, 89, 13, 6641, 18, 800, 3726, 3726, 19, 13158, 3593, 29, 13, 62, 6893, 18, 1246, 8, 22260, 15, 42, 92, 275, 1246, 3733, 101, 307, 8, 410, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
How do I use the Queue library in SML/NJ === I see that the SML/NJ includes a queue structure. I can't figure out how to use it. How do I use the additional libraries provided by SML/NJ?
0
[ 2, 184, 107, 31, 275, 14, 22521, 1248, 19, 13, 18, 8184, 118, 15773, 800, 3726, 3726, 31, 196, 30, 14, 13, 18, 8184, 118, 15773, 1103, 21, 22521, 1411, 9, 31, 92, 22, 38, 1465, 70, 184, 20, 275, 32, 9, 184, 107, 31, 275, 14,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0...
Can you write a block of c++ code inside C#? === I heard somewhere that you can drop down to C++ directly inside C# code. How is this done? Or did I hear wrong? Note: I do not mean C++ / CLI.
0
[ 2, 92, 42, 2757, 21, 1921, 16, 272, 20512, 1797, 572, 272, 5910, 60, 800, 3726, 3726, 31, 752, 3493, 30, 42, 92, 2804, 125, 20, 272, 20512, 1703, 572, 272, 5910, 1797, 9, 184, 25, 48, 677, 60, 54, 144, 31, 990, 1389, 60, 1945,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0...
How do you find the base url from a DLL in C#? === From within a DLL that's being called by a C#.NET web app, how do you find the base url of the web app?
0
[ 2, 184, 107, 42, 477, 14, 1000, 287, 6362, 37, 21, 13, 43, 211, 19, 272, 5910, 60, 800, 3726, 3726, 37, 363, 21, 13, 43, 211, 30, 22, 18, 142, 227, 34, 21, 272, 5910, 9, 2328, 2741, 4865, 15, 184, 107, 42, 477, 14, 1000, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0...
Date ranges in T/SQL === For a current project I am working I need to return an aggregate report based on date ranges. I have 3 types of reports, yearly, monthly and daily. To assist in returning this report I need a function that will return all of the sub-ranges of datetimes, within a big range. So for example if I as for all the daily ranges between '2006-01-01 11:10:00' and '2006-01-05 08:00:00' I would expect the following results. select * from dbo.fnGetDateRanges('d', '2006-01-01 11:10:00', '2006-01-05 08:00:00') 2006-01-01 11:10:00.000, 2006-01-02 00:00:00.000 2006-01-02 00:00:00.000, 2006-01-03 00:00:00.000 2006-01-03 00:00:00.000, 2006-01-04 00:00:00.000 2006-01-04 00:00:00.000, 2006-01-05 00:00:00.000 2006-01-05 00:00:00.000, 2006-01-05 08:00:00.000 For the yearly range of '2006-01-01 11:10:00' to '2009-05-05 08:00:00', I would expect. select * from dbo.fnGetDateRanges('y', '2006-01-01 11:10:00', '2009-05-05 08:00:00') 2006-01-01 11:10:00.000, 2007-01-01 00:00:00.000 2007-01-01 00:00:00.000, 2008-01-01 00:00:00.000 2008-01-01 00:00:00.000, 2009-01-01 00:00:00.000 2009-01-01 00:00:00.000, 2009-05-05 08:00:00.000 How would I implement this function?
0
[ 2, 1231, 9230, 19, 13, 38, 118, 18, 22402, 800, 3726, 3726, 26, 21, 866, 669, 31, 589, 638, 31, 376, 20, 788, 40, 8544, 1330, 432, 27, 1231, 9230, 9, 31, 57, 203, 2551, 16, 2813, 15, 14767, 15, 6460, 17, 1954, 9, 20, 5404, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
How can I programmatically determine whether an MP3 file is CBR or VBR? (preferrably using c#) === I know of many utilities that can tell me the bitrate of an MP3 file, but I've never seen one that can tell me whether or not the MP3 file is VBR (variable bit rate - the bit rate fluctuates within the file) or a CBR (constant bit rate - the bit rate stays the same within the file). My guess is that most programs aren't interested in finding this out since it involves analyzing the file somewhat to see if the bitrate changes, which takes away from speed. So, in lieu of finding a utility, I'd like to write one - so how could I programmatically determine whether or not an MP3 file is VBR or CBR? I have about 15,000 files to go through to find this out for, so I need to automate the process.
0
[ 2, 184, 92, 31, 625, 6732, 1326, 3746, 1472, 40, 4628, 240, 3893, 25, 272, 5145, 54, 566, 5145, 60, 13, 5, 3515, 19697, 8818, 568, 272, 5910, 6, 800, 3726, 3726, 31, 143, 16, 151, 19817, 30, 92, 494, 55, 14, 1142, 5487, 16, 40...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
What's the best way to use SqlBulkCopy to fill a really large table? === Nightly, I need to fill a SQL Server 2005 table from an ODBC source with over 8 million records. Currently I am using an insert statement from linked server with syntax select similar to this: Insert Into SQLStagingTable from Select * from OpenQuery(ODBCSource, 'Select * from SourceTable') This is really inefficient and takes hours to run. I'm in the middle of coding a solution using SqlBulkInsert code similar to the code found in [this question][1]. The code in that question is first populating a datatable in memory and then passing that datatable to the SqlBulkInserts WriteToServer method. What should I do if the populated datatable uses more memory than is available on the machine it is running (a server with 16GB of memory in my case)? I've thought about using the overloaded ODBCDataAdapter [fill][2] method which allows you to fill only the records from x to n (where x is the start index and n is the number of records to fill). However that could turn out to be an even slower solution than what I currently have since it would mean re-running the select statement on the source a number of times. What should I do? Just populate the whole thing at once and let the OS manage the memory? Should I populate it in chunks? Is there another solution I haven't thought of? [1]: http://stackoverflow.com/questions/127152/how-to-change-slow-parametrized-inserts-into-fast-bulk-copy-even-from-memory [2]: http://msdn.microsoft.com/en-us/library/59wzthcw(VS.80).aspx
0
[ 2, 98, 22, 18, 14, 246, 161, 20, 275, 4444, 255, 9077, 197, 19625, 20, 3509, 21, 510, 370, 859, 60, 800, 3726, 3726, 343, 102, 15, 31, 376, 20, 3509, 21, 4444, 255, 8128, 812, 859, 37, 40, 12340, 7229, 1267, 29, 84, 469, 507, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Change a Window background color, given a IntPtr handle === In c#, I have a handle to a window ( an IntPtr ), I want to change the background color of that window. How can I do this? I can get the GDI graphics object for that handle like so: Graphics graphics = Graphics.FromHwnd(theHandle); So I should somehow be able to change the background color from this? I also want to ensure the background color remains even after the window moves,resizes,repaints etc.
0
[ 2, 753, 21, 1463, 2395, 1665, 15, 504, 21, 19, 13726, 6384, 3053, 800, 3726, 3726, 19, 272, 5910, 15, 31, 57, 21, 3053, 20, 21, 1463, 13, 5, 40, 19, 13726, 6384, 13, 6, 15, 31, 259, 20, 753, 14, 2395, 1665, 16, 30, 1463, 9, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Proper use of try .. catch === Should I be using this method of throwing errors: if (isset($this->dbfields[$var])) { return $this->dbfields[$var]; } else { throw new FieldNotFoundException($var); } or this style: try { return $this->dbfields[$var]; } catch (Exception $e) { throw new FieldNotFoundException($var); } ...or something else altogether? *quick explanation of the code:* `$this->dbfields` is an array. `isset()` checks if a variable is set, in this case, whether the array element exists.
0
[ 2, 4119, 275, 16, 1131, 13, 9, 9, 2949, 800, 3726, 3726, 378, 31, 44, 568, 48, 2109, 16, 6033, 11908, 45, 100, 13, 5, 11001, 38, 5, 4403, 1565, 8, 1, 9007, 1109, 18, 2558, 4403, 3311, 500, 6, 6, 13, 1, 788, 5579, 1565, 8, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
What is a type and effect system? === The [Wikipedia artcile on _Effect system_][1] is currently just a short stub and I've been wondering for a while as to what is an effect system. Are there any languages that have an effect system in addition to a type system? What's a possible repreesntation of code in a mainstream language that you're familiar with but with effects? [1]: http://en.wikipedia.org/wiki/Effect_system
0
[ 2, 98, 25, 21, 1001, 17, 1590, 329, 60, 800, 3726, 3726, 14, 636, 17375, 26132, 415, 150, 3599, 27, 13, 1, 21295, 329, 1, 500, 2558, 165, 500, 25, 871, 114, 21, 502, 21354, 17, 31, 22, 195, 74, 5712, 26, 21, 133, 28, 20, 98,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Programmers employing business people === Some guy with an MBA can hire a programmer or network manager to do all that incomprehensible technical stuff. Why can't I hire an MBA or two to do all that incomprehensible "people" stuff?
4
[ 2, 17968, 18, 18192, 508, 148, 800, 3726, 3726, 109, 1244, 29, 40, 16071, 92, 10039, 21, 17968, 54, 982, 1382, 20, 107, 65, 30, 19, 11103, 99, 6077, 18, 3426, 2447, 3217, 9, 483, 92, 22, 38, 31, 10039, 40, 16071, 54, 81, 20, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0...
Cobertura refuses to acknowledge code was covered === I am using the Maven (2) Cobertura plug-in to create reports on code coverage, and I have the following stub I am using in a method: try { System.exit(0); } catch (final SecurityException exception) { exception.printStackTrace(); } System.err.println("The program never exited!"); I know that I need to log the exception, etc, but that's not the point right now...Cobertura is refusing to acknowledge that the line after the stack trace is printed is covered. That is, the line with the '}' before the System.err.println statement is not being shown as covered. Before, the ending curly brace of the method was not being shown as covered, hence the System.err statement. Any idea how I can convince cobertura's maven plugin that, since the System.err.println statement is covered, that ending brace has to have been covered? Oh yeah, and I use a mock security manager to throw the security exception, since that's the easiest way I've found of making the test continue executing after the System.exit call.
0
[ 2, 326, 4461, 3031, 10864, 20, 11762, 1797, 23, 1363, 800, 3726, 3726, 31, 589, 568, 14, 1216, 3124, 13, 5, 135, 6, 326, 4461, 3031, 10922, 8, 108, 20, 1600, 2813, 27, 1797, 5245, 15, 17, 31, 57, 14, 249, 21354, 31, 589, 568, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
What are the traits that you look for in a software developer? === Specifically, what are the best indicators to forecast if someone will be a great developer, and also, someone that you would want to work with? Examples: - education - breadth of technical knowledge - depth of knowledge in a particular domain - interpersonal skills - work on open source projects - choice of tools, operating systems, and languages - taste in music - etc *Please:* **Only one trait per response,** so they can be voted up or down.
4
[ 2, 98, 50, 14, 14756, 30, 42, 361, 26, 19, 21, 2306, 10058, 60, 800, 3726, 3726, 3524, 15, 98, 50, 14, 246, 13310, 18, 20, 12718, 100, 737, 129, 44, 21, 374, 10058, 15, 17, 67, 15, 737, 30, 42, 83, 259, 20, 170, 29, 60, 37...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Is a custom module the best way to access an external API in Drupal? === I'm new to extending Drupal, though I've done similar kinds of things for other CMSes. Anyone care to share opinions on the best way to access an external API from within Drupal? I need to show things like search results, listings, and listing summaries. In my reading up on Drupal, I think this implies I need to create both "nodes" and "blocks". Is this right? It wasn't clear to me from the module tutorial if this is possible from within the same module. Thanks for any help / suggestions!
0
[ 2, 25, 21, 5816, 12613, 14, 246, 161, 20, 1381, 40, 4886, 21, 2159, 19, 15708, 6720, 60, 800, 3726, 3726, 31, 22, 79, 78, 20, 8176, 15708, 6720, 15, 362, 31, 22, 195, 677, 835, 8623, 16, 564, 26, 89, 2390, 7202, 9, 1276, 781, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
As a software developer, what are the traits that you look for in a manager? === Specifically, what are the best indicators to forecast if someone will be a great manager for a team of software developers, and also, someone that you would want to work for? Examples: - education - breadth of technical knowledge - depth of knowledge in a particular domain - interpersonal skills - work on open source projects - choice of tools, operating systems, and languages - taste in music - etc *Please:* **Only one trait per response,** so they can be voted up or down. ---------- This question is intentionally similar to [a question on the traits of software developers][1]. Since many software managers are software developers who got promoted, I think it will be interested to see if the traits line up. [1]: http://stackoverflow.com/questions/196470/what-are-the-traits-that-you-look-for-in-a-software-developer
4
[ 2, 28, 21, 2306, 10058, 15, 98, 50, 14, 14756, 30, 42, 361, 26, 19, 21, 1382, 60, 800, 3726, 3726, 3524, 15, 98, 50, 14, 246, 13310, 18, 20, 12718, 100, 737, 129, 44, 21, 374, 1382, 26, 21, 173, 16, 2306, 10168, 15, 17, 67, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Identify full vs half yearly datasets in SQL === I have a table with two fields of interest for this particular exercise: a CHAR(3) ID and a DATETIME. The ID identifies the submitter of the data - several thousand rows. The DATETIME is not necessarily unique, either. (The primary keys are other fields of the table.) Data for this table is submitted every six months. In December, we receive July-December data from each submitter, and in June we receive December-June data. My task is to write a script that identifies people who have only submitted half their data. The obvious way, at least to my mind, seems to be to identify each submitter's first and last date and see if DATEDIFF says the number of years between them is greater than 1. But I'm new to this, and that sounds very slow (and I'm not actually sure how best to do that anyway). ...Does anyone have a better solution?
0
[ 2, 5808, 503, 4611, 519, 14767, 1054, 3554, 18, 19, 4444, 255, 800, 3726, 3726, 31, 57, 21, 859, 29, 81, 2861, 16, 1163, 26, 48, 1498, 5935, 45, 21, 4892, 5, 240, 6, 4924, 17, 21, 1231, 891, 9, 14, 4924, 17165, 14, 12298, 815,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Complex Find in Cake PHP === Hey all I'm hoping someone has enough experience with Cake PHP to make this work. I'm working on something that at the moment could affectionately be called a twitter clone. Essentially I have a set up like this. Users have many friends. This is a many to many relationship to the user table. It is stored in a link tabled called friends_users with columns user_id, friend_id. Users is a table with column user_id. Then i have a table called tips which associates to a user. A user can have many tips. I want to figure out a way to do a find on the Tip model that returns all tips owned by the userid i pass in as well as any tips owned by any friends of that user. This SQL query works perfectly - SELECT * FROM `tips` JOIN users ON users.id = tips.user_id JOIN friends_users ON tips.user_id = friends_users.friend_id WHERE (friends_users.user_id =2 or tips.user_id=2) LIMIT 0 , 30 That returns user#2s Tips as well as the tips of anyone who is a friend of User 2. Now how can i do the same thing using $this->Tip->findxxxxx(user_id) I know i can use Tip->query if need be but i'm trying to learn the hard way.
0
[ 2, 1502, 477, 19, 8390, 13, 26120, 800, 3726, 3726, 8409, 65, 31, 22, 79, 3935, 737, 63, 511, 1496, 29, 8390, 13, 26120, 20, 233, 48, 170, 9, 31, 22, 79, 638, 27, 301, 30, 35, 14, 688, 110, 28168, 44, 227, 21, 10623, 13871, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
How to configure spring HandlerExceptionResolver to handle NullPointerException thrown in jsp ? === From a jsp is thrown a NullPointerException for example using `<% null.toString(); %>` This exception is not handled by the HandlerExceptionResolver, but thrown to the web container(tomcat) and converted into a `code 500 error`. How can I configure spring to get that error in my HandlerExceptionResolver ?
0
[ 2, 184, 20, 1065, 15951, 1573, 24641, 10066, 872, 99, 5594, 2304, 20, 3053, 16203, 3132, 106, 10066, 872, 6027, 19, 487, 3401, 13, 60, 800, 3726, 3726, 37, 21, 487, 3401, 25, 6027, 21, 16203, 3132, 106, 10066, 872, 26, 823, 568, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
How do I load the contents of a text file into a javascript variable? === I have a text file in the root of my web app *http://localhost/foo.txt* and I'd like to load it into a variable in javascript.. in groovy I would do this: def fileContents = 'http://localhost/foo.txt'.toURL().text; println fileContents; How can I get a similar result in javascript?
0
[ 2, 184, 107, 31, 6305, 14, 8478, 16, 21, 1854, 3893, 77, 21, 8247, 8741, 7612, 60, 800, 3726, 3726, 31, 57, 21, 1854, 3893, 19, 14, 5900, 16, 51, 2741, 4865, 1637, 21127, 6903, 15580, 11694, 118, 4120, 111, 9, 38, 396, 38, 2483,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Configuring wordpress .htaccess to view subfolders === I have a WordPress install and a .htaccess that looks like this: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress I tried installing a fresh install of WordPress into a subdirectory for a seperate blog and am getting 404's within the root WordPress when I try to view it. I'm assuming this is because of the htaccess, and what I want to know is, how do I change it so that I can view the subfolder? Thanks :)
0
[ 2, 1065, 13549, 68, 833, 5890, 13, 9, 9020, 20604, 20, 1418, 972, 8814, 445, 800, 3726, 3726, 31, 57, 21, 833, 5890, 16146, 17, 21, 13, 9, 9020, 20604, 30, 1879, 101, 48, 45, 6926, 2348, 833, 5890, 13, 1, 821, 19673, 62, 7226, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Using Wordpress LOOP with pages instead of posts? === Is there a way to use **THE LOOP** in Wordpress to load pages instead of posts? I would like to be able to query a set of child pages, and then use **THE LOOP** function calls on it - things like *the_permalink()* and *the_title()*. Is there a way to do this? I didn't see anything in *query_posts()* documentation.
0
[ 2, 568, 833, 5890, 5293, 29, 4434, 700, 16, 9868, 60, 800, 3726, 3726, 25, 80, 21, 161, 20, 275, 13, 1409, 124, 5293, 1409, 19, 833, 5890, 20, 6305, 4434, 700, 16, 9868, 60, 31, 83, 101, 20, 44, 777, 20, 25597, 21, 309, 16, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Hardest javascript debugging problem ever === We have an ASP.NET application and when running on client site they often get null reference Javascript errors. As with all these errors the information IE6 displays is less than helpful. But the problem is as soon as I install IE script debugger and try and debug a bit more the error becomes non-reproducible.When script debugger is not installed then the error occurs again. Are there any other tools that could be helpful for javascript debugging on client site. The error is also not produced with IE7 or Firefox.
0
[ 2, 20766, 8247, 8741, 121, 16254, 2762, 1448, 462, 800, 3726, 3726, 95, 57, 40, 28, 306, 9, 2328, 3010, 17, 76, 946, 27, 6819, 689, 59, 478, 164, 16203, 2801, 8247, 8741, 11908, 9, 28, 29, 65, 158, 11908, 14, 676, 13, 660, 379, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Is there a sorted collection type in .NET? === I'm looking for a container that keeps all it's items in order. I looked at SortedList, but that requires a separate key, and does not allow duplicate keys. I could also just use an unsorted container and explicitly sort it after each insert. Usage: * Occasional insert * Frequent traversal in order * Ideally not working with keys separate from the actual object, using a compare function to sort. * Stable sorting for equivalent objects is desired, but not required. * Random access is not required. I realize I can just build myself a balanced tree structure, I was just wondering if the framework already contains such a beast.
0
[ 2, 25, 80, 21, 22554, 1206, 1001, 19, 13, 9, 2328, 60, 800, 3726, 3726, 31, 22, 79, 699, 26, 21, 12147, 30, 8968, 65, 32, 22, 18, 3755, 19, 389, 9, 31, 292, 35, 22554, 5739, 15, 47, 30, 4781, 21, 1725, 1246, 15, 17, 630, 5...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Problem with dynamic controls in .NET === Problem with dynamic controls Hello all, I'm wanting to create some dynamic controls, and have them persist their viewstate across page loads. Easy enough, right? All I have to do is re-create the controls upon each page load, using the same IDs. HOWEVER, here's the catch - in my PreRender event, I'm wanting to clear the controls collection, and then recreate the dynamic controls with new values. The reasons for this are complicated, and it would probably take me about a page or so to explain why I want to do it. So, in the interests of brevity, let's just assume that I absolutely must do this, and that there's no other way. The problem comes in after I re-create the controls in my PreRender event. The re-created controls never bind to the viewstate, and their values do not persist across page loads. I don't understand why this happens. I'm already re-creating the controls in my OnLoad event. When I do this, the newly created controls bind to the ViewState just fine, provided that I use the same IDs every time. However, when I try to do the same thing in the PreRender event, it fails. In any case, here is my example code : namespace TestFramework.WebControls { public class ValueLinkButton : LinkButton { public string Value { get { return (string)ViewState[ID + "vlbValue"]; } set { ViewState[ID + "vlbValue"] = value; } } } public class TestControl : WebControl { protected override void OnLoad(EventArgs e) { base.OnLoad(e); Controls.Clear(); ValueLinkButton tempLink = null; tempLink = new ValueLinkButton(); tempLink.ID = "valueLinkButton"; tempLink.Click += new EventHandler(Value_Click); if (!Page.IsPostBack) { tempLink.Value = "old value"; } Controls.Add(tempLink); } protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); ValueLinkButton tempLink = ((ValueLinkButton)FindControl("valueLinkButton")); //[CASE 1] //ValueLinkButton tempLink = new ValueLinkButton(); [CASE 2] tempLink.ID = "valueLinkButton"; tempLink.Value = "new value"; tempLink.Text = "Click"; Controls.Clear(); Controls.Add(tempLink); } void Value_Click(object sender, EventArgs e) { Page.Response.Write("[" + ((ValueLinkButton)sender).Value + "]"); } } } So, let's examine case 1, where the line next to [CASE 1] is not commented out, but the line next to [CASE 2] is commented out. Here, everything works just fine. When I put this control on a page and load the page, I see a link that says "Click". When I click the link, the page outputs the text "[new value]", and on the next line, we see the familiar "Click" link. Every subesquent time I click on the "Click" link, we see the same thing. So far, so good. But now let's examine case 2, where the line next to [CASE 1] is commented out, but the line next to [CASE 2] is not commented out. Here we run into problems. When we load the page, we see the "Click" link. However, when I click on the link, the page outputs the text "[]" instead of "[new value]". The click event is firing normally. However, the "new value" text that I assigned to the Value attribute of the control does not get persisted. Once again, this is a bit of a mystery to me. How come, when I recreate the control in OnLoad, everything's fine and dandy, but when I recreate the control in PreRender, the value doesn't get persisted? I feel like there simply has to be a way to do this. When I re-create the control in PreRender, is there some way to bind the newly created control to the ViewState? I've struggled with this for days. Any help that you can give me will be appreciated. Thanks.
0
[ 2, 1448, 29, 7782, 8671, 19, 13, 9, 2328, 800, 3726, 3726, 1448, 29, 7782, 8671, 10975, 65, 15, 31, 22, 79, 4638, 20, 1600, 109, 7782, 8671, 15, 17, 57, 105, 22084, 66, 1418, 3859, 464, 2478, 19069, 9, 2010, 511, 15, 193, 60, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
PHP: Best way to extract text within parenthesis? === What's the best/most efficient way to extract text set between parenthesis? Say I wanted to get the string "text" from the string "ignore everything except this (text)" in the most efficient manner possible. So far, the best I've come up with is this: $fullString = "ignore everything except this (text)"; $start = strpos('(', $fullString); $end = strlen($fullString) - strpos(')', $fullString); $shortString = substr($fullString, $start, $end); Is there a better way to do this? I know in general using regex tends to be less efficient, but unless I can reduce the number of function calls, perhaps this would be the best approach? Thoughts?
0
[ 2, 13, 26120, 45, 246, 161, 20, 10962, 1854, 363, 4766, 438, 4557, 60, 800, 3726, 3726, 98, 22, 18, 14, 246, 118, 4630, 8243, 161, 20, 10962, 1854, 309, 128, 4766, 438, 4557, 60, 395, 31, 417, 20, 164, 14, 3724, 13, 7, 11969, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...