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
sequence |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3,109,012 | 1 | 3,112,394 | null | 16 | 37,537 | I want to style an ordered list giving the numbers a much more bigger font size than the li elements content.
I have already achieved this but I dont know how to align the li elements content with the top of the numbers.
Take a look:

I have tried giving ol li p negative top margin, but that doesnt work. Also, ol li has a top margin but if i set it to 0 it doesnt do anything. My current html is:
```
<ol>
<li>
<p>content</p>
</li>
<li>
<p>more content</p>
</li>
</ol>
```
And my CSS:
```
ol {
padding-top: 200px;
}
ol li {
color: #EEEDED;
font-size: 35px;
font-weight: bold;
font-style: italic;
margin-top: 5px;
line-height: 1;
}
ol li p {
font-size: 11px;
color: #444444;
font-weight: normal;
font-style: normal;
line-height: 1.7em;
}
```
Any ideas??
| Styling ordered list numbers with a different font size than content | CC BY-SA 2.5 | 0 | 2010-06-24T10:15:33.887 | 2017-07-25T19:45:02.853 | null | null | 345,157 | [
"css"
] |
3,109,869 | 1 | null | null | 0 | 784 | I have a Sprite which is in the shape of a Convex polygon(not rectangular).
If I take its snapshot using :
```
var bmd:BitmapData = new BitmapData(width,height);
bmd.draw(someSprite,someMatrix,null,null,null);
```
I get an image like this :

In this image, I have added the green boundary myself, just to show
the dimensions of the image.
So, when I took a snapshot of the convex polygon shaped sprite
using draw method of the BitmapData class, I got a red triangle
with a white ellipse inside and for rest of the area, I got while pixels.
I want to replace those white pixels with blue colored pixels.
How do I do it?
| Bitmap data draw method - replacing the non-present pixels with blue color | CC BY-SA 3.0 | null | 2010-06-24T12:23:52.293 | 2015-10-12T19:03:54.517 | 2015-10-12T19:03:54.517 | 3,555,000 | 49,560 | [
"apache-flex",
"actionscript-3",
"snapshot",
"bitmapdata"
] |
3,111,358 | 1 | null | null | 1 | 203 | Text Area:

