Id
int64 1.68k
75.6M
| PostTypeId
int64 1
2
| AcceptedAnswerId
int64 1.7k
75.6M
⌀ | ParentId
int64 1.68k
75.6M
⌀ | Score
int64 -60
3.16k
| ViewCount
int64 8
2.68M
⌀ | Body
stringlengths 1
41.1k
| Title
stringlengths 14
150
⌀ | ContentLicense
stringclasses 3
values | FavoriteCount
int64 0
1
⌀ | CreationDate
stringlengths 23
23
| LastActivityDate
stringlengths 23
23
| LastEditDate
stringlengths 23
23
⌀ | LastEditorUserId
int64 -1
21.3M
⌀ | OwnerUserId
int64 1
21.3M
⌀ | Tags
sequence |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2,686,401 | 1 | 6,228,084 | null | 3 | 883 | Having a simple Navigation Controller in place (starting the Navigation Based Application project) I created a new View with a XIB file.
on my `HomeViewController` (Home screen with all options as `UIButton`'s I have:
```
@implementation HomeViewController
-(IBAction) optionChoosed:(UIButton *)button
{
NSString *msg = [NSString stringWithFormat:@"Button: %d", button.tag];
UIAlertView *alert=[[UIAlertView alloc] initWithTitle:@"Hi" message:msg delegate:nil cancelButtonTitle:@"Go away" otherButtonTitles:nil];
switch (button.tag) {
case 13:
// Simple Search
[self loadSimpleSearch]; break;
default:
[alert show];
break;
}
[alert release];
}
-(void)loadSimpleSearch
{
SimpleSearchViewController *controller =
[[SimpleSearchViewController alloc] initWithNibName:@"SimpleSearchViewController" bundle:nil];
[self.navigationController pushViewController:controller animated:YES];
[controller release];
}
```
witch works great!
it Pushes the View into the front of the stack!
Now, because in my 2nd view `SimpleSearchViewController` I have `self.title = @"myTitle";` I get the Title in the NavigationBar as well the back button (as I have the same setting on the `HomeViewController`)
I thought that the NavigationViewController would handle the pop of the current view, but it does not.
> , to pop the `SimpleSearchViewController`? `[self.navigationController popViewControllerAnimated:YES];`
as the view continues there, and `ViewDidUnload` is never called.
My idea was that this should be handle in the first ViewController, the `HomeViewController` but I have no idea what is the method I should hook to, and I read the documentation and I can't figure it out :-/
Any help is greatly appreciated, .
`HomeViewController`
[alt text http://cl.ly/XNS/Screen_shot_2010-04-21_at_22.38.51.png](http://cl.ly/XNS/Screen_shot_2010-04-21_at_22.38.51.png)
`SimpleSearchViewController`
[alt text http://cl.ly/YDw/Screen_shot_2010-04-21_at_22.40.00.png](http://cl.ly/YDw/Screen_shot_2010-04-21_at_22.40.00.png)
`SimpleSearchViewController` after pressing the button
[alt text http://cl.ly/XLO/Screen_shot_2010-04-21_at_22.40.21.png](http://cl.ly/XLO/Screen_shot_2010-04-21_at_22.40.21.png)
---
To add the image from a comment that asks if HomeViewController as the root controller for the NavigationViewController

| NavigationController is not popping the Pushed View on Back button | CC BY-SA 2.5 | 0 | 2010-04-21T20:41:45.853 | 2011-07-10T00:18:37.450 | 2020-06-20T09:12:55.060 | -1 | 28,004 | [
"cocoa-touch",
"uiviewcontroller",
"uinavigationcontroller"
] |
2,686,712 | 1 | 2,694,499 | null | 0 | 14,668 | probably I don't understand the layout properties of TableLayout yet. It doesn't seem to be possible to achieve such a flexible table like in HTML, because there are no cells. My target is it to achieve such a layout:

How can I do that? I thought about using a GridView but this doesn't seem to be useful in XML.
My efforts look like this:
```
<TableLayout
android:id="@+id/tableLayout"
android:layout_width="320sp"
android:layout_height="fill_parent"
android:layout_gravity="center_horizontal"
android:gravity="bottom"
android:layout_alignParentBottom="true">
<TableRow
android:background="#333333"
android:gravity="bottom"
android:layout_width="fill_parent">
<Button
android:id="@+id/btnUp"
android:layout_width="60sp"
android:layout_height="50sp"
android:gravity="left"
android:text="Lift U"
/>
<Button
android:id="@+id/btnScreenUp"
android:gravity="right"
android:layout_gravity="right"
android:layout_width="60sp"
android:layout_height="50sp"
android:text="Scrn U"
/>
</TableRow>
<TableRow
android:background="#444444"
android:gravity="bottom"
android:layout_gravity="right">
<Button
android:id="@+id/btnDown"
android:layout_width="60sp"
android:layout_height="50sp"
android:text="Lift D"
/>
<Button
android:id="@+id/btnScreenLeft"
android:layout_width="60sp"
android:layout_height="50sp"
android:gravity="right"
android:layout_gravity="right"
android:text="Scrn L"
/>
<Button
android:id="@+id/btnScreenDown"
android:layout_width="60sp"
android:layout_height="50sp"
android:gravity="right"
android:layout_gravity="right"
android:text="Scrn D"
/>
<Button
android:id="@+id/btnScreenRight"
android:layout_width="60sp"
android:layout_height="50sp"
android:gravity="right"
android:layout_gravity="right"
android:text="Scrn R"
/>
</TableRow>
</TableLayout>
```
| How to align Buttons in a TableLayout to different directions? | CC BY-SA 3.0 | 0 | 2010-04-21T21:30:32.780 | 2012-01-14T14:56:40.830 | 2012-01-14T14:56:40.830 | 319,773 | 319,773 | [
"android",
"android-layout"
] |
2,686,798 | 1 | null | null | 0 | 945 | I'm trying to develop a drag-and-drop behavior based on the jQuery UI draggable behavior but am running into some road blocks. I want to be able to drag several images with transparent regions around a region of the screen. I want the user to be able to drag the image he clicks and not just whatever draggable div or PNG happens to be z-indexed on top.
The below image is a screen grab from my test page. If I click the lower left region of the blue square through the red thing I should drag the square and not the red thing. The red thing is what gets dragged though because it is on top and the browser does not care about the transparency. My question is, how can I make it behave as expected in this situation and drag the square instead?
Edit: Images added
| jQuery drag and drop behavior with partially transparent image | CC BY-SA 3.0 | null | 2010-04-21T21:46:02.813 | 2011-11-26T03:15:23.180 | 2011-11-26T03:15:23.180 | 234,976 | 322,723 | [
"jquery",
"jquery-ui",
"draggable"
] |
2,687,054 | 1 | null | null | 1 | 194 | My problem is when trying to load a detail view through a table cell, the application constantly crashes. The error that comes up when running through debug is:
> "____TERMINATING_DUE_TO_UNCAUGHT_EXCEPTION_____" objc exception
thrown.
If anyone can help me it would be greatly appreciated.
Here is a screenshot for the debug, I am not sure if I am interpreting it right

[Image's link](http://img43.imageshack.us/img43/2143/errorud.png).
Here is my code where I beleive the error is happening:
```
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSInteger row = [indexPath row];
if(self.moreDetailView == nil){
DetailViewController *dvController = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:[NSBundle mainBundle]];
self.moreDetailView = dvController;
[dvController release];
}
else{}
moreDetailView.title = [NSString stringWithFormat:@"%@", [listOfItems objectAtIndex:row]];
goHerdv2AppDelegate *delegate = [[UIApplication sharedApplication] delegate];
[delegate.detailView pushViewController:moreDetailView animated:YES];}
```
| iPhone Application crashing upon loading a new Detail View | CC BY-SA 3.0 | null | 2010-04-21T22:42:38.727 | 2012-05-18T21:05:24.917 | 2012-05-18T21:05:24.917 | 1,028,709 | 322,749 | [
"iphone",
"objective-c"
] |
2,687,083 | 1 | 2,977,852 | null | 6 | 10,409 | I begun developing my own SIMPLE twitter client in my server (to bypass twitter.com blocking rule stablished by some dumbass at govt. office)
Please check this image so you can see :

It is being developed with this class [Twitter PHP class by Tijs Verkoyen](http://classes.verkoyen.eu/twitter/)
This is my heading code, which is utf-8.
`<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script src="js/jquery-1.4.2.min.js" type="text/javascript"></script>`
| Strange characters and encoding while using twitter API | CC BY-SA 2.5 | 0 | 2010-04-21T22:46:54.317 | 2010-06-10T12:26:17.813 | null | null | 198,544 | [
"php",
"api",
"twitter",
"character-encoding",
"special-characters"
] |
2,687,212 | 1 | 2,687,554 | null | 7 | 3,900 | I need to colour datapoints that are outside of the the confidence bands on the plot below differently from those within the bands. Should I add a separate column to my dataset to record whether the data points are within the confidence bands? Can you provide an example please?

# Example dataset:
```
## Dataset from http://www.apsnet.org/education/advancedplantpath/topics/RModules/doc1/04_Linear_regression.html
## Disease severity as a function of temperature
# Response variable, disease severity
diseasesev<-c(1.9,3.1,3.3,4.8,5.3,6.1,6.4,7.6,9.8,12.4)
# Predictor variable, (Centigrade)
temperature<-c(2,1,5,5,20,20,23,10,30,25)
## For convenience, the data may be formatted into a dataframe
severity <- as.data.frame(cbind(diseasesev,temperature))
## Fit a linear model for the data and summarize the output from function lm()
severity.lm <- lm(diseasesev~temperature,data=severity)
# Take a look at the data
plot(
diseasesev~temperature,
data=severity,
xlab="Temperature",
ylab="% Disease Severity",
pch=16,
pty="s",
xlim=c(0,30),
ylim=c(0,30)
)
title(main="Graph of % Disease Severity vs Temperature")
par(new=TRUE) # don't start a new plot
## Get datapoints predicted by best fit line and confidence bands
## at every 0.01 interval
xRange=data.frame(temperature=seq(min(temperature),max(temperature),0.01))
pred4plot <- predict(
lm(diseasesev~temperature),
xRange,
level=0.95,
interval="confidence"
)
## Plot lines derrived from best fit line and confidence band datapoints
matplot(
xRange,
pred4plot,
lty=c(1,2,2), #vector of line types and widths
type="l", #type of plot for each column of y
xlim=c(0,30),
ylim=c(0,30),
xlab="",
ylab=""
)
```
| Conditionally colour data points outside of confidence bands in R | CC BY-SA 2.5 | 0 | 2010-04-21T23:21:17.867 | 2013-03-29T09:28:28.523 | 2020-06-20T09:12:55.060 | -1 | 255,312 | [
"r",
"statistics",
"plot",
"linear-regression",
"confidence-interval"
] |
2,687,283 | 1 | 2,687,405 | null | 2 | 2,089 | I really like the dashboard line chart which is used in google analytics, Which charting solution they use, is it made by google, i can't find it in google charts.

Thanks
| What chart used in google analytics? | CC BY-SA 2.5 | 0 | 2010-04-21T23:42:49.703 | 2011-09-10T22:13:26.717 | 2017-02-08T14:24:17.127 | -1 | 241,654 | [
"flash",
"charts"
] |
2,687,804 | 1 | 2,747,621 | null | 48 | 94,259 | I'm working on HTML for a small web application; the design calls for a content area with rounded corners and a drop shadow. I've been able to produce this with CSS3, and it works flawlessly on Firefox and Chrome:

However, Internet Explorer 7 and 8 (not supporting CSS3) is a different story:

Is there an easy, lightweight JavaScript solution that would allow me to either 1) use IE-specific features to achieve this, or 2) modify the DOM (programmatically) in such a way that adds custom images around the content area to emulate the effect?
| Emulating CSS3 border-radius and box-shadow in IE7/8 | CC BY-SA 2.5 | 0 | 2010-04-22T02:05:42.060 | 2012-11-20T10:55:18.263 | null | null | 180,043 | [
"internet-explorer",
"css"
] |
2,688,096 | 1 | 2,688,190 | null | 0 | 318 | I created a ActiveX control using ATL, already package it with signature.
I want to use it on the webpage, but at the install window the name is `MyActiveX.cab` with no link. the `MyActiveX.cab` name can be changed by modifying the html page's tag codebase attribute. but the name is still format like "XXX.cab" with no hyperlink.
I find a activex control from chinese website has its own name and link:
and its object tags are nothing different:
```
<object ID="CMBPB_OCX"
CODEBASE="http://szdl.cmbchina.com/download/PB/pb50.cab#version=5,3,1,1"
classid="clsid:F2EB8999-766E-4BF6-AAAD-188D398C0D0B" width="0" height="0">
</object>
```
---

---
[](https://i.stack.imgur.com/aEnjY.gif)
[microsoft.com](http://i.msdn.microsoft.com/dynimg/IC70749.gif)
---
the pic was taken from [MSDN Pages](https://learn.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/), it has link.
`Really want to know how to Set the activex control name?`
I try to get help from [How to Set ActiveX Control Name](https://stackoverflow.com/questions/1783209/how-to-set-activex-control-name), but still get stuck.
`I Signed the cab file and the activex dll file both`, and don't know how to put the name and hyperlink in that window.
| How to Set ActiveX Control name and link on the install window of Internet Explorer? | CC BY-SA 4.0 | 0 | 2010-04-22T03:42:36.603 | 2019-07-23T23:17:01.553 | 2019-07-23T23:17:01.553 | 4,751,173 | 188,784 | [
"c++",
"activex",
"atl"
] |
2,688,417 | 1 | 2,858,313 | null | 4 | 1,443 | When I used to use Firebugs inspect elements feature it displayed the results like this below. Nice, nested tags on the left...css style on the right.

Recently, however, when I try to inspect elements it always shows this:
I've tried reverting to older versions of FireBug (can't remember if it started after an update?).. I've poked around the settings... Can't find why it's different. The interface it's showing now is completely useless for figuring out what's going on in the html / css.
| FireBug - inspect element problem -- showing different interface? | CC BY-SA 2.5 | null | 2010-04-22T05:24:41.617 | 2011-01-12T20:32:58.690 | 2017-02-08T14:24:18.590 | -1 | 59,479 | [
"firebug"
] |
2,688,759 | 1 | 2,688,806 | null | 1 | 121 | Let's say I have a list of branches, how to find a list of tree list that are singly connected together? The below diagram should illustrate my point. The input is a list of branches in a single tree, as labeled, ie. `1`, `2`, `3` and so on

| Given A List of Branches, How to Find a List of Tree List That Are Singly Connected Together | CC BY-SA 2.5 | null | 2010-04-22T06:51:26.823 | 2010-04-22T08:16:39.347 | 2017-02-08T14:24:18.923 | -1 | 3,834 | [
"c#",
"graph"
] |
2,691,021 | 1 | 2,697,234 | null | 15 | 1,164 | For one of my course project I started implementing "Naive Bayesian classifier" in C. My project is to implement a document classifier application (especially Spam) using huge training data.
Now I have problem implementing the algorithm because of the limitations in the C's datatype.
( Algorithm I am using is given here, [http://en.wikipedia.org/wiki/Bayesian_spam_filtering](http://en.wikipedia.org/wiki/Bayesian_spam_filtering) )
PROBLEM STATEMENT:
The algorithm involves taking each word in a document and calculating probability of it being spam word. If p1, p2 p3 .... pn are probabilities of word-1, 2, 3 ... n. The probability of doc being spam or not is calculated using

Here, probability value can be very easily around 0.01. So even if I use datatype "double" my calculation will go for a toss. To confirm this I wrote a sample code given below.
```
#define PROBABILITY_OF_UNLIKELY_SPAM_WORD (0.01)
#define PROBABILITY_OF_MOSTLY_SPAM_WORD (0.99)
int main()
{
int index;
long double numerator = 1.0;
long double denom1 = 1.0, denom2 = 1.0;
long double doc_spam_prob;
/* Simulating FEW unlikely spam words */
for(index = 0; index < 162; index++)
{
numerator = numerator*(long double)PROBABILITY_OF_UNLIKELY_SPAM_WORD;
denom2 = denom2*(long double)PROBABILITY_OF_UNLIKELY_SPAM_WORD;
denom1 = denom1*(long double)(1 - PROBABILITY_OF_UNLIKELY_SPAM_WORD);
}
/* Simulating lot of mostly definite spam words */
for (index = 0; index < 1000; index++)
{
numerator = numerator*(long double)PROBABILITY_OF_MOSTLY_SPAM_WORD;
denom2 = denom2*(long double)PROBABILITY_OF_MOSTLY_SPAM_WORD;
denom1 = denom1*(long double)(1- PROBABILITY_OF_MOSTLY_SPAM_WORD);
}
doc_spam_prob= (numerator/(denom1+denom2));
return 0;
}
```
I tried Float, double and even long double datatypes but still same problem.
Hence, say in a 100K words document I am analyzing, if just 162 words are having 1% spam probability and remaining 99838 are conspicuously spam words, then still my app will say it as Not Spam doc because of Precision error (as numerator easily goes to ZERO)!!!.
This is the first time I am hitting such issue. So how exactly should this problem be tackled?
| Problem with Precision floating point operation in C | CC BY-SA 2.5 | 0 | 2010-04-22T13:09:55.183 | 2012-09-15T23:12:42.193 | 2017-02-08T14:24:19.267 | -1 | 298,519 | [
"c",
"floating-point",
"machine-learning",
"spam-prevention"
] |
2,691,393 | 1 | 2,922,482 | null | 7 | 10,105 | I use Richfaces, Seam and JSF, and I want something like the following:

and I have managed it to a degree using a rich:subtable like this:
```
<rich:dataTable
value="#{backingBean.companyList}"
rows="100"
var="company">
<f:facet name="header">
<rich:columnGroup>
<rich:column>Company Name</rich:column>
<rich:column>Company Email</rich:column>
<rich:column>Product Name</rich:column>
<rich:column>Product Email</rich:column>
</rich:columnGroup>
</f:facet>
<rich:subTable value="#{company.products}" var="product" rowKeyVar="rowKey">
<rich:column rowspan="#{company.products.size()}" rendered="#{rowKey eq 0}">
#{company.name}
</rich:column>
<rich:column rowspan="#{company.products.size()}" rendered="#{rowKey eq 0}">
#{company.email}
</rich:column>
<rich:column>
#{product.name}
</rich:column>
<rich:column>
#{product.email}
</rich:column>
</rich:subTable>
```
the problem is that companies that have products, do not get rendered at all. What I want would be for them to be rendered, and the remaining row (the product-specific columns) to be empty.
Is there a way to do this?
I have also tried nested rich:datatables, but the internal columns do not overlap with the outer columns containing the header. With rich:subtable the inner columns overlap with the outer columns and show nice.
I created a Google Code project (a simple Maven project) that shows exactly what the problem is.
[http://code.google.com/p/richfaces-rowspan/](http://code.google.com/p/richfaces-rowspan/)
| Richfaces: rich:datatable rowspan using rich:subtable | CC BY-SA 2.5 | 0 | 2010-04-22T13:54:29.030 | 2010-05-27T15:30:00.480 | 2010-05-05T17:47:41.943 | 125,713 | 125,713 | [
"java",
"jsf",
"jakarta-ee",
"datatable",
"richfaces"
] |
2,691,726 | 1 | 15,768,802 | null | 10 | 8,426 | I'm using SetWindowTheme and SendMessage to make a .net listview look like a vista style listview, but the .net control still has a dotted selection border around the selected item:

Selected items in the explorer listview don't have that border around them. How can I remove it?
Windows Explorer:

Edit: Solution:
```
public static int MAKELONG(int wLow, int wHigh)
{
int low = (int)LOWORD(wLow);
short high = LOWORD(wHigh);
int product = 0x00010000 * (int)high;
int makeLong = (int)(low | product);
return makeLong;
}
SendMessage(olv.Handle, WM_CHANGEUISTATE, Program.MAKELONG(UIS_SET, UISF_HIDEFOCUS), 0);
```
| How can I remove the selection border on a ListViewItem | CC BY-SA 3.0 | 0 | 2010-04-22T14:33:52.190 | 2022-09-23T19:27:52.330 | 2017-04-10T22:34:12.327 | 2,682,312 | 149,986 | [
"c#",
".net",
"winforms",
"listview",
"listviewitem"
] |
2,693,336 | 1 | 2,696,720 | null | 19 | 20,932 | I installed Xcode a long time ago.
Apparently I didn't check back then the "UNIX Development Support" checkbox.
Now I want to have them but when I click on the installation this is what appears:

The check box is disabled
How can I install the UNIX Development Support? Is there a way to run some script that creates all the needed links from `/Developer/` to `/usr/bin` ?
Note: This is for old Xcode 3. Screens and tool names differ for Xcode 4 ("Unix Command Line Tools")
| How to update Xcode to install "UNIX Development Support"? | CC BY-SA 3.0 | 0 | 2010-04-22T18:19:07.320 | 2017-08-09T03:10:51.493 | 2017-08-08T21:21:20.690 | 3,167,040 | 20,654 | [
"xcode",
"macos",
"unix",
"xcode3.2"
] |
2,694,236 | 1 | 2,716,157 | null | 2 | 4,378 | I am having an issue when a page contains multiple ModalPopups each containing a ValidationSummary Control.
Here is the functionality I need:
1. A user clicks a button and a Modal Popup appears with dynamic content based on the button that was clicked. (This functionality is working. Buttons are wrapped in UpdatePanels and the partial page postback calls .Show() on the ModalPopup)
2. "Save" button in ModalPopup causes client side validation, then causes a full page postback so the entire ModalPopup disappears. (ModalPopup could disappear another way - the ModalPopup just needs to disappear after a successful save operation)
3. If errors occur in the codebehind during Save operation, messages are added to the ValidationSummary (contained within the ModalPopup) and the ModalPopup is displayed again.
When the ValidationSummary's are added to the PopupPanel's, the ModalPopups no longer display correctly after a full page postback caused by the "Save" button within the second PopupPanel. (the first panel continues to function correctly) Both PopupPanels are displayed, and neither is "Popped-Up", they are displayed in-line.
Any ideas on how to solve this?
EDIT: Functionality in each Popup is different - that is why there must be two different ModalPopups.
EDIT 2: Javascript error I was receiving:
function () {
Array.remove(Page_ValidationSummaries, document.getElementById(VALIDATION_SUMMARY_ID));
}
(function () {
var fn = function () {
AjaxControlToolkit.ModalPopupBehavior.invokeViaServer("MODAL_POPUP_ID", true);
Sys.Application.remove_load(fn);
};
Sys.Application.add_load(fn);
})
Image of Error State (after "PostBack Popup2" button has been clicked)

ASPX markup
```
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<%--*********************************************************************
Popup1
*********************************************************************--%>
<asp:UpdatePanel ID="Popup1ShowButtonUpdatePanel" runat="server">
<ContentTemplate>
<%--This button will cause a partial page postback and pass a parameter to the Popup1ModalPopup in code behind
and call its .Show() method to make it visible--%>
<asp:Button ID="Popup1ShowButton" runat="server" Text="Show Popup1" OnClick="Popup1ShowButton_Click"
CommandArgument="1" />
</ContentTemplate>
</asp:UpdatePanel>
<%--Hidden Control is used as ModalPopup's TargetControlID .Usually this is the ID of control that causes the Popup,
but we want to control the modal popup from code behind --%>
<asp:HiddenField ID="Popup1ModalPopupTargetControl" runat="server" />
<ajax:ModalPopupExtender ID="Popup1ModalPopup" runat="server" TargetControlID="Popup1ModalPopupTargetControl"
PopupControlID="Popup1PopupControl" CancelControlID="Popup1CancelButton">
</ajax:ModalPopupExtender>
<asp:Panel ID="Popup1PopupControl" runat="server" CssClass="ModalPopup" Style="width: 600px;
background-color: #FFFFFF; border: solid 1px #000000;">
<%--This button causes validation and a full-page post back. Full page postback will causes the ModalPopup to be Hid.
If there are errors in code behind, the code behind will add a message to the ValidationSummary,
and make the ModalPopup visible again--%>
<asp:Button ID="Popup1PostBackButton" runat="server" Text="PostBack Popup1" OnClick="Popup1PostBackButton_Click" />
<asp:Button ID="Popup1CancelButton" runat="server" Text="Cancel Popup1" />
<asp:UpdatePanel ID="Popup1UpdatePanel" runat="server">
<ContentTemplate>
<%--*************ISSUE HERE***************
The two ValidationSummary's are causing an issue. When the second ModalPopup's PostBack button is clicked,
Both ModalPopup's become visible, but neither are "Popped-Up".
If ValidationSummary's are removed, both ModalPopups Function Correctly--%>
<asp:ValidationSummary ID="Popup1ValidationSummary" runat="server" />
<%--Will display dynamically passed paramter during partial page post-back--%>
Popup1 Parameter:<asp:Literal ID="Popup1Parameter" runat="server"></asp:Literal><br />
</ContentTemplate>
</asp:UpdatePanel>
<br />
<br />
<br />
</asp:Panel>
<br />
<br />
<br />
<%--*********************************************************************
Popup2
*********************************************************************--%>
<asp:UpdatePanel ID="Popup2ShowButtonUpdatePanel" runat="server">
<ContentTemplate>
<%--This button will cause a partial page postback and pass a parameter to the Popup2ModalPopup in code behind
and call its .Show() method to make it visible--%>
<asp:Button ID="Popup2ShowButton" runat="server" Text="Show Popup2" OnClick="Popup2ShowButton_Click"
CommandArgument="2" />
</ContentTemplate>
</asp:UpdatePanel>
<%--Hidden Control is used as ModalPopup's TargetControlID .Usually this is the ID of control that causes the Popup,
but we want to control the modal popup from code behind --%>
<asp:HiddenField ID="Popup2ModalPopupTargetControl" runat="server" />
<ajax:ModalPopupExtender ID="Popup2ModalPopup" runat="server" TargetControlID="Popup2ModalPopupTargetControl"
PopupControlID="Popup2PopupControl" CancelControlID="Popup2CancelButton">
</ajax:ModalPopupExtender>
<asp:Panel ID="Popup2PopupControl" runat="server" CssClass="ModalPopup" Style="width: 600px;
background-color: #FFFFFF; border: solid 1px #000000;">
<%--This button causes validation and a full-page post back. Full page postback will causes the ModalPopup to be Hid.
If there are errors in code behind, the code behind will add a message to the ValidationSummary,
and make the ModalPopup visible again--%>
<asp:Button ID="Popup2PostBackButton" runat="server" Text="PostBack Popup2" OnClick="Popup2PostBackButton_Click" />
<asp:Button ID="Popup2CancelButton" runat="server" Text="Cancel Popup2" />
<asp:UpdatePanel ID="Popup2UpdatePanel" runat="server">
<ContentTemplate>
<%--*************ISSUE HERE***************
The two ValidationSummary's are causing an issue. When the second ModalPopup's PostBack button is clicked,
Both ModalPopup's become visible, but neither are "Popped-Up".
If ValidationSummary's are removed, both ModalPopups Function Correctly--%>
<asp:ValidationSummary ID="Popup2ValidationSummary" runat="server" />
<%--Will display dynamically passed paramter during partial page post-back--%>
Popup2 Parameter:<asp:Literal ID="Popup2Parameter" runat="server"></asp:Literal><br />
</ContentTemplate>
</asp:UpdatePanel>
<br />
<br />
<br />
</asp:Panel>
```
Code Behind
```
protected void Popup1ShowButton_Click(object sender, EventArgs e)
{
Button btn = sender as Button;
//Dynamically pass parameter to ModalPopup during partial page postback
Popup1Parameter.Text = btn.CommandArgument;
Popup1ModalPopup.Show();
}
protected void Popup1PostBackButton_Click(object sender, EventArgs e)
{
//if there is an error, add a message to the validation summary and
//show the ModalPopup again
//TODO: add message to validation summary
//show ModalPopup after page refresh (request/response)
Popup1ModalPopup.Show();
}
protected void Popup2ShowButton_Click(object sender, EventArgs e)
{
Button btn = sender as Button;
//Dynamically pass parameter to ModalPopup during partial page postback
Popup2Parameter.Text = btn.CommandArgument;
Popup2ModalPopup.Show();
}
protected void Popup2PostBackButton_Click(object sender, EventArgs e)
{
//***********After This is when the issue appears**********************
//if there is an error, add a message to the validation summary and
//show the ModalPopup again
//TODO: add message to validation summary
//show ModalPopup after page refresh (request/response)
Popup2ModalPopup.Show();
}
```
| Issue with Multiple ModalPopups, ValidationSummary and UpdatePanels | CC BY-SA 2.5 | null | 2010-04-22T20:29:00.407 | 2017-05-24T15:40:18.920 | 2017-02-08T14:24:23.040 | -1 | 47,226 | [
"asp.net",
"updatepanel",
"ajaxcontroltoolkit",
"modalpopupextender",
"validationsummary"
] |
2,695,399 | 1 | 2,695,452 | null | 1 | 238 | I'm using ASP.NET MVC 2.

Keeping it simple, I have three payment types: credit card, e-check, or "bill me later". I want to:
1. choose one payment type
2. display some fields for one payment type in my view
3. run some logic using those fields (specific to the type)
4. display a confirmation view
5. run some more logic using those fields (specific to the type)
6. display a receipt view
Each payment type has fields specific to the type... maybe 2 fields, maybe more. For now, I know how many and what fields, but more could be added. I believe the best thing for my views is to have a partial view per payment type to handle the different fields and let the controller decide which partial to render (if you have a better option, I'm open). My real problem comes from the logic that happens in the controller between views. Each payment type has a variable number of fields. I'd like to keep everything strongly typed, but it feels like some sort of dictionary is the only option. Add to that specific logic that runs depending on the payment type.
In an effort to keep things strongly typed, I've created a class for each payment type. No interface or inherited type since the fields are different per payment type. Then, I've got a Submit() method for each payment type. Then, while the controller is deciding which partial view to display, it also assigns the target of the submit action.
This is not elegant solution and feels very wrong. I'm reaching out for a hand. How would you do this?
| How to handle payment types with varying properties in the most elegant way | CC BY-SA 2.5 | null | 2010-04-23T00:11:52.483 | 2010-05-24T20:20:54.753 | 2017-02-08T14:24:23.733 | -1 | 205,753 | [
"c#",
"asp.net-mvc",
"design-patterns"
] |
2,695,794 | 1 | null | null | 0 | 2,078 | 
To me, this looks like a UITableViewCell, but with rounded corners. I also want the behavior of my "button" to do behave the same way as in the timer App. How do I do it?
EDIT: By "button" I mean the one that says "When Timer Ends". again, to me it looks like a TableViewCell. Thanks for the speedy responses guys.
| How to make a button look like this? (the iPhone's Timer App) | CC BY-SA 2.5 | null | 2010-04-23T02:19:59.537 | 2013-01-10T13:00:42.963 | 2017-02-08T14:24:24.080 | -1 | 83,883 | [
"iphone",
"uitableview"
] |
2,698,537 | 1 | 2,699,141 | null | 2 | 3,999 | Here's a weird bug I've found, IE8 is duplicating my div, but only a part of it.
How it looks in IE8:

And here's how it's meant to look in FF:

And the HTML:
```
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
\/\/\
<div id="roundbigbox">
<p id="pro">Produkter</p>
<div id="titles">
<div id="thinlinecopy"></div>
<div id="varekodetext">
<p>Varekode</p>
</div>
<div id="produkttext">
<p>Produkt</p>
</div>
<div id="pristext">
<p>Pris</p>
</div>
<div id="antalltext">
<p>Antall</p>
</div>
<div id="pristotaltext">
<p>Pris total</p>
</div>
<div id="sletttext">
<p>Slett</p></div>
<div id="thinline"></div>
</div>
...content...
<div class="delete">
<a id="slett" href="/order/delete/1329?return=" title="Slett"><!--Slett--></a>
</div>
</div>
```
CSS for FF:
```
div #roundbigbox {
background-image:url(../../upload/EW_p_og_L.png);
background-position:top center;
background-repeat:no-repeat;
padding:5px;
padding-top:10px;
padding-bottom:0px;
width:760px;
height:1%;
border-width:1px;
border-color:#dddddd;
border-radius:10px;
-moz-border-radius:10px;
-webkit-border-radius:10px;
z-index:1;
position:relative;
overflow:hidden;
margin:0;
margin-bottom:10px;
}
```
CSS for IE:
```
div #roundbigbox {
background-image:url(../../upload/EW_p_og_L.png);
background-position:top center;
background-repeat:no-repeat;
padding:5px;
padding-right:50px;
padding-top:10px;
width:760px;
height:1%;
border-width:1px;
border-color:#dddddd;
z-index:1;
position:relative;
overflow:hidden;
margin:0;
margin-bottom:10px;
}
```
What could cause such a weird bug? It's not duplicated in the HTML. I am stumped!
: There a lot of other divs inside, one after the other.
Thanks for any responses.
| Weird duplicate IE div | CC BY-SA 2.5 | 0 | 2010-04-23T12:44:25.270 | 2013-01-25T18:55:40.333 | 2017-02-08T14:24:26.130 | -1 | 287,047 | [
"html",
"css",
"internet-explorer"
] |
2,700,060 | 1 | 2,700,635 | null | 3 | 363 | I'm creating a standalone WPF app with multi-language support. I've found some great resources (mostly on SO) on how to store and access the strings as needed. This part is pretty straightforward and doable, but I'm fuzzy on how to take care of screen layout issues.
I'm using some custom images to skin up my app for buttons, etc. For instance, here's a button with some text within:
```
<Button
Canvas.Left="33"
Canvas.Top="484"
Style="{StaticResource SmallButtonBase}">
<TextBlock
FontSize="20"
FontWeight="Bold"
TextAlignment="Center" FontFamily="Helvetica">
Enter
</TextBlock>
</Button>
```

Now here is the same button with text from another language:
```
<Button
Canvas.Left="33"
Canvas.Top="484"
Style="{StaticResource SmallButtonBase}">
<TextBlock
FontSize="20"
FontWeight="Bold"
TextAlignment="Center" FontFamily="Helvetica">
Enterenschtein
</TextBlock>
</Button>
```

So my question is: What is a good method to prevent this "overflow" situation. I'd like to have XAML take care of any font resizing or indenting that is needed automatically so that I don't have to tweak the UI for each language I'm supporting.
Any insight is appreciated!
p.s. Here's the XAML for SmallButtonBase. It basically defines what happens when the button has focus or is pressed. A different image is used for each case.
```
<Style x:Key="SmallButtonBase" TargetType="Button">
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid x:Name="Container">
<Image x:Name="Img" Source="/Resources/Elements/Buttons/10.png" Margin="6" />
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsKeyboardFocused" Value="True">
<Setter TargetName="Img" Property="Source" Value="/Resources/Elements/Buttons/11.png" />
<Setter TargetName="Img" Property="Margin" Value="0" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsKeyboardFocused" Value="True" />
<Condition Property="IsPressed" Value="True" />
</MultiTrigger.Conditions>
<Setter TargetName="Img" Property="Source" Value="/Resources/Elements/Buttons/12.png" />
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
```
| What's the best way to handle layout issues with multi-language support in WPF/XAML? | CC BY-SA 2.5 | 0 | 2010-04-23T16:01:31.737 | 2010-04-23T17:30:11.513 | 2010-04-23T16:58:20.213 | 178,173 | 178,173 | [
"wpf",
"xaml",
"skin",
"multilingual"
] |
2,702,087 | 1 | 2,707,389 | null | 2 | 845 | I'm currently in the process of upgrading old II6 automation scripts that use the [IISVdir](http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/82373078-e14f-4f20-9a1f-883c2e94dc8d.mspx?mfr=true) tool to create/modify/update apps and virtual directories, and replacing them with [AppCmd](http://learn.iis.net/page.aspx/114/getting-started-with-appcmdexe/) for IIS7.
The IIS6, "IISVDir" commands reference paths in that are from the metabase, eg, `/W3SVC/1/ROOT/MyApp` - where 1 is ID of "Default Web Site". The command doesn't actually require the display name of the site to make changes to it.
This works well, since on a different language OS, the "Default Web Site" site name could be named, for example, "既定の Web サイト" or anything else for that matter. But this flexibility is lost if AppCmd can only reference "Default Web Site" via its name, and not a language-neutral identifier.
So, how can I script AppCmd to refer to sites, vdirs and apps using language neutral identifiers to reference the "Default App Site"?
Perhaps I need to start creating my own site instead, from the start, and name it something else specific, and stop using "Default Web Site" as the root?

(Disclosure: I only have a IIS7-English machine that I am working on currently, but I have both IIS6-English and IIS6-Japanese machines for testing my old scripts - so perhaps it really is just "Default Web Site" still on IIS7-Japanese?)
| How do I use IIS6 style metabase paths in IIS7 AppCmd tool? | CC BY-SA 2.5 | null | 2010-04-23T21:28:29.957 | 2010-04-25T06:30:14.023 | 2010-04-23T21:49:23.627 | 101,827 | 101,827 | [
"iis-7",
"iis-6",
"internationalization",
"appcmd",
"iisvdir"
] |
2,706,259 | 1 | 2,706,306 | null | 0 | 339 | I have a settings window and am trying to set it up so that there is a live preview what the main window will look like with the current settings.
Here is a picture of what the settings dialog looks like at the moment. The big black rectangle will be the preview.

| MVVM- Is there any way I can bind the visual of a visual brush to another window? | CC BY-SA 2.5 | null | 2010-04-24T21:36:30.773 | 2010-04-24T22:24:49.943 | 2017-02-08T14:24:30.243 | -1 | 268,336 | [
"wpf",
"mvvm",
"visualbrush"
] |
2,706,969 | 1 | null | null | 1 | 1,092 | I've been messing around with string.replace and I noticed something very odd with Webkit and Firebug's javascript consoles.
I can repeat this behavior in a blank browser window. (Look at the first and last lines)
```
>>> "/literature?page=".replace(/page=/i, "page=2")
"/literature?page="
>>> "/literature?page=".replace("page=", "page=2")
"/literature?page=2"
>>> "/literature?page=".replace(/page=/, "page=2")
"/literature?page=2"
>>> "/literature?page=".replace(/page=/i, "page=2")
"/literature?page=2"
```
Just so nobody thinks I mistyped something, here are screenshots.


| Javascript undefined behavior with string.replace | CC BY-SA 2.5 | null | 2010-04-25T02:52:36.643 | 2010-04-25T03:01:24.300 | 2017-02-08T14:24:30.913 | -1 | 16,204 | [
"javascript",
"undefined-behavior"
] |
2,708,132 | 1 | 2,708,196 | null | 0 | 333 | As the question says, for some reason my program is not flushing the input or using my variables in ways that I cannot identify at the moment. This is for a homework project that I've gone beyond what I had to do for it, now I just want the program to actually work :P
Details to make the finding easier:
The program executes flawlessly on the first run through. All throws work, only the proper values( n > 0 ) are accepted and turned into binary.
As soon as I enter my terminate input, the program goes into a loop and only asks for the terminate again like so:

When I run this program on Netbeans on my Linux Laptop, the program crashes after I input the terminate value. On Visual C++ on Windows it goes into the loop like just described.
In the code I have tried to clear every stream and initialze every variable new as the program restarts, but to no avail. I just can't see my mistake.
I believe the error to lie in either the main function:
```
int main( void )
{
vector<int> store;
int terminate = 1;
do
{
int num = 0;
string input = "";
if( cin.fail() )
{
cin.clear();
cin.ignore( numeric_limits<streamsize>::max(), '\n' );
}
cout << "Please enter a natural number." << endl;
readLine( input, num );
cout << "\nThank you. Number is being processed..." << endl;
workNum( num, store );
line;
cout << "Go again? 0 to terminate." << endl;
cin >> terminate // No checking yet, just want it to work!
cin.clear();
}while( terminate );
cin.get();
return 0;
}
```
or in the function that reads the number:
```
void readLine( string &input, int &num )
{
int buf = 1;
stringstream ss;
vec_sz size;
if( ss.fail() )
{
ss.clear();
ss.ignore( numeric_limits<streamsize>::max(), '\n' );
}
if( getline( cin, input ) )
{
size = input.size();
for( int loop = 0; loop < size; ++loop )
if( isalpha( input[loop] ) )
throw domain_error( "Invalid Input." );
ss << input;
ss >> buf;
if( buf <= 0 )
throw domain_error( "Invalid Input." );
num = buf;
ss.clear();
}
}
```
| Input not cleared | CC BY-SA 3.0 | null | 2010-04-25T12:08:32.450 | 2014-08-11T10:18:00.607 | 2017-02-08T14:24:31.960 | -1 | 320,124 | [
"c++",
"input",
"flush"
] |
2,708,476 | 1 | 14,498,790 | null | 35 | 29,767 | NB: I'll present this question in degrees purely for simplicity, radians, degrees, different zero-bearing, the problem is essentially the same.
Does anyone have any ideas on the code behind rotational interpolation? Given a linear interpolation function: Lerp(from, to, amount), where amount is 0...1 which returns a value between from and to, by amount. How could I apply this same function to a rotational interpolation between 0 and 360 degrees? Given that degrees should not be returned outside 0 and 360.
Given this unit circle for degrees:

where from = 45 and to = 315, the algorithm should take the shortest path to the angle, i.e. it should go through zero, to 360 and then to 315 - and not all the way round 90, 180, 270 to 315.
Is there a nice way to achieve this? Or is it going to just be a horrid mess of if() blocks? Am I missing some well understood standard way of doing this?
Any help would be appreciated.
| Rotation Interpolation | CC BY-SA 3.0 | 0 | 2010-04-25T14:07:21.950 | 2021-11-16T17:37:58.333 | 2016-09-02T12:23:54.403 | 63,399 | 63,399 | [
"math",
"rotation",
"interpolation"
] |
2,708,700 | 1 | null | null | 2 | 3,263 | In my latex document i've set `\hyphenpenalty=15000` and `\pretolerance=10000` to remove word hyphenation and make text bounds even.
But I can't disable this effect for section/subsection headers. All headers looks badly due to big spaces between words.
---

---
Are there any solution to disable `\hyphenpenalty=15000` and `\pretolerance=10000` effect for headers?
Thank you!
| How to remove \hyphenpenalty & \pretolerance influence on section/subsection headers | CC BY-SA 3.0 | null | 2010-04-25T15:13:46.243 | 2016-06-03T16:04:36.963 | 2017-02-08T14:24:32.297 | -1 | 272,814 | [
"latex",
"header",
"alignment",
"miktex"
] |
2,709,736 | 1 | 2,709,748 | null | 0 | 524 | after clicking on button in asp.net application runs edmgen tool with arguments. And I catch error :

```
var cs =ConfigurationManager.ConnectionStrings["ApplicationServices"].ConnectionString;
string myArgs="/mode:fullgeneration /c:\""+cs+"\" /project:nwd /entitycontainer:SchoolEntities /namespace:SchoolModel /language:CSharp ";
string filename= GetFrameworkDirectory() + "\\EdmGen.exe";
ProcessStartInfo startInfo = new ProcessStartInfo(filename,myArgs);
startInfo.UseShellExecute = false;
//startInfo.RedirectStandardError = true;
Process myGenProcess = Process.Start(startInfo);
//genInfo.Text = myGenProcess.StandardError.ReadToEnd();
```
How to fix this?
| Process.Start() edmgen | CC BY-SA 2.5 | null | 2010-04-25T20:01:43.540 | 2010-04-25T20:16:13.073 | 2017-02-08T14:24:32.653 | -1 | 211,452 | [
"c#",
".net",
"entity-framework",
"process",
"edmgen"
] |
2,710,010 | 1 | 2,710,030 | null | 5 | 1,736 | I have two and I am trying to find out their [Longest Common Substring](http://en.wikipedia.org/wiki/Longest_common_substring_problem).
One way is using (supposed to have a very good complexity, though a complex implementation), and the another is the (both are mentioned on the Wikipedia page linked above).

The problem is that the dynamic programming method has a huge running time (complexity is `O(n*m)`, where `n` and `m` are lengths of the two strings).
What I want to know (before jumping to implement suffix trees):
| How to speed up calculation of length of longest common substring? | CC BY-SA 2.5 | 0 | 2010-04-25T21:19:26.447 | 2015-11-16T05:21:28.743 | 2017-02-08T14:24:32.997 | -1 | 113,124 | [
"c++",
"algorithm",
"dynamic-programming",
"suffix-tree",
"lcs"
] |
2,710,536 | 1 | 2,710,604 | null | 2 | 468 | I asked for help earlier on Stackoverflow involving highlighting spans with the same Class when a mouse hovers over any Span with that same Class.
It is working great:
[How can I add a border to all the elements that share a class when the mouse has hovered over one of them using jQuery?](https://stackoverflow.com/questions/2709686/how-can-i-add-a-border-to-all-the-elements-that-share-a-class-when-the-mouse-has)
```
$('span[class]').hover(
function() {
$('.' + $(this).attr('class')).css('background-color','green');
},
function() {
$('.' + $(this).attr('class')).css('background-color','yellow');
}
)
```
Here is an example of it in usage:
[http://dl.dropbox.com/u/638285/0utput.html](http://dl.dropbox.com/u/638285/0utput.html)
However, it doesn't appear to work properly in IE8, while it DOES work in Chrome/Firefox.
Here is a screenshot of it in IE8, with my mouse hovered over the `"> min) { min"` section in the middle.

As you can see, it highlighted the span that the mouse is hovering over perfectly fine. However, it has also highlighted some random spans above and below it that don't have the same class! Only the span's with the same Class as the one where the mouse is over should be highlighted green. In this screenshot, only that middle green section should be green.
Here is a screenshot of it working properly in Firefox/Chrome with my mouse in the exact same position:

This screenshot is correct as the span that the mouse is over (the green section) is the only one in this section that shares that class.
Why is IE8 randomly green-highlighting spans when it shouldn't be (they don't share the same class) using my little jQuery snippet?
Again, if you want to see it live I have it here:
[http://dl.dropbox.com/u/638285/0utput.html](http://dl.dropbox.com/u/638285/0utput.html)
| Why doesn't this jQuery snippet work in IE8 like it does in Firefox or Chrome (Live Demo Included)? | CC BY-SA 2.5 | null | 2010-04-26T00:30:17.120 | 2010-04-26T04:00:50.660 | 2017-05-23T12:01:15.100 | -1 | 319,501 | [
"javascript",
"jquery",
"html",
"css",
"internet-explorer-8"
] |
2,710,751 | 1 | 2,710,996 | null | 0 | 2,823 | I'm trying to use the OleDb CSV parser to load some data from a CSV file and insert it into a SQLite database, but I get an exception with the `OleDbAdapter.Fill` method and it's frustrating:
> An unhandled exception of type
'System.Data.ConstraintException'
occurred in System.Data.dllAdditional information: Failed to
enable constraints. One or more rows
contain values violating non-null,
unique, or foreign-key constraints.
Here is the source code:
```
public void InsertData(String csvFileName, String tableName)
{
String dir = Path.GetDirectoryName(csvFileName);
String name = Path.GetFileName(csvFileName);
using (OleDbConnection conn =
new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +
dir + @";Extended Properties=""Text;HDR=No;FMT=Delimited"""))
{
conn.Open();
using (OleDbDataAdapter adapter = new OleDbDataAdapter("SELECT * FROM " + name, conn))
{
QuoteDataSet ds = new QuoteDataSet();
adapter.Fill(ds, tableName); // <-- Exception here
InsertData(ds, tableName); // <-- Inserts the data into the my SQLite db
}
}
}
class Program
{
static void Main(string[] args)
{
SQLiteDatabase target = new SQLiteDatabase();
string csvFileName = "D:\\Innovations\\Finch\\dev\\DataFeed\\YahooTagsInfo.csv";
string tableName = "Tags";
target.InsertData(csvFileName, tableName);
Console.ReadKey();
}
}
```
The "YahooTagsInfo.csv" file looks like this:
```
tagId,tagName,description,colName,dataType,realTime
1,s,Symbol,symbol,VARCHAR,FALSE
2,c8,After Hours Change,afterhours,DOUBLE,TRUE
3,g3,Annualized Gain,annualizedGain,DOUBLE,FALSE
4,a,Ask,ask,DOUBLE,FALSE
5,a5,Ask Size,askSize,DOUBLE,FALSE
6,a2,Average Daily Volume,avgDailyVolume,DOUBLE,FALSE
7,b,Bid,bid,DOUBLE,FALSE
8,b6,Bid Size,bidSize,DOUBLE,FALSE
9,b4,Book Value,bookValue,DOUBLE,FALSE
```
I've tried the following:
1. Removing the first line in the CSV file so it doesn't confuse it for real data.
2. Changing the TRUE/FALSE realTime flag to 1/0.
3. I've tried 1 and 2 together (i.e. removed the first line and changed the flag).
None of these things helped...
One constraint is that the tagId is supposed to be unique. Here is what the table look like in design view:

Can anybody help me figure out what is the problem here?
I changed the HDR property from `HDR=No` to `HDR=Yes` and now it doesn't give me an exception:
```
OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + dir + @";Extended Properties=""Text;HDR=Yes;FMT=Delimited""");
```
I assumed that if `HDR=No` and I removed the header (i.e. first line), then it should work... strangely it didn't work. In any case, now I'm no longer getting the exception.
The new problem arose here: [SQLiteDataAdapter Update method returning 0](https://stackoverflow.com/questions/2711021/sqlitedataadapter-update-method-returning-0)
| SQLiteDataAdapter Fill exception | CC BY-SA 2.5 | null | 2010-04-26T02:12:03.120 | 2010-04-27T17:34:30.207 | 2017-05-23T12:08:51.063 | -1 | 28,760 | [
"c#",
"exception",
"ado.net",
"oledb"
] |
2,711,854 | 1 | 2,712,958 | null | 3 | 4,372 | I want 3 components laid out on 2 lines, so that the bottom component and the top-right component use all available horizontal space.
```
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.setLayout(new MigLayout("debug, fill"));
Container cp = frame.getContentPane();
cp.add(new JTextField("component 1"), "");
cp.add(new JTextField("component 2"), "growx,push,wrap");
cp.add(new JTextField("component 3"), "span,growx,push");
frame.pack();
frame.setVisible(true);
```
Considering the above, how do i stop the space between "component 1" and "component 2" from appearing when resizing the frame?

| mig layout - span and grow/push spacing | CC BY-SA 3.0 | null | 2010-04-26T07:57:32.743 | 2014-10-01T10:41:41.163 | 2014-10-01T10:41:41.163 | 1,820,501 | 145,574 | [
"java",
"swing",
"miglayout"
] |
2,712,350 | 1 | 2,712,430 | null | 16 | 30,678 | I have a server-generated html like:
```
<ul>
<li><!-- few nested elements that form a block --></li>
<li><!-- few nested elements that form anaother block --></li>
<li><!-- etc, X times --></li>
</ul>
```
All blocks have known width 200px and unknown height. I want `<li>` to be arranged in table-like fashion like this:

What I have for now is following css:
```
li {
display: block;
width: 200px;
float: left;
margin: 10px;
}
```
All is fine except that columns don't get equal height. And in example above block #4 “snatch” at #1 and the result isn't what I'm trying to achieve:

Is there any pure-CSS cross-browser way that will allow grid layout I want and will not enforce markup change?
| UL+CSS for grid layout | CC BY-SA 2.5 | 0 | 2010-04-26T09:36:22.510 | 2010-04-26T09:48:45.677 | 2017-02-08T14:24:35.393 | -1 | 57,868 | [
"html",
"css",
"layout"
] |
2,712,454 | 1 | 2,713,225 | null | 0 | 387 | I've been working on a site for a while changing the layout and skin of a webshop checkout process. I've noticed that if you go the process until the last page, then click the link to go back to the view products page, the delivery method price displays underneath the navigation buttons, until you refresh and it goes away again.
I've downloaded both sources from the browser (Chrome, but this bug applies to all browsers) and used a [file difference tool](http://www.ranks.nl) to display the differences, the result being only:
```
< error.html
vs
> normal.html
34c34
< <link href="gzip.php?file=167842c1496093fbcd391b41cf7b03da.css&time=1272272181" rel="Stylesheet" type="text/css"/>
---
> <link href="gzip.php?file=167842c1496093fbcd391b41cf7b03da.css&time=1272272348" rel="Stylesheet" type="text/css"/>
```
Which is just the way it zips up the CSS stylesheets. (afaik)
Has anyone ever encountered such a problem, or anything similar?
Normal:

Error:

I can't even hazard a guess as to what is causing this, at all. I've searched over Google for anything and come up with nothing.
There isn't even any markup in this sourcecode to display the leveringsmåte (Delivery method) div.
What could be causing this?
The site in question is [Euroworker.no](http://euroworker.no).
[HTML @ Pastebin](http://pastebin.com/TRnNDnUU).
Smarty snippet:
```
{if !$CANONICAL}
{canonical}{self}{/canonical}
{/if}
<link rel="canonical" href="{$CANONICAL}" />
<!-- Css includes -->
{includeCss file="frontend/Frontend.css"}
{includeCss file="backend/stat.css"}
{if {isRTL}}
{includeCss file="frontend/FrontendRTL.css"}
{/if}
{compiledCss glue=true nameMethod=hash}
<!--[if lt IE 8]>
<link href="stylesheet/frontend/FrontendIE.css" rel="Stylesheet" type="text/css"/>
{if $ieCss}
<link href="{$ieCss}" rel="Stylesheet" type="text/css"/>
{/if}
<![endif]-->
```
Thanks.
: Just used DOM Inspector and found this:
```
<TD class="amount shippingAmount">138.-</TD>
```
Which is in the last page of the process.. Why would this be carrying over?
Got this from NET tab in Firebug,
```
GET order
Response Headersview source
Date Mon, 26 Apr 2010 11:20:06 GMT
Server Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5.10 with Suhosin-Patch mod_ssl/2.2.8 OpenSSL/0.9.8g
X-Powered-By PHP/5.2.4-2ubuntu5.10
Expires Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma no-cache
Content-Encoding gzip
Content-Length 5244
Keep-Alive timeout=15, max=96
Connection Keep-Alive
Content-Type text/html;charset=utf-8
Request Headersview source
Host www.euroworker.no
User-Agent Mozilla/5.0 (Windows; U; Windows NT 6.0; nb-NO; rv:1.9.1.9) Gecko/20100315 Firefox/3.5.9 (.NET CLR 3.5.30729)
Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language nb,no;q=0.8,nn;q=0.6,en-us;q=0.4,en;q=0.2
Accept-Encoding gzip,deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive 300
Connection keep-alive
Referer http://www.euroworker.no/checkout/pay
Cookie PHPSESSID=f5bd84668603decd779c5945d2de045c; __utma=259297566.1176642152.1271066660.1272267705.1272280025.34; __utmz=259297566.1271066660.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utmb=259297566.7.10.1272280025; __utmc=259297566
```
When I click on HTML for the GET order tab, it appears to be getting the Leveringsmåte TD from the previous page and just adding it in there.
| "Ghost" values in PHP/Smarty | CC BY-SA 2.5 | null | 2010-04-26T09:52:44.327 | 2013-10-31T13:26:38.653 | 2017-02-08T14:24:36.100 | -1 | 287,047 | [
"php",
"html",
"smarty"
] |
2,713,003 | 1 | 2,714,741 | null | 1 | 1,742 | I am doing this simple project using Flex 4 SDK and I got stuck with this simple problem: I have turned sortable property for AdvancedDataGridColumn to false, but the column header is still rendered as:

As You can see, my label for this header is "06", but the column header is divided and it keeps the place for sort arrow.
How can I change this? I would like my column header to contain only my label.
I know that most probably I need to do some magic with AdvancedDataGridHeaderRenderer but I just started learning Flex and would like to receive some help.
| Removing sort arrows from AdvancedDataGridColumn Header | CC BY-SA 3.0 | 0 | 2010-04-26T11:25:34.373 | 2013-06-16T21:14:39.123 | 2013-06-16T21:14:39.123 | 126,781 | 126,781 | [
"actionscript-3",
"flash",
"apache-flex",
"user-interface",
"flex4"
] |
2,714,081 | 1 | 2,715,195 | null | 0 | 970 | I have some questions about this window:

- - - [How to add a label to the title (word counter)](http://iloveco.de/adding-a-titlebar-accessory-view-to-a-window/)- [How to add a bottom bar?](http://iloveco.de/bottom-bars-in-cocoa/)
| How to create a window looks like Tweetie Mac OS X app new post window | CC BY-SA 2.5 | 0 | 2010-04-26T14:07:23.067 | 2010-05-13T08:08:54.270 | 2017-02-08T14:24:36.790 | -1 | 124,384 | [
"cocoa",
"interface-builder"
] |
2,717,937 | 1 | 2,720,214 | null | 2 | 1,707 | I have a simple problem. Using the IsPressed trigger i want to be able to set the background color of a button to something other than the default grey. Here is what the button looks like when it is not pressed

and here is what it looks like when it is clicked

Here is the trigger for the button. I know the trigger is firing correctly because of the glow effect around the edge of the button when it is clicked. I also know that the brush is correct because i tried it out as a background brush to see what it looked like.
```
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{DynamicResource ButtonHoverBrush}"/>
<Setter Property="BitmapEffect" Value="{DynamicResource ButtonHoverGlow}"/>
</Trigger>
<!-- This is the trigger which is working but the background color wont change -->
<Trigger Property="IsPressed" Value="True">
<Setter Property="BitmapEffect" Value="{DynamicResource ButtonHoverGlow}"/>
<Setter Property="Background" Value="{DynamicResource ButtonPressedBrush}" />
</Trigger>
</Style.Triggers>
```
Here is the entire style, as you can see, it is a default style applying to all buttons across the application.
```
<Style TargetType="Button">
<Setter Property="Background" Value="{DynamicResource ButtonBrush}" />
<Setter Property="Foreground" Value="Black" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{DynamicResource ButtonHoverBrush}"/>
<Setter Property="BitmapEffect" Value="{DynamicResource ButtonHoverGlow}"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="BitmapEffect" Value="{DynamicResource ButtonHoverGlow}"/>
<Setter Property="Background" Value="{DynamicResource ButtonPressedBrush}" />
</Trigger>
</Style.Triggers>
</Style>
```
1. Create a control template for a generic button and do some data binding: <ControlTemplate TargetType ="Button" x:Key="ButtonControlTemplate">
<Border Background="{TemplateBinding Background}"
BorderThickness="{TemplateBinding BorderThickness}"
BorderBrush="{TemplateBinding BorderBrush}"
CornerRadius="3">
<Grid>
<ContentPresenter ContentSource="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"/>
</Grid>
</Border>
</ControlTemplate>
2. Add control template to style: <Style TargetType="Button">
<Setter Property="Background" Value="{DynamicResource ButtonBrush}" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="Template" Value="{DynamicResource ButtonControlTemplate}" />
<Setter Property="BorderThickness" Value="1" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{DynamicResource ButtonHoverBrush}"/>
<Setter Property="BitmapEffect" Value="{DynamicResource ButtonHoverGlow}"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="BitmapEffect" Value="{DynamicResource ButtonHoverGlow}"/>
<Setter Property="Background" Value="{DynamicResource ButtonPressedBrush}" />
</Trigger>
</Style.Triggers>
</Style>
Note: BorderThickness is defaulted to 1 because otherwise it doesnt show
| Why is button background defaulting to grey when IsPressed is true | CC BY-SA 2.5 | null | 2010-04-27T00:26:05.400 | 2010-04-27T22:52:17.757 | 2020-06-20T09:12:55.060 | -1 | 199,362 | [
"wpf",
"xaml",
"triggers",
"click"
] |
2,718,083 | 1 | 2,718,118 | null | 0 | 1,603 | I have a situation with my MVC2 app where I have multiple pages that need to submit different information, but all need to end up at the same page. In my old Web Forms app, I'd have just accomplished this in my btnSave_Click delegate with a Redirect.
, each of which need to be from their completely different product pages. I'm not going to get into why or how they're different, just suffice to say, they're totally different. . But it should be noted, that view without having to submit any products to add to the cart.
Here's a diagram of what I'm trying to accomplish, and how I I need to handle it:

It seems like a common scenario, but I haven't seen any examples of how I should handle this.
Thank you all in advance.
| Best practice for submits redirecting to another page in MVC2? | CC BY-SA 2.5 | null | 2010-04-27T01:04:53.093 | 2010-04-27T01:14:21.597 | null | null | 135,786 | [
"asp.net-mvc-2"
] |
2,719,535 | 1 | 2,746,167 | null | 33 | 15,878 | I'm using Android's [android.graphics.Canvas](http://developer.android.com/reference/android/graphics/Canvas.html) class [to draw a ring](http://code.google.com/p/publicobject/source/browse/shush/src/com/publicobject/shush/ClockSlider.java). My onDraw method clips the canvas to make a hole for the inner circle, and then draws the full outer circle over the hole:
```
clip = new Path();
clip.addRect(outerCircle, Path.Direction.CW);
clip.addOval(innerCircle, Path.Direction.CCW);
canvas.save();
canvas.clipPath(clip);
canvas.drawOval(outerCircle, lightGrey);
canvas.restore();
```
The result is a ring with a pretty, anti-aliased outer edge and a jagged, ugly inner edge:

What can I do to antialias the inner edge?
I don't want to cheat by drawing a grey circle in the middle because the dialog is slightly transparent. (This transparency isn't as subtle on on other backgrounds.)
| How do I antialias the clip boundary on Android's canvas? | CC BY-SA 2.5 | 0 | 2010-04-27T07:50:41.360 | 2019-06-11T17:27:21.923 | 2017-02-08T14:24:38.147 | -1 | 40,013 | [
"android",
"android-widget"
] |
2,719,748 | 1 | 2,760,128 | null | 7 | 30,258 | I have the following situation. A customer uses JavaScript with jQuery to create a complex website. We would like to use JavaScript and jQuery on the server (IIS) for the following reasons:
1. Skills transfer - we would like to use JavaScript and jQuery on the server and not have to use eg VB Script. / classic asp. .Net framework/Java etc is ruled out because of this.
2. Improved options for search/accessibility. We would like to be able to use jQuery as a templating system, but this isn't viable for search engines and users with js turned off - unless we can selectively run this code on the server.
There is significant investment in IIS and Windows Server, so changing that is not an option.
I know you can run jScript on IIS using windows Script host, but am unsure of the scalability and the process surrounding this. I am also unsure whether this would have access to the DOM.
Here is a diagram that hopefully explains the situation. I was wondering if anyone has done anything similar?
EDIT: I am not looking for critic on web architecture, I am simply wanting to know if there are any options for manipulating the DOM of a page before it is sent to the client, using javascript. [Jaxer](http://jaxer.org/) is one such product (no IIS) Thanks.

| Execute javascript on IIS server | CC BY-SA 3.0 | 0 | 2010-04-27T08:29:29.907 | 2014-05-07T14:12:27.173 | 2012-05-25T20:39:33.480 | 416,224 | 305,319 | [
"javascript",
"iis",
"jaxer"
] |
2,719,783 | 1 | null | null | 0 | 3,332 | Basically I have a Listview control which has coloums (displayed in Detail mode) I add items to it that I want displayed, each under 1 colomn (Like an invoice) but it displays them all under the first instead. I've been adding items like this below which I guess is the wrong way to do it but every other way I tried is not working. You can see he result in the screenshot.
```
lstVLine.Items.Add(lineItem, lstVLine.Items.Count);
lstVLine.Items.Add(itemName,lstVLine.Items.Count);
```

| c# Listview displaying in lines | CC BY-SA 2.5 | null | 2010-04-27T08:37:51.420 | 2010-04-27T08:53:11.163 | 2017-02-08T14:24:38.863 | -1 | 186,647 | [
"c#",
"winforms",
"listviewitem"
] |
2,720,128 | 1 | 2,749,489 | null | 2 | 117 | There is something I don't understand. Today I desided to find out what is inside Sistem.Web.dll version 4.0.0.0 So I decided to find the place where this assembly located.

and opened this assembly with reflector - all methods were empty - and then with ilDasm from 7.0 SDK. This what I saw

After some research I've found fullfeatured assemblies in gac.
Actualy here
C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Web\82087f17d3b3f9c493e7261d608a6af4
They are much larger in size.
So why does references goes not to the gac, but to the C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\
Why don't they have IL inside?
How does it works?
Mabe I don't understand something.
| Referenced by projects .net 4.0 assemblies have no IL. How? and What for? | CC BY-SA 4.0 | 0 | 2010-04-27T09:43:41.287 | 2018-05-22T16:06:00.877 | 2018-05-22T16:06:00.877 | 1,033,581 | 119,843 | [
"assemblies",
".net-4.0"
] |
2,722,754 | 1 | 2,725,481 | null | 0 | 786 | I am building my portfolio website simply using `HTML`, `Flash`, and the `Mootools Javascript` framework. I have decided to implement a theme changing feature using Javascript and cookies. When the user clicks on the "Change Theme" link, a [mediaboxAdvanced](http://iaian7.com/webcode/mediaboxAdvanced) lightbox appears, containing a real-time form which allows you to change the theme on the portfolio.
Here's the code for the form:
```
<div id="mb_inline" style="display: none; margin:15px;">
<h3>Change Your Theme</h3>
<form>
<fieldset>
<select id="background_color" name="background_color">
<option value="#dcf589">Original</option>
<option value="#000FFF">Blue</option>
<option value="#00FF00">Green</option>
</select>
</fieldset>
</form>
</div>
```
I know, there is no submit button, but as soon as something is changed in that form, the following `Mootools` code happens:
```
var themeChanger = new Class(
{
pageBody : null,
themeOptions : null,
initialize: function()
{
this.pageBody = $(document.body);
this.themeOptions = $('background_color');
this.themeOptions.addEvent('change', this.change_theme.bindWithEvent(this));
},
change_theme: function(event)
{
alert("Hello");
}
});
window.addEvent('domready', function() {
var themeChanger_class = new themeChanger();
});
```
Now this is only a test function, which be triggered when the dropdown menu changes. However, it seems that none of it works when the form is in the lightbox! Now if I decide to run the form of the lightbox, then it works great!
It seems it can't even access the "background_color" element.
Am I missing something?
If you need more examples, I will fill in on demand.
Thank you all in advance.
-Christopher
---
I looked into this a little more and have two theories about all of this.
1- In the `mediaboxAdv.js` file, there's the following declaration:
```
$(document.body).adopt(
```
Could this keep me from accessing the body's properties, such as "background-color"?
2- Could the lightbox display that form as a page on its own, hence why I cannot access the parent page's body tag?
3- Do I need to declare my javascript file the following way?
```
<div id="mb_inline" style="display: none; margin:15px;">
<!-- script declaration -->
<script type="text/Javascript" src="scripts/themeChanger.js"></script>
<!-- the form -->
<h3>Change Your Theme</h3>
<form>
<fieldset>
<select id="background_color" name="background_color">
<option value="#dcf589">Original</option>
<option value="#000FFF">Blue</option>
<option value="#00FF00">Green</option>
</select>
</fieldset>
</form>
</div>
```
Here's a screenshot of what I am trying to do, if it can help you guys.

Chances are I might post a link to the site so that you can see with your own eyes what I want to do.
| Access <body> tag properties from form found in mediaboxAdvanced lightbox | CC BY-SA 2.5 | null | 2010-04-27T15:53:19.793 | 2010-04-29T17:55:01.800 | 2017-02-08T14:24:41.660 | -1 | 285,697 | [
"javascript",
"html",
"mootools",
"lightbox"
] |
2,722,939 | 1 | 16,694,704 | null | 27 | 31,243 | I've just started working on a new C++/Qt project. It's going to be an MDI-based IDE with docked widgets for things like the file tree, object browser, compiler output, etc. One thing is bugging me so far though: I can't figure out how to programmatically make a `QDockWidget` smaller. For example, this snippet creates my bottom dock window, "Build Information":
```
m_compilerOutput = new QTextEdit;
m_compilerOutput->setReadOnly(true);
dock = new QDockWidget(tr("Build Information"), this);
dock->setWidget(m_compilerOutput);
addDockWidget(Qt::BottomDockWidgetArea, dock);
```
When launched, my program looks like this (bear in mind the early stage of development):

However, I want it to appear like this:

I can't seem to get this to happen. The Qt Reference on QDockWidget says this:
> Custom size hints, minimum and maximum sizes and size policies should be implemented in the child widget. QDockWidget will respect them, adjusting its own constraints to include the frame and title. Size constraints should not be set on the QDockWidget itself, because they change depending on whether it is docked
Now, this suggests that one method of going about doing this would be to sub-class `QTextEdit` and override the `sizeHint()` method. However, I would prefer not to do this just for that purpose, nor have I tried it to find that to be a working solution.
I have tried calling `dock->resize(m_compilerOutput->width(), m_compilerOutput->minimumHeight())`, calling `m_compilerOutput->setSizePolicy()` with each of its options... Nothing so far has affected the size. Like I said, I would prefer a simple solution in a few lines of code to having to create a sub-class just to change `sizeHint()`. All suggestions are appreciated.
| C++ resize a docked Qt QDockWidget programmatically? | CC BY-SA 3.0 | 0 | 2010-04-27T16:18:27.283 | 2017-04-28T07:22:42.900 | 2013-01-03T16:31:05.503 | 399,317 | 105,623 | [
"c++",
"qt",
"resize",
"qdockwidget"
] |
2,723,702 | 1 | 2,723,718 | null | 2 | 1,308 | First of all, I've checked out all the SO threads, and googled my brains out. I must be missing something obvious.
I'd really appreciate some help! This is what I've got.
```
using System.Web;
using System.Web.Mvc;
namespace NIMDocs.Controllers
{
public class UploadController : Controller
{
public ActionResult Index()
{
return View();
}
public string Processed(HttpPostedFileBase FileData)
{
// DO STUFF
return "DUHR I AM SMART";
}
}
}
```
```
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>ITS A TITLE </title>
<script src="../../Content/jqueryPlugins/uploadify/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="../../Content/jqueryPlugins/uploadify/swfobject.js" type="text/javascript"></script>
<script src="../../Content/jqueryPlugins/uploadify/jquery.uploadify.v2.1.0.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#uploadify').fileUpload({
'uploader': '../../Content/jqueryPlugins/uploadify/uploadify.swf',
'script': '/Upload/Processed',
'folder': '/uploads',
'multi': 'true',
'buttonText': 'Browse',
'displayData': 'speed',
'simUploadLimit': 2,
'cancelImg': '/Content/Images/cancel.png'
});
});
</script>
</head>
<body>
<input type="file" name="uploadify" id="uploadify" />
<p><a href="javascript:jQuery('#uploadify').uploadifyClearQueue()">Cancel All Uploads</a></p>
</body>
</html>
```
What am I missing here? I've tried just about every path permutation for uploadify's "uploader" option. Absolute path, '/' prefixed, etc.
This is what I'm seeing.

And here is the directory structure.

| Why isn't uploadify and asp.net mvc 2 playing nice for me? | CC BY-SA 2.5 | 0 | 2010-04-27T18:01:33.467 | 2010-04-27T19:13:30.857 | 2010-04-27T18:09:06.370 | 67,445 | 67,445 | [
"asp.net",
"jquery",
"asp.net-mvc",
"uploadify"
] |
2,723,771 | 1 | 2,723,804 | null | 3 | 1,590 |
$dbc = mysql_connect($this->dbHost,$this->dbUser,$this->dbPass) or die ("Cannot connect to MySQL : " . mysql_error());
mysql_select_db($this->dbName) or die ("Database not Found : " . mysql_error());
}
}
class User extends dbConnect {
var $name;
function userInput($q) {
$sql = "INSERT INTO $this->dbTable set name = '".$q."'";
mysql_query($sql) or die (mysql_error());
}
}
?>
This is the code to call the class.
My save in my database:

Saving Multiple!
My save in my database:

| PHP MySQL database problem | CC BY-SA 2.5 | null | 2010-04-27T18:10:01.177 | 2018-08-24T09:16:40.290 | 2017-02-08T14:24:42.367 | -1 | 242,839 | [
"php",
"mysql"
] |
2,723,857 | 1 | 2,727,103 | null | 0 | 289 | I am rendering a QPixmap inside of a QThread. the code to paint is inside a function. If I declare the painter inside the drawChart function everything seems ok but if I declare the painter inside the run function the image is wrong in the sense that at the edge of a black and white area, the pixels at the interface are overlapped to give a grey. Does anyone know why this is so? Could it be because of the nature of the run function itself?
```
//This is ok
void RenderThread::run()
{
QImage image(resultSize, QImage::Format_RGB32);
drawChart(&image);
emit renderedImage(image, scaleFactor);
}
drawChart(&image)
{
QPainter painter(image);
painter.doStuff()(;
...
}
//This gives a image that seems to have artifacts
void RenderThread::run()
{
QImage image(resultSize, QImage::Format_RGB32);
QPainter painter(image);
drawChart(painter);
emit renderedImage(image, scaleFactor);
}
drawChart(&painter)
{
painter.doStuff();
...
}
```
//bad
.
//good
.
| QPainter declared inside a run function creates artifact | CC BY-SA 2.5 | null | 2010-04-27T18:22:21.683 | 2010-04-28T09:51:03.397 | 2017-02-08T14:24:43.037 | -1 | 131,981 | [
"qt"
] |
2,723,954 | 1 | 2,723,982 | null | 0 | 3,414 | Why session is null in this even if i set:
```
public class HelperClass
{
public AtuhenticatedUser f_IsAuthenticated(bool _bRedirect)
{
HttpContext.Current.Session["yk"] = DAO.context.GetById<AtuhenticatedUser>(1);
if (HttpContext.Current.Session["yk"] == null)
{
if (_bRedirect)
{
HttpContext.Current.Response.Redirect(ConfigurationManager.AppSettings["loginPage"] + "?msg=You have to login.");
}
return null;
}
return (AtuhenticatedUser)HttpContext.Current.Session["yk"];
}
}
```

| Can't i set Session in a class file? | CC BY-SA 2.5 | null | 2010-04-27T18:36:04.333 | 2010-04-27T18:56:39.983 | 2017-02-08T14:24:43.370 | -1 | 104,085 | [
"asp.net",
"session"
] |
2,723,978 | 1 | 4,837,883 | null | 2 | 90 | I've come across a weird problem whilst trying to optimise the following image:

It should have a little shadow down each of the left and right hand sides. However, in webkit (tried mac safari and chrome) the right hand edge loses its little shadow entirely. I've used multiple utilities to create the image and even tried copying a flipped version of the left hand side to the right, all to no avail.
Have I generated the png incorrectly or does webkit have a problem? It looks as it should in Firefox, IE etc.
| Does Webkit render 8bit PNGs correctly | CC BY-SA 2.5 | null | 2010-04-27T18:39:30.430 | 2011-01-29T16:12:08.210 | null | null | 256,014 | [
"webkit",
"png"
] |
2,725,971 | 1 | 2,726,589 | null | 1 | 1,287 | I have an external *.js file that contains Javascript. How do I get teh same intellisense and color highlighting as I do in an ASPX page?
Here's my options for the js extension (set to 'Script Editor')

And here's what it looks like in an ASPX page (How I would like it to look.)

BTW, I did a full reset my Settings, setting them to VB and no luck.
Update to original post:
Cuban suggested I add a reference to the file "jquery-1.3.2.min.js." When I searched my PC for that file using the fastest bestest Search app ever written, it found it it .003 nano seconds in the following locations:

Basically, the file magically appeared in a couple of my throw away VS2010 test web apps and in a VS2008 Common folder. I don't know why it was added or how I got it and why it doesn't appear under the 2010 web app that I am currently working on.
I am interested in learning JQuery, and I imagine having intellisense work would be a great help, not to mention I really would like to get the Intellisense and syntax highlighting working in external js file.
How would I modify the following statement from Cuban? Do I need to set a reference something first? And what's with the triple slash? I haven't seen this convention before.
Please help the clueless.
Thanks.
```
/// <reference path="../../Content/javascript/jquery/jquery-1.3.2.min.js" />
```
| VS2010: Syntax Color Highlighting and Intellisense in a JS file | CC BY-SA 2.5 | 0 | 2010-04-27T23:55:19.800 | 2010-04-28T09:35:29.040 | 2017-02-08T14:24:44.397 | -1 | 109,676 | [
"asp.net",
"javascript",
"visual-studio-2010"
] |
2,728,039 | 1 | 2,747,660 | null | 3 | 1,947 | It appears that [glColorMaterial()](http://pyopengl.sourceforge.net/documentation/manual/glColorMaterial.3G.html) is absent from [OpenGL ES](http://www.khronos.org/opengles/sdk/1.1/docs/man/). According to [this post](http://www.idevgames.com/forum/showthread.php?t=18189) (for iPhone), you may still enable `GL_COLOR_MATERIAL` in OpenGL ES 1.x, but you're stuck with the default settings of `GL_FRONT_AND_BACK` and `GL_AMBIENT_AND_DIFFUSE` that you would otherwise set with `glColorMaterial()`. I would be OK with this, but the diffuse lighting is not working correctly.
I set up my scene and tested it with one light, setting `glMaterialfv()` for `GL_AMBIENT` and `GL_DIFFUSE` once in the initialization. The normals have been set correctly, and lighting works the way it's supposed to. I see the Gouraud shading.
With `GL_LIGHTING` disabled, the flat colors I have set with `glColor4f()` appear on the various objects in the scene. This also functions as expected. However, when `glEnable(GL_COLOR_MATERIAL)` is called, the flat colors remain. I would expect to see the lighting effects.
glColorMaterial() is also [mentioned on anddev.org](http://www.anddev.org/viewtopic.php?p=33992), but I'm not sure if the information there is accurate.
I'm testing this on an Android 2.1 handset (Motorola Droid).
: It works properly on my 1.6 handset (ADP1). I've filed [Issue 8015](http://code.google.com/p/android/issues/detail?id=8015).
It does work with the emulator for Android 1.6 or 2.1.
Here is a [minimal testcase](http://sites.google.com/site/droidful/bugs/color_material_testcase.zip) to reproduce the problem.



| GL_COLOR_MATERIAL with lighting on Android | CC BY-SA 2.5 | 0 | 2010-04-28T09:02:18.387 | 2010-04-30T21:00:51.533 | 2017-02-08T14:24:46.087 | -1 | 105,137 | [
"android",
"opengl-es"
] |
2,728,794 | 1 | 2,736,247 | null | 7 | 20,950 | I'm having some issues deploying a Visio addin.
Running the VSTO file works on my computer, but whenever I try and move it to any other user's computer it throws an error on deployment.
I thought it might be a setting I'd set in the project properties so I created an entirely new plugin project and set it to display a message box on startup.
The error I'm getting is:
> An error occured during customization install.
The expected element "addIn" was not found in the XML.

| Error deploying VSTO Office addin | CC BY-SA 3.0 | 0 | 2010-04-28T10:59:57.367 | 2018-06-29T17:42:23.210 | 2015-01-10T01:51:29.173 | 964,243 | 85,161 | [
"ms-office",
"vsto",
"visio"
] |
2,729,793 | 1 | 2,729,925 | null | 0 | 644 | i really need your help with a CSS-Layout. I tried a few time, however i've no chance (and actually no idea how) to solve it. Moreover I don't even know if it's possible the way I want it!

The #mainContent should always be centered horizontally in the browserwindow. It should be 1024px in width and a 100% of the windowheight. Now the difficult part. I need two divs, one on the left side, one on the right side of the #mainContent. Both should be 100% in height, but should ALWAYS have the rest of the browserwindow. If the browserwindow has only 1024px in width #navLeft and #navRight are invisible.
Is that even possible, if so, HOW?
thank you
| CSS Problem, fixed contentarea with left and right sidebar? | CC BY-SA 2.5 | null | 2010-04-28T13:25:10.640 | 2010-04-28T19:12:17.093 | null | null | 1,444,475 | [
"css",
"layout"
] |
2,732,889 | 1 | 2,732,924 | null | 1 | 129 | I have an ASP.NET project which gives me the [following](https://dl.dropbox.com/u/3045472/images/Capture.PNG) exception if I try to run it

Where should I "call" it before I can use it ?
---
There is no global.asax in my solution
| Problem with connection string using | CC BY-SA 2.5 | null | 2010-04-28T20:27:37.553 | 2010-04-30T14:59:51.460 | 2010-04-29T12:01:44.890 | 208,670 | 208,670 | [
"c#",
"asp.net",
"visual-studio",
"connection-string"
] |
2,734,303 | 1 | 2,734,517 | null | 1 | 2,111 | I have a composite User control for entering dates:

The CustomValidator will include server sided validation code. I would like the error message to be cleared via client sided script if the user alters teh date value in any way. To do this, I included the following code to hook up the two drop downs and the year text box to the validation control:
```
<script type="text/javascript">
ValidatorHookupControlID("<%= ddlMonth.ClientID%>", document.getElementById("<%= CustomValidator1.ClientID%>"));
ValidatorHookupControlID("<%= ddlDate.ClientID%>", document.getElementById("<%= CustomValidator1.ClientID%>"));
ValidatorHookupControlID("<%= txtYear.ClientID%>", document.getElementById("<%= CustomValidator1.ClientID%>"));
</script>
```
However, I would also like the Validation error to be cleared when the user clicks the clear button. When the user clicks the Clear button, the other 3 controls are reset. To avoid a Post back, the Clear button is a regular HTML button with an OnClick event that resets the 3 controls. Unfortunately, the ValidatorHookupControlID method does not seem to work on HTML controls, so I thought to change the HTML Button to an ASP button and to Hookup to that control instead. However, I cannot seem to eliminate the Postback functionality associated by default with the ASP button control. I tried to set the UseSubmitBehavior to False, but it still submits. I tried to return false in my btnClear_OnClick client code, but the code sent to the browser included a DoPostback call after my call.
```
btnClear.Attributes.Add("onClick", "btnClear_OnClick();")
```
Instead of adding OnClick code, I tried overwriting it, but the DoPostBack code was still included in the final code that was sent to the browser.
What do I have to do to get the Clear button to clear the CustomValidator error when clicked and avoid a postback?
```
btnClear.Attributes.Item("onClick") = "btnClear_OnClick();"
```
| How do you clear a CustomValidator Error on a Button click event? | CC BY-SA 2.5 | null | 2010-04-29T01:50:12.703 | 2010-10-14T04:32:36.090 | 2017-02-08T14:24:48.790 | -1 | 109,676 | [
"asp.net",
"ajax",
"validation-controls"
] |
2,734,625 | 1 | null | null | 2 | 4,582 | What am I doing wrong? How come `<%= this %>` isn't being interpreted as C#?
Here's the code : 
And here is what it renders (notice the Firebug display): 
What do you think is going on? MVC newb here. :(
And the static Site class: 
(If you cannot see the screenshots on the page, view source and use the URLs from the `<img>` tags.)
| ASP.NET/MVC: Inline code | CC BY-SA 2.5 | null | 2010-04-29T03:34:14.980 | 2013-02-25T22:24:17.320 | 2013-02-25T22:24:17.320 | 889,949 | 213,461 | [
"c#",
"asp.net",
"asp.net-mvc"
] |
2,735,321 | 1 | 3,453,352 | null | 2 | 3,296 | I'm trying to automate InstallShield from my build process, and I need to set a type 51 Custom Action's Property Value from my Release's Product Configuration Flags property. What is the syntax (something in square brackets?) to do that?


| InstallShield: Setting a Custom Action's Property Value from a Release Property | CC BY-SA 2.5 | null | 2010-04-29T06:59:55.190 | 2010-08-11T23:43:13.060 | 2017-02-08T14:24:50.127 | -1 | 74,585 | [
"build-process",
"installshield",
"installshield-2010"
] |
2,736,380 | 1 | 2,738,948 | null | 6 | 456 | According to the specification,
> Black colour blocks and the edges of the program restrict program flow. If the Piet interpreter attempts to move into a black block or off an edge, it is stopped and the CC is toggled. The interpreter then attempts to move from its current block again. If it fails a second time, the DP is moved clockwise one step. These attempts are repeated, with the CC and DP being changed between alternate attempts. If after eight attempts the interpreter cannot leave its current colour block, there is no way out and the program terminates.
Unless I'm reading it incorrectly, this is at odds with the behaviour of the Fibonacci sequence example here:

(from: [http://www.dangermouse.net/esoteric/piet/samples.html](http://www.dangermouse.net/esoteric/piet/samples.html))
Specifically, why does the DP turn left at (0,3) ((0,0) being (top, left)) when it hits the left edge? At this point, both DP and CC are LEFT, so, by my reading, the sequence should then be:
1. Attempt (and fail) to leave the block by going off the edge at (0,4),
2. Toggle CC to RIGHT,
3. Attempt (and fail) to leave the block by going off the edge at (0,2).
4. Rotate DP to UP,
5. Attempt (and succeed) to leave the block at (1,2) by entering the white block at (1,1)
The behaviour indicated by the trace seems to be that DP gets rotated all the way, leaving CC at LEFT.
What have I misunderstood?
| How do DP and CC change in Piet? | CC BY-SA 4.0 | 0 | 2010-04-29T10:05:40.237 | 2020-11-04T16:13:13.560 | 2020-11-04T16:13:13.560 | 4,284,627 | 150,882 | [
"esoteric-languages",
"piet"
] |
2,738,470 | 1 | null | null | 2 | 1,605 | I'm using [zfdatagrid](http://zfdatagrid.com/) to display a table within a Zend app. How do i fix the width of the table? I can't find any setting in the grid.ini.
```
public function displaytemptableAction()
{
$config = new Zend_Config_Ini(APPLICATION_PATH.'/grids/grid.ini', 'production');
$db = Zend_Registry::get("db");
$grid = Bvb_Grid::factory('Table',$config,$id='');
$grid->setSource(new Bvb_Grid_Source_Zend_Table(new Model_DbTable_TmpTeamRaceResult()));
//CRUD Configuration
$form = new Bvb_Grid_Form();
$form->setAdd(false)->setEdit(true)->setDelete(true);
$grid->setForm($form);
$grid->setPagination(0);
$grid->setExport(array('xml','pdf'));
$this->view->grid = $grid->deploy();
}
```

| ZFDataGrid table width | CC BY-SA 2.5 | 0 | 2010-04-29T15:12:20.613 | 2012-05-02T15:15:08.357 | 2017-02-08T14:24:51.160 | -1 | 55,794 | [
"zend-framework",
"zfdatagrid"
] |
2,739,644 | 1 | 2,739,691 | null | 2 | 3,613 | I want to move column `OtherSupport` below `Amount2` ... is there an easy way to do this?

| How do I reorder columns in MySQL Query Editor? | CC BY-SA 3.0 | null | 2010-04-29T18:04:02.643 | 2018-04-16T15:27:06.933 | 2018-04-16T15:27:06.933 | 5,684,370 | 449,902 | [
"mysql"
] |
2,740,520 | 1 | 2,741,842 | null | 1 | 1,507 | I'm working on a simple tutorial, and I'd like to randomly generate the positions of the red and green boxes in the accompanying images anywhere inside the dark gray area, but not in the white area. Are there any particularly elegant algorithms to do this? There are some hackish ideas I have that are really simple (continue to generate while the coordinates are not outside the inside rectangle, etc.), but I was wondering if anyone had come up with some neat solutions.
Thanks for any help!

| Generate random coordinates from area outside of a rectangle? | CC BY-SA 2.5 | null | 2010-04-29T20:21:38.150 | 2010-04-30T01:45:53.557 | null | null | 255,394 | [
"actionscript-3",
"random",
"coordinates"
] |
2,740,817 | 1 | 2,760,229 | null | 1 | 636 | I have a TextArea html helper method I'm calling in a foreach loop. Basically, when I initially load the View it works fine, but when i reload the View and load postback data, the same TextArea throws a NullReferenceException and yet the variable I'm using in the TextArea as the name of the TextArea is not null. I've attached a picture below for demonstration:

Sorry if it's difficult to see, the blue arrow below is pointing to the variable used to name the TextArea. Again, it works on initial load, but it errors out on postback when the page is reloaded. I'm not sure what's going on.
| ASP.Net MVC null reference exception with TextArea name | CC BY-SA 3.0 | null | 2010-04-29T21:13:37.170 | 2016-06-21T13:20:31.213 | 2017-02-08T14:24:51.867 | -1 | 94,541 | [
"asp.net",
"asp.net-mvc"
] |
2,741,589 | 1 | 3,623,337 | null | 10 | 7,160 | I have a set of vertices(called A) and I want to find all the border vertices such that this border vertices set is an outline of the shape.
Many of the vertices in A are redundant because they are inside the shape, I want to get rid of these vertices.
My question is similar to [Best Algorithm to find the edges (polygon) of vertices](https://stackoverflow.com/questions/477867/best-algorithm-to-find-the-edges-polygon-of-vertices) but i need it to work for a non-convex polygon case.
EDIT:
Clarification: The below image is a concave polygon. This is what i meant by non-convex. If I run a convex hull algorithm on it, it would not preserve the concave part of the polygon.(unless i'm mistaken).

I have a set of vertices inside and on the border of the polygon: [[x1,y1], [x2,y2]...]
I want to reduce the set so that the vertices are just the border outline of the shape.
| Given a large set of vertices in a non-convex polygon, how can i find the edges? | CC BY-SA 2.5 | 0 | 2010-04-30T00:19:35.060 | 2018-06-26T08:59:19.193 | 2017-05-23T12:33:39.607 | -1 | 337,493 | [
"outline",
"polygons",
"vertices",
"concave"
] |
2,742,307 | 1 | 2,757,668 | null | 2 | 3,739 | Any one know of a tutorial or library or something that i could use to help me accomplish rendering a X-Y GRAPH for performance data or just data in general.
My goal is to have a final result looking something similar to

[This Chart rendered by RRD.](https://oss.oetiker.ch/rrdtool/stream-pop.png)
So just to clarify i just want to render these type of images i don't want rich server controls as they are over kill in my eyes. DevExpress,ComponentOne,Tel..,MSChart,FusionCharts,Jplot,dygraph,Ifragestics,DotNetcharting,AMcharts are no goods...
| c# any cool graphing libraries to graph performance data? | CC BY-SA 2.5 | 0 | 2010-04-30T04:32:55.540 | 2012-03-21T10:16:05.310 | 2017-02-08T14:24:53.233 | -1 | 155,941 | [
"c#",
"image",
"graph",
"rendering",
"charts"
] |
2,742,351 | 1 | 2,743,020 | null | 0 | 410 | If you go here: [http://econym.org.uk/gmap/snap.htm](http://econym.org.uk/gmap/snap.htm) there are some examples of the kind of stuff I'm trying to do. I want the user to enter a route on a google maps widget, and then have the map drawl the route along roads. Then the user click on a "submit" button, and their route is sent back to the server where it will be stored in a database.

Instead of sending back just the red vertices, I want to send back all the information that makes up the purple lines. Is this possible?
| Full coordinates across streets with google maps | CC BY-SA 2.5 | 0 | 2010-04-30T04:48:56.757 | 2011-11-17T14:01:29.877 | null | null | 118,495 | [
"google-maps"
] |
2,743,814 | 1 | null | null | 2 | 668 | I'm trying to add graphs to the admin interface, problem is that I have not found any documentation regarding this.
I'm sure there are generally accepted ways of customizing the way fields are displayed, and I do not wish to follow any problematic route.
---
Any ideas?
---
this is a model I'm trying to reproduce!
> : name, horn length (cm), daily grass grazed (sparkline), average speed (m/s)
daily grass grazed is a
and this is what I mean by

| Defining ways to visualise admin fields - Django | CC BY-SA 2.5 | 0 | 2010-04-30T10:26:21.440 | 2011-08-30T21:07:44.250 | 2017-02-08T14:24:53.897 | -1 | 208,827 | [
"python",
"django",
"django-admin"
] |
2,744,175 | 1 | 2,744,211 | null | 4 | 6,881 | I'm kind of new to the .NET platform. And currently I'm learning ASP.NET MVC.
I want to send an e-mail from my program and I have the following code:
```
public void sendVerrificationEmail()
{
//create the mail message
MailMessage mail = new MailMessage();
//set the addresses
mail.From = new MailAddress("");
mail.To.Add("");
//set the content
mail.Subject = "This is an email";
mail.Body = "this is a sample body with html in it. <b>This is bold</b> <font color=#336699>This is blue</font>";
mail.IsBodyHtml = true;
//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);
}
```
Now when I execute this code I'll get the following exception:
```
System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:25
```
Now I'm very very new to the IIS manager & stuff. so there is probably something wrong there.
Do I need to install a virtual SMTP server or something?. Currently I have following settings:
[http://img153.imageshack.us/img153/695/capture2p.png](http://img153.imageshack.us/img153/695/capture2p.png)
I've been looking for a few hours now but I can't seem to find a working solution.
Help would be appreciated!
| ASP MVC: Sending an E-mail | CC BY-SA 3.0 | null | 2010-04-30T11:35:05.553 | 2014-03-30T16:28:11.320 | 2014-03-30T16:28:11.320 | null | null | [
"c#",
"asp.net",
"asp.net-mvc",
"email",
"iis-7"
] |
2,744,498 | 1 | 2,744,532 | null | 0 | 320 | I have a thread function on Process B that contains a switch to perform certain operations based on the results of an event sent from Process A, these are stored as two elements in an array.
I set the first element to the event which signals when Process A has data to send and I have the second element set to the event which indicates when Process A has closed.
I have began to implement the functionality for the switch statement but I'm not getting the results as I expect.
Consider the following:
```
//Thread function
DWORD WINAPI ThreadFunc(LPVOID passedHandle)
{
for(i = 0; i < 2; i++)
{
ghEvents[i] = OpenEvent(EVENT_ALL_ACCESS, FALSE, TEXT("Global\\ProducerEvents"));
if(ghEvents[i] == NULL)
{
getlasterror = GetLastError();
}
}
dwProducerEventResult = WaitForMultipleObjects(
2,
ghEvents,
FALSE,
INFINITE);
switch (dwProducerEventResult)
{
case WAIT_OBJECT_0 + 0:
{
//Producer sent data
//unpackedHandle = *((HWND*)passedHandle);
MessageBox(NULL,L"Test",L"Test",MB_OK);
break;
}
case WAIT_OBJECT_0 + 1:
{
//Producer closed
ExitProcess(1);
break;
}
default:
return;
}
}
```
As you can see if the event in the first array is signalled Process B should display a simple message box, if the second array is signalled the application should close.
When I actually close Process A, Process B displays the message box instead.
If I leave the first case blank (Do nothing) both applications close as they should.
Furthermore Process B sends data an error is thrown (When I comment out the unpacking):

Have I implemented my switch statement incorrectly? I though I handled the unpacking of the HWND correctly too, any suggestions?
Thanks for your time.
The example I'm following: [Here](http://msdn.microsoft.com/en-us/library/ms686915(v=VS.85).aspx)
Event creation in Process A:
```
for (i = 0; i < 2; i++)
{
ghEvents[i] = CreateEvent(
NULL, // default security attributes
TRUE, // auto-reset event object
FALSE, // initial state is nonsignaled
TEXT("Global\\ProducerEvents")); // unnamed object
if (ghEvents[i] == NULL)
{
printf("CreateEvent error: %d\n", GetLastError() );
ExitProcess(0);
}
}
```
| Switch statement usage - C | CC BY-SA 2.5 | null | 2010-04-30T12:35:19.880 | 2010-04-30T13:40:12.423 | 2017-02-08T14:24:54.580 | -1 | 218,159 | [
"c",
"winapi",
"events",
"switch-statement"
] |
2,745,085 | 1 | 2,745,104 | null | 17 | 19,424 | I'm running Visual Studio 2008 on Windows 7. When I try to attach to a process, VS tells me to restart under different credentials (with elevated permissions).
So I have to restart VS and run it as Administrator. Is there a way to set it up so VS always starts with Admin privileges?

| Visual Studio requires elevated permissions in Windows 7 | CC BY-SA 2.5 | 0 | 2010-04-30T14:18:42.937 | 2019-09-17T10:24:23.903 | 2010-04-30T19:16:02.370 | 164,901 | 37,759 | [
"asp.net",
"visual-studio",
"windows-7",
"permissions"
] |
2,745,225 | 1 | 2,745,825 | null | 0 | 3,300 | I have a frame with several radio buttons where the user is supposed to select the "Category" that his Occupation falls into and then unconditionally also specify his occupation.

If the user selects "Retired", the requirement is to prefill "Retired" in the "Specify Occupation" text box and to disable it to prevent it from being changed. The Specify Occupation text box should also no longer be a tab stop. If the user selects a radio button other than Retired the Specify Occupation text box should be enabled and once again and the Specify Occupation text box should once again be in the normal tab sequence.
Originally, I was setting and clearing the disabled property on the Specify occupation textbox, then I found out that, upon submitting the form, disabled fields are excluded from the submit and the REQUIRED validator on the Specify Occupation textbox was being raised because the textbox was being blanked out.
What is the best way to solve this? My approach below was to mimic a disabled text box by setting/resetting the readonly attribute on the text box and changing the background color to make it appear disabled. (I suppose I should be changing the forecolor instead of teh background color). Nevertheless, my code to make the textbox readonly and to reset it doesn't appear to be working.
```
function OccupationOnClick(sender) {
debugger;
var optOccupationRetired = document.getElementById("<%= optOccupationRetired.ClientId %>");
var txtSpecifyOccupation = document.getElementById("<%= txtSpecifyOccupation.ClientId %>");
var optOccupationOther = document.getElementById("<%= optOccupationOther.ClientId %>");
if (sender == optOccupationRetired) {
txtSpecifyOccupation.value = "Retired"
txtSpecifyOccupation.readonly = "readonly";
txtSpecifyOccupation.style.backgroundColor = "#E0E0E0";
txtSpecifyOccupation.tabIndex = -1;
}
else {
if (txtSpecifyOccupation.value == "Retired")
txtSpecifyOccupation.value = "";
txtSpecifyOccupation.style.backgroundColor = "#FFFFFF";
txtSpecifyOccupation.readonly = "";
txtSpecifyOccupation.tabIndex = 0;
}
}
```
Can someone provide a suggestion to me on the best way to handle this scenario and provide a tweek to the code above to fix the setting/resetting on the readonly property?
| Using Javascript to flip flop a textbox's readonly flag | CC BY-SA 2.5 | 0 | 2010-04-30T14:35:17.433 | 2010-04-30T15:53:10.917 | 2017-02-08T14:24:55.600 | -1 | 109,676 | [
"asp.net",
"javascript",
"html"
] |
2,746,875 | 1 | 2,747,057 | null | 7 | 2,688 | I'm currently exploring worst case scenarios of atomic commit protocols like 2PC and 3PC and am stuck at the point that I can't find out . That is, how does it guarantee that if cohort A commits, cohort B also commits?
Here's the simplified [3PC from the Wikipedia article](http://en.wikipedia.org/wiki/3PC):

Now let's assume the following case:
1. Two cohorts participate in the transaction (A and B)
2. Both do their work, then vote for commit
3. Coordinator now sends precommit messages... A receives the precommit message, acknowledges, and then goes offline for a long time B doesn't receive the precommit message (whatever the reason might be) and is thus still in "uncertain" state
The results:
- - -
And there you have it: One cohort committed, another aborted.
So what am I missing here? In my understanding, if the automatic commit on timeout (in precommit state) was replaced by infinitely waiting for a coordinator command, that case should work fine.
| How can the Three-Phase Commit Protocol (3PC) guarantee atomicity? | CC BY-SA 2.5 | 0 | 2010-04-30T18:45:29.550 | 2017-04-07T20:55:31.937 | 2017-02-08T14:24:56.620 | -1 | 245,706 | [
"transactions",
"commit"
] |
2,746,894 | 1 | 2,746,934 | null | 1 | 668 |
I want an output like this image:

Please Correct my css code.
| CSS Float statement | CC BY-SA 2.5 | 0 | 2010-04-30T18:48:41.537 | 2018-10-29T06:51:23.977 | 2017-02-08T14:24:56.960 | -1 | 242,839 | [
"css",
"css-float"
] |
2,750,073 | 1 | 2,750,099 | null | 2 | 4,306 | Problem:
I have CaretListener and DocumentListener listening on a JTextPane.
I need an algorithm that is able to tell which line is the caret at in a JTextPane, here's an illustrative example:

Result: 3rd line

Result: 2nd line

Result: 4th line
and if the algorithm can tell which line the caret is in the JTextPane, it should be fairly easy to substring whatever that is in between the parentheses as the picture (caret is at character `m` of `metadata`):

--
This is how I divide the entire text that I retrieved from the JTextPane into sentences:
```
String[] lines = textPane.getText().split("\r?\n|\r", -1);
```
The sentences in the `textPane` is separated with \n.
Problem is, it is in? I know the dot of the caret says at which position it is, but . Assuming if I know which line the caret is, then I can just do `lines[<line number>]` and manipulate the string from there.
In Short: How do I use to know , and for further string manipulation? Please help. Thanks.
Do let me know if further clarification is needed. Thanks for your time.
| How to use Caret to tell which line it is in from JTextPane? (Java) | CC BY-SA 2.5 | null | 2010-05-01T13:20:50.270 | 2015-06-29T14:35:34.340 | 2017-02-08T14:24:58.687 | -1 | 324,236 | [
"java",
"algorithm",
"string",
"listener",
"jtextpane"
] |
2,753,334 | 1 | null | null | 1 | 152 | I am trying to create a Exception class to get and send errors from client to server. I want to catch exception in javascript function and push the details to the web service to write to database.
But i couldn't get how to get which function/line throwed this exception. Is there any way to solve this?

| To get which function/line threw exception in javascript | CC BY-SA 2.5 | 0 | 2010-05-02T11:40:49.083 | 2010-05-02T13:12:03.267 | 2017-02-08T14:24:59.397 | -1 | 104,085 | [
"javascript",
"exception"
] |
2,753,530 | 1 | 2,753,896 | null | 2 | 2,898 | Problem:
My program layout is fine, as below before I add JToolbar to `BorderLayout.PAGE_START`
Here's a screenshot before JToolbar is added:

Here's how it looked like after adding JToolbar:

May I know what did I do wrong?
Here's the code I used:
```
//Create the text pane and configure it.
textPane = new JTextPane();
-snipped code-
JScrollPane scrollPane = new JScrollPane(textPane);
scrollPane.setPreferredSize(new Dimension(300, 300));
//Create the text area for the status log and configure it.
changeLog = new JTextArea(5, 30);
changeLog.setEditable(false);
JScrollPane scrollPaneForLog = new JScrollPane(changeLog);
//Create a split pane for the change log and the text area.
JSplitPane splitPane = new JSplitPane(
JSplitPane.VERTICAL_SPLIT,
scrollPane, scrollPaneForLog);
splitPane.setOneTouchExpandable(true);
//Create the status area.
JPanel statusPane = new JPanel(new GridLayout(1, 1));
CaretListenerLabel caretListenerLabel =
new CaretListenerLabel("Caret Status");
statusPane.add(caretListenerLabel);
//Create the toolbar
JToolBar toolBar = new JToolBar();
-snipped code-
//Add the components.
getContentPane().add(toolBar, BorderLayout.PAGE_START);
getContentPane().add(splitPane, BorderLayout.CENTER);
getContentPane().add(statusPane, BorderLayout.PAGE_END);
//Set up the menu bar.
actions = createActionTable(textPane);
JMenu editMenu = createEditMenu();
JMenu styleMenu = createStyleMenu();
JMenuBar mb = new JMenuBar();
mb.add(editMenu);
mb.add(styleMenu);
setJMenuBar(mb);
```
Please help, I'm new to GUI Building, and I don't feel like using Netbeans to drag and drop the UI for me... Thank you in advance.
| BorderLayout problem with JSplitPane after adding JToolbar (Java) | CC BY-SA 2.5 | null | 2010-05-02T13:07:39.823 | 2016-10-25T11:42:48.880 | 2017-02-08T14:25:00.520 | -1 | 324,236 | [
"java",
"swing",
"layout",
"jsplitpane",
"jtoolbar"
] |
2,754,411 | 1 | 2,754,429 | null | 1 | 289 | I have wrote an application that consists of two projects in a solution, each project contains only 1 .c source file. I was using Visual Studio 2010 Ultimate but due to the University only supporting 2008 I decided to create a blank solution and copy the source files into the new one.
After creating a new solution in VS2008 express, creating two projects and re-creating and adding the source files to the projects I ran the application.
For some reason only one part of the application does not work, I use CreateProcess() to execute "Project1.exe" from Project 2.
This works fine under vs2010 but for some reason it's not working under VS2008 express, GetLastError() is showing an Error 2: File Not Found.
This is an image showing the same code in both IDE's:

I'm not using anything special and I've made sure that both solutions/projects are using .Net 3.5.
I can't work out why it would work for one IDE and not the other.
Any suggestions? Thanks!
Screenshot of .exe's

| Application built using VS2010 does not work in VS-Express2008 - C | CC BY-SA 2.5 | null | 2010-05-02T18:04:45.123 | 2010-05-03T08:11:15.957 | 2017-02-08T14:25:01.593 | -1 | 218,159 | [
"c",
"visual-studio-2008",
"winapi",
"visual-studio-2010",
"visual-studio-express"
] |
2,754,658 | 1 | 2,759,202 | null | 12 | 25,187 | The x-axis is time broken up into time intervals. There is an column in the data frame that specifies the time for each row. The column is a factor, where each interval is a different factor level.
Plotting a histogram or line using geom_histogram and geom_freqpoly works great, but I'd like to have a line, like that provided by geom_freqpoly, with the area filled.
Currently I'm using geom_freqpoly like this:
```
ggplot(quake.data, aes(interval, fill=tweet.type)) + geom_freqpoly(aes(group = tweet.type, colour = tweet.type)) + opts(axis.text.x=theme_text(angle=-60, hjust=0, size = 6))
```

I would prefer to have a filled area, such as provided by `geom_density`, but without smoothing the line:

The `geom_area` has been suggested, is there any way to use a ggplot2-generated statistic, such as ..count.., for the geom_area's y-values? Or, does the count aggregation need to occur prior to using ggplot2?
---
As stated in the answer, geom_area(..., stat = "bin") is the solution:
```
ggplot(quake.data, aes(interval)) + geom_area(aes(y = ..count.., fill = tweet.type, group = tweet.type), stat = "bin") + opts(axis.text.x=theme_text(angle=-60, hjust=0, size = 6))
```
produces:

| What is the simplest method to fill the area under a geom_freqpoly line? | CC BY-SA 3.0 | 0 | 2010-05-02T19:21:48.237 | 2018-04-20T08:34:09.473 | 2015-08-20T13:30:58.250 | null | 43,729 | [
"r",
"ggplot2"
] |
2,754,782 | 1 | 2,755,075 | null | 1 | 3,296 | I have a small "popup" like this:

But I don't want the padding around the button, I want it to be as small as it can be with the supplied text.
```
btn.setMargin(new Insets(1, 1, 1, 1));
panel.add(lbl, "wrap");
panel.add(btn);
frame.pack();
frame.setVisible(true);
```
At least this doesn't work...
Can this be achieved on MigLayout or should I use some other layout manager for this frame.
| Remove JButton padding in MigLayout | CC BY-SA 2.5 | null | 2010-05-02T20:06:39.187 | 2012-05-30T12:57:28.287 | 2017-02-08T14:25:01.930 | -1 | 222,342 | [
"java",
"padding",
"look-and-feel",
"jbutton",
"miglayout"
] |
2,755,023 | 1 | 2,755,093 | null | 5 | 1,404 | In the Wikipedia Article on [Block Cipher Modes](http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation) they have a neat little diagram of an
unencrypted image, the same image encrypted using ECB mode and another version of the same image encrypted using another method.
  
At university I have developed my own implementation of DES ([you can find it here](http://github.com/bgianfo/DES)) and we must demo our implementation in a presentation.
I would like to display a similar example as shown above using our implementation. However most image files have header blocks associated with them, which when encrypting the file with our implementation, also get encrypted. So when you go to open them in an image viewer, they are assumed to be corrupted and can't be viewed.
I was wondering if anybody new of a simple header-less image format which we could use to display these? Or if anyone had any idea's as to how the original creator of the images above achieved the above result?
Any help would be appreciated,
Thanks
Note: I realise rolling your own cryptography library is stupid, and DES is considered broken, and ECB mode is very flawed for any useful cryptography, this was purely an academic exercise for school. So please, no lectures, I know the drill.
| Howto display or view encrypted data in encrypted form? | CC BY-SA 2.5 | 0 | 2010-05-02T21:15:43.710 | 2010-05-02T21:45:07.580 | 2017-02-08T14:10:50.270 | -1 | 3,415 | [
"cryptography",
"visualization",
"des"
] |
2,756,106 | 1 | 2,809,785 | null | 0 | 107 | I have added two modules in my drupal site called....
1. me alias
2. Mime mail
Whenever we add new modules to our site,
it has links on admin page.
but after activating modules, i can't see the links on admin page.
but this happens only on server but on my localhost i can see the modules links on admin page.
i have put screenshot of the problem, in image you can see that, i have activated both modules but on admin page....i can't see its links.
why is not activated.
i have tried to clear all the cache and then try again but its not coming then also.
Here is the screen shot

| Why modules link is not coming on Administrator Main page? | CC BY-SA 2.5 | null | 2010-05-03T04:26:31.597 | 2010-05-11T10:19:12.697 | 2017-02-08T14:25:02.320 | -1 | 310,921 | [
"drupal",
"drupal-6",
"module",
"drupal-modules"
] |
2,756,515 | 1 | 2,770,413 | null | 1 | 3,751 | I am trying to create a custom object in AS3 to pass information to and from a server, which in this case will be Red5. In the below screenshots you will see that I am able to send a request for an object from as3, and receive it successfully from the java server. However, when I try to cast the received object to my defined objectType using 'as', it takes the value of null. It is my understanding that that when using "as" you're checking to see if your variable is a member of the specified data type. If the variable is not, then null will be returned.
This screenshot illustrates that I am have successfully received my object 'o' from red5 and I am just about to cast it to the (supposedly) identical datatype testObject of LobbyData:

[Enlarge](https://i.imgur.com/W3ZZ0.png)
However, when `testObject = o as LobbyData;` runs, it returns null. :(

[Enlarge](https://i.imgur.com/pNLbo.png)
Below you will see my specifications both on the java server and the as3 client. I am confident that both objects are identical in every way, but for some reason flash does not think so. I have been pulling my hair out for a long time, does anyone have any thoughts?
```
import flash.utils.IDataInput;
import flash.utils.IDataOutput;
import flash.utils.IExternalizable;
import flash.net.registerClassAlias;
[Bindable]
[RemoteClass(alias = "myLobbyData.LobbyData")]
public class LobbyData implements IExternalizable
{
private var sent:int; // java sentinel
private var u:String; // red5 username
private var sen:int; // another sentinel?
private var ui:int; // fb uid
private var fn:String; // fb name
private var pic:String; // fb pic
private var inb:Boolean; // is in the table?
private var t:int; // table number
private var s:int; // seat number
public function setSent(sent:int):void
{
this.sent = sent;
}
public function getSent():int
{
return sent;
}
public function setU(u:String):void
{
this.u = u;
}
public function getU():String
{
return u;
}
public function setSen(sen:int):void
{
this.sen = sen;
}
public function getSen():int
{
return sen;
}
public function setUi(ui:int):void
{
this.ui = ui;
}
public function getUi():int
{
return ui;
}
public function setFn(fn:String):void
{
this.fn = fn;
}
public function getFn():String
{
return fn;
}
public function setPic(pic:String):void
{
this.pic = pic;
}
public function getPic():String
{
return pic;
}
public function setInb(inb:Boolean):void
{
this.inb = inb;
}
public function getInb():Boolean
{
return inb;
}
public function setT(t:int):void
{
this.t = t;
}
public function getT():int
{
return t;
}
public function setS(s:int):void
{
this.s = s;
}
public function getS():int
{
return s;
}
public function readExternal(input:IDataInput):void
{
sent = input.readInt();
u = input.readUTF();
sen = input.readInt();
ui = input.readInt();
fn = input.readUTF();
pic = input.readUTF();
inb = input.readBoolean();
t = input.readInt();
s = input.readInt();
}
public function writeExternal(output:IDataOutput):void
{
output.writeInt(sent);
output.writeUTF(u);
output.writeInt(sen);
output.writeInt(ui);
output.writeUTF(fn);
output.writeUTF(pic);
output.writeBoolean(inb);
output.writeInt(t);
output.writeInt(s);
}
}
```
```
package myLobbyData;
import org.red5.io.amf3.IDataInput;
import org.red5.io.amf3.IDataOutput;
import org.red5.io.amf3.IExternalizable;
public class LobbyData implements IExternalizable
{
private static final long serialVersionUID = 115280920;
private int sent; // java sentinel
private String u; // red5 username
private int sen; // another sentinel?
private int ui; // fb uid
private String fn; // fb name
private String pic; // fb pic
private Boolean inb; // is in the table?
private int t; // table number
private int s; // seat number
public void setSent(int sent)
{
this.sent = sent;
}
public int getSent()
{
return sent;
}
public void setU(String u)
{
this.u = u;
}
public String getU()
{
return u;
}
public void setSen(int sen)
{
this.sen = sen;
}
public int getSen()
{
return sen;
}
public void setUi(int ui)
{
this.ui = ui;
}
public int getUi()
{
return ui;
}
public void setFn(String fn)
{
this.fn = fn;
}
public String getFn()
{
return fn;
}
public void setPic(String pic)
{
this.pic = pic;
}
public String getPic()
{
return pic;
}
public void setInb(Boolean inb)
{
this.inb = inb;
}
public Boolean getInb()
{
return inb;
}
public void setT(int t)
{
this.t = t;
}
public int getT()
{
return t;
}
public void setS(int s)
{
this.s = s;
}
public int getS()
{
return s;
}
@Override
public void readExternal(IDataInput input)
{
sent = input.readInt();
u = input.readUTF();
sen = input.readInt();
ui = input.readInt();
fn = input.readUTF();
pic = input.readUTF();
inb = input.readBoolean();
t = input.readInt();
s = input.readInt();
}
@Override
public void writeExternal(IDataOutput output)
{
output.writeInt(sent);
output.writeUTF(u);
output.writeInt(sen);
output.writeInt(ui);
output.writeUTF(fn);
output.writeUTF(pic);
output.writeBoolean(inb);
output.writeInt(t);
output.writeInt(s);
}
}
```
```
public function refreshRoom(event:Event)
{
var resp:Responder=new Responder(handleResp,null);
ncLobby.call("getLobbyData", resp, null);
}
public function handleResp(o:Object):void
{
var testObject:LobbyData=new LobbyData;
testObject = o as LobbyData;
trace(testObject);
}
```
```
public LobbyData getLobbyData(String param)
{
LobbyData lobbyData1 = new LobbyData();
lobbyData1.setSent(5);
lobbyData1.setU("lawlcats");
lobbyData1.setSen(5);
lobbyData1.setUi(5);
lobbyData1.setFn("lulz");
lobbyData1.setPic("lulzagain");
lobbyData1.setInb(true);
lobbyData1.setT(5);
lobbyData1.setS(5);
return lobbyData1;
}
```
| Casting an object using 'as' returns null: myObject = newObject as MyObject; // null | CC BY-SA 2.5 | null | 2010-05-03T06:46:26.557 | 2011-04-02T14:01:03.307 | 2010-05-03T06:53:20.897 | 187,484 | 187,484 | [
"actionscript-3",
"red5",
"iexternalizable"
] |
2,757,339 | 1 | 2,758,371 | null | 1 | 7,101 | I setup a test box computer with server 2008 (standard edition, not R2 and not hyper-v editing). I then installed SharePoint 2010. I was amazed how easy the whole setup went (the prerequisites setup on the SharePoint disk made this process oh so easy – great install system). Really this was just so easy.
This test box is being used for testing Access web services. I am able to well publish access applications to this test server and Access applications publish and run just fine on the web SharePoint site through an web browser.
However, the only thing that does not work is when I launch a Access report. The error message I get back is
Here is a screen shot:

I can’t seem to find the setting anywhere to turn session state on. Any hints or links on how to enable session state in SharePoint 2010 would be most appreciated.
| Enable Session state in sharePoint 2010 | CC BY-SA 2.5 | null | 2010-05-03T10:17:36.027 | 2010-07-29T09:57:08.163 | 2017-02-08T14:25:02.660 | -1 | 10,527 | [
"sharepoint",
"ms-access",
"sharepoint-2010"
] |
2,758,454 | 1 | 2,758,482 | null | 2 | 923 | When I draw rectangles etc in ActionScript, using the Flash Player's drawing API (i. e. the `Graphics` class), is the border line of that shape drawn on the outside or the inside of the shape? I. e., which of the following diagrams correctly depicts a rectangle drawn a the border of a content area in a custom component?

I looked at the [documentation for the Graphics class](http://livedocs.adobe.com/flex/3/langref/flash/display/Graphics.html) and couldn't find any hints.
| Are border lines in the Flash drawing API drawn inside or outside a shape? | CC BY-SA 2.5 | null | 2010-05-03T13:43:42.460 | 2010-05-03T14:10:32.067 | 2017-02-08T14:25:03.373 | -1 | 2,077 | [
"apache-flex",
"flash",
"graphics",
"css"
] |
2,758,604 | 1 | 2,758,688 | null | 18 | 7,583 | When setting up a [Setup Project](http://msdn.microsoft.com/en-us/library/19x10e5c.aspx) in Visual Studio 2010 and even to I removing all the prerequistes `.NET 4.0` is still on the computer that runs the Installation. Deploying with [ClickOnce](http://msdn.microsoft.com/en-us/library/t71a733d(VS.80).aspx) works but is not an option, but at least it doesn't ask for .NET 4.0.
---
This is one of the test configurations i've tested

And this is what it looks like when I run setup.exe or the .msi

| Setup Project in Visual Studio 2010 Requires .NET 4.0 | CC BY-SA 2.5 | 0 | 2010-05-03T14:09:24.317 | 2010-05-03T14:22:50.097 | 2017-02-08T14:25:04.563 | -1 | 39,106 | [
".net",
"visual-studio-2010",
"setup-project"
] |
2,758,642 | 1 | 3,085,648 | null | 2 | 1,722 | Is it possible, when developing an Eclipse RCP Application, to stack a view with the editor area? Like this?

I have multiple lists/tables and I want to create a kind of preview composite. When an Item on a list is selected by single mouse click, I want my preview composite to show the data of the item.
If the user double clicks an item, I want to open an editor in the stack behind the preview composite.
Is there anyway to achieve this?
Thanks.
| Eclipse RCP - Stacking a view with the editor area? | CC BY-SA 3.0 | null | 2010-05-03T14:14:21.340 | 2015-02-03T09:38:34.490 | 2012-05-28T11:40:40.803 | 680,925 | 200,887 | [
"java",
"eclipse",
"rcp"
] |
2,759,244 | 1 | null | null | 0 | 751 | My group project at school is to implement a style of monopoly in which students can buy courses and land on various squares and move around the board. This is not a regular square board so we were wondering if anyone had any ideas on how we would implement an image map or something like it to create many clickable regions not in a perfect square. I have attached the image of the game board. Just a way to start is needed, not lots of code or anything as we all know java pretty well. If anyone has any ideas that would be great.
Image of board is here.

| How to implement image map type interface for a game board in Java 6 | CC BY-SA 3.0 | null | 2010-05-03T15:43:25.183 | 2011-12-04T00:34:28.827 | 2011-12-04T00:34:28.827 | 84,042 | 331,554 | [
"java",
"imagemap"
] |
2,759,568 | 1 | 6,491,389 | null | 1 | 622 | I'm developing a ASP.Net web handler that returns images making a in-memory `System.Windows.Forms.Control` and then exports the rendered control as a bitmap compressed to PNG, using the method `DrawToBitmap()`. The classes are fully working by now, except for a problem with the color assignment. By example, this is a Gauge generated by the web handler.

The colors assigned to the inner parts of the gauge are red (`#FF0000`), yellow (`#FFFF00`) and green (`#00FF00`) but I only get a dully version of each color (`#CB100F` for red, `#CCB70D` for yellow and `#04D50D` for green).
The background is a bmp file containing the color gradient. The color loss happens whether the background is a gradient as the sample, a black canvas, a white canvas, a transparent canvas, even when there is not a background set.
-

-

-

-

-

I've tried multiple bitmap color deeps, output formats, compression level, etc. but none of them seems to work. Any ideas?
This is a excerpt of the source code:
```
Bitmap bmp = new Bitmap(w, h, System.Drawing.Imaging.PixelFormat.Format32bppPArgb);
Image bgimage = (Image) HttpContext.GetGlobalResourceObject("GraphicResources", "GaugeBackgroundImage");
Canvas control_canvas = new Canvas(); //inherits from Control
....
//the routine that makes the gauge
....
control_canvas.DrawToBitmap(bmp, new Rectangle(0, 0, w, h));
```
| How to get the "real" colors when exporting a GDI drawing to bmp | CC BY-SA 2.5 | null | 2010-05-03T16:32:46.323 | 2011-06-27T10:15:28.610 | 2017-02-08T14:25:07.267 | -1 | 64,763 | [
"c#",
"bitmap",
"gdi",
"system.drawing",
"color-mapping"
] |
2,760,558 | 1 | null | null | 1 | 233 | I want to share some class between two projects in Visual Studio 2008. I can't create a project for the common parts and reference it (see my comment if you are curious to why).
I've managed to share some source files, but it could be a lot more neat. I've created a test solution called .
The Solution Explorer of the solution which contains project and :

What I like:
- -
What I do not like:
- -
The file tree structure of the solution which contains project and :
```
$ tree /F /A
Folder PATH listing for volume Cystem
Volume serial number is 0713370 1337:F6A4
C:.
| Commonality.sln
|
+---One
| | One.cs
| | One.csproj
| |
| +---bin
| | \---Debug
| | One.vshost.exe
| | One.vshost.exe.manifest
| |
| +---Common
| | | Common.cs
| | | CommonTwo.cs
| | |
| | \---SubCommon
| | CommonThree.cs
| |
| +---obj
| | \---Debug
| | +---Refactor
| | \---TempPE
| \---Properties
| AssemblyInfo.cs
|
\---Two
| Two.cs
| Two.csproj
| Two.csproj.user
| Two.csproj~
|
+---bin
| \---Debug
+---obj
| \---Debug
| +---Refactor
| \---TempPE
\---Properties
AssemblyInfo.cs
```
And the relevant part of project 's project file :
```
<ItemGroup>
<Compile Include="..\One\Common\**\*.cs">
</Compile>
<Compile Include="Two.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
```
How do I address what I do not like, while keeping what I like?
| Automatically add links to class source files under a specified directory of another project in Visual Studio 2008 solution | CC BY-SA 2.5 | null | 2010-05-03T19:14:09.577 | 2010-05-04T20:37:18.973 | 2010-05-03T19:20:13.517 | 246,390 | 246,390 | [
"visual-studio-2008",
"msbuild"
] |
2,761,312 | 1 | 2,761,329 | null | 2 | 392 | I have the following set of controls.

# Scenario 1:
If you select one of the first 3 radio buttons and click enter, focus will jump to the Passport Number text box. If the user selects "Other", the "Other, Please Specify" textbox is enabled and, for convenience, screen focus (the cursor is moved) to that textbox.
# Scenario 2:
The "specify Other" text box is hidden until the user clicks on the Other Radio button. Upon doing so, the textbox is made visible and the cursor is placed in this textbox.
Which scenario do you feel is a better approach? Perhaps you have another variation? Please state your reasoning.
I would also appreciate it if you could make a generalized statement as to when hiding is better than disabling or vice versa, but I am also interested in this particular example.
Thanks.
Afetrthought: Perhaps, in the 2nd example, the "Please Specify" text would only appear after the user has selected the 'Other' radio button.

| Hide or Disable? In this example and in general | CC BY-SA 2.5 | null | 2010-05-03T21:21:51.627 | 2010-05-15T09:14:33.057 | 2017-02-08T14:25:07.940 | -1 | 109,676 | [
"user-interface",
"design-guidelines"
] |
2,762,284 | 1 | 2,762,345 | null | 7 | 1,268 | I am wondering what the different color schemes mean in the following:

What does the blue tag mean? and the purple one?
absolute OSX newbie here... please be gentle ;-)
| Applescript iTunes dictionary explanations | CC BY-SA 2.5 | null | 2010-05-04T01:34:35.567 | 2010-05-04T01:56:11.097 | 2017-02-08T14:25:08.943 | -1 | 171,461 | [
"macos",
"applescript",
"itunes"
] |
2,762,358 | 1 | 2,762,622 | null | 1 | 500 | Let's say I managed to get the dictionary opened for iTunes in the Applescript editor:

How would I access the "search" commands using Python with pyobjc?
I know I get can hold of the iTunes application using:
`iTunes = SBApplication.applicationWithBundleIdentifier_("com.apple.iTunes")`
but after I do a `dir` on it, I don't see the command in the returned dictionary. Help please!
| pyobj access to iTunes application | CC BY-SA 2.5 | null | 2010-05-04T01:58:16.210 | 2010-05-04T03:31:20.520 | 2017-02-08T14:25:08.943 | -1 | 171,461 | [
"python",
"macos",
"applescript",
"itunes",
"pyobjc"
] |
2,762,908 | 1 | 2,762,981 | null | 1 | 772 | I'm creating a web app that allows users to enter a number of colors, by specifying RGB values. Upon submission, the user will see a canvas with a solid rectangle drawn in the color chosen.
On this page, I have 7 canvases. The first one draws just fine, but none of the rest show up. The browser is Safari. Here's the relevant code:
First, the script element in the header, which defines the function I use to draw to the canvas.
```
<script language="JavaScript" TYPE="text/javascript"><!--
function drawCanvas(canvasId, red, green, blue) {
var theCanvas = document.getElementById("canvas" + canvasId);
var context = theCanvas.getContext("2d");
context.clearRect(0,0,100,100);
context.setFillColor(red,green,blue,1.0);
context.fillRect(0,0,100,100);
}
// -->
</script>
```
Next, the HTML source, where I have my canvas tags and some embedded Javascript to call my drawCanvas function
```
<canvas id="canvas0" width="100" height="100">
</canvas>
<script language="JavaScript" TYPE="text/javascript"><!--
drawCanvas(0,250,0,0);
// -->
</script>
.
. //more source
.
<canvas id="canvas1" width="100" height="100">
</canvas>
<script language="JavaScript" TYPE="text/javascript"><!--
drawCanvas(1,4,250,6);
// -->
</script>
```
Also provided is a screenshot. As you can see, the "red" canvas comes up just fine, but the second one, which should be green, doesn't show up at all. Any ideas?

| Why aren't these Canvases rendering? | CC BY-SA 2.5 | null | 2010-05-04T05:00:16.243 | 2010-05-12T18:52:53.643 | 2017-02-08T14:25:09.293 | -1 | 543 | [
"javascript",
"html",
"webkit",
"canvas"
] |
2,763,440 | 1 | 2,763,468 | null | 3 | 2,014 | Are there open source libraries for Java to make implementation of drag and drop easier?
I plan to make something like the one shown below:

The program is Alice, where you can drag some elements on the left and nest them to the right. It's open source, but they did not use any libraries I think. I'm wondering if we anyone know of open source frameworks that work this way, or assist in doing complex drag and drops.
| Are there Java libraries to do drag and drop | CC BY-SA 2.5 | 0 | 2010-05-04T07:08:15.597 | 2015-09-08T13:44:44.943 | 2017-02-08T14:25:09.630 | -1 | 241,379 | [
"java",
"alice",
"block-programming"
] |
2,768,135 | 1 | 2,768,338 | null | 3 | 3,143 | SQL Server doesn't allow creating an view with schema binding where the view query uses [OpenQuery](http://msdn.microsoft.com/en-us/library/ms188427.aspx) as shown below.

Is there a way or a work-around to create an index on such a view?
| Creating an index on a view with OpenQuery | CC BY-SA 2.5 | null | 2010-05-04T18:54:48.330 | 2010-05-09T03:14:06.003 | 2017-02-08T14:25:10.307 | -1 | 4,035 | [
"sql-server",
"tsql",
"indexing",
"query-optimization"
] |
2,768,916 | 1 | null | null | 0 | 5,329 | I have the following PHP code to connect to my db:
```
<?php
ob_start();
$host="localhost"; // Host name
$username="root"; // Mysql username
$password=""; // Mysql password
$db_name="test"; // Database name
$tbl_name="members"; // Table name
// Connect to server and select databse.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
?>
```
However, I get the following error:
```
Warning: mysql_connect() [function.mysql-connect]: [2002] A
connection attempt failed because the connected party did not (trying
to connect via tcp://localhost:3306) in C:\Program Files (x86)\EasyPHP-
5.3.2i\www\checklogin.php on line 11
Warning: mysql_connect() [function.mysql-connect]: A connection
attempt failed because the connected party did not properly respond
after a period of time, or established connection failed because
connected host has failed to respond. in C:\Program Files (x86)\EasyPHP-
5.3.2i\www\checklogin.php on line 11
Fatal error: Maximum execution time of 30 seconds exceeded in
C:\Program Files (x86)\EasyPHP-5.3.2i\www\checklogin.php on line 11
```
I am able to add a db/tables via phpmyadmin but I can't connect using PHP.
Here is a screenshot of my phpmyadmin page:

What could be the problem?
| trouble connecting to MySql DB (PHP) | CC BY-SA 3.0 | null | 2010-05-04T20:55:39.207 | 2014-05-20T14:20:18.797 | 2014-01-23T04:05:36.873 | -1 | 332,817 | [
"php",
"sql",
"mysql",
"phpmyadmin"
] |
2,769,467 | 1 | 2,769,523 | null | 223 | 233,893 | In this image (which I got from [here](http://maestric.com/wiki/lib/exe/fetch.php?w=&h=&cache=cache&media=java:spring:spring_mvc.png)), request sends something to

My Question is what does do?
Is it something like getting the information thrown from the web page and throwing it to the controller?
| What is Dispatcher Servlet in Spring? | CC BY-SA 3.0 | 0 | 2010-05-04T22:48:46.453 | 2022-11-23T09:55:39.730 | 2020-05-19T21:56:32.230 | 5,377,805 | 98,514 | [
"java",
"spring",
"spring-mvc",
"servlet-dispatching"
] |
2,771,171 | 1 | 2,771,251 | null | 192 | 288,333 | Is it possible to control the length and distance between dashed border strokes in CSS?
This example below displays differently between browsers:
```
div {
border: dashed 4px #000;
padding: 20px;
display: inline-block;
}
```
```
<div>I have a dashed border!</div>
```
Big differences: IE 11 / Firefox / Chrome

Are there any methods that can provide greater control of the dashed borders appearance?
| Control the dashed border stroke length and distance between strokes | CC BY-SA 3.0 | 0 | 2010-05-05T07:01:27.443 | 2022-12-02T11:38:08.027 | 2015-07-09T11:21:57.903 | 2,606,013 | 235,158 | [
"css",
"border",
"css-shapes"
] |
2,771,891 | 1 | null | null | 56 | 113,532 | Do you often use image marker from google or copy it to your server?
Where I can get all images list of available markers from google?
The list of images such as :


| List All Google Map Marker Images | CC BY-SA 3.0 | 0 | 2010-05-05T09:20:15.033 | 2015-06-23T18:45:50.797 | 2017-02-08T14:25:13.393 | -1 | 206,710 | [
"google-maps",
"google-maps-markers"
] |
2,772,598 | 1 | 2,772,679 | null | 2 | 828 | I am developing a small program which cuts images by the color.
That's will be easiest to explain using this example image:

And I want to create a new image just with the purple form, without the black frame.
Does anyone have any ideas? I am using Java 2D so I think that I need to create an Object "Shape" with the purple area of the first image.
| How can I cut an image using a color pattern? | CC BY-SA 3.0 | null | 2010-05-05T11:10:45.190 | 2013-02-08T05:24:30.730 | 2013-02-08T05:24:30.730 | 2,683 | 333,348 | [
"java",
"image",
"colors",
"java-2d",
"shapes"
] |
2,773,324 | 1 | null | null | 9 | 15,732 | I'm trying to use ModelAdmin.filter_horizontal and ModelAdmin.filter_vertical for ManyToMany field instead of select multiple box but all I get is:

My model:
```
class Title(models.Model):
#...
production_companies = models.ManyToManyField(Company, verbose_name="компании-производители")
#...
```
My admin:
```
class TitleAdmin(admin.ModelAdmin):
prepopulated_fields = {"slug": ("original_name",)}
filter_horizontal = ("production_companies",)
radio_fields = {"state": admin.HORIZONTAL}
#...
```
The javascripts are loading OK, I really don't get what happens. Django 1.1.1 stable.
| Django admin's filter_horizontal (& filter_vertical) not working | CC BY-SA 2.5 | null | 2010-05-05T12:53:37.187 | 2022-12-07T09:09:22.270 | 2017-02-08T14:25:14.413 | -1 | 321,126 | [
"python",
"django",
"django-admin",
"filtering"
] |
2,773,783 | 1 | 2,774,474 | null | 3 | 2,202 | What is the best way (using HTML/CSS) to create an iTunes-style layout with the following features:
- - -
Here is an example:

I'm happy to use Javascript/JQuery if there really isn't a pure CSS solution.
Thanks!
| iTunes style layout using CSS | CC BY-SA 2.5 | 0 | 2010-05-05T13:51:32.327 | 2013-02-24T05:23:14.533 | 2010-05-05T13:56:45.747 | 142,771 | 142,771 | [
"jquery",
"html",
"css",
"layout",
"itunes"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.