Id
int64 1.68k
75.6M
| PostTypeId
int64 1
2
| AcceptedAnswerId
int64 1.7k
75.6M
⌀ | ParentId
int64 1.68k
75.6M
⌀ | Score
int64 -60
3.16k
| ViewCount
int64 8
2.68M
⌀ | Body
stringlengths 1
41.1k
| Title
stringlengths 14
150
⌀ | ContentLicense
stringclasses 3
values | FavoriteCount
int64 0
1
⌀ | CreationDate
stringlengths 23
23
| LastActivityDate
stringlengths 23
23
| LastEditDate
stringlengths 23
23
⌀ | LastEditorUserId
int64 -1
21.3M
⌀ | OwnerUserId
int64 1
21.3M
⌀ | Tags
list |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4,674,453 | 1 | 4,687,799 | null | 1 | 2,570 | In C#, I'm trying to load a png file on Mac OSX using the latest Mono
```
using System.Drawing;
Bitmap bmp = new Bitmap("test.png");
```
I get the following error
```
Either the image format is unknown or you don't have the required libraries to decode this format [GDI+ status: UnknownImageFormat]
```
It doesn't happen with all png files; just this one.

Resaving in photo shop doesn't fix it unless I switch to 8bpp. Is there something I need to install to support this "special" png file? Works fine on windows.
| Cannot load PNG in C# on Mac OSX running Mono | CC BY-SA 2.5 | 0 | 2011-01-12T21:53:47.923 | 2012-07-31T13:19:24.250 | null | null | 245,777 | [
"c#",
"macos",
"mono",
"bitmap",
"png"
]
|
4,674,558 | 1 | null | null | 2 | 2,605 | I have a textbox that I am attaching jQuery UI's Autocomplete functionality to and I am using CSS to give it a max height via the example [here](http://jqueryui.com/demos/autocomplete/#maxheight). My problem is that doing this causes the z-index problem that [bgiframe](http://plugins.jquery.com/project/bgiframe) solves to come back again, but in a different way. The initial autocomplete menu is above all the controls underneath it, but when I begin to scroll the autocomplete menu falls behind them.
Any suggestions?
EDIT:
This is purely an IE6 bug.


As you can see, after scrolling down the autocomplete falls behind the other controls.
| jQuery UI Autocomplete with scrollbar z-index help | CC BY-SA 2.5 | null | 2011-01-12T22:08:18.120 | 2012-12-01T11:01:26.057 | 2011-01-14T16:16:25.287 | 186,464 | 186,464 | [
"jquery-ui",
"autocomplete",
"internet-explorer-6",
"z-index",
"bgiframe"
]
|
4,674,576 | 1 | 4,675,296 | null | 0 | 1,187 | I'd like to add images next to my cells in my nsoutlineview.

I'm having a really tough time doing this. I'm coming from iPhone development, so I was thinking of making a custom cell to do this, but it seems like NSCell is a control, not a view.
I've looked at the SourceView sample code, but it's tremendously confusing. It seems like this should be a really simple task as it's such a common interface component.
I currently have a working nsoutlineview which only has text, and i've implemented the following delegate methods:
```
-outlineView:child:ofItem:
-outlineView:isItemExpandable:
-outlineView:numberOfChildrenOfItem:
-outlineView:objectValueForTableColumn:byItem:
-outlineView:setObjectValue:forTableColumn:byItem:
-outlineViewSelectionDidChange:
```
| NSOutlineview with images in cells | CC BY-SA 2.5 | null | 2011-01-12T22:10:17.697 | 2011-01-13T22:19:01.543 | 2011-01-12T22:34:45.657 | 144,268 | 144,268 | [
"objective-c",
"cocoa",
"macos"
]
|
4,674,616 | 1 | 5,472,150 | null | 1 | 1,968 | I'm looking the [CoreDataBooks sample](http://developer.apple.com/library/ios/samplecode/CoreDataBooks/Introduction/Intro.html) to manage the data using the uitableviews and I have a question: when I choose a book, appears a table like this:

and if I press edit, to edit the values I need to go to another view....
it's possible make a think like the contacts app, and edit directly the values cliking?

thanks!
| ios uitableviewcontroller edit mode | CC BY-SA 2.5 | null | 2011-01-12T22:15:38.790 | 2011-03-29T12:01:45.020 | null | null | 349,045 | [
"uitableview",
"ios",
"editing"
]
|
4,674,988 | 1 | 5,669,980 | null | 3 | 1,115 |
I have two View Controllers loaded into a root View Controller. Both sub view layouts respond to orientation changes. I switch between the two views using [UIView transformationFromView:...]. Both sub views work fine on their own, but if...
1. Views are swapped
2. Orientation Changes
3. Views are swapped again
the View that was previously hidden has serious layout problems. The more I repeat these steps the worse the problem gets.
I have three viewsControllers.
1. MyAppViewController
2. A_ViewController
3. B_ViewController
A & B ViewControllers have a background image each, and a UIWebView and an AQGridView respectively. To give you an example of how i'm setting it all up, here's the loadView method for A_ViewController...
```
- (void)loadView {
[super loadView];
// background image
// Should fill the screen and resize on orientation changes
UIImageView *bg = [[UIImageView alloc] initWithFrame:self.view.bounds];
bg.contentMode = UIViewContentModeCenter;
bg.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
bg.image = [UIImage imageNamed:@"fuzzyhalo.png"];
[self.view addSubview:bg];
// frame for webView
// Should have a margin of 34 on all sides and resize on orientation changes
CGRect webFrame = self.view.bounds;
webFrame.origin.x = 34;
webFrame.origin.y = 34;
webFrame.size.width = webFrame.size.width - 68;
webFrame.size.height = webFrame.size.height - 68;
projectView = [[UIWebView alloc] initWithFrame:webFrame];
projectView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
[self.view addSubview:projectView];
}
```
For the sake of brevity, the AQGridView in B_ViewController is set up pretty much the same way.
Now both these views work fine on their own. However, I use both of them in the AppViewController like this...
```
- (void)loadView {
[super loadView];
self.view.autoresizesSubviews = YES;
[self setWantsFullScreenLayout:YES];
webView = [[WebProjectViewController alloc] init];
[self.view addSubview:webView.view];
mainMenu = [[GridViewController alloc] init];
[self.view addSubview:mainMenu.view];
activeView = mainMenu;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(switchViews:) name:SWAPVIEWS object:nil];
}
```
and I switch betweem the two views using my own switchView method like this
```
- (void) switchViews:(NSNotification*)aNotification;
{
NSString *type = [aNotification object];
if ([type isEqualToString:MAINMENU]){
[UIView transitionFromView:activeView.view toView:mainMenu.view duration:0.75 options:UIViewAnimationOptionTransitionFlipFromRight completion:nil];
activeView = mainMenu;
}
if ([type isEqualToString:WEBVIEW]) {
[UIView transitionFromView:activeView.view toView:webView.view duration:0.75 options:UIViewAnimationOptionTransitionFlipFromLeft completion:nil];
activeView = webView;
}
// These don't seem to do anything
//[mainMenu.view setNeedsLayout];
//[webView.view setNeedsLayout];
}
```
I'm fumbling my way through this, and I suspect a lot of what i've done is implemented incorrectly so please feel free to point out anything that should be done differently, I need the input.
But my primary concern is to understand what's causing the layout problems. Here's two images which illustrate the nature of the layout issues...
:
I just noticed that when the orientation is landscape, the transition flips vertically, when I would expect it to be horizontal. I don't know wether that's a clue as to what might be going wrong.

Switch to the other view... change orientation.... switch back....

| Hidden UIView Orientation Change / Layout problems | CC BY-SA 2.5 | 0 | 2011-01-12T22:57:19.123 | 2011-04-14T21:33:34.253 | 2011-01-12T23:57:54.487 | 106,435 | 64,586 | [
"cocoa-touch",
"ios",
"uiviewcontroller",
"orientation"
]
|
4,675,159 | 1 | 4,675,344 | null | 0 | 1,178 | In continuing to research a solution for this question on ServerFault:
[https://serverfault.com/questions/221203/mercurial-hook-fails-on-windows](https://serverfault.com/questions/221203/mercurial-hook-fails-on-windows)
I discovered an interesting and somewhat disturbing thing: I have seem three different versions of Python on my machine (four if you count the "official" version which doesn't appear to have a DLL with it....). Here's shot from my file search tool:

More Info:
- - - -
I suspect that this is the source of the my problem from the question above, but I thought I'd ask here, as this is particular issue is a Python deal.
I tried to replace both DLLs with each other, but when I use the one that comes with Mercurial, then TortoiseHg stops working.
It seems to me that "there should only be one" Python on my machine. How do I achieve that?
| Multiple Versions of Python on my Windows machine: Which is the "right" one? | CC BY-SA 2.5 | 0 | 2011-01-12T23:19:08.547 | 2011-01-12T23:45:22.757 | 2017-04-13T12:13:38.277 | -1 | 2,044 | [
"python",
"windows"
]
|
4,675,202 | 1 | 4,675,270 | null | 336 | 152,966 | 
How do I stop Notepad++ from loading all files from the past session?
Every time I open a file I have 10 other open tabs with all my past files. I don't want that. When I hit the close button I expect the program to do what I want and close it. If I wanted to save a session I would use the built in session save feature. I don't want to hit the gray x 20 times when I am done so next time I don't have a bunch of files opening and taking up memory.
I tried the -nosession parameter and that works. But it only works if I use the shortcut. It won't work if I use the right-click edit method. How do I set Notepad++ to do this?
| Notepad++ Setting for Disabling Auto-open Previous Files | CC BY-SA 3.0 | 0 | 2011-01-12T23:26:05.833 | 2020-09-15T17:05:36.867 | 2018-09-18T17:27:43.397 | 881,229 | 401,658 | [
"notepad++"
]
|
4,675,261 | 1 | 4,675,394 | null | 3 | 1,467 | How can I achieve the following layout? Specifically the positioning of `Image` and `DIV`
I've found that unless I set a specific width for the Div, it will just go on to the next line and take up the full width of the container. Additionally aligning it relative to the bottom of the image is giving me trouble. Currently they're both `float:left`

Edit: The two solutions so far work if the image is a constant width which I guess I could work with, but it's going in a Wordpress theme for an author's profile page and it's possible that images would have slightly variable widths. Is there a solution that would have the Div right next to the image (minus padding) regardless of how wide or narrow the image is? Basically having the div adjust its width to accommodate the image width.
| How to achieve Bottom Align floated div that sizes to it's container | CC BY-SA 2.5 | 0 | 2011-01-12T23:33:08.317 | 2011-01-13T10:01:38.980 | 2020-06-20T09:12:55.060 | -1 | 23,822 | [
"css",
"vertical-alignment"
]
|
4,675,371 | 1 | 4,675,384 | null | 30 | 133,982 | I am creating a vertical divider, that works fine. But the CSS is cumbersome.
The CSS is:
```
.headerDivider1 {
border-left:1px solid #38546d;height:80px;position:absolute;right:250px;top:10px;
}
.headerDivider2 {
border-left:1px solid #16222c;height:80px;position:absolute;right:249px;top:10px;
}
```
The HTML is:
```
<div class="headerDivider1"></div><div class="headerDivider2"></div>
```
The result is:

How could I tidy the HTML and CSS up?
| Vertical divider CSS | CC BY-SA 3.0 | 0 | 2011-01-12T23:49:19.060 | 2022-04-16T11:37:21.707 | 2013-01-27T12:18:27.210 | 458,741 | 501,173 | [
"html",
"css"
]
|
4,675,500 | 1 | 4,678,755 | null | 1 | 583 | What I mean that in the inspection of
my element I found that the two links
have the same name but are on different forms.
I want to click the second link.
How could I specify that in water?
Thanks in advance.
| If there are two links with the same element name but are on different forms of a page how to specify one over the other? | CC BY-SA 2.5 | null | 2011-01-13T00:13:18.263 | 2011-03-01T18:56:01.330 | 2011-01-13T18:35:16.287 | 571,722 | 571,722 | [
"watir",
"firewatir"
]
|
4,675,712 | 1 | 4,675,913 | null | 3 | 144 | i using below code to get a picture from URL:
```
URL url=new URL("http://www.google.com/images/logos/ps_logo2.png");
InputStream in=url.openStream();
ByteArrayOutputStream tmpOut = new ByteArrayOutputStream();
byte[] buf = new byte[512];
int len;
while (true) {
len = in.read(buf);
if (len == -1) {
break;
}
tmpOut.write(buf, 0, len);
}
tmpOut.close();
byte[] picture=tmpOut.toByteArray();
System.out.println(picture.length);
```
this code is okay,but my internet connect is very very bad,
so ,I maybe get a broken picture like this:

How can I ensure the picture file is complete ?
I think you can add this code to try and test this:
`if (len == -1) {` change to `if (len == -1 || (int)(Math.random()*100)==1 ) {`
full test code:
```
URL url=new URL("http://www.google.com/images/logos/ps_logo2.png");
InputStream in=url.openStream();
ByteArrayOutputStream tmpOut = new ByteArrayOutputStream();
byte[] buf = new byte[512];
int len;
while (true) {
len = in.read(buf);
if (len == -1 || (int)(Math.random()*100)==1 ) {
break;
}
tmpOut.write(buf, 0, len);
}
tmpOut.close();
byte[] picture =tmpOut.toByteArray();
System.out.println(picture.length);
```
thanks for help :)
| How to ensure I get the picture is complete? (in java) | CC BY-SA 2.5 | null | 2011-01-13T00:48:25.297 | 2011-01-13T01:27:04.583 | null | null | 165,589 | [
"java"
]
|
4,675,730 | 1 | 5,518,540 | null | 1 | 1,123 | ```
NSString *anError = nil;
id plist;
plist = [NSPropertyListSerialization propertyListFromData:rawCourseArray mutabilityOption:NSPropertyListImmutable format:&format errorDescription:&anError];
if (anError != nil){
[anError release];
}
```
The above code causes a memory leak every time I call it. I am releasing the error but still there is a leak. I haven't seen any resolution to this issue. I posted this already and most respond that this is not a leak. But see here in the leak performance tool:

I need this fixed because eventually my app crashes. Any ideas? Many thanks
| Nasty NSPropertyListSerialization Leak | CC BY-SA 2.5 | null | 2011-01-13T00:51:21.113 | 2011-04-01T20:33:32.177 | null | null | 405,970 | [
"iphone",
"memory-leaks",
"plist"
]
|
4,676,132 | 1 | 4,676,143 | null | 2 | 1,216 | Is this use case over complicated? I'm trying to implement a use case for the first time, and I'm trying to get it within the ball park.

| Is this UML Use Case too detailed? | CC BY-SA 2.5 | 0 | 2011-01-13T02:09:01.690 | 2011-01-19T17:01:48.753 | 2011-01-19T17:01:48.753 | 443,602 | 443,602 | [
"uml",
"modeling",
"use-case"
]
|
4,676,239 | 1 | 4,738,307 | null | 5 | 7,505 | I'm in the middle of trying to debug an issue with a new app, and something isn't right. In the app, I'm setting up custom UITableViewCells by adding 2 UILabels and 1 UIImageView directly to the cell.contentView
In my app, certain table view cells werent selectable ( they werent responding to tap events ). The 2nd cell on the screen was always never selectable, and then random other cells also werent selectable.
In my effort to debug, I stripped everything down the following bare essentials of code:
```
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"ReviewCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
cell.textLabel.text = @"foo";
return cell;
}
```
Even this is generic, boiler plate code, that looks like the following:

