Id
int64 1.68k
75.6M
| PostTypeId
int64 1
2
| AcceptedAnswerId
int64 1.7k
75.6M
⌀ | ParentId
int64 1.68k
75.6M
⌀ | Score
int64 -60
3.16k
| ViewCount
int64 8
2.68M
⌀ | Body
stringlengths 1
41.1k
| Title
stringlengths 14
150
⌀ | ContentLicense
stringclasses 3
values | FavoriteCount
int64 0
1
⌀ | CreationDate
stringlengths 23
23
| LastActivityDate
stringlengths 23
23
| LastEditDate
stringlengths 23
23
⌀ | LastEditorUserId
int64 -1
21.3M
⌀ | OwnerUserId
int64 1
21.3M
⌀ | Tags
sequence |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3,791,024 | 1 | 3,791,187 | null | 8 | 20,615 | jQuery.validate doesn't seem to change the background color of the invalid element by default. Is it also possible to change the background color of a `select` element? Most of my elements are `input type="text"`, but I need an indicator for the select form elements. I am using the default generated messages, as they don't fit my layout.
The following code change the background color of the `input` elements, but it never reverts to its previous style:
(sample)
```
<div class="field">
<div class="labelName_fb">
<label for="email">Email</label>
</div>
<div class="divforText3">
<div class="divLeft"></div>
<div class="textbox-image3">
<input class="txt required" id="emailCreate" name="emailCreate" value="" maxlength="100" type="text" style='width:180px'>
</div>
<div class="divright"></div>
</div>
</div>
```
Where the `input` element is given the `jqInvalid` error class on error.
```
/* line 3 */ .error { background: #ffdddd; } /* I have since removed the errorClass option */
/* line 254 */ .field .txt {background:transparent none repeat scroll 0 0;border:medium none;color:#000;font-size:11px;width:130px; margin:5px 0;}
```

