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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5,302,622 | 1 | 5,302,991 | null | 4 | 12,780 | I have a form on my Java application which basically is to provide the user with a list of data from a DB query. one idea was to use a table and populate each row with data from my resultset. However when designing the UI my team and i decided that it didnt look as smooth as we wanted. So we thought we would look into creating a custom view of the results in a panel. we wanted it to look something like:

So instead of rows of a table it will look like this with one for each enquiry on the resultset.
The problem i am having is coding this. I spent a good deal of time trying to workout how to add a component to a JForm. as netbeans seem to by default set up the ui as a grouplayout? so I worked out how to add 1 panel using:
```
javax.swing.JLabel idLbl;
javax.swing.JLabel jLabel1;
javax.swing.JLabel jLabel3;
javax.swing.JLabel jLabel5;
javax.swing.JLabel jLabel7;
javax.swing.JPanel jPanel1;
javax.swing.JLabel prefContactLbl;
javax.swing.JLabel propertyLabel;
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
idLbl = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
propertyLabel = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
contactLabel = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
prefContactLbl = new javax.swing.JLabel();
jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jLabel1.setFont(new java.awt.Font("Tahoma", 1, 12));
jLabel1.setText("Enquiry Id:");
jLabel1.setName("jLabel"+i);
idLbl.setText("jLabel2");
jLabel3.setFont(new java.awt.Font("Tahoma", 1, 12));
jLabel3.setText("Property:");
propertyLabel.setText("A property Address in some town with a postcode");
jLabel5.setFont(new java.awt.Font("Tahoma", 1, 12));
jLabel5.setText("Contact:");
contactLabel.setText("A Persons Name ( 01010100011)");
jLabel7.setFont(new java.awt.Font("Tahoma", 1, 12));
jLabel7.setText("Prefered Contact:");
prefContactLbl.setText("Email/Phone");
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(idLbl)
.addGap(18, 18, 18)
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(propertyLabel))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel7)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(prefContactLbl)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(contactLabel)))
.addContainerGap(20, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(idLbl)
.addComponent(jLabel3)
.addComponent(propertyLabel))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel7)
.addComponent(prefContactLbl)
.addComponent(jLabel5)
.addComponent(contactLabel))
.addContainerGap())
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(10 , 10, 10)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(100, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(570, Short.MAX_VALUE))
);
```
The main problem I am faced is adding more than 1 dynamically I am completly unsure how to go about it as all i can find is to set the layout not update it. And I cant set how many .addcomponent as its dynamic. Really confused on how to go about this.
Sorry if its hard to work out what I am trying to get across easier to think of it but putting it into words is a nightmare.
| Adding JPanel to Jframe dynamically | CC BY-SA 2.5 | 0 | 2011-03-14T18:15:39.407 | 2011-03-14T19:30:15.907 | 2011-03-14T19:30:15.907 | 513,838 | 417,534 | [
"java",
"swing",
"jpanel"
]
|
5,302,725 | 1 | 5,302,969 | null | 0 | 4,707 | I have a checkbox that triggers a function that opens a small window with a grid and a form.
If `closeAction:'close'` the window is not reopened after closing (some error).
If `closeAction:'hide'` the window is reopened with a mess instead of its items.
I know that I can solve the problem by `id:Ext.id()` though I have other functions that are using the id's.
Is there a way to reopen the window without these problems?
Part of the function creating the window, nothing unusual:
```
var errWindow = new Ext.Window({
width:300,
title:headerStr,
closeAction:'hide',
items: [errForm,problemsGrid]
});
errWindow.show();
```
The items of the form have id's like: "textfieldNumber1". Without the id's everithing works fine, but with them I get this
| ext window with bugs on reopening | CC BY-SA 2.5 | null | 2011-03-14T18:26:34.903 | 2011-11-06T17:17:13.483 | 2011-03-14T19:33:12.813 | 533,861 | 533,861 | [
"extjs"
]
|
5,302,761 | 1 | 5,303,338 | null | 3 | 2,719 | I'm trying to use the [SQLite4Java](http://code.google.com/p/sqlite4java/) library in my java application, when I try to open the database I get the following error:
> [-93] cannot load library:
java.lang.UnsatisfiedLinkError: no
sqlite4java-win32-x86 in
java.library.path
I've tried to ensure that the library is referenced correctly:



I don't use additional libraries in Java often at all and this is the first time I have come across this, am I missing an additional setting that needs to be made?
Thanks!
| Can't resolve error ([-93] cannot load library: java.lang.UnsatisfiedLinkError:) | CC BY-SA 2.5 | null | 2011-03-14T18:30:30.200 | 2011-03-14T19:19:12.357 | null | null | 218,159 | [
"java",
"sqlite"
]
|
5,302,879 | 1 | 5,303,462 | null | 0 | 174 | The picture shows a thin (1 pixel?) white margin (marked in blue) inside the border of a JTable.
How can the margin be eliminated, or the colour be changed?
I have tried:
- -
I set both to opaque without success.
Thanks for help.

| I wanna hide this little white-thing on the JTable | CC BY-SA 2.5 | null | 2011-03-14T18:38:54.073 | 2011-03-14T19:31:09.183 | 2011-03-14T19:25:59.150 | 59,087 | 1,333,276 | [
"java",
"user-interface",
"swing",
"jtable",
"background-color"
]
|
5,302,905 | 1 | null | null | 22 | 5,444 | Has anyone run across this warning message building for the iPhone?
More importantly do you understand how to fix it?
"unsupported configuration data detection and editable"
It's seems to be the UITextView that is complaining.
Here's a screenshot.

| Curious Warning Message on UITextView | CC BY-SA 2.5 | 0 | 2011-03-14T18:40:52.710 | 2015-10-13T22:44:37.490 | null | null | 519,493 | [
"ios",
"warnings",
"uitextview",
"nib"
]
|
5,303,076 | 1 | 5,304,988 | null | 1 | 1,151 | I have a NSDatePicker (target), and datePickerAction (action)
```
- (IBAction)datePickerAction:(id)sender
{
if( [[[NSApplication sharedApplication] currentEvent] modifierFlags] &
NSShiftKeyMask )
NSLog(@"shift pressed %@", [datePicker dateValue]);
else
NSLog(@"hello %@", [datePicker dateValue]);
}
```
It works well as when I click a date in NSDatePicker object, the method(action) is called, the problem is that the method is called twice - mouse down/up.
Can I make the method called only once (up or down)?
## EDIT
I only have the method to be selected.

And this is connection inspector.

| Action is called twice (mouse up/down) when Target is clicked in Cocoa/objective-c | CC BY-SA 2.5 | null | 2011-03-14T18:56:03.273 | 2011-03-14T22:34:01.087 | 2011-03-14T22:34:01.087 | 260,127 | 260,127 | [
"objective-c",
"cocoa",
"macos",
"target",
"nsdatepicker"
]
|
5,303,193 | 1 | 5,303,430 | null | 4 | 23,805 | 
Eventually, our team would like to move away from tables, but it seems like div tags are so much harder to use. In the above image, the layout was created using a table, but I cant figure out how to get a basic column structure working using div tags. How can I get those buttons on the same line? HTML newbie here.
| Two elements on one line using div tags? | CC BY-SA 2.5 | null | 2011-03-14T19:07:03.217 | 2012-10-28T20:09:23.633 | null | null | 203,948 | [
"asp.net",
"html"
]
|
5,303,268 | 1 | null | null | 1 | 1,397 | I have a NSDatePicker in graphical mode, and I set it up this code is called every second to update the current time in NSDatePicker object (datePicker).
```
- (void) updateTimerNoOne:(NSTimer *) timer {
[datePicker setDateValue: [NSDate date]];
[datePicker setNeedsDisplay: YES];
}
```

--> reset when updateTimerNoOne is called

The problem is that when I select some date, this function always reset so that the selected date is gone.
How can I keep the selected date?
| How not to reset the selected date in NSDatePicker (objective-c/cocoa) | CC BY-SA 2.5 | 0 | 2011-03-14T19:13:36.877 | 2011-03-15T00:28:22.610 | null | null | 260,127 | [
"objective-c",
"cocoa",
"nsdatepicker"
]
|
5,303,299 | 1 | 5,303,350 | null | 3 | 207 | I am trying to write a linear-time algorithm O(n), which given a table A[0..n-1] checks if there is a pair A[i], A[j] which satisfies f(A[i], A[j]) = C .
Supposing that f(a,b) = a+b the algorithm will be:
```
Algo Paires(A[0..N-1], C)
in: Tab A[0..n-1] and C a constant
out : Boolean
Init indice ← 0
For i ← 0..n-1 do
if indice ≠ i & A[indice] + A[i] = C
return true
else if i = n-1 & indice ≤ n-2
indice++; i ← 0;
End for
return False
```
But if:

what will be the algorithm then? any suggestions ?
| Generalizing a simple linear-time algorithm | CC BY-SA 2.5 | 0 | 2011-03-14T19:15:28.803 | 2011-03-14T19:39:13.470 | 2011-03-14T19:39:13.470 | 238,419 | 476,101 | [
"algorithm",
"data-structures"
]
|
5,303,536 | 1 | null | null | 1 | 3,902 | First time working with ASP.NET charting and any help would be greatly appreciated! I'm trying to add a vertical line to an area chart like the following...

