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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6,117,719 | 1 | 6,117,827 | null | -1 | 338 |
i have strings who look like this 20110525 .

how can i make to put '-' caracters in NSString variable ? to let dates look like this 2011-05-25 ?
My second question is how can i sort the dates to make the table look like this 20110525 then 20110526 ?Help please . Thank you
|
How to add characters to a NSString?
|
CC BY-SA 3.0
| null |
2011-05-24T22:36:32.523
|
2011-05-25T14:56:13.183
|
2011-05-25T14:56:13.183
| 41,116 | 760,095 |
[
"iphone",
"objective-c",
"ios4"
] |
6,118,116 | 1 | 6,118,182 | null | 2 | 2,793 |
I am currently trying to get the text of a control and while going down from the top window to the control I needed I got stuck in this control which has multiple chield with 2 controls having the same class name.
Debug sample code as illustration:
```
IntPtr window = FindWindow("MainControl", "WindowTitle");
iData.Text += window.ToString("X") + Environment.NewLine;
IntPtr control = FindWindowEx(window, IntPtr.Zero, "CMainWindow", null);
iData.Text += control.ToString("X") + Environment.NewLine;
IntPtr control2 = FindWindowEx(control, IntPtr.Zero, "My_SplitterWindow", null);
iData.Text += control2.ToString("X") + Environment.NewLine;
IntPtr control3 = FindWindowEx(control2, IntPtr.Zero, "ATL:0061FA08", null);
iData.Text += control3.ToString("X") + Environment.NewLine;
IntPtr control4 = FindWindowEx(control3, IntPtr.Zero, "ATL:0061E168", null);
iData.Text += control4.ToString("X") + Environment.NewLine;
IntPtr control5 = FindWindowEx(control4, IntPtr.Zero, "ATL:00620118", null);
iData.Text += control5.ToString("X") + Environment.NewLine;
IntPtr control6 = FindWindowEx(control5, IntPtr.Zero, "ATL:00622208", null);
iData.Text += control6.ToString("X") + Environment.NewLine;
// stucked here... :/
```
Here is an image of the child control I am at right now:

`ATL:00622208``#32770 (Dialog)`
|
Read a child control with multiple childs with classes having the same name?
|
CC BY-SA 3.0
| null |
2011-05-24T23:43:48.787
|
2014-03-07T19:18:37.057
|
2014-03-07T19:18:37.057
| 321,731 | 342,740 |
[
"c#",
"gettext",
"spy++"
] |
6,118,174 | 1 | null | null | 13 | 5,282 |
I have a couple questions regarding the relationship between references between two aggregate roots in a DDD model. Refer to the typical Customer/Order model diagrammed below.

First, should references between the actual object implementation of aggregates always be done through ID values and not object references? For example if I want details on the customer of an Order I would need to take the CustomerId and pass it to a ICustomerRepository to get a Customer rather then setting up the Order object to return a Customer directly correct? I'm confused because returning a Customer directly seems like it would make writing code against the model easier, and is not much harder to setup if I am using an ORM like NHibernate. Yet I'm fairly certain this would be violating the boundaries between aggregate roots/repositories.
Second, where and how should a cascade on delete relationship be enforced for two aggregate roots? For example say I want all the associated orders to be deleted when a customer is deleted. The ICustomerRepository.DeleteCustomer() method should not be referencing the IOrderRepostiory should it? That seems like that would be breaking the boundaries between the aggregates/repositories? Should I instead have a CustomerManagment service which handles deleting Customers and their associated Orders which would references both a IOrderRepository and ICustomerRepository? In that case how can I be sure that people know to use the Service and not the repository to delete Customers. Is that just down to educating them on how to use the model correctly?
|
How should I enforce relationships and constraints between aggregate roots?
|
CC BY-SA 3.0
| 0 |
2011-05-24T23:58:15.387
|
2011-05-26T15:19:28.807
|
2011-05-25T00:58:04.617
| 88,427 | 88,427 |
[
"domain-driven-design",
"aggregate",
"aggregateroot"
] |
6,118,323 | 1 | 6,118,416 | null | 0 | 811 |
I have an main window containing a UIToolBarController. In my first tab, I load a UIViewController, where I have an MKMapView. Above the map, I would like a toolbar like on the screenshot below (basically, instead of their UITableView I have an MKMapView...):