not all the cells are selectable.
What am I missing?
as an updated here is my row selection code if interested
```
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
ReviewWebViewController *rvc = [[ReviewWebViewController alloc] initWithReview:[self.reviews objectAtIndex:indexPath.row]];
[self.navigationController pushViewController:rvc animated:YES];
[rvc release], rvc=nil;
}
```
| UITableViewCell not always selectable? | CC BY-SA 2.5 | null | 2011-01-13T02:32:25.610 | 2011-01-19T19:23:47.990 | 2017-02-08T14:31:21.690 | -1 | 96,740 | [
"iphone",
"objective-c",
"uitableview"
]
|
4,676,493 | 1 | 4,676,727 | null | 2 | 5,230 | So we can take such [image from wikipedia](http://upload.wikimedia.org/wikipedia/commons/6/65/SonyCenter_360panorama.jpg)

And try to map it for future cube or something like cube


And than distort for top and bottom like

Some one may think that doing disturtion only for half and than triing to fill it would work

it would not=( and content aware filling would not help filling that square=(
but it looks bad if you will try to render such cubic panorama.
Another way that I can imagine is to render 3d panorama onto sphere and than somehow take snapshots/projections of it onto cube... but I do not know how to write it down wit simple math operations (idea here is not to use rendering engines but to do it as mathematically as possible)
| A 360 degree Sphere panorama into Cube panorama transformations algorithm (pseudocode or at least full logic wanted) | CC BY-SA 2.5 | 0 | 2011-01-13T03:22:50.703 | 2011-02-10T00:18:24.063 | 2011-01-13T03:54:04.667 | 434,051 | 434,051 | [
"algorithm",
"pseudocode",
"projection",
"cube",
"panoramas"
]
|
4,676,680 | 1 | 4,755,140 | null | 2 | 471 | I use codeplex.com to host my projects. Some days ago I connect to codeplex successful via visual studio ultimate 10 but now I can't.
Could you help me please? Below is the screen shot of the message I received from codeplex.
PS. You could see my discussion in CodePlex Information and Discussion here: [http://codeplex.codeplex.com/Thread/View.aspx?ThreadId=240384](http://codeplex.codeplex.com/Thread/View.aspx?ThreadId=240384)

Thanks.
Binh Nguyen
| Can't login to codeplex TFS via Visual studio 10 | CC BY-SA 2.5 | 0 | 2011-01-13T04:08:22.737 | 2011-01-21T03:35:54.827 | null | null | 523,325 | [
"visual-studio",
"codeplex"
]
|
4,676,687 | 1 | 4,687,637 | null | 0 | 1,049 | Hey guy's I am doing fixing a style that was messed up in IE, but everything looks nice in the browser, however when I go to print it doesn't show # 1, from 2 thereafter. What is the issue. Please help me. Thanks

```
ol.printplanitemlist
{
list-style-type:decimal;
margin-top:1em;
margin-bottom:1em;
padding-left:2.5em;
border:0;
line-height:100%;
}
ol.printplanitemlist li
{
/* margin-bottom:1em;*/
margin-bottom:1em;
position:relative;
}
.ActivityPromptText {
}
ul.PlanItemDisplay li
{
list-style-type:none;
margin:0;
}
ul.PlanItemDisplay
{
display:block;
margin:0;
padding:0;
list-style:none;
}
.MedicationTitle, .MedicationDescription, .MedicationName, .MedicationClass, .MedicationStrength, .MedicationForm, .MedicationHowOften, .MedicationMoreInfo {
top:-17px;
}
ul, li
{
padding:0;
margin:0;
border:0;
}
.printLbl {
font-size:1em;
/*line-height:1.375em;*/
font-weight:bold;
vertical-align:baseline;
margin:0;
border:0;
margin-bottom:0.188em;
}
li.ActivityTitle, li.AnnouncementTitle, li.MeasurementTitle, li.MedicationTitle,
li.QuestionTitle
{
color:#999999; font-size:0.75em; font-weight:bold; line-height:1.125em; margin-bottom:-0.188em; margin-top:0.5em; font-style:normal; display:block;
}
.AnnouncementPlanItemDisplay, .MeasurementPlanItemDisplay, .QuestionPlanItemDisplay{
top:-0.969em;
position:relative;
line-height:1.375em;
}
ul#ActivityDisplay {
position:relative;
top:-1.188em;
```
}
```
<FORM id=form1 method=post name=form1 action=PrintCarePlan.aspx>
<DIV><INPUT id=__EVENTTARGET type=hidden name=__EVENTTARGET> <INPUT id=__EVENTARGUMENT type=hidden name=__EVENTARGUMENT> <INPUT id=__VIEWSTATE value=/wEPDwUKMTAzNzk4NTgxNA9kFgICAw9kFggCBQ8WAh4EVGV4dAUBIGQCCQ8WAh8ABQkxLzEzLzIwMTFkAgsPFgIeC18hSXRlbUNvdW50AgUWCgIBD2QWBAIBDxYCHwAFIEFkZGl0aW9uYWwgaW5mb3JtYXRpb24gZm9yIHRvZGF5ZAIDDxYCHwECBBYIZg9kFgICCQ8PFgIeB1Zpc2libGVnZBYIAgEPFgIfAmcWAmYPDxYEHwAFDVRFRCBzdG9ja2luZ3MfAmdkZAIDD2QWAmYPDxYCHwAFA1RFRGRkAgUPDxYCHwAFblBsZWFzZSB3aGVyZSB5b3VyIFRFRCAoVGhyb21ibyBFbWJvbGljIERldGVycmVudCkgc3RvY2tpbmdzIHRocm91Z2hvdXQgdGhlIGRheS4gIFlvdSBtYXkgcmVtb3ZlIHRoZW0gYXQgbmlnaHQuZGQCBw9kFgJmDw8WBB8AZR4LTmF2aWdhdGVVcmxlFgIeB29uY2xpY2sFG2RvUG9wdXAodGhpcyk7cmV0dXJuIGZhbHNlO2QCAQ9kFgICCQ8PFgIfAmdkFggCAQ8WAh8CZxYCZg8PFgQfAAUfcGFpbiBtZWRpY2F0aW9uIGJlZm9yZSBleGVyY2lzZR8CZ2RkAgMPZBYCZg8PFgIfAAUYcGFpbiBtZWQgYmVmb3JlIGV4ZXJjaXNlZGQCBQ8PFgIfAAVKUGxlYXNlIHRha2UgeW91ciBwYWluIG1lZGljYXRpb24gMzAgbWludXRlcyBiZWZvcmUgeW91IHN0YXJ0IHlvdXIgZXhlcmNpc2VkZAIHD2QWAmYPDxYEHwBlHwNlFgIfBAUbZG9Qb3B1cCh0aGlzKTtyZXR1cm4gZmFsc2U7ZAICD2QWAgIJDw8WAh8CZ2QWCAIBDxYCHwJnFgJmDw8WBB8ABRF0b3dlbCB1bmRlciBhbmtsZR8CZ2RkAgMPZBYCZg8PFgIfAAURdG93ZWwgdW5kZXIgYW5rbGVkZAIFDw8WAh8ABVZJdCBpcyBpbXBvcnRhbnQgdGhhdCB5b3UgcGxhY2UgYSB0b3dlbCByb2xsIHVuZGVyIHlvdXIgYW5rbGUgd2hlbiB5b3UgYXJlIGx5aW5nIGluIGJlZGRkAgcPZBYCZg8PFgQfAGUfA2UWAh8EBRtkb1BvcHVwKHRoaXMpO3JldHVybiBmYWxzZTtkAgMPZBYCAgkPDxYCHwJnZBYIAgEPFgIfAmcWAmYPDxYEHwAFCmJsb29kIGNsb3QfAmdkZAIDD2QWAmYPDxYCHwAFA0RWVGRkAgUPDxYCHwAF+AFJZiB5b3UgaGF2ZSBhbnkgb2YgdGhlc2Ugc3ltcHRvbXMsIHBsZWFzZSBjb250YWN0IHRoZSBvZmZpY2UgaW1tZWRpYXRlbHkuCiAgICAqIENoYW5nZXMgaW4gc2tpbiBjb2xvciAocmVkbmVzcykgaW4gb25lIGxlZwogICAgKiBJbmNyZWFzZWQgd2FybXRoIGluIG9uZSBsZWcKICAgICogTGVnIHBhaW4gaW4gb25lIGxlZwogICAgKiBMZWcgdGVuZGVybmVzcyBpbiBvbmUgbGVnCiAgICAqIFN3ZWxsaW5nIChlZGVtYSkgb2Ygb25lIGxlZ2RkAgcPZBYCZg8PFgQfAGUfA2UWAh8EBRtkb1BvcHVwKHRoaXMpO3JldHVybiBmYWxzZTtkAgIPZBYEAgEPFgIfAAUOTXkgTWVkaWNhdGlvbnNkAgMPFgIfAQIBFgJmD2QWAgIFDw8WAh8CZ2QWEAIBDxYCHwJnFgJmDw8WBB8ABQ1wYWluIHJlbGlldmVyHwJnZGQCAw9kFgJmDw8WAh8ABQlpYnVwcm9mZW5kZAIFDw8WAh8ABQlpYnVwcm9mZW5kZAIHDw8WAh8ABQdjYXBsZXRzZGQCCQ8PFgIfAAUGODAwIG1nZGQCCw8PFgIfAGRkZAINDw8WAh8ABSdUYWtlIDEgY2FwbGV0IGV2ZXJ5IDQtNiBob3VycyBhcyBuZWVkZWRkZAIPD2QWAmYPDxYEHwBlHwNlFgIfBAUbZG9Qb3B1cCh0aGlzKTtyZXR1cm4gZmFsc2U7ZAIDD2QWBAIBDxYCHwAFDU15IEFjdGl2aXRpZXNkAgMPFgIfAQIGFgxmD2QWAgIBDw8WAh8CZ2QWCAIBD2QWAmYPDxYCHwAFGHdhbGtpbmcgYXJvdW5kIHRoZSBob3VzZWRkAgMPZBYCZg8PFgIfAAUYd2Fsa2luZyBhcm91bmQgdGhlIGhvdXNlZGQCCQ9kFgJmDw8WBB8AZR8DZRYCHwQFG2RvUG9wdXAodGhpcyk7cmV0dXJuIGZhbHNlO2QCDQ8PFgIfAAWEAVBsZWFzZSB3YWxrIHdpdGggeW91ciBhc3Npc3RpdmUgZGV2aWNlICh3YWxrZXIvY2FuZSBvciBjcnV0Y2hlcykgb24gYSBmbGF0IHN1cmZhY2VzIHdpdGhpbiB5b3VyIGhvdXNlIGZvciAxNSBtaW51dGVzIDUgdGltZXMgcGVyIGRheWRkAgEPZBYCAgEPDxYCHwJnZBYIAgEPZBYCZg8PFgIfAAURd2Fsa2luZyB1cCBzdGFpcnNkZAIDD2QWAmYPDxYCHwAFEXdhbGtpbmcgdXAgc3RhaXJzZGQCCQ9kFgJmDw8WBB8AZR8DZRYCHwQFG2RvUG9wdXAodGhpcyk7cmV0dXJuIGZhbHNlO2QCDQ8PFgIfAAWNAVBsZWFzZSB3YWxrIHVwIGFuZCBkb3duIHN0YWlycyAzIHRpbWVzIHRvZGF5IFdJVEggQVNTSVNUQU5DRSBPTkxZLiBBbHdheXMgdXNlIGEgZGV2aWNlIGFuZCBhIHJhaWwuICBJZiB5b3UgZG8gbm90IGhhdmUgc3RhaXJzLCBkaXNyZWdhcmQgdGhpc2RkAgIPZBYCAgEPDxYCHwJnZBYIAgEPZBYCZg8PFgIfAAUDaWNlZGQCAw9kFgJmDw8WAh8ABQ1pY2UgYXMgbmVlZGVkZGQCCQ9kFgJmDw8WBB8AZR8DZRYCHwQFG2RvUG9wdXAodGhpcyk7cmV0dXJuIGZhbHNlO2QCDQ8PFgIfAAVOUGxlYXNlIHVzZSBpY2UgYXMgbmVlZGVkIHRvZGF5LiAgQmUgY2VydGFpbiB0byB1c2UgaXQgYWZ0ZXIgZXhlcmNpc2luZyBhcyB3ZWxsZGQCAw9kFgICAQ8PFgIfAmdkFggCAQ9kFgJmDw8WAh8ABQ50aXNzdWUgbWFzc2FnZWRkAgMPZBYCZg8PFgIfAAUOdGlzc3VlIG1hc3NhZ2VkZAIJD2QWAmYPDxYEHwBlHwNlFgIfBAUbZG9Qb3B1cCh0aGlzKTtyZXR1cm4gZmFsc2U7ZAINDw8WAh8ABUBQbGVhc2UgbWFzc2FnZSB0aGUgYXJlYSBhcm91bmQgeW91ciBpbmNpc2lvbiBzZXZlcmFsIHRpbWVzIHRvZGF5ZGQCBA9kFgICAQ8PFgIfAmdkFggCAQ9kFgJmDw8WAh8ABRlzdGF0aW9uYXJ5IHJlY29tYmVudCBiaWtlZGQCAw9kFgJmDw8WAh8ABRlzdGF0aW9uYXJ5IHJlY29tYmVudCBiaWtlZGQCCQ9kFgJmDw8WBB8AZR8DZRYCHwQFG2RvUG9wdXAodGhpcyk7cmV0dXJuIGZhbHNlO2QCDQ8PFgIfAAWNAVBsZWFzZSB1c2UgdGhlIHN0YXRpb25hcnkgcmVjb21iZW50IGJpa2UgdG9kYXkgZm9yIDEwIG1pbnV0ZXMuICBTdGFydCB3aXRoIHBhcnRpYWwgcmV2b2x1dGlvbnMgYW5kIHByb2dyZXNzIHRvIGZ1bGwgcmV2b2x1dGlvbnMgYXMgdG9sZXJhdGVkLmRkAgUPZBYCAgEPDxYCHwJnZBYKAgEPZBYCZg8PFgIfAAUHQ0FNT3BlZGRkAgMPZBYCZg8PFgIfAGVkZAIFDxYCHwJnFgJmDw8WBB8ABQdDQU1PcGVkHwJnZGQCCQ8WAh8CaBYCZg8PFgYfAAUsaHR0cDovL3d3dy5jYW1vcGVkLmNvbS9kZS92aWRlb21hdGVyaWFsLmh0bWwfAwUsaHR0cDovL3d3dy5jYW1vcGVkLmNvbS9kZS92aWRlb21hdGVyaWFsLmh0bWwfAmgWAh8EBRtkb1BvcHVwKHRoaXMpO3JldHVybiBmYWxzZTtkAg0PDxYCHwAFJ1VzZSBDQU1PcGVkIHR3aWNlIGEgZGF5IGZvciAzMCBtaW51dGVzLmRkAgQPZBYEAgEPFgIfAAUMTXkgUXVlc3Rpb25zZAIDDxYCHwECARYCZg9kFgICBw8PFgIfAmdkFggCAQ8WAh8CZxYCZg8PFgQfAAUaSG93IGFyZSB5b3UgZmVlbGluZyB0b2RheT8fAmdkZAIDD2QWAmYPDxYCHwAFGkhvdyBhcmUgeW91IGZlZWxpbmcgdG9kYXk/ZGQCBQ8PFgIfAAUaSG93IGFyZSB5b3UgZmVlbGluZyB0b2RheT9kZAIHD2QWAmYPDxYEHwBlHwNlFgIfBAUbZG9Qb3B1cCh0aGlzKTtyZXR1cm4gZmFsc2U7ZAIFD2QWBAIBDxYCHwAFD015IE1lYXN1cmVtZW50c2QCAw8WAh8BAgMWBmYPZBYCAgMPDxYCHwJnZBYIAgEPFgIfAmcWAmYPDxYEHwAFC0tuZWUgTW90aW9uHwJnZGQCAw9kFgJmDw8WAh8AZWRkAgUPDxYCHwAFIEhvdyBtdWNoIGNhbiB5b3UgYmVuZCB5b3VyIGtuZWU/ZGQCBw9kFgJmDw8WBB8AZR8DZRYCHwQFG2RvUG9wdXAodGhpcyk7cmV0dXJuIGZhbHNlO2QCAQ9kFgICAw8PFgIfAmdkFggCAQ8WAh8CZxYCZg8PFgQfAAUKcGFpbiBsZXZlbB8CZ2RkAgMPZBYCZg8PFgIfAAUQcGFpbiBsZXZlbCB0b2RheWRkAgUPDxYCHwAFIFBsZWFzZSBsb2cgeW91ciBwYWluIGxldmVsIHRvZGF5ZGQCBw9kFgJmDw8WBB8AZR8DZRYCHwQFG2RvUG9wdXAodGhpcyk7cmV0dXJuIGZhbHNlO2QCAg9kFgICAw8PFgIfAmdkFggCAQ8WAh8CZxYCZg8PFgQfAAUPcmFuZ2Ugb2YgbW90aW9uHwJnZGQCAw9kFgJmDw8WAh8ABQNST01kZAIFDw8WAh8ABUZQbGVhc2UgbWVhc3VyZSB5b3VyIGFiaWxpdHkgdG8gYmVuZCBhbmQgc3RyYWlnaHRlbiB5b3VyIG9wZXJhdGl2ZSBrbmVlZGQCBw9kFgJmDw8WBB8AZR8DZRYCHwQFG2RvUG9wdXAodGhpcyk7cmV0dXJuIGZhbHNlO2QCEQ8PFgIfAAUEMjAxMWRkGAEFHl9fQ29udHJvbHNSZXF1aXJlUG9zdEJhY2tLZXlfXxYBBQRsb2dvnyiOzN32/TnV8y+DJDacLzmKIWo= type=hidden name=__VIEWSTATE> </DIV>
<SCRIPT type=text/javascript>
//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
//]]>
</SCRIPT>
<SCRIPT type=text/javascript src="/WebResource.axd?d=1HwPIkddnYckUN2xUQU95T2VKatY6mt9Dg990zejInCszK3pN-A9sNz55sulwawon9MvfVMYNaagWXGXXyUS4KFjvzU1&t=634208670757546466"></SCRIPT>
<DIV><INPUT id=__PREVIOUSPAGE value=RYBDuzinhGYBVohg1mfRtZqBqjrEl1IOfB1y5sMq5HRkm5gPpG_IN9UuYjxeqh4EtESSJfV_5g0lFzfooz8hR_0lGvGxoJWHmR-0aPBDV6VBLTZm0 type=hidden name=__PREVIOUSPAGE> <INPUT id=__EVENTVALIDATION value=/wEWAwLr0OzxDgKL1Z6VCgKyq56pB3ifZrQiaUnVJyYeWgMXmhiu4qtR type=hidden name=__EVENTVALIDATION> </DIV>
<DIV class=container>
<DIV class=header><INPUT style="BORDER-RIGHT-WIDTH: 0px; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" id=logo onclick='javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("logo", "", false, "", "Home.aspx", false, false))' src="../Images/logo.png" type=image name=logo> </DIV>
<DIV>
<P></P>
<DIV class=masterHeading>Care Plan For on 1/13/2011<BR></DIV><BR><BR>
<P></P><BR></DIV>
<DIV>
<TABLE style="MARGIN-LEFT: auto; MARGIN-RIGHT: auto" border=0 cellSpacing=5 cellPadding=0 width="90%">
<TBODY>
<TR vAlign=top>
<TD><LABEL class=printLbl>Additional information for today:</LABEL><BR>
<OL class=printplanitemlist>
<LI>
<UL class="PlanItemDisplay AnnouncementPlanItemDisplay">
<LI id=rItemHeaders_ctl01_rPlanItems_ctl00_ccAnnouncement_liTitle class=AnnouncementTitle><SPAN id=rItemHeaders_ctl01_rPlanItems_ctl00_ccAnnouncement_Title>TED stockings</SPAN>
<LI class=AnnouncementMsg><SPAN id=rItemHeaders_ctl01_rPlanItems_ctl00_ccAnnouncement_AnnouncementMsg>Please where your TED (Thrombo Embolic Deterrent) stockings throughout the day. You may remove them at night.</SPAN> </LI></UL>
<LI>
<UL class="PlanItemDisplay AnnouncementPlanItemDisplay">
<LI id=rItemHeaders_ctl01_rPlanItems_ctl01_ccAnnouncement_liTitle class=AnnouncementTitle><SPAN id=rItemHeaders_ctl01_rPlanItems_ctl01_ccAnnouncement_Title>pain medication before exercise</SPAN>
<LI class=AnnouncementMsg><SPAN id=rItemHeaders_ctl01_rPlanItems_ctl01_ccAnnouncement_AnnouncementMsg>Please take your pain medication 30 minutes before you start your exercise</SPAN> </LI></UL>
<LI>
<UL class="PlanItemDisplay AnnouncementPlanItemDisplay">
<LI id=rItemHeaders_ctl01_rPlanItems_ctl02_ccAnnouncement_liTitle class=AnnouncementTitle><SPAN id=rItemHeaders_ctl01_rPlanItems_ctl02_ccAnnouncement_Title>towel under ankle</SPAN>
<LI class=AnnouncementMsg><SPAN id=rItemHeaders_ctl01_rPlanItems_ctl02_ccAnnouncement_AnnouncementMsg>It is important that you place a towel roll under your ankle when you are lying in bed</SPAN> </LI></UL>
<LI>
<UL class="PlanItemDisplay AnnouncementPlanItemDisplay">
<LI id=rItemHeaders_ctl01_rPlanItems_ctl03_ccAnnouncement_liTitle class=AnnouncementTitle><SPAN id=rItemHeaders_ctl01_rPlanItems_ctl03_ccAnnouncement_Title>blood clot</SPAN>
<LI class=AnnouncementMsg><SPAN id=rItemHeaders_ctl01_rPlanItems_ctl03_ccAnnouncement_AnnouncementMsg>If you have any of these symptoms, please contact the office immediately. * Changes in skin color (redness) in one leg * Increased warmth in one leg * Leg pain in one leg * Leg tenderness in one leg * Swelling (edema) of one leg</SPAN> </LI></UL></LI></OL><BR></TD></TR>
<TR vAlign=top>
<TD><LABEL class=printLbl>My Medications:</LABEL><BR>
<OL class=printplanitemlist>
<LI>
<UL class="PlanItemDisplay MedicationPlanItemDisplay">
<LI id=rItemHeaders_ctl02_rPlanItems_ctl00_ccMedication_liTitle class=MedicationTitle><SPAN id=rItemHeaders_ctl02_rPlanItems_ctl00_ccMedication_Title>pain reliever</SPAN>
<LI class=MedicationName><SPAN id=rItemHeaders_ctl02_rPlanItems_ctl00_ccMedication_Name>ibuprofen</SPAN>
<LI class=MedicationClass>(<SPAN id=rItemHeaders_ctl02_rPlanItems_ctl00_ccMedication_MedicationClass>caplets</SPAN>)
<LI class=MedicationStrength><SPAN id=rItemHeaders_ctl02_rPlanItems_ctl00_ccMedication_Strength>800 mg</SPAN>
<LI class=MedicationForm><SPAN id=rItemHeaders_ctl02_rPlanItems_ctl00_ccMedication_Form></SPAN>,
<LI class=MedicationHowOften><SPAN id=rItemHeaders_ctl02_rPlanItems_ctl00_ccMedication_HowOften>Take 1 caplet every 4-6 hours as needed</SPAN> </LI></UL></LI></OL><BR></TD></TR>
<TR vAlign=top>
<TD><LABEL class=printLbl>My Activities:</LABEL><BR>
<OL class=printplanitemlist>
<LI>
<UL style="TEXT-ALIGN: left; MARGIN-LEFT: 0px; CLEAR: left; LEFT: 0px" id=ActivityDisplay class="PlanItemDisplay MedicationPlanItemDisplay">
<LI class=ActivityPromptText><SPAN id=rItemHeaders_ctl03_rPlanItems_ctl00_ccActivity_ActivityText>Please walk with your assistive device (walker/cane or crutches) on a flat surfaces within your house for 15 minutes 5 times per day</SPAN> </LI></UL>
<LI>
<UL style="TEXT-ALIGN: left; MARGIN-LEFT: 0px; CLEAR: left; LEFT: 0px" id=ActivityDisplay class="PlanItemDisplay MedicationPlanItemDisplay">
<LI class=ActivityPromptText><SPAN id=rItemHeaders_ctl03_rPlanItems_ctl01_ccActivity_ActivityText>Please walk up and down stairs 3 times today WITH ASSISTANCE ONLY. Always use a device and a rail. If you do not have stairs, disregard this</SPAN> </LI></UL>
<LI>
<UL style="TEXT-ALIGN: left; MARGIN-LEFT: 0px; CLEAR: left; LEFT: 0px" id=ActivityDisplay class="PlanItemDisplay MedicationPlanItemDisplay">
<LI class=ActivityPromptText><SPAN id=rItemHeaders_ctl03_rPlanItems_ctl02_ccActivity_ActivityText>Please use ice as needed today. Be certain to use it after exercising as well</SPAN> </LI></UL>
<LI>
<UL style="TEXT-ALIGN: left; MARGIN-LEFT: 0px; CLEAR: left; LEFT: 0px" id=ActivityDisplay class="PlanItemDisplay MedicationPlanItemDisplay">
<LI class=ActivityPromptText><SPAN id=rItemHeaders_ctl03_rPlanItems_ctl03_ccActivity_ActivityText>Please massage the area around your incision several times today</SPAN> </LI></UL>
<LI>
<UL style="TEXT-ALIGN: left; MARGIN-LEFT: 0px; CLEAR: left; LEFT: 0px" id=ActivityDisplay class="PlanItemDisplay MedicationPlanItemDisplay">
<LI class=ActivityPromptText><SPAN id=rItemHeaders_ctl03_rPlanItems_ctl04_ccActivity_ActivityText>Please use the stationary recombent bike today for 10 minutes. Start with partial revolutions and progress to full revolutions as tolerated.</SPAN> </LI></UL>
<LI>
<UL style="TEXT-ALIGN: left; MARGIN-LEFT: 0px; CLEAR: left; LEFT: 0px" id=ActivityDisplay class="PlanItemDisplay MedicationPlanItemDisplay">
<LI id=rItemHeaders_ctl03_rPlanItems_ctl05_ccActivity_liEquipment class=ActivityEquipment><SPAN id=rItemHeaders_ctl03_rPlanItems_ctl05_ccActivity_Equipment>CAMOped</SPAN>
<LI class=ActivityPromptText><SPAN id=rItemHeaders_ctl03_rPlanItems_ctl05_ccActivity_ActivityText>Use CAMOped twice a day for 30 minutes.</SPAN> </LI></UL></LI></OL><BR></TD></TR>
<TR vAlign=top>
<TD><LABEL class=printLbl>My Questions:</LABEL><BR>
<OL class=printplanitemlist>
<LI>
<UL class="PlanItemDisplay QuestionPlanItemDisplay">
<LI id=rItemHeaders_ctl04_rPlanItems_ctl00_ccQuestion_liTitle class=QuestionTitle><SPAN id=rItemHeaders_ctl04_rPlanItems_ctl00_ccQuestion_Title>How are you feeling today?</SPAN>
<LI class=QuestionPromptText><SPAN id=rItemHeaders_ctl04_rPlanItems_ctl00_ccQuestion_PromptText>How are you feeling today?</SPAN> </LI></UL></LI></OL><BR></TD></TR>
<TR vAlign=top>
<TD><LABEL class=printLbl>My Measurements:</LABEL><BR>
<OL class=printplanitemlist>
<LI>
<UL class="PlanItemDisplay MeasurementPlanItemDisplay">
<LI id=rItemHeaders_ctl05_rPlanItems_ctl00_ccMeasurement_liTitle class=MeasurementTitle><SPAN id=rItemHeaders_ctl05_rPlanItems_ctl00_ccMeasurement_Title>Knee Motion</SPAN>
<LI class=MeasurementPromptText><SPAN id=rItemHeaders_ctl05_rPlanItems_ctl00_ccMeasurement_PromptText>How much can you bend your knee?</SPAN> </LI></UL>
<LI>
<UL class="PlanItemDisplay MeasurementPlanItemDisplay">
<LI id=rItemHeaders_ctl05_rPlanItems_ctl01_ccMeasurement_liTitle class=MeasurementTitle><SPAN id=rItemHeaders_ctl05_rPlanItems_ctl01_ccMeasurement_Title>pain level</SPAN>
<LI class=MeasurementPromptText><SPAN id=rItemHeaders_ctl05_rPlanItems_ctl01_ccMeasurement_PromptText>Please log your pain level today</SPAN> </LI></UL>
<LI>
<UL class="PlanItemDisplay MeasurementPlanItemDisplay">
<LI id=rItemHeaders_ctl05_rPlanItems_ctl02_ccMeasurement_liTitle class=MeasurementTitle><SPAN id=rItemHeaders_ctl05_rPlanItems_ctl02_ccMeasurement_Title>range of motion</SPAN>
<LI class=MeasurementPromptText><SPAN id=rItemHeaders_ctl05_rPlanItems_ctl02_ccMeasurement_PromptText>Please measure your ability to bend and straighten your operative knee</SPAN> </LI></UL></LI></OL><BR></TD></TR></TBODY></TABLE><!--- indicates the date that the plan is currently displaying ---><INPUT id=hidDisplayedDate type=hidden name=hidDisplayedDate> </DIV>
<DIV class=footer>Copyright © 2008 - <SPAN id=lblCopyrightEndYear>2011</SPAN> iGetBetter, Inc. All rights reserved. </DIV></DIV></FORM>
```
| Ordered List not printing number 1, but all other numbers. why? | CC BY-SA 2.5 | null | 2011-01-13T04:10:42.490 | 2011-01-14T03:11:20.560 | 2011-01-13T05:14:00.543 | 109,849 | 109,849 | [
"css",
"internet-explorer",
"cross-browser"
]
|
4,677,052 | 1 | 4,694,761 | null | 1 | 3,022 | Thanks to [this answer](https://stackoverflow.com/questions/835839/client-configuration-to-consume-wcf-json-web-service/4535043#4535043), I am now able to successfully call a JSON RESTful service using a WCF client. But that service uses HTTP status codes to notify the result. I am not sure how I can access those status codes since I just receive an exception on client side while calling the service. Even the exception doesn't have HTTP status code property. It is just buried in the exception message itself.

So the question is, how to check/access the HTTP status code of response when the service is called.
| Accessing HTTP status code while using WCF client for accessing RESTful services | CC BY-SA 2.5 | null | 2011-01-13T05:22:22.953 | 2011-01-14T18:59:00.313 | 2017-05-23T12:07:06.850 | -1 | 23,671 | [
"wcf",
"json",
"wcf-client",
"wcf-rest"
]
|
4,677,347 | 1 | 4,677,501 | null | 0 | 4,788 | When compile and run using eclipse there is no problem , but when I exported as jar with these setting , i got `Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: gnu/io/SerialPortEventListener` .
The jar exporter didn't export my extended jar library?


| eclipse export jar java.lang.NoClassDefFoundError problem | CC BY-SA 2.5 | null | 2011-01-13T06:15:42.820 | 2012-01-11T10:12:03.023 | null | null | 227,149 | [
"java",
"eclipse",
"jar"
]
|
4,677,480 | 1 | 4,690,216 | null | 2 | 1,477 | I am using a property grid to edit, amongst other things, a collection of items:

The default behavior for a collection provides a + button to edit each member of the array.
I am using a Form to edit this field, which is already wired up but I want to remove the ability for the user to edit the array by using the 'expander'
So it would look like this:

UPDATE1: made ProductIds an IList property instead of int[ ]
Now does this:

-----------------!
UPDATE2: made ProductIds a custom class, eg
```
MyWrappedCollection : IEnumerable<int>
```
so it now looks like this:

Sure, it still shows [+] but it doesnt expand to anything (ie disappears when you click it)
| Modify default behaviour of PropertyGrid and TypeConverterAttribute | CC BY-SA 2.5 | null | 2011-01-13T06:41:49.710 | 2011-01-14T10:45:43.260 | 2011-01-13T07:56:40.840 | 224,410 | 224,410 | [
"c#",
"winforms",
"propertygrid"
]
|
4,677,552 | 1 | 4,678,801 | null | 8 | 9,112 | Is there a way to encode JPEG at a specific bitrate?
Presently, I'm using imagemagick's `convert`:
```
convert Lenna-gray-100.jpeg -quality 1.1111 test.jpeg
```
Bitrate increases with quality, but it's non-linear. I want to control the bitrate explicitly. It doesn't have to be exact, but I want it reasonably close (within, say 0.1 bpp of the specified setting).
Is there any encoder there that allows images to be encoded at a particular bit-rate? It doesn't have to be imagemagick, I'll take whatever works (preferably on Linux).
A dumb way to do this would be to play around with fractional values to the `-quality` parameter until something close to the target bitrate comes out, but I'm hoping for a more elegant solution.
So I got bored and decided to do things the quick (but stupid) way.
First, here's a graph of imagemagick's `-quality` vs bitrate:

BTW, here's the image I used:

So the change in bitrate is quite fine for lower quality values, but becomes coarse after about 80.
Here's some sample code to encode an image at some target bitrate. I used OpenCV cause it allows for in-memory JPEG encoding (no I/O necessary). While I originally was going to mock this up with Python, unfortunately the Python OpenCV wrappers don't expose the in-memory encoding functionality. So I wrote it in C++.
Lastly, I was thinking of using linear interpolation on the quality to get closer to the target bitrate, but since `cv::imencode` only accepts integer parameters, it's not possible to set a non-integer JPEG quality. The quality scale between OpenCV and imagemagick seems to differ somewhat as well, so taking the interpolated quality parameter from OpenCV and using in imagemagick's `convert` didn't work well.
This means that the output bitrate isn't equal to the target bitrate, especially at higher bitrates ( > 1). But it's close.
Can anyone suggest something better?
Code:
```
#include <stdio.h>
#include <cv.h>
#include <highgui.h>
#include <assert.h>
#include <vector>
using cv::Mat;
using std::vector;
#define IMENCODE_FMT ".jpeg"
#define QUALITY_UBOUND 101
#define BITS_PER_BYTE 8
int
main(int argc, char **argv)
{
if (argc != 4)
{
fprintf(stderr, "usage: %s in.png out.jpeg bpp\n", argv[0]);
return 1;
}
char *fname_in = argv[1];
char *fname_out = argv[2];
float target;
sscanf(argv[3], "%f", &target);
Mat orig = cv::imread(fname_in);
int pixels = orig.size().width * orig.size().height * orig.channels();
vector<unsigned char> buf;
vector<int> params = vector<int>(2);
params[0] = CV_IMWRITE_JPEG_QUALITY;
int q;
double bpp = 0.0;
for (q = 1; q < QUALITY_UBOUND; ++q)
{
params[1] = q;
cv::imencode(IMENCODE_FMT, orig, buf, params);
bpp = (double)buf.size() * BITS_PER_BYTE / pixels;
if (bpp > target)
break;
}
cv::imwrite(fname_out, orig, params);
printf("wrote %s at %d%% quality, %.2fbpp\n", fname_out, q, bpp);
return 0;
}
```
Compile and run using:
```
g++ -c -Wall -ggdb -I../c -I../blur `pkg-config --cflags opencv` -Wno-write-strings jpeg-bitrate.cpp -o jpeg-bitrate.o
g++ -I../c `pkg-config --cflags opencv` `pkg-config --libs opencv` -lboost_filesystem jpeg-bitrate.o -o jpeg-bitrate.out
rm jpeg-bitrate.o
misha@misha-desktop:~/co/cpp$ ./jpeg-bitrate.out Lenna-gray.png test.jpeg 0.53
wrote test.jpeg at 88% quality, 0.55bpp
```
| How to specify bitrate for JPEG compression? | CC BY-SA 2.5 | 0 | 2011-01-13T06:55:26.307 | 2015-10-22T14:58:59.650 | 2011-01-14T07:59:31.650 | 356,020 | 356,020 | [
"image-processing",
"compression",
"opencv",
"imagemagick",
"jpeg"
]
|
4,677,701 | 1 | 4,986,186 | null | 7 | 2,214 | I have simple window.
This is what happens when I click ComboBox:

List appears in upper left corner of screen instead of under Combobox.
XAML:
```
<Window x:Class="WpfPortOfTestingCamera.VideoSettings"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Video Settings" WindowStartupLocation="CenterOwner" ResizeMode="NoResize" ShowInTaskbar="False" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" SizeToContent="WidthAndHeight" d:DesignHeight="167">
<StackPanel Name="stackPanel1" VerticalAlignment="Top" HorizontalAlignment="Center">
<GroupBox Header="Settings" Name="groupBox1">
<Grid Name="grid1" VerticalAlignment="Center" HorizontalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80*" />
<ColumnDefinition Width="175*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Label Content="Resolution:" Height="28" Name="label1" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
<Label Content="Framerate:" Height="28" HorizontalAlignment="Left" Margin="0" Name="label2" VerticalAlignment="Center" Grid.Row="1" />
<ComboBox Grid.Column="1" Height="23" HorizontalAlignment="Left" Margin="0" Name="comboBox1" VerticalAlignment="Center" Width="150" SelectionChanged="comboBox1_SelectionChanged" />
<ComboBox Height="23" HorizontalAlignment="Left" Margin="0" Name="comboBox2" VerticalAlignment="Center" Width="150" Grid.Column="1" Grid.Row="1" SelectionChanged="comboBox2_SelectionChanged" />
</Grid>
</GroupBox>
<Label Name="labelSelectedSize" Content="Size @ FPS" />
<Button Name="button1" Content="Apply" Click="button1_Click" />
</StackPanel>
</Window>
```
| C# Strange WPF Combobox Behavior | CC BY-SA 2.5 | 0 | 2011-01-13T07:22:27.460 | 2014-04-16T19:50:07.417 | null | null | 465,408 | [
"c#",
".net",
"wpf",
"xaml",
"combobox"
]
|
4,677,862 | 1 | 4,678,634 | null | 3 | 3,314 | `width`
I want to reduce the width of the following barchart so Type 5, Type 4, Type 3, Type 2, Type 1 are very close to each other. I tried playing with the `barWidthRatio`, the `horizontalAxisRatio` and the `maxBarWidth` properties. Neither is giving me the desired result. I can only manage to reduce the width of the orange bars, how do I reduce the width of the blue bars?

Is there no way to do this?
| Reducing width of bar chart series | CC BY-SA 2.5 | 0 | 2011-01-13T07:50:31.953 | 2011-11-02T12:24:40.727 | 2011-01-13T09:17:11.120 | 157,837 | 157,837 | [
"apache-flex",
"charts"
]
|
4,678,052 | 1 | 4,678,111 | null | 0 | 227 | I have my old data model, my new model (same but with two more text fields in one entity) and a mapping model (just the default generated one).
When I do automatic migration, I get a crash and a stacktrace that looks like it's entered an endless loop, 62851 stack frames, mostly _PF_Handler_Public_GetProperty and descriptions on NSManagedObject, terminated by a malloc error, which I assume is the endless loop running out of memory on my device.

Do you have any idea what can lead to such an endless loop? I have no idea where to start debugging this.
Cheers
Nik
| Core Data: endless loop while auto-migrating between two data models | CC BY-SA 2.5 | null | 2011-01-13T08:26:22.930 | 2011-03-04T21:25:41.827 | 2011-03-04T21:25:41.827 | 203,220 | 80,246 | [
"iphone",
"cocoa",
"core-data",
"mapping-model",
"core-data-migration"
]
|
4,678,116 | 1 | 4,678,151 | null | 0 | 861 | I have canvas called "drawCanvas" to show images and inkcanvas that is contained in the canvas called "CanvasContainInkCanvas". I can zoom out by using MatrixTransform.
```
//Get the image that's being manipulation.
Canvas element = (Canvas)e.Source;
//Ues the matrix of the transform to manipulation the element's appearance.
Matrix matrix = ((MatrixTransform)drawCanvas.RenderTransform).Matrix;
//Get the ManipulationDelta object.
ManipulationDelta deltaManipulation = e.DeltaManipulation;
//Find the old center, and apply any previous manipulations.
Point center = new Point(element.ActualWidth / 2, element.ActualHeight / 2);
//Apply new move manipulation (if it exists).
center = matrix.Transform(center);
//Apply new zoom manipulation (if it exists).
matrix.ScaleAt(deltaManipulation.Scale.X, deltaManipulation.Scale.Y, center.X, center.Y);
//Translation (pan)
matrix.Translate(e.DeltaManipulation.Translation.X, e.DeltaManipulation.Translation.Y);
//Set the final matrix.
((MatrixTransform)drawCanvas.RenderTransform).Matrix = matrix;
// set the matrix of canvas that contain inkcanvas
((MatrixTransform)CanvasContainInkCanvas.RenderTransform).Matrix = matrix;
```
If I zoom out, I can see images outside canvas.

I want to copy images from canvas to inkcanvas to use selection.
My problem is that the images cannot be shown outside inkcanvas.

How do I show images outside inkcanvas?
Thanks
How do I use selection outside inkcanvas?
| How to show image outside inkcanvas | CC BY-SA 2.5 | null | 2011-01-13T08:39:48.530 | 2011-01-13T09:37:43.697 | 2011-01-13T09:37:43.697 | 556,917 | 556,917 | [
"c#",
"wpf",
"inkcanvas"
]
|
4,678,142 | 1 | 10,481,324 | null | 6 | 6,448 | HI,
I recently was reverse engineering a certain project to UML, and was stuck at a point where I could not reach a conclusion. The code is fairly simple:
```
...
try
{
sj = SendingJob.DeserializeXmlString("....");
trcSrc.TraceInfo("....");
}
catch (FormatException)
{
trcSrc.TraceError("....");
return "00 - Job Content Bad Format.";
} ...
```
Firts off I modeled the code as such:
---

---
But after reading the following text:
> "If an exception occurs while an action is executing, the execution is abandoned and there is no output from the action. If the action has an exception handler, the handler is executed with the exception information. "
... but the thing is my exception handler exits the catch block by returning a value, and stopping the activity. I tried to link the exception node to an activity final node, but my tool refuses to do it, and which I'm pretty sure is not the correct way to do it.
So my question is:
How to model an activity diagram where an action throws an exception and its handler terminates the activity?
| Uncertain about exception handling in UML 2.0 Activity Diagram | CC BY-SA 2.5 | 0 | 2011-01-13T08:44:01.893 | 2013-12-02T21:18:35.767 | 2011-01-14T07:15:49.973 | 339,204 | 339,204 | [
"uml",
"activity-diagram"
]
|
4,678,318 | 1 | 4,678,387 | null | 4 | 2,852 | I have developed a Facebook application that runs inside an iframe in the Facebook canvas. For it to work properly I request extended permissions from the user. If the user hasn't authorized the application I send him/her to a login page with the getLoginUrl() method in the PHP SDK.
It works, but it's not pretty. The method sends the user to a landing page before the authentication page. It looks like this:

When I click "Go to Facebook.com" I see the actual page for permission requests (I also get right to the permissions page if I print the url, copy it and enter it into a new browser window). How do I make Facebook skip this step when I do the redirect from an Iframe?
My code looks like this (using CodeIgniter and Facebook PHP SDK):
```
$this->facebook = new Facebook(array(
'appId' => '{MY_APP_ID}',
'secret' => '{MY_SECRET}',
'cookie' => TRUE,
'domain' => $_SERVER['SERVER_NAME']
));
$this->facebook->getSession();
try {
$this->me = $this->facebook->api('/me');
}
catch (FacebookApiException $e) {
$this->me = NULL;
}
if ( is_null($this->me) ) {
redirect($this->facebook->getLoginUrl(array(
'req_perms' => 'offline_access,read_stream,publish_stream,user_photos,user_videos,read_friendlists',
'next' => $this->config->item('base_url').'fblogin.php?redirect_uri='.$this->uri->uri_string()
)));
}
```
| Facebook Iframe application authentication? | CC BY-SA 2.5 | 0 | 2011-01-13T09:07:53.390 | 2011-01-14T17:32:00.337 | null | null | 160,574 | [
"php",
"facebook",
"facebook-graph-api"
]
|
4,678,415 | 1 | 4,678,605 | null | 1 | 1,069 | I am a newbie in windows phone 7.
WHen I add a new windows phone 7 project into visual studio, it creates MainPage.xaml and MainPage.cs as default. After that, I want to rename these file to HomePage.xaml and HomePage.cs, so I selected this file (in solution explorer) then pressed F2 and entered the new name. The renaming was ok. But when I pressed F5 to run my project, Visual studio stoped at the code line as below image. If I press F10 or F5 to continue, my application down.
If you know about this problem, please tell me.
Thanks.
Binh Nguyen
| How can I rename of the MainPage.xaml and MainPage.cs in windows phone 7 | CC BY-SA 2.5 | null | 2011-01-13T09:18:25.597 | 2011-01-14T10:10:56.587 | null | null | 523,325 | [
"windows-phone-7",
"rename"
]
|
4,678,428 | 1 | null | null | 2 | 211 | See attached screenshot, I'm trying to create a rule that allows me to control who gets the Administrator role based on the domain of their email address from the google identity provider.
This seems like it should be pretty straight forward; the google apps OAuth provider should probably provide the domain for it's google apps accounts, but as it doesn't at the moment I want to do some sort of wildcard match on the email address.
It's straightforward to handle it in the relying party application, but I'm trying to externalise the identity management function.

| Is it possible to configure a rule in Azure ACS so that I can match a claim value with a wildcard/regular expression? | CC BY-SA 2.5 | 0 | 2011-01-13T09:20:00.720 | 2011-03-15T09:16:57.447 | null | null | 270,679 | [
".net",
"azure",
"identity"
]
|
4,678,665 | 1 | 4,679,443 | null | 8 | 1,271 | I have shapes constructed out of 8x8 squares. I need to tile them using the fewest number of squares of size 8x8, 16x16, 32x32 and 64x64. Four 8x8 squares arranged in a square can be replaced by a single 16x16 square, e.g.:

What algorithm can be used to achieve this?
| Finding the optimal tiling strategy using squares of different sizes | CC BY-SA 2.5 | 0 | 2011-01-13T09:50:33.347 | 2011-01-13T11:24:40.487 | 2011-01-13T11:24:40.487 | 89,806 | 574,035 | [
"algorithm"
]
|
4,678,706 | 1 | null | null | 2 | 167 | I have this Layout:
```
<HorizontalScrollView android:id="@+id/card_images_horizontalscroll"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:scrollbars="none"
android:visibility="invisible"
>
<LinearLayout android:id="@+id/card_images_layout"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<ImageButton
android:id="@+id/card_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/icona"
android:
/>
</LinearLayout>
</HorizontalScrollView>
```
But I meet this issues: the image are enclose by a frame which I don't want, what's wrong?!
Like this:

Thanks so much!
I tried to change XML with this runtime code but I have the same issues:
```
b = new ImageButton(this);
b.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.WRAP_CONTENT));
b.startAnimation(alpha_animation);
b.setImageBitmap(myBitmap);
```
I tried also to follow the suggestion for change ImageButton in Button, but can I set at runtime the image source?
| ImageButton in an HorizontalSrollView have a frame | CC BY-SA 2.5 | null | 2011-01-13T09:56:29.330 | 2011-03-24T19:21:30.033 | 2011-01-13T10:18:00.647 | 554,892 | 554,892 | [
"android"
]
|
4,679,110 | 1 | 4,679,169 | null | 1 | 2,688 | So I want to rotate a subview x degrees (or at least 90 degrees). I want the subwiew to rotate around the subview's bottom right corner. Is it possible to do this animated like in the picture below?

Thanks!
| How do I rotate a subview x degrees? | CC BY-SA 2.5 | null | 2011-01-13T10:37:33.070 | 2011-01-13T11:03:07.377 | null | null | 273,555 | [
"iphone",
"objective-c"
]
|
4,679,235 | 1 | 4,679,924 | null | 15 | 2,754 | I'm preparing to create a WCF Service which our customers can use to update data in our system. So it has to be available over the Internet. I have a book about WCF from which I know the `Message Security` is the way to go when making a WCF Service available over the Internet. That is because you shouldn't use the transport security because it should only be used in environments where you can guarantee that there is a point-to-point connection between service and client. Did I get that right?
So I want to use Message Security in combination with a custom `UserName` authentication. I understand that I have to get a certificate to accomplish that. Our company already owns a SSL Certificate that is used for our Websites.
-
And
-
For testing purposes I created my own certificate with Makecert. It worked fine but I always had to add the certificate to the `Trusted Persons` on the client machine.
- `Message Security``Trusted Persons`
Now, let's assume the following scenario:

There are two Webservers behind an ISA-Server/Firewall. This ISA-Server holds the certificate for the www.company.com address. So all the SSL stuff is handled by it. It also forwards the incoming requests to the webservers accordingly. The newly created WCF Service should run on the 2nd webserver.
- `Message Security`
If yes, I heard copying certificates is not good practice because it reduces the level of security. Moving the certificate to the webserver is not an option, because it's needed for the websites on Web-Server1, too.
-
And:
-
Thank you...
| WCF Service - certificates and message security with UserName authentication | CC BY-SA 2.5 | 0 | 2011-01-13T10:53:35.690 | 2011-01-13T13:31:48.930 | 2011-01-13T13:31:48.930 | 254,797 | 254,797 | [
".net",
"authentication",
"wcf",
"certificate"
]
|
4,679,481 | 1 | 4,679,635 | null | 0 | 69 | I'm learning HTML & CSS and have built a page: [http://customstudio.co.uk/development](http://customstudio.co.uk/development)
The page is working well apart from in IE (7 in particular). For some reason the body text is not displaying (see screengrab below).
Any ideas will be gratefully received.
Thanks in advance,
Tom Perkins

| Internet Explorer Issue | CC BY-SA 2.5 | null | 2011-01-13T11:21:11.610 | 2011-01-13T12:18:00.557 | null | null | 557,002 | [
"html",
"css",
"internet-explorer"
]
|
4,679,557 | 1 | 4,679,811 | null | 2 | 5,407 | i'm getting this error when i run the ddms in android sdk tools:

From adb i change some settings from the Preferences > misc and i set the logging level as debbug.

and now i getting this:

Can you please help me to find out what the problem is?
Thank you
| android ddms error | CC BY-SA 2.5 | null | 2011-01-13T11:32:39.487 | 2011-01-13T12:06:27.677 | 2020-06-20T09:12:55.060 | -1 | 495,296 | [
"android",
"ddms"
]
|
4,679,575 | 1 | null | null | 1 | 1,422 | 
As you can see, a linearlayout is on top of the tabs. What I want is to align the LinearLayout bottom to the tabs top.
Alternatively aligning the RelativeLayout to the top of tabs may also work.
Here's the corresponding code for the view above:
```
<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout android:id="@+id/RelativeLayout01" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout android:layout_width="fill_parent" android:orientation="vertical" android:layout_height="wrap_content" android:id="@+id/LinearLayout02" android:layout_alignParentBottom="true">
<FrameLayout android:id="@+id/FrameLayout02" android:layout_height="wrap_content" android:layout_width="fill_parent" android:paddingTop="20sp" android:paddingBottom="20sp">
<ImageButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/record" android:layout_gravity="center_horizontal" android:id="@+id/RecordImageButton"></ImageButton>
</FrameLayout>
<SeekBar android:id="@+id/SeekBar01" android:layout_height="wrap_content" android:layout_width="fill_parent" android:paddingBottom="5sp" android:paddingLeft="10sp" android:paddingRight="10sp"></SeekBar>
<FrameLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/FrameLayout03">
<LinearLayout android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/LinearLayout02" android:layout_gravity="center_horizontal">
<ImageButton android:layout_width="wrap_content" android:id="@+id/ImageButton01" android:layout_height="wrap_content" android:src="@drawable/play_rev"></ImageButton>
<ImageButton android:layout_width="wrap_content" android:id="@+id/ImageButton02" android:layout_height="wrap_content" android:src="@drawable/play_stop"></ImageButton>
<ImageButton android:layout_width="wrap_content" android:id="@+id/ImageButton03" android:layout_height="wrap_content" android:src="@drawable/play"></ImageButton>
</LinearLayout>
</FrameLayout>
</LinearLayout>
</RelativeLayout>
```
Here is the code for the tabs:
```
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TabWidget
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@android:id/tabs"
android:layout_alignParentBottom="true" />
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@android:id/tabcontent" />
</RelativeLayout>
</TabHost>
```
MainActivity, which sets an activity for each tab:
```
public void initTabs()
{
Resources res = getResources(); // Resource object to get Drawables
TabHost tabHost = getTabHost(); // The activity TabHost
TabHost.TabSpec spec; // Resusable TabSpec for each tab
Intent intent; // Reusable Intent for each tab
intent = new Intent().setClass(this, FirstActivity.class);
spec = tabHost.newTabSpec("tab1").setIndicator("Tab",
res.getDrawable(R.drawable.ic_tab_artists))
.setContent(intent);
tabHost.addTab(spec);
intent = new Intent().setClass(this, SecondActivity.class);
spec = tabHost.newTabSpec("tab2").setIndicator("Tab 2",
res.getDrawable(R.drawable.ic_tab_artists))
.setContent(intent);
tabHost.addTab(spec);
intent = new Intent().setClass(this, ThridActivity.class);
spec = tabHost.newTabSpec("tab3").setIndicator("Tab 3",
res.getDrawable(R.drawable.ic_tab_artists))
.setContent(intent);
tabHost.addTab(spec);
tabHost.setCurrentTab(0);
}
```
| Android: Layout on top of tabs | CC BY-SA 2.5 | null | 2011-01-13T11:33:49.277 | 2013-07-08T13:05:38.200 | 2011-01-14T07:41:15.503 | 566,615 | 566,615 | [
"android",
"layout"
]
|
4,679,632 | 1 | 4,680,318 | null | 4 | 842 | How can I just open something similar to what I see in the theme roller site?

Alternatively, can I open a jQuery Dialog without the title bar
| How can I just open an Overlay (like dialog without title bar) in jQuery UI | CC BY-SA 2.5 | null | 2011-01-13T11:40:24.887 | 2011-01-13T12:57:58.137 | null | null | 292,291 | [
"jquery-ui"
]
|
4,679,676 | 1 | 4,680,033 | null | 1 | 1,051 | Thanks at all for all your help for now.I have another little issues
This is a portion of my layout which give me some problems:
```
<RelativeLayout android:id="@+id/card_address_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="visible"
>
<TextView
style="@style/card_field"
android:id="@+id/card_indirizzo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="left|center_vertical"
android:layout_marginTop="8dp"
android:maxLength="35"
android:ellipsize="marquee"
/>
<ImageButton
android:id="@+id/card_address_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|center_vertical"
android:layout_toRightOf="@id/card_indirizzo"
android:src="@drawable/map_selector"
android:onClick="startMap"
android:padding="0dp" />
</RelativeLayout>
```
The image button src is a selector, in this case this one:
```
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/map_b" /> <!-- pressed -->
<item android:drawable="@drawable/map_a" /> <!-- default -->
```
This is the result and I really don't understand why, why the image button has padding??!!!

Help meeeee!
This is the FULL xml:
```
<?xml version="1.0" encoding="utf-8"?>
```
```
<HorizontalScrollView android:id="@+id/card_images_horizontalscroll"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:scrollbars="none"
android:visibility="invisible"
>
<LinearLayout android:id="@+id/card_images_layout"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="80dp"
android:layout_marginRight="4dp"
>
</LinearLayout>
</HorizontalScrollView>
<TextView
android:id="@+id/card_images_footer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:background="@drawable/click_it"
/>
<ScrollView android:id="@+id/card_data_verticalscroll"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
>
<LinearLayout android:id="@+id/main_vertical_scroll_layout"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<TextView
style="@style/card_title"
android:id="@+id/card_name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:layout_weight="1"
/>
<TextView
style="@style/card_category"
android:id="@+id/card_categoria"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:layout_marginBottom="30dp"
/>
<RelativeLayout android:id="@+id/card_address_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="visible"
>
<TextView
style="@style/card_field"
android:id="@+id/card_indirizzo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="left|center_vertical"
android:layout_marginTop="8dp"
android:maxLength="35"
android:ellipsize="marquee"
/>
<ImageButton
android:id="@+id/card_address_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|center_vertical"
android:layout_toRightOf="@id/card_indirizzo"
android:src="@drawable/map_selector"
android:onClick="startMap"
android:padding="0dp" />
</RelativeLayout>
<RelativeLayout android:id="@+id/card_phone_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
>
<TextView
style="@style/card_field"
android:id="@+id/card_telefono"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:maxLength="35"
android:ellipsize="marquee"
android:layout_gravity="center_vertical"
android:layout_marginTop="8dp"
/>
<ImageButton android:text="call"
android:id="@+id/card_telefono_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_gravity="right|center_vertical"
android:src="@drawable/call_selector"
android:onClick="startCall"
/>
</RelativeLayout>
<RelativeLayout android:id="@+id/card_mail_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
>
<TextView
style="@style/card_field"
android:id="@+id/card_mail"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:maxLength="35"
android:ellipsize="marquee"
android:layout_gravity="center_vertical"
android:layout_marginTop="8dp"
/>
<ImageButton android:text="mail"
android:id="@+id/card_mail_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_gravity="right|center_vertical"
android:onClick="startMailClient"
android:src="@drawable/mail_selector"
/>
</RelativeLayout>
<RelativeLayout android:id="@+id/card_www_layout"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
>
<TextView
style="@style/card_field"
android:id="@+id/card_www"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:maxLength="35"
android:ellipsize="marquee"
android:layout_gravity="center_vertical"
android:layout_marginTop="8dp"
/>
<ImageButton android:text="www"
android:id="@+id/card_www_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_gravity="right|center_vertical"
android:onClick="startDefaultBrowser"
android:src="@drawable/www_selector"
/>
</RelativeLayout>
<TextView
style="@style/card_description"
android:id="@+id/card_descrizione"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="false"
android:layout_marginTop="30dp"
/>
</LinearLayout>
</ScrollView>
```
| Again ImageButton issues | CC BY-SA 2.5 | 0 | 2011-01-13T11:46:11.790 | 2011-01-13T12:31:20.007 | 2011-01-13T12:13:34.163 | 554,892 | 554,892 | [
"android",
"padding",
"android-relativelayout"
]
|
4,679,897 | 1 | 4,757,971 | null | 0 | 1,415 | I have a DataGridView with a Binding-Source bound to a Data-Table loaded from an Oracle-Database. (btw. I don't think that the Database-Connection could cause this)
I have also a DataGridViewComboBoxColumn bound to an class of persons (only "has" ID and name), so I can display / allow to edit the name instead of the ID. My problem is now that after the data-binding is completed c# automatically "selects" the first cell of the DGV - see the attached picture.

I also have to use this little piece of code to ensure data integrity:
```
private void _table_ColumnChanging(object sender, DataColumnChangeEventArgs e)
{
if (e.Column == _table.Columns["NEEDED_ID"])
{
if (e.ProposedValue == null)
{
e.ProposedValue = System.DBNull.Value;
}
}
}
```
Now using this _table.GetChanges() always returns the first row of the DGV as "modified" but the value isn't really changed - it's only `DBNull` instead of `null`. Can I somehow avoid automatic selection of first cell or how to avoid this behavior?
Meanwhile I found out that changing the first column to something not editable fixes this problem. But this is nothing more than an workaround. I would really appreciate to get an working solution for this.
I have also an empty Object 'on top' of the ComboBox-DataSource
```
DtoPerson blankPerson = new DtoPerson();
blankPerson.Name = String.Empty;
blankPerson.PersonRollenId = -1;
personList.Add(blankPerson);
```
| datatable.GetChanges() shows always first row of DataGridView | CC BY-SA 2.5 | 0 | 2011-01-13T12:16:43.423 | 2012-08-16T09:06:03.520 | 2011-01-21T13:11:37.620 | 474,221 | 474,221 | [
"c#",
"winforms",
"datagridview",
"datatable",
"bindingsource"
]
|
4,680,089 | 1 | 4,690,686 | null | 0 | 250 | I'd like to sum up the value in column C if A==D and if the title contains "MT" or "LS" then save the sums for example in column E. One field for MT and one for LS.
I tried sum-product, sum-ifs,a combination of isnumber(vlookup(B) nothing has worked so far.

```
ID(A) Title(B) Value(C) Reference(D)
1 title1_MT 2 1
1 title1_LS 7
1 title2_MT 4
1 title2_LS 5
2 title3_MT 6 2
2 title3_LS 14
2 title4_MT 23
2 title4_LS 4
```
| sum with two conditions | CC BY-SA 3.0 | null | 2011-01-13T12:37:51.600 | 2011-11-26T08:22:55.707 | 2011-11-26T08:22:55.707 | 234,976 | 574,199 | [
"excel",
"sum"
]
|
4,680,202 | 1 | 4,680,426 | null | 1 | 272 | I can't see any build results, I think I have an extra window open, as I have a small holder icon at the bottom / middle of the window.

Also errors flicker in red, see this [video](http://www.screencast.com/users/JulesM2010/folders/Jing/media/34cd6232-ce43-424d-b53e-d00f54de0b17)...
Any ideas how to fix these ?
I'm re-installed xcode 3.2.5 but it doesn't help.
| Xcode, why can't I see any build results and why do errors flicker in red? | CC BY-SA 2.5 | 0 | 2011-01-13T12:47:56.643 | 2011-01-13T13:13:33.040 | 2020-06-20T09:12:55.060 | -1 | 450,456 | [
"xcode"
]
|
4,680,396 | 1 | 4,680,518 | null | 1 | 1,186 | Been working all morning trying to place
the progressbar under the text "simulation in progress".
Can anyone give me help me?
Adding picture:
```
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="3dp"
>
<ImageView android:id="@+id/image"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_marginRight="10dp"
/>
<TextView android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#000"
/>
<ProgressBar
android:layout_width="fill_parent"
android:layout_height="wrap_content"
style="?android:attr/progressBarStyleHorizontal"
android:id="@+id/status_progress"
android:max="100"
/>
</LinearLayout>
```
| android remoteView layout is not working | CC BY-SA 2.5 | null | 2011-01-13T13:08:06.257 | 2011-01-13T13:24:19.573 | 2011-01-13T13:14:17.783 | 538,837 | 538,837 | [
"android"
]
|
4,680,448 | 1 | 4,680,597 | null | 1 | 4,071 | I'm trying to create a web app which will check several service status, server stats etc. I found this [http://www.jcraft.com/jsch/](http://www.jcraft.com/jsch/) seems to be pretty nice ssh java implementation. But every time I log in in to server I'm prompted to confirm RSA key fingerprint like this :

How can I override this, to always confirm yes without any prompts? I want to remove the whole swing part, I want to make this without any interaction, like this example code I took from the examples available on jscraft.com :
[http://www.jcraft.com/jsch/examples/Exec.java](http://www.jcraft.com/jsch/examples/Exec.java)
I'm not so familiar with swing and with java in general.
| Java ssh client | CC BY-SA 2.5 | 0 | 2011-01-13T13:15:15.497 | 2011-01-13T13:34:00.610 | null | null | 282,383 | [
"java",
"swing",
"ssh"
]
|
4,680,473 | 1 | null | null | 11 | 1,081 | Why does the UISlider view ignore the alpha view when set to 0.5?
Code:
```
for (int i = 0; i < 3; i++) {
UISlider *slider = [[[UISlider alloc]
initWithFrame:CGRectMake(0, i * 30, 200, 30)]
autorelease];
slider.alpha = 0.4 + (CGFloat)i / 10.0f;
[window addSubview:slider];
}
```
Result:

The sliders have alpha values 0.4, 0.5 and 0.6. And as you can see the middle one with 0.5 is completely opaque. It seams to only occur with alpha 0.5. Have tested other UI controllers and they work as expected with alpha is set to 0.5.
Reproduced with iOS 4.2 on real device and with iOS 3.2 and 4.2 in simulator.
BTW if someone curious how and why I hit this problem it's the sliding direction pad configuration for a puzzle game called [Slippy](http://itunes.apple.com/app/id408254506).
| UISlider ignores alpha when set to 0.5 | CC BY-SA 2.5 | 0 | 2011-01-13T13:18:37.800 | 2011-02-08T02:25:04.680 | 2011-02-08T02:25:04.680 | 56,686 | 56,686 | [
"iphone",
"cocoa-touch",
"uikit",
"alpha",
"uislider"
]
|
4,680,606 | 1 | 4,681,722 | null | 0 | 2,787 | I want to know what process to run with
```
System.Diagnostics.Process.Start("", "");
```
that open this dialog. Thank you

This dialog come from Live broadcasting project of MS Expression encoder, Config pin Dialog of selected device.

| C# : How to open configuration Pin Dialog? | CC BY-SA 2.5 | 0 | 2011-01-13T13:35:10.580 | 2013-08-06T00:41:24.217 | 2011-01-13T15:42:58.020 | 480,716 | 480,716 | [
"c#",
"configuration",
"video",
"properties",
"dialog"
]
|
4,680,647 | 1 | 4,684,503 | null | 8 | 6,407 | [on this page](http://euroworker.no/user/checkout) in IE 8, there is the famous phantom element bug. I have researched for two days all possible things I can find that might cause this, including hidden inputs (present) floated elements (not present) and HTML comments `<!--...-->` (present).

The "phantom element" is the grey div between the login div and the "ny kunde" button.
When trying to view this is the IE dev tools (F12) it cannot be selected, nor viewed. I believe it is because of a rendering issue in IE8.
Removing these did not help at all. Plus we apparently need the hidden input for form validation.
It's worth mentioning that this eCommerce solution doesn't validate .
I have exhausted every solution I can think of, and it is still present.
Does anyone have any suggestions?
Thanks :)
| Internet Explorer 8 duplicate div bug | CC BY-SA 2.5 | 0 | 2011-01-13T13:40:07.123 | 2011-01-13T19:46:21.020 | 2011-01-13T14:43:50.247 | 287,047 | 287,047 | [
"html",
"css",
"internet-explorer-8"
]
|
4,680,674 | 1 | 4,733,601 | null | 0 | 1,674 | My Visual Studio 2010 issues following error when I try to map application to use local IIS:

A larger image can be viewed here:
> [http://img717.imageshack.us/img717/8323/errorvi.jpg](http://img717.imageshack.us/img717/8323/errorvi.jpg)
I run VS2010 as administrator and I have installed (I guess) all necessary services and IIS features.
What could be the reason?
| Visual Studio USE LOCAL IIS WEB SERVER issue with IIS 7.5 | CC BY-SA 2.5 | null | 2011-01-13T13:42:37.327 | 2011-01-19T09:29:38.663 | 2011-01-13T15:05:32.590 | 419 | 113,571 | [
"visual-studio-2010",
"windows-7",
"iis-7.5"
]
|
4,680,707 | 1 | 4,680,744 | null | 3 | 235 | I am under the impression that the below code should work asynchronously.
However, when I am looking at firebug, I see the requests fired asynchronously, but the results coming back synchronously:

Controller:
```
[HandleError]
public class HomeController : Controller
{
public ActionResult Status()
{
return Content(Session["status"].ToString());
}
public ActionResult CreateSite()
{
Session["status"] += "Starting new site creation";
Thread.Sleep(20000); // Simulate long running task
Session["status"] += "<br />New site creation complete";
return Content(string.Empty);
}
}
```
Javascript/jQuery:
```
$(document).ready(function () {
$.ajax({
url: '/home/CreateSite',
async: true,
success: function () {
mynamespace.done = true;
}
});
setTimeout(mynamespace.getStatus, 2000);
});
var mynamespace = {
counter: 0,
done: false,
getStatus: function () {
$('#console').append('.');
if (mynamespace.counter == 4) {
mynamespace.counter = 0;
$.ajax({
url: '/home/Status',
success: function (data) {
$('#console').html(data);
}
});
}
if (!mynamespace.done) {
mynamespace.counter++;
setTimeout(mynamespace.getStatus, 500);
}
}
}
```
Addtional information:
- - -
Can anyone explain this? Shouldn't the `Status` action be returning practically immediately instead of waiting for `CreateSite` to finish?
---
Edit:
How can I get the long running process to kick off and still get status updates?
| Controller actions appear to be synchronous though on different requests? | CC BY-SA 2.5 | null | 2011-01-13T13:47:12.323 | 2011-01-13T17:18:35.493 | 2011-01-13T17:18:35.493 | 1,583 | 1,583 | [
"jquery",
"ajax",
"asp.net-mvc-2",
"asynchronous",
"long-running-processes"
]
|
4,680,704 | 1 | 4,747,723 | null | 1 | 506 | My client has this requirement :

i.e. a grid with collapsible columns. The easiest way I found to do that is to have 3 separate datagrids and 2 buttons, showing or collapsing the grids.
Here is the associated XAML:
```
<StackPanel Orientation="Horizontal" Grid.Column="2" Grid.Row="0" VerticalAlignment="Stretch">
<toolkit:DataGridDragDropTarget VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" VerticalAlignment="Stretch">
<sdk:DataGrid Name="Grid1" SelectionChanged="Grid_SelectionChanged" AutoGenerateColumns="False">
<sdk:DataGrid.Columns>
<sdk:DataGridTextColumn Binding="{Binding somefield}" Header="someheader" />
<sdk:DataGridTextColumn Binding="{Binding somefield}" Header="someheader" />
<sdk:DataGridTextColumn Binding="{Binding somefield}" Header="someheader"/>
<sdk:DataGridTextColumn Binding="{Binding somefield}" Header="someheader" />
</sdk:DataGrid.Columns>
</sdk:DataGrid>
</toolkit:DataGridDragDropTarget>
<Button Content=">" Click="Button_Click" Name="btn1" />
<sdk:DataGrid Name="Grid2" SelectionChanged="Grid_SelectionChanged" AutoGenerateColumns="False" ItemsSource="{Binding ItemsSource, ElementName=Grid1}">
<sdk:DataGrid.Columns>
<sdk:DataGridTextColumn Header="someheader" Binding="{Binding somefield}" />
<sdk:DataGridCheckBoxColumn Header="someheader" Binding="{Binding somefield}" />
<sdk:DataGridCheckBoxColumn Header="someheader" Binding="{Binding somefield}" />
<sdk:DataGridTextColumn Header="someheader" Binding="{Binding somefield}" />
<sdk:DataGridTextColumn Header="someheader" Binding="{Binding somefield}" />
</sdk:DataGrid.Columns>
</sdk:DataGrid>
<Button Content=">" Name="btn2" Click="Button_Click"/>
<sdk:DataGrid Name="Grid3" SelectionChanged="Grid_SelectionChanged" AutoGenerateColumns="False" ItemsSource="{Binding ItemsSource, ElementName=Grid1}">
<sdk:DataGrid.Columns>
<sdk:DataGridTextColumn Header="someheader" Binding="{Binding somefield}" />
</sdk:DataGrid.Columns>
</sdk:DataGrid>
</StackPanel>
```
This is working correctly. My problem occurs when I want to sort one of the grid. As the sorting is internal to the datagrid, the changes are not propagated to the other (even tough they are bound to the same source !).
Is there a way to "propagate" the sorting to the other grids ? I tried to find a way to intercept a sorting event, but it doesn't seem to exist...
Thanks in advance !
| Apply the sorting of a datagrid to another datagrid | CC BY-SA 2.5 | null | 2011-01-13T13:46:16.500 | 2011-01-24T06:44:35.017 | null | null | 249,000 | [
"sorting",
"datagrid",
"silverlight-4.0"
]
|
4,680,739 | 1 | 4,710,226 | null | 7 | 5,744 | I have a `tabBarController` that I add by placing the following code into:
```
...
UITabBarController IBOutlet *tabBarController;
}
@property (nonatomic, retain) IBOutlet UITabBarController *tabBarController;
```
```
...
[self.window addSubview:tabBarController.view];
[self.window makeKeyAndVisible];
[tabBarController setDelegate:self];
```
```
- (void)tabBarController:(UITabBarController *)tbc didSelectViewController:(UIViewController *)vc {
// Middle tab bar item in question.
if (vc == [tabBarController.viewControllers objectAtIndex:2]) {
ScanVC *scanView = [[ScanVC alloc] initWithNibName:@"ScanViewController" bundle:nil];
// set properties of scanView's ivars, etc
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:scanView];
[tabBarController presentModalViewController:navigationController animated:YES];
[navigationController release];
[scanView release];
}
}
```
When it does actually get presented I think this method isn't visually appealing, because when I dismiss the modal view I am brought back to an empty view.
A lot of barcode scanning applications or applications that simply display an image picker for example; do this quite successfully. I'm just wondering what kind of implementation they would use in order to achieve such an effect.
This is a screenshot of an application called , which has the exact same functionality I'm after:

I also noticed that in these applications, if you are on any other tab bar item other than the middle one let's say, and you click on the tab bar item that presents the modal view, once it gets dismissed it doesn't actually bring them back to an empty view it dismisses like normal, however the actual tab bar item that presents the modal view is never selected. I would be happy with this type of functionality if that's the only way to implement this type of effect.
Any help would be greatly appreciated as I've been stuck in this for quite some time. Also I'm not even sure whether it's the right way to put all of this code in my `AppDelegate` in order for the View Controller to be presented as a modal. It all seems, just, wrong.
| iPhone - presentModalViewController via UITabBarItem and dismissModalViewController cleanly | CC BY-SA 2.5 | 0 | 2011-01-13T13:50:41.447 | 2013-12-05T10:44:15.813 | 2011-01-17T04:37:30.307 | 264,802 | 264,802 | [
"iphone",
"objective-c",
"uiviewcontroller",
"uitabbarcontroller",
"uitabbar"
]
|
4,680,764 | 1 | 4,691,871 | null | 0 | 593 | I have in Java two panels which need to have same layout, there is my functions for initializations panels.
```
private void InitializePanelCom(){
pnlCom=new JPanel();
pnlCom.setSize(300,160);
pnlCom.setLocation(10, 60);
add(pnlCom);
GridBagLayout gb=new GridBagLayout();
GridBagConstraints gc=new GridBagConstraints();
pnlCom.setLayout(gb);
jLabelcommPort = setJLabel("Com Port : ");
jLabelbaudRate = setJLabel("Baud Rate : ");
jLabelplcAddress = setJLabel("Plc Address : ");
jLabelsendTime = setJLabel("Send Time : ");
jLabelx50 = setJLabel(" x 50 ms (2 - 99)");
jComboBoxcommPort = setJComboBox(commPortList);
jComboBoxbaudRate = setJComboBox(bitRateList);
jTextAreaPlcAddress = setJTextField("");
jTextAreaSendTime = setJTextField("");
gc.insets = new Insets(10,0,0,0);
gc.ipadx = 120;
gc.weightx = 1;
gc.gridx = 0;
gc.gridy = 0;
gc.anchor=GridBagConstraints.EAST;
pnlCom.add(jLabelcommPort,gc);
gc.insets = new Insets(10,0,0,0);
gc.ipadx = 120;
gc.weightx = 1;
gc.gridx = 1;
gc.gridy = 0;
gc.anchor=GridBagConstraints.EAST;
pnlCom.add(jComboBoxcommPort,gc);
gc.insets=new Insets(10,0,0,0);
gc.ipadx=120;
gc.weightx=1;
gc.gridx=0;
gc.gridy=1;
gc.anchor=GridBagConstraints.EAST;
pnlCom.add(jLabelbaudRate,gc);
gc.insets=new Insets(10,0,0,0);
gc.ipadx=120;
gc.weightx=1;
gc.gridx=1;
gc.gridy=1;
gc.anchor=GridBagConstraints.EAST;
pnlCom.add(jComboBoxbaudRate,gc);
gc.insets=new Insets(10,0,0,0);
gc.ipadx=120;
gc.weightx=1;
gc.gridx=0;
gc.gridy=2;
gc.anchor=GridBagConstraints.EAST;
pnlCom.add(jLabelplcAddress,gc);
gc.insets=new Insets(10,0,0,0);
gc.ipadx=120;
gc.weightx=1;
gc.gridx=1;
gc.gridy=2;
gc.anchor=GridBagConstraints.EAST;
pnlCom.add(jTextAreaPlcAddress,gc);
gc.insets=new Insets(10,0,0,0);
gc.ipadx=120;
gc.weightx=1;
gc.gridx=0;
gc.gridy=3;
gc.anchor=GridBagConstraints.EAST;
pnlCom.add(jLabelsendTime,gc);
gc.insets=new Insets(10,0,0,0);
gc.ipadx=120;
gc.weightx=1;
gc.gridx=1;
gc.gridy=3;
gc.anchor=GridBagConstraints.EAST;
pnlCom.add(jTextAreaSendTime,gc);
gc.insets=new Insets(10,0,0,0);
gc.ipadx=120;
gc.weightx=1;
gc.gridx=2;
gc.gridy=3;
gc.anchor=GridBagConstraints.EAST;
pnlCom.add(jLabelx50,gc);
}
![alt text][1]
private void InitializePanelTcp(){
pnlTcp=new JPanel();
pnlTcp.setSize(300,160);
pnlTcp.setLocation(10, 60);
add(pnlTcp);
GridBagLayout gb=new GridBagLayout();
GridBagConstraints gc=new GridBagConstraints();
pnlTcp.setLayout(gb);
lblIPAddress=setJLabel("IP Address : ");
txtIPAddress=setJTextField("");
lblPort=setJLabel("Port : ");
txtPort=setJTextField("");
cmbBaudRateTCP = setJComboBox(bitRateList);
lblBaudRateTCP = setJLabel("Baud Rate : ");
lblParityCheck=setJLabel("Parity check : ");
txtParityCheck=setJTextField("");
gc.insets = new Insets(10,0,0,0);
//gc.ipadx = 20;
gc.weightx = 0.3;
gc.gridx = 0;
gc.gridy = 0;
gc.anchor=GridBagConstraints.WEST;
pnlTcp.add(lblIPAddress,gc);
gc.insets = new Insets(10,0,0,0);
//gc.ipadx = 80;
gc.weightx = 0.7;
gc.gridx = 1;
gc.gridy = 0;
gc.anchor=GridBagConstraints.WEST;
pnlTcp.add(txtIPAddress,gc);
gc.insets=new Insets(10,0,0,0);
//gc.ipadx=120;
gc.weightx=0.3;
gc.gridx=0;
gc.gridy=1;
gc.anchor=GridBagConstraints.WEST;
pnlTcp.add(lblPort,gc);
gc.insets=new Insets(10,0,0,0);
//gc.ipadx=80;
gc.weightx=0.7;
gc.gridx=1;
gc.gridy=1;
gc.anchor=GridBagConstraints.WEST;
pnlTcp.add(txtPort,gc);
gc.insets=new Insets(10,0,0,0);
//gc.ipadx=120;
gc.weightx=0.3;
gc.gridx=0;
gc.gridy=2;
gc.anchor=GridBagConstraints.WEST;
pnlTcp.add(lblBaudRateTCP,gc);
gc.insets=new Insets(10,0,0,0);
//gc.ipadx=0;
gc.weightx=0.7;
gc.gridx=1;
gc.gridy=2;
gc.anchor=GridBagConstraints.WEST;
pnlTcp.add(cmbBaudRateTCP,gc);
gc.insets=new Insets(10,0,0,0);
//gc.ipadx=120;
gc.weightx=0.3;
gc.gridx=0;
gc.gridy=3;
gc.anchor=GridBagConstraints.WEST;
pnlTcp.add(lblParityCheck,gc);
gc.insets=new Insets(10,0,0,0);
//gc.ipadx=0;
gc.weightx=1.7;
gc.gridx=1;
gc.gridy=3;
gc.anchor=GridBagConstraints.WEST;
pnlTcp.add(txtParityCheck,gc);
}
```


Problem is that first panel (initializetcp, picture doesn't look the same, labels are moved at left, textboxes are small and ugly , it is different ). Can anybody help, I am new with GridBagContsraints at all ?
| GridBagConstraints problem-moved to left and size isn't the same | CC BY-SA 2.5 | null | 2011-01-13T13:53:07.603 | 2011-01-14T14:47:35.200 | null | null | 486,578 | [
"java",
"swing",
"gridbaglayout"
]
|
4,680,829 | 1 | 4,700,367 | null | 2 | 2,174 | I want to know what maximum value I can set and joomla accept in the field Session Lifetime under global configuration. so that I can set the maximum acceptable value here.
I want to increase the session life time for frontend of joomla and I think this value must me under the maximum limit joomla accept.
see attached.

any idea..?
Thanks.
| What maximum value I can set in the Session Lifetime field under global configuration of Joomla? | CC BY-SA 2.5 | null | 2011-01-13T13:59:06.727 | 2011-01-15T15:26:23.933 | null | null | 472,375 | [
"php",
"session",
"joomla"
]
|
4,680,875 | 1 | 4,680,987 | null | 3 | 2,805 | When using a transparent PNG image which has a fine fading shadow always there is an edge line around the shadow on the Android screen. It does not show this in emualator or Exclipse. See photo.
I wonder if there is way to improve on this. Is this something to do with inability of Android screen to show all 24 bit colours or the fact that is scaling and resampling image?
In this example the image is loaded into an ImageButton view. I tried it as source or background and it is the same quality.

| Quality of rendering shadow in transparent png on Android | CC BY-SA 2.5 | 0 | 2011-01-13T14:02:57.357 | 2011-01-13T14:13:48.327 | null | null | 562,497 | [
"android",
"png"
]
|
4,681,084 | 1 | 5,508,124 | null | 6 | 2,582 | This is a follow up question on [Save image to file keeping aspect ration in a WPF app](https://stackoverflow.com/questions/4648456/save-image-to-file-keeping-aspect-ratio-in-a-wpf-app)
I know howto scale the image, but how do I expand the canvas size, to ensure the image still has the requested width and height. In this example its 250x250 but its dynamic.
I have created this illustration to show what I'm trying to accomplice.

I can't find any way of expanding the canvas of an BitmapImage, nor a way to create an in memory image in the correct size, with a transparent background, and then merging the two images together.
| Expand canvas/transparent background in BitmapImage in a WPF app | CC BY-SA 2.5 | 0 | 2011-01-13T14:25:48.910 | 2011-04-30T17:07:10.647 | 2017-05-23T12:07:02.087 | -1 | 363,274 | [
"c#",
".net",
"wpf",
"c#-4.0"
]
|
4,681,289 | 1 | 4,681,428 | null | 1 | 24,130 | I'm no expert in regex but I need to parse some input I have no control over, and make sure I filter away any strings that don't have A-z and/or 0-9.
When I run this,
```
Pattern p = Pattern.compile("^[a-zA-Z0-9]*$"); //fixed typo
if(!p.matcher(gottenData).matches())
System.out.println(someData); //someData contains gottenData
```
certain spaces + an unknown symbol somehow slip through the filter (gottenData is the red rectangle):

In case you're wondering, it DOES also display Text, it's not all like that.
For now, I don't mind the [?] as long as it also contains some string along with it.
Please help.
[EDIT] as far as I can tell from the (very large) input, the [?]'s are either white spaces either nothing at all; maybe there's some sort of encoding issue, also perhaps something to do with #text nodes (input is xml)
| Java - Unknown characters passing as [a-zA-z0-9]*? | CC BY-SA 2.5 | 0 | 2011-01-13T14:44:17.107 | 2019-06-19T08:59:36.150 | 2011-01-13T15:50:14.783 | 480,859 | 480,859 | [
"java",
"regex",
"spaces",
"alphanumeric"
]
|
4,681,758 | 1 | 4,681,841 | null | 2 | 1,776 | I'm a jQuery newbie, but long-time Perl developer and know regexes well, so I don't want to use the jQuery Validation plugin.
I'm trying to validate the following 3 web forms, each of which has a text or textarea input field and a submit button :

I'm validating them with the following jQuery code, which seems to work well:
```
<script type="text/javascript" src="/jquery-1.4.4.min.js"></script>
<script type="text/javascript">
$(function() {
$('#mks_btn').click(function(e) {
$('#cl_txt').css('border', '2px solid black');
$('#comment_txt').css('border', '2px solid black');
if (! $('#mks_txt').val().match(/^(CL\s*)?[0-9]{6,}$/i)) {
$('#mks_txt').css('border', '2px solid red');
e.preventDefault();
}
});
$('#cl_btn').click(function(e) {
$('#mks_txt').css('border', '2px solid black');
$('#comment_txt').css('border', '2px solid black');
if (! $('#cl_txt').val().match(/^(MKS\s*)?[0-9]{6,}$/i)) {
$('#cl_txt').css('border', '2px solid red');
e.preventDefault();
}
});
$('#comment_btn').click(function(e) {
$('#mks_txt').css('border', '2px solid black');
$('#cl_txt').css('border', '2px solid black');
if ($('#comment_txt').val().length < 2) {
$('#comment_txt').css('border', '2px solid red');
e.preventDefault();
}
});
});
</script>
```
My (cosmetic) problem is:
When a user enters invalid value into the first text field ("MKS") and clicks the "Add MKS" button, my code will prevent form submission and make the border of the text field solid red. Then the user changes her mind and decides to enter text into web form and enters invalid data there again. Then I would have 2 red borders already, which would irritate the user.
I'm trying to workaround this problem by setting the other text fields to solid black on a button click - as you can see above. But this doesn't look good, because the original border has been something else before the user started entering anything.
So I wonder, if I could restore that value for all text input fields somehow - when a button is clicked (or maybe on blur or some other event, indicating that the user has switched to another web form?)
Thank you for any suggestions! Alex
My browser is Firefox 3.6.12 / WinXP, but I want all browsers work of course :-)
The HTML code for the 3 web forms is below and I only have text and links besides that, no further elements at the web page:
```
<form>
<tr valign="top">
<th>MKS</th><td>
<input name="show_id" type="hidden" value="20110111172527685">
<input name="toggle_mks" id="mks_txt" type="text" size="10" maxsize="10">
<input type="submit" id="mks_btn" value="Add MKS" class="toggle">
</td></tr>
</form>
<form>
<tr bgcolor="#EEEEEE" valign="top">
<th>CL</th><td>
<input name="show_id" type="hidden" value="20110111172527685">
<input name="toggle_cl" id="cl_txt" type="text" size="10" maxsize="10">
<input type="submit" id="cl_btn" value="Add CL" class="toggle">
</td></tr>
</form>
<form>
<tr valign="top">
<th>Comments</th><td>
<input name="show_id" type="hidden" value="20110111172527685">
<textarea name="comment" id="comment_txt" rows="4" cols="60" maxsize="320">
</textarea>
<input type="submit" id="comment_btn" value="Add comment" class="toggle">
</td></tr>
</form>
```
| jQuery: restoring initial css('value') while validating a form | CC BY-SA 2.5 | null | 2011-01-13T15:28:13.097 | 2011-01-13T15:56:07.617 | 2011-01-13T15:55:22.630 | 165,071 | 165,071 | [
"jquery",
"css",
"webforms",
"validation"
]
|
4,681,833 | 1 | 4,682,574 | null | 3 | 3,004 | I've been using [this excellent blog post](http://blog.boxedice.com/2009/07/10/how-to-build-an-apple-push-notification-provider-server-tutorial/) to try and get Apple Push Notifications working from my server. Connection seems to establish fine and I can write to it. However, no notification ever arrives. To try and debug it I'd like to construct an 'enhanced notification' which will make the APNS server return an error code before disconnecting. However, I'm unsure how to construct the data to send to the server using PHP.
Currently for a normal notification I am using, as per the tutorial post:
```
$apnsMessage = chr(0) . chr(0) . chr(32) . pack('H*', str_replace(' ', '', $deviceToken)) . chr(0) . chr(strlen($payload)) . $payload;
```
This creates a request in the format:

However, I need a request in the format:

Where, according to the documentation:
Identifier—An arbitrary value that identifies this notification. This same identifier is returned in a error-response packet if APNs cannot interpret a notification.
Expiry—A fixed UNIX epoch date expressed in seconds (UTC) that identifies when the notification is no longer valid and can be discarded. The expiry value should be in network order (big endian). If the expiry value is positive, APNs tries to deliver the notification at least once. You can specify zero or a value less than zero to request that APNs not store the notification at all.
Any help in adapting the above code to tuse the above enhanced notification format would be much appreciated!
| PHP Apple Enhanced Notification | CC BY-SA 2.5 | 0 | 2011-01-13T15:34:51.547 | 2015-07-31T08:36:01.373 | null | null | 348,308 | [
"php",
"push-notification",
"apple-push-notifications"
]
|
4,681,903 | 1 | 4,684,876 | null | 19 | 6,980 | I need to replicate the effect that the UIButton does on an image when tapped, the highlighting. See:

The original PNG is a square with alpha background. When I set it as UIButton's image it automatically apply an effect on the non-alpha pixels of the image.
How to do this effect?
| How to implement highlighting on UIImage like UIButton does when tapped? | CC BY-SA 2.5 | 0 | 2011-01-13T15:41:46.537 | 2014-04-17T15:13:14.500 | null | null | 335,974 | [
"objective-c",
"uiimage",
"uibutton",
"mask",
"layer"
]
|
4,681,902 | 1 | 4,683,047 | null | 2 | 9,678 | I have a custom radiobutton with a 9-patch image as background. I use a Selector to determine the background.
I also have some text i want to put over the background of the image, but the text is aligning next to the button.
This is the RadioGroup
```
<LinearLayout
android:id="@+id/segmented"
android:layout_width="fill_parent"
android:layout_height="50sp"
android:gravity="center"
android:layout_below="@+id/header">
<RadioGroup android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/group1"
android:gravity="center">
<RadioButton
android:checked="false"
android:layout_width="90sp"
android:id="@+id/rbVerzekeringen"
android:text="Verzekeringen"
android:textSize="10sp"
android:button="@drawable/checkbox_theme" />
<RadioButton
android:checked="false"
android:layout_width="90sp"
android:id="@+id/rbPersoonlijk"
android:text="Persoonlijk"
android:textSize="10sp"
android:button="@drawable/checkbox_theme" />
<RadioButton
android:checked="false"
android:layout_width="90sp"
android:id="@+id/rbNotities"
android:text="Notities"
android:textSize="10sp"
android:button="@drawable/checkbox_theme" />
</RadioGroup>
</LinearLayout>
```
This is the Selector:
```
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true" android:state_window_focused="false"
android:drawable="@drawable/bt_filter_active" />
<item android:state_checked="false" android:state_window_focused="false"
android:drawable="@drawable/bt_filter" />
<item android:state_checked="true" android:state_pressed="true"
android:drawable="@drawable/bt_filter_active" />
<item android:state_checked="false" android:state_pressed="true"
android:drawable="@drawable/bt_filter" />
<item android:state_checked="true" android:state_focused="true"
android:drawable="@drawable/bt_filter_active" />
<item android:state_checked="false" android:state_focused="true"
android:drawable="@drawable/bt_filter" />
<item android:state_checked="false" android:drawable="@drawable/bt_filter" />
<item android:state_checked="true" android:drawable="@drawable/bt_filter_active" />
</selector>
```
And this is what it lookes like:

As you can figure out I want 3 large buttons with the text over it.
How can I do this?
I set the selector at background in stead of button and set the button to null.
The code looks like this now:
```
<LinearLayout
android:id="@+id/segmented"
android:layout_width="fill_parent"
android:layout_height="50sp"
android:gravity="center"
android:layout_below="@+id/header">
<RadioGroup android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/group1"
android:gravity="center">
<RadioButton
android:checked="false"
android:layout_width="100sp"
android:layout_height="40sp"
android:id="@+id/rbVerzekeringen"
android:text="Verzekeringen"
android:textSize="13sp"
android:orientation="vertical"
android:background="@drawable/checkbox_theme"
android:button="@null"
android:gravity="center"/>
<RadioButton
android:checked="false"
android:layout_width="100sp"
android:layout_height="35sp"
android:id="@+id/rbPersoonlijk"
android:text="Persoonlijk"
android:textSize="35sp"
android:background="@drawable/checkbox_theme"
android:button="@null"
android:gravity="center"/>
<RadioButton
android:checked="false"
android:layout_width="100sp"
android:layout_height="30sp"
android:id="@+id/rbNotities"
android:text="Notities"
android:textSize="13sp"
android:background="@drawable/checkbox_theme"
android:button="@null"
android:gravity="center"/>
</RadioGroup>
</LinearLayout>
```
But now when I make the buttons larger or smaller the text in it just disappears like this (height of the first image is 40sp, the second is 35sp and the last one is 30sp):

How can I make the background image smaller without cutting the text in it?
| Custom RadioButton image not filling space | CC BY-SA 2.5 | null | 2011-01-13T15:41:44.913 | 2011-01-17T23:48:15.530 | 2011-01-17T08:58:20.993 | 517,460 | 517,460 | [
"android",
"radio-button",
"css-selectors"
]
|
4,682,352 | 1 | 4,682,416 | null | 0 | 648 | I am trying to vertically align the text and image of a RadPanelBarItem. Normally I would nest the two properties in a div, and apply a vertical-align: middle; to format these the way I want them, but unfortunately the Text and Image properties are nested within the RadPanelBar control.

Does anyone know the default classes of the RadPanelBarItem, and/or a simple way of aligning these two items that I am missing?
Thanks!
| Vertical-Align Text&Image in RadPanelBarItem? | CC BY-SA 2.5 | null | 2011-01-13T16:21:29.370 | 2011-01-13T16:28:15.327 | null | null | 537,172 | [
"c#",
"css",
"telerik",
"panel"
]
|
4,682,619 | 1 | 4,688,902 | null | 4 | 479 | I've been trying to figure out for a long time now how to create an interface that can allows users to input several rows of data and pass those entries into an SQL server database all in one shot. I could not get any better ideas so I came up with this (see picture below).

What I envisioned is that the user enters values in the textboxes and hits the "add to list" button. The values are then populated in the list box below with the heading "exhibits lists" and when the add exhibit button is pressed, all values from the list box are passed into the database.
Well, I'm left wondering again if it would be possible to tie these values from the textboxes to the list box and whether I'd be able to pass them into the database.
If it were possible then I'd please love to know how to go about it otherwise I'd be glad if you could recommend a better way for me to handle the situation otherwise I'd have to resolve to data entry one at a time.
I believe there is some useful information from this website that can help solve my problem but I just can't make heads or tails of the article... it seems like I'm almost there and it skids off. Can everyone please read and help me adapt it to my situation? Post below:
[http://www.codeproject.com/KB/aspnet/ExtendedGridView.aspx](http://www.codeproject.com/KB/aspnet/ExtendedGridView.aspx)
| What are the possibilities of displaying items in a listbox? | CC BY-SA 2.5 | null | 2011-01-13T16:43:14.420 | 2011-03-22T09:28:29.157 | 2011-02-09T08:02:50.060 | 38,403 | 569,285 | [
"c#",
"asp.net",
"listbox",
"webforms"
]
|
4,682,718 | 1 | 4,682,894 | null | 13 | 1,351 | I'm running into an issue where the border of an outer div with rounded-corners is getting cut-off by an inner element with a CSS3 gradiet. Is this a bug with CSS3 - if so, I'll happily submit a bug-report.
If not, how do I fix this?
:
[http://jsfiddle.net/joshuamcginnis/2aJ8X/](http://jsfiddle.net/joshuamcginnis/2aJ8X/)

| Is this a bug with CSS3: Rounded corners with CSS3 gradient | CC BY-SA 2.5 | 0 | 2011-01-13T16:51:09.997 | 2011-06-08T15:20:38.720 | 2011-01-13T18:14:22.720 | 361,833 | 361,833 | [
"html",
"gradient",
"css"
]
|
4,682,770 | 1 | 4,689,260 | null | 0 | 2,642 | I'm using the DevExpress WPF grid control. When you hover the mouse over a grid cell, and that grid cell is too small to display the entire value, a tooltip is automatically generated containing the full value, like this: (sorry, print-screen doesn't capture the mouse pointer)

Is there any way to suppress this? Ideally, i'd like to suppress it for only certain grid columns if possible.
The MSDN documentation for the event FrameworkElement.ToolTipOpening (exposed by the grid column) says:
However, I've tried that, and it doesn't work in this case. Other posts on the web refer to using a TooltipController, but since I'm using the WPF grid, there's no such class (that I can see).
| Suppressing the automatic tooltip on a DevExpress WPF GridControl - possible? | CC BY-SA 2.5 | null | 2011-01-13T16:55:27.077 | 2011-01-14T08:37:56.510 | null | null | 569,214 | [
"wpf",
"devexpress",
"gridcontrol"
]
|
4,683,030 | 1 | 4,687,807 | null | 4 | 6,788 | I need to draw a large set of cubes, all with (possibly) unique textures on each side. Some of the textures also have parts of transparency. The cubes that are behind ones with transparent textures should show through the transparent texture. However, it seems that the order in which I draw the cubes decides if the transparency works or not, which is something I want to avoid. Look here:
```
cubeEffect.CurrentTechnique = cubeEffect.Techniques["Textured"];
Block[] cubes = new Block[4];
cubes[0] = new Block(BlockType.leaves, new Vector3(0, 0, 3));
cubes[1] = new Block(BlockType.dirt, new Vector3(0, 1, 3));
cubes[2] = new Block(BlockType.log, new Vector3(0, 0, 4));
cubes[3] = new Block(BlockType.gold, new Vector3(0, 1, 4));
foreach(Block b in cubes) {
b.shape.RenderShape(GraphicsDevice, cubeEffect);
}
```
This is the code in the Draw method. It produces this result:
[](https://i.stack.imgur.com/M0B3k.jpg)
As you can see, the textures behind the leaf cube are not visible on the other side. When i reverse index 3 and 0 on in the array, I get this:

It is clear that the order of drawing is affecting the cubes. I suspect it may have to do with the blend mode, but I have no idea where to start with that.
| Issue with transparent texture on 3D primitive, XNA 4.0 | CC BY-SA 4.0 | 0 | 2011-01-13T17:18:03.610 | 2019-08-08T09:19:38.340 | 2019-08-08T09:19:38.340 | 4,751,173 | 77,840 | [
"c#",
"xna",
"textures"
]
|
4,683,065 | 1 | null | null | 5 | 1,281 | I am in the process of adding auditing into my EF4 (model first) application. I can get the details about the structural properties on entities that have changes. I can also see when there have been changes on a many to many relationship. I can see the name of the types involved and what happened (add or remove) but what I'd really like is the Id's of the entities that are involved in the relationship change.
Here is what I currently have for tracking changes to many to many relationships:
```
var changes = context.ObjectStateManager.GetObjectStateEntries(EntityState.Added | EntityState.Deleted | EntityState.Modified);
var auditTime = DateTime.Now;
foreach (var change in changes)
{
if (change.Entity != null && change.Entity.GetType().Equals(typeof(AuditTrail)))
{
continue;
}
var detailsBuilder = new StringBuilder();
if (change.Entity == null & (change.State == EntityState.Added | change.State == EntityState.Deleted))
{
detailsBuilder.Append("A link between entities ");
foreach (var changedMember in change.EntitySet.ElementType.KeyMembers)
{
detailsBuilder.AppendFormat("{0}", changedMember.Name);
if(change.EntitySet.ElementType.KeyMembers.IndexOf(changedMember) < change.EntitySet.ElementType.KeyMembers.Count -2)
{
detailsBuilder.Append(", ");
}
else if (change.EntitySet.ElementType.KeyMembers.IndexOf(changedMember) == change.EntitySet.ElementType.KeyMembers.Count - 2)
{
detailsBuilder.Append(" and ");
}
}
detailsBuilder.AppendFormat(" was {0}.<br />", change.State);
}
}
```
How can I get the details (or even the actual entities) involved in the relationship change?
After poking around on for a few more hours I have managed to find the information I need (see attached image). However, the classes that store the data are internal sealed classes and I can't find a public entry to query the object state manager to get this information out back. So I can audit the change.

| EF4 Audit changes of many to many relationships | CC BY-SA 2.5 | 0 | 2011-01-13T17:21:14.337 | 2011-04-29T19:10:55.303 | 2011-01-17T09:56:47.230 | 48,886 | 48,886 | [
"c#",
".net-4.0",
"entity-framework-4"
]
|
4,683,416 | 1 | 4,684,321 | null | 0 | 821 | Hey I want to create a layout like this for my application. Of course the functionalities will be differents. I'm studying the source code for this, and I found the xml files that does that. I just dont know how to implement that in the activity, how to call, what to create, a listview, etc.

I mean, I just want to list the name with a bigger font and the date like in the image, with a small font but aligned to the right.
Because, I want to get the data from the database I've created and print it like this list of CallLog.
I mean, how Android makes the date with that icon align in the right, with a small font size?
So this is my activity, I just dont know what xml file from the source code to use, or what method to implement so I can print the data like the image example.
```
public class RatedCalls extends ListActivity {
private static final String LOG_TAG = "RatedCalls";
private TableLayout table;
private CallDataHelper cdh;
private TableRow row;
private TableRow row2;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.recent_calls);
Log.i(LOG_TAG, "calling from onCreate()");
cdh = new CallDataHelper(this);
startService(new Intent(this, RatedCallsService.class));
Log.i(LOG_TAG, "Service called.");
Log.i(LOG_TAG, "before call fillList");
/*
* mAdapter = new RecentCallsAdapter();
* getListView().setOnCreateContextMenuListener(this);
* setListAdapter(mAdapter);
*/
fillList();
Log.i(LOG_TAG, "after call fillList");
}
public void onResume() {
super.onResume();
fillList();
}
public void fillList() {
Log.i(LOG_TAG, "entered on fillList");
List<String> ratedCalls = new ArrayList<String>();
ratedCalls = this.cdh.selectTopCalls();
//setListAdapter(new ArrayAdapter<String>(this, R.layout.recent_calls_list_item,
//ratedCalls));
ListView lv = getListView();
lv.setTextFilterEnabled(true);
getListView().setOnCreateContextMenuListener(this);
lv.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
Toast.makeText(getApplicationContext(),
((TextView) view).getText(), Toast.LENGTH_LONG).show();
}
});
}
}
```
Thanks.
| How to create a layout like Android CallLog's layout | CC BY-SA 2.5 | null | 2011-01-13T17:58:29.657 | 2011-01-13T19:27:42.960 | 2011-01-13T18:05:58.723 | 399,459 | 399,459 | [
"android",
"android-layout",
"android-source"
]
|
4,683,718 | 1 | 4,683,750 | null | 3 | 1,151 | I get that the `MembershipProvider` is in the `System.Web.Security` namespace. I have added a reference `System.Web` in my project, I've added a `using System.Web.Security` directive in my .cs file - but as you can see, VS2010 does not believe me:
> The type or namespace name 'MembershipProvider' could not be found
(are you missing a using directive or an assembly reference?)

What am I missing here?
| Where is my abstract base MembershipProvider? | CC BY-SA 4.0 | null | 2011-01-13T18:24:40.637 | 2018-05-04T22:50:48.060 | 2018-05-04T22:50:48.060 | 127,888 | 127,888 | [
"c#",
"security",
"namespaces",
"membership",
"membership-provider"
]
|
4,683,741 | 1 | 4,683,829 | null | 1 | 1,440 | I want to present my data in a better way (instead of a simple list). Is it in Android possible to present a list with data (for example tweet-messages) in a special way like this:

Any other kind of visualization is also welcome!
| Android and data visualization : How to present data in a better way? | CC BY-SA 3.0 | null | 2011-01-13T18:27:12.730 | 2015-12-12T16:12:06.030 | 2015-12-12T16:12:06.030 | 4,370,109 | 574,687 | [
"android",
"list",
"twitter",
"visualization"
]
|
4,683,863 | 1 | 4,683,914 | null | 0 | 2,876 | Hey, I want to know how do I do to create a ListView in Android like this, not exactly, but with multiple text, and the text with different font size? Because the one I've created just worked for one text line for each line. Thanks.

| How to create a ListView with multiple text | CC BY-SA 2.5 | null | 2011-01-13T18:40:44.647 | 2011-01-13T18:45:29.907 | null | null | 399,459 | [
"android",
"android-layout",
"android-listview"
]
|
4,684,086 | 1 | 4,684,157 | null | 4 | 4,324 | I'm looking for a library in c or objective c that does node-data visualizations similar to [http://arborjs.org/](http://arborjs.org/)

helpful answers include,
1. what are graphs like that called?
2. names of libraries that do something like that.
3. suggestions for implementation.
I'm targeting iOS and/or MacOS, hence c or objective-c/cocoa. On iOS the javascript version runs super slow.
Thanks!
Edit: GraphViz looks great. I'm a little concerned it may have dependencies that are GPL, and thus can't be used on iOS... looking into that now.
| Node-based data visualization library in c or objective c | CC BY-SA 2.5 | 0 | 2011-01-13T19:00:48.443 | 2019-02-21T21:37:12.510 | 2011-01-13T19:19:53.583 | 196,358 | 196,358 | [
"objective-c",
"c",
"data-visualization",
"graph-visualization"
]
|
4,684,105 | 1 | 4,781,673 | null | 1 | 19,620 | I have drawn something in inkscape and it looks great. I resize the image to the size I want and then export it as a Bitmap. The result has very poor quality, looking like no anti-alias has been applied to it, all edges are jazzy.
All the images are vectors, and I resize them to fit Android screen resolutions. I had the impression that if I use inkscape I will be able to scale and export images and mantain great quality. I attach an image to see the jazzy lines.

How can I improve this export ?
| Export as Bitmap from inkScape has poor quality | CC BY-SA 2.5 | 0 | 2011-01-13T19:02:47.043 | 2011-12-07T22:30:03.360 | 2011-01-17T09:00:19.840 | 379,865 | 379,865 | [
"svg",
"inkscape"
]
|
4,684,195 | 1 | 4,684,280 | null | 1 | 2,112 | I have been trying to get this problem resolved for week and have get to come to a solution. What I have is 2 points in a 2d space, what I need to resolve is what the rotation of one is around the other. With luck the attached diagram will help, what I need to be able to calculate is the rotational value of b around a.

I have found lots of stuff that points to finding the dot product etc but I am still searching for that golden solution :o(
Thanks!
| Calculating in radians the rotation of one point around another | CC BY-SA 2.5 | null | 2011-01-13T19:13:29.857 | 2011-01-13T19:31:00.063 | null | null | 414,284 | [
"c#",
"xna",
"game-engine",
"xna-4.0"
]
|
4,684,363 | 1 | 4,692,102 | null | 76 | 149,466 | I have created a [MATLAB](http://en.wikipedia.org/wiki/MATLAB) plotting with the `plot()` function. How do I change the window title of the generated figure of the plotting?
My MATLAB m-file which I'm working on:
```
hold on
x = [0; 0.2; 0.4; 0.6; 0.8; 1; 1.2; 1.4; 1.6; 1.8; 2; 2.2; 2.4; 2.6; 2.8; 3; 3.2; 3.4; 3.6; 3.8; 4; 4.2; 4.4; 4.6; 4.8; 5; 5.2; 5.4; 5.6; 5.8; 6; 6.2; 6.4; 6.6; 6.8; 7; 7.2; 7.4; 7.6; 7.8; 8; 8.2; 8.4; 8.6; 8.8; 9; 9.2; 9.4; 9.6; 9.8; 10; 10.2; 10.4; 10.6; 10.8; 11; 11.2; 11.4; 11.6; 11.8; 12; 12.2; 12.4; 12.6; 12.8; 13; 13.2; 13.4; 13.6; 13.8; 14; 14.2; 14.4; 14.6; 14.8; 15; 15.2; 15.4; 15.6; 15.8; 16; 16.2; 16.4; 16.6; 16.8; 17; 17.2; 17.4; 17.6; 17.8; 18; 18.2; 18.4; 18.6; 18.8];
y = [0; 0.198669; 0.389418; 0.564642; 0.717356; 0.841471; 0.932039; 0.98545; 0.999574; 0.973848; 0.909297; 0.808496; 0.675463; 0.515501; 0.334988; 0.14112; -0.0583741; -0.255541; -0.44252; -0.611858; -0.756802; -0.871576; -0.951602; -0.993691; -0.996165; -0.958924; -0.883455; -0.772764; -0.631267; -0.464602; -0.279415; -0.0830894; 0.116549; 0.311541; 0.494113; 0.656987; 0.793668; 0.898708; 0.96792; 0.998543; 0.989358; 0.940731; 0.854599; 0.734397; 0.584917; 0.412118; 0.22289; 0.0247754; -0.174327; -0.366479; -0.544021; -0.699875; -0.827826; -0.922775; -0.980936; -0.99999; -0.979178; -0.919329; -0.822829; -0.693525; -0.536573; -0.358229; -0.165604; 0.033623; 0.23151; 0.420167; 0.592074; 0.740376; 0.859162; 0.943696; 0.990607; 0.998027; 0.965658; 0.894791; 0.788252; 0.650288; 0.486399; 0.303118; 0.107754; -0.0919069; -0.287903; -0.472422; -0.638107; -0.778352; -0.887567; -0.961397; -0.9969; -0.992659; -0.948844; -0.867202; -0.750987; -0.604833; -0.434566; -0.246974; -0.0495356];
plot(x, y, '--b');
x = [0; 0.2; 0.4; 0.6; 0.8; 1; 1.2; 1.4; 1.6; 1.8; 2; 2.2; 2.4; 2.6; 2.8; 3; 3.2; 3.4; 3.6; 3.8; 4; 4.2; 4.4; 4.6; 4.8; 5; 5.2; 5.4; 5.6; 5.8; 6; 6.2; 6.4; 6.6; 6.8; 7; 7.2; 7.4; 7.6; 7.8; 8; 8.2; 8.4; 8.6; 8.8; 9; 9.2; 9.4; 9.6; 9.8; 10; 10.2; 10.4; 10.6; 10.8; 11; 11.2; 11.4; 11.6; 11.8; 12; 12.2; 12.4; 12.6; 12.8; 13; 13.2; 13.4; 13.6; 13.8; 14; 14.2; 14.4; 14.6; 14.8; 15; 15.2; 15.4; 15.6; 15.8; 16; 16.2; 16.4; 16.6; 16.8; 17; 17.2; 17.4; 17.6; 17.8; 18; 18.2; 18.4; 18.6; 18.8];
y = [-1; -0.980133; -0.921324; -0.825918; -0.697718; -0.541836; -0.364485; -0.172736; 0.0257666; 0.223109; 0.411423; 0.583203; 0.731599; 0.850695; 0.935744; 0.983355; 0.991629; 0.960238; 0.890432; 0.784994; 0.648128; 0.48529; 0.302972; 0.108443; -0.0905427; -0.286052; -0.470289; -0.635911; -0.776314; -0.885901; -0.960303; -0.996554; -0.993208; -0.950399; -0.869833; -0.754723; -0.609658; -0.44042; -0.253757; -0.057111; 0.141679; 0.334688; 0.514221; 0.673121; 0.805052; 0.904756; 0.968256; 0.993023; 0.978068; 0.923987; 0.832937; 0.708548; 0.555778; 0.380717; 0.190346; -0.00774649; -0.205663; -0.395514; -0.56973; -0.721365; -0.844375; -0.933855; -0.986238; -0.999436; -0.972923; -0.907755; -0.806531; -0.673287; -0.513333; -0.333047; -0.139617; 0.0592467; 0.255615; 0.44166; 0.609964; 0.753818; 0.867487; 0.946439; 0.987526; 0.989111; 0.95113; 0.875097; 0.764044; 0.622398; 0.455806; 0.27091; 0.0750802; -0.123876; -0.318026; -0.499631; -0.66145; -0.797032; -0.900972; -0.969126; -0.998776];
plot(x, y, '-r');
hold off
title('My plot title');
xlabel('My x-axis title');
ylabel('My y-axis title');
```
Its output figure is:

How do I change the window title of this plot?
What command do I add, and/or what modifications should I do to change it?
| How to change the window title of a MATLAB plotting figure? | CC BY-SA 3.0 | 0 | 2011-01-13T19:32:59.423 | 2014-04-24T18:58:40.193 | 2012-08-03T14:52:20.077 | 63,550 | 245,376 | [
"matlab",
"title",
"plot"
]
|
4,684,477 | 1 | 4,692,803 | null | 0 | 1,008 | Hey I want to make a view appear below the last that has been created.
It is showing like this:

I want to make the next view show below the last one, so for each new view added, it shows below. Understand?
Here is my code. The xml file and the java file.
```
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:id="@+id/linearId"
android:padding="6dip"
>
<ImageView
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_marginRight="6dip"
android:src="@drawable/icon"
/>
<LinearLayout
android:orientation="vertical"
android:layout_width="0dip" android:layout_weight="1"
android:layout_height="fill_parent"
>
<TextView
android:id="@+id/txt1"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:textSize="20sp"
android:gravity="center_vertical"
android:text="My Application"
/>
<TextView
android:id="@+id/txt2"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:singleLine="true"
android:ellipsize="marquee"
android:text="Simple application that shows how to use RelativeLayout"
android:textSize="10sp"
/>
</LinearLayout>
</LinearLayout>
```
```
public class RatedCalls extends Activity {
private static final String LOG_TAG = "RatedCalls";
private TableLayout table;
private CallDataHelper cdh;
private TableRow row;
private TableRow row2;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.listitem);
Log.i(LOG_TAG, "calling from onCreate()");
cdh = new CallDataHelper(this);
startService(new Intent(this, RatedCallsService.class));
Log.i(LOG_TAG, "Service called.");
Log.i(LOG_TAG, "before call fillList");
List<String> ratedCalls = new ArrayList<String>();
ratedCalls = this.cdh.selectTopCalls();
LayoutInflater inflater = (LayoutInflater) this
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
LinearLayout ll = (LinearLayout) this.findViewById(R.id.linearId);
for (int i = 0; i < 1; i++) {
View item = inflater.inflate(R.layout.listitem, null);
TextView x = (TextView) item.findViewById(R.id.txt1);
x.setText(ratedCalls.get(0));
TextView ht = (TextView) item.findViewById(R.id.txt2);
ht.setText(ratedCalls.get(1));
ll.addView(item, ViewGroup.LayoutParams.WRAP_CONTENT);
}
}
```
| How to make a view appear below | CC BY-SA 2.5 | null | 2011-01-13T19:43:57.430 | 2011-01-14T15:40:06.897 | 2011-01-13T20:16:35.343 | 321,697 | 399,459 | [
"android",
"android-layout",
"android-listview"
]
|
4,684,925 | 1 | 4,688,377 | null | 6 | 1,384 | how to move the object in specific locations.
for examples. am having one small bar(width=50, height=10). i have to move this like plunger manually. i want to move only in x cordinates ( limits is x=20(start point) to x=50(end point)) no moves on y coordinates. but its moving 50 to 10 after wards no movement.
coding:-
```
- (void)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
if (isPlaying) {
UITouch *touch = [[event allTouches] anyObject];
touchPosition = [touch locationInView:touch.view];
if ( CGRectContainsPoint(para3.boundingBox,touchPoint)
isDragging = YES;
touchOffset = para3.position.y - touchPosition.y;
}
- (void)ccTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
if (isPlaying) {
UITouch *touch3 = [[event allTouches] anyObject];
float distanceMoved =
([touch3 locationInView:touch3.view].y + touchOffset) -
para3.position.y;
float newY = para3.position.y + distanceMoved;
if (newY > 67 && newY < 99)
para3.position = CGPointMake(newY , para3.position.y );
//para3.contentSize/2
if (newY >67 )
para3.position = CGPointMake( 67, para3.position.y );
if (newY < 99)
para3.position = CGPointMake( 99, para3.position.y );
}
}
```
| how to move the object in specific locations in cocos2d | CC BY-SA 2.5 | 0 | 2011-01-13T20:30:16.040 | 2011-01-14T12:36:28.917 | 2011-01-14T05:44:56.467 | 554,683 | 554,683 | [
"iphone",
"objective-c",
"cocos2d-iphone",
"sprite"
]
|
4,684,997 | 1 | 4,709,823 | null | 1 | 970 | I'm developing a simple application with CakePhp, and need some help on creating a multi-record edit form using some related data.
The application I'm developing is pretty straightforward, its main purpose is managing students records: updating, deleting, changing a student from one group to another, the usual suspects.
The relevant tables of the database are:
= (, teacher, classroom, etc)
=(, , since, until)
= (, name, last_name, etc)
= (, assitance, date)
(, , meta_information )
As you might have gathered from the tables above, the application is supposed to aid in recording assitance. Which is where I'm having some issues.
What I want to do is this:
- - - Register assitance should redirect to a view in wich for every student belonging to that group, the user can see the student's assitance, edit them, and save. Something like this:
In which stands for "Absent" and for "Present" and the user can edit everyone, and the save.
I just don't know how to go about that? How do I manage that? I've managed to create a multi-edit form for the assitance, but adding the related data is a pain, I don't know if I should query the students from the groups controllers and then pass that to the action to register assitance, or manage all the logic inside the assitance controller?
Any help would be great,
thanks!
Edit: Here's the output of `$this->Student->find('first');`
```
Array (
[Alumno] => Array (
[id] => 14
[tipo] => dni
[dni] => 2321312312
[apellido] => COQUITO
[nombre] => Pepe
[carrera] => Composición Musical
[creado] => 2011-01-08 17:59:00
[modificado] => 2011-01-08 17:59:00
)
)
```
The output is in spanish. = Student, = first name, = last_name.
| Multi-record edit with related data on Cakephp? | CC BY-SA 2.5 | 0 | 2011-01-13T20:37:55.730 | 2013-10-17T08:50:30.473 | 2013-10-17T08:50:30.473 | 168,868 | 363,554 | [
"php",
"cakephp"
]
|
4,685,031 | 1 | 4,685,111 | null | 0 | 172 | A question from a non-web-designer about the preferred - and least browser-sensitive - way of shifting users controls a few pixels horizontally and vertically if I'm using divs instead of table cells.
If you look at this top part of a web page, you will notice that the lower menu is a couple of pixels too far to the left and a couple pixels too high. (Note right edge doesn't line up with the menu above it. Also, tops of image buttons to the right of the lower control are clipped.)
Can I position them absolutely, or use white space to shift the lower one into alignment?
Here's a screenshot:

Here is the approximate markup:
```
<body id="bodyTag" runat="server">
<form id="Form1" method="post" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<div id="divAll" runat="server" style="visibility:visible;">
<div id="divPrintHeaders" style="visibility:hidden; width: 923px;height:70px;">
<asp:ImageButton ID="printCompanyLogoImageButton" ImageUrl="~/Images/TopNav/MainLogoImage.gif"
runat="server"></asp:ImageButton>
<asp:Image ID="printPageTitleImage" ImageUrl="~/Images/PageTitle/Product_Title.gif" runat="server"></asp:Image>
<br />
</div>
<div id="divMainHeaders" style="z-index:10;">
<ZZ:TopNavCtrl ID="topNavCtrl" runat="server"/>
<div style="margin-top:-13px;margin-left:-4px;height:31px;z-index : 25;">
<ZZ:MyMenuControl ID="myMenu" runat="server" OnMyMenu="myMain_DoStuff" />
</div>
</div>
<div style="LEFT: 12px; POSITION: absolute; TOP: 120px">
<ZZ:SomeControl id="something" runat="server"></ZZ:SomeControl>
<!-- Several more controls here ... -->
<table border="0" cellpadding="0" cellspacing="0"
style=" background-color: #ffffff; LEFT: 0px; POSITION: relative; TOP: 100px; width: 740px; height: 50px;">
<tr valign="middle">
<td>
<asp:PlaceHolder id="footerPlaceHolder" runat="server"></asp:PlaceHolder>
</td>
</tr>
</table>
</div>
</div>
</form>
</body>
```
| Shifting User Controls in .ASPX Markup | CC BY-SA 2.5 | null | 2011-01-13T20:42:55.630 | 2011-01-13T20:52:25.510 | null | null | 67,875 | [
"asp.net",
"html"
]
|
4,685,121 | 1 | 4,759,183 | null | 2 | 1,717 | I'm newbie with GWT/GXT and I'm looking for best persistence way for my future apps. I was considering many variants of doing that so I decided to draw a graph here:

So my conclusions are:
1) JPA/Hibernate is the best persistence framework but it hates cooperation with GWT and a specially with GXT
2) JDBC it was just an example joke :)
3) MyBatis is really great tool for gaining data from db, its fast, efficient and has great possibilities not seen in Hibernate, but writing mappers is the worst thing ever.
4) Dozzer is server and user resourcess killer. You must write a lot of boiler plate code and it just copy data (sometimes a lot). Don't use it at any cost!!! Imagine server that runs 100 sessions and each bean request must use Dozzer.
5) DTO - similar situation. It's boilerplate, and it's just transforming one data type into other. There is no serious data processing. Use server resourcess wisely.
6) Gilead is copying hibernate beans states. It could be dangerous (just heard from few comments), hard to configure and integrate with other IoC frameworks (Guice in my case).
7) Don't transform POJO into BeanModel on the client side. JavaScript is really slow and it slows down the whole client.
8) Best practise for me and maybe for you: find the shortest path on the graph from DB to the BaseModel bean on the client side.
9) MyBatis allows to map query results to the BaseModel beans (tested) so they don't need to be transformed many times and you don't have to care about it at all. The only thing is writing proper mappings.
This is my personal opinion but I would like to know your opinion. Please explain me if I'm wrong and give cons arguments. I would really like to use Hibernate or maybe you know another ORM or similar to MyBatis framework that could give me direct mapping to the BeanModel.
For my purpose I'm going to develop app that would generate for me domain classes in BaseModel style with mappers, validators, editors, advanced search panels, DAOs, services and GWT-RPC classes. The best solution would be to develop own scaffolding :D. What do you think about it?
| A little bit diffrent GWT/GXT persistent approach | CC BY-SA 2.5 | null | 2011-01-13T20:53:25.483 | 2014-09-30T10:15:56.600 | null | null | 276,948 | [
"hibernate",
"gwt",
"persistence",
"gxt",
"mybatis"
]
|
4,685,376 | 1 | null | null | -1 | 1,419 | I'm trying to download a JSON file through javascript to use in a ping test but the browser appears to be interpreting it as javascript and gives parse errors. here is the code:
```
function sprawdz(adres)
{
//ping = 0;
startTime = new Date().getTime( );
$.ajax({
type: 'GET',
//url: 'http://'+adres+'/img/loading.gif',
url: 'URL TO JSON FILE HERE',
dataType: 'jsonp',
async: false,
setup: function() {
//
},
complete: function(xhr, text)
{
//alert(xhr.status + ' - ' + xhr.responseText + ' - ' + xhr.status);
finishTime = new Date( ).getTime( );
ping = finishTime - startTime;
//pngud(ping);
}
}
);
//return ping + ' ms';
}
```