| jQuery validate change color of element background | CC BY-SA 2.5 | 0 | 2010-09-24T21:10:55.240 | 2010-09-27T19:07:26.443 | 2010-09-27T17:05:22.653 | 149,023 | 149,023 | [
"jquery",
"css",
"jquery-plugins",
"jquery-validate"
] |
3,791,169 | 1 | 3,791,285 | null | 0 | 69 | I'm customizing forum software
- - `class="threadpreview"`- - - `onmouseout`
(I'm not using jQuery)
EDIT: If jQuery can do this easily I'll give it a shot

| When mousing over a link I want the div that contains the link and other content to increase in height then back down to 19px on mouse out | CC BY-SA 4.0 | null | 2010-09-24T21:33:09.133 | 2023-01-17T18:32:47.913 | 2023-01-17T18:32:47.913 | 4,370,109 | 457,761 | [
"javascript",
"dom-events"
] |
3,791,173 | 1 | 3,791,777 | null | 1 | 347 | I am new to OpenGL. I am using JOGL.
I downloaded this [model](http://www.turbosquid.com/3d-models/3d-mitsubishi-l200/394290). It has a bunch of textures. I'm trying to apply "truck_color-blue.jpg" here, but I'm not sure I'm doing it right. This is what I'm seeing:

Essentially, what I am doing is recording all the `vt`, `v`, and `vn` entries, then using the `f` lines to index into them. This is the code that makes the `glTexCoord*()` call:
```
if (facePoint.textureIndex != null) {
Vector2f texCoords = getTexture(facePoint.textureIndex);
gl.glTexCoord2f(texCoords.x, texCoords.y);
}
// ...
Point3f vertex = getVertex(facePoint.vertexIndex);
gl.glVertex3f(vertex.x, vertex.y, vertex.z);
```
I suspect that I'm not correctly matching up the texture coords to the vertices. The model says that it is UV mapped. Does that mean I need to do textures differently?
My code to read .obj files:
```
public class ObjModel extends WorldEntity {
// ...
@Override
protected void buildDrawList() {
startDrawList();
for (Polygon poly : polygons) {
if (poly.getFaces().size() == 4) {
gl.glBegin(GL2.GL_QUADS);
} else {
gl.glBegin(GL2.GL_POLYGON);
}
for (FacePoint facePoint : poly.getFaces()) {
if (facePoint.vertexIndex == null) {
throw new RuntimeException("Why was there a face with no vertex?");
}
if (facePoint.textureIndex != null) {
Vector2f texCoords = getTexture(facePoint.textureIndex);
gl.glTexCoord2f(texCoords.x, texCoords.y);
}
if (facePoint.normalIndex != null) {
// why use both Vector3f and Point3f?
Vector3f normal = getNormal(facePoint.normalIndex);
gl.glNormal3f(normal.x, normal.y, normal.z);
}
Point3f vertex = getVertex(facePoint.vertexIndex);
gl.glVertex3f(vertex.x, vertex.y, vertex.z);
}
gl.glEnd();
}
endDrawList();
}
private Point3f getVertex(int index) {
if (index >= 0) {
// -1 is necessary b/c .obj is 1 indexed, but vertices is 0 indexed.
return vertices.get(index - 1);
} else {
return vertices.get(vertices.size() + index);
}
}
private Vector3f getNormal(int index) {
if (index >= 0) {
return normals.get(index - 1);
} else {
return normals.get(normals.size() + index);
}
}
private Vector2f getTexture(int index) {
if (index >= 0) {
return textures.get(index - 1);
} else {
return textures.get(textures.size() + index);
}
}
private void readFile(String fileName) {
try {
BufferedReader input = new BufferedReader(new FileReader(fileName));
try {
String currLine = null;
while ((currLine = input.readLine()) != null) {
int indVn = currLine.indexOf("vn ");
if (indVn != -1) {
readNormal(currLine);
continue;
}
int indV = currLine.indexOf("v ");
if (indV != -1) {
readVertex(currLine);
continue;
}
int indF = currLine.indexOf("f ");
if (indF != -1) {
readPolygon(currLine);
continue;
}
int indVt = currLine.indexOf("vt ");
if (indVt != -1) {
readTexture(currLine);
continue;
}
}
} finally {
input.close();
}
} catch (IOException ex) {
ex.printStackTrace();
}
}
private void readVertex(String newLine) {
String pieces[] = newLine.split("\\s+");
Point3f vertex = new Point3f(Float.parseFloat(pieces[1]), Float.parseFloat(pieces[2]), Float.parseFloat(pieces[3]));
vertices.add(vertex);
}
private void readNormal(String newLine) {
String pieces[] = newLine.split("\\s+");
Vector3f norm = new Vector3f(Float.parseFloat(pieces[1]), Float.parseFloat(pieces[2]), Float.parseFloat(pieces[3]));
normals.add(norm);
}
private void readTexture(String newLine) {
String pieces[] = newLine.split("\\s+");
Vector2f tex = new Vector2f(Float.parseFloat(pieces[1]), Float.parseFloat(pieces[2]));
textures.add(tex);
}
private void readPolygon(String newLine) {
polygons.add(new Polygon(newLine));
}
}
```
represents a line like `f 1/2/3 4/5/6 7/8/9`.
public class Polygon {
private List faces = new ArrayList();
```
public Polygon(String line) {
if (line.charAt(0) != 'f') {
throw new IllegalArgumentException(String.format("Line must be a face definition, but was: '%s'", line));
}
String[] facePointDefs = line.split("\\s+");
// ignore the first piece - it will be "f ".
for (int i = 1; i < facePointDefs.length; i++) {
faces.add(new FacePoint(facePointDefs[i]));
}
}
public List<FacePoint> getFaces() {
return Collections.unmodifiableList(faces);
}
```
}
represents a face point, like `21/342/231`.
```
public class FacePoint {
private static final String FACE_POINT_REGEX = "^(\\d+)\\/(\\d+)?(\\/(\\d+))?$";
public Integer vertexIndex;
public Integer textureIndex;
public Integer normalIndex;
public FacePoint(String facePointDef) {
Matcher matcher = Pattern.compile(FACE_POINT_REGEX).matcher(facePointDef);
if (!matcher.find()) {
throw new IllegalArgumentException(String.format("facePointDef is invalid: '%s'", facePointDef));
}
String vertexMatch = matcher.group(1);
if (vertexMatch == null) {
throw new IllegalArgumentException(String.format("The face point definition didn't contain a vertex: '%s'",
facePointDef));
}
vertexIndex = Integer.parseInt(vertexMatch);
String texMatch = matcher.group(2);
if (texMatch != null) {
textureIndex = Integer.parseInt(texMatch);
}
String normalMatch = matcher.group(4);
if (normalMatch != null) {
normalIndex = Integer.parseInt(normalMatch);
}
}
}
```
| OpenGL: Am I texturing this wrong? | CC BY-SA 2.5 | null | 2010-09-24T21:33:58.353 | 2010-09-24T23:45:28.030 | null | null | 147,601 | [
"java",
"opengl",
"graphics",
"jogl"
] |
3,791,351 | 1 | null | null | 3 | 1,676 | When I draw a gradient fill with OpenGL, the output looks striped, i.e. it's rendered with only about the a fourth of the possible colors.
In the render buffer all the colors appear but not in the actual output.
I'm developing on iPhone 3G running iOS4.
Any ideas?
Peter
==========

==========
```
GLint redBits, greenBits, blueBits;
glGetIntegerv (GL_RED_BITS, &redBits); // ==> 8
glGetIntegerv (GL_GREEN_BITS, &greenBits); // ==> 8
glGetIntegerv (GL_BLUE_BITS, &blueBits); // ==> 8
glDisable(GL_BLEND);
glDisable(GL_DITHER);
glDisable(GL_FOG);
glDisable(GL_LIGHTING);
glDisable(GL_TEXTURE_2D);
glShadeModel(GL_SMOOTH);
const GLfloat vertices[] = {
0, 0,
320, 0,
0, 480,
320, 480,
};
const GLubyte colors[] = {
255, 255, 255, 255,
255, 255, 255, 255,
200, 200, 200, 255,
200, 200, 200, 255,
};
glVertexPointer(2, GL_FLOAT, 0, vertices);
glEnableClientState(GL_VERTEX_ARRAY);
glColorPointer(4, GL_UNSIGNED_BYTE, 0, colors);
glEnableClientState(GL_COLOR_ARRAY);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
```
| OpenGL gradient fill on iPhone looks striped | CC BY-SA 2.5 | 0 | 2010-09-24T22:03:16.927 | 2010-09-25T21:26:33.647 | 2010-09-25T16:57:42.143 | 457,788 | 457,788 | [
"iphone",
"colors",
"opengl-es",
"gradient"
] |
3,791,372 | 1 | 3,791,547 | null | 5 | 18,481 | I've encountered a strange error when attempting to update a SharePoint 2010 list that I have linked to via Microsoft Access 2010.
Error: Data cannot be inserted because there is no matching record.

This occurs in 2 scenarios:
1. I attempt to run any UPDATE query against the list in MS Access
2. I attempt to update a record from the list if the list view is filtered
The second item might need an explanation. If I simply open the linked list in Access, scroll down to a record I want to edit, and edit it, it works. If I filter that view first (for example, showing only records with a checkbox field checked), I cannot edit any records and get the error.
This only happens in one particular environment; others work fine with either approach. I've checked permissions (I have full control of the list, I am a Site Collection Administrator, etc.). I have tried linking to the list in various ways: from within Access, from the "Open with Access" ribbon button in SharePoint. I've deleted and recreated the Access DB file... no luck.
Also, Google has no knowledge of this particular error: searches for the exact error text come up with 0 results.
Any idea what to check? Running SQL-style queries against this SharePoint list is the only viable option for maintaining it.
| Data update error with SharePoint 2010 and MS Access 2010 | CC BY-SA 2.5 | null | 2010-09-24T22:07:38.250 | 2017-03-29T01:02:04.297 | null | null | 17,966 | [
"sharepoint",
"ms-access",
"sharepoint-2010",
"ms-access-2010"
] |
3,791,402 | 1 | 4,114,489 | null | 4 | 377 | I am trying to create a booking system. How do I show the selected date in 2 select boxes instead of an input which is the default in Joomla as in the image below?

I tried searching the `calendar-setup.js` file but couldn't locate any function to do this. I want to bind the click event of the calendar to the select boxes.
Any suggestions?
| Joomla Calendar customization | CC BY-SA 2.5 | null | 2010-09-24T22:13:27.380 | 2010-11-06T18:28:19.813 | 2010-11-03T19:21:54.553 | 63,550 | 56,150 | [
"joomla",
"joomla-extensions"
] |
3,791,573 | 1 | 3,792,153 | null | 1 | 164 | I have to solve a following problem.
there are many files let's say 3 for example, with the following content
a1
a2
a3
a4
a5
a6
......
b1
b2
b3
b4
b5
b6
......
c1
c2
c3
c4
c5
c6
......
my program has to take filenames in parameter, read those files and print the following result
"a1 b1 c1"
"a2 b2 c2"
"a3 b3 c3"
"a4 b4 c4"
"a5 b5 c5"
"a6 b6 c6"
......
I've already wrote one version of the program, but it start by reading all the files, and that is very inneficient because those file can be 200Mb in size.
how to write a program to retrieve a line in each file and displays my matches before moving on to the following lines in the files. This certainly will avoid loading all the files and make good use of the garbage collector?
sorry i dont know how to insert images here, it always fails, but while profiling, memory usage looks like stairs from the top to the bottom

ok it's works 1
thanks for reply
Thanks to FUZxxi his answer really help me, but there was a problem when files did not have the same number of line, to solve this problem, I've re-write his program this way
```
printLines :: [[String]] -> IO ()
printLines [] = return ()
printLines ss = do
ss' <- printFirstLine ss
if and $ map null ss' then putStrLn "finish" else printLines ss'
printFiles :: [FilePath] -> IO ()
printFiles paths = do
files <- mapM readFile paths
let fileLines = map lines files
printLines fileLines
sliceFirstRow :: [[String]] -> ([String],[[String]])
sliceFirstRow list = unzip $ map getFirst list
printFirstLine :: [[String]] -> IO ([[String]])
printFirstLine ss = do
let (fline,lline) = sliceFirstRow ss
mapM_ putStrLn fline
return lline
getFirst :: [String] -> (String, [String])
getFirst [] = ("",[])
getFirst (x:xs) = (x,xs)
```
Thanks again
| Can i deal with many files at the same time in Haskell? | CC BY-SA 2.5 | 0 | 2010-09-24T22:49:35.090 | 2010-09-26T14:49:07.210 | 2010-09-26T14:49:07.210 | 403,279 | 403,279 | [
"haskell",
"file",
"garbage-collection"
] |
3,791,591 | 1 | 3,792,853 | null | 2 | 1,246 | I'm just testing this stuff out, so I don't need an alternate approach (no GL extensions). Just hoping someone sees an obvious mistake in my usage of GLES.
I want to take an bitmap of a glyph that is smaller than 32x32 (width and height are not necessarily powers of 2) and put it into a texture so I can render it. I've first created an empty 32x32 texture then I copy the pixels into the larger texture.
```
Gluint texture;
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_2D, texture);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glTextImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, 32, 32, 0,
GL_ALPHA, GL_UNSIGNED_BYTE NULL);
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, bitmap.width(), bitmap.height(),
GL_ALPHA, GL_UNSIGNED_BYTE, bitmap.pixels());
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParamteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParamteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
```
Then I try to draw only the bitmap portion of the texture using the texture coordinates:
```
const GLfloat vertices[] = {
x + bitmap.width(), y + bitmap.height(),
x, y + bitmap.height(),
x, y,
x + bitmap.width(), y
};
const GLfloat texCoords[] = {
0, bitmap.height() / 32,
bitmap.width() / 32, bitmap.height() / 32,
0, 0,
bitmap.width() / 32, 0
};
const GLushort indices[] = { 0, 1, 2, 0, 2, 3 };
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glVertexPointer(2, GL_FLOAT, 0, vertices);
glTexCoordPointer(2, GL_FLOAT, 0, texCoords);
glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, indices);
```
Now if all were well in the world, the size of the square created by the vertices would be the same size as the bitmap portion of the texture and it would draw my bitmap exactly.
Lets say for example that my glyph was 16x16, then it should take up the bottom left quadrant of the 32x32 texture. Then the texCoords would seem to be correct with (0, 0.5), (0.5, 0.5), (0, 0) and (0.5, 0).
However my 12x12 'T' glyph looks like this: 
Anyone know why?
BTW. I start by setting up the projection matrix for 2D work as such:
```
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0.0f, 480, 800, 0.0f, 0.0f, 1.0f);
glDisable(GL_DEPTH_TEST);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslate(0.375f, 0.375f, 0.0f); // for exact pixelization
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_ALPHA);
glEnable(GL_TEXTURE_2D);
glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
```
| OpenGL ES render bitmap glyph as texture positioning issues | CC BY-SA 2.5 | 0 | 2010-09-24T22:56:52.330 | 2010-09-25T07:04:29.977 | 2010-09-25T00:43:30.313 | 44,729 | 184,413 | [
"c++",
"opengl-es",
"render-to-texture",
"text-rendering"
] |
3,791,682 | 1 | 3,822,868 | null | 2 | 257 | 
wich contains a list of students on the left and a lot of skills to assign to each student.
Each student have it´s own table with the full skill list (HTML, CSS, ...). Now whats a simple way to get value from the checkboxes and assign them to the corresponding student table?
The purpose is to creating a graph for each student showing their skillset :-) ah, sorry for my poor english.
| Insert values from checkboxes in various tables? | CC BY-SA 2.5 | 0 | 2010-09-24T23:14:22.883 | 2021-01-19T21:51:18.643 | 2021-01-19T21:51:18.643 | 1,839,439 | 457,780 | [
"php",
"database"
] |
3,791,692 | 1 | 3,792,125 | null | 1 | 1,756 | Saw this www.workatplay.com/ website, and got fascinated on how simple and nice stuff can look. I wish to make exactly like the header above.
With the header I am reffering to this:
[http://img227.imageshack.us/img227/619/header1o.png](http://img227.imageshack.us/img227/619/header1o.png)

And how the links + the "[workatplay.com]" logo is set up at the right.
I tried looking at the source & css/source for learning, but It doesnt seem to be there. The part where the nav-sub(the pink bar) gets colordefined(css) and splitted.
Is the whole header a background itself? Why cant i find it in the css or anywhere else to know how they have done.
How can i make a header like this?
| CSS: How to make this topheader? | CC BY-SA 2.5 | null | 2010-09-24T23:17:06.440 | 2010-09-25T01:57:37.630 | 2010-09-24T23:23:03.473 | 82,548 | 457,827 | [
"css"
] |
3,791,816 | 1 | 4,053,705 | null | 4 | 1,924 | I have a jQuery accordion that I am styling using the ui themes. My question is, how can I have a section that has no sub-sections and does not expand when mouse-overed? I am using mouseover as my trigger.
For example:

The Home section has nothing underneath it. I would like it to stay collapsed when hovered over. When clicked it should navigate to the href target (which it does).
Init code:
```
<script type="text/javascript">
$(function () {
$("#accordion").accordion({
event: "mouseover",
alwaysOpen: false,
autoHeight: false,
navigation: true,
});
});
</script>
```
Markup (shortened for brevity):
```
<div id="accordion">
<h3><a class="heading" href="~/Home">Home</a></h3>
<div>
</div>
<h3><a href="#">Browse</a></h3>
<div>
<li><a href="http://www.php.net/">PHP</a></li>
<li><a href="http://www.ruby-lang.org/en/">Ruby</a></li>
<li><a href="http://www.python.org/">Python</a></li>
<li><a href="http://www.perl.org/">PERL</a></li>
<li><a href="http://java.sun.com/">Java</a></li>
<li><a href="http://en.wikipedia.org/wiki/C_Sharp">C#</a></li>
</div>
</div>
```
The style sheet is straight from the jQuery ui theme library.
Thank you in advance.
Rick
| jQuery accordion control over empty sections | CC BY-SA 2.5 | 0 | 2010-09-24T23:56:16.400 | 2010-10-29T16:06:45.330 | null | null | 131,818 | [
"jquery",
"jquery-ui"
] |
3,792,039 | 1 | 3,792,059 | null | 0 | 3,316 | I signed up for an account for a free web hosting.
The site provides MySQL databases and I'm trying to access it using my windows application but I can't connect to the server. Please consider my code:
```
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MySql.Data.MySqlClient;
namespace MySql
{
public partial class Form1 : Form
{
BackgroundWorker bg = new BackgroundWorker();
string MyConString = "SERVER=209.51.195.117;" + // MySQL host: sql100.0fees.net
"DATABASE=mydb;" + // IP: 209.51.195.117
"UID=myusername;" + // not really my username
"PASSWORD=mypassword;"; // and password
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
bg.DoWork += new DoWorkEventHandler(bg_DoWork);
bg.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bg_RunWorkerCompleted);
}
void bg_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
button1.Enabled = true;
}
void bg_DoWork(object sender, DoWorkEventArgs e)
{
string status = String.Empty;
MySqlConnection connection = new MySqlConnection(MyConString);
try
{
connection.Open();
if (connection.State == ConnectionState.Open)
lblStatus.Text = "Connected";
else
lblStatus.Text = "No connection";
}
catch (Exception x)
{
lblStatus.Text = x.Message;
}
}
private void button1_Click(object sender, EventArgs e)
{
lblStatus.Text = "Connecting... please wait.";
button1.Enabled = false;
bg.RunWorkerAsync();
}
}
}
```
Is it possible to connect my application to an online database? Or are there errors in my code?
By the way, this the error message being produced: `Unable to connect to any of the specified MySQL hosts.`

| Can't connect to an online database using my window application. (C# winforms) | CC BY-SA 2.5 | null | 2010-09-25T01:21:24.680 | 2010-09-25T01:27:53.840 | null | null | 396,335 | [
"c#"
] |
3,792,100 | 1 | 3,792,106 | null | 1 | 1,274 | i am just getting started with MVVM Foundation. I am getting

my codes below:
```
class StartViewModel : ObservableObject
{
public StartViewModel() {
_counter = 0;
}
public ICommand IncrementCommand
{
get { return _incrementCommand ?? (_incrementCommand = new RelayCommand(() => ++Counter)); }
}
protected int Counter {
get { return _counter; }
set {
_counter = value;
base.RaisePropertyChanged("Counter");
}
}
protected int _counter;
protected RelayCommand _incrementCommand;
}
```
```
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50*" />
<RowDefinition Height="250*" />
</Grid.RowDefinitions>
<Button Content="Increment" Grid.Row="0" Command="{Binding IncrementCommand}" />
<TextBlock Padding="5" Text="{Binding Counter}" Grid.Row="1" />
</Grid>
```
whats wrong with the code? the error appears when i try click the Increment button
| MVVM Foundation: Assertion Failed Error: Invalid Property Name | CC BY-SA 2.5 | null | 2010-09-25T01:42:52.183 | 2010-09-25T02:09:11.087 | null | null | 292,291 | [
"c#",
"mvvm",
"mvvm-foundation"
] |
3,792,423 | 1 | 3,792,464 | null | 1 | 137 | How do you remove this:

| Remove columns in gridview | CC BY-SA 2.5 | null | 2010-09-25T03:53:17.020 | 2010-09-25T04:21:09.283 | 2010-09-25T04:21:09.283 | 16,623 | 372,935 | [
"c#",
"vb.net",
"datagridview"
] |
3,792,606 | 1 | 3,792,633 | null | 4 | 4,538 | currently, I am looking for a multi columns comb box components which can place in my Java Swing application.
Currently, I use combo box as auto complete drop down list as user is typing.

Is there any available GUI component, which enable me to have the following (multi collumns)? As you can see, there are 3 columns in the drop down list, as opposed to 1 column in the above example.

Thanks.
| Multi Columns Combo Box for Swing | CC BY-SA 2.5 | 0 | 2010-09-25T05:24:52.980 | 2010-09-25T05:36:25.010 | null | null | 72,437 | [
"java",
"swing"
] |
3,792,895 | 1 | 3,793,754 | null | 3 | 392 | I've been working with web-forms and I want to switch to the MVC pattern based on some facts and other goodies that I see in it. I was going good with MVC review when I came across the latest Dynamic Data (which in past was called Dynamic Data Templates).
Correct me if I'm wrong but I believe in backend both MVC2 & DD use the MVC pattern but then DD supports server-side controls and has a lot of automation using its latest scaffolding technique. We can make a running website with-in a few hours and DD handles most of it for us.
MS people day it is 'massively' flexible and configurable. However, as I went on looking for online resources I was disappointed (compared to the solutions available in MVC) a recent post from the asp.net forum hit me hard -
> Re: Why I won't be using Dynamic Data
any more - please read this Microsoft
And it looks like a non-MS guy has done more in DD then the actual team!
His website has some complex solutions - [http://csharpbits.notaclue.net/](http://csharpbits.notaclue.net/)
---
> Below, I've attached some of my
screens which I've accomplished in
Web-forms (I need to be able to plug
such features in my web-app). For
example, Grid-cascading, optimized
pagination, header-filters, frozen
grid-header, bulk edit, etc...grid-header, bulk edit, etc...
Please share your experience whether its wise to wait until DD matures and has enough documentation and solutions or is MVC anytime better?
Some Screens:



| ASP.Net Dynamic Data or MVC2? | CC BY-SA 2.5 | null | 2010-09-25T07:23:38.560 | 2011-04-19T18:49:55.560 | 2020-06-20T09:12:55.060 | -1 | 186,380 | [
"asp.net-mvc",
"compare",
"dynamic-data"
] |
3,792,980 | 1 | 3,798,913 | null | 1 | 190 | this is my code :
```
<div id="test" style="width:200px;height:100px;background:red" class="tabs change_font_size">
<div>
<a class="delete" style="float:right;font-size:20px;text-decoration:underline;cursor:pointer;">delete</a>
<form action="/" style="background:blue">
<input type="text" name="text"/>
<input type="submit" value="submit"/>
</form>
</div>
</div>
$('#test').draggable()
```
you can run this code in this [http://jsfiddle.net/8vntr/1/](http://jsfiddle.net/8vntr/1/)

i can drag the red div, but i can't drag the blue form ,
what can i do ?
thanks
| how to drag the blue form in the red div using jquery-ui | CC BY-SA 2.5 | null | 2010-09-25T08:03:48.273 | 2010-09-26T17:14:26.823 | null | null | 420,840 | [
"jquery",
"jquery-ui",
"draggable"
] |
3,793,079 | 1 | 3,793,156 | null | 2 | 163 | I have a table: points
it has 2 filds: X, Y
each row represents a dot on 2d field
I want to be capable of performing search of dots with in some radius R like

and is square with side A like

BTW: I use PHP to access my DB.
My main point is to get nearest to center of figure point as first result in the quqe like

How to do such thing in SQL?
| SQL: search of nearest in 2d square and circle | CC BY-SA 2.5 | null | 2010-09-25T08:42:06.500 | 2010-09-26T12:48:49.713 | 2010-09-25T20:24:20.957 | 434,051 | 434,051 | [
"php",
"sql",
"search",
"2d"
] |
3,793,381 | 1 | 3,793,411 | null | 0 | 4,421 | I've got the following layout:
```
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button android:id="@+id/back"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="Back" />
<Button android:id="@+id/page_number"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="1 / 100" />
<Button android:id="@+id/next"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="Next" />
</LinearLayout>
</LinearLayout>
```
Which results in the following

How do I make the buttons fit the screen and stop the WebView pushing them off?
| WebView and buttons layout makes buttons invisible | CC BY-SA 2.5 | null | 2010-09-25T10:15:32.337 | 2011-01-29T21:11:29.597 | null | null | 149,166 | [
"android",
"layout",
"button",
"webview"
] |
3,793,409 | 1 | 3,793,513 | null | 1 | 329 | Please see [http://jeaffreygilbert.com/workatplayheader.html](http://jeaffreygilbert.com/workatplayheader.html)
and the accepted question answer [CSS: How to make this topheader?](https://stackoverflow.com/questions/3791692/css-how-to-make-this-topheader)

As you can see all links(services, toolbox, and so including the work[at]play logo + contact us) is in this:
[](https://i.stack.imgur.com/A8Tck.png)
[workatplay.com](http://www.workatplay.com/sites/all/themes/play/css/schemes/pink/sprite-nav.png)
I wish to have normal html links.. so I have normal services. And it have anything to do with the sprite-nav.png.
| CSS: Making these navigation "picture"/logo links into normal html link | CC BY-SA 4.0 | null | 2010-09-25T10:26:12.070 | 2019-08-06T23:35:00.977 | 2020-06-20T09:12:55.060 | -1 | 457,827 | [
"css"
] |
3,793,510 | 1 | 3,794,077 | null | 5 | 875 | I have a few inequalities regarding `{x,y}`, that satisfies the following equations:
```
x>=0
y>=0
f(x,y)=x^2+y^2>=100
g(x,y)=x^2+y^2<=200
```
`x``y`
Graphically it can be represented as follows, the blue region is the region that satisfies the above inequalities:

The question now is, is there any function in Matlab that finds every admissible pair of `{x,y}`? If there is an algorithm to do this kind of thing I would be glad to hear about it as well.
Of course, one approach we can always use is brute force approach where we test every possible combination of `{x,y}` to see whether the inequalities are satisfied. But this is the last resort, because it's time consuming. I'm looking for a clever algorithm that does this, or in the best case, an existing library that I can use straight-away.
The `x^2+y^2>=100` `and x^2+y^2<=200` are just examples; in reality `f` and `g` can be any polynomial functions of any degree.
| Find the Discrete Pair of {x,y} that Satisfy Inequality Constriants | CC BY-SA 2.5 | 0 | 2010-09-25T10:56:28.913 | 2012-05-02T14:19:46.137 | 2012-05-02T14:19:46.137 | 97,160 | 3,834 | [
"c#",
"matlab",
"mathematical-optimization",
"linear-programming",
"nonlinear-optimization"
] |
3,793,583 | 1 | 3,794,391 | null | 2 | 389 | I'm creating a new ASP.net website via Visual Studio. I then try to run the default.aspx page it generates, and it throws this error:

I've tried deleting the affected lines as suggested by [MSDN](http://support.microsoft.com/kb/942055) but to no avail! I am on Windows 7, with ASP.net installed
Any ideas?
| IIS7, Default.aspx error message (screenshot) | CC BY-SA 2.5 | null | 2010-09-24T10:23:28.250 | 2010-09-25T15:32:00.280 | null | null | 356,635 | [
"windows-7",
"iis",
"server-error"
] |
3,793,683 | 1 | 3,793,741 | null | 4 | 1,326 | Here is an image:

When I load this image in different browsers, it shows differently.
Take a look at the result:

I spent a lot of time on this, but I can't understand why it happens.
I have only theories: something wrong with color profiles, or bad image structure, or something else - maybe special copyright measures?
Why is this happening?
| Same image displaying differently in different browsers | CC BY-SA 2.5 | 0 | 2010-09-25T11:57:57.567 | 2010-09-25T12:22:05.753 | 2017-02-08T14:30:25.257 | -1 | 1,289,690 | [
"image",
"browser",
"jpeg"
] |
3,793,799 | 1 | 3,793,886 | null | 31 | 45,135 | Is there a .NET API that generates [QR Codes](http://en.wikipedia.org/wiki/QR_Code) such as this one?

I'd like to display these on pages that I expect my users to print out.
| QR Code generation in ASP.NET MVC | CC BY-SA 2.5 | 0 | 2010-09-25T12:30:36.607 | 2020-09-23T06:42:47.480 | 2017-02-08T14:30:25.593 | -1 | 24,874 | [
".net",
"asp.net-mvc",
"computer-vision",
"barcode",
"qr-code"
] |
3,793,892 | 1 | 3,794,313 | null | 82 | 96,250 | This kind of stuff exists in Eclipse:

But I've not found it in Visual Studio yet. Is there such a window to show code outline at all?
I tried both Document Outline and Class View windows. The Class View is close, but it only shows class information, can it come up with function info also?
| How to show code outline in Visual Studio? | CC BY-SA 3.0 | 0 | 2010-09-25T12:56:18.290 | 2022-12-05T07:46:50.803 | 2012-10-20T06:12:04.400 | 681,785 | 417,798 | [
"visual-studio",
"outline-view"
] |
3,794,084 | 1 | 3,800,277 | null | 0 | 863 | I am using and module to put node in a tab.
When I put GMap location map in one of the node tabs (Tabs module) other than first one (default), the map view . It slides one width off the screen to the east (right). I need to press "scroll right" arrow once on the map controls to have the marker centred properly.
I have read all the Drupal threads touching this issue and all I found are suggestions to function.
Anyone knows where exactly to play with it? Where to apply the change to the code to accomplish the task in the least invasive way?
Attached screenshots:


| GMap map and Tabs display conflict in Drupal | CC BY-SA 2.5 | null | 2010-09-25T13:53:50.033 | 2013-09-09T11:14:03.540 | 2013-09-09T11:14:03.540 | 569,101 | 229,229 | [
"google-maps",
"drupal",
"tabs",
"conflict"
] |
3,794,368 | 1 | 3,795,640 | null | 1 | 2,972 | I am looking for a way to change my application name (that appears on right click on Windows 7 taskbar):

To something more informative like:

How do I do that?
I am using: Qt 4.7 (MinGW), Windows
I have found some info about using certificates and signing executables, but I am not sure if it is what I need. I know how to change icon. Thanks in advance.
| Change visible application name (Windows) | CC BY-SA 2.5 | 0 | 2010-09-25T15:23:15.337 | 2010-09-25T21:31:15.263 | null | null | null | [
"windows",
"qt4",
"mingw"
] |
3,794,418 | 1 | null | null | 0 | 4,770 | I am able to check out projects from SVN repository using eclipse as in the below screen shot.

But i am not able to do the same from command line..I am getting the error as : `'SVN' is not recognized as an internal or external command`
If SVN is not installed on my machine how come eclipse is able to checkout?
Do i need to install SVN client in my machine?
I tried searching on my machine but could not find which path(SVN installation) eclipse is referring to execute SVN commands
| How to use SVN commands from command line? | CC BY-SA 2.5 | 0 | 2010-09-25T15:37:33.927 | 2013-08-03T05:54:07.097 | 2010-09-25T15:42:48.927 | 305,684 | 305,684 | [
"eclipse",
"svn"
] |
3,794,406 | 1 | 3,796,352 | null | 1 | 4,302 | i'm pretty confused over the following issue and would be grateful for some clarity.
generally, how i work involves designing all of my graphics in Flash Authoring, converting them to Sprite symbols by changing the base class to flash.display.Sprite, give my instances names and finally export them to ActionScript.
the approach actually permits me to dynamically create properties in code on my Sprite instances that i've exported to ActionScript, just as if they were instances of MovieClips. i'm not entirely sure why i'm able to do this, but i can. in polling the objects to make sure of their superclass, they are indeed Sprites and not MovieClips.
however, as expected, if i program a new sprite from scratch in code and try to dynamically add a property to the new programmed sprite a compile time error will result.
```
package
{
import flash.display.Sprite;
import flash.utils.getQualifiedSuperclassName;
public class Document extends Sprite
{
public function Document()
{
trace(getQualifiedSuperclassName(blueOvalInstance));
//flash.display::Sprite (it's not a MovieClip)
trace(blueOvalInstance.hasOwnProperty("currentFrame"));
//false (ok, ok, it's definately not a MovieClip)
blueOvalInstance.myNewProperty = true;
//dynamically added boolean property on a Sprite instance
trace(blueOvalInstance.hasOwnProperty("myNewProperty"));
//true. fancy that! my Flash Authoring exported Sprite has a dynamically added property
codeSprite();
}
private function codeSprite():void
{
var myCodedSprite:Sprite = new Sprite();
myCodedSprite.graphics.beginFill(0xFF0000);
myCodedSprite.graphics.drawRect(0, 0, 100, 100);
myCodedSprite.graphics.endFill();
addChild(myCodedSprite);
myCodedSprite.anotherNewProperty = true;
//dynamically added boolean property on a Sprite instance, just like before!
//Compile Time Error!!!
//1119: Access of possibly undefined property anotherNewProperty through a reference with static type flash.display:Sprite.
}
}
}
```
so why is it that can i dynamically add properties to exported sprites in my document class if they are not MovieClips, while i can not if i create them myself in code?
the following image shows a new BlueOval symbol being exported to ActionScript from Flash Authoring with the base class of Sprite (not MovieClip). notice the new green (instead of blue) colored "Movie Clip" icon in the library panel.

| ActionScript - Dynamically Adding Property to Sprite | CC BY-SA 2.5 | null | 2010-09-25T15:35:03.323 | 2010-09-26T13:51:09.353 | null | null | 336,929 | [
"flash",
"actionscript-3",
"dynamic",
"properties",
"sprite"
] |
3,795,259 | 1 | 3,795,264 | null | 1 | 363 | I'm getting this classic error :
This is how it's implemented :
```
NSManagedObjectContext *context = [(AppDelegate *)[[UIApplication sharedApplication] delegate] managedObjectContext];
NSManagedObject *newShot = [NSEntityDescription insertNewObjectForEntityForName:@"shotName" inManagedObjectContext:context];
NSString *newName= @"test";
[newShot setName:newName];
```
And this is how it's designed :


No only I'm getting a crash with the message above, I'm also getting this warning :
Obviously something is wrong somewhere, I think I'm using Strings on both side though .
---
Edit, I'm now using this after Eimantas's comment :
```
NSManagedObjectContext *context = [(AppDelegate *)[[UIApplication sharedApplication] delegate] managedObjectContext];
NSManagedObject *newShot = [NSEntityDescription insertNewObjectForEntityForName:@"shotName" inManagedObjectContext:context];
NSString *newName= @"test";
[newShot setValue:newName forKey:@"shotNumber"];
[context saveAction];
```
But I`m still getting :
'NSManagedObjectContext' may not respond to '-saveAction'
| Classic CoreData error | CC BY-SA 2.5 | null | 2010-09-25T19:35:28.043 | 2010-09-28T13:31:20.920 | 2010-09-25T21:26:33.600 | 51,382 | 415,088 | [
"iphone",
"objective-c"
] |
3,795,513 | 1 | 3,795,563 | null | 11 | 4,147 | I have a folder full of ruby files, and when I try and require one file in another that is in the same directory using `require 'file'` I get a `LoadError` but when I use `require './file'` everything works fine. Can somebody explain to me why this happens and if there is any way I can require a file without adding a `./` onto the file?
(Picture of directory):

| Ruby require 'file' doesn't work but require './file' does. Why? | CC BY-SA 2.5 | 0 | 2010-09-25T20:46:40.470 | 2017-12-08T14:29:46.363 | 2011-11-09T02:35:43.133 | 38,765 | 427,494 | [
"ruby",
"require"
] |
3,795,649 | 1 | 3,795,665 | null | 7 | 13,623 | Apparently this is deprecated :
```
cell.textColor = [UIColor whiteColor];
```
Does anyone know what the best way to change the color of a Cell Text ?
---
Edit after comment :
I'm now using this :
```
cell.textLabel.textColor = [UIColor whiteColor];
```
but the color is still not changing, see the IB parameters :

| Setting Cell Text Color | CC BY-SA 2.5 | 0 | 2010-09-25T21:33:03.510 | 2010-09-25T21:59:26.973 | 2010-09-25T21:56:28.837 | 415,088 | 415,088 | [
"iphone",
"objective-c"
] |
3,795,827 | 1 | 3,997,773 | null | 1 | 736 | I have one project where the code-signing popup is all whacked-out.
On a "normal" (, every-other) project, the popup looks something like "Good menu" in this picture, but on one project, it looks like the "Not-good menu":

The "Not-good menu" is from the project about which I'm asking.
I tried quitting & relaunching XCode, but there's no change.
Any ideas what went wrong? Is there some sort of "un-whack my project" tool?
I suspect that the problem is related to the whack-project being not-worked-on for a long time and, hence, missed a "This project created by an older version of XCode" migration. Is there some sort of "update my project files" tool?
On a tip from another forum, I did this:
- - - - - - -
Well, there's good news & bad news.
Good news: It builds, and no code-signing errors. Yay.
Bad news: The popup still looks like the "not-good menu" in my screenshot.
More Bad News: the not-good menu is incomplete so, for example, I can select the client's ad-hoc, but not their app-store (we're sort of hoping to ship the product!)
| XCode code signing menu has gone wonky -- how to fix? | CC BY-SA 2.5 | 0 | 2010-09-25T22:25:23.637 | 2012-09-12T20:16:52.533 | 2010-10-05T14:36:26.717 | 34,820 | 34,820 | [
"iphone",
"xcode",
"codesign"
] |
3,795,988 | 1 | 3,796,467 | null | 0 | 83 | I would like to have a special listview with a title, couple of sub-categories, and a picture. The picture below is a rough idea of how I would like to lay it out. I am very new to android so keep in mind that details really helps me. Thank you in advance.

| How can I make a listview with more than a title? | CC BY-SA 2.5 | null | 2010-09-25T23:34:14.047 | 2010-09-26T03:15:03.630 | null | null | 413,926 | [
"android",
"listview"
] |
3,796,169 | 1 | null | null | 0 | 232 | Not sure what's going on but the Jquery.js is dying on me with "d is not null". This came out of no where. I can't seem to figure out how to fix it it.
Screenshot of firebug:


From this drupal link [link](http://drupal.org/node/317371) Michelle (3rd comment) claims this is Collapsible forum containers issue? (Which as far as I know I am not using?) but it doesn't seem to help?
Anybody have any suggestions?
Thanks!
| Drupal JQuery broken? | CC BY-SA 2.5 | null | 2010-09-26T00:52:35.670 | 2010-11-11T15:29:21.653 | 2010-09-26T01:11:13.363 | 220,819 | 442,895 | [
"javascript",
"jquery",
"drupal"
] |
3,796,583 | 1 | 3,796,825 | null | 2 | 3,114 |
I downloaded the sandbox of Symfony 1.4.8 and copied the files to my webserver. Unfortunately, when I try to access `/symfony/sf_sandbox/web/` (where I installed it), I get the following:

It seems like the images aren't showing. According to the text:
> If you see no image in this page, you may need to configure your web server so that it gains access to the `symfony_data/web/sf/` directory.
However, when I try to locate the folder referenced above, it does not exist:
As you can see, there is no `sf/` directory under `web/`. What am I doing wrong?
| Error getting images to show up in Symfony 1.4.8 | CC BY-SA 2.5 | null | 2010-09-26T04:19:58.917 | 2014-09-29T18:36:14.933 | null | null | 193,619 | [
"image",
"symfony1",
"directory"
] |
3,796,793 | 1 | 3,828,456 | null | 13 | 952 | Searching Stackoverflow on Google I get this result:

Inspecting the HTML source of the Stack Overflow frontpage I can't find any reference of
stuff.
I thought it was something related to [meta description](http://www.w3schools.com/html/html_meta.asp), but it is not true.
Also, where are the , , etc. declared? [Sitemap.xml](http://it.wikipedia.org/wiki/Sitemap)?
In few words, could I obtain the same result simply editing my web site content, or is it something configured on some Google webmaster panel?
| How to programmatically provide site structure and url path to Google search | CC BY-SA 3.0 | 0 | 2010-09-26T06:16:36.030 | 2012-11-08T18:35:48.843 | 2012-11-08T18:35:48.843 | 866,022 | 130,929 | [
"html",
"seo"
] |
3,796,831 | 1 | 3,796,851 | null | 3 | 2,894 | Ok, so in my rails project. I'm getting this error, any help?
```
class SearchController < ApplicationController
require 'rubygems'
require 'open-uri'
def index
@show_info
end
def do_search
@show = params{:search_term}
@show = @show["search_term"]
@url = "http://services.tvrage.com/tools/quickinfo.php?show=#{@show}"
@sitehtml = open(@url)
lines = @sitehtml.split("\n")
@show_info = []
lines.each do |line|
line_split = line.split("@")
@show_info << line_split[1]
end
end
end
```
and I keep on getting this error, 
(Full Size: [http://grab.by/6z6u](http://grab.by/6z6u) )
Any help? I don't really understand it.
| "private method `split' called for" | CC BY-SA 2.5 | null | 2010-09-26T06:34:18.733 | 2010-09-26T06:54:29.963 | null | null | 407,702 | [
"ruby-on-rails",
"ruby"
] |
3,797,013 | 1 | null | null | 0 | 2,204 | 
From the above we can see is `0`(there is no reloc item), but shows that the reloc item actually exists.
The definition of DOS EXE Header is [here](http://www.frontiernet.net/~fys/exehdr.htm).
How to understand it?
| About the relocation table in DOS EXE header | CC BY-SA 2.5 | 0 | 2010-09-26T07:56:43.470 | 2021-01-21T05:32:15.213 | null | null | 431,665 | [
"dos",
"exe",
"portable-executable"
] |
3,797,241 | 1 | 3,797,255 | null | 8 | 30,086 | I thought ADT should come with a visual editor for building GUI : [Easy way to build Android UI?](https://stackoverflow.com/questions/851882/easy-way-to-build-android-ui)
However, I just cannot find it. I was wondering where is the Visual Editor for Eclipse with the ADT plugin.
I can run HelloWorld application without problem. However, whenever I click on `main.xml` at the left navigation tree layout folder, here is what I get. What I wish to get is a WYSIWYG editor.

| Where is the Visual Editor for Eclipse with the ADT plugin | CC BY-SA 2.5 | 0 | 2010-09-26T09:39:35.060 | 2014-07-24T03:23:42.457 | 2017-05-23T11:48:22.880 | -1 | 72,437 | [
"android"
] |
3,797,277 | 1 | 3,797,292 | null | 0 | 2,604 | I wanted to have two buttons on the both end of Navigation Bar (in iPad's Detail View Controller).
So I created two UIToolbars and I set the them as Left&RightBarButtonItems.
But, There is some color variation in the NavigationBar.
Attached images for your understanding.

 
the code I used ,
```
UIToolbar *leftToolbar =[[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 200, 45)];
NSMutableArray *lItems = [[NSMutableArray alloc] initWithArray:[leftToolbar items]];
UIBarButtonItem *lb1 =[[UIBarButtonItem alloc]initWithTitle:@"Home"style:UIBarButtonItemStyleBordered target:self action:@selector(home:) ];
UIBarButtonItem *lb2 =[[UIBarButtonItem alloc]initWithTitle:@"New Document"style:UIBarButtonItemStyleBordered target:self action:@selector(newDoc:) ];
[lItems insertObject:lb1 atIndex:0];
[lItems insertObject:lb2 atIndex:1];
[leftToolbar setItems:lItems animated:YES];
[lItems release];
leftToolbar.barStyle =UIBarStyleBlackTranslucent;
leftToolbar.tintColor=[UIColor clearColor];
self.navigationItem.leftBarButtonItem=[[UIBarButtonItem alloc] initWithCustomView:leftToolbar];
```
Can you help me to avoid this color variation?
Is there any other way to have buttons like this, without using UIToolbar?
Thanks ,
Gopi.
| UIToolbar in iPad | CC BY-SA 2.5 | null | 2010-09-26T09:50:51.477 | 2010-11-26T18:12:56.237 | 2010-09-26T10:09:54.583 | 21,234 | 248,880 | [
"ipad"
] |
3,797,310 | 1 | null | null | 1 | 698 | 
Anyone knows?
It seems to me most space of `PE` is taken up by `Unmapped Data` , is this the case in most occasions?
| What are in the "Unmapped Data" part of PE? | CC BY-SA 2.5 | null | 2010-09-26T09:59:35.203 | 2011-10-06T22:38:41.943 | 2020-06-20T09:12:55.060 | -1 | 339,038 | [
"portable-executable"
] |
3,797,571 | 1 | 3,800,976 | null | 1 | 390 | Just to test, I ran this code
```
#include<unistd.h>
#include<stdio.h>
#include<stdlib.h>
int main() {
int **ar = (int**) malloc(100000000* sizeof(int*));
int i;
for(i = 0; i<10000000; i++) {
ar[i] = (int*) malloc(1000 * 4);
ar[i][123] = 456;
}
usleep(3000000); usleep(3000000);
usleep(3000000); usleep(3000000);
usleep(3000000); usleep(3000000);
return 0;
}
```
The memory usage graph went like this (the bottom pink colored graph tracks memory).

Though this program did not run out of memory, any more memory requirements would lead to the `malloc` failing and then a segmentation fault due to the `ar[i][123] = 456;` line.
I want to put a limit on the memory allocation through my program, but also do not want to bind my program statically.
> For example,
So, if my program is run on a machine with 8GB of memory, it can use a max of 4GB, but in case the program runs on a machine with 256MB, only 128MB should be available to the program.
Also, I want to do this from within my program, rather than controlling the amount of memory available using some external utility.
| How to limit the amount of memory accessible to my C code? | CC BY-SA 2.5 | 0 | 2010-09-26T11:27:55.927 | 2012-02-08T22:23:39.140 | 2010-09-26T17:24:34.540 | 113,124 | 113,124 | [
"c",
"memory",
"memory-management"
] |
3,797,604 | 1 | 3,845,633 | null | 3 | 14,007 | 
Attached is a plot of accelerometer data with 3 axis. The sudden bumps in the plot are the noise. I would like to get rid of them. So what filter should be used in this case ? If it is possible provide some pseudo code for it and explanation.
| How to filter accelerometer data from noise | CC BY-SA 3.0 | 0 | 2010-09-26T11:36:49.257 | 2022-08-18T16:14:58.323 | 2017-10-27T20:58:43.743 | 4,523,099 | 426,305 | [
"filtering",
"accelerometer"
] |
3,797,713 | 1 | 3,797,738 | null | 10 | 2,437 | I observed a relative strange behavior when I use floating images in a document. The list items indentation is made relatively to the 'red line' instead of the 'green' one.
Why is this happening and can I solve this?
```
<img style="float: left">
<p>some text</p>
<ul>
<li>aaa</li
<li>bbb</li
</ul>
<p>some other text</p>
```

| How to indent list items using CSS when you have floating blocks? | CC BY-SA 2.5 | 0 | 2010-09-26T12:10:11.143 | 2020-08-27T15:02:44.497 | 2010-09-26T22:25:53.513 | 99,834 | 99,834 | [
"css",
"html-lists"
] |
3,797,932 | 1 | 3,797,937 | null | 2 | 5,395 | I am trying to follow: [http://dev.mysql.com/doc/refman/4.1/en/fulltext-natural-language.html](http://dev.mysql.com/doc/refman/4.1/en/fulltext-natural-language.html)
in an attempt to improve search queries, both in speed and the ability to order by score.
However when using this SQL ("skitt" is used as a search term just so I can try match Skittles).
```
SELECT
id,name,description,price,image,
MATCH (name,description)
AGAINST ('skitt')
AS score
FROM
products
WHERE
MATCH (name,description)
AGAINST ('skitt')
```
I am trying to find out why, I think I might have set my index's up wrong I'm not sure, this is the first time I've strayed away from LIKE!
Here is my table structure and data:

Thank you!
| mysql fulltext MATCH,AGAINST returning 0 results | CC BY-SA 2.5 | null | 2010-09-26T13:15:34.963 | 2014-01-20T22:25:22.990 | 2010-09-26T13:21:53.483 | 241,465 | 241,465 | [
"mysql",
"full-text-search"
] |
3,798,139 | 1 | 3,798,164 | null | 0 | 330 | I need a script in Jquery for select a sub-menu in another special javascript menu.Every sub-menu there are new content,and for this that I would like make an automatic switcher. Naturally in that page (Of the menu) there are some scripts embed:
functions.js -> [link text](http://pastebin.com/sVpMAFSj)
util.js -> [link text](http://pastebin.com/XCwtwfF7)
JSONREQUEST.js -> [link text](http://pastebin.com/tU4AFNi1)
category.js -> [link text](http://pastebin.com/0W6wRjNW)
I think that solution is in category.js, because there's a function named updatepage()
P.S: I can use also the 'function' of browser, javascript: "SCRIPT FOR SWITCH";
Images below:

---

| Change location in a javascript menu | CC BY-SA 3.0 | null | 2010-09-26T14:05:37.183 | 2011-05-09T11:07:16.563 | 2011-05-09T11:07:16.563 | 560,648 | 441,720 | [
"javascript",
"jquery",
"switch-statement",
"categories"
] |
3,798,185 | 1 | 3,798,198 | null | 0 | 1,435 | I wounder how its possible to make a shape like the example, with round corners and padding from the screen borders, and also put text inside, how is this possible?

| Design in Android, Shapes | CC BY-SA 2.5 | 0 | 2010-09-26T14:18:56.917 | 2010-09-26T14:23:51.930 | null | null | 371,301 | [
"android",
"xml",
"shapes"
] |
3,798,202 | 1 | null | null | 0 | 1,538 | I am building a web application for an affiliate program and on the `users` table I have this structure:

Based on this MySql table I want every user to be able to see his tree, so I need this query:
1. The user to see who recruited him and who was recruited by him and I don't want the query to show other users that are recruited by the same recruited that recruited this user. Basicly it should look this way:

| MySql PHP tree view | CC BY-SA 2.5 | null | 2010-09-26T14:24:38.153 | 2010-09-26T17:58:45.113 | 2010-09-26T15:40:51.547 | 75,801 | 98,074 | [
"php",
"mysql",
"treeview"
] |
3,798,184 | 1 | 3,799,199 | null | 2 | 490 | ```
this->setWindowTitle(tr("数据转移程序"));
edt_ftp_server = new QLineEdit;
edt_ftp_port = new QLineEdit;
edt_ftp_account = new QLineEdit;
edt_ftp_pwd = new QLineEdit;
edt_ftp_pwd->setEchoMode( QLineEdit::Password );
lbl_ftp_server = new QLabel;
lbl_ftp_server->setText(tr("FTP服务器地址:"));
lbl_ftp_server->setBuddy( edt_ftp_server );
lbl_ftp_port = new QLabel;
lbl_ftp_port->setText(tr("FTP服务器端口:"));
lbl_ftp_port->setBuddy( edt_ftp_port );
lbl_ftp_account = new QLabel;
lbl_ftp_account->setText(tr("FTP登录帐号:"));
lbl_ftp_account->setBuddy( edt_ftp_account );
lbl_ftp_pwd = new QLabel;
lbl_ftp_pwd->setText(tr("FTP登录密码:"));
lbl_ftp_pwd->setBuddy( edt_ftp_pwd );
ftp_settings = new QGroupBox(this);
ftp_settings->setTitle(tr("FTP服务器设置"));
ftp_settingsLayout = new QGridLayout;
ftp_settingsLayout->addWidget( lbl_ftp_server, 0, 0);
ftp_settingsLayout->addWidget( edt_ftp_server, 0, 1);
ftp_settingsLayout->addWidget( lbl_ftp_port, 1, 0);
ftp_settingsLayout->addWidget( edt_ftp_port, 1, 1);
ftp_settingsLayout->addWidget( lbl_ftp_account, 2, 0);
ftp_settingsLayout->addWidget( edt_ftp_account, 2, 1);
ftp_settingsLayout->addWidget( lbl_ftp_pwd, 3, 0);
ftp_settingsLayout->addWidget( edt_ftp_pwd, 3, 1);
ftp_settings->setLayout( ftp_settingsLayout );
edt_db_server = new QLineEdit( this );
edt_db_port = new QLineEdit( this );
edt_db_account = new QLineEdit( this );
edt_db_pwd = new QLineEdit( this );
edt_db_pwd->setEchoMode( QLineEdit::Password );
lbl_db_server = new QLabel( this );
lbl_db_server->setText(tr("FTP服务器地址:"));
lbl_db_server->setBuddy( edt_ftp_server );
lbl_db_port = new QLabel( this );
lbl_db_port->setText(tr("FTP服务器端口:"));
lbl_db_port->setBuddy( edt_ftp_port );
lbl_db_account = new QLabel( this );
lbl_db_account->setText(tr("FTP登录帐号:"));
lbl_db_account->setBuddy( edt_ftp_account );
lbl_db_pwd = new QLabel( this );
lbl_db_pwd->setText(tr("FTP登录密码"));
lbl_db_pwd->setBuddy( edt_ftp_pwd );
db_settings = new QGroupBox(this);
db_settings->setTitle(tr("数据库服务器设置"));
db_settingsLayout = new QGridLayout;
db_settingsLayout->addWidget( lbl_ftp_server, 0, 0);
db_settingsLayout->addWidget( edt_ftp_server, 0, 1);
db_settingsLayout->addWidget( lbl_ftp_port,1, 0);
db_settingsLayout->addWidget( edt_ftp_port,1, 1);
db_settingsLayout->addWidget( lbl_ftp_account, 2, 0);
db_settingsLayout->addWidget( edt_ftp_account, 2, 1);
db_settingsLayout->addWidget( lbl_ftp_pwd,3, 0);
db_settingsLayout->addWidget( edt_ftp_pwd, 3, 1);
db_settings->setLayout( db_settingsLayout );
buttonsLayout = new QHBoxLayout;
buttonsLayout->addStretch();
btn_start = new QPushButton;
btn_start->setText(tr("开始"));
buttonsLayout->addWidget(btn_start);
btn_stop = new QPushButton;
btn_stop->setText(tr("停止"));
buttonsLayout->addWidget( btn_stop );
btn_exit = new QPushButton;
btn_exit->setText(tr("退出"));
buttonsLayout->addWidget(btn_exit);
settingLayout = new QVBoxLayout;
settingLayout->addWidget( db_settings );
settingLayout->addStretch();
settingLayout->addWidget( ftp_settings );
centralLayout = new QHBoxLayout;
centralLayout->addLayout( settingLayout );
lst_log = new QListWidget;
centralLayout->addWidget(lst_log);
winLayout = new QVBoxLayout;
winLayout->addLayout( centralLayout );
winLayout->addLayout( buttonsLayout );
setLayout( winLayout );
```
I am developing a tiny qt program, and have writen above code in a QMainWindow subclass Constructor.
But the widgets displayed are messed up.All advices are appreciated!
The following is the result screenshot:

| Why the layout managers in QT doesn't work? | CC BY-SA 2.5 | null | 2010-09-26T14:18:50.840 | 2010-09-26T18:21:56.937 | 2010-09-26T14:20:52.477 | 428,014 | 428,014 | [
"c++",
"qt",
"layout-manager"
] |
3,798,503 | 1 | 3,798,559 | null | 0 | 419 | I have a UIView in which I flip between a UITableView and a MKMapView. The MKMapView is created at runtime and animated in the following function:
```
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5];
[UIView setAnimationTransition:(self.mapView == nil ? UIViewAnimationTransitionFlipFromRight : UIViewAnimationTransitionFlipFromLeft)
forView:self.topView cache:YES];
// create new map view if necc.
if (self.mapView == nil)
{
self.mapView = [[VTMapView alloc] initWithFrame:self.topView.bounds];
mapView.mapType = MKMapTypeStandard;
mapView.delegate = self;
mapView.scrollEnabled = YES;
mapView.zoomEnabled = YES;
mapView.showsUserLocation = YES;
}
// map visible? show or hide it
if (![self isMapVisible])
{
tableView.hidden = YES;
[self.topView insertSubview:mapView aboveSubview:self.tableView];
mapLoadCount = 0;
} else {
tableView.hidden = NO;
[mapView removeFromSuperview];
}
[UIView commitAnimations];
```
The first time it works fine, but in future runs there are horizontal bars on the top and bottom of the map view during the animation. It looks something like this:

I've tried playing with the cache setting, removing other views, etc. It doesn't happen in the simulator but it happens on OS 4.1.x and 3.1.x.
If I don't hide the `tableView`, I see bits of the table instead of the grey bars, so I think the mapview is being resized incorrectly during the flip.
| Mysterious borders during MKMapView animation | CC BY-SA 2.5 | null | 2010-09-26T15:40:02.933 | 2010-10-04T00:26:43.473 | null | null | 104,181 | [
"iphone",
"core-animation",
"mapkit"
] |
3,799,136 | 1 | 3,799,456 | null | 1 | 2,887 | I have an issue with list-style-image property in CSS with Internet Explorer 8
If I set
```
li {
float:left;
list-style-image: none;
}
```
each menu item is above each other. If I remove list-style-image:none, they are perfectly positioned instead, but they have the dot image. (see images)


| CSS in Internet Explorer: list-style-image and float:left issue | CC BY-SA 2.5 | null | 2010-09-26T18:06:09.357 | 2010-09-26T19:41:24.093 | 2010-09-26T18:11:27.913 | 257,022 | 257,022 | [
"css",
"internet-explorer"
] |
3,799,198 | 1 | null | null | 0 | 348 | I try to use the Addin from VisualNDepend in Visual Studio 2010, but when I open Visual Studio 2010 I always get the following error message.
```
************** Exception Text **************
Exception on Addin.Connect.OnConnection()
Exception in NDepend v3.0.3.4916
.NET Fx Version: 4.0.30319.1
OS Windows Version: 6.1.7600.0
Processor Architecture: x64
Execution Environment: Hosted in VisualStudio v10.0
Error Hash: 3.0.3.4916 PRO 2A215D8F System.InvalidCastException
LicenseId:
Exception.Type {System.InvalidCastException}
Exception.Message {Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.VisualStudio.CommandBars.CommandBarControl'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{43FD5911-7BAC-4BDC-AB6C-2DE65B5C0233}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).}
Exception.StackTrace {
ff.a()
abz..ctor(DTE2 A_0, aon A_1, ajx A_2)
zo..ctor(AddIn A_0, DTE2 A_1, aon A_2)
NDepend.AddIn.VisualStudio.V3.Connect.a(AddIn A_0, DTE2 A_1)
NDepend.AddIn.VisualStudio.V3.Connect.a(Object A_0, ext_ConnectMode A_1, Object A_2, Array& A_3)
NDepend.AddIn.VisualStudio.V3.Connect.b(Object A_0, ext_ConnectMode A_1, Object A_2, Array& A_3)}
Exception.InnerException = null
```
I already stayed in contact with the Support of VisualNDepend, but they couldn't helped me either. Does anybody of you has an idea why this could fail?

| VisualNDepend Visual Studio 2010 Addin failed | CC BY-SA 2.5 | null | 2010-09-26T18:21:42.517 | 2010-09-27T08:25:57.133 | null | null | 338,645 | [
"visual-studio-2010",
"visual-studio-addins"
] |
3,799,212 | 1 | 3,799,255 | null | 2 | 4,821 | This is MySQL Query:
```
SELECT `TABLE_SCHEMA` , `TABLE_NAME` , `COLUMN_NAME`
FROM `COLUMNS` WHERE `TABLE_SCHEMA` = 'zfk'
```
How can I make multi dimensional arrays:
Level 1 TABLE_SCHEMA `where`
Level 2 TABLE_NAME
Level 3 COLUMN_NAME
MySQL Output:

| Multi-Dimensional array from MySQL Result | CC BY-SA 2.5 | null | 2010-09-26T18:25:35.637 | 2012-06-06T08:54:15.767 | null | null | 107,129 | [
"php",
"mysql"
] |
3,799,238 | 1 | 3,799,269 | null | 20 | 3,635 | I've seen a slide that presented [Fab](http://github.com/jed/fab), a node.js framework.

Is this JavaScript?
Could someone explain what is going on in that code?
I'm all lost.
| Javascript FAB framework on Node.js | CC BY-SA 2.5 | 0 | 2010-09-26T18:32:58.347 | 2011-03-29T13:06:52.027 | 2011-03-29T13:06:52.027 | 463,304 | 224,922 | [
"javascript",
"node.js",
"chaining",
"floating-action-button"
] |
3,799,289 | 1 | 3,799,306 | null | 1 | 188 | In the image below, in my markup, the title of the page is "Welcome to My sample Web Site" (not all caps). However, in the split screen, the title is shown in all caps.
The code in CSS is:
```
h1, h2, h3, h4, h5, h6
{
font-size: 1.5em;
color: #666666;
font-variant: small-caps;
text-transform: none;
font-weight: 200;
margin-bottom: 0px;
}
h1
{
font-size: 1.6em;
padding-bottom: 0px;
margin-bottom: 0px;
}
.header h1
{
font-weight: 700;
margin: 0px;
padding: 0px 0px 0px 20px;
color:white;
border: none;
line-height: 2em;
font-size: 2em;
}
```
I want to display the title as I coded in the markup (not all caps).

| Question about VS 2010 web application template (html markup) | CC BY-SA 2.5 | null | 2010-09-26T18:47:39.733 | 2010-09-26T19:13:41.027 | null | null | 279,521 | [
"css",
"visual-studio-2010"
] |
3,799,540 | 1 | 4,527,008 | null | 1 | 6,630 | What is [this](https://i.stack.imgur.com/bcWDB.jpg) Error For?
I repaired my Vs but this did not solve it.

My OS : Windows 7 64 bit home edition.
Visual studio 2010 Ultimate.
Does My question need more information?
| Failed to Create AppDomain | CC BY-SA 2.5 | null | 2010-09-26T19:56:24.030 | 2013-04-29T19:56:57.127 | 2010-09-27T16:00:51.497 | 369,161 | 369,161 | [
"asp.net",
"visual-studio",
"visual-studio-2010"
] |
3,799,803 | 1 | 3,799,943 | null | 3 | 2,206 | When you make a window in glut using glutCreateWindow it puts a top to the window? What if I want to do some OpenGL rendering without a window top?
This probably doesn't make much sense without a picture:

Essentially I want to remove this from the window.
| Is it possible to make a window withouth a top in GLUT? | CC BY-SA 2.5 | null | 2010-09-26T20:59:44.077 | 2015-01-11T03:07:01.230 | null | null | null | [
"opengl",
"glut"
] |
3,799,839 | 1 | null | null | 2 | 588 | > Upon noticing that there were
unexpected artefacts in other OpenGL
programs, I did some digging and
discovered that you can upgrade the
OpenGL stack on Ubuntu:
[https://launchpad.net/~xorg-edgers/+archive/ppa](https://launchpad.net/~xorg-edgers/+archive/ppa)After updating, all GL rendering was
faster (my test programs below
in speed!) and without artefacts.So to answer my own question: how can
glFlush() affect rendering
correctness?
=== ===
or, more correctly, what is the fundamental bug with my classic untrendy non-shader-VBO-stuff?
```
cdef struct xyz:
float x, y, z
cdef inline void _normal(xyz b,xyz a):
glNormal3f(a.x-b.x,a.y-b.y,a.z-b.z)
cdef inline void _draw_quad(xyz a,xyz b,xyz c,xyz d):
glVertex3f(a.x,a.y,a.z)
glVertex3f(b.x,b.y,b.z)
glVertex3f(c.x,c.y,c.z)
glVertex3f(d.x,d.y,d.z)
cdef void _draw_grid(xyz a,xyz b,xyz c,xyz d):
glBegin(GL_LINE_LOOP)
_draw_quad(a,b,c,d)
glEnd()
.... # main loop goes through my data array issuing the appropriate functions
while self._buf.remaining() > 0:
op = self._buf.read_char()
if op == _COLOR:
col = self._buf.read_rgb()
#print col
glColor3f(col.r,col.g,col.b)
elif op in (_BOX,_GRID):
tl,tr,br,bl,trb,brb,tlb,blb = self._buf.read_xyz(),self._buf.read_xyz(),\
self._buf.read_xyz(),self._buf.read_xyz(),\
self._buf.read_xyz(),self._buf.read_xyz(),\
self._buf.read_xyz(),self._buf.read_xyz()
if op == _BOX:
#print "box",col
glBegin(GL_QUADS)
func = _draw_quad
else:
#print "grid",col
func = _draw_grid
_normal(tlb,tl)
func(tl,tr,br,bl)
_normal(tl,tr)
func(tr,trb,brb,br)
_normal(tr,tl)
func(tl,tlb,blb,bl)
_normal(tr,tl)
func(tl,tlb,trb,tr)
_normal(tl,tr)
func(bl,blb,brb,br)
_normal(tl,tlb)
func(tlb,trb,brb,blb)
if op == _BOX:
glEnd()
#glFlush()
else:
raise Exception("corrupt serialisation; got %x"%op)
```
if flush after each cube or wireframe, I get this rendering:

if I omit the flush - and I obviously don't want to be flushing, even if I am not treading the most optimal opengl path - then I get this rendering, and this is the bug I don't understand:

For the curious, here is how `glutSolidCube` and wires do it: [http://www.google.com/codesearch/p?hl=en#xbii4fg5bFw/trunk/FDS/trunk/SMV_5/source/glut-3.7.6/glut_shapes.c&q=glutSolidCube%20lang:c&sa=N&cd=4&ct=rc](http://www.google.com/codesearch/p?hl=en#xbii4fg5bFw/trunk/FDS/trunk/SMV_5/source/glut-3.7.6/glut_shapes.c&q=glutSolidCube%20lang:c&sa=N&cd=4&ct=rc)
| how can glFlush() affect rendering correctness? | CC BY-SA 2.5 | null | 2010-09-26T21:09:32.417 | 2013-08-30T08:09:40.850 | 2010-11-08T20:46:34.123 | 15,721 | 15,721 | [
"opengl",
"cython"
] |
3,800,026 | 1 | null | null | 3 | 8,408 | I would like to create a CSS/HTML version of this notepad on my page:

I was thinking of using a simple table like this:
```
<div id="notepad">
<table>
<thead id="tbl_header">Comments</thead>
<tr></tr>
<tr>
<td class="col1">Dot</td>
<td class="col2">Text for column 2</td>
</tr>
<tr>
<td class="col1"></td>
<td class="col2"></td>
</tr>
<tr>
<td class="col1"></td>
<td class="col2"></td>
</tr>
<tr>
<td class="col1"></td>
<td class="col2"></td>
</tr>
<tr>
<td class="col1"></td>
<td class="col2"></td>
<td class="col3"></td>
</tr>
</table>
</div>
```
So what I was thinking was cutting up the graphic. Have the top part, be the bg img for the `<thead>`.
Then just create one of the lines as the rows (there would be two graphics, one for col1 and col2 - so when a new row is created the bg of both columns would be populated), so that it can scale vertically as needed. Then, for the last set, I have two more graphics. One is for col1. One for col2 (which is the regular row but a little narrower in width) and the curl would be col3.
Is there a scalable way I can do this, using CSS & HTML only (no JS or jQuery) ?
Thanks.
P.S. Or is there another way to create this same thing without having to use bg images - and just using CSS?
| How do I style a table like a notepad? | CC BY-SA 2.5 | 0 | 2010-09-26T22:08:38.727 | 2011-06-08T18:25:11.387 | 2010-09-26T22:11:26.087 | 139,010 | 91,970 | [
"html",
"css"
] |
3,800,069 | 1 | null | null | 1 | 1,227 | Is it possible to create a layout based on (background) images? For example, there is well know app called Appie that uses this picture as a homescreen:

I might be able to recreate the layout with a `TableLayout`, but this will be difficult to get it perfectly aligned with the buttons in the image. The default layout options make it very difficult, or maybe impossible, to allow for selection of the buttons on the image (especially when the buttons are in an arc-path).
Can anyone tell me how this is done?
| creating a custom image based layout on android | CC BY-SA 2.5 | null | 2010-09-26T22:20:36.800 | 2010-09-26T23:52:19.720 | 2010-09-26T23:45:37.253 | 119,895 | 458,987 | [
"android",
"image",
"layout"
] |
3,800,419 | 1 | 3,800,445 | null | 3 | 782 | I'm studying MDI Form in windows form and I'm playing with this simple application:

Each `ToolStripMeniItem` calls a single instance of a particular form, but as you can see (please see my code) my code is repetitive for each ToolStripMeniItem, how can I shorten this?
```
public static Form IsFormAlreadyOpen(Type FormType)
{
foreach (Form OpenForm in Application.OpenForms)
{
if (OpenForm.GetType() == FormType)
return OpenForm;
}
return null;
}
private void form1ToolStripMenuItem_Click(object sender, EventArgs e)
{
Form1 f1 = null;
if (IsFormAlreadyOpen(typeof(Form1)) == null)
{
f1 = new Form1();
f1.MdiParent = this;
f1.Show();
}
else
{
Form selectedForm = IsFormAlreadyOpen(typeof(Form1));
foreach (Form OpenForm in this.MdiChildren)
{
if (OpenForm == selectedForm)
{
if (selectedForm.WindowState == FormWindowState.Minimized)
{
selectedForm.WindowState = FormWindowState.Normal;
}
selectedForm.Select();
}
}
}
}
private void form2ToolStripMenuItem_Click(object sender, EventArgs e)
{
Form2 f2 = null;
if (IsFormAlreadyOpen(typeof(Form2)) == null)
{
f2 = new Form2();
f2.MdiParent = this;
f2.Show();
}
else
{
Form selectedForm = IsFormAlreadyOpen(typeof(Form2));
foreach (Form OpenForm in this.MdiChildren)
{
if (OpenForm == selectedForm)
{
if (selectedForm.WindowState == FormWindowState.Minimized)
{
selectedForm.WindowState = FormWindowState.Normal;
}
selectedForm.Select();
}
}
}
// and so on... for the other ToolStripMeniItem
}
```
| Is there a way to shorten this code? C# winforms | CC BY-SA 2.5 | 0 | 2010-09-27T00:21:45.650 | 2010-09-27T01:25:05.977 | null | null | 396,335 | [
"c#"
] |
3,800,704 | 1 | 4,585,943 | null | 0 | 508 | When using the Darkfish RDoc generator to generate RDoc documentation, next to methods there is a `Click to toggle source` button next to each method. It isn't working for me when I generate my documentation, so how do you get that feature to work, do you have to add a keyword into your RDoc source or something?

| How do I enable "Click to toggle source" button in Ruby RDoc? | CC BY-SA 2.5 | 0 | 2010-09-27T02:13:40.637 | 2011-09-05T21:21:27.837 | 2010-11-28T06:27:16.567 | 128,421 | 427,494 | [
"ruby",
"rubygems",
"rdoc"
] |
3,800,723 | 1 | 3,800,728 | null | 0 | 764 | Hi i using this mysql code to generate this data below:
code:
```
SELECT L.LEAVETYPE, LA.IDLEAVETYPE, LA.IDLEAVETABLE, SUM( LA.NOOFDAYS )
FROM LEAVETYPE AS L
LEFT JOIN LEAVEAPPLICATION AS LA ON LA.IDLEAVETYPE = L.IDLEAVETYPETABLE
GROUP BY L.LEAVETYPE
```

When i add the Where condition it will only show the LeaveType with value. How can i show all the leavetype including the null (Like in the first picture)?
```
SELECT L.LEAVETYPE, LA.IDLEAVETYPE, LA.IDLEAVETABLE, SUM(LA.NOOFDAYS)
FROM LEAVETYPE AS L
LEFT JOIN LEAVEAPPLICATION AS LA ON LA.IDLEAVETYPE = L.IDLEAVETYPETABLE
WHERE LA.IDSTAFFTABLE='24'
GROUP BY L.LEAVETYPE
```

| mysql left join and sum group by | CC BY-SA 2.5 | null | 2010-09-27T02:20:17.707 | 2010-09-27T02:48:15.330 | 2010-09-27T02:48:15.330 | 135,152 | 417,899 | [
"sql",
"mysql",
"join"
] |
3,800,927 | 1 | 3,800,967 | null | 0 | 1,309 | I'm having a strange issue with some @font-face text where there is some strange padding (or at least vertical space) included with the text. It is causing problems because I want to text to be positioned a certain way but can't have it overlapping other things. Here is a picture of what is occurring:

As you can see when the text is selected, the text overlaps some of the navigation bar above it. I have tried adjusting the line height and padding, margins, anything I can think of. Here is the relevant CSS, does anybody have a suggestion as to how I can get the height of the line to be around the height of the actual text.
```
*{ margin: 0; padding: 0; }
h1#logo { font: 350px/.95 'Bebas Neue'; color: #DDD; text-align: center; margin: 1px 0; }
```
: Here is a live example of the problem: [http://codezroz.com/stuff/hello.html](http://codezroz.com/stuff/hello.html)
| Strange vertical space on text | CC BY-SA 2.5 | null | 2010-09-27T03:28:23.507 | 2010-09-27T05:19:09.787 | 2010-09-27T03:36:16.843 | 361,920 | 361,920 | [
"margin",
"font-face",
"css"
] |
3,800,951 | 1 | null | null | 4 | 3,041 | I am using a custom Dialog that contains a text field, an image, and a button. The text can contain HTML. Sometimes the bottom of the dialog gets chopped off the bottom when the text is long enough. How can I prevent this? I want Android to determine the size of the dialog but it doesn't seem to be doing that. DO I need to size the Dialog myself in this case?
Here is the layout...
```
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/alert_root_incorrect"
style="@style/AlertDialogTheme"
android:background="@drawable/rounded_alert"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="10dp"
>
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/rounded_alert"
>
<TableLayout
android:stretchColumns="0"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<TableRow>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:textStyle="bold"
android:text="Sorry, that's wrong!"
android:textColor="@color/gray_dark" />
<ImageView
android:id="@+id/check"
android:background="@drawable/xmark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginRight="10dp" />
</TableRow>
</TableLayout>
<TextView
android:id="@+id/alert_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:ellipsize="none"
android:text="In fact, this is where the explanation will go. Something about how this passage related to the topic"
android:textColor="#000000" />
<Button
android:id="@+id/okay_button"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_gravity="center_horizontal"
android:background="@drawable/rounded_alert_button"
android:text="Okay"
android:textColor="@color/white"
android:textSize="20sp" />
</LinearLayout>
</LinearLayout>
```
And here is the code I am using to load it...
```
if ( null == layout ) {
this.layout = inflater.inflate(R.layout.alert_incorrect, (ViewGroup) findViewById(R.id.alert_root_incorrect));
}
TextView message = (TextView) layout.findViewById(R.id.alert_text);
message.setText(Html.fromHtml(card.getConclusion()));
((Button) layout.findViewById(R.id.okay_button)).setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
dismissDialog(INCORRECT_DIALOG);
nextQuestion();
}
});
layout.requestLayout();
dialog = new Dialog(this, R.style.AlertDialogTheme);
dialog.setContentView(layout);
dialog.setCancelable(false);
return dialog;
```
And here's a snap of what I mean..

Thanks,
John
| Android not sizing Custom Dialog big enough | CC BY-SA 2.5 | null | 2010-09-27T03:33:42.417 | 2012-10-12T16:26:58.860 | null | null | 4,476 | [
"android",
"dialog"
] |
3,800,972 | 1 | 3,801,047 | null | 4 | 4,201 | ```
Facebook.prototype.post = function(options) {
var data = {
access_token: this.data.token,
// message: options.message,
link: options.link,
};
if (options.type == 'image') data.picture = options.image;
var url = 'https://graph.facebook.com/me/feed';
if (options.friend !== undefined)
url = 'https://graph.facebook.com/' + escape(options.friend) + '/feed';
$.ajax({
type: 'post',
dataType: 'json',
url: url,
data: data,
success: options.success,
error: options.error
});
```
};

| How do I enable inline video play when I send a link to facebook for YouTube videos via my app? | CC BY-SA 2.5 | 0 | 2010-09-27T03:39:46.603 | 2010-09-27T06:27:08.197 | 2010-09-27T05:45:38.480 | 436,630 | 436,630 | [
"facebook"
] |
3,801,571 | 1 | null | null | 10 | 5,731 | 
Anyone knows the difference?
| What's the difference between "Import Table address" and "Import Address Table address" in Date Directories of PE? | CC BY-SA 2.5 | 0 | 2010-09-27T06:33:35.543 | 2022-07-15T02:34:45.183 | null | null | 431,665 | [
"portable-executable",
"datadirectory"
] |
3,802,041 | 1 | null | null | 1 | 656 | Trying to find solution for redirection to the login page after Ajax-call if a user is not authenticated longer.
I used a method described here
[How to manage a redirect request after a jQuery Ajax call](https://stackoverflow.com/questions/199099/how-to-manage-a-redirect-request-after-a-jquery-ajax-call)
```
private static void RedirectionToLogin(ActionExecutingContext filterContext)
{
string redirectOnSuccess = filterContext.HttpContext.Request.Url.AbsolutePath;
string redirectUrl = string.Format("?ReturnUrl={0}", redirectOnSuccess);
string loginUrl = FormsAuthentication.LoginUrl + redirectUrl;
filterContext.HttpContext.Response.AddHeader("REQUIRES_AUTH", "1");
filterContext.HttpContext.Response.StatusCode = 401;
filterContext.HttpContext.Response.Redirect(loginUrl, true);
}
```
JavaScript is
```
$(window).ajaxComplete(function (event, request, settings) {
alert(request.getResponseHeader('REQUIRES_AUTH'));
alert(request.status);
if (request.getResponseHeader('REQUIRES_AUTH') === 1) {
window.location = App.basePath + "Login/LogOn";
{
});
```
If user was logged out request.getResponseHeader('REQUIRES_AUTH')) is always NULL

Why request.getResponseHeader('REQUIRES_AUTH')) is NULL???
| Problem to catch REQUIRES_AUTH and xhr.status from HttpContext.Response | CC BY-SA 2.5 | null | 2010-09-27T08:10:45.400 | 2010-11-04T17:13:34.123 | 2017-05-23T10:32:35.693 | -1 | 284,405 | [
"javascript",
"asp.net-mvc",
"ajax",
"redirect",
"authentication"
] |
3,802,177 | 1 | 3,802,598 | null | 2 | 2,193 | How can i stylize html5's range control to like this screenshot

| styling html5's range control | CC BY-SA 2.5 | null | 2010-09-27T08:32:08.237 | 2010-09-27T09:41:04.970 | null | null | 277,696 | [
"javascript",
"css",
"html"
] |
3,802,333 | 1 | 3,803,272 | null | 3 | 1,592 | I built a ListActivity and now I want to add Map Previews as the List Icons. I dont want to extend MapView because: 1st I just need a little static preview and 2nd I already extended to ListView.
I already looked into using the [static map api](http://www.google.de/url?sa=t&source=web&cd=1&ved=0CCMQqwMoBDAA&url=http%3A%2F%2Fcode.google.com%2Fapis%2Fmaps%2Fdocumentation%2Fstaticmaps%2F&ei=6VmgTPT0GYGmOKfguKQM&usg=AFQjCNEdZcmn2xxERbP4Wen5isuxeUvgbQ&sig2=lYqVrtZcz781XoGH3RS7hQ), however that also doesnt look quite good in that small dimensions:

[http://maps.google.com/maps/api/staticmap?center=40.714728,-73.998672&zoom=12&size=65x65&maptype=roadmap&sensor=true](http://maps.google.com/maps/api/staticmap?center=40.714728,-73.998672&zoom=12&size=65x65&maptype=roadmap&sensor=true)
| How to implement a little static map preview as list icon? | CC BY-SA 2.5 | 0 | 2010-09-27T09:01:25.580 | 2017-06-16T17:58:29.310 | null | null | 433,718 | [
"android",
"android-widget",
"google-maps-api-3",
"android-maps",
"google-maps-static-api"
] |
3,802,359 | 1 | 3,802,453 | null | 1 | 451 | I'm wont to work with netbeans, and with Visual studio I can't find the way to view a hierarchical relation of the control(Parent container ---> Child) in the form, something like this:

Is there a way to have a view like this in Visual Studio 2010 with c# programming language ?
| View container of a control in a Form | CC BY-SA 3.0 | 0 | 2010-09-27T09:05:27.617 | 2014-10-15T14:20:56.217 | 2014-10-15T14:20:56.217 | 1,710,392 | 330,280 | [
"visual-studio",
"visual-studio-2010"
] |
3,802,384 | 1 | null | null | 0 | 222 | I've started to develop my own mini project in restaurant reservation to improve my Java skills.
At the moment, I create a table consists of
- number of tables in the restaurant
(column) - and time interval during the day
(row).
So for example, if someone booked a table at 11:00 on Table 4, that cell will become reserved and mark as booked. And i should be able to separate the table of each day to be their own table so that i can select to view the today table or tomorrow table.
I created 3 MySQL table; 'customer', 'seat', and 'booking' table. Detail of each table in the fixture below.
to bind the data from each table to the table in Netbeans. (I'm using NetBeans).
Please see the images below.


| Any idea on how to implement these database tables to Java? | CC BY-SA 2.5 | null | 2010-09-27T09:09:19.693 | 2010-09-27T09:18:41.280 | 2010-09-27T09:13:43.580 | 140,185 | 355,578 | [
"java",
"mysql",
"database-design",
"jdbc"
] |
3,802,588 | 1 | 3,803,572 | null | 3 | 3,312 | I use the following to upload a file to Flex:
```
private var filer:FileReference;
protected function button1_clickHandler(event:MouseEvent):void
{
var fd:String = "Files (*)";
var fe:String = "*";
var ff:FileFilter = new FileFilter(fd, fe);
filer = new FileReference();
filer.addEventListener(Event.SELECT, onFileSelect);
filer.browse(new Array(ff));
filer.addEventListener(Event.COMPLETE,
function (e:Event):void {
e.currentTarget.data.toString();
}
);
}
private function onFileSelect(e:Event):void {
filer.load();
}
```
And my file looks like this:

Here is the original file: [http://sesija.com/up/1.txt](http://sesija.com/up/1.txt)
I need to read the uploaded file and parse it. The problem is that in my `e.currentTarget.data.toString();` I get only '`1`' and not the rest of the String.
Any idea on how to successfully read this entire txt file?
| Flex: Read bytearray | CC BY-SA 2.5 | null | 2010-09-27T09:39:30.870 | 2010-09-27T12:06:49.190 | null | null | 222,159 | [
"apache-flex",
"filereference"
] |
3,802,650 | 1 | 3,802,777 | null | -1 | 596 | How do i set the position of a menuitem all the way to the right, as shown in the picture, and make sure it stays there when resizing the dockbar.

| C#: How do i position a menuitem | CC BY-SA 2.5 | null | 2010-09-27T09:47:30.187 | 2010-09-27T10:04:24.383 | null | null | 436,802 | [
"c#",
"menu",
"move"
] |
3,802,614 | 1 | 3,802,673 | null | 8 | 42,388 | I am a iPhone developer stuck with some basic CSS properties ;)
I want to show something like this:

This is what I have:
```
<div class="cell">
<div class="cell_3x3_top">
<div class="cell_3x3_type rounded_left">type</div> <!--UPDATED:2010/09/29-->
<div class="cell_3x3_title rounded_right">title</div><!--UPDATED:2010/09/29-->
</div>
<div class="cell_3x3_content rounded_left rounded_right">content</div><!--UPDATED:2010/09/29-->
</div>
```
and the css:
```
div.cell_3x3_top{
height:20%;
margin: 0 0 0 0;
padding: 0 0 0 0;
border: none;
margin-bottom: 1px; /*to compensate space between top and content*/
text-align: center;
vertical-align: middle;
}
div.cell_3x3_type{
width:20%;
float:left;
background-color: inherit;
margin-right: -2px; /*UPDATED:2010/09/29*/
}
div.cell_3x3_title{
width:80%;
float:left;
background-color: inherit;
margin: 0 0 0 0; /* maybe not neccesary*/
padding: 0 0 0 0; /*maybe not neccesary*/
margin-left: -1px; /*UPDATED:2010/09/29 */
}
div.cell_3x3_content{
height:80%;
background-color: inherit;
}
```
But when I render my content with above code `title` div seems to be too large and it appears underneath `type` div, Why is this?
`type` div is 20% width, `title` is 80% width so it should be 100% exactly. Is any margin or other metric I am forgetting here?
I have tried to move `title` div to the left using margin but is still buggy. I wonder what is the correct way of getting something like the picture?
(Not exactly because if you look closer `title` div is a little bit shorter than it should be. See that its right border is not aligned with `content` div.)
Thanks in advance.
EDIT: 2010/09/28
This is actually what I want to achieve:

and this is what I have:

Above code (updated a little bit) would work if I wouldn't have bordered divs. Since border width is 1px what I need is to set `type` div width to 20%-2px (left border + right border = 2px) and `title` div to 80%-2px
```
.rounded_left{
border-top-left-radius: 4px 4px;
border-bottom-left-radius: 4px 4px;
border-color:gray;
border-width: 1px;
border-style:solid;
}
```
(.rounded_right is similar)
This is not related to `clear:both` property I believe. I tried and didn't had any effect since my `content` div was good form the beginning.
In short: How can I make a div including its border to be let's say exactly 20% width?
Ignacio
ANSWER:
I realized that a wrapper div around type and title respectively solves the problem. So my answer is kind of like this:
```
<td class="cell">
<div class="cell_3x3_top bordered">
<div class="cell_3x3_type_container"><div class="cell_3x3_type rounded_left full_height">6</div></div>
<div class="cell_3x3_title_container"><div class="cell_3x3_title rounded_right full_height">title</div></div> </div>
<div class="cell_3x3_content rounded_left rounded_right">content</div>
</td>
```
I set 20% and 80% in the containers and the borders in the inner div.
| div padding, margin? | CC BY-SA 2.5 | null | 2010-09-27T09:43:30.250 | 2021-05-15T14:21:01.250 | 2010-09-27T17:59:05.740 | 149,008 | 149,008 | [
"html",
"css",
"border",
"margin"
] |
3,802,970 | 1 | 3,803,008 | null | 0 | 209 | I used EtherDetect to see what is one game sending to me and what I'm sending to game server.
I was wondering what encryption is it after the packet information which is colored in grey color in the image bellow. How can I encrypt/decrypt information which I'm sending/receiving in my games like this?

| What encryption is it? | CC BY-SA 2.5 | 0 | 2010-09-27T10:31:07.830 | 2010-09-27T21:01:51.353 | 2010-09-27T11:46:23.893 | 256,544 | 374,476 | [
"encoding",
"reverse-engineering",
"packet"
] |
3,803,087 | 1 | 3,803,245 | null | 0 | 1,356 | I'm trying to create the following design:

This is my code so far.
```
<section class="frontpagearticle">
<figure class="frontpagearticlefigure">
<img class="frontpagearticleimg" />
</figure>
<header>
<h2 class="frontpagearticleh2">MyHeader</h2><time class="frontpagearticletime">pubtime</time>
</header>
<p class="frontpagearticletext">Lorem....</p>
<a href="">Read more...</a>
</section>
```
I'm having problems creating my css, so ex. pubtime would be align to the right, while MyHeader would be left align.
The image is always going to be the same size.
```
height: 140px;
width: 250px;
```
| How to create a simple article design with CSS and HTML5 | CC BY-SA 2.5 | null | 2010-09-27T10:47:54.457 | 2010-09-27T11:16:24.643 | 2010-09-27T11:16:24.643 | null | 363,274 | [
"html",
"css"
] |
3,803,162 | 1 | 3,803,593 | null | 5 | 8,024 | I used this selector code for my custom button (simple.xml)
```
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true" android:state_pressed="false" android:drawable="@drawable/focused" />
<item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/focusedpressed" />
<item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/pressed" />
<item android:drawable="@drawable/defaultbutton" />
</selector>
```
But on my ImageButton I don't know how to remove border. I want to show only my images not to show border around button.
Thanks

| Android, remove custom button border | CC BY-SA 2.5 | null | 2010-09-27T11:02:11.767 | 2010-09-27T12:09:39.653 | 2010-09-27T11:44:48.513 | 180,538 | 432,848 | [
"android",
"background",
"imagebutton"
] |
3,803,226 | 1 | 3,803,290 | null | 8 | 3,811 | A picture says more than a thousand words?

I would like the second (and consecutive) lines to be aligned with the first. Any ideas?
Html is
```
<input><span>text</span>
```
| Align checkbox labels (web) | CC BY-SA 2.5 | 0 | 2010-09-27T11:09:44.070 | 2011-10-06T13:30:44.087 | 2010-09-27T11:17:59.883 | 65,087 | 65,087 | [
"html",
"css"
] |
3,803,579 | 1 | 3,821,881 | null | 2 | 284 | In VS 2010, when searching for text in the XAML editor, the highlighted text is highlighted in the lightest gray colour when not in focus. Is it possible to change the background colour of the highlighted found item text? I've tried changing the VS theme but cannot find the property which would set this colour. In the screenshot below, the text "Text" is selected but you can barely see it and its driving me mad.

| VS 2010 - find text in XAML editor | CC BY-SA 2.5 | 0 | 2010-09-27T12:07:16.463 | 2011-09-13T10:55:54.047 | null | null | 61,197 | [
"visual-studio-2010"
] |
3,803,607 | 1 | 3,805,907 | null | 2 | 3,267 | I want to achieve a python version web regexbuddy,and i encounter a problem,how to highlight match values in different color(switch between yellow and blue) in a textarea,there has a demo what exactly i want on [http://regexpal.com](http://regexpal.com),but i was a newbie on js,i didn't understand his code meaning.
any advice is appreciated

| how to highlight part of textarea html code | CC BY-SA 2.5 | 0 | 2010-09-27T12:11:04.780 | 2016-06-02T06:15:23.493 | 2010-09-27T16:21:52.407 | 432,745 | 446,929 | [
"javascript",
"python",
"regex",
"highlight",
"regexbuddy"
] |
3,803,673 | 1 | 3,811,090 | null | 1 | 845 | I have a function which updates the centroid (mean) in a K-means algoritm.
I ran a profiler and noticed that this function uses a lot of computing time.
It looks like:
```
def updateCentroid(self, label):
X=[]; Y=[]
for point in self.clusters[label].points:
X.append(point.x)
Y.append(point.y)
self.clusters[label].centroid.x = numpy.mean(X)
self.clusters[label].centroid.y = numpy.mean(Y)
```
So I ponder, is there a more efficient way to calculate the mean of these points?
If not, is there a more elegant way to formulate it? ;)
EDIT:
Thanks for all great responses!
I was thinking that perhaps I can calculate the mean cumulativly, using something like:

where x_bar(t) is the new mean and x_bar(t-1) is the old mean.
Which would result in a function similar to this:
```
def updateCentroid(self, label):
cluster = self.clusters[label]
n = len(cluster.points)
cluster.centroid.x *= (n-1) / n
cluster.centroid.x += cluster.points[n-1].x / n
cluster.centroid.y *= (n-1) / n
cluster.centroid.y += cluster.points[n-1].y / n
```
Its not really working but do you think this could work with some tweeking?
| Optimizing mean in python | CC BY-SA 2.5 | 0 | 2010-09-27T12:20:31.730 | 2010-09-28T08:50:40.040 | 2010-09-27T18:06:39.113 | 441,337 | 441,337 | [
"python",
"optimization",
"numpy"
] |
3,804,083 | 1 | 3,804,121 | null | 1 | 247 | i have an array in php who contains pictures url (jpg pics). When you execute the php script this array is filled with url of pictures (for this example lets say 4 pics). At this point i want to equally distribute the pics in the space and generate a single one, like:

| How to make a single picture (PNG/JPG) from a know number of pictures on PHP? | CC BY-SA 2.5 | null | 2010-09-27T13:09:59.120 | 2010-09-27T13:29:38.903 | null | null | 310,648 | [
"php"
] |
3,804,239 | 1 | 3,804,738 | null | 2 | 1,171 | I have a working paginator. I combine Zend Paginator and jQuery to switch between pages. My problem is that the page links only have a range from 1 to 10 but it should be e.g. from 1 to 13. I can get to page 13 by clicking the forward button but the page link 13 is not displayed.

Paginator setup:
```
$paginator = new Zend_Paginator (
new Zend_Paginator_Adapter_DbSelect ( $programmeList ) );
$paginator->setItemCountPerPage ( 12 )
->setCurrentPageNumber ( $this->_getParam ( 'page', 1 ));
```
Pass paginator to the view:
```
if (! $this->_request->isXmlHttpRequest ()) {
$this->view->paginator = $paginator;
} else {
$this->view->currentPage = $paginator->getCurrentPageNumber ();
}
```
And this is how I print page links:
```
foreach ( $this->pagesInRange as $page ) {
echo '<a href="#" id="page" page="'.$page.'">' . $page . '</a>';
}
```
Any ideas?
| Zend Paginator - Page Links | CC BY-SA 2.5 | 0 | 2010-09-27T13:29:34.520 | 2012-02-09T10:05:45.267 | null | null | 401,025 | [
"php",
"zend-framework",
"jquery",
"zend-paginator"
] |
3,805,135 | 1 | 3,812,421 | null | 2 | 7,255 | For some reason I can't add ActionScript actions to a timeline frame within a Button Symbol, like I normally would with MovieClip symbols or on the stage. The Actions panel shows this message:
"In ActionScript 3.0, code cannot be placed directly on objects. Please select a frame..."
even though I definetely have a frame selected!
Any ideas?
EDIT: Screenshot as requested. As you can see, a frame is clearly selected...

| Adding Actions to Button Symbol frames in Flash CS5 | CC BY-SA 2.5 | null | 2010-09-27T15:08:26.860 | 2011-09-28T20:25:32.513 | 2010-09-27T15:20:09.407 | 165,673 | 165,673 | [
"flash",
"actionscript-3",
"timeline",
"flash-cs5",
"symbols"
] |
3,805,854 | 1 | null | null | 3 | 5,880 | I am trying to run Rails3 on XP Profesoinal and following the tutorial here [http://railstutorial.org](http://railstutorial.org) and am receiving the following errors all the time, even trying to return static pages. The message is the procedure entry point rb_str2cstr could not be located in the dynamic link library msvcrt-ruby191.dll
Also, the page gives a runtime error "no driver for sqlite3 found" even though i haven't created any models yet. The sqlite3.exe, sqlite3.dll and sqlite3.def are all in the bin folder and I have run Gem install sqlite3-ruby.
I have also tried gem install mongrel --pre and the instructions given [http://www.ruby-forum.com/topic/202770#882858](http://www.ruby-forum.com/topic/202770#882858), but nothing is working

| Ruby on rails msvcrt-ruby191.dll problems on XP | CC BY-SA 2.5 | null | 2010-09-27T16:35:06.620 | 2012-09-14T19:30:07.727 | null | null | 10,479 | [
"ruby-on-rails",
"ruby",
"sqlite"
] |
3,806,080 | 1 | 3,806,115 | null | 0 | 238 | I have a function that gets a string passed to it. When testing the function, I'm getting a null reference exception on the string parameter that gets passed to it, even though the string is not null, I don't understand why I'm getting this error. I have a screen shot below

I used a dummy value to verify both the string parameter in the SelectSingleNode function and the newValue string parameter being passed to my function and they both contain values, so I don't understand why it's throwing a null reference exception. Just for clarity, the purpose of the function is to write values back to the nodes of an XML file.
UPDATE
Sorry for not posting code
```
Private Sub setValue(ByVal nodeToMod As String, ByVal newValue As String)
''Test writing to xml config file
Dim dummy As String = "Config/" & nodeToMod
Dim xmlDoc As New XmlDocument
Using fs As FileStream = New FileStream(HttpContext.Current.Server.MapPath("~/XML_Config/Config.xml"), FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite)
xmlDoc.Load(fs)
Dim foo As XmlNode = xmlDoc.SelectSingleNode(dummy)
Console.WriteLine(foo.InnerXml)
fs.Seek(0, SeekOrigin.Begin)
fs.SetLength(0)
xmlDoc.Save(fs)
End Using
End Sub
```
And here is the XML file I'm working with
```
<?xml version="1.0" encoding="utf-8"?>
<Config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Username>[email protected]</Username>
<Password>Password1</Password>
<ProductType>MyProduct</ProductType>
<DirectoryEntryPath>LDAP://myDomain</DirectoryEntryPath>
<SMTPDefaultOnly>True</SMTPDefaultOnly>
<Logo>myLogo.gif</Logo>
</Config>
```
Yes, the SlectSingleNode function is not returning a value. I just started working with XPath, this seemed to have worked when I was using last week. I'm not sure why it has stopped working now.
UPDATE2:
Got it, stupid mistake. I had nodeToMod being passed as "UserName" instead of "Username" in the Set method
```
Set(ByVal value As String)
setValue("UserName", value.ToString)
_userName = value
End Set
```
| NullReference on a value that is not null | CC BY-SA 2.5 | null | 2010-09-27T17:07:42.760 | 2010-09-27T17:27:18.447 | 2010-09-27T17:27:18.447 | 94,541 | 94,541 | [
"asp.net",
"xml",
"vb.net"
] |
3,806,097 | 1 | 3,806,331 | null | 1 | 573 | I am breaking my head, but still I dint get solution. I ran these code and analyzed with .NET memory profiler. It showed me that one instance of IntEntity[] is not collected. But I am clearing the list and setting it to null. How I can make this to garbage collect? Am I doing anything wrong here?
Edit: I tried setting b = null & calling GC.Collect(GC.MaxGeneration); But same results.
Edit2: Added images from NET Memory Profiler & ANTS Memory profiler
Please help me.
Here is the code am using,
```
public class IntEntity
{
public int Value { get; set; }
}
public abstract class Base
{
protected List<IntEntity> numbers;
public Base()
{
}
public abstract void Populate();
public int Sum()
{
numbers = new List<IntEntity>();
Populate();
int sum = 0;
foreach (IntEntity number in numbers)
{
sum += number.Value;
}
numbers.Clear();
numbers = null;
return sum;
}
}
public class Child : Base
{
public override void Populate()
{
numbers.Add(new IntEntity() { Value = 10 });
numbers.Add(new IntEntity() { Value = 20 });
numbers.Add(new IntEntity() { Value = 30 });
numbers.Add(new IntEntity() { Value = 40 });
}
}
Base b = new Child();
MessageBox.Show(b.Sum().ToString());
b = null;
GC.Collect(GC.MaxGeneration);
```


| c# memory leak analyze | CC BY-SA 2.5 | null | 2010-09-27T17:10:03.243 | 2010-09-27T18:45:48.570 | 2010-09-27T18:45:48.570 | 368,999 | 368,999 | [
"c#"
] |
3,806,512 | 1 | 3,827,110 | null | 4 | 2,103 | For example you measure the data coming from some device, it can be a mass of the object moving on the bridge. Because it is moving the mass will give data which will vibrate in some amplitude depending on the mass of the object. Bigger the mass - bigger the vibrations.
Are there any methods for filtering such kind of noise from that data?
May be using some formulas of vibrations? Have no idea what kind of formulas or algorithms (filters) can be used here. Please suggest anything.
EDIT 2:
Better picture, I just draw it for better understanding:

Not very good picture. From that graph you can see that the frequency is the same every
time, but the amplitude chanbges periodically. Something like that I have when there are no objects on the moving road. (conveyer belt). vibrating near zero value.
When the object moves, I there are the same waves with changing amplitude.
The graph can tell that there may be some force applying to the system and which produces forced occilations. So I am interested in removing such kind of noise. I do not know what force causes such occilations. Soon I hope I will get some data on the non moving road with and without object on it for comparison with moving road case.
| Algorithms needed on filtering the noise caused by the vibration | CC BY-SA 2.5 | 0 | 2010-09-27T18:02:17.400 | 2010-10-11T22:30:51.773 | 2010-10-10T16:30:05.643 | 242,388 | 242,388 | [
"algorithm",
"filtering",
"modeling",
"signal-processing"
] |
3,806,780 | 1 | null | null | 0 | 214 | I got the following structure:
```
<td>
<a>1. menu</a>
<a>2. menu</a>
<a>3. menu</a>
<a>4. menu</a>
</td>
```
Of course, I have classes assigned to the elements. I am trying to adjust the height of those a elements to the outer td, so that the hover effect will fill from top to the bottom.
See here:

Any idea how I can accomplish that?
| Adjusting height of a-tag to outer td | CC BY-SA 3.0 | null | 2010-09-27T18:42:47.863 | 2017-06-11T08:21:57.313 | 2017-06-11T08:21:57.313 | 4,370,109 | 309,497 | [
"css",
"hyperlink",
"html-table",
"structure"
] |
3,807,992 | 1 | 3,809,514 | null | 6 | 7,912 | As in this mockup:

I know it is possible to have charts display next to each other using `org.jfree.chart.plot.CombinedDomainXYPlot`, but is it possible to have them overlaid, possibly using different Y axes (one for the stacked bars to the left of the chart, and one for the line chart shown to the right of the chart)?
| JFreeChart: is it possible to combine a stacked bars and line chart combined? | CC BY-SA 2.5 | null | 2010-09-27T21:22:22.147 | 2017-02-18T23:57:12.057 | null | null | 5,295 | [
"jfreechart"
] |
3,808,033 | 1 | null | null | 3 | 385 | Sometimes when working with Visual Studio 2008, the main editor window will just start failing to draw beyond a certain width. In this case it appears to only re-draw about 80% of the editor width, then it starts showing grey/incomplete rendering. See this screenshot:

I have no idea what's going on here; anyone else experience this issue? If I restart Visual Studio it seems fine again for a while. I've got the latest videocard drivers on my computer, and it has happened on different computers of mine. Has even happened on a "stock" install of VS2008.
I'm in Windows 7 Ultimate, 64-bit if that matters.
| Way to fix Visual Studio 2008 Redraw Problem? | CC BY-SA 2.5 | null | 2010-09-27T21:28:23.050 | 2010-10-06T21:35:53.900 | null | null | 22,505 | [
"visual-studio-2008"
] |
3,808,457 | 1 | 3,808,530 | null | 6 | 1,960 | What I'd like to do is label both of the geom_bar() 's in the following example with their respective data labels. So far, I can only get one or the other to show up:
dput():
```
x <- structure(list(variable = c("a", "b", "c"), f = c(0.98, 0.66,
0.34), m = c(0.75760989010989, 0.24890977443609, 0.175125)), .Names = c("variable",
"f", "m"), row.names = c(NA, 3L), class = "data.frame")
ggplot(x, aes(variable, f, label=paste(f*100,"%", sep=""))) +
geom_bar() +
geom_text(size=3, hjust=1.3, colour="white") +
geom_bar(aes(variable, m, label=paste(m*100,"%",sep="")), fill="purple") +
coord_flip()
```

See how on the inside of the black there is a data label. In the same plot, I'd like to do the same thing on the inside of the purple.
| ggplot2 Labeling a multilayered bar plot | CC BY-SA 2.5 | 0 | 2010-09-27T22:45:10.260 | 2010-09-28T14:19:31.660 | null | null | 170,352 | [
"r",
"ggplot2"
] |
3,808,531 | 1 | 3,808,557 | null | 1 | 438 | As PHP is simpler for me I wished to benchmark algorithms in it for fun, and I chose to do factorials.
The recursive function completely flunked in speed when I got up to `80!` compared to the iterative method, and it gradually skyrocketed upwards while iterative had a steady line, actually it is something like this (x = factorial, y = seconds):

But in C/Java (which I just implemented the test in) show the same results to be only 1-5% off from eachother, almost the same speed.
Is it just useless to benchmark algorithms in this manner in scripting languages?
: For NullUserException:
```
function factrec($x) {
if($x <= 1) {
return $x;
} else {
return $x * factrec($x - 1);
}
}
```
| Are algorithm benchmarks in PHP pointless? | CC BY-SA 2.5 | null | 2010-09-27T23:02:06.137 | 2012-04-06T05:00:57.370 | 2012-04-06T05:00:57.370 | 92,837 | 445,413 | [
"php",
"performance",
"algorithm",
"scripting-language"
] |
3,808,663 | 1 | 3,811,135 | null | 1 | 550 | I have a recursively defined user control that needs the following properties:
there are two columns
the first contains a single border around some text
the second column contains a stack of these same type of controls (the recursive part)
if the box in the first column is shorter than the total height of the stacked boxes in the second column, the box should expand to make both columns the same height.
If the total height of the second column is shorter than the box in the first column, then the last item in the second column's stack should expand so they are the same height.
so for example, it might look like this:

Ok, so far what I have done is create a horizontal stack panel where the first item is a dock-panel containing a border and text... the second column is a vertical stack panel bound to a sublist, creating the recursive user control... like this..
```
<StackPanel Orientation="Horizontal" Background="AliceBlue">
<local:TMRequirementView Requirement="{Binding Baseline}" />
<StackPanel Orientation="Vertical">
<ItemsControl ItemsSource="{Binding Requirements}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<local:TMGridView Baseline="{Binding}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
```
Where the requirement looks like this:
```
<DockPanel>
<Border MinHeight="50"
BorderBrush="Black" BorderThickness="2">
<TextBlock Text="{Binding Description}"
TextWrapping="Wrap" Background="Transparent" Height="Auto" />
</Border>
</DockPanel>
```
Now this works great if the stacked column is taller, but it doesn't work if the first column is taller, and I get gaps. Any idea how to handle this mutual height dependency?
---
Update:
So by adding a border around the right columns stack panel, I was able to see that the stackpanel actually did receive the min-height changes. However, even though there was room to expand, the children of the stack panel didn't automatically update. If I fix the minheight of the stack panel before hand to something large, the children fill up. What I need to figure out is how to update the chidren's height based on changes to the stack panel's min-height.
| inter related stack panel sizing | CC BY-SA 2.5 | 0 | 2010-09-27T23:38:10.323 | 2010-10-01T17:52:02.603 | 2010-10-01T17:36:00.287 | 124,034 | 124,034 | [
"c#",
"wpf",
"stackpanel",
"sizing"
] |
3,808,769 | 1 | 3,809,136 | null | 3 | 800 | I have a list of items I'd like to show in a UITableViewCell. Right now, I'm simply using a cell.textLabel with commas separating each value, but I'd like to do something a little more dynamic.
How would I achieve something like this?

Would it be an array of UILabels with borders and radius on those borders?
Thanks for your ideas.
| How to display an array of UILabels? | CC BY-SA 2.5 | 0 | 2010-09-28T00:02:31.837 | 2010-09-28T01:48:52.820 | null | null | 188,710 | [
"iphone",
"uilabel",
"border"
] |
3,808,792 | 1 | 3,811,576 | null | 3 | 3,850 | I have two questions about axis labels:
1. How do I make a label at the Y2-axis, that shows a highlighted label following the dynamic price (y2-value) of the last bar/candlestick? As the red label in this example:

And possibly also the same on the `XAxis`, showing the time of the last bar.
1. Also I wonder how to make the time axis plot only every 30 min, and also that it should be full half hours, not arbitrary 30 min spots.. As also shown in the above image.
ZedGraph is awesome. But takes some time to figure out the tricks and tweaks.. :)
| ZedGraph Axis labels | CC BY-SA 3.0 | null | 2010-09-28T00:09:57.067 | 2011-05-09T15:36:30.787 | 2011-05-09T15:36:30.787 | 63,550 | 445,533 | [
"zedgraph"
] |
3,808,977 | 1 | null | null | 1 | 441 | I can't understand the problem here but this looks fine in all browsers cept Opera.
The HTML Code is as follows:
```
<table width="395" height="214" border="1">
<tr>
<td colspan="2">Here is some content in here that has 2 colspans</td>
<td width="137">This only has 1 colspan.</td>
</tr>
<tr>
<td width="113">This has only 1 colspan also.</td>
<td colspan="2">This cell has 2 colspans now and should look presentable hopefully.</td>
</tr>
<tr>
<td colspan="3">This cell has 3 colspans within this table and should fill up the entire width of the table.</td>
</tr>
</table>
```
Now the Output looks like this in Opera:

But how do I make it look like this (as all other browsers look like):

The problem is actually much deeper than this, but this is the main basic overall problem.
| Colspans in Opera Browsers not working right | CC BY-SA 3.0 | null | 2010-09-28T01:07:09.707 | 2016-11-05T08:40:53.200 | 2016-10-23T10:11:25.583 | 4,370,109 | 304,853 | [
"html",
"html-table",
"opera"
] |
3,808,995 | 1 | null | null | 2 | 661 | A lot of my floats are showing up on a separate line when viewing in IE7 ... in Ffox, chrome, IE8 etc they look fine.
The site in question is:
[http://208.43.52.30](http://208.43.52.30)
The places where the float is not working are the location for "events near me", "Show" for the show month buttons ..
I'll attach some screenshots


| IE7 Display issues | CC BY-SA 2.5 | null | 2010-09-28T01:11:49.993 | 2012-06-12T13:38:56.770 | 2012-06-12T13:38:56.770 | 44,390 | 215,733 | [
"css",
"internet-explorer-7",
"css-float"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.