Id
int64 1.68k
75.6M
| PostTypeId
int64 1
2
| AcceptedAnswerId
int64 1.7k
75.6M
⌀ | ParentId
int64 1.68k
75.6M
⌀ | Score
int64 -60
3.16k
| ViewCount
int64 8
2.68M
⌀ | Body
stringlengths 1
41.1k
| Title
stringlengths 14
150
⌀ | ContentLicense
stringclasses 3
values | FavoriteCount
int64 0
1
⌀ | CreationDate
stringlengths 23
23
| LastActivityDate
stringlengths 23
23
| LastEditDate
stringlengths 23
23
⌀ | LastEditorUserId
int64 -1
21.3M
⌀ | OwnerUserId
int64 1
21.3M
⌀ | Tags
list |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4,565,375 | 1 | 4,572,782 | null | -1 | 1,524 | When ever I see website like or one thing always comes to my mind is:
If you guys confused about what I'm talking about here's a screenshot from BitSnoop:

[http://i54.tinypic.com/a2fbc3.png](http://i54.tinypic.com/a2fbc3.png)
In this torrent it has 3 different torrent trackers and all of them have different seeders/peers connected to them.
- -
I tried to do this in ASP.NET MVC but every time I failed so some one please enlighten me with your knowledge ;)
| Parsing a torrent info from multiple trackers and storing in a database | CC BY-SA 3.0 | null | 2010-12-30T18:56:30.843 | 2011-12-11T05:30:10.640 | 2011-12-11T05:30:10.640 | 234,976 | 470,237 | [
"c#",
"parsing",
"bittorrent"
]
|
4,565,584 | 1 | 4,602,124 | null | 2 | 242 | I'm trying to edit my TFS 2010 build templates using the Visual Studio 2010 Workflow designer. I have this nice widescreen display, and the designer insists on displaying the activity blocks in itty bitty areas. How can I resize them so I can at least read the entire display descriptions?