| Javascript Ping by Downloading JSON file | CC BY-SA 2.5 | null | 2011-01-13T21:18:08.250 | 2014-06-16T17:19:38.633 | 2011-01-13T21:36:51.617 | 139,010 | 574,897 | [
"javascript",
"json",
"jsonp"
]
|
4,685,460 | 1 | 4,685,865 | null | 8 | 4,294 | Right now I'm populating a UIScrollView with a series of views. The views need to be warped to make the UIScrollView appear like a carousel. In other words when the user scrolls it needs to be like a circle. I've never done anything quite like this before, but I'm assuming CoreAnimation is out of the question and OpenGL needs to be used. If this is possible with CoreAnimation or Quartz then I really just need a sample on how to warp the views and I can figure the rest out myself but I'm not familiar with OpenGL.

| Curving/warping views with CoreAnimation or OpenGL for carousel effect | CC BY-SA 2.5 | 0 | 2011-01-13T21:26:19.010 | 2013-08-07T14:10:13.793 | 2013-08-07T14:10:13.793 | 60,724 | 324,464 | [
"iphone",
"opengl-es",
"uiscrollview",
"core-animation",
"quartz-graphics"
]
|
4,685,641 | 1 | 4,685,879 | null | 0 | 536 | The problem in this code is that when it's run and I push "Yes" button, This is shown:

