Id
int64 1.68k
75.6M
| PostTypeId
int64 1
2
| AcceptedAnswerId
int64 1.7k
75.6M
⌀ | ParentId
int64 1.68k
75.6M
⌀ | Score
int64 -60
3.16k
| ViewCount
int64 8
2.68M
⌀ | Body
stringlengths 1
41.1k
| Title
stringlengths 14
150
⌀ | ContentLicense
stringclasses 3
values | FavoriteCount
int64 0
1
⌀ | CreationDate
stringlengths 23
23
| LastActivityDate
stringlengths 23
23
| LastEditDate
stringlengths 23
23
⌀ | LastEditorUserId
int64 -1
21.3M
⌀ | OwnerUserId
int64 1
21.3M
⌀ | Tags
list |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5,370,125 | 1 | 5,370,940 | null | 9 | 2,779 | I'd like to build a NSCollectionView similar to the one in iPhoto '11. I want to group several pictures in section, and create a section header as well. The section header of a specific section is always visible until the last element of that section is visible. You can take a look at the picture to see what I mean.
EDIT: I should add that the contents are not images.

Thanks in advance
| NSCollectionView with sections - like in iPhoto | CC BY-SA 2.5 | 0 | 2011-03-20T17:21:48.657 | 2014-04-16T11:36:26.807 | 2011-03-20T19:13:45.650 | 115,730 | 264,529 | [
"cocoa",
"xcode",
"nscollectionview",
"iphoto"
]
|
5,370,261 | 1 | 5,388,776 | null | 0 | 2,061 | dude here im gonna create client and combine with GIO Channel, and after i put it all together, it seems appears to work on socket, but the g_io_channel not as watching, like crashing or such..
please see following code :
```
#include <stdio.h>
#include <gio/gio.h> // g_timeout_add
#include <gtk/gtk.h> // gtk
#include <netinet/in.h> //sockaddr_in
#include <sys/socket.h> // socket();
#include <arpa/inet.h> // inet_addr();
#include <string.h> // memset();
struct dada
{
gint id_sock;
guint id_gio_watch;
};
gboolean incoming(GIOChannel *chan, GIOCondition condition, struct dada *didi )
{
int byte;
int insock = g_io_channel_unix_get_fd(chan);
#define MAXMAX 128
char buff[128];
printf("sock : %d\n",insock);
byte = recv(insock,buff,MAXMAX-1,0);
if(byte <= 0)
{
perror("recv");
close(didi->id_sock);
g_source_remove(didi->id_gio_watch);
return FALSE;
}
else
{
buff[byte] = '\0';
printf("coming : %s",buff);
}
return TRUE;
}
// gtk area
void hello(GtkWidget *widget, gpointer data)
{
g_print("Haii world %s\n", (char *)data);
}
gint delete_event(GtkWidget *widget, GdkEvent *event, gpointer data)
{
g_print("a delete event has been occured properly :D\n");
return(0);
}
void destroy(GtkWidget * widget, gpointer data)
{
gtk_main_quit();
}
// end of gtk area
int main(int argc, char **argv)
{
//gtk bussines from here
GtkWidget *window;
GtkWidget *button;
gtk_init(&argc,&argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_signal_connect(GTK_OBJECT(window), "delete_event", GTK_SIGNAL_FUNC(delete_event), NULL);
gtk_signal_connect(GTK_OBJECT(window), "destroy", GTK_SIGNAL_FUNC(destroy), NULL);
gtk_container_set_border_width(GTK_CONTAINER(window),10);
button = gtk_button_new_with_label("ohayo");
gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(hello), (gpointer)"hha" );
gtk_signal_connect_object(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), GTK_OBJECT(window));
gtk_container_add(GTK_CONTAINER(window),button);
gtk_widget_show(button);
gtk_widget_show(window);
//gtk bussiness done here...
// network code //
struct dada didi;
memset(&didi,0,sizeof(didi));
struct sockaddr_in my; // set my network device info
gint rootsock; // handle the root socket
//socket
rootsock = socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
//binding
memset(&my,0,sizeof(my));
my.sin_addr.s_addr = inet_addr("127.0.0.1");
my.sin_family = AF_INET;
my.sin_port = htons(1111);
//bind(rootsock,(struct sockaddr*)&my,sizeof(my));
printf("sock : %d\n",rootsock);
connect(rootsock,(struct sockaddr*)&my,sizeof(my));
didi.id_sock = rootsock;
didi.id_gio_watch = g_io_add_watch(g_io_channel_unix_new(didi.id_sock),G_IO_IN|G_IO_OUT,(GIOFunc)incoming,&didi);
// network code //
gtk_main();
return 0;
}
```
compiling :
```
$ gcc -o konek_gioglib konek_gioglib.c `pkg-config glib-2.0 --libs --cflags gtk+-2.0`
```
my own pc run as server with port 1111 and stream connection ( TCP ) :
```
$ nc -v -l 1111
```
running my app :
```
$ ./konek_gioglib
sock : 6
sock : 6
```
server got connection and send some word :
```
$ nc -v -l 1111
Connection from 127.0.0.1 port 1111 [tcp/*] accepted
a
a
```
and when the server send something, gtk window show but with error like these :

is there anyone dont mind to explain, why these things could happened to mine ?
| g_io_channel + socket = client, and GIO not work properly | CC BY-SA 2.5 | null | 2011-03-20T17:45:55.380 | 2011-03-22T08:55:16.410 | 2011-03-21T11:23:08.093 | 568,702 | 568,702 | [
"c",
"sockets",
"glib",
"gio"
]
|
5,370,552 | 1 | 5,372,638 | null | 0 | 2,215 | I am trying to generate a pdf file, using python reportlab, but is seems image is displayed with strange black border in pdf.
Here is the code:
```
# Standalone script to generate pdf lessons
from reportlab.pdfgen import canvas
def hello(c):
c.drawImage("./media/files/1.png", 0, 600, 350, 350)
c = canvas.Canvas("hello.pdf")
hello(c)
c.showPage()
c.save()
```
The image I am trying to add is here
Can somebody advice why the black line on the left have appeared, and how to fix it?
| python: reportlab, how to remove black borders from image | CC BY-SA 2.5 | 0 | 2011-03-20T18:36:58.910 | 2011-05-05T12:06:35.410 | 2011-05-05T12:06:35.410 | 62,997 | 126,545 | [
"python",
"reportlab"
]
|
5,370,594 | 1 | 5,370,622 | null | 1 | 5,821 | do you guys know a .net ListView-Replacement which can be highly customized?
I am developing an app which is similar to a "todo" list.
I want to be able to customize almost every visual detail of the list so I get something like this:

I want also to be able to reorder items by mouse + I need drag&drop.
If you don't know any ListView, maybe you know how I could make my own listview like this one from scratch?
Thanks for your ideas!
| Highly customizable Listview for .Net? | CC BY-SA 2.5 | null | 2011-03-20T18:44:53.510 | 2019-08-09T13:53:52.797 | null | null | 82,460 | [
".net",
"vb.net",
"listview",
"replace",
"customization"
]
|
5,370,905 | 1 | 5,371,210 | null | 0 | 5,066 | i have a jquery ui dialog and i have a jqgrid on that dialog. When i click Add or Edit, the jqgrid popup (to have a popup on a popup), it shows up to enter in the data BUT . .
. .it shows up behind the jquery UI dialog (the zorder is wrong). Is there anyway to have the jqgrid popup set the correct Zorder so this window shows on top of (in front of) the jquery ui dialog so this is usable.
I have a screenshot below highlighting the behavior.