EDIT: If this annoys you too, [vote for this suggestion](https://connect.microsoft.com/wf/feedback/details/282123/feature-request-ability-to-resize-items-in-designer-mode)
| Possible to resize activity blocks in Visual Studio 2010 Workflow designer? | CC BY-SA 2.5 | null | 2010-12-30T19:26:31.403 | 2011-01-05T15:20:14.167 | 2011-01-05T15:20:14.167 | 55,948 | 55,948 | [
"visual-studio-2010",
"workflow-foundation",
"visual-studio-designer"
]
|
4,565,662 | 1 | 4,566,011 | null | 2 | 5,980 | 
can any one plz help me how to Find the MST using the PRIM algorithm. Highlight the edges of the MST and write the sequence in which the nodes are added to the MST..
thanks
| Finding MST of directed graph using Prim's algorithm | CC BY-SA 2.5 | 0 | 2010-12-30T19:37:11.690 | 2012-05-16T05:17:34.260 | 2010-12-30T20:28:04.860 | 89,806 | 534,408 | [
"algorithm",
"graph",
"minimum-spanning-tree",
"prims-algorithm"
]
|
4,565,679 | 1 | null | null | 14 | 14,520 | i need to tell a printer driver to issue a form feed.
i'm printing directly to a printer using the:
- [OpenPrinter](http://msdn.microsoft.com/en-us/library/dd162751(VS.85).aspx)- [StartDocPrinter](http://msdn.microsoft.com/en-us/library/dd145115(VS.85).aspx)- [StartPagePrinter](http://msdn.microsoft.com/en-us/library/dd145117(VS.85).aspx)- [WritePrinter](http://msdn.microsoft.com/en-us/library/dd145226(VS.85).aspx)- [EndPagePrinter](http://msdn.microsoft.com/en-us/library/dd162597(VS.85).aspx)- [EndDocPrinter](http://msdn.microsoft.com/en-us/library/dd162595(VS.85).aspx)- [ClosePrinter](http://msdn.microsoft.com/en-us/library/dd183446(VS.85).aspx)
set of API calls.
A lot of the inspiration came from [KB138594 - HOWTO: Send Raw Data to a Printer by Using the Win32 API](http://support.microsoft.com/kb/q138594/). An important point to note in that KB article is that they (and my copied code) start the document in `RAW` mode:
```
// Fill in the structure with info about this "document."
docInfo.pDocName = "My Document";
docInfo.pOutputFile = NULL;
docInfo.pDatatype = "RAW";
StartDocPrinter(hPrinter, 1, docInfo);
```
> `RAW` mode (as opposed to `TEXT` mode) means we are issuing raw bytes to the printer driver. We promise to talk in the language it understands.
We can then use `WritePrinter` to write everything we want:
```
WritePrinter(hPrinter, "Hello, world!"); //note, extra parameters removed for clarity
WritePrinter(hPrinter, 0x0c); //form-feed
```
The problem here is the `0x0c` form-feed character. Because we've opened the printer in `RAW` mode, we are promising we will send the printer driver bytes it can process. The drivers of printers take `0x0C` to mean you want to issue a form-feed.
The problem is that other printers (, ) expect print jobs to be in their own printer language. If you use the above to print to an XPS or PDF printer: nothing happens (i.e. no save dialog, nothing printed).
i [asked for a solution to this question a while ago](http://social.msdn.microsoft.com/forums/en-US/windowsxps/thread/6280ebb0-61ad-4c42-a870-7f022fcdfbfe/), and a response was that you have to change the document mode from `RAW`:
```
docInfo.pDatatype = "RAW";
```
to `TEXT`:
```
docInfo.pDataType = "TEXT";
```
> Well this probably is because you send
"RAW" data directly to the printer,
and RAW can be any PDL. But the XPS
driver will probably only understands
XPS, and it will probably just ignore
your "unknown: Hello, world!0xFF" PDL. The
XPS driver will probably, if any, only
accept XPS data when you write
directly to it.If you want to render text on the XPS
driver, you should use GDI. You might
be able to send plain text to the
driver if you specify "TEXT" as the
datatype. The print processor attached
to the driver will then "convert" the
plaintext for you by rendering the job
via GDI to the driver.
So that worked, i changed my code to declare the print document as `TEXT`:
```
// Fill in the structure with info about this "document."
docInfo.pDocName = "My Document";
docInfo.pOutputFile = NULL;
docInfo.pDatatype = "TEXT";
StartDocPrinter(hPrinter, 1, docInfo);
WritePrinter(hPrinter, "Hello, world!");
WritePrinter(hPrinter, 0x0c); //form-feed
```
And then the dialog for XPS and PDF printers appear, and it saves correctly. And i thought all was fixed.
Except months later, when i tried to print to a <quote>real</quote> printer: the form-feed doesn't happen - presumably because i am no longer printing in "raw printer commands" mode.
So what i need is the way of issuing a form feed. i need the API call that will tell printer driver that i want the printer to perform a form-feed.
How to tell a printer to issue a Form-Feed during printing?
---
## Background on Data Types
The print processor tells the spooler to alter a job according to the document data type. It works in conjunction with the printer driver to send the spooled print jobs from the hard drive to the printer.
Software vendors occasionally develop their own print processors to support custom data types. Normally, the print processor does not require any settings or intervention from administrators.
The Windows printing process normally supports five data types. The two most commonly used data types, enhanced metafile (EMF) and ready to print (RAW), affect performance in different ways on both the client computer and the print server computer.
`RAW` is the default data type for clients other than Windows-based programs. The RAW data type tells the spooler not to alter the print job at all prior to printing. With this data type, the entire process of preparing the print job is done on the client computer.
`EMF`, or enhanced metafile, is the default datatype with most Windows-based programs. With EMF, the printed document is altered into a metafile format that is more portable than RAW files and usually can be printed on any printer. EMF files tend to be smaller than RAW files that contain the same print job. Regarding performance, only the first portion of a print job is altered, or rendered on the client computer, but most of the impact is on the print server computer, which also helps the application on the client computer to return control to the user faster.
The following table ([taken from MSDN](http://technet.microsoft.com/en-us/library/bb490764.aspx)) shows the five different data types supported by the default Windows print processor:
: `RAW`
: Print the document with no changes.
: This is the data type for all clients not based on Windows.
: `RAW [FF appended]`
: Append a form-feed character (0x0C), but make no other changes. (A PCL printer omits the document's last page if there is no trailing form-feed.)
: Required for some applications. Windows does not assign it, but it can be set as the default in the Print Processor dialog box.
: `RAW [FF auto]`
: Check for a trailing form-feed and add one if it is not already there, but make no other changes.
: Required for some applications. Windows does not assign it, but it can be set as the default in the Print Processor dialog box.
: `NT EMF 1.00x`
: Treat the document as an enhanced metafile (EMF) rather than the RAW data that the printer driver puts out.
: EMF documents are created by Windows.
: `TEXT`
: Treat the entire job as ANSI text and add print specifications using the print device's factory defaults.
: This is useful when the print job is simple text and the target print device cannot interpret simple text.
You can see the print processors available for a printer, and the data types that each processor supports, through the properties of a printer in the control panel:

## See also
- [Send ESC commands to a printer in C#](https://stackoverflow.com/questions/2837786/send-esc-commands-to-a-printer-in-c)- [Feed paper on POS Printer C#](https://stackoverflow.com/questions/207454/feed-paper-on-pos-printer-c)- [Print raw data to a thermal-printer using .NET](https://stackoverflow.com/questions/2638988/print-raw-data-to-a-thermal-printer-using-net)
| Windows: How to tell printer to issue a FormFeed during printing? | CC BY-SA 3.0 | 0 | 2010-12-30T19:39:25.133 | 2020-08-02T14:16:18.460 | 2017-05-23T12:34:53.630 | -1 | 12,597 | [
"windows",
"printing",
"xps"
]
|
4,565,914 | 1 | 4,566,034 | null | 0 | 45 | i have a MS access database with a table such as the one below and i am trying to figure out the sql needed to determine the total number of times the date changes across all the fields for each defectID record.
also, note that each day i add a field to the table, so if this can be made dynamic that would be best.
when there are no dates i would like the result to display 0 (zero)

thanks all
| access help to dynamicaly determin a records date changes across fields | CC BY-SA 2.5 | null | 2010-12-30T20:13:03.720 | 2011-01-02T21:30:59.220 | null | null | 352,157 | [
"sql",
"ms-access"
]
|
4,566,385 | 1 | 4,566,729 | null | 6 | 1,212 | I'm trying to design a page that has two columns of content, div#left and div#right. (I know these aren't proper semantic identifiers, but it makes explaining easier) The widths of both columns are fixed.

When the viewport is too narrow to display both side-by-side, , like this:

My first thought was simply to apply `float: left` to #left and `float: right` to #right, but that makes #right itself to the right side of the window (which is the proper behavior for `float`, after all), leaving an empty space. This also leaves a big gap between the columns when the browser window is really wide.

Applying `float: left` to divs would result in the wrong one moving to the bottom when the window was too small.

I could probably do this with media queries, but IE doesn't support those until version 9. The source order is unimportant, but I need something that works in IE7 minimum. Is this possible to do without resorting to Javascript?
| Can I create a two-column layout that fluidly adapts to narrow windows? | CC BY-SA 2.5 | null | 2010-12-30T21:26:46.947 | 2010-12-30T22:24:45.727 | 2010-12-30T21:53:03.137 | 4,160 | 4,160 | [
"css",
"layout"
]
|
4,566,639 | 1 | 4,566,652 | null | 1 | 1,273 | I am trying to write text onto a png, however when I do it puts a dark border around it, I am not sure why.
The original image:
The processed image: 
Code:
```
// Load the image
$im = imagecreatefrompng("admin/public/images/map/order/wally.png");
// If there's an error, gtfo
if(!$im) {
die("");
}
$textColor = imagecolorallocate($im, 68, 68, 68);
$width = imagesx($im);
$height = imagesy($im);
$fontSize = 5;
$text = "AC";
// Calculate the left position of the text
$leftTextPos = ($width - imagefontwidth($fontSize)*strlen($text)) / 2;
// Write the string
imagestring($im, $fontSize, $leftTextPos, $height-28, $text, $textColor);
// Output the image
header('Content-type: image/png');
imagepng($im);
imagedestroy($im);
```
| Applying text to png transparency issue PHP | CC BY-SA 3.0 | 0 | 2010-12-30T22:08:42.780 | 2017-09-18T06:07:35.660 | 2017-09-18T06:07:35.660 | 1,033,581 | 241,465 | [
"php",
"gd"
]
|
4,566,637 | 1 | 4,566,752 | null | 2 | 5,710 | I have a piece of .NET code that is erroring out when it makes a call to `HTTPWebRequest.GetRequestStream`. Here is the error message:
> The underlying connection was closed:
Could not establish trust relationship
for the SSL/TLS secure channel.
I've read a few things that suggest that I might need a certificate on the machine running the code, but I believe I have all the require certificates...
This is how I checked to see if I had the required certificates:
1. hit the webservice using Firefox.
2. Look at the certificates being used to hit that web service by looking at the security info through the browser
3. export the certificates
4. import the certificates through Internet Options in the control panel
Should this be sufficient? I am still getting the error.
Code:
```
var request = (HttpWebRequest)HttpWebRequest.Create(requestUrl); //my url
request.Method = StringUtilities.ConvertToString(httpMethod); // Set the http method GET, POST, etc.
if (postData != null)
{
request.ContentLength = postData.Length;
request.ContentType = contentType;
using (var dataStream = request.GetRequestStream())
{
dataStream.Write(postData, 0, postData.Length);
}
}
```
Adding some screen shots of my certs. Let me know if anything looks wrong:
First, we have the cert that Firefox is using:

Next, we have what is in my Trusted Root Certs according to the MMC:

Last, we have what is in my Intermediate certs according to the MMC:

Does this look right?
| Why wouldn't I be able to establish a trust relationship for a SSL/TLS channel? | CC BY-SA 2.5 | 0 | 2010-12-30T22:08:20.530 | 2011-03-14T17:32:12.993 | 2011-03-14T17:32:12.993 | 226,897 | 226,897 | [
".net",
"asp.net",
"security",
"exception",
"ssl-certificate"
]
|
4,566,773 | 1 | null | null | 2 | 4,209 | I'm teaching myself javascript by creating a script for displaying an external rss feed on a webpage.
The code I patched together works great locally. This is a screen grab of the code producing exactly the desired behavior. The code is populating all the information inside the section "Blog: Shades of Gray", except for "tagged" which I hard coded:

But when I upload the site files to my server, the code doesn't work at all. This is a screen grab of the code on my site NOT producing the desired behavior...

This feels like I'm not getting something really basic about how javascript works locally vs. on the server. I did my half hour of googling for an answer and no trails look promising. So I'd really appreciate your help.
This is my site (under construction) [http://jonathangcohen.com](http://jonathangcohen.com)
Below is the code, which can also be found at [http://jonathangcohen.com/grabFeeds.js](http://jonathangcohen.com/grabFeeds.js).
```
/*Javascript for Displaying an External RSS Feed on a Webpage
Wrote some code that’ll grab attributes from an rss feed and assign IDs for displaying on a webpage. The code references my Tumblr blog but it’ll extend to any RSS feed.*/
window.onload = writeRSS;
function writeRSS(){
writeBlog();
}
function writeBlog(){
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET","http://blog.jonathangcohen.com/rss.xml",false);
xmlhttp.send();
xmlDoc=xmlhttp.responseXML;
var x=xmlDoc.getElementsByTagName("item");
//append category to link
for (i=0;i<3;i++)
{
if (i == 0){
//print category
var blogTumblrCategory = x[i].getElementsByTagName("category")[0].childNodes[0].nodeValue
document.getElementById("getBlogCategory1").innerHTML =
'<a class="BlogTitleLinkStyle" href="http://blog.jonathangcohen.com/tagged/'+blogTumblrCategory+'">'+blogTumblrCategory+'</a>';
//print date
var k = x[i].getElementsByTagName("pubDate")[0].childNodes[0].nodeValue
thisDate = new Date();
thisDate = formatTumblrDate(k);
document.getElementById("getBlogPublishDate1").innerHTML = thisDate;
//print title
var blogTumblrTitle = x[i].getElementsByTagName("title")[0].childNodes[0].nodeValue
var blogTumblrLink = x[i].getElementsByTagName("link")[0].childNodes[0].nodeValue
document.getElementById("getBlogTitle1").innerHTML =
'<a class="BlogTitleLinkStyle" href="'+blogTumblrLink+'">'+blogTumblrTitle+'</a>';
}
if (i == 1){
//print category
var blogTumblrCategory = x[i].getElementsByTagName("category")[0].childNodes[0].nodeValue
document.getElementById("getBlogCategory2").innerHTML =
'<a class="BlogTitleLinkStyle" href="http://blog.jonathangcohen.com/tagged/'+blogTumblrCategory+'">'+blogTumblrCategory+'</a>';
//print date
var k = x[i].getElementsByTagName("pubDate")[0].childNodes[0].nodeValue
thisDate = new Date();
thisDate = formatTumblrDate(k);
document.getElementById("getBlogPublishDate2").innerHTML = thisDate;
//print title
var blogTumblrTitle = x[i].getElementsByTagName("title")[0].childNodes[0].nodeValue
var blogTumblrLink = x[i].getElementsByTagName("link")[0].childNodes[0].nodeValue
document.getElementById("getBlogTitle2").innerHTML =
'<a class="BlogTitleLinkStyle" href="'+blogTumblrLink+'">'+blogTumblrTitle+'</a>';
}
if (i == 2){
//print category
var blogTumblrCategory = x[i].getElementsByTagName("category")[0].childNodes[0].nodeValue
document.getElementById("getBlogCategory3").innerHTML =
'<a class="BlogTitleLinkStyle" href="http://blog.jonathangcohen.com/tagged/'+blogTumblrCategory+'">'+blogTumblrCategory+'</a>';
//print date
var k = x[i].getElementsByTagName("pubDate")[0].childNodes[0].nodeValue
thisDate = new Date();
thisDate = formatTumblrDate(k);
document.getElementById("getBlogPublishDate3").innerHTML = thisDate;
//print title
var blogTumblrTitle = x[i].getElementsByTagName("title")[0].childNodes[0].nodeValue
var blogTumblrLink = x[i].getElementsByTagName("link")[0].childNodes[0].nodeValue
document.getElementById("getBlogTitle3").innerHTML =
'<a class="BlogTitleLinkStyle" href="'+blogTumblrLink+'">'+blogTumblrTitle+'</a>';
}
}
}
function formatTumblrDate(k){
d = new Date(k);
var curr_date = d.getDate();
var curr_month = d.getMonth();
curr_month++;
var curr_year = d.getFullYear();
printDate = (curr_month + "/" + curr_date + "/" + curr_year);
return printDate;
}
```
Thank you!
| Javascript works great locally, but not on my server | CC BY-SA 2.5 | 0 | 2010-12-30T22:31:41.060 | 2010-12-31T15:06:50.193 | null | null | 241,800 | [
"javascript",
"xml",
"rss"
]
|
4,566,835 | 1 | 4,566,899 | null | 4 | 337 | This is only marginally programming related - has much more to do w/ colors and their representation.
I am working on a very low level app. I have an array of bytes in memory. Those are characters. They were rendered with anti-aliasing: they have values from 0 to 255, 0 being fully transparent and 255 totally opaque (alpha, if you wish).
I am having trouble conceiving an algorithm for the rendering of this font. I'm doing the following for each pixel:
```
// intensity is the weight I talked about: 0 to 255
intensity = glyphs[text[i]][x + GLYPH_WIDTH*y];
if (intensity == 255)
continue; // Don't draw it, fully transparent
else if (intensity == 0)
setPixel(x + xi, y + yi, color, base); // Fully opaque, can draw original color
else { // Here's the tricky part
// Get the pixel in the destination for averaging purposes
pixel = getPixel(x + xi, y + yi, base);
// transfer is an int for calculations
transfer = (int) ((float)((float) (255.0 - (float) intensity/255.0) * (float) color.red + (float) pixel.red)/2); // This is my attempt at averaging
newPixel.red = (Byte) transfer;
transfer = (int) ((float)((float) (255.0 - (float) intensity/255.0) * (float) color.green + (float) pixel.green)/2);
newPixel.green = (Byte) transfer;
// transfer = (int) ((float) ((float) 255.0 - (float) intensity)/255.0 * (((float) color.blue) + (float) pixel.blue)/2);
transfer = (int) ((float)((float) (255.0 - (float) intensity/255.0) * (float) color.blue + (float) pixel.blue)/2);
newPixel.blue = (Byte) transfer;
// Set the newpixel in the desired mem. position
setPixel(x+xi, y+yi, newPixel, base);
}
```
The results, as you can see, are less than desirable. That is a very zoomed in image, at 1:1 scale it looks like the text has a green "aura".

Any idea for how to properly compute this would be greatly appreciated.
Thanks for your time!
| Computing "average" of two colors | CC BY-SA 2.5 | 0 | 2010-12-30T22:42:17.507 | 2010-12-30T23:35:55.673 | 2010-12-30T22:46:28.133 | 547,023 | 280,698 | [
"c",
"low-level",
"antialiasing",
"alphablending"
]
|
4,566,957 | 1 | 4,566,998 | null | 3 | 1,042 | Is there any way to disable the overscrolling-effect for ListBoxes or ScrollViewers? I think the effect is also called "rubber-band-effect".
I'd like to completely disable it
or to disable it, if there are only a few items in the container, and re-enable it if there are more items in the container than the number of items that fit on one screen.
The list of installed application has exactly the behavior I want to achieve. There is no overscrolling.

| How to disable the overscrolling-effect for ListBoxes/ScrollViewer in Windows Phone 7 | CC BY-SA 2.5 | null | 2010-12-30T23:05:45.120 | 2010-12-30T23:25:03.143 | 2010-12-30T23:25:03.143 | 387,023 | 387,023 | [
"silverlight",
"windows-phone-7"
]
|
4,567,190 | 1 | 4,567,213 | null | 1 | 63 | 
I have installed python and don't really know what this means. Any ideas?
| Trying to Launch Google App Engine, given error related to python | CC BY-SA 2.5 | null | 2010-12-30T23:57:54.423 | 2010-12-31T00:02:55.557 | null | null | 440,266 | [
"python",
"google-app-engine"
]
|
4,567,186 | 1 | 4,567,291 | null | 0 | 185 | Did I just break some kind of record?

Ok so this is actually a serious question :)
What I did was drag one of my code files onto my desktop. I then deleted the file from Xcode, thinking I had a better way to code something. Turns out I didn't, and I want to reuse my old file.
But... I emptied the trash can in between. I didn't think this would be a problem, I just dragged the desktop version of the file back into Xcode. But now, the file is all messed up - it looks like what you get if you open a .jpeg or anything else with a text editor. I build it with this and get 67,000 errors :o
Somehow the character encoding or something has changed - anyone know how to fix this?
EDIT: ok here's another photo. No, its not photoshop.

| Xcode: 67,000 build errors. How do I fix this? | CC BY-SA 2.5 | 0 | 2010-12-30T23:57:16.820 | 2010-12-31T00:28:18.920 | 2010-12-31T00:22:15.620 | 555,619 | 555,619 | [
"iphone",
"xcode",
"character-encoding"
]
|
4,567,204 | 1 | 4,570,444 | null | -1 | 720 | I am using a query to fetch data in ms access. I'd like to print the data using a report, but with the constraint that it must be two column per page, how do i do this?
or if you could suggest how i executed a query in ms access and get the records returned by a query in code, so that i can make the report another way.
thanks

| generating report in ms access | CC BY-SA 2.5 | 0 | 2010-12-31T00:01:45.510 | 2010-12-31T13:47:28.140 | 2010-12-31T00:56:54.037 | 362,461 | 362,461 | [
"ms-access",
"report"
]
|
4,567,227 | 1 | null | null | 0 | 1,348 | I'm trying to work out some url rewrite issues and I'm trying to get firebug to help me. I'm getting 404 errors on misguided urls and I would like to see which ones are off. That way I can examine why they are off and perhaps see an easy solution.
Anyway I can't seem to get firebug to show me the original urls, and I can't seem to find it in the request data on the net tab.
Firebug Net Tab:

Can someone tell how I can see what urls are triggering these 404s?
| In Firebug 1.6.0, how do you tell what url triggered a 404 error? | CC BY-SA 2.5 | null | 2010-12-31T00:08:05.763 | 2010-12-31T16:06:49.857 | 2010-12-31T16:06:49.857 | 25,847 | 25,847 | [
"url-rewriting",
"firebug",
"http-status-code-404"
]
|
4,567,407 | 1 | 4,571,894 | null | 1 | 841 | I'm building a panel control that makes use of jQuery UI tabs, and looks like this:

The tabs are in the header and the tab panels are nested inside the parent element under a single containing (`div.form-panel-contents`) that I use for expanding/collapsing the panel contents. The problem is when I collapse the containing div via slideUp, somehow Tabs detects that the tab panels container is not visible and applies the CSS class `ui-tabs-hide` to each of the nested tab panels, which sets all tab panels to `display: none`.
`ui-tabs-hide`
When I change the state of the containing div I want the state of the tab panels to remain intact, so that the slide up/down looks fluid. I'm also curious how the tool even detects that the parent element was collapsed in the first place.
```
if ($.fn.tabs)
$(".ui-tabs").tabs();
```
-
```
<div class="widget ui-tabs form-panel-container">
<ul class="title_bar">
<li class="handle"><h5>New Panel Look - Test <span class="asterisk"></span></h5></li>
<li class="leaf"><a class="leaf_link" href="#tab_name_1">Tab Name 1</a></li>
<li class="leaf"><a class="leaf_link" href="#tab_name_2">Tab Name 2</a></li>
<li class="leaf"><a class="leaf_link" href="#tab_name_3">Tab Name 3</a></li>
<li class="handle_buttons"><a href="" class="handle_btn expand"></a><a href="" class="handle_btn question"></a></li>
</ul>
<div class="form-panel-contents">
<div>
<div id="tab_name_1">
<div class="text_area">
<div class="padder">
<p> content content content content content content content content content content content content content content content content content content</p>
</div>
</div>
<div class="action_bar">
<div class="pad">
<a href="" class="btn"><label></label>Name of Button</a>
</div>
</div>
</div><!-- end wrapper div -->
<div class="text_area" id="tab_name_2">
<div class="padder">
<textarea>content content content content content content content content content content content content</textarea>
</div>
</div>
<div class="text_area" id="tab_name_3">
<div class="padder">
<h5>Input Something<span class="asterisk"></span></h5>
<div class="title_container"><input type="text" id="title"></div>
</div>
</div>
</div>
</div>
</div>
```
| jQuery UI Tabs conundrum when tab-panel parent element is collapsed | CC BY-SA 2.5 | null | 2010-12-31T01:01:50.347 | 2010-12-31T19:16:37.197 | 2010-12-31T01:07:07.227 | 56,753 | 56,753 | [
"jquery",
"panel",
"jquery-ui-tabs"
]
|
4,567,631 | 1 | 4,567,725 | null | 1 | 823 | I took this data structure from this [A* tutorial](http://blogs.msdn.com/b/ericlippert/archive/2007/10/04/path-finding-using-a-in-c-3-0-part-two.aspx):
```
public interface IHasNeighbours<N>
{
IEnumerable<N> Neighbours { get; }
}
public class Path<TNode> : IEnumerable<TNode>
{
public TNode LastStep { get; private set; }
public Path<TNode> PreviousSteps { get; private set; }
public double TotalCost { get; private set; }
private Path(TNode lastStep, Path<TNode> previousSteps, double totalCost)
{
LastStep = lastStep;
PreviousSteps = previousSteps;
TotalCost = totalCost;
}
public Path(TNode start) : this(start, null, 0) { }
public Path<TNode> AddStep(TNode step, double stepCost)
{
return new Path<TNode>(step, this, TotalCost + stepCost);
}
public IEnumerator<TNode> GetEnumerator()
{
for (Path<TNode> p = this; p != null; p = p.PreviousSteps)
yield return p.LastStep;
}
IEnumerator IEnumerable.GetEnumerator()
{
return this.GetEnumerator();
}
}
```
I have no idea how to create a simple graph with.
How do I add something like the following undirected graph using C#:

Basically I'd like to know how to connect nodes. I have my own datastructures that I can already determine the neighbors and the distance. I'd now like to convert that into this posted datastructure so I can run it through the AStar algorithm.
I was seeking something more like:
```
Path<EdgeNode> startGraphNode = new Path<EdgeNode>(tempStartNode);
startGraphNode.AddNeighbor(someOtherNode, distance);
```
| How do I create a graph from this datastructure? | CC BY-SA 2.5 | 0 | 2010-12-31T02:08:34.207 | 2010-12-31T04:49:33.130 | 2010-12-31T02:50:37.510 | 400,861 | 400,861 | [
"c#",
"algorithm",
"data-structures",
"a-star"
]
|
4,567,644 | 1 | 4,567,680 | null | 1 | 884 | Suppose I have some arbitrary input image with width and height . I want to rotate this image all the way around 360 degrees back to the starting position. However, if the image is of anything except a circle, then the edges of the image will be clipped if the canvas it is drawn onto remains at size by .

What I need then is to determine the canvas size (width and height ) that can be used for all rotated versions of the input image. I know that == , and thus the desired canvas size is a square, because it is obvious that we are rotating something about a center point, and the final image (after 360 rotations) is essentially a circle.
The other thing to consider is that objects such as squares will have corners that will stick out, so just using the max value of width or height for both dimensions also does not work.
One solution I have come up with is to create the canvas larger than I need (for example by setting and to `max(w1, h1) * 2`, rotating everything, and then trimming all the transparent pixels. This is not very efficient and I would much rather be able to calculate the tightest bounding box upfront.
| Smallest possible bounding box for a rotated image | CC BY-SA 2.5 | 0 | 2010-12-31T02:14:36.150 | 2010-12-31T03:12:20.917 | null | 2,359,478 | 2,359,478 | [
"actionscript-3",
"math",
"geometry"
]
|
4,567,834 | 1 | 4,567,843 | null | 3 | 12,778 | Here is my CSS code for table:
```
table.t_data
{
/* border: 1px; - **EDITED** - doesn't seem like influences here */
background-color: #080;
border-spacing: 1px;
margin: 0 auto 0 auto;
}
table.t_data thead th, table.t_data thead td
{
background-color: #9f9;
/* border: #080 0px solid; - **EDITED** - doesn't seem like influences here */
padding: 5px;
margin: 1px;
}
table.t_data tbody th, table.t_data tbody td
{
background-color: #fff;
/* border: #080 0px solid; - **EDITED** - doesn't seem like influences here */
padding: 2px;
}
```
I need to display the following HTML:
```
<table class="t_data">
<thead style="padding:1px">
<tr>
<th>#</th>
<th>Team</th>
<th>Stadium Name</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Team 1</td>
<td>Name 1</td>
<td>Size 1-1, 2-1, 3-1</td>
</tr>
<tr>
<td>2</td>
<td>Team 1</td>
<td>Name 1</td>
<td>Size 1-1, 2-1, 3-1</td>
</tr>
<tr>
<td>3</td>
<td>Team 1</td>
<td>Name 1</td>
<td>Size 1-1, 2-1, 3-1</td>
</tr>
</tbody>
</table>
```
It display perfect (as expected) table in Mozilla Firefox and in IE8:

But there are issues in other browsers/modes:
In Chrome the line between head and body is double width:

In IE8 (switched into IE7 compatibility mode) all lines are double width:

Question: what are CSS options to make each line boldness same (1px)?
| CSS+HTML: How to draw table/cell border | CC BY-SA 3.0 | 0 | 2010-12-31T03:11:08.577 | 2017-06-18T09:13:26.427 | 2017-06-18T09:13:26.427 | 4,370,109 | 159,179 | [
"html",
"css",
"html-table",
"cross-browser"
]
|
4,567,924 | 1 | 4,568,064 | null | 2 | 625 | I've looked at many graphing libraries and couldn't find one with a good radar graph. See image for the type of look I want. Most of the one's I've seen look very plain and mathy, anything that could be used for a game interface?

| What's a good JS graph library that has a good-looking radar graph? | CC BY-SA 2.5 | null | 2010-12-31T03:39:21.693 | 2013-12-08T16:18:33.300 | null | null | 459,289 | [
"javascript",
"graph"
]
|
4,567,953 | 1 | 4,568,119 | null | 1 | 1,431 | I was looking at the Twitter for iPhone app and was puzzled.
First of all, there are normal words looking like links inside.
Second, when I touch those link-like words, the text view (or maybe web view) jumps to the corresponding part below (yes, it doesn't open Safari, it just jumps to the text within that text/web view)
Now I want to implement the same effects.
1. I should base my implementation on what? UITextView or UIWebView?
2. How to make normal words look like links?
3. How to make those smooth jumps within such a text/web views?
Thanks in advance.


| UITextView or UIWebView with normal words looking like links | CC BY-SA 2.5 | null | 2010-12-31T03:49:55.657 | 2011-01-04T06:36:03.173 | 2011-01-04T06:36:03.173 | 714 | 544,504 | [
"iphone",
"cocoa-touch"
]
|
4,568,070 | 1 | 4,656,209 | null | 1 | 378 | This is difficult to explain without illustration, so - behold, an illustration, cobbled together from screenshots of a few hello-world examples and a lot of Paint work:

I have started out using Windows Forms on .NET (via IronPython, but that shouldn't be important), and haven't been able to figure out very much. GUI libraries in general are very intimidating, simply because every class has so many possible attributes. Documentation is good at explaining what everything does, but not so good at helping you figure out what you need.
I will be assembling the GUI dynamically, but I'm not expecting that to be the hard part. The sticking points for me right now are:
- How do I get text labels to size themselves automatically to the width of the contained text (so that the text doesn't clip, and I also don't reserve unnecessary space for them when resizing the window)?- How do I make the vertical scrollbar always appear? Setting the VScroll property (why is this protected when AutoScroll is public, BTW?) doesn't seem to do anything.- How come the horizontal scrollbar is not added by AutoScroll when contents are laid out vertically (via `Dock = DockStyle.Top`)? I can use a minimum size for panels to prevent the label and corresponding control from overlapping when the window is shrunk horizontally, but then the scrollbar doesn't appear and the control is inaccessible.- How can I put limits on window resizing (e.g. set a minimum width) without disabling it completely? (Just set minimum/maximum sizes for the Form?) Related to that, is there any way to set minimum/maximum widths or heights without setting a minimum/maximum size (i.e. can I constrain the size in only one dimension)?- Is there a built-in control suitable for hex editing or am I going to have to build something myself?
... And should I be using something else (perhaps something more capable?) I've heard WPF mentioned, but I understand that this involves XML and I really want to build a GUI from XML - I already have data in an object graph, and doing some kind of weird XML pseudo-serialization (in Python, no less!) in order to create a GUI seems incredibly roundabout.
| How do I make a GUI that behaves like this? | CC BY-SA 2.5 | null | 2010-12-31T04:28:44.573 | 2011-01-11T09:51:25.627 | null | null | 523,612 | [
"winforms",
"user-interface",
"dynamic",
"window",
"constraints"
]
|
4,568,147 | 1 | null | null | 1 | 1,882 | I want to plot a piecewise function, but I don't want any gaps to appear
at the junctures, for example:
```
t=[1:8784];
b=(26.045792 + 13.075558*sin(0.0008531214*t - 2.7773943)).*((heaviside(t-2184))-(heaviside(t-7440)));
plot(b,'r','LineWidth', 1.5);grid on
```
there should not be any gaps appearing in
the plot between the three intervals , but they do.
I want the graph to be continueous without gaps.
Any suggestions on how to achieve that.
Thanks in advance.
Actually, my aim is to find the carrier function colored by yellow in the figure below. I divide the whole interval into 3 intervals: 1-constant 2-sinusoidal 3- constant, then I want to find the overall function from the these three functions

| Gaps In Plot Of Piecewise Function in Matlab | CC BY-SA 2.5 | null | 2010-12-31T04:52:22.453 | 2013-04-18T19:39:35.063 | 2013-04-18T19:39:35.063 | 1,655,144 | 375,750 | [
"matlab",
"gaps-in-visuals",
"piecewise"
]
|
4,568,243 | 1 | 4,568,438 | null | 0 | 42 | on various speedtest websites, amongst which site-perf.com I see the `header` causing relatively the largest delay for the website to load. On other speedtest charts i see the same, namely: while connection, ques, resolve, body are all fine, the `header` seems to take oddly long time. A note to be mentioned is that the .jpg files are very tiny thumbnails that are generated by a php script. (look at the size of them: tiny!)
In various trials, for example the two printscreens below that were set two weeks apart, i have more or less the same result: huge yellow bars dwarfing delays caused by other aspects.
Am i interpreting these pictures properly at all? Could the yellow be actually a "polluted" delay where its slow load is due to many factors combined (slow internet connection, slow recolve etc, and not so contrasty to be blaimed at the `headers` in the chart?
if you try to test your own website with similar size/load at [http://site-perf.com](http://site-perf.com), do you get a similar chart as I get?
looking at such results (pictures) what could be causing the relatively higher percentages seen, caused as what is described as `header`?
what could I do/try, to reduce the percentage of time lost in yellow here?
Thanks very much +!
---
`PIC1`

---
`PIC2`

| Strange: delay caused by headers dwarfing other speed aspects! How to interpret these speed charts? | CC BY-SA 2.5 | 0 | 2010-12-31T05:18:15.773 | 2010-12-31T06:04:31.310 | null | null | 509,670 | [
"php",
"optimization",
"header",
"performance",
"thumbnails"
]
|
4,568,297 | 1 | null | null | 8 | 45,799 | I am getting this strange error on startup. What could be wrong in my environment?

Here is the error :
```
>!ENTRY org.eclipse.core.jobs 4 2 2010-12-30 17:56:32.545
!MESSAGE An internal error occurred during: "Initializing Java Tooling".
!STACK 0
org.eclipse.equinox.internal.provisional.frameworkadmin.FrameworkAdminRuntimeException: Not a file url: ../p2/
at org.eclipse.equinox.internal.frameworkadmin.equinox.EquinoxManipulatorImpl.loadWithoutFwPersistentData(EquinoxManipulatorImpl.java:368)
at org.eclipse.equinox.internal.frameworkadmin.equinox.EquinoxManipulatorImpl.load(EquinoxManipulatorImpl.java:331)
at org.eclipse.pde.internal.core.target.AbstractBundleContainer.getVMArguments(AbstractBundleContainer.java:722)
at org.eclipse.pde.internal.core.target.TargetPlatformService.newDefaultTargetDefinition(TargetPlatformService.java:493)
at org.eclipse.pde.internal.core.PluginModelManager.initDefaultTargetPlatformDefinition(PluginModelManager.java:458)
at org.eclipse.pde.internal.core.PluginModelManager.initializeTable(PluginModelManager.java:428)
at org.eclipse.pde.internal.core.PluginModelManager.getWorkspaceModels(PluginModelManager.java:886)
at org.eclipse.pde.core.plugin.PluginRegistry.getWorkspaceModels(PluginRegistry.java:176)
at org.eclipse.pde.internal.core.SearchablePluginsManager.computeContainerClasspathEntries(SearchablePluginsManager.java:128)
at org.eclipse.pde.internal.core.ExternalJavaSearchClasspathContainer.getClasspathEntries(ExternalJavaSearchClasspathContainer.java:29)
at org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:2584)
at org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:2679)
at org.eclipse.jdt.internal.core.JavaProject.getResolvedClasspath(JavaProject.java:1866)
at org.eclipse.jdt.core.JavaCore.initializeAfterLoad(JavaCore.java:3443)
at org.eclipse.jdt.internal.ui.InitializeAfterLoadJob$RealJob.run(InitializeAfterLoadJob.java:35)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.net.URISyntaxException: Not a file url: ../p2/
at org.eclipse.equinox.internal.frameworkadmin.equinox.utils.FileUtils.fromFileURL(FileUtils.java:192)
at org.eclipse.equinox.internal.frameworkadmin.equinox.EquinoxFwConfigFileParser.readp2DataArea(EquinoxFwConfigFileParser.java:362)
at org.eclipse.equinox.internal.frameworkadmin.equinox.EquinoxFwConfigFileParser.readFwConfig(EquinoxFwConfigFileParser.java:224)
at org.eclipse.equinox.internal.frameworkadmin.equinox.EquinoxManipulatorImpl.loadWithoutFwPersistentData(EquinoxManipulatorImpl.java:366)
```
| An internal error occurred during "Initializing Java Tooling." in Eclipse on startup | CC BY-SA 3.0 | 0 | 2010-12-31T05:31:47.510 | 2017-07-31T13:13:23.387 | 2012-05-03T20:52:13.587 | 1,033,808 | 184,730 | [
"eclipse",
"startup"
]
|
4,568,803 | 1 | null | null | 3 | 3,139 | I want to take a 512x280 pixel screenshot of a certain section of the screen in C# then store the RGB information in an array. If I wanted the origin (top left) of the screenshot to begin at the pixels (200,200), how would I go about doing this?
I asked this earlier and was given the following code:
[http://pastebin.com/JmCJ4Qer](http://pastebin.com/JmCJ4Qer)
However, this seems to still create the bitmap starting at the 0,0 coordinates but will just leave that area empty until it reaches the size. It creates something like this: 
Where the image is pushed down and to the right however many pixels are specified in xOrigin and yOrigin.
| Taking a screenshot of a specific area in C#? | CC BY-SA 2.5 | null | 2010-12-31T07:34:39.450 | 2010-12-31T08:15:15.610 | 2010-12-31T08:09:31.277 | 362,218 | 558,948 | [
"c#",
"screenshot"
]
|
4,569,117 | 1 | 4,569,148 | null | 26 | 5,327 | Observe a line in a Vim instance:

Now I hit $:

Why does my cursor not go all the way to the end? Once I try inserting, the text gets inserted the last character! Even if I try to move right again while still in normal mode I get the bell. Oddly, when in edit mode I can move to the actual end of line with the right arrow key!

Does anyone know why Vim does this? On 7.3 by the way. Thanks for the help.
| Why does Vim position the caret one character off with $ (end of line)? | CC BY-SA 3.0 | 0 | 2010-12-31T08:58:45.373 | 2019-02-14T22:52:51.423 | 2015-05-21T23:12:18.317 | 2,359,271 | 66,584 | [
"vim"
]
|
4,569,305 | 1 | null | null | 1 | 536 | I've installed phpunit version 3.5.6 using pear and required dependecies using
pear install --alldeps phpunit/PHPUnit which went fine.
When I run phpunit from the command line such as (phpunit fleet.php) it produces a fatal error and fails opening required files (see sample output image below).
I have checked the include_path using get_include_path and the output is as follows.
c:\PHP; c:\PHP\pear; c:\php\includes; c:\Inetpub\Library;
The system path also contains c:\php\pear
Please advise how to get this running.

| phpunit Fatal error - require_once not locating files that appear to be on the include path | CC BY-SA 2.5 | null | 2010-12-31T09:37:06.597 | 2010-12-31T10:29:07.747 | null | null | 466,764 | [
"phpunit"
]
|
4,569,316 | 1 | 4,569,334 | null | 2 | 529 | What I did is as follows.
- - - - - - - [Here is the video that demonstrates the empty images.](http://www.youtube.com/watch?v=6ZH5H0Wj-5A)

My Question is
- - - -
| Does Xcode compile images? | CC BY-SA 4.0 | 0 | 2010-12-31T09:38:37.250 | 2022-12-25T16:53:48.357 | 2022-12-25T16:53:48.357 | 3,689,450 | 140,765 | [
"iphone",
"xcode",
"image",
"ipad",
"build"
]
|
4,569,271 | 1 | 4,569,441 | null | 6 | 28,437 | I'm using asp.net mvc - ajax with jQuery...
I've a model type named "" that contains a property ""
this property contains data in the following format:
```
TableOfContents = "1,2,4,6,9,17,28";
```
Json action method, that reuturn Book object look like this:
```
public JsonResult GetBook(int id) {
return Json(_bookRepository.Current(id), .....AllowGet);
}
```
Following style of list images that I want to display.

In C# (Razor) I can do this,
```
var splitted = Model.TableOfContents.Split(‘,’);
@foreach(var number in splitted) {
<li><img src=”@Url.Content(“~/Content/Images/img-“ + number + “.gif”)” /> </li>
}
```
This code 100% works and shows images as shown in the above image.
The same thing I want to done with jQuery because I’m using ASP.NET MVC Ajax with jQuery.
Here is the jQuery script through with I get data from MVC via jQuery.
```
<script type="text/javascript">
function GetBook(id) {
var url = '@Url.Content("~//Monthly/CurrentBook?id=")' + id;
$.post(url,
null,
function (book) {
$('#bookResult' + book.ID).html(
'<a href="@Url.Content("~/BookDetails/")' + book.ID + '">Click to View Details</a>'
+ '<div><p style=" text-align:center;">'
+ '<a href="' + monthly.URL + '"><button style="background-image:url(@Url.Content("~/Content/Images/download-pdf.gif")); width:200px; height:70px;" /></a>'
+ '**<!-- Here I want to use jQuery Code for displaying Table of content Images -->**'
+ '</p></div>');
},
'json'
);
}
</script>
```
I used jQuery code like this:
```
$.each(book.TableOfContents.split(','), function(number) {
+ '<li><img src="img-' + number + '.gif" /></li>'
}
```
But it displays result as: "1,2,3,17,90" (in string format instead of displaying images)
In ASP.NET MVC Razor, I can display list of images like this:
```
var splitted = Model.TableOfContents.Split(‘,’);
@foreach(var number in splitted) {
<li><img src=”@Url.Content(“~/Content/Images/img-“ + number + “.gif”)” /> </li>
}
```
[http://alhadith.cz.cc](http://alhadith.cz.cc) (this webite's main page displays list of images with ASP.NET MVC Razor)
| $.each(someData.split(',') => returns concatenated string, instead of array of items | CC BY-SA 2.5 | null | 2010-12-31T09:31:04.987 | 2010-12-31T10:07:01.890 | 2010-12-31T09:45:36.957 | 552,182 | 552,182 | [
"jquery",
"asp.net-mvc",
"json"
]
|
4,569,575 | 1 | 4,569,619 | null | 5 | 432 | For my application I have to use a undefined number of different detection strategies. A strategy is defined in the following fashion:

The AND gate can also be a OR gate. For now, I hard coded all these rules in my code. For better extensability, I'd like to define all the detection startegies respectively rules in a XML file and parse it. But I'm not really sure how I can define such a detection strategy in a XML file. Any hints how to start?
| XML Architecture | CC BY-SA 2.5 | 0 | 2010-12-31T10:38:25.193 | 2010-12-31T14:30:35.153 | null | null | null | [
"c#",
".net",
"xml"
]
|
4,569,754 | 1 | 4,570,618 | null | 0 | 208 | Hey guys, I have this piece of code:
```
while($uno=mysql_fetch_assoc($results)) {
echo '<div class="wcapt"><a class="neutral" href="../images.php?id=' . $uno['id'] . '"><img class="pad" src="'. $uno['thumbs'].'" border="0" /></a><br/><center><p>'.$uno['name'].'</p></center></div>';
}
```
And all the images I link to have exactly the same size. Here's the Mainstyles.css
```
div.wcapt
{
border: 1px solid green;
float: left;
padding: 0;
margin: 3px;
font: 11px/1.4em Arial, sans-serif;
color: gray;
}
img.pad
{
padding: 5px;
}
a.neutral
{
display: inline;
font-weight: normal;
text-transform: none;
background-color: transparent;
color: white;
text-decoration: none;
}
```
The problem is that Firefox adds some extra padding to the first image, and only the first image. And this is really annoying. Here's a screenshot of the page:

| Firefox adding padding to first image in multiple images, although all images have same styling and size | CC BY-SA 2.5 | null | 2010-12-31T11:18:06.840 | 2010-12-31T14:31:23.167 | 2010-12-31T11:19:35.693 | 472,375 | 553,855 | [
"php",
"html",
"css"
]
|
4,569,994 | 1 | 4,570,030 | null | 0 | 2,052 | I am having a datagridview where the content of that datagridview will be from my sample text file. When i click on load i will have the data from sample.txt and that data in that text file is shown in the datagridview. I will have a checkbox column in my datagridview. If the user checks i will select the row and when user clicks delete button i would like to delete that text from the text file.
Suppose my text is as follows

If i click on the check box of first row and click on delete i would like to delete that text from text file
| How to delete the content from text file while deleting from datagridview | CC BY-SA 2.5 | null | 2010-12-31T12:07:03.517 | 2010-12-31T16:09:01.167 | 2010-12-31T16:09:01.167 | 114,664 | 388,388 | [
"c#",
"winforms",
"datagridview",
"text-files"
]
|
4,570,261 | 1 | 4,570,371 | null | 2 | 1,767 | I'm trying to learn WPF and was thinking about creating a simple IRC client. The most complicated part is to create the chat log. I want it to look more or less like the one in mIRC:

or irssi:

The important parts are that the text should be selectable, lines should wrap and it should be able to handle quite large logs.
The alternatives that I can come up with are:
1. StackPanel inside a ScrollViewer where each line is a row
2. ListView, since that seems more suitable for dynamic content/data binding.
3. Create an own control that does the rendering on its own.
Is there any WPF guru out there that has some ideas on which direction to take and where to start?
| WPF (irc) chat log control | CC BY-SA 2.5 | null | 2010-12-31T13:04:30.203 | 2011-09-28T00:39:02.047 | 2010-12-31T13:26:08.330 | 5,380 | 408,952 | [
"c#",
"wpf",
"wpf-controls",
"irc"
]
|
4,570,315 | 1 | null | null | 0 | 443 | In a map, I would like to cluster my results. So far I've only seen cluster tools that further zoom in. What I want is to have a fixed map and, that, if clicked, the cluster will open itself. I tried to visualize what I want to do in the picture below:

Now, does anyone have an idea how to do this? Are there solutions for this already?
Thanks in advance,
Maurice
| clusters in geo mapping | CC BY-SA 2.5 | 0 | 2010-12-31T13:14:05.757 | 2011-06-15T13:57:31.597 | 2010-12-31T13:42:58.280 | 211,116 | 399,163 | [
"javascript",
"dictionary",
"geolocation",
"openlayers"
]
|
4,570,456 | 1 | 4,570,528 | null | 3 | 604 | Who knows what is this widget Twitter application uses? How to create one?

| Twitter UI control | CC BY-SA 2.5 | 0 | 2010-12-31T13:50:14.427 | 2011-01-01T05:22:10.157 | 2010-12-31T15:03:40.693 | 397,991 | 397,991 | [
"android"
]
|
4,570,600 | 1 | 4,570,704 | null | 1 | 1,833 | I am creating an web application for my tae kwon do club.
People are able to register online for a tournament.
After the registration deadline the web application generates a dendrogram. Something like this:

I am wondering now how to draw it.
Because of the fact that there are my weight and age categories i have to draw them dynamicly for each group.
What is the easiest way to draw this inside a MVC view?
| Drawing tree diagram in ASP.Net MVC | CC BY-SA 2.5 | 0 | 2010-12-31T14:28:00.930 | 2013-06-21T19:42:26.367 | 2013-04-01T09:08:10.980 | 727,208 | 535,306 | [
"asp.net-mvc",
"drawing"
]
|
4,570,711 | 1 | 4,571,382 | null | 0 | 285 | When my users log into the website their first name, last name and ID are missing from the session data because my session data is coded to take post data and submit into the session table in my database.
Because user logs in with email and password in my session data only email appears and nothing else does.
How can I make first name, last name and id appear in my session table in my db? I want to some how grab these details from the database when user is logging in and provide it in my $u_data array so it get's posted upload login success.
Here is my code:
```
<?php
class Login_Model extends CI_Model {
public function checkLogin() {
$this->db->where('email', $this->input->post('email')); //compare db email to email entered in form
$this->db->where('password', $this->hashed()); //compare db password to hashed user password
$query = $this->db->get('users'); //get the above info from 'user' table
if ($query->num_rows() == 1) { //if number of rows returned is 1
$u_data = array( //new variable with session data
'user_id' => $this->db->insert_id(),
'email' => $this->input->post('email'),
'first_name' => $this->input->post('first_name'),
'last_name' => $this->input->post('last_name'),
'logged_in' => TRUE
);
$this->session->set_userdata($u_data); //send data from variable to db session
return TRUE;
} else {
return FALSE;
}
}
public function hashed() { //hashing method
// sha1 and salt password
$password = $this->encrypt->sha1($this->input->post('password')); //encrypt user password
$salt = $this->config->item('encryption_key'); //grab static salt from config file
$start_hash = sha1($salt . $password);
$end_hash = sha1($password . $salt);
$hashed = sha1($start_hash . $password . $end_hash);
return $hashed;
}
}
```

| How to post non-post data into session when user logs in | CC BY-SA 2.5 | null | 2010-12-31T14:53:07.983 | 2011-01-05T18:26:43.030 | 2010-12-31T16:03:00.983 | 439,688 | 439,688 | [
"php",
"mysql",
"class",
"codeigniter",
"methods"
]
|
4,571,032 | 1 | 4,571,557 | null | 4 | 2,844 | Consider the following piece of Xaml
```
<Grid Background="Blue">
<Border Width="100" Height="60" BorderBrush="Black" BorderThickness="2">
<Border Background="Red">
<Border.OpacityMask>
<VisualBrush>
<VisualBrush.Visual>
<TextBlock Text="Text"
Foreground="#FF000000"
Background="#00000000"/>
</VisualBrush.Visual>
</VisualBrush>
</Border.OpacityMask>
</Border>
</Border>
</Grid>
```
It will look like this because of the OpacityMask whos only non-transparent part is the Foreground of the TextBlock.

Now if I switch the Colors for Foreground and Background in the TextBlock like this
```
<TextBlock Text="Text"
Foreground="#00000000"
Background="#FF000000"/>
```
I get this because the even though the Foreground is transparent the Background behind it is not, resulting in a useless OpacityMask :)

Is there anyway I can get this? Basically an inverted OpacityMask

Am I missing some other way to do this here?
To clarify, even though my example is about a TextBlock, it could be anything. Ellipse/Image/Path etc. The feature I'm after is "Invert OpacityMask"
| Invert OpacityMask | CC BY-SA 3.0 | null | 2010-12-31T16:01:30.033 | 2011-08-30T05:58:04.927 | 2011-08-30T05:58:04.927 | 318,425 | 318,425 | [
"wpf",
"xaml",
"border",
"textblock",
"opacitymask"
]
|
4,571,508 | 1 | 4,571,689 | null | 2 | 1,017 | I'm trying out the EF 4.0 and using the Model first approach. I'd like to store images into the database and I'm not sure of the best type for the scalar in the entity.
I currently have it(the image scalar type) setup as a binary. From what I have been reading the best way to store the image in the db is a byte[]. So I'm assuming that binary is the way to go. If there is a better way I'd switch.

In my controller I have:
```
//file from client to store in the db
HttpPostedFileBase file = Request.Files[inputTagName];
if (file.ContentLength > 0)
{
keyToAdd.Image = new byte[file.ContentLength];
file.InputStream.Write(keyToAdd.Image, 0, file.ContentLength);
}
```
This builds fine but when I run it I get an exception writing the stream to keyToAdd.Image.
The exception is something like: Method does not exist.
Any ideas?
Note that when using a EF 4.0 model first approach I only have int16, int32, double, string, decimal, binary, byte, DateTime, Double, Single, and SByte as available types.
Thanks
| How to store an image in a db using EF 4.0 with the Model first approach. MVC2 | CC BY-SA 2.5 | 0 | 2010-12-31T17:47:56.440 | 2010-12-31T18:28:18.603 | 2010-12-31T18:03:29.403 | 7,617 | 7,617 | [
"database",
"image",
"entity-framework",
"types",
"filestream"
]
|
4,572,024 | 1 | null | null | 0 | 171 | I have the following directory structure:

I wrote the includes:
```
#include "obj.h"
#include "textura.h"
```
Yet, I'm getting:
```
fatal error C1083: Cannot open include file: 'obj.h': No such file or directory.
```
Why?
I tried previously to move the files to "header files", it didn't work, same error.
| Why can't I include this .h? | CC BY-SA 2.5 | null | 2010-12-31T19:48:00.020 | 2010-12-31T20:16:17.487 | 2010-12-31T20:16:17.487 | 45,963 | 45,963 | [
"c++",
"visual-studio-2008"
]
|
4,572,183 | 1 | 4,572,266 | null | 37 | 3,885 | I randomly plotted a Sin[x] function in Mathematica 7 and this is what it shows:

Note the visible defect at approximately `x = -100`.
Here is a zoom of the defect part, clearly showing that Mathematica for some reason uses a much lower resolution between the points there:

Anybody know why this happens and why only at `x = -100`?
Note: same happens in [Wolfram Alpha](http://www.wolframalpha.com/input/?i=sin%28x%29%20from%20-42pi%20to%2042pi), by the way.
| Strange Sin[x] graph in Mathematica | CC BY-SA 3.0 | 0 | 2010-12-31T20:29:54.807 | 2017-08-31T07:36:04.720 | 2012-07-23T03:00:46.937 | 363,078 | 363,078 | [
"wolfram-mathematica"
]
|
4,572,315 | 1 | 4,582,877 | null | 2 | 5,183 | I have seen many times on Java Swing GUIs buttons that look like images until the mouse rolls over them. They appear to not have their content area filled. When the mouse rolls over them, the content area fills in but the button looks as though the mouse is not hovering over it. An example of this would be the toolbar of buttons used to activate each demo in SwingSet2.
How is this effect possible?
Here are images that illustrate my question:



These are using the Window Look&Feel on Vista. The images were captured from the SwingSet2 demo toolbar.
Thanks!
| Creating an invisible button in Java Swing | CC BY-SA 2.5 | null | 2010-12-31T21:09:48.693 | 2013-03-16T10:42:36.750 | 2011-01-01T17:09:28.757 | 464,886 | 464,886 | [
"java",
"user-interface",
"swing",
"button"
]
|
4,572,431 | 1 | 4,572,702 | null | 5 | 14,575 | How to draw a circle in (100px top and 100px left) of img using php ?
Image URL : `image.jpg`
I want to load the img then draw a circle on the orginal content of it
Before :

After :

| How to draw a circle in img using php? | CC BY-SA 2.5 | 0 | 2010-12-31T21:39:43.807 | 2015-05-31T19:01:26.423 | 2010-12-31T21:49:19.797 | 423,903 | 423,903 | [
"php",
"gd"
]
|
4,572,631 | 1 | 4,577,865 | null | 14 | 4,310 | I'm styling the items in a WPF `ListBox`, and want to put a border around each item. With `BorderThickness` set to 1, for example, the top-bottom borders between adjacent items are both drawn and therefore appear "thicker" than the side borders, as shown:

The item template that produces these `ListBoxItems` is:
```
<DataTemplate>
<Border BorderThickness="1" BorderBrush="DarkSlateGray" Background="DimGray" Padding="8 4 8 4">
<TextBlock Text="{Binding Name}" FontSize="16"/>
</Border>
</DataTemplate>
```
I'd like to "collapse" these adjacent borders, as one could, for example, [through CSS](http://htmldog.com/reference/cssproperties/border-collapse/). I'm aware that `BorderThickness` can be defined separately for the left/right/top/bottom borders, but this affects the border of the first or last item, as well, which is not desired.
Is there a way to accomplish this with WPF? A property of `Border` I'm missing, or does it require a different approach to creating borders?
| Is it possible to emulate border-collapse (ala CSS) in a WPF ItemsControl? | CC BY-SA 2.5 | 0 | 2010-12-31T22:58:24.597 | 2011-01-02T09:37:43.787 | null | null | 238,688 | [
"wpf",
"wpf-controls",
"border"
]
|
4,572,866 | 1 | 4,572,875 | null | 3 | 747 | Basically what I want to do is illustrated here:

I start with A and B, then B is conformed to A to create C.
The idea is, given TLBR rectangles A, B, make C
I also need to know if it produces an empty rectangle (B outside of A case).
I tried this but it just isn't doing what I want:
```
if(clipRect.getLeft() > rect.getLeft())
L = clipRect.getLeft();
else
L = rect.getLeft();
if(clipRect.getRight() < rect.getRight())
R = clipRect.getRight();
else
R = rect.getRight();
if(clipRect.getBottom() > rect.getBottom())
B = clipRect.getBottom();
else
B = rect.getBottom();
if(clipRect.getTop() < rect.getTop())
T = clipRect.getTop();
else
T = rect.getTop();
if(L < R && B < T)
{
clipRect = AguiRectangle(0,0,0,0);
}
else
{
clipRect = AguiRectangle::fromTLBR(T,L,B,R);
}
```
Thanks
| Algorithm for finding a rectangle constrained to its parent | CC BY-SA 2.5 | 0 | 2011-01-01T01:07:25.973 | 2011-01-01T01:41:25.463 | 2011-01-01T01:14:23.610 | 146,780 | 146,780 | [
"c++",
"clipping"
]
|
4,572,895 | 1 | 4,572,941 | null | 2 | 533 | OK, I am mostly a LAMP developer so I am new to the entity framework. However, I am familiar with the basics in LINQ and have generated a entity model from my DB. Now here is my requirement:
I have a datagrid on a WinForm that will be refreshed from a data source on a remote server every few seconds as changes to the dataset are made from other sources. Obviously, I'd like to construct a lambda expression to get the right anonymous type to satisfy the columns that needs to be shown in my datagrid. I have done this and here is the result (I'm using a custom datagrid control, btw):

And my code thus far:
```
Models.dataEntities objDB = new Models.dataEntities();
var vans = from v in objDB.vans
select v;
gcVans.DataSource = vans;
```
OK, so now I have my basic data set. One problem I had is that the "Status" column will show a calculated string based on several parameters in the data set. I added this to my entities via a partial class. As you can see in the screenshot, this is working correctly:
```
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace WindowsFormsApplication1.Models {
public partial class van {
public string van_status {
get {
if (this.is_offline == 1) {
return "Offline";
} else if (this.is_prayer_room == 1) {
return "In Prayer Room";
} else {
return "TODO: Create statuses";
}
}
}
}
}
```
This added property works fine. However, the second I try to project the status in an anonymous type so I can also retrieve the school name, I get an error:
```
Models.dataEntities objDB = new Models.dataEntities();
var vans = from v in objDB.vans
select new {
van_name = v.van_name,
school_name = v.school.school_name,
capacity = v.capacity,
phone = v.phone,
van_status = v.van_status
};
gcVans.DataSource = vans;
```

So, I have two questions:
1) If I cannot use computed properties of my partial classes in LINQ projections, how am I supposed to show my computed string in my datagrid?
2) Am I even approaching this correctly? When I resolve #1, how would I refresh this data (ie during a timer fire event)? Would I simply call `objDB.refresh()` and then tell my datagrid to update from the datasource? Does calling that method actually run the lambda expression above or does it load everything from the DB?
Thanks for any assistance with this. Also, if you have any best practices to share that would be awesome! I hope I explained this as thoroughly as you need to provide assistance.
| LINQ to Entities - Best way to accomplish this? | CC BY-SA 2.5 | 0 | 2011-01-01T01:23:40.153 | 2011-01-01T02:16:53.147 | 2011-01-01T01:31:16.223 | 277,757 | 277,757 | [
"c#",
"linq",
"linq-to-sql",
"linq-to-entities"
]
|
4,573,176 | 1 | 4,576,491 | null | 0 | 139 | look what's happened. One time it works nice but another time happen this:

Why? How can I solve?
EDIT: 
| iPhone tabbar strange problem | CC BY-SA 2.5 | null | 2011-01-01T04:28:28.100 | 2011-01-02T00:21:23.320 | 2011-01-01T22:17:24.500 | 545,004 | 545,004 | [
"iphone",
"tabbar"
]
|
4,573,483 | 1 | 4,573,532 | null | 47 | 61,548 | I remember seeing someone use a shortcut in NetBeans to open a dialog similar to phpStrom that can open files based on class names or is it file name. whats that?

| Netbeans Shortcut to Open File | CC BY-SA 2.5 | 0 | 2011-01-01T07:44:17.597 | 2020-04-19T12:50:43.003 | 2011-01-01T10:28:37.800 | 30,453 | 292,291 | [
"netbeans",
"keyboard-shortcuts",
"screenshot",
"openfiledialog",
"classname"
]
|
4,573,527 | 1 | 4,575,879 | null | 1 | 2,139 | We have an app written in C++ 6 that fills in blank polygons on a traffic map to show current traffic conditions. Green for good, yellow more congested, etc.
The "shell maps" are bitmaps of the roadways using rectangles and polygons that have nothing filled in them. Data is collected from roadway sensors (wire inductor loops) and the polygons are filled based on loop detector data.
When the maps change, someone has to manually zoom in the bitmap in paint, and get the coordinates around the inside of each new shape, where the congestion color will be filled in. The polygons that make the map skeleton are all drawn in navy blue, on a white background.
I made an app. where when the user clicks anywhere inside the white part of the polygon, the points for the inside perimeter are displayed to the user, with a zoomed in thumbnail showing the inside permiter painted.
In .Net, the perimeter is painted perfectly.
In the C++ 6 app, some of the polyon points my app. collects don't display correctly.
I looked at msPaint, and .Net does not draw the points the same way as MS Paint.
Here's a quick example. Code is from one form with one button and one label. A line is drawn on a bitmap, the bitmap is "zoomed in" so you can see it, and displayed on the label.
The line segment drawn is not the same as the line segment that you draw in MS Paint if you draw a line in Paint using the same two points.
```
private void button1_Click(object sender, EventArgs e)
{
Bitmap bm = new Bitmap(16, 16);
Graphics g = Graphics.FromImage(bm);
//g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.Half;
//g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality;
//g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighSpeed;
//g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.None;
g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.Default;
Point pt = new Point(1, 3);
Point pt2 = new Point(5, 1);
// If you reverse the points, the same line is drawn.
g.DrawLine(Pens.Orange, pt, pt2);
// label1.Image = bm;
Bitmap bm2 = ZoomMap(8, bm);
g.Dispose();
bm.Dispose();
label1.Image = bm2;
}
private Bitmap ZoomMap(int zoomValue, Bitmap bm)
{
Bitmap zoomedBitMap;
Size sz = bm.Size;// new Size(75, 75);
Size newSize = new Size(sz.Width * zoomValue, sz.Height * zoomValue);
zoomedBitMap = new Bitmap(newSize.Width, newSize.Height);
Graphics gr = Graphics.FromImage(zoomedBitMap);
gr.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
gr.PageUnit = GraphicsUnit.Pixel;
gr.DrawImage(bm, 1, 1, newSize.Width, newSize.Height);
gr.Dispose();
return zoomedBitMap;
}
```

No matter what settings I apply, there is no way to mimic MS Paint in C#, but in C++ 6 mimics MS Paint perfectly.
Is there any type of windows API I can call to draw on an existing bitmap?
Thanks in advance for any replies.
| Can't use GDI+. Can a line be drawn on a bitmap using Windows API call? | CC BY-SA 2.5 | null | 2011-01-01T08:13:56.130 | 2011-01-01T22:07:23.573 | null | null | 320,881 | [
"c#",
"bitmap",
"bitmapdata"
]
|
4,573,680 | 1 | 4,573,691 | null | 4 | 8,109 | According to the blog post here [Data Annotations in the Entity Framework](http://blogs.msdn.com/b/efdesign/archive/2010/03/30/data-annotations-in-the-entity-framework-and-code-first.aspx) there should be an attribute for a column called "Key" which allows you to mark the primary key of an entity. However I cannot locate this in .Net 3.5 or .Net 4.0.
What have I missed? I've included the reference to EntityFramework.dll and I've checked all the attributes under `System.ComponentModel.DataAnnotations` but I cannot locate it.

I have set my project to .Net 4.0 full (not client profile).
Any ideas?
| There is no Key attribute in EF CTP 5 | CC BY-SA 2.5 | 0 | 2011-01-01T09:35:31.770 | 2011-06-30T12:24:05.263 | 2011-04-29T20:53:45.657 | 73,986 | 53,771 | [
"c#",
".net",
"entity-framework-ctp5"
]
|
4,574,461 | 1 | 4,574,590 | null | 1 | 281 | Anyone know what is the name (if exist) of the control used for display the properties?

Apparently it is some modified list object but i wish to know if exist a control that do it.
Thanks.
| Vb6: name of the activex control | CC BY-SA 2.5 | null | 2011-01-01T15:11:22.153 | 2011-01-01T15:56:55.170 | null | null | 202,705 | [
"vb6",
"activex"
]
|
4,574,586 | 1 | 4,594,949 | null | 0 | 1,389 | I have a transparent image which ("hold_empty.png", below) which I want to turn into a button. Inside the button there will be a view with a colored background which is slightly smaller size than the actual image to hold the background color.
The reason for this is because the image has rounded corners and so I cannot simply put a background color on the image as it will appear to be bigger than the image.

The image is a transparent square with "rounded corners". The effect I am trying to create should be like layers.
1. Background color layer (red, green, etc)
2. The "hold_empty.png" picture (above)
3. The whole object (including bg color layer) should be clickable.
The problem I am experiencing is that only the image (and its borders) appears to be clickable, and not the whole object.
The code follows below.
```
// x,y,w,h
CGRect frame = CGRectMake(10, 10, 72, 72);
CGRect frame2 = CGRectMake(5, 5, 60, 60); // I know this is not filling the image, its just a test
UIView *bgColorView = [[UIView alloc] initWithFrame:frame2];
[bgColorView setFrame:frame2];
bgColorView.backgroundColor = [UIColor redColor];
UIImage *image = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"hold_empty" ofType:@"png"]];
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
[btn addSubview:bgColorView];
[btn setImage:image forState:UIControlStateNormal];
btn.frame = frame;
[btn addTarget:self action:@selector(btnSelectColor:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:btn];
[bgColorView release];
```
So, to summarize: How do I make a transparent image button with a background color clickable?
Thanks.
| Making a Transparent image button with bgcolor | CC BY-SA 2.5 | null | 2011-01-01T15:54:59.943 | 2011-01-14T06:13:20.117 | 2011-01-02T04:23:18.383 | 315,635 | 315,635 | [
"iphone",
"uiimage",
"uibutton",
"transparency",
"background-color"
]
|
4,574,712 | 1 | 4,574,808 | null | 0 | 1,992 | I have a small [card game](http://apps.facebook.com/video-preferans/) at Facebook (and few Russian social networks), which gets user's id, first name and avatar through the old REST API.
Now I'm trying to develop the same game as a mobile app with Hero SDK for Android and iPhone. Which means I can't use native SDKs for those platforms, but have to use [OAuth as descibed at Facebook page](http://developers.facebook.com/docs/guides/mobile).

I'm trying to write a short PHP script, which would return the user information as XML to my mobile app. My script can get the token already:
```
<?php
define('FB_API_ID', 'XXX');
define('FB_AUTH_SECRET', 'XXX');
$code = @$_GET['code'];
# this is just a link for me, for development puposes
if (!isset($code)) {
$str = 'https://graph.facebook.com/oauth/authorize?client_id=' . FB_API_ID .
'&redirect_uri=http://preferans.de/facebook/mobile.php&display=touch';
print "<html><body><a href=\"$str\">$str</a></body></html>";
exit();
}
$req = 'https://graph.facebook.com/oauth/access_token?client_id=' . FB_API_ID .
'&redirect_uri=http://preferans.de/facebook/mobile.php&client_secret=' . FB_AUTH_SECRET .
'&code=' . $code;
$ch = curl_init($req);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$page = curl_exec($ch);
if (curl_errno($ch))
exit('Download failed');
curl_close($ch);
parse_str($page, $data);
#header('Content-Type: text/xml; charset=utf-8');
#print('<?xml version="1.0"? ><app>');
print_r($data);
#print('</app>');
?>
```
This works well and I get back the token:
```
Array
(
[access_token] => 262578703638|2.OwBuoa2fT5Zp_yo2hFUadA__.3600.1294904800-587287941|ycUNaHVxa_8mvenB9JB1FH3DcAA
[expires] => 6697
)
```
But how can I use this token now to find the user's name and avatar and especially I'm confused by how will I get the current user id?
While using REST API I've always known the current user id by calling `$userid=$fb->require_login()`
| Using Facebook Graph API from a mobile application | CC BY-SA 3.0 | 0 | 2011-01-01T16:33:37.100 | 2014-04-10T12:27:11.550 | 2014-04-10T12:27:11.550 | 165,071 | 165,071 | [
"facebook",
"facebook-graph-api",
"oauth-2.0"
]
|
4,574,771 | 1 | 4,574,839 | null | 4 | 1,359 | Please copy and run following script
```
DECLARE @Customers TABLE (CustomerId INT)
DECLARE @Orders TABLE ( OrderId INT, CustomerId INT, OrderDate DATETIME )
DECLARE @Calls TABLE (CallId INT, CallTime DATETIME, CallToId INT, OrderId INT)
-----------------------------------------------------------------
INSERT INTO @Customers SELECT 1
INSERT INTO @Customers SELECT 2
INSERT INTO @Customers SELECT 3
-----------------------------------------------------------------
INSERT INTO @Orders SELECT 10, 1, DATEADD(d, -20, GETDATE())
INSERT INTO @Orders SELECT 11, 1, DATEADD(d, -10, GETDATE())
INSERT INTO @Orders SELECT 12, 2, DATEADD(d, -8, GETDATE())
INSERT INTO @Orders SELECT 13, 2, DATEADD(d, -6, GETDATE())
INSERT INTO @Orders SELECT 14, 3, DATEADD(d, -4, GETDATE())
-----------------------------------------------------------------
INSERT INTO @Calls SELECT 101, DATEADD(d, -19, GETDATE()), 1, NULL
INSERT INTO @Calls SELECT 102, DATEADD(d, -17, GETDATE()), 1, NULL
INSERT INTO @Calls SELECT 103, DATEADD(d, -9, GETDATE()), 1, NULL
INSERT INTO @Calls SELECT 104, DATEADD(d, -6, GETDATE()), 1, NULL
INSERT INTO @Calls SELECT 105, DATEADD(d, -5, GETDATE()), 1, NULL
INSERT INTO @Calls SELECT 106, DATEADD(d, -4, GETDATE()), 2, NULL
INSERT INTO @Calls SELECT 107, DATEADD(d, -2, GETDATE()), 2, NULL
INSERT INTO @Calls SELECT 108, DATEADD(d, -2, GETDATE()), 3, NULL
```
I want to update @Calls table and need following results.

I am using the following query (Old query before answer)
```
UPDATE @Calls
SET OrderId = (
CASE
WHEN (s.CallTime > e.OrderDate)
THEN e.OrderId
END
)
FROM @Calls s INNER JOIN @Orders e ON s.CallToId = e.CustomerId
```
Now I am using this query
```
UPDATE c set OrderID = o1.OrderID
from @Calls c inner join @Orders o1 on c.CallTime > o1.OrderDate
left join @Orders o2 on c.CallTime > o2.OrderDate
and o2.OrderDate > o1.OrderDate
where o2.OrderID is null
and o1.CustomerId = c.CallToId
```
and the result of my query is not what I need.
Requirement:
As you can see there are two orders. One is on `2010-12-12` and one is on `2010-12-22`. I want to update `@Calls` table with relevant OrderId with respect to CallTime.
This is sample data so this is not the case that I always have two Orders. There might be 10+ Orders and 100+ calls and 1000s of Customers.
I could not find good title for this question. Please change it if you think of any better.
The query provided in answer is taking too much time. Total number of records to update is around 250000.
Thanks.
| Update table without using cursor and on date | CC BY-SA 2.5 | 0 | 2011-01-01T16:49:01.223 | 2011-01-04T11:07:17.823 | 2011-01-04T10:52:31.073 | 77,674 | 77,674 | [
"sql",
"sql-server",
"sql-server-2005",
"tsql",
"sql-server-2008"
]
|
4,574,868 | 1 | 4,600,736 | null | 144 | 70,712 | I have a product with a straightforward REST API so that users of the product can directly integrate with the product's features without using my web user interface.
Recently I have been getting interest from various third parties about integrating their desktop clients with the API to allow users of my product to access their data using that third party application.
I've seen that applications that want to use Twitter authenticate using a login page hosted by Twitter that grants a specific application permission to access that user's data. You click the "Allow" or "Deny" button and the authentication process is complete. Facebook uses the same mechanism as best I can tell.
Upon further research, this seems to be OAuth in action, and seeing as my API is .Net-based, I am thinking I should use DotNetOpenAuth and provide a similar mechanism. Unfortunately the samples are sparsely documented (if at all) and the only tutorials I can find online seem to be focussed on helping you provide a login mechanism for your users so that they can log into your website using a third party provider.
What I would like to do is have my REST API handle all of the core authentication and business logic for my web application and have, under the hood, my web application essentially be another application that just uses the API via OAuth. Users would authenticate on the website either directly using their username and password, or via a third party provider such as MyOpenID or Facebook and then the website would somehow use the returned token to authenticate against the REST API.

It basically looks like I need my API to somehow host an OAuth service, but also have users use a third party OAuth service. I can't help but think I don't quite have enough of a grasp on OAuth to decide if I'm overcomplicating things or if what I'm trying to do is a good or bad way to do things.
Can someone give me at least a broad overview of the steps I need to undertake, or what I should look at to make this happen? Or point me at some tutorials? Or blast my proposal and tell me I'm going about this (architecturally) all wrong?
| Securing my REST API with OAuth while still allowing authentication via third party OAuth providers (using DotNetOpenAuth) | CC BY-SA 2.5 | 0 | 2011-01-01T17:17:34.790 | 2021-04-01T13:32:25.917 | 2021-04-01T13:32:25.917 | 9,213,345 | 98,389 | [
"oauth",
"openid",
"dotnetopenauth",
"rest"
]
|
4,575,164 | 1 | 4,575,212 | null | 2 | 1,075 | On my web-site [http://vfm-elita.com](http://vfm-elita.com) (it is not in English, sorry for that) - center and right columns are overlapping, please see screenshot for details:

Between left and center columns you can see a "gap" with a green background - it is expected and good.
But there are no any gap between center and right columns, instead they are overlapping.
Issue exists in all known browsers
There are no special formatting applied to columns. They are usual 'TD' columns, the only CSS modifier is width that is "250px" for left and right columns, and for center - it is "auto".
Please advise how can I correct that error.
Thanks a lot!
| CSS+HTML: tds are overlapping | CC BY-SA 2.5 | 0 | 2011-01-01T18:34:14.627 | 2011-01-01T18:46:30.650 | null | null | 159,179 | [
"html",
"css"
]
|
4,575,155 | 1 | 4,575,420 | null | 11 | 15,657 | I have a TableLayout with a button at the bottom. My problem is that the button stretches to fill the entire width of the column even though I don't want it that wide.

The XML looks like this:
```
<?xml version="1.0" encoding="utf-8"?>
<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:stretchColumns="*"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TableRow android:layout_height="wrap_content"
android:layout_width="fill_parent">
<CheckBox android:id="@+id/check1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Some text 1"/>
<CheckBox android:id="@+id/check2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Some text 1"/>
</TableRow>
<TableRow android:layout_height="wrap_content"
android:layout_width="fill_parent">
<CheckBox android:id="@+id/check3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Even some more text 2"/>
<CheckBox android:id="@+id/check4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Even some more text 2"/>
</TableRow>
<TableRow android:layout_height="wrap_content"
android:layout_width="fill_parent">
<CheckBox android:id="@+id/check5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="An even longer line of text 3"/>
<CheckBox android:id="@+id/check6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Another longer line of text 3"/>
</TableRow>
<EditText
android:id="@+id/myEditText1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textMultiLine"
android:singleLine="false"
android:text="Enter some text"
/>
<TableRow>
<Button android:id="@+id/SaveButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Save">
</Button>
</TableRow>
</TableLayout>
```
Even if I set an explicit width to the button it ignores it. For example if I have:
```
<Button android:id="@+id/SaveButton"
android:layout_width="100sp"
android:layout_height="100sp"
android:text="Save">
</Button>
```
... the button gets taller but the width still stretches to fill the column.
I'd like the button to be about half its current width, centered in the column.
| Button width in Android TableLayout | CC BY-SA 2.5 | 0 | 2011-01-01T18:33:07.420 | 2011-01-01T21:05:33.047 | null | null | 424,690 | [
"android"
]
|
4,575,230 | 1 | 4,579,547 | null | 4 | 1,138 | I'm using SQL Server 2008. I have a table with over 3 million records, which is related to another table with a million records.
I have spent a few days experimenting with different ways of querying these tables. I have it down to two radically different queries, both of which take 6s to execute on my laptop.
The first query uses a brute force method of evaluating matches, and removes incorrect matches via aggregate summation calculations.
The second gets all possibly likely matches, then removes incorrect matches via an EXCEPT query that uses two dedicated indexes to find the low and high mismatches.
Logically, one would expect the brute force to be slow and the indexes one to be fast. Not so. And I have experimented heavily with indexes until I got the best speed.
Further, the brute force query doesn't require as many indexes, which means that technically it would yield better overall system performance.
Below are the two execution plans. If you can't see them, please let me know and I'll re-post then in landscape orientation / mail them to you.
Brute-force query:
```
SELECT ProductID, [Rank]
FROM (
SELECT p.ProductID, ptr.[Rank], SUM(CASE
WHEN p.ParamLo < si.LowMin OR
p.ParamHi > si.HiMax THEN 1
ELSE 0
END) AS Fail
FROM dbo.SearchItemsGet(@SearchID, NULL) AS si
JOIN dbo.ProductDefs AS pd
ON pd.ParamTypeID = si.ParamTypeID
JOIN dbo.Params AS p
ON p.ProductDefID = pd.ProductDefID
JOIN dbo.ProductTypesResultsGet(@SearchID) AS ptr
ON ptr.ProductTypeID = pd.ProductTypeID
WHERE si.Mode IN (1, 2)
GROUP BY p.ProductID, ptr.[Rank]
) AS t
WHERE t.Fail = 0
```

Index-based exception query:
```
with si AS (
SELECT DISTINCT pd.ProductDefID, si.LowMin, si.HiMax
FROM dbo.SearchItemsGet(@SearchID, NULL) AS si
JOIN dbo.ProductDefs AS pd
ON pd.ParamTypeID = si.ParamTypeID
JOIN dbo.ProductTypesResultsGet(@SearchID) AS ptr
ON ptr.ProductTypeID = pd.ProductTypeID
WHERE si.Mode IN (1, 2)
)
SELECT p.ProductID
FROM dbo.Params AS p
JOIN si
ON si.ProductDefID = p.ProductDefID
EXCEPT
SELECT p.ProductID
FROM dbo.Params AS p
JOIN si
ON si.ProductDefID = p.ProductDefID
WHERE p.ParamLo < si.LowMin OR p.ParamHi > si.HiMax
```

My question is, based on the execution plans, which one look more efficient? I realize that thing may change as my data grows.
I have updated the indexes, and now have the following execution plan for the second query:

| Two radically different queries against 4 mil records execute in the same time - one uses brute force | CC BY-SA 2.5 | null | 2011-01-01T18:50:58.130 | 2016-01-23T08:25:18.903 | 2011-01-01T20:02:59.443 | 401,584 | 401,584 | [
"sql-server",
"sql-server-2008",
"performance",
"sql-execution-plan"
]
|
4,575,435 | 1 | null | null | -6 | 4,914 | I have this polar function:
`r = A / log(B * tan(t / 2 * N)`
where A, B, N are arbitrary parameters and t is the angle theta in the polar coordinate system.
Example graph for `A=8, B=0.5, N=4`

How can I plot this function onto a Cartesian coordinate grid so I get an image like the one above?
thanks
| How to plot polar function onto cartesian grid? | CC BY-SA 3.0 | 0 | 2011-01-01T19:41:32.217 | 2012-12-25T12:34:43.137 | 2012-12-25T12:34:43.137 | 1,379,664 | 397,707 | [
"java",
"math",
"graph",
"coordinate-systems"
]
|
4,575,475 | 1 | null | null | 5 | 1,602 | If we suppose that every fingerprint is made of concentric curves (ellipses or circles) - and I'm aware of the fact that not fingerprint is - how can I
Let's take this "ideal" fingerprint and try to find out its center ...

My approaches were to try:
- -
While these methods work to the some extant, with some additional filtering, they fail, when fingerprint is "not ideal as this one is". Can you think of any different approach? Are there standard ways to do it?
I really like Zack's idea now, and would like for someone to make it a bit more clear how to do it...
I wished someone had expounded on Zack's idea a bit more. Bounty given to Zack.
Fingerprint with center of curves that approximate ridges outside of fingerprint.

| Finding center of fingerprints | CC BY-SA 3.0 | null | 2011-01-01T19:50:34.970 | 2016-05-31T11:21:32.527 | 2013-10-22T17:53:35.690 | 321,731 | null | [
"image-processing",
"signal-processing",
"fingerprint",
"biometrics"
]
|
4,576,493 | 1 | 4,576,721 | null | 25 | 30,394 | The Android game [My Paper Plane](http://www.appbrain.com/app/my-paper-plane-2-%283d%29/com.wavecade.mypaperplane_x) is a great example of how to implement tilt controls, but I've been struggling to understand how I can do something similar.
I have the following example that uses [getOrientation()](http://developer.android.com/reference/android/hardware/SensorManager.html) from the SensorManager. The whole thing is on [pastebin here](http://pastebin.com/c1MNT5x7). It just prints the orientation values to text fields. Here is the most relevant snippet:
```
private void computeOrientation() {
if (SensorManager.getRotationMatrix(m_rotationMatrix, null,
m_lastMagFields, m_lastAccels)) {
SensorManager.getOrientation(m_rotationMatrix, m_orientation);
/* 1 radian = 57.2957795 degrees */
/* [0] : yaw, rotation around z axis
* [1] : pitch, rotation around x axis
* [2] : roll, rotation around y axis */
float yaw = m_orientation[0] * 57.2957795f;
float pitch = m_orientation[1] * 57.2957795f;
float roll = m_orientation[2] * 57.2957795f;
/* append returns an average of the last 10 values */
m_lastYaw = m_filters[0].append(yaw);
m_lastPitch = m_filters[1].append(pitch);
m_lastRoll = m_filters[2].append(roll);
TextView rt = (TextView) findViewById(R.id.roll);
TextView pt = (TextView) findViewById(R.id.pitch);
TextView yt = (TextView) findViewById(R.id.yaw);
yt.setText("azi z: " + m_lastYaw);
pt.setText("pitch x: " + m_lastPitch);
rt.setText("roll y: " + m_lastRoll);
}
}
```
The problem is that the values this spits out look like nonsense, or at least there's no way to isolate which type of motion the user performed. I've drawn a diagram to indicate the 2 types of motion that I'd like to detect - 1. "tilt" for pitch and 2. "rotate" for roll/steering:

(That's an isometric-ish view of a phone in landscape mode, of course)
When I tilt the phone forwards and backwards along its long axis - shown by 1. - I expected only 1 of the values to change much, but all of them seem to change drastically. Similarly, if I rotate the phone about an imaginary line that comes out of the screen - shown in 2. - I'd hope that only the roll value changes, but all the values change a lot.
The problem is when I calibrate my game - which means recording the current values of the angles x, y and z - I later don't know how to interpret incoming updated angles to say "ok, looks like you have tilted the phone and you want to roll 3 degrees left". It's more like "ok, you've moved the phone and you're a-tiltin' and a-rollin' at the same time", even if the intent was only a roll. Make sense?
Any ideas? I've tried using remapCoordinateSystem to see if changing the axis has any effect. No joy. I think I'm missing something fundamental with this :-(
| How can I use SensorManager.getOrientation for tilt controls like "My Paper Plane"? | CC BY-SA 2.5 | 0 | 2011-01-02T00:21:29.537 | 2011-01-02T01:54:13.490 | null | null | 4,596 | [
"android",
"screen-orientation",
"tilt"
]
|
4,576,560 | 1 | null | null | 0 | 707 | I am using the drag gesture to move elements on a canvas. I am using the pinch gesture to zoom/tranlate the size of the canvas. What I want to do now is move the entire canvas based on the movement of both fingers in a pinch. I know I can do this with the move, but I need that for items on the canvas itself, and sometimes the entire canvas is covered with items that would make it so you could not select the canvas to move it.

Is this possible with the PinchGestureEventArgs?
| Windows Phone 7: Using Pinch Gestures For Pinch and As A Secondary Drag Gesture | CC BY-SA 2.5 | null | 2011-01-02T00:45:00.147 | 2011-05-16T10:51:49.617 | null | null | 1,132,773 | [
"windows-phone-7",
"silverlight-toolkit",
"multi-touch",
"gestures"
]
|
4,576,590 | 1 | null | null | 1 | 485 | I am trying to update some values in a database and after executing a query it will not update the values in the database, only replace it with a blank value.
This is my php code:
```
$sql = 'UPDATE ' . $tbl_name . ' SET `Name` = \'' . $name .'\', `Store` = \'apples\', `URL` = \'apples\', `SKU` = \'apples\', `Price` = \'apples\', `Location` = \'apples\' WHERE CONVERT(`crisss1205_me_com`.`ID` USING utf8) = \'1\' LIMIT 1;';
```
and it doesn't return any errors. The variable is coming from a $_POST
If I print out the query using `echo $sql;` it looks like this:
> UPDATE crisss1205_me_com SET `Name` = 'HelloWorld', `Store` = 'apples', `URL` = 'apples', `SKU` = 'apples', `Price` = 'apples', `Location` = 'apples' WHERE CONVERT(`crisss1205_me_com`.`ID` USING utf8) = '1' LIMIT 1;
But in the database under the "Name" column it shows a blank space.
If I leave the query alone but change `$name = $_POST['name'];` to `$name = "HelloWorld";` it will update the database fine.
What could be the reason why it will not show up from a "POST"?
---
```
<?php
$tbl_name = $_COOKIE['e-mail_ctt'];
require_once('../config.php');
$name = (string)$_POST['name'];
$store = $_POST['store'];
$url = $_POST['url'];
$sku = $_POST['sku'];
$price = $_POST['price'];
$location = $_POST['location'];
$demo = "app";
$sql = "UPDATE " . $tbl_name . " SET Name='" . $name . "', Store='" . $store . "', URL='" . $url . "', SKU='" . $sku . "', Price='" . $price . "', Location='" . $location . $demo . "' WHERE ID='1';";
echo $sql;
mysql_query($sql) or die(mysql_error());
exit ;
?>
```
Browser Source code:
```
UPDATE crisss1205_me_com SET Name='Mac', Store='mac', URL='mac', SKU='mac', Price='mac', Location='Online Store Onlyapp' WHERE ID='1';
```
Database:

| After MySQL Query, row shows blank values | CC BY-SA 2.5 | null | 2011-01-02T00:57:44.843 | 2011-05-07T01:56:20.507 | 2011-05-07T01:56:20.507 | 135,152 | 441,870 | [
"php",
"mysql",
"sql"
]
|
4,576,709 | 1 | 4,579,880 | null | 4 | 1,366 | I have created a very basic wpf application that I want to use to record time entries against different projects.
I havent used mvvm for this as I think its an overkill.
I have a form that contains a combobox and a listbox. I have created a basic entity model like this

What I am trying to do is bind the combobox to Project and whenever I select an item from the combobox it updates the listview with the available tasks associated with that project.
This is my xaml so far. I dont have any code behind as I have simply clicked on that Data menu and then datasources and dragged and dropped the items over. The application loads ok and the combobox is been populated however nothing is displaying in the listbox.
Can anyone tell me what I have missed?
```
<Window.Resources>
<CollectionViewSource x:Key="tasksViewSource" d:DesignSource="{d:DesignInstance l:Task, CreateList=True}" />
<CollectionViewSource x:Key="projectsViewSource" d:DesignSource="{d:DesignInstance l:Project, CreateList=True}" />
</Window.Resources>
<Grid DataContext="{StaticResource tasksViewSource}">
<l:NotificationAreaIcon
Text="Time Management"
Icon="Resources\NotificationAreaIcon.ico"
MouseDoubleClick="OnNotificationAreaIconDoubleClick">
<l:NotificationAreaIcon.MenuItems>
<forms:MenuItem Text="Open" Click="OnMenuItemOpenClick" DefaultItem="True" />
<forms:MenuItem Text="-" />
<forms:MenuItem Text="Exit" Click="OnMenuItemExitClick" />
</l:NotificationAreaIcon.MenuItems>
</l:NotificationAreaIcon>
<Button Content="Insert" Height="23" HorizontalAlignment="Left" Margin="150,223,0,0" Name="btnInsert" VerticalAlignment="Top" Width="46" Click="btnInsert_Click" />
<ComboBox Height="23" HorizontalAlignment="Left" Margin="70,16,0,0" Name="comProjects" VerticalAlignment="Top" Width="177" DisplayMemberPath="Project1" ItemsSource="{Binding Source={StaticResource projectsViewSource}}" SelectedValuePath="ProjectID" />
<Label Content="Projects" Height="28" HorizontalAlignment="Left" Margin="12,12,0,0" Name="label1" VerticalAlignment="Top" IsEnabled="False" />
<Label Content="Tasks" Height="28" HorizontalAlignment="Left" Margin="16,61,0,0" Name="label2" VerticalAlignment="Top" />
<ListBox Height="112" HorizontalAlignment="Left" Margin="16,87,0,0" Name="lstTasks" VerticalAlignment="Top" Width="231" DisplayMemberPath="Task1" ItemsSource="{Binding Path=ProjectID, Source=comProjects}" SelectedValuePath="TaskID" />
<TextBox Height="23" HorizontalAlignment="Left" Margin="101,224,0,0" Name="txtMinutes" VerticalAlignment="Top" Width="42" />
<Label Content="Mins to Insert" Height="28" HorizontalAlignment="Left" Margin="12,224,0,0" Name="label3" VerticalAlignment="Top" />
<Button Content="None" Height="23" HorizontalAlignment="Left" Margin="203,223,0,0" Name="btnNone" VerticalAlignment="Top" Width="44" />
</Grid>
```
| Binding a wpf listbox to a combobox | CC BY-SA 2.5 | 0 | 2011-01-02T01:48:28.280 | 2011-01-10T16:24:02.777 | null | null | 293,545 | [
"wpf",
"entity-framework-4"
]
|
4,576,969 | 1 | 4,585,791 | null | 0 | 197 | Need help in viewing date.
I'm using jquery-1.4.2.min, json-simple-1.1, gson-1.4
I have a table that is used to save command output executed in scheduled period. The data starts from 08-12-2010 and ends at 02-01-2011.
The table structure is as follows:
```
CREATE TABLE commandoutput (
id bigint(20) NOT NULL AUTO_INCREMENT,
command varchar(255) DEFAULT NULL,
fromHost varchar(255) DEFAULT NULL,
toHost varchar(255) DEFAULT NULL,
executionDate datetime DEFAULT NULL,
passed tinyint(1) DEFAULT NULL,
operator varchar(255) DEFAULT NULL,
cooperationType varchar(255) DEFAULT NULL,
rawOutput text,
country varchar(255) DEFAULT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB AUTO_INCREMENT=169279 DEFAULT CHARSET=latin1;
```
The problem is the data displayed in JSP view is not as expected. The problem didn't happen at the first time I tested this a month ago using sample data. Now using real time data with more than 150.000 records, the view is messed up.
Sample Data:

passed=1, failed=0
JSP View:

I've checked in Firebugs that the response given in json is the data with incorrect date.
I've tested this using IE7, IE8, FF3.6, Chrome8 with same result.
Does anyone have similar problem before? What is the solution?
| incorrect date displayed in JSP view | CC BY-SA 2.5 | null | 2011-01-02T03:27:29.473 | 2011-01-03T15:36:46.453 | 2011-01-02T03:31:06.833 | 334,849 | 555,091 | [
"jquery",
"json",
"jsp",
"gson"
]
|
4,577,380 | 1 | 4,640,752 | null | 8 | 3,733 | My example here, 
Shows an image in the center of CSS3 generated columns. I need the text in the column to the right of the image to wrap around the image so that it doesn't appear in front of the image. This to my understanding is not doable in current css.
Does someone have a NON-OBTRUSIVE way of achieving what I am looking for?
I'd love to achieve this look here,

without the title and misc stuff located in the top left of course. The idea would be to allow the adding of images anywhere in the markup and have it look correctly.
I dont care about browser support at this time, so - any solution is great!
Thanks in advance....
Erik
| CSS3 Columns and Images | CC BY-SA 2.5 | 0 | 2011-01-02T06:10:35.457 | 2012-03-22T07:08:50.200 | null | null | 191,006 | [
"javascript",
"html",
"layout",
"css"
]
|
4,577,656 | 1 | null | null | 0 | 285 | I want to create a ListView with categorized list items.
Same as in the case of Contacts application:
I categorizes according to the Initials.
I would have to create my own adapter thats for sure with some logic.
But can anyone tell me any best practice or a small tutorial to get me started. I have started to learn the default contacts application.
Heres what I want:

| ListView with cateogarized disabled items | CC BY-SA 2.5 | null | 2011-01-02T08:01:22.543 | 2011-01-02T08:30:31.613 | null | null | 514,553 | [
"android",
"listview",
"categories"
]
|
4,577,730 | 1 | 4,578,070 | null | 0 | 181 | I have enabled garbage collection in my Cocoa application.

Why does my application still use a lot of memory. Actually, its not just using a lot of memory, if I leave it running for a few hours it will take up a few gigabytes, which is out of control.

Is there something special that I need to do to make this work?
| cocoa garbage collection doesnt work? | CC BY-SA 2.5 | null | 2011-01-02T08:33:01.253 | 2011-01-02T10:52:53.857 | null | null | 91,414 | [
"cocoa",
"garbage-collection"
]
|
4,577,907 | 1 | 4,579,013 | null | 0 | 2,439 | I'm adding a UIButton to a tableView footer programmatically. This button has a left and right margin that is equal to the tableView margin:
```
UIButton *deleteButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
deleteButton.frame = CGRectMake(10, 60, 300, 34);
deleteButton.autoresizingMask = UIViewAutoresizingFlexibleWidth
```
I'm adding autoresizingMask because I want to support rotation. However, it does not work as I want, as the button stretches all the way down to the right, as shown by the image below.
Any idea how to fix it? If I remove the autosizing property then the margin is correct.

| Resizing a UIButton programmatically by maintaining a margin | CC BY-SA 2.5 | null | 2011-01-02T09:50:03.510 | 2011-01-02T15:24:49.817 | 2011-01-02T10:09:15.360 | 226,672 | 226,672 | [
"iphone",
"cocoa-touch",
"uitableview"
]
|
4,578,398 | 1 | null | null | 9 | 16,050 | I have a simple non-clickable link within a div that looks like this:

It's meant to be a sharable link that the user can copy paste into other things.
For usability purposes, I want a single left click anywhere within the div to select the entire link:

I don't know much about, javascript/web programming, so I've tried the following:
```
<div id="share_link" onClick="select_all('share_link')"><%= request.url %></div>
```
and this javascript
```
<script type="text/javascript">
function select_all(id) {
document.getElementById(id).focus();
}
</script>
```
This doesn't work. I'd like to know what's the simplest thing I should do to achieve what I want. I thought about changing the div to a text input or the text within to be a link, but ideally the content within should be read-only, non-editable, and non-clickable
| selecting all text within a div on a single left click with javascript | CC BY-SA 2.5 | null | 2011-01-02T12:40:17.423 | 2012-10-14T18:52:02.360 | null | null | 325,072 | [
"javascript",
"jquery",
"html"
]
|
4,578,425 | 1 | null | null | 0 | 455 | I want use CSS3 property to make a complicated background image which with corner shadow and so on.Including background image,left border image,right border image.So,for the `<div class="outer"></div>`I write the CSS below:
```
.outer
{
background:url("title_main.png");
background-repeat:repeat-x;
background-clip: content;
background-origin:content;
-moz-background-clip: content;
-moz-background-origin: content;
-webkit-background-clip: content;
-webkit-background-origin:content;
-webkit-border-image:url("title_border.png") 0 15 0 15 stretch;
-moz-border-image: url("title_border.png") 0 15 0 15 stretch;
border-image:url("fancy_title.png") 0 15 0 15 stretch;
border-width:0 15px ;
width:80px;
height:32px;
}
```
In chrome browser it work well like:
But the firefox doesn't like this:
Why would this happened?How can I fix this?Make the firefox effect like the chrome?
| CSS3 background-origin property does work in firefox? | CC BY-SA 2.5 | null | 2011-01-02T12:48:27.400 | 2011-01-02T15:10:24.197 | null | null | 508,236 | [
"background-image",
"css"
]
|
4,578,443 | 1 | null | null | 0 | 433 | I'm using AutoCompleteBox from the wpf toolkit and I implement the populating by my own
since there is a lot of data and I want to do the search in a background thread.
this is what heppans when I search for the number 12.
while it should show me 4 results - 12,120,121,122.
What am I doing wrong ?
Guide on msdn that I tried to folow: [http://msdn.microsoft.com/en-us/library/system.windows.controls.autocompletebox.populating(VS.95).aspx](http://msdn.microsoft.com/en-us/library/system.windows.controls.autocompletebox.populating(VS.95).aspx)

XAML:
```
<Grid>
<Controls:AutoCompleteBox x:Name="txtSearch" Populating="AutoCompleteBox_Populating" Height="30" Background="Beige" />
</Grid>
```
Code behind:
```
public partial class Window1 : Window {
private int MAX_NUM_OF_RESULTS = 3;
public List<Person> Persons { get; set; }
public List<string> Results { get; set; }
public Window1() {
InitializeComponent();
Persons = new List<Person>();
for (var i = 0; i < 1000000; i++) {
Persons.Add(new Person { Name = i.ToString() });
}
Results = new List<string>();
}
private void AutoCompleteBox_Populating(object sender, PopulatingEventArgs e) {
e.Cancel = true;
var b = new BackgroundWorker();
b.RunWorkerAsync(txtSearch.SearchText);
b.DoWork += b_DoWork;
b.RunWorkerCompleted += b_RunWorkerCompleted;
}
void b_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) {
txtSearch.ItemsSource = Results;
txtSearch.PopulateComplete();
}
void b_DoWork(object sender, DoWorkEventArgs e) {
Results.Clear();
var counter = 0;
foreach (var person in Persons) {
if (person.Name.StartsWith(e.Argument.ToString())) {
Results.Add(person.Name);
counter++;
if (counter > MAX_NUM_OF_RESULTS) {
break;
}
}
}
}
}
```
Class Person:
```
public class Person {
public string Name;
}
```
| Autocomplete with BackgroundWorker does not work | CC BY-SA 3.0 | null | 2011-01-02T12:53:49.757 | 2011-09-27T16:51:58.837 | 2011-08-31T14:07:38.317 | 546,730 | 138,627 | [
"wpf",
"multithreading",
"backgroundworker",
"autocompletebox"
]
|
4,578,512 | 1 | 4,580,913 | null | 3 | 120 | I want to embed a webpage so it displays on this pasge

Under the Item, I would like to embed a web page so it displays as that page has live updates in HTML.
Could this be done?
Thanks
This is the code for the Table View as I'm using Three20
```
[TTTableTextItem itemWithText:@"Item1" URL:@"tt://countrylauncher"],
[TTTableTextItem itemWithText:@"Item2" URL:@"http://www.link1.org"],
[TTTableTextItem itemWithText:@"Item3" URL:@"http://link2.com"],
[TTTableTextItem itemWithText:@"Item4" URL:@"http://itunes.apple.com/us/app/lalalala/"],
```
| Adding embdeded webpage to a tableview? | CC BY-SA 2.5 | null | 2011-01-02T13:15:20.930 | 2011-01-03T15:55:09.303 | 2011-01-02T14:32:23.363 | 370,507 | 370,507 | [
"iphone",
"three20"
]
|
4,578,556 | 1 | 4,651,117 | null | 1 | 1,879 | This [addin](http://www.extendoffice.com/product/word-documents-tabs.html) adds 'document tabs' into Microsoft Word, I wonder how it's done? As we know, according to Word's 'Object Model' API, , how can that addin put multiple Word document windows into the same parent window and use tabs to switch among them?
Attached this screenshot to illustrate how that addin works:

| Put multiple Word document windows into the same parent window | CC BY-SA 3.0 | null | 2011-01-02T13:28:30.317 | 2013-07-27T19:08:10.967 | 2013-07-27T19:08:10.967 | 1,065,525 | 133,516 | [
"windows",
"ms-word",
"ms-office",
"ole"
]
|
4,578,598 | 1 | 4,578,982 | null | 7 | 1,097 | Trying to implement a very simple TPH setup for a system I'm making, 1 base, 2 inherited classes.
However the inherited classes all belong to the same entity set, so within my ObjectContext using loop, I can only access the base abstract class. I'm not quite sure how I get the elements which are concrete classes? (I've also converted it to using POCO).

Then within my application using the Entities:
```
using (SolEntities sec = new SolEntities()) {
Planets = sec.CelestialBodies;
}
```
There's a CelestialBodies entity set on `sec`, but no Planets/Satellites as I'd expect.
Not quite sure what needs to be done to access them.
Thanks
| EF TPH Inheritance Query | CC BY-SA 2.5 | 0 | 2011-01-02T13:36:02.173 | 2011-01-02T15:54:14.463 | null | null | 175,407 | [
"c#",
"entity-framework",
"c#-4.0",
"tph"
]
|
4,578,624 | 1 | 4,578,803 | null | 1 | 2,330 | In my onCreateOptionsMenu() I have basically the following:
```
public boolean onCreateOptionsMenu(Menu menu) {
menu.add(Menu.NONE, MENU_ITEM_INSERT, Menu.NONE, R.string.item_menu_insert).setShortcut('3',
'a').setIcon(android.R.drawable.ic_menu_add);
PackageManager pm = getPackageManager();
if(pm.hasSystemFeature(PackageManager.FEATURE_CAMERA) && pm.hasSystemFeature(PackageManager.FEATURE_CAMERA_AUTOFOCUS)){
menu.add(Menu.NONE, MENU_ITEM_SCAN_ADD, Menu.NONE, ((Collectionista.DEBUG)?"DEBUG Scan and add item":getString(R.string.item_menu_scan_add))).setShortcut('4',
'a').setIcon(android.R.drawable.ic_menu_add);
}
...
}
```
And in onPrepareOptionsMenu among others the following:
```
final boolean scanAvailable = ScanIntent.isInstalled(this);
final MusicCDItemScanAddTask task = new MusicCDItemScanAddTask(this);
menu.findItem(MENU_ITEM_SCAN_ADD).setEnabled(scanAvailable && (tasks == null || !existsTask(task)));
```
As you see, two options items have the same drawable set (android.R.drawable.ic_menu_add). Now, if in onPrepareOptionsMenu the second menu item gets disabled, its label and icon become gray, but also the icon of the first menu item becomes gray, while the label of that first menu item stays black and it remains clickable. What is causing this crosstalk between the two icons/drawables? Shouldn't the system handle things like mutate() in this case?
I've included a screenshot:

| Android: changing drawable states of option menu items seems to have side-effects | CC BY-SA 2.5 | null | 2011-01-02T13:42:07.833 | 2011-01-03T18:45:06.260 | 2011-01-03T18:45:06.260 | 458,813 | 458,813 | [
"android",
"menuitem",
"drawable",
"options-menu"
]
|
4,579,020 | 1 | 4,579,333 | null | 20 | 13,567 | I have a radial blur shader in GLSL, which takes a texture, applies a radial blur to it and renders the result to the screen. This works very well, so far.
The problem is, that this applies the radial blur to the first texture in the scene. But what I actually want to do, is to apply this blur to the scene.
What is the best way to achieve this functionality? Can I do this with only shaders, or do I have to render the scene to a texture first (in OpenGL) and then pass this texture to the shader for further processing?
```
// Vertex shader
varying vec2 uv;
void main(void)
{
gl_Position = vec4( gl_Vertex.xy, 0.0, 1.0 );
gl_Position = sign( gl_Position );
uv = (vec2( gl_Position.x, - gl_Position.y ) + vec2(1.0) ) / vec2(2.0);
}
```
```
// Fragment shader
uniform sampler2D tex;
varying vec2 uv;
const float sampleDist = 1.0;
const float sampleStrength = 2.2;
void main(void)
{
float samples[10];
samples[0] = -0.08;
samples[1] = -0.05;
samples[2] = -0.03;
samples[3] = -0.02;
samples[4] = -0.01;
samples[5] = 0.01;
samples[6] = 0.02;
samples[7] = 0.03;
samples[8] = 0.05;
samples[9] = 0.08;
vec2 dir = 0.5 - uv;
float dist = sqrt(dir.x*dir.x + dir.y*dir.y);
dir = dir/dist;
vec4 color = texture2D(tex,uv);
vec4 sum = color;
for (int i = 0; i < 10; i++)
sum += texture2D( tex, uv + dir * samples[i] * sampleDist );
sum *= 1.0/11.0;
float t = dist * sampleStrength;
t = clamp( t ,0.0,1.0);
gl_FragColor = mix( color, sum, t );
}
```

| How do I use a GLSL shader to apply a radial blur to an entire scene? | CC BY-SA 2.5 | 0 | 2011-01-02T15:25:28.407 | 2014-08-26T22:23:56.483 | 2011-01-02T18:05:39.987 | 19,679 | 192,702 | [
"opengl",
"glsl",
"blur"
]
|
4,579,350 | 1 | 4,579,367 | null | 4 | 13,568 | How do I change the black/gray color to white?
This is just a simple view with a UIView attached to the UIViewControllers property together a with a webview that fills the UIView.
Here's the code that works:
```
- (void)loadView {
UIWebView *webview = [[UIWebView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 320.0f, 416.0f)];
[webView setBackgroundColor:[UIColor whiteColor]];
self.view = webView;
[webview release];
}
```
Thanks in advance.

| Changing background color on UIScrollView? | CC BY-SA 2.5 | 0 | 2011-01-02T16:42:18.793 | 2012-05-26T23:53:14.357 | 2011-01-02T17:18:43.130 | 454,049 | 454,049 | [
"iphone"
]
|
4,579,359 | 1 | null | null | 2 | 834 | I've been using CutyCapt to take screen shots of several web pages with great success. My challenge now is to paint a few dots on those screen shots that represent where a user clicked.
CutyCapt goes through a process of resizing the web page to the scroll width before taking a screen shot. That's extremely useful because you only get content and not much (if any) of the page's background.
My challenge is trying to map a user's mouse X coordinates to the screen shot. Obviously users have different screen resolutions and have their browser window open to different sizes. The image below shows 3 examples with the same logo. Assume, for example, that the logo is 10 pixels to the left edge of the "content" area (in red).
In each of these cases, and for any resolution, I need a JavaScript routine that will calculate that the logo's X coordinate is 10. Again, the challenge (I think) is differing resolutions. In the center-aligned examples, the logo's position, as measured from the left edge of the browser (in black), differs with changing browser size. The left-aligned example should be simple as the logo never moves as the screen resizes.
Can anyone think of a way to calculate the scrollable width of a page? In other words, I'm looking for a JavaScript solution to calculate the minimum width of the browser window before a horizontal scroll bar shows up. And I need to do this without first knowing any element IDs or class names.
Thanks for your help!

| Browser relative positioning with jQuery and CutyCapt | CC BY-SA 2.5 | 0 | 2011-01-02T16:44:00.097 | 2011-01-25T00:04:36.607 | 2011-01-02T23:55:15.253 | 166,403 | 166,403 | [
"javascript",
"jquery",
"browser",
"positioning",
"css-position"
]
|
4,579,358 | 1 | 4,579,405 | null | 6 | 2,585 | Assuming that a table contains sufficient information to warrant an index seek, at what cardinality will SQL Server (or PostgreSQL) opt for an index scan?
The reason I ask this is I previously posted a question ([link](https://stackoverflow.com/questions/4575230/two-radically-different-queries-against-4-mil-records-execute-in-the-same-time/4576303#4576303)) in which two queries performed at the same speed, yet one didn't attempt to use the index on the processed columns. After SQL Server suggested I put a that the columns being queried (it suggested this for both queries), I started looking for reasons as to why it would make such a strange suggestion.
I experimented with making the indexes covering and composite, but both executed in the same time (we're talking 3 million rows).
Finally I concluded it was because of the ultra-high cardinality of the data. Every row is unique. I am deducing this caused SQL server to choose an index scan. However, the query stated "WHERE Col1 > ? AND Col2 < ?", so this is a little confusing.
My questions are:
1. At what cardinality will a RDBMS always opt for an index scan?
2. Can anyone explain why SQL Server would not use the index when the WHERE statement would indicate this would make sense?
I have attached the execution plan.

| At what cardinality does SQL Server switch to an index scan (vs. seek) | CC BY-SA 2.5 | 0 | 2011-01-02T16:43:50.577 | 2011-01-02T18:18:55.777 | 2017-05-23T12:24:28.527 | -1 | 401,584 | [
"sql-server",
"postgresql",
"indexing",
"sql-execution-plan"
]
|
4,579,420 | 1 | 4,579,463 | null | 2 | 1,362 | Im trying to change the font colour on the table view header where it says California / New York. How do i do that?
On a black background the text needs to be white but cant figure this one out.
Thanks

| UITableView Font | CC BY-SA 2.5 | null | 2011-01-02T16:59:35.137 | 2014-03-12T18:26:23.910 | null | null | 370,507 | [
"iphone"
]
|
4,579,578 | 1 | 4,579,888 | null | 0 | 2,426 | 
Ihave a gridview item template field namely Status as mentioned above ...
i want when user click on hold button of particular row then the record from the particular row is transfered to another page. ... means.... if i click on the hold button of 1st row of gridview then seats=35 and booking closed =08:00:00 PM willbe trasferred to
```
Me.Response.Redirect("Select_seats.aspx?s_no=" & label22.Text.ToString & "&" & "journey=" & label6.Text & "&" & "seater=" & label4.Text & "&" & "sleeper=" & label2.Text & "&" & "service=" & lab5.Text.ToString) ..
```
and if i click on the manage button of same row then the record of that row will be transferred to
```
Me.Response.Redirect("Select_nfo.aspx?s_no=" & label22.Text.ToString & "&" & "journey=" & label6.Text & "&" & "seater=" & label4.Text & "&" & "sleeper=" & label2.Text & "&" & "service=" & lab5.Text.ToString)
```
| redirect gridview selected row data to two different pages on clicking on two different select button asp.net? | CC BY-SA 2.5 | null | 2011-01-02T17:36:42.357 | 2011-01-02T18:58:09.010 | 2011-01-02T18:04:31.033 | 226,897 | 559,800 | [
"asp.net",
"vb.net"
]
|
4,580,270 | 1 | 4,726,915 | null | 1 | 920 | We need to visualize the number of forms submitted over a 2 week period where it is broken down by day/hour.
I have the query returning data such as:

My question is, how do I tell MS chart to display this data? When I bind it I get the following:

I'd like it to expand out and show the hours between the dates.
| Display time data with telerik chart | CC BY-SA 2.5 | null | 2011-01-02T20:11:18.737 | 2011-01-18T17:13:58.860 | null | null | 2,424 | [
"c#",
"asp.net",
"mschart"
]
|
4,580,344 | 1 | 4,580,369 | null | 0 | 177 | I am trying to use JSON for getting dynamic content to my webpage, using javascript. Something is not correct and I have problem figuring out what it can be. In firebug I can see that the JSON-data is retreived as it should. When looking in Firebug under "DOM", the URL I am accessing for the page (the actual page I have created, not the URL to JSON-data) is coloured red (see screenshot below). Here is my javascript:
```
$(document).ready(function() {
$('#target').click(function() {
alert("At least I',m reached ");
$.getJSON('http://localhost/timereporting/phpscriptlibrary/get_remaining_hours.php', function(data) {
document.getElementById('errorDiv').innerHTML = "Divtext";
alert("Inside getJason");
});
alert("At least I',m done ");
});
```
This is the significant part of my php file:
```
$json_string = "{\"activities\": ";
$json_string = $json_string."[";
for ( $counter = 0; $counter < $num; $counter += 1) {
$json_string = $json_string."[".mysql_result($rows,$counter,'date').", \"".mysql_result($rows,$counter,'activity_id')."\", ".mysql_result($rows,$counter,'hours')."]";
if($counter != ($num-1)){
$json_string = $json_string.", ";
}
}
$json_string = $json_string."]}";
echo $json_string;
```
I assume that "echo" is the way to "send" the JSON-data to the javascript?
One strange thing is that in firebug the JSON-data is presented in two different ways. If you look at the included screenshots below, the second one has dates like "1988" or similar while on the first one the dates are more complete like "2010-12-10". The first screenshot depicts how it should be and that's how I am trying to send it, and obviously it is received like this at some point.
How come my div-tag isn't updated with the date or that the alert inside the $.getJSON isn't triggered, only the alert before and after?



| JQuery.getJson isn't triggered properly | CC BY-SA 2.5 | null | 2011-01-02T20:23:34.217 | 2011-01-02T20:33:11.390 | null | null | 229,144 | [
"php",
"javascript",
"json",
"dom"
]
|
4,580,392 | 1 | 4,580,400 | null | 0 | 131 | This is a simplified version of an html table I have:
(The table is RTL)
```
......
<tr>
<td>
<select>
<option>A New Think Pad</option>
<option>OptB</option>
<option>OptC</option>
</select>
</td>
</tr> .....
<tr>
<td>
<select>
<option>Poker</option>
<option>B</option>
<option>C</option>
</select>
</td>
</tr>
```
My problem is that it ends out looking something like this:

How do i get the option below (Poker) to size itself to the size of the td.
(I do not know the size of the td in advance)
I have tried:
```
select, option { width:inherit;}
```
But it does not seem to do the job.
Thanks in advance and be happy, Julian
| CSS - How do I style a select to fully occupy the td it is in | CC BY-SA 2.5 | null | 2011-01-02T20:34:26.780 | 2011-01-02T20:42:00.857 | null | null | null | [
"css"
]
|
4,580,510 | 1 | 4,580,568 | null | 1 | 387 | In my app I'm using a spinners to let the user select an item from a list. Everything works fine but I'm not really happy with the look of the spinner. As you can see in the image below it has the same design as a normal button.

What I want is a spinner which looks more like a normal text field. So I browsed a little bit through the drawable folder of the Android sources and found out that the spinner background should normally look quite different. I append an image of a spinner with the background image as I found it in the drawable folder. Although the spinner in the image is focused, I think you can see the difference between both spinners.

Now I'm wondering why the my spinner (first one) doesn't have the same design as the second one as II didn't changed any attributes which are related to the design of it. Where does this button like design come from?
| Android: Why does my Spinner haven't got the standard design? | CC BY-SA 2.5 | null | 2011-01-02T21:03:45.940 | 2011-12-19T08:49:49.450 | null | null | 19,601 | [
"android",
"spinner"
]
|
4,580,727 | 1 | 10,412,148 | null | 33 | 24,844 | Something strange afoot, here:
An instance of Datepicker is showing up in a weird place as a single bar in the upper left hand corner of [this](http://bigsilkdesign.com/comida/#&panel1-1) page.
I'm using both jQuery UI's Datepicker and Accordion on a page. In the CSS for the UI, the `display:none` for Datepicker seems to be overridden by the `display:block` for the Accordion, at least according to Firebug (see img below).
Then, once the Datepicker trigger is clicked in the 'catering/event room' tab (click one of the buttons to show div with Datepicker,) the `display:none` seems to then work.
Here's what the bad div looks like:

and here's the Firebug panel:

| Override jQuery UI Datepicker div visible strangely on first page load. | CC BY-SA 3.0 | 0 | 2011-01-02T21:55:11.110 | 2016-01-21T11:39:42.857 | 2013-10-18T11:45:05.883 | 2,681,246 | 282,302 | [
"css",
"jquery-ui",
"datepicker",
"accordion"
]
|
4,580,767 | 1 | 4,581,303 | null | 1 | 2,111 | How to check the current keyboard's language using vb6 ?
```
IF ("Is it the English language") Then
Msgbox "EN"
End IF
```

| How to check the current keyboard's language using vb6? | CC BY-SA 2.5 | null | 2011-01-02T22:08:27.980 | 2012-04-03T23:34:37.293 | 2012-04-03T23:34:37.293 | 3,043 | 423,903 | [
"vb6",
"localization"
]
|
4,580,834 | 1 | 4,581,238 | null | 6 | 4,040 | I'm making a Minecraft clone as my very first OpenGL project and am stuck at the box selection part. What would be the best method to make a reliable box selection?
I've been going through some AABB algorithms, but none of them explain well enough what they exactly do (especially the super tweaked ones) and I don't want to use stuff I don't understand.
Since the world is composed of cubes I used octrees to remove some strain on ray cast calculations, basically the only thing I need is this function:
```
float cube_intersect(Vector ray, Vector origin, Vector min, Vector max)
{
//???
}
```
The ray and origin are easily obtained with
```
Vector ray, origin, point_far;
double mx, my, mz;
gluUnProject(viewport[2]/2, viewport[3]/2, 1.0, (double*)modelview, (double*)projection, viewport, &mx, &my, &mz);
point_far = Vector(mx, my, mz);
gluUnProject(viewport[2]/2, viewport[3]/2, 0.0, (double*)modelview, (double*)projection, viewport, &mx, &my, &mz);
origin = Vector(mx, my, mz);
ray = point_far-origin;
```
min and max are the opposite corners of a cube.
I'm not even sure this is the right way to do this, considering the number of cubes I'd have to check, even with octrees.
I've also tried `gluProject`, it works, but is very unreliable and doesn't give me the selected face of the cube.
---
So this is what I've done: calculate a position in space with the ray:
```
float t = 0;
for(int i=0; i<10; i++)
{
Vector p = ray*t+origin;
while(visible octree)
{
if(p inside octree)
{
// then call recursive function until a cube is found
break;
}
octree = octree->next;
}
if(found a cube)
{
break;
}
t += .5;
}
```
It's actually surprisingly fast and stops after the first found cube.

As you can see the ray has to go trough multiple octrees before it finds a cube (actually a position in space) - there is a crosshair in the middle of the screen. The lower the increment step the more precise the selection, but also slower.
| Best box selection method for a Minecraft clone | CC BY-SA 2.5 | null | 2011-01-02T22:22:55.543 | 2013-08-03T02:01:51.587 | 2011-01-03T22:11:43.480 | 176,269 | 176,269 | [
"c++",
"opengl",
"picking"
]
|
4,580,927 | 1 | null | null | 6 | 646 | I'm having an issue where the text in the code completion dialog is unreadable. For whatever reason the foreground is the same as the background. I have tried finding the right colors to change in the preferences but with no success.
| Eclipse\Aptana code completion is unreadable | CC BY-SA 2.5 | 0 | 2011-01-02T22:44:34.667 | 2011-11-07T08:04:31.733 | null | null | 80,566 | [
"eclipse",
"aptana"
]
|
4,581,125 | 1 | null | null | 1 | 513 | I am localizing my app, I found Apple use different folder structures for bundle or strings.
Can anyone tell me why Apple doesn't use the same folder structures for easy of use?

| Why does Apple use different folder structures for bundle and strings localization? | CC BY-SA 2.5 | null | 2011-01-02T23:32:01.703 | 2011-01-03T00:17:57.050 | 2011-01-03T00:08:41.733 | 224,988 | 424,957 | [
"ios",
"internationalization",
"bundle",
"application-settings",
"localizable.strings"
]
|
4,581,278 | 1 | 4,597,782 | null | 1 | 2,285 | In Labview, I'm trying to produce a .csv file with one column being the timestamp and the others being the data so each data point is timestamped. I have succeeded in doing that, but my timestamp and data aren't synced so the values don't always align. For example, sometimes it will only have a data point, but not a timestamp associated on the same line. Here is the section of the code that takes the waveform (data) and timestamp to spit out the spreadsheet file.  Not shown is the time delay.
Thank you in advance!
| Syncing the timestamp with incoming data in Labview | CC BY-SA 2.5 | null | 2011-01-03T00:23:12.370 | 2011-01-04T19:56:07.707 | null | null | 88,111 | [
"csv",
"timestamp",
"labview"
]
|
4,581,667 | 1 | null | null | 7 | 2,042 | I am trying to get a basic hello world application going using XCode and Interface Builder. However, in Interface Builder I can't see my outlets to wire things up with. I go to the connections tab of the objects inspector pane and it says "New Referencing Outlet".
I am wondering if my code is wrong. Here it is
```
class HelloWorldController
attr_accessor :hello_label, :hello_button, :hello
def awakeFromNib
@hello = true
end
def changeLabel(sender)
if @hello
@hello_label.stringValue = "Good Bye"
@hello_button.title = "Hello"
@hello = false
else
@hello_label.stringValue = "Hello World"
@hello_button.title = "Good Bye"
@hello = true
end
end
end
```
As I understand it I should be able to see hello, hello_label, hello_button, and changeLabel, but I don't. I thought maybe I had a misspelling somewhere, but that doesn't seem to be it either. Here is a shot of the two interface builder windows.

Any help is appreciated. I think I am just overlooking something, but not sure.
UPDATE: I solved the problem by just re-installing OS X. I suspect there was a problem because X Code 4 was installed, no idea. However, it now works with a fresh install of OS X, X Code and MacRuby
| Interface Builder not Seeing Outlets with MacRuby | CC BY-SA 2.5 | 0 | 2011-01-03T02:18:06.207 | 2012-04-08T19:32:18.137 | 2011-01-04T10:55:06.203 | 23,571 | 23,571 | [
"ruby",
"xcode",
"interface-builder",
"macruby"
]
|
4,581,873 | 1 | 4,658,273 | null | 0 | 1,336 | I have an interesting problem/question and i'm not sure if it is even doable. So I have a custom header view for regular UITableView. But it's transparent and it doesn't fill fill table width. So it displayed properly when table is scrolled and this header view is displayed above cell content (sticked to the top). But when same header is displayed between two sections down - it looks ugly, because it's transparent and it's either displayed above black rectangle or above table background.
I was wondering is there way to customize header view for when it's stick to the top and when it's not. Or... may be it's possible to specify what needs to be displayed underneath header view when it's between sections. Something like sectionSeparatorView?

| viewForHeaderInSection - create header that would display properly in all cases | CC BY-SA 2.5 | 0 | 2011-01-03T03:25:12.533 | 2011-01-11T13:48:37.210 | 2020-06-20T09:12:55.060 | -1 | 274,519 | [
"iphone",
"uitableview",
"ios"
]
|
4,581,946 | 1 | null | null | 1 | 1,178 | I have a vb.net form with ToolStrip menu
```
RenderMode - ManagerRenderMode
LayoutStyle - HorizontalStackWithOverflow
```
My development environment is .net 4.0, VS2010, windows 7 x64; but occasionally I am getting next error 
```
A generic error occurred in GDI+.
Stacktrace: at System.Drawing.Graphics.CheckErrorStatus(Int32 status)
at System.Drawing.Graphics.FillRectangle(Brush brush, Int32 x, Int32 y, Int32 width, Int32 height)
at System.Drawing.Graphics.FillRectangle(Brush brush, Rectangle rect)
at System.Windows.Forms.ToolStripProfessionalRenderer.FillWithDoubleGradient(Color beginColor, Color middleColor, Color endColor, Graphics g, Rectangle bounds, Int32 firstGradientWidth, Int32 secondGradientWidth, LinearGradientMode mode, Boolean flipHorizontal)
at System.Windows.Forms.ToolStripProfessionalRenderer.RenderToolStripBackgroundInternal(ToolStripRenderEventArgs e)
at System.Windows.Forms.ToolStripProfessionalRenderer.OnRenderToolStripBackground(ToolStripRenderEventArgs e)
at System.Windows.Forms.ToolStripRenderer.DrawToolStripBackground(ToolStripRenderEventArgs e)
at System.Windows.Forms.ToolStrip.OnPaintBackground(PaintEventArgs e)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
```
| A generic error in GDI+ with ToolStrip in ManagerRenderMode | CC BY-SA 2.5 | 0 | 2011-01-03T03:49:26.220 | 2011-10-26T02:24:01.497 | null | null | 241,811 | [
"vb.net",
"visual-studio-2010",
"gdi+",
"64-bit"
]
|
4,582,080 | 1 | 4,582,089 | null | 1 | 969 | Anybody can explain to me about this diagram 
How can Android application which run on Dalvik call a native lib from VM?
| About android architecture? | CC BY-SA 2.5 | 0 | 2011-01-03T04:33:55.857 | 2011-01-03T11:29:34.323 | 2011-01-03T11:29:34.323 | 244,296 | 122,456 | [
"android",
"architecture"
]
|
4,582,338 | 1 | null | null | 0 | 324 | Please look at this screenshot:

When you tap in another segmentedcontrol, it switches smoothly (try it if you can).
First of all, is it a segmentedcontrol?
Second, how can I add this smooth effect?
Thanks guys.
| How can I do this iPhone (segmentedcontrol?) layout? | CC BY-SA 3.0 | null | 2011-01-03T05:53:38.237 | 2012-01-20T22:09:03.553 | 2012-01-20T22:09:03.553 | 441,574 | 545,004 | [
"iphone",
"uisegmentedcontrol"
]
|
4,582,465 | 1 | 4,582,519 | null | 0 | 658 | I have tried "[http://www.codeproject.com/KB/system/ScreenMonitor.aspx?msg=3717430#xx3717430xx](http://www.codeproject.com/KB/system/ScreenMonitor.aspx?msg=3717430#xx3717430xx)" to capture all things at working desktop, its good. But I saw that whenever I open CSExpress 2010 (Visual Studio Express) for my programming environment this utility capture as BLACK image, so whats the issue with it.
Screen like it : 
Please let me know.
Thanks,
Laxmilal
| Screen Capture and Visual Studio C# Express? | CC BY-SA 3.0 | null | 2011-01-03T06:23:02.990 | 2013-05-09T14:38:06.380 | 2013-05-09T14:38:06.380 | 13,302 | 1,444,686 | [
"c#",
"screenshot"
]
|
4,582,501 | 1 | null | null | 8 | 1,759 | I am building an IE Extension, and I need to keep my Access Database file in the Appdata folder. It's working fine. But in many systems where IE IE Protected Mode is ON, it crashes, I guess this is because IE Protected Mode doesn't allow Extensions to access Appdata.
I was trying to find a way out so that I can detect if IE is in Protected Mode through my extension.
Please give some code snippets and some links to get me out of this issue.
Regards
I am attaching a screenshot of error as well.

| How to detect IE Protected Mode using c# | CC BY-SA 2.5 | 0 | 2011-01-03T06:33:03.563 | 2011-01-03T16:12:09.320 | null | null | 434,685 | [
"c#",
"internet-explorer",
"protected-mode"
]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.