This means that my application stopped working, I just want it to end.
```
private void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
{
string message = "An unhandled exception has ocurred, do you want close the app?";
MessageBoxResult currentMB = MessageBox.Show(message, "SomeTitleApp", MessageBoxButton.YesNo, MessageBoxImage.Exclamation);
if (currentMB == MessageBoxResult.Yes)
{ Application.Current.Shutdown(); }
else
{ e.Handled = true; }
}
```
| Question about DispatcherUnhandledException | CC BY-SA 2.5 | null | 2011-01-13T21:44:57.010 | 2011-01-13T22:08:07.617 | null | null | 534,444 | [
"c#"
]
|
4,685,937 | 1 | 4,686,007 | null | 0 | 139 | Should I even be a ListBox?

I'm talking about the Style control, and the Width control. How can I accomplish having these custom items?
Thank you!
| How can I have an item like this inside of a Listbox? | CC BY-SA 2.5 | null | 2011-01-13T22:14:55.707 | 2011-01-13T22:21:51.157 | null | null | null | [
"c#",
"winforms",
"listbox",
"items"
]
|
4,686,066 | 1 | 4,760,263 | null | 0 | 1,220 | Can anyone assist with how to successfully use JQueryUI Dialog where I remove a table row that is displayed in the dialog by using a link or some other mechanism?
Here is a visual of the code I'm working with