```
<asp:Chart id="chtTriage" Width="545" BackColor="#f2f2f2" runat="server">
<Series>
<asp:Series Name="srs" ChartType="Area" Color="LightGray">
<Points>
<asp:DataPoint XValue="0" YValues="1000" />
<asp:DataPoint XValue="5" YValues="2500" />
<asp:DataPoint XValue="10" YValues="6000" />
<asp:DataPoint XValue="15" YValues="4000" />
<asp:DataPoint XValue="20" YValues="2500" />
<asp:DataPoint XValue="25" YValues="2000" />
<asp:DataPoint XValue="30" YValues="1500" />
<asp:DataPoint XValue="35" YValues="1200" />
<asp:DataPoint XValue="40" YValues="1000" />
<asp:DataPoint XValue="45" YValues="500" />
<asp:DataPoint XValue="50" YValues="0" />
</Points>
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="chaTriage" BackColor="#f2f2f2">
<AxisY Title="Number of Dogs" Interval="1000" IntervalType="Number" IsMarginVisible="false">
<LabelStyle Font="Aerial, 8.25pt" />
<MajorGrid Enabled="false" />
</AxisY>
<AxisX Title="Triage Points" Interval="10" IntervalType="Number" IsStartedFromZero="true" Minimum="0" IsMarginVisible="false">
<LabelStyle Font="Aerial, 8.25pt" />
<MajorGrid Enabled="false" />
</AxisX>
</asp:ChartArea>
</ChartAreas>
</asp:Chart>
```
Has anyone ever run across this before?
Thanks!
| Adding a vertical line to an Area Chart | CC BY-SA 2.5 | 0 | 2011-03-14T19:38:03.477 | 2012-07-19T16:19:52.910 | null | null | 121,375 | [
"asp.net",
"asp.net-charts"
]
|
5,303,570 | 1 | 5,303,628 | null | 5 | 1,616 | I want to have Borderless window similar to image I have attached; how can I do this ?
Thanks
Ocean
| Borderless window in WPF | CC BY-SA 2.5 | null | 2011-03-14T19:41:58.237 | 2018-02-05T15:47:07.063 | 2011-08-16T15:46:22.183 | 305,637 | 603,781 | [
"wpf",
"wpf-controls",
"styles"
]
|
5,303,739 | 1 | 5,305,677 | null | 2 | 1,210 | I'm trying to update my (little) knowledge of OpenGL ES 1.1 to 2.0 on the iPhone. The default OpenGL ES Application template for the iPhone draws a square and makes it translate up and down and works fine. Their implementation does the math for the Y value changes on the shader itself which is pretty much useless. So, I've changed the vertext shader to:
```
uniform mat4 mvpMatrix;
attribute vec4 position;
attribute vec4 color;
varying vec4 colorVarying;
void main()
{
gl_Position = position * mvpMatrix;
colorVarying = color;
}
```
Which seems to be correct and common (from I've seen in my research). Obviously, I did the necessary changes to the code, like binding the uniform and, to help with the math, I got the sources for the esUtil.h code. On the drawing method, my code looks like this:
```
transY += 0.075f;
ESMatrix mvp, model, view;
esMatrixLoadIdentity(&view);
esPerspective(&view, 60.0, 320.0/480.0, 1.0, -1.0);
esMatrixLoadIdentity(&model);
esTranslate(&model, sinf(transY), 0.0f, 0.0f);
esMatrixLoadIdentity(&mvp);
esMatrixMultiply(&mvp, &model, &view);
glUniformMatrix4fv(uniforms[UNIFORM_MVPMATRIX], 1, GL_FALSE, (GLfloat *)&mvp);
```
And that should be working but, unfortunately, what I get is quite different from a simple translation.

I've restarted the template a few times but I can't figure out what I'm doing wrong here... Rotating seems to be working as expected, I believe...
Any help would be appreciated.
| Translating square with shaders on iPhone | CC BY-SA 2.5 | null | 2011-03-14T19:57:54.470 | 2012-09-01T10:54:48.557 | null | null | 207,399 | [
"iphone",
"opengl-es-2.0"
]
|
5,304,099 | 1 | 5,304,400 | null | 0 | 1,506 | Hy!!
My error code:
```
Exception in thread "main" java.lang.NullPointerException
at lesebank.Konto.getKontofromID(Konto.java:39)
at lesebank.Main.main(Main.java:18)
SQL EXCEPTIONJava Result: 1
BUILD SUCCESSFUL (total time: 1 second)
```
Method:
```
Konto konto = new Konto ();
Statement s = dbconn.getSt();
try
{ //in the next line the error occurs
s.execute("select id,inhaberin,ktostd,habenzinsen,notiz from Konto where id = " +id);
ResultSet set = s.getResultSet();
if (set.next())
{
konto.setId(set.getInt(1));
konto.setId_inhaberin(set.getInt(2));
konto.setKtostd(set.getDouble(3));
konto.setHabenzinsen(set.getDouble(4));
konto.setNotiz(set.getString(5));
return konto;
}
}
catch (SQLException ex)
{
System.out.print(ex.getMessage());
}
return null;
```
DBConn:
```
public class DBConnection {
private String url = "jdbc:derby://localhost:1527/Bank";
private Connection conn;
private Statement st;
public DBConnection() {
try
{
conn = DriverManager.getConnection(this.url, "test", "test");
st = conn.createStatement();
}
catch (SQLException ex)
{
System.out.print("SQL EXCEPTION");
}
}
public Statement getSt() {
return st;
}
```
Database:

Please help
| Nullpointer Exception (Derby, JDBC) | CC BY-SA 2.5 | 0 | 2011-03-14T20:27:59.270 | 2011-03-14T21:00:32.740 | 2011-03-14T20:43:34.623 | 547,995 | 547,995 | [
"java",
"exception",
"jdbc",
"nullpointerexception",
"derby"
]
|
5,304,231 | 1 | 5,304,651 | null | 0 | 413 | I have a problem while installing drupal 7, despite the sqlite version being 3.7.5, and I have MySql database installed

| Database configuration while installing Drupal 7 | CC BY-SA 2.5 | null | 2011-03-14T20:40:41.333 | 2011-03-14T21:15:32.170 | 2011-03-14T20:43:47.747 | 327,563 | 508,377 | [
"php",
"mysql",
"drupal",
"sqlite"
]
|
5,304,228 | 1 | 5,304,600 | null | 7 | 18,536 | I've no clue at design, and I'm trying to get a simple HTML form to look like this:
.
Basically, it's a form with input fields and submit button.
Regarding the input fields, there are and . I'd like these to be perfectly centre-aligned with each other and the second one to stretch to be the same width as the ones above.
Regarding the submit button, I'd like it to be perfectly center-aligned, both horizontally and vertically, with the input fields, but be to the right of these.
I'm not too worried about it not being fully cross-browser.
Thanks for pointers!
: I'd prefer if it were done with CSS rather than be table-based. (I hear table-based is just plain evil.)
| How to align multiple form elements? | CC BY-SA 2.5 | 0 | 2011-03-14T20:40:38.473 | 2011-03-14T21:11:38.527 | 2011-03-14T21:07:45.797 | 92,272 | 92,272 | [
"html",
"css",
"web"
]
|
5,304,361 | 1 | 5,305,746 | null | 0 | 1,439 | Recently, I have been working in a generic inscription system to help students to register in a class or a lab. But I have problems with the logic of ManyToManyField in the Lab class.
```
from django.db import models
from django.contrib.auth.models import User
class Day(models.Model):
name = models.CharField(max_length=20, primary_key=True)
def __unicode__(self):
return u"%s" % self.name
class LabName(models.Model):
lab_name = models.CharField(max_length=50, primary_key=True)
class Meta:
verbose_name_plural = 'LabNames'
def __unicode__(self):
return u'%s' % self.lab_name
class Lab(models.Model):
name = models.ForeignKey(LabName)
start_hour = models.TimeField()
length = models.IntegerField(help_text="Given in minutes")
classDays = models.ManyToManyField(Day)
start_date = models.DateField()
finish_date = models.DateField()
max_cap = models.SmallIntegerField(help_text="Maximun number of students")
teacher = models.ForeignKey(User, related_name="Teachers")
students = models.ManyToManyField(User)
class Meta:
verbose_name_plural = 'Labs'
def __unicode__(self):
return u"%s %s" % (self.id, self.name)
```
I would prefer to associate an specific Group (`django.contrib.auth.models.Group`) called 'Students' rather than all the users or at least filter and/or validate this field to just add and view students and also do the same with the teacher field.
I just noticed that maybe I could filter those users who are in a certain group using the optional parameter `limit_choices_to`.
The question is:
How can I use the `limit_choices_to` parameter to show only those users who are in the 'Students' group or the 'Teachers' group?

| Django auth group model m2m | CC BY-SA 2.5 | null | 2011-03-14T20:51:38.660 | 2011-03-14T23:12:11.443 | 2011-03-14T22:17:17.120 | 371,342 | 371,342 | [
"python",
"django"
]
|
5,304,679 | 1 | 5,304,991 | null | 0 | 583 | I am trying to retrieve all the rows that are in my database with the following code:

I have created a class that holds two objects, simply for the purpose of testing whether the code works or not (It will be expanded for the chance of differing amounts of columns at a later date) .
When execution reaches the if statement, it evaluates to false and breaks out of the loop even though this tool shows there is inface data inside of it:

The sample on the authors website seems to be similar and searches for better examples have returned nothing of use.
Where am I going wrong, is it my initial configuration of the SQL statement or is it the way I am handling the query returned?
Thanks.
| hasRow returns false on populated database - SQLite4Java | CC BY-SA 2.5 | 0 | 2011-03-14T21:19:32.710 | 2011-03-14T21:48:09.140 | null | null | 218,159 | [
"java",
"database",
"sqlite",
"netbeans"
]
|
5,304,791 | 1 | 5,304,865 | null | 2 | 220 | I have this div:
```
<div class="product-name">Product1</div>
```
I also have this div:
```
<div class="product-name gold">Product2</div>
```
How can I alter this xpath query to get whatever divs which product-name? Instead of getting an exact match.
```
/html/body//div[@class='product-name']
```
I googled it, but all I could find is how to use `contains` when searching for a value within a node, and not an attribute.

| php simple xpath question | CC BY-SA 2.5 | null | 2011-03-14T21:29:51.883 | 2011-03-14T23:02:41.313 | 2011-03-14T21:50:17.943 | 407,943 | 407,943 | [
"php",
"xpath"
]
|
5,305,108 | 1 | 5,305,178 | null | 2 | 2,771 | I want to scale images to fit with in some predefined size without affecting the actual image's aspect ratio.
Do we have any predefined algorithms for that in java?
Resizing Like this. The output is the same image but in smaller size. The outside frame is just a mark.

| How to calculate new height and width for an image to fit with in predefined height and width, without affecting the image real aspect ratio in java? | CC BY-SA 2.5 | null | 2011-03-14T22:00:56.747 | 2011-03-14T22:19:15.467 | 2011-03-14T22:19:15.467 | null | null | [
"java"
]
|
5,305,423 | 1 | null | null | 3 | 5,953 | I have a `NSDatePicker (NSDatePicker* datePicker)`, and set its delegate as the main application (`self`). I programmed as follows.
1. Make self datePicker delegate [[datePicker cell] setDelegate:self];
2. Set datePickerAction: to be called when control is clicked. [datePicker setAction:@selector(datePickerAction:)];
This is the method.
```
- (IBAction)datePickerAction:(id)sender
{
if( [[[NSApplication sharedApplication] currentEvent] modifierFlags] &
NSShiftKeyMask )
NSLog(@"shift pressed %@", [datePicker dateValue]);
else
NSLog(@"hello %@", [datePicker dateValue]);
}
```
The problem is that delegation doesn't seem to work when I click the date in the NSDatePicker calendar.

- [target/action](https://stackoverflow.com/questions/5303076/action-is-called-twice-mouse-up-down-when-target-is-clicked-in-cocoa-objective)-
| Setting up NSDatePicker delegate | CC BY-SA 2.5 | null | 2011-03-14T22:32:57.890 | 2016-09-03T04:40:24.580 | 2017-05-23T12:01:45.900 | -1 | 260,127 | [
"objective-c",
"cocoa",
"macos",
"nsdatepicker"
]
|
5,305,462 | 1 | null | null | 2 | 621 | When I have buttons near the button of the screen, the tooltip appears underneath the mouse. Clicking will then make the tooltip disappear, instead of clicking the button.

```
public static void main(String[] args) {
JFrame frame = new JFrame("Test");
JButton button = new JButton("Test");
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.out.println("action performed");
}
});
button.setToolTipText("Sample tooltip text");
frame.add(button);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
frame.pack();
}
```
Any idea how to ensure that the button receives the click in this case?
| Tooltip stealing mouse events | CC BY-SA 2.5 | null | 2011-03-14T22:37:38.170 | 2011-05-03T07:13:55.710 | null | null | 120,191 | [
"swing",
"tooltip",
"mouseevent"
]
|
5,305,519 | 1 | 5,305,653 | null | 21 | 3,466 | I've run into a bit of a snag, is it just me or can you not assign an image from a resource to TSpeedButton's glyph without a hideous black outline as shown below?
I've assigned it exactly the same way for the TImage component and I'm getting the result needed.
I've been searching for quite a while but no one seems to have this bizarre and annoying problem.
Here's my source code for the form below:
```
procedure TForm3.Button1Click(Sender: TObject);
var r : tresourcestream; png : tpngimage;
begin
r := tresourcestream.CreateFromID(hinstance,34,'cardimage');
png := tpngimage.Create;
png.LoadFromStream(r);
png.AssignTo(image1.Picture.bitmap);
png.AssignTo(speedbutton1.glyph);
png.Free;
r.Free;
end;
```
34 is the image of type 'cardimage' that relates to the image being shown in the picture if you haven't guessed already.

| Is it possible to remove hideous outline around a TSpeedButton glyph? | CC BY-SA 3.0 | 0 | 2011-03-14T22:43:39.393 | 2019-07-30T10:42:01.787 | 2011-08-23T17:03:06.457 | 650,492 | 659,688 | [
"delphi",
"glyph"
]
|
5,305,563 | 1 | null | null | 0 | 254 | I want to create a custom view in a Cocoa application. It's basically a record view, where the data from multiple database fields is displayed in a long list. Here's a quick mockup:

Now there are several things to consider:
- - -
I already have some experience in Cocoa, but I don't know how I should best create this basic layout. In iOS I would probably use a UITableView with custom cells, but NSTableView is very different and probably not suited for this application.
Several ideas come to my mind:
1. Just use a WebView and create the layout as HTML. I have a lot of experience with HTML, so layouting should be easy. On the other hand, this seems like a dirty hack.
2. Use an NSAttributedString. Since this layout is mostly text, this should be possible. Then just put that into a read-only NSTextView. It might be hard to get the layout pixel-perfect.
3. Create a lot of NSTextFields and NSBoxes programmatically. Layouting will be complicated and involve a lot of mathematics (but I like maths, so that's okay)
4. Make a custom view and do all drawing in drawRect:
What is the best solution? I'm overwhelmed by the amount of choices that are available, and I can't see which solution is cleanest. Does anybody have experience with creating dynamic data views?
| Custom Record View in Cocoa Application | CC BY-SA 2.5 | 0 | 2011-03-14T22:49:36.717 | 2011-03-15T10:18:06.790 | null | null | 322,427 | [
"objective-c",
"cocoa",
"nsview"
]
|
5,305,740 | 1 | null | null | 7 | 12,207 | I have a gridpanel and 5 columns in that. Problem is that column headers and row data are not aligned. I believe its just the problem in my project only as when i create an example with the same code then everything works fine. Check the following image:

Can anyone suggest what could be the problem?
| extjs - column headers and row data are not aligned | CC BY-SA 3.0 | 0 | 2011-03-14T23:11:35.333 | 2017-07-27T08:25:21.387 | 2012-10-21T22:44:46.960 | 427,969 | 427,969 | [
"extjs",
"grid"
]
|
5,306,191 | 1 | 5,308,076 | null | 0 | 216 | Hi I get an error running this code in mono tools?
Unsure how to fix?
```
using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.Odbc;
using System.Data.SqlClient;
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Login1.Authenticate += Login1_Authenticate;
}
protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
{
OdbcConnection cn = new OdbcConnection("Driver={MySQL ODBC 3.51 Driver}; Server=localhost; Database=gymwebsite; User=root; Password=commando; OPTION=3;");
cn.Open();
OdbcCommand cmd = new OdbcCommand("Select * from login where username=? and password=?", cn);
//Add parameters to get the username and password
cmd.Parameters.Add("@username", OdbcType.VarChar);
cmd.Parameters["@username"].Value = this.Login1.UserName;
cmd.Parameters.Add("@password", OdbcType.VarChar);
cmd.Parameters["@password"].Value = this.Login1.Password;
OdbcDataReader dr = default(OdbcDataReader);
// Initialise a reader to read the rows from the login table.
// If row exists, the login is successful
dr = cmd.ExecuteReader();
if (dr.HasRows)
{
e.Authenticated = true;
Response.Redirect("UserProfileWall.aspx");
// Event Authenticate is true
}
}
}
```
ystem.NotImplementedException: The requested feature is not implemented. Error 500
| Error 500 using odbc in monotools? | CC BY-SA 2.5 | null | 2011-03-15T00:23:59.313 | 2011-03-15T06:04:40.787 | 2011-03-15T05:55:37.770 | 477,228 | 477,228 | [
"c#",
"asp.net",
"mono",
"monodevelop"
]
|
5,306,491 | 1 | 5,308,073 | null | 4 | 544 | I've got a query that's supposed to return 2 rows. However, it returns 48 rows. It's acting like one of the tables that's being joined isn't there. But if I add a column from that table to the select clause, with no changes to the from or where parts of the query, it returns 2 rows.
Here's what "Explain plan" says without the "m.*" in the select:

Here it is again after adding m.* in the select:

Can anybody explain why it should behave this way?
: We only had this problem on one system and not another. The DBA verified that the one with the problem is running optimizer_features_enable set to 10.2.0.5, and the one where it doesn't happen is running optimizer_features_enable set to 10.2.0.4. Unfortunately the customer site is running 10.2.0.5.
| Query does cartesian join unless | CC BY-SA 2.5 | 0 | 2011-03-15T01:19:53.973 | 2011-05-18T10:04:04.293 | 2011-03-15T15:20:14.323 | 3,333 | 3,333 | [
"oracle",
"join",
"cartesian"
]
|
5,306,527 | 1 | 5,309,183 | null | 0 | 236 | I have the x,y co-ordinates for a bounding ellipsoid in a data.frame. And then I have several `query` x,y co-ordinates in a data.fame. The x,y co-ordinates for a bounding ellipsoid was calculated using the function...
```
exy <- ellipsoidhull(X[,1:2])
```
such that....
```
plot(predict(exy), xlim=c(-0.018, 0.015), ylim=c(-0.018,0.015),
cex=0.1, type="l")
```
gives me a plot like this....

I have query like this....
```
V2 V3
-0.0167 -0.0137
-0.0159 -0.0127
-0.0150 -0.0127
-0.0164 -0.0137
-0.0164 -0.0134
-0.0173 -0.0131
```
How can I find which of the `query` is within/outside the bounding ellipsoid? Is there an R function to do this? Thanks
| query x,y coordinates inside/outside bounding ellipsoid | CC BY-SA 4.0 | null | 2011-03-15T01:26:18.310 | 2022-06-08T16:47:51.467 | 2022-06-08T16:47:51.467 | 7,327,058 | 645,600 | [
"r",
"plot",
"ellipse"
]
|
5,306,717 | 1 | null | null | 22 | 1,734 | I have a server process implemented in haskell that acts as a simple in-memory db. Client processes can connect then add and retrieve data. The service uses more memory than I would expect, and I'm attempting to work out why.
The crudest metric I have is linux "top". When I start the process I see an "VIRT" image size of ~27MB. After running a client to insert 60,000 data items, I see an image size of ~124MB.
Running the process to capture GC statistics (+RTS -S), I see initially
```
Alloc Copied Live GC GC TOT TOT Page Flts
bytes bytes bytes user elap user elap
28296 8388 9172 0.00 0.00 0.00 0.32 0 0 (Gen: 1)
```
and on adding the 60k items I see the live bytes grow smoothly to
```
...
532940 14964 63672180 0.00 0.00 23.50 31.95 0 0 (Gen: 0)
532316 7704 63668672 0.00 0.00 23.50 31.95 0 0 (Gen: 0)
530512 9648 63677028 0.00 0.00 23.50 31.95 0 0 (Gen: 0)
531936 10796 63686488 0.00 0.00 23.51 31.96 0 0 (Gen: 0)
423260 10047016 63680532 0.03 0.03 23.53 31.99 0 0 (Gen: 1)
531864 6996 63693396 0.00 0.00 23.55 32.01 0 0 (Gen: 0)
531852 9160 63703536 0.00 0.00 23.55 32.01 0 0 (Gen: 0)
531888 9572 63711876 0.00 0.00 23.55 32.01 0 0 (Gen: 0)
531928 9716 63720128 0.00 0.00 23.55 32.01 0 0 (Gen: 0)
531856 9640 63728052 0.00 0.00 23.55 32.02 0 0 (Gen: 0)
529632 9280 63735824 0.00 0.00 23.56 32.02 0 0 (Gen: 0)
527948 8304 63742524 0.00 0.00 23.56 32.02 0 0 (Gen: 0)
528248 7152 63749180 0.00 0.00 23.56 32.02 0 0 (Gen: 0)
528240 6384 63756176 0.00 0.00 23.56 32.02 0 0 (Gen: 0)
341100 10050336 63731152 0.03 0.03 23.58 32.35 0 0 (Gen: 1)
5080 10049728 63705868 0.03 0.03 23.61 32.70 0 0 (Gen: 1)
```
This appears to be telling me that the heap has ~63MB of live data. This could well be consistent with numbers from top, by the time you add on stack space, code space, GC overhead etc.
So I attempted to use the heap profiler to work out what's making up
this 63MB. The results are confusing. Running with "+RTS -h", and looking at the
generated hp file, the last and largest snapshot has:
```
containers-0.3.0.0:Data.Map.Bin 1820400
bytestring-0.9.1.7:Data.ByteString.Internal.PS 1336160
main:KV.Store.Memory.KeyTree 831972
main:KV.Types.KF_1 750328
base:GHC.ForeignPtr.PlainPtr 534464
base:Data.Maybe.Just 494832
THUNK 587140
```
All of the other numbers in the snapshot are much smaller than this.
Adding these up gives the peak memory usage as ~6MB, as reflected in the
chart output:

Why is this inconsistent with the live bytes as shown in the GC statistics? It's
hard to see how my data structures could be requiring 63MB, and the
profiler says they are not. Where is the memory going?
Thanks for any tips or pointers on this.
Tim
| How should I interpret the output of the ghc heap profiler? | CC BY-SA 2.5 | 0 | 2011-03-15T02:03:40.890 | 2011-06-15T21:33:54.207 | 2011-03-15T04:41:08.570 | 659,817 | 659,817 | [
"haskell"
]
|
5,306,739 | 1 | null | null | 0 | 1,218 | I have a list of vertically-aligned images surrounded with anchor tags. Each anchor tag has a rel='tipsy' attribute and a title attribute with the content of the html that should go in the tipsy tooltip. When I hover over one of the images, its tooltip renders properly, but its position is always on the top image.
Here is the javascript snippet that I have on the page:
```
$(function() {
$('a[rel=tipsy]').tipsy({fade: true, gravity: 'w', fallback: "Couldn't Load Info!", html : true, delayIn: 450, delayOut:50, offset:0, opacity:1.0, title:'title', trigger:'hover', live:true });
});
```
In the screenshot below, the mouspointer was actually on the lower image, but the tooltip's position is on the first. When I hover over the first image, the tooltip content changes accordingly, but the position is still the same. And the position would also stay the same if I hovered more images in case they were there.

| Tipsy is showing various tooltips at the same position | CC BY-SA 2.5 | null | 2011-03-15T02:07:29.103 | 2012-02-10T02:20:06.050 | 2020-06-20T09:12:55.060 | -1 | 84,098 | [
"jquery",
"html",
"jquery-plugins"
]
|
5,306,917 | 1 | 5,307,208 | null | 1 | 133 | I'm new to multi-threading and I have been doing a Proof-of-Concept, I've also 'discovered' the (VS2008) Threads Window:

: how can I "link" the running threads to my code?
For example, how would I get the Thread ID (as shown in the Threads Window) so that I could log it (for example); , the BeginInvoke() method takes a 'id' argument (string) which I have set (as "Service A" in the example below) but I can't see it in the Threads Window.
The thing that interests me is that I'm sparking up parallel threads of execution using AsyncCallbacks and BeginInvoke() but I can only see two worker threads in the Threads Window at a point where i think I should see three. Actually I think I can - the three worker threads with the 'Name' as `<No Name>`.
For reference here's some of the code I'm using:
```
// Creating the call back and setting the call back delegate
AsyncCallback callBackA = new AsyncCallback(AsyncOperationACompleted);
// callBackB ...
// callBackC ...
// Create instances of the delegate, which calls the method we want to execute
callerA = new DumbEndPoint.AsyncMethodCaller(DumbEndPoint.PretendWorkingServiceCall);
// callerB ...
// callerC ...
// sleep = thread sleep time in milliseconds
IAsyncResult resultA = callerA.BeginInvoke(sleep, "Service A", callBackA, null);
// resultB ...
// resultC ...
// I expect to see three threads in the Threads Window at this point.
```
I'm then getting the results in the call back delegate:
```
private void AsyncOperationACompleted(IAsyncResult result)
{
try
{
string returnValue = callerA.EndInvoke(result);
mySmartDTO.ServiceDataA = returnValue;
}
catch (Exception ex)
{
// logging
...
}
}
```
| Trying to interpret (VS2008) Threads Window with whats actually executing | CC BY-SA 2.5 | null | 2011-03-15T02:36:04.123 | 2011-03-15T03:27:57.490 | null | null | 39,094 | [
"c#",
".net",
"visual-studio",
"multithreading",
"asynchronous"
]
|
5,307,244 | 1 | 5,307,545 | null | 5 | 2,658 | I'm making a small interface for calculating voltage dividers in Mathematica. I have two sliders (z1 & z2) that represent the resistor values and a couple of sliders to represent Vin as a sinusoid.
The issue is that the range of available resistor values (in the real world) is roughly logarithmic on `{r, 100, 1,000,000}`. If I set my slider range to `r`, however, it's impractical to select common low resistor values in approx. `{100, 10,000}`.
Is it possible to create a slider that sweeps through a logarithmic range?
`````
Manipulate[
Grid[{{Plot[(VinRCos[t] + VinC), {t, -3, 9},
PlotRange -> {-1, VMax}, AxesLabel -> {t, Vin}]}, {Plot[
z2/(z1 + z2)(VinR*Cos[t] + VinC), {t, -3, 9},
PlotRange -> {-1, VMax}, AxesLabel -> {t, Vout}]}},
ItemSize -> 20],
{{z1, 10000}, 10, 1000000, 10}, {z1}, {{z2, 10000}, 10,
1000000}, {z2}, Delimiter, {{VinR, 2.5}, 0,
5}, {VinR}, {{VinC, 2}, -VMax, VMax}, {VinC}]
```

| Logarithmic Slider Control in Mathematica | CC BY-SA 3.0 | 0 | 2011-03-15T03:34:53.697 | 2014-01-31T06:15:11.383 | 2012-01-03T21:46:37.630 | 615,464 | 14,572 | [
"user-interface",
"widget",
"wolfram-mathematica"
]
|
5,307,332 | 1 | 5,307,451 | null | 0 | 1,491 | i am newbie with android sqlite database. now i just try to create my custom database manager and i got the error at oncreate() function. I already spent 3 days to figure it out but unfortunately i am still stuck in it. Any brilliant idea would be appreciate.
```
public class DBManager extends SQLiteOpenHelper {
private SQLiteDatabase db;
private static Context myContext;
public static final String DB_NAME = "goldenland.db";
public static final String TB_CAT = "tbl_categories";
public static final String TB_ARTICLE = "tbl_articles";
public static final String TB_SUBCAT = "tbl_subcategories";
public static final String TB_SCHEDULE = "tbl_schedule";
public static final String TB_CONTENT = "tbl_contents";
public static final String TB_CITY = "tbl_cities";
public static final String name = "name";
public static String DB_PATH = "/data/data/com.gokiri.goldenland/databases/";
public DBManager(Context context) {
super(context, DB_NAME, null, 1);
DBManager.myContext = context;
}
public void createDataBase() throws IOException {
boolean dbExit = checkDataBase();
if (dbExit) {
System.out.println("Testing");
} else {
this.getReadableDatabase();
try {
copyDataBase();
} catch (IOException e) {
throw new RuntimeException(e.getMessage());
}
}
}
private boolean checkDataBase() {
SQLiteDatabase checkDb = null;
try {
String myPath = DB_PATH + DB_NAME;
checkDb = SQLiteDatabase.openDatabase(myPath, null,
SQLiteDatabase.OPEN_READWRITE);
} catch (SQLException e) {
}
if (checkDb != null) {
checkDb.close();
}
return checkDb != null ? true : false;
}
public void copyDataBase() throws IOException {
InputStream myInput = myContext.getAssets().open("goldenland_2.sqlite");
String outFileName = DB_PATH + DB_NAME;
OutputStream myOutput = new FileOutputStream(outFileName);
byte[] buffer = new byte[1024];
int length;
while ((length = myInput.read(buffer)) > 0) {
myOutput.write(buffer, 0, length);
}
myOutput.flush();
myOutput.close();
myInput.close();
}
public void openDatabase() throws SQLiteException {
String myPath = DB_PATH + DB_NAME;
db = SQLiteDatabase.openDatabase(myPath, null,
SQLiteDatabase.OPEN_READWRITE);
}
```

| Android sqlite creating database error | CC BY-SA 2.5 | 0 | 2011-03-15T03:49:43.247 | 2011-03-15T06:14:48.593 | null | null | 405,219 | [
"java",
"android",
"database",
"sqlite"
]
|
5,307,418 | 1 | 5,680,439 | null | 3 | 9,701 | Maven nube here.
How does one add a remote repository in STS.
pic 1) In preferences I added the [apache maven snapshot repository archetype catalog](https://repository.apache.org/content/repositories/snapshots/archetype-catalog.xml)
pic 2) But, dosent show up in the "Maven repository" window. Any help ?
pic 3) Is this a problem that I am missing the settings file ?
Am using the latest STS for Mac OS X 2.5.2SR1

but dosent show up here

Is this a problem that I am missing the settings file ?

| STS ( Eclipse ) maven adding remote repository | CC BY-SA 2.5 | 0 | 2011-03-15T04:04:58.843 | 2011-05-25T22:07:52.660 | 2011-03-15T04:13:55.610 | 479,805 | 479,805 | [
"eclipse",
"maven"
]
|
5,307,699 | 1 | 5,307,736 | null | 3 | 9,041 | Extract Images (any kind) from a ImageList and save it as a file with extension

| VB6 Extract Images (any kind) from a ImageList | CC BY-SA 2.5 | null | 2011-03-15T05:01:08.850 | 2011-06-01T13:31:24.233 | 2011-03-15T05:05:26.573 | 366,904 | 448,084 | [
"vb6",
"image-manipulation",
"imagelist"
]
|
5,307,954 | 1 | null | null | 1 | 6,262 | I am using draggable with the following options:
```
$("#accountDetailPanel .draggable").draggable({
helper: 'clone',
appendTo: 'body',
cursor: 'move',
revert: 'invalid'
});
$(".accountPod").droppable({ accept: '.draggable' });
```
I'm applying draggable to the content of the 2nd tab of a jquery UI tab upon load:

The issue is only the first drag works fine. When I don't drop the draggable into an acceptable droppable, the pod reverts back but I can't do another drag. No matter what, the dragged pod loses its draggableness.

In attempting to apply a stop function to the draggable init put me on a path to needing to nest infinite .draggable calls.
The full script:
```
$(document).ready(function(){
$("#tabs").tabs();
/**
* Click on account pod -> account detail pane is populated
* Inside account detail, tabs pulled dynamically
* Installation List - each installation (home) is movable
*/
$(".accountPod").live("click", function(event){
var account_id = $(this).attr("id").replace("acct_", "");
// load user's details into tab panel (replace all tabs)
$("#accountDetailPanel").load("/accountDetail/" + account_id, function(){
// post-load of tabs html
$("#tabs").tabs();
// init draggables
$("#accountDetailPanel .draggable").draggable({
helper: 'clone',
appendTo: 'body',
cursor: 'move',
revert: 'invalid'
});
$(".accountPod").droppable({ accept: '.draggable' });
});
});
});
```
Since this fiddle works: [http://jsfiddle.net/notbrain/DycY6/41/](http://jsfiddle.net/notbrain/DycY6/41/) I'm definitely thinking it's related to the dynamic application of .draggable() when the tabs are loaded.
Any pointers are greatly appreciated!
| jquery UI draggable helper: clone removes draggable from original? | CC BY-SA 2.5 | null | 2011-03-15T05:45:00.740 | 2011-07-13T23:17:50.037 | 2011-03-15T06:51:48.657 | 124,563 | 124,563 | [
"jquery",
"jquery-ui-tabs",
"jquery-ui-draggable"
]
|
5,307,980 | 1 | null | null | 0 | 662 | I need to a form for invoicing,
Please help me to have some Idea how to insert all the data at once into invoice table.
I am using text box to get all details for items .
here is the code for get details of items from table.
```
enter code here<% While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))%>
<tr>
<td><input name="dipatchid" type="text" id="dipatchid" value="<%=(Recordset1.Fields.Item("dispatchid").Value)%>" size="5" /></td>
<td><input name="dispatchdate" type="text" id="dispatchdate" value="<%=(Recordset1.Fields.Item("dis_date").Value)%>" /></td>
<td><input type="hidden" name="custid_" id="custid_" />
<input name="From_" type="text" id="From_" value="<%=(Recordset1.Fields.Item("from_").Value)%>" /></td>
<td><input name="to_" type="text" id="to_" value="<%=(Recordset1.Fields.Item("To_").Value)%>" /></td>
<td><input name="hrs" type="text" id="hrs" value="<%=(Recordset1.Fields.Item("total_hrs").Value)%>" size="5" /></td>
<td><input name="rate_" type="text" id="rate_" size="8" /></td>
<td><input name="totalamt" type="text" id="totalamt" size="10" /></td>
<td><img src="imgs/error_icon.png" width="16" height="16" alt="Remove" /></td> </tr>
<% Repeat1__index=Repeat1__index+1 Repeat1__numRows=Repeat1__numRows-1 Recordset1.MoveNext() Wend %>
```

| Invoicing in classic Asp + Ajax | CC BY-SA 2.5 | null | 2011-03-15T05:50:37.440 | 2011-11-19T02:45:22.987 | 2011-11-19T02:45:22.987 | 50,776 | 195,790 | [
"asp-classic",
"invoice"
]
|
5,308,863 | 1 | 5,308,909 | null | 2 | 2,053 | Please refer to the following image:

I wanted to group the controls like that. Beside Email, Calendar, and Tasks, there's a line drawn. I searched, but I don't think I got anywhere close to finding the solution. They all point to drawing using GDI, whatever that is. Even fiddled with the group box with no use.
| How can I draw an etched 3D line on a WinForm? | CC BY-SA 2.5 | 0 | 2011-03-15T07:54:08.507 | 2011-03-15T08:01:26.020 | 2011-03-15T07:59:33.523 | 366,904 | 595,119 | [
"c#",
".net",
"winforms",
"controls"
]
|
5,308,873 | 1 | null | null | 1 | 1,313 | For my scenario, I have a UITableView with a UITextField for the first row. While I try to set custom toolbar for keyboard with UITextField.inputAccessoryView, it pushed my first row of textfield partially off the screen. This is not happening if I avoid adding the toolbar. Refer screen shot below:

I tried with NSNotification with keyboardWillShow by reposition to first row of the tableview, but it just look awkward for the table pulling out and in. It might be something to do overriding UITableView/UIScrollView, but I am out of idea how to do this.
Would like to know how you guys resolve this.
Thanks you!
| Custom inputAccessoryView push my UITableView first row partially off the screen | CC BY-SA 2.5 | null | 2011-03-15T07:55:24.300 | 2011-03-19T00:07:36.600 | 2011-03-15T08:19:22.427 | 30,461 | 572,438 | [
"iphone",
"cocoa-touch",
"ios",
"uikit"
]
|
5,309,010 | 1 | 5,322,941 | null | 0 | 1,168 | I can't solve a problem ... And asking this question for second time.
I want to describe my problem: I write class MiniBrowser inherit from UIViewController
```
@interface MiniBrowser : UIViewController <UIWebViewDelegate>{
IBOutlet UIWebView *webView;
}
@property(nonatomic,retain) IBOutlet UIWebView *webView;
@end
```
How you can see in this class I have a webViwe in witch I want to show some html code.

Now I want to but I can't !!! I Read [this](http://mithin.in/2009/08/26/detecting-taps-and-events-on-uiwebview-the-right-way) article and test in this way but nothing happen !!! I am trying to catch touchesBegan event but it's never called !!! Who have any suggestion or any example of code please help me !!!
Thanks for answering this question !!!
| WebView and touchesBegan event not rising ! | CC BY-SA 2.5 | null | 2011-03-15T08:12:47.907 | 2011-05-24T21:57:14.980 | null | null | 612,606 | [
"iphone",
"events",
"uiwebview",
"uiviewcontroller",
"try-catch"
]
|
5,309,279 | 1 | null | null | 19 | 11,774 | When I'm using a 3rd party l
ibrary such as [boto](http://code.google.com/p/boto/), PyCharm seems to be able to auto-complete quite nicely

However, as soon as I define a function of my own, auto-complete breaks down inside that function. I understand why, since I can't give the function any type information about its arguments, so it can't guess how to auto-complete. Is there a way around this issue?
I tried using the docstring (for Python 2), but still no auto-complete
```
def delete_oldest_backups(conn, backups_to_keep, backup_description):
"""
delete_oldest_backups(EC2Connection, int, string)
"""
```
(Also tried `boto.ec2.connection.EC2Connection` instead of just `EC2Connection`)
| How to get PyCharm to auto-complete code in methods? | CC BY-SA 2.5 | 0 | 2011-03-15T08:42:59.460 | 2014-03-14T10:34:36.853 | 2011-03-15T13:37:33.213 | 11,236 | 11,236 | [
"python",
"autocomplete",
"pycharm"
]
|
5,309,363 | 1 | null | null | 1 | 270 | I am using a modified version of [LazyTableImages sample code](http://developer.apple.com/library/ios/#samplecode/LazyTableImages/Introduction/Intro.html#//apple_ref/doc/uid/DTS40009394) provided by apple. During testing, found there are few memory leaks in the code. I have tested the original code given by apple and found the same leaks(464 Bites).
 Anybody managed to fix this? appreciate your help.
| Memory leak in Apple's LazyTableImages Sample code | CC BY-SA 2.5 | 0 | 2011-03-15T08:50:17.880 | 2011-03-15T14:27:29.050 | null | null | 466,066 | [
"iphone",
"objective-c",
"cocoa-touch",
"uitableview",
"memory-leaks"
]
|
5,309,406 | 1 | 5,309,569 | null | 1 | 252 | I am using an `AutoCompleteEditText` and I want to make it appearance as 
But I don't know how it will be.
| AutoCompleteEditText selector, how it will be? | CC BY-SA 2.5 | null | 2011-03-15T08:54:53.207 | 2011-03-15T09:11:08.293 | null | null | 550,966 | [
"android",
"autocomplete",
"android-widget",
"css-selectors"
]
|
5,309,532 | 1 | 5,401,249 | null | 0 | 436 | we are creating one jQuery mobile app in that app, I have to bind the webservice data in to list in HTML and when I click the first items in the list, it redirect to second page which I created in same page seperated with div tag and display the relavent information which i selected from the list. In addition to that i stored the web service result in an array.
```
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>Test</title><br />
<link rel="stylesheet" href="jquery.mobile-1.0a3.min.css" />
<script type="text/javascript" src="jquery-1.5.min.js"></script>
<script type="text/javascript" src="jquery.mobile-1.0a3.min.js"></script>
<script type="text/javascript">
function GetSelectedValut()
{
var list_value = $(this).attr('searchlist');
alert(list_value);
}
</script>
</head>
<body>
<!-- Page one starts-->
<div data-role="page" id="pageone">
<div data-role="header">
<h1>Header </h1>
</div>
<div data-role="content" id="page1content">
<ul data-role="listview" data-inset="true" id="searchlist">
<li id="search">
<a href="#pagetwo" value="Selected one" onclick="GetSelectedValut()">Selected one</a>
</li>
<li id="search1" onclick="GetSelectedValut()">
<a href="#detailpage">Selected two</a>
</li>
<li>
<a href="#detailpage">Selected three</a>
</li>
<li>
<a href="#detailpage">Selected four</a>
</li>
<li>
<a href="#detailpage">Selected five</a>
</li>
<li>
<a href="#detailpage">Selected six</a>
</li>
</ul>
</div>
<div data-role="footer">
<h1>Footer</h1>
</div>
</div>
<!-- Page one ends-->
<!-- Page two starts-->
<div data-role="page" id="pagetwo">
<div data-role="header">
<h1>Header</h1>
</div>
<div data-role="content">
Welcome to Div two
</div>
<div data-role="footer">
<h1>Footer</h1>
</div>
</div>
<!-- page two ends -->
</body>
</html>
```

| error when getting value from list in html? | CC BY-SA 2.5 | 0 | 2011-03-15T09:07:02.820 | 2011-03-23T05:36:11.170 | 2011-03-15T09:15:44.260 | 504,130 | 504,130 | [
"jquery",
"html",
"jquery-mobile"
]
|
5,309,585 | 1 | 5,309,703 | null | 0 | 374 | I have a script that I wrote in PHP which scrapes data from a url.
Is it possible with jQuery to do an ajax call that, once a url is entered into an input field (There is a URL validation inside the script), it "Loads" until a successful url has been identified and the rest of the script can then run thus returning results once it is complete.
Below is an example of what I'm trying to describe:

What exactly should I look up to understand how to do this?
| Using jQuery for ajax call once url is entered in input field | CC BY-SA 2.5 | null | 2011-03-15T09:12:04.500 | 2011-03-16T08:03:31.473 | null | null | 634,877 | [
"php",
"jquery",
"ajax",
"json"
]
|
5,309,955 | 1 | 5,310,997 | null | 0 | 927 | I have following html/css:
```
<html>
<body>
<style type='text/css'>
.result_table table {
border-collapse:collapse;
}
.result_table table td {
white-space:nowrap;
max-width:200px;
overflow:hidden;
padding:4px;
max-height:24px;
height:24px;
}
</style>
<div class="result_table">
<table border=1><thead><tr><td>Title</td></tr></thead>
<tbody>
<tr>
<td>Lorem ipsum dolor sit amet, ...</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>
```
when "Lorem impsum" has big length (more than 9000 symbols), Opera browser begins to wrap text, even though there is no break symbols and TD has nowrap and overflow directives.

other famous browser do all good:

| Opera <table> wrap bug | CC BY-SA 2.5 | null | 2011-03-15T09:47:15.393 | 2011-03-15T11:25:17.823 | 2011-03-15T11:12:14.177 | 468,793 | 441,393 | [
"html",
"css",
"opera",
"nowrap"
]
|
5,310,757 | 1 | 5,311,040 | null | 3 | 338 | I'm trying to achieve the following:

Where:
- -
Is this beyond the scope of the [ASP.NET Validation Controls](http://msdn.microsoft.com/en-us/library/aa479013.aspx)? The only solution I can think of is writing some bespoke javascript (for client side) and backing that up with some server side code.
| Validation spanning a group of text boxes | CC BY-SA 2.5 | null | 2011-03-15T11:03:02.873 | 2011-03-15T11:28:59.110 | null | null | 436,028 | [
"c#",
".net",
"asp.net",
"validation"
]
|
5,310,956 | 1 | 5,311,065 | null | 2 | 573 | I saw this somewhere and was wondering how to achieve this.
suppose i have a shelf background 
and i have cover images of books. how can i put those images exactly on each wodden plates edges dynamically.Number of books are not fixed they might go beyond the capacity of shelf then shelf will also grow. Each level of shelf contains maximum 3 cover images of book.
can i do this on background or do i need to draw a shelf on canvas or something else??
| How to put images at exact location dynamically | CC BY-SA 2.5 | 0 | 2011-03-15T11:22:20.447 | 2011-03-16T11:39:17.983 | null | null | 644,274 | [
"android",
"android-layout"
]
|
5,311,051 | 1 | 5,311,248 | null | 0 | 171 | is there a way to control the way the in a is managed ?
Instead of having a vertical flow, I'd like to group them by a given number and display the groups side-by-side.
This (non-standard) HTML code shows the expected result when the group size is 3, but uses more than one :
```
<style type="text/css">
table
{
float: left;
border-collapse: collapse;
}
td, th
{
border: solid black 1px;
}
</style>
<table>
<tr><th>ID</th><th>Name</th><th>Address</th></tr>
<tr><td>1</td><td>John</td><td>Oregon</td></tr>
<tr><td>2</td><td>Joe</td><td>NY</td></tr>
<tr><td>3</td><td>Bobby</td><td>Texas</td></tr>
</table>
<table>
<tr><th>ID</th><th>Name</th><th>Address</th></tr>
<tr><td>4</td><td>John</td><td>Oregon</td></tr>
<tr><td>5</td><td>Joe</td><td>NY</td></tr>
<tr><td>6</td><td>Bobby</td><td>Texas</td></tr>
</table>
<table>
<tr><th>ID</th><th>Name</th><th>Address</th></tr>
<tr><td>7</td><td>John</td><td>Oregon</td></tr>
<tr><td>8</td><td>Joe</td><td>NY</td></tr>
</table>
```
Here is the result obtained :

| Specific rows layout in a table | CC BY-SA 3.0 | null | 2011-03-15T11:29:53.583 | 2017-01-17T09:57:58.250 | 2017-01-17T09:57:58.250 | 4,370,109 | 145,757 | [
"html",
"css",
"html-table"
]
|
5,311,299 | 1 | 5,312,292 | null | 2 | 25,474 | i am trying to set up a Facebook Application to get it working on the localhost. i have redirected localhost.com to 127.0.0.1 in my hosts.
i have set up the following

And when i try to set the canvas url to

am getting the following error
> Validation failed.URL must point to a directory (i.e.,
end with a '/' or a dynamic page
(i.e., have a '?' somewhere). Canvas
Page can only contain lowercase
letters, dashes, and underscores.
| Facebook Canvas URL | CC BY-SA 2.5 | 0 | 2011-03-15T11:53:21.287 | 2015-05-18T07:01:40.917 | 2011-03-15T12:12:25.540 | 155,196 | 155,196 | [
"canvas",
"facebook"
]
|
5,311,306 | 1 | 5,311,456 | null | 25 | 22,860 | So let's say I have a list of N pairs of positive long coordinates (points).
How do I find the smallest rectangle containing all of them?
The rectangle can also have floating coordinates and be rotated in any angle and further shrunk... Not just X, Y, Width and Height!

I already know how to find the smallest polygon or not rotated rectangle, but it's not what I need...I wish to know how to find the arbitrarily oriented minimum bounding box.
| How to find an arbitrarily oriented minimum bounding box in c++ | CC BY-SA 2.5 | 0 | 2011-03-15T11:53:40.523 | 2021-08-27T07:34:48.960 | 2011-03-15T12:08:04.810 | 74,861 | 485,098 | [
"c++",
"geometry"
]
|
5,311,322 | 1 | 5,311,894 | null | 0 | 162 | While polishing off an installer of mine, I noticed something weird in the Programs and Features dialog of Windows 7:
- -
The problem seems ubiquitous: for most of my installed apps that supply these links, clicking "Support" takes me to the developer's website, and clicking "Help" takes me to their "Support" page.

Should I follow suit with my installer, or actually compensate for this?
| Publisher URL vs Support URL in Windows installers | CC BY-SA 2.5 | null | 2011-03-15T11:55:20.510 | 2011-03-15T13:35:41.683 | 2011-03-15T12:46:33.543 | 274,535 | 33,080 | [
"windows-installer"
]
|
5,311,607 | 1 | 5,311,828 | null | 0 | 557 | I have a Rect with the following fill:
```
<s:LinearGradient id="goldGradientFill">
<s:entries>
<s:GradientEntry color="#6B4822" ratio="0" />
<s:GradientEntry color="#FDE3C0" ratio="1" />
</s:entries>
</s:LinearGradient>
```
But instead of a two color fill only the last GradientEntry color (#FDE3C0) is displayed. In my case there are 3 rects with this fill. One displays the gradient like it should.
The code for alle three rects is the same:
```
var myRect:Rect = new Rect();
myRect.height = 30;
myRect.width = 4;
myRect.fill = goldGradientFill;
myGraphics.addElement(myRect);
```
Is there anyone who experienced a problem like this one?
(update)
I added some screens.


| Flex: instead of a LinearGradient fill only the last GradientEntry is displayed | CC BY-SA 2.5 | null | 2011-03-15T12:19:53.990 | 2011-03-15T12:39:18.583 | 2011-03-15T12:39:18.583 | 387,454 | 387,454 | [
"apache-flex",
"actionscript-3"
]
|
5,311,639 | 1 | 5,403,560 | null | 1 | 15,468 | I have a view controller and a view. I then have a UIImageView created through IB and position using the IB Inspector. Setting the UIImageView's frame to x and y coordinatates to 0 results in the image being placed top left of the view, below the status bar.
If I then implement viewDidLoad method of the view controller and set UIImageView 's frame position using:
```
myimageview.frame = CGRectMake(0, 0, 50, 50);
```
Which are exactly the same coordinates as defined for the UIImageView in IB, the image is moved up underneath the status bar. It seems the coordiantes when set via code are realtive to the Window and not the parent View as shown IB.
Anyone know why there is a decrepancy between IB and code?
---
The frame info before setting it in code:
```
2011-03-15 13:15:34.249 MyAPP [98288:207] {{0, 49}, {35, 37}}
```
The frame info after setting it in code:
```
2011-03-15 13:15:34.250 MyAPP [98288:207] {{0, 0}, {35, 37}}
```
As defined in Interface Builder:

As you can see IB says that the UIImageView X and Y coordinators are 0 ,0. While the debugging info above says that it's actually 0, 49.
| Setting an UIImageView's frame position relative to parent view in Interface Builder is different when set in code? | CC BY-SA 2.5 | null | 2011-03-15T12:22:24.147 | 2011-03-23T10:06:17.473 | 2011-03-15T13:22:10.763 | 248,848 | 248,848 | [
"objective-c",
"cocoa-touch",
"xcode",
"ios",
"xcode4"
]
|
5,312,060 | 1 | 5,312,206 | null | 0 | 786 | I have seen ER diagrams and conceptual schema of many databases, but I am still not very clear how do you create table out of it and query them?
For example, below is a schema database and how do create tables out of it and query it?

Say I need perform a query to find all films that include the keyword “America” within the genre “Action” (genre ID = 126). any ideas?
| Relationship between tables? | CC BY-SA 3.0 | null | 2011-03-15T12:59:03.480 | 2017-07-03T20:57:56.213 | 2017-07-03T20:57:56.213 | 4,370,109 | 656,285 | [
"mysql",
"database",
"database-design"
]
|
5,312,192 | 1 | 5,312,431 | null | 0 | 532 | I’m trying to create the affect of a tool tip with a triangle pointer on top of an unordered list. To create the triangle, I thought I would just create a square div, rotate it 45 degrees, and give it the same background color as the unordered list.
As you can probably guess, this works great in everything except in IE. The problem I’m having is that it seems that the overflow is hidden on the ul, so when I position the pointer div half outside of the ul to create the triangle effect, the top half of the div is hidden.
I have tried to change overflows and z-indexes to get this to work, but no luck. I’m thinking it has to do with the gradient filter applied to the ul, maybe that applies an overflow rule? I know I can probably just move the pointer div outside of the list, but this will be display on hover of another element, and I’d rather just display the ul on hover, instead of the ul and the div.
Does anybody know how I can fix this?
Chrome screen shot

IE screen shot

NOTE: I added borders to the rotated div to make it easier to tell what I'm talking about.
HTML
```
<ul>
<li><div id="pointer"></div><a href="#">List Item 1</a></li>
<li><a href="#">List Item 2</a></li>
<li><a href="#">List Item 3</a></li>
<li><a href="#">List Item 4</a></li>
<li><a href="#">List Item 5</a></li>
<li><a href="#">List Item 6</a></li>
<li><a href="#">List Item 7</a></li>
<li><a href="#">List Item 8</a></li>
<li><a href="#">List Item 9</a></li>
<li><a href="#">List Item 10</a></li>
<li><a href="#">List Item 11</a></li>
<li><a href="#">List Item 12</a></li>
<li><a href="#">List Item 13</a></li>
<li><a href="#">List Item 14</a></li>
<li><a href="#">List Item 15</a></li>
<li><a href="#">List Item 16</a></li>
<li><a href="#">List Item 17</a></li>
<li><a href="#">List Item 18</a></li>
<li><a href="#">List Item 19</a></li>
<li><a href="#">List Item 21</a></li>
<li><a href="#">List Item 22</a></li>
<li><a href="#">List Item 23</a></li>
</ul>
```
CSS
```
ul {
position:absolute;
top:41px;
left:175px;
width:540px;
height:361px;
padding:0;
z-index:15;
margin-bottom:20px;
border:1px solid #DEDCD9;
border-right:none;
background-color: #F5EFE3;
-moz-border-radius: 0 0 0 12px;
-webkit-border-radius: 0 0 0 12px;
border-radius: 0 0 0 12px;
background-image: -moz-linear-gradient(top, #F5EFE3, #FFF); /* FF3.6 */
background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #F5EFE3),color-stop(1, #FFF)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient(#69F5EFE3A89D, #FFF); /* Chrome 10+, Saf6 */
background-image: linear-gradient(top, #F5EFE3, #FFF);
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#F5EFE3', EndColorStr='#FFFFFF'); /* IE6–IE9 */
}
ul li {
display:inline;
line-height:32px;
width:269px;
border-right:1px solid #DEDCD9;
border-bottom:1px solid #DEDCD9;
float:left;
margin:0;
padding:0;
overflow:visible;
}
ul li a {
display:block;
text-transform:none;
padding-left:20px;
color:#407d85;
}
#pointer {
position:absolute;
height: 15px;
width: 15px;
left:10px;
top:-8px;
border:1px solid black;
/*border:0;*/
background-color:#F5EFE3;
-webkit-transform:rotate(45deg);
-moz-transform:rotate(45deg);
transform:rotate(45deg);
filter: progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=0.7071067811865476, M12=-0.7071067811865475, M21=0.7071067811865475, M22=0.7071067811865476); /* IE6,IE7 */
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(SizingMethod='auto expand', M11=0.7071067811865476, M12=-0.7071067811865475, M21=0.7071067811865475, M22=0.7071067811865476)"; /* IE8 */
}
.lte8 #pointer {
top:-12px;
}
```
| tooltip css/html | CC BY-SA 2.5 | null | 2011-03-15T13:11:28.073 | 2011-03-15T16:51:17.200 | 2011-03-15T13:28:06.753 | 128,516 | 128,516 | [
"html",
"css"
]
|
5,312,235 | 1 | 5,315,644 | null | 38 | 11,555 | My usual Vim work flow is:
- In insert mode, spell something wrong.- Press `^X s` to get some suggestions.- Press Esc to accept the first one.
After this, I'm in command mode in the middle of the line, instead of insert mode of where I was before. I could use `A`, but that only works if I was typing on the end of the line. Is there an alternative way? Optimally, I'd like a command that corrects the last mistake to the first suggestion without moving the cursor.
| How do I correct Vim spelling mistakes quicker? | CC BY-SA 3.0 | 0 | 2011-03-15T13:14:04.090 | 2022-12-07T03:51:38.200 | 2020-06-20T09:12:55.060 | -1 | 403,390 | [
"vim",
"spell-checking"
]
|
5,312,451 | 1 | null | null | 1 | 1,273 | I added a custom font in `info.plist`.But it worked only when programmatically changed.it doesn't change when tried through interface builder by changing the object attribute section. for example i used `UILabel` then i choose the custom font in the attribute section but it did not change the font style.
install the `"Harrowprint"` font by double clicking the file and also add it in my project resource file.

thanks in advance,
Senthilkumar
| How to add custom font in .xib? | CC BY-SA 3.0 | null | 2011-03-15T13:30:52.853 | 2013-02-20T11:30:29.610 | 2012-11-15T07:53:33.777 | 510,814 | 510,814 | [
"ios4",
"uifont"
]
|
5,312,514 | 1 | 5,319,341 | null | 3 | 9,910 | I need to know how to clean noise from an image with Matlab.
lets look at this example:


as you see the numbers is not look clearly.
so how can I clean the noise and the pixels that are not the numbers so the identification will be easier.
thanks.
| clean noise from an image | CC BY-SA 3.0 | 0 | 2011-03-15T13:36:30.407 | 2012-02-28T22:58:50.840 | 2012-02-28T22:58:50.840 | 817,452 | 556,011 | [
"matlab",
"image-processing"
]
|
5,312,517 | 1 | 5,313,003 | null | 0 | 2,765 | First of all, i'm using Jsf 1.2...
I have a problem with submitting some values in a form to validation.
Specifically this code segement:
```
<h:panelGrid columns="4" id="StatusPanel">
<h:outputText value="#{msg.Phone_number_to_send_SMS_to}" />
<h:inputText id="phoneNumber" value="#{general.smsPhoneNumber}" required="true"
requiredMessage="Please enter a valid phone number." />
<a4j:commandLink value="#{msg.Submit_Button}"
reRender="pinCodeDeliveryMsgText, pinCodeDeliveryMsg, pinCodeDeliveryFailedMsg, pinCodeDeliveryMainPanel, LastPinCodeMsg, SendingSMSMSG"
action="#{general.submit}" />
<h:message for="phoneNumber" fatalClass="mandatoryFieldMissing" errorClass="mandatoryFieldMissing" tooltip="true" />
</h:panelGrid>
```
Which looks like this in the html page:

Whenever I press the submit link, the page doesn't really go through validation, it seems to go with the last successull values instead. The result being that, if the phone number field is left empty, it does nothing and doesn't even render the `<h:message>` tag.
Actually, I have a workaround fix that looks like this:
```
<h:commandLink value="#{msg.Submit_Button}">
<a4j:support event="onclick" reRender="pinCodeDeliveryMsgText, pinCodeDeliveryMsg, pinCodeDeliveryFailedMsg, pinCodeDeliveryMainPanel, LastPinCodeMsg, SendingSMSMSG"
action="#{general.submit}"/>
</h:commandLink>
```
But i'm really curious to know what's the difference between `a4j:commandLink` and `h:commandLink` that makes one woirk and the other not.
TnX
| Trying to understand why h:commandLink submits through validation and a4j:commandLink doesn't | CC BY-SA 2.5 | null | 2011-03-15T13:36:47.910 | 2011-06-08T01:39:23.100 | 2011-06-08T01:39:23.100 | 82,320 | 128,076 | [
"jsf"
]
|
5,312,536 | 1 | 5,312,671 | null | 0 | 385 | I need to create text area that would have indication if of the rows exceed limits.
Any ideas how to easily do that? Is it possible to put some background color only for that row?
Example below looks like a select list, but normally there are long sentences. We just need to check that does that sentence exceed limits we have given and if yes then let's give some feedback. User can still continue editing.

| Checking length of each row of text area using jQuery | CC BY-SA 2.5 | null | 2011-03-15T13:37:56.650 | 2011-03-15T13:46:17.553 | null | null | 253,793 | [
"jquery",
"textarea"
]
|
5,312,631 | 1 | 5,314,027 | null | 4 | 2,120 | 
I would like to add a custom pulldown menu to the actionbar in my project similar to the one that can be found in the google books app (screen).
In this case it represents the complete table of contents of the book.
I tried to follow the guide from the developer site where there is an [example with a SpinnerAdapter](http://developer.android.com/guide/topics/ui/actionbar.html#Dropdown). But when i use a custom Layout (in my case a RelativeLayout with two TextViews in it) i get an Exception that saying "ArrayAdapter requires the resource ID to be a TextView". So i dismissed my idea with the pulldown but then i found the pulldown in the books app wich looks to me like they used a custom layout as well because it looks to me like two single TextViews in one Layout.
Could anybody please enlighten me if what i want to do is even possible and how?
| How to create a custom Pulldown in the Honeycomb ActionBar? | CC BY-SA 2.5 | null | 2011-03-15T13:43:34.387 | 2011-05-29T07:02:18.727 | 2011-05-29T07:02:18.727 | 750,987 | 457,378 | [
"android",
"android-3.0-honeycomb",
"android-actionbar",
"custom-view"
]
|
5,312,635 | 1 | 5,312,929 | null | 0 | 58 | How can I check that every outlet actually points to some view ?
How can I manually set the index of the object in Interface Builder ?
we discussed in previous topic [There is a problem when i am getting index of subview](https://stackoverflow.com/questions/5312153/there-is-a-problem-when-i-am-getting-index-of-subview)
i checked my outlet

| How can I check that every outlet actually points to some view? | CC BY-SA 2.5 | null | 2011-03-15T13:43:57.240 | 2011-03-15T14:05:24.577 | 2017-05-23T12:19:48.617 | -1 | 499,825 | [
"iphone",
"uiview",
"xib"
]
|
5,312,901 | 1 | 5,313,171 | null | 0 | 540 | I am developing an on-screen keyboard where each key generates a sequence of three keystrokes to another application. Each button has a text description. But now clients want the function to be able to choose to see which characters are sent. Then I want the chars to be displayed over the descriptive text so that it is still possible to imagine the text below, see my suggestion below. But how do I do that?

| View text over other text in WPF | CC BY-SA 2.5 | null | 2011-03-15T14:03:20.917 | 2011-03-15T14:24:21.887 | null | null | 198,145 | [
"wpf",
"wpf-controls",
"graphic-effects"
]
|
5,312,962 | 1 | 5,388,675 | null | 5 | 4,651 | I am using CoreText to render multiple columns of text. However, when I set the first letter of the 1st paragraph to a bold, larger font than the rest of the text, I incur 2 issues (both visible in the attached image):
1. The spacing underneath the first line is too big (I understand that this is because the 1st character could be a g,y,p,q etc.
2. Lines below the first line now do not line up with corresponding lines in the next column.
Any advice on how to overcome these 2 issues would be greatly appreciated, thank you.

| Line spacing and paragraph alignment in CoreText | CC BY-SA 2.5 | 0 | 2011-03-15T14:08:36.720 | 2011-11-17T15:18:10.090 | null | null | 596,774 | [
"iphone",
"cocoa",
"cocoa-touch",
"ipad",
"core-text"
]
|
5,313,374 | 1 | null | null | 4 | 5,629 | I require your help, I have a problem (see picture), I have let say two arrays and each of this array contains intervals with different length and real values and I need to find out how I'm gone overlap this intervals efficiently.
I'm open to ideas, or paper theory or concret algorithms which will let me find a way out!
I'm guessing about to transform this somehow in waves and overlap them.
Its very important, its for my thesis.
as an example, here in numbers to explain it better:
1. Array: 1-2, 5-7, 9-12
2. Array: 3-4, 5-6, 13-17
The result will be then one single array containing the new intervals.
second interval (Array one and two) are overlapped.
result Array: 1-2, 3-4, 5-7, 9-12, 13-17
I'm thinking about "interval tree", but its not sufficent how I'm gone merge them.

Thanks in advance!
| how to overlap intervals efficiently | CC BY-SA 2.5 | 0 | 2011-03-15T14:39:20.717 | 2016-03-10T15:56:54.520 | 2011-03-15T19:39:25.740 | 167,854 | 660,743 | [
"overlap",
"intervals"
]
|
5,313,413 | 1 | 7,219,568 | null | 1 | 519 | I made a simple app that takes an input image and outputs a processed one using a fragment shader. When using a 2^n image it's OK. But if I use a rectangular not-power-of-2 image I get a black stitch running from top to bottom.
This is the original:

This is after being processed:

Here's my fragment shader:
```
precision mediump float;
uniform vec2 uSize;
uniform sampler2D sTexture;
void main()
{
gl_FragColor = texture2D(sTexture, vec2(gl_FragCoord) / uSize)
}
```
Where, uSize is a vec2 having the size of the image
Generally I can work with a power-of-2 textures, but as OGLES2 supports rectangular textures I was thinking of sparing myself some work.
Thanks!
# UPDATE
Here go my vertices:
```
static GLfloat vVertices[] =
{
-1.0f, 1.0f, 0.0f,
-1.0f, -1.0f, 0.0f,
1.0f, -1.0f, 0.0f,
1.0f, -1.0f, 0.0f,
1.0f, 1.0f, 0.0f,
-1.0f, 1.0f, 0.0f,
};
```
And here is the vertex shader:
```
attribute vec4 vPosition;
void main()
{
gl_Position = vPosition;
}
```
# UPDATE
Now, that's strange. Here are the two triangles rendered separately (first using the first 3 vertices, and then using the next (last) three).
Here go for the square image (as expected):


And here are how the same triangles look for the rectangle image/texture. They look :


They don't look like triangles at all. Does anyone know what's happening?
| Issues when processing an image using OpenGL ES 2.0 | CC BY-SA 2.5 | 0 | 2011-03-15T14:42:32.750 | 2011-08-28T07:20:19.233 | 2011-03-16T12:53:56.930 | 348,183 | 348,183 | [
"opengl-es",
"textures"
]
|
5,313,447 | 1 | 5,313,737 | null | 1 | 1,047 | I was looking around for some jquery plugin but couldn't find any. At picture you can see three level category selector - when user selects first, the other box is manipulated from selected values etc. does anybody knows if there is a plugin like this already made?

| Three level selector | CC BY-SA 2.5 | null | 2011-03-15T14:45:07.023 | 2011-03-15T15:08:58.513 | 2011-03-15T15:07:09.047 | 59,303 | 189,451 | [
"jquery"
]
|
5,313,546 | 1 | 5,313,993 | null | 0 | 1,709 | I have a query with subquery in it. the subquery returns the value, that i need to return in php and that also is used in "where" clause. i trying to figure out how can i not exequte th subquery two times.
I trying to assign the value of it to the variable. And it works fine in "select", but when i use variable in "where" clause, the query returns 0 rows.
```
SELECT t.tour_id, t.tour_name, u.company_name, u.first_name, u.last_name,
@expireDate:= (SELECT DATE_ADD(tour_start_date, INTERVAL (t.tour_duration - 1) DAY)
FROM travelhub_tours_instance
WHERE tour_id = t.tour_id
ORDER BY tour_start_date DESC
LIMIT 1) AS expire,
( @expireDate + INTERVAL 14 DAY ) AS expirediff,
CURDATE() AS now,
( (@expireDate + INTERVAL 14 DAY) = CURDATE() ) AS criteria
FROM travelhub_tours t
JOIN travelhub_users u ON t.operator_id = u.user_id
WHERE (@expireDate + INTERVAL 14 DAY) = CURDATE()
```
In the `WHERE` clause, I put the same as in "criteria" column. and without the WHERE clause it variable work exactly how I expect. I'm confused - without "where":

| MySql variable in "where" clause problem | CC BY-SA 2.5 | null | 2011-03-15T14:53:57.453 | 2011-03-15T15:49:45.240 | 2011-03-15T15:04:47.203 | 135,152 | 613,688 | [
"mysql",
"sql",
"correlated-subquery"
]
|
5,313,713 | 1 | 5,314,043 | null | 1 | 84 | At this point I am confused and am just looking for people to bounce this off of and so you guys are it.
I am working on a web based inventory program for our organization.
At this point I want it to be as generic as possible so I am looking at a structure like this:

So what I am looking at is there are item types or categories, each Item type has a set of properties and properties can be shared, each item has an item type which then gives the item properties that can be filled with values, these values then have to relate back to the properties.
Does this make sense to anyone else? I am confused to no avail at this point so any thoughts or suggestions or even reading material that would put me in the right general direction would be appreciated.
| How would I go about designing this in a database | CC BY-SA 2.5 | 0 | 2011-03-15T15:07:21.830 | 2011-03-15T15:51:30.503 | 2011-03-15T15:51:30.503 | 21,234 | 404,006 | [
"database-design"
]
|
5,313,964 | 1 | 5,314,102 | null | 0 | 4,485 | I know this is probably a simple question but my mind just isn't working this morning! Basically I have a box with content in it (like a content/at a glance box) and I want to float it with some text like you would float an image. Right now the following CSS is doing this:

How would you go about fixing this?
```
#content #info_box {
width: 230px;
float: left;
margin-right: 10px;
margin-right: 0;
background: #efefef;
}
#content #info_box #content {
width: 210px;
margin: 7px 10px;
}
#content #info_box #content ul {
list-style-type: none;
padding: 0px;
margin: 3px 0px 10px 0px;
}
#content #info_box #content ul li {
background-image: url(/images/arrow_bullet.png);
background-repeat: no-repeat;
background-position: 0px 5px;
padding-left: 14px;
}
#content #info_box #content #dates { font-size: 14px; }
```
```
<p>Quisque eget odio ac lectus vestibulum faucibus eget in metus. In pellentesque faucibus vestibulum. Nulla at nulla justo, eget luctus tortor. Nulla facilisi. Duis aliquet egestas purus in blandit. Curabitur vulputate, ligula lacinia scelerisque tempor, lacus lacus ornare ante, ac egestas est urna sit amet arcu. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed molestie augue sit amet leo consequat posuere. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Proin vel ante a orci tempus eleifend ut et magna. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus luctus urna sed urna ultricies ac tempor dui sagittis. In condimentum facilisis porta. Sed nec diam eu diam mattis viverra. Nulla fringilla, orci ac euismod semper, magna diam porttitor mauris, quis sollicitudin sapien justo in libero. Vestibulum mollis mauris enim. Morbi euismod magna ac lorem rutrum elementum. Donec viverra auctor lobortis. Pellentesque eu est a nulla placerat dignissim. Morbi a enim in magna semper bibendum. Etiam scelerisque, nunc ac egestas consequat, odio nibh euismod nulla, eget auctor orci nibh vel nisi. Aliquam erat volutpat. Mauris vel neque sit amet nunc gravida congue sed sit amet purus. Quisque lacus quam, egestas ac tincidunt a, lacinia vel velit. Aenean facilisis nulla vitae urna tincidunt congue sed ut dui. Morbi malesuada nulla nec purus convallis consequat. Vivamus id mollis quam. Morbi ac commodo nulla. In condimentum orci id nisl volutpat bibendum. Quisque commodo hendrerit lorem quis egestas. Maecenas quis tortor arcu.</p>
<div id="info_box">
<div id="content">
<b>Job at a glance</b>
<br>
<ul>
<li>This job is an internship</li>
<li>It pays $7 per hour</li>
<li>You'll be working 3 hour shifts</li>
</ul>
You'll be scheduled to work on:<br>
<span id="dates">S <b>M</b> <b>T</b> <b>W</b> <b>T</b> <b>F</b> S</span>
</div>
</div>
```
| Floating content box in text like and image [css] | CC BY-SA 2.5 | null | 2011-03-15T15:26:40.143 | 2011-03-15T15:44:56.513 | null | null | 483,418 | [
"html",
"css",
"block",
"css-float"
]
|
5,313,994 | 1 | 5,314,040 | null | -2 | 172 | I have 3 tables: KeyWords, GrantsKeyConn, Grants. The way it is set up, each "grant" has associated "keywords", which are stored in the KeyWords table as such:

Each "keyword" is associated/connected to a specific "grant" in the GrnatsKeyConn table as such:

... so that multiple "keywords" can be associated/connected to one "grant". Finally, each "grant" is stored in the Grants table as such:

I'm trying to filter out grants by specifying keywords in a textbox. So, say I specify the keywords "test, new, final"... then the result would filter out only grants that have those keywords associated with them; it doesn't have to result in grants that only have the 3 keywords associated with them; it can result in grants that have 1, 2, 3, ..., all of the keywords specified.
So how would I make this query? I don't want to do a select from KeyWords table to get ID of a keyword, then use that ID to go into the GrantsKeyConn table to get the associated grants, then go to the Grants table to extract the right grants. If so, how would I do this?
Let me know if I need to further clarify my question.
| How would I do this MySQL query in C#? | CC BY-SA 3.0 | null | 2011-03-15T15:28:57.797 | 2011-08-06T22:32:31.690 | 2011-08-06T22:32:31.690 | null | 196,921 | [
"c#",
"mysql"
]
|
5,314,256 | 1 | 5,314,518 | null | 4 | 1,714 | So I have a `UISlider` which I'm customizing with some images:
```
UIImage *stetchLeftTrack = [[UIImage imageNamed:@"slider_blue.png"] stretchableImageWithLeftCapWidth:9.0 topCapHeight:0.0];
UIImage *stetchRightTrack = [[UIImage imageNamed:@"slider_white.png"] stretchableImageWithLeftCapWidth:9.0 topCapHeight:0.0];
[volumeSlider setThumbImage: [UIImage imageNamed:@"slider_blob.png"] forState:UIControlStateNormal];
[volumeSlider setMinimumTrackImage:stetchLeftTrack forState:UIControlStateNormal];
[volumeSlider setMaximumTrackImage:stetchRightTrack forState:UIControlStateNormal];
```
I'm actually just trying to copy the volume controls as seen in the iPod app (which AFAIK you can't do in code). Because I'm using high res images, it draws everything huge on the app like so:

When actually the desired effect is:

If I scale down the actual images, I lose the quality and it looks rubbish and blurry! So I'm looking to do this in code but got a bit lost...
| Custom iPhone UISlider to look like the iPod app volume control | CC BY-SA 2.5 | 0 | 2011-03-15T15:47:08.787 | 2011-03-15T16:05:37.037 | null | null | 143,979 | [
"iphone",
"objective-c",
"uislider"
]
|
5,314,281 | 1 | 5,320,905 | null | 0 | 1,187 | I am writing a simple csv parser which reads the data from my csv and insert that into my table.Programs works fine When i test with small dataset.Where as when i go for larger one my datatime value alone is shown twice in the table row .dont know why??
For example:In the below picture you can see it prints the datetime twice which is supposed to print only once.But my other column data were rite .

```
CREATE TABLE [dbo].[SAMPLE](
[Number] [int] NULL,
[DateTime] [datetime] NULL,
[Value] [decimal](9, 2) NULL
) ON [PRIMARY]
```
And I am running a simple query which runs nearly 45000 times.
```
string sqlQuery = "insert into Sample values ( " + number+ ",'" + row.dateT + "'," + value + ");";
SqlCommand sqlComm = new SqlCommand(sqlQuery, dbcon);
```
To Test my input value I had written the "sqlquery" into a text file which is perfect and I am 100% sure I am not writing same datetime into table
| SQL Query DataTime value Inserting twice into the table | CC BY-SA 2.5 | 0 | 2011-03-15T15:48:59.330 | 2011-03-16T04:02:56.363 | null | null | 357,037 | [
"c#",
"sql-server",
"sql-server-2005",
"sql-server-2008"
]
|
5,314,589 | 1 | 5,314,991 | null | 3 | 612 | Has someone else experienced something like this with Delphi and if so is there a known workaround!
I'm using the Delphi 2010 Rad Studio on Windows 7 64 bit.
A few times when editing the IDE hangs and I can't do any action either by keyboard or mouse. But there is a error-beep sound from windows like there is a modal window open somewhere, but hidden behind the ide it self.
Only by ending the ide via Task manager can I make this hidden modal window visible.

| Delphi IDE locks because of a hidden modal window | CC BY-SA 2.5 | 0 | 2011-03-15T16:12:10.183 | 2011-03-16T14:58:34.500 | 2011-03-15T17:06:38.717 | 282,848 | 484,136 | [
"delphi",
"ide",
"delphi-2010"
]
|
5,314,691 | 1 | 5,314,806 | null | 0 | 381 | I'm building an internal file portal style app in silverlight,
I need to be able to filter the files by category using checkboxes like in pivotviewer:

To display the categories im using a ItemsControl, and am currently using a hacky workaround to store the category id.. so files can be added and removed appropriaely when somethings check or unchecked:
```
<ItemsControl x:Name="categoryList" ItemsSource="{Binding}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="2">
<CheckBox Checked="categoryIncluded" Unchecked="categoryExcluded" Content="{Binding ID}">
<CheckBox.ContentTemplate>
<DataTemplate>
<!-- This is a hack, content is being used to store the id of the category -->
</DataTemplate>
</CheckBox.ContentTemplate>
</CheckBox>
<TextBlock Foreground="#FFC2BDBD" Text="{Binding Name}"/>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
```
This seems like a massive hack,
How is this normally done in silverlight?
(I'm using RIA data services by the way)
| Silverlight filtering data with checkboxes like pivotviewer? | CC BY-SA 3.0 | null | 2011-03-15T16:20:57.230 | 2016-01-20T09:12:20.880 | 2016-01-20T09:12:20.880 | 4,370,109 | 415,286 | [
"silverlight",
"filtering",
"ria"
]
|
5,315,529 | 1 | 5,316,844 | null | 21 | 18,888 | I have problem with organizing layout in android aplication. I'm dynamically creating buttons and adding them with this code to my layout:
```
LayoutInflater layoutInflater = (LayoutInflater)getBaseContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
for (int i = 0; i < NO_NUMBERS; i++){
Button btn = new Button(this);
btn = (Button) layoutInflater.inflate(R.layout.button, null);
btn.setId(2000+i);
Integer randomNumber = sort.getNumbersCopy()[i];
btn.setText(randomNumber.toString());
btn.setOnClickListener((OnClickListener) this);
buttonList.addView(btn);
list.add(btn);
}
```
I'm adding it to the LinearLayout:
```
<LinearLayout
android:id="@+id/buttonlist"
android:layout_alignParentLeft="true"
android:layout_marginTop="185dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:orientation="horizontal"
android:gravity="center_horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</LinearLayout>
```
and i'm importing this .xml where i'm defining button layout:
```
<Button xmlns:android="http://schemas.android.com/apk/res/android"
android:textSize="26dp"
android:textStyle ="bold"
android:textColor="#ffffff"
android:background="@drawable/button"
android:layout_marginLeft="8px"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"/>
```
Well, layout always ends up like this:
Instead of something like this (even spce between buttons, square buttons):

To summarize this: I have to:
- - - -
| Layout problem with button margin | CC BY-SA 2.5 | 0 | 2011-03-15T17:25:00.553 | 2013-08-26T21:28:19.583 | 2011-03-15T22:43:39.987 | 99,821 | 99,821 | [
"android",
"layout",
"android-layout"
]
|
5,315,788 | 1 | 5,394,071 | null | 4 | 4,867 | Has anyone come across something like this exclusively in Chrome 10/Win?

All the non-breaking spaces in these two webfonts aren't rendered properly. Working in IE7/8/9, Firefox, Safari, and Chrome/OSX.
Contents of my fonts.css file:
```
@font-face {
font-family: 'Hellenic';
src: url('../fonts/eot/hellenic.eot?') format('eot'),
url('../fonts/ttf/hellenic.ttf') format('truetype'),
url('../fonts/woff/hellenic.woff') format('woff'),
url('../fonts/svg/hellenic.svg#MCMHellenicWide') format('svg');
}
@font-face {
font-family: 'Lasalle';
src: url('../fonts/eot/lasalle.eot?') format('eot'),
url('../fonts/ttf/lasalle.ttf') format('truetype'),
url('../fonts/woff/lasalle.woff') format('woff'),
url('../fonts/svg/lasalle.svg#FilmotypeLaSalle') format('svg');
}
@font-face {
font-family: 'LeagueGothic';
src: url('../fonts/eot/leaguegothic.eot?') format('eot'),
url('../fonts/ttf/leaguegothic.ttf') format('truetype'),
url('../fonts/woff/leaguegothic.woff') format('woff'),
url('../fonts/svg/leaguegothic.svg#svgFontName') format('svg');
}
```
| Chrome 10/Windows @font-face encoding trouble | CC BY-SA 2.5 | 0 | 2011-03-15T17:44:49.897 | 2011-08-31T00:58:21.190 | 2011-03-22T15:22:02.763 | 497,479 | 359,745 | [
"css",
"windows",
"google-chrome",
"character-encoding",
"font-face"
]
|
5,315,741 | 1 | null | null | 6 | 3,587 | I am trying to save objects having Many-Many Relationship . A SellingCompany can have many Accounts and an Account can be associated with many SellingCompanies. So there is a many-many relationship between the tables stored in SellingCompaniesAccount
My Account_Info domain is as follows:
```
class AccountInfo {
static mapping ={
table 'AccountInfo'
version false
//id column:'accountInfoID'
}
String evi_pass_phrase
String evi_username
String security_key
// to make sure fields show up in a particular order
static constraints = {
//accountInfoID(insert:false,update:false)
evi_pass_phrase()
evi_username()
security_key()
}
static hasMany = [sellingcompaniesaccount:SellingCompaniesAccount]
String toString() {
return "${evi_username}"
}
}
```
My SellingComapanies domain is as follows:
```
class SellingCompanies
{
static mapping = {
table 'SellingCompanies'
version false
}
String name
//static belongsTo = AccountInfo
//static hasMany = [accounts: AccountInfo]
static hasMany = [sellingcompaniesaccount:SellingCompaniesAccount]
static constraints = {
name(blank:false, validator:
{ val, obj ->
def similarSellingCompanies = SellingCompanies.findByNameIlike(val)
return !similarSellingCompanies || (obj.id == similarSellingCompanies.id)
})
}
//String toString() { name }
}
```
The table that holds the Many-Many relationship is as follows:
```
class SellingCompaniesAccount {
static constraints = {
// ensure the group of sellingCompaneis and accountInfo values are unique
agency_name(unique:['sellingCompanies','accountInfo'])
}
int agency_id
String agency_name
String consultant_id
String code
Boolean isActive
String iata
ContactInfo contactinfo
static belongsTo = [sellingCompanies:SellingCompanies, accountInfo:AccountInfo]
}
}
```
The form in the create.gsp file contains the code that actually iterates over all the different SellingCompanies and displays as a check-box.
```
<g:form action="save" method="post">
<div class="dialog">
<table width="500px" border="0px" color="red">
<tbody>
<tr class="prop">
<td valign="top" class="name"><label for="accountInfo"><g:message
code="sellingCompaniesAccount.accountInfo.label"
default="Account Info" /></label></td>
<td valign="top"
class="value ${hasErrors(bean: sellingCompaniesAccountInstance, field: 'accountInfo', 'errors')}">
<g:select name="accountInfo.id"
from="${content_hub_admin.AccountInfo.list()}" optionKey="id"
value="${sellingCompaniesAccountInstance?.accountInfo?.id}" /></td>
</tr>
<tr class="prop">
<td valign="top" class="name"><label for="sellingCompanies"><g:message
code="sellingCompaniesAccount.sellingCompanies.label"
default="Selling Companies" /></label></td>
<td valign="top"
class="">
<g:each in="${content_hub_admin.SellingCompanies.list()}" var="item" status="i">
${++i}. ${item.name} <g:checkBox name="sellingcompanies_${++i-1}" optionKey="id" value="${item.id}" /> <br>
</g:each>
<!-- end here by rsheyeah -->
</td>
</tr>
<tr class="prop">
<td valign="top" class="name"><label for="code"><g:message
code="sellingCompaniesAccount.code.label" default="Code" /></label></td>
<td valign="top"
class="value ${hasErrors(bean: sellingCompaniesAccountInstance, field: 'code', 'errors')}">
<g:textField name="code"
value="${sellingCompaniesAccountInstance?.code}" /></td>
</tr>
<tr class="prop">
<td valign="top" class="name"><label for="agency_name"><g:message
code="sellingCompaniesAccount.agency_name.label"
default="Agencyname" /></label></td>
<td valign="top"
class="value ${hasErrors(bean: sellingCompaniesAccountInstance, field: 'agency_name', 'errors')}">
<g:textField name="agency_name"
value="${sellingCompaniesAccountInstance?.agency_name}" /></td>
</tr>
<tr class="prop">
<td valign="top" class="name"><label for="isActive"><g:message
code="sellingCompaniesAccount.isActive.label" default="Is Active" /></label>
</td>
<td valign="top"
class="value ${hasErrors(bean: sellingCompaniesAccountInstance, field: 'isActive', 'errors')}">
<g:checkBox name="isActive"
value="${sellingCompaniesAccountInstance?.isActive}" /></td>
</tr>
<tr class="prop">
<td valign="top" class="name"><label for="agency_id"><g:message
code="sellingCompaniesAccount.agency_id.label" default="Agencyid" /></label>
</td>
<td valign="top"
class="value ${hasErrors(bean: sellingCompaniesAccountInstance, field: 'agency_id', 'errors')}">
<g:textField name="agency_id"
value="${fieldValue(bean: sellingCompaniesAccountInstance, field: 'agency_id')}" />
</td>
</tr>
<tr class="prop">
<td valign="top" class="name"><label for="iata"><g:message
code="sellingCompaniesAccount.iata.label" default="Iata" /></label></td>
<td valign="top"
class="value ${hasErrors(bean: sellingCompaniesAccountInstance, field: 'iata', 'errors')}">
<g:textField name="iata"
value="${sellingCompaniesAccountInstance?.iata}" /></td>
</tr>
<tr class="prop">
<td valign="top" class="name"><label for="consultant_id"><g:message
code="sellingCompaniesAccount.consultant_id.label"
default="Consultantid" /></label></td>
<td valign="top"
class="value ${hasErrors(bean: sellingCompaniesAccountInstance, field: 'consultant_id', 'errors')}">
<g:textField name="consultant_id"
value="${sellingCompaniesAccountInstance?.consultant_id}" /></td>
</tr>
<tr class="prop">
<td valign="top" class="name"><label for="contactinfo"><g:message
code="sellingCompaniesAccount.contactinfo.label"
default="Contactinfo" /></label></td>
<td valign="top"
class="value ${hasErrors(bean: sellingCompaniesAccountInstance, field: 'contactinfo', 'errors')}">
<g:select name="contactinfo.id"
from="${content_hub_admin.ContactInfo.list()}" optionKey="id"
value="${sellingCompaniesAccountInstance?.contactinfo?.id}" /></td>
</tr>
</tbody>
</table>
</div>
<div class="buttons"><span class="button"><g:submitButton
name="create" class="save"
value="${message(code: 'default.button.create.label', default: 'Create')}" /></span>
</div>
</g:form>
```
Lastly the controller which handles the save and list functions.
```
class SellingCompaniesAccountController {
private static Logger log = Logger.getLogger(SellingCompaniesAccountController.class)
//def index = { }
//def scaffold = true
def index = { redirect(action:list,params:params) }
//To limit access to controller actions based on the HTTP request method.
def allowedMethods = [save:'POST']
//create.gsp exists
def create = {
render(view:"create")
}
//edit.gsp exists
//def edit = {}
//list.gsp exists
def list = {
[ sellingCompaniesAccountInstanceList: SellingCompaniesAccount.list( max:15) ]
}
//show.gsp exists
//def show={}
//save.gsp exists
def save = {
log.info "Saving: " + params.toString()
println("Saving: " + params.toString())
def sellingCompaniesAccount = params.sellingCompaniesAccount
println(sellingCompaniesAccount)
def sellingCompanies = params.sellingCompanies
log.info "sellingCompanies: " + sellingCompanies
println(sellingCompanies)
def sellingCompaniesAccountInstance = new SellingCompaniesAccount(name: params.name)
println(params.name)
params.each {
if (it.key.contains("_sellingcompanies"))
//sellingCompaniesAccountInstance.sellingCompaniesId << SellingCompanies.get((it.key - "sellingcompanies_") as Integer)
if (it.key.contains("sellingcompanies_"))
sellingCompaniesAccountInstance.sellingCompaniesId << SellingCompanies.get((it.key - "sellingcompanies_") as Integer)
}
log.info sellingCompaniesAccountInstance
if (sellingCompaniesAccountInstance.save(flush: true)) {
flash.message = "${message(code: 'default.created.message', args: [message(code: 'sellingCompaniesAccountInstance.label', default: 'sellingCompaniesAccountInstance'), sellingCompaniesAccountInstance.id])}"
redirect(action: "show", id: sellingCompaniesAccountInstance.id)
log.info sellingCompaniesAccountInstance
}
else {
render(view: "create", model: [sellingCompaniesAccountInstance: sellingCompaniesAccountInstance])
}
}
}
```
Now, I am getting the following error, due to the empty hidden values appearing like _sellingcompanies_1 etc.:
Error Logs:
```
Saving: ["accountInfo.id":"1", "accountInfo":["id":"1"], "_sellingcompanies_5":"", "_isActive":"", "code":"test", "agency_name":"test", "sellingcompanies_4":"4", "sellingcompanies_5":"5", "create":"Create", "isActive":"on", "iata":"test", "agency_id":"test", "contactinfo.id":"1", "contactinfo":["id":"1"], "consultant_id":"test", "sellingcompanies_2":"2", "_sellingcompanies_1":"", "sellingcompanies_3":"3", "_sellingcompanies_2":"", "_sellingcompanies_3":"", "sellingcompanies_1":"1", "_sellingcompanies_4":"", "action":"save", "controller":"sellingCompaniesAccount"]
null
null
null
2011-03-15 17:13:44,620 [http-8080-2] ERROR org.codehaus.groovy.grails.web.errors.GrailsExceptionResolver - For input string: "_5"
java.lang.NumberFormatException: For input string: "_5"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:449)
at java.lang.Integer.valueOf(Integer.java:554)
at content_hub_admin.SellingCompaniesAccountController$_closure4_closure5.doCall(content_hub_admin.SellingCompaniesAccountController:70)
at content_hub_admin.SellingCompaniesAccountController$_closure4.doCall(content_hub_admin.SellingCompaniesAccountController:66)
at content_hub_admin.SellingCompaniesAccountController$_closure4.doCall(content_hub_admin.SellingCompaniesAccountController)
at java.lang.Thread.run(Thread.java:680)
```
First of all, where does the hidden values come from and is this approach fine to commit the the Many-Many relationship info in SellingCompaniesAccount controller class. Any better technique of doing this.
The create.gsp resolves to this in the browser:

Thanks in advance
| Saving object having many-to-many relationship in grails | CC BY-SA 2.5 | 0 | 2011-03-15T17:40:08.313 | 2021-02-23T12:33:32.363 | 2011-03-15T17:56:30.613 | 439,670 | 439,670 | [
"grails",
"groovy",
"save",
"has-many"
]
|
5,315,812 | 1 | null | null | 53 | 15,547 | The right-click context menus of the source editor, the project items and the solution item, is getting ridiculously long, and two of them even have scrolling now on my 1680x1050 screen.
Is there any way for me to hide items on these menus, even if I have to add an event to my Visual Studio macro-system and find and hide them manually?
Here's examples, many of these items I use:

The current answer + comments suggest I should use the Customize menu item in the toolbar context menus, go to the second tab, Commands, and use the Context Menus radio selection and find the relevant menus there.
Here are 3, which are suggested by comments:

As you can see, they're all empty.
After clicking the "Reset All" button in that dialog, for the Solution and Project menus, I got items in the dialog, that I could edit, but the changes did not affect the actual context menu on either a project or the solution file. Also, after restarting Visual Studio, the dialog contents for those two were again empty.
| Hide items in the right-click context menus in Visual Studio 2010 (08)? | CC BY-SA 2.5 | 0 | 2011-03-15T17:47:03.613 | 2015-01-21T01:39:57.660 | 2011-03-15T18:45:21.480 | 267 | 267 | [
"visual-studio-2010",
"contextmenu",
"right-click"
]
|
5,316,133 | 1 | null | null | 4 | 3,591 | I need a table that displays properties and allows their values to be changed. Similar to the Netbeans properties windows for the GUI editor. Does anyone know of any existing classes or libraries. I'd hate to reinvent the wheel on this one.
Edit:
Something like this which allows separators into different groups, JCombos, and JButtons to all be used.

Thanks
| Properties Table in Java | CC BY-SA 2.5 | 0 | 2011-03-15T18:14:22.513 | 2011-12-07T22:15:02.450 | 2011-03-15T18:20:39.907 | 489,041 | 489,041 | [
"java",
"user-interface",
"netbeans",
"properties"
]
|
5,316,295 | 1 | null | null | 6 | 1,964 | When I try to compress the a jpg image, most of the time it work perfectly, however some jpg image turn green after the compression. Here is my code
```
public void compressImage(String filename, String fileExtension) {
BufferedImage img = null;
try {
File file = new File(filename);
img = ImageIO.read(file);
if (fileExtension.toLowerCase().equals(".png") || fileExtension.toLowerCase().equals(".gif")) {
//Since there might be transparent pixel, if I dont do this,
//the image will be all black.
for (int x = 0; x < img.getWidth(); x++) {
for (int y = 0; y < img.getHeight(); y++) {
int rgb = img.getRGB(x, y);
int alpha = (rgb >> 24) & 0xff;
if (alpha != 255) {
img.setRGB(x, y, -1); //set white
}
}
}
}
Iterator iter = ImageIO.getImageWritersByFormatName("jpg");
//Then, choose the first image writer available
ImageWriter writer = (ImageWriter) iter.next();
//instantiate an ImageWriteParam object with default compression options
ImageWriteParam iwp = writer.getDefaultWriteParam();
//Set the compression quality
iwp.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
iwp.setCompressionQuality(0.8f);
//delete the file. If I dont the file size will stay the same
file.delete();
ImageOutputStream output = ImageIO.createImageOutputStream(new File(filename));
writer.setOutput(output);
IIOImage image = new IIOImage(img, null, null);
writer.write(null, image, iwp);
writer.dispose();
} catch (IOException ioe) {
logger.log(Level.SEVERE, ioe.getMessage());
}
}
```


| Compress JPG make the image turn green | CC BY-SA 2.5 | 0 | 2011-03-15T18:28:19.630 | 2021-12-08T15:01:29.843 | 2011-03-15T19:11:09.310 | 240,337 | 240,337 | [
"java",
"compression",
"jpeg",
"javax.imageio",
"image-compression"
]
|
5,316,460 | 1 | null | null | 0 | 107 | i have problems with filewriting-reading. I am gonna be short on words.
When user pushes OK btn a string is added to assignArr ArrayList. At this time, this string is saved to a file. When user adds a new string (by pushing OK btn) to Arraylist, only the former and the new item is in it, so there is no duplication. This is how i save the arraylist in the okbtn listener to a file:
```
if (assignArr.size() > 0)
{
String filename = "tomato35.txt";
FileOutputStream fos;
try {
fos = openFileOutput(filename,Context.MODE_PRIVATE);
ObjectOutputStream out = new ObjectOutputStream(fos);
fos.flush();
for (int t=0; t<assignArr.size(); t++)
{
out.writeUTF(assignArr.get(t).toString() + "\n");
Toast.makeText(MainActivity.this, "Saving OK + " + assignArr.get(t), Toast.LENGTH_LONG).show();
}
out.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Toast.makeText(MainActivity.this, "assignArrsize: " + assignArr.size(), Toast.LENGTH_LONG).show();
}
```
Lets suppose i added the String "Daddy Alex".
So the output of this is "Saving OK + Daddy Alex", which is an item in the assignArr.
Now i quit the application, so the assignArr Arraylist gets empty, as it is only a variable. Now i reopen my app and now the content of the file should be read into an arraylist:
```
try {
InputStream is = openFileInput("tomato35.txt");
BufferedReader br = new BufferedReader(new InputStreamReader(is));
String line;
String NL = System.getProperty("line.separator");
while((line = br.readLine()) != null)
{
assignArr.add(line);
}
is.close();
}
catch (IOException e)
{
e.printStackTrace();
}
for (int i=0; i<assignArr.size(); i++)
{
Toast.makeText(MainActivity.this, "AssignArr." + i + " = " + assignArr.get(i), Toast.LENGTH_LONG).show();
}
```
I am posting some outputs based on different strings in the assignArr:

I have also tried this:
```
String filename = "tomato35.txt";
BufferedWriter bw = null;
bw = new BufferedWriter(new FileWriter(filename, true));
for (int t=0; t<assignArr.size(); t++)
{
bw.write(assignArr.get(t).toString() + "\n");
Toast.makeText(MainActivity.this, "Saving OK + " + assignArr.get(t), Toast.LENGTH_LONG).show();
}
bw.flush();
```
and
```
PrintWriter f;
File file ;
file = new File("tomato44.txt");
f = new PrintWriter(file);
for (int t=0; t<assignArr.size(); t++)
{
f.println(assignArr.get(t).toString());
Toast.makeText(MainActivity.this, "Saving OK + " + assignArr.get(t), Toast.LENGTH_LONG).show();
}
f.close();
```
But in these cases i don't even get the Toast msg...
i have no idea why are these wrong. Sometimes the output is ok at first time, but when i add another item to the assignArr, write to file, exit and then reopen the app, this second item is wrong, but the first is ok. I've been struggling with this for days now...
| Android filereading problem | CC BY-SA 2.5 | null | 2011-03-15T18:44:48.370 | 2011-05-11T01:32:39.190 | 2020-06-20T09:12:55.060 | -1 | 571,648 | [
"android",
"file"
]
|
5,316,493 | 1 | 5,317,107 | null | 7 | 1,047 | If I have a Manipulate statement, such as:
```
Manipulate[
Graphics[Line[{{0, 0}, pt}], PlotRange -> 2], {{pt, {1, 1}},
Locator}]
```

How do I change the appearance of the Locator object in the easiest way possible? Do I have to resort to Dynamic statements? Specifically, I would have liked to make the Locator invisible.
| How do I control the appearance of a Locator inside a Mathematica's Manipulate statement? | CC BY-SA 3.0 | 0 | 2011-03-15T18:47:57.980 | 2012-01-03T21:43:50.830 | 2012-01-03T21:42:59.377 | 615,464 | 159,584 | [
"wolfram-mathematica"
]
|
5,316,545 | 1 | 5,320,843 | null | 65 | 202,675 | After [proudly coloring my liststyle bullet without any image url or span tags](https://stackoverflow.com/questions/5306640/how-to-define-the-color-of-bullets-in-ul-li-lists-via-css), via:
```
ul{ list-style: none; padding:0; margin:0; }
li{ padding-left: 1em; text-indent: -1em; }
li:before { content: "■"; padding-right:7px; }
```
Although these stylesheets work perfectly down to the rounded borders and other css3 stuff, and although the recipient of the email (for instance, Eudora OSE 1) renders all css styles correctly, just like in a browser, there is one problem: the bullets like `•` or `■` become converted into `&#adabacadabra;`
Appearing finally like so in emails:

How do I proceed from here?
| li:before{ content: "■"; } How to Encode this Special Character as a Bullit in an Email Stationery? | CC BY-SA 3.0 | 0 | 2011-03-15T18:53:34.737 | 2021-03-12T23:39:30.120 | 2017-05-23T11:54:07.150 | -1 | 509,670 | [
"css",
"list",
"character-encoding",
"special-characters"
]
|
5,317,086 | 1 | 5,317,389 | null | 3 | 1,253 | The following code allows you to play with the values in a Wheatstone Bridge. The output appears to the right of the sliders. How do I make the output panel () appear somewhere else and how do I set a fixed size? (I can only find options for manipulating size and position of Controls, not the output in the Manipulate docs.)
```
Manipulate[
Evaluate[(10^Rx/(10^R3 + 10^Rx) - 10^R2/(10^R1 + 10^R2))*Vin] "V",
{{R1, 5}, 1, 6, 0.01},
Pane["R1 = " Dynamic[Round[10^R1] "\[CapitalOmega]"],
ImageMargins -> {{2.5, 0}, {3, 0}}], {{R2, 5}, 1, 6, 0.01},
Pane["R2 = " Dynamic[Round[10^R2] "\[CapitalOmega]"],
ImageMargins -> {{2.5, 0}, {3, 0}}], {{R3, 5}, 1, 6, 0.01},
Pane["R3 = " Dynamic[Round[10^R3] "\[CapitalOmega]"],
ImageMargins -> {{2.5, 0}, {3, 0}}],
{{Rx, 5}, 1, 6, 0.01},
Pane["Rx = " Dynamic[Round[10^Rx] "\[CapitalOmega]"],
ImageMargins -> {{2.5, 0}, {3, 0}}],
{{Vin, 2.5}, 0, VMax, Appearance -> "Open"}]
```

| How Do I Position & Size the Output in a Manipulate Panel in Mathematica? | CC BY-SA 2.5 | 0 | 2011-03-15T19:42:58.990 | 2011-03-15T22:58:16.097 | 2011-03-15T22:48:13.377 | 618,728 | 14,572 | [
"user-interface",
"wolfram-mathematica"
]
|
5,317,213 | 1 | 5,317,983 | null | 0 | 3,334 | I have followed the Facebook PHP SDK example and created the following.
```
<?php
require ("lib/facebook.php");
$facebook = new Facebook(array('appId' => 'XXXXXXXXXXXX', 'secret' => 'XXXXXXXXXXXXXXXXXXXXXXX', 'cookie' => true, ));
$session = $facebook->getSession();
$me = null;
// Session based API call.
if($session) {
try {
$uid = $facebook->getUser();
$me = $facebook->api('/me');
}
catch (FacebookApiException $e) {
error_log($e);
}
}
// login or logout url will be needed depending on current user state.
if($me) {
$logoutUrl = $facebook->getLogoutUrl();
} else {
$loginUrl = $facebook->getLoginUrl();
}
?>
<!doctype html>
<html xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<title>php-sdk</title>
<style>
body {
font-family: 'Lucida Grande', Verdana, Arial, sans-serif;
}
h1 a {
text-decoration: none;
color: #3b5998;
}
h1 a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '<?php
echo $facebook->getAppId();
?>',
session : <?php
echo json_encode($session);
?>, // don't refetch the session when PHP already has it
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
// whenever the user logs in, we refresh the page
FB.Event.subscribe('auth.login', function() {
window.location.reload();
});
};
(function() {
var e = document.createElement('script');
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
</script>
<?php
if($me):
?>
<a href="<?php
echo $logoutUrl;
?>"> <img src="http://static.ak.fbcdn.net/rsrc.php/z2Y31/hash/cxrz4k7j.gif"> </a>
<?php
else:
?>
<div> Using JavaScript & XFBML:
<fb:login-button></fb:login-button>
</div>
<?php
endif;
?>
<h3>Session</h3>
<?php
if($me):
?>
<pre><?php
print_r($session);
?></pre>
<h3>You</h3>
<img src="https://graph.facebook.com/<?php
echo $uid;
?>/picture"> <?php
echo $me['name'];
?>
<h3>Your User Object</h3>
<pre><?php
print_r($me);
?></pre>
<?php
else:
?>
<strong><em>You are not Connected.</em></strong>
<?php
endif;
?>
<?php
print_r($me);
?>
</body>
</html>
```
When i click Login. It opens the window and when i allow permission. It refreshes the window. only to show the same content. when i do a `print_r($me)` nothing is visible.
When i check in the Application settings. The application has been installed in my fb account.


| Facebook Connect Fetching user Data | CC BY-SA 2.5 | null | 2011-03-15T19:53:32.020 | 2012-06-26T05:56:08.027 | 2011-03-16T03:17:07.567 | 155,196 | 155,196 | [
"facebook",
"facebook-graph-api",
"facebook-php-sdk"
]
|
5,317,369 | 1 | 7,210,247 | null | 4 | 1,819 | I have a UIView subclass on which the user can add a random CGPath. The CGPath is added by processing UIPanGestures.
I would like to resize the UIView to the minimal rect possible that contains the CGPath. In my UIView subclass, I have overridden sizeThatFits to return the minimal size as such:
```
- (CGSize) sizeThatFits:(CGSize)size {
CGRect box = CGPathGetBoundingBox(sigPath);
return box.size;
}
```
This works as expected and the UIView is resized to the value returned, but the CGPath is also "resized" proportionally resulting in a different path that what the user had originally drawn. As an example, this is the view with a path as drawn by the user:

And this is the view with the path after resizing:

How can I resize my UIView and not "resize" the path?
| Resize UIView to fit a CGPath | CC BY-SA 2.5 | 0 | 2011-03-15T20:06:17.073 | 2011-08-26T21:15:10.800 | null | null | 185,064 | [
"ios",
"uiview",
"cgpath"
]
|
5,317,895 | 1 | 5,317,945 | null | 1 | 1,256 | I have such a funny question.
I have the following architecture:

For example, Manager class is implemented like this:
```
public sealed class Manager : Interface.Abstract.Employee
{
private Interface.IEmployee chief = null;
private readonly Decimal bonuslimit = Convert.ToDecimal(0.4F * Convert.ToSingle(BaseSalary));
public Manager(Person person, DateTime hiredate)
: base(person, hiredate)
{
}
public override List<Interface.IEmployee> Subordinates
{
get;
set;
}
public override Interface.IEmployee Chief
{
get
{
return this.chief;
}
set
{
//if(value is Associate)
//{
// throw new SystemException("Associate can't be a chief");
//}
this.chief = value;
}
}
public override Decimal Salary
{
get
{
var actualbonus = Convert.ToDecimal(0.01F * Convert.ToSingle(this.YearsSinceHired * BaseSalary));
var bonus = (actualbonus > bonuslimit) ? bonuslimit : actualbonus;
var additional = 0M;
if(this.HasSubordinates)
{
foreach(Interface.Abstract.Employee employee in this.Subordinates)
{
if(employee is Sales)
{
additional += employee.Salary;
}
}
}
return Convert.ToDecimal(Convert.ToSingle(additional) * 0.005F) + BaseSalary + bonus;
}
}
}
```
And 'factory client' that looks like this:
```
public class EmployeeFactoryClient
{
private IDictionary<String, IEmployee> employees = new Dictionary<String, IEmployee>();
public EmployeeFactoryClient()
{
this.Factory = new EmployeeFactory();
}
public EmployeeFactoryClient(IEmployeeFactory factory)
{
this.Factory = factory;
}
public IEmployeeFactory Factory { get; set; }
public void HireEmployee(Person person, String type, String code)
{
this.employees.Add(
new KeyValuePair<String, IEmployee>(
code,
this.Factory.Create(person, type, DateTime.Now)
)
);
}
public void DismissEmployee(String code)
{
this.employees.Remove(code);
}
public IEmployee GetEmployee(String code)
{
return this.employees[code];
}
public IEmployee this[String index]
{
get { return this.employees[index]; }
private set { this.employees[index] = value; }
}
public Decimal TotalSalary
{
get
{
var result = 0M;
foreach(var item in this.employees)
{
result += item.Value.Salary;
}
return result;
}
}
}
```
And finally I have some test code:
```
public void SalaryTest()
{
#region [Persons]
var SalesPerson01 = new Person
{
Birthday = new DateTime(1980, 11, 03),
Forename = "Corey",
Surname = "Black",
Gender = SexType.Female
};
var SalesPerson02 = new Person
{
Birthday = new DateTime(1980, 11, 03),
Forename = "John",
Surname = "Travis",
Gender = SexType.Male
};
#endregion
this.company.HireEmployee(SalesPerson01, "Sales", SalesPerson01.GetHashCode().ToString());
((Employee)this.company[SalesPerson01.GetHashCode().ToString()]).YearsSinceHired = 10;
this.company.HireEmployee(SalesPerson02, "Sales", SalesPerson02.GetHashCode().ToString());
((Employee)this.company[SalesPerson02.GetHashCode().ToString()]).YearsSinceHired = 3;
///////////////////////////////////////////////////////////////////
((Employee)this.company[SalesPerson01.GetHashCode().ToString()]).Subordinates.Add(
this.company[SalesPerson02.GetHashCode().ToString()]
);
Assert.AreEqual(1405M, this.company.TotalSalary);
}
```
Line
`((Employee)this.company[SalesPerson01.GetHashCode().ToString()]).Subordinates.Add(this.company[SalesPerson02.GetHashCode().ToString()]);` throws `NullReferenceExeption`. In the `this.company[SalesPerson02.GetHashCode().ToString()]` indexer returns `IEmployee` interface but not a class instance. Am I right? And if it is so how do I fix that?
| Getting NullReferenceException | CC BY-SA 2.5 | null | 2011-03-15T20:51:30.417 | 2011-03-15T21:08:28.990 | null | null | 532,675 | [
"c#",
"list",
"interface",
"nullreferenceexception"
]
|
5,318,013 | 1 | 5,318,178 | null | 2 | 2,951 | I wanted to create Custom Dialog like the following image which can be called from an activity while performing validations.
The Custom Dialog should be a separate class.

How can I achieve the following the custom dialog. I gave gone through the following url
[http://developer.android.com/guide/topics/ui/dialogs.html](http://developer.android.com/guide/topics/ui/dialogs.html)
but unable to get a clear idea on how should I create the below alert .
1. How can I create my own header "Alert Info" with a background color & an icon before the text "Alert Info"
2. I wanted to also control the transparency of the alert (90 % transparency) Is it possible to achieve % transparency on Android
3. How to provide the listeners to the buttons Ok & Cancel.
Any sample code with layout xml handling the above requirements will be helpful.
Kindly provide with a sample code/suggestions.
| Create Custom Dialog | CC BY-SA 2.5 | null | 2011-03-15T21:01:01.110 | 2011-04-05T09:19:53.460 | 2011-03-15T21:02:41.660 | 12,707 | 443,141 | [
"android"
]
|
5,318,061 | 1 | 5,318,105 | null | 0 | 1,986 | Hey everyone I am trying to .submit some values with ajax response and i want to stay on current page with no refresh or $_POST.
At the 3rd image you will se my jquery script. I tried to alert('1'); etc in it. Even in the first line of function it does not alert. Strangely, It does the $_POST of the form. but not my ajax submit. as it doesnt do any process, "return false;" doesnt work too.
At the 2nd image, you see my form tag, its ID is correct its action is set to a javascript which is not necessary to run. I tried it with no "method" with no "action" with "javascript:;"
At the 1st image you will see where should my ajax response get placed. I'm searching for answer for hours. Thanks in advance for any help or comments.



| How to ajax .submit a form without post with jquery | CC BY-SA 2.5 | 0 | 2011-03-15T21:05:43.520 | 2011-03-25T20:18:24.913 | null | null | 569,063 | [
"php",
"javascript",
"jquery",
"ajax"
]
|
5,318,122 | 1 | null | null | 0 | 3,996 | Right now I have my script setup so that when each checkbox inside a table row is checked it performs the functions required (addClass and some others).
I would also like the checkboxs to check/uncheck and perform the same functions when the individual table row is clicked.
```
$('input[type="checkbox"]').bind('click',function(e) {
var $this = $(this);
if($this.is(':checked')) {
num += 1;
$('#delete_btn').fadeIn('fast');
$this.parents('tr').addClass('selected');
select_arr.unshift(this.id);
} else {
num -= 1;
if(num <= 0) {
$('#delete_btn').fadeOut('fast');
}
$this.parents('tr').removeClass('selected');
select_arr.shift(this.id);
}
});
```
What would be the best way to achieve the same result that this code does by just clicking the table row itself rather than the checkbox, but still allowing the checkboxes to function the same.

Thanks in Advance.
| Check and Uncheck Checkbox when Table Row is Clicked | CC BY-SA 2.5 | null | 2011-03-15T21:11:18.847 | 2011-05-31T05:21:44.190 | null | null | 483,185 | [
"javascript",
"jquery"
]
|
5,318,027 | 1 | 5,319,089 | null | 2 | 665 | I have an ArrayList of javabeans that I iterate over in a JSP view using `<c:forEach`
Now I want to format the output and provide subtotals based on the groupings. Groupings are set by the sql query. One way I got it to work was using a bunch of jstl `<c:set tags` in the jsp view to remember the previous row's data and then a bunch of `<c:if` to make decisions.
A  is worth a thousand words
Using JSTL worked locally on my PC but when I deployed from Eclipse to my development server for testing on the intranet, I got "Code Too Large For Try { " error. I think the reason is because I am using too many `<c:sets`.
I have an incline that the sub totaling should be done with Java code. But then how do I correlate the subtotals with the array list of beans passed to the view?
If I move the logic to my servlet, should I make another bean to model the summary rows? And then inject that bean into the array that is iterated over in the view? I'm at lost. Any ideas on a better approach?
== Edit: Added JSTL `<c:forEach` loop for commenting (eliminated bunch of rows to for breviety)
```
<c:if test="${list != null}">
<table border="0" width="95%" cellspacing="0" cellpadding="0" class="tableBlackBorder">
<tr>
<td>
<table width="100%" border="0" cellpadding="1" class="sortable" id="sortable">
<tr>
<td width="115" nowrap class="phoneTableTitle">Action</td>
<td class="phoneTableTitle">Line Code</td>
<td class="phoneTableTitle">Program</td>
<td class="phoneTableTitle">Year</td>
<td class="phoneTableTitle">Jan<br>hrs</td>
<td class="phoneTableTitle">Feb<br>hrs</td>
<td class="phoneTableTitle">Nov<br>hrs</td>
<td class="phoneTableTitle">Dec<br>hrs</td>
<td class="phoneTableTitle">Total<br>hrs</td>
</tr>
<c:set var="prevLinecode" value="" />
<c:set var="prevProgram" value="" />
<c:set var="totJan" value="" />
<c:set var="totFeb" value="" />
<c:set var="totNov" value="" />
<c:set var="totDec" value="" />
<c:set var="totSub" value="" />
<c:forEach var="ctc" items="${list}" varStatus="status">
<c:if test="${status.first}">
<tr class="TrainingTableRowBG">
<td NOWRAP class="TableOutputText"><a href="?method=view&cost_to_complete_id=<c:out value="${ctc.cost_to_complete_id}" />">view</a> - <a href="?method=edit&cost_to_complete_id=<c:out value="${ctc.cost_to_complete_id}" />">edit</a> - <a href="?method=delete&cost_to_complete_id=<c:out value="${ctc.cost_to_complete_id}" />">delete</a></td>
<td class="TableOutputText"><c:out value="${ctc.linecode}" /></td>
<td class="TableOutputText" NOWRAP><c:out value="${ctc.shop_order_range.program_name}" /></td>
<td class="TableOutputText"><c:out value="${ctc.year}" /></td>
<td class="TableOutputText"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${ctc.jan}" /></td>
<td class="TableOutputText"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${ctc.feb}" /></td>
<td class="TableOutputText"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${ctc.nov}" /></td>
<td class="TableOutputText"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${ctc.dec}" /></td>
<td class="TableOutputText"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${ctc.lineSum}" /></td>
<c:set var="lineJan" value="${ctc.jan}" />
<c:set var="lineFeb" value="${ctc.feb}" />
<c:set var="lineNov" value="${ctc.nov}" />
<c:set var="lineDec" value="${ctc.dec}" />
<c:set var="lineSub" value="${ctc.lineSum}" />
</tr>
</c:if>
<c:if test="${ctc.linecode == prevLinecode}" >
<tr class="TrainingTableRowBG">
<td width="115" NOWRAP class="TableOutputText"><a href="?method=view&cost_to_complete_id=<c:out value="${ctc.cost_to_complete_id}" />">view</a> - <a href="?method=edit&cost_to_complete_id=<c:out value="${ctc.cost_to_complete_id}" />">edit</a> - <a href="?method=delete&cost_to_complete_id=<c:out value="${ctc.cost_to_complete_id}" />">delete</a></td>
<td class="TableOutputText"><c:out value="${ctc.linecode}" /></td>
<td class="TableOutputText" NOWRAP><c:out value="${ctc.shop_order_range.program_name}" /></td>
<td class="TableOutputText"><c:out value="${ctc.year}" /></td>
<td class="TableOutputText"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${ctc.jan}" /></td>
<td class="TableOutputText"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${ctc.feb}" /></td>
<td class="TableOutputText"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${ctc.nov}" /></td>
<td class="TableOutputText"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${ctc.dec}" /></td>
<td class="TableOutputText"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${ctc.lineSum}" /></td>
<c:set var="lineJan" value="${lineJan + ctc.jan}" />
<c:set var="lineFeb" value="${lineFeb + ctc.feb}" />
<c:set var="lineNov" value="${lineNov + ctc.nov}" />
<c:set var="lineDec" value="${lineDec + ctc.dec}" />
<c:set var="lineSub" value="${lineSub + ctc.lineSum}" />
</tr>
</c:if>
<c:if test="${ctc.linecode != prevLinecode && !status.first}" >
<tr class="CTCSummary">
<td colspan="2">Summary For Contract: </td>
<td><c:out value="${prevContract}" /></td>
<td colspan="11" class="TableRowBGSubNav"></td>
<td class="TableRowBGSubNav"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${lineJan}" /></td>
<td class="TableRowBGSubNav"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${lineFeb}" /></td>
<td class="TableRowBGSubNav"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${lineNov}" /></td>
<td class="TableRowBGSubNav"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${lineDec}" /></td>
<td class="TableRowBGSubNav"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${lineSub}" /></td>
<c:set var="progJan" value="${progJan + lineJan}" />
<c:set var="progFeb" value="${progFeb + lineFeb}" />
<c:set var="progNov" value="${progNov + lineNov}" />
<c:set var="progDec" value="${progDec + lineDec}" />
<c:set var="progSub" value="${progSub + lineSub}" />
</tr>
<c:if test="${ctc.shop_order_range.program_name != prevProgram && !status.first}" >
<tr class="CTCProgramSummary">
<td colspan="2">Summary for Program:</td>
<td><c:out value="${prevProgram}" /></td>
<td colspan="11" class="TableRowBGSubNav"></td>
<td class="TableRowBGSubNav"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${progJan}" /></td>
<td class="TableRowBGSubNav"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${progFeb}" /></td>
<td class="TableRowBGSubNav"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${progNov}" /></td>
<td class="TableRowBGSubNav"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${progDec}" /></td>
<td class="TableRowBGSubNav"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${progSub}" /></td>
<c:set var="totJan" value="${totJan + progJan}" />
<c:set var="totFeb" value="${totFeb + progFeb}" />
<c:set var="totNov" value="${totNov + progNov}" />
<c:set var="totDec" value="${totDec + progDec}" />
<c:set var="totSub" value="${totSub + progSub}" />
<c:set var="progJan" value="" />
<c:set var="progFeb" value="" />
<c:set var="progNov" value="" />
<c:set var="progDec" value="" />
<c:set var="progSub" value="" />
</tr>
</c:if>
<tr class="TrainingTableRowBG">
<td width="115" NOWRAP class="TableOutputText"><a href="?method=view&cost_to_complete_id=<c:out value="${ctc.cost_to_complete_id}" />">view</a> - <a href="?method=edit&cost_to_complete_id=<c:out value="${ctc.cost_to_complete_id}" />">edit</a> - <a href="?method=delete&cost_to_complete_id=<c:out value="${ctc.cost_to_complete_id}" />">delete</a></td>
<td class="TableOutputText"><c:out value="${ctc.linecode}" /></td>
<td class="TableOutputText" NOWRAP><c:out value="${ctc.shop_order_range.program_name}" /></td>
<td class="TableOutputText"><c:out value="${ctc.year}" /></td>
<td class="TableOutputText"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${ctc.jan}" /></td>
<td class="TableOutputText"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${ctc.feb}" /></td>
<td class="TableOutputText"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${ctc.nov}" /></td>
<td class="TableOutputText"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${ctc.dec}" /></td>
<td class="TableOutputText"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${ctc.lineSum}" /></td>
<c:set var="lineJan" value="${ctc.jan}" />
<c:set var="lineFeb" value="${ctc.feb}" />
<c:set var="lineNov" value="${ctc.nov}" />
<c:set var="lineDec" value="${ctc.dec}" />
<c:set var="lineSub" value="${ctc.lineSum}" />
</tr>
</c:if>
<c:set var="prevLinecode" value="${ctc.linecode}" />
<c:set var="prevProgram" value="${ctc.shop_order_range.program_name}" />
<c:if test="${status.last}" >
<tr class="CTCSummary">
<td colspan="2">Last Summary For Contract: </td>
<td><c:out value="${prevContract}" /></td>
<td colspan="11" class="TableRowBGSubNav"></td>
<td width="31" class="TableRowBGSubNav"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${lineJan}" /></td>
<td width="31" class="TableRowBGSubNav"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${lineFeb}" /></td>
<td width="31" class="TableRowBGSubNav"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${lineNov}" /></td>
<td width="31" class="TableRowBGSubNav"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${lineDec}" /></td>
<td width="31" class="TableRowBGSubNav"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${lineSub}" /></td>
<c:set var="progJan" value="${progJan + lineJan}" />
<c:set var="progFeb" value="${progFeb + lineFeb}" />
<c:set var="progNov" value="${progNov + lineNov}" />
<c:set var="progDec" value="${progDec + lineDec}" />
<c:set var="progSub" value="${progSub + lineSub}" />
</tr>
<tr class="CTCProgramSummary">
<td colspan="2">Summary for Program:</td>
<td><c:out value="${prevProgram}" /></td>
<td colspan="11" class="TableRowBGSubNav"></td>
<td class="TableRowBGSubNav"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${progJan}" /></td>
<td class="TableRowBGSubNav"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${progFeb}" /></td>
<td class="TableRowBGSubNav"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${progNov}" /></td>
<td class="TableRowBGSubNav"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${progDec}" /></td>
<td class="TableRowBGSubNav"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${progSub}" /></td>
<c:set var="totJan" value="${totJan + progJan}" />
<c:set var="totFeb" value="${totFeb + progFeb}" />
<c:set var="totNov" value="${totNov + progNov}" />
<c:set var="totDec" value="${totDec + progDec}" />
<c:set var="totSub" value="${totSub + progSub}" />
</tr>
</c:if>
</c:forEach>
<tr class="CTCTotalSummary">
<td colspan="2">TOTAL:</td>
<td></td>
<td colspan="11" class="TableRowBGSubNav"></td>
<td class="TableRowBGSubNav"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${totJan}" /></td>
<td class="TableRowBGSubNav"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${totFeb}" /></td>
<td class="TableRowBGSubNav"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${totNov}" /></td>
<td class="TableRowBGSubNav"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${totDec}" /></td>
<td class="TableRowBGSubNav"><fmt:formatNumber type="number" minIntegerDigits="1" minFractionDigits="2" value="${totSub}" /></td>
</tr>
</table>
</td>
</tr>
</table>
</c:if>
```
| Format output from Iterating over a list of Javabeans | CC BY-SA 2.5 | null | 2011-03-15T21:02:27.530 | 2011-03-16T14:42:04.980 | 2011-03-16T14:42:04.980 | 358,794 | 358,794 | [
"java",
"jsp",
"web-applications"
]
|
5,318,175 | 1 | 5,428,212 | null | 7 | 8,221 | When loading data into my Fragments I would would like to have an indeterminate spinner in the middle of the fragment (example in pic below) to show the user that content is loading within that particular pane.
What's the best way to do this in Honeycomb?
I don't really want to use a spinner in the action bar, it's not immediately obvious where data is loading. Also, I don't want an indeterminate progress dialog because it appears in the center of the entire app and also stops the user from doing anything else until it is dismissed. N.B. FragmentDialogs seem to do this also.
Am I going to have to hack around with a custom FrameLayout to get the desired effect for each pane?

| Fragment loading spinner/dialog in Honeycomb | CC BY-SA 2.5 | 0 | 2011-03-15T21:16:19.817 | 2011-05-29T07:02:51.473 | 2011-05-29T07:02:51.473 | 750,987 | 227,228 | [
"android",
"spinner",
"progressdialog",
"android-fragments",
"android-3.0-honeycomb"
]
|
5,318,497 | 1 | 5,321,340 | null | 1 | 587 | I have a Tab Bar application and in there I have a Navigation Bar going back and forth between 2 views with a back button (1st view - home, 2nd view - google map website link). On the second view, when I implemented a UIWebView and gave it a google map url of my company's location, when I ran it in iOS Simulation, it ran the google map application in the UIWebView, but the problem is that in the bottom left corner, the zoom in button is showing, but the zoom out button is hiding 2/3 if the button image, so I was wondering how can I adjust the UIWebView screen size to fit in with the UINavigationController? Hope someone can help and please let me know if you do not understand my question
*I posted a picture to show you on my iOS simulator what I'm talking about, the botton left corner is where my zoom out is not fully showing

| UIWebview size problem with UINavigationController | CC BY-SA 2.5 | null | 2011-03-15T21:47:30.923 | 2012-12-28T18:44:06.443 | 2011-03-16T06:21:43.060 | 30,461 | 616,482 | [
"iphone",
"cocoa-touch",
"google-maps",
"uikit",
"zooming"
]
|
5,318,564 | 1 | 5,318,776 | null | 2 | 2,886 | I have twoo views. I want to rotate one view by 90 degrees, is it possible? My view is an Admob View. My admobview now shows on the screens left. Picture:

I d like to rotate that view by 90 degrees, to my view's bottom. Is it possible?
I have a code, but is not working, and when the admob is refreshing than the views state change to the original state.:(
and i dont want to change it to landscape, thanks.
| Android rotate a View only by 90 degrees | CC BY-SA 2.5 | null | 2011-03-15T21:54:26.987 | 2011-03-15T22:19:28.533 | 2011-03-15T21:59:43.393 | 472,537 | 472,537 | [
"android",
"rotation"
]
|
5,318,837 | 1 | 5,322,910 | null | 1 | 540 | Some time ago, as part of the process of learning Python+Django, I decided to write a custom MySQL-specific model field for the BIT column type. Unfortunately, I've ran into a problem.
contains a single "main" app
contains all of the standard files created by "python manage.py startapp", plus extfields.py
```
from django.db import models
import re
import bitstring
class BitField(models.Field):
description = 'A class representing a field of type "BIT" (MySQL-specific)'
__metaclass__ = models.SubfieldBase
def __init__(self, *args, **kwargs):
bf_size = int(kwargs.pop('bitfield_size', 0))
assert bf_size > 0, '%ss must have a positive bitfield_size' % self.__class__.__name__
self._bf_size = bf_size
super(BitField, self).__init__(*args, **kwargs)
def db_type(self):
return 'BIT(%d)' % self._bf_size
def to_python(self, value):
print('to_python starts')
if isinstance(value, bitstring.BitArray):
return value
value = str(value)
regex = re.compile('^[01]{%d}$' % self._bf_size)
assert regex.search(value) == True, 'The value must be a bit string.'
print('to_python ends')
return bitstring.BitArray(bin=value)
def get_db_prep_value(self, value):
return value.bin
```
```
from django.db import models
import extfields
class MessageManager(models.Manager):
"""
This manager is solely for the Message model. We need to alter the default
QuerySet so that we'll get the correct values for the attributes bit field
"""
def get_query_set(self):
return super(MessageManager, self).get_query_set().defer(
'attributes'
).extra(
select={'attributes': 'BIN(attributes)'}
)
class Message(models.Model):
attributes = extfields.BitField(bitfield_size=15)
objects = MessageManager()
```
When I use the python shell (via python manage.py shell), I get the following:
```
>>> from main import models
>>> m = models.Message.objects.get(pk=1)
>>> m
<Message_Deferred_attributes: Message_Deferred_attributes object>
>>> m.attributes
u'1110001110'
>>> type(m.attributes)
<type 'unicode'>
>>> m.attributes = '1312312'
>>> m.attributes
'1312312'
```
As you see, the m.attributes is a plain string, instead of bitstring.BitArray instance.
Could someone please tell me where I've made a mistake?
I'm using Python 2.6.5 on Ubuntu 10.04. The bitstring module I import is this one: [http://code.google.com/p/python-bitstring/](http://code.google.com/p/python-bitstring/). Python-django package version is 1.1.1-2ubuntu1.3.
right now my to_python() definition looks like this:
```
def to_python(self, value):
print 'to_python'
if isinstance(value, bitstring.BitArray):
return value
print type(value)
value = str(value)
print'\n'
print value
print '\n'
print type(value)
regex = re.compile('^[01]{%d}$' % self._bf_size)
assert regex.search(value) == True, 'The value must be a bit string.'
value = bitstring.BitArray(bin=value)
print '\n'
print type(value)
print 'End of to_python'
return value
```
The console output is:

After this, an AssertionError is raised.
| to_python() never gets called (even in case of __metaclass__ = models.SubfieldBase) | CC BY-SA 2.5 | 0 | 2011-03-15T22:27:01.547 | 2011-03-16T10:58:15.710 | 2011-03-16T10:58:15.710 | 70,064 | 70,064 | [
"python",
"django",
"django-models"
]
|
5,318,929 | 1 | 5,319,035 | null | 1 | 111 | I am trying to create an iphone application that reads a json feed and I am having some trouble updating a TableView.
This is my TableViewController header file:
```
@interface LiveNewsController : UITableViewController <UITableViewDelegate, UITableViewDataSource>{
NSMutableData *responseData;
NSMutableArray *articleArray;
UITableView *tblView;
}
-(void) refreshPressed: (id)sender;
@property (nonatomic, retain) IBOutlet UITableView *tblView;
@end
```
These are parts of my TableViewController implementation file:
```
@implementation LiveNewsController
@synthesize tblView;
-(id) init {
if(self = [super init])
{
self.title = @"Live News";
}
return self;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
NSLog(@"I am here %d",[articleArray count]);
return [articleArray count];
}
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
NSLog(@"cellForRowAtIndexPath called. Data size %d", [articleArray count]);
NSUInteger row = [indexPath row];
cell.textLabel.text = [articleArray objectAtIndex:row];
return cell;
}
-(void) refreshPressed: (id)sender
{
NSLog(@"Reload Pressed. Data size: %d", [articleArray count]);
[tblView reloadData];
}
```
Here is a screenshot of my .xib file with the connections:

So the main idea is the following:
1. Fetch articleArray
2. When refresh is pressed update view (the data is being fetched correctly but the snippet doesn't show it here)
numberOfRowsInSection and CellForRowAtIndexPath are only being called once when the view loads but nothing happens when I press the reload button.
I checked tblView and it is . I did some research and read that this is usually caused by some erroneous connections in the .xib file but I have triple checked that and I can't seem to pinpoint the problem.
Any help is appreciated,
Thanks!
| Trouble Reloading UITableView | CC BY-SA 2.5 | null | 2011-03-15T22:38:21.120 | 2011-03-15T22:52:10.587 | null | null | 601,159 | [
"iphone"
]
|
5,319,128 | 1 | 5,319,206 | null | 3 | 204 | I come from a PHP background where MySQL easily works from PHP, and don't the process for getting MySQL to work from Python. From all the research i did and reading of similar yet non-exact questions, it seems that there are different ways to achieve this, which makes it even harder for me to wrap my head around. So far I have MySQL-python-1.2.3 installed for python 2.7.1 in Windows XP 32Bit. Can anyone give me an overview of what is necessary to get MySQL working from Python in Windows, or even what is next after my steps all the way to fetching a table row? .
### UPDATE:
@Mahmoud, using your suggestion i have triggered the following:

| What is the process for using MySQL from Python in Windows? | CC BY-SA 2.5 | null | 2011-03-15T23:06:02.540 | 2011-04-13T13:36:14.157 | 2011-03-15T23:27:48.357 | 98,204 | 98,204 | [
"python",
"mysql",
"database",
"database-connection"
]
|
5,319,155 | 1 | null | null | 12 | 2,583 | >
[Xcode 4 Archive Version Unspecified](https://stackoverflow.com/questions/5332115/xcode-4-archive-version-unspecified)
Hi,
I'm archiving an application for iPad adhoc deployment but when I try to share the archive, the option for ipa construction is not available. The application I'm trying to deploy was created using XCode 3. It worked perfectly fine over there.
My problem seems to be, that the created archive has two missing values. The organizer shows the value of "version" as "unspecified" and the value "identifier" is empty. I tried setting this values in my info.plist and in the Info-tab in the project settings. None of it worked.
So why are these values not correctly set?
Here is a screen shot:

| xcode4 archive/ipa problem | CC BY-SA 3.0 | 0 | 2011-03-15T23:10:20.493 | 2011-04-08T05:59:12.937 | 2017-05-23T11:48:24.847 | -1 | 661,537 | [
"xcode4",
"archive",
"ipa"
]
|
5,319,419 | 1 | 5,320,026 | null | 2 | 475 | I want to press the QTY button (red text) and copy the text (ie 13) into the textfield in the same row.

```
-(IBAction)qtyButtonPressed:(id)sender {
UITextField *textField = (UITextField *)[self.view viewWithTag:3];
textField.text = @"13";
```
this is what i have atm.
| HELP! uitableviewcell buttonpressed update textfield | CC BY-SA 2.5 | 0 | 2011-03-15T23:50:02.353 | 2012-02-26T18:05:01.387 | 2011-03-16T00:24:18.677 | 517,169 | 517,169 | [
"iphone",
"ios",
"ipad",
"uitableview"
]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.