There is no ENTER at the end of the first line and is there any solution to know at which character it turns to next line?
Take this for instance, it turns to next line after the character "哪" or after the 13th character. (SBC case or DBC case characters can be inputed.)
| How to know at which character it changes to another line in a textarea? | CC BY-SA 3.0 | null | 2010-06-24T15:21:26.553 | 2015-10-12T18:31:05.967 | 2015-10-12T18:31:05.967 | 3,555,000 | 317,429 | [
"javascript",
"html"
] |
3,112,497 | 1 | 3,156,459 | null | 33 | 15,626 | I've been following the Google App Engine tutorials, and I'm having a problem with the .jsp file. Here is the code from Google: [Using JSPs](http://code.google.com/appengine/docs/java/gettingstarted/usingjsps.html). I'm using Eclipse to build my project, and for some reason when I add the `guestbook.jsp` file to the war directory, it gets a red error icon. I can't double click to open guestbook.jsp either. What could be going on here?

| .jsp file not working for Google App Engine guestbook tutorial | CC BY-SA 3.0 | 0 | 2010-06-24T17:42:30.137 | 2017-02-01T05:55:14.810 | 2011-12-08T12:07:36.397 | 17,413 | 375,537 | [
"java",
"eclipse",
"google-app-engine"
] |
3,113,279 | 1 | 3,113,746 | null | 1 | 2,314 | For some reason jQuery UI's autocomplete has stopped working for me. I get the same error as is described on [this webpage](http://forum.jquery.com/topic/jquery-ui-autocomplete-what-am-i-doing-wrong-here).
I've copied the content of the query from that webpage below, hoping that somebody here will be able to answer it.
Thanks!
I am using `Jquery UI Autocomplete` to get a list of names. But for some reason I am getting an error:

> ```
$('#repName').removeAttr('readonly').focus(function () {
$(this).val('');
}).autocomplete({
source: function (request, response) {
tagId = $('#TagId').val();
$.ajax({
url: '/Developement/GetRepName', type: 'POST', dataType: 'json',
data: { searchText: request.term, maxResults: 10, tagId: tagId },
success: function (data) {
response($.map(data, function (item) {
return {
label: item.Name,
value: item.RepId,
id: item.RepId
}
}))
}
})
},
select: function (event, ui) {
commissionAllicationModifications(ui.item.id, 0, 'A');
}
});
```
I have no clue why this is happening.
I am using Jquery UI 1.8.1.
I would appreciate any kind of help on this.
It is coming from the jQuery UI 1.8.1 file, specifically jQuery UI Autocomplete 1.8.1.
> ```
.menu({
focus: function (event, ui) {
var item = ui.item.data("item.autocomplete");
if (false !== self._trigger("focus", null, { item: item })) {
// use value to match what will end up in the input, if it was a key event
if (/^key/.test(event.originalEvent.type)) {
self.element.val(item.value);
}
}
},
selected: function (event, ui) {
var item = ui.item.data("item.autocomplete");
if (false !== self._trigger("select", event, { item: item })) {
self.element.val(item.value);
}
self.close(event);
// only trigger when focus was lost (click on menu)
var previous = self.previous;
if (self.element[0] !== doc.activeElement) {
self.element.focus();
self.previous = previous;
}
self.selectedItem = item;
},
* blur: function (event, ui) {
* if (self.menu.element.is(":visible")) {
* self.element.val(self.term);
* }
* }
})
.zIndex(this.element.zIndex() + 1)
// workaround for jQuery bug #5781 http://dev.jquery.com/ticket/5781
.css({ top: 0, left: 0 })
.hide()
.data("menu");
```
It is weird though because this works flawlessly in another project. What I noticed is when the code hits the [starred] section the self.menu section is undefined. Another thing of note was that it doesn't even send the request. I was thinking that it might be my focus function.
> ```
.focus(function () {
$(this).val('');
```
But it is not.
Thank you for you help.
| jQuery UI Autocomplete stopped working | CC BY-SA 3.0 | null | 2010-06-24T19:30:56.857 | 2013-07-02T10:10:27.873 | 2017-02-08T14:27:35.053 | -1 | 356,620 | [
"javascript",
"jquery",
"jquery-ui",
"jquery-ui-autocomplete"
] |
3,113,365 | 1 | 3,115,287 | null | 20 | 12,721 | For some reason I cannot get the Settings.bundle to recognize my additional languages. I must be missing something obvious, but I just cannot figure it out. Here's what I've got:
Project Structure in XCode:

Root.plist file:
[Root.plist file http://img227.imageshack.us/img227/571/screenshot20100624at334.png](http://img227.imageshack.us/img227/571/screenshot20100624at334.png)
French Root.strings file
[french Root.strings file http://img121.imageshack.us/img121/571/screenshot20100624at334.png](http://img121.imageshack.us/img121/571/screenshot20100624at334.png)
From everything I've read, I believe the project structure is right. The StringsTable in the Root.plist matches the name of the individual .strings files, and the Key for each item in the Root.plist has a match in the .strings files as well.
Why don't I see French text in my settings when I change the default iPhone language?
Thanks in advance!
| Localization of the iPhone Settings.bundle | CC BY-SA 3.0 | 0 | 2010-06-24T19:45:28.827 | 2018-01-03T20:29:01.780 | 2018-01-03T20:29:01.780 | 271,976 | 271,976 | [
"iphone",
"ios",
"xcode",
"localization",
"settings.bundle"
] |
3,114,523 | 1 | 3,114,557 | null | 1 | 1,694 | I am working on creating an Action Bar like the one from the new Android UI Patterns and I am running into a bit of trouble. I have a `ViewSwitcher` with two layouts in it. When the user taps the search button I animate between the two layouts. The problem is that the layouts are different sizes and I can't figure out how to make them take up the same amount of space. Here's what I mean. p.s. forgive the bad art, they are just place holders ;)
The red box is right up against the `ViewSwitcher` and there is a gap between that and the action bar for this layout:

but not this one:

What I want is to tell the layouts in the `ViewSwitcher` to be the same size. How can I do this?
| Implementing Android Action Bar | CC BY-SA 2.5 | 0 | 2010-06-24T23:01:44.620 | 2010-06-26T03:31:34.910 | 2017-02-08T14:27:36.090 | -1 | 236,136 | [
"android",
"layout"
] |
3,116,386 | 1 | 3,160,233 | null | 4 | 5,452 | It seems like Silverlight 4 does not have a ListView control, unless I am missing something. Or a control that's basically replicates its function (e.g. re-sizable column headers, etc...).
Is there an example of how to create something similar? I am after a setup like this:

| ListView control for Silverlight 4? | CC BY-SA 2.5 | null | 2010-06-25T07:52:56.787 | 2012-10-30T14:07:28.720 | 2010-06-30T17:08:54.763 | 9,382 | 9,382 | [
"listview",
"silverlight-4.0",
"c#-4.0"
] |
3,116,609 | 1 | 3,183,338 | null | 0 | 507 | below are tables I need to index in Sphinx

News has many projects linked to it via the news_projects table...
My question is it advisable to have all the project names in one text field so that it can be searched on?
This is my query :
```
//query to get the project names and make all project names appear in one field separated by comma.
SELECT
news.id
news.headline,
news.body,
GROUP_CONCAT(DISTINCT projects.project_name) as related_projects
FROM news
LEFT JOIN news_projects on news.id = news_projects.news_id
LEFT JOIN projects on news_projects.project_id = projects.id
GROUP BY news.id
```
This will then output rows with project_name column formatted as 'name,name2,name3'
Im a bit undecided weather to use this or just make the project_id an attribute.. Having the project_name as text is definitely of big help because it can be searched on...
Please.. I need you opinion on this.. thanks a lot!
| Need advice on Sphinx query and index configuration | CC BY-SA 2.5 | null | 2010-06-25T08:35:32.300 | 2012-02-24T07:58:45.730 | 2017-02-08T14:27:36.430 | -1 | 258,219 | [
"sphinx"
] |
3,119,739 | 1 | 3,119,805 | null | 41 | 30,897 | I know that `length(x)` returns `max(size(x))` and `numel(x)` returns the total number of elements of x, but which is better for a 1 by n array? Does it matter, or are they interchangeable in this case?
Just for kicks:

Looks like they're the same performance-wise until you get to 100k elements.
| Difference between MATLAB's numel and length functions | CC BY-SA 2.5 | 0 | 2010-06-25T16:33:13.150 | 2017-11-15T05:00:58.810 | 2017-04-02T16:05:30.767 | 1,749,675 | 201,800 | [
"arrays",
"matlab",
"microbenchmark"
] |
3,120,263 | 1 | 3,120,313 | null | 5 | 812 | I have the following table structured like this:

So basically as you can see, the department goes through name changes every couple of years. Look at number 16 for example. I want a select query that will only get the name when the date is the greatest. How do I do that?
| SQL query, distinct rows needed | CC BY-SA 4.0 | 0 | 2010-06-25T17:57:41.777 | 2020-11-11T13:35:15.040 | 2020-11-11T13:35:15.040 | 1,783,163 | 50,312 | [
"sql",
"ms-access",
"distinct"
] |
3,120,408 | 1 | null | null | 2 | 981 | I'd like to add a menu to the glass part of the frame in a C++ application which is using WTL and Win32++. Those libraries are probably largely as this is something I'd need to do from Win32.
The latest versions of Opera and the upcoming Firefox are going to be doing this but I haven't been able to find a code example. Has anyone got examples of adding controls to glass that they can share? I guess an example of buttons and things like that are something I could work from.
I did some digging with WinSpy but I wasn't able to work out the exact controls Opera were using.
I'm targeting Windows Vista and 7 only.
Opera example:

Example showing menu in Firefox 4 [proposal](https://www.youtube.com/watch?v=HmgtW2Iw-kE) (follow the link for more in their YouTube presentation:
[](https://i.stack.imgur.com/eFDjT.png)
[faaborg at people.mozilla.com](https://people.mozilla.com/~faaborg/files/20100322-menuBarHeatMap/firefoxButton.png)
| Example showing how to add a button/menu to the glass part of a Vista window frame like Opera/Firefox 4 | CC BY-SA 4.0 | 0 | 2010-06-25T18:19:59.037 | 2022-10-26T08:16:28.790 | 2019-07-31T01:05:57.313 | 4,751,173 | 636 | [
"c++",
"windows",
"visual-c++",
"winapi",
"menu"
] |
3,120,468 | 1 | 3,123,310 | null | 2 | 960 | I have a dataframe that looks like this:
```
str(Data)
'data.frame': 11520 obs. of 29 variables:
$ groupname : Factor w/ 8 levels "Control","Treatment1",..: 1 1 1 1 1 1 1 1 1 1 ...
$ fCycle : Factor w/ 2 levels "Dark","Light": 2 2 2 2 2 2 2 2 2 2 ...
$ totdist : num 0 67.5 89.8 109.1 58.3 ...
#etc.
```
I can do a single plot of Treatment1 vs Control like this:
```
qq(groupname~totdist|fCycle, data=Data,
subset=(groupname=='Control'|groupname=='Treatment1'))
```
It looks like this:

I'd like to automatically make similar plots of Treatment2 vs Control ...TreatmentX vs Control. Is this the place for a loop or does lattice have a better way?
| R:lattice.qq How do I do a multi-panel plot of treatment[x] vs control? | CC BY-SA 2.5 | null | 2010-06-25T18:29:17.453 | 2010-06-26T11:15:34.900 | 2017-02-08T14:27:39.507 | -1 | 128,245 | [
"r",
"lattice",
"quantile"
] |
3,122,870 | 1 | null | null | 5 | 2,434 | I want to create a sidebar in one of my mac applications. Basically it will look much like the Things sidebar.
Here is the picture that I basically want to recreate:

I can't figure out how to show the "sections" (collect, focus and active projects) and how to have certain items always show up (inbox, today, next, etc...) and finally I would really appreciate if someone would explain how to make the active projects section, with the triangle.
Also I need the active projects section to load from an entity in core data.
I would also really appreciate if you could post an example.
| Create sidebar in mac app with sections | CC BY-SA 3.0 | 0 | 2010-06-26T05:46:33.350 | 2014-12-20T08:02:12.040 | 2012-05-17T19:25:49.423 | 1,028,709 | 376,819 | [
"objective-c",
"cocoa",
"xcode",
"macos",
"core-data"
] |
3,123,621 | 1 | 3,123,672 | null | 1 | 895 | I am making an iPhone Application which has a list of RSS Feeds, and I want to show a blue bubble on the left with the number of unread articles (one bubble per feed), just like in Mail app, as shown here:

Does anyone know if this is possible with Cocoa Touch, or must I add a UILabel?
---
If I must use a UILabel, then how do I make it round, and make it's background color invisible when the row is selected?
---
Thanks!
| Show the number of unread items just like in the Mail app | CC BY-SA 2.5 | 0 | 2010-06-26T11:00:27.170 | 2011-06-20T20:06:50.903 | 2017-02-08T14:27:40.183 | -1 | null | [
"iphone",
"cocoa-touch",
"uitableview"
] |
3,124,520 | 1 | 3,155,273 | null | 0 | 821 | Ok, I'm very new to Obj-C and Cocoa, but I'm sure my bindings here are correct. I've been googling, searching stack overflow and have checked my values again and again.
So, here are my bindings:

They connect to this class:
```
@interface TMMaddMangaWindowDelegate : NSWindowController {
...
}
...
@property (copy) NSMutableArray* mangaList;
...
@end
@implementation TMMaddMangaWindowDelegate
...
@synthesize mangaList;
// - (NSMutableArray*) mangaList {
// NSLog(@"mangaList was called!");
// return mangaList;
//}
//- (void) setMangaList:(NSMutableArray *) input{
// NSLog(@"setMangaList was called!");
// [mangaList autorelease];
// mangaList = [input retain];
//}
...
-(void) populateList:(NSArray*)list{
NSMutableArray* newArray = [[NSMutableArray alloc] initWithArray:list];
NSLog(@"Populating List.");
for(NSXMLNode* node in list){
[newArray addObject:node.description];
//[[self mutableArrayValueForKey:@"mangaList"] addObject:node.description];
//NSLog(@"%@", node.description);
}
[self setMangaList:newArray];
[[self chapterListDownloadIndicator] stopAnimation:self];
}
```
As you can see, I also tried the `mutableArrayValueForKey` approach, which yielded nothing. I know for a fact mangaList is gaining items.
I've been working on this for a while, and probably made a stupid mistake.
Thanks in advance.
| Cocoa bindings between NSTableView and NSMutableArray refuse to update | CC BY-SA 2.5 | null | 2010-06-26T16:07:17.723 | 2010-07-01T05:26:20.500 | null | null | 160,630 | [
"objective-c",
"cocoa",
"cocoa-bindings"
] |
3,124,566 | 1 | 3,124,575 | null | 12 | 17,554 | Calculate the longest path between two nodes.
The path is in an arch.
Signature of method is:
```
public static int longestPath(Node n)
```
In the example binary tree below, it is (going thru 2-3-13-5-2).

This is what I have right now and for the given tree it just returns 0.
```
public static int longestPath(Node n) {
if (n != null) {
longestPath(n, 0);
}
return 0;
}
private static int longestPath(Node n, int prevNodePath) {
if (n != null && n.getLeftSon() != null && n.getRightSon() != null) {
int currNodePath = countLeftNodes(n.getLeftSon()) + countRightNodes(n.getRightSon());
int leftLongestPath = countLeftNodes(n.getLeftSon().getLeftSon()) + countRightNodes(n.getLeftSon().getRightSon());
int rightLongestPath = countLeftNodes(n.getRightSon().getLeftSon()) + countRightNodes(n.getRightSon().getRightSon());
int longestPath = currNodePath > leftLongestPath ? currNodePath : leftLongestPath;
longestPath = longestPath > rightLongestPath ? longestPath : rightLongestPath;
longestPath(n.getLeftSon(), longestPath);
longestPath(n.getRightSon(), longestPath);
return longestPath > prevNodePath ? longestPath : prevNodePath;
}
return 0;
}
private static int countLeftNodes(Node n) {
if (n != null) {
return 1+ countLeftNodes(n.getLeftSon());
}
return 0;
}
private static int countRightNodes(Node n) {
if (n != null) {
return 1+ countRightNodes(n.getRightSon());
}
return 0;
}
```
I understand that I'm missing a key concept somewhere... My brain goes crazy when I try tracking the flow of execution...
Am I right by saying that by finding the longest path among the root, its left & right nodes and then recurse on its left & right nodes passing them the longest path from previous method invocation and finally (when?) return the longest path, I'm not certain as to how you go about returning it...
| Longest path between 2 Nodes | CC BY-SA 3.0 | 0 | 2010-06-26T16:18:00.750 | 2016-11-03T10:31:01.563 | 2016-11-03T10:31:01.563 | 178,163 | 178,163 | [
"java",
"algorithm",
"recursion",
"binary-tree"
] |
3,124,691 | 1 | 3,129,699 | null | 0 | 2,616 | Does anyone a black theme addon for dreamweaver something like this:

| Is there a black theme for Dreamweaver? | CC BY-SA 3.0 | null | 2010-06-26T16:55:36.460 | 2018-02-02T12:26:35.167 | 2018-02-02T12:26:35.167 | 472,495 | 139,459 | [
"dreamweaver",
"color-scheme"
] |
3,125,980 | 1 | 15,172,514 | null | 89 | 78,078 | Is there an addon that allows you to view, edit, `localStorage` information?
If there is and it works as an extension of Firebug I will be extremely happy.
Something like Google Chrome's local storage
similar to [Firecookie](https://addons.mozilla.org/en-US/firefox/addon/6683/) but for the `localStorage`


Is there something like it?
| Firefox addon to view/edit/create localStorage data? | CC BY-SA 4.0 | 0 | 2010-06-27T00:47:37.257 | 2019-12-29T06:48:55.370 | 2019-12-29T06:48:55.370 | 1,033,581 | 340,760 | [
"firefox",
"firebug",
"firefox-addon",
"local-storage"
] |
3,126,577 | 1 | 3,126,676 | null | 3 | 2,360 | Help!!!
I am trying to compile a LaTeX document that has been compiled before, but now for some reason it just won't go through. The error message I am getting is not very informative, and I can't even find the file it is pointing to.
The details: I am using Aquamacs, and when I try to compile the document the mini-buffer displays the following message:

When I press C-c ` this is what I get:
> --- TeX said --- \Hy@AtBeginDocument ->\ltx@LocalAppendToMacro
\Hy@AtBeginDocumentHook l.735
...r\Hy@AtBeginDocument\expandafter{\Hy@temp
}
--- HELP --- TeX encountered an unknown command name. You probably
misspelled the name. If this message
occurs when a LaTeX command is being
processed, the command is probably in
the wrong place---for example, the
error can be produced by an \item
command that's not inside a
list-making environment. The error can
also be caused by a missing
\documentclass command.
The problem is, I can't even find this file referred to in the mini-buffer (report output*) - believe me, it is not in the directory they say it is. My LaTeX document has only 191 lines, and the error supposedly is on line 735.
I have checked the whole document looking for something that could be wrong, but I haven't been able to find anything.
It might not have anything to do with this, but earlier today I was rearranging my whole .emacs file and I might have done something which interferes with auctex or latex, but I tried compiling another file and it worked.
Thanks :)
| Error trying to compile latex document. Where can I find the file "report output*"? | CC BY-SA 2.5 | null | 2010-06-27T06:29:54.610 | 2010-06-27T07:21:03.057 | 2017-02-08T14:27:41.210 | -1 | 347,646 | [
"emacs",
"latex",
"compilation",
"auctex"
] |
3,127,503 | 1 | 3,127,780 | null | 5 | 2,253 | I was wondering if there's a way to sort columns with Table sorter
So that I could arrange the columns themselves according to some ID or anything.

So here for instance, If I want to sort the table so that the Apple column
Would be first, how do I do that?
| Sorting Table Columns with jQuery Table Sorter | CC BY-SA 2.5 | null | 2010-06-27T13:37:14.253 | 2010-09-03T22:21:29.677 | null | null | 333,283 | [
"jquery",
"tablesorter"
] |
3,127,705 | 1 | null | null | 0 | 195 | I just updated my app to .Net 4.0 from 3.5sp1
Which included removing references to the toolkit and exhange them with system.xaml.
Some more reference changing was required by me but I dont quite recall what they were.
Anyway, after I compiled and run it the the first thing that popped into my eyes is that all the images seem worse.
Here's a screenshot that show some of the changes, WPF 4.0 is on the right

Will appreciate any help.
Thanks
Dan
| Images in WPF 4.0 are of lesser quality than in 3.5 | CC BY-SA 3.0 | 0 | 2010-06-27T14:43:38.597 | 2022-11-02T09:12:34.233 | 2011-11-28T01:16:01.947 | 234,976 | 377,422 | [
"c#",
".net",
"wpf",
"image"
] |
3,130,222 | 1 | 3,130,266 | null | 1 | 466 | I've attached the relevant portion of my web.config file below.
When a user attempts to directly visit the url admin.aspx, and they are not an admin, they are redirected to the login page. However, the user then attempts to visit ViewWeek.aspx, it indicates that they are still logged in.
Why does this ASP.NET authorization boot the user to the login screen, yet keep the user logged in? I'd rather it just direct the user to the default URL specified in the forms tag.
Thanks
```
<authentication mode="Forms">
<forms name=".ASPXFORMSAUTH" defaultUrl="ViewWeek.aspx" timeout="50000000" />
</authentication>
```

| ASP.NET Authorization - When a user is denied access, they are redirected to the login screen, yet they are still logged in. How can I change this? | CC BY-SA 2.5 | null | 2010-06-28T05:20:32.167 | 2010-06-28T11:06:16.037 | null | null | 127,880 | [
"asp.net"
] |
3,133,118 | 1 | 3,134,054 | null | 1 | 260 | So, I'm writing an AS3 program that tiles floor tiles. I want the user to be to be able to create their own floor schematic represented by different rectangles. It'll be drag-and-drop. They will lay out their schematic (which is composed of different size rectangular tiles) and drop colors/patterns onto them.
This schematic will then be tiled on a 3D plane to represent what the actual floor would look like.
I've got the 3D part working, drag-and-drop working, etc. What I'm missing is the floor schematic stuff. I've spent a lot of time trying to figure out the best solution, but I can't QUITE get there.
Here are some examples (out of a WHOLE bunch of possible combinations) of how the floor schematics could look:




The different tiles within the schematic are the droppable regions. My problem: ? Don't worry about tiling, sizing, etc. I've got that all figured out already. I just literally do not know how I can represent a tile schematic in XML and draw it correctly with AS3. Any ideas?
| How do I represent tiles in XML? | CC BY-SA 2.5 | null | 2010-06-28T14:15:13.347 | 2010-06-28T22:10:10.910 | null | null | 249,867 | [
"xml",
"flash",
"actionscript-3",
"abstraction",
"papervision3d"
] |
3,135,057 | 1 | null | null | 1 | 529 | This is the type of dropdown window I would like. It has columns, with different types of data in each. I tried just using tab delimiting, but it made it look sloppy. How could I get a dropdown / combobox element like this using PyQt4? (Ignore the black box, I just wanted to hide my system files).

| How can I get this kind of dropdown with Qt? (Specifically PyQt4) | CC BY-SA 2.5 | 0 | 2010-06-28T18:24:28.493 | 2013-01-07T14:06:58.583 | null | null | 146,044 | [
"python",
"user-interface",
"pyqt4"
] |
3,136,713 | 1 | 3,136,739 | null | 1 | 1,326 | In my application a calculation is performed which display the text to the GUI.
The application multiplies a user given amount by a defined number (Say 0.85) to create a total (User types in 2, application works out 2 x 0.85).
As the number that is displayed is that of a currency I am trying to correctly format the text to make it readable and correct.
So far I have tried
```
.ToString("N2");
```
This has just resulted in two additional zero's being appended to the end of the figure.
The problem can be seen here:

As you can see the correct value is .68 (Or £0.68) and my text is showing £68.00
Taking the "N2" out of the ToString does help but I'm still left with £68.
I know this is not as trivial as it sounds but it's something I've never needed to think about before and it's got me thinking about it for a long while.
Thanks!
The data is stored as a double and was previously a float, the application is flexible to change. The currency icon is also not needed as I am providing that manually, only the formatting is necessary.
| How to correctly format text based on currency | CC BY-SA 2.5 | null | 2010-06-28T22:49:13.750 | 2010-06-28T23:14:44.600 | 2017-02-08T14:27:43.607 | -1 | 218,159 | [
"c#",
"formatting",
"currency",
"textbox"
] |
3,137,972 | 1 | 5,061,750 | null | -1 | 66 | Using the repo found here:
[http://github.com/nkallen/screw-unit](http://github.com/nkallen/screw-unit)
and this commit:
cc41f3cf373d804b11519704faf1971370f43760
I get this screen when viewing the package's "EXAMPLE.html" file:

Basically all of the text showing how many tests were run and the describe/it clauses, and the test results are missing.
The same revision works fine on Safari and Firefox.
I found this report that seems related, but no follow-up:
[http://groups.google.com/group/screw-unit/browse_thread/thread/f0e82f5d68acbf21](http://groups.google.com/group/screw-unit/browse_thread/thread/f0e82f5d68acbf21)
Any ideas?
Edit: I found that upgrading jquery from version 1.2.6 (included with package) to 1.4.2 results in a screen in which green/red tests show up. Unfortunately, the top header showing the number of total tests and failing tests does not show up.
| How can I get Screw.Unit to Run on Internet Explorer | CC BY-SA 2.5 | 0 | 2010-06-29T05:00:15.963 | 2011-02-21T02:34:24.440 | 2010-09-04T01:23:07.917 | 54,426 | 54,426 | [
"javascript",
"internet-explorer",
"screwunit"
] |
3,139,777 | 1 | 3,139,816 | null | 1 | 4,456 | I used the FPDF class to create a multi-page PDF document and then I used an iframe to display the multi-page document.

I want to do the same thing on another page, except a bit different. Instead of displaying one multi-page PDF document, I would like to let the user upload two separate PDF's and then I display the two PDF's within the same iframe.
How can I make two different PDF files appear in the same iframe
| How can I make two different PDF files appear in the same iframe? | CC BY-SA 2.5 | null | 2010-06-29T10:25:00.437 | 2010-06-29T10:37:11.337 | 2017-02-08T14:27:43.970 | -1 | 83,916 | [
"php",
"html",
"pdf",
"iframe"
] |
3,144,397 | 1 | null | null | 4 | 299 | Is it possible to have concrete factories create concrete classes with type specific parameters for them, using the abstract factory pattern? Or do the different concrete classes created by their respective concrete factories need to to have the same fields?
Ex) In the image below how would you go about to instantiate the WinButton and the OSXButton with different set of arguments given by the client (Application)?

| How do you set specific properties to a class created by an abstract factory? | CC BY-SA 3.0 | null | 2010-06-29T20:16:49.887 | 2011-06-25T03:30:05.743 | 2011-05-16T20:55:26.387 | 21,234 | 360,674 | [
"oop",
"design-patterns",
"language-agnostic",
"factory-pattern"
] |
3,145,084 | 1 | 3,145,711 | null | 6 | 2,248 | Sorry for the title, it's difficult to explain.
I need a data model similar to this:

As you can see, a set can belong to both a user or a school. My problem: It should only be allowed to belong either to a user OR a school. But never both at the same time.
How can I solve this problem?
| MySQL: Two n:1 relations, but not both at once | CC BY-SA 2.5 | 0 | 2010-06-29T21:58:39.320 | 2010-06-30T17:43:07.277 | 2010-06-30T00:13:48.497 | 20,860 | 284,318 | [
"mysql",
"database-design",
"relational-database",
"polymorphic-associations"
] |
3,146,739 | 1 | 3,147,944 | null | 7 | 579 | I'm having some trouble with colors in interface builder and cocoa.
I build out my interface in photoshop, and when I copy the RGB values from photoshop and set my UI elements in interface builder, or through code, the colors are not even close. I've messed around with setting color profiles in photoshop but can't seem to find one that makes a difference (maybe I'm just using them wrong)
Can anyone lend a hand as to how to set photoshop to more accurately depict the colors used by cocoa? This is what I mean:

I created a box in interface builder and set its RGB to 50, 100, 150, then took a screenshot of it and pasted it into photoshop. Then I created another box in photoshop and set its rgb value to 50, 100, 150. If I sample the IB color, it's RGB comes out to 63, 120, 163.
| Color differences between cocoa and photoshop | CC BY-SA 3.0 | 0 | 2010-06-30T05:44:42.760 | 2011-10-28T20:46:35.033 | 2011-10-28T20:46:35.033 | 757,830 | 112,356 | [
"cocoa",
"macos",
"colors",
"photoshop"
] |
3,146,823 | 1 | 3,158,958 | null | 5 | 12,766 | I'm trying to add a legend under the plot in scattered chart as shown below. Anyone knows if this is possible?
Before:

After:

| Is it possible to add Legend to the plot in JFreeChart? | CC BY-SA 2.5 | 0 | 2010-06-30T06:04:50.527 | 2010-07-01T14:54:31.550 | 2017-02-08T14:27:47.423 | -1 | 328,443 | [
"java",
"charts",
"jfreechart"
] |
3,147,635 | 1 | 11,585,604 | null | 11 | 2,453 | I know you can edit a file in githubs website, but I can't find if you can create or delete a file.
---
Note that since early December 2012, you can create [new files directly from GitHub](https://github.com/blog/1327-creating-files-on-github):

> : You can pre-fill the filename field using just the URL.
Typing `?filename=yournewfile.txt` at the end of the URL will pre-fill the filename field with the name `yournewfile.txt`.

| Is it possible to create a file somewhere in github via browser? | CC BY-SA 3.0 | 0 | 2010-06-30T08:39:42.097 | 2012-12-07T14:52:53.220 | 2012-12-07T14:52:53.220 | 6,309 | 304,894 | [
"browser",
"github"
] |
3,148,451 | 1 | 3,149,106 | null | 2 | 528 | I've tried to run this code under scala 2.7.3 and 2.7.7 and everytime i get this error. What is wrong?
```
import scala.io._
def toInt(in: String): Option[Int] =
try {
Some(Integer.parseInt(in.trim))
} catch {
case e: NumberFormatException => None
}
def sum(in: Seq[String]) = {
val ints = in.flatMap(s => toInt(s))
ints.foldLeft(0)((a, b) => a + b)
}
println("Enter some numbers and press ctrl-D (Unix/Mac) ctrl-C (Windows)")
val input = Source.fromInputStream(System.in)
val lines = input.getLines.collect
println("Sum "+sum(lines))
```

| Got NoClassDefFound running sample code | CC BY-SA 2.5 | null | 2010-06-30T10:46:18.620 | 2010-06-30T12:28:01.737 | 2017-02-08T14:27:48.787 | -1 | 174,943 | [
"scala"
] |
3,148,969 | 1 | 3,149,027 | null | 10 | 4,774 | My website has several nested folders and sometimes long file names, so sometimes only 4 tabs can be opened at a time.
1. Can vs2010 be made to show only file names and leave out any path information?
2. Can the max displayed length for tabs be set?
I know the window can be split so top and bottom both have their own tabs.
For example (using the ["Visual Studio 2010 Pro Power Tools"](http://visualstudiogallery.msdn.microsoft.com/d0d33361-18e2-46c0-8ff2-4adea1e34fef/)):

Showing the files:
- - - - -
For example (not using the Visual Studio 2010 Pro Power Tools):

Showing the files:
- - - -
| VS2010 Only show file names in tabs | CC BY-SA 3.0 | 0 | 2010-06-30T11:55:24.407 | 2021-04-30T06:05:28.070 | 2012-07-05T14:22:05.463 | 12,597 | 351,025 | [
"visual-studio-2010"
] |
3,149,436 | 1 | null | null | 0 | 1,006 | I've a case where I'm using one table to store user and group related datas. This column is called profile. So, basically this table is many-to-many table for the cases where one user is belonging in to many groups or there are many users in one group.
I'm a bit confused how it should be described...
Here's a simplified presentation of the class.
[Entity relationship model](http://img337.imageshack.us/img337/7561/profiles.png)

```
user_group_table = Table('user_group', metadata,
Column('user_id', Integer,ForeignKey('profiles.id',
onupdate="CASCADE", ondelete="CASCADE")),
Column('group_id', Integer, ForeignKey('profiles.id',
onupdate="CASCADE", ondelete="CASCADE"))
)
class Profile(Base)
__tablename__ = 'profiles'
id = Column(Integer, autoincrement=True, primary_key=True)
name = Column(Unicode(16), unique=True) # This can be either user- / groupname
groups = relationship('Profile', secondary=user_group_table, backref = 'users')
users = relationship('Profile', secondary=user_group_table, backref = 'groups')
#Example of the usage:
user = Profile()
user.name = 'Peter'
salesGroup = Profile()
salesGroup.name = 'Sales'
user.groups.append(salesGroup)
salesGroup.users
>[peter]
```
| SQLAlchemy recursive many-to-many relation | CC BY-SA 3.0 | null | 2010-06-30T12:58:28.797 | 2015-02-05T19:42:38.870 | 2011-12-20T23:30:17.357 | 53,195 | 380,078 | [
"sqlalchemy",
"pylons"
] |
3,149,568 | 1 | 3,149,619 | null | 1 | 6,056 | When developing a Win32 Application (non-console application) in Visual Studio 2005, is there any way to get the same sort of output as you do from the console?
For instance, say I want to see log statements (such as I would with cout in a console application) to trace the path my program has taken in the code.
My first thought would be that this could be done through the Output tab selecting something from its "Show output from:" dropdown, when debugging but I don't know what API I need to do this...

For example say I had the following in my windows application and wanted to know when the following function enters and exits writing the result to the Visual Studio window above.
```
void someFunction(void)
{
Win32APIConsoleLog("BEGIN: someFunction()");
// ...
Win32APIConsoleLog("END: someFunction()");
}
```
Is this possible? And if so, what what libraries do I need to include and what function calls do I need to make to write out to the console window?
| Win32 Application Console Output? | CC BY-SA 2.5 | null | 2010-06-30T13:16:09.270 | 2018-10-06T14:47:55.170 | 2017-02-08T14:27:49.133 | -1 | 18,149 | [
"debugging",
"visual-studio-2005",
"winapi",
"console",
"trace"
] |
3,151,493 | 1 | 3,153,010 | null | 2 | 1,250 | I have this table:
CREATE TABLE perarea
(
id_area INT primary key,
nombre VARCHAR2(200),
id_areapadre INT references perarea(id_area)
);
And this was added to access the data:

My intention is to create a hierarchy showing areas and their subordinates in the treeview. Then when a user clicks a node, have a table on the right of the treetable load all employee from that area.
First thing's first though, how can I populate the treetable?
Thank you!
| How can I use a treetable to show all rows in an Oracle SQL table? | CC BY-SA 3.0 | null | 2010-06-30T16:51:23.517 | 2021-09-06T21:37:13.467 | 2015-05-13T21:19:41.320 | 4,640,209 | 112,355 | [
"java",
"oracle-adf",
"treetable"
] |
3,151,544 | 1 | 3,151,625 | null | 0 | 162 | Here's what I have:
I have a table called Area that is self referential. If the column ParentAreaID is null it means it's a parent area. If it has a value, it means that it has a parents.

How can I show a table with ID, Name and NAME (of the parents using the self referential ID)?
| How can I show a name using the ID as the foreign key? | CC BY-SA 2.5 | null | 2010-06-30T16:57:48.897 | 2010-06-30T17:08:47.733 | null | null | 112,355 | [
"oracle",
"jdeveloper"
] |
3,151,839 | 1 | null | null | 1 | 77 | I often have to create software to run tests (on hardware or other software), but I don't know of a good user interface control in .NET for displaying test results.
(Just to clarify, I am not looking for a testing solution for .NET code. I am looking for a way to provide a system similar to those used for testing code to a user so that she can run pre-made tests on some other object.)
Most unit testing frameworks provide such a user interface, and I am particularly fond of Resharper's UI for unit tests:

Does anyone know of a custom control (open source or for purchase) that would provide this sort of interface?
Ideally, the developer would be able to load up the UI with a collection of items which can be `Run` and potentially `Stop`ped, would have a `Passed` boolean, and could output useful information (e.g. text or formatted HTML/XML).
| Framework user interface for running tests and reporting results | CC BY-SA 2.5 | 0 | 2010-06-30T17:36:14.983 | 2015-03-15T15:17:24.880 | 2017-02-08T14:27:49.473 | -1 | 116,891 | [
".net",
"testing",
"user-interface"
] |
3,152,292 | 1 | 3,153,640 | null | 0 | 3,485 | I'm trying to word wrap a richeditable text but I'm having some problems:

I want it to wrap vertically so I can avoid the horizontal scrollbar.
The Air app only has a spark list and the itemrenderer used is this:
```
<?xml version="1.0" encoding="utf-8"?>
<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
autoDrawBackground="true">
<s:RichEditableText width="100%" height="100%" multiline="true" text="{data.text}"/>
</s:ItemRenderer>
```
Any ideas ho to fix this? Thank you.
| Flex 4 richeditabletext word wrap | CC BY-SA 2.5 | null | 2010-06-30T18:35:11.603 | 2013-07-13T02:31:30.310 | 2017-02-08T14:27:49.817 | -1 | 1,013 | [
"apache-flex",
"air",
"flex4",
"word-wrap"
] |
3,153,193 | 1 | 3,170,041 | null | 1 | 893 | Here is my problem
Image

I want to check if the balls are touching, which works perfect. Sometimes however that ball with the arrow isn't picked up which of course makes sense since it isn't touching anything. However, I want to give a little bit of leeway so that if a ball is say 4 pixels/0.001m away, it should be considered as touching. So what idea/ how would i go about implementing it. I looked at the isTouching code and here is what I can come up with.
```
var b1 = body1;
var b2 = body2;
Transform xf;
Transform xf2;
b1.GetTransform(out xf);
b2.GetTransform(out xf2);
var touching = AABB.TestOverlap(b1.GetFixtureList().GetShape(), b2.GetFixtureList().GetShape(), ref xf, ref xf2);
if (!touching)
continue;
```
I still need to test if there is a ball faraway, and I am clueless to what I can do.
| BOX2D Contact (isTouching) Problem | CC BY-SA 2.5 | null | 2010-06-30T20:35:53.053 | 2010-07-03T02:10:45.640 | null | null | 275,561 | [
"c#",
"xna",
"box2d"
] |
3,154,199 | 1 | 3,154,243 | null | 0 | 208 | I have an embedded web server written in C using uIP libraries, in a microcontroller, which outputs the following static text in response to an http get. It is shown below as a C literal string:
```
"HTTP/1.0 200 OK\r\n"
"Server: UIP/1.0 (http://www.something.com/)\r\n"
"Content-type: text\html\r\n"
```
Right after that comes the doctype string \ and the \ ... \</html> body of the page requested. I did not write this code, but it was handed to me. Now I try it on Opera, Firefox, and Internet Explorer. The entire webpage is using Ansi/C and no special strings or bytes. But it loads and displays properly only on Opera. For some reason this particular uIP based web-browser will not render on IE 8 or Firefox.
![alt text][1]
What can I add to the http headers to make my micro-web-server encoding of basic/default C/ansi codepage be detected properly for all browsers, and not just opera?

| Is there some http GET response that I can add to fix an encoding problem on the client web browser? | CC BY-SA 2.5 | null | 2010-06-30T23:37:11.853 | 2010-06-30T23:49:34.947 | null | null | 84,704 | [
"http",
"tcp",
"embeddedwebserver",
"http-get",
"embedded"
] |
3,154,269 | 1 | 3,155,620 | null | 1 | 1,198 | Using the [Python bindings](http://cgal-python.gforge.inria.fr/) for [CGAL](http://www.cgal.org/), I can't work out how create a hexahedron, nor how to calculate its intersection with another hexahedron.
I have 8 input points, which are the corners of the hexahedron:

My code does this:
```
P = Polyhedron_3()
bottom = P.make_tetrahedron(p[0],p[1],p[2],p[3])
top = P.make_tetrahedron(p[4],p[5],p[6],p[7])
left = P.make_tetrahedron(p[0],p[1],p[5],p[4])
right = P.make_tetrahedron(p[3],p[2],p[6],p[7])
front = P.make_tetrahedron(p[4],p[7],p[3],p[0])
back = P.make_tetrahedron(p[1],p[2],p[6],p[5])
```
but when I count the points in the resulting polyhedron there are 24 - each face is unjoined with its neighbours.
How can I build a solid hexahedron using Python CGAL?
And, finally, having successfully constructed two such polyhedron, how do I calculate their intersection?
| creating and intersecting hexahedrons with CGAL | CC BY-SA 2.5 | null | 2010-06-30T23:57:52.713 | 2010-07-01T09:28:39.137 | 2017-02-08T14:27:50.503 | -1 | 15,721 | [
"python",
"geometry",
"cgal"
] |
3,155,888 | 1 | 3,157,846 | null | 0 | 2,623 | I am testing a `CPPieChart` and finding that the data source delegate method `-sliceLabelForPieChart:recordIndex:` is not displaying a slice label.
In addition, there is no `title` property for the pie chart type.
So I figured I would test using a `UILabel` instance:
```
UILabel *viewTitle = [[UILabel alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 100.0f, 24.0f)];
viewTitle.text = @"Total Space";
[hostingView addSubview:viewTitle];
[viewTitle release];
```
Interestingly, it looks like the label coordinates are inverted and the text is mirrored:

What is the best way to resolve the coordinate system inversion and text mirroring?
| How to correctly add Core Plot label/annotation to a CPPieChart object? | CC BY-SA 2.5 | 0 | 2010-07-01T07:42:03.013 | 2010-12-22T16:27:26.277 | 2017-02-08T14:27:51.177 | -1 | 19,410 | [
"iphone",
"uilabel",
"core-plot",
"cppiechart"
] |
3,156,294 | 1 | 3,156,319 | null | 26 | 1,305 | hey I'm looking for are clean solution to this problem:

i start the loop with `i = 0` in the second loop step the `i = 1`, then `i = -1` and then `i = 2` ect.
how to programm this with a `for` loop in a clean way?
| looping in two directions | CC BY-SA 2.5 | 0 | 2010-07-01T08:54:54.977 | 2011-11-24T13:03:39.240 | 2017-02-08T14:27:51.547 | -1 | 230,202 | [
"php",
"javascript",
"loops",
"for-loop"
] |
3,156,595 | 1 | 3,156,626 | null | 0 | 245 | I'm creating a survey with 10 questions. All questions have 5 possible answers with values from 1-5. The data is stored in a database with one row per user. There is a column for the answer to every question.

To make bar graphs for the answers to every question, I currently retrieve the count of rows where the value of a specific column is equal to a specific possible answer:
```
SELECT COUNT(*) AS `records_found` FROM (`antworten`) WHERE `frage1` = 1
SELECT COUNT(*) AS `records_found` FROM (`antworten`) WHERE `frage1` = 2
SELECT COUNT(*) AS `records_found` FROM (`antworten`) WHERE `frage1` = 3
SELECT COUNT(*) AS `records_found` FROM (`antworten`) WHERE `frage1` = 4
SELECT COUNT(*) AS `records_found` FROM (`antworten`) WHERE `frage1` = 5
SELECT COUNT(*) AS `records_found` FROM (`antworten`) WHERE `frage2` = 1
SELECT COUNT(*) AS `records_found` FROM (`antworten`) WHERE `frage2` = 2
SELECT COUNT(*) AS `records_found` FROM (`antworten`) WHERE `frage2` = 3
SELECT COUNT(*) AS `records_found` FROM (`antworten`) WHERE `frage2` = 4
SELECT COUNT(*) AS `records_found` FROM (`antworten`) WHERE `frage2` = 5
(...)
```
This will generate a graph like this: [http://i.imgur.com/SESJ8.png](https://i.imgur.com/SESJ8.png)
This is probably very stupid, and there is probably a much better way to retrieve the desired data. I just can't come up with it, could someone help me? :) Thank you.
| Optimize an SQL query to get count of specific answers | CC BY-SA 2.5 | null | 2010-07-01T09:41:29.217 | 2010-07-01T09:53:05.443 | null | null | 284,318 | [
"mysql",
"count"
] |
3,157,367 | 1 | null | null | 1 | 1,498 | I would like to group rows in categories like that:

I know how to do this with OutlookGroupBy but its not possible to put the same row into severals categories
So is there a way to group rows while beeing possible to put the same row into several categories at the same time?
My ultragrid is bound to a dataset
| Infragistics - Ultragrid - Group rows into categories | CC BY-SA 3.0 | null | 2010-07-01T11:41:05.280 | 2017-03-01T08:10:52.230 | 2017-03-01T08:10:52.230 | 4,283,590 | 381,034 | [
"c#",
"infragistics",
"ultrawingrid"
] |
3,158,860 | 1 | 3,158,961 | null | 0 | 84 | I use Firefox in daily use. While testing own web-application in Internet Explorer, I've get bug like this(as example facebook.com page):

As example I capture facebook.com website. Blue colored textboxes. This issue then I catch in other web-sites.
How to fix this problem? I haven't installed any plugin to IE and haven't customized it ever.
Is anybody catch same problem?
| Internet explorer 8 blue colored textboxes in my PC | CC BY-SA 2.5 | null | 2010-07-01T14:43:50.003 | 2010-07-01T14:54:53.903 | 2017-02-08T14:27:52.577 | -1 | 211,452 | [
"windows-vista",
"internet-explorer-8"
] |
3,159,969 | 1 | 3,160,613 | null | 0 | 241 | I'm currently developing my first android app, and my first game. I've been developing on a netbook with a CliqXT (HVGA). Things are going well, it renders perfectly on the smaller screen. I knew I'd have some issues when rendering on larger screens, but the issues I'm having are not what I was expecting and I'm kind of stuck.
So basically the game consists of a main SurfaceView which I'm rendering the tiled game world on to. I followed this tutorial to get started, and my structure is still pretty similar except that it calculates the boundries based on the player location:
```
http://www.droidnova.com/create-a-scrollable-map-with-cells-part-i,654.html
```
The game also has various buildings the player can enter. Upon entering it launches another activity for that particular building. The building activities are just normal Views with Android UI stuff defined in XML (Buttons, TextViews, etc).
So I expected the the building UIs to render correctly on the larger screen. I specified all dimensions in "dp" and fonts in "sp" in hopes that they'd scale correctly. I expected the actual game tilemap to render generally correctly, but maybe be really tiny due to the higher resolution / dpi. I'm using a very similar function to the tutorial linked above (calculateLoopBorders(), my version is pasted below) to calculate how many tiles to render based on screen height and width (getHeight() and getWidth()).
The whole game is just being rendered as if it's HVGA. The tilemap, and the building UIs are just scaled down to the smaller screen size, leaving black borders around the left, right, and bottom (see images).
If anyone can point me in the right direction it'd be greatly appreciated, thanks a lot!
(Some of you may recognize this public domain DOS classic)


Edit: Thanks Christian for fixing code formatting.
mCellHeight and mCellWidth are the width/height of the cells in pixels
mMapHeight and mMapWidth are the width/height of the total game world in number of tiles
```
public void calculateLoopBorders() {
mWidth = getWidth();
mHeight = getHeight();
mStartRow = (int) Math.max(0, mPlayer.mRow - ((int) (mHeight / 2) / mCellHeight));
mStartCol = (int) Math.max(0, mPlayer.mCol - ((int) (mWidth / 2) / mCellWidth));
mMaxRow = (int) Math.min(mMapHeight, mStartRow + (mHeight / mCellHeight)) + 1;
mMaxCol = (int) Math.min(mMapWidth, mStartCol + (mWidth / mCellWidth));
if (mMaxCol >= mMapWidth) {
mStartCol = mMaxCol - (mWidth / mCellWidth);
}
if (mMaxRow >= mMapHeight) {
mStartRow = mMaxRow - (mHeight / mCellHeight);
}
int x1 = mStartCol * mCellWidth;
int y1 = mStartRow * mCellHeight;
int x2 = x1 + mWidth;
int y2 = y1 + mHeight;
mBgSrcRect = new Rect(x1, y1, x2, y2);
mBgDestRect = new Rect(0,0, mWidth, mHeight);
}
```
| Issues with screen sizes and activity rendering | CC BY-SA 2.5 | null | 2010-07-01T17:00:12.187 | 2010-07-24T12:54:54.123 | 2010-07-01T17:39:30.907 | 1,742,702 | 1,742,702 | [
"android",
"compatibility"
] |
3,160,787 | 1 | 3,264,650 | null | 3 | 541 | I have an iPhone SDK project that is supposed to build a static library for both the simulator and the ARM processor and then combine the two into a universal library.
Heretofore, I was using iPhone SDK 3+ and accomplished this by creating a separate target for each, one simulator and one ARM, and then making a third target that combines them using a shell script. The deployment targets/build settings for each of the constituent targets are set to their respective architectures, etc. Also, iPhone SDK 3+ allowed me to select "Base SDK" from the drop down menu in the upper-left corner of the main XCode window.
Everything worked famously--then I upgraded to SDK 4.
Now, there is no "Base SDK" listing in the drop down menu in the upper-left. Also, the compiler seems to ignore the target deployment settings entirely. Even though one of the targets is set to "iPhone Device" and the other is set to "iPhone Simulator", they still build as whatever is set in the drop down menu.
In case I've not been clear enough, here is the offending aforementioned menu we all know and love:

Once again, in SDK 3 everything worked perfectly. Now in SDK 4, if it's set to "Device" I get two libraries built for ARM. If it's set to simulator, I get two libraries built for the simulator.
Anybody know of a workaround for this bullhonkey?
Thanks much.
UPDATE: the "xcodebuild" command line tool still works, that is to say it will build the correct architecture according to each target's deployment parameters.
Thus, rather than using XCode's GUI to build, I can use a shell script that calls xcodebuild like so:
It'd still be nice to find a real solution, but this will get the job done for now.
| Targeting multiple platforms in iPhone SDK 4 | CC BY-SA 2.5 | 0 | 2010-07-01T18:51:24.263 | 2010-07-18T21:09:05.817 | 2010-07-01T23:36:11.023 | 223,201 | 223,201 | [
"iphone",
"linker"
] |
3,161,385 | 1 | 3,161,502 | null | 80 | 78,451 | I created this community wiki to bind together a number of
other Q/A's I've seen here on SO. If you're here, you've probably
installed the final version of Xcode 3.2.3 with iPhone SDK 4 ([download link](https://developer.apple.com/iphone/download.action?path=%2Fiphone%2Fiphone_sdk_4__final%2Fxcode_3.2.3_and_iphone_sdk_4__final.dmg), reg reqd), and then encountered one or both of these problems:
- In your previously working Xcode iPhone project, you get "Base SDK Missing" somewhere. Something like this:- In a related but more general observation, none of the previously available panoply of Device or Simulator SDK choices (e.g. 3.0, 3.1, 3.1.3, ...) is available where you used to see them.
| Install Xcode 3.2.3 w/ iPhone SDK 4, get "Base SDK missing", can't see other SDKs | CC BY-SA 4.0 | 0 | 2010-07-01T20:22:55.637 | 2019-01-11T03:54:51.677 | 2019-01-11T03:54:51.677 | 1,033,581 | 45,813 | [
"iphone",
"xcode",
"ios4"
] |
3,163,600 | 1 | null | null | 2 | 377 | I am using the delegate method for auto rotation in iphone application.
```
-(BOOL)shouldAutorotateToInterfaceOrientation:UIInterfaceOrientation)interfaceOrientation{
if(interfaceOrientation == UIInterfaceOrientationPortrait ){
[UIView beginAnimations:@"View Flip" context:nil];
[UIView setAnimationDuration:0.2f];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
self..view.transform = CGAffineTransformMakeRotation(0);
self.view.bounds = CGRectMake(0,0,320,460);
[UIView commitAnimations];
self.navigationBar.frame=CGRectMake(0, 0, 320, 44);
}else if(interfaceOrientation == UIInterfaceOrientationLandscapeRight){
[UIView beginAnimations:@"View Flip" context:nil];
[UIView setAnimationDuration:0.2f];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
CGAffineTransform transform = CGAffineTransformMakeRotation(3.14159/2);
self.view.transform = transform;
CGRect contentRect = CGRectMake(10, -10, 480, 300);
self.view.bounds = contentRect;
[UIView commitAnimations];
self.navigationBar.frame=CGRectMake(0, 0, 480, 32);
}else if(interfaceOrientation == UIInterfaceOrientationLandscapeLeft){
//navigationController.navigationBar.frame=CGRectMake(0, 0, 480, 34);
[UIView beginAnimations:@"View Flip" context:nil];
[UIView setAnimationDuration:0.2f];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
CGAffineTransform transform = CGAffineTransformMakeRotation(-3.14159/2);
self.view.transform = transform;
CGRect contentRect = CGRectMake(-10, -10, 480, 300);
self.view.bounds = contentRect;
[UIView commitAnimations];
self.navigationBar.frame=CGRectMake(0, 0, 480, 32);
}else if(interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown ){
return NO;
}
return YES;
}
```
It is working fine on iphone OS3 but on iphone OS4, when rotating to landscape mode, the interface displays incorrectly

When rotating back to portrait mode the interfaces compresses....

Please suggest me any suggestion how I resolve it ??
Thanks
Deepika
| Issue when iphone takes place the Landscape Orientation | CC BY-SA 3.0 | null | 2010-07-02T06:15:29.540 | 2011-12-12T18:41:16.760 | 2011-12-12T18:41:16.760 | -1 | 343,054 | [
"iphone",
"objective-c",
"cocoa-touch"
] |
3,164,090 | 1 | 14,235,610 | null | 0 | 323 | I have 2 picture that there is two line,I want to compare there two curved line and know how much they are similar together...I use Mathlab for programming and also use Image process package.
Thank's in advance
[Photo Album](https://web.archive.org/web/20181112054310/http://www.photoalbum-2day.com:80/)
[URL=[http://www.photoalbum-2day.com/image.php?i=31873-jpg][IMG=http://www.photoalbum-2day.com/images/000/031/873-t.jpg][/IMG][/URL]](http://www.photoalbum-2day.com/image.php?i=31873-jpg][IMG=http://www.photoalbum-2day.com/images/000/031/873-t.jpg][/IMG][/URL])
| how I can compare two curved lines in two pictures? | CC BY-SA 4.0 | 0 | 2010-07-02T08:05:13.087 | 2019-07-31T19:04:44.617 | 2019-07-31T19:04:44.617 | 4,751,173 | 342,743 | [
"image-processing",
"curve"
] |
3,165,600 | 1 | 3,338,150 | null | 3 | 316 | I have seen something like this:

in a Menulet on the right of menu items and I can't figure out how to do it.
Can anyone elaborate? Thank you!
| NSMenuItem number bubble? | CC BY-SA 2.5 | null | 2010-07-02T12:25:20.260 | 2010-07-26T19:13:39.720 | 2010-07-04T21:53:25.650 | 168,225 | 382,039 | [
"cocoa",
"nsmenu",
"nsmenuitem"
] |
3,166,440 | 1 | 3,189,788 | null | 0 | 1,699 | I downloaded JEDIVCL package.... according to its help i have to run install.bat from jcl folder and then run install.bat from jvcl folder. i launched install.bat from jvcl folder but i received this error:

and if run install.bat from jcl folder receive this error:

How can I solve this problem? if its possible give me steps to install this package.
| Error in installing JEDI - please install the dependencies first | CC BY-SA 4.0 | null | 2010-07-02T14:09:13.483 | 2019-07-31T19:31:04.450 | 2019-07-31T19:31:04.450 | 4,751,173 | 371,686 | [
"delphi",
"delphi-7"
] |
3,170,130 | 1 | 3,170,182 | null | 1 | 1,019 | I'd like to make a list adapter that formats views like this:

I want to be able to fire a different onClick when the user clicks the image. I have defined the onClick on the image itself in the getView() override, but how do I then get the position of the line that was clicked so I can update the record in the database to record the action?
| Creating a split button for a custom ListView adapter | CC BY-SA 2.5 | 0 | 2010-07-03T02:50:20.100 | 2010-07-03T03:16:39.563 | null | null | 283,952 | [
"android",
"listview",
"listviewitem"
] |
3,170,368 | 1 | 3,172,203 | null | 1 | 450 | I have website with list and anchor links.
I want to have the anchor length is fixed so that it will not come to next line.
When I move the mouse over,the remaining text should be displayed and when the over leave out of the link, it should be again set back to normal one line.
I want the one like the green color.

| how to have fixed with list or anchor element in html? | CC BY-SA 2.5 | 0 | 2010-07-03T04:58:34.367 | 2010-07-03T17:13:23.030 | 2017-02-08T14:27:55.290 | -1 | null | [
"html",
"css"
] |
3,171,044 | 1 | 3,173,999 | null | 0 | 165 | I'd need to make a new style for buttons and text entry controls. It should look something like

Is there a way to do this?
| WxPython custom styled controls | CC BY-SA 2.5 | null | 2010-07-03T09:37:58.937 | 2010-07-04T07:07:03.413 | 2017-02-08T14:27:55.967 | -1 | 151,377 | [
"python",
"controls",
"wxpython"
] |
3,172,304 | 1 | 3,172,441 | null | 7 | 15,872 | I recently published my first MVC 2 project to a commercial web server, running Windows 2008, and which purportedly supports other MVC sites without issue, but have been experiencing some problems. Here is the high-level structure of the project. As you can see, it is very simple:

But, after the site is published, and I navigate to the URL, I get "HTTP Error 403.14 - Forbidden: The Web server is configured to not list the contents of this directory."
So, I contacted the web host about it and was told I had to include a default landing page, such as Default.aspx, Index.aspx, etc. I doubted this response was accurate because I thought MVC Routing would have taken care of this, but I did as suggested anyway, adding a redirect to my home controller in the Default.aspx.cs codebehind, but got an HTTP Error 404. I added that redirect per advice similar to that found in this article: [http://www.58bits.com/blog/CommentView,guid,10b2ddfa-057c-41d0-bdc7-564b212ce896.aspx](http://www.58bits.com/blog/CommentView,guid,10b2ddfa-057c-41d0-bdc7-564b212ce896.aspx).
I've been going back and forth with the web host about this for over a week, across about a dozen different responses and answers, yet I have not been able to find a resolution to this. I am this is a simple thing to resolve, but I have no idea what to try next, or what to suggest to the web hosting support that they try next.
Soooo ... knowing that the StackOverflow community is smarter than me and the support techs for my web hosting company combined, a thousand times over, I'm hoping you can help me work toward a resolution here, so I can successfully publish my project and access it without error.
| Why won't my MVC project work after publishing it? | CC BY-SA 2.5 | 0 | 2010-07-03T17:49:20.663 | 2014-12-23T11:44:48.523 | 2017-02-08T14:27:56.643 | -1 | 272,219 | [
"asp.net",
"asp.net-mvc",
"windows-server-2008",
"publish"
] |
3,172,623 | 1 | 3,175,732 | null | 2 | 3,234 | I'm putting together a simple game for the iPhone, and am trying to implement the effect of moving the camera around the GLView.
I'm drawing about a hundred objects using `glDrawArrays` with vertex and color pointers. After this, I want to move the camera to the right by 1 unit. This is the snippet of code I have in my `drawView` method. I change the matrix mode to the projection stack, and then change back to model view mode after the project manipulation is complete (I may be getting this wrong, I am a newbie to OpenGL).
```
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glTranslatef(1.0, 0.0, 0.0);
glMatrixMode(GL_MODELVIEW);
```
In any case, the result is definitely not expected. What happens is that I see my objects very briefly (for perhaps a frame), and then they disappear. The same thing happens if I take away the `glTranslatef` in the block above.
What am I doing wrong?
Thanks in advance!
# Before

# After

| Why is my object disappearing after using gluLookat for OpenGL ES 2.0? | CC BY-SA 2.5 | 0 | 2010-07-03T19:29:22.533 | 2010-07-04T20:21:08.783 | 2020-06-20T09:12:55.060 | -1 | 39,155 | [
"iphone",
"opengl-es"
] |
3,172,794 | 1 | 3,172,804 | null | 11 | 7,208 | Does anyone know how to add a scope bar to a `UITableView`?
The App Store app does this sometimes, like in the picture below.
I would like to use this scope bar to add sorting options for the elements in the `UITableView`. This would be more convenient than having a toolbar with a `UISegmentControl`.
I just don't know how to implement this. I don't even know the name of the element (I'm calling it scope bar because it looks just like the scope bar of a `UISearchBar`, but it is not).

| Scope Bar for UITableView like App Store? | CC BY-SA 3.0 | 0 | 2010-07-03T20:30:06.017 | 2014-08-08T17:23:14.087 | 2014-08-08T17:23:14.087 | 64,046 | 382,834 | [
"ios",
"uitableview",
"uisearchbar",
"uisegmentedcontrol"
] |
3,172,813 | 1 | null | null | 3 | 852 | I'm trying to draw a prism and animate it with CoreAnimation. But I can't find a good solution to draw the fan of rainbow colors.

There a a couple of ways to do that, each of them has disadvantages:
- - `CAGradientLayer`- -
Any suggestions?
| Drawing a prism with CoreAnimation | CC BY-SA 2.5 | 0 | 2010-07-03T20:37:21.960 | 2014-11-05T16:34:17.200 | 2017-02-08T14:27:56.983 | -1 | 115,102 | [
"iphone",
"opengl-es",
"core-animation"
] |
3,173,364 | 1 | 3,173,443 | null | 17 | 14,884 | How do I remove the white borders?

| White Border around GroupBox | CC BY-SA 2.5 | 0 | 2010-07-04T00:58:41.563 | 2017-01-19T14:44:35.377 | 2017-02-08T14:27:57.320 | -1 | 314,087 | [
"c#",
"wpf"
] |
3,175,063 | 1 | 3,175,102 | null | 0 | 446 | i want to create an info box in .net 2 (attached is an image with an example)

I wanted to use a panel, but I cannot change the color of its border.
is it possible to change this property? if so, how?
Thanks,
Shuky[](https://i.stack.imgur.com/8GGTQ.jpg)
| creating an Info-box like control in .NET 2 | CC BY-SA 4.0 | null | 2010-07-04T15:00:24.173 | 2019-07-31T23:05:05.560 | 2019-07-31T23:05:05.560 | 4,751,173 | 276,789 | [
"c#",
".net",
"winforms",
"controls"
] |
3,175,520 | 1 | 3,175,544 | null | 0 | 65 | I created an Add-in project and now I have this in my solution explorer:

Do I just add right click the solution and add a Windows form? I'm not sure how this works and the tutorials I find don't touch on this.
Thanks.
| How can I add a Window to my Visual Studio? | CC BY-SA 2.5 | null | 2010-07-04T17:16:06.310 | 2010-07-04T17:40:30.253 | null | null | 112,355 | [
"visual-studio",
"add-in"
] |
3,175,679 | 1 | null | null | 0 | 387 | I am looking to build an app similar to santayourself (facebook application) a screenshot below

The application will accept a photo and then the users can move it with controls for zoom and rotate and moving image right, left, up and down. Then once the face is as required then the user can click save to save the image on the server (php, apache, linux).
Any recommendations on how to go about this project? I guess a javascript solution will be better. Any suggestions welcome.
| Use face from an image for postcard (see screenshot) | CC BY-SA 2.5 | null | 2010-07-04T18:08:52.753 | 2010-07-05T12:58:41.860 | null | null | 79,523 | [
"php",
"javascript",
"image-processing",
"image-manipulation"
] |
3,176,656 | 1 | 3,176,861 | null | 1 | 377 | In C#, I am working on a project to automatically update a separate server with an image and other form data and such... However, the PHP server isn't getting any of the POST data, it's only getting the headers and I can't figure out why.
Here is what I am sending to the server (all new lines have CRLF):
```
POST /new_reply/1 HTTP/1.1
Host: 192.168.1.104
User-Agent: Update Bot
Cookie: SID=sib5m5lgaq66vfp2nfhpab6ug0;UID=bot
Content-Type: multipart/form-data; boundary=-----xxx
Content-Length: 1903
-----xxx
Content-Disposition: form-data; name="form_sent"
1
-----xxx
Content-Disposition: form-data; name="name"
-----xxx
Content-Disposition: form-data; name="body"
hej fra mig
-----xxx
Content-Disposition: form-data; name="image"; filename="test.jpg"
Content-Type: image/jpeg
(image data)
-----xxx
Content-Disposition: form-data; name="post"
Post
-----xxx--
```
Here is the image with the hidden characters show of the request:

Here is the PHP print_r of $_REQUEST on the page /new_reply/1:
```
Array
(
[reply] => 1
[SID] => sib5m5lgaq66vfp2nfhpab6ug0
[UID] => bot
)
```
As you can see, none of the post is coming through...
| POST Headers being sent, but not received on server | CC BY-SA 3.0 | 0 | 2010-07-05T00:11:34.517 | 2014-03-13T21:28:56.240 | 2014-03-13T21:28:56.240 | 414,521 | 383,303 | [
"php",
"http",
"post"
] |
3,176,821 | 1 | null | null | 2 | 1,202 | Okay, so I'm using Expression Blend 4 and learning SL, and am pretty overwhelmed with it all. I'm working on a simple project to animate an aircraft holding pattern. I want to show things on the screen in a specific order:
1. Draw a holding point (the station)
2. Draw the aircraft's position
3. Animate an arrow starting at the aircraft's position and going to the station.
4. draw an arcing arrow (in an animated fashion).
Mockup:

I know enough to use a storyboard to do my animations, but I can't find a way to simply draw my lines/arrows for steps 3 and 4. I can move shapes around like a mo-fo in a storyboard (because that's what all the learning resources show you how to do), but I can't figure out how to just draw a line/arrow. And once I get past that basic step, I need to figure out how to do it programmatically so I can put the aircraft's position in a location relative to the station based on an input parameter.
Any resources or thoughts to help me get started with this?
| How do I draw animated lines in Silverlight? | CC BY-SA 2.5 | 0 | 2010-07-05T01:27:36.613 | 2010-07-06T00:34:16.157 | null | null | 856 | [
"silverlight",
"animation",
"expression-blend"
] |
3,178,336 | 1 | null | null | 0 | 10,551 |
### File datafile.txt
```
code x y
23 22.1 33.11
23 110 22
23 11 200
24 111 321
24 222 111
24 10 22.1
10 88.3 99.3
10 110 32
10 121 143
10 190 200
```
In the above file, the first column represents the image code which is displayed on the screen, and the x and y columns represent the point where people look on the image. There were three different images displayed to the user. The problem with the code below is that I don't know how to save the image with the plotted x-y on with the same name of file as it opened.
```
fid = fopen(datafile.txt);
A = textscan(fid,'%f%f%f'); %Read data from the file
code = A{1};
xfix = A{2};
yfix = A{3};
for k=1:length(code)
imagefile=code(k)
I = imread([num2str(imagefile) '.jpg']); %# Load a sample image
imshow(I); %# Display it
[r,c,d] = size(I) %# Get the image size
set(gca,'Units','normalized','Position',[0 0 1 1]); %# Modify axes size
set(gcf,'Units','pixels','Position',[200 200 c r]); %# Modify figure size
hold on;
x = xfix2(k);
y = yfix2(k);
plot(x,y,'+ b');
f = getframe(gcf); %# Capture the current window
imwrite(f.cdata,([num2str(imagefile) '.jpg'])); %# Save the frame data
hold off
end
```

However, I have a little problem. The "cross plots" which I overlay on the image, were surrounded by gray shadow (like when we photocopy a paper, they will be a gray color on it). How did this happen?
| MATLAB - How to plot x,y on an image and save? | CC BY-SA 3.0 | 0 | 2010-07-05T09:16:23.000 | 2014-06-25T07:58:58.183 | 2020-06-20T09:12:55.060 | -1 | 80,796 | [
"image",
"matlab",
"plot"
] |
3,179,904 | 1 | 3,180,170 | null | 6 | 7,828 | I'm having problems figuring out how to display different cell styles as well as custom cells together within a UITableView. I understand how to set up and put cells together and the construction of a basic UITableView, but just not how to "mix and match" cell within one.
The best example I can show you on what I am trying to achieve is with the Tweetie 2 application.

The top of the segment there is a block paragraph, then below it there UITableViewCell's with the UITableViewCellStyleValue2 style set. How exactly would I go about achieving this effect?
Thanks ahead of time
| Using multiple cell style types and custom cells in a UITableView | CC BY-SA 2.5 | 0 | 2010-07-05T13:36:51.487 | 2015-03-28T18:54:34.930 | 2017-02-08T14:27:59.460 | -1 | 205,846 | [
"iphone",
"uitableview"
] |
3,182,747 | 1 | 3,183,041 | null | 1 | 2,619 | I created a google maps store locator and im using a jquery pagination to show only 5 results per page. It works. The only problem is that every time I hit search it duplicates the pagination.

Code:
```
function paginate(){
var page = 1;
var itemsPerPage = 4;
var prev = "Previous Results";
var next = "More Results";
var $entries = $("#entries");
var $list = $entries.children("ul:first");
$list.children().eq(itemsPerPage).nextAll().andSelf().hide();
var $pagination = $("<ul class='pagination'></ul>").each(function () {
var itemsTotal = $list.children().size();
var pages = Math.ceil(itemsTotal / itemsPerPage);
$(this).append("<span class='endline'></span>");
$(this).append("<li class='prev'>" + prev + "</li>");
$(this).append("<li class='more'>" + next + "</li>");
}).appendTo($entries);
$pagination.children("li:first").hide();
$pagination.children().click(function () {
if ($(this).text() == prev)
page = page - 1;
else if ($(this).text() == next)
page = page + 1;
var firstToShow = (page - 1) * itemsPerPage;
var lastToShow = page * itemsPerPage;
$list.children().hide().slice(firstToShow, lastToShow).slideDown('slow');
if (page == 1)
$(this).parent().find("li:first").hide();
else
$(this).parent().find("li:first").show();
if (page == Math.ceil($list.children().size() / itemsPerPage))
$(this).parent().find("li:last").hide();
else
$(this).parent().find("li:last").show();
});
}
```
And then in the google maps javascript I have (code is taken from [Creating a Store Locator with PHP, MySQL & Google Maps](http://code.google.com/apis/maps/articles/phpsqlsearch.html)):
```
function searchLocationsNear(center) {
var radius = document.getElementById('radiusSelect').value;
var searchUrl = 'genxml.php?lat=' + center.lat() + '&lng=' + center.lng() + '&radius=' + radius;
GDownloadUrl(searchUrl, function(data) {
var xml = GXml.parse(data);
var markers = xml.documentElement.getElementsByTagName('marker');
map.clearOverlays();
var sidebar = document.getElementById('sidebar');
sidebar.innerHTML = '';
if (markers.length == 0) {
sidebar.innerHTML = '<p class="caption">No results found.</p>';
map.setCenter(new GLatLng(40, -100), 4);
return;
}
var bounds = new GLatLngBounds();
for (var i = 0; i < markers.length; i++) {
var name = markers[i].getAttribute('name');
var address = markers[i].getAttribute('address');
var type = markers[i].getAttribute('type');
var distance = parseFloat(markers[i].getAttribute('distance'));
var point = new GLatLng(parseFloat(markers[i].getAttribute('lat')),
parseFloat(markers[i].getAttribute('lng')));
var marker = createMarker(point, name, address, type);
map.addOverlay(marker);
var sidebarEntry = createSidebarEntry(marker, name, address, distance, type);
sidebar.appendChild(sidebarEntry);
bounds.extend(point);
}
paginate();
results();
map.setCenter(bounds.getCenter(), map.getBoundsZoomLevel(bounds));
});
}
```
html:
```
<div id="entries">
<ul id="sidebar">
<li>all the entries</li>
<li>all the entries</li>
...etc
</ul>
and then the pagination
<ul class="pagination"></ul>
</div>
```
and on the button there is:
```
<input type="button" onclick="searchLocations()" class="submit" value="Search"/>
```
and that function is:
```
function searchLocations() {
var address = document.getElementById('addressInput').value;
geocoder.getLatLng(address, function(latlng) {
if (!latlng) {
sidebar.innerHTML = '<p class="caption"><b>No results found.</b><br><br>Please try your search again. Make sure to enter a single city, state, or zip code.</p>';
} else {
searchLocationsNear(latlng);
filter();
}
});
}
```
| jQuery pagination results page | CC BY-SA 3.0 | 0 | 2010-07-05T23:48:39.740 | 2011-10-28T21:14:40.843 | 2011-10-28T21:14:40.843 | 757,830 | 381,711 | [
"javascript",
"jquery"
] |
3,183,105 | 1 | 3,183,656 | null | 0 | 876 | this is quite an elaborate problem for me that i've been trying to figure out for a while now. Even explaining it is a little difficult for me but i'll give it a try.
I am using a gutted version of the Snake Android sample. Pretty much I am using the TileView class verbatim and am only trying to display a few tiles on the screen. Instead of the SnakeView class I am using a GameView class in which I only included the code I thought necessary to display a tile on the screen. Here is the class
```
public class GameView extends TileView {
/**
* Labels for the drawables that will be loaded into the TileView class
*/
private static final int RED_STAR = 1;
private static final int YELLOW_STAR = 2;
private static final int GREEN_STAR = 3;
/**
* mMoveDelay: number of milliseconds between animations.
*/
private long mMoveDelay = 600;
/**
* mLastMove: tracks the absolute time when the last animation happened.
*/
private long mLastMove;
/**
* Create a simple handler that we can use to cause animation to happen. We
* set ourselves as a target and we can use the sleep()
* function to cause an update/invalidate to occur at a later date.
*/
private RefreshHandler mRedrawHandler = new RefreshHandler();
class RefreshHandler extends Handler {
@Override
public void handleMessage(Message msg) {
GameView.this.update();
GameView.this.invalidate();
}
public void sleep(long delayMillis) {
this.removeMessages(0);
sendMessageDelayed(obtainMessage(0), delayMillis);
}
};
/**
* Constructs a GameView based on inflation from XML
*
* @param context
* @param attrs
*/
public GameView(Context context, AttributeSet attrs) {
super(context, attrs);
initGameView();
}
public GameView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
initGameView();
}
private void initGameView() {
setFocusable(true);
Resources r = this.getContext().getResources();
resetTiles(4);
loadTile(RED_STAR, r.getDrawable(R.drawable.redstar));
loadTile(YELLOW_STAR, r.getDrawable(R.drawable.yellowstar));
loadTile(GREEN_STAR, r.getDrawable(R.drawable.greenstar));
}
public void initNewGame() {
// set the move delay. This tells the update method how often it should
// refresh the screen.
mMoveDelay = 600;
update();
}
public void update() {
long now = System.currentTimeMillis();
if (now - mLastMove > mMoveDelay) {
// clear any tiles on the screen
clearTiles();
updateWalls();
// draws the tiles storred in mCellularArray
//updateCellularArray();
mLastMove = now;
}
mRedrawHandler.sleep(mMoveDelay);
}
private void updateWalls() {
for (int x = 0; x < mXTileCount; x++) {
setTile(GREEN_STAR, x, 0);
setTile(GREEN_STAR, x, mYTileCount - 1);
}
for (int y = 1; y < mYTileCount - 1; y++) {
setTile(GREEN_STAR, 0, y);
setTile(GREEN_STAR, mXTileCount - 1, y);
}
}
private void updateCellularArray() {
setTile(YELLOW_STAR, 6, 7);
}
}
```
Now what is happening is that when the updateWalls() method is called, the tiles are placed within the View and comes up like this:

Now when I uncomment out the `updateCellularArray()` method and comment out the `updateWalls()` the program force closes and throws a NullPointerException. After some debugging I figured out that when the updateCellular array method is called, the mTileGrid array in the TileView class is not initialized, but it is when `updateWalls()` is called. I am completely baffled as to why this is happening. It doesn't matter if i replace the for loop with a simple `setTile(GREEN_STAR, 3, 3);` it still force closes.
Here is the TileView class I am using (again this is the same one in the Snake sample that comes with the Android SDK):
```
/**
* TileView: a View-variant designed for handling arrays of "icons" or other
* drawables.
*
*/
public class TileView extends View {
/**
* Parameters controlling the size of the tiles and their range within view.
* Width/Height are in pixels, and Drawables will be scaled to fit to these
* dimensions. X/Y Tile Counts are the number of tiles that will be drawn.
*/
protected static int mTileSize;
protected static int mXTileCount;
protected static int mYTileCount;
private static int mXOffset;
private static int mYOffset;
/**
* A hash that maps integer handles specified by the subclasser to the
* drawable that will be used for that reference
*/
private Bitmap[] mTileArray;
/**
* A two-dimensional array of integers in which the number represents the
* index of the tile that should be drawn at that locations
*/
private int[][] mTileGrid;
private final Paint mPaint = new Paint();
public TileView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.TileView);
mTileSize = a.getInt(R.styleable.TileView_tileSize, 12);
a.recycle();
}
public TileView(Context context, AttributeSet attrs) {
super(context, attrs);
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.TileView);
mTileSize = a.getInt(R.styleable.TileView_tileSize, 12);
a.recycle();
}
/**
* Rests the internal array of Bitmaps used for drawing tiles, and
* sets the maximum index of tiles to be inserted
*
* @param tilecount
*/
public void resetTiles(int tilecount) {
mTileArray = new Bitmap[tilecount];
}
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
mXTileCount = (int) Math.floor(w / mTileSize);
mYTileCount = (int) Math.floor(h / mTileSize);
mXOffset = ((w - (mTileSize * mXTileCount)) / 2);
mYOffset = ((h - (mTileSize * mYTileCount)) / 2);
Log.d("Tomek", "TileGrid array dimensions are: " + mXTileCount + "," + mYTileCount);
mTileGrid = new int[mXTileCount][mYTileCount];
clearTiles();
}
/**
* Function to set the specified Drawable as the tile for a particular
* integer key.
*
* @param key
* @param tile
*/
public void loadTile(int key, Drawable tile) {
Bitmap bitmap = Bitmap.createBitmap(mTileSize, mTileSize, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
tile.setBounds(0, 0, mTileSize, mTileSize);
tile.draw(canvas);
mTileArray[key] = bitmap;
}
/**
* Resets all tiles to 0 (empty)
*
*/
public void clearTiles() {
for (int x = 0; x < mXTileCount; x++) {
for (int y = 0; y < mYTileCount; y++) {
setTile(0, x, y);
}
}
}
/**
* Used to indicate that a particular tile (set with loadTile and referenced
* by an integer) should be drawn at the given x/y coordinates during the
* next invalidate/draw cycle.
*
* @param tileindex
* @param x
* @param y
*/
public void setTile(int tileindex, int x, int y) {
//Log.d("Tomek", "Attempting to set tile: " + x + "," + y);
//Log.d("Tomek", "The current value at " + x + "," + y + " is " + mTileGrid[x][y]);
//Log.d("Tomek", "It will be changed to " + tileindex);
mTileGrid[x][y] = tileindex;
}
@Override
public void onDraw(Canvas canvas) {
super.onDraw(canvas);
for (int x = 0; x < mXTileCount; x += 1) {
for (int y = 0; y < mYTileCount; y += 1) {
if (mTileGrid[x][y] > 0) {
canvas.drawBitmap(mTileArray[mTileGrid[x][y]],
mXOffset + x * mTileSize,
mYOffset + y * mTileSize,
mPaint);
}
}
}
}
}
```
Sorry for posting all this code. Any help would be greatly appreciated.
Thanks much,
Tomek
EDIT: simplified GameView class
EDIT 2: Alright after modifying the `updateCellularArray()` method to the following:
```
private void updateCellularArray() {
for (int x = 0; x < mXTileCount; x++) {
setTile(GREEN_STAR, 12, 12);
}
}
```
It finally placed the tile where I wanted it to...
[](https://i.stack.imgur.com/pNYvy.png)
I'm starting to wonder if it has something to do with the RefreshHandler. Possibly when the RedrawHandler's sleep method is called in the update method of the GameView class. I'm not quite sure how it works so I am going to try playing around with it and see what I can come up with.
| Strange problem with modified Android Snake example | CC BY-SA 4.0 | null | 2010-07-06T02:09:36.523 | 2019-08-01T01:09:04.740 | 2019-08-01T01:09:04.740 | 4,751,173 | 29,326 | [
"android",
"nullpointerexception"
] |
3,183,297 | 1 | 3,223,511 | null | 1 | 494 | Edit: Ok, this is what works. It may not be "right", but 1) it displays correctly & 2) it validates at W3C. It seems that I should make all positioning absoolute and add positioning to all divs except for those with a fieldset, where I have to add the position to the fieldset. Feel free to correct this if you think that I am wrong, but "it works for me" ! Yay! Yipee! At last! Lots of +1 all round and thanks to all who helped.
---
Edit: the bounty goes to whomever can post the editted HTML which displays like the Delphi screenshot.
---
I am using Borland Delphi to produce an HTML form generator. The user can drag & drop components to produce a file and when he is happy he can generate HTML (I pop a Submit button on to the end of his form).
Since I have the absolute position of each control when I am generating, I want so specify absolute positions in CSS. I thought this meant that I have to use `position: fixed`, but that doesn't look right, and nor does absolute.
What am I doing wrong? (the HTML validates at W3C)
Here is a very basic basic example as seen when designing the form in the Delphi program

And here it is in MSIE 8 (with fix position)

And again with absolute position

And, finally, here is the HTML
```
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Input data</title>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
</head>
<body>
<form action="http://localhost/a_submitted.php" method="post">
<div class="TGroupBox" id="GroupBox1">
<fieldset style="position: absolute; top:40px; left:40px; width: 857px; height: 441px;">
<legend>GroupBox1</legend>
<div class="TPanel" id="Panel1">
<fieldset style="position: absolute; top:64px; left:56px; width: 753px; height: 369px;">
<legend></legend>
<div class="TLabel" id="Label1" style="position: absolute; top:88px; left: 80px; width: 32px; height: 13px;">Label1</div>
<div class="TEdit" id="Edit1" style="position: absolute; top:80px; left: 72px; width: 121px; height: 21px;"><input type="text" name="Edit1" value="an edit bx"></div>
<div class="TCheckBox" id="CheckBox1" style="position: absolute; top:88px; left: 80px; width: 97px; height: 17px;">CheckBox1<input type="checkbox" name="CheckBox1" value="CheckBox1Checked"></div>
<div class="TComboBox" id="ComboBox1" style="position: absolute; top:145px; left: 137px; width: 145px; height: 21px;">
<select size ="1" name="ComboBox1">
<option value="one" selected="selected">one </option>
<option value="two">two </option>
<option value="three">three </option>
</select>
</div>
<div class="TRadioGroup" id="RadioGroup1">
<fieldset style="position: absolute; top:144px; left: 136px; width: 185px; height: 105px;"><legend>RadioGroup1</legend>
red: <input type="radio" name="RadioGroup1" value=""><br>
white: <input type="radio" name="RadioGroup1" value="" checked><br>
blue: <input type="radio" name="RadioGroup1" value=""><br>
</fieldset>
</div>
</fieldset>
</div>
</fieldset>
</div>
<div><input type="submit" name="submitButton" value="Submit" style="position:relative; top:25px; left: 50%;"></div>
</form>
</body>
</html>
```
---
Edit: the bounty goes to whomever can post the editted HTML which displays like the Delphi screenshot.
---
Edit: Ok, this is what works. It may not be "right", but 1) it displays correctly & 2) it validates at W3C. It seems that I should make all positioning absoolute and add positioning to all divs except for those with a fieldset, where I have to add the position to the fieldset. Feel free to correct this if you think that I am wrong, but "it works for me" ! Yay! Yipee! At last! Lots of +1 all round and thanks to all who helped.
| I have a basic problem understanding CSS positioning | CC BY-SA 2.5 | null | 2010-07-06T03:14:05.177 | 2010-07-12T11:07:51.700 | 2017-02-08T14:28:00.517 | -1 | 192,910 | [
"html",
"css"
] |
3,185,299 | 1 | 3,185,365 | null | 1 | 1,770 | I'm looking for a query to select rows from two different tables, (I did find one result here for selecting from two different tables, but it merged the column names to have an easier query). I need to keep the original column names, but have two different tables existing within the new, larger table. There are no overlapping columns between the two tables.
A picture, to visualise:

So, how can I do this? I know the query will probably be quite convoluted, but anything half-decent is probably going to be better than my current attempt:
```
SELECT t1.* , t2.*
FROM table1 t1 RIGHT OUTER JOIN table2 t2
ON r.someColumn1 = rc.someColumn2
UNION
SELECT t1.* , t2.*
FROM table1 t1 LEFT OUTER JOIN table2 t2
ON r.someColumn1 = rc.someColumn2
```
This does work, but only as long as there are no cases where someColumn1 = someColumn2 - which can happen quite easily, of course.
Any help is appreciated, and I apologise for what is probably a very silly question to which the smart answer is "don't do it, you fool!".
| How to select two seperate non-overlapping tables in MySQL | CC BY-SA 3.0 | null | 2010-07-06T10:12:00.167 | 2017-06-04T20:43:26.220 | 2017-06-04T20:43:26.220 | 4,370,109 | 352,636 | [
"mysql",
"join"
] |
3,188,903 | 1 | null | null | 2 | 1,416 | I'm pretty new to jQuery but basically what I'm looking for is a script that can do the following:

The numbers will change the entire slide (image and text).
Can someone point me to a script that can do this? Or something very similar, I'm just learning about JS. Thanks!
| jQuery carousel entire slide changes with images/text/etc | CC BY-SA 3.0 | null | 2010-07-06T18:00:02.767 | 2011-12-04T00:00:15.957 | 2011-12-04T00:00:15.957 | 84,042 | 384,825 | [
"jquery",
"html",
"css",
"tabs",
"carousel"
] |
3,188,912 | 1 | 3,194,539 | null | 1 | 1,531 | I have a WPF 'monitor widget' that displays CPU, RAM and disk performance as small percentage bars. I use the following gradient as a resource to divide the bars into 4 sections (ie. 0% - 25%, 25% - 50%, etc.)
```
<LinearGradientBrush x:Key="Quarters" StartPoint="0,0" EndPoint="0,15" MappingMode="Absolute">
<GradientStop Color="LightGreen" Offset="0.0" />
<GradientStop Color="LightGreen" Offset="0.24" />
<GradientStop Color="Yellow" Offset="0.25" />
<GradientStop Color="Yellow" Offset="0.49" />
<GradientStop Color="Orange" Offset="0.5" />
<GradientStop Color="Orange" Offset="0.74" />
<GradientStop Color="Red" Offset="0.75" />
<GradientStop Color="Red" Offset="1.0" />
</LinearGradientBrush>
```
Originally, the bars' 0% position was at the top (bar.Height = 0) and 100% was at the bottom (bar.Height = 15). The bar size would change by simply adjusting its Height property. Everything worked fine, but I would prefer the bars' 0% position to be at the bottom instead, ie. the bars will 'grow' upward.
Making the bars grow upward was no problem, but the problem I do have is that the gradient now moves with the rectangle, so that the top of the rectangle is always green, no matter how small it is. I understand that this is because I am now using Canvas.SetTop to move the top of the rectangles (bars) as well as change their height. How can I force the gradient to an absolute position, regardless of the position of the rectangle?
  (background opacity)
Sorry, I know the image is small, but you should just be able to make out that the middle bar starts from the top (green) and grows downward, ending in orange (50% -75% value). The left bar starts at the bottom (this is what I want), but the gradient in this bar moves with the height... this is the problem. Note that I'll reverse the gradient when I can fix this problem, so that red will represent the top 25%. In this example, the bottom quarter should be red, the next quarter orange and the remainder yellow.
I can't believe that there is no simple solution for this... come on brain-boxes. :) How about moving the absolute position of the gradient with the rectangle... is this possible???
(Relating post: [Determining a computer's maximum hard drive data transfer rate programmatically with C#](https://stackoverflow.com/questions/3150956/determining-a-computers-maximum-hard-drive-data-transfer-rate-programmatically-w))
| Fixed gradient with a moving rectangle? | CC BY-SA 2.5 | null | 2010-07-06T18:01:25.110 | 2013-03-12T08:15:10.020 | 2017-05-23T12:01:33.300 | -1 | 249,281 | [
"wpf",
"gradient"
] |
3,191,411 | 1 | 3,191,456 | null | 2 | 3,243 | I am fairly familiar with creating simple custom controls, but I haven't had this instance come up before, I wish to give design time changeability support to a "Colors" dictionary which applies a series of gradients to a custom control panel.
Although using a simple `public Dictionary<int, Color> ProgressValueColors` does in fact give me the design-time property in my Properties window with the "..." selection, it is completely greyed out, it must not automatically infer my Dictionary and know what to do, both Add and Remove buttons are greyed out, see below. How could I make this function?

I will need to enter a "Value" property which is the `Key` of the int, and a Color property which needs to be a color picker and then the user can press Add to have this add to the Dictionary.
Thanks, hope there is some user control expert out there! :)
| Custom user controls - how to add Code Collection Editor of type Dictionary<int, Color> | CC BY-SA 2.5 | null | 2010-07-07T01:55:42.877 | 2010-07-07T02:18:08.530 | null | null | 41,211 | [
"c#",
".net",
"winforms",
"custom-controls",
"windows-forms-designer"
] |
3,193,715 | 1 | null | null | 0 | 2,733 | I have a fact table containing 8 Million rows with 1 Million rows increase per month. The table already contains indexes on it. The table is used by IBM Cognos environment to generate reports. Currently I am looking for way to optimize the table SELECT statements.
As first try, I partitioned the table (each partition has equal distribution of rows) and the query is suitable for the partitions, but for some reason, I am getting equal or even worse performance, which is weird. Only one partition is affected per query. Can someone explain how to optimize this ?
Second idea I came to is to implement the fact table as Index organized table, but it will have to have all the columns as primary key. Is this alright and will there be performance gain ?
Third idea is to implement the fact table in a way that will contain all the columns that are joined from the star schema. Will there be performance gain ?
EDIT: Here is the execution plan:

I have managed to reduce the access time to fact table FT_COSTS by 3 times (cost was 42000, now is 14900) AFTER I created indexes containing the partitioning criteria, but before that I was getting worse results than in unpartitioned table. I used this link to solve my partitioning problem [Range partition skip check](https://stackoverflow.com/questions/2535908/range-partition-skip-check)
From what I see now, the main bottleneck is the GROUP BY which raises the cost from 34000 to 85 000 , which is more than doubling . Does anyone have idea about a workaround on this ?
| Optimize SELECT from Partitioned Fact Table in Oracle 10 | CC BY-SA 3.0 | 0 | 2010-07-07T10:01:17.807 | 2014-06-04T01:39:41.453 | 2017-05-23T12:24:45.570 | -1 | 385,402 | [
"performance",
"oracle",
"partitioning",
"business-intelligence"
] |
3,194,933 | 1 | 3,264,980 | null | 3 | 91 | I can't figure out how to set the EstimatedHours property from the StarTeam SDK. The property EstimatedHours is readonly, and I can't figure out any way to set the value from the SDK, though through the UI you can set the "Plan, Work" field.

Setting the `EstimatedStart/Finish` doesn't work:
```
var task = new Borland.StarTeam.Task(cr.ParentFolder);
task.Name = "Name";
task.Notes = "Notes";
// task.EstimatedHours = 4.0; // readonly property
task.EstimatedStart = DateTime.Now;
task.EstimatedFinish = DateTime.Now.AddHours(4);
task.Update();
```
| How to set the "Plan Work" (EstimatedHours) for a Task in StarTeam SDK? | CC BY-SA 2.5 | null | 2010-07-07T13:10:27.423 | 2010-07-16T12:51:55.457 | 2017-02-08T14:28:03.413 | -1 | 28,445 | [
"starteam"
] |
3,195,187 | 1 | null | null | 8 | 6,789 | I'm trying to use the Google Maps API and the div that is going to contain the map works only when not inside another div. I've created a little sample code with two maps, the first works the second doesn't. If I remove the doctype of this piece of code, both work. Any ideas why?
```
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta content='application/xhtml+xml; charset=UTF-8' http-equiv='content-type' />
<style type='text/css'>
html { height: 100% }
body { height: 100%; margin: 0px; padding: 0px }
#map_canvas { height: 50% }
#map_canvas2 { height: 50% }
</style>
<title>Map</title>
<script src='http://maps.google.com/maps/api/js?sensor=false' type='text/javascript'></script>
<script type='text/javascript'>
function initialize() {
var latlng = new google.maps.LatLng(20, 20);
var myOptions = {
zoom: 8,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
var map2 = new google.maps.Map(document.getElementById("map_canvas2"), myOptions);
}
</script>
</head>
<body onload='initialize()'>
<div id='map_canvas'></div>
<div>
<div id='map_canvas2'></div>
</div>
</body>
</html>
```
This is how it looks like in Firefox and Chrome:


---
| Google Maps doesn't work when inside a div | CC BY-SA 2.5 | 0 | 2010-07-07T13:34:37.000 | 2010-07-08T13:23:16.830 | 2010-07-07T13:44:44.007 | 6,068 | 6,068 | [
"javascript",
"api",
"google-maps"
] |
3,198,829 | 1 | null | null | 12 | 3,871 | I'm in the process of upgrading my iPhone app to high-res graphics, and I've run into some problems with older devices. The situation involves my UITabBar icons. Have a look:

The top screenshot looks correct. It was captured on the latest generation iPhone (new screen) running OS4. However, the second screenshot is completely wrong. The high-res icons are displaying at 100% size and are getting cropped. That second screenshot was taken from my second-gen iPod touch (old screen) running OS4.
So, I'm really confused here. I've read over Apple's documentation, and as far as I know I'm doing everything they require. Within my app bundle I have images named as:
- - - - -
Within interface builder, I have specified the low-res version of each image (the filename WITHOUT "@2x") to be used in the tab bar. If I understand iPhone documentation correctly, the device should automatically detect screen resolution and display the high-res version if available. So if anything, it almost seems like my iPod touch is incorrectly detecting its display resolution. Am I missing something here perhaps?
Any help or insight that can be offered would be appreciated! Thanks.
No luck so far. I took the manual approach and added the following into the `viewDidLoad` command of my `UITabBarController`:
```
- (void)viewDidLoad {
[super viewDidLoad];
UITabBarItem *tab;
UIViewController *item;
tab = [[UITabBarItem alloc] initWithTitle:@"Featured" image:[UIImage imageNamed:@"tab-featured.png"] tag:0];
item = [self.viewControllers objectAtIndex:0];
item.tabBarItem = tab;
[tab release];
tab = [[UITabBarItem alloc] initWithTitle:@"Topics" image:[UIImage imageNamed:@"tab-topics.png"] tag:1];
item = [self.viewControllers objectAtIndex:1];
item.tabBarItem = tab;
[tab release];
tab = [[UITabBarItem alloc] initWithTitle:@"Video" image:[UIImage imageNamed:@"tab-video.png"] tag:2];
item = [self.viewControllers objectAtIndex:2];
item.tabBarItem = tab;
[tab release];
tab = [[UITabBarItem alloc] initWithTitle:@"Experts" image:[UIImage imageNamed:@"tab-experts.png"] tag:3];
item = [self.viewControllers objectAtIndex:3];
item.tabBarItem = tab;
[tab release];
tab = [[UITabBarItem alloc] initWithTitle:@"Events" image:[UIImage imageNamed:@"tab-events.png"] tag:4];
item = [self.viewControllers objectAtIndex:4];
item.tabBarItem = tab;
[tab release];
}
```
This still produces the same result as above (large cut-off icons within the tab bar). Has anyone heard of issues with the UITabBar populating high-res icon pairs?
Regarding James' comment:
Yes, I was able to resolve this. It seemed to be an error with file references in XCode. I was running out of ideas, so I rolled back and started stripping out all @2x images from my app, just to get everything displaying correctly again with the low-res artwork. Once the app displayed proper size images again (albeit at low-resolution), then one by one I started adding the @2x images back in, waiting for something to break. It seemed to work fine the second time going in. Don't know why or what happened. The SDK just seemed to get some wires crossed as to what had happened.
| High-res UITabBar icons display at full size on low-res screen | CC BY-SA 2.5 | 0 | 2010-07-07T21:06:35.543 | 2013-06-12T18:49:19.770 | 2011-01-22T15:30:04.750 | 419 | 943,017 | [
"iphone",
"xcode"
] |
3,199,690 | 1 | null | null | 0 | 353 | When I install native JAI I get black lines in my scaled images. Does anyone know how to avoid this?
```
ParameterBlockJAI pb = new ParameterBlockJAI("scale");
pb.addSource(image);
pb.setParameter("xScale", (float) from.getScale());
pb.setParameter("yScale", (float) from.getScale());
pb.setParameter("xTrans", 0.0F);
pb.setParameter("yTrans", 0.0F);
pb.setParameter("interpolation", new InterpolationNearest());
resultingImage = JAI.create("scale", SubsampleAverageDescriptor.create(resultingImage, from.getScale(), from.getScale(), new RenderingHints(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY)), null);
```

| Installed native JAI, getting black lines | CC BY-SA 2.5 | null | 2010-07-07T23:37:09.973 | 2010-09-28T16:14:04.540 | 2017-02-08T14:28:06.647 | -1 | 346,087 | [
"java",
"jai"
] |
3,202,643 | 1 | 3,202,672 | null | 2 | 1,487 | How do I write a chord, i.e. a NoteOn of seveal notes on each above the other at the same time line?

What should be the message for this chord.
| How to write chords with MIDI? | CC BY-SA 2.5 | null | 2010-07-08T10:25:01.043 | 2018-12-28T11:32:47.003 | 2018-12-28T11:32:47.003 | 2,266,772 | 75,500 | [
"binary",
"midi",
"music-notation"
] |
3,203,402 | 1 | 3,204,842 | null | 9 | 47,277 | I am using JqGrid with javascript.
I would set the height of each table row but I have not understand how to do.
This is my code:
```
function jobList(){
var json=doShowAll();
alert("jobList() ==> php/get_job_status.php?value="+json);
jQuery("#jobList").jqGrid({
url:'php/get_job_status.php?value='+json,
datatype: "xml",
colNames:['id','title', 'start', 'stop','completed'],
colModel:[
{name:'id',index:'id', width:15,hidden:true, align:"center"},
{name:'title',index:'title', width:150, align:"center"},
{name:'start',index:'start', width:350, align:"center", sorttype:"date"},
{name:'fine',index:'fine', width:350, align:"center", sorttype:"date"},
{name:'completed',index:'completed', width:120, align:"center",formatter:highlight},//il solitoformatter:infractionInFormatter},
],
//rowNum:8,
//rowList:[8,10,20,30],
pager: '#pagerJobList',
sortname: 'id',
viewrecords: true,
sortorder: "desc",
multiselect: false,
subGrid: false,
autowidth: true,
height: 250,
rowheight: 300,
caption: "Job Progress",
afterInsertRow: function(rowid, aData){
jQuery("#jobList").jqGrid('setCell', rowid, 'completed', '', {
background: 'red',
color: 'white'
});
},
onSelectRow: function(id){
//alert(id);
var title="";
if (id) {
var ret = jQuery("#jobList").jqGrid('getRowData',id);
title=ret.id;
//alert(title);
}
else {
alert("Please select row");
}
var json2=doShowAll();
subGrid(json2,title);
}
}
);
```
}
Modifying RowHeight value rows height don't change.
This is my table result

Thanks a lot.
| JQgrid set row height | CC BY-SA 3.0 | 0 | 2010-07-08T12:14:06.340 | 2016-07-28T22:32:59.340 | 2013-11-26T09:24:00.877 | 1,903,074 | 453,712 | [
"javascript",
"jquery",
"jqgrid",
"height",
"row"
] |
3,204,336 | 1 | 3,230,192 | null | 0 | 3,760 | Randomly when I go to check out a document in Webtop I get a UCF error.

Anyone have any ideas how to troubleshoot this?
| Blank popup when trying to checkout or export documents in Documentum. Java applet not triggering | CC BY-SA 2.5 | null | 2010-07-08T14:01:12.743 | 2019-05-31T11:12:05.043 | 2010-07-08T16:53:56.080 | 5,653 | 5,653 | [
"documentum",
"webtop"
] |
3,204,929 | 1 | 3,205,083 | null | 1 | 147 | What's going on with the line that split out on it's own? I did a commit and then I did a pull for the repository and then an update.
What caused this?
How do I get that split part back into the main line?

| Mercurial - How did my commit get split off (see pic)? | CC BY-SA 2.5 | null | 2010-07-08T14:59:54.603 | 2010-07-08T16:06:25.767 | 2017-02-08T14:28:09.177 | -1 | 13,009 | [
"version-control",
"configuration",
"mercurial",
"tortoisehg"
] |
3,205,665 | 1 | 3,206,031 | null | 3 | 6,239 | I have a texture loaded into memory that is of RGBA format with various alpha values.
The image is loaded as so:
```
GLuint texture = 0;
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_2D, texture);
self.texNum = texture;
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, self.imageWidth, self.imageHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, [self.imageData bytes]);
```
I want to know how I can draw this texture so that the alpha channel in the image is treated as all 1's and the texture is drawn like an RGB image.
Consider the base image:

This image is a progression from 0 to 255 alpha and has the RGB value of 255,0,0 throughout
However if I draw it with blending disabled I get an image that looks like:
www.ldeo.columbia.edu/~jcoplan/alpha/no_alpha.png
When what I really want is an image that looks like this:
www.ldeo.columbia.edu/~jcoplan/alpha/correct.png
I'd really appreciate some pointers to have it ignore the alpha channel completely. Note that I can't just load the image in as an RGB initially because I do need the alpha channel at other points.
Edit: I tried to use GL_COMBINE to solve my problem as such:
```
glColorf(1,1,1,1);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE);
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_REPLACE);
glTexEnvi(GL_TEXTURE_ENV, GL_SRC0_RGB, GL_TEXTURE);
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_COLOR);
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA, GL_REPLACE);
glTexEnvi(GL_TEXTURE_ENV, GL_SRC0_ALPHA, GL_PRIMARY_COLOR);
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA, GL_SRC_ALPHA);
[self drawTexture];
```
But still no luck, it draws black to red still.
| Draw a texture in OpenGL while ignoring its alpha channel | CC BY-SA 3.0 | 0 | 2010-07-08T16:08:25.827 | 2011-12-30T23:47:32.393 | 2011-12-30T23:47:32.393 | 242,848 | 386,854 | [
"opengl",
"textures",
"alpha",
"alphablending",
"premultiplied-alpha"
] |
3,208,955 | 1 | null | null | 9 | 25,573 | How do I find the vertices of the broken line that surrounds the silhouette in this image? 
A possible input for the example above is:
So for this example the solution would be
| skyline algorithm | CC BY-SA 2.5 | 0 | 2010-07-09T00:06:43.220 | 2016-03-28T19:39:04.337 | 2010-07-09T00:25:48.047 | 1,288 | null | [
"c",
"algorithm"
] |
3,209,410 | 1 | 3,275,669 | null | 12 | 3,515 | Greetings,
We are developing a scientific QT Application which detect the border of a cell.Please refer to following prototype snapshots.


Now ,we are going to develop this as a opensource product with a good design and architecture.We reconed that it has many complex actions and flows.
Eg: move contour node,delete coutour node,add contour node,draw barrier,select multiple nodes...etc
We were hoping to use QT State Machine Framework for UI, and wondering whether to use several state-machine instances for each flow/action or use one "huge" state-machine?
We need unde/redo operations and is it possible to interate QT State-Machine Framework with QT Undo/Redo Framework?
[edit] Is it really possible to use QT SM Framekwork to handle UI interactions?
What kind of design they use in GIMP or CAD applications ?
Thanks in advance,
umanga
| QT : Using State Machine for UI interactions? | CC BY-SA 3.0 | 0 | 2010-07-09T02:25:11.907 | 2013-04-16T15:10:48.710 | 2013-04-16T15:10:48.710 | 2,273,628 | 180,904 | [
"qt",
"user-interface",
"architecture",
"state-machine",
"undo"
] |
3,209,843 | 1 | 3,216,024 | null | 2 | 1,444 | Okay, I know absolutely nothing about 3D projection, but I need to figure out a way to project pictures in Silverlight (`<Matrix3D/>`) based on some predetermined variables that I have available to me. I've searched high and low for some sample code or a really basic "" set of articles, but have yet to find anything that makes any sense. Even the great [Khan Academy](http://www.khanacademy.org/) wasn't simple enough for me. Cameras, field of view, rotations - my brain just can't wrap itself around this stuff.
I have a need for the following projections:
- - - -
So, I have a number of variables provided to me like X, Y and sometimes Z. For example, this -
somehow turns this ->  into this ->  and
into this -> 
I have other information, like the coordinates of where the picture appears on a canvas, it's width/height, etc. if that information is useful too.
Does anyone know of any resources that can explain this (scratch Wikipedia please - that stuff doesn't make any sense to me). Or do you know how these calculations work (.NET, sans WPF 3D functions)?
| Getting Started with Matrix3D (Silverlight) | CC BY-SA 2.5 | null | 2010-07-09T04:31:51.670 | 2013-03-06T19:03:32.730 | 2017-02-08T14:28:10.213 | -1 | 149,573 | [
"c#",
"vb.net",
"silverlight",
"matrix",
"projection"
] |
3,213,462 | 1 | null | null | 4 | 6,415 | I'm trying to get the following query to execute at a reasonable performance:
```
UPDATE order_item_imprint SET item_new_id = oi.item_new_id
FROM order_item oi
INNER JOIN order_item_imprint oii ON oi.item_number = oii.item_id
```
Currently, it doesn't complete within 8 days so we killed it. The query explaination is as follows:

```
Merge Join (cost=59038021.60..33137238641.84 rows=1432184234121 width=1392)
Merge Cond: ((oi.item_number)::text = (oii.item_id)::text)
-> Nested Loop (cost=0.00..10995925524.15 rows=309949417305 width=1398)
-> Index Scan using unique_order_item_item_number on order_item oi (cost=0.00..608773.05 rows=258995 width=14)
-> Seq Scan on order_item_imprint (cost=0.00..30486.39 rows=1196739 width=1384)
-> Materialize (cost=184026.24..198985.48 rows=1196739 width=6)
-> Sort (cost=184026.24..187018.09 rows=1196739 width=6)
Sort Key: oii.item_id
-> Seq Scan on order_item_imprint oii (cost=0.00..30486.39 rows=1196739 width=6)
```
I have indexes on both tables, and i've ensured the comparing fields are of identical type and size. I am now at the point of trying to change the postgresql server configuration to hopefully help, but I am not sure it will.
The order_item_imprint table is about 1.1 million in size with a 145MB disk footprint, and the order_item table is about a 3rd the size.
The main goal is i need to be able to run this along with several other queries during a few hour maintenance window.
Auto vacuum and analyze has been run prior to execution plan.
| UPDATE FROM with a JOIN (Large Table Performance) Postgresql? | CC BY-SA 2.5 | 0 | 2010-07-09T14:17:19.367 | 2010-07-10T09:46:02.210 | 2017-02-08T14:28:10.697 | -1 | 89,183 | [
"optimization",
"postgresql"
] |
3,213,741 | 1 | 3,218,946 | null | 5 | 4,585 | In my activity I show the camera preview on a surfaceView. It works perfectly fine on Nexus One and HTC Desire, but on Samsung Galaxy S I see strange lines, weird proportions and everything three times. see the Screenshot below.
The issue seems to be similar to this one:
[camera preview on android - strange lines on 1.5 version of sdk](https://stackoverflow.com/questions/2053440/camera-preview-on-androd-strange-lines-on-1-5-version-of-sdk)
but none of the comments there helped. I tried to swap height,width for the camera parameters, but not much of a difference.
(Side note: my activity is always in landscape mode, fixed. I have that fix in my manifest as screenOrientation parameters, in case that matters somehow).
The code of my SurfaceHolderCallback (the relevant inner class in my activity):
```
class SurfaceHolderCallback implements SurfaceHolder.Callback {
private static final int IMAGE_WIDTH = 512;
private static final int IMAGE_HEIGHT = 384;
private static final String ORIENTATION = "orientation";
private static final String ROTATION = "rotation";
private static final String PORTRAIT = "portrait";
private static final String LANDSCAPE = "landscape";
public void surfaceCreated(SurfaceHolder holder) {
camera = Camera.open();
//Surface.setOrientation(Display.DEFAULT_DISPLAY,Surface.ROTATION_90);
Parameters p = camera.getParameters();
p.setPictureSize(IMAGE_WIDTH, IMAGE_HEIGHT);
p.set(ORIENTATION, PORTRAIT);
p.set(ROTATION, 90);
// p.setPreviewSize(640, 480);
Camera.Size s = p.getSupportedPreviewSizes().get(0);
Log.d(APP, "preview params " + s.width +"/"+ s.height);
p.setPreviewSize( s.width,s.height );
p.setPictureFormat(PixelFormat.JPEG);
p.set("flash-mode", "auto");
camera.setParameters(p);
try {
camera.setPreviewDisplay(surfaceHolder);
} catch (Throwable ignored) {
Log.e(APP, "set preview error.", ignored);
}
}
public void surfaceChanged(SurfaceHolder holder, int format, int width,
int height) {
if (isPreviewRunning) {
camera.stopPreview();
}
try {
camera.startPreview();
} catch(Exception e) {
Log.d(APP, "Cannot start preview", e);
}
isPreviewRunning = true;
}
...
```

| Camera preview on Android - strange on Samsung Galaxy S | CC BY-SA 3.0 | 0 | 2010-07-09T14:48:06.073 | 2013-04-18T00:22:21.810 | 2017-05-23T12:19:40.327 | -1 | 241,475 | [
"android",
"camera"
] |
3,214,424 | 1 | 8,858,263 | null | 130 | 51,730 | When I run layout on a specific XML file, I get this:
```
This tag and its children can be replaced by one <TextView/>
and a compound drawable
```
What change should be done for the following xml code:
```
<LinearLayout android:id="@+id/name_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:background="@drawable/grouplist_single_left_grey_area" >
<ImageView android:id="@+id/photo_image"
android:layout_width="@dimen/thumbnail_width"
android:layout_height="@dimen/thumbnail_height"
android:paddingBottom="5dip"
android:paddingTop="5dip"
android:paddingRight="5dip"
android:paddingLeft="5dip"
android:layout_marginRight="5dip"
android:clickable="true"
android:focusable="true"
android:scaleType="fitCenter"
android:src="@*android:drawable/nopicture_thumbnail"
android:background="@drawable/photo_highlight" />
<TextView android:id="@+id/name"
android:paddingLeft="5dip"
android:layout_weight="1"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
```
This is how it looks like on the screen:

The camera icon is the default. Clicking on that will give the user an option to choose another image.
| android layout: This tag and its children can be replaced by one <TextView/> and a compound drawable | CC BY-SA 3.0 | 0 | 2010-07-09T16:03:35.770 | 2022-05-19T17:21:25.753 | 2015-01-28T12:56:40.353 | 933,189 | 349,330 | [
"android",
"layout"
] |
3,215,817 | 1 | 3,215,892 | null | 12 | 4,691 | Ok i know this is quite off-topic for programmers but still I need this for app, so here it is:
Ballistic curve (without wind or any other conditions) is specified by these 2 lines:


So, there is a problem that you got 3 unknown values: x,y and time t, but only 2 equations.
You can't really compute all 3 with just these values, I got:
- - -
Thus, you have to decide which one to specify.
Now you have 2D tanks game, or anything like that, you know you have tank and using ballistic you have to shoot opponent down with setting angle and power.
I need to know when the bullet hit the ground, it can be on-air as it fly, or precomputed.
There comes up my problem. Which way to use? Pre-compute or check for hitting the ground in each step.
If I would like to pre-compute, I would need to know height of terrain, which, logically would have to be constant as I don't know in which x coord. If I would know the X, it would mean that just in front of my turret is wall. So only way to get to result, when I hit the ground, would be with checking in intervals of time for hitting the ground. This is also good because the terrain doesn't have top be static yay! But isn't that too great overhead which could be made much simpler? Have you encountered with such problem/solution?
Thanks in advance, btw the terrain can be flat, using lines or NURBS so I please for general solution, not specific as in which height you shoot in that will be impact.
| Ballistic curve problem | CC BY-SA 2.5 | 0 | 2010-07-09T19:13:36.450 | 2010-08-22T00:58:54.690 | 2017-02-08T14:28:13.780 | -1 | 365,619 | [
"c++",
"physics"
] |
3,217,715 | 1 | 3,217,788 | null | 1 | 3,726 | I have two graphs with in one image, each with 5 points. Their value on the X axis is not important, all that I require is that they're all equally distributed on it.
```
import matplotlib.pyplot as plt
data = [43,51,44,73,60]
data2 = [34,25,42,53,61]
fig = plt.figure(1)
ax = fig.add_subplot(111)
ax.plot(data, '-o', color='#000000', lw=1, ms=6)
ax.plot(data2, '-o', color='#000000', lw=1, ms=6)
plt.show()
```
This creates a graph like the one below.

I need the second graph (the one using the data2 points) to start from 5 on the X axis, not from 0, meaning it'll have the points at (5,34),(6,25),(7,42),(8,53),(9,61). How can I do this?
| Matplotlib: move graph to the right | CC BY-SA 2.5 | 0 | 2010-07-10T03:35:23.537 | 2010-07-10T04:09:19.763 | null | null | 287,491 | [
"python",
"graph",
"matplotlib"
] |
3,219,098 | 1 | 3,219,105 | null | 9 | 1,303 | I was wondering what options were available to generate .png based on the kind of input one feeds a graphing calculator.. so
(y^2 + 5x + 3) / ((3x + 3) + 5y + 18)
would return

The only thing I've found so far is texvc in mediawiki, but it seems overkill to get the whole mediawiki for one of it's modules.
| generating equation png files based on mathematical input | CC BY-SA 2.5 | 0 | 2010-07-10T11:56:36.313 | 2021-04-30T14:54:57.097 | 2010-07-10T13:09:45.413 | 282,848 | 211,983 | [
"python",
"math",
"equation"
] |
3,221,776 | 1 | 3,251,896 | null | 1 | 113 | This is my first time using Views in Drupal and am finding that no matter what I do, I can't seem to get my output to sort on any field at all.
I'm using the views_bonus_pack to create xml output, but not sure if that matters.
I've tried the post date field, the node Id field, the node title field, and... the output is always the same.
Any ideas?
[Update, here are screenshots of what I'm working with]
[http://emberapp.com/evanmcd/images/settings-2/sizes/m.png](http://emberapp.com/evanmcd/images/settings-2/sizes/o)
[http://emberapp.com/evanmcd/images/untitled/sizes/m.png](http://emberapp.com/evanmcd/images/untitled/sizes/m.png)

And, here's the resulting XML
[http://www.mapendo.org/media_viewer/items.xml](http://www.mapendo.org/media_viewer/items.xml)
Thanks to anyone who can help.
-
| Trouble with getting a sort to work within a view with views_bonus_pack | CC BY-SA 2.5 | null | 2010-07-11T03:44:41.393 | 2010-07-15T03:04:58.577 | 2017-02-08T14:28:16.927 | -1 | 78,199 | [
"drupal",
"drupal-6",
"drupal-views"
] |
3,222,790 | 1 | 3,222,914 | null | 3 | 944 | I've got some problems implementing Conway's Game of Life in JavaScript. At the [German Wikipedia](http://de.wikipedia.org/wiki/Conways_Spiel_des_Lebens#Andere_Objekte) it says that this pattern here:

Will create an empty world after 54 generations and the evolution looks like this:

That means, the second generation looks like this:

But when using my code, the second generation looks like this and the world doesn't get empty, either:

So my code is obviously wrong, but I don't see my mistake:
```
var cellSize = 5, // In px
fieldSize = 70, // In cells
canvas = document.getElementById("canvas"),
ctx = canvas.getContext("2d"),
thisGeneration = [],
nextGeneration = [];
// Set canvas size
canvas.width = canvas.height = cellSize * fieldSize;
// Fill the generation array
for (var i = 0; i < fieldSize; i++){
thisGeneration.push([]);
for (var x = 0; x < fieldSize; x++){
// thisGeneration[thisGeneration.length-1].push( (Math.random() > 0.08)? 0 : 1);
thisGeneration[thisGeneration.length-1].push(0);
}
}
// Draw pattern:
thisGeneration[35][35] = thisGeneration[35][36] = thisGeneration[35][37] =
thisGeneration[36][35] = thisGeneration[36][37] =
thisGeneration[37][35] = thisGeneration[37][37] =
thisGeneration[39][35] = thisGeneration[39][37] =
thisGeneration[40][35] = thisGeneration[40][37] =
thisGeneration[41][35] = thisGeneration[41][36] = thisGeneration[41][37] =
1;
// "slice" causes "nextGeneration" to be a copy, not a reference
nextGeneration = thisGeneration.slice(0);
setInterval(function(){
for (var y = 0, l = thisGeneration.length, x, l2, n; y < l; y++){
for (x = 0, l2 = thisGeneration[y].length; x < l2; x++){
ctx.fillStyle = thisGeneration[y][x]? "black" : "white";
ctx.fillRect(x*cellSize, y*cellSize, cellSize, cellSize);
// n := Number of neighbors of the cell
n = 0;
if (typeof (thisGeneration[y-1]) != "undefined"){
n += (
(thisGeneration [y-1] [x-1] ||0)+
(thisGeneration [y-1] [ x ] ||0)+
(thisGeneration [y-1] [x+1] ||0)
);
}
n += (
(thisGeneration [ y ] [x-1] ||0)+
(thisGeneration [ y ] [x+1] ||0)
);
if (typeof (thisGeneration[y+1]) != "undefined"){
n += (
(thisGeneration [y+1] [x-1] ||0)+
(thisGeneration [y+1] [ x ] ||0)+
(thisGeneration [y+1] [x+1] ||0)
);
}
if (n === 3 && !thisGeneration[y][x]){
// Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.
nextGeneration[y][x] = 1;
}
if (n < 2 && thisGeneration[y][x]){
// Any live cell with fewer than two live neighbours dies, as if caused by under-population.
nextGeneration[y][x] = 0;
}
if ((n === 2 || n === 3) && thisGeneration[y][x]){
// Any live cell with two or three live neighbours lives on to the next generation.
nextGeneration[y][x] = 1;
}
if (n > 3 && thisGeneration[y][x]){
// Any live cell with more than three live neighbours dies, as if by overcrowding.
nextGeneration[y][x] = 0;
}
}
}
thisGeneration = nextGeneration.slice(0); // "slice" causes "thisGeneration" to be a copy, not a reference
}, 1000);
```
I'd also like to know whether I could improve the performance of the script, because as you can see I use a 2-dimensional array save the cell states.
| Implementing Conway's Game of Life in JavaScript with <canvas> | CC BY-SA 2.5 | null | 2010-07-11T10:59:53.207 | 2012-06-16T23:05:58.163 | 2017-02-08T14:28:18.363 | -1 | 2,034,126 | [
"javascript",
"canvas",
"conways-game-of-life"
] |
3,223,048 | 1 | null | null | 5 | 3,267 | I have created a column with cells that contain a JTextArea + A JButton inside it, as you can see in the image below in Column 3 :

But i have faced lots of problems with my CellRenderer and CellEditor when updating the cells values in that column, as my code is a bit complicated. So instead i want to replace that column with 2 columns. One column to be of and the other to be of but these 2 columns should have the same look as column 3 appears in the above image. :
If those are fixed, that way the 2 columns will have the same look as the above image + updating the cells values will be much easier.
Ok guys ... You asked for it. My code is huge but if you can help me fix it, that would be perfect. I have created a running jar sample for my problem & included my source code too. You can download it from here :
[Jar sample](http://www.4shared.com/file/JTnv9ysk/table_problem_sample.html)
The problem is that i use a button to allow sorting table rows(Move them up/down), but when i do this some of the moved cells values are not updated !
You can see the following screenshot :

The problem is in the cell editor i am using ... But i can't fix it.
| Can i make a JTable column without borders? | CC BY-SA 3.0 | null | 2010-07-11T12:33:14.967 | 2013-04-24T12:04:50.893 | 2013-04-24T12:04:50.893 | 714,965 | 147,381 | [
"java",
"swing",
"jtable",
"border"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.