Id
int64 1.68k
75.6M
| PostTypeId
int64 1
2
| AcceptedAnswerId
int64 1.7k
75.6M
⌀ | ParentId
int64 1.68k
75.6M
⌀ | Score
int64 -60
3.16k
| ViewCount
int64 8
2.68M
⌀ | Body
stringlengths 1
41.1k
| Title
stringlengths 14
150
⌀ | ContentLicense
stringclasses 3
values | FavoriteCount
int64 0
1
⌀ | CreationDate
stringlengths 23
23
| LastActivityDate
stringlengths 23
23
| LastEditDate
stringlengths 23
23
⌀ | LastEditorUserId
int64 -1
21.3M
⌀ | OwnerUserId
int64 1
21.3M
⌀ | Tags
list |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4,355,292 | 1 | 4,355,712 | null | 1 | 162 | I'm trying to write a "hello world" for iPhone 4. As this is my first attempt at iPhone app development, and my first experience with Objective C, please feel free to assume you need to teach me how to suck eggs on this one.
As my foundation, I started with the [http://appsamuck.com/day1.html](http://appsamuck.com/day1.html) tutorial - but it's so far out of date I'm not going to get anywhere unless I de-construct the steps.
At this point I'm looking at the part where he tells you how to add a label to the display add the reference to the label.
Unfortunately it just doesn't seem to be fitting together properly.
Essentially, what I'd like the simulator to do when I run the "Built and Run" button is for the "MyLabel" to change to read "HERE"
When this all runs, there are no errors, but cdLabel.text is not changing to read "HERE".
I've got a photo of the basic GUI setup - and can post any other information needed.
the `ViewController.h` reads:
```
@interface MinutesToMidnightViewController : UIViewController {
IBOutlet UILabel *cdLabel;
}
-(void)updateLabel;
```
the `ViewController.m` has the following function in it:
```
-(void)updateLabel {
cdLabel.text = [NSString: "HERE"];
}
```
Finally - there's a photo of how I've set up the GUI bits in the interface designer:

If there's anyone who can connect the dot on this last bit I'd be so very grateful! (Also directions to IOS4 beginner's tutorials or open source APPS would be highly valued :)
Thanks!
- A
In response to the question of when do I call `updateLabel`
I have the function
```
- (void)applicationDidFinishLaunching:(UIApplication *)application {
[viewController updateLabel];
}
```
built into my `MinutesToMidnightAppDelegate.m` file
| Adding and changing labels on the iPhone? (IOS4+) | CC BY-SA 2.5 | null | 2010-12-04T19:10:16.290 | 2014-05-13T04:13:33.520 | 2014-05-13T04:13:33.520 | 2,682,142 | 398,055 | [
"iphone",
"ios4",
"interface-builder",
"uilabel"
] |
4,355,397 | 1 | 6,733,106 | null | 4 | 616 | I have been experiencing strange behavior with the header drawing the first time. Here are the steps I go through and it is reproducible every time.
- - -
}
```
-(void)controllerWillChangeContent:(NSFetchedResultsController*)controller {
[self.setsTableView beginUpdates];
}
-(void)controllerDidChangeContent:(NSFetchedResultsController*)controller {
[self.setsTableView endUpdates];
}
```
-
As soon as I move the TableView scroll up or down, the problem immediately resolves itself. Also, if I quit the app and go back in, the header is displayed correctly.
I have drawn a red box around the problem area.
Anyone ever see this behavior before?

Notice the difference in how the header is displayed below. This is how it SHOULD look from the start. All I do between screenshot 1 (above) and screenshot 2 (below) is scroll the UITableView.

| UITableView header not displaying correctly after update to underlying data | CC BY-SA 2.5 | null | 2010-12-04T19:32:25.507 | 2014-02-18T09:41:27.017 | 2010-12-04T19:57:42.970 | 399,076 | 399,076 | [
"iphone",
"cocoa-touch",
"uitableview"
] |
4,355,459 | 1 | 4,448,151 | null | 0 | 2,361 | I have a Telerik grid in my asp.net mvc application that looks something like:

Now it lists all the regions in a zone selected from the list placed just above the grid. zoneid is foreign key in the grid. Now I want that when I add new region in the grid the zoneID should be taken from the list instead of what is present in zone column of the grid because that value is just to display the zone and that can also be removed from the grid as it as apparent from the list which zone the listed regions belong to.
I understand that I could have used editor templates to show this list inside the grid on edit but I prefer it to be outside the grid and provide some filtering on basis of the zone as we are likely to have many regions per zone. so my concern here, now, is how can I set ZoneID of a region (edited or newly added) equal to selected value of list that shows just above the grid control.
| Sending custom values on save and update using Telerik Grid | CC BY-SA 4.0 | 0 | 2010-12-04T19:46:05.777 | 2018-05-05T17:23:28.620 | 2018-05-02T22:44:12.947 | 472,495 | 331,174 | [
"asp.net-mvc",
"asp.net-mvc-2",
"telerik",
"telerik-mvc"
] |
4,355,449 | 1 | 4,355,466 | null | 0 | 630 | I am getting when I add this line:
```
locMan = [[CLLocationManager alloc] init];
```
To the `viewDidLoad` method inside of my .m file I get some errors that I have never seen before. Here are the errors:

I cannot for the life of me figure out why adding that line is causing problems. If anyone can shed some light I would be very grateful.
I have this header file:
```
#import <UIKit/UIKit.h>
#import "CoreLocation/CoreLocation.h"
@interface RobotWarsViewController : UIViewController
<CLLocationManagerDelegate> {
CLLocationManager *locMan;
// Current Location View
IBOutlet UIView *currentLocationView;
IBOutlet UILabel *currentLocationLabel;
}
@property (assign, nonatomic) UIView *currentLocationView;
@property (assign, nonatomic) UILabel *currentLocationLabel;
@property (assign, nonatomic) CLLocationManager *locMan;
- (IBAction)dropEMP:(id)sender;
- (IBAction)armEMP:(id)sender;
@end
```
And this .m file:
```
#import "RobotWarsViewController.h"
@implementation RobotWarsViewController
@synthesize locMan;
@synthesize currentLocationView;
@synthesize currentLocationLabel;
- (void)viewDidLoad {
[super viewDidLoad];
locMan = [[CLLocationManager alloc] init];
// locMan.delegate = self;
}
- (IBAction)dropEMP:(id)sender{
NSLog(@"Boo");
}
- (IBAction)armEMP:(id)sender{
NSLog(@"boo");
}
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation {
NSLog(@"location update");
}
- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
- (void)viewDidUnload {
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (void)dealloc {
[super dealloc];
[currentLocationView release];
[currentLocationLabel release];
}
@end
```
| Objective C: strange error when init a variable declared in my header file | CC BY-SA 2.5 | null | 2010-12-04T19:45:00.253 | 2010-12-04T20:04:50.860 | null | null | 251,589 | [
"iphone",
"objective-c",
"compiler-errors"
] |
4,355,525 | 1 | 4,356,080 | null | 6 | 14,414 | I am trying to write a blur shader for the iPad. I have it working but I am not very happy with the results. I get very choppy frame rates and the blur looks like crap when blur amount is high.
Any ideas on how to improve things?
Some sample output:

```
uniform sampler2D texture;
varying mediump vec2 fragTexCoord;
varying mediump vec3 eyespaceNormal;
varying highp float blurAmount;
void main(void)
{
highp vec2 gaussFilter[7];
gaussFilter[0] = vec2(-3.0, 0.015625);
gaussFilter[1] = vec2(-2.0, 0.09375);
gaussFilter[2] = vec2(-1.0, 0.234375);
gaussFilter[3] = vec2(0.0, 0.3125);
gaussFilter[4] = vec2(1.0, 0.234375);
gaussFilter[5] = vec2(2.0, 0.09375);
gaussFilter[6] = vec2(3.0, 0.015625);
highp float blurSize = blurAmount * 1.0;
/////////////////////////////////////////////////
// 7x1 gaussian blur fragment shader
/////////////////////////////////////////////////
highp vec4 color = vec4(0,0,0,1);
for( int i = 0; i < 7; i++ )
{
color += texture2D( texture, vec2( fragTexCoord.x+gaussFilter[i].x*blurSize, fragTexCoord.y+gaussFilter[i].x*blurSize ) )*gaussFilter[i].y;
}
gl_FragColor = color;
}
```
Edit:
A box blur may be the way to go.
Here is a box blur version of the shader:
```
highp vec4 color = vec4(0,0,0,1);
color += texture2D(texture, vec2(fragTexCoord.x, fragTexCoord.y - 4.0*blurAmount)) * 0.05;
color += texture2D(texture, vec2(fragTexCoord.x, fragTexCoord.y - 3.0*blurAmount)) * 0.09;
color += texture2D(texture, vec2(fragTexCoord.x, fragTexCoord.y - 2.0*blurAmount)) * 0.12;
color += texture2D(texture, vec2(fragTexCoord.x, fragTexCoord.y - blurAmount)) * 0.15;
color += texture2D(texture, vec2(fragTexCoord.x, fragTexCoord.y)) * 0.16;
color += texture2D(texture, vec2(fragTexCoord.x, fragTexCoord.y + blurAmount)) * 0.15;
color += texture2D(texture, vec2(fragTexCoord.x, fragTexCoord.y + 2.0*blurAmount)) * 0.12;
color += texture2D(texture, vec2(fragTexCoord.x, fragTexCoord.y + 3.0*blurAmount)) * 0.09;
color += texture2D(texture, vec2(fragTexCoord.x, fragTexCoord.y + 4.0*blurAmount)) * 0.05;
gl_FragColor = color;
```
Here is the box blur output(note it's only a horizontal blur, but it might be enough for what i want) :

| OpenGL ES 2.0 fragment shader to blur is slow and low quality | CC BY-SA 2.5 | 0 | 2010-12-04T19:58:05.997 | 2012-09-18T12:57:33.650 | 2010-12-06T02:58:37.163 | 19,679 | 113,538 | [
"iphone",
"ipad",
"ios",
"opengl-es",
"opengl-es-2.0"
] |
4,356,053 | 1 | 4,419,706 | null | 3 | 40,795 |
Hi i was wondering if there was a way for a batch file to make a pop up appear using the `msg * "hi"` command along with other selections besides the ones that are there by default (cancel and ok) by this, i mean add custom buttons to the pop up message such as a "next" button that would bring you to another pop up message with dialog on it or something along those lines. In summary , is there a way to edit the results of the `msg * "text goes here"` command?
This is what comes up...

And this is kind of what i want:

However , i also would like to know if its possible to change the title of the pop up message and the size or position of it. I know that this is starting to sound like a gui based popup in a batch file but im just wondering if its possible by any means neccessary (Keep in mind that i only want to use batch/shell). Any information or ideas would really help! Thanks!
| Advanced uses of the msg * command in a batch file? | CC BY-SA 2.5 | 0 | 2010-12-04T21:58:31.957 | 2019-09-01T23:25:46.873 | 2010-12-11T13:35:16.557 | 524,670 | 524,670 | [
"windows-7",
"popup",
"batch-file",
"cmd"
] |
4,356,596 | 1 | 4,356,624 | null | 2 | 68 | I'm using the mysql [GREATEST()](http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html#function_greatest) function to select the highest integer value from either column (apples or peaches).
```
+----+------------------+
| id | apples | peaches |
+----+------------------+
| 1 | 8 | 4 |
| 2 | 2 | 6 |
| 3 | 3 | 9 |
| 4 | 7 | 2 |
| 5 | 4 | 4 |
+----+------------------+
```
Using `$result = "SELECT GREATEST(apples, peaches) FROM table";` and `echo $result`, I get:
```
8
6
9
7
```
Next to each value, I want to echo the corresponding fruit name and a fruit icon. How can I achieve the image below via the MYSQL query?

Also, notice that equal values aren't displayed by the `GREATEST()` function. Is there a way to display the equal value as well?
| Detect queried field via greatest() | CC BY-SA 2.5 | 0 | 2010-12-05T00:11:44.653 | 2014-06-17T11:28:33.623 | 2014-06-17T11:28:33.623 | 2,610,249 | 458,228 | [
"php",
"mysql",
"sql",
"database-table"
] |
4,356,700 | 1 | null | null | 2 | 5,746 | [This YouTube video](http://www.youtube.com/watch?v=_kmeFXjjGfk) can be embedded into most sites (e.g., Stackoverflow), but it cannot be embedded into [Rap Genius](http://rapgenius.com). You can try it yourself by pasting the embed code in to Rap Genius with firebug. You'll see this:

I need a way to detect whether a video is specifically blocked from Rap Genius.
Note that this is different from checking whether a video cannot be embedded – i.e., if you GET `http://gdata.youtube.com/feeds/api/videos?v=2&alt=jsonc&q=_kmeFXjjGfk`, you'll see that in the JSON response, `data.items[0].accessControl.embed == 'allowed'`
One clue: before the video starts playing, the player makes a request to a URL that looks like this:
```
http://www.youtube.com/get_video_info?video_id=_kmeFXjjGfk&el=embedded&ps=default&eurl=http%3A%2F%2Frapgenius%2Ecom&hl=en_US
```
Which, when curled, gives this response:
```
status=fail&errorcode=150&reason=This+video+contains+content+from+UMG%2C+who+has+blocked+it+from+display+on+this+website.%3Cbr%2F%3E%3Cu%3E%3Ca+href%3D%27http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D_kmeFXjjGfk%26feature%3Dplayer_embedded%27+target%3D%27_blank%27%3EWatch+on+YouTube%3C%2Fa%3E%3C%2Fu%3E&fslarge=1
```
So maybe I can just query this URL? Will this work in all cases? Is there an "official" way of doing this?
| Determine whether a YouTube video cannot be embedded in a specific site | CC BY-SA 2.5 | 0 | 2010-12-05T00:36:17.687 | 2013-03-19T14:52:29.333 | 2017-02-08T14:31:11.160 | -1 | 25,068 | [
"youtube",
"youtube-api"
] |
4,356,759 | 1 | null | null | 1 | 625 | Here is the matrix I want to represent in the link-list form

The idea is that it's a 2-D matrix. The font in red is the regular [i][j], and blue is the extra information I want to store in a link-list.
In this matrix, I need to have several informations to be stored.
1. int row
2. int colm
3. int label [as shown in blue]
4. bool value (the value to be displayed on the screen)
5. *** right
6. *** left
7. *** up
8. *** down
the problem is i am going to get 4 link-lists, if I create 4 pointers of array [for 2-D matrix]? how do I even get the directional pointers???
If you are curious, I am working on solving a Karnaugh Map.
[link text](http://en.wikipedia.org/wiki/Karnaugh)
Any help is appreciated. Thanks!
| parse 2-D matrix into link-list | CC BY-SA 2.5 | 0 | 2010-12-05T00:51:41.663 | 2010-12-05T01:03:35.953 | null | null | 230,884 | [
"c++",
"matrix",
"linked-list"
] |
4,356,775 | 1 | null | null | 4 | 211 | I have never come across this kind of behaviour before and I wondered if anyone is able to shed some light on the matter?
So as you can see in the picture, I am catching exceptions of type `AccessViolationException`, and yet the debugger is complaining that the exception is unhandled!
How is it possible?

Oh, and I know you shouldnt have an empty `catch` block, that's not my question.
Thanks!
Now I am getting this one instead:

| Unusual exception behaviour? | CC BY-SA 2.5 | 0 | 2010-12-05T00:56:33.210 | 2010-12-05T01:43:36.207 | 2010-12-05T01:43:36.207 | 395,126 | 395,126 | [
"c#",
"debugging",
"exception",
".net-4.0",
"access-violation"
] |
4,356,788 | 1 | 4,356,820 | null | 15 | 9,724 | Basically, what I want to do is understand how to calculate the values along a 'curve' as represented here in the photoshop curves box:

So, given N points with x between 0 and 1 and y between 0 and 1 - we'll create a curve that passes through all these points. Given this curve, I'd like to be able to calculate all values of the curve for any given X.
In other words, I'd like to modify values of color just like the curves box does, but programmatically.
I've read that these are "catmull-rom splines" -- but all I see is a function that relies upon a parametric T -- I want to be able to look up for values of x. I'd like to do this in C if possible
| How to recreate the math behind photoshop curves | CC BY-SA 2.5 | 0 | 2010-12-05T01:01:02.790 | 2018-03-06T09:50:55.337 | null | null | 85,271 | [
"math",
"graphics"
] |
4,356,919 | 1 | 5,098,420 | null | 9 | 30,129 | Android noob here. I learn the best by seeing the source code of a functional example, but I have been unable to find a simple-but-complete example of using a socket in its own thread.
I have an Android service that needs to communicate with the Internet. I want to open a TCP socket that connects to a server on the Internet. The service needs to send data to the Internet, and data coming back from the net will need to go to the service. Since the service is doing other things as well, the socket connection needs to live in its own thread.
Any idea where I could find an example of a socket in a thread with communication to/from the socket?
Thanks

| How to get data to/from a socket in a thread? | CC BY-SA 3.0 | 0 | 2010-12-05T01:40:02.583 | 2011-12-29T17:48:52.767 | 2011-12-29T17:48:52.767 | 840,973 | 127,287 | [
"android",
"multithreading",
"sockets"
] |
4,357,042 | 1 | null | null | 0 | 349 | I have a report with a couple of header rows that should repeat when the report spans over a page.
I'm aware that [this is not intuitive](http://phil-austin.blogspot.com/2010/02/repeating-table-headers-in-reporting.html), but I can get it to work when the detail rows extend to the next page.
However, my issue is with my subreports. When they cause the report to extend to the next page, my header rows don't repeat.
I was just wondering if anyone else has experienced this and, if so, what you did to fix.
Below is an image of how the report looks.

| RepeatRowHeaders not working when subreport rolls over to next page | CC BY-SA 2.5 | null | 2010-12-05T02:30:45.897 | 2011-05-16T12:05:14.853 | null | null | 250,385 | [
"ssrs-2008",
"reporting-services"
] |
4,357,046 | 1 | null | null | 14 | 36,169 | I'm creating a custom list item in and android list view. it's very simple, it has a textview on the left and an image on the right. the image should align all the way right, and the text view should take up all the space on the left. problem is, i can get the image to show up, but it pushes left. if i set the textview width to fill_parent, the image disappears. here's my layout:
```
<?xml version="1.0" encoding="utf-8" ?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal"
android:layout_width="fill_parent" android:layout_height="50px" android:layout_gravity="center_vertical">
<!-- item -->
<TextView android:id="@+id/txtItem" android:gravity="center_vertical" android:textSize="20px" android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
<!-- disclosure image -->
<ImageView android:layout_gravity="right|center_vertical" android:src="@drawable/common_icon_arrow_disclosure"
android:layout_width="wrap_content" android:layout_height="wrap_content"/>
</LinearLayout>
```
i've also tried a relative layout, but the same thing happens. what am i doing wrong?
---
EDIT: for clarification, this is what i'm trying to accomplish:

i want the text field to take up the whole left area, and the image to be on the right, unscaled, vertically centered.
| Android List Item: TextView on left, Image on right | CC BY-SA 4.0 | 0 | 2010-12-05T02:33:32.590 | 2019-12-24T12:19:19.597 | 2019-12-24T11:05:05.453 | 1,000,551 | 339,448 | [
"android",
"android-layout"
] |
4,357,089 | 1 | 4,357,178 | null | 0 | 1,316 | Is there a way using Core Plot to have periodic labels assigned to data plots? Such as 10-20 labels listed across my plot points.
Here is an example (mockup) of what I am hoping to do:

Is it possible to do this when the graph loads, or maybe when you swipe across the graph you see the data points showing their call out?
| Core Plot: Data point labels shown, or when data points touched? | CC BY-SA 2.5 | null | 2010-12-05T02:50:27.090 | 2010-12-05T03:17:51.040 | null | null | 144,695 | [
"iphone",
"objective-c",
"core-plot"
] |
4,357,074 | 1 | 4,357,105 | null | 0 | 1,597 | I want a format html using CSS so that I get the following:
> Image on the left, with subject and
body next to it on the right. I want
subject to be on one line and the body
to be on the other.
With One message after each other
on subsequesnt blocks downs the page.However I'm getting the subject and the body one one line and a cacade effect down the
page.
Here is what I seem to be getting.

I just cannot seem to get the hang of what's needed.
My html is :
```
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>messages to/from someone</title>
<link rel="stylesheet" type="text/css" href="messages.css" />
</head><body>
<div class'message'>
<span class='to'>
<img class='floatimgleft' src='../code/images/arrow-right.png' width='64' height='64' border='0' />
<span class='subject'>subject</span>
<span class='body'>body</span>
</span>
</div>
<div class'message'>
<span class='to'>
<img class='floatimgleft' src='../code/images/arrow-right.png' width='64' height='64' border='0' />
<span class='subject'>subject</span>
<span class='body'>body</span>
</span>
</div>
<div class'message'>
<span class='to'>
<img class='floatimgleft' src='../code/images/arrow-right.png' width='64' height='64' border='0' />
<span class='subject'>subject</span>
<span class='body'>body</span>
</span>
</div>
</body></html>
```
My CSS is:
```
.floatimgleft {
float:left;
margin-top:10px;
margin-right:10px;
margin-bottom:10px;
}
.message{
display: block;
}
.subject {
display: inline;
}
.body {
display: inline;
}
```
Edit: I've edited the code to show where I started from. I was under the impression that div class='message' would cause a line break between messages but I'm getting a cascade effect.
| How float image and text correctly using css | CC BY-SA 2.5 | null | 2010-12-05T02:44:56.983 | 2010-12-05T03:42:50.157 | 2010-12-05T03:04:47.887 | 30,225 | 30,225 | [
"css-float"
] |
4,357,145 | 1 | 4,357,158 | null | 13 | 72,777 | This is easy in jquery but how about plain javascript?
The code is for the Google image search API. I want to search images that match the html or preferably text inside a div.
```
var searchThis = document.getElementById('imgToFind'); //get HTML, or text from div
// Find images
imageSearch.execute(searchThis); //search image
```
The HTML
```
<div id="imgToFind">PlayStation</div>
```
The result should be images of playstation. Instead I get these
 dosic ois - 123
 IE8 javascript returns [object HTMLDivElement] instead [
 Loving Hand
And other irrelevant images. I wonder what Google searches for.. think the second one is giving me a hint.
| javascript get html or text from div | CC BY-SA 2.5 | 0 | 2010-12-05T03:06:05.890 | 2010-12-05T15:59:04.337 | null | null | 407,607 | [
"javascript",
"image",
"json",
"api"
] |
4,357,205 | 1 | null | null | 0 | 790 | A picture worth thousands of words:
Question:
How to layout the image and text so they can work as an anchor as a whole?

| combine image and text on the fly and make whole div works as an hypelink | CC BY-SA 2.5 | null | 2010-12-05T03:26:56.020 | 2010-12-06T03:52:11.147 | null | null | 115,722 | [
"javascript",
"html",
"ruby-on-rails",
"css"
] |
4,357,574 | 1 | 4,357,612 | null | 2 | 112 | I want to sort the messages by poster_time instead of the usual id incrementing as I have restored a database with auto incrementing id's and very old messages show up on top I had like to be able to sort them by poster_time to fix that problem.
I've attempted to fix this myself but I don't want to lose any functionality, here is my attempt.
```
SELECT t.id_topic
FROM {db_prefix}topics AS t' . ($context['sort_by'] === 'last_poster' ? '
INNER JOIN {db_prefix}messages AS ml ON (ml.id_msg = t.id_last_msg)' : (in_array($context['sort_by'], array('starter', 'subject')) ? '
INNER JOIN {db_prefix}messages AS mf ON (mf.id_msg = t.id_first_msg)' : '')) . ($context['sort_by'] === 'starter' ? '
LEFT JOIN {db_prefix}members AS memf ON (memf.id_member = mf.id_member)' : '') . ($context['sort_by'] === 'last_poster' ? '
LEFT JOIN {db_prefix}members AS meml ON (meml.id_member = ml.id_member)' : '') . '
WHERE t.id_board = {int:current_board}' . (!$modSettings['postmod_active'] || $context['can_approve_posts'] ? '' : '
AND (t.approved = {int:is_approved}' . ($user_info['is_guest'] ? '' : ' OR t.id_member_started = {int:current_member}') . ')') . '
ORDER BY ' . (!empty($modSettings['enableStickyTopics']) ? 'is_sticky' . ($fake_ascending ? '' : ' DESC') . ', ' : '') . $_REQUEST['sort'] . ($ascending ? '' : ' DESC') . '
LIMIT {int:start}, {int:maxindex}',
```
to this for testing purposes
```
SELECT t.id_topic
FROM topics AS t
INNER JOIN messages AS ml ON (ml.id_msg = t.id_last_msg)
INNER JOIN messages AS mf ON (mf.id_msg = t.id_first_msg)
LEFT JOIN members AS memf ON (memf.id_member = mf.id_member)
LEFT JOIN members AS meml ON (meml.id_member = ml.id_member)
WHERE t.id_board = 1
ORDER BY ml.poster_time DESC
LIMIT 0, 500
```
Using the code above I've figured out I need ml.poster_time DESC how do I bundle it up with the code at the very top.
Here the structures
boards structure



```
$topic_ids = array();
$context['topics'] = array();
// Sequential pages are often not optimized, so we add an additional query.
$pre_query = $start > 0;
if ($pre_query && $maxindex > 0)
{
$request = $smcFunc['db_query']('', '
SELECT t.id_topic
FROM {db_prefix}topics AS t' . ($context['sort_by'] === 'last_poster' ? '
INNER JOIN {db_prefix}messages AS ml ON (ml.id_msg = t.id_last_msg)' : (in_array($context['sort_by'], array('starter', 'subject')) ? '
INNER JOIN {db_prefix}messages AS mf ON (mf.id_msg = t.id_first_msg)' : '')) . ($context['sort_by'] === 'starter' ? '
LEFT JOIN {db_prefix}members AS memf ON (memf.id_member = mf.id_member)' : '') . ($context['sort_by'] === 'last_poster' ? '
LEFT JOIN {db_prefix}members AS meml ON (meml.id_member = ml.id_member)' : '') . '
WHERE t.id_board = {int:current_board}' . (!$modSettings['postmod_active'] || $context['can_approve_posts'] ? '' : '
AND (t.approved = {int:is_approved}' . ($user_info['is_guest'] ? '' : ' OR t.id_member_started = {int:current_member}') . ')') . '
ORDER BY ' . (!empty($modSettings['enableStickyTopics']) ? 'is_sticky' . ($fake_ascending ? '' : ' DESC') . ', ' : '') . $_REQUEST['sort'] . ($ascending ? '' : ' DESC') . '
LIMIT {int:start}, {int:maxindex}',
array(
'current_board' => $board,
'current_member' => $user_info['id'],
'is_approved' => 1,
'id_member_guest' => 0,
'start' => $start,
'maxindex' => $maxindex,
)
);
$topic_ids = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
$topic_ids[] = $row['id_topic'];
}
// Grab the appropriate topic information...
if (!$pre_query || !empty($topic_ids))
{
// For search engine effectiveness we'll link guests differently.
$context['pageindex_multiplier'] = empty($modSettings['disableCustomPerPage']) && !empty($options['messages_per_page']) && !WIRELESS ? $options['messages_per_page'] : $modSettings['defaultMaxMessages'];
$result = $smcFunc['db_query']('substring', '
SELECT
t.id_topic, t.num_replies, t.locked, t.num_views, t.is_sticky, t.id_poll, t.id_previous_board,
' . ($user_info['is_guest'] ? '0' : 'IFNULL(lt.id_msg, IFNULL(lmr.id_msg, -1)) + 1') . ' AS new_from,
t.id_last_msg, t.approved, t.unapproved_posts, t.is_solved, ml.poster_time AS last_poster_time,
ml.id_msg_modified, ml.subject AS last_subject, ml.icon AS last_icon,
ml.poster_name AS last_member_name, ml.id_member AS last_id_member,
IFNULL(meml.real_name, ml.poster_name) AS last_display_name, t.id_first_msg,
mf.poster_time AS first_poster_time, mf.subject AS first_subject, mf.icon AS first_icon,
mf.poster_name AS first_member_name, mf.id_member AS first_id_member,
IFNULL(memf.real_name, mf.poster_name) AS first_display_name, SUBSTRING(ml.body, 1, 385) AS last_body,
SUBSTRING(mf.body, 1, 385) AS first_body, ml.smileys_enabled AS last_smileys, mf.smileys_enabled AS first_smileys
FROM {db_prefix}topics AS t
INNER JOIN {db_prefix}messages AS ml ON (ml.id_msg = t.id_last_msg)
INNER JOIN {db_prefix}messages AS mf ON (mf.id_msg = t.id_first_msg)
LEFT JOIN {db_prefix}members AS meml ON (meml.id_member = ml.id_member)
LEFT JOIN {db_prefix}members AS memf ON (memf.id_member = mf.id_member)' . ($user_info['is_guest'] ? '' : '
LEFT JOIN {db_prefix}log_topics AS lt ON (lt.id_topic = t.id_topic AND lt.id_member = {int:current_member})
LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = {int:current_board} AND lmr.id_member = {int:current_member})'). '
WHERE ' . ($pre_query ? 't.id_topic IN ({array_int:topic_list})' : 't.id_board = {int:current_board}') . (!$modSettings['postmod_active'] || $context['can_approve_posts'] ? '' : '
AND (t.approved = {int:is_approved}' . ($user_info['is_guest'] ? '' : ' OR t.id_member_started = {int:current_member}') . ')') . '
ORDER BY ' . ($pre_query ? 'FIND_IN_SET(t.id_topic, {string:find_set_topics})' : (!empty($modSettings['enableStickyTopics']) ? 'is_sticky' . ($fake_ascending ? '' : ' DESC') . ', ' : '') . $_REQUEST['sort'] . ($ascending ? '' : ' DESC')) . '
LIMIT ' . ($pre_query ? '' : '{int:start}, ') . '{int:maxindex}',
array(
'current_board' => $board,
'current_member' => $user_info['id'],
'topic_list' => $topic_ids,
'is_approved' => 1,
'find_set_topics' => implode(',', $topic_ids),
'start' => $start,
'maxindex' => $maxindex,
)
);
```
Thanks - I have been suffering with this for a whole week now.
| SQL Query merging with PHP assistance please | CC BY-SA 4.0 | null | 2010-12-05T05:47:37.800 | 2020-12-19T09:46:46.337 | 2020-12-19T09:46:46.337 | 1,783,163 | 414,521 | [
"php",
"sql",
"mysql"
] |
4,358,582 | 1 | 4,360,516 | null | 14 | 14,100 | The Google Map I have is only beeing rendered partially and is centered to the wrong point (it should center to the marker). See below:

Now to add a little more detail:
- - -
Especially the last point is the one I'm wondering most about. I guess opening the developer console re-executes some JavaScript.
So: Can I call a function to re-execute JavaScript, the way the developer console does?
This is the code:
```
<script type="text/javascript">
{literal}
function initialize() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map")); //, { size : {width:600,height:600} }
map.addControl(new GLargeMapControl3D());
map.addControl(new GMapTypeControl());
map.addControl(new GScaleControl());
map.setCenter(new GLatLng(51.17689812200107, 9.84375), 5);
map.checkResize();
var geocoder = new GClientGeocoder();
function showPoint(lat, lon) {
if (lat != "" && lon != "") {
var point = new GLatLng(lat, lon);
map.setCenter(point, 10);
var marker = new GMarker(point, {draggable: true});
GEvent.addListener(marker, "dragstart", function() {
// map.closeInfoWindow();
});
GEvent.addListener(marker, "dragend", function() {
var newPoint = marker.getLatLng();
$('#lat').val(newPoint.lat());
$('#lon').val(newPoint.lng());
// marker.openInfoWindowHtml("Neue Koordinaten Lat: "+ newPoint.lat() +" Lon: "+ newPoint.lng());
});
map.addOverlay(marker);
}
}
{/literal}showPoint("{$gmap_lat}", "{$gmap_lon}");{literal}
}
}
{/literal}
```
This is where I put the div:
```
<fieldset style="-moz-border-radius: 1em; -webkit-border-radius: 1em;">
<legend>Karte</legend>
<div id="map" title="Lage von '{$name}'"><br>Die Karte wird geladen...<br><br>Hinweis: Damit dies funktioniert müssen Sie in Ihrem Browser JavaScript aktivieren</div>
Falls sich der Marker nicht auf der richtigen Position befinden sollte, bewegen Sie diesen mit Ihrer Maus auf die richtige Position.
<br>Länge: <input type="text" id="lat" name="lat" value="{$gmap_lat}">
Breite: <input type="text" id="lon" name="lon" value="{$gmap_lon}">
</fieldset>
```
And on the div the following CSS rules apply:

| Google Map shows only partially | CC BY-SA 2.5 | 0 | 2010-12-05T11:35:05.917 | 2019-09-10T13:52:06.227 | 2010-12-05T12:03:11.907 | 351,893 | 351,893 | [
"javascript",
"google-maps"
] |
4,359,006 | 1 | 4,359,079 | null | 0 | 4,151 | I'm trying to create the following:

Using two images: one as mask (the diagonal lines) and the other the image and text themselves (the mask and image+text are the same size):
 
..and I just can't get it done!
I've tried all combinations with divs and z-indeces, opacity and background-image.. (should mention I'm noob to html).
Here's one shot I got at it (with only the mask and an image):
```
div {
position: absolute;
top: 775px;
left: 0px;
height: 188px;
width: 272px;
background-image: url('grey-out.png');
}
img {
z-index: 1000;
}
```
---
```
<div></div>
<img src="41_large.png" />
```
Which just gives the diagonal lines themselves..
Can someone please help me out?
How do I make that "disabled" look combining the (semi-transparent) mask and the div?
Thanks!
| Creating a "disabled" look by using a mask | CC BY-SA 2.5 | null | 2010-12-05T13:22:09.543 | 2015-07-12T13:30:29.787 | 2020-06-20T09:12:55.060 | -1 | 424,952 | [
"html"
] |
4,359,132 | 1 | 4,359,162 | null | 1 | 2,649 | I an using JQuery datepicker on my asp.net page and I can't see "Prev" or "Next" buttons but I can click on them. Where can I change the color of these buttons or make them viewable? I tried with other themes, but still same result.

Thanks.
| Jquery datepicker not viewable | CC BY-SA 2.5 | null | 2010-12-05T13:58:13.873 | 2010-12-05T14:05:14.697 | null | null | 292,558 | [
"jquery",
"jquery-ui"
] |
4,359,252 | 1 | 4,359,386 | null | 2 | 2,329 | I am trying to build a very simple java project in
having two different source folders with different output folders with same java source file.
But, getting CTE in the project.
```
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="myBin" path="mySrc"/>
<classpathentry kind="src" output="yourBin" path="yourSrc"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="output" path="bin"/>
</classpath>
```

I also find [this](http://www.eclipse.org/forums/index.php?t=msg&goto=487983&) while googling.
Any workaround for this is greatly appreciated.
Thanks.
---
Edit :
Actually, I have a single project, which I am enhancing continuously and want to keep all versions together. I googled this approach from [here](https://stackoverflow.com/questions/513697/how-to-set-up-multiple-source-folders-within-a-single-eclipse-project). Any hack for this or better approach is welcomed.
| Two different source folders with different output folders in eclipse having same type java source files;not getting compiled | CC BY-SA 2.5 | null | 2010-12-05T14:31:32.160 | 2010-12-05T21:21:04.603 | 2017-05-23T12:01:09.563 | -1 | 118,649 | [
"java",
"eclipse",
"compiler-errors",
"packaging"
] |
4,359,488 | 1 | 4,359,518 | null | 4 | 1,555 | I'm making Pong clone using HTML5 canvas and JavaScript. The problem I'm having can best be described in this diagram:

If the ball is moving at 10px per frame, I can't just test if the ball is touching the paddle, as it is possible that the ball has surpassed the paddle in that frame-step.
Is there any way to test if the ball has collided with the paddle?
Edit: The only 2 solutions I can think of at the moment are:

or

| Ball passing through paddle in Pong game | CC BY-SA 2.5 | null | 2010-12-05T15:25:23.937 | 2010-12-05T22:49:05.783 | 2010-12-05T22:49:05.783 | 2,214 | 531,265 | [
"javascript",
"html"
] |
4,359,597 | 1 | 4,359,647 | null | 4 | 3,256 | i know Visual Studio has no way to increment the build number in a way that people would expect, but it support [randomizing the build number](https://stackoverflow.com/questions/826777/how-to-have-an-auto-incrementing-version-number-visual-studio):
My `AssemblyInfo.cs` file contains:
```
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("1.0.*")]
```
And yet it gives, what appears to me, non-sensical results (even allowing for Visual Studio's pseudo-random version numbers):

So the simpler question is:
> What do i put into `AssemblyInfo.cs` to make it work?
From [MSDN](http://msdn.microsoft.com/en-us/library/system.reflection.assemblyversionattribute.aspx) (reformatted for clarity):
> You can specify all the values or you
can accept the default build number,
revision number, or both by using an
asterisk (*). For example, ```
[assembly:AssemblyVersion("2.3.25.1")]
```
indicates 2 as the major version, 3 as
the minor version, 25 as the build
number, and 1 as the revision number.
A version number such as ```
[assembly:AssemblyVersion("1.2.*")]
```
specifies 1 as the major version, 2 as
the minor version, and accepts the
default build and revision numbers. A
version number such as ```
[assembly:AssemblyVersion("1.2.15.*")]
```
specifies 1 as the major version, 2 as
the minor version, 15 as the build
number, and accepts the default
revision number. The default build number increments
daily. The default revision number
is random.
i take that to mean that version numbers are:
```
[1.0.0.0]
major.minor.build.revision
```
while
```
[1.0.0.*]
major.minor.build.[random]
```
and
```
[1.0.*]
major.minor.[daynumber].[random]
```
| What's wrong with my Visual Studio auto-incrementing build number syntax? | CC BY-SA 2.5 | 0 | 2010-12-05T15:49:12.303 | 2010-12-05T16:21:36.030 | 2017-05-23T12:30:36.930 | -1 | 12,597 | [
"visual-studio",
"random",
"build-numbers"
] |
4,359,901 | 1 | 4,535,669 | null | 1 | 435 | After I put my ExpandableListView component in a ViewFlipper element, I got this:

My layout file is this:
```
<LinearLayout android:id="@+id/LinearLayout01"
android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical">
<LinearLayout android:id="@+id/LinearLayout02"
android:layout_width="wrap_content" android:layout_height="wrap_content">
<ViewFlipper android:id="@+id/ViewFlipper01"
android:layout_width="wrap_content" android:layout_height="wrap_content">
<!--adding views to ViewFlipper-->
<ExpandableListView android:id="@+id/List01"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:text="Flipper Content 0"></ExpandableListView>
<TextView android:id="@+id/TextView01" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="Flipper Content 1"></TextView>
<TextView android:id="@+id/TextView02" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="Flipper Content 2"></TextView>
<TextView android:id="@+id/TextView03" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="Flipper Content 3"></TextView>
</ViewFlipper>
</LinearLayout>....</LinearLayout>
```
Does anybody have an idea why the item rows are just partially in orange?
Thanks!
| ExpandableListView in ViewFlipper display problem? | CC BY-SA 2.5 | null | 2010-12-05T16:46:57.877 | 2010-12-26T22:26:13.643 | null | null | 481,828 | [
"android",
"expandablelistview",
"viewflipper"
] |
4,360,558 | 1 | null | null | 7 | 4,271 | Xcode 4 Preview 4 displays "Build Succeeded", as show the image below there are 5 erros. Actually there are more than 5 errors, but it seems that Xcode doesn't build anymore. It happened when i built the project in xcode 3 while the xcode 4 was open with the same project. Anyone have an idea to overcome this bug and reestablish the Xcode??

I tried to restart the Xcode, restart the mac. I don't know how to clean up the build. The "clean all" option in Product menu is unable.
Thanks in advance.
| Xcode 4 Preview 4 displays "Build Succeeded" but with errors | CC BY-SA 3.0 | 0 | 2010-12-05T18:58:48.973 | 2019-06-17T18:46:29.233 | 2015-03-15T12:48:28.697 | 1,779,477 | 486,971 | [
"iphone",
"xcode",
"xcode4"
] |
4,360,896 | 1 | null | null | 4 | 398 | Give N days, with money amount doubling each day, is this the most efficient way to accomplish this?
Day one: you are given $.5.
Day two: you are given twice the amount as day one $1, now you have $1.5
Day three: you are given twice the amount as day two $2 and now you have $3.5
And so on.
```
function calcit3()
{
var cur_total = .5;
var prev_total = 0;
var days = 20;
for ( z = 1; z < days; z++ )
{
cur_total = cur_total * 2;
prev_total = cur_total;
}
return (cur_total + prev_total);
}
```
This is just purely acedemic. Not really trying to shave cycles or anything.
Thanks.
EDIT:

| Most efficient javascript algorithm to calc total if amount were to double each day | CC BY-SA 2.5 | 0 | 2010-12-05T20:13:43.023 | 2010-12-05T21:21:04.117 | 2010-12-05T21:21:04.117 | 319,403 | 531,427 | [
"javascript"
] |
4,360,892 | 1 | 4,360,899 | null | 32 | 31,810 | I tried the following,
```
/*
* addRelationship
*
* Adds a relationship between two entities using the given relation type.
*
* @param fromKey the original entity
* @param toKey the referring entity
* @param relationTypeDesc the type of relationship
*/
function addRelationship($fromKey, $toKey, $relationTypeDesc) {
$relationTypeKey = $this->getRelationTypeKey($relationTypeDesc);
```
But, when I tried to use it in another place, it says PHPDoc not found.

The following is the updated syntax which will work in NetBeans PHP -
```
/**
* addRelationship
*
* Adds a relationship between two entities using the given relation type.
*
* @param integer $fromKey the original entity
* @param integet $toKey the referring entity
* @param string $relationTypeDesc the type of relationship
*/
function addRelationship($fromKey, $toKey, $relationTypeDesc) {
```
| How to add documentation for my functions in Netbeans PHP? | CC BY-SA 2.5 | 0 | 2010-12-05T20:12:41.807 | 2015-08-23T05:22:08.900 | 2010-12-05T20:29:42.903 | 184,184 | 184,184 | [
"php",
"netbeans",
"documentation-generation",
"code-completion"
] |
4,360,926 | 1 | 4,361,038 | null | 3 | 1,827 | I need to implement the following layout structure in some web site:

As you can see, in this conversation there are 3 participants. Every line that a participant say is in a bubble. Every participant has different color bubble. All the bubbles for a participant have the same distance from the left.
I'm looking for a jQuery plugin that implements this layout structure (or a similiar layout structure). This plugin should support at least 2 and 3 participants, but an option for more would be great.
If no such plugins exists, how can I implement this? I mean, how can I calculate the width of each bubble (depending on the participants count) and the margin-left for each bubble?
Thanks!
| jQuery - Bubbles Conversation Layout | CC BY-SA 2.5 | 0 | 2010-12-05T20:19:55.320 | 2010-12-23T17:46:00.247 | 2020-06-20T09:12:55.060 | -1 | 140,937 | [
"jquery"
] |
4,361,023 | 1 | 4,371,643 | null | 6 | 8,332 | I have particles that I want to be able to change the color of in code, so any color can be used. So I have only one texture that basically has luminance.
I've been using `glColor4f(1f, 0f, 0f, 1f);` to apply the color.
Every blendfunc I've tried that has come close to working ends up like the last picture below. I still want to preserve luminance, like in the middle picture. (This is like the Overlay or Soft Light filters in Photoshop, if the color layer was on top of the texture layer.)
Any ideas for how to do this without programmable shaders? Also, since these are particles, I don't want a black box behind it, I want it to add onto the scene.

| OpenGL ES 1.1: How to change texture color without losing luminance? | CC BY-SA 2.5 | 0 | 2010-12-05T20:40:15.203 | 2011-03-20T18:24:45.140 | null | null | 506,796 | [
"iphone",
"android",
"opengl-es"
] |
4,361,372 | 1 | 4,361,464 | null | 4 | 4,139 | I have a question regarding a 2D Fourier transformation. I'm currently in the progress of understandig the maths behind this, and there's something I dont onderstand. As far as I'm concerned, the DFT has a complexity of `O(N*N)`. If I look at the following algorithm:

I don't understand how it works. Are we going to do this caluculation for every pixel in the tranformed ?
1. We have an image of 2*2.
2. For each pixel in this image we're going to do the DFT F(x,y)
3. I'll create a new image, and each pixel is the magnitude of the corrosponding complex value
Is this how it works or am I missing something? Because the way I see it now, it has a complexity of `O(N^4)`
| Complexity of a 2d Discrete Fourier Transform | CC BY-SA 2.5 | null | 2010-12-05T21:37:32.567 | 2010-12-05T23:19:26.527 | null | null | 241,513 | [
"c#",
"complexity-theory",
"fft"
] |
4,361,654 | 1 | null | null | 0 | 347 | I'm using [jQuery Form plugin](http://jquery.malsup.com/form/) to create a very simple contact form. However, there seems to be some conflict (?) between it and the PHP script I'm using as well.
The call is super simple, like so:
```
$('.contactform').ajaxForm({
target: '#error',
beforeSubmit: function() {
$('#error span').remove();
$('#error').append('<p class="loading">Sending your message...</p>');
},
success: function() {
$('#error p.loading').fadeOut();
$('#error').fadeIn('slow');
}
});
```
it takes the POST method from the form by default. What happens is, the script is stuck on "sending your message", even though the PHP script is successful, gives a response and sends the message correctly. I checked in Firebug, and it seems like there's an 404 error for the PHP script, but the response is correct (see the image)

I would love some help debugging the problem - the PHP script that's supposedly cannot be found can be viewed here: [http://pastie.org/1350597](http://pastie.org/1350597)
I have no idea what could cause such a weird behavior. Thanks in advance!
| jQuery form - PHP script "not found" but message is being sent successfully | CC BY-SA 2.5 | null | 2010-12-05T22:26:34.980 | 2010-12-06T01:05:02.390 | null | null | 139,468 | [
"php",
"jquery",
"jqueryform"
] |
4,361,659 | 1 | null | null | 1 | 985 | I'm developing polish blogosphere monitoring website and I'm looking for "best practice" with handling
massive content download in python.
Here is sample sheme of a workflow:

Description:
I've categorized database of rss feeds (around 1000). Every hour or so I should check feeds if there are some new items posted. If so, I should analyze each new item.
Analyze process handles metadata of each document and also downloads every image found inside.
Simplified one-thread version of a code:
```
for url, etag, l_mod in rss_urls:
rss_feed = process_rss(url, etag, l_mod) # Read url with last etag, l_mod values
if not rss:
continue
for new_item in rss_feed: # Iterate via *new* items in feed
element = fetch_content(new_item) # Direct https request, download HTML source
if not element:
continue
images = extract_images(element)
goodImages = []
for img in images:
if img_qualify(img): # Download and analyze image if it could be used as a thumbnail
goodImages.append(img)
```
So I iterate throught the rss feeds, downloads only feeds with new items. Download each item from a feed. Download and analyze each image in item.
HTTR requests appears at the follwing stages:
- downloading rss xml document
- downloading x items found on rss
- downloading all images of each item
I've decided to try python gevent (www.gevent.org) library to handle multiple urls content download
What I want to gain as a result:
- Ability to limit number of external http requests
- Ability to parralel downloading all listed content items.
What is a best way to do it?
I'm not sure, because I'm new to parralel programming at all (well this async request probably has nothing to do with parralel programming at all) and I have no idea how such tasks
are done in a mature world, yet.
The only idea come to my mind is to use the following technique:
- Run processing script via cronjob every 45 minutes
- Try to lock file with written pid process inside at the very beggining. If locking failed, check process list for this pid. If pid not found, probably process failed at some point and its safe to srart new one.
- Via the wrapper for gevent pool run task for rss feeds download, at every stage (new items found) add new job to quique to download item, at every item downloaded add tasks for image downloading.
- Check every some seconds state of jobs currenly running, run new job from quique if there free slots available in FIFO mode.
Sound OK for me, however maybe this kind of task has some "best practise" and I'm reinventing the wheel now.
Thats why I'm posting my question here.
Thx!
| organizing pools for multiple urls massive download | CC BY-SA 3.0 | 0 | 2010-12-05T22:26:56.683 | 2011-11-28T21:13:05.523 | 2011-11-28T21:13:05.523 | 234,976 | 531,535 | [
"python",
"asynchronous",
"download",
"gevent"
] |
4,361,758 | 1 | 4,361,884 | null | 0 | 955 | Given two points P,Q and a delta, I defined the equivalence relation ~=, where P ~= Q if `EuclideanDistance(P,Q)` <= delta. Now, given a set of points, in the example S = (A, B, C, D, E, F) and n = 6 (the fact points are actually endpoints of segments is negligible), is there an algorithm that has complexity better than O(n^2) in the average case to find a partition of the set (the representative element of the subsets is unimportant)?
Attempts to find theoretical definitions of this problem were unsuccessful so far: k-means clustering, nearest neighbor search and others seems to me different problems. The picture shows what I need to do in my application.
Any hint? Thanks

: while the actual problem (cluster near points given some kind of invariant) should be solvable in better better than O(n^2) in the average case, there's a serious flaw in my problem definition: =~ is a equivalence relation because of the simple fact it doesn't respect the . I think this is the main reason this problem is not easy to solve and need advanced techiques. Will post very soon my actual solution: should work when near points all satisfy the =~ as defined. Can fail when poles apart points doesn't respect the relation but they are in relation with the center of gravity of clustered points. It works well with my input data space, may not with yours. Do anyone know a full formal tratment of this problem (with solution)?
| Partition neighbor points given a euclidean distance range | CC BY-SA 2.5 | 0 | 2010-12-05T22:47:49.437 | 2020-09-02T10:47:27.227 | 2010-12-09T22:35:31.527 | 213,871 | 213,871 | [
"algorithm",
"cluster-analysis",
"partitioning",
"spatial",
"euclidean-distance"
] |
4,361,970 | 1 | 4,361,986 | null | 2 | 1,025 | In PHP, I'm generating a calendar with code from [here](http://davidwalsh.name/php-calendar). I've connected it with Basecamp and am successfully calculating the hours worked each day and sum them for the week and month. To properly calculate overtime, I need the hours from the whole week, even when it spans the end/beginning of a month.

After several hours of trying, I haven't been able to calculate the dates of the days marked with '?' in the above image.
I can't escape the feeling that I'm missing something obvious here, but haven't been able to figure it out. Any help much appreciated, thank you.
| Last days of previous month | CC BY-SA 2.5 | 0 | 2010-12-05T23:27:49.340 | 2010-12-05T23:31:33.593 | null | null | 113,559 | [
"php",
"calendar",
"date"
] |
4,362,393 | 1 | 4,373,115 | null | 0 | 213 | 
Initially I have user input decimal numbers (0 - 15), and I will turn that into binary numbers.
Say these numbers are written into a text file, as shown in the picture. These numbers are arranged by the numbers of 1's. The dash - is used to separate different groups of 1.
I have to read this file, and compare strings of one group with the all the strings in the group below, i.e., Group 1 with all the strings in group 2, and group 2 - group 3.
The deal is that, only one column of 0 / 1 difference is allowed, and that column is replaced by letter t. If more than one column of difference is encountered, write none.
So say group 2, 0001 with group 3, 0011, only the second column is different. however, 0010 and 0101 are two columns of difference.
The result will be written into another file.....
At the moment, when I am reading these strings, I am using vector . I came across bitset. What is important is that I have to access the character one at a time, meaning I have break the vector into vector . But it seems like there could be easier way to do it.
I even thought about a hash table - linked-list. Having group 1 assigned to H[0]. Each comparison is done as H[current-group] with H[current_group+1]. But beyond the first comparison (comparing 1's and 0's), the comparison beyond that will not work under this hash-linked way. So I gave up on that.
```
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <algorithm>
#include <iterator>
using namespace std;
int main() {
ifstream inFile("a.txt");
vector<string> svec;
copy(istream_iterator<string>(inFile), istream_iterator<string>(), back_inserter(svec));
copy(svec.begin(), svec.end(), ostream_iterator<string>(cout,"\n"));
for(int i = 0; i < svec.size(); i++)
{
cout << svec[i] << " ";
}
inFile.close();
return 0;
}
```
This is the sample code of writing it into a file....but like I said, the whole deal of vector seems impractical in my case....
Any help is appreciated. thanks
| comparing bits (one position at a time) | CC BY-SA 2.5 | null | 2010-12-06T01:08:41.527 | 2010-12-07T03:25:05.567 | 2010-12-06T01:22:38.530 | 230,884 | 230,884 | [
"c++",
"string",
"vector"
] |
4,362,592 | 1 | null | null | 4 | 2,517 | I am doing some OCR stuff and screen scraping. I end up with lots of files that look like this.



All I need to do is some very basic OCR in C# on these files. I've been pulling my hair trying to get different libraries to work (Tessnet2, Puma, MODI) and have been having lots of different problems getting them to even run from within C#.
What do you guys recommend for something this simple?
Thanks!
| Simple OCR Problem in .NET C# | CC BY-SA 2.5 | 0 | 2010-12-06T02:02:50.757 | 2013-10-14T19:22:10.787 | null | null | 423,079 | [
"c#",
"ocr"
] |
4,362,850 | 1 | 4,362,877 | null | 1 | 199 | while writing DoDragDrop(), a tooltip message informing that
>

| Tooltip information at DoDragDrop() in C# winforms | CC BY-SA 2.5 | null | 2010-12-06T03:08:57.670 | 2013-10-18T06:35:45.323 | 2013-10-18T06:35:45.323 | 168,868 | 479,468 | [
"c#",
"winforms",
"visual-studio",
"tooltip"
] |
4,362,995 | 1 | 4,363,125 | null | 1 | 855 | Greetings
I have a Main Window which will hold multiple User Controls. I will give you a better view with an example picture:

```
<!--Player 1-->
<local:ucRaces x:Name="ucRacesP1" Width="78" Height="33" Visibility="Hidden" />
<Image Name="imageRacePlayer1" Height="27" Width="27" />
<!--Player 2-->
<local:ucRaces x:Name="ucRacesP2" Width="78" Height="33" Visibility="Hidden" />
<Image Name="imageRacePlayer2" Height="27" Width="27" />
```
- - - -
Now what I want to do is, when a person selects a value in UC3 the properties for player1 need to be set. When a value gets selected in UC4 I need the properties for player2 to be set. I was thinking to do this with properties but when searching for Properties and WPF I stumbled upon Dependency Properties. Which started to confuse me a bit, would I need to use normal Properties or these Dependency Properties.
- How can I know if I have to set the player1 values or the player2 values (this depends from which UserControl sends the data)?- How would I save these values best for the entire application?- Is putting the User Controls on hidden at the start (due to positioning) the best way or is there a better alternative?
Thank you for your time reading my question(s)!
| WPF - Global Properties and User Controls | CC BY-SA 2.5 | 0 | 2010-12-06T03:41:31.987 | 2010-12-06T23:10:15.160 | 2010-12-06T23:09:56.080 | null | null | [
"c#",
"wpf",
"properties",
"controls"
] |
4,363,349 | 1 | null | null | 2 | 3,741 | I want to make an iPad application but problem is the iPad's interface builder (xib )file is larger than normal ipad with scrollers. So,it's very difficult to place elements on such file.I want to know that(xib) of ipad is always like this and if not ,how can i make it in normal size ?I hope the question is understandable.


| Ipad interface builder (xib) problem | CC BY-SA 2.5 | null | 2010-12-06T04:57:51.120 | 2013-05-07T12:42:03.930 | 2011-02-08T03:48:46.760 | 401,198 | 401,198 | [
"iphone",
"objective-c",
"xcode",
"ipad"
] |
4,363,375 | 1 | 4,363,407 | null | 1 | 155 | I've uploaded a simple Azure website (am testing out authentication) and have found this:
[http://mateerweb.cloudapp.net/](http://mateerweb.cloudapp.net/) (live for next 12 hours or so!)

Its supposed to look like this:

How to get the live version looking like the test one on every deploy. After a recompile sometimes it works..
| Azure Sample Website Graphics not working | CC BY-SA 2.5 | null | 2010-12-06T05:03:32.073 | 2010-12-06T05:09:54.740 | null | null | 26,086 | [
"asp.net",
"azure"
] |
4,363,512 | 1 | null | null | 1 | 395 | I have this mp3 folder that contains mp3 generate from Google Text To Speech (TTS).

Since the , i cant use this command to join the mp3 via php script.
```
cat file1.mp3 file2.mp3 > new_file1.mp3
```
This command works but it join the mp3 without the correct order.
```
cat *.mp3 > new_filename.mp3
```
Question is how to join the mp3 based on the date time it created? Or if i rename all the mp3 into 1.mp3 etc filename, i want it to be join based on the filename ascending.
| how to join mp3 in linux machine using php | CC BY-SA 2.5 | null | 2010-12-06T05:32:15.433 | 2012-01-11T13:19:48.177 | 2010-12-06T05:50:05.993 | 417,899 | 417,899 | [
"php",
"linux",
"mp3"
] |
4,363,522 | 1 | 4,367,747 | null | 31 | 11,744 | I am trying to do "continuous integration" with TeamCity. I would like to label my builds in a incremental way and the GUID provided by the VCS is not as usefull as a simple increasing number. I would like the number to actually match the revision in number in Mercurial.
My state of affairs:

Mercurial info:

I would like the build to be labeled 0.0.12 rather than the GUID.
Would someone be so kind and save me hours of trying to figure this out ?
| How can I label my build with revision number and not the GUID (in TeamCity)? | CC BY-SA 2.5 | 0 | 2010-12-06T05:33:33.457 | 2013-05-23T09:08:39.073 | null | null | 4,694 | [
"mercurial",
"teamcity"
] |
4,363,943 | 1 | 4,367,319 | null | 3 | 1,009 | I'm trying to reproduce (part of) the work in this paper: [http://www.mit.edu/~kimo/publications/harmonization/](http://www.mit.edu/~kimo/publications/harmonization/)
I can't figure out quite what they mean by "Haar pyramids". I've found all kinds of things on the Gaussian and Laplacian image pyramids, as well as plenty on Haar filters, but nowhere (outside of this paper) have I found anything that is referred to as a "Haar pyramid".
At the moment, I'm using roughly the 2D Haar transform linked to at the bottom of this page (slightly edited to work with my own image format): [http://www.cs.ucf.edu/~mali/haar/](http://www.cs.ucf.edu/~mali/haar/)
When given this:

It produces this:

Is this what I'm looking for? I'm having trouble understanding how there is any advantage to processing images in this format. Also, the paper mentions that they use "oversampled" Haar pyramids, which I believe means that they aren't resizing the image on each pass through the filter. If that's the case, then how can I store all of these images compactly? I like the code I have because it stores everything in just one bitmap, and the thought of having to store an array of multiple instances of the picture is not too attractive.
The slightest insight into any part of my question would be much appreciated. Thanks!
| What are Haar Pyramids? | CC BY-SA 2.5 | 0 | 2010-12-06T06:50:41.270 | 2010-12-06T14:33:09.447 | 2010-12-06T07:10:48.690 | 366,904 | 385,086 | [
"image",
"image-processing",
"signal-processing",
"haar-wavelet"
] |
4,364,150 | 1 | 4,364,184 | null | 3 | 450 | This may not be a programming related but possibly programmers would be in the best position to answer it.
For camera calibration I have a 8 x 8 square pattern printed on sheet of paper. I have to manually enter these co-ordinates into a text file. The software would then pick it up from there and compute the calibration parameters.
Is there a script or some software that I can run on these images and get the pixel co-ordinates of the 4 corners of each of the 64 squares?

| How to find pixel co-ordinates of corners of a square pattern? | CC BY-SA 2.5 | 0 | 2010-12-06T07:32:22.887 | 2011-12-24T14:50:31.347 | 2011-12-24T14:50:31.347 | 360,840 | 142,299 | [
"language-agnostic",
"image-processing",
"opencv",
"camera-calibration"
] |
4,364,436 | 1 | null | null | 0 | 61 | Nearly pulling my hair out on this one.

I developed my iPhone app mostly using the 3.1.2 SDK and Three20. (there is no version associated with the cut of Three20 I was using, but the latest date in the CHANGES doc is May 31st, 2010.)
I upgraded to the 4.1 SDK and things mostly ran fine. I decided to upgrade Three20 to the latest version as well, but I encountered the compile issue listed [here](https://devforums.apple.com/thread/68687) (note: apple login required). After a lot of strife I was able to solve the issue with the help of that thread, but, lo and behold, the app is now completely blank.
The skeleton is there: tabbed navigation, with four tabs (the fourth is currently selected in my pic), but no data. Even switching to the previous version of Three20 no longer works. I'm baffled. Any ideas?
| iPhone app nearly blank in simulator after upgrade from 3.1.3 to 4.1 | CC BY-SA 2.5 | null | 2010-12-06T08:21:24.437 | 2010-12-06T08:32:10.577 | null | null | 44,440 | [
"iphone",
"ios-simulator",
"iphone-sdk-4.1"
] |
4,364,945 | 1 | 4,365,052 | null | 3 | 200 | I backuped a project and then reinstalled my OS (Win 7, if it matters).
I reinstalled VS 2010, and I reinstalled the support of protobuf.net to VS 2010.
Before that, the serializing and de-serializing were both perfectly OKAY, but now the wont work, and every time i step into them with the debugger:

| I again have a problem with protobuf.net | CC BY-SA 2.5 | null | 2010-12-06T09:33:11.717 | 2010-12-06T09:57:54.490 | null | null | 389,222 | [
"c#",
"protobuf-net"
] |
4,365,277 | 1 | 4,493,798 | null | 1 | 2,260 | I am trying to implement following thing in android 2.x.

In my application i want to allow the user to create the custom live wallpaper kind of thing where
user chooses few images and then those image will rotate in a typical fashion and after that user will be able to set it all the view as a live wallpaper within the application only.
i have successfully implemented the selection of images and its rotation now i don't know how to set live wallpaper within the application. i have tried implementing Live Wallpaper chooser but it is used to access already installed live wallpaper. but what about the dynamically created live wallpaper?
Even i tried to call it using following line of code
```
intent.setClassName("com.android.wallpaper.livepicker", "com.android.wallpaper.livepicker.LiveWallpaperPreview");
```
But it is giving me an error
```
java.lang.SecurityException: Permission Denial: starting Intent { cmp=com.android.wallpaper.livepicker/.LiveWallpaperPreview } from ProcessRecord{43f94a38 29784:com.vb.ui/10038} (pid=29784, uid=10038) requires null
```
is it possible to install live wallpaper apk programmatically so that once the live wallpaper is created it is being installed by the application ?
if live wallpapers are stored in some place then we can store user created live wallpaper at that place so when live wallpaper chooser is being selected we can see the live wallpaper in the list
| call Live wallpaper within application | CC BY-SA 2.5 | null | 2010-12-06T10:10:00.347 | 2011-03-31T15:41:46.470 | 2011-03-31T15:41:46.470 | 19,750 | 405,383 | [
"android",
"live-wallpaper"
] |
4,365,284 | 1 | 4,365,314 | null | 1 | 352 | I am developing an iPhone app, and I am the following problem.
I have declared the outlets and properties for UILabel in my header file, but in XIB I am not able to find the outlets for UILabel.
Here is a snippet which shows my header file declaration of IBOutlets for UILabels:

What should I do?
| Outlets to UILabel Not Found in XIB even after declaring Outlets in header file | CC BY-SA 4.0 | null | 2010-12-06T10:10:53.683 | 2019-09-09T20:54:22.040 | 2019-09-09T20:54:22.040 | 472,495 | 463,857 | [
"iphone",
"objective-c",
"cocoa-touch",
"ios4"
] |
4,365,297 | 1 | 4,613,786 | null | 5 | 12,852 | I am experiencing a weird scrolling issue and I was hoping someone could give me a hand in trying to identify why this is happening.
I have included the part of my code that I think is relevant to the question but am happy to update this post with whatever else is needed.
I have implemented a pull to refresh view in the tableview's content inset area. The refresh fires an Async NSURLConnection that pulls data from a webserver, parses the relevant information and refreshes the table as required.
This is where the refresh process kicks off:
```
- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate{
if (scrollView.contentOffset.y <= - 65.0f && !self.reloading) {
self.reloading = YES;
[self reloadTableViewDataSource];
[refreshHeaderView setState:EGOOPullRefreshLoading];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.2];
self.tableView.contentInset = UIEdgeInsetsMake(60.0f, 0.0f, 0.0f, 0.0f);
[UIView commitAnimations];
}
}
```
Problem is if I start to scroll whilst the content inset is "visible" (i.e. during reload) I get this weird behaviour where my table sections do not scroll all the way to the top - see screenshot for a clear visual of what I am trying to describe here.
Has anyone experienced this before? Any ideas on what I should be looking at to try and fix it?
Many thanks in advance,
Rog


| Issue scrolling table view with content inset | CC BY-SA 2.5 | 0 | 2010-12-06T10:12:40.127 | 2012-04-26T18:38:50.150 | 2011-01-03T03:22:25.600 | 714 | 401,092 | [
"iphone",
"cocoa-touch",
"uitableview"
] |
4,365,361 | 1 | 4,365,450 | null | 5 | 3,325 | Any idea why IB doesn't let me make this connection?

| Connecting UITextField in Interface Builder to IBOutlet defined in code | CC BY-SA 2.5 | null | 2010-12-06T10:20:45.467 | 2010-12-06T10:43:43.657 | 2010-12-06T10:26:11.333 | 8,005 | 8,005 | [
"iphone",
"objective-c",
"ios",
"interface-builder"
] |
4,365,670 | 1 | 4,366,363 | null | 2 | 1,556 | I added one msi file in a setup project through Importfolder option in Wix as shown in figure.
Now if i build it.It gives following error:
```
ERROR:
----- Starting C:\Program Files\WixEdit\wix-3.0.5419.0\light.exe "REDtrack_Setup.wixobj" -cultures:en-us -out "REDtrack_Setup.msi" -ext WixIisExtension -ext WixSqlExtension -ext WixUtilExtension at 12/6/2010 4:29:48 PM
Microsoft (R) Windows Installer Xml Linker version 3.0.5419.0
Copyright (C) Microsoft Corporation. All rights reserved.
D:\Apps\REDtrack Setup\REDtrack_Setup\REDtrack_Setup.wxs(2334) : error LGHT0267 : Found orphaned Component 'REDtrackService_Setup.msi'. If this is a Product, every Component must have at least one parent Feature. To include a Component in a Module, you must include it directly as a Component element of the Module element or indirectly via ComponentRef, ComponentGroup, or ComponentGroupRef elements.
D:\Apps\REDtrack Setup\REDtrack_Setup\REDtrack_Setup.wxs(1685) : warning LGHT1008 : The action 'PublishFeatures' in the InstallExecuteSequence table is being suppressed.
D:\Apps\REDtrack Setup\REDtrack_Setup\REDtrack_Setup.wxs(1686) : warning LGHT1008 : The action 'RegisterProduct' in the InstallExecuteSequence table is being suppressed.
D:\Apps\REDtrack Setup\REDtrack_Setup\REDtrack_Setup.wxs(1687) : warning LGHT1008 : The action 'PublishProduct' in the InstallExecuteSequence table is being suppressed.
D:\Apps\REDtrack Setup\REDtrack_Setup\REDtrack_Setup.wxs(1688) : warning LGHT1008 : The action 'RegisterUser' in the InstallExecuteSequence table is being suppressed.
----- Finished
Error in light
```
How can i resolve it.

| How to include a msi file in a Wix setup project | CC BY-SA 2.5 | null | 2010-12-06T11:00:14.883 | 2010-12-06T12:24:52.087 | null | null | 503,125 | [
"wix",
"windows-installer"
] |
4,365,856 | 1 | 4,420,108 | null | 4 | 4,289 | I asked a similar question already which got me to where I am now but I really need some help on this one. Its the last thing in my way to completing something cool (in my eyes lol)
I have a 3d world where I can move around and in this world are simple cubes.
Using the function -(CGPoint)getScreenCoorOfPoint:(IMPoint3D)_point3D I can work out where these cubes are in X,Y within the 3D world. But its not based on where I am but where they are with the 3d Area. Using the same function, I can also work out where I am. Also I can find out where someone has tapped on the screen.
How on earth do I map these together so that I can work out if I have clicked one of them?
Surely I need something to work out which way I am facing. People have suggested rendering them off screen and doing something but it went completely over my head. I think of scrapping the function about and building my own based on the 3d coords (somehow)
Code
```
for (NSDictionary *item in self.players)
{
int x;
int z;
x = [[item objectForKey:@"posX"] floatValue];
z = [[item objectForKey:@"posZ"] floatValue];
IMPoint3D playerPos;
playerPos.x = x;
playerPos.z = z;
playerPos.y = 1;
CGPoint screenPositionOfThisCube ;
screenPositionOfThisCube = [self getScreenCoorOfPoint:playerPos];
#define TUNE 28
CGRect fingerSquish = CGRectMake(
screenPositionOfThisCube.x - TUNE,
screenPositionOfThisCube.y - TUNE,
TUNE * 2,
TUNE * 2);
// now check that the POINT OF THE TOUCH
// is inside the rect fingerSquish
if ( CGRectContainsPoint( fingerSquish, pos ) )
{
NSLog(@"WOOP");
// YOU HAVE FOUND THE TOUCHED CUBEY.
// YOU ARE DONE. this item is the cube being touched.
// make the cube change color or something to test it.
}
}
```
I also trying out gluUnproject with no success (see my other post)

| iPhone : OpenGL ES : Detecting if you have tapped a object (cube) on screen | CC BY-SA 2.5 | null | 2010-12-06T11:23:43.553 | 2011-04-20T07:04:15.890 | 2010-12-14T20:00:10.557 | 44,729 | 369,313 | [
"iphone",
"opengl-es",
"picking"
] |
4,366,091 | 1 | 4,366,127 | null | 0 | 205 | I have been programming C# on Visual Studio for a while and now that I am back at Eclipse + PHP I am missing the great code assistant tool. Well, I tried to enable it from everywhere and it shows up -- .
This is what I want to see:

I do see the left side of the assistant, but for some reason I do not see the right side -- which is the more useful part of the two!
| How to enable Eclipse Code Assistant for PHP? | CC BY-SA 2.5 | null | 2010-12-06T11:51:33.357 | 2010-12-06T12:03:14.233 | null | null | 283,055 | [
"php",
"eclipse"
] |
4,366,119 | 1 | 4,370,253 | null | 8 | 2,629 | OK, I have this problem to solve but I can’t program it in Java correctly. See the picture below, you’ll see a 6 pointed star were every point and intersection of lines is a letter.

The assignment is to position the numbers 1 to 12 in such a way that the sum of all lines of four balls is 26 and the sum of all the 6 points of the star is 26 as well.
This comes down to:
- - - - - - -
So I started programming a program that would loop through all options brute forcing a solution. The loop is working, however, it now shows solutions where one number is used more than once, which is not allowed. How can I make it in the code that it also checks whether all variables are different or not?
```
if ((A!= B != C != D != E != F != G != H != I != J != K != L)
```
I tried the above, but it doesn't work, because it says:
> incomparable types: boolean and int.
(instead of making a nested 12*12 statement which checks every variable combination)
This is my code so far:
```
public class code {
public static void main(String[] args){
for(int A = 1; A < 13; A++){
for(int B = 1; B < 13; B++){
for(int C = 1; C < 13; C++){
for(int D = 1; D < 13; D++){
for(int E = 1; E < 13; E++){
for(int F = 1; F < 13; F++){
for(int G = 1; G < 13; G++){
for(int H = 1; H < 13; H++){
for(int I = 1; I < 13; I++){
for(int J = 1; J < 13; J++){
for(int K = 1; K < 13; K++){
for(int L = 1; L < 13; L++){
if ((A+C+F+H==26) && (A+D+G+K==26) && (B+C+D+E==26) && (B+F+I+L==26) && (E+G+J+L==26) && (H+I+J+K==26) && (A+B+E+H+K+L==26)){
if ((A= C != D != E != F != G != H != I != J != K != L)){
System.out.println("A: " + A);
System.out.println("B: " + B);
System.out.println("C: " + C);
System.out.println("D: " + D);
System.out.println("E: " + E);
System.out.println("F: " + F);
System.out.println("G: " + G);
System.out.println("H: " + H);
System.out.println("I: " + I);
System.out.println("J: " + J);
System.out.println("K: " + K);
System.out.println("L: " + L);
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
```
| How to write an "all these numbers are different" condition in Java? | CC BY-SA 3.0 | 0 | 2010-12-06T11:55:33.880 | 2011-08-12T02:00:23.747 | 2011-08-12T02:00:23.747 | 600,500 | 489,284 | [
"java",
"if-statement"
] |
4,366,218 | 1 | 4,366,292 | null | 1 | 906 | Is there a standard way to implement a button like the one below in a navigation bar? If not I can, of course, just use an image or maybe a custom view but as it's used in quite a few apps I thought there may be a method I'm missing.

| iPhone Add Item/Row Button in Navigation Bar | CC BY-SA 2.5 | 0 | 2010-12-06T12:07:45.863 | 2011-03-02T05:32:15.907 | 2010-12-06T12:13:03.140 | 348,308 | 348,308 | [
"iphone",
"button",
"uinavigationbar"
] |
4,366,226 | 1 | 4,368,584 | null | 9 | 6,942 | If you have ever asked how can I debug releasing/alloc issues in objective-c, you will have came across these environment settings that can help track the problem down:
- `NSZombieEnabled`- `MallocStackLogging`- `NSDebugEnabled`
You set all of these to `YES` in the 'environment' section of the 'arguments' tab in the 'executables' (found in group tree) info.
---
So, Im getting this console output
> MyApp [:40b] -[CALayer
retainCount]: message sent to
deallocated instance
then open terminal, while the debugger has forwarded the break and type:
> malloc_history
Then, I get a big text dump, and as far as I understand the important bit is this:
1
```
ALLOC 0x4dbb160-0x4dbb171 [size=18]:
thread_a0375540 |start | main |
UIApplicationMain | GSEventRun |
GSEventRunModal | CFRunLoopRunInMode |
CFRunLoopRunSpecific | __CFRunLoopRun
| __CFRunLoopDoTimer |
__CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__
| __NSFireDelayedPerform |
-[todoListViewController drillDocumentMenu:] |
-[documentListViewController drillIntoDocumentWithToDoRecord:] |
-[documentViewController OpenTodoDocument:OfType:WithPath:] |
-[documentViewController OpenDocumentOfType:WithPath:] |
-[documentViewController managePDFDocumentWithPath:] |
-[PDFDocument loadPDFDocumentWithPath:andTitle:] |
-[PDFDocument getMetaData] | CGPDFDictionaryApplyFunction |
ListDictionaryObjects(char const*,
CGPDFObject*, void*) | NSLog | NSLogv
| _CFLogvEx | __CFLogCString |
asl_send | _asl_send_level_message |
asl_set_query | strdup | malloc |
malloc_zone_malloc
```
2
```
FREE 0x4dbb160-0x4dbb171 [size=18]:
thread_a0375540 |start | main |
UIApplicationMain | GSEventRun |
GSEventRunModal | CFRunLoopRunInMode |
CFRunLoopRunSpecific | __CFRunLoopRun
| __CFRunLoopDoTimer |
__CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__
| __NSFireDelayedPerform |
-[todoListViewController drillDocumentMenu:] |
-[documentListViewController drillIntoDocumentWithToDoRecord:] |
-[documentViewController OpenTodoDocument:OfType:WithPath:] |
-[documentViewController OpenDocumentOfType:WithPath:] |
-[documentViewController managePDFDocumentWithPath:] |
-[PDFDocument loadPDFDocumentWithPath:andTitle:] |
-[PDFDocument getMetaData] | CGPDFDictionaryApplyFunction |
ListDictionaryObjects(char const*,
CGPDFObject*, void*) | NSLog | NSLogv
| _CFLogvEx | __CFLogCString |
asl_send | _asl_send_level_message |
asl_free | free
```
3
```
ALLOC 0x4dbb170-0x4dbb19f [size=48]:
thread_a0375540 |start | main |
UIApplicationMain | GSEventRun |
GSEventRunModal | CFRunLoopRunInMode |
CFRunLoopRunSpecific | __CFRunLoopRun
| __CFRunLoopDoTimer |
__CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__
| __NSFireDelayedPerform |
-[todoListViewController drillDocumentMenu:] |
-[documentListViewController drillIntoDocumentWithToDoRecord:] |
-[documentViewController OpenTodoDocument:OfType:WithPath:] |
-[documentViewController OpenDocumentOfType:WithPath:] |
-[documentViewController managePDFDocumentWithPath:] |
-[ScrollViewWithPagingViewController init] | -[UIView init] |
-[UIScrollView initWithFrame:] | -[UIView initWithFrame:] | UIViewCommonInitWithFrame | -[UIView
_createLayerWithFrame:] | +[NSObject(NSObject) alloc] | +[NSObject(NSObject) allocWithZone:] | class_createInstance |
_internal_class_createInstanceFromZone | calloc | malloc_zone_calloc
```
---
EDIT (fresh run= different object pointers):
Zombie Detection with instruments:

Why and how, does the retain count jump from 1 to -1?
Looking at the backtrace of the Zombie, looks like the retain count is being called by: Quartz through release_root_if_unused

---
Edit: - I was removing a view from super, then releasing it. Fixed by just releasing it.
| Understanding a malloc_history dump | CC BY-SA 3.0 | 0 | 2010-12-06T12:08:46.440 | 2013-10-21T00:07:08.993 | 2017-02-08T14:31:11.857 | -1 | 293,008 | [
"objective-c",
"ios",
"malloc-history"
] |
4,366,796 | 1 | 4,366,884 | null | 4 | 2,275 | I'm sure this is normal and I'm just misunderstanding something, but since making one of my `NSScrollView`s slightly inset from the bottom of the window (as opposed to taking the full height), a blue border has appeared around it.
I've set `NSNoBorder` on the scroll view, so this must be something else.
```
[scrollView setBorderType:NSNoBorder];
```
Any pointers would be greatly appreciated. I'd like the border to go away as it spoils the look of the app and just looks broken.
I assume it's the scroll view. The view inside it as an `NSOutlineView`, so maybe it's something on that?

| Blue border appearing around NSScrollView | CC BY-SA 2.5 | null | 2010-12-06T13:22:56.677 | 2010-12-06T13:32:19.093 | null | null | 322,122 | [
"objective-c",
"cocoa",
"macos",
"nsoutlineview",
"nsscrollview"
] |
4,366,852 | 1 | 4,367,014 | null | 0 | 1,255 | I apologize if the question already exists...
Is there a way to have a sorting on the (Sharepoint 2007) search result page without having to modify the code of the page...? ANd how, if so?
I am trying to sort on title when the result is loaded:

It should be something simple.., but I am new to sharepoint.. so I appreciate any help..
Thanks!!
Katya
| Sharepoint 2007 => Search => Sorting | CC BY-SA 2.5 | 0 | 2010-12-06T13:29:00.310 | 2010-12-06T13:48:12.220 | null | null | 185,081 | [
"sharepoint-2007"
] |
4,367,518 | 1 | 4,367,617 | null | 0 | 683 | i want to have two data on each row on my tableview.
Something like Recent Call (on the left the name, on the right the day)
this is my code:
```
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier] autorelease];
//cell.selectionStyle = UITableViewCellStyleValue1 ;
}
// Configure the cell.
NSDictionary *dictionary = [listaOggetti objectAtIndex:indexPath.section];
NSArray *array = [dictionary objectForKey:@"Elementi"];
NSString *cellValue = [array objectAtIndex:indexPath.row];
NSArray *array1 = [dictionary objectForKey:@"Tipo"];
NSString *cellDetail = [array1 objectAtIndex:indexPath.row];
if ([indexPath row] == 0){
cell.textLabel.text = cellValue;
cell.textAlignment = UITextAlignmentCenter;
cell.backgroundColor = [UIColor blueColor];
cell.font = [UIFont systemFontOfSize:13];
} else {
cell.textLabel.text = cellDetail;
cell.detailTextLabel.text = cellValue;
}
return cell;
}
```
i've try to use different style on
```
initWithStyle
```
without any result (only show my detailtext on the right).
In NSLOG i see the right value of cellDetail.
```
{
Elementi = (
"Chiamate e Videochiamate Nazionali",
"08m:43s",
"1h:31m:17s",
"1h:40m:00s"
);
},
{
Tipo = (
Effettuato,
Rimanente,
Totale
);
},
{
Elementi = (
"SMS e MMS Nazionali",
21,
29,
50
);
},
{
Tipo = (
Effettuato,
Rimanente,
Totale
);
},
{
Elementi = (
"Traffico Dati FMM",
"69.95 MB",
"954.05 MB",
"1024.00 MB"
);
},
{
Tipo = (
Effettuato,
Rimanente,
Totale
);
},
{
Elementi = (
Skype,
"00m:00s",
"3h:20m:00s",
"3h:20m:00s"
);
},
{
Tipo = (
Effettuato,
Rimanente,
Totale
);
},
{
Elementi = (
"WWW3, Yahoo!, Google, eBay e altri servizi",
"0.00 MB",
"100.00 MB",
"100.00 MB"
);
},
{
Tipo = (
Effettuato,
Rimanente,
Totale
);
}
)
```
my goal is to obtain cells like this:

| UITableview with two data per row | CC BY-SA 2.5 | null | 2010-12-06T14:42:03.437 | 2010-12-06T18:01:13.447 | 2010-12-06T15:49:07.760 | 314,538 | 314,538 | [
"iphone",
"objective-c",
"uitableview"
] |
4,367,572 | 1 | null | null | 0 | 1,365 | I'm making a UI designed as shown below. View 1 is an image, when showing different pictures, its size will be different. The sizes of view 2 and view 3 are depend on View 1. How to define the xml file to make this happen?
ps: The design came from client so I can't change it.

| How to make a view's size depend on another view's size? | CC BY-SA 2.5 | 0 | 2010-12-06T14:48:34.320 | 2010-12-07T11:49:53.940 | 2010-12-06T14:55:14.620 | 423,989 | 423,989 | [
"android",
"user-interface"
] |
4,367,876 | 1 | null | null | 1 | 1,396 | Sorry for this newb question, i'm new to UML.
The diagram for a system is this one:
From what I know of UML, none of the classes in this diagram can own instances of the associated class as there's no aggregate relationship with it.
Does this mean in an implementation of the system in Java, based on the diagram, an outside class has to own instances of the associated class?
Sorry if the answer is obvious. I've spent hours scratching my head over it.
| Who owns the associated class in this uml diagram? | CC BY-SA 2.5 | 0 | 2010-12-06T15:22:02.343 | 2010-12-06T21:39:19.987 | 2010-12-06T15:27:59.210 | 492,364 | 532,329 | [
"uml"
] |
4,367,927 | 1 | 4,368,137 | null | 2 | 7,571 | In my Cocoa application I want to show the user a list of available network interfaces, like Wireshark does:

What is the best way of getting such a list? Does Apple provide a framework for this, or must I use a C API from the standard library or another library?
| Get a list of all available network interfaces (en0, en1, en2, etc) with Cocoa? | CC BY-SA 4.0 | 0 | 2010-12-06T15:27:07.670 | 2018-09-21T15:45:22.907 | 2018-09-21T15:45:22.907 | 1,387,438 | null | [
"objective-c",
"cocoa",
"networking"
] |
4,368,028 | 1 | null | null | 0 | 263 | I have a problem with pyglet on one of my notebooks. I'm working on a relatively complex 2D-Game but it occurs even with the most minimalistic pyglet application you can imagine:
```
import pyglet
if __name__ == '__main__':
window = pyglet.window.Window(width=100, height=100)
window.clear()
ball_img = pyglet.image.load('ball.gif')
ball = pyglet.sprite.Sprite(ball_img)
@window.event
def on_draw():
ball.draw()
pyglet.app.run()
```
It should display an image of a ball like this:

But what it's drawing is a somehow stretched image:

If I replace `ball.draw()` with `ball_img.blit(0, 0, 0)` it gets rendered as expected.
The notebook is a small Thinkpad X40 running Linux (Intel integrated graphics).
How can such a behaviour be caused or what is likely to be causing this?
| pyglet sprite/texture issue: stretched from bottom left | CC BY-SA 2.5 | null | 2010-12-06T15:38:00.737 | 2011-01-07T14:06:23.917 | 2010-12-06T15:56:10.770 | 28,169 | 520,463 | [
"python",
"linux",
"opengl",
"pyglet"
] |
4,368,470 | 1 | null | null | 2 | 2,647 | I have some data displaying on charts using the standard Silverlight charts from the Silverlight Toolkit, however all of the data will not display on one graph and there seems to be large amounts of spacing going on in between each set of colums which results in the right hand side columns of data being 'chopped' off.
Does anyone know how I can decrease this spacing and / or tell the graph to have a fixed width so that it fits in all columns.
Below is an image to visually demonstrate the issue.

I add on the original question that, I want a direct way to set fixed width for each ColumnSeries. I tried that using
```
<Style x:Key="DataPointStyle1" TargetType="charting:ColumnDataPoint">
<Setter Property="Width" Value="5px" />
</Style>
```
And then, in ColumnSeries markup:
```
<charting:ColumnSeries
IndependentValueBinding="{Binding Path=Key}"
DependentValueBinding="{Binding Path=Value}"
DataPointStyle="{StaticResource DataPointStyle1}"
Title="Sales Amount"/>
```
But it just gets relative width to the width of the chart and to the # of the series-es.
| Silverlight Column Series Chart Width Question | CC BY-SA 2.5 | 0 | 2010-12-06T16:15:33.037 | 2011-02-08T21:57:57.023 | 2011-02-08T10:58:56.633 | 502,436 | 492,035 | [
"silverlight",
"silverlight-4.0",
"charts",
"silverlight-toolkit"
] |
4,368,754 | 1 | 4,375,000 | null | 1 | 3,249 | Ive been using the code below for my auto-completes on my form for a while , but after updating jquery ui to version 1.8.6 from 1.8rc3 it has broken the formatting of the JSONP return. The returned data is no longer formatted html, but instead it is a string. Any Ideas?
[http://jsfiddle.net/blowsie/ejLPg/](http://jsfiddle.net/blowsie/ejLPg/)
```
$("#companyname").autocomplete({
source: function (request, response) {
$.ajax({
url: turl,
dataType: "jsonp",
data: {
maxRows: 9,
name_startsWith: request.term
},
success: function (data) {
response($.map(data, function (item) {
return {
label: "<span class='ui-menu-item-title'>" + item.name.toLowerCase() + "</span><span class='ui-menu-item-subtitle'>" + item.address1.toLowerCase() + ' ' + item.post_code.toLowerCase() + '</span>',
value: item.name_id
}
}))
}
})
},
minLength: 3,
delay: 50,
select: function (event, ui) {
LoadGivenCompany(ui.item.value);
},
open: function () {
$(this).removeClass("ui-corner-all").addClass("ui-corner-top");
},
close: function () {
$(this).removeClass("ui-corner-top").addClass("ui-corner-all");
},
focus: function () { return false }
});
```

Thanks in advance
| Jquery UI Autocomplete Ajax JSONP return is broken in JQ UI Version 1.8.6 | CC BY-SA 2.5 | 0 | 2010-12-06T16:41:11.373 | 2011-02-24T00:27:18.447 | 2010-12-07T09:01:51.153 | 370,286 | 370,286 | [
"ajax",
"jquery-ui",
"jquery",
"jsonp"
] |
4,368,894 | 1 | null | null | 0 | 478 | In the query below there is a field called `main` which is used to differentiate the categories.
So, there are common categories and main categories and both can be found on a tree. The `main` field is just a type and there's nothing with the tree structure, I mean, it's like a status field.
```
SELECT `c`.*,
(count(p.id)-1) AS `depth`
FROM `categories` AS `c`
CROSS JOIN `categories` AS `p`
WHERE (c.lft BETWEEN p.lft AND p.rht)
AND (c.root_id =p.root_id)
AND (p.main =1)
GROUP BY `c`.`id`
ORDER BY `c`.`root_id` ASC, `c`.`lft` ASC
```
There is a `where` clausule which specify that the parent category need to be a main category. Also, sometimes I need to do a `select` where the parent category is a common category `p.main =0`.
The `depth` is the position of the element in the tree. So if a category is a one level children of another, the depth will be `1`, if two levels, the depth will be `2`.
My problem is that when I do the select above, if there are children marked as common category on a tree where the father is a main category (selecting `p.main =1`) the common categories `depth` is always `0`.
In other words, the select works properly, if I select all categories that has the top parent marked as `main`, it will display the tree with all categories including children categories marked with `main=0`. But in this case, the depth is always `0`
See the results:

The category `1423` is a child of `27` and is not a main category, but `27` is, so depth is `0`, but need to be `1`. The category `276` is a child of `64` and both are a main categories, so it has the right depth.
How can I change this query so that the `depth` field work as expected?
Reference here: [How to generate a tree view from this result set based on Tree Traversal Algorithm?](https://stackoverflow.com/questions/3638551/how-to-generate-a-tree-view-from-this-result-set-based-on-tree-traversal-algorith)
| How to change this CROSS JOIN SQL created for a tree traversal (nested set)? | CC BY-SA 2.5 | null | 2010-12-06T16:56:38.587 | 2010-12-09T19:12:20.237 | 2017-05-23T12:30:37.427 | -1 | 260,610 | [
"sql",
"mysql",
"nested-sets",
"modified-preorder-tree-t"
] |
4,369,689 | 1 | 4,374,711 | null | 4 | 698 | I have a jQuery `mouseup` event set on the background element that is blue with dotted lines (thats a background image, not elements). It only fires if one of the other elements is not laid on top. I could relay the event in code, but that seems to invite chaos. Is there a way to get the blue element to receive the `mouseup` event even if another element is resting on top?
Also, currently , the red, blue, and black overlay elements are not children of the blue background element, but they could be, if need be.

## Edit:::::
Refactoring the html to nest the elements in to a parent-child relationship worked.
| jQuery - fire mouse event even when another element is on top | CC BY-SA 2.5 | null | 2010-12-06T18:31:31.603 | 2010-12-07T08:33:56.190 | 2010-12-06T19:07:12.677 | 84,131 | 84,131 | [
"jquery",
"events",
"mouseevent"
] |
4,370,295 | 1 | 4,370,400 | null | 0 | 126 | In some of my text editors, there's a feature that draws vertical lines down the tab stops which makes it a breeze to ensure that braces are matched.

Does VS2010 have such a feature?
| Tab markings in VS2010 | CC BY-SA 2.5 | null | 2010-12-06T19:45:26.650 | 2010-12-06T19:57:50.150 | 2010-12-06T19:52:51.440 | 14,357 | 14,357 | [
"visual-studio-2010",
"text-editor"
] |
4,370,501 | 1 | 4,391,790 | null | 0 | 392 | I had a Visual Studio 2010 MVC 2 project with spanish characters in my views.
I converted the project to Telerik MVC 2 project and now I get weird characters in place of the special characters in my views during execution (they're shown ok in the aspx code in Visual Studio).
E.g.: I used to see this during execution:

I now I see this:

This only happens with the Master Page content.
In Visual Studio: where do I set the encoding used when saving/loading files? The Telerik conversion seems to have messed that up, right?
| Visual Studio project character set problem | CC BY-SA 2.5 | null | 2010-12-06T20:12:40.743 | 2010-12-08T20:10:59.157 | 2010-12-08T20:10:59.157 | 26,699 | 26,699 | [
"visual-studio",
"encoding"
] |
4,370,707 | 1 | 4,410,383 | null | 2 | 280 | I have a currently silverlight graph that needs to be changed to a image graph
I can get the columns and data in there fine

however I cannot seem to figure out how to colorize the bars as below (right now I use the max 20% values as red anything between 20% and 80% of max is yellow and the low 20% as green)

| asp.netmvc web helpers chart themeing | CC BY-SA 2.5 | 0 | 2010-12-06T20:37:39.000 | 2010-12-10T15:29:40.703 | 2010-12-06T20:57:48.757 | 84,791 | 84,791 | [
"asp.net-mvc",
"asp.net-mvc-3"
] |
4,370,779 | 1 | 4,370,978 | null | 8 | 14,390 | I have written an application in c# and now i want to print its content in form of invoice as shown in figure i want to print costumer data only once but jobs he has asked to be performed on his car shown in datagrid view should be there in form of list with labour and total labour at the end of invoice.
some people suggested to use crystal reports I have never used them so looking for a simpler solution
cutting it short how can we print required values from form
| Print Invoice C# Winforms | CC BY-SA 2.5 | 0 | 2010-12-06T20:46:47.983 | 2010-12-06T22:28:18.867 | null | null | 430,167 | [
"c#",
"printing",
"invoice"
] |
4,371,003 | 1 | 4,371,117 | null | 12 | 27,302 | I have been searching for a solution to resize the text size in a div to make the text fill out the entire div height and width, with no avail.
I have made some images to help understand this problem:

So this is a simple div with a height and width set. This height and width does not change, the text in the box does! So what I want to do is to make that text fill the whole width and height of the div just like in the image below.

I have been working on the simple example below and I simply cannot find out how to do this. I have tried setting relative font-sizes with percentage, doing things with overflow,
text-aligning all not giving me the result I want.
```
<html>
<head>
<title>Test</title>
<style type="text/css">
#box1, #box2{
width: 400px;
height: 300px;
color: white;
margin: 10;
font-size:larger;
text-align:justify;
letter-spacing: 100%;
}
#box1 { background-color: green;}
#box2 { background-color: blue;}
</style>
</head>
<body>
<div id="box1">
Llorem ipsum foo bar baz
</div>
<div id="box2">
Foobar
</div>
</body>
</html>
```
Is this problem even solvable with simple CSS or will I have to do some javascript/jQuery?
| Dynamically resize text to fill div | CC BY-SA 2.5 | 0 | 2010-12-06T21:12:18.300 | 2013-09-20T08:06:21.650 | null | null | 368,379 | [
"javascript",
"jquery",
"html",
"css"
] |
4,371,205 | 1 | 4,371,222 | null | 0 | 1,937 | i used CrossFTP to create FTP Server

when i connected using firefox it works well.
but when using Apache commons it throws an Exception
```
import java.net.SocketException;
import org.apache.commons.net.ftp.FTPClient;
import java.io.IOException;
public class FtpConnectDemo {
public static void main(String[] args) throws SocketException, IOException {
FTPClient client = new FTPClient();
client.connect("ftp://192.168.1.150");
boolean login = client.login("ehab01", "CD7IZW0O");
if (login) {
System.out.println("Login success...");
boolean logout = client.logout();
if (logout) {
System.out.println("Logout from FTP server...");
}
} else {
System.out.println("Login fail...");
}
client.disconnect();
}
}
```
---
```
Exception in thread "main" java.net.UnknownHostException: ftp://192.168.1.150
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:849)
at java.net.InetAddress.getAddressFromNameService(InetAddress.java:1200)
at java.net.InetAddress.getAllByName0(InetAddress.java:1153)
at java.net.InetAddress.getAllByName(InetAddress.java:1083)
at java.net.InetAddress.getAllByName(InetAddress.java:1019)
at java.net.InetAddress.getByName(InetAddress.java:969)
at org.apache.commons.net.SocketClient.connect(SocketClient.java:184)
at org.apache.commons.net.SocketClient.connect(SocketClient.java:273)
at com.ftp.FtpConnectDemo.main(FtpConnectDemo.java:19)
```
| Apache commons ftp | CC BY-SA 2.5 | 0 | 2010-12-06T21:38:45.710 | 2012-05-18T15:24:15.763 | 2012-05-18T15:24:15.763 | 21,234 | 248,222 | [
"java",
"ftp",
"apache-commons-net"
] |
4,371,688 | 1 | null | null | 0 | 258 | I'm working a a location search box and I was wondering if you guys could give me some help.
I've looked through some resources and managed to get working city search with spelling correction. It basically searches for exact matches, if none are found, it searches for double metaphone matches and limits them by the (levenshtein/length)<0.5 .
I'd like to implement a way to parse states (and if possible neighborhoods).
My question is:
Is there a way for MySQL to search for the city (and state)? What I mean is, is there a way for me to split the string and pass the parts to MySQL without knowing what each part is? (what part is city and which is state)
I'm thinking about this because I'd like to have spelling correction/guessing instead of just looking through the string with an array of correctly spelled states - similar to the way I have it with the cities.
There is probably an easy way to do this, I'm just mentally fatigued from getting the current city search working. I'd appreciate any help on this. Thanks.
The tables,their fields and one sample row:
Cities:


| Parsing location string - MySQL query | CC BY-SA 2.5 | null | 2010-12-06T22:43:29.257 | 2010-12-07T13:15:01.567 | 2010-12-07T13:15:01.567 | 528,813 | 528,813 | [
"php",
"mysql",
"regex",
"parsing",
"geocoding"
] |
4,371,921 | 1 | null | null | 2 | 300 | The command is
```
Show[{PolyhedronData["TruncatedOctahedron"],
Graphics3D[
Translate[
PolyhedronData["TruncatedOctahedron", "Faces"], {30, 30, 30}],
{40, 40, 40}
]}]
```

which creates 1 additional copy of the original figure. If I want 1 more copy of it on the same image, how do I specify the translation vector for it? How should this command be modified?
| Mathematica translate - getting multiple copies | CC BY-SA 3.0 | null | 2010-12-06T23:12:32.533 | 2012-01-03T19:33:58.390 | 2012-01-03T19:33:58.390 | 615,464 | 532,991 | [
"wolfram-mathematica"
] |
4,372,062 | 1 | 4,372,301 | null | 2 | 868 | The code comes from [here](http://beej.us/guide/bgnet/output/html/multipage/clientserver.html)
Given that in C++ you can use C libraries would you say that the following code is a legitimate C++ code?
If not what changes need to be applied?
This code compiles with g++ and runs as expected.
UPDATE:
Thank you for all answers. I'm still slightly confused as there's no agreement on whether or not this code comply with C++ standards. Will ask another question to dispel my doubts
UPDATE2:
To moderators who closed this question:
Just noticed that the question has been closed which I think is ridiculous. It's a down-to-earth technical question and I received down-to-earth technical answers.In case you haven't read fully the whole thread, here's the visual representation of the conclusion we've agreed on:

Clearly C++ is not a superset of C.
Closing questions that deal with coding standards is just wrong.
Client:
```
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <netdb.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#define PORT "3490" // the port client will be connecting to
#define MAXDATASIZE 100 // max number of bytes we can get at once
// get sockaddr, IPv4 or IPv6:
void *get_in_addr(struct sockaddr *sa){
if (sa->sa_family == AF_INET) {
return &(((struct sockaddr_in*)sa)->sin_addr);
}
return &(((struct sockaddr_in6*)sa)->sin6_addr);
}
int main(int argc, char *argv[]){
int sockfd, numbytes;
char buf[MAXDATASIZE];
struct addrinfo hints, *servinfo, *p;
int rv;
char s[INET6_ADDRSTRLEN];
if (argc != 2) {
fprintf(stderr,"usage: client hostname\n");
exit(1);
}
memset(&hints, 0, sizeof hints);
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
if ((rv = getaddrinfo(argv[1], PORT, &hints, &servinfo)) != 0) {
fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(rv));
return 1;
}
// loop through all the results and connect to the first we can
for(p = servinfo; p != NULL; p = p->ai_next) {
if ((sockfd = socket(p->ai_family, p->ai_socktype,
p->ai_protocol)) == -1) {
perror("client: socket");
continue;
}
if (connect(sockfd, p->ai_addr, p->ai_addrlen) == -1) {
close(sockfd);
perror("client: connect");
continue;
}
break;
}
if (p == NULL) {
fprintf(stderr, "client: failed to connect\n");
return 2;
}
inet_ntop(p->ai_family, get_in_addr((struct sockaddr *)p->ai_addr),
s, sizeof s);
printf("client: connecting to %s\n", s);
freeaddrinfo(servinfo); // all done with this structure
if ((numbytes = recv(sockfd, buf, MAXDATASIZE-1, 0)) == -1) {
perror("recv");
exit(1);
}
buf[numbytes] = '\0';
printf("client: received '%s'\n",buf);
close(sockfd);
return 0;
}
```
Server:
```
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <sys/wait.h>
#include <signal.h>
#define PORT "3490" // the port users will be connecting to
#define BACKLOG 10 // how many pending connections queue will hold
void sigchld_handler(int s){
while(waitpid(-1, NULL, WNOHANG) > 0);
}
// get sockaddr, IPv4 or IPv6:
void *get_in_addr(struct sockaddr *sa){
if (sa->sa_family == AF_INET) {
return &(((struct sockaddr_in*)sa)->sin_addr);
}
return &(((struct sockaddr_in6*)sa)->sin6_addr);
}
int main(void){
int sockfd, new_fd; // listen on sock_fd, new connection on new_fd
struct addrinfo hints, *servinfo, *p;
struct sockaddr_storage their_addr; // connector's address information
socklen_t sin_size;
struct sigaction sa;
int yes=1;
char s[INET6_ADDRSTRLEN];
int rv;
memset(&hints, 0, sizeof hints);
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = AI_PASSIVE; // use my IP
if ((rv = getaddrinfo(NULL, PORT, &hints, &servinfo)) != 0) {
fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(rv));
return 1;
}
// loop through all the results and bind to the first we can
for(p = servinfo; p != NULL; p = p->ai_next) {
if ((sockfd = socket(p->ai_family, p->ai_socktype,
p->ai_protocol)) == -1) {
perror("server: socket");
continue;
}
if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &yes,
sizeof(int)) == -1) {
perror("setsockopt");
exit(1);
}
if (bind(sockfd, p->ai_addr, p->ai_addrlen) == -1) {
close(sockfd);
perror("server: bind");
continue;
}
break;
}
if (p == NULL) {
fprintf(stderr, "server: failed to bind\n");
return 2;
}
freeaddrinfo(servinfo); // all done with this structure
if (listen(sockfd, BACKLOG) == -1) {
perror("listen");
exit(1);
}
sa.sa_handler = sigchld_handler; // reap all dead processes
sigemptyset(&sa.sa_mask);
sa.sa_flags = SA_RESTART;
if (sigaction(SIGCHLD, &sa, NULL) == -1) {
perror("sigaction");
exit(1);
}
printf("server: waiting for connections...\n");
while(1) { // main accept() loop
sin_size = sizeof their_addr;
new_fd = accept(sockfd, (struct sockaddr *)&their_addr, &sin_size);
if (new_fd == -1) {
perror("accept");
continue;
}
inet_ntop(their_addr.ss_family,
get_in_addr((struct sockaddr *)&their_addr),
s, sizeof s);
printf("server: got connection from %s\n", s);
if (!fork()) { // this is the child process
close(sockfd); // child doesn't need the listener
if (send(new_fd, "Hello, world!", 13, 0) == -1)
perror("send");
close(new_fd);
exit(0);
}
close(new_fd); // parent doesn't need this
}
return 0;
}
```
| Is this a legitimate C++ code? | CC BY-SA 3.0 | 0 | 2010-12-06T23:34:54.833 | 2016-03-22T15:04:22.837 | 2016-03-22T15:04:22.837 | 573,032 | 445,762 | [
"c++",
"c",
"networking",
"gcc",
"g++"
] |
4,372,259 | 1 | null | null | 2 | 1,466 | I have been using the Hough transform in my application both using Matlab and OpenCV/labview and found that for some images, the hough transform gave an obviously wrong line fit (consistently)
Here are the test and overlayed images. The angle seem right, but the rho is off.

On the image below, you will see the top image tries to fit a line to the left side of the original image and the bottom image fits a line to the right side of the image.

In Matlab, I call the Hough function through
```
[H1D,theta1D,rho1D] = hough(img_1D_dilate,'ThetaResolution',0.2);
```
in C++, i trimmed the OpenCV HoughLines function so I end up with only the part we are filling the accumulator. Note that because my theta resolution is 0.2, I have 900 angles to analyze. The tabSin and tabCos are defined prior to the function so that they are just a sin and cos of the angle.
Note that these routines generally work well, but just for specific cases it performs the way I have shown.
```
double start_angle = 60.0;
double end_angle = 120.0;
double num_theta = 180;
int start_ang = num_theta * start_angle/180;
int end_ang = num_theta * end_angle/180;
int i,j,n,index;
for (i = 0;i<numrows;i++)
{
for (j = 0;j<numcols;j++)
{
if (img[i*numcols + j] == 100)
{
for (n = 0;n<180;n++)
{
index = cvRound((j*tabCos[n] + i * tabSin[n])) + (numrho-1)/2;
accum[(n+1) * (numrho+2) + index+1]++;
}
}
}
}
```
TabCos and tabSin are defined in Labview with this code
int32 i;
float64 theta_prec;
float64 tabSin[180];
float64 tabCos[180];
theta_prec = 1/180*3.14159;
for (i = 0;i<180;i++)
{
tabSin[i] = sin(itheta_prec);
}
any suggestions would be greatly appreciated
| hough transform error in matlab and openCV? | CC BY-SA 2.5 | 0 | 2010-12-07T00:14:05.970 | 2010-12-14T21:28:21.580 | 2010-12-10T16:36:41.513 | 486,739 | 486,739 | [
"matlab",
"opencv",
"hough-transform"
] |
4,372,368 | 1 | 4,372,654 | null | 3 | 371 | Would it be possible to have the colour of text in an element to be inverted of the background?
eg:

So the first image is the normal state. the second is during the mouseover, and the last is the finished mouseover.
Edit: i want the background to slide out, and the colour of each character to change as the black block "slides" behind it.
| Javascript advanced mouseover | CC BY-SA 3.0 | null | 2010-12-07T00:35:52.700 | 2013-09-29T23:34:19.287 | 2013-09-29T23:34:19.287 | 759,866 | 461,514 | [
"javascript"
] |
4,372,461 | 1 | null | null | 0 | 201 | In Facebook's iPhone app, you can click "Notifications" at the bottom of the screen to display an animated view controller that slides up from the bottom of the screen, with a Done button to dismiss it. How do I implement the same type of view controller in Three20?


| Emulating the "notifications" style window on Facebook iPhone app? | CC BY-SA 2.5 | null | 2010-12-07T00:54:59.823 | 2010-12-07T01:15:36.640 | null | null | 44,440 | [
"iphone",
"three20"
] |
4,372,541 | 1 | 4,372,614 | null | 0 | 1,006 | I download some sample code from deitel, but it refuse to build. I already went to Project -> Edit Project Settings and changed the Base SDK to Device iOS 4.1

I also tried to set the Project -> Set Active SDK, but the menu option is disabled and says "Base SDK Missing".
If I try to build, I get an immediate error:

If I create a project form scratch, everything works perfectly. What am I doing wrong?
| Unable to change xcode dependencies to iOS SDK 4.1 | CC BY-SA 2.5 | null | 2010-12-07T01:14:17.257 | 2010-12-07T05:31:08.817 | null | null | 74,415 | [
"cocoa",
"cocoa-touch",
"xcode"
] |
4,372,783 | 1 | 4,381,198 | null | 2 | 628 | I've got the following method (example taken from [this link](http://codeclimber.net.nz/archive/2009/09/02/lucene.net-your-first-application.aspx))
```
Public Function ReadIndex(ByVal q As String, ByVal page As Integer?) As List(Of Domain.[Event]) Implements ILuceneService.ReadIndex
''# This starts us at the first record if the user doesn't have a page specified
If page Is Nothing Then page = 0
Dim i As Integer = page
''# Variables used by Lucene
Dim reader As IndexReader = IndexReader.Open(luceneDirectory)
Dim searcher As IndexSearcher = New IndexSearcher(reader)
Dim query As Query = New TermQuery(New Term("fullText", q.ToLower))
Dim hits As Hits = searcher.Search(query)
Dim ResultIDs As List(Of Integer) = New List(Of Integer)
Dim HC = hits.Length ''# FOR DEBUGGING PURPOSES
While (i <= (page * 10) AndAlso i < hits.Length)
Dim document As Document = hits.Doc(i)
Dim score As Single = hits.Score(i)
ResultIDs.Add(document.[Get]("id"))
i += 1
End While
''# Self explanitory
searcher.Close()
Return EventService.QueryEvents().Where(Function(e) (ResultIDs.Contains(e.ID))).ToList()
End Function
```
But when I set a breakpoint at
```
Dim HC = hits.Length ''# FOR DEBUGGING PURPOSES
```
and analyze it in the debugger, it always says it has a length of `0` and says
> Children could not be evaluated
---

---

I'm not sure what this means, however, the result of the query is always a SINGLE record being returned. Even if I know for a fact that more than one should be returned.
---
If you'd like to read the entire service, it's posted below.
```
Imports System.Web
Imports System.Text
Imports Lucene.Net.Index
Imports Lucene.Net.Search
Imports Lucene.Net.Documents
Imports Lucene.Net.Analysis.Standard
Imports Lucene.Net.Store
Namespace Domain
Public Class LuceneService : Implements ILuceneService
Private luceneDirectory As Directory = FSDirectory.GetDirectory(HttpContext.Current.Server.MapPath("~/App_Data/"), False)
Private ExceptionService As Domain.IExceptionService
Private EventService As Domain.EventService
Sub New()
ExceptionService = New Domain.ExceptionService(New Domain.ExceptionRepository)
EventService = New Domain.EventService(New Domain.EventRepository)
End Sub
Public Function AddIndex(ByVal searchableEvent As [Event]) As Boolean Implements ILuceneService.AddIndex
Dim builder As New StringBuilder
builder.Append(Trim(searchableEvent.Description))
builder.Append(" ")
builder.Append(Trim(searchableEvent.Title))
builder.Append(" ")
builder.Append(Trim(searchableEvent.Location.Name))
builder.Append(" ")
builder.Append(Trim(searchableEvent.Region.Region))
builder.Append(" ")
builder.Append(Trim(searchableEvent.StartDateTime.ToString("yyyy/MM/dd")))
builder.Append(" ")
builder.Append(Trim(searchableEvent.TicketPriceHigh.ToString))
builder.Append(" ")
builder.Append(Trim(searchableEvent.TicketPriceLow.ToString))
builder.Append(" ")
builder.Append(Trim(searchableEvent.URL))
builder.Append(" ")
builder.Append(Trim(searchableEvent.User.UserName))
CreateIndex()
Dim writer As New IndexWriter(luceneDirectory, New StandardAnalyzer(), False)
Dim doc As Document = New Document
doc.Add(New Field("id", searchableEvent.ID, Field.Store.YES, Field.Index.UN_TOKENIZED))
doc.Add(New Field("fullText", builder.ToString, Field.Store.YES, Field.Index.TOKENIZED))
doc.Add(New Field("user", searchableEvent.User.UserName, Field.Store.YES, Field.Index.UN_TOKENIZED))
doc.Add(New Field("location", searchableEvent.Location.Name, Field.Store.YES, Field.Index.UN_TOKENIZED))
doc.Add(New Field("date", searchableEvent.StartDateTime, Field.Store.YES, Field.Index.UN_TOKENIZED))
writer.AddDocument(doc)
writer.Optimize()
writer.Close()
Return True
End Function
Public Function DeleteIndex(ByVal searchableEvent As [Event]) As Boolean Implements ILuceneService.DeleteIndex
Throw New NotImplementedException
End Function
Public Function ReadIndex(ByVal q As String, ByVal page As Integer?) As List(Of Domain.[Event]) Implements ILuceneService.ReadIndex
Dim IDList As List(Of Integer) = New List(Of Integer)
If page Is Nothing Then page = 0
Dim i As Integer = page
''# Variables used by Lucene
Dim reader As IndexReader = IndexReader.Open(luceneDirectory)
Dim searcher As IndexSearcher = New IndexSearcher(reader)
Dim query As Query = New TermQuery(New Term("fullText", q.ToLower))
Dim hits As Hits = searcher.Search(query)
Dim HC = hits.Length ''# For Debugging Purposes
While (i <= (page * 10) AndAlso i < hits.Length())
Dim document As Document = hits.Doc(i)
Dim score As Single = hits.Score(i)
IDList.Add(document.[Get]("id"))
i += 1
End While
''# Self explanitory
searcher.Close()
Return EventService.QueryEvents().Where(Function(e) (IDList.Contains(e.ID))).ToList()
End Function
Public Function UpdateIndex(ByVal searchableEvent As [Event]) As Boolean Implements ILuceneService.UpdateIndex
Throw New NotImplementedException
End Function
Private Sub CreateIndex() Implements ILuceneService.CreateIndex
If Not IndexReader.IndexExists(HttpContext.Current.Server.MapPath("~/App_Data/")) Then
Dim writer As New IndexWriter(HttpContext.Current.Server.MapPath("~/App_Data/"), New StandardAnalyzer(), True)
writer.Close()
End If
End Sub
End Class
End Namespace
```
| Why is my Lucene.Net "hits" collection length returning "0" | CC BY-SA 2.5 | null | 2010-12-07T02:10:25.733 | 2010-12-09T04:36:59.157 | 2010-12-07T17:37:37.577 | 124,069 | 124,069 | [
".net",
"lucene.net"
] |
4,372,880 | 1 | 4,374,549 | null | 1 | 1,437 | "Windows SharePoint Services Search" is not showing in the my APP server. I checked in WFE als, there also it is not there. I checked in "Services->Windows SharePoint Services Search" is running in all servers. It was shown before. When I am playing around this. I lost it.
How to get back it?

| Windows SharePoint Services Search missing in Servers in Farm | CC BY-SA 2.5 | null | 2010-12-07T02:31:06.210 | 2010-12-07T09:53:20.497 | null | null | 158,008 | [
"sharepoint",
"sharepoint-2007",
"moss"
] |
4,372,873 | 1 | 4,374,927 | null | 1 | 19,458 | Ok so ive been finishing off my batch program called "stringparsing.bat" and the last error im having trouble with is one that says "missing operator" when i use the following snippet:
```
set /p linecount=
cls
set foo=0
set linenumber=0
:lineset
set /a linenumber=%linenumber% +1
set /p line1= %linenumber%
echo %line1% >> %name%.txt
set /a foo=%foo%+1
set /a line number=%linenumber%+1
IF %foo%==%linecount% goto MAIN123
goto lineset
```
More specificly, ive narrowed it down to :
```
set /a linenumber=%linenumber% +1
set /p line1= %linenumber%
```
Im pretty sure im mis-using the command... what i am trying to do, is make a prompt that asks the user to input how many lines of text that they are going to insert into a text file. Then make a loop that asks the user to type some text which is then sent to the text file. But i wanted to to put the line number before the prompt so that it would look like this:

So when the batch file asks for the first line, it says 1: , and when it asks for the second line, its says 2: , and so on. after each line prompt, i get the "missing operator" error message... Btw i need to use this scirpt to get it to work:
set /p line1= %linenumber%+1
But in order to use this command with the at the end, do i have to add the parameter as well as the parameter?
Any ideas?
| "missing operator" error message while using the "set /a" command | CC BY-SA 2.5 | null | 2010-12-07T02:28:53.907 | 2021-12-13T01:04:10.150 | null | null | 524,670 | [
"parameters",
"batch-file",
"set"
] |
4,373,209 | 1 | 4,373,256 | null | 2 | 639 | Here is my code:
i am assuming am doing something wrong, but am expecting the padding on the right to also be 2px?
```
<!DOCTYPE html>
<html>
<head>
<style>
div{border:solid 1px gray;}
#outer{width:200px; padding:2px;}
#inner{width:100%;}
</style>
</head>
<body>
<div id="outer">
<div id="inner"> </div>
</div>
</body>
</html>
```
Render:

| Why doesn't nested div width render as expected in webKit and Gecko? | CC BY-SA 2.5 | 0 | 2010-12-07T03:46:00.697 | 2010-12-07T04:40:36.330 | 2010-12-07T03:57:46.463 | 98,204 | 98,204 | [
"css",
"firefox",
"google-chrome"
] |
4,373,360 | 1 | 4,375,280 | null | 4 | 3,053 | Greetings all,
As seen in the image,

I have an object named O (set of linestripes).Its object-coordinate system is (x',y',z').
I translate,rotate this object in my OpenGL scene using following code snippet:
```
glPushMatrix();
glTranslatef(Oz, Oy,Oz);
glRotatef(rotationX , 1.0, 0.0, 0.0);
glRotatef(rotationY, 0.0, 1.0, 0.0);
glRotatef(rotationZ, 0.0, 0.0, 1.0);
contour->render();
glPopMatrix()
```
;
I have a point called H ,which is translated to (hx,hy,hz) world coordinates using
```
glPushMatrix();
glTranslatef(hx,hy,hz);
glPopMatrix();
```
If I am correct, (Oz,Oy,Oz) and (hx,hy,hz) are world coordinates.
Now,what I want todo is calculate the position of H (hx,hy,hz) relative to O's object-coordinate system.(x',y',z');
As I understood,I can do this by calculating inverse transformations of object O and apply them to point H.
Any tips on this? Does OpenGL gives any functions for inverse-matrix calculation ? If I somehow found inverse-matrices what the order of multiplying them ?
Note : I want to implement "hammer" like tool where at point H ,I draw a sphere with radius R.User can use this sphere to chop the object O like a hammer.I have implemented this in 2D ,so I can use the same algorithm if I can calculate the hammer position
relative to (x',y',z')
Thanks in advance.
| OpenGL ,World to Object coordinate mapping ? (inverse matrix) | CC BY-SA 2.5 | 0 | 2010-12-07T04:22:07.897 | 2013-06-29T20:52:37.093 | 2013-06-29T20:52:37.093 | 1,714,410 | 180,904 | [
"opengl",
"matrix",
"geometry",
"matrix-inverse"
] |
4,373,425 | 1 | 4,373,608 | null | 1 | 911 | I have a very simple site setup using [awesome_nested_set](https://github.com/collectiveidea/awesome_nested_set) and a single table called Pages.
I would like the ability to select different layouts in the admin when creating and updating Pages. What I envisioned is a drop down on the Pages form that allowed me to select a layout/template.
The only thing I know about layouts is you are required to add them to /views/layouts/ and specify the layout at the top of the controller. I need a way to manage layouts on a per Page basis inside the app itself.
Is that even possible? If so, can you explain on a high level how that might be done so I can have a starting point?
Something like this:

| Ruby on Rails - How to manage layouts in admin interface? | CC BY-SA 2.5 | 0 | 2010-12-07T04:35:19.310 | 2010-12-07T05:12:59.543 | 2010-12-07T05:02:29.993 | 150,803 | 150,803 | [
"ruby-on-rails",
"ruby"
] |
4,373,528 | 1 | 4,394,333 | null | 0 | 328 | I am pulling my hair out on this one. I have a NavigationController with two levels of TableViews. Each TableView is in its own NIB file. The first level simply displays a list. Upon selecting a cell, it takes the user to a second level TableView with a more detailed list. It is on this second level TableView that I want to display a search bar (actually I am using a SearchDisplayController as well). I have added it to the TableView because I want the SearchBar to scroll with the table.
Below, I am displaying two screenshots. The first is the second level tableview in InterfaceBuidler. The second is the second level tableview at runtime. For some reason, the SearchBar doesn't display at runtime.
I have tried creating a completely new project from scratch and the same things happens. I don't understand why the SearchBar doesn't display on a NIB pushed on the NavigationController.
Before you ask, if I put the SearchBar on the first level TableView, it shows up just fine. Yes, I am adding it to the TableView itself, so it is a part of the view that should be displayed.
Help! What am I doing wrong?

This is what actually displays after the XIB is pushed...

| NIB File Doesn't Display at Runtime | CC BY-SA 2.5 | null | 2010-12-07T04:54:19.200 | 2011-12-14T14:44:47.510 | 2010-12-09T02:34:37.860 | 399,076 | 399,076 | [
"iphone",
"uitableview",
"uisearchbar",
"xib",
"uisearchdisplaycontroller"
] |
4,373,666 | 1 | 4,388,829 | null | 4 | 3,865 | I'm trying to write a little greasemonkey script/bookmarklet/what have you for Google Docs. The functionality I'd like to add needs a keypress/keyup/keydown event handler (one of those three). Unfortunately, Javascript isn't my forté, and I can't seem to capture (?) a keypress event to while in the edit pane. As a last resort, I've tried the following:
```
javascript:(function(){
els = document.getElementsByTagName("*");
for(i=0;i<els.length;i++){
els[i].onkeypress=function(){alert("hello!");};
els[i].onkeyup=function(){alert("hello2!");};
els[i].onkeydown=function(){alert("hello3!");};
}
})();
```
However, this still doesn't capture keypresses in the editing pane - no annoying alerts (although it seems to work for most other sites...). I've checked in Chrome and Firefox both (I can't get it to work in either one).
I tried "Log Events" in Firebug (and checked out all the registered events via a neat little extension to Firebug, Eventbug); it didn't seem like those events were firing on keypresses.
Edit:
To clarify [Tim], I made this [screenshot](http://cl.ly/07413k1F3R3X1G0b3n0Y) with some annotations...

The "editing pane" I'm talking about seems to be a bunch of Javascripted-up divs displaying what I type.
Any ideas? Thanks!
| Capture keypress in Javascript (Google Docs) | CC BY-SA 2.5 | 0 | 2010-12-07T05:24:27.617 | 2014-11-07T01:22:11.367 | 2014-11-07T01:22:11.367 | 1,677,912 | 569,771 | [
"javascript",
"greasemonkey",
"google-docs",
"bookmarklet"
] |
4,373,824 | 1 | 4,373,899 | null | 3 | 223 | Several mac applications, both Apple and third party, feature a menu in the left column usually used for filtering content. Below are some examples from iPhoto, iCal and iTunes.

I don't see an interface builder class that corresponds to this. How are these usually implemented? A NSTableView with custom cells? Is there any pre-written code to handle the more complex aspects like the collapsing triangles? This seems like a such a common user interface that I don't want to reinvent the wheel if I don't have to.
| Cocoa left column menu | CC BY-SA 2.5 | 0 | 2010-12-07T06:00:15.777 | 2010-12-07T06:15:53.007 | null | null | 384,109 | [
"objective-c",
"cocoa",
"nstableview"
] |
4,374,388 | 1 | 4,374,540 | null | 2 | 12,199 | 
---
After some google search I find it!
This algorithm is a non-tail recursive method.
The reversed input string is completely pushed into a stack.
```
prefixToInfix(stack)
1) IF stack is not empty
a. Temp -->pop the stack
b. IF temp is a operator
i. Write a opening parenthesis to output
ii. prefixToInfix(stack)
iii. Write temp to output
iv. prefixToInfix(stack)
v. Write a closing parenthesis to output
c. ELSE IF temp is a space -->prefixToInfix(stack)
d. ELSE
i. Write temp to output
ii. IF stack.top NOT EQUAL to space -->prefixToInfix(stack)
```
when the Stack top is
> F(ABC)
and we enter the algorithm, "A" is written to the output as it was currently the value of
> temp=A (say)
Now how I get '' on the output column as according to the algorithm the next temp value will be "B" which was popped from the stack after the last recursive call.
How the diagram is showing output "((A-" ...
Where I am doing the incorrect assumption ?
Could someone take the trouble in explaining it ?
| Prefix to Infix Conversion Algorithm with figure | CC BY-SA 2.5 | 0 | 2010-12-07T07:49:51.040 | 2010-12-07T10:12:24.433 | null | null | 415,041 | [
"algorithm",
"recursion",
"stack",
"prefix",
"infix-notation"
] |
4,374,459 | 1 | 4,375,835 | null | 0 | 835 | I am depth only rendering scene to different frame buffer, the problem is a bit hard to explain but as you can see in the image the depth map it is actually suffering from grid like artifacts. Do you have any idea what can be the source of this ?
here is the code for fb creation:
```
self.shadowTexture = glGenTextures(1);
glBindTexture( GL_TEXTURE_2D, self.shadowTexture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP );
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP );
glTexImage2D( GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, w, h, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, None);
glBindTexture( GL_TEXTURE_2D, 0);
self.fbo = glGenFramebuffers(1)
glBindFramebuffer(GL_FRAMEBUFFER_EXT, self.fbo)
glDrawBuffer(GL_NONE);
glReadBuffer(GL_NONE);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,GL_TEXTURE_2D, self.shadowTexture, 0);
```

| Depth render artifacts | CC BY-SA 2.5 | null | 2010-12-07T08:00:06.503 | 2010-12-07T10:52:17.993 | 2010-12-07T08:05:16.543 | 40,948 | 40,948 | [
"opengl",
"graphics",
"3d",
"glsl"
] |
4,374,622 | 1 | 4,374,668 | null | 11 | 15,684 | As you can see

I want to somehow remove the dotted lines after the button has been clicked.Any ideas how ?
Thanks
GUYS : This is the current status of my CSS ansd HTML but still no USE:
```
.myButton input {
position:absolute;
display:block;
top: 5%;
left:87%;
height: 44px;
border:none;
cursor:pointer;
width: 43px;
font: bold 13px sans-serif;;
color:#333;
background: url("hover.png") 0 0 no-repeat;
text-decoration: none;
}
.myButton input:hover {
background-position: 0 -44px;
color: #049;
outline: 0;
}
.myButton input:active {
background-position: 0 -88px;
color:#fff;
outline: 0;
}
input:active, input:focus {
outline: 0;
}
<div class="myButton">
<input type="submit" value="">
</div>
```
Nothing seems to be happening !!
| How to remove the "Dotted Border" on clicking? | CC BY-SA 2.5 | 0 | 2010-12-07T08:22:26.757 | 2014-09-01T22:21:08.100 | 2010-12-07T08:43:44.353 | 453,871 | 453,871 | [
"javascript",
"html",
"css"
] |
4,374,702 | 1 | 4,374,723 | null | 0 | 2,733 | In an application that I'm writing I have to load a lot of data in a listview after I push a certain button. Because this might take a while, I want to show a simple loading-screen to the user.
I did this by creating a very simple form with 1 label on it. I do a Form.Show() before I start fetching the data, and a Form.Close() once it's finished. This works partially: I get the loading screen, it closes at the right time, but as you can see the label isn't displayed.
I know I should program this loagind screen-problem with the help of a BackgroundWorker, but I'm not a very experienced C# programmer so if I could just somehow force the label to display I would be more than happy.
Is it possible to force this label to display immediately, or do I have to find another solution?

| C# Label not showing at loading screen | CC BY-SA 2.5 | null | 2010-12-07T08:32:28.287 | 2010-12-07T08:53:55.990 | null | null | 282,096 | [
"c#",
"screen",
"loading"
] |
4,374,932 | 1 | 4,375,059 | null | 0 | 1,951 | I would like to create from this image a styled DIV box for my website :

How can I do that using CSS and HTML.
I cut the image in three different parts :
- - - 
However I don't know how to use them with Divs to create my vertically expendable box.
Thanks for your help!
| How to make a vertically extendable DIV box from this image? | CC BY-SA 2.5 | null | 2010-12-07T09:03:20.700 | 2010-12-07T10:04:27.100 | null | null | 266,406 | [
"css",
"html",
"background-image"
] |
4,375,088 | 1 | 4,375,145 | null | -1 | 1,920 | I have created one windows service which send an email notifications to users (list retrieved from db) every 2 minutes. I wish to check that everything is running ok in web service and hence I wish to debug the service. The service is installed in SMC (services.msc) when an server setup of application is done.
My question: how to debug the windows service?
I see the service from
1. Task Manager
2. Attach to process
I have tried from following links
- [Debugging windows services](https://stackoverflow.com/questions/1982636/debugging-windows-services) (CANNOT understood the FIRST COMMENT- making normal windows form)- [Debugging a Windows Service and trying to see what it sees](https://stackoverflow.com/questions/3894019/debugging-a-windows-service-and-trying-to-see-what-it-sees)- [Debug Windows Service](https://stackoverflow.com/questions/2629720/debug-windows-service)
I have also given the rights of debugging from [http://msdn.microsoft.com/en-us/library/aa291232%28VS.71%29.aspx#vxtskdebuggerpermissionsdebuggingasystemservice](http://msdn.microsoft.com/en-us/library/aa291232%28VS.71%29.aspx#vxtskdebuggerpermissionsdebuggingasystemservice)
Let me know if any input required.
Thanks!
@maycil
I wrote your `If(!Debug)` code but I guess there is some problem as I don't see proper color of Visual Studio.

| Debug a Windows Service | CC BY-SA 3.0 | 0 | 2010-12-07T09:26:28.217 | 2017-01-08T14:44:17.187 | 2017-05-23T10:30:38.583 | -1 | 224,636 | [
"c#",
"visual-studio",
"winforms",
"debugging",
"windows-services"
] |
4,375,206 | 1 | 4,375,418 | null | 1 | 3,087 | I wanted to take Numeric input from user from Numberpad displayed on screen, it should be in Activity view. please see attached image.
I don't know if there is some way to make similar UI or do i have make one my self in XML ? . need your help. 
| Android on screen number pad | CC BY-SA 2.5 | null | 2010-12-07T09:41:05.233 | 2015-10-20T14:24:20.487 | null | null | 236,732 | [
"android"
] |
4,375,255 | 1 | 4,375,399 | null | 6 | 7,817 | Can anyone guess what CSS styling I should apply to a button to guess this exact look.

and that I don't have to apply any CSS to get this style, but on Mac and Linux it's not the same, so I can't depend on the default styling of the OS for this. I would have to force this style myself in the css. Anyone knows what CSS styling can consistently produce this effect?
| Windows OS Button Style CSS | CC BY-SA 3.0 | 0 | 2010-12-07T09:48:40.770 | 2017-09-22T07:24:57.147 | 2017-06-14T00:17:53.170 | 1,548,895 | 507,387 | [
"css",
"button"
] |
4,375,561 | 1 | 4,379,991 | null | 5 | 3,309 | I used searchbar with my UITableview. When I enter search text, the background color will be changed automatically as white color.
and also I used:
```
tableView.bounces=FALSE;
```
When I used searchbar, that time bounces also, won't work.
The output like as follows:

1. I need to change background color, when I searching content.
2. I need: tableView.bounces=FALSE;
will work, when I searching content.
| UITableview background color when using Search Bar | CC BY-SA 3.0 | 0 | 2010-12-07T10:21:35.533 | 2017-11-03T20:53:59.230 | 2017-11-03T20:53:40.147 | 472,495 | 409,571 | [
"iphone"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.