[http://i51.tinypic.com/30sh55t.png](http://i51.tinypic.com/30sh55t.png)
HTML
```
<tr>
<td>1/1/0001</td>
<td>THOMAS</td>
<td>LNAMEONE<input type="hidden" id="name_17053942" value="LNAMEONE" /></td>
<td>SKIN TW</td>
<td>17053942<input type="hidden" id="number_17053942" value="SKINNER" /></td>
<td>1/7/2009</td><td>Graph Trend View <a href="#" id="17053942" class="ui-state-add ui-corner-all">Add</a></td>
<td class="hide-cell">
<!-- ui-dialog -->
<div id="dialog_17053942_message" title="17053942 THOMAS SKINNER">
<p></p>
</div>
</td>
</tr>
<tr>
<td>6/21/2010</td>
<td>EMERY</td>
<td>LNAMETWO<input type="hidden" id="name_ZF365763B" value="LNAMETWO" /></td>
<td>RAND E</td>
<td>ZF365763B<input type="hidden" id="number_ZF365763B" value="ZF365763B" /></td>
<td>1/7/2009</td><td>Graph Trend View <a href="#" id="ZF365763B" class="ui-state-add ui-corner-all">Add</a></td>
<td class="hide-cell">
<!-- ui-dialog -->
<div id="dialog_ZF365763B_message" title="ZF365763B EMERY RANDOLPH">
<p></p>
</div>
</td>
</tr>
```
JQUERY
```
$(function() {
// Dialog
$('#carrier-list').dialog({
autoOpen: false,
resizable: false,
height: 260,
modal: true,
width: 240,
buttons: {
"Compare Carriers": function() {
$(this).dialog('close');
},
"Save": function() {
$(this).dialog('close');
}
}
});
// Dialog Link
// This adds a carrier to a list
$('.ui-state-add').click(function() {
var target = $(this).attr("id");
//alert(target);
$("#carrier-table").prepend("<tr id='" + target + "'>" +
"<td><a href='#' id='" + target + "' class='ui-state-remove ui-corner-all'>remove</a></td>" +
"<td>" + target + "</td>" +
"<td>" + $("#name_" + target).val() + "</td>" +
"</tr>");
$('#carrier-list').dialog('open');
return false;
});
//hover states on the static widgets
$('.ui-state-add').hover(
function() { $(this).addClass('ui-state-hover'); },
function() { $(this).removeClass('ui-state-hover'); }
);
// Remove Dialog Link
// This adds a carrier to a list
$('.ui-state-remove').click(function() {
var target = $(this).attr("id");
alert(target);
$('#' + target).remove(); ;
//$('#carrier-list').dialog('open');
return false;
});
});
```
| Using JQueryUI Dialog, how can I remove a table row that is displayed using <A> | CC BY-SA 3.0 | 0 | 2011-01-13T22:27:51.517 | 2017-11-11T16:31:33.337 | 2017-11-11T16:31:33.337 | 4,370,109 | 574,973 | [
"jquery-ui",
"html-table",
"dialog",
"row"
]
|
4,686,356 | 1 | 4,687,177 | null | 0 | 608 | A have ListBox and 4 Items.
2 visible
2 colpased:

Click:

-this bad!
I need this:

I need Set in reapeatButton change Interval!?!? how to do it
| How edit repeatButton Interval? | CC BY-SA 3.0 | null | 2011-01-13T23:04:39.520 | 2015-03-24T07:19:44.217 | 2011-11-23T09:38:02.207 | 45,382 | 450,466 | [
"c#",
"wpf",
"listbox",
"repeatbutton"
]
|
4,686,360 | 1 | 4,686,623 | null | 7 | 1,658 | In my window threre is small black line.
Why?

```
<Window x:Class="WpfPortOfTestingCamera.InputSelection"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="InputSelection" WindowStartupLocation="CenterOwner" ResizeMode="NoResize" ShowInTaskbar="False" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" SizeToContent="WidthAndHeight" d:DesignWidth="280" d:DesignHeight="206">
<StackPanel HorizontalAlignment="Center" Name="stackPanel1" VerticalAlignment="Top" Margin="10" MaxWidth="500">
<GroupBox Header="Select Camera" HorizontalAlignment="Center" VerticalAlignment="Center">
<ComboBox Height="23" Name="comboBox1" HorizontalAlignment="Center" VerticalAlignment="Center" MinWidth="120" />
</GroupBox>
<Button Content="OK" Name="ButtonOK" IsDefault="True" Click="ButtonOK_Click" />
</StackPanel>
</Window>
```
| C# WPF - Black Line in window | CC BY-SA 2.5 | 0 | 2011-01-13T23:05:47.957 | 2011-01-13T23:45:48.960 | null | null | 465,408 | [
"c#",
".net",
"wpf"
]
|
4,686,651 | 1 | null | null | 2 | 1,771 | Over the last two days I've effectively figured out how NOT to rotate Raphael Elements.
Basically I am trying to implement a multiple pivot points on element to rotate it by mouse.
When a user enters rotation mode 5 pivots are created. One for each corner of the bounding box and one in the center of the box.
When the mouse is down and moving it is simple enough to rotate around the pivot using Raphael [elements.rotate(degrees, x, y)](http://raphaeljs.com/reference.html#rotate) and calculating the degrees based on the mouse positions and atan2 to the pivot point.
The problem arises after I've rotated the element, bbox, and the other pivots. There x,y position in the same only there viewport is different.
In an SVG enabled browser I can create new pivot points based on [matrixTransformation and getCTM](http://www.w3.org/TR/SVG/coords.html#NestedTransformations). However after creating the first set of new pivots, every rotation after the pivots get further away from the transformed bbox due to rounding errors.

The above is not even an option in IE since in is VML based and cannot account for transformation.
> Is the only effective way to implement
element rotation is by using rotate
absolute or rotating around the center
of the bounding box?Is it possible at all the create multi
pivot points for an object and update
them after mouseup to remain in the
corners and center of the transformed
bbox?
I've attempted to use jQuery offset to find the pivot after it's been rotated, and to use that offset location as the pivot point.
Demo site ...
[http://weather.speedfetishperformance.com/dev/raphael/rotation.html](http://weather.speedfetishperformance.com/dev/raphael/rotation.html)
| Raphael SVG VML Implement Multi Pivot Points for Rotation | CC BY-SA 2.5 | null | 2011-01-13T23:50:11.967 | 2011-01-16T21:13:22.043 | 2011-01-16T18:18:45.413 | 162,393 | 162,393 | [
"javascript",
"svg",
"rotation",
"raphael",
"trigonometry"
]
|
4,686,697 | 1 | 4,686,750 | null | 0 | 1,658 | I have a folder structure, as shown below:

I need to create a bash script that does 4 things:
1. It searches all the files in the generic directory and finds the string 'generic' and makes it into 'something'
2. As above, but changes "GENERIC" to "SOMETHING"
3. As above, but changes "Generic" to "Something"
4. Renames any filename that has "generic" in it with "something"
Right now I am doing this process manually by using the search and replace in net beans. I dont know much about bash scripting, but i'm sure this can be done. I'm thinking of something that I would run and it would take "Something" as the input.
Where would I start? what functions should I use? overall guidance would be great. thanks.
I am using Ubuntu 10.5 desktop edition.
| How do I write a bash script to replace words in files and then rename files? | CC BY-SA 2.5 | null | 2011-01-13T23:59:00.510 | 2011-01-14T00:49:14.773 | 2020-06-20T09:12:55.060 | -1 | 311,465 | [
"linux",
"bash",
"replace",
"file-rename"
]
|
4,687,032 | 1 | null | null | 0 | 526 | Have an application using database persistence (entity framework, but not sure that matters)
Given the following hypothetical layout:

Where all of these objects derive from the AbstractBase. Container is an object that acts as a collection for an arbitrary number of AbstractBase-derived objects.
# Problem
For instance, Container can have zero Containers, can have zero or one Objects, must have exactly one AnotherObject, can have many AbstractObjects, etc.
## Simple way
A field in AbstractBase called CountRestrictor that's a small int. This corresponds to an enum outside of the database holding an attribute. Problem: This is not contained in the database. A change to the database requires a change in that enum container (and thus a rebuild) of that assembly. Plus, I have to write math translation code elsewhere.
## Class-based way
So, what about a class? The problem is that classes in the database require datatypes, so can we express this mathematical restriction as a datatype? Can I make a class that holds part of a lambda expression that can be later translated into an Expression item, for instance? I don't think so.
---
# Things I've Considered
## Embedded mathematical logic
Maybe a CountObject with a CountObject.Restrictor attribute of type string that could be programmatically translated into an Expression object:
```
CountObject lessThanTwo = new CountObject { Restrictor = "< 2" };
CountObject exactlyOne = new CountObject { Restrictor = "= 1" };
```
While inside the Container object I can have logic something like:
```
…
private Bool IsValidEntry<T>(T obj) where T : AbstractBase
{
Int count = this.AbstractBases.OfType<T>().Count;
Expression expression = new Expression(); // No constructors defined, so not sure how
// use obj.Restrictor to build the expression
if (expression)
// Add element
else
// throw Exception/Message dialog
…
}
```
Is this possible? Is it advisable (since I'm injecting math into my database, though, not a lot)
## Manual string to math translation
Another thing I considered is just using CountObject.Restrictor as a human readable string "Less that Two", "Exactly One", etc. and having another object outside the database that does translation:
```
public class CountTranslator
{
private String _lessThanTwo = "Less than Two";
private String _exactlyOne = "Exactly One";
public String LessThanTwo { get { return _lessThanTwo; } }
…
}
```
This would cleanly allow the use of Module.CountTranslator.LessThanTwo, but wouldn't be stored in the database, requiring a rebuild for changes. It would be sensitive to misspelling ("Less Than Two" != "Less than Two"), and would still require the building of "human to math" code:
```
…
Int count = container.AbstractBase.OfType<T>();
Int restrictor = obj.CountObject.Restrictor;
switch(restrictor)
{
case CountTranslator.ExactlyOne // Have to make sure database record string spelled correctly
if (count != 1)
// do something
…
}
```
But this strikes me as horribly ugly with a lot of conditional checking.
## Additive conditions
Finally, I've considered additive conditions. AbstractBase has a many-to-many relationship with CountObject.
```
public class CountObject
{
private Int _value;
private String _expression;
public Int Value { get { return _value; } }
public String Expression { get { return _Expression; } }
}
public partial class Container : AbstractBase
{
…
private Bool IsValidEntry<T>(T obj) where T : AbstractBase
{
Int count = AbstractBases.OfType<T>().Count;
foreach (CountObject counter in obj.CountObjects)
{
switch(counter.Expression)
{
case "<":
if (count > counter.Value)
throw Exception;
case "=":
if (count != counter.Value)
throw Exception;
…
}
}
}
}
```
Again, this is a lot of conditionals and switch statements.
## Coda
Are there other ways to skin the cat? Perhaps a "Mathematical translation class" hidden in .NET somewhere? Is there one way that exemplifies
| Expressing relationship quantity restrictions in a SQL record (Entity) | CC BY-SA 2.5 | null | 2011-01-14T00:54:42.417 | 2011-01-16T04:17:29.490 | 2011-01-15T01:01:43.787 | 74,919 | 74,919 | [
"sql",
"math",
"relational-database",
"entity-relationship"
]
|
4,687,124 | 1 | 4,687,144 | null | 1 | 583 | Hi please look at my xml file, very straight and simple, one textView and one Spinner
```
<TextView android:id="@+id/TextViewContactNamesTexting"
android:layout_height="wrap_content" android:layout_gravity="center_vertical"
android:text="name" android:layout_width="fill_parent"
android:textColor="@color/font" android:textSize="15sp"></TextView>
<Spinner android:layout_height="wrap_content"
android:layout_width="fill_parent" android:layout_marginLeft="10px"
android:id="@+id/SpinnerNumTexting"></Spinner>
```
in run time I would like to generate as many as I want depending on an arrayList.
I attach the picture which explains my thought better.
any suggestion?
I know how to fill the spinner appropriately, just stuck on generating more than one :(
thanks in advance...

| multiple spinner but one in xml | CC BY-SA 2.5 | null | 2011-01-14T01:14:52.043 | 2011-01-14T01:20:03.963 | null | null | 536,853 | [
"android",
"view",
"spinner"
]
|
4,687,302 | 1 | 4,691,618 | null | 2 | 5,855 | I want to create a custom dialog that contains a listview and buttons below the listview. The buttons should be below the listview but always visible (layout_alignParentBottom="true").
I have created an xml that works quite well, but only on long lists. If the list is short, the buttons are still at the screen bottom, and the height of the dialog title is streched to make dialog fill screen. Image attached shows what I get today.
In short. I want a normal dialog that only fills screen if nececcary.
I am unable to post the xml for some reason. but I use a relativelayout, buttons are aligned parent bottom, small panel layouted above buttons, listview layouted above this panel.
All layouts are layout:height=wrap_content.
Thankful for any help. /Magnus

| Custom dialog with listview and button always fullscreen | CC BY-SA 2.5 | 0 | 2011-01-14T01:52:58.487 | 2013-08-06T18:48:06.607 | null | null | 513,932 | [
"android",
"listview",
"button",
"dialog",
"android-alertdialog"
]
|
4,687,400 | 1 | 4,687,861 | null | 5 | 5,514 | My program needs to arbitrarily maximize any window on the current desktop. I achieve this by calling `ShowWindow(hWnd, SW_MAXIMIZE)`, where hWnd is the `HWND` of the window I want to maximize. When that line of code executes, the window in question (here, Notepad) looks like this:

Everything seems fine, except for the fact that the window has not been positioned correctly, i.e. the window seems to be a few pixels to low, and the title bar does not look "squashed" like it should. Compared to how it should look when the maximize button is clicked, the problem is clearly visible:

Does anyone know why this behaviour occurs, and what I can do to fix it?
| Problem when maximizing window in C++ | CC BY-SA 2.5 | null | 2011-01-14T02:19:23.523 | 2015-04-16T04:59:02.527 | null | null | 464,886 | [
"windows",
"winapi",
"window",
"maximize"
]
|
4,687,414 | 1 | 4,704,513 | null | 16 | 23,105 | If there is no record available, I want to add a `TextBlock` on data grid, below the header, showing the message "No Record Found."
Consider the attached image for reference.
| Show "No record found" message on a WPF DataGrid when it's empty | CC BY-SA 3.0 | 0 | 2011-01-14T02:23:52.887 | 2018-09-14T17:03:34.240 | 2014-07-15T08:09:26.607 | 314,334 | 557,352 | [
"wpf",
"xaml",
"wpfdatagrid"
]
|
4,687,841 | 1 | 4,687,855 | null | 3 | 9,456 | How is the "sunken" or "inset" effect applied to these letters in this menu? I looked (briefly) with Firebug but can't find how they're doing it. Works in FF, not in IE.

See [http://balsamiq.com/products/mockups/mybalsamiq](http://balsamiq.com/products/mockups/mybalsamiq) for actual example.
| CSS "sunken"/"inset" letter effect without using image | CC BY-SA 3.0 | 0 | 2011-01-14T03:57:18.983 | 2012-01-14T02:55:15.970 | 2012-01-13T16:51:33.910 | 106,224 | 385,273 | [
"css",
"text"
]
|
4,688,049 | 1 | 4,739,832 | null | 2 | 124 | The problem I am having is in my testing I create an order which obtains an ID. This ID is different every-time.
Here is a picture of some sample code:

Thanks in advance to any help.
--Curtis
| How can I make a variable out of an ID that is made after the item using the ID is created? | CC BY-SA 2.5 | null | 2011-01-14T04:43:21.653 | 2011-01-19T19:38:50.190 | null | null | 571,722 | [
"ruby",
"watir",
"firewatir"
]
|
4,688,403 | 1 | null | null | 1 | 977 | In the Linked in iphone application I noticed that they have a tableview, see the following picture with what appears to have a triangle indicator pointing upwards.

Notice how the tableview cell has a little triangle pointing upwards and is part of a tableview cell.
The triangle is the ---^--- part of the image.
I'm wondering. How do you make a UITableView with this triangle indicator, and what is this effect called?
Thanks
| How to do a UITable cell with triangle indicator? | CC BY-SA 2.5 | 0 | 2011-01-14T06:05:56.293 | 2016-07-12T07:17:29.693 | 2015-03-03T12:33:31.240 | 1,118,321 | 315,635 | [
"iphone",
"uitableview",
"geometry"
]
|
4,688,639 | 1 | 4,688,746 | null | 0 | 355 | The table structure is :

The controller action to insert a row to table is
public bool CreateInstnParts(string data)
{
IDictionary myInstnParts = DeserializeData(data);
```
try
{
HSInstructionPart objInstnPartBO = new HSInstructionPart();
using (ISession session = Document.OpenSession())
{
using (ITransaction transaction = session.BeginTransaction())
{
objInstnPartBO.DocumentId = Convert.ToInt32(myInstnParts["documentId"]);
objInstnPartBO.InstructionId = Convert.ToInt32(myInstnParts["instructionId"]);
objInstnPartBO.PartListId = Convert.ToInt32(myInstnParts["part"]);
objInstnPartBO.PartQuantity = Convert.ToInt32(myInstnParts["quantity"]);
objInstnPartBO.IncPick = Convert.ToBoolean(myInstnParts["incpick"]);
objInstnPartBO.IsTracked = Convert.ToBoolean(myInstnParts["istracked"]);
objInstnPartBO.UpdatedBy = User.Identity.Name;
objInstnPartBO.UpdatedAt = DateTime.Now;
session.Save(objInstnPartBO);
transaction.Commit();
}
return true;
}
}
catch (Exception ex)
{
Console.Write(ex.Message);
return false;
}
}
```
This is throwing an exception
NHibernate.MappingException was caught
Message="No persister for: Hexsolve.Data.BusinessObjects.HSInstructionPart"
Source="NHibernate"
StackTrace:
at NHibernate.Impl.SessionFactoryImpl.GetEntityPersister(String entityName)
at NHibernate.Impl.SessionImpl.GetEntityPersister(String entityName, Object obj)
at NHibernate.Event.Default.AbstractSaveEventListener.SaveWithGeneratedId(Object entity, String entityName, Object anything, IEventSource source, Boolean requiresImmediateIdAccess)
at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.SaveWithGeneratedOrRequestedId(SaveOrUpdateEvent event)
at NHibernate.Event.Default.DefaultSaveEventListener.SaveWithGeneratedOrRequestedId(SaveOrUpdateEvent event)
at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.EntityIsTransient(SaveOrUpdateEvent event)
at NHibernate.Event.Default.DefaultSaveEventListener.PerformSaveOrUpdate(SaveOrUpdateEvent event)
at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.OnSaveOrUpdate(SaveOrUpdateEvent event)
at NHibernate.Impl.SessionImpl.FireSave(SaveOrUpdateEvent event)
at NHibernate.Impl.SessionImpl.Save(Object obj)
at HexsolveMVC.Controllers.InstructionController.CreateInstnParts(String data) in F:\Project\HexsolveMVC\Controllers\InstructionController.cs:line 1342
InnerException:
Can anyone help me solve this??
| NHibernate.MappingException on table insertion | CC BY-SA 2.5 | null | 2011-01-14T06:50:25.097 | 2011-01-14T07:11:22.490 | null | null | 855,788 | [
"nhibernate-mapping"
]
|
4,688,945 | 1 | 4,690,949 | null | 0 | 995 | I think this problem is best explained by images. This is how my accordion looks:

When you click on the small plus/minus icons the slides under each chapter will expand/collapse. However when the content in the accordion grows too tall, it grows out from its container. So if I click on more plus icons the accordion will look like this (not pretty):

As you can see, the container is not growing taller together with the accordion and it does not look good.
This problem only occurs in IE7 and IE8. It works in Firefox and Chrome.
The HTML looks like this (simplified):
```
<div id="content">
<div class="box2 rounded-corners">
<div class="chapters">
<h3><a href="/clientarea/view/archived-course/teid/133">Obsah</a></h3>
<div id="accordion">
<ul>
... // accordion content - too long
... // accordion content - too long
</ul>
<div class="clear"> </div>
</div>
<div class="clear"> </div>
</div>
<div class="training-body">
... // content to the right of the accordion
</div>
</div>
</div>
```
The CSS, again siplified:
```
html, body {
height: 100%;
width: 100%;
overflow: auto;
}
#content {
background: white url('/images/background_middle.png') left top repeat-x;
padding: 13px;
min-height: 40em;
height: auto !important;
height: 40em;
}
/* this is the div with rounded corners */
#content .box2 {
background: white;
padding: 0 15px 15px;
border: 1px solid #C5E3F8;
position: relative;
}
/* left sidebar 98
#content div.chapters {
float: left;
width: 224px;
}
/* orange heading "OBSAH" */
#content div.chapters h3 {
color: #ff6e19;
text-transform: uppercase;
font-size: .9em;
text-align: center;
padding-bottom: .5em;
margin-top: 1em;
margin-bottom: 0;
}
#content div.chapters h3 a {
color: #ff6e19;
}
/* accordion */
#accordion {
width: 226px;
border-top: 1px solid #c5e3f8;
}
#accordion ul {
padding-left: 0;
margin-top: 0;
margin-bottom: 0;
margin-left: 0;
}
/* area to the right of the accordion */
#content div.training-body {
float: left;
padding-left: 0px;
width: 748px;
line-height: 1.3em;
}
```
| Accordion "growing out" from its container - in IE7/8 | CC BY-SA 2.5 | 0 | 2011-01-14T07:47:02.447 | 2011-01-14T12:17:51.300 | 2011-01-14T08:13:26.390 | 95,944 | 95,944 | [
"html",
"css",
"internet-explorer",
"internet-explorer-8",
"internet-explorer-7"
]
|
4,689,057 | 1 | 4,689,128 | null | 1 | 1,277 | I was going through the factory method pattern describe [here](http://exciton.cs.rice.edu/JavaResources/DesignPatterns/book/hires/pat3cfso.htm). I didn't quite get the meaning of the arrows marked from `Application` to `Document` and from `MyApplication` to `MyDocument`. Can anyone help to me to understand this notation.

| Factory method UML diagram clarification | CC BY-SA 2.5 | null | 2011-01-14T08:06:24.280 | 2011-01-14T08:18:29.677 | null | null | 94,169 | [
"design-patterns",
"uml",
"factory-method"
]
|
4,689,308 | 1 | 4,689,462 | null | 1 | 230 | I have the following piece of code:
```
else if (state.IsKeyDown(Keys.H))
{
Help help = new Help();
help.ShowDialog();
}
```
For some reason, if I hold the H key, the dialog opens multiple times:
| Preventing a dialog from showing multiple times | CC BY-SA 2.5 | null | 2011-01-14T08:44:21.497 | 2011-01-14T18:36:04.683 | null | null | 389,222 | [
"c#",
"xna"
]
|
4,689,218 | 1 | 4,690,918 | null | 1 | 1,319 | 
Okay so i have created the datagridview all right and enabled editing to the column as seen in the picture below. next i want to write a click event for the edit link such that when it is clicked, only the investigatorID column is available for editing. At that instance when changes can be made, i want the investigator column to display a dropdownlist of investigators that can be selected and that selected item be bound to the row on which the edit link was clicked.
I have the datasource to display the investigatorIDs am only wondering where to write the code for the click even of the edit link and have it do the magic.
Lets work some Magic people..:)
Then i thought again and a better idea came up since i only need the investigator id to be passed into the database to be updated, i edited the design as follows(see picture below)
so instead of having the exhibit type and image displayed in the grid view, i rather call up just the exhibit id to which the investigatorID will be assigned it makes more sense when you have a look at the database below:
though not fully populated but the concept behind the database is that:1. one case may be linked to more than one exhibit (so to say one case has many exhibits and each of those exhibits is assigned an investigating officer that cannot be working on more than 3 exhibits at a time.
so at this stage when investigators are assigned to a case, the caseID,and Exhibit details , are already populated. the Admin that opened the case would already have their ID there and the manager that is yet to assign the case would have their id and the investigators ID to be assigned to the fields.
Looking at my second design i have been able to create a grid to display only investigators that are working on a 2 or less exhibits. which means they are available to be assigned on at least one more exhibit. so to do the assigning, i select a CaseID from the dropdown list which details all cases from the case table(not shown here) and based on the selected case, i display all exhibitID linked to the selected casedID. from there, the user can select one Exhibit from the dropdownlist and and then select any of the available investigators to assign. so all i need to do now is when the user clicks the assign button, i want to know where and how i can make the investigatorsID against which the assign button was clicked be passed into the exhibits table as an update and that gridvire (userID, Username aka investigators list) be refereshed so that should the investigatorID that was recently clicked reached its threshold of three exhibits, their investigatorsID and name does not show up. and at the same time, the exhibit that has already been assigned also does not show up again in the dropdownlist. So in effect, the assign button is clicked, and the ID next to thatis sent to the exhibit table for update and the gridview together with the exhibit dropdownlist is refreshed.
there shouldnt be a problem with the grid view since its datais directly binded so a simple exhibitgridview.databind() should work it out and pobably calling the method that previously populated the exhibitdropdownlist would work the refresh for the dropdownlist as well...
so the problem here now is how to get the codes behind assign button click for this events to take place. please find attached below the code behind for the masterpages (using a nested masterpage) and the code behind and .cs file for the current page where this is supposed to happen.
First master page (SITE.MASTER) Code behind
```
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="Prototype5.SiteMaster" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head id="Head1" runat="server">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
// $(function () {
// $("#showOpenCasePage").click(function () {
// $("#CaseMainPanel").load("/EntryForms/OpenCase.aspx");
// });
// $("#showAddExhibitPage").click(function () {
// $("#CaseMainPanel").load("/EntryForms/AddExhibit.aspx");
// });
// $("#showOpenCasePage").click(function () {
// $("#CaseManagementMainPanel").load("/EntryForms/OpenCase.aspx");
// });
// $("#showAddExhibitPage").click(function () {
// $("#CaseManagementMainPanel").load("/EntryForms/AddExhibit.aspx");
// });
// $("#showAllocateOfficerPage").click(function () {
// $("#CaseManagementMainPanel").load("/EntryForms/AllocateOfficer.aspx");
// });
// $("#showReallocateOfficerPage").click(function () {
// $("#CaseManagementMainPanel").load("/EntryForms/ReallocateOfficer.aspx");
// });
// $("#showPrioritizeCasePage").click(function () {
// $("#CaseManagementMainPanel").load("/EntryForms/CasePriority.aspx");
// });
// $("#showRecordFindingPage").click(function () {
// $("#InvestigatorMainPanel").load("/EntryForms/RecordFinding.aspx");
// });
// $("#showUpdateStatusPage").click(function () {
// $("#InvestigatorMainPanel").load("/EntryForms/UpdateStatus.aspx");
// });
// });
</script>
<title></title>
<link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />
<asp:ContentPlaceHolder ID="HeadContent" runat="server">
</asp:ContentPlaceHolder>
<script type="text/javascript">
function updateClock() {
var currentTime = new Date();
var currentHours = currentTime.getHours();
var currentMinutes = currentTime.getMinutes();
var currentSeconds = currentTime.getSeconds();
// Pad the minutes and seconds with leading zeros, if required
currentMinutes = (currentMinutes < 10 ? "0" : "") + currentMinutes;
currentSeconds = (currentSeconds < 10 ? "0" : "") + currentSeconds;
// Choose either "AM" or "PM" as appropriate
var timeOfDay = (currentHours < 12) ? "AM" : "PM";
// Convert the hours component to 12-hour format if needed
currentHours = (currentHours > 12) ? currentHours - 12 : currentHours;
// Convert an hours component of "0" to "12"
currentHours = (currentHours == 0) ? 12 : currentHours;
// Compose the string for display
var currentTimeString = currentHours + ":" + currentMinutes + ":" + currentSeconds + " " + timeOfDay;
// Update the time display
document.getElementById("clock").firstChild.nodeValue = currentTimeString;
}
</script>
<style type="text/css">
.style1
{
width: 213px;
}
.menu
{}
.style2
{
width: 100%;
}
.style3
{
width: 264px;
}
.style4
{
width: 291px;
}
</style>
</head>
<body onload="updateClock(); setInterval('updateClock()', 1000 )">
<form id="Form1" runat="server">
<div class="page">
<div class="header">
<div class="title">
<span style="font-size: 5em; font-family:Old English Text MT; color: #FF6600;"><strong>Case Management System</strong></span>
</div>
<div class="clock">
<span id="clock"> </span>
</div>
<div class="clear hideSkiplink">
<table class="style2">
<tr>
<td class="style4" align="center">
<asp:LoginView ID="MasterLoginView" runat="server">
<LoggedInTemplate>
Welcome <span class="bold"><asp:LoginName ID="HeadLoginName" runat="server" />
[ <asp:LoginStatus ID="HeadLoginStatus" runat="server" LogoutAction="Redirect" LogoutText="Log Out" LogoutPageUrl="~/Logout.aspx"/> ]
<%--Welcome:
<span class="bold"><asp:LoginName ID="MasterLoginName" runat="server" /> </span>!--%>
</LoggedInTemplate>
<AnonymousTemplate>
Welcome: Guest
[ <a href="Account/Login.aspx" ID="HeadLoginStatus" runat="server">Log In</a> ]
</AnonymousTemplate>
</asp:LoginView>
</td>
<td class="style3">
</td>
<td valign="top">
<asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="False"
IncludeStyleBlock="False" Orientation="Horizontal" Height="36px" Width="120px">
<Items>
<asp:MenuItem NavigateUrl="~/Default.aspx" Text="Home"
ImageUrl="~/Images/homeIcon.png"/>
<asp:MenuItem NavigateUrl="~/About.aspx" Text="About"
ImageUrl="~/Images/aboutIcon.png"/>
<asp:MenuItem ImageUrl="~/Images/contactUsIcon.png" NavigateUrl="~/ContactUs.aspx"
Text="Contact Us" Value="Contact Us"></asp:MenuItem>
</Items>
</asp:Menu>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="page" style="margin-top:5px;height:auto;">
<div style="border-style:solid;">
<table style="width:100%; background-color:#3a4f63">
<tr>
<td class="style1" valign="top">
<p style="padding-left: 4px; padding-right:4px;">
<asp:Button ID="functionButton" runat="server" Text="System Functions"
class="fnctButton" Height="41px" Width="192px" />
<asp:ContentPlaceHolder ID="LeftNavigation" runat="server">
</asp:ContentPlaceHolder>
</p>
</td>
<td rowspan="2" valign="top" align="center">
<asp:ContentPlaceHolder ID="MainContent" runat="server"/>
</td>
</tr>
<tr>
<td class="style1" align="left" valign="top">
<asp:ContentPlaceHolder ID="RightNewsItem" runat="server"/>
</td>
</tr>
</table>
</div>
</div>
<div class="clear">
</div>
<div class="footer">
<span style="font-size: small;color: #FFFFFF;"><strong>Copyright 2011 JustRite Software Inc.</strong></span></div>
</form>
</body>
</html>
```
Second Master page based on the first one (Manage.Master)
```
<%@ Master Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Manager.master.cs" Inherits="Prototype5.Manager" %>
<asp:Content ID="ManagerHead" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="ManagerLeft" ContentPlaceHolderID="LeftNavigation" runat="server">
<div style="margin-top:20px; margin-bottom:20px;">
<p class="actionButton">
<asp:Button ID="allocateInvestigatorsButton" runat="server"
Text="Allocate Investigators" height="30px" width="135px"
onclick="allocateInvestigatorsButton_Click" />
</p>
<p class="actionButton">
<asp:Button ID="realocateInvestigatorsButton" runat="server"
Text="Reallocate Investigators" Height="30px" Width="135px"
onclick="realocateInvestigatorsButton_Click" />
</p>
<p class="actionButton">
<asp:Button ID="prioritizeCaseButton" runat="server"
Text="Prioritize Case" height="30px" width="135px"
onclick="prioritizeCaseButton_Click" />
</p>
<p class="actionButton">
<asp:Button ID="openCaseButton" runat="server"
Text="Open Case" height="30px" width="135px"
onclick="openCaseButton_Click" />
</p>
<p class="actionButton">
<asp:Button ID="registerExhibitButton" runat="server"
Text="Register Exhibit" height="30px" width="135px"
onclick="registerExhibitButton_Click" />
</p>
</div>
</asp:Content>
<asp:Content ID="ManagerMain" ContentPlaceHolderID="MainContent" runat="server">
<asp:ContentPlaceHolder ID="MainContent" runat="server"/>
</asp:Content>
<asp:Content ID="ManagerRight" ContentPlaceHolderID="RightNewsItem" runat="server">
<asp:Button ID="AlertButton" runat="server" Text="Alerts"
class="fnctButton" Height="25px" Width="70px" />
<div style="border-style: none; border-color: inherit; border-width: medium; width:210px; height: 103px;">
<p style="text-align: justify; font-size:1.2em; color:White; width: 209px; height: 95px;">
This is a place holder for allerts about cases to which the investigator has been assigned to.
</p>
</div>
</asp:Content>
```
Current Page containing elements based on second master page based on second master page
```
<%@ Page Title="" Language="C#" MasterPageFile="~/Manager.master" AutoEventWireup="true" CodeBehind="AllocateInvestigators.aspx.cs" Inherits="Prototype5.AllocateInvestigators" %>
<asp:Content ID="AllocateInvestigatorsMain" ContentPlaceHolderID="MainContent" runat="server">
<div>
<table class="style2">
<tr>
<td colspan="4" style="background-color: #C0C0C0">
</td>
</tr>
<tr>
<td class="style1"
style="width: 79px; color: #000000; background-color: #666666;">
<strong>Case ID:</strong></td>
<td align="left" class="style1" style="width: 187px">
<asp:DropDownList ID="caseIDDropDownList" runat="server" Height="22px"
Width="116px" DataSourceID="distinctCaseIDSqlDataSource"
DataTextField="CaseID" DataValueField="CaseID"
onselectedindexchanged="caseIDDropDownList_SelectedIndexChanged">
</asp:DropDownList>
<asp:SqlDataSource ID="distinctCaseIDSqlDataSource" runat="server"
ConnectionString="<%$ ConnectionStrings:CMSSQL3ConnectionString1 %>" SelectCommand="SELECT DISTINCT CaseID FROM Exhibits
WHERE InvestigatorID = NULL"></asp:SqlDataSource>
</td>
<td class="style3"
style="width: 119px; color: #000000; background-color: #666666;">
<strong>Case Priority:</strong></td>
<td align="left">
<asp:DropDownList ID="casePriorityDropDownList" runat="server" height="22px"
width="116px">
<asp:ListItem>Low</asp:ListItem>
<asp:ListItem>Medium</asp:ListItem>
<asp:ListItem>High</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td colspan="4" style="background-color: #C0C0C0">
</td>
</tr>
</table>
</div>
<div>
<table class="style2">
<tr>
<td style="width: 79px; color: #000000;">
<strong>Exhibit ID:</strong></td>
<td align="left">
<asp:DropDownList ID="exhibitsDropDownList" runat="server" height="22px"
onselectedindexchanged="exhibitsDropDownList_SelectedIndexChanged"
width="116px">
</asp:DropDownList>
<asp:SqlDataSource ID="exhibitIDSqlDataSource" runat="server"
ConnectionString="<%$ ConnectionStrings:CMSSQL3ConnectionString1 %>"
SelectCommand="SELECT ExhibitID FROM Exhibits"></asp:SqlDataSource>
</td>
</tr>
<tr>
<td colspan="2">
</td>
</tr>
</table>
</div>
<div>
<table class="style2">
<tr>
<td>
<asp:GridView ID="exhibitGridView" runat="server" AutoGenerateColumns="False"
CellPadding="4" DataKeyNames="UserID" DataSourceID="SqlDataSource1"
EmptyDataText="There are no data records to display." ForeColor="#333333"
GridLines="None" Height="241px"
onselectedindexchanged="GridView1_SelectedIndexChanged" Width="323px"
style="margin-right: 0px">
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:BoundField DataField="UserID" HeaderText="UserID" ReadOnly="True"
SortExpression="UserID" />
<asp:BoundField DataField="UserName" HeaderText="UserName"
SortExpression="UserName" />
<asp:ButtonField ButtonType="Button" CommandName="Select" Text="Assign" />
</Columns>
<FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
<RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
<SortedAscendingCellStyle BackColor="#FDF5AC" />
<SortedAscendingHeaderStyle BackColor="#4D0000" />
<SortedDescendingCellStyle BackColor="#FCF6C0" />
<SortedDescendingHeaderStyle BackColor="#820000" />
</asp:GridView>
<asp:SqlDataSource ID="assignInvestigatorsSqlDataSource" runat="server"
ConnectionString="<%$ ConnectionStrings:CMSSQL3ConnectionString1 %>"
SelectCommand="SELECT ExhibitID, ExhibitType, ExhibitImage, InvestigatorID FROM Exhibits">
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:CMSSQL3ConnectionString1 %>"
DeleteCommand="DELETE FROM [Exhibits] WHERE [ExhibitID] = @ExhibitID AND [CaseID] = @CaseID"
InsertCommand="INSERT INTO [Exhibits] ([CaseID], [ExhibitType], [DateReceived], [StoredLocation], [OfficerID], [SuspectID], [InvestigatorID], [ManagerID], [AdminID]) VALUES (@CaseID, @ExhibitType, @DateReceived, @StoredLocation, @OfficerID, @SuspectID, @InvestigatorID, @ManagerID, @AdminID)"
ProviderName="<%$ ConnectionStrings:CMSSQL3ConnectionString1.ProviderName %>"
SelectCommand="SELECT UserID, UserName
FROM Users
WHERE UserID IN (SELECT UserID
FROM Users
WHERE UserType LIKE 'Investigator'
AND UserID NOT IN (SELECT InvestigatorID
From Exhibits
GROUP BY (InvestigatorID)
HAVING COUNT(InvestigatorID) > 2));"
UpdateCommand="UPDATE [Exhibits] SET [ExhibitType] = @ExhibitType, [DateReceived] = @DateReceived, [StoredLocation] = @StoredLocation, [OfficerID] = @OfficerID, [SuspectID] = @SuspectID, [InvestigatorID] = @InvestigatorID, [ManagerID] = @ManagerID, [AdminID] = @AdminID WHERE [ExhibitID] = @ExhibitID AND [CaseID] = @CaseID">
<DeleteParameters>
<asp:Parameter Name="ExhibitID" Type="Int32" />
<asp:Parameter Name="CaseID" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="CaseID" Type="Int32" />
<asp:Parameter Name="ExhibitType" Type="String" />
<asp:Parameter Name="DateReceived" Type="DateTime" />
<asp:Parameter Name="StoredLocation" Type="String" />
<asp:Parameter Name="OfficerID" Type="String" />
<asp:Parameter Name="SuspectID" Type="Int32" />
<asp:Parameter Name="InvestigatorID" Type="String" />
<asp:Parameter Name="ManagerID" Type="String" />
<asp:Parameter Name="AdminID" Type="String" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="ExhibitType" Type="String" />
<asp:Parameter Name="DateReceived" Type="DateTime" />
<asp:Parameter Name="StoredLocation" Type="String" />
<asp:Parameter Name="OfficerID" Type="String" />
<asp:Parameter Name="SuspectID" Type="Int32" />
<asp:Parameter Name="InvestigatorID" Type="String" />
<asp:Parameter Name="ManagerID" Type="String" />
<asp:Parameter Name="AdminID" Type="String" />
<asp:Parameter Name="ExhibitID" Type="Int32" />
<asp:Parameter Name="CaseID" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
</td>
</tr>
</table>
</div>
<div>
<table class="style2">
<tr>
<td>
</td>
<td>
</td>
</tr>
</table>
</div>
</asp:Content>
```
AND lastly the .cs file of the current page
```
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
namespace Prototype5
{
public partial class AllocateInvestigators : System.Web.UI.Page
{
SqlConnection caseConnection = new SqlConnection();
SqlConnection exhibitConnection = new SqlConnection();
DataSet caseDataSet = new DataSet();
DataSet exhibitDataSet = new DataSet();
SqlDataAdapter caseSqlDataAdapter = new SqlDataAdapter();
SqlDataAdapter exhibitSqlDataAdapter = new SqlDataAdapter();
protected void Page_Load(object sender, EventArgs e)
{
//exhibitGridView.Enabled = false;
}
protected void caseIDDropDownList_SelectedIndexChanged(object sender, EventArgs e)
{
exhibitGridView.Enabled = true;
string selectedCaseID = caseIDDropDownList.SelectedItem.Text.ToString();
CreateExhibitDataset();
DataView exhibitDataView = new DataView(exhibitDataSet.Tables[0]);
exhibitDataView.RowFilter = "CaseID = '" + selectedCaseID + "' ";
exhibitsDropDownList.DataSource = exhibitDataView;
exhibitsDropDownList.DataBind();
}
private void CreateDataSet()
{
caseConnection.ConnectionString =
distinctCaseIDSqlDataSource.ConnectionString;
caseSqlDataAdapter.SelectCommand = new
SqlCommand(distinctCaseIDSqlDataSource.SelectCommand, caseConnection);
caseSqlDataAdapter.Fill(caseDataSet);
}
private void CreateExhibitDataset()
{
exhibitConnection.ConnectionString =
exhibitIDSqlDataSource.ConnectionString;
exhibitSqlDataAdapter.SelectCommand = new
SqlCommand(exhibitIDSqlDataSource.SelectCommand, caseConnection);
exhibitSqlDataAdapter.Fill(exhibitDataSet);
}
}
}
```
Counting on your kind help...@_@...


| How and Where do i enter the code to edit just one column of a datagridview | CC BY-SA 2.5 | 0 | 2011-01-14T08:33:15.350 | 2011-01-15T11:05:51.383 | 2011-01-14T11:09:44.333 | 284,240 | 569,285 | [
"c#",
"asp.net",
"webforms"
]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.