qid
int64
4
8.14M
question
stringlengths
20
48.3k
answers
list
date
stringlengths
10
10
metadata
list
input
stringlengths
12
45k
output
stringlengths
2
31.8k
548,627
<p>I have a loop using the for (NSObject *obj in someArray) { } syntax. Is there an easy way to tell if I'm on the last iteration of the loop (ie. without having to use [someArray count])</p>
[ { "answer_id": 548641, "author": "codelogic", "author_id": 43427, "author_profile": "https://Stackoverflow.com/users/43427", "pm_score": 5, "selected": true, "text": "<p>Maybe this will work?</p>\n\n<pre><code>if ( obj == [ someArray lastObject ] ) {\n // ...\n}\n</code></pre>\n" },...
2009/02/14
[ "https://Stackoverflow.com/questions/548627", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53839/" ]
I have a loop using the for (NSObject \*obj in someArray) { } syntax. Is there an easy way to tell if I'm on the last iteration of the loop (ie. without having to use [someArray count])
Maybe this will work? ``` if ( obj == [ someArray lastObject ] ) { // ... } ```
548,657
<p>Code:</p> <pre><code>Shoes.setup do gem 'mechanize' end require 'rubygems' require 'mechanize' </code></pre> <p>Running Shoes on it says:</p> <pre><code>no such file to load -- mechanize </code></pre>
[ { "answer_id": 548677, "author": "Alex Wayne", "author_id": 62076, "author_profile": "https://Stackoverflow.com/users/62076", "pm_score": 1, "selected": false, "text": "<p><code>rubygems</code> needs to be required before any gems.</p>\n\n<pre><code>require 'rubygems'\nrequire 'mechanize...
2009/02/14
[ "https://Stackoverflow.com/questions/548657", "https://Stackoverflow.com", "https://Stackoverflow.com/users/50176/" ]
Code: ``` Shoes.setup do gem 'mechanize' end require 'rubygems' require 'mechanize' ``` Running Shoes on it says: ``` no such file to load -- mechanize ```
I did: ``` sudo gem install mechanize ``` and the following seems to be working: ``` Shoes.setup do gem 'mechanize' end require 'mechanize' ``` It says 'Building native extensions' and is taking forever, but seems to be the norm according to [hackety.org](http://hackety.org/2008/05/08/clearingUpTheWholeShoesAn...
548,659
<p>We have the application, which used to download the firmware to external device.</p> <p>We used to release our SW as a zip file. Some of the users directly running the application from the zip file.</p> <p>So the application extracting to windows TEMP folder and running. That time windows firewall or anti virus soft...
[ { "answer_id": 548669, "author": "Kluge", "author_id": 8752, "author_profile": "https://Stackoverflow.com/users/8752", "pm_score": 2, "selected": true, "text": "<p>Why not check the current directory to see if it's a temp folder? In pseudocode:</p>\n\n<pre><code>if (GetCurrentDir() == G...
2009/02/14
[ "https://Stackoverflow.com/questions/548659", "https://Stackoverflow.com", "https://Stackoverflow.com/users/188260/" ]
We have the application, which used to download the firmware to external device. We used to release our SW as a zip file. Some of the users directly running the application from the zip file. So the application extracting to windows TEMP folder and running. That time windows firewall or anti virus software blocking t...
Why not check the current directory to see if it's a temp folder? In pseudocode: ``` if (GetCurrentDir() == GetTempDir()) abort("You cannot run our application from the temp folder."); ```
548,676
<p>I am in desperate need of some advice.</p> <p>I'm almost done with my junior year as a CS major. I sort of feel like a late comer because I didn't really get into computer science until sophomore year... Through hard work, lots of credit hours during the year and summer school I am almost caught up to my peers b...
[ { "answer_id": 548680, "author": "BobbyShaftoe", "author_id": 38426, "author_profile": "https://Stackoverflow.com/users/38426", "pm_score": 1, "selected": false, "text": "<p>Well, with a good understanding of Computer Science, the so-called \"practical programming\" is not that difficult...
2009/02/14
[ "https://Stackoverflow.com/questions/548676", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14013/" ]
I am in desperate need of some advice. I'm almost done with my junior year as a CS major. I sort of feel like a late comer because I didn't really get into computer science until sophomore year... Through hard work, lots of credit hours during the year and summer school I am almost caught up to my peers but here come ...
Sounds like a fine plan. Some suggestions: 1. Learn to automate everything you can. Make it a habit. If you do something more than a couple times, put it in a script. It's not just to avoid typing but to document the process. Improve your scripts as you notice problems. Share your scripts when appropriate. 2. Learn th...
548,718
<p>I'm only new to using SSH, but when I log in I end up in the directory ~, which in general is the same directory when FTPing in. I can still go to /, but I don't know what the ~ means. Home? Where is it in relation to /, or how could I find out?</p>
[ { "answer_id": 548724, "author": "Hannes Ovrén", "author_id": 13565, "author_profile": "https://Stackoverflow.com/users/13565", "pm_score": 3, "selected": false, "text": "<p>~ is your home directory, yes. Which is very nice since your home directory is not always where you think it shoul...
2009/02/14
[ "https://Stackoverflow.com/questions/548718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/66381/" ]
I'm only new to using SSH, but when I log in I end up in the directory ~, which in general is the same directory when FTPing in. I can still go to /, but I don't know what the ~ means. Home? Where is it in relation to /, or how could I find out?
~ is an alias to the currently logged in users home directory. To find out where that really is, type `pwd` (stands for: Print Working Directory) **right after logging in**, which should give you the location relative to `/`. It's probably something like: ``` /home/myusername ```
548,744
<p>I'm using PHP and xPath to crawl into a website I own (just crawl the html not going into the server) but I get this error:</p> <blockquote> <p>Catchable fatal error: Object of class DOMNodeList could not be converted to string in C:\wamp\www\crawler.php on line 46</p> </blockquote> <p>I already tried echo...
[ { "answer_id": 548752, "author": "postfuturist", "author_id": 1892, "author_profile": "https://Stackoverflow.com/users/1892", "pm_score": 1, "selected": false, "text": "<p>Just a wild guess, but <em>echo $elements;</em> is line 46, right? I believe the echo command expects something that...
2009/02/14
[ "https://Stackoverflow.com/questions/548744", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28586/" ]
I'm using PHP and xPath to crawl into a website I own (just crawl the html not going into the server) but I get this error: > > Catchable fatal error: Object of class > DOMNodeList could not be converted to > string in C:\wamp\www\crawler.php on > line 46 > > > I already tried echoing just that line to see wha...
According to the [documentation](http://www.php.net/manual/en/domxpath.query.php), the "`$elements != null`" check is unnecessary. `DOMXPath::query()` will always return a `DOMNodeList`, though maybe it will be of zero length, which won't confuse the `foreach` loop. Also, note the use of the `nodeValue` property to ge...
548,749
<p>I'm attempting to make a data structure to represent a Maze in C++.</p> <p>All the data I need to hold about the maze can be stored in 16 bit integers using bitwise operations (to represent each cell of the maze):<br> <a href="https://i.stack.imgur.com/TEaN5.gif" rel="nofollow noreferrer"><img src="https://i.stack....
[ { "answer_id": 548754, "author": "yesraaj", "author_id": 22076, "author_profile": "https://Stackoverflow.com/users/22076", "pm_score": 2, "selected": false, "text": "<p>try with std::vector</p>\n" }, { "answer_id": 548762, "author": "James", "author_id": 66387, "autho...
2009/02/14
[ "https://Stackoverflow.com/questions/548749", "https://Stackoverflow.com", "https://Stackoverflow.com/users/64878/" ]
I'm attempting to make a data structure to represent a Maze in C++. All the data I need to hold about the maze can be stored in 16 bit integers using bitwise operations (to represent each cell of the maze): [![alt text](https://i.stack.imgur.com/TEaN5.gif)](https://i.stack.imgur.com/TEaN5.gif) (source: [mazework...
There's a problem with the constructor - you use "width" and "height" before they are assigned. You also need a destructor to free the memory: ``` ~Maze() { delete [] mazeGrid; } ``` Other than that, it looks ok.
548,755
<p>Somebody please help me by modying this code.when i retrieve the Login value through stored procedure call,though i give the correct user name and password i am getting the error message "Invalid UserName or Password" means always checking the false condition only.pls help me somebody......Here is my code.</p> <p>L...
[ { "answer_id": 548794, "author": "tHeSiD", "author_id": 66384, "author_profile": "https://Stackoverflow.com/users/66384", "pm_score": 0, "selected": false, "text": "<pre><code> Session[\"UserName\"] = TxtUserName.Text; \n Login lg = new Login(); \n if ((lg.GetLogin(TxtUserName.T...
2009/02/14
[ "https://Stackoverflow.com/questions/548755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/59637/" ]
Somebody please help me by modying this code.when i retrieve the Login value through stored procedure call,though i give the correct user name and password i am getting the error message "Invalid UserName or Password" means always checking the false condition only.pls help me somebody......Here is my code. Login.cs: ...
First, this looks like it could be a case-sensitivity issue; even if the TSQL isn't case-sensitive, the C# will be. But why return the password at all (in fact, youshouldn't even **store** a password - only a hash). Personally, I'd just have: ``` CREATE PROCEDURE GetUserLogin( @UserName varchar(50),@Password varchar(...
548,759
<p>I creating a small addin to help with my source control. </p> <p>Does anybody know how I could retrieve the Branch Name and Version Number of a source file in Rational ClearCase. I want to do this using C#. Where is all the information actually stored?</p>
[ { "answer_id": 548799, "author": "shoosh", "author_id": 9611, "author_profile": "https://Stackoverflow.com/users/9611", "pm_score": 1, "selected": false, "text": "<p>Your best bet is probably to use the cleartool.exe command line and parse the result. Ideally this is usually done from a ...
2009/02/14
[ "https://Stackoverflow.com/questions/548759", "https://Stackoverflow.com", "https://Stackoverflow.com/users/56097/" ]
I creating a small addin to help with my source control. Does anybody know how I could retrieve the Branch Name and Version Number of a source file in Rational ClearCase. I want to do this using C#. Where is all the information actually stored?
You need, from C#, to execute a `cleartool` command More specifically, a `descr` with a [format option](http://publib.boulder.ibm.com/infocenter/cchelp/v7r0m1/index.jsp?topic=/com.ibm.rational.clearcase.cc_ref.doc/topics/fmt_ccase.htm) only displaying *exactly* what you are after. ``` cleartool descr -fmt "%Sn" youFi...
548,766
<p>How do you write a module for ruby. in python you can use </p> <pre><code># module.py def helloworld(name): print "Hello, %s" % name # main.py import module module.helloworld("Jim") </code></pre> <p>Back to the Question how do you create a module in/for ruby</p>
[ { "answer_id": 548771, "author": "alamodey", "author_id": 58521, "author_profile": "https://Stackoverflow.com/users/58521", "pm_score": 0, "selected": false, "text": "<pre><code>module NumberStuff \n def self.random \n rand(1000000) \n end \nend \n\nmodule LetterStuff \n def self.r...
2009/02/14
[ "https://Stackoverflow.com/questions/548766", "https://Stackoverflow.com", "https://Stackoverflow.com/users/65122/" ]
How do you write a module for ruby. in python you can use ``` # module.py def helloworld(name): print "Hello, %s" % name # main.py import module module.helloworld("Jim") ``` Back to the Question how do you create a module in/for ruby
Modules in Ruby have different purpose than modules in Python. Typically you use modules to define common methods that could be included in other class definition. But modules in Ruby could also be used in similar way as in Python just to group methods in some namespace. So your example in Ruby would be (I name module...
548,819
<p>I have a program that needs a lot of memory, and it crashes as soon as the 2GB virtual address space is reached. Sysinternals process explorer displays this as "virtual size" column. How can I determine this "virtual size" with C (or C++) code?</p> <p>Ok, I have to query a performance counter for "Virtual Bytes". ...
[ { "answer_id": 548831, "author": "shoosh", "author_id": 9611, "author_profile": "https://Stackoverflow.com/users/9611", "pm_score": 1, "selected": false, "text": "<p>You query a performance counter.<br>\nThere is a complete API for this in the win32 API, <a href=\"http://msdn.microsoft.c...
2009/02/14
[ "https://Stackoverflow.com/questions/548819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/65023/" ]
I have a program that needs a lot of memory, and it crashes as soon as the 2GB virtual address space is reached. Sysinternals process explorer displays this as "virtual size" column. How can I determine this "virtual size" with C (or C++) code? Ok, I have to query a performance counter for "Virtual Bytes". Perfmon sho...
According to [MSDN: Memory Performance Information](http://msdn.microsoft.com/en-us/library/aa965225(VS.85).aspx) `PROCESS_MEMORY_COUNTERS_EX.PrivateUsage` is the same as VM Size in Task Manager in Windows XP. [GetProcessMemoryInfo](http://msdn.microsoft.com/en-us/library/ms683219(VS.85).aspx) should work: ``` PROCESS...
548,821
<p>i've seen alot of php based websites where no matter where you navigate your stuck at the index.php and some random parameters are passed in the url. and when i take a look at an open source version who does the same the index.php has a bunch of includes in them</p> <p>whats a basic way i can do the same thing? doe...
[ { "answer_id": 548834, "author": "Cruachan", "author_id": 7315, "author_profile": "https://Stackoverflow.com/users/7315", "pm_score": 2, "selected": false, "text": "<p>This is very common design pattern, and not just for PHP - I first used it for Cold Fusion with a design model called Fu...
2009/02/14
[ "https://Stackoverflow.com/questions/548821", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
i've seen alot of php based websites where no matter where you navigate your stuck at the index.php and some random parameters are passed in the url. and when i take a look at an open source version who does the same the index.php has a bunch of includes in them whats a basic way i can do the same thing? does this inc...
I've seen this and personally I think it's an **awful** design. Particularly because many people don't tend to sanitize the include parameter such that someone can include any file they want by just passing in a relative path. mod\_rewrite is typically used to hide URLs like: ``` /index.php?path=user&include=account ...
548,877
<p>How do i convert a Request.Query string to an integer value. I've tried all the Convert.ToInt32 and Int32.Parse but it says Input string is not in the correct format. I am using the string value as an input to a stored procedure which takes in only integer types for that field.</p> <p>Here's a part of the code-</p>...
[ { "answer_id": 548890, "author": "Alex Reitbort", "author_id": 11525, "author_profile": "https://Stackoverflow.com/users/11525", "pm_score": 2, "selected": false, "text": "<p>How about looking on the input that you provide to Int32.Parse?</p>\n" }, { "answer_id": 548899, "aut...
2009/02/14
[ "https://Stackoverflow.com/questions/548877", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
How do i convert a Request.Query string to an integer value. I've tried all the Convert.ToInt32 and Int32.Parse but it says Input string is not in the correct format. I am using the string value as an input to a stored procedure which takes in only integer types for that field. Here's a part of the code- ``` string r...
``` int foo; int.TryParse(Request.QueryString["foo"], out foo); ``` or just like you say, `int.Parse` should convert to int Could you post some code here ?
548,879
<p>How do I make sure that a socket bound to a port is properly released on process exit such that the port can be reused without <code>bind()</code> failing with EADDRINUSE? I've written a tiny program which just creates a socket, binds it to a fixed port, waits for a connection and then immediately terminates. When I...
[ { "answer_id": 548912, "author": "Ivo Bosticky", "author_id": 10814, "author_profile": "https://Stackoverflow.com/users/10814", "pm_score": 6, "selected": true, "text": "<p>Using SO_REUSEADDR socket option will allow you to re-start the program without delay.</p>\n\n<pre><code>int iSetOp...
2009/02/14
[ "https://Stackoverflow.com/questions/548879", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13051/" ]
How do I make sure that a socket bound to a port is properly released on process exit such that the port can be reused without `bind()` failing with EADDRINUSE? I've written a tiny program which just creates a socket, binds it to a fixed port, waits for a connection and then immediately terminates. When I rerun the pro...
Using SO\_REUSEADDR socket option will allow you to re-start the program without delay. ``` int iSetOption = 1; ... sockfd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); setsockopt(_sockfd, SOL_SOCKET, SO_REUSEADDR, (char*)&iSetOption, sizeof(iSetOption)) ... ```
548,883
<p>I am receiving some mysterious errors in my apache error log. For example:</p> <pre><code>File does not exist: /home/httpd/vhosts/studentlife.co.il/httpdocs/help_center/div.hot-jobs File does not exist: /home/httpd/vhosts/studentlife.co.il/httpdocs/solutions/function.filesize File does not exist: /home/httpd/vho...
[ { "answer_id": 548889, "author": "Gareth", "author_id": 31582, "author_profile": "https://Stackoverflow.com/users/31582", "pm_score": 3, "selected": false, "text": "<p>I would say don't worry about it.</p>\n\n<p>I can make a request for <code>/the/answer/to/life/the/universe/and/everythi...
2009/02/14
[ "https://Stackoverflow.com/questions/548883", "https://Stackoverflow.com", "https://Stackoverflow.com/users/49226/" ]
I am receiving some mysterious errors in my apache error log. For example: ``` File does not exist: /home/httpd/vhosts/studentlife.co.il/httpdocs/help_center/div.hot-jobs File does not exist: /home/httpd/vhosts/studentlife.co.il/httpdocs/solutions/function.filesize File does not exist: /home/httpd/vhosts/studentlif...
I would say don't worry about it. I can make a request for `/the/answer/to/life/the/universe/and/everything.42` and it would show up in your error log. Probably some spider is hunting for vulnerabilities in your site and it's randomly trying URLs. If you see the same pages a *lot* then start checking to see whether y...
548,892
<p>I'm looking for tips, tricks and resources on optimizing a website design for Android's browser.</p> <p>I'm building an Android app and some of the functionality will be accessible through a web interface.</p>
[ { "answer_id": 548922, "author": "Peter", "author_id": 58553, "author_profile": "https://Stackoverflow.com/users/58553", "pm_score": 1, "selected": false, "text": "<p>As all mobile web pages keep every thing slimmed as mutch as you can..</p>\n" }, { "answer_id": 548949, "auth...
2009/02/14
[ "https://Stackoverflow.com/questions/548892", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35112/" ]
I'm looking for tips, tricks and resources on optimizing a website design for Android's browser. I'm building an Android app and some of the functionality will be accessible through a web interface.
I rely on two elements to optimize websites for mobile browsers (especially Android and iPhone): Meta tags: HandheldFriendly and viewport ---------------------------------------- Usually I want pages not to have a page width of 800 to 900 pixels, as the Android and iPhone browsers set it to by default. To have the pa...
548,925
<p>I'm not sure about how pthread dataspecific works : considering the next code (found on the web), does this means i can create for example 5 threads in the main, have a call to func in only some of them (let's say 2) those threads would have the data 'key' set to something (ptr = malloc(OBJECT_SIZE) ) and the other ...
[ { "answer_id": 549061, "author": "paxdiablo", "author_id": 14860, "author_profile": "https://Stackoverflow.com/users/14860", "pm_score": 4, "selected": true, "text": "<p>Your reasoning is correct. These calls are for thread-specific data. They're a way of giving each thread a \"global\" ...
2009/02/14
[ "https://Stackoverflow.com/questions/548925", "https://Stackoverflow.com", "https://Stackoverflow.com/users/61838/" ]
I'm not sure about how pthread dataspecific works : considering the next code (found on the web), does this means i can create for example 5 threads in the main, have a call to func in only some of them (let's say 2) those threads would have the data 'key' set to something (ptr = malloc(OBJECT\_SIZE) ) and the other th...
Your reasoning is correct. These calls are for thread-specific data. They're a way of giving each thread a "global" area where it can store what it needs, but only if it needs it. The key is shared among all threads, since it's created with `pthread_once()` the first time it's needed, but the value given to that key i...
548,927
<p>I'm working on an animated clock application for the iPhone, and I have to pivot all the 3 nodes in the view, which I have obtained in the following code:</p> <pre><code>[CATransaction begin]; [CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions]; clockarm.layer.anchorPoint = CGPointMake(...
[ { "answer_id": 548985, "author": "Alex Wayne", "author_id": 62076, "author_profile": "https://Stackoverflow.com/users/62076", "pm_score": 2, "selected": false, "text": "<p>Add the animationDidFinish delegate method and setup the animation again for another rotation. CA wont let you turn...
2009/02/14
[ "https://Stackoverflow.com/questions/548927", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I'm working on an animated clock application for the iPhone, and I have to pivot all the 3 nodes in the view, which I have obtained in the following code: ``` [CATransaction begin]; [CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions]; clockarm.layer.anchorPoint = CGPointMake(0.0, 0.0); [CA...
Add the animationDidFinish delegate method and setup the animation again for another rotation. CA wont let you turn things more than 360 degrees.
548,932
<p>I usually get this error and (always) don't know how to solve it. This time I got it also, it seems that I'm not understanding a concept or missing something Here's the code</p> <pre><code> // create a new twitteroo core with provided username/password TwitterooCore core = new TwitterooCore(username,...
[ { "answer_id": 548939, "author": "Alex Reitbort", "author_id": 11525, "author_profile": "https://Stackoverflow.com/users/11525", "pm_score": 0, "selected": false, "text": "<p>May be Timeline.Friends is null and may be Timeline is null. I suggest you look at the stack trace of exception a...
2009/02/14
[ "https://Stackoverflow.com/questions/548932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12637/" ]
I usually get this error and (always) don't know how to solve it. This time I got it also, it seems that I'm not understanding a concept or missing something Here's the code ``` // create a new twitteroo core with provided username/password TwitterooCore core = new TwitterooCore(username, password); ...
I found the problem finally It was because of my Firewall seems to be blocking connections to Visual Studio. Now it works with no changes at all :) Thanks for all your support
548,960
<p>I have a table with names of movies, and I want to be able to search for a movie in that table. But I want to be able to search for part of the title, and still return a result. For example, if there is a record with the name "The quantum of solace", then I want to be able to do a search for "quantum solace", or eve...
[ { "answer_id": 548968, "author": "Mark Davidson", "author_id": 50866, "author_profile": "https://Stackoverflow.com/users/50866", "pm_score": 4, "selected": true, "text": "<p>Use a <a href=\"http://dev.mysql.com/doc/refman/5.1/en/fulltext-boolean.html\" rel=\"nofollow noreferrer\">MySQL F...
2009/02/14
[ "https://Stackoverflow.com/questions/548960", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1585/" ]
I have a table with names of movies, and I want to be able to search for a movie in that table. But I want to be able to search for part of the title, and still return a result. For example, if there is a record with the name "The quantum of solace", then I want to be able to do a search for "quantum solace", or even "...
Use a [MySQL Full Text Search](http://dev.mysql.com/doc/refman/5.1/en/fulltext-boolean.html) in boolean mode. If you do this when you search for '007: quantum solace' as it contains at least one matching result in the column it will be displayed, you can then order by relevancy. ``` SELECT *, MATCH(title) AGAINST ('q...
548,969
<p>If i declare an enum as follows:</p> <pre><code>typedef enum A { a = 0x00000001, b = 0x00000002 } AObj; </code></pre> <p>Now if i declare a variable of AObj as follows what does this mean?</p> <pre><code>AObj myAObj : 2; </code></pre>
[ { "answer_id": 548968, "author": "Mark Davidson", "author_id": 50866, "author_profile": "https://Stackoverflow.com/users/50866", "pm_score": 4, "selected": true, "text": "<p>Use a <a href=\"http://dev.mysql.com/doc/refman/5.1/en/fulltext-boolean.html\" rel=\"nofollow noreferrer\">MySQL F...
2009/02/14
[ "https://Stackoverflow.com/questions/548969", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41518/" ]
If i declare an enum as follows: ``` typedef enum A { a = 0x00000001, b = 0x00000002 } AObj; ``` Now if i declare a variable of AObj as follows what does this mean? ``` AObj myAObj : 2; ```
Use a [MySQL Full Text Search](http://dev.mysql.com/doc/refman/5.1/en/fulltext-boolean.html) in boolean mode. If you do this when you search for '007: quantum solace' as it contains at least one matching result in the column it will be displayed, you can then order by relevancy. ``` SELECT *, MATCH(title) AGAINST ('q...
548,971
<p>Through my automated crash collection for <a href="http://www.maxto.net" rel="noreferrer">MaxTo</a> I got the following crash report:</p> <pre><code>V8.12.0.0 - System.ComponentModel.Win32Exception - :Void UpdateLayered():0 Version: MaxTo8.12.0.0 Exception: System.ComponentModel.Win32Exception Error message: Not en...
[ { "answer_id": 549025, "author": "Lars Truijens", "author_id": 1242, "author_profile": "https://Stackoverflow.com/users/1242", "pm_score": 4, "selected": false, "text": "<p>Leaking or using to many GDI objects/handles. Those could cause a resource heap shortage. You might not be able to ...
2009/02/14
[ "https://Stackoverflow.com/questions/548971", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1606/" ]
Through my automated crash collection for [MaxTo](http://www.maxto.net) I got the following crash report: ``` V8.12.0.0 - System.ComponentModel.Win32Exception - :Void UpdateLayered():0 Version: MaxTo8.12.0.0 Exception: System.ComponentModel.Win32Exception Error message: Not enough storage is available to process this ...
Leaking or using to many GDI objects/handles. Those could cause a resource heap shortage. You might not be able to reproduce because your users might have other GDI resource heavy programs running or use Terminal Server in which case they have to share some of the heap with the other users. See [System Error. Code: 8. ...
548,979
<p>This is a simplified version of what I am trying to implement to grab text from a mIRC chat window:</p> <pre><code>[DllImport("user32.dll", EntryPoint = "SendMessage")] private static extern int SendMessage(IntPtr hwnd, int msg, int wParam, StringBuilder sb); public const int WM_GETTEXT = 0x000D; IntPtr mainHand...
[ { "answer_id": 549015, "author": "shoosh", "author_id": 9611, "author_profile": "https://Stackoverflow.com/users/9611", "pm_score": 1, "selected": false, "text": "<p>You can communicate with mIRC using Windows DDE. You can read about it <a href=\"http://www.mirc.com/faq6.html#section6-33...
2009/02/14
[ "https://Stackoverflow.com/questions/548979", "https://Stackoverflow.com", "https://Stackoverflow.com/users/63229/" ]
This is a simplified version of what I am trying to implement to grab text from a mIRC chat window: ``` [DllImport("user32.dll", EntryPoint = "SendMessage")] private static extern int SendMessage(IntPtr hwnd, int msg, int wParam, StringBuilder sb); public const int WM_GETTEXT = 0x000D; IntPtr mainHandle = FindWindo...
You can communicate with mIRC using Windows DDE. You can read about it [here](http://www.mirc.com/faq6.html#section6-33). I'm not sure however if this will enable you to get the text.
548,987
<p>I have an annoying problem in one of my projects where the production environment uses Microsoft Office 2000 and we only have Microsoft Office 2003 in the developement environment.</p> <p>I use automation to do some manipulation of Word documents so to make this work in both the production and the developement envi...
[ { "answer_id": 548991, "author": "mrdenny", "author_id": 4197, "author_profile": "https://Stackoverflow.com/users/4197", "pm_score": 3, "selected": false, "text": "<p>Have someone find the OFfice 2000 installer and put Office 2000 in development. If you don't have like environments you ...
2009/02/14
[ "https://Stackoverflow.com/questions/548987", "https://Stackoverflow.com", "https://Stackoverflow.com/users/57855/" ]
I have an annoying problem in one of my projects where the production environment uses Microsoft Office 2000 and we only have Microsoft Office 2003 in the developement environment. I use automation to do some manipulation of Word documents so to make this work in both the production and the developement environments i...
Locate a machine that has Office 2000 and .NET installed. Run this command on it: Tlbimp "c:...\msword.olb" /out:Word.dll where ... is the Office installation directory. Copy Word.dll to your dev machines. Add a reference to it in your project, make sure Copy Local is set to Yes (it is by default). You can now use "u...
549,002
<p>If I have the following code:</p> <pre class="lang-cs prettyprint-override"><code>[TestFixture] public class MyBaseTest { protected ISessionManager _sessionManager; [SetUp] public void SetUp() { /* some code that initializes _sessionManager */ } } [TestFixture] public class MyDerivedTest : MyBaseTes...
[ { "answer_id": 549006, "author": "Iain Holder", "author_id": 1122, "author_profile": "https://Stackoverflow.com/users/1122", "pm_score": 4, "selected": true, "text": "<p>You have to call the method directly.</p>\n\n<pre><code> [SetUp]\n public void DerivedSetUp()\n {\n base.Ba...
2009/02/14
[ "https://Stackoverflow.com/questions/549002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8446/" ]
If I have the following code: ```cs [TestFixture] public class MyBaseTest { protected ISessionManager _sessionManager; [SetUp] public void SetUp() { /* some code that initializes _sessionManager */ } } [TestFixture] public class MyDerivedTest : MyBaseTest { IBlogRepository _repository; [SetUp] ...
You have to call the method directly. ``` [SetUp] public void DerivedSetUp() { base.BaseSetUp(); // Do something else } ``` Edit: I haven't tried it, but perhaps a partial method might work too. I'd prefer to do the above though. Edit2: I've just tried using partial methods. It didn't work. ...
549,004
<p>I'm having a real issue with UITabBarController. The outcome I'm after is the following: 1) in portrait mode, a simple tab bar based application (with navigation bars) nothing too fancy. 2) in landscape mode, I want to use my own UIViewController ignoring the UITabBar completely.</p> <p>The approach (I tried many v...
[ { "answer_id": 549107, "author": "naoki", "author_id": 66417, "author_profile": "https://Stackoverflow.com/users/66417", "pm_score": 1, "selected": false, "text": "<p>Check out the <code>UIViewController</code> instance method <code>rotatingFooterView</code> in the docs.</p>\n\n<p>Or, yo...
2009/02/14
[ "https://Stackoverflow.com/questions/549004", "https://Stackoverflow.com", "https://Stackoverflow.com/users/63742/" ]
I'm having a real issue with UITabBarController. The outcome I'm after is the following: 1) in portrait mode, a simple tab bar based application (with navigation bars) nothing too fancy. 2) in landscape mode, I want to use my own UIViewController ignoring the UITabBar completely. The approach (I tried many variants) I...
Just in case you still need the answer, or someone else stumbles onto this, I've done the same thing and got it working, but there are a couple of hoops you have to jump through. In order to rotate a UITabBarController's view, there are four things you have to do: 1. Remove the status bar before switching to the view ...
549,023
<p>Data :</p> <pre><code>Empcode Amount 30034 27.25 30034 124 </code></pre> <p>linq code</p> <pre><code> Dim ComputedData = From p In AllOrders _ Order By p.Field(Of String)("EmpCode") _ Group By Key = p.Field(Of String)("EmpCode") Into Group _ ...
[ { "answer_id": 549044, "author": "Morten Christiansen", "author_id": 4055, "author_profile": "https://Stackoverflow.com/users/4055", "pm_score": 0, "selected": false, "text": "<p>It seems <code>Sum</code> treats the values as integers which causes the rounding. You could either try and t...
2009/02/14
[ "https://Stackoverflow.com/questions/549023", "https://Stackoverflow.com", "https://Stackoverflow.com/users/62889/" ]
Data : ``` Empcode Amount 30034 27.25 30034 124 ``` linq code ``` Dim ComputedData = From p In AllOrders _ Order By p.Field(Of String)("EmpCode") _ Group By Key = p.Field(Of String)("EmpCode") Into Group _ Select EmpCode = Key, _ ...
Used Cdbl and the issues is solved ``` Dim ComputedData = From p In AllOrders _ Order By p.Field(Of String)("EmpCode") _ Group By Key = p.Field(Of String)("EmpCode") Into Group _ Select EmpCode = Key, _ Consumption = Group.Sum(Function(p) CDe...
549,059
<p>I have two divs with float: right:</p> <pre><code>&lt;div id="container" style="width:760px"&gt; &lt;div id="d1" style="float:right;"&gt;&lt;/div&gt; &lt;div id="d2" style="float:right;"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>I want to hide any overflow in d2 if the contents of both divs get too wide to...
[ { "answer_id": 549114, "author": "jeroen", "author_id": 42139, "author_profile": "https://Stackoverflow.com/users/42139", "pm_score": 1, "selected": false, "text": "<p>You could try something like:</p>\n\n<pre><code>#d2 {\n height: 1em;\n overflow: hidden;\n}\n</code></pre>\n\n<p>B...
2009/02/14
[ "https://Stackoverflow.com/questions/549059", "https://Stackoverflow.com", "https://Stackoverflow.com/users/676066/" ]
I have two divs with float: right: ``` <div id="container" style="width:760px"> <div id="d1" style="float:right;"></div> <div id="d2" style="float:right;"></div> </div> ``` I want to hide any overflow in d2 if the contents of both divs get too wide to fit in their container (it all should be one line that must n...
You could try something like: ``` #d2 { height: 1em; overflow: hidden; } ``` But you already specified that that might not work. Anyway, it´s not something I would ever try because you are required to specify a **width** when you float an element. Another solution would be to use javascript to calculate an...
549,109
<p>Is there any way to hide folders/ files with Python? </p> <p>I'm working a huge project (a vulnerability scanner). The project creates a lot of files and folders. Therefore the question, is there any way to make a script that hides files and folders? </p>
[ { "answer_id": 549117, "author": "kmkaplan", "author_id": 50902, "author_profile": "https://Stackoverflow.com/users/50902", "pm_score": 1, "selected": false, "text": "<p>If you can put your data in a DBM style file you will only have a single data file.</p>\n\n<p><a href=\"http://docs.py...
2009/02/14
[ "https://Stackoverflow.com/questions/549109", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Is there any way to hide folders/ files with Python? I'm working a huge project (a vulnerability scanner). The project creates a lot of files and folders. Therefore the question, is there any way to make a script that hides files and folders?
``` import tempfile ``` See the [documentation](http://docs.python.org/library/tempfile.html). Here "hidden file" means ["The file is readable and writable only by the creating user ID."](http://docs.python.org/2/library/tempfile.html#tempfile.mkstemp) i.e., the meaning is "hide file from other users".
549,130
<p>does anybody know how to delete all characters behind a specific character??</p> <p>like this:</p> <pre><code>http://google.com/translate_t </code></pre> <p>into </p> <pre><code>http://google.com </code></pre>
[ { "answer_id": 549133, "author": "Dennis Kempin", "author_id": 66434, "author_profile": "https://Stackoverflow.com/users/66434", "pm_score": 2, "selected": false, "text": "<pre><code>str=\"http://google.com/translate_t\"\nshortened=str[0:str.rfind(\"/\")]\n</code></pre>\n\n<p>Should do i...
2009/02/14
[ "https://Stackoverflow.com/questions/549130", "https://Stackoverflow.com", "https://Stackoverflow.com/users/66437/" ]
does anybody know how to delete all characters behind a specific character?? like this: ``` http://google.com/translate_t ``` into ``` http://google.com ```
if you're asking about an abstract string and not url you could go with: ``` >>> astring ="http://google.com/translate_t" >>> astring.rpartition('/')[0] http://google.com ```
549,148
<p>I have a forum page that displays a tree view of messages below the currently selected message. When you click on a message in the tree the new message body is loaded into a <strong>div</strong> near the top of the page using AJAX and then the following code is run:</p> <pre><code>window.location.hash = "page_top";...
[ { "answer_id": 549153, "author": "Gumbo", "author_id": 53114, "author_profile": "https://Stackoverflow.com/users/53114", "pm_score": 2, "selected": false, "text": "<p>You could reset it first:</p>\n\n<pre><code>window.location.hash = \"\";\nwindow.location.hash = \"page_top\";\n</code></...
2009/02/14
[ "https://Stackoverflow.com/questions/549148", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46354/" ]
I have a forum page that displays a tree view of messages below the currently selected message. When you click on a message in the tree the new message body is loaded into a **div** near the top of the page using AJAX and then the following code is run: ``` window.location.hash = "page_top"; ``` Of course "page\_top...
Answering my own question. Gumbo was on the right track, but not quite there. Safari doesn't like location.hash being set to a blank value. Instead you need to set it to a real anchor value. So along at the top of the page I now have: ``` <div><a href="page_top"></a></div> <div><a href="page_topnot"></a></div> ``` ...
549,158
<p>Imagine a system of filters (maybe audio filters, or text stream filters).</p> <p>A <code>Filter</code> base class has a <code>do_filter()</code> method, which takes some input, modifies it (perhaps), and returns that as output.</p> <p>Several subclasses exist, built with TDD, and each has a set of tests which tes...
[ { "answer_id": 549164, "author": "krosenvold", "author_id": 23691, "author_profile": "https://Stackoverflow.com/users/23691", "pm_score": 1, "selected": false, "text": "<p>I fairly frequently extract test-logic to separate classes, so I'd extract the filter test to a separate class that ...
2009/02/14
[ "https://Stackoverflow.com/questions/549158", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17221/" ]
Imagine a system of filters (maybe audio filters, or text stream filters). A `Filter` base class has a `do_filter()` method, which takes some input, modifies it (perhaps), and returns that as output. Several subclasses exist, built with TDD, and each has a set of tests which test them in isolation. Along comes a com...
Within one Test suite/class have a method ``` public void TestForFooBehaviour(IFilter filter) { /* whatever you would normally have in a test method */ } ``` Then invoke this method from both the original test on the simple filter as well as from the composite filter. This also works for abstract base classes. ...
549,162
<p>I know namespace are used to describe, like doctype, but is there a way or a trick to transform inner namespace html with an xsl using xsd ?</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;...
[ { "answer_id": 550987, "author": "driis", "author_id": 13627, "author_profile": "https://Stackoverflow.com/users/13627", "pm_score": 1, "selected": false, "text": "<p>No, you cannot perform an XSL transformation without using some kind of scripting technology. I would suggest you do it s...
2009/02/14
[ "https://Stackoverflow.com/questions/549162", "https://Stackoverflow.com", "https://Stackoverflow.com/users/59350/" ]
I know namespace are used to describe, like doctype, but is there a way or a trick to transform inner namespace html with an xsl using xsd ? ``` <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w...
Modern browsers support XSLT out of the box. Take a look at [eu.wowarmory.com](http://eu.wowarmy.com) - they use it extensively. If the server detects a user agent that does not support XSLT, it is rendered at the server side, and a quite verbose HTML is rendered there and sent to the browser. This makes a nice abst...
549,178
<p>I have just been testing a web site I have set up in Internet explorer. Works fine in Firefox of course. I have a set of style sheets most of which have a background picture I, the user can select the different style sheets as they please. The style sheets render exactly the same apart from colours and backgrounds, ...
[ { "answer_id": 549185, "author": "TM.", "author_id": 12983, "author_profile": "https://Stackoverflow.com/users/12983", "pm_score": 1, "selected": false, "text": "<p>\"CSS problem on Internet Explorer. I have no idea what is wrong!\"</p>\n\n<p>This is heard pretty much every day at my off...
2009/02/14
[ "https://Stackoverflow.com/questions/549178", "https://Stackoverflow.com", "https://Stackoverflow.com/users/60163/" ]
I have just been testing a web site I have set up in Internet explorer. Works fine in Firefox of course. I have a set of style sheets most of which have a background picture I, the user can select the different style sheets as they please. The style sheets render exactly the same apart from colours and backgrounds, of ...
Hi I have found the problem I needed to set the height of the div. For those who mentioned this I have added a point to your rep and thanks for the advice :D CHL CSS: ``` height:100%; ```
549,196
<p>With SQL Server, I can send </p> <pre><code>SELECT * FROM FOO SELECT * FROM BAR </code></pre> <p>to the server and get back the results of both, all in one trip.</p> <p>Can I do that with mySQL also?</p>
[ { "answer_id": 549222, "author": "Paul Dixon", "author_id": 6521, "author_profile": "https://Stackoverflow.com/users/6521", "pm_score": 1, "selected": false, "text": "<p>As long as the queries have the same number of columns you can do a <a href=\"http://dev.mysql.com/doc/refman/5.0/en/u...
2009/02/14
[ "https://Stackoverflow.com/questions/549196", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9328/" ]
With SQL Server, I can send ``` SELECT * FROM FOO SELECT * FROM BAR ``` to the server and get back the results of both, all in one trip. Can I do that with mySQL also?
I can only speak about the mysqli-extension for PHP, but I guess the same will be possible with most mysql-libraries. In PHP, you can send multiple queries, like ``` SELECT * FROM foo; SELECT * FROM bar; ``` with `mysqli_multi_query()` and iterate through the result-sets with `mysqli_next_result()`.
549,200
<p>I have converted a complex XML File to a Dataset that has 7 Tables and around 70 Columns I have created the tables in SQL Server to match the ones in the Dataset using the XML Schema. How can I easily write my Dataset to the SQL tables?</p>
[ { "answer_id": 549205, "author": "Ian P", "author_id": 10853, "author_profile": "https://Stackoverflow.com/users/10853", "pm_score": -1, "selected": false, "text": "<p>If you're using .NET 3/3.5, you could look into LINQ.</p>\n" }, { "answer_id": 549213, "author": "leppie", ...
2009/02/14
[ "https://Stackoverflow.com/questions/549200", "https://Stackoverflow.com", "https://Stackoverflow.com/users/49971/" ]
I have converted a complex XML File to a Dataset that has 7 Tables and around 70 Columns I have created the tables in SQL Server to match the ones in the Dataset using the XML Schema. How can I easily write my Dataset to the SQL tables?
Depending on how many rows you have in the DataSet, probably the best thing to do would be to use a SqlCommandBuilder, like so: ``` var connection = new SqlConnection("my connection string"); connection.Open(); // repeat for each table in data set var adapterForTable1 = new SqlDataAdapter("select * from table1", conn...
549,206
<p>I make my <code>boost::signal</code>s public because I'm lazy.</p> <pre><code>class Button { public: signal&lt;void()&gt; clicked; }; int main() { Button btn; btn.clicked.connect(handleClick); } </code></pre> <p>... rather than encapsulating with a <code>Button::OnClicked(boost::function&lt;void()&gt;...
[ { "answer_id": 549210, "author": "user21714", "author_id": 21714, "author_profile": "https://Stackoverflow.com/users/21714", "pm_score": 3, "selected": true, "text": "<p>It depends. </p>\n\n<p>It has bitten me before when I wanted to add some special logic each time an object connected t...
2009/02/14
[ "https://Stackoverflow.com/questions/549206", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I make my `boost::signal`s public because I'm lazy. ``` class Button { public: signal<void()> clicked; }; int main() { Button btn; btn.clicked.connect(handleClick); } ``` ... rather than encapsulating with a `Button::OnClicked(boost::function<void()>)`. Is this going to come back and bite me?
It depends. It has bitten me before when I wanted to add some special logic each time an object connected to another object's signals. This is the most likely case to bite you. Also, it can make it difficult to keep track of exactly when other objects are connecting to any given object. I would say hide the connect...
549,218
<p>Somebody please help me how to place the content page in center of the page.I am trying to do using css class but content doesn't have css property.In my application when i am clicking on LOGIN DETAILS , that page should open in the center but opening under the menu item. Here is my code: ...
[ { "answer_id": 549241, "author": "TheTXI", "author_id": 22164, "author_profile": "https://Stackoverflow.com/users/22164", "pm_score": 0, "selected": false, "text": "<p>Put your contentplaceholder in a <code>&lt;div&gt;</code> and then center the div?</p>\n" }, { "answer_id": 5492...
2009/02/14
[ "https://Stackoverflow.com/questions/549218", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42532/" ]
Somebody please help me how to place the content page in center of the page.I am trying to do using css class but content doesn't have css property.In my application when i am clicking on LOGIN DETAILS , that page should open in the center but opening under the menu item. Here is my code:
As the other posters have said, you will need to use CSS to position the div in the center of the screen. Here's some quick code to help you with this. ``` div#centered { background-color: #eee; border: 1px solid #ddd; position: absolute; left: 50%; top: 50%; width: 400px; height: ...
549,245
<p>Please help me out in getting infinite session on facebook. I am getting a session logged out or invalid session key while testing my application.</p> <p>Does this infinite session apply to anyone who logs in?</p>
[ { "answer_id": 549271, "author": "Samuel", "author_id": 60020, "author_profile": "https://Stackoverflow.com/users/60020", "pm_score": 2, "selected": false, "text": "<p>i believe the infinite session is not used anymore.</p>\n\n<p>instead, you can indlude the general include.php which wil...
2009/02/14
[ "https://Stackoverflow.com/questions/549245", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Please help me out in getting infinite session on facebook. I am getting a session logged out or invalid session key while testing my application. Does this infinite session apply to anyone who logs in?
i believe the infinite session is not used anymore. instead, you can indlude the general include.php which will require the user log in if he has been logged out for being stagnant. the "New Design Platform Changes" wiki page says ``` * We will still grant infinite sessions to your Web applications for users on the ...
549,249
<p>I use SWIG to wrap a Ruby script around a C++ library. In Ruby, I can inherit from a C++ class, but I cannot pass the resulting pointer to a C++ function in a polymorphic way. </p> <p>Here is a concrete example. The SWIG interface file defines base class Animal with virtual function sound():</p> <pre><code>[ani...
[ { "answer_id": 558493, "author": "Aram Verstegen", "author_id": 64234, "author_profile": "https://Stackoverflow.com/users/64234", "pm_score": 1, "selected": false, "text": "<p>I believe you need to define a <a href=\"http://www.swig.org/Doc1.3/Ruby.html#Ruby_nn16\" rel=\"nofollow norefer...
2009/02/14
[ "https://Stackoverflow.com/questions/549249", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37602/" ]
I use SWIG to wrap a Ruby script around a C++ library. In Ruby, I can inherit from a C++ class, but I cannot pass the resulting pointer to a C++ function in a polymorphic way. Here is a concrete example. The SWIG interface file defines base class Animal with virtual function sound(): ``` [animals.i] %module(director...
I got a solution to my problem from Tobias Grimm at the swig-user mailing list. The first part of the problem is SWIG's misleading error message. The message seems to suggest that I pass the wrong type of pointer to my C++ function, but this is not the case. If you check the class of the exception in Ruby, it's ObjectP...
549,280
<p>I just started making a PHP/AJAX site and I was wondering where I should add the functionality to <strong>"only include the content"</strong>.</p> <p>Should I have if statements in my header and footer scripts that check for a <strong>"ContentOnly"</strong> get parameter? And then append that parameter to the quer...
[ { "answer_id": 549295, "author": "ceejayoz", "author_id": 1902010, "author_profile": "https://Stackoverflow.com/users/1902010", "pm_score": 4, "selected": true, "text": "<p>Please don't use AJAX for the sake of using AJAX.</p>\n\n<p>That said, most AJAX libraries pass a <code>X-Requested...
2009/02/14
[ "https://Stackoverflow.com/questions/549280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/57698/" ]
I just started making a PHP/AJAX site and I was wondering where I should add the functionality to **"only include the content"**. Should I have if statements in my header and footer scripts that check for a **"ContentOnly"** get parameter? And then append that parameter to the query strings in my AJAX calls? Or shoul...
Please don't use AJAX for the sake of using AJAX. That said, most AJAX libraries pass a `X-Requested-With` HTTP header indicating that it's an AJAX request. You can use that header to decide whether to include your header/footer etc.
549,302
<p>How do you search a Websites source code with ruby, hard to explain but heres the code for doing it in python </p> <pre><code>import urllib2, re word = "How to ask" source = urllib2.urlopen("http://stackoverflow.com").read() if re.search(word,source): print "Found it "+word </code></pre>
[ { "answer_id": 549346, "author": "jcrossley3", "author_id": 66451, "author_profile": "https://Stackoverflow.com/users/66451", "pm_score": 2, "selected": false, "text": "<p>Here's one way:</p>\n\n<pre><code>require 'open-uri'\nword = \"How to ask\"\nopen('http://stackoverflow.com') do |f|...
2009/02/14
[ "https://Stackoverflow.com/questions/549302", "https://Stackoverflow.com", "https://Stackoverflow.com/users/66437/" ]
How do you search a Websites source code with ruby, hard to explain but heres the code for doing it in python ``` import urllib2, re word = "How to ask" source = urllib2.urlopen("http://stackoverflow.com").read() if re.search(word,source): print "Found it "+word ```
Here's one way: ``` require 'open-uri' word = "How to ask" open('http://stackoverflow.com') do |f| puts "Found it #{word}" if f.read =~ /#{word}/ end ```
549,314
<p>Addressing all the browsers back to IE6 is quite challenging. Every browser supports different features of the specifications. Is there a guide on a safe subset of CSS which can be used across browsers (IE6,IE7,FF1,FF2,Safari,Opera)? That way I wouldn't have to test my style sheets in 6 different browsers after ever...
[ { "answer_id": 549322, "author": "Daniel A. White", "author_id": 23528, "author_profile": "https://Stackoverflow.com/users/23528", "pm_score": 4, "selected": true, "text": "<p>Here is a valuable reference.\n<a href=\"http://www.quirksmode.org/css/contents.html\" rel=\"nofollow noreferrer...
2009/02/14
[ "https://Stackoverflow.com/questions/549314", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48486/" ]
Addressing all the browsers back to IE6 is quite challenging. Every browser supports different features of the specifications. Is there a guide on a safe subset of CSS which can be used across browsers (IE6,IE7,FF1,FF2,Safari,Opera)? That way I wouldn't have to test my style sheets in 6 different browsers after every s...
Here is a valuable reference. <http://www.quirksmode.org/css/contents.html> Also, for IE and select other browsers - conditional comments. <http://msdn.microsoft.com/en-us/library/ms537512.aspx> I use them this way. I override any IE specifics. ``` <link rel="stylesheet" type="text/css" href="theme.css" /> <!--[if I...
549,347
<p>The GCC toolchain uses AT&amp;T assembler syntax by default, but support for Intel syntax is available via the <code>.intel_syntax</code> directive.</p> <p>Additionally, both AT&amp;T and Intel syntax are available in a <code>prefix</code> and a <code>noprefix</code> version, which differ in whether or not they req...
[ { "answer_id": 549428, "author": "Tom Alsberg", "author_id": 66034, "author_profile": "https://Stackoverflow.com/users/66034", "pm_score": 4, "selected": true, "text": "<p>The <code>noprefix</code>/<code>prefix</code> directives only control whether registers require a <code>%</code> pre...
2009/02/14
[ "https://Stackoverflow.com/questions/549347", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48015/" ]
The GCC toolchain uses AT&T assembler syntax by default, but support for Intel syntax is available via the `.intel_syntax` directive. Additionally, both AT&T and Intel syntax are available in a `prefix` and a `noprefix` version, which differ in whether or not they require to prefix register names with a `%` sigil. De...
The `noprefix`/`prefix` directives only control whether registers require a `%` prefix(\*) (at least it seems so and that's the only difference the documentation mentions). Value literals always need a `$` prefix in AT&T syntax and never in Intel syntax. So the following works: ``` __asm__(".intel_syntax prefix"); __a...
549,360
<p>I am trying to create a reusable "picker". It is basically like a keypad of a phone. Since I will be using this a lot in my iPhone app, I have been frustrated with trying to make it appear.</p> <p>It is in its own XIB file and has its own UIViewController subclass as the FileOwner. However, when I instantiate this ...
[ { "answer_id": 549428, "author": "Tom Alsberg", "author_id": 66034, "author_profile": "https://Stackoverflow.com/users/66034", "pm_score": 4, "selected": true, "text": "<p>The <code>noprefix</code>/<code>prefix</code> directives only control whether registers require a <code>%</code> pre...
2009/02/14
[ "https://Stackoverflow.com/questions/549360", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I am trying to create a reusable "picker". It is basically like a keypad of a phone. Since I will be using this a lot in my iPhone app, I have been frustrated with trying to make it appear. It is in its own XIB file and has its own UIViewController subclass as the FileOwner. However, when I instantiate this with: ```...
The `noprefix`/`prefix` directives only control whether registers require a `%` prefix(\*) (at least it seems so and that's the only difference the documentation mentions). Value literals always need a `$` prefix in AT&T syntax and never in Intel syntax. So the following works: ``` __asm__(".intel_syntax prefix"); __a...
549,374
<p>I need to do something like this </p> <pre><code>class User &lt; ActiveRecord::Base has_many :abuse_reports end class AbuseReport &lt; ActiveRecord::Base belongs_to :abuser, :class_name =&gt; 'User', :foreign_key =&gt; 'abuser_id' belongs_to :game end class Game &lt; ActiveRecord::Base has_many :abuse_rep...
[ { "answer_id": 549474, "author": "LDomagala", "author_id": 45719, "author_profile": "https://Stackoverflow.com/users/45719", "pm_score": 2, "selected": false, "text": "<p>The problem you are having is that you use ActiveRecord in way its not \"supposed\" to be used. By that I mean that y...
2009/02/14
[ "https://Stackoverflow.com/questions/549374", "https://Stackoverflow.com", "https://Stackoverflow.com/users/66463/" ]
I need to do something like this ``` class User < ActiveRecord::Base has_many :abuse_reports end class AbuseReport < ActiveRecord::Base belongs_to :abuser, :class_name => 'User', :foreign_key => 'abuser_id' belongs_to :game end class Game < ActiveRecord::Base has_many :abuse_reports end @top_abusers = User...
Firstly, you should really use :include instead of :joins ``` User.find(:all, :include => { :abuse_reports => [ :game ] }, :order => ) ``` or, in your case, try ``` User.page(params[:page], :include => { :abuse_reports => [ :game ] }) ``` This will perform the join for you *and* retrieve the records in one shot. ...
549,382
<p>I'm trying to implement a log viewer in my application. The idea is simple, a listbox that shows some messages sended from other classes, but I don't know what is the best way to do this.</p> <p>My initial thought was to make a Logger class (<strong>singletone</strong>) that contains a <strong>List</strong> or <str...
[ { "answer_id": 549384, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 2, "selected": false, "text": "<p>Any reason not to use existing technologies?</p>\n\n<ul>\n<li><a href=\"http://logging.apache.org/log4net/index.html\...
2009/02/14
[ "https://Stackoverflow.com/questions/549382", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4386/" ]
I'm trying to implement a log viewer in my application. The idea is simple, a listbox that shows some messages sended from other classes, but I don't know what is the best way to do this. My initial thought was to make a Logger class (**singletone**) that contains a **List** or **Queue**, then I'll add a **method AddM...
Some of the questions to consider are: * Is your application multi-threaded? Is the thread[s] which write[s] the messages the same as the UI thread which reads the messages and populates the list box? * How many messages per second and being created? * How many times per second do you want to update the list box? * Wh...
549,391
<p>I have a very simple piece of code that I used in previous versions of Python without issues (version 2.5 and prior). Now with 3.0, the following code give the error on the login line "argument 1 must be string or buffer, not str".</p> <pre><code>import smtplib smtpserver = 'mail.somedomain.com' AUTHREQUIRE...
[ { "answer_id": 549491, "author": "George", "author_id": 48486, "author_profile": "https://Stackoverflow.com/users/48486", "pm_score": 2, "selected": false, "text": "<pre><code>Traceback (most recent call last):\n File \"smtptest.py\", line 18, in &lt;module&gt;\n session.login(smtpus...
2009/02/14
[ "https://Stackoverflow.com/questions/549391", "https://Stackoverflow.com", "https://Stackoverflow.com/users/66468/" ]
I have a very simple piece of code that I used in previous versions of Python without issues (version 2.5 and prior). Now with 3.0, the following code give the error on the login line "argument 1 must be string or buffer, not str". ``` import smtplib smtpserver = 'mail.somedomain.com' AUTHREQUIRED = 1 ...
**UPDATE**: just noticed from a look at the bug tracker there's a suggested fix also: Edit smtplib.py and replace the existing `encode_plain()` definition with this: ``` def encode_plain(user, password): s = "\0%s\0%s" % (user, password) return encode_base64(s.encode('ascii'), eol='') ``` Tested here on m...
549,393
<p>What's the best practice in terms of setting up my DataContext for easy access in my extended LinqToSql classes?</p> <p>For example, I have a "User" entity in my dbml and I want to add methods to that class like so:</p> <pre><code>Partial Public Class User Public Function GetUser(ByVal UserID as Integer) as ...
[ { "answer_id": 549398, "author": "Rex M", "author_id": 67, "author_profile": "https://Stackoverflow.com/users/67", "pm_score": 5, "selected": true, "text": "<p>First, make sure you are disposing your DataContext when you're done! He can be a heavy little bastard (<strong>edit</strong> no...
2009/02/14
[ "https://Stackoverflow.com/questions/549393", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47167/" ]
What's the best practice in terms of setting up my DataContext for easy access in my extended LinqToSql classes? For example, I have a "User" entity in my dbml and I want to add methods to that class like so: ``` Partial Public Class User Public Function GetUser(ByVal UserID as Integer) as User 'Do Work...
First, make sure you are disposing your DataContext when you're done! He can be a heavy little bastard (**edit** not heavy to instantiate, but heavy to keep around if you keep using it without disposing); you don't want old DataContexts hanging around in memory. Second, **the DataContext is intended to represent a sin...
549,399
<p>I'm trying to create an array of arrays that will be using repeated data, something like below:</p> <pre><code>int[] list1 = new int[4] { 1, 2, 3, 4 }; int[] list2 = new int[4] { 5, 6, 7, 8 }; int[] list3 = new int[4] { 1, 3, 2, 1 }; int[] list4 = new int[4] { 5, 4, 3, 2 }; int[,] lists = new int[4, 4] { list1 , ...
[ { "answer_id": 549417, "author": "Sean", "author_id": 26095, "author_profile": "https://Stackoverflow.com/users/26095", "pm_score": 7, "selected": true, "text": "<p>What you need to do is this:</p>\n\n<pre><code>int[] list1 = new int[4] { 1, 2, 3, 4};\nint[] list2 = new int[4] { 5, 6, 7,...
2009/02/14
[ "https://Stackoverflow.com/questions/549399", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48151/" ]
I'm trying to create an array of arrays that will be using repeated data, something like below: ``` int[] list1 = new int[4] { 1, 2, 3, 4 }; int[] list2 = new int[4] { 5, 6, 7, 8 }; int[] list3 = new int[4] { 1, 3, 2, 1 }; int[] list4 = new int[4] { 5, 4, 3, 2 }; int[,] lists = new int[4, 4] { list1 , list2 , list...
What you need to do is this: ``` int[] list1 = new int[4] { 1, 2, 3, 4}; int[] list2 = new int[4] { 5, 6, 7, 8}; int[] list3 = new int[4] { 1, 3, 2, 1 }; int[] list4 = new int[4] { 5, 4, 3, 2 }; int[][] lists = new int[][] { list1 , list2 , list3 , list4 }; ``` Another alternative would be to create a `List<in...
549,407
<p>I'm really new to using JSON to handle my Ajax Request and Response cycle. I've previously used just plain old parameters passed as POST data and I've rendered straight HTML in the response which was then placed into the DOM. As I've looked at various examples and read through various tutorials, it seems like a fair...
[ { "answer_id": 549425, "author": "marktucks", "author_id": 62831, "author_profile": "https://Stackoverflow.com/users/62831", "pm_score": 2, "selected": false, "text": "<p>You could create the elements in the DOM using javascript instead of just dropping them into the innerHtml of the DIV...
2009/02/14
[ "https://Stackoverflow.com/questions/549407", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20178/" ]
I'm really new to using JSON to handle my Ajax Request and Response cycle. I've previously used just plain old parameters passed as POST data and I've rendered straight HTML in the response which was then placed into the DOM. As I've looked at various examples and read through various tutorials, it seems like a fairly ...
I steer away from writing a lot of HTML within JavaScript strings. I prefer separation of structure from data manipulation. The better alternative is to place that code in the page, load the values based off the ID's, and show/hide it if necessary: ``` <div id="codeBlock" style="visible=false;"> <span id="val1"></...
549,427
<p>As I'm developing my <a href="https://stackoverflow.com/questions/521723/reflective-web-application">WebIDE</a>, I keep coming up with questions that I cannot answer myself. This is because the project is supposed to help others create what they would "normally" create, but faster (i.e. as automated as possible). ...
[ { "answer_id": 549476, "author": "barfoon", "author_id": 1390354, "author_profile": "https://Stackoverflow.com/users/1390354", "pm_score": -1, "selected": false, "text": "<p>I do something very similar. What you need is a JSON object to pass back to the javascript. When you are done with...
2009/02/14
[ "https://Stackoverflow.com/questions/549427", "https://Stackoverflow.com", "https://Stackoverflow.com/users/62248/" ]
As I'm developing my [WebIDE](https://stackoverflow.com/questions/521723/reflective-web-application), I keep coming up with questions that I cannot answer myself. This is because the project is supposed to help others create what they would "normally" create, but faster (i.e. as automated as possible). In this light, m...
I send all data to the backend in a big GET array. actionpage.php?action=post&parameters[parameter1]=value1&parameters[parameter2]=value2 If you print\_r($\_GET), on the PHP side you'll see: ``` array( "action" => "create", "parameters" => array("parameter1"=>"value1","parameter2"=>"value2") ) ``` What thi...
549,451
<p>I'm trying to create an activity that presents some data to the user. The data is such that it can be divided into 'words', each being a widget, and sequence of 'words' would form the data ('sentence'?), the ViewGroup widget containing the words. As space required for all 'words' in a 'sentence' would exceed the ava...
[ { "answer_id": 558825, "author": "Will", "author_id": 53498, "author_profile": "https://Stackoverflow.com/users/53498", "pm_score": 0, "selected": false, "text": "<p>Try setting both of <strong>lp</strong>'s LayoutParams to be <code>WRAP_CONTENT</code>.</p>\n\n<p>Setting <strong>mlp</str...
2009/02/14
[ "https://Stackoverflow.com/questions/549451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2010/" ]
I'm trying to create an activity that presents some data to the user. The data is such that it can be divided into 'words', each being a widget, and sequence of 'words' would form the data ('sentence'?), the ViewGroup widget containing the words. As space required for all 'words' in a 'sentence' would exceed the availa...
Since May 2016 there is new layout called FlexboxLayout from Google, which is highly configurable for purpose you want. FlexboxLayout is in Google GitHub repository at <https://github.com/google/flexbox-layout> at this moment. You can use it in your project by adding dependency to your `build.gradle` file: ``` depen...
549,458
<p>I've got a multidimensional array:</p> <pre><code>foo = [["a","b","c"], ["d", "e", "f"], ["g", "h", "i"]] </code></pre> <p>Now I need to ruturn the "coordinates" of "f", which should be (1,2). How can I do this without knowing which "row" "f" is in? I've been trying to use the index method, but this only works whe...
[ { "answer_id": 549467, "author": "Suroot", "author_id": 64626, "author_profile": "https://Stackoverflow.com/users/64626", "pm_score": 1, "selected": false, "text": "<p>You would probably need to loop through the arrays to find the letter, then print out the location.</p>\n\n<p>This is mo...
2009/02/14
[ "https://Stackoverflow.com/questions/549458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/66348/" ]
I've got a multidimensional array: ``` foo = [["a","b","c"], ["d", "e", "f"], ["g", "h", "i"]] ``` Now I need to ruturn the "coordinates" of "f", which should be (1,2). How can I do this without knowing which "row" "f" is in? I've been trying to use the index method, but this only works when I tell it where to look,...
``` foo.each_with_index do |item, index| if item.index('f') // the array number that 'f' is in puts "Array number: #{index}" // the index in that array of the letter 'f' puts item.index('f') end end ```
549,464
<p>I would like to have master WPF form with tab control where each tab contains one independent WPF form. Those forms do not depend on each other, so I thought it will be easier to develop each of them separately and then just embed them into master form. <br></p> <p>Number of forms is known, so there is no need for ...
[ { "answer_id": 549484, "author": "Lars Truijens", "author_id": 1242, "author_profile": "https://Stackoverflow.com/users/1242", "pm_score": 3, "selected": false, "text": "<p>When you use a <a href=\"http://msdn.microsoft.com/en-us/library/system.windows.controls.frame.aspx\" rel=\"norefer...
2009/02/14
[ "https://Stackoverflow.com/questions/549464", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25732/" ]
I would like to have master WPF form with tab control where each tab contains one independent WPF form. Those forms do not depend on each other, so I thought it will be easier to develop each of them separately and then just embed them into master form. Number of forms is known, so there is no need for dynamic plug...
When you use a [Frame](http://msdn.microsoft.com/en-us/library/system.windows.controls.frame.aspx) or [NavigationWindow](http://msdn.microsoft.com/en-us/library/system.windows.navigation.navigationwindow.aspx) you can have it load different xaml [Pages](http://msdn.microsoft.com/en-us/library/system.windows.controls.pa...
549,469
<p>I have the method (Delphi 2009):</p> <pre><code>procedure TAnsiStringType.SetData(const Value: TBuffer; IsNull: boolean = False); begin if not IsNull then FValue:= PAnsiString(Value)^; inherited; end; </code></pre> <p>This is an abstract method on the base class, where "Value: Pointer" expects the pointer ...
[ { "answer_id": 549590, "author": "Toon Krijthe", "author_id": 18061, "author_profile": "https://Stackoverflow.com/users/18061", "pm_score": 4, "selected": true, "text": "<p>Nice puzzle, but I have the solution:</p>\n\n<ul>\n<li>P2 and P3 are the address of the pointer to the buffer</li>\...
2009/02/14
[ "https://Stackoverflow.com/questions/549469", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36875/" ]
I have the method (Delphi 2009): ``` procedure TAnsiStringType.SetData(const Value: TBuffer; IsNull: boolean = False); begin if not IsNull then FValue:= PAnsiString(Value)^; inherited; end; ``` This is an abstract method on the base class, where "Value: Pointer" expects the pointer of the corresponding data,...
Nice puzzle, but I have the solution: * P2 and P3 are the address of the pointer to the buffer * P1 and P4 are the address of the buffer * P5 is the first element in the buffer I have added comment in the code: ``` var Buffer: AnsiString; P1: Pointer; P2: Pointer; P3: Pointer; P4: Pointer; P5: Pointer; b...
549,488
<p>I want to assign a keydown event handler to an iframe. Something similar to the pure JS:</p> <pre><code>document.getElementById('iframe_id').contentWindow.addEventListener('keydown',funcName, true); </code></pre> <p>I tried:</p> <pre><code>$(document.getElementById('iframe_id').contentWindow).keydown( function() ...
[ { "answer_id": 549667, "author": "Mcbeev", "author_id": 12762, "author_profile": "https://Stackoverflow.com/users/12762", "pm_score": 0, "selected": false, "text": "<p>The $ function replaces the need for document.getElementById</p>\n\n<pre><code>$('iframe_id').contentDocument.keydown(fu...
2009/02/14
[ "https://Stackoverflow.com/questions/549488", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I want to assign a keydown event handler to an iframe. Something similar to the pure JS: ``` document.getElementById('iframe_id').contentWindow.addEventListener('keydown',funcName, true); ``` I tried: ``` $(document.getElementById('iframe_id').contentWindow).keydown( function() { // my func }); ``` But it does...
`contentWindow` is the `iframe`'s `window` object. You want the `iframe`'s `document` instead: ``` $(document.getElementById('iframe_id').contentWindow.document).keydown(function() { // my func }); ``` Note that I am not sure how jQuery reacts to elements from other windows/frames.
549,507
<p>I have tried this example of array of pointers. I am getting the error "Illegal initialisation in function main"</p> <pre><code>int main() { int a[]={1,2,3,4,5}; int b[]={1,2,3,4,5}; int c[]={1,2,3,4,5}; int *p[3]={a,b,c}; int i; clrscr(); for(i=0;i&lt;3;i++) printf("%d - %u\n",*...
[ { "answer_id": 549548, "author": "ypnos", "author_id": 21974, "author_profile": "https://Stackoverflow.com/users/21974", "pm_score": 2, "selected": false, "text": "<p>This compiles fine with gcc and gcc -ansi. gcc -ansi -pedantic however gives the following warning:</p>\n\n<pre><code>bla...
2009/02/14
[ "https://Stackoverflow.com/questions/549507", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I have tried this example of array of pointers. I am getting the error "Illegal initialisation in function main" ``` int main() { int a[]={1,2,3,4,5}; int b[]={1,2,3,4,5}; int c[]={1,2,3,4,5}; int *p[3]={a,b,c}; int i; clrscr(); for(i=0;i<3;i++) printf("%d - %u\n",*p[i],p[i]); g...
In gcc you see warnings about this if you use the *-pedantic* flag. But this is apparently something that has changed in the standard, in C90 it say: > > *All the expressions in an initializer for an object that has static > storage duration or in an initializer list for an object that has > aggregate or union t...
549,536
<p>I'm working on a simple web crawler in python and I wan't to make a simple queue class, but I'm not quite sure the best way to start. I want something that holds only unique items to process, so that the crawler will only crawl each page once per script run (simply to avoid infinite looping). Can anyone give me or p...
[ { "answer_id": 549543, "author": "Aaron Maenpaa", "author_id": 2603, "author_profile": "https://Stackoverflow.com/users/2603", "pm_score": 3, "selected": true, "text": "<p>I'd just use a set, it doesn't maintain order but it will help you maintain uniqueness:</p>\n\n<pre><code>&gt;&gt;&g...
2009/02/14
[ "https://Stackoverflow.com/questions/549536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2128/" ]
I'm working on a simple web crawler in python and I wan't to make a simple queue class, but I'm not quite sure the best way to start. I want something that holds only unique items to process, so that the crawler will only crawl each page once per script run (simply to avoid infinite looping). Can anyone give me or poin...
I'd just use a set, it doesn't maintain order but it will help you maintain uniqueness: ``` >>> q = set([9, 8, 7, 7, 8, 5, 4, 1]) >>> q.pop() 1 >>> q.pop() 4 >>> q.pop() 5 >>> q.add(3) >>> q.add(3) >>> q.add(3) >>> q.add(3) >>> q set([3, 7, 8, 9] ```
549,545
<p>I'm looking for a design pattern that would fit my application design.</p> <p>My application processes large amounts of data and produces some graphs. Data processing (fetching from files, CPU intensive calculations) and graph operations (drawing, updating) are done in seperate threads. </p> <p>Graph can be scrol...
[ { "answer_id": 549581, "author": "Assaf Lavie", "author_id": 11208, "author_profile": "https://Stackoverflow.com/users/11208", "pm_score": 1, "selected": false, "text": "<p>Multiple progress bars aren't such a bad idea, mind you. Or maybe a complex progress bar that shows several threads...
2009/02/14
[ "https://Stackoverflow.com/questions/549545", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I'm looking for a design pattern that would fit my application design. My application processes large amounts of data and produces some graphs. Data processing (fetching from files, CPU intensive calculations) and graph operations (drawing, updating) are done in seperate threads. Graph can be scrolled - in this cas...
I once spent the best part of a week trying to make a smooth, non-hiccupy progress bar over a very complex algorithm. The algorithm had 6 different steps. Each step had timing characteristics that were seriously dependent on A) the underlying data being processed, not just the "amount" of data but also the "type" of ...
549,575
<p>Our organization's custom build tools write out a lot of intermediate data, and I'd like it if Hudson could detect which files were created as part of a build and archive those. I'm not sure if it already does so, but if it does there's no user-visible explanation of it, and certainly deleting a build does not dele...
[ { "answer_id": 549630, "author": "jcrossley3", "author_id": 66451, "author_profile": "https://Stackoverflow.com/users/66451", "pm_score": 0, "selected": false, "text": "<p>It's difficult to answer without understanding your \"custom checkout process\", but typically all of the project's ...
2009/02/14
[ "https://Stackoverflow.com/questions/549575", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23309/" ]
Our organization's custom build tools write out a lot of intermediate data, and I'd like it if Hudson could detect which files were created as part of a build and archive those. I'm not sure if it already does so, but if it does there's no user-visible explanation of it, and certainly deleting a build does not delete i...
The Hudson way would be to clean up all temporary files at the beginning of the build, and then use Hudson's artifacts archive facility to save the output from each build - specify pkg/\*\*/\*.tgz for the "Archive the Artifacts" post build step and then the tgz files will all be copied into the job specific storage are...
549,601
<p>I have 2 tables to search. Searching photos for keywords, title and description. The keywords have been split off into a separate table. My advanced search will allow searching on all 3 but the basic will just be the keyword table.</p> <p>Basic table setup:</p> <p><strong>PHOTO Table</strong></p> <ul> <li><em>Pho...
[ { "answer_id": 549638, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 0, "selected": false, "text": "<p>It isn't entirely clear what you mean, but it sounds like like you just want:</p>\n\n<pre><code>SELECT /* some col...
2009/02/14
[ "https://Stackoverflow.com/questions/549601", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I have 2 tables to search. Searching photos for keywords, title and description. The keywords have been split off into a separate table. My advanced search will allow searching on all 3 but the basic will just be the keyword table. Basic table setup: **PHOTO Table** * *PhotoID* * *Name* * *Title* * *Description* **...
Let’s say you have table Photo and table Word and have a relation many-to-many using additional table WordToPhoto: ``` DECLARE @Photo TABLE (ID INT, Name VARCHAR(20), Title VARCHAR(50), Description VARCHAR(200)) INSERT INTO @Photo SELECT 1, 'mountain.jpg', 'Mountain trip', 'Mountain trip' UNION SELECT 2, 'beach.jpg',...
549,628
<p>Is there a way to use the RegularExpressionValidator to validate only when the ValidationExpression does not match? In particular use a PO BOX regex to validate an address that is <strong>NOT</strong> a PO BOX.</p> <p>Thanks!</p>
[ { "answer_id": 549640, "author": "Alex Reitbort", "author_id": 11525, "author_profile": "https://Stackoverflow.com/users/11525", "pm_score": 1, "selected": false, "text": "<p>Create a regular expression that validates NOT a PO BOX or use custom validator.</p>\n" }, { "answer_id":...
2009/02/14
[ "https://Stackoverflow.com/questions/549628", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51275/" ]
Is there a way to use the RegularExpressionValidator to validate only when the ValidationExpression does not match? In particular use a PO BOX regex to validate an address that is **NOT** a PO BOX. Thanks!
You can effectively invert your regular expression using a [negative look-ahead](http://www.regular-expressions.info/lookaround.html). For example, consider the following regular expression that matches only a string of digits: ``` ^\d+$ ``` This expression could be inverted as follows: ``` ^(?!\d+$).*$ ```
549,635
<p>I want to create an attandence list from the student's database in PDF using PHP. I want the columns student.name, student_id, student_rollno and a column for sign for signing to be made as table in pdf. How can I do this?</p>
[ { "answer_id": 549661, "author": "Anand", "author_id": 12649, "author_profile": "https://Stackoverflow.com/users/12649", "pm_score": 0, "selected": false, "text": "<p>You could use the <a href=\"http://in.php.net/pdf\" rel=\"nofollow noreferrer\">pdflib</a> extension for php to do this.<...
2009/02/14
[ "https://Stackoverflow.com/questions/549635", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I want to create an attandence list from the student's database in PDF using PHP. I want the columns student.name, student\_id, student\_rollno and a column for sign for signing to be made as table in pdf. How can I do this?
Well, this is a somewhat general question but I'll take the PDF part at least and offer up the following PHP class : <http://www.tcpdf.org> This class works without having to enable the pdf extension on your server which is a huge benefit. But beyond that, it also supports simple HTML including the 'table' tag. If you...
549,652
<p>Here's some code that someone wants to use in a production app (not me, honest) - I'd like some independent feedback on it please.</p> <pre><code> public class JobProcessor&lt;TJob&gt; : IJobProcessor&lt;TJob&gt; where TJob : class { private readonly IJobQueue&lt;TJob&gt; theJobQueue = new NullQueue&lt;TJob&g...
[ { "answer_id": 549673, "author": "Alex Reitbort", "author_id": 11525, "author_profile": "https://Stackoverflow.com/users/11525", "pm_score": 2, "selected": false, "text": "<p>Is you thread trying to catch ThreadAbortException and then recreate itself? I am not sure it is possible, but an...
2009/02/14
[ "https://Stackoverflow.com/questions/549652", "https://Stackoverflow.com", "https://Stackoverflow.com/users/61311/" ]
Here's some code that someone wants to use in a production app (not me, honest) - I'd like some independent feedback on it please. ``` public class JobProcessor<TJob> : IJobProcessor<TJob> where TJob : class { private readonly IJobQueue<TJob> theJobQueue = new NullQueue<TJob>(); private Thread processorThrea...
Is you thread trying to catch ThreadAbortException and then recreate itself? I am not sure it is possible, but anyway it is not a nice way to play with the OS. And you will lose jobs if exception happens after currentJob = theJobQueue.RetrieveJob(); but before theObserver.ProcessMessage(this, currentJob); And unless ...
549,659
<p>I'm unable to restore a window after "minimizing" a window to tray, by doing this in wndproc:</p> <pre><code>case WM_SIZE: if (wparam==SIZE_MINIMIZED) { ShowWindow(hwnd,SW_HIDE); } break; </code></pre> <p>The tray message handler looks like this:</p> <pre><code>case TRAY_ICON_MESSAGE: switch(lparam) {...
[ { "answer_id": 549684, "author": "schnaader", "author_id": 34065, "author_profile": "https://Stackoverflow.com/users/34065", "pm_score": 3, "selected": true, "text": "<p>Could you have a look if the functions return any errors?</p>\n\n<p>You could also have a look at <a href=\"http://msd...
2009/02/14
[ "https://Stackoverflow.com/questions/549659", "https://Stackoverflow.com", "https://Stackoverflow.com/users/66490/" ]
I'm unable to restore a window after "minimizing" a window to tray, by doing this in wndproc: ``` case WM_SIZE: if (wparam==SIZE_MINIMIZED) { ShowWindow(hwnd,SW_HIDE); } break; ``` The tray message handler looks like this: ``` case TRAY_ICON_MESSAGE: switch(lparam) { case WM_LBUTTONDOWN: ShowWindo...
Could you have a look if the functions return any errors? You could also have a look at [SetForegroundWindow](http://msdn.microsoft.com/en-us/library/ms633539(VS.85).aspx)
549,677
<p>I have defined a custom error but if I test if custom error gets raised, it fails.</p> <p>My models.py:</p> <pre><code>class CustomError(Exception): """ This exception is my custom error """ class Company(models.Model): name = models.CharField(max_length=200) def test_error(self): raise C...
[ { "answer_id": 549876, "author": "Andy Hume", "author_id": 46460, "author_profile": "https://Stackoverflow.com/users/46460", "pm_score": 2, "selected": false, "text": "<p>You could catch the error and assert that it occured.</p>\n\n<p>eg: (untested)</p>\n\n<pre><code>def test2(self)\n ...
2009/02/14
[ "https://Stackoverflow.com/questions/549677", "https://Stackoverflow.com", "https://Stackoverflow.com/users/66492/" ]
I have defined a custom error but if I test if custom error gets raised, it fails. My models.py: ``` class CustomError(Exception): """ This exception is my custom error """ class Company(models.Model): name = models.CharField(max_length=200) def test_error(self): raise CustomError('hello') ...
Thanks Andy for your answer the problem was however that I was using the wrong/different kinds of imports: In my settings in my INSTALLED\_APPS I had myproj.myapp After I changed: ``` from myapp.models import Company,CustomError ``` To: ``` from myproj.myapp.models import Company,CustomError ``` It worked as e...
549,693
<pre><code>&lt;script type="test/javascript" src="/js/something.js"&gt;&lt;/script&gt; </code></pre> <p>Nothing looks out of place there, right? Then what's going on that, in Firefox, Chrome, Steel, Android Browser, and IE 6, the page loads and does not execute anything in schedulegrid.js? Even if it is just a single ...
[ { "answer_id": 549696, "author": "some", "author_id": 36866, "author_profile": "https://Stackoverflow.com/users/36866", "pm_score": 4, "selected": true, "text": "<p>it should be \"text/javascript\" not \"test/javascript\"</p>\n" }, { "answer_id": 549700, "author": "Mike", ...
2009/02/14
[ "https://Stackoverflow.com/questions/549693", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19687/" ]
``` <script type="test/javascript" src="/js/something.js"></script> ``` Nothing looks out of place there, right? Then what's going on that, in Firefox, Chrome, Steel, Android Browser, and IE 6, the page loads and does not execute anything in schedulegrid.js? Even if it is just a single alert() call: nothing. Firebug ...
it should be "text/javascript" not "test/javascript"
549,728
<p>So we had a power outage at work the other day and ever since then <a href="http://en.wikipedia.org/wiki/ReSharper" rel="nofollow noreferrer">ReSharper</a> and Visual Studio just aren't playing nicely. The issue occurs when I try to click on one of the light bulb action lists, they just disappear. I also noticed tha...
[ { "answer_id": 550030, "author": "Drew Noakes", "author_id": 24874, "author_profile": "https://Stackoverflow.com/users/24874", "pm_score": 0, "selected": false, "text": "<p>Can you access the context actions menu via the shortcut key? On my install (IntelliJ/R#2 key bindings) the shortc...
2009/02/14
[ "https://Stackoverflow.com/questions/549728", "https://Stackoverflow.com", "https://Stackoverflow.com/users/66496/" ]
So we had a power outage at work the other day and ever since then [ReSharper](http://en.wikipedia.org/wiki/ReSharper) and Visual Studio just aren't playing nicely. The issue occurs when I try to click on one of the light bulb action lists, they just disappear. I also noticed that when I compile and there is an error, ...
I had the same problem, including having the Visual Studio database edition installed, and solved it by resetting the Visual Studio settings. From the Visual Studio command prompt (for instance, menu *Start* -> *Programs* -> *Microsoft Visual Studio 2008* -> *Visual Studio Tools* -> *Microsoft Visual Studio 2008 Comma...
549,734
<p>how do i change this to linq to sql?</p> <pre><code>select * from ratesSchedule as rs inner join userdetails as ud on rs.sid = ud.sid and rs.tabletype = 'd' </code></pre> <p>i got this far</p> <pre><code>var results = from rs in db.ratesSchedule join ud in db.userdetails on rs.sid equals ud....
[ { "answer_id": 549795, "author": "casperOne", "author_id": 50776, "author_profile": "https://Stackoverflow.com/users/50776", "pm_score": 2, "selected": false, "text": "<p>You should be able to just put it in the WHERE part of the statement, since you aren't joining on a condition other t...
2009/02/14
[ "https://Stackoverflow.com/questions/549734", "https://Stackoverflow.com", "https://Stackoverflow.com/users/65005/" ]
how do i change this to linq to sql? ``` select * from ratesSchedule as rs inner join userdetails as ud on rs.sid = ud.sid and rs.tabletype = 'd' ``` i got this far ``` var results = from rs in db.ratesSchedule join ud in db.userdetails on rs.sid equals ud.sid ``` but i can't figure out how ...
If you'd like to do it without where clause, try this: ``` var results = from rs in db.ratesSchedule join ud in db.userdetails on new { rs.sid, rs.tabletype } equals new { ud.sid, tabletype = "d" } ``` Personally I'd stick to SQL in this case, since LINQ isn't even...
549,737
<p>I have a program whose <code>STDERR</code> output I want to inspect and run <code>grep</code> on etc.</p> <p>So I could redirect it to <code>STDOUT</code> and use grep, but the problem is, I do <em>not</em> want the original <code>STDOUT</code> content.</p> <p>So, this one won't do</p> <pre><code>cmd 2&gt;&amp;1 ...
[ { "answer_id": 549745, "author": "Charlie Martin", "author_id": 35092, "author_profile": "https://Stackoverflow.com/users/35092", "pm_score": 2, "selected": false, "text": "<p>Close STDOUT first:</p>\n\n<pre><code>1&gt;&amp;-, &gt;&amp;-\n</code></pre>\n\n<p>See <a href=\"http://tldp.org...
2009/02/14
[ "https://Stackoverflow.com/questions/549737", "https://Stackoverflow.com", "https://Stackoverflow.com/users/60628/" ]
I have a program whose `STDERR` output I want to inspect and run `grep` on etc. So I could redirect it to `STDOUT` and use grep, but the problem is, I do *not* want the original `STDOUT` content. So, this one won't do ``` cmd 2>&1 | grep pattern ``` because it will mix the original STDOUT and STDERR. And this one...
What does not work: ------------------- The reason the last command you quoted: ``` cmd 1>/dev/null 2>&1 | grep pattern ``` does not work, stems from a confusion on the order in which redirection works. You expected the last quoted redirection to be applied to the ones before it on every output, so that output the ...
549,741
<p>Why does python 2.5.2 have the following behavior</p> <pre><code>&gt;&gt;&gt;[2].extend([]) == [2] False &gt;&gt;&gt; [2].extend([]) == None True $ python --version Python 2.5.2 </code></pre> <p>I assume I'm not understanding something here, but intuitively I'd think that [2].extend([]) should yield [2]</p>
[ { "answer_id": 549748, "author": "Rafał Dowgird", "author_id": 12166, "author_profile": "https://Stackoverflow.com/users/12166", "pm_score": 7, "selected": true, "text": "<p>Extend is a method of list, which modifies it but doesn't return <code>self</code> (returning <code>None</code> in...
2009/02/14
[ "https://Stackoverflow.com/questions/549741", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8123/" ]
Why does python 2.5.2 have the following behavior ``` >>>[2].extend([]) == [2] False >>> [2].extend([]) == None True $ python --version Python 2.5.2 ``` I assume I'm not understanding something here, but intuitively I'd think that [2].extend([]) should yield [2]
Extend is a method of list, which modifies it but doesn't return `self` (returning `None` instead). If you need the modified value as the expression value, use `+`, as in `[2]+[]`.
549,751
<p>How do I determine what screen my application is running on?</p>
[ { "answer_id": 549785, "author": "Bob", "author_id": 45, "author_profile": "https://Stackoverflow.com/users/45", "pm_score": 0, "selected": false, "text": "<p>Hmm, I don't think there is a built in way to get this, but it shouldn't be too hard to determine. Use the <a href=\"http://msdn....
2009/02/14
[ "https://Stackoverflow.com/questions/549751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/54009/" ]
How do I determine what screen my application is running on?
This should get you started. Get a Button and a listbox on a Form and put this in the Button\_Click: ``` listBox1.Items.Clear(); foreach (var screen in Screen.AllScreens) { listBox1.Items.Add(screen); } listBox1.SelectedItem = Screen.FromControl(this); ``` The answer is in the last line, remember tha...
549,759
<p>This jQuery will return the source URL of a frame:</p> <pre><code>$('#frame-name').attr('src') </code></pre> <p>But if a link inside the frame is clicked, the original source is still returned.</p> <p>Is it possible to detect the new source URL? Or get the source of the new document loaded in the frame? If either...
[ { "answer_id": 549791, "author": "Adam Peck", "author_id": 26658, "author_profile": "https://Stackoverflow.com/users/26658", "pm_score": 1, "selected": false, "text": "<p>AFAIK there is no good way to do this with jQuery. You need to use location.href on the html element so if you get t...
2009/02/14
[ "https://Stackoverflow.com/questions/549759", "https://Stackoverflow.com", "https://Stackoverflow.com/users/74552/" ]
This jQuery will return the source URL of a frame: ``` $('#frame-name').attr('src') ``` But if a link inside the frame is clicked, the original source is still returned. Is it possible to detect the new source URL? Or get the source of the new document loaded in the frame? If either of those is a yes, are there sec...
``` parent.frames[1].location.href; ``` Not jQuery, but what I was looking for. However, kicks a security error if the source is on a different domain.
549,770
<p>since I updated ruby using Mac Ports (on Leopard) I have got several problems and I also had to reinstall gems. Now when I run Mongrel I keep getting the error "Missing these required gems" followed by the list of gems that I required in environment.rb but that gems seems to be correctly installed as I see running <...
[ { "answer_id": 549930, "author": "pantulis", "author_id": 3972, "author_profile": "https://Stackoverflow.com/users/3972", "pm_score": 0, "selected": false, "text": "<p>Are you sure the gem command is actually the one installed by MacPorts and not the included default from OSX?</p>\n" }...
2009/02/14
[ "https://Stackoverflow.com/questions/549770", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51387/" ]
since I updated ruby using Mac Ports (on Leopard) I have got several problems and I also had to reinstall gems. Now when I run Mongrel I keep getting the error "Missing these required gems" followed by the list of gems that I required in environment.rb but that gems seems to be correctly installed as I see running `gem...
Try this at the Terminal, and see whether the paths are similar: ``` which ruby which gem ``` I had a similar problem just the other week, and had to rename the original gem binary so it would find the MacPorts-installed one.
549,799
<p>I have like 20 or so tables in the database RentalEase and I want to print them out (physically) so I can look at them easier. I don't care too much about what data is in them, just their structure. How can I do this?</p> <p>It's an SQL Express server and I'm using Microsoft SQL Server Management Studio Express to ...
[ { "answer_id": 549811, "author": "Robin", "author_id": 60234, "author_profile": "https://Stackoverflow.com/users/60234", "pm_score": 6, "selected": true, "text": "<p>try: </p>\n\n<pre><code>sp_help &lt;table_name&gt;\n</code></pre>\n" }, { "answer_id": 549815, "author": "Alex...
2009/02/14
[ "https://Stackoverflow.com/questions/549799", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12243/" ]
I have like 20 or so tables in the database RentalEase and I want to print them out (physically) so I can look at them easier. I don't care too much about what data is in them, just their structure. How can I do this? It's an SQL Express server and I'm using Microsoft SQL Server Management Studio Express to manage it....
try: ``` sp_help <table_name> ```
549,808
<p>I want to be able to have LinkedList.contains() return true for a custom comparator.</p> <p>Suppose that I have 1 LinkedList and 2 objects</p> <pre><code>LinkedList&lt;MyObject&gt; myList = new LinkedList&lt;MyObject&gt;(); MyObject a = new MyObject("HELLO"); MyObject b = new MyObject("HELLO"); </code></pre> <p>...
[ { "answer_id": 549816, "author": "Brett Daniel", "author_id": 48495, "author_profile": "https://Stackoverflow.com/users/48495", "pm_score": 6, "selected": true, "text": "<p>LinkedList uses the equals method, not Comparable.compareTo. You should <a href=\"http://www.ibm.com/developerwork...
2009/02/14
[ "https://Stackoverflow.com/questions/549808", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6367/" ]
I want to be able to have LinkedList.contains() return true for a custom comparator. Suppose that I have 1 LinkedList and 2 objects ``` LinkedList<MyObject> myList = new LinkedList<MyObject>(); MyObject a = new MyObject("HELLO"); MyObject b = new MyObject("HELLO"); ``` Technicaly, both objects are identical in ter...
LinkedList uses the equals method, not Comparable.compareTo. You should [override equals (and hashCode)](http://www.ibm.com/developerworks/java/library/j-jtp05273.html) in MyObject to solve the problem.
549,828
<p>I'm displaying links that get marked as read in a database when a user clicks them. I want to style the clicked and unclicked links based on the database information not the user's browser history. So far, when I use:</p> <pre><code> 10 a:visited { 11 color: #444; 12 } 13 14 a:link { 15 font-weight: bold; ...
[ { "answer_id": 549830, "author": "Ash", "author_id": 5023, "author_profile": "https://Stackoverflow.com/users/5023", "pm_score": 5, "selected": false, "text": "<p>You can use the !important directive. eg.</p>\n\n<pre><code>.myClass\n{\n color:red !important;\n background-color:white...
2009/02/14
[ "https://Stackoverflow.com/questions/549828", "https://Stackoverflow.com", "https://Stackoverflow.com/users/62701/" ]
I'm displaying links that get marked as read in a database when a user clicks them. I want to style the clicked and unclicked links based on the database information not the user's browser history. So far, when I use: ``` 10 a:visited { 11 color: #444; 12 } 13 14 a:link { 15 font-weight: bold; 16 color:bl...
First of all, if you don't want the browsers own history to interfere with your styles then use the :visited pseudo-class to match the style of the non-visited link, then just apply classes manually based on your DB records. Regarding conflicting styles, it's all about the [specificity](http://css-tricks.com/specifics...
549,849
<p>I have the following class hierarchy in C++:</p> <pre><code>class Base { virtual void apply() = 0; }; class Derived : public Base { virtual void apply() { // implementation here that uses derived_specialty } virtual void derived_specialty() = 0; }; class Implementation : public Derived {...
[ { "answer_id": 549857, "author": "ChrisW", "author_id": 49942, "author_profile": "https://Stackoverflow.com/users/49942", "pm_score": 4, "selected": true, "text": "<p>You can kind of do it by composition:</p>\n\n<pre><code>class Base {\n virtual void apply();\n};\n\nclass Derived : pu...
2009/02/14
[ "https://Stackoverflow.com/questions/549849", "https://Stackoverflow.com", "https://Stackoverflow.com/users/57458/" ]
I have the following class hierarchy in C++: ``` class Base { virtual void apply() = 0; }; class Derived : public Base { virtual void apply() { // implementation here that uses derived_specialty } virtual void derived_specialty() = 0; }; class Implementation : public Derived { virtual...
You can kind of do it by composition: ``` class Base { virtual void apply(); }; class Derived : public Base { class IImplementation { virtual void derived_specialty() = 0; }; IImplementation& m_implementation; Derived(IImplementation& implementation) : m_implementation(implement...
549,865
<p>For some reason the login to my site has to be done two times in order to work. If anyone has any idea why I appreciate it.</p> <p>Here is the code I have for the authorization:</p> <pre><code>&lt;?php session_start(); require_once($_SERVER['DOCUMENT_ROOT'].'/config.php'); require_once(SITE_ROOT.'includes/exceptio...
[ { "answer_id": 549877, "author": "marktucks", "author_id": 62831, "author_profile": "https://Stackoverflow.com/users/62831", "pm_score": 3, "selected": true, "text": "<p>I'd listen to @strager as your code, from my limited PHP exerience, doesn't seem to show anything that would cause the...
2009/02/14
[ "https://Stackoverflow.com/questions/549865", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2170954/" ]
For some reason the login to my site has to be done two times in order to work. If anyone has any idea why I appreciate it. Here is the code I have for the authorization: ``` <?php session_start(); require_once($_SERVER['DOCUMENT_ROOT'].'/config.php'); require_once(SITE_ROOT.'includes/exceptions.php'); require_once(S...
I'd listen to @strager as your code, from my limited PHP exerience, doesn't seem to show anything that would cause the error. Although I can't help but offer some simple refactorings unrelated to your question but it would just make *me* feel better: ``` <?php session_start(); require_once($_SERVER['DOCUMENT_R...
549,894
<p>Does anyone know of a parser that can take Wiki formatted text as input and produce a tree of entities, in the same way that an XML parser produces an entity tree? To clarify, I'm looking for something that would take text like:</p> <pre><code> -Intro- Textual stuff in ''italics'' --Subhead-- Yet more text </cod...
[ { "answer_id": 550275, "author": "Charlie Martin", "author_id": 35092, "author_profile": "https://Stackoverflow.com/users/35092", "pm_score": 2, "selected": false, "text": "<p>You can't do it directly from a wiki-formatted page because the wiki format doesn't have complete information. ...
2009/02/14
[ "https://Stackoverflow.com/questions/549894", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Does anyone know of a parser that can take Wiki formatted text as input and produce a tree of entities, in the same way that an XML parser produces an entity tree? To clarify, I'm looking for something that would take text like: ``` -Intro- Textual stuff in ''italics'' --Subhead-- Yet more text ``` and produce a...
You can't do it directly from a wiki-formatted page because the wiki format doesn't have complete information. Instead, the wiki format text is translated basically by a bunch of regular-expression rules and inserted into a predefined page framework in HTML or XHTML. The easiest way to do what you want is to find an a...
549,907
<p>(can you tell I'm learning Ruby today? :))</p> <p>I want to determine if the multidimensional array I'm working with is a 'rectangle'--i.e., the rows are the same size. Here's what I'm doing, which works but feels clunky.</p> <pre><code>if @myArray[0].size != @myArray[0..@myArray.size].size raise "This array is ...
[ { "answer_id": 549937, "author": "vladr", "author_id": 66516, "author_profile": "https://Stackoverflow.com/users/66516", "pm_score": 3, "selected": true, "text": "<p>Try:</p>\n\n<pre><code>raise 'This array is not a rectangle' \\\n if myArray[1..-1].any? { |row| row.size != myArray[0].s...
2009/02/14
[ "https://Stackoverflow.com/questions/549907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/66348/" ]
(can you tell I'm learning Ruby today? :)) I want to determine if the multidimensional array I'm working with is a 'rectangle'--i.e., the rows are the same size. Here's what I'm doing, which works but feels clunky. ``` if @myArray[0].size != @myArray[0..@myArray.size].size raise "This array is not a rectangle." end...
Try: ``` raise 'This array is not a rectangle' \ if myArray[1..-1].any? { |row| row.size != myArray[0].size } ``` See <http://www.ruby-doc.org/core/classes/Array.html> (the [] operator) and <http://www.ruby-doc.org/core/classes/Enumerable.html> (the any? method)
549,920
<p>I am looking into using Git on a massive scale. I was hoping to increase adoption and make things easier by calling the <code>master</code> branch <code>trunk</code>.</p> <p>This can and will give SVN users some feelings of comfort. I know I can create a branch called <code>trunk</code>, but that seems to deviate ...
[ { "answer_id": 549925, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 4, "selected": false, "text": "<p>There is nothing special about the name \"master\" in Git, it's just called that by convention (and by default). You c...
2009/02/14
[ "https://Stackoverflow.com/questions/549920", "https://Stackoverflow.com", "https://Stackoverflow.com/users/66519/" ]
I am looking into using Git on a massive scale. I was hoping to increase adoption and make things easier by calling the `master` branch `trunk`. This can and will give SVN users some feelings of comfort. I know I can create a branch called `trunk`, but that seems to deviate from the Git norms and might cause some user...
You can rename the master branch trunk as Greg has suggested, or you can also create a trunk that is a symbolic reference to the master branch so that both git and svn users have the 'main' branch that they are used to. ``` git symbolic-ref refs/heads/trunk refs/heads/master ``` Note that trunk isn't a first class c...
549,961
<p>I am having trouble when removing an item from a list. The list is defined in a superclass, but the Hibernate annotations are applied to property accessors in a subclass. There are two methods in the superclass that manipulate the list. The "add" method works fine, but the "remove" does not persist changes. I have c...
[ { "answer_id": 549973, "author": "cliff.meyers", "author_id": 41754, "author_profile": "https://Stackoverflow.com/users/41754", "pm_score": 1, "selected": false, "text": "<p>Try removing the calls to Session.refresh(). From the docs:</p>\n\n<blockquote>\n <p>Re-read the state of the giv...
2009/02/14
[ "https://Stackoverflow.com/questions/549961", "https://Stackoverflow.com", "https://Stackoverflow.com/users/63308/" ]
I am having trouble when removing an item from a list. The list is defined in a superclass, but the Hibernate annotations are applied to property accessors in a subclass. There are two methods in the superclass that manipulate the list. The "add" method works fine, but the "remove" does not persist changes. I have chec...
You have to explicitly specify cascade as CascadeType.DELETE\_ORPHAN. Try to change code to ``` @OneToMany @Cascade(cascade = {CascadeType.ALL, CascadeType.DELETE_ORPHAN}, mappedBy = "temporal") ``` Part from hibernate [docs](http://www.hibernate.org/hib_docs/entitymanager/reference/en/html/objectstate.html): ...
549,962
<p>What conventions are people here following for naming of instance variables and method arguments - particularly when method arguments are used to set ivars (instance variables)?</p> <p>In C++ I used to use the <code>m_</code> prefix for ivars a lot. In C# I followed the convention of disambiguating purely by use of...
[ { "answer_id": 549997, "author": "wfarr", "author_id": 2286, "author_profile": "https://Stackoverflow.com/users/2286", "pm_score": 1, "selected": false, "text": "<p>Here's how <a href=\"http://developer.apple.com/documentation/Cocoa/Conceptual/CodingGuidelines/Articles/NamingIvarsAndType...
2009/02/14
[ "https://Stackoverflow.com/questions/549962", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32136/" ]
What conventions are people here following for naming of instance variables and method arguments - particularly when method arguments are used to set ivars (instance variables)? In C++ I used to use the `m_` prefix for ivars a lot. In C# I followed the convention of disambiguating purely by use of `this.` for ivars. I...
As you've noted, the Cocoa style is to use method argument names like `theValue` if the argument name will conflict with an instance variable. There shouldn't be many times that this comes up in Objective-C 2.0 style code, however. The assumption is that you shouldn't (usually) be accessing instance variables directly....
549,965
<p>I'm concerned that the web hosting that I'm paying for is not configured correctly. ASP.NET Web Sites which compile and run correctly on my local machine don't work once they're deployed.</p> <p>The issue I'm dealing with is a compilation error: CS0246, "Type or namespace could not be found (Are you missing a 'usi...
[ { "answer_id": 549975, "author": "Torbjørn", "author_id": 22621, "author_profile": "https://Stackoverflow.com/users/22621", "pm_score": 0, "selected": false, "text": "<p>If you build your site locally and upload the resulting dll (that will contain HelloClass) to the bin directory, I bet...
2009/02/14
[ "https://Stackoverflow.com/questions/549965", "https://Stackoverflow.com", "https://Stackoverflow.com/users/56998/" ]
I'm concerned that the web hosting that I'm paying for is not configured correctly. ASP.NET Web Sites which compile and run correctly on my local machine don't work once they're deployed. The issue I'm dealing with is a compilation error: CS0246, "Type or namespace could not be found (Are you missing a 'using' directi...
I'd like to thank everyone for their support. It's most appreciated. I've been in contact with a specialist at my web hosting company and they've advised me that this isn't a code or server configuration error, but just a missed step in my control panel. Setting my website working directory as a virtual dir resolved th...
549,974
<p>I am writing a webapplication which will have widgets like iGoogle does (but with different information ;)). Since there will be different colomns I would love to hear your ideas on how to call the modules in the code. I want to define in the database what widgets are enabled and in what column they are and in what ...
[ { "answer_id": 550082, "author": "SchizoDuckie", "author_id": 18077, "author_profile": "https://Stackoverflow.com/users/18077", "pm_score": 0, "selected": false, "text": "<p>What kind of confirmation are you looking for from us? If it's your system, your widgets, then just run them the w...
2009/02/14
[ "https://Stackoverflow.com/questions/549974", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19929/" ]
I am writing a webapplication which will have widgets like iGoogle does (but with different information ;)). Since there will be different colomns I would love to hear your ideas on how to call the modules in the code. I want to define in the database what widgets are enabled and in what column they are and in what ord...
Your approach sounds reasonable: insist on a well-defined interface for each widget, and then invoke that method (or those methods) for each registered widget. Some things to keep in mind: * abstraction: do the widgets know where they are on the page, or how big their window is? * security: are the widgets written by ...
549,985
<p>I'm currently trying to DRY up this initial verbose code:</p> <pre><code>def planting_dates_not_nil? !plant_out_week_min.blank? || !plant_out_week_max.blank? || !sow_out_week_min.blank? || !sow_out_week_max.blank? end def needs_planting?(week) if !plant_out_week_min.blank? &amp;&amp; !plant_out_week_ma...
[ { "answer_id": 550012, "author": "Alex Wayne", "author_id": 62076, "author_profile": "https://Stackoverflow.com/users/62076", "pm_score": 2, "selected": true, "text": "<p>Your method is returning the result of <code>task_names.each</code>. <code>each</code> always returns what it starte...
2009/02/14
[ "https://Stackoverflow.com/questions/549985", "https://Stackoverflow.com", "https://Stackoverflow.com/users/52092/" ]
I'm currently trying to DRY up this initial verbose code: ``` def planting_dates_not_nil? !plant_out_week_min.blank? || !plant_out_week_max.blank? || !sow_out_week_min.blank? || !sow_out_week_max.blank? end def needs_planting?(week) if !plant_out_week_min.blank? && !plant_out_week_max.blank? (plant_...
Your method is returning the result of `task_names.each`. `each` always returns what it started with. So you need to actually return your result. Also, you are recreating you `to_do_this_week` array on every iteration of the loop, which would wipe it clean. ``` def tasks_for_week(week, *task_names) to_do_this_week ...
549,987
<p>I have a form that is accepting URLs from users in PHP.</p> <p>What characters should I allow or disallow? Currently I use</p> <p>$input= preg_replace("/[^a-zA-Z0-9-\?:#.()\,/\&amp;\'\\"]/", "", $string);</p> <p>$input=substr($input,0,255);</p> <p>So, it's trimmed to 255 chars and only can include letters, numbe...
[ { "answer_id": 550008, "author": "vishvananda", "author_id": 64381, "author_profile": "https://Stackoverflow.com/users/64381", "pm_score": 2, "selected": false, "text": "<p>You need to allow = sign and % for things like %20. Also the @ sign is legal</p>\n\n<p>You can validate the url wi...
2009/02/14
[ "https://Stackoverflow.com/questions/549987", "https://Stackoverflow.com", "https://Stackoverflow.com/users/92448/" ]
I have a form that is accepting URLs from users in PHP. What characters should I allow or disallow? Currently I use $input= preg\_replace("/[^a-zA-Z0-9-\?:#.()\,/\&\'\\"]/", "", $string); $input=substr($input,0,255); So, it's trimmed to 255 chars and only can include letters, numbers, and ? - \_ : # ( ) , & ' " / ...
[RFC 1738](http://www.ietf.org/rfc/rfc1738.txt) which defines the URL specification states that only the characters ``` abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+.- ``` may be used within a URL scheme, and only the characters ``` abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789$-_...
550,009
<p>I'm trying to extract email addresses from plain text transcripts of emails. I've cobbled together a bit of code to find the addresses themselves, but I don't know how to make it discriminate between them; right now it just spits out all email addresses in the file. I'd like to make it so it only spits out addresse...
[ { "answer_id": 550018, "author": "Albert Visser", "author_id": 46043, "author_profile": "https://Stackoverflow.com/users/46043", "pm_score": 0, "selected": false, "text": "<p>if you can be reasonably sure that lines containing these email addresses start with whitespace followed by \"Fro...
2009/02/14
[ "https://Stackoverflow.com/questions/550009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I'm trying to extract email addresses from plain text transcripts of emails. I've cobbled together a bit of code to find the addresses themselves, but I don't know how to make it discriminate between them; right now it just spits out all email addresses in the file. I'd like to make it so it only spits out addresses th...
If your goal is actually to extract email addresses from text, you should use a library built for that purpose. Regular expressions are not well suited to match arbitrary email addresses. But if you're doing this as an exercise to understand regular expressions better, I'd take the approach of expanding the expression...
550,024
<p>I am using Tomcat to compress my HTML content like this:</p> <pre><code>&lt;Connector port="8080" maxHttpHeaderSize="8192" maxProcessors="150" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="8443" acceptCount="150" connectionTimeout="20000" disableUploadTimeout="true" ...
[ { "answer_id": 551437, "author": "Neil McKeown", "author_id": 54556, "author_profile": "https://Stackoverflow.com/users/54556", "pm_score": 2, "selected": false, "text": "<p>Perhaps the compression Tomcat is referring to isn't gzip? It's a stab in the dark, but it might relate to white-s...
2009/02/15
[ "https://Stackoverflow.com/questions/550024", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32174/" ]
I am using Tomcat to compress my HTML content like this: ``` <Connector port="8080" maxHttpHeaderSize="8192" maxProcessors="150" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="8443" acceptCount="150" connectionTimeout="20000" disableUploadTimeout="true" compression="on" ...
Have a look at [<http://sourceforge.net/projects/pjl-comp-filter/>](http://sourceforge.net/projects/pjl-comp-filter/). Other custom solutions may have memory leaks. Also, if you are using mod\_jk then you are certainly not using the 8080 connector (which supports compression) for those requests.
550,026
<p>I think I'm missing something simple, but I can't figure out exactly what it is.</p> <p>I'm trying to set up an App with a <code>UITabViewController</code>, and one of the Tabs will have a UITableView and UISearchBar (but no Navigation Controller). I set up the <code>UITabViewController</code> with all the tabs in...
[ { "answer_id": 550031, "author": "Himadri Choudhury", "author_id": 66344, "author_profile": "https://Stackoverflow.com/users/66344", "pm_score": 1, "selected": false, "text": "<p>If you can't assign the DataSource without it crashing, then that suggests that some of the the DataSource de...
2009/02/15
[ "https://Stackoverflow.com/questions/550026", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I think I'm missing something simple, but I can't figure out exactly what it is. I'm trying to set up an App with a `UITabViewController`, and one of the Tabs will have a UITableView and UISearchBar (but no Navigation Controller). I set up the `UITabViewController` with all the tabs in interface builder, and the views...
I had a similiar Issue with the same error message. The simple solution was to click at the View in the TabBarController (The grey rectangle which says "view loaded from..") in IB and change the class of the element to the classname of my TableViewController.
550,032
<pre><code> File "C:\Python25\lib\SocketServer.py", line 330, in __init__ self.server_bind() File "C:\Python25\lib\BaseHTTPServer.py", line 101, in server_bind SocketServer.TCPServer.server_bind(self) File "C:\Python25\lib\SocketServer.py", line 341, in server_bind self.socket.bind(self.server_address)...
[ { "answer_id": 550034, "author": "TomHastjarjanto", "author_id": 53170, "author_profile": "https://Stackoverflow.com/users/53170", "pm_score": 6, "selected": true, "text": "<p>It might be possible that you are trying to run on a port the current user account does not have permission to b...
2009/02/15
[ "https://Stackoverflow.com/questions/550032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
``` File "C:\Python25\lib\SocketServer.py", line 330, in __init__ self.server_bind() File "C:\Python25\lib\BaseHTTPServer.py", line 101, in server_bind SocketServer.TCPServer.server_bind(self) File "C:\Python25\lib\SocketServer.py", line 341, in server_bind self.socket.bind(self.server_address) File...
It might be possible that you are trying to run on a port the current user account does not have permission to bind to. This could be port 80 or something. Try increasing the portnumber or use a user with sufficient privileges. Hope this helps
550,035
<p><strong>Question:</strong></p> <ul> <li><p>What is the <strong>difference</strong> between:</p> <ul> <li><code>vector&lt;string&gt;</code> and <code>vector&lt;char *&gt;</code>?</li> </ul></li> <li><p>How would I pass a value of data type: <code>string</code> to a function, that specifically accepts:</p> <ul> <li...
[ { "answer_id": 550042, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": "<pre><code>foo(i-&gt;c_str());\n</code></pre>\n" }, { "answer_id": 550045, "author": "Community", "author_id":...
2009/02/15
[ "https://Stackoverflow.com/questions/550035", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51078/" ]
**Question:** * What is the **difference** between: + `vector<string>` and `vector<char *>`? * How would I pass a value of data type: `string` to a function, that specifically accepts: + `const char *`? For **instance**: ``` vector<string> args(argv, argv + argc); vector<string>::iterator i; void foo (const...
This really has nothing to do with vectors specifically. A `char*` is a pointer, which may or may not point to valid string data. A [`std::string`](http://en.cppreference.com/w/cpp/string/basic_string) is a string class, encapsulating all the required data that makes up a string, along with allocation and deallocatio...
550,038
<p>I have the following element:</p> <pre><code>&lt;script type="text/javascript" src="https://cdn.example.com/js_file.js"&gt;&lt;/script&gt; </code></pre> <p>In this case the site is HTTPS, but the site may also be just HTTP. (The JS file is on another domain.) I'm wondering if it's valid to do the following for con...
[ { "answer_id": 550073, "author": "Jeff", "author_id": 54742, "author_profile": "https://Stackoverflow.com/users/54742", "pm_score": 10, "selected": true, "text": "<p>A relative URL without a scheme (http: or https:) is valid, per <a href=\"http://www.ietf.org/rfc/rfc3986.txt\" rel=\"nore...
2009/02/15
[ "https://Stackoverflow.com/questions/550038", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5441/" ]
I have the following element: ``` <script type="text/javascript" src="https://cdn.example.com/js_file.js"></script> ``` In this case the site is HTTPS, but the site may also be just HTTP. (The JS file is on another domain.) I'm wondering if it's valid to do the following for convenience sake: ``` <script type="text...
A relative URL without a scheme (http: or https:) is valid, per [RFC 3986: "Uniform Resource Identifier (URI): Generic Syntax", Section 4.2](http://www.ietf.org/rfc/rfc3986.txt). If a client chokes on it, then it's the client's fault because they're not complying with the URI syntax specified in the RFC. Your example ...
550,050
<p>How to remove tkinter icon from title bar in it's window</p>
[ { "answer_id": 550071, "author": "John T", "author_id": 36457, "author_profile": "https://Stackoverflow.com/users/36457", "pm_score": 2, "selected": false, "text": "<p>As far as I know, the closest you will get to a \"blank\" icon is using one that's the same color as the window title ba...
2009/02/15
[ "https://Stackoverflow.com/questions/550050", "https://Stackoverflow.com", "https://Stackoverflow.com/users/49701/" ]
How to remove tkinter icon from title bar in it's window
### On Windows **Step One:** Create a transparent icon using either an icon editor, or a site like [rw-designer](http://www.rw-designer.com/online_icon_maker.php). Save it as `transparent.ico`. **Step Two:** ``` from tkinter import * tk = Tk() tk.iconbitmap(default='transparent.ico') lab = Label(tk, text='Window w...
550,072
<p>I am writing an client application in C# which will be supposed to change ConnectionString settings in a web.config file from another application I wrote. How can I achieve this goal?</p> <p>Is there a way to load the web.config file in my application and read/change its data object orientated? Or do I need to pars...
[ { "answer_id": 550090, "author": "Christian C. Salvadó", "author_id": 5445, "author_profile": "https://Stackoverflow.com/users/5445", "pm_score": 3, "selected": true, "text": "<p>If you're doing this from another application, you can use the <a href=\"http://msdn.microsoft.com/en-us/libr...
2009/02/15
[ "https://Stackoverflow.com/questions/550072", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25428/" ]
I am writing an client application in C# which will be supposed to change ConnectionString settings in a web.config file from another application I wrote. How can I achieve this goal? Is there a way to load the web.config file in my application and read/change its data object orientated? Or do I need to parse it as if...
If you're doing this from another application, you can use the [VirtualDirectoryMapping](http://msdn.microsoft.com/en-us/library/system.web.configuration.virtualdirectorymapping.aspx) class: ``` VirtualDirectoryMapping vdm = new VirtualDirectoryMapping(@"C:\Inetpub\wwwroot\YourApplication", true); WebConfigurationFile...
550,079
<p>I am attempting to read from main memory using masm32 assembly and in order to do this I created (as previously recommended in an answer to another of my questions here) an array that will contain the greatly separated memory locations (in order to avoid reading from cache). I have managed to create the array and h...
[ { "answer_id": 550090, "author": "Christian C. Salvadó", "author_id": 5445, "author_profile": "https://Stackoverflow.com/users/5445", "pm_score": 3, "selected": true, "text": "<p>If you're doing this from another application, you can use the <a href=\"http://msdn.microsoft.com/en-us/libr...
2009/02/15
[ "https://Stackoverflow.com/questions/550079", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28586/" ]
I am attempting to read from main memory using masm32 assembly and in order to do this I created (as previously recommended in an answer to another of my questions here) an array that will contain the greatly separated memory locations (in order to avoid reading from cache). I have managed to create the array and have...
If you're doing this from another application, you can use the [VirtualDirectoryMapping](http://msdn.microsoft.com/en-us/library/system.web.configuration.virtualdirectorymapping.aspx) class: ``` VirtualDirectoryMapping vdm = new VirtualDirectoryMapping(@"C:\Inetpub\wwwroot\YourApplication", true); WebConfigurationFile...
550,086
<p>I install Wordpress many times and have to delete the hello world post manually after each install. This is daunting !</p> <p>How can I prevent this post to appear. Same question for blogroll links.</p> <p>Thanks.w</p>
[ { "answer_id": 550097, "author": "Mark Hurd", "author_id": 65714, "author_profile": "https://Stackoverflow.com/users/65714", "pm_score": 2, "selected": false, "text": "<p>In version 2.7.1, these items are created in wp_install_defaults() of /wp-admin/includes/upgrade.php.</p>\n\n<p>It do...
2009/02/15
[ "https://Stackoverflow.com/questions/550086", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I install Wordpress many times and have to delete the hello world post manually after each install. This is daunting ! How can I prevent this post to appear. Same question for blogroll links. Thanks.w
In the `wp-content` folder, define a file called `install.php`, and in that put a `wp_install_default` function. Since a default category of some kind is assumed, it's a good idea to create a least one category (code example derived from `/wp-admin/includes/upgrade.php`): ``` <?php function wp_install_defaults() { ...
550,098
<p>So, this is problem a stupid mistake, but I've been hacking away at it for about an hour and can't seem to solve it.</p> <p>I have a class main.cpp which is full of random GUI crap (not really relevant to my problem I believe) but in one of my methods I make a reference to another one of my classes "TiffSpec"</p> ...
[ { "answer_id": 550103, "author": "strager", "author_id": 39992, "author_profile": "https://Stackoverflow.com/users/39992", "pm_score": 2, "selected": false, "text": "<p>Make sure you are linking <code>TiffSpec.cpp</code> into your project. How to do this depends on your development envi...
2009/02/15
[ "https://Stackoverflow.com/questions/550098", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39189/" ]
So, this is problem a stupid mistake, but I've been hacking away at it for about an hour and can't seem to solve it. I have a class main.cpp which is full of random GUI crap (not really relevant to my problem I believe) but in one of my methods I make a reference to another one of my classes "TiffSpec" TiffSpec is a ...
It's the `CLI_OBJECTS` line that seems to list the object files. Add TiffSpec.o: ``` CLI_OBJECTS=main.o TiffSpec.o ``` --- The linking command comes from this rule in the makefile: ``` main: $(CLI_OBJECTS) $(LINK) $(CLI_OBJECTS) $(LDADD) $(LIBS) ``` This says that `main` should be built from the files listed ...