here is my code:
```
$(document).ready(function () {
$("#modalDialogContainer").dialog({
resizable: false,
height: 'auto',
autoOpen: false,
width: 1000,
modal: false,
buttons: {
'Close': function () {
closeModalPopup();
}
}
});
});
```
then later on a button click to launch the jquery ui dialog i have this:
```
$("#modalDialogContainer").dialog("open");
```
i found [this link](http://www.trirand.com/blog/?page_id=393/bugs/jqgrid-in-a-jqmodal-causes-incorrect-editdeletealertmod-modal-position/) which seems to be someone experiencing the same issue and at the end it says its fixed but i don't see this inthe jqgrid source code.
| Incorrect Z-Order - the jqgrid Add/Edit screen shows up behind if you the grid is on a jquery ui dialog | CC BY-SA 2.5 | 0 | 2011-03-20T19:31:19.010 | 2011-03-20T20:16:56.993 | 2011-03-20T19:58:49.017 | 4,653 | 4,653 | [
"jquery",
"jqgrid",
"jquery-ui-dialog"
]
|
5,370,997 | 1 | 5,382,561 | null | 0 | 4,269 | I have a simple `Devexpress` `Gridview`.

Here code;
```
<dx:ASPxGridView ID="grid" runat="server" DataSourceID="MasterDataSource" Width="100%"
AutoGenerateColumns="False" KeyFieldName="CategoryID">
<Columns>
<dx:GridViewDataTextColumn FieldName="CategoryID" ReadOnly="True" VisibleIndex="0" />
<dx:GridViewDataTextColumn FieldName="CategoryName" VisibleIndex="1" />
<dx:GridViewDataTextColumn FieldName="Description" VisibleIndex="2" />
</Columns>
<SettingsDetail ShowDetailRow="True" ExportMode="Expanded" />
<Templates>
<DetailRow>
<dx:ASPxGridView ID="detailGrid" runat="server" AutoGenerateColumns="False" DataSourceID="DetailDataSource"
KeyFieldName="ProductID" Width="100%" OnBeforePerformDataSelect="detailGrid_BeforePerformDataSelect">
<SettingsDetail IsDetailGrid="true" ExportIndex="0" />
<Columns>
<dx:GridViewDataTextColumn FieldName="ProductID" ReadOnly="True" VisibleIndex="0" />
<dx:GridViewDataTextColumn FieldName="ProductName" VisibleIndex="1" />
<dx:GridViewDataTextColumn FieldName="UnitPrice" VisibleIndex="2" />
<dx:GridViewDataTextColumn FieldName="QuantityPerUnit" VisibleIndex="3" />
</Columns>
</dx:ASPxGridView>
```
Is there any way calculate sub total of `Unit Price` column in Devexpress?
For this example; I just want total of `Unit Price` column (18 + 19 + 4.5 + 14 + 18 + 263.5 + 18 + 46 + 14 + 14 + 15 = `430`) in the bottom..
How can i do that?
| Calculate SubTotal in Devexpress Gridview | CC BY-SA 2.5 | 0 | 2011-03-20T19:41:18.147 | 2011-03-21T19:27:43.997 | null | null | 447,156 | [
"c#",
"asp.net",
"gridview",
"devexpress",
"aspxgridview"
]
|
5,371,055 | 1 | 5,371,814 | null | 1 | 254 | How can I create such a shape using the Drawing API?

where red means filled and white means not filled
| ActionScript 3.0 Drawing API question | CC BY-SA 2.5 | 0 | 2011-03-20T19:51:45.200 | 2011-03-20T21:59:42.010 | 2011-03-20T20:11:38.757 | 78,782 | 666,576 | [
"actionscript-3",
"drawing"
]
|
5,371,104 | 1 | 5,371,241 | null | 10 | 3,165 | > IOI 95The six basic layouts of four rectanglesFour rectangles are given. Find the smallest enclosing (new) rectangle into which these four may be fitted without overlapping. By smallest rectangle, we mean the one with the smallest area.All four rectangles should have their sides parallel to the corresponding sides of the enclosing rectangle. Figure 1 shows six ways to fit four rectangles together. These six are the only possible basic layouts, since any other layout can be obtained from a basic layout by rotation or reflection. Rectangles may be rotated 90 degrees during packing.There may exist several different enclosing rectangles fulfilling the requirements, all with the same area. You must produce all such enclosing rectangles.
Four lines, each containing two positive space-separated integers that represent the lengths of a rectangle's two sides. Each side of a rectangle is at least 1 and at most 50.
The output file contains one line more than the number of solutions. The first line contains a single integer: the minimum area of the enclosing rectangles. Each of the following lines contains one solution described by two numbers p and q with p<=q. These lines must be sorted in ascending order of p, and must all be different.
So this is the problem statement. I figured out that I want to try all 24*16 positions ( you can turn rectangle 90 degrees) against all these basic layouts and check the new area, however I have no idea how to implement this. Anything from some pseudo code to links to articles would help a lot. Thanks in advance.
| fitting rectangles in the smallest possible area | CC BY-SA 2.5 | 0 | 2011-03-20T19:59:37.200 | 2011-04-03T08:26:06.580 | 2011-03-20T20:08:00.110 | 50,476 | 555,479 | [
"algorithm"
]
|
5,371,137 | 1 | 5,371,470 | null | 0 | 514 | Attached is a screen shot from the iPhone Recipes Core Data source example.
I'm trying to recreate the display of the three horizontal lines in the UITableViewCellAccessory position during editing, but I can't see any UITableViewCellAccessory style that would create three horizontal lines. During editing, the source code sets the accessory style to UITableViewCellAccessoryStyleNone.
Can you give me a hint on how to create this effect?

| Create UITableViewCellAccessory during editing | CC BY-SA 2.5 | null | 2011-03-20T20:04:34.630 | 2011-03-20T21:01:53.583 | null | null | 79,271 | [
"iphone",
"uitableview"
]
|
5,371,257 | 1 | null | null | 0 | 1,347 | I'm trying to create a layout containing, among other things, a LinearLayout. The XML for the whole screen is:
```
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:id="@+id/fileSelView"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Spinner android:id="@+id/dirListSpinner"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"/>
<Spinner android:id="@+id/fileTypeSpinner"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"/>
<EditText android:id="@+id/fileNameTF"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_toRightOf="@+id/fileTypeSpinner"/>
<LinearLayout android:id="@+id/centerBox"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/dirListSpinner"
android:layout_above="@+id/fileTypeSpinner"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true">
<ListView android:id="@+id/dirView" android:background="#f00"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:layout_weight="1"/>
<RelativeLayout android:id="@+id/buttonBox" android:background="#0f0"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_weight="0">
<Button android:id="@+id/upButton"
android:text="Up"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"/>
<Button android:id="@+id/mkdirButton"
android:text="MkDir"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/upButton"
android:layout_centerHorizontal="true"/>
<Button android:id="@+id/okButton"
android:text="OK"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/mkdirButton"
android:layout_centerHorizontal="true"/>
<Button android:id="@+id/cancelButton"
android:text="Cancel"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/okButton"
android:layout_centerHorizontal="true"/>
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
```
The result of this layout looks like this:

The LinearLayout itself is laid out the way I want, within its parent, but its contents come out all wrong. It has two children: a ListView on the left and a RelativeLayout on the right. The ListView should take up all the available height, and as much width as possible, while the RelativeLayout should be a small as possible and vertically centered within its parent. Instead, the ListView ends up being way too narrow, and the RelativeLayout grows to fill the space, despite the ListView having android:layout_weight="1" and the RelativeLayout having android:layout_weight="0". Also, the RelativeLayout is aligned with the top of its parent, despite having android:gravity="center_vertical".
What am I doing wrong?
---
## UPDATE
OK, I changed android:gravity="center_vertical" to android:layout_gravity="center" on the RelativeLayout, and now it is vertically centered within its parent, as desired.
Regarding the layout weight issue, I tried changing android:layout_width="fill_parent" to android:layout_width="0px" on the ListView, but that didn't work; I'm getting the same result as before, with the ListView way too narrow and the RelativeLayout expanding to take up the available space.
The layout now looks like this: [http://thomasokken.com/layout-problem2.png](http://thomasokken.com/layout-problem2.png)
Note that the buttons in the RelativeLayout are not correctly centered horizontally. It's as if the RelativeLayout got sized and laid out correctly at first, and then grew towards the left later, without re-laying out its children.
I haven't been able to get the ListView to get sized properly using a RelativeLayout parent, either. Could it be resizing itself in response to a setAdapter() call? I'm using a custom ListAdapter class whose getView() method returns RelativeLayout objects:
```
public View getView(int position, View convertView, ViewGroup parent) {
File item = items[position];
if (convertView == null) {
Context context = parent.getContext();
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = inflater.inflate(R.layout.file_selection_dialog_row, null);
ImageView icon = (ImageView) convertView.findViewById(R.id.fdrowimage);
icon.setImageResource(item.isDirectory() ? R.drawable.folder : R.drawable.document);
}
TextView text = (TextView) convertView.findViewById(R.id.fdrowtext);
text.setText(item.getName());
return convertView;
}
```
The layout for the list rows looks like this:
```
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<ImageView android:id="@+id/fdrowimage"
android:layout_height="35dp" android:layout_width="wrap_content"
android:layout_alignParentLeft="true"
android:paddingRight="5dp" android:paddingLeft="3dp"/>
<TextView android:id="@+id/fdrowtext"
android:layout_width="wrap_content" android:layout_height="35dp"
android:layout_toRightOf="@+id/fdrowimage"
android:layout_alignTop="@+id/fdrowimage"
android:layout_alignBottom="@+id/fdrowimage"
android:gravity="center_vertical"
android:textSize="23dp"/>
</RelativeLayout>
```
| LinearLayout problem | CC BY-SA 2.5 | 0 | 2011-03-20T20:21:17.167 | 2012-07-18T18:19:25.477 | 2012-07-18T18:19:25.477 | 50,776 | 670,341 | [
"android",
"layout"
]
|
5,371,293 | 1 | null | null | 0 | 245 | I asked a very similar question to this one almost a month ago [here](https://stackoverflow.com/questions/5119050/help-parsing-a-string-potentially-using-regular-expressions).
I am trying very hard to understand regular expressions, but not a bit of it makes any sense. SLak's solution in that question worked well, but when I try to use the Regex Helper at [http://gskinner.com/RegExr/](http://gskinner.com/RegExr/) it only matches the first comma of `-2.2,1.1-6.9,2.3-12.8,2.3` when given the regex `,|(?<!^|,)(?=-)`
In other words I can't find a single regex tool that will even help me understand it. Well, enough whining. I'm now trying to re-write this regex so that I can do a Regex.Split() to split up the string `2.2 1.1-6.9,2.3-12.8 2.3` into `-2.2`, `1.1`, `-6.9`, `2.3`, `-12.8`, and `2.3`.
The difference the aforementioned question is that there can now be leading and/or trailing whitespace, and that whitespace can act as a delimiter as can a comma.
I tried using `\s|,|(?<!^|,)(?=-)` but this doesn't work. I tried using this to split `293.46701,72.238185`, but C# just tells me "the input string was not in a correct format". Please note that there is leading and trailing whitespace that SO does not display correctly.
EDIT: Here is the code which is executed, and the variables and values after execution of the code.

| Help writing a regular expression | CC BY-SA 2.5 | null | 2011-03-20T20:27:40.307 | 2011-03-20T21:57:02.123 | 2017-05-23T12:01:16.000 | -1 | 343,381 | [
"c#",
"regex"
]
|
5,371,310 | 1 | null | null | 0 | 432 | Right now im using one large centered image in my body tag.
First image is basically what the front page is going to be like. Looks great.

Second image has some content and pushes down the footer and the whole page. But still looks fine.

This last image has a lot of content and pushes everything down, even past the height of the body background image.

So my idea is too split up the background at the change of colour you see in the first image, where the footer starts, and add that as a background for the Footer DIV.
But the issue is that that part of the background goes on past the browser in the first image. If I were to put the BG in my footer DIV it would have to be 500px in height, resulting in scrollbars.
Essentially I want to put the the lower part of the background in my Footer DIV and have it act like the BODY, in that it won't create scrollbars.
I think that was clearer than my previous explanation? It's hard to explain!
| Trying to have get a div tag to extend to the bottom of the browser | CC BY-SA 2.5 | null | 2011-03-20T20:29:57.577 | 2011-03-27T06:15:55.383 | 2011-03-21T01:11:37.677 | 261,689 | 295,133 | [
"html",
"css"
]
|
5,371,311 | 1 | 5,380,311 | null | 1 | 2,388 | I have two browsers both running in Ubuntu 10.
Firefox 4 RC and Google Chrome 10. Both have very different representation of bold text. Please, see screenshot below - Chrome on top, Firefox below

Same browsers in Windows and in Mac OSx show no differences or at least very minor ones.
To rule out any CSS incompatibilities, I checked both styles applied and calculated values for font-weight, size, letter spacing and line height. They all match.
Strange enough text (including this one) that is not bold look exactly the same.
The font used is , it is attached as web font.
My question is how do web browsers generate bold text? Why is that dependent on font used and how to work around it? Using other font is not an option, unfortunately.
EDIT: This is the CSS that apply to the text as requested:
```
text-align: right;
font-size: 110%;
font-weight: bold;
font-style: normal;
white-space: nowrap;
font-family: "Monotype Corsiva","mntcrsweb",sans-serif;
letter-spacing: 0.02em;
line-height: 100%;
text-shadow: -0.1em -0.06em 0.2em #000000;
font-size: 180%;
direction: ltr;
font-size: 10px;
line-height: 125%;
```
| Bold text looks very different in different web browsers | CC BY-SA 2.5 | null | 2011-03-20T20:30:03.073 | 2011-03-21T16:05:48.133 | 2011-03-20T20:39:07.073 | 427,205 | 427,205 | [
"css",
"fonts",
"cross-browser",
"typography"
]
|
5,371,306 | 1 | 5,371,399 | null | 0 | 3,520 | I'm trying to make a html/css based poker program and at the moment im trying to figure out how I am going to put the chips on the table or move my chat window on table.
my code is in index.html
```
<body>
<div id="content">
<div id="table">
<div id="boardImage"><img src="./img/poker_table_new.png" /></div>
</div>
<div id="chat">
<textarea id="chatBox"></textarea>
<input id="message" type="text">
<input id="sendButton" type="submit" value="Send">
</div>
</div>
```
and in CSS
```
#content {
position:relative;
z-index:-1;
}
#table {
position:inherit;
z-index:-1;
}
#chat {
z-index:2;
position:inherit;
left:500px;
}
#boardImage {
position:inherit;
z-index:-1;
}
#chatBox {
position:inherit;
z-index:2;
width: 300px;
height: 300px;
}
```
and basically im trying to move the chatbox on my table picture, but it is not moving on top of it.
im not sure if i should use position relative for my poker program? or am i using the z-index correctly? must i put the z-index for all the divs?
at the moment there is a poker table on top of the html and when i scroll down, there is my chatbox, but they should be on eachother.
do i have too much same code? too much writing z-index? and positioning for my poker program, must i move everything with pixels and which would be the best positioning way to go? later on i must start moving chips and cards on table etc.
picture: 
| HTML z-index and positioning | CC BY-SA 2.5 | null | 2011-03-20T20:28:49.497 | 2011-03-21T10:46:54.440 | 2011-03-21T10:46:54.440 | 625,189 | 625,189 | [
"html",
"css",
"positioning",
"z-index"
]
|
5,371,869 | 1 | null | null | 25 | 3,032 | While the bounty is no longer available, I'm still keen for anyone with an answer to this question to contribute; I'm still watching it, and I'm waiting to see if there is a better answer. Thanks, and please read on...
---
I am looking for a way to convert an arbitrary set of [RCC](http://en.wikipedia.org/wiki/Region_connection_calculus)-like spatial relations (or similar) describing a constraint network into Venn-diagram-like images. For example, the constraint network as expressed in RCC8:
`W {EC} Y`, `X {TPP} Y`, `Z {NTPP} Y`, `Z {PO} X`.
..could be represented by the following diagram with circular or square regions:
 ..alternatively: 
Is anyone aware of software that can at least generate such diagrams programmatically (via an API) from a specification of RCC-like constraints?
I am aware that such a constraint network could be underspecified, precluding a match to any single such diagram (many solutions may exist). Ideally, I would like to deal with this by being able to generate possible alternatives, but can resort to none (and raising an error) for now.
Just to be clear, in this question I am specifically asking for software which can calculate a based on RCC-like constraints in a . I am not concerned with tools to turn a DSL for RCC into some other syntax, nor am I interested in particular image serialization formats or methods. I am hoping to find an algorithm to do this for dealing with an arbitrary number of constraints for up to six unique sets.
[Graphviz](http://www.graphviz.org/) (as @vickirk mentioned below) is an example of a , which is akin to what I'm after. Unfortunately, it seems that Graphviz itself cannot help with this problem (but I'd be very happy to be proven wrong!). It seems this is a very hard problem.
| Venn diagram generation software from RCC(8) specification or similar | CC BY-SA 3.0 | 0 | 2011-03-20T22:08:03.590 | 2014-09-04T02:51:51.033 | 2014-09-04T02:51:51.033 | null | null | [
"java",
"algorithm",
"language-agnostic",
"visualization",
"venn-diagram"
]
|
5,372,053 | 1 | 5,374,826 | null | 10 | 7,450 | I have installed the sp1 for visual studio 2010 and installed sql server ce 4 runtime. But still not able to create connection to the sql ce database using standart data provider.
This is how my Select DataProvider Dialog looks like now.

P.S.
Does not know if it matters, but I have tested this with console application and winforms application both targeted at .Net 4.0
| SQL Server CE 4 DataProvider not available in server explorer | CC BY-SA 4.0 | 0 | 2011-03-20T22:39:58.723 | 2018-09-24T15:17:42.057 | 2018-09-24T15:17:42.057 | 1,033,581 | 493,344 | [
"c#",
"visual-studio-2010",
"dataprovider",
"sql-server-ce"
]
|
5,372,140 | 1 | 5,373,228 | null | 2 | 2,285 | Hey guys, I've been playing around with WPF's Path shape, but I'm a bit annoyed with some behaviour.
Specifically, the path does not size itself as I would like. If you look at the image below, what I want is for the entire path to be within the white square (which represents the bounds of the Path control), but the arcs hang out a bit. I think this is because Path sizes itself according to the points used to draw the shape, and not according to the shape that is actually drawn.
My question is: does anyone know how to overcome this? I mean, aside from explicitly setting the dimensions of the path. Is there some option that I have overlooked in order to get the path to size itself according to the shape, and not according to the points used to make the shape? Thanks for any answers.
 
---
Here's two versions of (what should be) equivalent code:
1) First, using databindings (written out in a very verbose manner):
```
<UserControl x:Class="OrbitTrapWpf.LineSegmentTool"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:OrbitTrapWpf"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300"
x:Name="Root" Background="White">
<UserControl.Resources>
<local:ArcSizeConverter x:Key="ArcSizeConverter"/>
<local:ArcPointConverter x:Key="ArcPointConverter"/>
</UserControl.Resources>
<Path Name="path" Stroke="Black">
<Path.Data>
<PathGeometry>
<PathGeometry.Figures>
<PathFigureCollection>
<PathFigure IsClosed="True">
<PathFigure.StartPoint>
<Binding ElementName="Root" Path="point0"></Binding>
</PathFigure.StartPoint>
<PathFigure.Segments>
<PathSegmentCollection>
<ArcSegment SweepDirection="Counterclockwise" >
<ArcSegment.Size>
<Binding ElementName="Root" Path="Radius" Converter="{StaticResource ArcSizeConverter}"/>
</ArcSegment.Size>
<ArcSegment.Point>
<Binding ElementName="Root" Path="point1" />
</ArcSegment.Point>
</ArcSegment>
<LineSegment>
<LineSegment.Point>
<Binding ElementName="Root" Path="point2" />
</LineSegment.Point>
</LineSegment>
<ArcSegment SweepDirection="Counterclockwise">
<ArcSegment.Size>
<Binding ElementName="Root" Path="Radius" Converter="{StaticResource ArcSizeConverter}"/>
</ArcSegment.Size>
<ArcSegment.Point>
<Binding ElementName="Root" Path="point3" />
</ArcSegment.Point>
</ArcSegment>
</PathSegmentCollection>
</PathFigure.Segments>
</PathFigure>
</PathFigureCollection>
</PathGeometry.Figures>
</PathGeometry>
</Path.Data>
</Path>
```
2) And this one, using the mini-language:
```
<UserControl x:Class="OrbitTrapWpf.LineSegmentTool"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:OrbitTrapWpf"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300"
x:Name="Root" Background="White">
<UserControl.Resources>
<local:ArcSizeConverter x:Key="ArcSizeConverter"/>
<local:ArcPointConverter x:Key="ArcPointConverter"/>
</UserControl.Resources>
<Grid Name="grid">
<Path Name="path" Stroke="Black" Data="M 0.146446609406726,1.14644660940673 A 0.5,0.5 0 1 0 0.853553390593274,1.85355339059327 L 1.85355339059327,0.853553390593274 A 0.5,0.5 0 1 0 1.14644660940673,0.146446609406726 Z " />
```
I thought that the two should be roughly the same, but apparently the mini-language version sizes nearly correctly, while the original is much different.
| WPF Path sizing problem | CC BY-SA 2.5 | 0 | 2011-03-20T22:56:59.950 | 2017-02-22T16:49:50.683 | 2011-03-20T23:13:21.613 | 616,815 | 616,815 | [
"wpf",
"path",
"size",
"shapes"
]
|
5,372,195 | 1 | 5,372,474 | null | 3 | 5,078 | I am creating a simple Mahjong game for a final project at school and seem to be having some troubles with the `drawString()` method on the Graphics/Graphics2D object. I call the `drawString` method and see nothing written to the screen.
In my scenario I have extended the `JFrame` class and overridden the `paintComponent()` method to create a custom graphical object, specifically a mahjong tile. Using polygons described in various arrays I create a faux 3D view of a tile drawing the face, right side, and bottom of the tile. These polygons are filled using `GradientPaint` objects to give the tile a better appearance. Here is what it looks like:

My `Tile` class looks like this (note: some code was omitted for brevity):
```
public class Tile extends JPanel
{
private int _width;
private int _height;
private int _depth;
/**
* Accessor to get the center of the face of the rendered
* mahjong tile.
*
* @return A point containing the center of the face of the tile.
*/
public Point getCenter()
{
return new Point(_width / 2, _height / 2);
}
/**
* The default constructor creates a tile that is proportionally
* calculated to 80 pixels wide.
*/
public Tile()
{
this(80);
}
/**
* Given the width parameter a mahjong tile is drawn according to
* the proportions of a size 8 mahjong tile.
*
* @param width The width of the tile to be rendered.
*/
public Tile(int width)
{
_width = width;
_height = (int)(width * 1.23);
_depth = (int)((width * 0.3) / 2);
setPreferredSize(new Dimension((_width + _depth) + 1, (_height + _depth) + 1));
}
@Override public void paintComponent(Graphics g)
{
// ... setup polygon arrays ...
super.paintComponent(g);
Graphics2D g2d = (Graphics2D)g;
// Turn on anti-aliasing.
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
// ... setup various gradients ...
// Fill the face of the tile.
g2d.setPaint(faceGradient);
g2d.fillPolygon(faceXPolyPoints, faceYPolyPoints, faceXPolyPoints.length);
// Fill the right side of the top portion of the tile.
g2d.setPaint(ivoryRightSideGradient);
g2d.fillPolygon(ivoryRightSideXPolyPoints, ivoryRightSideYPolyPoints, ivoryRightSideXPolyPoints.length);
// Fill the bottom side of the top portion of the tile.
g2d.setPaint(ivoryBottomGradient);
g2d.fillPolygon(ivoryBottomXPolyPoints, ivoryBottomYPolyPoints, ivoryBottomXPolyPoints.length);
// Fill the right side of the bottom portion of the tile.
g2d.setPaint(jadeRightSideGradient);
g2d.fillPolygon(jadeRightSideXPolyPoints, jadeRightSideYPolyPoints, jadeRightSideXPolyPoints.length);
// Fill the bottom side of the bottom portion of the tile.
g2d.setPaint(jadeBottomGradient);
g2d.fillPolygon(jadeBottomXPolyPoints, jadeBottomYPolyPoints, jadeBottomXPolyPoints.length);
// Draw the outlines for the tile.
g2d.setPaint(Color.BLACK);
g2d.drawPolygon(faceXPolyPoints, faceYPolyPoints, faceXPolyPoints.length);
g2d.drawPolygon(ivoryRightSideXPolyPoints, ivoryRightSideYPolyPoints, ivoryRightSideXPolyPoints.length);
g2d.drawPolygon(ivoryBottomXPolyPoints, ivoryBottomYPolyPoints, ivoryBottomXPolyPoints.length);
g2d.drawPolygon(jadeBottomXPolyPoints, jadeBottomYPolyPoints, jadeBottomXPolyPoints.length);
g2d.drawPolygon(jadeRightSideXPolyPoints, jadeRightSideYPolyPoints, jadeRightSideXPolyPoints.length);
}
}
```
As you may know, there are many different types of mahjong tiles one being a character tile that displays various Chinese characters on the tile face. So my `Tile` class sets up the basic drawing of a tile and I create a new `CharacterTile` class that extends/inherits the `Tile` class. The code for that class follows:
```
public class CharacterTile extends Tile
{
private Character _character;
public CharacterTile(Character character)
{
super();
_character = character;
}
@Override public void paintComponent(Graphics g)
{
super.paintComponent(g);
Graphics2D g2d = (Graphics2D)g;
String charToWrite;
switch (_character)
{
case ONE:
charToWrite = "\u4E00";
break;
case TWO:
charToWrite = "\u4E8C";
break;
case THREE:
charToWrite = "\u4E09";
break;
case FOUR:
charToWrite = "\u56DB";
break;
case FIVE:
charToWrite = "\u4E94";
break;
case SIX:
charToWrite = "\u516D";
break;
case SEVEN:
charToWrite = "\u4E03";
break;
case EIGHT:
charToWrite = "\u516B";
break;
case NINE:
charToWrite = "\u4E5D";
break;
case NORTH:
charToWrite = "\u5317";
break;
case EAST:
charToWrite = "\u6771";
break;
case WEST:
charToWrite = "\u897F";
break;
case SOUTH:
charToWrite = "\u5357";
break;
case RED:
charToWrite = "\u4E2D";
break;
case GREEN:
charToWrite = "\u767C";
break;
case WAN:
charToWrite = "\u842C";
break;
default:
charToWrite = "?";
break;
}
g2d.drawString(charToWrite, 0, 0);
}
}
```
As you can see the default constructor for the `CharacterTile` class accepts an `enum` indicating the desired face value. Inside the overridden `paintComponent` I have a switch statement that sets the appropriate character to write and then I call the `g2d.drawString()` method to write the character in the upper left corner. The problem? It doesn't write anything. What am I doing wrong?
| Graphics.drawString() Isn't Drawing | CC BY-SA 2.5 | null | 2011-03-20T23:05:43.413 | 2011-03-21T02:35:40.513 | null | null | 2,220 | [
"java",
"awt"
]
|
5,372,403 | 1 | 5,372,441 | null | 0 | 111 | Suppose I have 3 sensors: `sensor1`, `sensor2` and `sensor3`.
The only variables I know are:
```
Distance from sensor1 to origin is 36.05
Distance from sensor2 to origin is 62.00
Distance from sensor3 to origin is 63.19
Distance from sensor1 to sensor2 is 61.03
Distance from sensor1 to sensor3 is 90.07
Distance from sensor2 to sensor3 is 59.50
```
This is how it would look like if you had the positions:

How can I calculate the position of every point using only those variables?
This is not homework, just curiosity.
| How to calculate where each sensor is when I have only few variables | CC BY-SA 2.5 | null | 2011-03-20T23:38:01.047 | 2011-03-25T08:25:38.270 | null | null | null | [
"language-agnostic",
"math",
"geometry"
]
|
5,372,454 | 1 | null | null | 1 | 701 | This test works locally, but when run from the Play test runner on our aws ci instance, I get the following permissions error in Firefox: Permission denied for HOST to get property Location.href and then Command execution error.

In Chrome, the remote message is different, but I sense the same underlying reason. Object <> has no method 'getCurrentWindow'.

Is it this issue? [http://code.google.com/p/selenium/issues/detail?id=703](http://code.google.com/p/selenium/issues/detail?id=703)
| Playframework test-runner selenium permission denied Location.href and Command Execution Failure | CC BY-SA 2.5 | 0 | 2011-03-20T23:47:57.773 | 2011-03-21T16:15:32.640 | 2011-03-21T16:15:32.640 | 124,563 | 124,563 | [
"permissions",
"selenium",
"playframework",
"test-runner"
]
|
5,372,494 | 1 | 5,499,132 | null | 4 | 703 | consider the red line to be given as a sequence of points

I'm looking for an algorithm to create the outlines of the thick black shape (also as a sequence of points) such that they are ordered cleanly. And the outline should also respect a minimum distance to itself.
What algorithm can I use to achieve this?
| outline vectorshape algorithm | CC BY-SA 2.5 | null | 2011-03-20T23:56:22.167 | 2011-03-31T11:37:56.023 | 2011-03-21T00:03:25.777 | 666,576 | 666,576 | [
"algorithm",
"vector-graphics"
]
|
5,372,572 | 1 | 5,374,734 | null | 1 | 1,406 | I am having trouble with foreign keys Dynamic Data and entity framework 4.0. It feels like there is a problem with the entity association but I am not sure. I have multiple fields representing the foreign key on the insert page. When I try and insert data I get an error A dependent property in a ReferentialConstraint is mapped to a store-generated column.
Column: 'CommentId'
My data is a very basic one to many relationship, the foreign key in question is BookId in the Comment Table.
Books
- -
Comments
- - - -
I create the FOREIGN KEY with the following sql script.
```
ALTER TABLE [dbo].[Comments] WITH CHECK ADD CONSTRAINT [FK_Comments_Books] FOREIGN KEY([CommentId])
REFERENCES [dbo].[Books] ([BookId])
```
Entity Framework Generates the following XML
```
<EntityType Name="Books">
<Key>
<PropertyRef Name="BookId" />
</Key>
<Property Name="BookId" Type="int" Nullable="false" StoreGeneratedPattern="Identity" />
<Property Name="Title" Type="nvarchar" Nullable="false" MaxLength="255" />
<Property Name="Description" Type="nvarchar" Nullable="false" MaxLength="2000" />
<Property Name="Abstract" Type="nvarchar" />
<Property Name="UserName" Type="nvarchar" Nullable="false" MaxLength="255" />
<Property Name="Image" Type="varbinary(max)" />
<Property Name="BookContent" Type="varbinary(max)" />
<Property Name="rowguid" Type="uniqueidentifier" Nullable="false" />
<Property Name="CreateDate" Type="datetime" />
<Property Name="ModifiedDate" Type="datetime" />
</EntityType>
<EntityType Name="Comments">
<Key>
<PropertyRef Name="CommentId" />
</Key>
<Property Name="CommentId" Type="int" Nullable="false" StoreGeneratedPattern="Identity" />
<Property Name="UserName" Type="nvarchar" Nullable="false" MaxLength="255" />
<Property Name="UserComment" Type="nvarchar" Nullable="false" />
<Property Name="BookId" Type="int" Nullable="false" />
</EntityType>
<Association Name="FK_Comments_Books">
<End Role="Books" Type="BookStoreModel.Store.Books" Multiplicity="1" />
<End Role="Comments" Type="BookStoreModel.Store.Comments" Multiplicity="0..1" />
<ReferentialConstraint>
<Principal Role="Books">
<PropertyRef Name="BookId" />
</Principal>
<Dependent Role="Comments">
<PropertyRef Name="CommentId" />
</Dependent>
</ReferentialConstraint>
</Association>
```
When I let the scaffolding do its thing, I get multiple fields representing the foreign key

| How do you insert foreign keys with Dynamic Data | CC BY-SA 2.5 | null | 2011-03-21T00:11:51.410 | 2011-03-21T07:05:11.687 | null | null | 57,263 | [
"asp.net",
"entity-framework-4",
"asp.net-dynamic-data"
]
|
5,372,586 | 1 | 5,373,449 | null | 5 | 3,502 | Delphi 2006's TImage doesn't quite support PNGs. In order to have images with alpha transparency on my forms I have to load them at run-time. I can load them at design time but they don't survive, I think because PNGs are not saved in the DFM file. I'm sure this is all hunky-dory in the latest Delphi but I can't upgrade right at the moment.
Anyway, I was loading them at run-time with:
```
Image1.Picture.Assign (PngImageCollection1.Items [0].PNGImage) ;
```
The PNGImageCollection component holds all my PNGs of various sizes (these are created and loaded at design-time), and I assign them to the respective TImages in the FormCreate event.
This has worked OK, until I had a problem where I was trying to reuse one of these images somewhere else after it had been used on a form. I discovered that the act of assigning the TPicture had set it to an empty image as a result of the Assign. This was happening in the routine TPicture.ForceType, which AFAICT checks the type of FGraphic, and if it is not the desired type, it frees FGraphic and creates a new instance of the requested type.
OK. So after a bit of scratching around, I see that maybe I should really be doing this:
```
Image1.Picture.Bitmap.Assign (PngImageCollection1.Items [0].PNGImage) ;
```
This did the trick, in that the Assign did not clobber the image, but the image now shows with the semi-transparent bits as opaque, i.e.:

instead of:

How can I get this image to display the alpha-transparent bits properly? (and supplementary question: Is Image1.Picture.Bitmap.Assign the correct way to do it?).
Here's the code in a bit more detail:
In the code where I had the problem "reusing" a TImage, the sequence was:
On form create:
```
LogoImage.Picture.Assign (PngImageCollection1.Items [0].PNGImage) ;
```
(PNGIMage is a company logo, LogoImage1 is on the main form).
On print report header:
```
procedure PrintLogo (Report : TBaseReport) ;
var
X1, Y1, LogoHeightMM : Double ;
begin
with Report do
begin
LogoHeightMM := CalcGraphicHeight (LogoWidthMM, MainForm.LogoImage.Picture.Graphic) ;
X1 := PageWidth - MarginRight - LogoWidthMM ;
Y1 := SectionBottom - LogoHeightMM ;
PrintBitmapRect (X1, Y1, X1 + LogoWidthMM, Y1 + LogoHeightMM, MainForm.LogoImage.Picture.Bitmap) ;
end ;
end ;
```
The first time the routine to print the logo is called it executes without error, but the LogoImage .Picture is left cleared after the call to PrintBitmapRect. The next time the print header routine is called, the call to CalcGraphicHeight fails because the width and height of the image are zero.
Changing the Picture.Assign to a Picture.Bitmap.Assign fixes the RTE in the header print routine, but when I transplanted the same "fix" to other static images assigned from PNGs (like the gears above) I lost the aplha channel.
| Delphi 2006: Run-time assignment of PNG to TImage loses alpha transparency | CC BY-SA 2.5 | 0 | 2011-03-21T00:14:47.750 | 2011-03-21T05:22:57.757 | 2020-06-20T09:12:55.060 | -1 | 89,691 | [
"delphi",
"png",
"delphi-2006",
"timage",
"alpha-transparency"
]
|
5,372,676 | 1 | 5,374,037 | null | 0 | 2,493 | This may have a simple solution which I haven't found yet. but here's the situation.
I have a data in Excel sheet: 
This is a log file generated from simulations. The simulation is run tens of times (variable) and each run generates one block starting at "-------------------" and ending before the next "-----------------" divider. The number of rows between these dividers is variable but certain things are fixed. the number and order of columns and the first row & cell being the divider, the next row in the same column having date stamp, the next row having column headings. the divider and date stamp are contained in only 1 cell.
What I need to do is mind the MAX of CNT & SIM_TIME for each simulation run. I will then take the average of these. I only need to do this for the "Floor 1" table from the screenshot.
What's the best way to proceed? which functions should I use? (I have Office 2010 if that has new functions not present in 2007)
| find max of a repeating dynamic range in Excel | CC BY-SA 2.5 | null | 2011-03-21T00:33:03.863 | 2013-05-25T00:02:29.687 | 2011-03-21T00:37:54.037 | 23,897 | 354,502 | [
"excel"
]
|
5,372,992 | 1 | 5,384,827 | null | 0 | 533 | I'm using [this sample](http://blogs.msdn.com/b/atc_avalon_team/archive/2006/03/01/541206.aspx) to create a multi-column tree view and I've noticed that scrolling no longer works correctly for this list view:

After some playing around I've discovered that the bit that is breaking the scrollbars is the setting of the "Template" property for the TreeListView:
```
<Style TargetType="{x:Type l:TreeListView}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type l:TreeListView}">
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
<DockPanel>
<GridViewHeaderRowPresenter Columns="{StaticResource gvcc}" DockPanel.Dock="Top"/>
<ItemsPresenter/>
</DockPanel>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
```
Commenting out the above fixes the scrollbars (however obviously means that the grid column headers are not shown). In fact I've discovered that even the following template breaks the scrollbars:
```
<Style TargetType="{x:Type l:TreeListView}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type l:TreeListView}">
<ItemsPresenter/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
```
Why is this?
| Why does setting the "Template" property in a style breaking scrolling? | CC BY-SA 2.5 | null | 2011-03-21T01:32:15.587 | 2011-11-04T20:44:59.697 | 2011-08-12T17:52:03.457 | 305,637 | 113,141 | [
"wpf",
"scrollbar",
"styles"
]
|
5,373,052 | 1 | 5,373,087 | null | -1 | 353 | 
When I remove 41 and 42 lines, Elapsed time is "00:00:03.13". The "com_site" table aliased as [c] has no index or PK.
Result records count is 5503(20 records before removing.)
Could anyone explain me why this happens?
Thanks...
| Elapsed time of SQL | CC BY-SA 2.5 | null | 2011-03-21T01:45:04.457 | 2011-03-21T01:54:34.947 | 2011-03-21T01:46:48.730 | 135,152 | 206,698 | [
"sql",
"oracle"
]
|
5,373,329 | 1 | null | null | 6 | 2,480 |
## Context: Favicons
I am writing a WordPress plugin to download favicons and also convert them to png:
 [http://plugins.trac.wordpress.org/browser/wp-favicons/trunk](http://plugins.trac.wordpress.org/browser/wp-favicons/trunk) ( GPL2)
## Icon Lib
- - - [http://www.phpclasses.org/package/2369-PHP-Extract-graphics-from-ico-files-into-PNG-images.html](http://www.phpclasses.org/package/2369-PHP-Extract-graphics-from-ico-files-into-PNG-images.html)
## Problem
In 1 out of 5.000 icons (the others work ok...) a problem occurs with the XOR functionality. See line 296 here:  [http://plugins.trac.wordpress.org/browser/wp-favicons/trunk/plugins/filters/inc/class.ico.php](http://plugins.trac.wordpress.org/browser/wp-favicons/trunk/plugins/filters/inc/class.ico.php) (Notice: Uninitialized string offset: 64) So the string expected is too small.
## Example
An example is this icon: [click here to see](http://www.slatch.com/media/bcr.ICO) (navigates to slatch.com)
## Question
Does anybody know how to fix this? OR knows another good PHP Icon Class that lets me read .ico (all sorts of) via get_as_string instead of get_from_file which is better?
## PS
I already read:
- [How to convert .ICO to .PNG?](https://stackoverflow.com/questions/37590/how-to-convert-ico-to-png)- [Convert png file to ico with PHP](https://stackoverflow.com/questions/2628114/convert-png-file-to-ico-with-php)- [Favicon to PNG in PHP](https://stackoverflow.com/questions/4584895/favicon-to-png-in-php/5373239)
| Issue converting ICO to PNG using PHP | CC BY-SA 3.0 | 0 | 2011-03-21T02:45:22.663 | 2017-01-22T10:23:13.127 | 2017-05-23T12:17:04.057 | -1 | 121,626 | [
"php",
"png",
"favicon",
"ico"
]
|
5,373,535 | 1 | 5,373,573 | null | 3 | 4,743 | I would like tot give my `Print this Page` button a special magical property sothat it automatically enabled the by default unset property (see picture) namely to Do Print the Backgrounds of div colors and bg images etc.
```
<a href="#" onclick="javascript:window.print()"><? echo __('Print'); ?></a>
```
Clues, ideas, code, answers or suggestions as answers are all tremmendously welcome and I a will appreciate any hints at all for this dream to come true. Thanks in advance.

| Supplementary properties/settings for JavaScript:window.print() to enable Backgrounds by default | CC BY-SA 2.5 | 0 | 2011-03-21T03:28:32.757 | 2013-06-07T20:59:42.977 | null | null | 509,670 | [
"javascript",
"jquery",
"printing",
"colors",
"background"
]
|
5,373,612 | 1 | 5,377,671 | null | 1 | 1,580 | I need to make a legacy application start using spring security 3.
This app already has its security data model with:

Very simple by far. I can write my custom `usersByUsernameQuery` and `authoritiesByUsernameQuery`.
The thing is that there is another table indicating the (i.e. `@Service` layer method) that a Role can execute:

So the administrator can enable/disable a role from accessing an operation through a web interface, without redeploying the app.
I still can annotate the business methods with `@Secure('ROLE_ADMIN')` for example, but my custom `UserDetailsService` must know at least the method name that is being secured, so I can perform the right query.
So, the question is: is there a way that my custom `UserDetailsService` can intercept the method's name that is being secured?
| Spring Security: custom authorities by operation | CC BY-SA 2.5 | null | 2011-03-21T03:44:27.520 | 2011-03-21T12:37:41.230 | 2011-03-21T10:59:20.367 | 21,234 | 468,508 | [
"java",
"jdbc",
"spring-security",
"legacy"
]
|
5,373,922 | 1 | 5,588,923 | null | 0 | 245 | this is my first post here , I am trying to achive something in pyqt , I have a control placed in a widget and when user is selecting that control , i need a selection border something similer pyqt designer has , I am attching a image for refrenct .
Anybody has any idea how I can aachive this with pyqt ?
Thanks

| Control Selection Border in PyQT | CC BY-SA 3.0 | null | 2011-03-21T04:48:26.820 | 2011-11-28T21:14:53.663 | 2011-11-28T21:14:53.663 | 234,976 | 503,888 | [
"python",
"widget",
"pyqt4"
]
|
5,374,364 | 1 | 5,374,406 | null | 1 | 113 | i am displaying array of data in a table view.
my code for that is like this.
```
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
}
// Set up the cell
CGRect labelFrame = CGRectMake(0,0 , 100, 25);
itemNameLabel = [[[UILabel alloc] initWithFrame:labelFrame] autorelease];
itemNameLabel.textAlignment = UITextAlignmentLeft;
itemNameLabel.backgroundColor = [UIColor clearColor];
itemNameLabel.text = [tableData objectAtIndex:indexPath.row];
CGRect anotherLabelFrame = CGRectMake(120, 0, 100, 25);
quantityLabel = [[[UILabel alloc] initWithFrame:anotherLabelFrame] autorelease];
quantityLabel.textAlignment = UITextAlignmentLeft;
quantityLabel.backgroundColor = [UIColor clearColor];
MyGroceryListAppDelegate *appDelegate = (MyGroceryListAppDelegate *)[[UIApplication sharedApplication] delegate];
Category *obj = (Category *)[appDelegate.itemsList objectAtIndex:indexPath.row];
quantityLabel.text = [NSString stringWithFormat:@"%d",obj.quantity];
[cell.contentView addSubview:itemNameLabel];
[cell.contentView addSubview:quantityLabel];
return cell;
}
```
how can i resolve this.
can any one please help me.
Thank u in advance.
i am giving text for itemNameLabel is using array and for quantityLabel using class object.
so,when i scrolling table view the array names are override on other label,but quantity label is not overriding because it is from class.
i need to display itemNameLabel from array since it changes it value.
when i scroll table view my tableview is looking like this.
| tableview text over ride with previous text | CC BY-SA 2.5 | null | 2011-03-21T06:07:53.723 | 2011-03-21T06:17:19.687 | null | null | 699,226 | [
"iphone"
]
|
5,374,426 | 1 | 5,374,709 | null | 0 | 165 | I've a ListView with two columns and i'm filling the ListView using the code below
```
ListViewItem[] l_lvItem = Enumerable.Range(0, 10).Select(X => new ListViewItem(new String[] {X.ToString(),(X+1).ToString() })).ToArray();
listView1.Items.AddRange(l_lvItem);
```
Here is the output of the above code

But the need like

I've enabled the `Checkboxes` property of my listView. But i cannot change the checked property of the each item using the above code.
Using `for/foreach` loop i can change the property,
but just need to a simple way .
Please help me to modify/rewrite my above code.
Thanks in advance.
| How to change the checked property of ListViewItem? | CC BY-SA 2.5 | null | 2011-03-21T06:17:05.213 | 2011-03-21T07:00:57.037 | null | null | 336,940 | [
"c#",
"listview",
"lambda"
]
|
5,374,821 | 1 | null | null | 0 | 256 | Please tell me how to add a date field to a screen
It will be in the format of choose from  that box will be button in which after sl
| Blackberry Date Field help | CC BY-SA 2.5 | null | 2011-03-21T07:18:54.080 | 2011-03-22T01:39:10.340 | 2011-03-21T13:55:19.357 | 75,204 | 669,005 | [
"blackberry",
"java-me"
]
|
5,374,996 | 1 | 5,377,129 | null | 2 | 1,635 | I'm having trouble with a class project consisting, among other things, of modeling (using merise) a database for an app-store like. I've come to the point where I have an entity-relationship model that really suits me and seem to fit the constraints of the subject.
On this modeling, I'm using inheritance to mark the difference between and app, and an add-on, both of which have common characteristics. In fact, they have the perfect same characteristics, but they are subject to different associations.
Here is a screenshot that might help you understand:

I was hoping to make `Software` a view, and `App` and `AddOn` tables, supposing the latter two won't have entries with the same id. But I don't know how to do that, and maybe this isn't the right way to do it, so I'm open to suggestions.
I hope I was clear enough, if not, don't hesitate to ask me to be more precise.
Thanks for reading!
| Implementing inheritance in SQL | CC BY-SA 2.5 | null | 2011-03-21T07:46:16.177 | 2011-03-21T11:43:14.430 | 2011-03-21T09:52:39.733 | 297,408 | 669,020 | [
"mysql",
"sql"
]
|
5,375,165 | 1 | 5,375,235 | null | 1 | 384 | 
In an ecommerce site, I would like to display number of items in a row according to browser width, but minimum will be 4 items. Just like what has been done in Amozon site, if you try to browse amozon.com, try to maximize and shrink your browser, you will find that number of items display in [More Items to Consider] section is according to your browser size. It is smart enough to know when it should fully hide or show an item, no partially visible item forever.
Anyone know what is this technology called? Any idea how this can be done? Thanks in advance.
| How to dynamically show number of products in a row according to browser size? | CC BY-SA 2.5 | null | 2011-03-21T08:08:42.987 | 2011-03-21T08:23:19.353 | null | null | 278,410 | [
"css",
"layout"
]
|
5,375,282 | 1 | null | null | 2 | 813 | I created a custom control similar to TabControl. It works nice, except that the text in header items gets blury when I resize the content. It can, for example look like this:

Not only the text, but the box around the text can also get non-vertical. See the blue border around the "General" item:

What is causing this problem? I have set SnapToDevicePixels = True.
Thanks for any ideas!
:
I'm using .NET 4.0. TextOptions.TextFormattingMode is set to "Display".
The whole problem with fuzzy text and background occurs if I apply a DropShadowEffect effect in the style for ItemsControl which displays the buttons. This is the code for the Effect:
```
<Setter Property="Effect">
<Setter.Value>
<DropShadowEffect Direction="0" ShadowDepth="1" BlurRadius="10" Opacity="0.2" Color="Black" />
</Setter.Value>
</Setter>
```
If this code is not enabled, the the text and the borders get displayed nicely.
| WPF Text rendering problem | CC BY-SA 2.5 | 0 | 2011-03-21T08:25:01.693 | 2011-03-21T09:31:08.073 | 2011-03-21T09:31:08.073 | 300,696 | 300,696 | [
"wpf",
"text",
"rendering"
]
|
5,375,350 | 1 | 5,453,189 | null | 27 | 13,469 | I have a UITextView where the user can create notes and save into a plist file.
I want to be able to show lines just like a normal notebook. The problem I have is
that the text won't align properly.
The image below explains the problem quite well.

This is the background I use to create the lines like the Notes.app

This is my code for creating the background for my `UITextView`:
```
textView.font = [UIFont fontWithName:@"MarkerFelt-Thin" size:19.0];
textView.backgroundColor = [UIColor colorWithPatternImage: [UIImage imageNamed: @"Notes.png"]];
```
I know that the `UIFont.lineHeight` property is only available in > iOS 4.x.
So I wonder if there is another solution to my problem?
| UITextView ruled line background but wrong line height | CC BY-SA 3.0 | 0 | 2011-03-21T08:36:20.713 | 2014-04-01T06:28:40.613 | 2014-04-01T06:27:06.017 | 850,848 | 447,419 | [
"iphone",
"objective-c",
"uitextview"
]
|
5,375,565 | 1 | 5,382,078 | null | 0 | 218 | whats wrong with my code. when it tries to overwrite an existing .xps file, error pops.

Here's my code
```
string filename = dlg.FileName;
XpsDocument xpsDoc = new XpsDocument(filename, FileAccess.ReadWrite);
XpsDocumentWriter xpsWriter = XpsDocument.CreateXpsDocumentWriter(xpsDoc);
FlowDocument flow = (((((chatHistoryPage.LayoutRoot as Grid).Children[7] as ContentControl).Content) as FlowDocumentPageViewer).Document as FlowDocument);
xpsWriter.Write((flow as IDocumentPaginatorSource).DocumentPaginator);
xpsDoc.Close();
```
Thank you
| WPF: XPSPackagingException | CC BY-SA 2.5 | null | 2011-03-21T09:05:27.790 | 2011-03-21T21:27:23.590 | null | null | 273,340 | [
"wpf",
"exception",
"xps",
"savefiledialog"
]
|
5,376,032 | 1 | 5,376,089 | null | -1 | 266 | See the image below. I have a table, tbl_AccountTransaction in which I have 10 rows. The lower most table having columsn AccountTransactionId, AgreementId an so on. Now what i want is to get a single row, that is sum of all amount of the agreement id. Say here I have agreement id =23 but when I ran my query its giving me two rows instead of single column, since there is nano or microsecond difference in between the time of insertion.
So i need a way that will give me row

I have update my query to this
```
SELECT Sum(Amount) as Amount,AgreementID, StatementDate
FROM tbl_AccountTranscation
Where TranscationDate is null
GROUP BY AgreementID,Convert(date,StatementDate,101)
```
but still getting the same error
>
| Group by in t-sql not displaying single result | CC BY-SA 2.5 | null | 2011-03-21T09:57:00.260 | 2011-03-23T19:48:03.817 | 2011-03-21T18:10:55.690 | 90,527 | null | [
"sql",
"sql-server",
"tsql"
]
|
5,376,115 | 1 | 5,378,104 | null | 0 | 195 | I am using this query to fetch data from webserver onto my iPhone app using JSON Parsing.
```
SELECT a.FundID, a.FundName, a.Strike, a.LongShort, a.Current, a.Points, a.OpenClose
FROM tbl_Positions a, tbl_FundStatic b
WHERE b.FundID = a.FundID
AND b.UserID = '14'
AND a.OpenClose != 'Close'
UNION
SELECT c.FundID, c.FundName, '0' AS Strike, "-" AS LongShort, b.LastTradePrice, '0' AS Points, "-" AS OpenClose
FROM tbl_FundStatic c, tbl_MarketData b
WHERE c.UserID = '14'
AND b.IndexCode = c.`Index`
AND c.FundID NOT
IN (
SELECT DISTINCT (FundID)
FROM tbl_Positions
)
```
Ideally it should return data like

But it shows junk value (like "MA==",etc) for the columns `Points` and `Strike`.
What could be wrong?
I am using SBJSON Parser.
I am using following code to parse data into JSON String on server side:
```
DataTable dt = new DataTable();
MySqlDataAdapter da = new MySqlDataAdapter(cmd);
da.Fill(dt);
objMyCon.Close();
String jsonString = JsonConvert.SerializeObject(dt);
String finalString = "{\"ExecuteTrade\":";
finalString += jsonString;
finalString += "}";
return finalString;
```
```
{"ExecuteTrade":[{"FundID":28,"FundName":"Sam Fund 2","Strike":"MTIxMzA=","LongShort":"Long","Current":11985.00,"Points":"LTE0NQ==","OpenClose":"Open"},
{"FundID":27,"FundName":"Sam Fund 1","Strike":"MTE5ODU=","LongShort":"Long","Current":11985.00,"Points":"NTAwMDA=","OpenClose":"Open"},
{"FundID":32,"FundName":"Sam Fund 3","Strike":"MjIwMDA=","LongShort":"Long","Current":14000.00,"Points":"NjAwMA==","OpenClose":"Open"},
{"FundID":45,"FundName":"Rob Fund test","Strike":"OTk5OQ==","LongShort":"NULL","Current":11984.61,"Points":"OTk5OQ==","OpenClose":"NULL"},
{"FundID":46,"FundName":"newtestfund5th","Strike":"OTk5OQ==","LongShort":"NULL","Current":11984.61,"Points":"OTk5OQ==","OpenClose":"NULL"}]}
```
This is the Datatable:

On app side I am using
```
NSDictionary *diction = [responseString JSONValue];
```
The Query works fine when executed on server.
| Fetching Data from Webserver onto iPhone returns Garbage values | CC BY-SA 2.5 | null | 2011-03-21T10:04:43.247 | 2011-03-21T13:17:33.833 | 2011-03-21T11:19:43.777 | 463,857 | 463,857 | [
"iphone",
"mysql",
"json"
]
|
5,376,135 | 1 | 5,410,961 | null | 1 | 1,211 | I have a notification bar that is 'hiding' behind my header by default:

It is only shown after an AJAX request (via jQuery animate()) to tell the user if it was successful:

But when the user scrolled down the page and does not see the header, the way I build it at the moment, it :

So there are 2 cases:
1. if the user sees the header, it should be right beneath it
2. if the user does NOT see the header, it should be attached to the top of the page
And of course when the user scrolls it should move smoothly between the states.
| dynamic css notification bar that scrolls with screen | CC BY-SA 2.5 | null | 2011-03-21T10:06:48.667 | 2011-03-23T20:04:27.470 | 2011-03-23T19:19:29.723 | 213,730 | 213,730 | [
"css"
]
|
5,376,160 | 1 | null | null | 0 | 190 | I need to create something similar what we have in desktop app but it need to be on site.
All theses panels are objects in Java with properties type, number and name. I have same objects in my array ( json format and I create array of objects with dojo.declare). How to create for one object this thing

How to create this ? Can anybody help ?
| Need help with div creation | CC BY-SA 2.5 | null | 2011-03-21T10:09:46.483 | 2011-03-22T05:23:19.973 | null | null | 486,578 | [
"dojo"
]
|
5,376,555 | 1 | 5,376,684 | null | 2 | 3,273 | I would like to add imageview at above of listview. I knew about add section hearder in listview. But i just wanna save my time so i used image view for listview header instead of using addSectionHeader. Unfortunately i just stuck in with some xml properties. Image Overlay at my list view. Actually image supposed to be at the above of list. Check out my xml layout. Thanks.
```
<?xml version="1.0" encoding="utf-8"?>
```

| Add Image at above of listview | CC BY-SA 2.5 | null | 2011-03-21T10:46:36.630 | 2016-05-29T11:20:31.453 | 2011-03-21T10:56:20.647 | 405,219 | 405,219 | [
"android-layout",
"android-listview",
"android",
"android-imageview"
]
|
5,376,579 | 1 | 5,377,494 | null | 2 | 4,716 |
# Case
This is not really a games project. Its a project which runs in full screen for showing video conferencing, and watching TV in high definition, and is controlled from a Remote control.
# Wish:
- I am looking for GUI libraries.
Is there only this method available for developing full screen applications?
[http://download.oracle.com/javase/tutorial/extra/fullscreen/index.html](http://download.oracle.com/javase/tutorial/extra/fullscreen/index.html)- I need a nice looking GUI with nice GUI buttons/grid/multiple video screen 9 or 4 and good layout. (OR something similar to VCR or DVD player GUI in full screen)
For example

Question: Which Java GUI libraries i can use to make such above user interfaces?
| How to make Java GUI full screen and similar to Playstation 3 | CC BY-SA 2.5 | 0 | 2011-03-21T10:48:52.437 | 2021-04-11T03:22:01.163 | 2011-03-21T14:05:52.010 | null | null | [
"java",
"user-interface"
]
|
5,376,628 | 1 | null | null | 1 | 1,419 | I'm developing a "featured" section to a site. The idea being that when hovering over an element on the left it will trigger a fade-in of the right half.
This is working except where there is an overlap of elements (anywhere in the center in-between the red lines). It causes a flickering of the fade-in effect.

This is the feature HTML
```
<div id="feature">
<div id="left-overlay">...Right</div>
<div id="left-feature"><h2>Left</h2></div>
<div id="right-overlay">...Left</div>
<div id="right-feature"><h2>Right</h2></div></div>
```
And this is the jQuery
```
$('div#left-feature').hover(function () {
$('div#left-overlay').stop().css({'z-index' : '10'}).fadeTo('normal', 1);
}, function () {
$('div#left-overlay').stop().fadeTo('normal', 0).css({'z-index' : '-10'});
});
```
Any help would be much appreciated.
I've added a link a demo of this code and its functionality - [http://jsfiddle.net/jamescallaghan/7rLhS/](http://jsfiddle.net/jamescallaghan/7rLhS/)
| jQuery Overlapping Elements causing Flickering | CC BY-SA 2.5 | 0 | 2011-03-21T10:53:46.303 | 2011-03-21T12:04:50.277 | 2011-03-21T11:27:02.027 | 653,248 | 653,248 | [
"jquery",
"jquery-effects"
]
|
5,377,137 | 1 | 5,402,679 | null | 7 | 2,171 | JFileChooser, at least under OS X, produces a very half-baked open dialog that doesn't support things like typing in the start of a file name to select it or disclosure triangles.
Does anyone know of a 3rd-party alternative that has a more fully-featured behaviour? Ideally, I'd like one for each major platform. I'm aware of [XFileDialog](http://code.google.com/p/xfiledialog/) for windows, but what about Mac and Linux/Unix?
In comparison:


| Better JFileChooser alternatives for OS X, Linux? | CC BY-SA 2.5 | 0 | 2011-03-21T11:44:06.503 | 2011-03-23T08:44:51.187 | null | null | 15,255 | [
"java",
"linux",
"macos",
"user-interface",
"jfilechooser"
]
|
5,377,388 | 1 | 5,377,658 | null | 4 | 2,294 | I'm using a custom layout for an alert dialog, in which I set a custom background image.
When displayed, it seems that the dialog box is higher than my image background, while I set the layout dimensions to the image dimensions.
How can I set the dialog box dimensions to the dimensions of my background image? How can I remove this white border?
Thanks

dialog layout
```
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_root"
android:orientation="vertical"
android:background="@drawable/whip_sel_dialog_bg"
android:layout_width="279dp"
android:layout_height="130dp" >
<TextView android:id="@+id/dialog_title"
android:textColor="#FFF"
android:textSize="16sp"
android:textStyle="bold"
android:text="@string/dialog_title"
android:layout_width="fill_parent" android:gravity="center" android:layout_height="30dp" android:layout_marginTop="5dp"/>
<TextView android:id="@+id/dialog_text"
android:textColor="#FFF"
android:layout_height="35dp" android:layout_width="fill_parent" android:gravity="center"/>
<LinearLayout android:id="@+id/confirmation"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:gravity="center">
<Button android:id="@+id/button_cancel"
android:layout_width="128dp"
android:layout_height="43dp"
android:background="@drawable/btn_ok"
android:textColor="#FFF"
android:text="@string/cancel"
android:layout_marginRight="10dp"/>
<Button android:id="@+id/button_ok"
android:layout_width="128dp"
android:layout_height="43dp"
android:background="@drawable/btn_ok"
android:textColor="#FFF"
android:text="@string/ok" />
</LinearLayout>
</LinearLayout>
```
dialog class
```
public class WSelDialog extends Dialog implements OnClickListener {
private Button okButton, cancelButton;
public WSelDialog() {
super(MainActivity.this);
setContentView(R.layout.whipem_dialog);
okButton = (Button) findViewById(R.id.button_ok);
okButton.setText(getString(R.string.whip_sel_ok));
okButton.setOnClickListener(this);
cancelButton = (Button) findViewById(R.id.button_cancel);
cancelButton.setText(getString(R.string.whip_sel_cancel));
cancelButton.setOnClickListener(this);
TextView text = (TextView) findViewById(R.id.dialog_text);
text.setText(getString(R.string.whip_sel));
text.setOnClickListener(this);
}
@Override
public void onClick(View v) {
((GlobalVars)getApplicationContext()).playSound(100);
if (v == cancelButton)
dismiss();
else {
Intent i = new Intent(MainActivity.this, WhipSelection.class);
startActivity(i);
}
}
};
```
| Issue with custom alert dialog | CC BY-SA 2.5 | 0 | 2011-03-21T12:10:32.493 | 2011-03-21T12:36:23.013 | null | null | 326,849 | [
"android",
"dialog"
]
|
5,377,953 | 1 | 5,377,994 | null | 2 | 6,750 | I've got this table:

I want to choose the last two entries (the two with the largest id's) no matter what,
and also the 4 entries that have the most 'power' both queries joined together.
So in this example I would only have 4 results, id 9 & 8, 3 & 4.
I tried:
```
$query = "SELECT * FROM table
ORDER BY power DESC LIMIT 4
INNER JOIN SELECT * FROM table
ORDER BY id DESC LIMIT 2 ";
```
I'm getting the "Invalid query" error. What is wrong here?
| SQL Join two querys, same table | CC BY-SA 2.5 | null | 2011-03-21T13:04:38.300 | 2011-03-21T13:18:33.097 | 2011-03-21T13:13:08.830 | 1,288 | 537,943 | [
"mysql",
"sql"
]
|
5,377,974 | 1 | 5,378,028 | null | 4 | 22,420 | I have a navigation menu which looks like this:

I have to split it into three parts (left, center, right).
I have written the html and css code like this:
```
<span id="nav-left-img"></span>
<ul id="navigation">
<li>Home</li>
<li>About Us</li>
<li>Products</li>
<li>Contact Us</li>
</ul>
<span id="nav-right-img"></span>
```
and here is the css:
```
ul#navigation
{
background: url('../img/menu-c.png') repeat-x;
height: 45px;
clear: both;
width: 420px;
}
ul#navigation li
{
float: left;
text-align: center;
width: 100px;
padding-top: 10px;
}
#nav-left-img
{
background: url('../img/menu-l.png') no-repeat;
height: 45px;
width: 10px;
}
```
The `span` does not seems to do the trick; if I use a `div` it works. What is possibly wrong with the code? Is it ok if I use `div` instead of `span` or should I stick with `div` for joining that left and right image? How do I do it with `span`?
| why is span element not working with this piece of code | CC BY-SA 2.5 | null | 2011-03-21T13:06:03.837 | 2011-03-21T13:31:40.500 | 2011-03-21T13:19:07.397 | 405,015 | 396,476 | [
"html",
"css"
]
|
5,378,185 | 1 | 5,378,564 | null | 0 | 2,532 | The MFC Application Wizard disables visual styles for dialog based applications.
- -
Thank you!

| Visual Styles within Dialog Based MFC Applications? | CC BY-SA 2.5 | 0 | 2011-03-21T13:25:23.177 | 2011-03-21T13:53:55.720 | 2011-03-21T13:34:10.240 | 237,483 | 237,483 | [
"c++",
"visual-studio-2008",
"winapi",
"mfc"
]
|
5,378,280 | 1 | 5,378,314 | null | 0 | 1,047 | I am trying to make a (somewhat simple) color scheme generator for a webpage. I need it to look exactly like this image (or as close as I can get it):

Is there any websites out or other areas I can look to find examples on how to do this? I couldn't find any code examples online.
The tags may be off, I'm not sure which language I would need to use. (Please edit if so)
| How to create a color scheme generator for a webpage | CC BY-SA 2.5 | null | 2011-03-21T13:32:56.463 | 2011-03-21T13:57:23.287 | 2011-03-21T13:57:23.287 | 370,286 | 650,489 | [
"javascript",
"html",
"color-scheme",
"color-picker"
]
|
5,378,396 | 1 | 5,378,426 | null | 1 | 996 | How do I create a div with width size: 1024px, height: 200px and another div inside starting position with size 990px width: 20px, height: 200px forming a line.
I started to do but I'm not progressing:
Here is the code:
```
div.wrap, div.header
{
width:1024px;
margin:0 auto;
}
div.header, header1
{
height:100px;
background-color:Purple;
}
div.header header1
{
background-color:Gray;
left:990px;
position:fixed;
}
```
```
<div class="wrap">
<div class="header">
<div class="header1"></div>
</div>
</div>
```
As should be the result:

| Div forming a line inside another div | CC BY-SA 2.5 | null | 2011-03-21T13:41:54.903 | 2011-03-21T13:49:40.607 | null | null | 491,181 | [
"css",
"html",
"position",
"line"
]
|
5,378,520 | 1 | 5,569,998 | null | 8 | 7,499 | I am new to ASP.Net MVC 3, facing some issues while trying to implementing client side unobtrusive validation for a editor template I have created for showing date in a custom way.
I need to show date in a format as

I have put up a for displaying the date in three parts as
```
@model DateTime?
<table class="datetime">
<tr>
<td>@Html.TextBox("Day", (Model.HasValue ? Model.Value.ToString("dd") : string.Empty)) </td>
<td class="separator">/</td>
<td>@Html.TextBox("Month", (Model.HasValue ? Model.Value.ToString("MM") : string.Empty))</td>
<td class="separator">/</td>
<td>@Html.TextBox("Year", (Model.HasValue ? Model.Value.ToString("yyyy") : string.Empty))</td>
</tr>
<tr>
<td class="label">dd</td>
<td/>
<td class="label">mm</td>
<td/>
<td class="label">yyyy</td>
</tr>
</table>
```
I have to bind a Date of Birth field which is a property in a of my model to this property, in this structure
```
MyModel
--> MySubModel
--> DateOfBirth
public class MySubModel
{
...
[DataType(DataType.Date)]
[Display(Name = "Date of birth")]
[DateTimeClientValidation()]
public DateTime DateofBirth { get; set; }
...
}
```
I have put up a custom validation attribute which implements IClientValidatable as
```
public class DateTimeClientValidationAttribute : ValidationAttribute, IClientValidatable
{
...
public IEnumerable<ModelClientValidationRule> GetClientValidationRules(ModelMetadata metadata, ControllerContext context)
{
List<ModelClientValidationRule> clientRules = new List<ModelClientValidationRule>();
//Combined date should be valid
ModelClientValidationRule validDateRule = new ModelClientValidationRule
{
ErrorMessage = "Please enter a valid date.",
ValidationType = "validdate"
};
validDateRule.ValidationParameters.Add("dayelement", metadata.PropertyName + ".Day");
validDateRule.ValidationParameters.Add("monthelement", metadata.PropertyName + ".Month");
validDateRule.ValidationParameters.Add("yearelement", metadata.PropertyName + ".Year");
clientRules.Add(validDateRule);
return clientRules;
}
...
}
```
I am trying to emit the element names of Day, Month & Year textboxes here to client side validation elements, so that I will write a client side jquery validation method and adapter later which would consume those elements and do the validation at the client side.
Now, to use this editor template, I put in the following lines
```
@model MyModel
...
<tr>
<td class="editor-label">
@Html.LabelFor(m => m.MySubModel.DateofBirth)
</td>
<td class="editor-field">
@Html.EditorFor(m => m.MySubModel.DateofBirth)
@Html.ValidationMessageFor(m => m.MySubModel.DateofBirth)
</td>
</tr>
...
```
1. This is not emitting out the unobtrusive javascript validation attributes in the html, though I have implemented IClientValidatable. For testing purpose when I put the same attribute (DateTimeClientValidation) on another property in the model which was not using this editor template, then it emitted out those validation attributes, it is not emitting it out only for this editor template. Where could have I gone wrong ?
2. Regarding Validation Message span for the editor template, is it right that I put it in View only or should I put it directly in the editor template (@Html.ValidationMessageFor(m => m.MySubModel.DateofBirth))
3. In this example, am I right in the design, I have put in DateTimeClientValidationAttribute, which actually is an attribute I put on model, but this component knows a bit about UI (since it is trying to emit out the Day, Month & Year elements name to the client), this makes Model know a bit about View, am I breaking any design principles here ?
4. In DateTimeClientValidationAttribute, I am trying to emit out the day, month & year elements names to the client, so that the client script can do validations on it. But since the model property DateofBirth is in a subobject, the actual element name in the script is MySubObject.DateOfBirth, which makes the Day textbox name to be MySubObject.DateofBirth.Day, how can I find that fully qualified model name in the GetClientValidationRules method, so that I can emit out the name to the client ?
Thanks for being patient to read out all this, and for the answers
| ASP.Net MVC 3 - Client side unobtrusive validation for Editor Templates | CC BY-SA 2.5 | 0 | 2011-03-21T13:50:39.673 | 2011-04-06T16:46:15.347 | 2011-04-01T08:47:04.783 | 669,521 | 669,521 | [
"asp.net-mvc-3",
"data-annotations",
"editortemplates",
"unobtrusive-validation"
]
|
5,378,706 | 1 | 5,378,824 | null | 0 | 5,102 | I used the codes below to load image file in app bundle.
The codes work! imageData does NOT return 0x0
```
NSMutableString *sss;
sss=[[NSMutableString alloc] initWithString: [[NSBundle mainBundle] resourcePath]];
[sss appendString:@"/"] ;
[sss appendString:@"thumbnail.png"];
NSData *imageData = [NSData dataWithContentsOfFile:sss];
```
but the codes below in which almost everything is same have no function, imageData always DOES return 0x0, it looks like [NSData dataWithContentsOfFile:filepath ] does not work for large size image file
```
NSMutableString *sss;
sss=[[NSMutableString alloc] initWithString: [[NSBundle mainBundle] resourcePath]];
[sss appendString:@"/"] ;
[sss appendString:@"original.png"];
NSData *imageData = [NSData dataWithContentsOfFile:sss];
```
Both of thumbnail.png and original.png are in the same directory of main bundle.
thumbnail.png

original.png

Welcome any comment
Thanks
Marc
| dataWithContentsOfFile:filepath of NSData sometimes works, sometimes has no function | CC BY-SA 3.0 | null | 2011-03-21T14:05:25.753 | 2012-06-14T00:54:47.170 | 2012-06-14T00:54:47.170 | 1,035,899 | 629,453 | [
"iphone"
]
|
5,379,005 | 1 | 5,381,059 | null | 0 | 47 | This is one of those situations where I think I've solved my own problem but, being new to Cocoa (and programming in general), I'd like someone to check that I'm right!
My original problem was as follows: I have a simple CoreData program with a one-to-many relationship between two entities: "Categories" (parent) and "Checklists" (child). Tapping on a Category brings up a new view with a table of its Checklists. The problem was that if I tapped on one Category, I got a big list of all the Checklists from all the Categories - this list was the same no matter which category I tapped on.
My solution is to use a @property and a predicate. When I set up the Checklists view controller (in the Root View Controller's TableView:DidSelectRowAtIndexPath:) I did the following:
```
Category *category = (Category *)[__fetchedResultsController objectAtIndexPath:indexPath];
detailViewController.category = category;
```
Then in the Checklist View Controller's fetchedResultsController method I did the following:
```
NSPredicate *requestPredicate = [NSPredicate predicateWithFormat:@"category.name = %@", self.category.name];
[fetchRequest setPredicate:requestPredicate];
```
This seems to have worked, but I just wanted to check I have gone about this in the right way. Thanks!
## -
EDIT - here's a screenshot of my Core Data model:

| How do I access the right child entites when I select a parent? | CC BY-SA 2.5 | 0 | 2011-03-21T14:26:36.977 | 2011-03-21T17:05:21.643 | 2011-03-21T14:42:50.980 | 619,432 | 619,432 | [
"iphone",
"cocoa-touch",
"core-data"
]
|
5,379,573 | 1 | null | null | 0 | 1,721 | I'm editing a table via phpMyAdmin and see that the dID column is allowing me to select a value from a drop-down list. I initially set the column as an int.


Why is it doing this?
| phpMyAdmin shows column value as drop-down when field type is int | CC BY-SA 2.5 | null | 2011-03-21T15:09:18.503 | 2011-03-21T16:54:00.993 | 2011-03-21T16:44:58.963 | 9,314 | 700,070 | [
"mysql",
"phpmyadmin"
]
|
5,379,870 | 1 | null | null | 11 | 40,276 | I am using VS 2008. I am getting a PopUp everytime i run my application.
Following is the PopUp:
> The following module was built with
optimizations enabled or without debug
information :```
C:\Windows\Microsoft.Net\Framework\v2.0.50727\Temporary ASP.NET Files\root\7c06d97f\c871fca3\assembly\dl3\1ed1f335\00d7b454_9450ca01\BArcodingImaging.DLL
```
To debug this module, change its
project build configuration to debug
mode. To suppress this message,
disable the "Warn inf no user code on
launch" debugger option.
I have tried all the links available on the Google to get rid of this error but nothing works. Actually most of the links are for VS 2005. But i am using VS 2008.
I used following reference:
[http://social.msdn.microsoft.com/Forums/en-US/tfsbuild/thread/1946cf16-ae70-4394-9cd9-9d35f3f012ed/](http://social.msdn.microsoft.com/Forums/en-US/tfsbuild/thread/1946cf16-ae70-4394-9cd9-9d35f3f012ed/)
And one on Code Guru.

| Changing Project Build Configuration to Debug mode | CC BY-SA 3.0 | null | 2011-03-21T15:31:06.393 | 2022-08-20T04:48:13.970 | 2012-08-28T07:07:15.040 | 226,958 | 669,213 | [
".net",
"visual-studio",
"debugging",
"configurationmanager"
]
|
5,380,077 | 1 | 5,407,575 | null | 1 | 515 | this question is related to [Get scroll bar position of an NSScroller on the fly](https://stackoverflow.com/questions/5363728/get-scroll-bar-position-of-an-nsscroller-on-the-fly)
But now i would like to know how to get current position of list element (green rect) on scrolling.

`[self bounds]` or `[self frame]` or `[[self enclosingScrollView] ...]` won't work for this kind of thing or i'm using it in wrong way.
Inside frame of `[[NSScrollView enclosingScrollView] contentView]]` we see list of `NSBox`'s.
When i click on triangle of `NSBox` which is list element, instance of that `NSBox` is stored in `-activeTicketRow`, i've thought that i can then get `NSBox` coordinates inside `NSScrollView` frame when `[[NSScrollView enclosingScrollView] contentView]]` bounds changes, but after reading "View Programming Guide" i guess not.
I've added observer in `NSScrollView`
```
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(updateConvMenu:)
name:NSViewBoundsDidChangeNotification
object:[[self enclosingScrollView] contentView]
];
```
and in `-updateConvMenu` i get coordinates of `[[self enclosingScrollView] contentView]`, so that's good.
No i would like to store `NSBox` (which triangle was clicked) from `[[self enclosingScrollView] contentView]` inside `-activeTicketRow` so i can then get it's frame coordinates in `-updateConvMenu` when `[[self enclosingScrollView] contentView]` bounds changes.
I think now this question is more readable.
| Get list element bounds or frame on scrolling | CC BY-SA 3.0 | null | 2011-03-21T15:46:01.203 | 2016-05-29T10:21:01.797 | 2017-05-23T12:01:09.963 | -1 | 400,574 | [
"objective-c",
"cocoa"
]
|
5,380,280 | 1 | 5,393,123 | null | 0 | 1,266 | I recently updated a project in my solution to use MVC 3 instead of MVC 2.
Ever since doing that, and although it compiles in my machine, I get the following error in the server:
```
/MyProject.csproj/global.asax (1,0):
errorASPPARSE: Could not load type 'MyNamespace.MvcApplication'.
```
Any ideas?
- - -
:
The exact command that fails is this:
```
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -v /MyProject.csproj -p c:\cruisecontrol\trunk.project\checkout\Solution\Project -u -f .\TempBuildDir\
```
If I open the VS.NET 2010 in the server, compile it once manually, the command then runs ok.
The problem is that my CC.NET deletes everything and then checks it out from source control from scratch, so this approach doesn't work for me. Although it's interesting because it's weird.
I was able to reproduce this locally, so it's not a problem specifically in the CC.NET server.
Could someone try to reproduce it?
MVC 3 application with razor (although I doubt it'd make a difference), run aspnet_compiler on it, and see if it fails with that error. Just close VS.NET as soon as it creates the solution and the project.

This does not happen if I compile it at least once with Visual Studio
If someone is kind enough to try it, I can rule out a problem in the 2 machines I tested.
| Problems using aspnet_compiler to compile a fresh ASP.NET MVC 3 project | CC BY-SA 2.5 | null | 2011-03-21T16:03:09.290 | 2011-03-22T14:59:36.713 | 2011-03-22T13:08:55.433 | 1,782 | 1,782 | [
"asp.net-mvc-3",
"razor",
"cruisecontrol.net"
]
|
5,380,374 | 1 | 5,380,680 | null | 11 | 20,456 | I need to implement the layout as in the picture. Parent and Sibling are in a vertical LinearLayout. So I need to make a child view to overlap it's parent. Can I do that in android?

| android: how to make a child view overlap the parent? | CC BY-SA 2.5 | 0 | 2011-03-21T16:11:43.740 | 2020-03-20T07:21:18.260 | null | null | 190,148 | [
"android",
"layout",
"parent-child"
]
|
5,380,417 | 1 | 5,380,817 | null | 31 | 33,452 | `ggplot` generally does a good job of creating sensible breaks and labels in scales.
However, I find that in plot with many facets and perhaps a `formatter=` statement, the labels tend to get too "dense" and overprint, for example in this picture:
```
df <- data.frame(
fac=rep(LETTERS[1:10], 100),
x=rnorm(1000)
)
ggplot(df, aes(x=x)) +
geom_bar(binwidth=0.5) +
facet_grid(~fac) +
scale_x_continuous(formatter="percent")
```

I know that I can specify the breaks and labels of scales explicitly, by providing `breaks=` and `scale=` arguments to `scale_x_continuous`.
However, I am processing survey data with many questions and a dozen crossbreaks, so need to find a way to do this automatically.
Is there a way of telling `ggplot` to calculate breaks and labels automatically, but just have fewer, say at the minimum, maximum and zero point?
Ideally, I don't want to specify the minimum and maximum points, but somehow tap into the built-in ggplot training of scales, and use the default calculated scale limits.
| Is there a way of manipulating ggplot scale breaks and labels? | CC BY-SA 3.0 | 0 | 2011-03-21T16:15:01.137 | 2020-03-18T00:46:20.160 | 2012-08-09T22:19:19.057 | 602,276 | 602,276 | [
"r",
"ggplot2"
]
|
5,380,588 | 1 | 5,448,120 | null | 3 | 2,108 | I need to apply a pixel shader to this code (the fullscreen quad). I have the FX file. What is the procedure? (EDIT finalized: code is working)
```
public int CompositeImage(IntPtr pD3DDevice, IntPtr pddsRenderTarget, AMMediaType pmtRenderTarget, long rtStart, long rtEnd, int dwClrBkGnd, VMR9VideoStreamInfo[] pVideoStreamInfo, int cStreams)
{
try
{
if (udevice != pD3DDevice)
{
InitCompositionDevice(pD3DDevice);
}
// will be creating managed object from those so increment ref count
Marshal.AddRef(pddsRenderTarget);
Marshal.AddRef(pVideoStreamInfo[0].pddsVideoSurface);
device.Clear(ClearFlags.Target, Color.Red, 1f, 0);
device.BeginScene();
// here the video frame will be stored
Texture capturedVideoTexture = null;
// this is the output surface
Surface renderTarget = new Surface(pddsRenderTarget);
// get the surface for the input video
Surface videoSurface = new Surface(pVideoStreamInfo[0].pddsVideoSurface);
// will use this rect for calculations
Rectangle videoSurfaceRect = new Rectangle(0, 0, videoSurface.Description.Width, videoSurface.Description.Height);
// create single layer texture from input video
capturedVideoTexture = new Texture(device, videoSurfaceRect.Width, videoSurfaceRect.Height, 1, Usage.RenderTarget, Format.A8R8G8B8, Pool.Default);
// get its surface
Surface textureSurface = capturedVideoTexture.GetSurfaceLevel(0);
// will use this rect for calculations
Rectangle textureSurfaceRect = new Rectangle(0, 0, textureSurface.Description.Width, textureSurface.Description.Height);
// copy the whole video surface into the texture surface
device.StretchRectangle(videoSurface, videoSurfaceRect, textureSurface, textureSurfaceRect, TextureFilter.Linear);
// identity matreices for world projection and view
device.Transform.World = Matrix.Identity;
device.Transform.Projection = Matrix.Identity;
device.Transform.View = Matrix.Identity;
// setup viewport
Viewport view = new Viewport();
view.X = 0;
view.Y = 0;
view.Width = 1920;
view.Height = 1080;
view.MinZ = 0;
view.MaxZ = 1;
device.Viewport = view;
// writing will go to output surface
device.SetRenderTarget(0, renderTarget);
// nothing fancy of a vertex shader
device.VertexFormat = CustomVertex.PositionTextured.Format;
// use the texture while rendering
device.SetTexture(0, capturedVideoTexture);
//Bind our Vertex Buffer
device.SetStreamSource(0, vb, 0);
// setup and apply shader
ps.Begin(FX.None);
ps.BeginPass(0);
ps.SetValue("ScreenTexture", capturedVideoTexture);
//Render from our Vertex Buffer
device.DrawPrimitives(PrimitiveType.TriangleList, 0, 2);
ps.EndPass();
ps.End();
device.EndScene();
videoSurface.Dispose();
textureSurface.Dispose();
capturedVideoTexture.Dispose();
renderTarget.Dispose();
videoSurface = null;
renderTarget = null;
capturedVideoTexture = null;
}
catch (Exception e)
{
Debug.WriteLine(e.ToString());
}
return 0;
}
```
This is the final effect achieved: Sepia on the VMR9 video:

Now what remains is code the anaglyph shaders for 3D content :)
| Apply pixel shader to video with DirectX | CC BY-SA 2.5 | null | 2011-03-21T16:30:30.627 | 2011-03-29T10:41:45.730 | 2011-03-29T10:41:45.730 | 610,204 | 610,204 | [
"c#",
"c++",
"video",
"directx",
"shader"
]
|
5,380,815 | 1 | 5,380,861 | null | 0 | 296 | Drop below letters like g, y, j are truncated in Firefox 3.6 only.
```
<input type="text" value="yyyy gggg xxxx" style="height: 1em;" />
```

[http://jsfiddle.net/mrtsherman/yqTjX/](http://jsfiddle.net/mrtsherman/yqTjX/)
My google-fu is completely failing me. Simple problem. I imagine there is a simple solution.
| Firefox text input truncates bottoms of letters | CC BY-SA 2.5 | null | 2011-03-21T16:46:28.337 | 2011-03-21T17:18:55.570 | null | null | 510,314 | [
"html",
"css",
"firefox"
]
|
5,380,806 | 1 | 5,381,086 | null | 1 | 6,489 | I'm trying to load a CSV into a DataTable using this:
```
class CSVReader
{
public System.Data.DataTable GetDataTable(string strFileName)
{
System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection
(
"Provider=Microsoft.Jet.OleDb.4.0; Data Source = " + System.IO.Path.GetDirectoryName(strFileName) +
"; Extended Properties = \"Text;HDR=YES;FMT=Delimited\""
);
conn.Open();
string strQuery = "SELECT * FROM [" + System.IO.Path.GetFileName(strFileName) + "]";
System.Data.OleDb.OleDbDataAdapter adapter = new System.Data.OleDb.OleDbDataAdapter(strQuery, conn);
System.Data.DataSet ds = new System.Data.DataSet("CSV File");
adapter.Fill(ds);
return ds.Tables[0];
}
}
```
It works fine one one CSV, but not another. Here is the snippet of the file that doesn't load properly:

It simply loads "T" as the first column name, and everything else is blank/null. I tried manually looking at the first line with
```
Using (StreamReader x = new StreamReader(fileName) { string firstline x = x.ReadLine(); }
```
and the equivalent File.ReadAllLines and referenced the array's "0" entry ( file[0] ).
Both simply return "T" as the "first line" and anything beyond that is blank. Any ideas why it only sees the first character in the CSV and nothing else?
EDIT: First line looks like this:
> TERM(s),OBJECTID,FILE,PATH,HIT COUNT
The second line looks like this:
> "(test)","172911","16369318","Item001.E01/Partition 1/NONAME [NTFS]/[unallocated space]/13621367/16369318","4"
EDIT 2:
I switched over the the lib somebody linked (CVSReader) and it seems to have taken a lot of the pain out. I tried encoding the file in UTF-8 with Notepad++ and it gets farther along, until it gets to:
> LumenWorks.Framework.IO.Csv.MalformedCsvException was unhandled
Message=The CSV appears to be corrupt near record '1373' field '3 at position '2601'. Current raw data : '32/System.ServiceModel/06d6eab93282d2b136a377bd50b7c5a9/System.ServiceModel.ni.dll","11"
"(vc)","40656","Adobe AIR Application Installer.swf","Item001.E01/Partition 1/NONAME [NTFS]/[root]/Program Files/Common Files/Adobe AIR/Versions/1.0/Adobe AIR Application Installer.swf","11"
"(vc)","503322","䄳䆷䞫䄦䠥","Item001.E01/Partition 1/NONAME [NTFS]/[root]/WINDOWS/Installer/520ae67.msp/䄳䆷䞫䄦䠥","11"
I'm guessing that it is taking issue with the foreign characters in UTF-8 encoding. If I leave the file the way it was, original encoding, it processes poorly/incorrectly. I don't want to make the user have to open the file and save it as ASCII/UTF-16 since it is ~90mb. I've been trying to google around, but most people say .NET can handle any encoding.
It seems the file is outputted as UCS-2 LE (which I think is UTF-16, right?). I"m confused why CVSReader/StreamReader are taking issue.
When I pass a "characterset=Unicode" appended to the string on my OldeDB function it seems to work for USC-2LE/Unicode encoding. I would prefer to use the CSVReader custom lib, but it seems to use TextReader (which as far as I can tell can't handle Unicode).
[http://www.codeproject.com/KB/database/CsvReader.aspx](http://www.codeproject.com/KB/database/CsvReader.aspx)
THe following code will not work. It doesn't throw an error, but it seems to stall out even on its own thread:
Bad Code for USC2/Unicode:
```
using (CsvReader csv = new CsvReader(
new StreamReader(kwfile, Encoding.Unicode), true))
{
csv.MissingFieldAction = MissingFieldAction.ReplaceByEmpty;
keywordHits.Load(csv);
}
```
Working, but not preferred solution:
```
public System.Data.DataTable GetDataTable(string strFileName)
{
System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection
(
"Provider=Microsoft.Jet.OleDb.4.0; Data Source = " + System.IO.Path.GetDirectoryName(strFileName) +
"; Extended Properties = \"Text;characterset=Unicode;HDR=YES;FMT=Delimited\""
);
conn.Open();
string strQuery = "SELECT * FROM [" + System.IO.Path.GetFileName(strFileName) + "]";
System.Data.OleDb.OleDbDataAdapter adapter = new System.Data.OleDb.OleDbDataAdapter(strQuery, conn);
System.Data.DataSet ds = new System.Data.DataSet("CSV File");
adapter.Fill(ds);
return ds.Tables[0];
}
```
I've tried it with the optional third parameter in the CSVReader as well, and no difference. The program "works" by loading one CSV using the CSVReader class but has to use the OldeDB on the Unicode CSV. Obviously, using StreamReader with the Encoding.Unicode parameter works, but I'd have to re-invent the wheel in parsing out possibly malformed entries. Any thoughts? Or is this the best I can do without rewriting the CSVReader?
| Trouble Parsing Unicode CSV File | CC BY-SA 2.5 | null | 2011-03-21T16:46:02.320 | 2011-03-22T13:40:43.990 | 2011-03-22T13:40:43.990 | 585,088 | 585,088 | [
"c#",
".net"
]
|
5,380,906 | 1 | null | null | 2 | 2,628 | I would like to to have a GTK TreeView with a background image as shown in the mockup below.
I have found methods for setting the background of widgets, but there does not appear to be a method for setting a background `pixbuf` or other image format.
I'm using Python with PyGTK but an answer in any language with GTK bindings is acceptable.
:

Based on Jong Bor's advice, I tried the following:
```
style = treeview.get_style().copy()
img_pixbuf = gtk.gdk.pixbuf_new_from_file(image_filename)
img_pixmap = img_pixbuf.render_pixmap_and_mask()[0]
for state in (gtk.STATE_NORMAL, gtk.STATE_ACTIVE, gtk.STATE_PRELIGHT,
gtk.STATE_SELECTED, gtk.STATE_INSENSITIVE):
style.bg_pixmap[state] = img_pixmap
treeview.set_style(style)
```
At first this didn't seem to have any effect, but upon selecting an item in my `TreeView` I observed the following:

Part of the background 'shows through' when a row is selected.
(Note that I'm using a background image based on my mockup, except that it has some blue color, for test purposes).
I then activated part of my GUI that clears the contents of the TreeView and redraws it, and observed this:

However as soon as I add something to the TreeView the background disappears, so I'm still not sure if this is going in the right direction.
| How do I add a background image to a GTK TreeView? | CC BY-SA 2.5 | null | 2011-03-21T16:53:40.660 | 2015-12-24T11:17:12.527 | 2011-03-22T17:38:42.060 | 182,642 | 182,642 | [
"gtk",
"pygtk",
"gtktreeview"
]
|
5,380,951 | 1 | 5,381,590 | null | 0 | 2,646 | I have a `CheckBoxList` like this. (There are customer name)

These are customer name and every customer has a customer number (`Unique` -- `Primary Key`)
Table: `S_TEKLIF`
`MUS_K_ISIM` represent Customer Name
`HESAP_NO` represent Customer Number
I have a `Send Button` and `Gridview`.
When i click the Send Button,
In my `Gridview`, I just want run this `SQL`;
```
SELECT A.HESAP_NO, A.TEKLIF_NO1 || '/' || A.TEKLIF_NO2 AS TEKLIF, A.MUS_K_ISIM,
B.MARKA, C.SASI_NO, C.SASI_DURUM, D.TAS_MAR, RISK_SASI(A.TEKLIF_NO1, A.TEKLIF_NO2, C.SASI_NO) AS RISK,
MV_SASI(A.TEKLIF_NO1, A.TEKLIF_NO2, C.SASI_NO, SYSDATE) AS MV
FROM S_TEKLIF A, S_URUN B, S_URUN_DETAY C, KOC_KTMAR_PR D
WHERE A.TEKLIF_NO1 || A.TEKLIF_NO2 = B.TEKLIF_NO1 || B.TEKLIF_NO2
AND A.TEKLIF_NO1 || A.TEKLIF_NO2 = C.TEKLIF_NO1 || C.TEKLIF_NO2
AND B.SIRA_NO = C.URUN_SIRA_NO
AND B.DISTRIBUTOR = D.DIST_KOD
AND B.MARKA = D.MARKA_KOD
AND B.URUN_KOD = D.TAS_KOD
AND A.HESAP_NO IN (
```
But as you can see bottom of th `SQL`, I just want to show "" in my Gridview.
How can i do that?
What should be in my `Send_Click()` function and in my `SQL`?
Best Regards, Soner
| Selected Data in CheckBoxList to Gridview | CC BY-SA 2.5 | null | 2011-03-21T16:56:51.767 | 2011-03-21T19:41:51.307 | null | null | 447,156 | [
"c#",
".net",
"asp.net",
"gridview",
"checkbox"
]
|
5,381,124 | 1 | null | null | 2 | 3,252 | Multiple axis creation via MXML works fine:
[http://livedocs.adobe.com/flex/3/html/help.html?content=charts_types_12.html](http://livedocs.adobe.com/flex/3/html/help.html?content=charts_types_12.html)
But when I'm trying dynamically create horizontal and vertical axis then I'm getting extra axes. I believe this is Adobe bug. How I can fix this behavior? Thanks.

```
<?xml version="1.0" encoding="utf-8"?>
<s:Application
minHeight="600"
minWidth="955"
creationComplete="application1_creationCompleteHandler(event)"
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
<fx:Script>
<![CDATA[
import mx.charts.AxisRenderer;
import mx.charts.LinearAxis;
import mx.charts.series.ColumnSeries;
import mx.charts.series.LineSeries;
import mx.collections.ArrayCollection;
import mx.events.FlexEvent;
[Bindable] public var SMITH:ArrayCollection = new ArrayCollection([{date:"22-Aug-05", close:41.87},
{date:"23-Aug-05", close:45.74},
{date:"24-Aug-05", close:42.77},
{date:"25-Aug-05", close:48.06},]);
[Bindable] public var DECKER:ArrayCollection = new ArrayCollection([{date:"22-Aug-05", close:157.59},
{date:"23-Aug-05", close:160.3},
{date:"24-Aug-05", close:150.71},
{date:"25-Aug-05", close:156.88},]);
protected function application1_creationCompleteHandler(event:FlexEvent):void
{
// VERTICAL AXIS
var verticalAxis1:LinearAxis = new LinearAxis();
var verticalAxis2:LinearAxis = new LinearAxis();
var verticalAxisRenderer1:AxisRenderer = new AxisRenderer();
var verticalAxisRenderer2:AxisRenderer = new AxisRenderer();
verticalAxisRenderer1.axis = verticalAxis1;
verticalAxisRenderer2.axis = verticalAxis2;
// HORIZONTAL AXIS
var horizontalAxis:LinearAxis = new LinearAxis();
var horizontalAxisRenderer:AxisRenderer = new AxisRenderer();
horizontalAxisRenderer.axis = horizontalAxis;
horizontalAxisRenderer.placement = "bottom";
// SERIES
var newSeries:Array = new Array();
var columnSeries:ColumnSeries = new ColumnSeries();
columnSeries.dataProvider = SMITH;
columnSeries.yField = "close";
columnSeries.verticalAxis = verticalAxis1;
columnSeries.displayName = "SMITH";
newSeries.push(columnSeries);
var lineSeries:LineSeries = new LineSeries();
lineSeries.dataProvider = DECKER;
lineSeries.yField = "close";
lineSeries.verticalAxis = verticalAxis2;
lineSeries.displayName = "DECKER";
newSeries.push(lineSeries);
// CHART
myChart.verticalAxisRenderers = [verticalAxisRenderer1, verticalAxisRenderer2];
myChart.horizontalAxisRenderers = [horizontalAxisRenderer];
myChart.series = newSeries;
}
]]>
</fx:Script>
<mx:Panel title="Column Chart With Multiple Axes">
<mx:ColumnChart id="myChart"
showDataTips="true"/>
<mx:Legend dataProvider="{myChart}"/>
</mx:Panel>
</s:Application>
```
| Dynamically create axis via ActionScript in Adobe flex charting library; Adobe Bug? | CC BY-SA 2.5 | null | 2011-03-21T17:11:23.680 | 2013-02-15T07:05:13.720 | null | null | 99,144 | [
"apache-flex",
"actionscript",
"dynamic",
"axis",
"charts"
]
|
5,381,162 | 1 | 10,993,048 | null | 41 | 22,219 | How can i implement the [Post-Redirect-Get](http://en.wikipedia.org/wiki/Post/Redirect/Get) pattern with ASP.NET?
A button click performs some processing:
```
<asp:Button id="bbLaunch" OnCommand="bbLaunch_Click" />
```
User clicks the button, the spacecraft is launched, the web-page redisplays. If the user presses F5, they get the warning:

The solution to the problem is the [Post-Redirect-Get](http://en.wikipedia.org/wiki/Post/Redirect/Get) pattern.
What is the method by which [PRG](http://en.wikipedia.org/wiki/Post/Redirect/Get) can be implemented in ASP.NET?
---
The question centers around the problems of:
- `<asp:Button>``POST`- - - - - - `Response.Redirect(Request.RawUrl);`- - - `Server.Transfer``Server.Transfer`- `aspx``aspx.cs``post``MyPage.aspx`
In other words:
: ASP.net (i.e. not ASP.net MVC)
## See also
- [How do I implement the Post/Redirect/Get pattern in asp.net WebForms?](https://stackoverflow.com/questions/919516/how-do-i-implement-the-post-redirect-get-pattern-in-asp-net-webforms)- [How do I use the “Post/Redirect/Get” a.k.a. “Redirect after Post” with asp.net](https://stackoverflow.com/questions/331277/how-do-i-use-the-post-redirect-get-a-k-a-redirect-after-post-with-asp-net)
| Post-Redirect-Get with ASP.NET | CC BY-SA 3.0 | 0 | 2011-03-21T17:14:05.543 | 2018-11-20T16:54:39.017 | 2017-05-23T12:32:29.317 | -1 | 12,597 | [
"asp.net",
"post-redirect-get",
"redirect-after-post"
]
|
5,381,255 | 1 | 5,431,091 | null | 1 | 521 | 
I need to implement kind of illustrated function ( ratio = somefunction(time)) in Objective-c. Language doesn't actually matters, because task seems purely algorithmic. Is there any common way to do things like this?
Next things should be easily adjustable in process of design:
1) Number of small intervals per period (now it 4, but it can be 3 or 20 for example).
2) f1 can be changed. It's simple function like f(x) = sin(x).
3) if we say
```
f_resulting =
f1 for a time t1
f2 for a time t2
then again
f1 for a time t1
etc..
```
ratio when f1 "works" vs f2 "works" (t1 to t2) should be adjustable.
| The best way to implement piece-wise periodic function in Objective-C? | CC BY-SA 2.5 | 0 | 2011-03-21T17:21:17.823 | 2011-03-25T10:15:46.857 | 2011-03-21T17:25:36.393 | 139,010 | 612,705 | [
"objective-c",
"function"
]
|
5,381,343 | 1 | 5,730,128 | null | 1 | 7,100 | i followed all of these steps in this tutorial:
Created a validator class
```
public class ProjectValidator : AbstractValidator<ProjectViewModel>
{
public ProjectValidator()
{
//RuleFor(h => h.Milestone).NotEmpty().WithName("Milestone");
RuleFor(h => h.Applications).NotNull().WithName("Application");
RuleFor(h => h.InitiativeName).NotNull().WithName("Business Aligned Priority");
RuleFor(h => h.BusinessDriverId).NotNull().WithName("Business Driver");
RuleFor(h => h.FundingTypeId).NotNull().WithName("Funding Type");
RuleFor(h => h.Description).NotEmpty().WithName("Description");
RuleFor(h => h.Name).NotEmpty().WithName("Project Name");
RuleFor(h => h.Sponsors).NotNull().WithName("Sponsors");
}
}
```
Put an attribute on my DTO to specific this validtor
```
[Validator(typeof(ProjectValidator))]
public class ProjectViewModel
{
}
```
but after a form post when i go to check the ModelState errors list, the errors i see are coming from the asp.net-mvc default validation.
```
public ActionResult UpdateMe(ProjectViewModel entity)
{
Project existingProject = this.Repository.Fetch<Project>(entity.Id);
UpdateProperties(entity, existingProject);
var allErrors = ModelState.Values.SelectMany(v => v.Errors);
if (allErrors.Count() > 0)
{
```
any suggestions on why its not picking up the fluent. validator ?? I have added an image below of what i see on the gui

if i call the validator directly in code it works just fine:
```
ProjectValidator validator = new ProjectValidator();
ValidationResult result = validator.Validate(entity);
```
| Attribute based validation with fluent validation doesn't seem to work with asp.net-mvc | CC BY-SA 2.5 | 0 | 2011-03-21T17:30:28.690 | 2011-04-20T12:19:29.080 | 2011-03-21T19:09:00.343 | 4,653 | 4,653 | [
"asp.net-mvc",
"fluentvalidation",
"fluentvalidation-2.0"
]
|
5,381,547 | 1 | 5,391,641 | null | 0 | 230 | Well i'm currently developping my Toolbar for Google Chrome as a Extension. The main principe is that i'm all the time injecting the toolbar as an iframe by using the Content Script.
But now i see a couple of bug with gmail, google map/search, pdf an maybe other that i've not yet see...
Let me explain, when i go on gmail, i don't see my toolbar at all...
When i open Google, it seems really normal :
But then when i start a search my toolbar seems to overide the top link (web, images, videos, maps,...) I can't click on them anymore...

Next problem is when i'm trying to go on google map or trying to open a PDF, it seems to give the same css to these web pages from my toolbar...
Google Maps :

PDF :

Hope i where clear enough, do not hesitate to ask me question if necessary ;)
| Trouble between an injected iframe and other web page (Google, Gmail, Pdf) | CC BY-SA 2.5 | null | 2011-03-21T17:51:07.717 | 2011-03-22T13:01:05.820 | null | null | 632,950 | [
"javascript",
"jquery",
"html",
"css",
"google-chrome-extension"
]
|
5,381,555 | 1 | 6,171,471 | null | 11 | 6,068 | How do I show the description box of the properties window in Visual Studio 2010 if it is hidden?

For example, the following image shows the description box. It reads "Load: Occurs whenever the user loads the form."

| How do I show the description box of the properties window in Visual Studio 2010 if it is hidden? | CC BY-SA 2.5 | 0 | 2011-03-21T17:51:37.293 | 2022-04-26T21:40:34.450 | 2011-03-21T18:09:21.887 | 224,976 | 224,976 | [
"visual-studio"
]
|
5,381,670 | 1 | 5,381,741 | null | 3 | 11,753 | I add all row `CheckBox` in my `Gridview` helping with this [article](http://www.asp.net/data-access/tutorials/adding-a-gridview-column-of-checkboxes-cs).
Here is my `Calculate Button` code;
```
protected void Calculate_Click(object sender, EventArgs e)
{
bool atLeastOneRowDeleted = false;
foreach (GridViewRow row in GridView1.Rows)
{
CheckBox cb = (CheckBox)row.FindControl("ProductSelector");
if (cb != null && cb.Checked)
{
atLeastOneRowDeleted = true;
int productID = Convert.ToInt32(GridView1.DataKeys[row.RowIndex].Value);
Response.Write(string.Format( "This would have deleted ProductID {0}<br />", productID));
}
}
}
```
But when i do that, getting strange error like this;

How can i solve this problem?
Best Regards, Soner
| Index was out of range error in Gridview | CC BY-SA 2.5 | 0 | 2011-03-21T18:02:20.770 | 2011-03-21T18:51:15.127 | null | null | 447,156 | [
"c#",
".net",
"asp.net",
"gridview"
]
|
5,381,764 | 1 | null | null | 4 | 578 | 
QUESTION: Why does the debugger show "directagents\a\aanodide" instead of the value of the verbatim string @"directagents\aanodide".
This seems to be a ReSharper quirk.
To Reproduce:
1. Enter a literal string with a "\a" in it.
2. Apply the refactor "Change to Verbatim Sring" "\a" becomes invisible in th verbatim string "\a" is not really gone.
More evidence from immediate window showing Hand Typed VS. Copy/Paste.

| why is this verbatim string not working as I expect for a unit test assert and showing a strange value in debugger? | CC BY-SA 2.5 | 0 | 2011-03-21T18:11:59.670 | 2011-03-21T19:15:07.227 | 2011-03-21T19:15:07.227 | 106,224 | 398,546 | [
"c#",
"debugging",
"mstest",
"verbatim"
]
|
5,381,833 | 1 | 5,400,486 | null | 6 | 3,460 | In SSIS, if I start with one step, then have a lot of steps that can happen all at once, and then have another single step after all of those are done, the constraint lines are all over the place. It's ugly and that makes it hard to read. I can move them around, but the next time I load the package, they are ugly again. Is there a way to make them stay where I put them, so I can keep this looking neat?
Here is a partial picture of what I am talking about (This graphic doesn't show up for me).
Lacking the graphic, here is an example in words:
```
step 1: start a log file
step 2 (10 of them): load file 1 through load file 10
step 3: create a flag file
step 4: ftp all the files to another location
```
| How to keep SSIS constraint lines neat? | CC BY-SA 2.5 | null | 2011-03-21T18:17:50.710 | 2011-03-24T11:24:21.327 | 2011-03-22T00:15:19.667 | 22,523 | 22,523 | [
"visual-studio-2008",
"sql-server-2008",
"ssis"
]
|
5,381,991 | 1 | 5,382,217 | null | 1 | 924 | I have a browse button that I want to edit. Here is how I made it:
```
<input type = "file" id = "myBrowseButton" class = "BrowseButtons" name = "Browse" />
```
The button looks like you regular browse button but I want it to look like this:

I have been asking around and doing research, and from what I can tell the only (not incredibly long and time consuming) way to edit this would be to find some utility that will do it for me and mess around with that. Where would I be able to find said utility/ is there another (not extremely time consuming) way to edit this?
| Editing a browse button | CC BY-SA 2.5 | null | 2011-03-21T18:31:49.353 | 2012-10-01T09:56:38.357 | null | null | 650,489 | [
"html",
"css"
]
|
5,382,236 | 1 | 5,382,708 | null | 5 | 7,312 | I am puzzled that there are two entries to enter for the code sign identity. Am not sure whether this was the same in Xcode 3 but in Xcode 4 I see (in the Build Settings) something like this:

In the project.pbxproj for "Distribution" it looks like this
```
CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
```
I cannot find anywhere any documentation what the difference is, but maybe I am overlooking it (in the documentation). I am confused about which one to set and now I set both. But I do not like the "I don't know what I am doing but I it works" feeling. It seems to me like the first one (CODE_SIGN_IDENTITY) is not needed for iPhone development. Because for "Debug" and "Release" I have not changed the value since I migrated from Xcode 3 to Xcode 4 and in project.pbxproj I can see only "CODE_SIGN_IDENTITY[sdk=iphoneos*]" is present.
So back to my question does anyone know what "CODE_SIGN_IDENTITY[sdk=iphoneos*]" means and what is the differences to CODE_SIGN_IDENTITY and whether CODE_SIGN_IDENTITY is needed and whether Apple has something documented about this anywhere?
| What does CODE_SIGN_IDENTITY[sdk=iphoneos*] mean | CC BY-SA 2.5 | 0 | 2011-03-21T18:54:42.070 | 2011-04-20T13:44:48.407 | null | null | 382,009 | [
"iphone",
"xcode",
"sdk",
"xcode4"
]
|
5,382,402 | 1 | 5,382,494 | null | 32 | 27,518 | In WCF you can define a contract using the `[DataContract]` and `[DataMember]` attributes, like this:
```
[DataContract]
public class Sample
{
[DataMember(EmitDefaultValue = false, IsRequired = false)]
public string Test { get; set; }
}
```
[This article on the MSDN](http://msdn.microsoft.com/en-us/library/aa347792.aspx) states that using `EmitDefaultValue = false` is not recommended:

However, i like to use this, because the XML that is generated using this construction is cleaner. Not specifying this setting results in:
```
<Sample>
<Test xsi:nil="true"/>
</Sample>
```
while using the setting the element is ommited when there is no value:
```
<Sample>
</Sample>
```
I'm curious to what the reasoning behind that statement is. Specifically since both snipptes of XML look equivalent to me (and both last part can be deserialized correctly for this contract).
| Why is using [DataMember(EmitDefaultValue = false)] not recommended? | CC BY-SA 2.5 | 0 | 2011-03-21T19:08:26.210 | 2017-07-07T01:43:39.643 | null | null | 62,662 | [
"wcf",
"msdn",
"datacontract",
"datamember"
]
|
5,382,442 | 1 | 5,382,849 | null | 3 | 4,608 | I am working on a project(I have to implement it in Perl but I am not good at it) that reads DNA and finds its RNA. Divide that RNA's into triplets to get the equivalent protein name of it. I will explain the steps:
1) Transcribe the following DNA to RNA, then use the genetic code to translate it to a sequence of amino acids
Example:
```
TCATAATACGTTTTGTATTCGCCAGCGCTTCGGTGT
```
2) To transcribe the DNA, first substitute each DNA for it’s counterpart (i.e., G for C, C for G, T for A and A for T):
```
TCATAATACGTTTTGTATTCGCCAGCGCTTCGGTGT
AGTATTATGCAAAACATAAGCGGTCGCGAAGCCACA
```
Next, remember that the Thymine (T) bases become a Uracil (U). Hence our sequence becomes:
```
AGUAUUAUGCAAAACAUAAGCGGUCGCGAAGCCACA
```
Using the genetic code is like that
```
AGU AUU AUG CAA AAC AUA AGC GGU CGC GAA GCC ACA
```
then look each triplet (codon) up in the genetic code table. So AGU becomes Serine, which we can write as Ser, or
just S. AUU becomes Isoleucine (Ile), which we write as I. Carrying on in this way, we get:
```
SIMQNISGREAT
```
I will give the protein table:

So how can I write that code in Perl? I will edit my question and write the code that what I did.
| DNA to RNA and Getting Proteins with Perl | CC BY-SA 2.5 | null | 2011-03-21T19:14:16.827 | 2018-05-21T08:01:44.613 | null | null | 453,596 | [
"perl",
"project",
"dna-sequence",
"protein-database"
]
|
5,382,450 | 1 | 5,391,037 | null | 0 | 94 | I'am reading this example, but Could you explain a little more, I dont get the part when it says "then we Normalize"...
I know
```
P(sun) * P(F=bad|sun) = 0.7*0.2 = 0.14
P(rain)* P(F=bad|rain) = 0.3*0.9 = 0.27
```
But where do they get
```
W P(W | F=bad)
-----------------
sun 0.34
rain 0.66
```
Example [from](http://inst.eecs.berkeley.edu/~cs188/fa10/slides/FA10%20cs188%20lecture%2018%20--%20decision%20diagrams%20%286PP%29.pdf)



| Desicion Network Example | CC BY-SA 2.5 | null | 2011-03-21T19:15:18.610 | 2012-04-05T18:44:39.233 | 2012-04-05T18:44:39.233 | 3,043 | 265,519 | [
"artificial-intelligence"
]
|
5,382,484 | 1 | 8,480,496 | null | 0 | 3,335 | Regarding using multiple stores, with different root categories:
I have 2 stores set up, with different roots. One has 14 products, the other 6.
If I use the following on my homepage (simply to show how many products are in the root category for that store - in this case with an ID of 8) I get 20 products - so all products in the store, from all roots:
```
$_testproductCollection = Mage::getModel('catalog/category')->load(8)
->getProductCollection()
->addAttributeToSelect('*')->load();
echo "NO. OF PRODUCTS IS ".$_testproductCollection->count();
```
However, if I change the ID to a sub-category, I get the correct amount of products. There are only 6 products in this root:

But the count shows 20 (as there's 20 in the whole store - or both roots).
Anyone know what's up? Is it a bug?
I also noticed that if you go to Manage Products and use the store view filter, it doesn't do anything, still showing 20 products in the store view whose root has only 6 products:

| Magento - Loading root collection loads all products | CC BY-SA 2.5 | null | 2011-03-21T19:19:38.190 | 2011-12-12T20:38:16.020 | 2011-03-21T19:36:50.547 | 161,056 | 161,056 | [
"magento"
]
|
5,382,608 | 1 | null | null | 0 | 151 | in my app i want to move objects (from touch using the code below) inside the red rectangle how to make this 
code :
```
UITouch *touch = [[event allTouches] anyObject];
CGPoint location = [touch locationInView:[touch view]];
if (insidethepaddle) {
object1.center = CGPointMake(location.x, location.y - 50);
}
```
| how to make margin | CC BY-SA 2.5 | null | 2011-03-21T19:31:08.140 | 2011-03-21T20:12:20.857 | null | null | 420,292 | [
"iphone",
"objective-c",
"cocoa-touch",
"uitouch"
]
|
5,382,666 | 1 | 5,382,895 | null | 6 | 14,704 | I've got three XBees. 2x PROs and a standard, all series 2s.
I've configured one PRO and one standard to be router/endpoints on channel 0 and PAN 234 (this is the default channel and PAN ID when selecting the "XBP24-B"/"XB24-B" "ZNET2.5 ROUTER/END DEVICE AT" profile (version 1247 for both).
However the one PRO I've set with the "ZNET 2.5 COORDINATOR AT" profile has a channel of E (though if I keep flashing the device with the same profile, this changes from 12-F).
Obviously if the coordinator doesn't have the same channel, nothing will work, but I can't see any way of setting the channel manually..?
The CH setting in X-CTU is read only, and I can see any other UI element to change the channel:
I've even been into the terminal and typed (words in brackets are what the terminal returns):
+++ (OK)
ATCH (E)
ATCH0 (ERROR)
ATCH 0 (ERROR)
ATCH00 (ERROR)
ATCH 00 (ERROR)
ATCH E (ERROR)
ATCHE (ERROR)
I've Googled and Googled to no avail. incredibly frustrating, can anyone help?!
I've had them working previous as a matter of fluke as I kept flashing the hardware until the channel numbers match up, but this is obviously ridiculous!
| How do you set the channel on a XBee PRO series 2? | CC BY-SA 2.5 | 0 | 2011-03-21T19:35:57.683 | 2016-12-16T16:53:01.093 | 2011-03-21T19:43:44.503 | 21,234 | 127,018 | [
"embedded",
"xbee"
]
|
5,382,772 | 1 | 5,390,148 | null | 42 | 87,655 | This is the message while trying to run under XCode 4 (it used to work under XCode 3):
No provisioned iOS devices are available. Connect an iOS device or choose an iOS simulator as the destination.
I have profiles for my device for this app... where should I be looking to correct this?

| Xcode cannot run using the selected device | CC BY-SA 3.0 | 0 | 2011-03-21T19:46:30.727 | 2016-02-05T02:25:51.893 | 2014-09-24T07:22:49.830 | 1,753,005 | 1,231,786 | [
"xcode4"
]
|
5,383,044 | 1 | 5,399,289 | null | 0 | 955 | I am trying to add MapWidget to VerticalPanel but the map added on the
left corner:

And I added marker and the marker should be centered on the image
I can't see the marker when I load the map. I should navigate to this
location to show map.
The code for this
```
private FormPanel form = new FormPanel();
private VerticalPanel main = new VerticalPanel();
public Map(){
ScrollPanel container = new ScrollPanel();
initWidget(container);
container.setStyleName("FuoEgForm");
form.setWidget(main);
main.setSpacing(6);
container.add(main);
}
public MapWidget addMapWidget(){
MapWidget map = new MapWidget();
//map.setSize("100%", "100%");
map.setStyleName("gwt-map");
map.removeMapType(MapType.getNormalMap());
map.removeMapType(MapType.getSatelliteMap());
map.addMapType(MapType.getPhysicalMap());
map.addMapType(MapType.getHybridMap());
map.setCurrentMapType(MapType.getHybridMap());
//map.setSize("100%", "100%");
map.setWidth("500px");
map.setHeight("500px");
main.add(map);
}
```
How can I solve this issue? The map should fill the gray
boundary?
| Error in GWT MapWidget | CC BY-SA 2.5 | null | 2011-03-21T20:10:16.523 | 2012-10-05T08:06:02.270 | 2011-03-21T20:15:08.833 | 333,786 | 565,140 | [
"gwt"
]
|
5,383,049 | 1 | 5,383,456 | null | 3 | 16,284 | I am going to be implementing the facebook application into my project, but I've ran into some roadblocks. First I read about the link that developers.facebook.com has posted:

I really don't know how to use the GitHub repository and add it to my app project, so I hope I can get some help with that,
Next, while I was continuing the rest, I found something that I might need help on as well:

So that's all I have for now, I just need to get through this first part, then I can continue on, so I hope someone can help me get on through that first part, thanks
(sorry if I had to post the pictures, I just really need to be specific and I'm sometimes having trouble with reading tutorials)
| Implementing Facebook into Xcode Project | CC BY-SA 2.5 | 0 | 2011-03-21T20:10:50.727 | 2011-03-21T20:45:14.097 | null | null | 616,482 | [
"iphone",
"objective-c",
"xcode",
"facebook",
"github"
]
|
5,383,177 | 1 | 5,383,785 | null | 1 | 2,286 | I'm having a strange problem trying to get an HTML email campaign to render the proper text I need.
I'm the legalese at the bottom of my email, there are instances where I need to add a trademark symbol. I've converted all those instances to `™`, `$#0153;` or `™`, and when I run the mail script locally, everything looks as it should, however when I run the script on the intended server, all those trademark instances show an empty box character instead.
I should note that elsewhere on the email, I'm using other HTML entities that render fine... `–`, `’`, `“` - No problems, only this damn ™ thats driving me crazy.
The offending code:
....`DisplayPort™ connectors, and/or DisplayPort™ compliant`....
renders as

| HTML Entities in email from php mail() | CC BY-SA 2.5 | null | 2011-03-21T20:22:17.260 | 2011-03-21T21:10:19.320 | 2011-03-21T20:42:39.217 | 186,626 | 186,626 | [
"php",
"email",
"html-entities"
]
|
5,383,281 | 1 | null | null | 0 | 433 | Its an interview question: What is the parent of session object?
As per scope(in image below) my answer is : application 
But, the answer was given as request.. as we can access session object from request context by request.getSession() method.
I am not able to understand how a single request can be parent of whole user session?
Sorry if i am breaking any question guidelines.
| Parent of session object: request or application | CC BY-SA 2.5 | null | 2011-03-21T20:32:11.260 | 2011-03-21T20:57:30.380 | null | null | 200,063 | [
"java",
"session",
"web-applications"
]
|
5,383,502 | 1 | 5,383,613 | null | 2 | 138 | I have a table that has patient information (name, dob, ssn, etc.) and a table that has lists of medications that they take. (aspirin, claritin, etc.) The tables are related by a unique id from the patient table. So, it's easy enough to pull all of Mary Smith's medications.
But, what I need to do is to show a paginated list of patients that shows their name, other stuff from the patient table and has a column with a line-separated list of their medications. Roughly, this:

If I do a simple left join, I get 3 repeated rows of Mary Smith with one medication per row.
The patient table can have thousands of records, so I don't want to do a query to get all the patients and then loop through and get their meds. And, because it's paginated based on patient, I can't figure out how to get the correct number of patients for the page, along with all their medications.
(The patients/medications thing is just a rough example of the data; so please don't suggest restructuring how the data is stored.)
| What's the most efficient way to pull the data from mysql so that it is formatted as follows: | CC BY-SA 2.5 | null | 2011-03-21T20:48:40.687 | 2011-03-21T20:58:26.750 | null | null | 56,830 | [
"php",
"mysql",
"performance"
]
|
5,383,599 | 1 | 5,383,683 | null | 1 | 1,726 | I am trying to insert 3 values into this B-Tree, 60, 61, and 62. I understand how to insert values when a node is full, and has an empty parent, but what if the parent is full?
For example, when I insert 60 and 61, that node will now be full. I can't extend the parent, or the parent of the parent (because they are full). So can I change the values of the parent? I have provided an image of the B-tree prior to my insert, and after.

Attempt to insert 60, 61, 62:

Notice I changed the 66 in the root to 62, and added 62 to to the <72 node. Is this the correct way to do this?
| How to do B-Tree Insert | CC BY-SA 2.5 | null | 2011-03-21T20:55:42.333 | 2011-03-21T21:01:49.550 | null | null | 454,592 | [
"data-structures",
"b-tree"
]
|
5,383,653 | 1 | null | null | -1 | 303 | I want to basically create this kind of layout:

What would be the best way to achieve this?
| How to achieve this layout? | CC BY-SA 2.5 | null | 2011-03-21T20:59:37.497 | 2011-05-05T11:41:16.220 | null | null | 1,178,669 | [
"html",
"css",
"gwt",
"uibinder"
]
|
5,384,343 | 1 | 5,390,106 | null | 0 | 1,584 | I have created a universal window based application in xcode 4. Additionally I created a `FirstViewController` class with a `FirstViewController.xib` file.
I dragged a `Navigation Controller` to the objects panel for the `MainWindow_iPhone.xib`. I want the root controller to be the FirstViewController so I selected it in the custom class property.
I now want the view to be loaded from `FirstViewController.xib` but I can't select it in the NIB name selector, it just is not listed there. When I type it in it says that it is not intended to be there.
The strange thing is that exactly this procedure worked for me in xcode 3.2.6
Any ideas?

| How to select NIB for view controller in xcode4? | CC BY-SA 3.0 | 0 | 2011-03-21T22:08:38.073 | 2011-06-12T08:22:56.160 | 2011-05-11T16:17:05.943 | 401,025 | 401,025 | [
"objective-c",
"xcode",
"xcode4"
]
|
5,384,431 | 1 | 5,384,450 | null | 91 | 30,340 | 
see these dotted lines there on every indent...
How do I turn it off?
I must have accidentally hit some keyboard shortcut but I can't find this anywhere in the settings.
Sorry, this is a really dumb question, but these lines really bother me and I didn't know where else to turn :)
| How to disable the indentation dotted line in VS 2010 | CC BY-SA 3.0 | 0 | 2011-03-21T22:20:49.750 | 2015-10-01T23:16:37.003 | 2013-08-05T23:02:27.847 | 97,385 | 537,925 | [
"visual-studio-2010",
"visual-studio",
"visual-studio-2012",
"text-editor"
]
|
5,384,511 | 1 | 5,384,560 | null | 2 | 73 | 
Many programs are using it, usually with long-click. Can I find it from Eclipse Android GUI editor?
| What is this widget/element called in Android? | CC BY-SA 2.5 | null | 2011-03-21T22:30:30.340 | 2011-03-21T22:35:23.073 | null | null | 473,539 | [
"android"
]
|
5,384,665 | 1 | 5,385,124 | null | 0 | 1,441 | I've got a point in 2d image for example the red Dot in the given picture and a set of n points blue dot (x1,y1)...(xn,yn) and I want to find nearest point to (x0,y0) in a way better than trying all points. Like to have best possible solution. Would appreciate if you share any similar class if you have.

| Finding the nearest XY coordinates | CC BY-SA 3.0 | null | 2011-03-21T22:49:29.217 | 2017-07-28T02:26:26.577 | 2017-07-28T02:26:26.577 | 1,033,581 | 357,037 | [
"c++",
"qt",
"visual-c++"
]
|
5,385,011 | 1 | null | null | 1 | 125 | I'd like to close down my application programs and services before the Windows dialog prompts for 'in use applications to be closed'. The reason for this is that not all users will be aware of the services and apps that are running. I have tried custom actions, Uninstall() OnBeforeUninstall() etc, but these fire AFTER the windows dialog is displayed. Does anyone know of how to do this? (By the way, the uninstaller works ok... its just not too friendly.) The dialog I'm referring to is shown below...

| How do I stop programs and services before the Windows Uninstaller runs | CC BY-SA 2.5 | null | 2011-03-21T23:35:05.777 | 2011-03-22T08:13:17.837 | 2011-03-22T08:13:17.837 | 274,535 | 457,588 | [
"windows-installer"
]
|
5,385,103 | 1 | 5,386,169 | null | 22 | 20,848 | How can I make a Mathematica graphics that copies the behaviour of [complex_plot](https://doc.sagemath.org/html/en/reference/plotting/sage/plot/complex_plot.html) in sage? i.e.
> ... takes a complex function of one
variable, and plots output of the
function over the specified xrange and
yrange as demonstrated below. The
magnitude of the output is indicated
by the brightness (with zero being
black and infinity being white) while
the argument is represented by the hue
(with red being positive real, and
increasing through orange, yellow, ...
as the argument increases).
Here's an example (stolen from M. Hampton of [Neutral Drifts](http://neutraldrifts.blogspot.com/)) of the zeta function with overlayed contours of absolute value:

In the Mathematica documentation page [Functions Of Complex Variables](http://reference.wolfram.com/mathematica/guide/FunctionsOfComplexVariables.html) it says that you can visualize complex functions using `ContourPlot` and `DensityPlot` "potentially coloring by phase". But the problem is in both types of plots, `ColorFunction` only takes a single variable equal to the contour or density at the point - so it seems impossible to make it colour the phase/argument while plotting the absolute value. Note that this is not a problem with `Plot3D` where all 3 parameters `(x,y,z)` get passed to `ColorFunction`.
I know that there are other ways to visualize complex functions - such as the "neat example" in the [Plot3D docs](http://reference.wolfram.com/mathematica/ref/Plot3D.html#347161167), but that's not what I want.
Also, I do have [one solution below](https://stackoverflow.com/questions/5385103/plot-a-complex-function-in-mathematica/5386801#5386801) (that has actually been used to generate some graphics used in Wikipedia), but it defines a fairly low level function, and I think that it should be possible with a high level function like `ContourPlot` or `DensityPlot`. Not that this should stop you from giving your favourite approach that uses a lower level construction!
---
There were some nice articles by Michael Trott in the Mathematica journal on:
Visualizing Riemann surfaces [of algebraic functions](http://library.wolfram.com/infocenter/Articles/3014/), [IIa](http://library.wolfram.com/infocenter/Articles/901/), [IIb](http://library.wolfram.com/infocenter/Articles/1987/), [IIc](http://library.wolfram.com/infocenter/Articles/3900/), [IId](http://library.wolfram.com/infocenter/Articles/4556/).
Visualizing Riemann surfaces [demo](http://library.wolfram.com/examples/riemannsurface/).
[The Return of Riemann surfaces (updates for Mma v6)](http://www.mathematica-journal.com/issue/v10i4/Corner10-4.html)
Of course, Michael Trott wrote the [Mathematica guide books](http://www.mathematicaguidebooks.org/), which contain many beautiful graphics, but seem to have fallen behind the accelerated Mathematica release schedule!
| Plot a complex function in Mathematica | CC BY-SA 4.0 | 0 | 2011-03-21T23:52:05.860 | 2021-10-24T10:41:23.777 | 2021-10-20T08:53:30.417 | 353,337 | 421,225 | [
"wolfram-mathematica",
"visualization",
"plot",
"complex-numbers"
]
|
5,385,199 | 1 | null | null | 1 | 742 | So I've implemented my own version of a camera app on Android. Everything seems to work well except I have a user with a MyTouch 4G and his images are turning out striped and messed up:

Any ideas on what could be causing this? Has anyone seen this before?
Also: Users with other devices are having their pictures come out just fine.
Edit: I've now been able to see this happen on the device. When taking the picture about half the screen flashes green. Then the picture comes out as seen above. I've tried saving the byte[] many different ways. It seems the data I'm getting really is corrupt. I'm using the jpeg onPictureTaken callback and just saving off that byte[]. And again. I've ONLY been able to see this on a few MyTouch 4G devices. I really am at a loss here. Any help?
| Banding in saved image from Camera on Android | CC BY-SA 2.5 | 0 | 2011-03-22T00:04:52.390 | 2011-04-13T23:16:12.217 | 2011-03-23T23:17:12.510 | 369,649 | 369,649 | [
"android",
"image",
"camera"
]
|
5,385,605 | 1 | null | null | 4 | 266 | I'm trying to find a way to detect the radius of the themed window corner (pls, see the picture attached). E.g. for Aero theme when DWM is on all corners have radius 8, when DWM is off only top corners are curvy and have radius 6. Right now I'm hardcoding settings for different themes, and my questions is there more intelligent way of detecting these settings?

So far I looked to the windows visual styles api (UxTheme.dll) and can't find how to get the correct radius, it always the same for Aero no matter if DWM is on or off.
TIA
| How to correctly detect the corner radius for themed window | CC BY-SA 2.5 | null | 2011-03-22T01:04:46.987 | 2011-03-22T06:34:22.990 | null | null | 670,363 | [
"c#",
"windows",
"themes",
"pinvoke"
]
|
5,385,878 | 1 | null | null | 0 | 68 | I'm following a guide, which says this:
Once the cert if approved you can go download and install the cert under the Certificates menu.
Once your certs are in place you need to add your device to the list of “Devices”.
When i double clicked the cert file, it added itself to keychain access like so:

Should it appear under both private key and public key, and if so, how do i get it to do that?
| Installing certs? Have i done this right? | CC BY-SA 2.5 | null | 2011-03-22T01:52:05.310 | 2011-03-22T04:57:10.253 | 2011-03-22T04:49:22.700 | 561,395 | 561,395 | [
"iphone",
"xcode",
"key",
"keychain"
]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.