I'd like to know how I can make this big toolbar on top, and would like to add just une UIActionSheet style button ("Start" in green, and when clicked switch to red "Stop").
Thanks!
PS: The app from the screenshot is Clock if you want to try.
|
iPhone UIToolbar with UIActionSheet style buttons
|
CC BY-SA 3.0
| null |
2011-05-25T00:30:55.097
|
2011-05-25T00:47:28.237
| null | null | 318,830 |
[
"iphone",
"uibutton",
"toolbar",
"uiactionsheet"
] |
6,118,480 | 1 | 6,119,123 | null | 1 | 618 |
I'm developing an Internet Explorer toolbar and I want to place a combobox
I create on my toolbar.
```
HWND combobox1=CreateWindow(_T("COMBOBOX"), _T("combobox"), WS_BORDER |
WS_VISIBLE | WS_CHILD | CBS_DROPDOWN, 10, 0, 200,
250, m_hWnd, (HMENU) NULL,NULL , NULL);
```
And that works correctly, but the combobox is styled in the Windows Classic way, and I want to have it use the Windows Aero theme. I've tried this:
```
#pragma comment(linker,"\"/manifestdependency:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")`
```

But nothing changes. (I tried this on a simple Win32 app and the style worked fine, but in the DLL on the toolbar the style doesn't get set)
[Here's a simple example](http://narod.yandex.ru/disk/13945570001/MotleyFool.zip).
|
windows 7 style for combobox on internet explorer toolbar, how?
|
CC BY-SA 3.0
| null |
2011-05-25T00:59:15.100
|
2011-05-25T03:43:13.027
|
2011-05-25T01:04:21.847
| 707,111 | 676,205 |
[
"c++",
"windows-7",
"toolbar"
] |
6,118,497 | 1 | 6,119,771 | null | 0 | 193 |
I have a view with 14 buttons, it looks quite ugly now. I use round rect button, and put the buttons 7 each side.
Maybe someone could recommend me some good custom button style?
here comes the screenshot.
I don't see any way to reduce number of buttons, so may be I can change the button style to make it look better, any recommend button style?

|
How to deal with a view with 14 buttons?
|
CC BY-SA 3.0
| null |
2011-05-25T01:02:51.883
|
2011-05-25T05:03:41.817
|
2011-05-25T01:29:58.970
| 465,191 | 465,191 |
[
"iphone"
] |
6,118,737 | 1 | 6,118,902 | null | 50 | 238,843 |
I'm working on a project in which I am trying to make a paint program.
So far I've used Netbeans to create a GUI and set up the program.
As of right now I am able to call all the coordinated necessary to draw inside it but I am very confused with how to actually paint inside it.
Towards the end of my code I have a failed attempt at drawing inside the panel.
Can anyone explain/show how to use graphics in a example like this?
All examples I have found make a class and extend it with `JPanel` but I don't know if I can do this since it was generated in netbeans.
`JPanel``JFrame`
### JavaPaintUI Class
```
package javapaint;
import java.awt.*;
import javax.swing.*;
public class JavaPaintUI extends javax.swing.JFrame {
public JavaPaintUI() {
initComponents();
}
private void initComponents() {
jPanel2 = new javax.swing.JPanel();
jPanel2.setBackground(new java.awt.Color(255, 255, 255));
jPanel2.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
jPanel2.addMouseListener(new java.awt.event.MouseAdapter() {
public void mousePressed(java.awt.event.MouseEvent evt) {
jPanel2MousePressed(evt);
}
public void mouseReleased(java.awt.event.MouseEvent evt) {
jPanel2MouseReleased(evt);
}
});
jPanel2.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
public void mouseDragged(java.awt.event.MouseEvent evt) {
jPanel2MouseDragged(evt);
}
});
pack();
}// </editor-fold>
int currentX, currentY, oldX, oldY;
private void jPanel2MouseDragged(java.awt.event.MouseEvent evt) {
if (tool == 1) {
currentX = evt.getX();
currentY = evt.getY();
oldX = currentX;
oldY = currentY;
System.out.println(currentX + " " + currentY);
System.out.println("PEN!!!!");
}
}
private void jPanel2MousePressed(java.awt.event.MouseEvent evt) {
oldX = evt.getX();
oldY = evt.getY();
System.out.println(oldX + " " + oldY);
}
//mouse released//
private void jPanel2MouseReleased(java.awt.event.MouseEvent evt) {
if (tool == 2) {
currentX = evt.getX();
currentY = evt.getY();
System.out.println("line!!!! from" + oldX + "to" + currentX);
}
}
//set ui visible//
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new JavaPaintUI().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JPanel jPanel2;
// End of variables declaration
class jPanel2 extends JPanel {
@Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
g.drawString("BLAH", 20, 20);
g.drawRect(200, 200, 200, 200);
}
}
}
```
### Screen shot
The whole thing is a `JFrame` and the white section in the center is `jPanel2` which is what I want to draw on.

|
How to draw in JPanel? (Swing/graphics Java)
|
CC BY-SA 3.0
| 0 |
2011-05-25T01:55:27.880
|
2017-12-18T00:14:57.780
|
2017-12-18T00:14:57.780
| 418,556 | 768,764 |
[
"java",
"swing",
"jpanel",
"draw",
"paintcomponent"
] |
6,118,917 | 1 | 6,120,026 | null | 1 | 214 |
I'm wondering if there is a way to create images out of text in a Java web app.
I'm using GWT to design a web app, and would like to allow some administration so that a small number of things could be edited by someone without a ton of savvy and not require a migration. This would be, say, menu headings, which I would otherwise create out of text in (e.g.) Photoshop, and include in my ear. Instead I want to allow an administrator to add some text, and I'd have some code to convert this to an image, using some specified formatting, for "nice" presentation.
As an example, the administrator might want to add a "news" page. So he will enter `News` and it will come out looking like: 
Am I making sense? Is this something that is done? Are there libraries available for this?
|
Text to image on web server
|
CC BY-SA 3.0
| null |
2011-05-25T02:30:34.920
|
2011-05-25T05:46:52.920
|
2011-05-25T02:42:52.333
| 581,528 | 581,528 |
[
"java",
"image-processing"
] |
6,118,974 | 1 | 6,119,042 | null | 3 | 151 |
I have a newsfeed/chat box. Each entry contains two spans: #user and #message. I would like #user to float left, and #message to float left upon it. If #message causes the row to exceed the container width, #message should wrap below #user, as shown in the diagram below.
By default #message jumps completely beneath #user if it does not fit on the same row.
I have tried whitespace:nowrap on each element but that doesn't seem to do the trick either.
Help?

|
How can I wrap a floated span underneath another floated span, within a floated span [diagram included]?
|
CC BY-SA 4.0
| null |
2011-05-25T02:42:24.513
|
2019-04-18T08:15:58.183
|
2019-04-18T08:15:58.183
| 4,284,627 | 684,726 |
[
"css",
"css-float",
"word-wrap"
] |
6,119,050 | 1 | 6,120,147 | null | 2 | 5,279 |
I am new to Umbraco. I am creating an image gallery (called Customers). A Customer has a logo, which is an image.

How do I create a razor macro that outputs a list of customer logos?
I am after the cshtml code, probably something like this:
```
@inherits umbraco.MacroEngines.DynamicNodeContext
@foreach (var customer in Content.Customers) {
<img src="@customer.logo.umbracoFile" alt="@customer.Name"/>
}
```
Thanks in advance!
|
Umbraco, razor and image gallery
|
CC BY-SA 3.0
| 0 |
2011-05-25T02:57:57.333
|
2014-03-05T08:03:33.773
|
2011-05-25T05:29:57.577
| 36,036 | 36,036 |
[
"razor",
"umbraco"
] |
6,119,071 | 1 | 6,119,105 | null | 5 | 2,697 |
Still learning about Objective C and getting the structure right.
I have an iOS App with a UIViewController that has a defined method named "doSomething". In my view controller I have a view and in that view a number of UIButton that I create programmatically (see example below with one button).

Now when I press the button I want to call my method "doSomething". The way I currently do it is like this:
```
[myButton addTarget:nil
action:@selector(doSomething:)
forControlEvents:UIControlEventTouchUpInside];
```
Since my target is nil it goes up the responder chain until it finds a method called "doSomething". It works, but it does not really feel right.
I have started to look into using @protocol but not really got my head around it. I have been looking at some tutorials but for me it is not clear enough. I have used protocols like for the table view controllers, but defining one is new for me.
Would it be possible to get an example for this specific case?
Thanks!
|
Calling a method in a UIViewController from a UIButton in a subview
|
CC BY-SA 3.0
| 0 |
2011-05-25T03:01:00.037
|
2011-05-25T06:58:38.690
| null | null | 350,622 |
[
"objective-c",
"inheritance",
"uibutton",
"protocols"
] |
6,119,147 | 1 | 8,270,557 | null | 3 | 3,355 |
Using the [Google Calendar API](http://code.google.com/apis/calendar/), I can successfully [add](http://code.google.com/apis/calendar/data/2.0/developers_guide_dotnet.html#CreatingSingle), [update](http://code.google.com/apis/calendar/data/2.0/developers_guide_dotnet.html#UpdatingEvents) and [delete](http://code.google.com/apis/calendar/data/2.0/developers_guide_dotnet.html#DeletingEvents) an event.
But I can't see a way to set the event color. When the event is created, the default color is used.
Am I missing something? It seems odd that other aspects (where, when, reminders) can be set via the api. Is it possible to change it?

|
Setting event color's in Google Calendar
|
CC BY-SA 3.0
| 0 |
2011-05-25T03:14:09.317
|
2012-03-20T13:43:53.873
| null | null | 5,188 |
[
"c#",
"google-calendar-api"
] |
6,119,266 | 1 | 16,753,670 | null | 1 | 1,307 |
Using MFMailComposeViewController works fine when the phone is in UIInterfaceOrientationPortrait, however If I do not allow autorotation I get something like this when the user rotates the phone:

So I decided to allow the view controller (which is also a modal view), that is a part of the view that calls the modal view to rotate:
RootAppInfoViewController.h
```
#import <UIKit/UIKit.h>
@interface RootAppInfoViewController : UIViewController <UINavigationControllerDelegate>{
UINavigationController *navigationControl;
}
@property (nonatomic,retain) IBOutlet UINavigationController *navigationControl;
//dismisses this modal view
- (IBAction)selectHome:(id)sender;
@end
```
RootAppInfoViewController.m
```
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations.
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}
```
(Having this autorotate allows rotation for this entire view by the way). But this is a mere view controller and I want a table view to be presented modally so I have this class, which is referenced through the RootAppInfoViewController.xib which makes this modal view a table view:
AppInfoViewController.h
```
#import <UIKit/UIKit.h>
#import <MessageUI/MessageUI.h>
@interface AppInfoViewController : UITableViewController <MFMailComposeViewControllerDelegate, UINavigationControllerDelegate> {
NSMutableArray *dataSourceArray;
}
@property(nonatomic, retain) NSMutableArray *dataSourceArray;
@end
```
AppInfoViewController.m
```
//..
/* //NOTE: Commenting or uncommenting this block of code has no effect!
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations.
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}//*/
//...
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
NSString *source = [[[self.dataSourceArray objectAtIndex:indexPath.section] objectForKey:kSourceKey] objectAtIndex:indexPath.row];
if(indexPath.section == kFeedbackSection) {
if([MFMailComposeViewController canSendMail]) {
// fill out email
//...
MFMailComposeViewController *controller = [[MFMailComposeViewController alloc] init];
//MailCompose *controller = [[MailCompose alloc] init];
controller.mailComposeDelegate = self;
[[controller navigationBar] setTintColor:[UIColor oceanColor]];
[controller setToRecipients:[NSArray arrayWithObject:kFeedbackEmail]];
[controller setSubject:emailSubject];
[controller setMessageBody:emailBodyTemplate isHTML:NO];
[self presentModalViewController:controller animated:YES];
[controller release];
} else {
[UIAlertHelper mailErrorAlert];
}
} //...
}
#pragma mark -
#pragma mark MFMailComposeViewControllerDelegate methods
- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error {
[self dismissModalViewControllerAnimated:YES];
}
```
Commenting or non-commenting out the autorotation code in this class has no effect. holding the device upright and clicking on the row that loads the MFMailComposeViewControlleryeilds no problems, it loads upright, then it rotates just fine. However, loading the table view, holding it sideways and then tapping on the row with the MFMailComposeViewController loads the modal view controller as a blank screen:

This happens both in the simulator and the actual physical device.
Anyone know what's up? Thanks in advance!
|
MFMailComposeViewController Blank Screen When Opening in Landscape Mode
|
CC BY-SA 3.0
| null |
2011-05-25T03:37:29.460
|
2013-05-25T20:36:40.953
| null | null | 347,339 |
[
"objective-c",
"cocoa-touch",
"uitableview",
"ios4",
"messageui"
] |
6,119,340 | 1 | 6,119,385 | null | 1 | 506 |
I am using Turbo C, and I've some query about my code. I'm just perplexed... The program first asks for a list of numbers(you shouldn't type more than 20). As the user types in the numbers, they are placed in the array `list[]`. Once the user terminates the list by typing 0*(which is not placed on the list)*, the program then calls the `sort()` function, which sorts the values in the list. At the last part, which has a comment of `/*I AM NOW CONFUSED WITH THIS PART*/`, is the part where I need your help... Kindly help me out.

```
File Edit Run Compile Project Options Debug Break/watch
╒════════════════════════════════════ Edit ════════════════════════════════════╕
│ Line 1 Col 43 Insert Indent Tab Fill Unindent * C:NONAME.C │
│ │
│ #define MAXSIZE 20 /* size of buffter */ │
│ void sort(int[], int); /* prototype */ |
│ |
│ main() |
│ { |
│ static int list[MAXSIZE]; /* buffer for numbers */ |
│ int size = 0; /* size 0 before input */ |
│ int dex; /* index of array */ |
│ do /* get list of numbers */ |
│ { |
│ printf("Type number: "); |
│ scanf("%d", &list[size]); |
│ } |
│ while(list[size++] != 0); /* exit loop on 0 */ |
│ |
│ sort(list,--size); /* sort nubmers */ |
│ for(dex=0; dex<size; dex++) /* print sorted list */ |
│ printf("%d\n", list[dex]); |
│ |
│ getche(); |
│ } |
│ |
│ void sort(int list[], int size) |
│ { |
│ int out, in, temp; /* I AM NOW CONFUSED */ |
│ |
│ for(out=0; out<size-1; out++) /* IN THIS PART! */ |
│ for(in=out; in<size; in++) |
│ if(list[out] > list[in]) |
│ { |
│ temp=list[in]; |
| list[in]=list[out]; |
│ list[out]=temp; |
│ } |
│ } |
│ |
│ |
├─────────────────────────────────── Watch ────────────────────────────────────┤
│ │
└──────────────────────────────────────────────────────────────────────────────┘
F1-Help F5-Zoom F6-Switch F7-Trace F8-Step F9-Make F10-Menu NUM
```
|
Sorting an array Question
|
CC BY-SA 3.0
| null |
2011-05-25T03:51:43.890
|
2011-05-26T08:17:23.053
|
2011-05-26T08:17:23.053
| 661,719 | 661,719 |
[
"c"
] |
6,119,462 | 1 | null | null | 1 | 486 |
How could I archive this:

programmatically?
Is there a way of creating resource files with code?
|
add resourse files to project with code
|
CC BY-SA 3.0
| null |
2011-05-25T04:14:06.490
|
2011-05-25T06:52:19.817
| null | null | 637,142 |
[
"c#",
"reflection",
"resources"
] |
6,119,760 | 1 | 6,181,364 | null | 1 | 683 |
I have differential equations derived from epidemic spreading. I want to obtain the numerical solutions. Here's the equations,

t is a independent variable and ranges from `[0,100]`.
The initial value is
```
y1 = 0.99; y2 = 0.01; y3 = 0;
```
At first, I planned to deal these with ode45 function in matlab, however, I don't know how to express the series and the combination. So I'm asking for help here.
**
## The problem is how to express the right side of the equations as the odefun, which is a parameter in the ode45 function.
**
|
How to obtain the numerical solution of these differential equations with matlab
|
CC BY-SA 3.0
| null |
2011-05-25T05:01:33.930
|
2011-05-30T23:10:17.963
|
2011-05-25T13:59:00.747
| 480,028 | 480,028 |
[
"math",
"matlab",
"numerical",
"differential-equations"
] |
6,119,787 | 1 | null | null | 0 | 1,200 |
Is it possible to create a menu of this type in android?

|
Custom menu in android
|
CC BY-SA 3.0
| 0 |
2011-05-25T05:06:58.337
|
2011-05-25T05:19:51.177
|
2011-05-25T05:12:05.413
| 592,182 | 707,942 |
[
"android"
] |
6,119,997 | 1 | 6,120,167 | null | 1 | 417 |
Last week i started to develop an android app and almost done the coding part but the layout design for the app is too confusing...
The following is the design what i wanted,

Anyone please give me the coding part to create the design/layout. Thanks in advance...
|
Android view layout design help
|
CC BY-SA 3.0
| null |
2011-05-25T05:42:11.083
|
2011-05-25T06:01:27.320
| null | null | 274,585 |
[
"android",
"android-layout"
] |
6,120,100 | 1 | 6,120,119 | null | 7 | 7,509 |
I have two tables named as:
1. table_product
2. table_user_ownned_auction
### table_product
```
specific_product_id astatus ...
(primary_key,autoinc)
--------------------------------------
1 APAST ...
2 ALIVE ...
3 ALIVE ...
4 APAST ...
5 APAST ...
```
### table_user_ownned_auction
```
own_id specific_product_id details
----------------------------------------
1 1 XXXX
2 5 XXXX
```
I need to select `atatus = APAST`, and not in table 2.
Which means, in above structure table1 has 3 APAST status (1,4,5). But in table 2 specific_product_id (1,5) only stored so i need to select specific_product_id = 4
I used this query
```
SELECT *
FROM table_product
WHERE astatus = 'APAST'
AND specific_product_id NOT IN (SELECT specific_product_id
FROM table_user_ownned_auction )
```
...which takes this long:
> Query took 115.1039 sec
...to execute.
### EXPLAIN PLAN

How can i optimize it or any other way to select what i want?
|
mysql NOT IN QUERY optimize
|
CC BY-SA 3.0
| 0 |
2011-05-25T05:54:52.267
|
2016-08-05T11:03:25.767
|
2011-05-25T05:57:39.440
| 135,152 | 430,112 |
[
"mysql",
"sql",
"query-optimization"
] |
6,120,733 | 1 | 6,183,651 | null | 1 | 830 |
I had a local database used to connect with sql server authentication, every thing was perfectly working. i installed share point server 2010 standalone version in the machine and it created new sql server instance for SharePoint data and am able to connect to new share point instance.
The problem is now after installing SharePoint, i am unable to connect to the local database i was previously connecting without any problem.

please help me
Thanks,
Pradeep
|
unable to connect to local sql server database after SharePoint is installed
|
CC BY-SA 3.0
| null |
2011-05-25T07:06:05.330
|
2011-05-31T06:12:19.910
|
2011-05-25T07:13:51.783
| 366,947 | 366,947 |
[
"sql",
"sql-server-2008",
"sharepoint-2010"
] |
6,120,736 | 1 | 6,121,026 | null | 2 | 445 |
I'm trying to generate a trellis of some levelplots. Now I got 2 issues.
Here is some sampledata
```
library(lattice)
require(stats)
attach(environmental)
ozo.m <- loess((ozone^(1/3)) ~ wind * temperature * radiation,
parametric = c("radiation", "wind"), span = 1, degree = 2)
w.marginal <- seq(min(wind), max(wind), length.out = 50)
t.marginal <- seq(min(temperature), max(temperature), length.out = 50)
r.marginal <- seq(min(radiation), max(radiation), length.out = 4)
wtr.marginal <- list(wind = w.marginal, temperature = t.marginal,
radiation = r.marginal)
grid <- expand.grid(wtr.marginal)
grid[, "fit"] <- c(predict(ozo.m, grid))
levelplot(fit ~ wind * temperature | radiation, data = grid,
cuts = 10, region = TRUE,
xlab = "Wind Speed (mph)",
ylab = "Temperature (F)",
main = "Cube Root Ozone (cube root ppb)")
```
This will generate the following plot.
1)
I want the title of every plot not to be radiation, but the value of the radiation (e.g. 7,334,...)
2) I want to change the ticks from the x and y axis to letters instead of the current numbers. (instead of 5-10-15-20 I need E-J-O-T)
Can you guys point me (once again) in the right direction?
|
Correct names on trellis of levelplots
|
CC BY-SA 3.0
| null |
2011-05-25T07:06:51.920
|
2011-05-25T07:57:17.380
|
2011-05-25T07:50:24.727
| 717,132 | 717,132 |
[
"r",
"lattice"
] |
6,120,780 | 1 | 6,122,299 | null | 1 | 2,081 |
I want to display output like this:
For that used two sections. 1st one is for heading, 2nd for displaying the data, but in date column dates are dynamic b'cos it depends on the parsing data means no of row is depends upon that array.
So can anyone suggest me, how can I put multiple labels in single row for that following is my code: in
```
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
NSString *MyIdentifier = [NSString stringWithFormat:@"MyIdentifier %i", indexPath.row];
MyTableCell *cell = (MyTableCell *)[tableView dequeueReusableCellWithIdentifier:MyIdentifier];
if (cell == nil)
{
cell = [[[MyTableCell alloc] initWithFrame:CGRectZero reuseIdentifier:MyIdentifier] autorelease];
}
for (UIView * view in cell.contentView.subviews)
{
[view removeFromSuperview];
}
if (indexPath.section==0)
{
[cell addColumn:130];
label =[[[UILabel alloc] initWithFrame:CGRectMake(0.0, 0, 64.0, 45)] autorelease];
//label.tag = LABEL_TAG;
label.font = [UIFont boldSystemFontOfSize:12];
label.text = @"Date";//[NSString stringWithFormat:@"%d", indexPath.row];
label.textAlignment = UITextAlignmentCenter;
label.textColor = [UIColor blackColor];
label.backgroundColor=[UIColor brownColor];
label.autoresizingMask = UIViewAutoresizingFlexibleRightMargin |
UIViewAutoresizingFlexibleHeight;
[cell.contentView addSubview:label];
//[cell addColumn:200];
label1 =[[UILabel alloc] initWithFrame:CGRectMake(66, 0, 64.0, 45)] ;
//label1.tag = VALUE_TAG;
label1.font = [UIFont boldSystemFontOfSize:12];
// add some silly value
//label.text = [NSString stringWithFormat:@"%d", indexPath.row * 4];
label1.text = @"Gold";
label1.textAlignment = UITextAlignmentCenter;
label1.backgroundColor=[UIColor brownColor];
[cell.contentView addSubview:label1];
label2 =[[UILabel alloc] initWithFrame:CGRectMake(132.0, 0, 64, 45)] ;
//[cell addColumn:260];
label2.font = [UIFont boldSystemFontOfSize:12];
label2.text = @"Silver";
label2.textAlignment = UITextAlignmentCenter;
label2.backgroundColor=[UIColor brownColor];
[cell.contentView addSubview:label2];
label3 =[[UILabel alloc] initWithFrame:CGRectMake(198.0, 0, 62, 45)] ;
// [cell addColumn:350];
label3.font = [UIFont boldSystemFontOfSize:12];
label3.text =@"Bronze";
label3.textAlignment = UITextAlignmentCenter;
label3.backgroundColor=[UIColor brownColor];
[cell.contentView addSubview:label3];
label4 =[[UILabel alloc] initWithFrame:CGRectMake(262.0, 0, 61, 45)] ;
// [cell addColumn:350];
label4.font = [UIFont boldSystemFontOfSize:12];
label4.text =@"Avg Conf";
label4.textAlignment = UITextAlignmentCenter;
label4.backgroundColor=[UIColor brownColor];
[cell.contentView addSubview:label4];
}
else
{label5 = [[UILabel alloc] initWithFrame:CGRectMake(0.0, 0, 64.0, 150)];
label5.font = [UIFont boldSystemFontOfSize:12];
label5.numberOfLines=4;
label5.text = [arr objectAtIndex:indexPath.row];
label5.textAlignment = UITextAlignmentLeft;
label5.textColor = [UIColor blackColor];
label5.backgroundColor=[UIColor grayColor];
[cell.contentView addSubview:label5];
}
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
```

and outPut will appear according to 2nd image][1](https://i.stack.imgur.com/IAdPy.png)

|
How to manages multiple lable in single row but no. of cell in table view depends on array in iPhone SDK.
|
CC BY-SA 3.0
| null |
2011-05-25T07:11:36.653
|
2014-03-26T20:07:28.720
|
2014-03-26T20:07:28.720
| 3,275,134 | 519,679 |
[
"iphone",
"objective-c",
"ios",
"uitableview",
"uilabel"
] |
6,120,817 | 1 | 6,120,912 | null | 7 | 1,566 |
I would like to create an application that shows the history of disk usage.
I have already create a backend for geting data and now I would like to show this data in a line chart like this:

As you can see, I get date (DateTime) and usage (int) foreach disk.
My question:
I'm looking for a free solution that is easy to understand/use.
|
Silverlight Chart
|
CC BY-SA 3.0
| null |
2011-05-25T07:15:36.477
|
2012-07-22T12:58:49.017
|
2011-05-25T07:54:59.140
| 249,933 | 424,923 |
[
"c#",
"silverlight-4.0",
"charts"
] |
6,121,365 | 1 | 6,129,650 | null | 1 | 5,612 |
I'm using Jorn Zaefferer's Autocomplete query plugin, [http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/](http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/) and I wanted to add a button that will load all the elements the same as combobox.
So, I created a method that puts a div with image as background next to an input text:
```
var createDownArrow = function (input, request, options) {
var defaults = {
downArrowClass: 'autocomplete_DownArrow'
};
options = $.extend({}, defaults, options);
var offset = $(input).offset();
var width = typeof options.width == 'string' || options.width > 0 ? options.width : $(input).width();
var element = $('<div/>').addClass(options.downArrowClass).appendTo(document.body).
css({ position: 'absolute', top: offset.top, left: offset.left + width}).click(function () {
if (request && typeof request == 'function') {
request();
}
});
};
```
the input text has the following css:
```
border: 1px solid #888888;
height:15px;
font-weight: normal;
font-size: 12px;
font-family: Arial (Hebrew);
padding:0px;
margin:0xp;
```
this is the div css:
```
background-image:url(drop.jpg);
background-position:top right;
height:17px;
width:17px;
cursor:pointer;
```
and using this function on the input in the html:
```
<br /><br /><br /><br />
<input type="text" id="test" />
```
I get the result:

Which you can see is not the desire result.
How can I align the div next to the input? (I am using direction:rtl)
|
align div next to input
|
CC BY-SA 3.0
| null |
2011-05-25T08:05:50.403
|
2011-05-25T19:17:59.503
|
2011-05-25T09:29:05.403
| 289,246 | 289,246 |
[
"javascript",
"jquery",
"html",
"css"
] |
6,121,546 | 1 | null | null | 6 | 923 |
I want to embed a OneNote alike text editor into my program, so that I can easily rearrange paragraphs by drag & drop.

Any (open source) text editor control that can do this?
Thanks.
|
WPF: Text editor control that can rearrange paragraphs by drag & drop (like OneNote)
|
CC BY-SA 3.0
| 0 |
2011-05-25T08:25:58.763
|
2011-07-04T02:44:36.110
| null | null | null |
[
"wpf",
"mvvm",
"textbox",
"wpf-controls",
"text-editor"
] |
6,121,641 | 1 | 6,132,734 | null | 1 | 1,192 |
I have a problem with drawing. I have a frame with one button. Using the mouse, I draw a transculent rectangle. But I have a small problem, because when drawing this rectangle, it is drawing behind the button and I want this rectangle to be over the button.
This is a screenshot:

And this is the code:
```
package draw;
import java.awt.*;
import java.awt.event.*;
import java.util.ArrayList;
import java.util.List;
import javax.swing.*;
import javax.swing.event.*;
public class Selection extends JPanel
implements ChangeListener {
/**
*
*/
private static final long serialVersionUID = 1L;
private static final int WIDE = 640;
private static final int HIGH = 640;
private List<Node> nodes = new ArrayList<Node>();
private Point mousePt = new Point(WIDE / 2, HIGH / 2);
private Rectangle mouseRect = new Rectangle();
private boolean selecting = false;
public static void main(String[] args) throws Exception {
EventQueue.invokeLater(new Runnable() {
public void run() {
JFrame f = new JFrame("GraphPanel");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Selection gp = new Selection();
f.add(new JScrollPane(gp), BorderLayout.CENTER);
f.pack();
f.setVisible(true);
}
});
}
Selection() {
JButton but=new JButton("Button");
add(but);
this.setPreferredSize(new Dimension(WIDE, HIGH));
this.addMouseListener(new MouseHandler());
this.addMouseMotionListener(new MouseMotionHandler());
}
@Override
public void paintComponent(Graphics g) {
g.setColor(new Color(0x00f0f0f0));
g.fillRect(0, 0, getWidth(), getHeight());
g.setColor(Color.BLACK);
((Graphics2D) g).setComposite(AlphaComposite.getInstance(rule, alpha));
g.fillRect(mouseRect.x, mouseRect.y,
mouseRect.width, mouseRect.height);
g.drawRect(mouseRect.x, mouseRect.y,
mouseRect.width, mouseRect.height);
}
int rule = AlphaComposite.SRC_OVER;
float alpha = 0.85F;
private class MouseHandler extends MouseAdapter {
@Override
public void mouseReleased(MouseEvent e) {
selecting = false;
mouseRect.setBounds(0, 0, 0, 0);
if (e.isPopupTrigger()) {
}
e.getComponent().repaint();
}
@Override
public void mousePressed(MouseEvent e) {
mousePt = e.getPoint();
Node.selectNone(nodes);
selecting = true;
e.getComponent().repaint();
}
}
private class MouseMotionHandler extends MouseMotionAdapter {
@Override
public void mouseDragged(MouseEvent e) {
if (selecting) {
mouseRect.setBounds(
Math.min(mousePt.x, e.getX()),
Math.min(mousePt.y, e.getY()),
Math.abs(mousePt.x - e.getX()),
Math.abs(mousePt.y - e.getY()));
}
e.getComponent().repaint();
}
}
/** A Node represents a node in a graph. */
private static class Node {
private Color color;
private boolean selected = false;
private Rectangle b = new Rectangle();
/** Draw this node. */
public void draw(Graphics g) {
g.setColor(this.color);
if (selected) {
g.setColor(Color.darkGray);
g.drawRect(b.x, b.y, b.width, b.height);
}
}
/** Mark this node as slected. */
public void setSelected(boolean selected) {
this.selected = selected;
}
/** Select no nodes. */
public static void selectNone(List<Node> list) {
for (Node n : list) {
n.setSelected(false);
}
}
}
@Override
public void stateChanged(ChangeEvent arg0) {
// TODO Auto-generated method stub
}
}
```
How can I solve this problem?
|
Java Swing and drawing problem
|
CC BY-SA 3.0
| 0 |
2011-05-25T08:34:42.320
|
2012-06-26T06:41:10.833
|
2012-06-26T06:41:10.833
| 714,968 | 705,544 |
[
"java",
"swing",
"jbutton",
"paintcomponent"
] |
6,121,676 | 1 | 6,121,704 | null | -1 | 972 |
```
<form>
Last Name
<input name="lastname" type="text"/><br/>
First Name
<input name="firstname" type="text"/><br/>
Middle Name
<input name="middlename" type="text"/><br/>
</form>
```
I know there are so many php libraries for this but my pdf file so much complicated
i.e for storing suppose first name of HTML form to pdf I have so many small small text boxes in pdf
but In HTML form I have only one text box for first name.
How should I do that.
This is the sample pdf image

[http://img21.imageshack.us/img21/4793/testpdf.jpg](http://img21.imageshack.us/img21/4793/testpdf.jpg)
|
Writing HTML Form values in pdf file using PHP
|
CC BY-SA 3.0
| null |
2011-05-25T08:37:40.440
|
2011-11-29T04:45:13.443
|
2011-11-29T04:45:13.443
| 234,976 | 762,381 |
[
"php"
] |
6,121,735 | 1 | 6,121,806 | null | 1 | 2,226 |
I have a repeater inside an Update Panel. when I click the button repeater is modified according to the query.
What I want is to get the value of the DropDown when I click Button. But I can't get the value, instead the UpdatePanelAnimationExtender runs again. I added another button () inside the Update Panel. The UpdatePanelAnimationExtender runs when I click that button also.
My question is how can restrict the update panel only to the button? and how can I retrieve the value of DropDown outside the update panel? I added to conditional but it also not working.

aspx page
```
<p>Search by Author</p>
<asp:TextBox ID="txtAuthor" runat="server" Text="" AutoComplete="off" /><br />
<p>Search by Publisher</p>
<asp:TextBox ID="txtPublisher" runat="server" Text="" AutoComplete="off" /><br />
<asp:Button ID="btnFind" runat="server" Text="Find Books" OnClick="BtnFind_Click" />
<br />
<p>Search by Price</p>
<asp:RadioButtonList ID="RadioButtonList1" runat="server">
<asp:ListItem Text="Below Rs. 1000.00"></asp:ListItem>
<asp:ListItem Text="Between Rs. 1001 to 2500"></asp:ListItem>
<asp:ListItem Text="Above Rs. 2501.00"></asp:ListItem>
</asp:RadioButtonList>
<br />
<asp:TextBox ID="txtTest" runat="server"></asp:TextBox>
<asp:Button ID="Button2" runat="server" Text="Button"
onclick="Button1_Click" />
<asp:UpdatePanel ID="udpBooks" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:Button ID="btnTest" runat="server" Text="Testing Button" onclick="Button1_Click" />
<asp:Repeater ID="repBooks" runat="server" DataSourceID="SqlDataSource1"
onitemcommand="repBooks_ItemCommand">
<HeaderTemplate>
</HeaderTemplate>
<ItemTemplate>
<div id="bookBorder">
<table width="640px" height="70px" border="0">
<tr>
<td width="51%" style="padding-top: -20px">
<span class="title">Description:</span> :
<%# DataBinder.Eval(Container.DataItem, "description")%>
</td>
<td>
<asp:DropDownList ID="DropDownList2" CssClass="dropDown" runat="server" Width="100px">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
</asp:DropDownList>
<br />
<asp:Button ID="btnAddToCart" CssClass="button" runat="server" Text="Add to Cart"
OnClick="BtnAddToCart_Click" />
</td>
</tr>
</table>
</div>
<br />
</ItemTemplate>
</asp:Repeater>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnFind" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
<asp:UpdatePanelAnimationExtender ID="upae1" runat="server" TargetControlID="udpBooks">
<Animations>
<OnUpdating>
<Parallel Duration="0">
<EnableAction AnimationTarget="btnFind" Enabled="false" />
<FadeOut MinimumOpacity=".5" />
</Parallel>
</OnUpdating>
<OnUpdated>
<Parallel Duration="0">
<FadeIn MinimumOpacity=".8" />
<EnableAction AnimationTarget="btnFind" Enabled="true" />
</Parallel>
</OnUpdated>
</Animations>
</asp:UpdatePanelAnimationExtender>
```
Code Behind
```
public partial class Default3 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void SqldsOrderDetails_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
{
string author = txtAuthor.Text;
string publisher = txtPublisher.Text;
string select = "";
if (author.Equals("") && publisher.Equals(""))
select = "select bookId, ISBN, Title, publisher, author, price, description from dbo.[book]";
else if(author.Equals("") && !publisher.Equals(""))
select = "select bookId, ISBN, Title, publisher, author, price, description from dbo.[book] where publisher=@publisher ";
else if(!author.Equals("") && publisher.Equals(""))
select = "select bookId, ISBN, Title, publisher, author, price, description from dbo.[book] where author=@author";
else if(!author.Equals("") && !publisher.Equals(""))
select = "select bookId, ISBN, Title, publisher, author, price, description from dbo.[book] where author=@author and publisher=@publisher";
SqlDataSource1.SelectCommand = select;
e.Command.Parameters.Add(new SqlParameter("@author", this.txtAuthor.Text));
e.Command.Parameters.Add(new SqlParameter("@publisher", this.txtPublisher.Text));
}
protected void BtnFind_Click(object sender, EventArgs e)
{
System.Threading.Thread.Sleep(2000);
// this.gvOrderDetails.DataBind();
this.repBooks.DataBind();
}
protected void ul_Click(object sender, EventArgs e)
{
Response.Redirect("default.aspx");
}
protected void BtnAddToCart_Click(object sender, EventArgs e)
{
txtTest.Text = "sd";
}
protected void Button1_Click(object sender, EventArgs e)
{
txtTest.Text = "sd";
}
protected void repBooks_ItemCommand(object source, RepeaterCommandEventArgs e)
{
DropDownList d = e.Item.FindControl("DropDownList2") as DropDownList;
txtTest.Text = d.SelectedValue;
Button b= e.Item.FindControl("btnAddToCart") as Button;
b.Text = d.SelectedValue;
}
}
```
|
Cannot get value of UpdatePanel element
|
CC BY-SA 3.0
| null |
2011-05-25T08:44:31.913
|
2011-05-25T09:16:48.103
|
2011-05-25T09:16:48.103
| 340,046 | 340,046 |
[
"asp.net",
"updatepanel",
"repeater"
] |
6,121,797 | 1 | 6,121,936 | null | 25 | 163,682 |
I have to following code for selecting layout on button click.
```
View.OnClickListener handler = new View.OnClickListener(){
public void onClick(View v) {
switch (v.getId()) {
case R.id.DownloadView:
// doStuff
setContentView(R.layout.main);
break;
case R.id.AppView:
// doStuff
setContentView(R.layout.app);
break;
}
}
};
findViewById(R.id.DownloadView).setOnClickListener(handler);
findViewById(R.id.AppView).setOnClickListener(handler);
```
When I click the "AppView" button, the layout changes, but when I click the "DownloadView "button, nothing happens.
[This link](https://i.stack.imgur.com/XTAhV.jpg) says that I have to start a new activity.
But I don't know how to use the code there of intent to start new activity, will a new file be added?
```
package com.example.engagiasync;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;
public class AppView extends Activity implements OnClickListener{
@Override
public void onCreate(Bundle savedInstanceState){
setContentView(R.layout.app);
TextView tv = (TextView) this.findViewById(R.id.thetext);
tv.setText("App View yo!?\n");
}
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
}
}
```

|
android: how to change layout on button click?
|
CC BY-SA 3.0
| 0 |
2011-05-25T08:50:08.107
|
2017-11-17T09:15:36.827
|
2014-05-02T10:46:04.007
| 759,866 | 827,530 |
[
"java",
"android",
"android-intent",
"android-activity"
] |
6,121,840 | 1 | 6,121,886 | null | 0 | 776 |
I want to have a Hierarchical Data in select box with php:

But when I use [optgroup](http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_optgroup), the `<optgroup>` couldnt have a value.
Is there any way to have a Hierarchical Data like this image?
Thanks in advance
|
Categories and subcategories in optgroup
|
CC BY-SA 3.0
| null |
2011-05-25T08:53:58.183
|
2011-05-25T12:44:05.793
| null | null | 677,052 |
[
"php",
"html",
"optgroup"
] |
6,121,874 | 1 | 6,121,967 | null | 0 | 63 |

I was running the instrument on device not on simulator.
|
How can i remove these leaks? I have attached snapshot
|
CC BY-SA 3.0
| 0 |
2011-05-25T08:56:52.460
|
2011-05-25T09:04:52.373
| null | null | 651,046 |
[
"iphone",
"xcode",
"memory-leaks"
] |
6,121,864 | 1 | 6,123,599 | null | -1 | 86 |
ms sql server 2008

```
SELECT Action.*
FROM Mailing
INNER JOIN ActionCategoryMailingBunch
ON Mailing.MailingID = ActionCategoryMailingBunch.MailingID
INNER JOIN ActionCategory
ON ActionCategoryMailingBunch.ActionCategoryID =
ActionCategory.ActionCategoryID
INNER JOIN Action
ON ActionCategory.ActionCategoryID = Action.ActionCategoryID
WHERE ( Mailing.MailingID = 7 )
AND ( Mailing.MailingID NOT IN (SELECT MailingID
FROM MailingReport) )
AND ( Action.ActionID NOT IN (SELECT ActionID
FROM MailingReport) )
AND ( ActionCategoryMailingBunch.MailingBunchStatusID = 4 )
```
especially this block
```
(Mailing.MailingID NOT IN (SELECT MailingID FROM MailingReport))
AND (Action.ActionID NOT IN (SELECT ActionID FROM MailingReport))
```
|
optimize this query
|
CC BY-SA 3.0
| null |
2011-05-25T08:56:10.317
|
2012-12-07T00:17:41.963
|
2012-12-07T00:17:41.963
| 1,845,869 | 266,644 |
[
"sql-server-2008",
"query-optimization"
] |
6,122,014 | 1 | 6,122,067 | null | 4 | 1,024 |
I'm trying to access an element in MS CRM 2011 with the following id:
account|NoRelationship|Form|B_GenerateInvoice-Large
I can see this element in the IE developer tools:

Unfortunately I always get null when trying to find this element.
I've tried the following:
```
alert(document.getElementById('account|NoRelationship|Form|B_GenerateInvoice-Large'));
alert($("[id='account|NoRelationship|Form|B_GenerateInvoice-Large]").html());
alert($(jq("account|NoRelationship|Form|B_GenerateInvoice-Large")).html()); // jq() adds the '#' and escapes special characters
alert($("#account|NoRelationship|Form|B_GenerateInvoice-Large").html());
alert(document.getElementById("#account\\|NoRelationship\\|Form\\|B_GenerateInvoice-Large"));
alert($("#account\\|NoRelationship\\|Form\\|B_GenerateInvoice-Large").html());
```
These all fail to find the element.
Am I missing something obvious here?
The javascript was inside an iframe while the element was outside of the iframe..
I did not manage to solve it.
|
javascript/jQuery can't find element with messed up id
|
CC BY-SA 3.0
| null |
2011-05-25T09:08:46.263
|
2011-06-07T09:39:37.207
|
2020-06-20T09:12:55.060
| -1 | 72,859 |
[
"javascript",
"jquery",
"jquery-selectors",
"dynamics-crm-2011"
] |
6,122,294 | 1 | null | null | 1 | 788 |
I opened a project yesterday via Open From Subversion
I accidentally saved the project to C:\Users\blahblah....
I then immediately closed the project, and Opened From Subversion again, saving it to the correct directory.
Now I'm trying to commit the changes I made since opening the correct project and I'm getting this message:

Is there a risk that I can screw things up if I deselect C:\etc and instead select D:\etc and commit that?
There are no changes to the C:\ project. Also, I now have to merge the changes from yesterday into another branch.
|
Getting a "Commit from Multiple Working Copies" message.. not sure what to do?
|
CC BY-SA 3.0
| null |
2011-05-25T09:33:35.083
|
2011-05-25T11:18:05.223
| null | null | 181,771 |
[
"visual-studio",
"visual-studio-2010",
"svn",
"ankhsvn"
] |
6,122,389 | 1 | 6,122,449 | null | 3 | 1,986 |
(sony pictures app)
I need to implement carousel view for my ipad.I am searching through this forum and some websites.Many of them post coverflow view.If anybody implements carousel view please guides me..
|
Carousel view for ipad
|
CC BY-SA 3.0
| 0 |
2011-05-25T09:41:47.977
|
2011-06-02T09:47:27.287
|
2011-06-02T09:47:27.287
| 730,705 | 730,705 |
[
"iphone",
"objective-c",
"carousel"
] |
6,122,392 | 1 | 6,122,658 | null | 1 | 10,496 |
I have created my grid and would like to use default behaviour of the grid to delete a row.
This is my grid setup code:
```
$("#grid").jqGrid('navGrid', '#grid_pager',
{ add: true, addtitle: 'Add Customer',
edit: true, edittitle: 'Edit Customer',
del: true, deltitle: 'Delete Customer',
refresh: true, refreshtitle: 'Refresh data',
search: true, searchtitle: 'Advanced search filters',
addfunc: addReferent, editfunc: editReferent
},
{}, // default settings for edit
{}, // default settings for add
{ // define settings for Delete
mtype: "post",
reloadAfterSubmit: true,
url: wsBaseUrl + 'CustomerService.asmx/DeleteCustomer',
resize: false,
serializeDelData: function(postdata) {
return JSON.stringify({ customerID: postdata.id });
}
},
{ // define settings for search
closeOnEscape: true, multipleSearch: true, closeAfterSearch: true
},
{}
);
```
and this is the web service method defined on the server
```
[WebMethod]
public OperationResult Deletecustomer(string customerID)
{
}
```
but unfortunately when I click the delete button and click ok on the confirm window I get an error saying 404. as in the following picture

What am I doing wrong?
I have added the following code to my jqGrid Initialization
```
// Set defaults value for jqGrid
$.jgrid.defaults = $.extend($.jgrid.defaults, {
mtype: 'post',
datatype: 'json',
jsonReader: {
root: "d.Rows",
page: "d.Page",
total: "d.Total",
records: "d.Records",
repeatitems: false,
userdata: "d.UserData",
id: "Id"
},
ajaxGridOptions: { contentType: 'application/json; charset=utf-8' },
serializeGridData: function (postData) {
return JSON.stringify(postData);
},
ajaxDelOptions: { contentType: 'application/json; charset=utf-8' },
serializeDelData: function (postData) {
return JSON.stringify(postData);
},
loadui: "block",
multiboxonly: true,
rowNum: 25,
rowList: [25, 50, 100],
altRows: true,
altclass: 'ui-priority-secondary',
autoencode: true,
autowidth: true,
rownumbers: true,
rownumWidth: 30,
gridview: true,
hoverrows: true,
viewrecords: true
});
```
but I still get the same error...
|
jqGrid Delete a Row
|
CC BY-SA 3.0
| null |
2011-05-25T09:41:55.147
|
2011-05-25T10:36:23.153
|
2011-05-25T10:36:23.153
| 431,537 | 431,537 |
[
"jquery",
"asp.net",
"jquery-plugins",
"jqgrid"
] |
6,122,472 | 1 | null | null | 1 | 507 |
I've developed a webpart that presents a strange behaviour. When I load the page where is installed sometimes it works correctly and sometimes it crashes, but I can't find any pattern (seems random to me).
When I debugged it I saw that have two threads of execution. (The cursor of debug always passes two times over every function in separated threads). How can it be?
I want that only be one thread, and I also suspect that this could be the source of the random crash. Any idea where start to find this error?
EDIT:
Added the two screenshots with the debug


|
Sharepoint webpart multithread when debugging?
|
CC BY-SA 3.0
| null |
2011-05-25T09:48:07.500
|
2011-06-01T15:07:27.727
|
2011-05-26T10:26:57.263
| 674,887 | 674,887 |
[
"multithreading",
"visual-studio-2010",
"sharepoint",
"sharepoint-2010",
"web-parts"
] |
6,122,543 | 1 | 6,124,278 | null | 0 | 89 |
I am not able to validate my IPhone App
It is giving erroe as shown below

what could be the problem?
|
IPhone App : not able to validate
|
CC BY-SA 3.0
| null |
2011-05-25T09:53:24.107
|
2011-05-25T12:12:26.683
| null | null | 531,783 |
[
"iphone",
"objective-c",
"cocoa-touch",
"ios4",
"xcode4"
] |
6,122,631 | 1 | 6,233,527 | null | 0 | 192 |
I have a ListView, and I want to customize the layout of each item in the list so that it has a button on the right and a section to the left of the button that has multiple words that are TextViews (i.e. each TextView in the left hand side will be of one word). Here's a picture of what I mean:

Right now I have been able to successfully get the ButtonImage where I want it (with a defined width of 40dp). If I simply put the TextViews in a RelativeLayout, I noticed they stack on top of each other, so I added "android:layout_toRightOf"s in each of the TextViews accordingly. Obviously, this means that I will never have words below each other. I have set up the left side of this layout such that it has padding of 40dp to the right of it (so the TextViews weren't going behind the button or colliding into it). What happens is the TextViews will line up perfectly at the top and then the last few that can't squeeze in will expand vertically to fill the left box side. I would like to have the left box area (with the TextViews) set up such that, if a TextView is going to hit the right wall (technically the 40dp padding from the parent's right wall), it will be moved down and all the way to the left so the words read like a book. Also note that there will be anywhere from 1-5 TextViews (words) in this left hand side for any given item in the ListView. I'm pretty sure that, if I can get my layout the way I want it, I will never have to worry about the left hand side stacking higher than the button image (which would be an easily solvable problem anyhow). Here's my code:
```
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:paddingRight="40dp"
android:id="@+id/kwds"
>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/first"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/second"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/first"
/>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/third"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/second"
/>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fourth"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/third"
/>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fifth"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/fourth"
/>
</RelativeLayout>
<ImageButton android:id="@+id/bkmbtn"
android:src="@drawable/bkbtn"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
>
</ImageButton>
</RelativeLayout>
```
Before you guys ask, yes there really is a need to have a TextView per word (unfortunately ). If anything is unclear, let me know. And thank you for any help you can offer me! I really hope this is possible.
|
Realign TextViews If Expands Past Container
|
CC BY-SA 3.0
| null |
2011-05-25T10:00:32.327
|
2011-06-03T23:15:08.193
|
2011-05-25T10:13:55.570
| 69,802 | 696,130 |
[
"android",
"android-layout"
] |
6,122,796 | 1 | 6,122,834 | null | 6 | 3,158 |
I'm writing a winforms application and I need to create a view simliar to this one:

Any suggestion how to do it? perhaps it would be easier using WPF?
I thought about drawing rectangles or some sort of a table. Is there any open source control that can do it more easily?
|
Winforms\WPF - How to create flow chart alike graphic
|
CC BY-SA 3.0
| null |
2011-05-25T10:13:33.193
|
2011-05-25T10:16:18.643
| null | null | 150,826 |
[
".net",
"wpf",
"winforms",
"graphics",
"charts"
] |
6,122,954 | 1 | 6,123,010 | null | 1 | 40 |

I think it is a very basic question.Some xib,plist look like a group((see this pic arrow on left)mainwindow.xib,icarouselexampleviewcontroller).New.xib file is normal.
what is the difference between this two?
where to use?
what is en?
How to create them?
|
Why do some XIBs appear to be groups containing other files, and what is the purpose of those files
|
CC BY-SA 3.0
| null |
2011-05-25T10:25:32.933
|
2011-08-20T22:30:28.663
|
2011-08-20T22:30:28.663
| 119,717 | 730,705 |
[
"iphone",
"objective-c"
] |
6,123,246 | 1 | null | null | 0 | 190 |
If you can read the Headings ... one's called JWT, the other Alela Diane.. how do I get "Alela Diane" to fill up the space between them ( no puns intended )
The CSS property for these div's is set to display: inline-block.

The HTML - >
```
<div id="shastra_display">
<div class="shastra_post">
There are multiple div's like this containing the Alela Diane's and JWT's etc.
</div>
</div>
```
The CSS - >
```
#shastra_display
{
width: 880px;
}
#shastra_display div
{
display: inline-block;
vertical-align: text-top;
}
.shastra_post
{
width: 270px;
background-color: light-grey;
}
```
|
How to achieve float: top in CSS/HTML
|
CC BY-SA 3.0
| null |
2011-05-25T10:48:06.230
|
2012-05-31T13:02:44.640
|
2012-05-31T13:02:44.640
| 215,068 | 723,343 |
[
"html",
"css"
] |
6,123,618 | 1 | 6,124,158 | null | 2 | 5,217 |
So I want to now if that possible for .NET languages to ignore error without using try catch construction ?
I can ignore warring with #nowarring 40 for example, can I ignore error ?
Why I want it ?
simply wanted to call system pause with this way
```
open System.Runtime.InteropServices
[<DllImport(@"msvcrt.dll")>]
extern void system(string str)
system "pause"
```
but got Error message
> unbalanced stack. This is probably
because the managed PInvoke signature
does not match the unmanaged target
signature. Make sure that the calling
convention and parameters of the
PInvoke signature match the target
unmanaged signature.
So I don't care, it works. But can I just ignore this error ? without doing weird stuff like that :
```
try (system "pause") catch |_->()
```
Ok , I solved my problem by adding CallingConvention=CallingConvention.Cdecl, but what the question was about skipping exceptions, so and I still don't know if I can do it.
So maybe I need to tell some real reason to not be down-voted hard - sometimes it's matters for program to live even with hard errors occupations, but even sometimes you don't need to catch them. You need just ignore them...
off topic : proof image about using void instead of int :

|
Can I ignore error without using try catch()?
|
CC BY-SA 3.0
| 0 |
2011-05-25T11:19:43.630
|
2015-08-27T19:02:35.733
|
2011-05-25T11:45:37.123
| 238,232 | 238,232 |
[
"c#",
".net",
"vb.net",
"f#"
] |
6,123,724 | 1 | null | null | 0 | 1,886 |
While creating the website I choose Location as HTTP and then provided [http://172.24.17.188/myProject](http://172.24.17.188/myProject) and it created the project happily.
And I was able to run the project too. But once I have closes the VS2008 and reopened the project , I am getting the following error while trying to run the website.

I am able to browse the website by manually typing in browser but unable to run or debug usinh VS2008.
|
Unable to Start Debugging on the WebServer
|
CC BY-SA 3.0
| null |
2011-05-25T11:26:46.000
|
2011-05-25T12:11:52.097
|
2011-05-25T11:40:28.223
| 291,224 | 291,224 |
[
"c#",
".net",
"asp.net",
"visual-studio-2008",
"windows-xp"
] |
6,123,853 | 1 | null | null | 2 | 512 |
We are testing our app running on IBM portal server in the Linux box but found that the "free" values of vmstat are decreasing steadily, even after the test. By looking at top, the "VIRT" values are also increasing steadily. By monitoring Java app heap usage, the initial heap size (1.5G) was never reached, and the usage was rising slowly and steadily (with minor rises/drops within the test period) from 6xxm to about 1g until the test ended. When the test just ended, it dropped by a large amount back to about 6XXm. My questions are:
1. Is the result normal and OK?
2. Is the app heap usage behaviour OK?
3. Is it normal that the "free" values of vmstat are decreasing steadily and "VIRT" values of top are increasing steadily without drop after the test?
Below are top and vmstat output:
```
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
14157 user01 17 0 2508m 1.2g 47m S 16.0 23.3 11:38.94 java
14157 user01 17 0 2508m 1.2g 47m S 16.9 23.3 11:49.08 java
14157 user01 17 0 2508m 1.2g 47m S 15.8 23.4 11:58.58 java
14157 user01 17 0 2509m 1.2g 47m S 13.0 23.5 12:06.36 java
14157 user01 17 0 2509m 1.2g 47m S 17.6 23.5 12:16.92 java
14157 user01 17 0 2509m 1.2g 47m S 16.9 23.6 12:27.09 java
14157 user01 17 0 2510m 1.2g 47m S 16.1 23.6 12:36.73 java
14157 user01 17 0 2510m 1.2g 47m S 14.5 23.7 12:45.43 java
...
14157 user01 17 0 2514m 1.2g 47m S 15.9 24.6 15:20.18 java
14157 user01 17 0 2514m 1.2g 47m S 16.2 24.6 15:29.88 java
14157 user01 17 0 2514m 1.2g 47m S 16.1 24.7 15:39.56 java
14157 user01 17 0 2515m 1.2g 47m S 19.5 24.7 15:51.28 java
14157 user01 17 0 2516m 1.2g 47m S 11.4 24.8 15:58.11 java
14157 user01 17 0 2515m 1.2g 47m S 14.7 24.8 16:06.91 java
14157 user01 17 0 2515m 1.2g 47m S 16.0 24.9 16:16.51 java
14157 user01 17 0 2515m 1.2g 47m S 16.1 24.9 16:26.15 java
14157 user01 17 0 2515m 1.2g 47m S 14.7 25.0 16:34.96 java
14157 user01 17 0 2516m 1.2g 47m S 11.8 25.0 16:42.03 java
...
14157 user01 17 0 2517m 1.3g 47m S 13.1 25.6 18:18.04 java
14157 user01 17 0 2517m 1.3g 47m S 17.8 25.6 18:28.75 java
14157 user01 17 0 2516m 1.3g 47m S 15.2 25.7 18:37.85 java
14157 user01 17 0 2517m 1.3g 47m S 13.5 25.7 18:45.93 java
14157 user01 17 0 2516m 1.3g 47m S 14.6 25.8 18:54.70 java
14157 user01 17 0 2517m 1.3g 47m S 14.6 25.8 19:03.47 java
14157 user01 17 0 2517m 1.3g 47m S 15.3 25.9 19:12.67 java
14157 user01 17 0 2517m 1.3g 47m S 16.6 25.9 19:22.64 java
14157 user01 17 0 2517m 1.3g 47m S 15.0 26.0 19:31.65 java
14157 user01 17 0 2517m 1.3g 47m S 12.4 26.0 19:39.09 java
...
14157 user01 17 0 2530m 1.4g 47m S 0.0 27.5 23:23.91 java
procs -----------memory---------- ---swap-- -----io---- -system-- -----cpu------
r b swpd free buff cache si so bi bo in cs us sy id wa st
1 0 2004 702352 571508 1928436 0 0 0 54 287 413 1 1 98 0 0
0 0 2004 702368 571528 1928416 0 0 0 12 280 379 0 0 100 0 0
...
24 0 2004 673988 572504 1948000 0 0 0 440 760 751 16 6 78 0 0
0 0 2004 671352 572540 1951048 0 0 0 477 1180 830 19 7 74 0 0
0 0 2004 674756 572572 1946904 0 0 0 380 604 650 13 3 84 0 0
1 0 2004 694208 572612 1928360 0 0 0 222 518 599 7 2 91 0 0
16 0 2004 692068 572640 1929360 0 0 0 539 1075 850 24 7 69 0 0
0 0 2004 689036 572680 1931376 0 0 0 292 978 781 14 6 81 0 0
...
0 0 2004 530432 579120 2007176 0 0 0 453 511 712 18 4 78 0 0
0 0 2004 528440 579152 2008172 0 0 0 200 436 652 10 2 87 0 0
0 0 2004 524352 579192 2010188 0 0 0 401 514 779 17 6 76 0 0
0 0 2004 524964 578208 2012200 0 0 0 514 475 696 15 3 82 0 0
0 0 2004 522484 578260 2013176 0 0 0 416 488 699 15 3 82 0 0
2 0 2004 521264 578300 2015192 0 0 0 368 501 728 14 5 80 0 0
0 0 2004 518400 578340 2016180 0 0 0 404 452 647 14 3 84 0 0
25 0 2004 517064 578368 2018208 0 0 0 414 497 752 15 3 82 0 0
...
0 0 2004 499312 578820 2029064 0 0 0 351 459 660 13 3 84 0 0
0 0 2004 496228 578872 2031068 0 0 0 260 473 701 15 5 80 0 0
0 0 2004 501360 578912 2026916 0 0 0 500 398 622 9 3 88 0 0
1 0 2004 499260 578948 2027908 0 0 0 262 436 638 13 2 85 0 0
1 0 2004 497964 578984 2028900 0 0 0 276 452 628 15 3 82 0 0
0 0 2004 497492 579024 2029888 0 0 0 200 384 548 7 2 91 0 0
0 0 2004 496620 579044 2030896 0 0 0 172 393 586 9 2 89 0 0
...
1 0 2004 357876 566000 2104592 0 0 0 374 510 736 18 6 76 0 0
23 0 2004 358544 566032 2105588 0 0 0 362 456 644 12 3 85 0 0
0 0 2004 376332 566084 2087032 0 0 0 353 441 614 13 3 84 0 0
0 0 2004 375888 566120 2088024 0 0 0 220 411 620 10 2 88 0 0
0 0 2004 375280 566156 2087988 0 0 0 224 408 586 7 2 91 0 0
16 0 2004 373092 566188 2090012 0 0 0 233 494 723 12 3 85 0 0
2 0 2004 369564 566236 2090992 0 0 0 455 475 714 14 5 80 1 0
...
r b swpd free buff cache si so bi bo in cs us sy id wa st
1 0 2004 235156 572776 2155384 0 0 0 8 282 396 0 0 100 0 0
0 0 2004 235132 572796 2155364 0 0 0 24 291 435 0 0 100 0 0
1 0 2004 234780 572828 2155332 0 0 0 101 292 474 1 5 94 0 0
0 0 2004 234804 572844 2155316 0 0 0 45 288 451 0 1 99 0 0
0 0 2004 234852 572856 2155304 0 0 0 12 283 409 0 0 100 0 0
```
Heap Usage:

|
load test memory problem
|
CC BY-SA 3.0
| null |
2011-05-25T11:37:19.037
|
2021-07-29T14:59:38.127
|
2021-07-29T14:59:38.127
| 5,459,839 | 769,479 |
[
"java",
"linux",
"memory",
"native",
"heap-memory"
] |
6,123,966 | 1 | null | null | 8 | 6,988 |
How do I configure the distance between edges and nodes (red), i.e. the outer shape of a node(blue)?

|
Distance between edges and nodes in graphviz
|
CC BY-SA 3.0
| 0 |
2011-05-25T11:47:12.677
|
2020-08-15T20:42:02.720
|
2017-02-08T14:32:16.863
| -1 | 35,070 |
[
"graphviz",
"dot"
] |
6,124,254 | 1 | 6,124,311 | null | 0 | 142 |
I have a loop in one of my views to display a table like so: 
Each category object has 5 attributes called: level_1, level_2, level_3, level_4, level_5.
There will be an array with all the category objects. so there could be any amount of categories and no necessarily 3.
what would the best way to draw this up be? i have something like this at the moment but dont know how to select the relevant category level attribute in the 5.times loop.
```
<table border="0">
<tr>
<th>Maturity</th>
<% for category in @categories %>
<th><%= category.category_title %></th>
<% end %>
</tr>
<% 5.times do |i|%>
<% level = 5 - i %>
<tr>
<td>Level <%= level %> Maturity</td>
<% for category in @categories %>
<td><%= category.level_ #put in the level value here so it selects the relevant attraibute %></td>
<% end %>
</tr>
<% end %>
</table>
```
|
Rails 3: retrieving different attribute depending on loop count?
|
CC BY-SA 3.0
| null |
2011-05-25T12:10:31.173
|
2011-05-25T12:51:27.690
| null | null | null |
[
"ruby-on-rails"
] |
6,124,374 | 1 | null | null | 3 | 1,139 |
I have a Windows (XP/Vista/7) application implemented in C# using .NET 3.5 and I have a weird resize problems on a small number of Windows XP machines (I haven't been able to reproduce the problem myself).
The application uses a System.Windows.Forms.Form with a System.Windows.Forms.Panel which holds sub-views. Each sub-view is in itself a System.Windows.Forms.Form. During initialization each sub-view is added to the panel (panel.Controls.Add(sub-view)) and the controller selects sub-view by playing with the Hide and Show-methods of each sub-view.
Figure 1 shows how the application normally looks. The panel is the part with the lovely waterdrop-background-image.
But on some Windows XP machines the application looks like figure 2. The entire application has been resized (weird in itself since I have static Max/Min attributes) and the panel is bigger (and has dropped slightly). The background image repeats and any text on the panel is also resized.
Any ideas what this can be? Can it be a .NET-related problem? I do not have access to the problematic machines so all have to go on at the moment is some blurry screenshots.

It is a DPI problem. Changing the DPI setting (on Windows XP) and the application will be resized (but on Vista/7 it stays correct). Thank you for the speedy response guys.
|
Windows XP application (.NET/C#) resize problem
|
CC BY-SA 3.0
| 0 |
2011-05-25T12:21:21.890
|
2011-05-26T06:40:42.587
|
2011-05-26T06:40:42.587
| 226,654 | 226,654 |
[
"c#",
".net",
"windows-xp"
] |
6,124,394 | 1 | 6,124,595 | null | 23 | 17,077 |
I have a little jQuery function that is meant to automatically select text in an asp.net text box when it gets focus. However, the text in the text box gets selected, but immediately then deselects.
The code works if i bind to the focus event with .focus(function()) but I am adding the text boxes to the page dynamically which is why I think I need to use the live event.
Can anyone see a problem? The text boxes in question are in Item templates of two gridviews inside a multiview if that makes a difference?
Code:
```
<script type="text/javascript">
//Select all text in Cost Rate Text Boxes when they have focus
$(document).ready(function () {
$(".CostRateTextBox").live('focus', function () {
$(this).select();
});
});
</script>
```

Edit:
```
<script type="text/javascript">
//Select all text in Cost Rate Text Boxes when they have focus
$(document).ready(function () {
$(".CostRateTextBox").live('focus', function () {
$(this).select();
preventDefault();
});
});
</script>
```
|
Select all text on focus using jQuery
|
CC BY-SA 3.0
| 0 |
2011-05-25T12:23:09.270
|
2015-02-20T15:57:16.303
|
2011-05-25T12:38:14.633
| 428,404 | 428,404 |
[
"jquery",
"asp.net"
] |
6,124,419 | 1 | 6,135,606 | null | 4 | 1,071 |
The following piece of code produces a matplotlib NavToolbar2 at the top of a frame as expected when run on wxPython 2.8.x, Python 2.5.4/2.6, Matplotlib 0.99.x.
However, I've recently moved to Python 2.7, and wxPython 2.9.1 in an attempt to support OS X in 64-bit. It's under this environment that the code below produces an empty toolbar:

I noticed when building matplotlib that it said something about not needing WxAgg for wx 2.9 and up, might this be the problem? All I've tried so far is to replace `FigureCanvasWxAgg` with `FigureCanvasWx` and `NavigationToolbar2WxAgg` with `NavigationToolbar2Wx`. No luck.
Any ideas what's going on?
```
import wx
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg, NavigationToolbar2WxAgg
import matplotlib as mpl
app = wx.PySimpleApp()
f = wx.Frame(None)
fig = mpl.figure.Figure()
p = FigureCanvasWxAgg(f, -1, fig)
tb = NavigationToolbar2WxAgg(fig.canvas)
f.SetToolBar(tb)
tb.Realize()
f.Show()
app.MainLoop()
```
One more thing... if I replace the NavigationToolbar2WxAgg with my own custom navtoolbar class (code at first answer on this thread: [Add new navigate modes in matplotlib](https://stackoverflow.com/questions/4740988/add-new-navigate-modes-in-matplotlib)), the whole thing crashes unless I remove `tb.Realize()`.
```
2011-05-25 08:21:18.354 Python[48013:60f] *** Assertion failure in -[NSToolbar _itemAtIndex:], /SourceCache/AppKit/AppKit-1038.35/Toolbar.subproj/NSToolbar.m:1227
2011-05-25 08:21:18.356 Python[48013:60f] An uncaught exception was raised
2011-05-25 08:21:18.356 Python[48013:60f] Invalid parameter not satisfying: index>=0 && index<[self _numberOfItems]
2011-05-25 08:21:18.358 Python[48013:60f] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: index>=0 && index<[self _numberOfItems]'
*** Call stack at first throw:
(
0 CoreFoundation 0x00007fff868ef7b4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x00007fff83e9b0f3 objc_exception_throw + 45
2 CoreFoundation 0x00007fff868ef5d7 +[NSException raise:format:arguments:] + 103
3 Foundation 0x00007fff86d7c77e -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 198
4 AppKit 0x00007fff806f44a9 -[NSToolbar _itemAtIndex:] + 158
5 AppKit 0x00007fff806f3e94 -[NSToolbar _removeItemAtIndex:notifyDelegate:notifyView:notifyFamilyAndUpdateDefaults:] + 56
6 libwx_osx_cocoau-2.9.1.0.0.dylib 0x0000000101aea2a6 _ZN9wxToolBar7RealizeEv + 1430
7 _controls_.so 0x00000001048d4b76 _wrap_ToolBarBase_Realize + 102
8 .Python 0x00000001000ca81a PyEval_EvalFrameEx + 23498
9 .Python 0x00000001000cc8c5 PyEval_EvalCodeEx + 1733
10 .Python 0x00000001000ca9bf PyEval_EvalFrameEx + 23919
11 .Python 0x00000001000cc8c5 PyEval_EvalCodeEx + 1733
12 .Python 0x00000001000cb0c8 PyEval_EvalFrameEx + 25720
13 .Python 0x00000001000cc8c5 PyEval_EvalCodeEx + 1733
14 .Python 0x00000001000ca9bf PyEval_EvalFrameEx + 23919
15 .Python 0x00000001000cb2a6 PyEval_EvalFrameEx + 26198
16 .Python 0x00000001000cb2a6 PyEval_EvalFrameEx + 26198
17 .Python 0x00000001000cc8c5 PyEval_EvalCodeEx + 1733
18 .Python 0x00000001000ca9bf PyEval_EvalFrameEx + 23919
19 .Python 0x00000001000cb2a6 PyEval_EvalFrameEx + 26198
20 .Python 0x00000001000cc8c5 PyEval_EvalCodeEx + 1733
21 .Python 0x00000001000ccbc6 PyEval_EvalCode + 54
22 .Python 0x00000001000f0c7e PyRun_FileExFlags + 174
23 .Python 0x00000001000f1aa1 PyRun_SimpleFileExFlags + 817
24 .Python 0x00000001001093d9 Py_Main + 2825
25 Python 0x0000000100000f54 0x0 + 4294971220
)
terminate called after throwing an instance of 'NSException'
```
|
matplotlib navtoolbar doesn't realize in wx 2.9 (Mac OS X)
|
CC BY-SA 3.0
| 0 |
2011-05-25T12:25:43.927
|
2011-05-26T08:50:45.640
|
2017-05-23T10:28:25.977
| -1 | 214,035 |
[
"python",
"wxpython",
"matplotlib",
"toolbar"
] |
6,124,738 | 1 | null | null | 19 | 15,658 |
According to msdn:
> How GDI+ Support Arabic?
GDI+ supports Arabic text manipulation including print text with RTL reading order for both output devices, Screen and Printer. The Graphics.DrawString method draws the specified text string at a designated x, y location or rectangle (according to its overloading), with the specified Brush and Font objects using the formatting attributes of the specified StringFormat object. The StringFormat object includes text layout information such as text reading order.
> Therefore, you can easily move the origin of the graphics object to be Right-Top, instead of Left-Top, to print out the Arabic text in the designated location on the screen smoothly, without having to calculate locations explicit.
While this is true when setting (X,Y) coordination to (0,0) but if I want to increase X coordination to print at specific area on the paper, the X coordination will increase to the right side of the paper not to the left as it supposed to when printing in Right-to-left; which means print outside of the paper.
See this demo:
```
static void Main(string[] args)
{
PrintDocument p = new PrintDocument();
p.PrintPage += new PrintPageEventHandler(PrintPage);
p.Print();
}
static void PrintPage(object sender, PrintPageEventArgs e)
{
string drawString = "إختبار الرسم";
SolidBrush drawBrush = new SolidBrush(Color.Black);
Font drawFont = new System.Drawing.Font("Arail", 16);
RectangleF recAtZero = new RectangleF(0, 0, e.PageBounds.Width, e.PageBounds.Height);
StringFormat drawFormat = new StringFormat();
drawFormat.FormatFlags = StringFormatFlags.DirectionRightToLeft;
e.Graphics.DrawString(drawString, drawFont, drawBrush, recAtZero, drawFormat);
RectangleF recAtGreaterThantZero = new RectangleF(300, 0, e.PageBounds.Width, e.PageBounds.Height);
e.Graphics.DrawString(drawString, drawFont, drawBrush, recAtGreaterThantZero, drawFormat);
}
```
How to move the origin of the graphics object to be Right-Top instead of Left-Top and when increase X coordination it advance the printing point to the left not to the right.
PS: What I am doing now is setting X coordination to negative to force it move to left.

|
Printing Right-To-Left in c#
|
CC BY-SA 4.0
| 0 |
2011-05-25T12:51:37.907
|
2022-01-17T18:27:04.720
|
2022-01-17T18:27:04.720
| 1,655,837 | 56,788 |
[
"c#",
".net",
"graphics",
"printing"
] |
6,125,056 | 1 | 6,135,677 | null | 2 | 1,763 |
I am having an admin module and a front end module.
I have a category section.
I create categories by posting the value from the text box to php through ajax.
Both admin and front end charset is utf-8.
I read that by default ajax use utf-8 encoding.
while i post the data it is saved in the database perfectly.
I can see that unicode text in the database.
as well as i can see it while listing in the admin and in the front end.
when i click edit what i do is i fetch the data from the server using ajax/json
what i get is just ????? instead of the unicode text.
Where as in normal loading it is displayed well.
What could be the problem... what i am missing?
---
```
var jax = createAjax();
jax.open("POST",path,true)
jax.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
jax.onreadystatechange = afunction;
```
here is the php code
```
$query = "select * from $box where id=$id";
if(! ($res = mysql_query($query)))die(mysql_error());
$rs = mysql_fetch_array($res,1);
$rs['status'] = 1;
header("Content-Type: text/html; charset=utf-8");
die(json_encode($rs));
```
i have used the above for both request and response... even i have changed utf-8 to iso-85**-1 some thing that default but no effect.
i have attached the screen shots below

in the above image you can see the utf char is displayed well in the listing but when edited ussing ajax and json it is dislayed as ???? in the text box.

and here is how the text appears in the db...

|
unicode text not displayed as expected when fetched using ajax
|
CC BY-SA 3.0
| null |
2011-05-25T13:17:31.160
|
2011-05-26T08:27:26.573
|
2011-05-25T14:08:15.550
| 558,305 | 558,305 |
[
"javascript",
"ajax",
"unicode"
] |
6,125,205 | 1 | 6,125,301 | null | 2 | 283 |
I am trying to use GroupLayout from NetBeans 7.0, but I simply cannot select it. I did go to Properties/Libraries/Wrapped JARs/swing-layout-1.0.4.jar and even make it public but still GroupLayout still refuse to appear:

|
Using GroupLayout
|
CC BY-SA 3.0
| null |
2011-05-25T13:27:43.013
|
2011-05-25T13:44:04.493
|
2011-05-25T13:44:04.493
| 513,838 | 136,285 |
[
"java",
"netbeans",
"grouplayout"
] |
6,125,534 | 1 | 6,153,721 | null | 0 | 1,929 |
I have a combo box in Access and it contains a list of the field names from one of my tables. However, it is unordered and I don't know how to order it when field names is selected as its source. How can I order this alphabetically?
To clarify here are the settings I'm using in the properties menu.

|
Access Combo Box Based on Field List
|
CC BY-SA 3.0
| null |
2011-05-25T13:51:32.963
|
2017-01-18T18:40:11.067
|
2011-05-27T13:49:40.240
| 752,633 | 752,633 |
[
"ms-access"
] |
6,125,526 | 1 | 6,126,491 | null | 1 | 126 |
[http://bit.ly/jEiZ2Z](http://bit.ly/jEiZ2Z)
If you click on the "7" and "8", you'll be selecting an arrival and end date.
The vertical spacing ( white space / border ) is inconsistent with this:
[http://bit.ly/lem5aI](http://bit.ly/lem5aI)
I'm referring to the bottom white "border":

It's off by a pixel or two. I want it to look like the first link.
In the latter link, you need to actually click on any of the textfields in the console ( eg arrival, departure ) to get the calendar to show up.
Stylistically it seems exactly the same, including the styles of outer parents, etc. I'm pretty sure it's something being inconsistently inherited, or perhaps it's whitespace literally in the HTML. ( I've had a long 20+ hr day so my eyes are not fresh ).
Would be great if someone could try spotting this.
In addition, it looks much more off ( more than 1 pixel ) in IE.
|
Why is there inconsistent spacing between two similarly styled elements, and how can I make them consistent?
|
CC BY-SA 3.0
| null |
2011-05-25T13:50:50.407
|
2011-05-25T14:57:08.117
| null | null | 145,190 |
[
"css",
"internet-explorer",
"whitespace"
] |
6,125,764 | 1 | 6,125,959 | null | 4 | 843 |
I would like to average across "Rows" in a column. That is rows that have the same value in another column.
For example :
```
e= {{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2},
{69, 7, 30, 38, 16, 70, 97, 50, 97, 31, 81, 96, 60, 52, 35, 6,
24, 65, 76, 100}}
```

I would like to average all the Value in the second column that have the same value in the first one.
So Here : The Average for Col 1 = 1 & Col 1 = 2
And then create a third column with the result of this operation. So the values in that columns should be the same for the first 10 lines an next 10.
Many Thanks for any help you could provide !
LA
Output Ideal Format :

|
Mathematica : Conditional Operations on Lists
|
CC BY-SA 3.0
| 0 |
2011-05-25T14:09:02.823
|
2011-05-31T22:29:13.963
|
2011-05-31T22:29:13.963
| 769,551 | 769,551 |
[
"loops",
"wolfram-mathematica",
"conditional-statements"
] |
6,125,804 | 1 | 6,125,927 | null | 0 | 631 |
How would one go about recreating the iPhone 'Timer' section of the iPhone built-in 'Clock' app?
I am not asking about specifics (I am a developer and code objective-c, etc), but rather am trying to learn proper design patterns. I have included a screenshot of the app below.
I understand that the first portion of the app is an UIDatePicker. What types of objects are the "When Timer Ends" and "Start" buttons? The "When Timer Ends" portion looks like a UITableViewCell, and the "Start" button looks like a UIButton. Are all 3 of these objects in one UITableView? How would one go about creating the gradients belonging to the "When Timer Ends" and "Start" objects? Are these simply images? Or are the gradients created Programmatically?
I generally like to stay away from Interface Builder and code my views Programmatically.
Thanks a lot!

|
iPhone Built-in Timer (Clock) App
|
CC BY-SA 3.0
| null |
2011-05-25T14:12:11.840
|
2011-05-25T14:20:37.430
| null | null | 477,116 |
[
"iphone",
"timer",
"clock"
] |
6,125,891 | 1 | 6,436,595 | null | 0 | 293 |
When i am adding IBOutlet UIImage *name and connect it with interface builder, then it gives me Leaks. How can i remove this leaks.?
```
IBOutlet UIImageView * growbar;
@property (nonatomic, retain) UIImageView * growbar;
@synthesize growbar;
```
After that, I will connect it to interface builder by drpping UIImageview on view and connect..

This is when i was adding iboutlet.
|
Found leaks when adding IBOutlets specially UIimageview in interface builder
|
CC BY-SA 3.0
| null |
2011-05-25T14:17:35.147
|
2011-06-22T07:49:21.410
|
2011-05-25T15:24:37.853
| 651,046 | 651,046 |
[
"iphone",
"xcode",
"memory-leaks",
"uiimageview"
] |
6,125,893 | 1 | null | null | 0 | 266 |
I am looking for easy customizable charts.
For example, i need to do this chart

And this:

And many other.
So...What is best technplogy, flash, silverlight(on server side asp.net WebForms), js. Is it good idea to write own chart conrols without based on exists controls?
|
Choosing charts controls library
|
CC BY-SA 3.0
| null |
2011-05-25T14:17:54.250
|
2012-01-03T16:36:54.390
| null | null | 290,082 |
[
"c#",
"javascript",
"silverlight",
"flash",
"charts"
] |
6,125,989 | 1 | null | null | 1 | 978 |
When clicking F3 in Eclipse, the editor jumps to the declaration of the element the cursor was on.
However, this does not work when I try jumping to elements declared in the maven repository:

In my setup `M2_REPO` is defined under `Window\Preferences\Java\Build Path\Classpath Variables` as "C:\Maven\repository" which is correct.
How can I resolve this?
|
Eclipse: Open Decleration (F3) doesn't open files in Maven repository
|
CC BY-SA 3.0
| null |
2011-05-25T14:25:02.220
|
2011-05-25T14:28:25.463
| null | null | 348,545 |
[
"eclipse",
"maven"
] |
6,126,125 | 1 | 6,126,363 | null | 2 | 3,697 |
my client is asking for an auto-rotating news feed type thing on their site. The content will not change, but it will automatically move from item to the next. It will also allow the user to mouse over previous items and hold them in place.
This is best shown by the type of thing you find on Yahoo's homepage:

The four news items will auto-rotate, but when a user puts their mouse over one (as shown), it will stop rotating and just show that one, until they move it away (then it will continue auto-rotating).
I imagine I can do this with a lot of `$('item1').fade` and `$('item2').appear` type malarky using Prototype and Scriptaculous, but I was wondering if there was a better way, or an existing bit of code I could use (it seems like quite a common thing, these days).
Thanks for any tips or assistance!
|
Best way to create an auto-rotating "news" feed on a website?
|
CC BY-SA 3.0
| 0 |
2011-05-25T14:34:16.340
|
2011-05-25T14:49:34.870
|
2011-05-25T14:44:11.830
| 199,700 | 199,700 |
[
"php",
"javascript",
"html",
"css"
] |
6,126,130 | 1 | 6,126,751 | null | 0 | 509 |
I only want to use text in the tabs of my TabLayout. Unfortunately, by default, the Tabs are very large and the text is very small. I see no way of adjusting the size of the text or height of the tabs, without using `TabSpec.setIndicator(View)`; which would be very undesirable because then I would have define a specific layout, selector, selected image, unselected image, etc... so my tabs would not fit the look and feel of each device. Is there a convenient way to customize the Tab appearance?
```
mTabHost.addTab(mTabHost.newTabSpec("system").setIndicator("My first tab").setContent(R.id.fileBrowserTabHostSystemList));
mTabHost.addTab(mTabHost.newTabSpec("recent").setIndicator("My Second tab").setContent(R.id.fileBrowserTabHostRecentList));
```

|
Android: prettier TabLayout?
|
CC BY-SA 3.0
| 0 |
2011-05-25T14:34:33.070
|
2011-05-26T09:04:05.837
| null | null | 426,493 |
[
"android"
] |
6,126,587 | 1 | 6,129,372 | null | 0 | 2,018 |
A user comes to my web app and locates the destination address but he does not locate the source location and publishes the page. The normal user who are not registered to the web app adds the source location.
Once the user adds the source location he is not able to see the exact direction map, rather the google is displaying the default maps.
Here is the exception giving when we used chrome console.
I have added the code here and also the exception I am getting
```
Error Name:
main.js:41Uncaught TypeError:Object#<object> has no method 'Load'
function calcRoute() {
showDirections();
document.getElementById('directionsPanel').innerHTML="";
initialize();
var start = document.getElementById("txt_from").value;
var end = getDestinationAdderss(document.getElementById('final_address').innerHTML);
var request = {
origin:start,
destination:end,
travelMode: google.maps.DirectionsTravelMode.DRIVING
};
directionsService.route(request, function(response, status) {
if (status == google.maps.DirectionsStatus.OK) {
directionsDisplay.setDirections(response);
}
});
```

```
function initialize() {
directionsDisplay = new google.maps.DirectionsRenderer();
var chicago = new google.maps.LatLng(41.850033, -87.6500523);
var myOptions = {
zoom:7,
mapTypeId: google.maps.MapTypeId.ROADMAP,
center: chicago
}
map = new google.maps.Map(document.getElementById("map_canvas_directions"), myOptions);
directionsDisplay.setMap(map);
directionsDisplay.setPanel(document.getElementById("directionsPanel"));
}
```
|
problem with google directions api
|
CC BY-SA 3.0
| null |
2011-05-25T15:02:53.277
|
2011-05-25T19:58:18.750
|
2011-05-25T19:02:42.337
| 449,344 | 449,344 |
[
"javascript",
"google-maps",
"google-maps-api-3"
] |
6,126,644 | 1 | null | null | 1 | 3,673 |
Background: I'm converting an access run time that searches plans by zip code, plan type, and age.
So far, I have the main search down with the stored procedure `get_zip_plan_age` displaying correctly but am not sure if I'm calling the stored procedure `get_lowest_female_insurance_rate` correctly in the C# code-behind and how to write the code differently for `get_lowest_female_rate` which displays the lowest female rate for each age group vs `get_zip_plan_age` which displays all data.
Question:
- `get_lowest_female_rate`- `get_lowest_female_rate`
Here's a screenshot of the access runtime:

Here's my code for default.aspx.cs:
```
protected void Search_Zip_Plan_Age_Button_Click(object sender, EventArgs e)
{
using (SqlConnection cn = new SqlConnection())
{
cn.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["PriceFinderConnectionString"].ToString();
cn.Open();
using (SqlCommand cmd = cn.CreateCommand())
{
cmd.CommandText = "get_zip_plan_age";
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "get_lowest_female_rate";
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "get_lowest_male_rate";
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "get_carrier_info";
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter parm = cmd.CreateParameter();
parm.ParameterName = "@insur_age";
parm.DbType = DbType.Int64;
parm.Value = Convert.ToInt64(this.insur_age.Text);
cmd.Parameters.Add(parm);
parm = cmd.CreateParameter();
parm.ParameterName = "@zip_code";
parm.DbType = DbType.String;
parm.Value = this.ZipCode.Text;
cmd.Parameters.Add(parm);
parm = cmd.CreateParameter();
parm.ParameterName = "@plan_code";
parm.DbType = DbType.String;
parm.Value = this.PlanCode.Text;
cmd.Parameters.Add(parm);
SqlDataReader reader = cmd.ExecuteReader();
Zip_Plan_Age_GridView.DataSource = reader;
Zip_Plan_Age_GridView.DataBind();
}
}
}
```
Here's the code for the stored procedure get_zip_plan_age that displays all data:
```
ALTER PROCEDURE get_zip_plan_age
-- Add the parameters for the stored procedure here
@zip_code nvarchar(16),
@plan_code nvarchar(16),
@insur_age int = 0
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
IF @insur_age > 0
BEGIN
SELECT
[state_code],
[zip_code],
[female_value],
[male_value],
[carrier_name],
[update_date],
[insur_age],
[plan_code],
[spousal_discount]
FROM [state_zipcode_plans]
WHERE (([insur_age] = @insur_age)
AND ([zip_code] = @zip_code)
AND ([plan_code] = @plan_code))
ORDER BY [male_value], [plan_code]
END
ELSE BEGIN
SELECT
[state_code],
[zip_code],
[female_value],
[male_value],
[carrier_name],
[update_date],
[insur_age],
[plan_code],
[spousal_discount]
FROM [state_zipcode_plans]
WHERE (([zip_code] = @zip_code)
AND ([plan_code] = @plan_code))
ORDER BY [male_value], [plan_code]
END
END
GO
```
|
Calling multiple stored procedures and Gridviews with 1 button click
|
CC BY-SA 3.0
| null |
2011-05-25T15:06:28.073
|
2011-06-10T20:35:07.213
|
2011-05-25T15:31:55.077
| 76,337 | 606,805 |
[
"c#",
"asp.net",
"sql-server-2008",
"stored-procedures",
"gridview"
] |
6,127,051 | 1 | null | null | 0 | 236 |
I have a GWT application that has a left-hand scrollable navigation panel with a directory tree. I would like to be able to keep the panel narrow with a scroll bar at the bottom (which I have) but show the entire file name on hover, overflowing over the vertical scrollbar and into the next panel. I could do it by overlaying a small div with the full name when hovering, but that seems klugey and prone to subtle visual errors. I've tried fiddling with visibility, wrap and z-index with no effect. Can I do this by just adjusting the CSS parameters of the item in question, or on some other not-so-klugey way?
IntelliJ does this in the right way, but they're not in a browser:

Thanks,
-Lars
|
Overflow to the right over a scrollbar and the next panel, using GWT
|
CC BY-SA 3.0
| null |
2011-05-25T15:34:25.660
|
2012-07-24T08:35:38.817
| null | null | 368,209 |
[
"css",
"gwt",
"hover",
"overflow",
"visibility"
] |
6,127,121 | 1 | 6,127,384 | null | 4 | 3,959 |
In Xcode 3 one used to be able to define Outlets, Actions etc in Interface Builder by going to the Library > Classes Pane and selecting the class from the list. Is this functionality missing in Xcode 4 ?

There is a File Template Library in the Utility area (Lower Right Corner) in Xcode 4 but my custom clases do not show here !!
|
How to define Outlets and Actions in the Classes Pane in Interface Builder in Xcode 4?
|
CC BY-SA 3.0
| null |
2011-05-25T15:40:09.600
|
2011-05-25T16:09:39.433
| null | null | 558,423 |
[
"iphone",
"xcode",
"ios",
"interface-builder",
"xcode4"
] |
6,127,123 | 1 | 6,127,201 | null | 26 | 19,893 |
When I store date property with value DateTime.MaxValue in database and retrieve it back, the stored value does not equal to DateTime.MaxValue. The tick properties are off. Why is this?
Using MS SQL, data type for date field is 'datetime'

|
.net DateTime MaxValue is different once it is stored in database
|
CC BY-SA 3.0
| 0 |
2011-05-25T15:40:10.263
|
2012-11-27T14:29:19.603
|
2011-05-25T15:46:32.493
| 37,759 | 37,759 |
[
"c#",
".net",
"sql",
"datetime"
] |
6,127,154 | 1 | 6,128,143 | null | 25 | 8,902 |
I'm trying to keep track of the state in this app using Backbone.js:

I have a "ChartAppModel" with a set of defaults:
```
ChartAppModel = Backbone.Model.extend({
defaults: {
countries : [],
selectedCountries : [],
year : 1970,
},
initialize: function() {
loadAbunchOfData();
checkStartState();
}
});
```
If given a start fragment, this default state should however be overwritten:
```
var startState = $.deparam.fragment(); //using Ben Alman's BBQ plugin
this.set({selectedCountries: startState.s, year: startState.y});
```
Now, for example the SidebarView is ready to be updated:
```
ChartAppViewSidebar = Backbone.View.extend({
initialize: function(){
this.model.bind("change:selectedCountries", this.render);
},
render : function(){
[... render new sidebar with check boxes ...]
},
```
Problem is I also have an event handler on the sidebar that updates the model:
```
events: {
"change input[name=country]": "menuChangeHandler",
},
menuChangeHandler : function(){
[... set selectedCountries on model ...]
},
```
So there will be a feedback loop ...
And then, I'd also like a way of pushing a new state - so I listen to model changes:
```
ChartAppModel = Backbone.Model.extend({
initialize: function() {
this.bind("change", this.setState);
}
});
```
... and relatively soon this state-manager will collapse ...
1) How do I init my views (for example "which checkboxes should be checked") based on the fragment? (any hints on best practices for state / start state that is not a typical "route" are appreciated)
2) How can I avoid my views setting an attribute on the model which they themselves listen for?
3) How can I push a new state based on a part of the model?
Bonus :)
Thanks!
|
Backbone.js state management / view initialization based on url fragment
|
CC BY-SA 3.0
| 0 |
2011-05-25T15:43:03.680
|
2011-05-25T19:55:29.420
| null | null | 104,059 |
[
"javascript",
"model-view-controller",
"backbone.js",
"state-management"
] |
6,127,282 | 1 | 6,128,480 | null | 5 | 660 |
I'm plotting a PGM image:

Here's the [data](http://pastebin.com/jzCVRMJ1) I'm using.
The problem is some of the shown pixels are wrong. For example:
- -
Can anybody explain the discrepancies and how to fix them?
Here's my source:
```
from pylab import *
import numpy
LABELS = range(13)
NUM_MODES = len(LABELS)
def read_ascii_pgm(fname):
"""
Very fragile PGM reader. It's OK since this is only for reading files
output by my own app.
"""
lines = open(fname).read().strip().split('\n')
assert lines[0] == 'P2'
width, height = map(int, lines[1].split(' '))
assert lines[2] == '13'
pgm = numpy.zeros((height, width), dtype=numpy.uint8)
for i in range(height):
cols = lines[3+i].split(' ')
for j in range(width):
pgm[i,j] = int(cols[j])
return pgm
def main():
import sys
assert len(sys.argv) > 1
fname = sys.argv[1]
pgm = read_ascii_pgm(fname)
# EDIT: HACK!
pgm[0,0] = 12
cmap = cm.get_cmap('spectral', NUM_MODES)
imshow(pgm, cmap=cmap, interpolation='nearest')
edit = True
if edit:
cb = colorbar()
else:
ticks = [ (i*11./NUM_MODES + 6./NUM_MODES) for i in range(NUM_MODES) ]
cb = colorbar(ticks=ticks)
cb.ax.set_yticklabels(map(str, LABELS))
savefig('imshow.png')
if __name__ == '__main__':
main()
```
I see what's happening here now. Basically, `imshow` seems to be doing this:
- `[ min(image), max(image) ]`-
What I want it to do is:
- -
I can verify this by forcing the dynamic range of the image to be 13 (see the line labelled `HACK`). Is there a better way to do this?
Here's an updated image:

|
Off by one error in imshow?
|
CC BY-SA 3.0
| 0 |
2011-05-25T15:51:35.573
|
2011-05-25T17:56:06.260
|
2011-05-25T17:23:45.690
| 356,020 | 356,020 |
[
"python",
"matplotlib"
] |
6,127,596 | 1 | 6,130,899 | null | 1 | 1,227 |
Hello fellow Blackberry developers,
please advise me how to validate data entered by user into two BasicEditField's (the myName should be longre than 2 characters; the myFloat should be > 10.0) and:
1. Mark the BasicEditField containing wrong data red
2. Prevent user from clicking the "Save" (or "OK") button
3. Anything else if above actions are not possible with Blackberry?
Below is my very simple test case. It is a complete code src\mypackage\MyApp.java and will run instantly if you paste it into JDE or Eclipse:

```
package mypackage;
import net.rim.device.api.system.*;
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;
import net.rim.device.api.ui.decor.*;
public class MyApp extends UiApplication {
public static void main(String args[]) {
MyApp myApp = new MyEdit();
myApp.enterEventDispatcher();
}
public MyApp() {
pushScreen(new MyScreen());
}
}
class MyScreen extends MainScreen {
MenuItem myItem = new MenuItem("Show my dialog", 0, 0) {
public void run() {
String[] buttons = { "Save", "Cancel" };
Dialog dialog = new Dialog("My dialog", buttons, null, 0, Bitmap.getPredefinedBitmap(Bitmap.INFORMATION));
EditField myNameField = new EditField("Name (must be > 2 chars): ", "",
TextField.DEFAULT_MAXCHARS, EditField.NO_NEWLINE);
dialog.add(myNameField);
BasicEditField myFloatField = new BasicEditField("Number: (must be > 10.0)", "",
5, EditField.FILTER_REAL_NUMERIC | EditField.EDITABLE);
dialog.add(myFloatField);
if (dialog.doModal() == 0) {
String myName = myNameField.getText();
float myFloat = 0.0f;
try {
myFloat = Float.parseFloat(myFloatField.getText());
} catch (NumberFormatException e) {
}
Status.show("Name: " + myName + ", Number: " + myFloat);
}
}
};
public MyScreen() {
setTitle(new LabelField("How to validate input?"));
addMenuItem(myItem);
}
}
```
Before asking this question, I have looked at [TextFilter](http://www.blackberry.com/developers/docs/6.0.0api/net/rim/device/api/ui/text/TextFilter.html) and [Field.isDataValid()](http://www.blackberry.com/developers/docs/6.0.0api/net/rim/device/api/ui/Field.html#isDataValid%28%29) but I'm still unsure how to validate user input in Blackberry (vs. I have a pretty clear picture on how to validate user input in a web script with a web form - with jQuery/PHP/Perl/whatever)
Thank you!
Alex
|
Blackberry: validate modal Dialog input, do not allow to Save/Ok
|
CC BY-SA 3.0
| null |
2011-05-25T16:17:18.370
|
2011-05-25T21:01:35.537
|
2011-05-25T16:25:00.083
| 165,071 | 165,071 |
[
"blackberry",
"dialog",
"validation"
] |
6,127,613 | 1 | null | null | 4 | 3,076 |
In Firefox if I put an image in an element and then use border-radius, Firefox clips the image and it looks great! Works the same way in IE9 (amazing!). In Chrome (or any webkit browser) the border is rounded but it doesn't clip the image and it looks horrible. What am I doing wrong?
```
border-radius:10px;
-moz-border-radius:10px;
-o-border-radius:10px;
-webkit-border-radius:10px;
```

|
How do I round the corner of images in Chrome (and other webkit browsers)?
|
CC BY-SA 3.0
| 0 |
2011-05-25T16:19:03.737
|
2012-11-14T06:09:10.773
| null | null | 4,835 |
[
"css",
"google-chrome"
] |
6,128,341 | 1 | 6,128,427 | null | 0 | 456 |
I'm trying to make a viewController appears like the small one in the middle of the picture :

I tried with the UiAlertView, but it semms not offering this feature.
I found some apps adding buttons and labels, photo in similar viewControllers.
Any idea ?
|
how to make a custom viewController with transparent black background?
|
CC BY-SA 3.0
| null |
2011-05-25T17:18:54.157
|
2011-05-25T17:28:57.650
| null | null | 505,392 |
[
"iphone"
] |
6,128,555 | 1 | null | null | 2 | 44,465 |
I have a DataGridView with two columns. When a cell in the first column is clicked, an OpenFileDialog is shown and when I select a file, the cell in the second column value is set to the selected file name. Here is the code:
```
private void dataGridView1_CellContentClick(
object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex == 0)
{
SelectFile(e.RowIndex);
}
}
private void SelectFile(int rowIndex)
{
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
dataGridView1.Rows[rowIndex].Cells[1].Value =
openFileDialog.FileName;
}
}
```
This works, but I would like a new row to be added when the cell value is set. This happens when I edit the cell manually, the row gets in 'edit' state and a new row is added below. I would like the same to happen when I set the cell value programmatically.
[edit]
When my form is first shown the DataGridView is empty and the only row is shown is the one with (* sign - IsNewRow is true). When I manually edit a cell in that row it goes into edit state (pencil sign) and a new empty row is added. This doesn't happen when I use the above code. The row remains as IsNewRow (* sign) and a new row is not added.


|
Set DataGridView cell value and add a new row
|
CC BY-SA 3.0
| 0 |
2011-05-25T17:41:17.647
|
2015-01-30T18:52:42.503
|
2011-05-25T18:01:19.813
| null | null |
[
"c#",
"winforms",
"datagridview"
] |
6,128,624 | 1 | 6,128,739 | null | 6 | 4,638 |
I have the following HTML/CSS, which simply has a `<span>` tag styled with `float:right` inside an `<h2>` tag:
```
<style>h2{background-color:#e2e2e2;}
span{float:right;border:1px solid red;}</style>
<h2>H2 Test <span>SPAN text</span></h2>
```
Everything works well on Firefox (and I suspect other good browsers, like Chrome, Opera, etc.), but in IE, the `<span>` gets forced to the next line.
Note: the image shows an example of Firefox and IE. 
How can I get IE to duplicate the behavior of Firefox?
Additional info: I am not locked into using `float:right`, all I really want is a portion of the text left aligned, and a portion of the text right aligned within the `<h2>`. I have tried numerous things, but IE always seems to be the browser that just won't work. Any help would be appreciated.
|
IE Compatibility issue: <span> inside <h2>
|
CC BY-SA 3.0
| 0 |
2011-05-25T17:48:16.483
|
2012-04-26T11:44:32.993
| null | null | 562,697 |
[
"html",
"css",
"cross-browser"
] |
6,128,647 | 1 | null | null | 0 | 311 |
I have a simple login form on a TTTableView, in which I use TTTableControlItem with UITextFields.
I have two fields, Email & Password. Since the UILabel's width determined by the text, the two textfields aren't aligned vertically to the same line and it looks bad.

How do I control the width of the caption inside?
Is there another way to achieve this without subclassing/finding the labels/controls and move them after render?
Thanks.
|
Three20: TTTableControlItem caption's width
|
CC BY-SA 3.0
| 0 |
2011-05-25T17:50:03.940
|
2011-05-25T23:37:48.623
| null | null | 116,925 |
[
"ios",
"three20"
] |
6,128,675 | 1 | null | null | 3 | 1,958 |
When I open two tabs with Nivo Slider in each one, I observed that firebug's net tab show multiple requisitions of the same image in each slide change. It grow the size(in mb) of the page and memory usage/allocation to firefox.exe. After a while, my computer became very slow, and memory allocation in task monitor is higher than 1gb.
How to replicate it:
1- Open [http://nivo.dev7studios.com/](http://nivo.dev7studios.com/) in 2 tabs in firefox(tested in 3.6 ~ 5.0)
2- Open net panel of firebug in the second tab
3- reload the second tab

|
Image loading multiple times, Is this a Firefox ou a NivoSlider bug?
|
CC BY-SA 3.0
| 0 |
2011-05-25T17:53:12.770
|
2013-01-05T11:13:19.450
|
2011-06-27T19:47:20.933
| 484,550 | 484,550 |
[
"jquery",
"firefox",
"firebug",
"firefox4",
"nivo-slider"
] |
6,128,689 | 1 | 6,134,388 | null | 2 | 1,946 |
I've got an app with the following structure:
```
UIWindow
-- GlobalNavigationController.view (subclasses UIViewController)
-- UIView
-- UINavigationController.view
```
GlobalNavigationController forwards all rotation and lifecycle events (viewWillAppear, willRotateToInterfaceOrientation, etc) to the navigation controller.
Everything works really well, until you:
1. Open a modal dialog
2. Rotate into landscape (or to another orientation)
3. Close the dialog.
At this point, it seems that the underlying views in UINavigationController were not informed about some of the rotation events.
You get views like this:

Any idea?
Thanks
|
UINavigationController rotation problem with modal dialog
|
CC BY-SA 3.0
| null |
2011-05-25T17:54:01.730
|
2011-05-26T06:09:16.653
| null | null | 482,410 |
[
"iphone",
"uinavigationcontroller",
"modal-dialog",
"landscape"
] |
6,128,706 | 1 | 6,128,814 | null | 3 | 65 |
I have a div that I need to take up 100% of the page except for `x` amount of pixels. I can't use JavaScript, is this possible?
I can set height like so:
```
height:100%;
```
or I could set it as:
```
height:0px;
```
But how do I make it a hundred percent subtract `x` pixels?
This is why I need to do this:

You'll notice that the footer is being underlapped by the div. Is there anything I can do about this?
|
Using two types of measurements with a div (only css?)
|
CC BY-SA 3.0
| null |
2011-05-25T17:55:02.113
|
2011-05-25T18:06:40.627
|
2011-05-25T18:06:40.627
| 595,437 | 595,437 |
[
"css",
"html"
] |
6,128,731 | 1 | 6,154,335 | null | 0 | 350 |
I'm creating an n-tier application with Visual Studio 2010.
I have a project with only app configs, a project with only tests, and a project with only contracts (interfaces).
In a logical model, where should you enter application config values, tests and contracts?
Is this good practice?

|
Where to enter app settings, tests and contracts/interfaces in a n-tier architecture?
|
CC BY-SA 3.0
| null |
2011-05-25T17:57:20.423
|
2011-05-31T22:23:38.083
|
2011-05-25T18:05:24.777
| 23,199 | 492,460 |
[
".net",
"visual-studio-2010",
"architecture",
"projects-and-solutions",
"n-tier-architecture"
] |
6,128,762 | 1 | null | null | 0 | 164 |
The code below echoes an HTML table. The bottom right-hand corner of the table displays the number `$row["points"]`. I like the way it displays, but there is a sliver of light blue (#CAE1FF) between the right border of the table and the number `$row["points"]`. How can I get the number flush with the right border (so there is no light blue between the number and the border)?
Here is a screenshot:

Thanks in advance,
John
The code:
```
echo "<table class=\"samplesrec\">";
echo '<tr style="border-left:3px solid #004993; border-right:3px solid #004993; border-top:3px solid #004993;" class="class2a backgroundtt">';
echo '<td class="sitename1"></td>';
echo '</tr>';
echo '<tr class="class2b backgroundtt">';
echo '<td style="border-left:3px solid #004993; border-right:3px solid #004993;" class="sitename2name"></td>';
echo '</tr>';
echo '<tr style="border-left:3px solid #004993; border-right:3px solid #004993; border-bottom:3px solid #004993;" class="class2c backgroundtt">';
echo '<td class="sitename2tt"><div class="pointlink">'.number_format($row["points"]).'</div></td>';
echo '</tr>';
```
The CSS:
```
table.samplesrec {
position:absolute;
left:30px;
top:150px;
text-align: left;
font-family: "Times New Roman", Times, serif;
font-weight: normal;
font-size: 18px;
color: #000000;
width: 580px;
table-layout:fixed;
background-color: #FFFFFF;
border: 0px #FFFFFF;
border-collapse: collapse;
border-spacing: 0px;
padding: 0px;
text-decoration: none;
vertical-align: text-bottom;
}
table.samplesrec td {
border: 0px solid #fff;
text-align: left;
height: 5px;
overflow:hidden;
}
.class2a
{
margin-bottom:3px;
padding:2px;
color:#000000;
}
.class2a a{
padding: 2px;
color: #004284;
background-color:#CAE1FF;
text-decoration: none;
}
.class2a a:hover{
background-color: #FF0000;
padding: 2px;
color: #FFFFFF;
text-decoration: none;
}
.backgroundtt
{
position: inherit;
width:500px;
height:0px;
background: #CAE1FF;
}
.sitename1 { width: 580px;
font-family: "Courier New", Courier, monospace;
font-weight: normal;
font-size: 14px;
overflow:hidden !important;
color: #000000;
padding-bottom: 0px;
}
.class2b
{
margin-bottom:3px;
padding:2px;
color:#000000;
}
.class2b a{
padding: 2px;
color: #004284;
background-color:#CAE1FF;
text-decoration: none;
}
.class2b a:hover{
background-color: #FF0000;
padding: 2px;
color: #FFFFFF;
text-decoration: none;
}
.sitename2name { width: 300px;
overflow:hidden !important;
color: #999999;
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: normal;
height: 5px;
padding-bottom: 0px;
}
.sitename2name a{
width: 300px;
overflow:hidden !important;
color: #004284;
font-family:Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: bold;
height: 5px;
padding-bottom: 0px;
}
.sitename2name a:hover{
width: 300px;
overflow:hidden !important;
color: #004284;
background-color: #FFFFFF;
text-decoration:underline;
font-family:Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: bold;
height: 5px;
padding-bottom: 0px;
}
.class2c
{
margin-bottom:0px;
padding:2px;
padding-bottom: 5px;
color:#000000;
border-bottom-color:#FFFFFF;
border-bottom:thick;
}
.class2c a{
padding: 2px;
padding-bottom: 5px;
color: #004284;
background-color:#CAE1FF;
text-decoration: none;
border-bottom-color:#FFFFFF;
border-bottom:thick;
}
.class2c a:hover{
background-color: #FF0000;
padding: 2px;
padding-bottom: 5px;
color: #FFFFFF;
text-decoration: none;
border-bottom-color:#FFFFFF;
border-bottom:thick;
}
.sitename2tt { width: 150px;
overflow:hidden !important;
color: #000000;
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: normal;
height: 5px;
padding-bottom: 0px;
}
.sitename2tt a{
width: 50px;
overflow:hidden !important;
color: #004284;
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: normal;
height: 5px;
padding-bottom: 0px;
}
.sitename2tt a:hover{
width: 50px;
overflow:hidden !important;
color: #004284;
text-decoration:underline;
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: normal;
height: 5px;
padding-bottom: 0px;
}
.pointlink {
float:right;
margin-right: 0px;
font-size:18px;
font-weight:bold;
padding-right: 5px;
padding-left: 5px;
background-color:#004993;
color:#FFFFFF;
}
.pointlink a{
float:right;
margin-right: 0px;
font-size:18px;
padding: 2px;
padding-right: 2px;
padding-left: 2px;
background-color:#004993;
color:#FFFFFF;
}
.pointlink a:hover{
float:right;
margin-right: 0px;
font-size:18px;
padding: 2px;
padding-right: 2px;
padding-left: 2px;
background-color: #FF0000;
color:#FFFFFF;
}
```
|
Styling A Number To Appear Flush In The Bottom Right-Hand Corner of HTML Table
|
CC BY-SA 3.0
| null |
2011-05-25T18:00:38.890
|
2011-05-25T19:35:56.160
| null | null | 158,865 |
[
"css"
] |
6,128,855 | 1 | 6,129,180 | null | 4 | 1,467 |
I am trying to determine if a 1BPP indexed TIFF image is using a white pixel or black pixel. To check if my code was correct , I made the application draw the same image it proccessed onto a new image. This is when I noticed some problems and I have beem beating my head trying to figure it out.
I am pretty sure it has something to do with my bitwise check!
origninal image

Processed Image

Test project can be downloaded at [http://www.unclickable.net/code/tiffTest.zip](http://www.unclickable.net/code/tiffTest.zip)
unsafe
{
//flipStartPoint
```
int y;
for (y = 0; y < tiffSource.Height; y++)
{
var Column = (byte*)tiffSource.GetScanlinePointer(y);
int x;
for (x = 0; x < (tiffSource.Width / 8); x++)
{
int xm = x * 8;
byte b = Column[xm];
if (b > 0)
{
for (int Z = 0; Z < 8; Z++)
{
if (((b & (128 >> Z)) != 0))
{
if (lowisWhite)
{
image1.SetPixel((xm + Z), y, Color.FromArgb(0, 255, 255,255));
}
}
else
{
if (!lowisWhite)
{
image1.SetPixel((xm + Z), y, Color.FromArgb(0, 255,255, 255));
}
}
}
}
else
{
if (!lowisWhite)
{
for (int Z = 0; Z < 8; Z++)
{
image1.SetPixel((xm + Z), y, Color.FromArgb(0, 255, 255, 255));
}
}
}
}
}
}
```
|
C# TIFF Bit Wise Check
|
CC BY-SA 3.0
| null |
2011-05-25T18:07:44.697
|
2011-05-26T13:31:54.280
|
2011-05-26T13:31:54.280
| 498,714 | 498,714 |
[
"c#",
"image-processing",
"bit-manipulation",
"tiff"
] |
6,129,011 | 1 | 6,129,042 | null | 1 | 928 |
Here is a picture of what I am working with:

I need the borders below the vertical menu bar (on the left) to fade out (the one going up and the one going down). How would I make these two borders fade out? It seems kind of blocky now. I prefer not to use JavaScript but I will probably do what is necessary (I'm trying to make the site as light weight as possible).
By fade, I do mean over space, not time.
|
Fading a border (css)
|
CC BY-SA 3.0
| null |
2011-05-25T18:22:38.213
|
2011-05-26T18:40:51.097
|
2011-05-26T18:40:51.097
| 595,437 | 595,437 |
[
"javascript",
"html",
"css",
"border"
] |
6,129,238 | 1 | 6,129,684 | null | 3 | 643 |
I have a NSControl subview and I want to change the drawing when the control is not on a keyWindow. The problem is that I don't see any property that reflects that state (tried `enabled` property but that was not it).
In simple terms, can I differentiate between these two states?

|
Drawing NSControl when the windows is key or not
|
CC BY-SA 3.0
| null |
2011-05-25T18:41:41.270
|
2012-05-21T10:42:42.173
|
2012-05-21T10:42:42.173
| 741,249 | 111,783 |
[
"macos",
"cocoa",
"nscontrol"
] |
6,129,531 | 1 | 6,130,630 | null | 2 | 3,809 |
Here's how looks like when idle:

And here it is, when I tap on it, when it should be popping the full screen selection mode (according to what I've read):

As you can see, it doesn't seem to be opening the full screen selection mode.
Here is my XAML:
```
<phone:PhoneApplicationPage
x:Class="GameLense.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
shell:SystemTray.IsVisible="True">
<Grid>
<Grid.Resources>
<DataTemplate x:Name="PickerItemTemplate">
<StackPanel Orientation="Horizontal">
<Border Background="Transparent" Width="34" Height="34">
<Image Source="{Binding ImagePath}" Margin="12 0 0 0"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Stretch="Fill"/>
</Border>
<TextBlock Text="{Binding Name}" Margin="12 0 0 0"/>
</StackPanel>
</DataTemplate>
<DataTemplate x:Name="PickerFullModeItemTemplate">
<StackPanel Orientation="Horizontal">
<Border Background="Gold" Width="34" Height="34">
<Image Source="{Binding ImagePath}" Margin="12 0 0 0" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Border>
<TextBlock Text="{Binding Name}" Margin="12 0 0 0"/>
</StackPanel>
</DataTemplate>
</Grid.Resources>
<Grid.RowDefinitions>
<RowDefinition Height="100" />
<RowDefinition />
</Grid.RowDefinitions>
<!--Begin Top Bar -->
<Image Grid.Row="0" Source="Images/topbarBg.png" Stretch="Fill" />
<TextBlock Text="Console" HorizontalAlignment="Left"
VerticalAlignment="Center" FontSize="35"
Padding="10"/>
<toolkit:ListPicker x:Name="lstPlatform"
ListPickerMode="Full"
Grid.Row="0" CacheMode="BitmapCache"
Margin="160 0 10 0" VerticalAlignment="Center"
ItemTemplate="{StaticResource PickerItemTemplate}"
FullModeItemTemplate="{StaticResource PickerFullModeItemTemplate}" />
<!--End Top Bar -->
</Grid>
</phone:PhoneApplicationPage>
```
Any ideas on what I may be doing wrong?
|
Windows Phone 7's ListPicker control isn't opening up the full selection window
|
CC BY-SA 3.0
| 0 |
2011-05-25T19:08:10.050
|
2011-12-05T11:48:01.293
| null | null | 699,978 |
[
"c#",
"windows-phone-7",
"listpicker"
] |
6,129,539 | 1 | 14,083,038 | null | 0 | 499 |
I have an entity A which has two attributes. Entity B has A as parent and has an additional 3 attributes. The changes in the new version don't affect entities A and B.
How can I migrate objects of entity B to a new version of my data model, including the attributes from entity A?
I tried using two entity mappings: one for A and one for B, but 'A attributes' aren't migrated. Alternatively I would add A's attributes to the mapping to migrate B, but there I can't selected the right attributes (in Xcode 4).
---
I'm not referring to a regular relationship between two entities, but inheritance:

---
Just to be sure, I created a new project to test with. Herein, I added only the two entities as seen above. In my `awakeFromNib` I do a fetch request and if no results are returned, I add a new entity:
```
NSManagedObject *newAccount = [[NSManagedObject alloc] initWithEntity:entityDesc insertIntoManagedObjectContext:[self managedObjectContext]];
// Account
[newAccount setValue:@"TheName" forKey:@"name"];
[newAccount setValue:[NSDecimalNumber decimalNumberWithMantissa:5 exponent:2 isNegative:NO] forKey:@"currentBalance"];
// BankDebitAccount
[newAccount setValue:@"TheAccountNumber" forKey:@"accountNumber"];
[newAccount setValue:@"TheBankName" forKey:@"bankName"];
[newAccount setValue:[NSDecimalNumber decimalNumberWithMantissa:6 exponent:1 isNegative:YES] forKey:@"openingBalance"];
```
In my second version of the data model, I added a new entity and I enabled automatic migration via
```
NSMutableDictionary *dict = [NSMutableDictionary dictionary];
[dict setObject:[NSNumber numberWithBool:YES] forKey:NSMigratePersistentStoresAutomaticallyOption];
if (![__persistentStoreCoordinator addPersistentStoreWithType:NSXMLStoreType configuration:nil URL:url options:dict error:&error]) {
```
The migration does indeed happen, and the three properties from BankDebitAccount successfully are migrated. The currentBalance property from Account is reset to 0 and the name property isn't visible in the XML file anymore (and thus, is equal to nil).
---
I just tried opening this newly made test project in Xcode 3(.2.4). When I open the mapping model in there and select my child entity's mapping, I can actually add an attribute mapping for the parent's attributes:

So, I guess that would make this a bug in Xcode 4.
|
Migrating entities and parent entities
|
CC BY-SA 3.0
| null |
2011-05-25T19:09:00.627
|
2012-12-29T15:17:47.257
|
2011-05-31T18:11:44.283
| 130,354 | 130,354 |
[
"objective-c",
"cocoa",
"core-data",
"core-data-migration"
] |
6,129,749 | 1 | 6,129,808 | null | 3 | 50 |
here's my table:

and I want get the customers which have some values of `for/category` fields which is comma separated..
I am trying something like this:
```
SELECT * FROM `customers` WHERE `for` LIKE ('%AMC PHD & WWS%' OR '%Rostfrei%' OR '%Thermopac%')
```
but its giving empty result.
|
php mysql query issue
|
CC BY-SA 3.0
| 0 |
2011-05-25T19:27:14.353
|
2011-05-25T19:31:55.413
| null | null | 432,543 |
[
"php",
"mysql",
"sql"
] |
6,129,899 | 1 | 6,132,876 | null | 15 | 72,920 |
I'm trying to use the functionality from the Tkinter module (Python 2.7) to create a GUI that has eight widgets placed on a 7 row by 5 column grid (sorry that I did not include an image; the dialog box is not allowing me to browse and upload the saved image).
(Widget, start_row, start_col, row_span, column_span):
1. ("Button 0", 6, 0, 1, 1)
2. ("Button 1", 6, 1, 1, 1)
3. ("Button 2", 6, 2, 1, 1)
4. ("Button 3", 6, 3, 1, 1)
5. ("Button 4", 6, 4, 1, 1)
6. ("Frame1", 0, 0, 3, 2)
7. ("Frame2", 2, 0, 3, 2)
8. ("Frame3", 0, 3, 6, 3)
Yet, when I run my code, the buttons and Frame3 are rendered fine, but Frame1 vertically "squashes" Frame2. Any suggestions would be greatly appreciated. (I have read the suggested StackOverflow answers and none seem to provide information that can be used to solve my problem. Also, I have searched extensively online to no avail.)
```
from Tkinter import *
class Application(Frame):
def __init__(self, master=None):
Frame.__init__(self, master)
self.master.title("Grid Manager")
self.master.rowconfigure(0, weight=1)
self.master.columnconfigure(0, weight=1)
for i in range(5):
self.master.button = Button(master, text = "Button {0}".format(i))
self.master.button.grid(row=6, column=i, sticky=W+E)
self.Frame1 = Frame(master, bg="red")
self.Frame1.grid(row = 0, column = 0, rowspan = 3, columnspan = 2, sticky = W+E+N+S)
self.Frame2 = Frame(master, bg="blue")
self.Frame2.grid(row = 2, column = 0, rowspan = 3, columnspan = 2, sticky = W+E+N+S)
self.Frame3 = Frame(master, bg="green")
self.Frame3.grid(row = 0, column = 2, rowspan = 6, columnspan = 3, sticky = W+E+N+S)
root = Tk()
app = Application(master=root)
app.mainloop()
```
UPDATE: Now that I'm at my personal computer, here are images for the result that I want and the result that I get, respectively:


|
Python - Multiple frames with Grid manager
|
CC BY-SA 3.0
| 0 |
2011-05-25T19:37:10.990
|
2019-02-24T17:04:08.973
|
2011-05-25T23:48:32.567
| 415,282 | 415,282 |
[
"python",
"tkinter"
] |
6,129,939 | 1 | null | null | 0 | 233 |
I've got a TitleWindow with 2 buttons in it.
One button is in the contentgroup and the other in the controlbargroup.
Titlewindow and buttons are styled with chromecolor.
Why has the button in den controlbar not a red color?
How can I get a red button?

```
<?xml version="1.0" encoding="utf-8"?>
<s:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
horizontalCenter="0" verticalCenter="0"
width="300" height="400"
isPopUp="true">
<s:Button label="Red Button" />
<s:controlBarContent>
<s:Button label="Red Button" />
</s:controlBarContent>
</s:TitleWindow>
```
Style.css:
```
s|TitleWindow{
chromeColor: #00FF00; //Green
backgroundColor: #0000FF; //Blue
}
s|TitleWindow s|Button{
chromeColor: #FF0000; //Red
}
```
|
Button in TitleWindow has wrong color
|
CC BY-SA 3.0
| null |
2011-05-25T19:40:20.840
|
2011-05-25T20:03:54.807
|
2011-05-25T20:03:54.807
| 275,643 | 770,207 |
[
"flash",
"apache-flex",
"actionscript-3",
"actionscript",
"mxml"
] |
6,130,018 | 1 | 6,130,142 | null | 5 | 5,708 |
I've merrily hacking away at this website, testing it in Firefox and Internet Explorer 9, taking for granted that Safari and Chrome will render my CSS3 fine, when I've just discovered they don't.
In FF and IE9 I see this:

In Safari/Chrome I see this:

Here's the HTML:
```
<div class="container">
<div>
<img src="static/images/image1.jpg" alt="" />
</div>
```
Here's the CSS:
```
.container {
border-radius:10px;
-moz-border-radius:10px;
-webkit-border-radius: 10px;
}
```
What am I doing wrong? :(
Please see a working example of the problem I'm having: [http://jsfiddle.net/jAsnU/3](http://jsfiddle.net/jAsnU/3) Thanks.
|
CSS3 rounded image corners not working in Safari/Chrome?
|
CC BY-SA 3.0
| 0 |
2011-05-25T19:47:45.933
|
2011-05-25T20:32:10.550
|
2011-05-25T20:32:10.550
| 199,700 | 199,700 |
[
"html",
"css"
] |
6,130,208 | 1 | 6,131,045 | null | 0 | 521 |
I have been doing some preliminary work on 30-bit displays (specifically, the DXGI_FORMAT_R10G10B10X2 format and related OpenGL RGB10A2 format) and have a question regarding a slide from the [WinHEC 2008](http://msdn.microsoft.com/en-us/windows/hardware/gg463168) presentation by Chas Boyd and David Glen on [Display Technologies](http://download.microsoft.com/download/5/e/6/5e66b27b-988b-4f50-af3a-c2ff1e62180f/gra-t583_wh08.pptx) (<- warning - large powerpoint) showing JNDs vs. display brightness:

It's pretty clear that they're showing typical display brightness in the dark bar in the 150-400 cd/m^2 range, and the advantage of a 10 bit over 8 bit display in the number of JNDs for a given brightness.
Does anyone know why there are curves (A and B) being shown here? There's nothing in the adjacent slides or notes that describe what the two curves represent, so I'm not sure if those are two different display technologies, or values from competing theories on the human visual system, or what.
FYI - my only experience with JNDs is from the [DICOM 3.14 standard](http://medical.nema.org/dicom/2004/04_14PU.PDF)
Anyone recognize this graph, attend the conference, or have an informed opinion?
|
10-bit displays and JNDs
|
CC BY-SA 3.0
| null |
2011-05-25T20:04:12.663
|
2011-05-25T21:16:45.780
|
2011-05-25T20:55:44.540
| 44,729 | 295,726 |
[
"opengl",
"graphics",
"directx",
"rendering"
] |
6,130,272 | 1 | 6,133,560 | null | 0 | 284 |
I'm trying to generate a matrix report. I have an SSN row and a 3 digit code column. The 3 digit codes are randomly inserted into cells through out the report, one per row. I would like to have them display all in one column. I have tried...
```
=Iif(IsNothing(Fields!CODE.Value),"The Field Is Null",Fields!CODE.Value)
```
But this just displays "The Field is Null". I want noting displayed as in...
```
=Iif(IsNothing(Fields!CODE.Value),"",Fields!CODE.Value)
```
But have the null cells themselves excluded. Anyone know a trick to pull this off?
the result would look like this...
```
ssn code
123456789 123
123456789 123
and so on
```
My matrix structure looks like this...

and the Exp is now set to =Iif(IsNothing(Fields!ID5.Value),"The Field Is Null",Fields!ID5.Value)
Note: The ID5 is just a quick nameing convention. ID5 corresponds to the code. ID2 corresponds to the SSN.
|
sql server 2008 reporting services
|
CC BY-SA 3.0
| null |
2011-05-25T20:09:34.167
|
2011-05-27T00:46:14.237
|
2011-05-26T15:05:38.803
| 665,094 | 665,094 |
[
"sql-server-2008",
"reporting-services",
"expression"
] |
6,130,335 | 1 | null | null | 1 | 85 |
I have a site that I've inherited, and am going a bit insane with the CSS. There's a div that has a height of 185px - it shows in Computed Styles, and it's very obviously being applied to the divs with the same class. However, the height doesn't show up anywhere in the stylesheet, and it doesn't show up under Applied Styles or Inherited From in the element inspector. (See screenshot.) I need to get rid of the height, as it's causing some issues with truncating content (we don't want to use overflow:scroll because there are many of these divs on the page - one per database record - and that's an awful lot of scrollbars.)
The div class is search-result, and you can see in the right pane the height:185px attribute. Here's the code we actually have in our stylesheet for that class plus sub-elements:
```
#content .search-result {
margin-bottom: 1em;
border-bottom: 1px solid #ccc;
padding: 1em 0;
}
#content .search-result .image-box {
float: right;
margin: 0 0 1.5em 30px;
font-size: .75em;
text-align: center;
}
#content .search-result .image-box img {
border: 1px solid #eee;
margin-bottom: .5em;
}
#content .search-result ul {
list-style: none;
margin: 0 0 1em;
}
```
I've also run grep on the entire site install, and the text "185px" doesn't exist anywhere on the server that I can find. Where else could this "ghost" style be getting set?

|
Where could this CSS attribute be set?
|
CC BY-SA 3.0
| null |
2011-05-25T20:14:48.800
|
2011-05-25T20:37:58.423
|
2011-05-25T20:37:58.423
| 341,611 | 341,611 |
[
"css",
"height"
] |
6,130,354 | 1 | 6,130,429 | null | 0 | 765 |
>
[What are these numbers on the right side of my Windows Phone Silverlight app?](https://stackoverflow.com/questions/5393485/what-are-these-numbers-on-the-right-side-of-my-windows-phone-silverlight-app)
For example:

Those letters kind of get in the way of me seeing what the design looks like as a whole, can I disable them?
|
How can I disable the small letters in the WP7 emulator?
|
CC BY-SA 3.0
| null |
2011-05-25T20:16:48.077
|
2011-05-25T20:24:14.520
|
2017-05-23T12:12:03.890
| -1 | 699,978 |
[
"windows-phone-7",
"emulation"
] |
6,130,457 | 1 | 6,139,546 | null | 2 | 911 |
I'm generating a multipage PDF from Java using iText. Problem: the lines on my charts shift color between certain pages.
Here's a screenshot of the transition between pages:
This was taken from Adobe Reader. The lines are the correct color in OS X Preview.app.
In Reader the top is #73C352, the bottom is #35FF69. In Preview.app the line is #00FE7E.
Any thoughts on what could be causing this discrepancy? I saved the PDF from Preview.app and opened it in Adobe Reader, still has the colors off.
[Here is the PDF that is having trouble](http://dl.dropbox.com/u/6466134/StackOverflow%20PDF.pdf). Open it in Adobe Reader and look at the transition between pages 11 & 12.
On checking this out further, it appears that the java.awt.print.PrinterJob is calling print() for each pageIndex twice. This might be a clue.
|
iText PDF colors are inconsistent in Acrobat
|
CC BY-SA 3.0
| 0 |
2011-05-25T20:26:34.283
|
2011-05-26T21:00:07.437
|
2011-05-26T01:11:10.750
| 14,467 | 14,467 |
[
"java",
"pdf",
"colors",
"itext"
] |
6,130,475 | 1 | 6,136,999 | null | 33 | 39,706 |
Is it possible to add an image to the buttons of the `UIActionSheet` as seen in `UIDocumentInteractionController`? If so, please let me know how it is done.

|
Adding Images to UIActionSheet buttons as in UIDocumentInteractionController
|
CC BY-SA 3.0
| 0 |
2011-05-25T20:28:06.780
|
2019-01-28T07:45:28.087
|
2017-02-08T14:32:17.217
| -1 | 488,434 |
[
"iphone",
"objective-c",
"uiimage",
"uiactionsheet",
"uidocumentinteraction"
] |
6,130,760 | 1 | 6,163,010 | null | 1 | 1,003 |
I already tried with `decimal(10,4)` and `float` in the SQL but after I updated my Database model the EF treat
```
decimal(10,4) as a Decimal in C#
float as a Double in C#
```
witch for me it's great, but the Model Validation always fail

and it's not because I'm using `.` instead of `,`

> What should I do so the validation can run smoothly?
I know I can avoid this using a in between the View and the Model, but I just want to know how to do things right.
|
What's the way to add decimal number to SQL that replicate in EF?
|
CC BY-SA 4.0
| 0 |
2011-05-25T20:49:29.750
|
2018-07-15T15:15:44.350
|
2018-07-15T15:15:44.350
| 13,860 | 28,004 |
[
"entity-framework",
"validation",
"asp.net-mvc-3"
] |
6,131,065 | 1 | null | null | 0 | 1,996 |
Hey I'm totally confused with the way the ajax uri works. Please look at the code below:
```
<script>
function clickHandler(){
$.ajax({
**url : "http://localhost:8080/csp/ajaxchangerole.html?user=" + document.getElementById('userid').value,**
dataType: 'text',
success : function (data) {
$("#roleval").html(data);
}
});
}
```
It also works even if I change the url to this fashion
```
<script>
function clickHandler(){
$.ajax({
**url : "ajaxchangerole.html?user=" + document.getElementById('userid').value,**
dataType: 'text',
success : function (data) {
$("#roleval").html(data);
}
});
}
```
But if I change the url to either of the two urls mentioned below, it doesn't even call the controller. I'm not sure why. Can someone explain what I need to call the controller at the below specified urls?
OR
[http://localhost:8080/csp/admin/ajaxchangerole.html?user=](http://localhost:8080/csp/admin/ajaxchangerole.html?user=)
Here is my snippet from my xml file that has the mappings for the above urls:
```
<bean name="/admin/changerole.html" class="csp.spring.controller.admin.ChangeRoleFormController" >
<property name="customerDao" ref="customerDao" />
<property name="commandName" value="customer" />
<property name="commandClass" value="csp.model.Customer" />
<property name="formView" value="admin/changerole" />
<property name="successView" value="home" />
</bean>
<bean name="/admin/ajaxchangerole.html"
class="csp.spring.controller.admin.ChangeRoleAjaxController">
<property name="customerDao" ref="customerDao" />
<property name="authorityDao" ref="authorityDao" />
</bean>
```
I can't understand why I have to remove "/admin" from the above two mappings to get this ajax part working. Any help is greatly appreciated. Thanks in advance.
Regards,
Serotonin Chase
Fyi,
my controllers:
1.ChangeRoleAjaxController
Next controller:
2. ChangeRoleFormController
My two jsp files:
1. changerole.jsp

Next jsp file:
2. ajax_changerole.jsp

|
ajax jquery url specification
|
CC BY-SA 3.0
| null |
2011-05-25T21:18:58.090
|
2011-05-25T21:28:39.337
| null | null | 615,520 |
[
"jquery",
"ajax",
"spring"
] |
6,131,113 | 1 | 6,135,406 | null | 0 | 979 |
I have a jqGrid on a page wrapped inside an ASP.NET web part. Here is it's definition:
```
$("#referent_grid").jqGrid({
url: '<%= SPContext.Current.Site.Url %>' + wsBaseUrl + 'ReferentService.asmx/ListReferents',
colNames: ['Full Name', 'Phone Number', 'Email', 'Department'],
colModel: [
{ name: 'FullName', index: 'FullName', width: 240, align: 'left', search: true, stype: 'text', searchoptions: { sopt: ['eq', 'bw', 'bn', 'ew', 'en', 'cn', 'nc']} },
{ name: 'PhoneNumber', index: 'PhoneNumber', width: 120, align: 'left', search: true, stype: 'text', searchoptions: { sopt: ['eq', 'bw', 'bn', 'ew', 'en', 'cn', 'nc']} },
{ name: 'Email', index: 'Email', width: 180, align: 'left', search: true, stype: 'text', searchoptions: { sopt: ['eq', 'bw', 'bn', 'ew', 'en', 'cn', 'nc']} },
{ name: 'Department', index: 'Department', width: 180, align: 'left', search: true, stype: 'text', searchoptions: { sopt: ['eq', 'bw', 'bn', 'ew', 'en', 'cn', 'nc']} },
],
jsonReader: {
id: "ReferentID"
},
pager: $('#referent_grid_pager'),
sortname: 'FullName',
sortorder: "asc",
height: '300',
shrinkToFit: false,
caption: 'Referent List'
});
$("#referent_grid").jqGrid('navGrid', '#referent_grid_pager',
{ add: true, addtitle: 'Add Referent', edit: true, edittitle: 'Edit Referent',
del: true, deltitle: 'Delete Referent', refresh: true, refreshtitle: 'Refresh data',
search: true, searchtitle: 'Advanced search filters',
addfunc: addReferent, editfunc: editReferent
},
{}, // default settings for edit
{}, // default settings for add
{ // define settings for Delete
mtype: "post", reloadAfterSubmit: true,
url: '<%= SPContext.Current.Site.Url %>' + wsBaseUrl + 'ReferentService.asmx/DeleteReferent',
resize: false,
serializeDelData: function (postdata) {
return JSON.stringify({ referentID: postdata.id });
},
afterSubmit: function (data, postdata) {
var result = $.parseJSON(data.responseText);
return [true, ''];
}
},
{ closeOnEscape: true, multipleSearch: true, closeAfterSearch: true }, // search options
{}
);
```
As you can see I have Advanced Search enabled. The problem I am facing to is that the first time the page is called the jqGrid calls the `ListReferents` method without passing the filters parameter as you can see in the following screenshot from Fiddler

When I click on the `refresh` button of the jqGrid it calls the `ListReferents` method passing the filters parameter as you can see in the following screenshot from Fiddler

To arrange this I have defined two methods inside my web service but the first method does never get called while the second is.
```
[WebMethod]
public JQGridData ListReferents(string _search, string nd, string rows, string page, string sidx, string sord) {
return ListReferents(_search, nd, rows, page, sidx, sord, string.Empty);
}
[WebMethod]
public JQGridData ListReferents(string _search, string nd, string rows, string page, string sidx, string sord, string filters) {
// method code here
}
```
Where am I doing wrong?
|
jqGrid with Enabled Advanced Search different calls to the server
|
CC BY-SA 3.0
| null |
2011-05-25T21:22:31.957
|
2011-05-26T07:57:14.280
| null | null | 431,537 |
[
"jquery",
"asp.net",
"jqgrid"
] |
6,131,661 | 1 | 6,131,738 | null | 11 | 3,927 |
I want to stack divs with different heights but same width within a div container.. from top to bottom going right.
Problem now is with divs that are short.. gives a ugly gap to the div above.
I've added a small sketch with what i want to do..

Thanks from norway!
|
Stack divs with different heights
|
CC BY-SA 3.0
| null |
2011-05-25T22:19:42.083
|
2011-05-25T22:37:15.457
| null | null | 681,061 |
[
"html",
"layer"
] |
6,131,763 | 1 | 6,133,469 | null | 11 | 4,015 |
I have a feeling this will be an obvious answer, but I can't seem to work it out.
What appears to happen is that I commit/push some changes to the server and everything appears fine on my copy.
Another developer then pulls from the server from the same branch (allegedly seeing my changes, as far as I'm aware), makes some modifications, commits them to their own local copy then finally pushes it back to the server.
Somewhere in the middle of doing this my changes get lost as their push (326c8fd0...) causes a merge with lots of delete/add lines resetting the repository back to a much older revision. This has happened a few times now even with fresh copies of the repository.
The highlighted line below (8def6e9..) was a commit I made, the following commits should have been on this same branch assuming the other developer pulled the changes. A merge happens at 326c8fd0 which ends up resetting the repository incorrectly, losing previous changes.

Am I missing something very obvious as to why this is happening? We're both using TortoiseGit.
Sorry for the probably vague explanation.
|
Git: Changes keep getting lost due to seemingly random merges
|
CC BY-SA 3.0
| 0 |
2011-05-25T22:33:42.600
|
2016-01-13T08:12:35.900
| null | null | 171,703 |
[
"git",
"version-control",
"tortoisegit"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.