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,036,632 | 1 | 5,036,754 | null | 0 | 256 | How does one get the pop up menu selection for email, mms etc which is used when an image is selected on the iphone.

Another thing, How can one add things to this menu e.g. facebook share, twitter share? What is the name of this menu?
| Sending MMS and Email from within app | CC BY-SA 2.5 | null | 2011-02-18T01:01:36.760 | 2011-02-18T01:29:57.320 | null | null | 356,387 | [
"iphone"
]
|
5,036,664 | 1 | 5,052,956 | null | 0 | 364 | I want to display a 'flow' chart of a process showing time spent in children relative to the parent. For example, say that I have MethodA which calls MethodB and MethodC. 30% of the time relative to MethodA in MethodB and 70% in MethodC. I want to display something like this:

I know this is a sort of vague question, so to narrow the scope, I don't know what kind of chart this might be. What kind of Libraries might provide the capability to display this type of chart?
| How to create a caller/callee graph? | CC BY-SA 2.5 | null | 2011-02-18T01:08:16.487 | 2011-02-19T19:20:38.920 | 2011-02-19T19:08:21.580 | 92,692 | 92,692 | [
"c#",
"winforms",
"charts"
]
|
5,036,772 | 1 | 5,036,784 | null | 2 | 748 | I'm using jQuery UI Datepicker and hooked it with a text field in the simplest way possible.
```
$('#date').datepicker();
```
But when I click the text field, the Datepicker looks like this:

Why's that? Do I need to install skin or something?
Thanks.
| jQuery UI Datepicker - why's it naked? | CC BY-SA 2.5 | 0 | 2011-02-18T01:28:01.467 | 2011-02-18T01:49:56.983 | 2011-02-18T01:33:13.710 | 407,236 | 407,236 | [
"jquery",
"jquery-ui"
]
|
5,036,788 | 1 | null | null | 19 | 8,330 | 
As shown in above diagram ... the `lineHeight` is the height of the orange box. How can I get the height of the blue box (i.e. `lineHeight` + line spacing height)? Thanks!
UPDATE: I found the the `lineHeight` behaves differently depends on the characters in content. If the content is all in English, the lineHeight is corrent (21, for example, in the default UITextView). However, when the content is mixed with Chinese characters, the UIFont `lineHeight` is still reported as 21 while the `self.textView.contentSize.height` is increased differently:
```
English - adding 21 points for each line
Chinese - adding 24 points for each line
```
UPDATE (`sizeWithFont:`)
```
CGSize constrainedRect = CGSizeMake(1000, 1000);
CGSize rectEnglish = [@"hello\nworld" sizeWithFont:self.textView.font constrainedToSize:constrainedRect lineBreakMode:UILineBreakModeWordWrap];
NSLog(@"width: %.2f height: %.2f", rectEnglish.width, rectEnglish.height);
CGSize rectChinese = [@"你\n好嗎" sizeWithFont:self.textView.font constrainedToSize:constrainedRect lineBreakMode:UILineBreakModeWordWrap];
NSLog(@"width: %.2f height: %.2f", rectChinese.width, rectChinese.height);
```
output:
```
width: 41.00 height: 42.00
width: 34.00 height: 42.00
```
| How to get height of a line in UITextView | CC BY-SA 2.5 | 0 | 2011-02-18T01:31:48.620 | 2011-02-18T04:08:55.670 | 2011-02-18T04:08:55.670 | 88,597 | 88,597 | [
"iphone",
"uitextview"
]
|
5,036,958 | 1 | null | null | 3 | 2,823 | There is [a really simple tutorial on implementing a system tray icon](http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javase6/systemtray/).
The problem is, I can see the icon in tray if I run my app from eclipse, but I can't see it if I export and run a runnable jar file. I have other images in my app that work fine form the same folder.
The tray is working (left and right click on it) but doesn't show the image, like you can see in the image (the jar file on top, with eclipse on bottom):

Why? Thank you and sorry for my english!
: I finally found the solution the image need to be accessed whit:
```
Image img = Toolkit.getDefaultToolkit().getImage(MyClass.class.getResource("/images/asd.png"));
```
| Java SystemTray icon | CC BY-SA 2.5 | null | 2011-02-18T02:07:06.200 | 2011-02-18T15:49:54.973 | 2011-02-18T15:49:54.973 | 40,342 | 613,631 | [
"java",
"icons",
"tray"
]
|
5,037,085 | 1 | 5,037,109 | null | 1 | 2,066 | I have been given the task of coding the form below. I was planning to do it using tables, however my instructor told me to do it using , since it takes up more resources or something(I think he said it was intensive). I can do it using divs, but I think it is a waste of time because I could make the below form easily using tables(I mean quickly).
Any ideas as to how to proceed, what to use, or or some thing ??

| How to code html forms which are complex? | CC BY-SA 3.0 | null | 2011-02-18T02:31:26.623 | 2012-01-13T21:34:08.077 | 2012-01-13T21:34:08.077 | 861,565 | 350,648 | [
"html",
"semantic-markup"
]
|
5,037,502 | 1 | null | null | 8 | 9,698 | I want to convert RGB image into Below Image. I am using ImageMagick Library . I want help to know that by which functions i can convert in Original Image into Image-2. Here is below two images. I would like to use Only ImageMagick Library. I would like to do Image Processing simillar to this [Link](https://stackoverflow.com/questions/4062365/turning-photo-into-cartoon-using-php) in Objective C.


| Edge Detection of Image in iPhone Using Image Magick | CC BY-SA 2.5 | 0 | 2011-02-18T04:09:20.660 | 2012-12-07T07:21:39.000 | 2017-05-23T12:01:09.563 | -1 | 1,511,093 | [
"iphone",
"ios",
"ios4",
"imagemagick"
]
|
5,037,510 | 1 | 5,037,776 | null | 1 | 1,222 | I have a split View Controller iPad app. Its a port of a iPhone version that relied heavily on the tab bar. Since you cannot put a split view controller into a tab bar (or at least shouldn't, or so I've read) I settled on a design where the tabbar controller is inside the detail view controller of the split view controller.
This works fine. However, the tabbar is showing 8 tabs rather than 5 like on the iPhone. This makes for an incredibly cramped tab bar.
I know on the iPhone the 4+more is unchangable. Does anyone know if there's a way to make the iPad only show 4 icons or 5 icons on the tabbar?

| how to reduce number of tab bar items shown on iPad | CC BY-SA 2.5 | null | 2011-02-18T04:10:36.980 | 2015-02-11T07:11:59.213 | null | null | 213,806 | [
"ipad",
"ios",
"uitabbarcontroller"
]
|
5,037,547 | 1 | null | null | 4 | 507 | Well, i was looking on [QCompleter](http://doc.trolltech.com/4.2/qcompleter.html), it's pretty cool of what i can see. But i looked on Visual Studio 2010 that when you do for example: MessageBox(HWND hWnd, it shows a rectangle (white background, black text) that shows MessageBox(, LPCWSTR lpText, LPCWSTR lpCaption, UNIT uType); What i mean it's highlights the position you are.
Here is an image:

| Advanced QCompleter | CC BY-SA 2.5 | 0 | 2011-02-18T04:18:17.523 | 2011-02-18T04:32:18.927 | null | null | 620,154 | [
"c++",
"windows",
"qt",
"qt-creator",
"nokia"
]
|
5,037,588 | 1 | null | null | 37 | 16,718 | I have a detailed 2D polygon (representing a geographic area) that is defined by a very large set of vertices. I'm looking for an algorithm that will simplify and smooth the polygon, (reducing the number of vertices) with the constraint that the of the resulting polygon must contain all the vertices of the detailed polygon.
For context, here's an example of the edge of one complex polygon:

My research:
- I found the Ramer–Douglas–Peucker algorithm which will reduce the number of vertices - but the resulting polygon will not contain all of the original polygon's vertices. See this article [Ramer-Douglas-Peucker on Wikipedia](http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm)- I considered expanding the polygon (I believe this is also known as outward polygon offsetting). I found these questions: [Expanding a polygon (convex only)](https://stackoverflow.com/questions/3749678/expand-fill-of-convex-polygon) and [Inflating a polygon](https://stackoverflow.com/questions/1109536/an-algorithm-for-inflating-deflating-offsetting-buffering-polygons). But I don't think this will substantially reduce the detail of my polygon.
Thanks for any advice you can give me!
| Simplified (or smooth) polygons that contain the original detailed polygon | CC BY-SA 2.5 | 0 | 2011-02-18T04:24:08.810 | 2020-09-14T03:22:41.533 | 2017-05-23T10:32:36.017 | -1 | 345,450 | [
"algorithm",
"geometry",
"gis",
"polygon",
"computational-geometry"
]
|
5,037,606 | 1 | 5,037,696 | null | 0 | 2,981 | I have this problem with css: a dynamic div contains a single line of text that I need to be wrapped every time the div resizes its width to a smaller size.
But my problem is that the text is inside the table. It is not a pure text, it actually serves as a directory of the contacts somehow like a paging.
Please refer to the images that I have attached for a better view of my problem. I also attached part of the code that I have below. See the attached image for a better understanding of the problem.
I'm not well versed in css, so I'm hoping you can suggest a better layout for this.
Hope you can help me. Thank you! :)
```
<div id="divSearch" style="width:350px">
<p style="word-wrap:break-word;white-space:pre-wrap;">
<table id="tblGlossary">
<tr>
<td class="glossary"><a href="#" >#</a></td>
<td align="right"> </td>
<td class="glossary"><a href="www.abc.com?tag=A'">A</a></td>
<td align="right"> </td>
<td class="glossary"><a href="www.abc.com?tag=B'">B</a></td>
<td align="right"> </td>
<td class="glossary"><a href="www.abc.com?tag=C'">C</a></td>
<td align="right"> </td>
<td class="glossary"><a href="www.abc.com?tag=D'">D</a></td>
<td align="right"> </td>
<td class="glossary"><a href="www.abc.com?tag=E'">E</a></td>
<td align="right"> </td>
<td class="glossary"><a href="www.abc.com?tag=F'">F</a></td>
<td align="right"> </td>
<td class="glossary"><a href="www.abc.com?tag=G'">G</a></td>
<td align="right"> </td>
<td class="glossary"><a href="www.abc.com?tag=H'">H</a></td>
<td align="right"> </td>
<td class="glossary"><a href="www.abc.com?tag=I'">I</a></td>
<td align="right"> </td>
<td class="glossary"><a href="www.abc.com?tag=J'">J</a></td>
<td align="right"> </td>
<td class="glossary"><a href="www.abc.com?tag=K'">K</a></td>
<td align="right"> </td>
<td class="glossary"><a href="www.abc.com?tag=L'">L</a></td>
<td align="right"> </td>
<td class="glossary"><a href="www.abc.com?tag=M'">M</a></td>
<td align="right"> </td>
<td class="glossary"><a href="www.abc.com?tag=N'">N</a></td>
<td align="right"> </td>
<td class="glossary"><a href="www.abc.com?tag=O'">O</a></td>
<td align="right"> </td>
<td class="glossary"><a href="www.abc.com?tag=P'">P</a></td>
<td align="right"> </td>
<td class="glossary"><a href="www.abc.com?tag=Q'">Q</a></td>
<td align="right"> </td>
<td class="glossary"><a href="www.abc.com?tag=R'">R</a></td>
<td align="right"> </td>
<td class="glossary"><a href="www.abc.com?tag=S'">S</a></td>
<td align="right"> </td>
<td class="glossary"><a href="www.abc.com?tag=T'">T</a></td>
<td align="right"> </td>
<td class="glossary"><a href="www.abc.com?tag=U'">U</a></td>
<td align="right"> </td>
<td class="glossary"><a href="www.abc.com?tag=V'">V</a></td>
<td align="right"> </td>
<td class="glossary"><a href="www.abc.com?tag=W'">W</a></td>
<td align="right"> </td>
<td class="glossary"><a href="www.abc.com?tag=X'">X</a></td>
<td align="right"> </td>
<td class="glossary"><a href="www.abc.com?tag=Y'">Y</a></td>
<td align="right"> </td>
<td class="glossary"><a href="www.abc.com?tag=Z'">Z</a></td>
</tr>
</table>
</p>
</div>
```


| wrap a single line of text in a dynamic div | CC BY-SA 2.5 | null | 2011-02-18T04:27:37.600 | 2011-02-18T04:41:26.080 | 2011-02-18T04:31:04.710 | 405,015 | 249,580 | [
"html",
"css"
]
|
5,037,796 | 1 | 5,037,818 | null | 4 | 16,311 | I want to draw a circle with sectors on it without using external images like the image below:

I'd prefer using HTML, CSS, or jQuery, but if they don't work, then any other language will do.
| Drawing a circle (with sectors) using HTML, CSS, or jQuery | CC BY-SA 2.5 | 0 | 2011-02-18T04:56:39.073 | 2016-04-07T17:38:35.787 | 2011-02-18T05:19:26.883 | 365,102 | 510,435 | [
"jquery",
"html",
"css",
"geometry"
]
|
5,038,348 | 1 | 5,039,247 | null | 1 | 208 | I have a small problem in html forms. When I give the following css,
```
.row .section-1 label {/* Formatting all section-1 labels */
padding: 0 5px 0 10px;
margin: 3px 0 0 0;
display:block;
```
}
This is the output that I get :

However when I edit the css to put padding in the form of a percentage:
```
.row .section-1 label {/* Formatting all section-1 labels */
padding: 0 40% 0 80%;
margin: 3px 0 0 0;
display: block;
}
```
This is the output I get :

I want to use percentages, however I want the look in the first image. Any ideas??
Thanks
| Text goes goes into separate lines when using a percentage padding | CC BY-SA 2.5 | null | 2011-02-18T06:32:59.440 | 2015-01-06T09:35:44.323 | 2020-06-20T09:12:55.060 | -1 | 350,648 | [
"html",
"css",
"forms",
"pixel"
]
|
5,038,689 | 1 | 5,038,823 | null | 1 | 1,750 | How do I style one column on my table to not have any borders?
I've been using the `<col/>` tag with an id so that I can style it with CSS.
Example of my CSS:
```
#table td, th {
vertical-align:middle;
text-align:center;
font-size:11px;
border:1px solid #E0E0E0;
}
#col {
width:300px;
border:none !important;
}
```

The above should make every cell in #table have borders, while the !important declaration should override the cascade above. What am I doing wrong here?
I made the below by making every `<td id="col">` and changing my col selector to `td#col`. I felt that this was a messy way to do things, I wanted better control over my table by not inserting an id tag into every td column.
| CSS styling html table columns using <col />, cascade help | CC BY-SA 2.5 | null | 2011-02-18T07:29:26.693 | 2011-02-18T08:43:37.363 | 2011-02-18T08:43:37.363 | 405,327 | 405,327 | [
"css",
"html-table"
]
|
5,038,724 | 1 | 5,038,777 | null | 1 | 1,944 | Please go thourgh Attached Image where i descirbed my scenario:
I want SQL Join query.
| Inner join query | CC BY-SA 2.5 | 0 | 2011-02-18T07:34:25.770 | 2017-04-12T09:46:24.480 | null | null | 578,083 | [
"sql",
"sql-server",
"join",
"inner-join"
]
|
5,038,877 | 1 | 5,039,006 | null | 0 | 226 | I've already asked this question, but I think I din't explain the problem well enough. So here we go again:

I've got a list. With a default background color as shown in the picture above. I want to make background change to color #EDEDED when hovered upon. Only Item 4. Item 3, item two should remain with the original background color.
How do I do that? My problem has been that when I hover on item 4, all parent items get their background color changed to #EDEDED also. Any JQuery or CSS solution is appreciated.
Here's the code for the list above:
```
<ul>
<li class='comment'>
<div class='comment-body'>
item 2
</div><abbr class='timestamp' title='2011-02-18 11:39:32'>2011-02-18 11:39:32</abbr>
<div class='aut'>
Anonymous
</div><a href='#comment_form' class='reply' id='2' name="2">Reply</a>
<ul id='comments-ul'>
<li class='comment'>
<div class='comment-body'>
item 3
</div><abbr class='timestamp' title='2011-02-18 11:40:07'>2011-02-18 11:40:07</abbr>
<div class='aut'>
Anonymous
</div><a href='#comment_form' class='reply' id='3' name="3">Reply</a>
<ul id='comments-ul'>
<li class='comment'>
<div class='comment-body'>
item 4
</div><abbr class='timestamp' title='2011-02-18 11:40:12'>2011-02-18
11:40:12</abbr>
<div class='aut'>
Anonymous
</div><a href='#comment_form' class='reply' id='4' name="4">Reply</a>
</li>
</ul>
</li>
</ul>
</li>
<li class='comment'>
<div class='comment-body'>
item 1
</div><abbr class='timestamp' title='2011-02-18 11:39:28'>2011-02-18 11:39:28</abbr>
<div class='aut'>
Anonymous
</div><a href='#comment_form' class='reply' id='1' name="1">Reply</a>
</li>
</ul>
```
| List Hover issue | CC BY-SA 4.0 | 0 | 2011-02-18T07:56:56.237 | 2019-08-08T23:29:54.787 | 2019-08-08T23:29:54.787 | 4,751,173 | 576,589 | [
"jquery",
"html",
"css"
]
|
5,039,131 | 1 | 5,039,301 | null | 4 | 2,333 | I was trying to Solve the [Defense of a Kingdom problem](https://www.spoj.pl/problems/DEFKIN/) and came up with an algorithm but it exceeds the time limit of the problem.
I want to know a good algorithm to solve this within the time limit.
The problem:
> Theodore implements a new strategy game “Defense of a Kingdom”. On
each level a player defends the Kingdom that is represented by a
rectangular grid of cells. The player builds crossbow towers in some
cells of the grid. The tower defends all the cells in the same row and
the same column. No two towers share a row or a column.The penalty of the position is the number of cells in the largest
undefended rectangle. For example, the position shown on the picture
has penalty 12.Help Theodore write a program that calculates the penalty of the given position.
## Input
The first line of the input file contains the number of test cases.Each test case consists of a line with three integer numbers: w —
width of the grid, h — height of the grid and n — number of crossbow
towers (1 ≤ w, h ≤ 40 000; 0 ≤ n ≤ min(w, h)).Each of the following n lines contains two integer numbers xi and yi —
the coordinates of the cell occupied by a tower (1 ≤ xi ≤ w; 1 ≤ yi ≤
h).
## Output
For each test case, output a single integer number — the number of
cells in the largest rectangle that is not defended by the towers.
## Example
Input:
1
15 8 3
3 8
11 2
8 6 Output: 12
| What's a good algorithm for Defense of a Kingdom? | CC BY-SA 3.0 | 0 | 2011-02-18T08:36:25.687 | 2020-04-03T04:52:56.833 | 2017-01-03T11:24:28.303 | 1,788,806 | 622,805 | [
"c++",
"algorithm"
]
|
5,039,378 | 1 | 5,040,709 | null | 6 | 1,254 | I use org mode to store shortcuts for my projects. Such org files contain mostly links which I create using `org-insert-link`. But sometimes the simple link is not sufficient so I have to use lisp functions. This works fine but it does not look very nice.

Is there a way to create a link which would call a lisp function?
| customized links in the org mode | CC BY-SA 2.5 | null | 2011-02-18T09:05:46.330 | 2011-02-18T11:26:35.863 | null | null | 59,704 | [
"emacs",
"org-mode"
]
|
5,039,818 | 1 | null | null | 2 | 545 | I have an assignment to design a database for storing mazes and games played on these mazes.
A maze is essentially a grid, containing prizes and traps. The assignment isn't more specific: it asks us to find some kind of general rules to express events that occur in game and rules for these events.
I've put down a simple conceptual schema of it:

Do you think that, based on my description of the assignment, this is a good solution? How can I improve it?
| How would you design a database for storing mazes and games played on the same mazes? | CC BY-SA 2.5 | null | 2011-02-18T09:54:18.363 | 2011-02-18T10:41:57.067 | 2011-02-18T10:04:59.607 | 173,773 | 318,937 | [
"database-design",
"uml"
]
|
5,040,067 | 1 | 5,040,575 | null | 16 | 4,589 | I get the following error while running my app.
I have not used sizeWithTextStyle in my entire project.
So what could be wrong?
I get error on `return pos;` statement below
```
(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
UIView *pos = [[UIView alloc] initWithFrame:CGRectMake(0.0,0.0,320.0,35.0)];
return pos;
}
```
`Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFString sizeWithTextStyle:]: unrecognized selector sent to instance 0x7044b50'`
Because of indentation problem while putting whole crash log here, I am putting the screenshot of the crash log

| Error: "-[NSCFString sizeWithTextStyle:]: unrecognized selector" in IPhone SDK | CC BY-SA 2.5 | 0 | 2011-02-18T10:18:59.057 | 2013-11-21T11:19:05.777 | 2011-02-21T10:13:36.973 | 463,857 | 463,857 | [
"iphone",
"objective-c",
"cocoa-touch",
"ios4"
]
|
5,040,207 | 1 | 5,042,754 | null | 1 | 1,140 | I am having a problem while debugging a unit test in Visual Studio 2008. The unit test uses a `System.Timers.Timer` (within the business logic) to handle a certain delay (1'000 miliseconds). The thread running the test is put to sleep for 5'000 miliseconds.
When running the test on its own, it passes. When running all tests (>120) it sometimes passes and sometimes fails (). I then tried setting a breakpoint in the mock object, where I set the flag that is asserted in the unit test. Now when I debug the test on its own, I get the phenomenon, that the `Assert.IsTrue()` fails but the Quick Watch tells me, that it is true:

```
public class ObjectManagerAccessMock : IObjectManagerAccess
{
public bool ExecuteCommandWasCalled { get; set; }
public void ExecuteCommand()
{
ExecuteCommandWasCalled = true; //set breakpoint here
}
}
```
Does the thread running the test continue to run, when another thread is stopped (through the breakpoint)?
| Unit test multi thread environment with breakpoints in Visual Studio 2008 | CC BY-SA 2.5 | null | 2011-02-18T10:31:31.077 | 2011-02-18T15:01:46.677 | null | null | 431,657 | [
"c#",
"multithreading",
"visual-studio-2008",
"unit-testing"
]
|
5,040,464 | 1 | 5,062,860 | null | 2 | 1,297 | I'm attempting to load a bitmap image from an images folder from within the res folder using - `Bitmap.getBitmapResource("/images/bg_general.png")`
But the image is not being found even though it exists at specified path. Im using blackberry eclipse plugin. Here is a snippet of my dir structure where the image is located -

| Subfolder in res folder not finding image | CC BY-SA 2.5 | null | 2011-02-18T11:00:16.663 | 2013-01-07T18:17:10.187 | null | null | 470,184 | [
"blackberry",
"blackberry-eclipse-plugin"
]
|
5,040,467 | 1 | 5,040,637 | null | 1 | 808 | After having hard times with performance in my winform app, I decided to redesign it to separate the processing step from the visual reporting step.
As a picture is worth a thousand words, I drew this for the purpose of this question :

Needless to say that Computing/Visualisation layers were separated, but the problem with the first configuration was that the amount of Data that was stored in live memory to be displayed on the flow was growing, growing, taking more and more RAM space, which resulted in the computing part to be squeezed up and taking longer and longer (linearly in time)
That's why I came up with the new design. Now this proved to be helpful and efficient : Processing first, using 100% memory to compute, and then only handling stored results to be displayed ( "generate report" button)
SO here is my simple question : What are my options for that, and which are most performance-friendly, (Caching, Serializing, Storing in files then reading them back, Lazy-Loading....)
Thanks in advance
EDIT :
Data is formed of simple and plain line records (actually times series) that could be stored in CSV format for example
| Better Architecture for .Net Performance : Caching, Serializing or Writing to disk? | CC BY-SA 2.5 | 0 | 2011-02-18T11:00:18.803 | 2011-02-18T12:08:49.993 | 2011-02-18T11:09:34.750 | 426,332 | 426,332 | [
"c#",
".net",
"architecture"
]
|
5,040,875 | 1 | 5,041,723 | null | 0 | 1,271 | ```
<xsd:element name="CurrencyCode" minOccurs="0" type="xsd:string">
<xsd:simpleType>
<xsd:restriction>
<xsd:length value="3"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
```
I want my Currencycode to be an optional value and if at all there is a value it should have a length of 3 letters .. either my CurrencyCode can have Length=0 or length=3
When i use the above code the validator returns an error when there is an empty field

So how can i deal with this ??
| xsd validation ERROR with both minOccurs and length used simultaneously | CC BY-SA 2.5 | null | 2011-02-18T11:43:46.100 | 2011-02-18T13:33:29.887 | 2011-02-18T13:33:29.887 | 36,305 | 410,693 | [
"xsd"
]
|
5,040,994 | 1 | 5,042,803 | null | 5 | 5,285 | I use Google Chrome as my default browser but prefer to use Internet Explorer for debugging Silverlight applications. I therefore set my web project properties thus and check the Silverlight debugger option.

This has worked fine for ages but since returning from vacation I find that the iexplore.exe process running silverlight is no longer attached to the debugger and I must attach it manually. When not debugging my app I can check the Debug | Attach to Process... dialog and see that there are no instances of iexplore.exe running. Then I hit F5 and start a debug session and look again, after which there are two instances, one of which is attached, but not the one running Silverlight. Once I attach the other too, debugging works fine and I can hit breakpoints and step through the code with no problem.

Any ideas on what I'm missing to get the debugger attaching to the correct process would be appreciated.
| Silverlight debugging; not attaching process | CC BY-SA 2.5 | 0 | 2011-02-18T11:56:44.823 | 2011-02-18T14:58:35.727 | null | null | 1,535 | [
"silverlight",
"debugging"
]
|
5,041,349 | 1 | 5,041,590 | null | 5 | 5,051 | I'm trying to subclass `NSCell` to draw a custom background highlight. The documentation seems to suggest that the overriding `highlight:withFrame:inView:` should allow me to do this but the method is never called.
Instead, I've overridden `drawInteriorWithFrame:inView:` which works fine - I can draw what I want in the cell. However, the issue is that I have to draw everything myself, losing the functionality of the type of NSCell I am extending - for example an NSTextFieldCell's ability to display text:
Custom drawn highlighted cell:

However, I just want to redraw the background (the highlight), and retain the ability to use the main functionality of the extended cell:

I could, of course, just draw the text myself too but I'm hoping there is an easier way of doing this.
Any help is much appreciated.
| NSCell Custom Highlight | CC BY-SA 2.5 | 0 | 2011-02-18T12:36:33.167 | 2011-02-18T13:03:24.070 | null | null | 348,308 | [
"cocoa",
"nscell"
]
|
5,041,606 | 1 | 8,931,075 | null | 0 | 2,355 | I am trying to use the QuantizeFilter in
[http://www.jhlabs.com/ip/filters/index.html](http://www.jhlabs.com/ip/filters/index.html)
to reduce the color depth of a screen shot.
Here is my very very simple code:
```
Robot robo = new Robot();
BufferedImage notQuantized = robo.createScreenCapture( new Rectangle ( 0, 0, 300, 300 ) );
BufferedImage Quantized = new BufferedImage( 300, 300, BufferedImage.TYPE_INT_BGR);
File nonquantized = new File ("C:\\nonquantized.png");
File quantized = new File("C:\\quantized.png");
nonquantized.createNewFile();
quantized.createNewFile();
QuantizeFilter bla = new QuantizeFilter();
int [] outPixels = new int[300*300*3];
int [] inPixels = new int[300*300*3];
notQuantized.getRaster().getPixels( 0, 0, 300, 300, inPixels );
bla.quantize( inPixels, outPixels, 300, 300,2, true, true );
Quantized.getRaster().setPixels( 0, 0, 300, 300, outPixels );
ImageIO.write( Quantized, "png", quantized );
ImageIO.write( notQuantized, "png", nonquantized );
```
However, what I am left with is:


A further analysis of the problem shows that the inPixels array is filled incorrectly; it is filled three times with the upper one-third of the original image.
Any pointers how I can fix that?
Additionally, any links good + fast quantization algorithm in Java? What I search for is an algorithm that will take a TYPE_INT_BGR image and produce a new TYPE_INT_BGR image but with less actual difference in pixels, so it could be easily deflated.
For example, if we have two pixels in the original image, with values like 255, 255, 234 and another one with value like 255, 255, 236, they should both be converted to 255,255,240. Cheers
| JH Labs Quantize Usage to reduce image color depth | CC BY-SA 2.5 | 0 | 2011-02-18T13:05:41.000 | 2012-10-20T11:14:16.847 | 2011-05-05T13:43:04.937 | 487,649 | 487,649 | [
"java",
"image",
"image-processing",
"quantization"
]
|
5,041,680 | 1 | 5,560,265 | null | 11 | 6,548 | i have a problem with WPF Binding. I want to bind a list of Months to a ItemsControl that shows a Calendar Control for each month. But each rendered Calendar shows DateTime.Now,not the bound DateTimes. Does anyone know why this is happening?
This is what i have so far:
```
<Window x:Class="CalendarListTest.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid>
<ItemsControl x:Name="calendarList">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Calendar DisplayDate="{Binding CurrentDate}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
```
** The place where the collection is assigned to the ItemsSource**
```
private void Window_Loaded( object sender, RoutedEventArgs e )
{
CalendarList list = new CalendarList( );
list.Add( new CalendarMonth( ) { CurrentDate = DateTime.Parse( "1.1.1979" ) } );
list.Add( new CalendarMonth( ) { CurrentDate = DateTime.Parse( "1.2.1979" ) } );
list.Add( new CalendarMonth( ) { CurrentDate = DateTime.Parse( "1.3.1979" ) } );
calendarList.ItemsSource = list;
}
```
:
```
public class CalendarMonth
{
private DateTime _currentDate;
public DateTime CurrentDate
{
get { return _currentDate; }
set { _currentDate = value; }
}
}
```
:
```
public class CalendarList : ObservableCollection<CalendarMonth>
{
}
```
Now, the result:

Why is this happening?
edit: When providing `<Calendar DisplayDate="{Binding CurrentDate, Mode=OneWay}" />` the binding works.
| WPF: binding viewmodel property of type DateTime to Calendar inside ItemsControl | CC BY-SA 2.5 | 0 | 2011-02-18T13:12:25.933 | 2014-03-20T08:14:42.407 | 2011-02-20T19:30:24.577 | 304,871 | 304,871 | [
"wpf",
"datetime",
"calendar",
"itemscontrol"
]
|
5,041,795 | 1 | null | null | 0 | 3,152 | Good day to all. I have a little problem:
How do I close the sleeping connections to a database?
When I issue a query the query is executed then the connection remains on sleep mode for 2-3 seconds. The problem is that I generate queries faster than they are closed.
Is there a way to force a connection to close before entering in the sleep mode? Or any workaround.
Thank you for help.
Note: The connections are not permanent, they close, but just to slow...
Note 2 - for the mysql_close(): The command is issued at the end of the query. Still the query goes into sleep mode before close. I attach a print screen in a min.

Notice the sleeping connections... they will be closed in 1-3 secs... but I generate another queries faster. I need to skip the sleep wasted time.
| SQL, PHP - Close a sleeping connection | CC BY-SA 2.5 | null | 2011-02-18T13:22:12.370 | 2012-10-25T07:21:27.350 | 2011-02-18T13:28:25.270 | 569,872 | 569,872 | [
"sql",
"mysql",
"database-connection",
"sleep"
]
|
5,041,994 | 1 | 5,042,034 | null | 1 | 337 | I have a bit of c code that I've been working on in Xcode on my mac. I then wanted to work with it on a Windows machine and compile it with TinyC. When I run it, the output is different.
Is it possible that this is due to using different compilers?
Thanks!
---
The code is a simple script that opens up a wav file to throw all the samples into an array.
```
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void read_wav_header(unsigned int *samp_rate, unsigned int *bits_per_samp,
unsigned int *num_samp);
void read_wav_data(int *data, unsigned int samp_rate,
unsigned int bits_per_samp, unsigned int num_samp);
int conv_bit_size(unsigned int in, int bps);
int main(void)
// int read_wav(void)
{
unsigned int samp_rate, bits_per_samp, num_samp;
read_wav_header(&samp_rate, &bits_per_samp, &num_samp);
printf("samp_rate=[%d] bits_per_samp=[%d] num_samp=[%d]\n",
samp_rate, bits_per_samp, num_samp);
int *data = (int *) malloc(num_samp * sizeof(int));
read_wav_data(data, samp_rate, bits_per_samp, num_samp);
unsigned int i;
// for (i = 0; i < num_samp; ++i) {
for (i = 0; i < 100; ++i) {
printf("%d\n", data[i]);
}
return EXIT_SUCCESS;
}
void read_wav_header(unsigned int *samp_rate, unsigned int *bits_per_samp,
unsigned int *num_samp)
{
unsigned char buf[5];
// freopen ("/Users/ericbrotto/Desktop/iPhoneData/tmp/Hack.wav","r",stdin);
freopen ("C:/Documents and Settings/Eric.Brotto/Desktop/Eric_Other/Files/Hack.wav","r",stdin);
/* ChunkID (RIFF for little-endian, RIFX for big-endian) */
fread(buf, 1, 4, stdin);
buf[4] = '\0';
if (strcmp((char*)buf, "RIFF")) exit(EXIT_FAILURE);
/* ChunkSize */
fread(buf, 1, 4, stdin);
/* Format */
fread(buf, 1, 4, stdin);
buf[4] = '\0';
printf("IS THIS WAVE? -->%s<--\n",(char*)buf);
if (strcmp((char*)buf, "WAVE")) exit(EXIT_FAILURE);
/* Subchunk1ID */
fread(buf, 1, 4, stdin);
buf[4] = '\0';
printf("IS THIS fmt? -->%s<--\n",(char*)buf);
if (strcmp((char*)buf, "fmt ")) exit(EXIT_FAILURE);
/* Subchunk1Size (16 for PCM) */
fread(buf, 1, 4, stdin);
if (buf[0] != 16 || buf[1] || buf[2] || buf[3]) exit(EXIT_FAILURE);
/* AudioFormat (PCM = 1, other values indicate compression) */
fread(buf, 1, 2, stdin);
if (buf[0] != 1 || buf[1]) exit(EXIT_FAILURE);
/* NumChannels (Mono = 1, Stereo = 2, etc) */
fread(buf, 1, 2, stdin);
unsigned int num_ch = buf[0] + (buf[1] << 8);
if (num_ch != 1) exit(EXIT_FAILURE);
/* SampleRate (8000, 44100, etc) */
fread(buf, 1, 4, stdin);
*samp_rate = buf[0] + (buf[1] << 8) +
(buf[2] << 16) + (buf[3] << 24);
/* ByteRate (SampleRate * NumChannels * BitsPerSample / 8) */
fread(buf, 1, 4, stdin);
const unsigned int byte_rate = buf[0] + (buf[1] << 8) +
(buf[2] << 16) + (buf[3] << 24);
/* BlockAlign (NumChannels * BitsPerSample / 8) */
fread(buf, 1, 2, stdin);
const unsigned int block_align = buf[0] + (buf[1] << 8);
/* BitsPerSample */
fread(buf, 1, 2, stdin);
*bits_per_samp = buf[0] + (buf[1] << 8);
if (byte_rate != ((*samp_rate * num_ch * *bits_per_samp) >> 3))
exit(EXIT_FAILURE);
if (block_align != ((num_ch * *bits_per_samp) >> 3))
exit(EXIT_FAILURE);
/* Subchunk2ID */
// fread reads line by line until the end.
fread(buf, 1, 4, stdin);
buf[4] = '\0';
if (strcmp((char*)buf, "data")) exit(EXIT_FAILURE);
/* Subchunk2Size (NumSamples * NumChannels * BitsPerSample / 8) */
fread(buf, 1, 4, stdin);
const unsigned int subchunk2_size = buf[0] + (buf[1] << 8) +
(buf[2] << 16) + (buf[3] << 24);
*num_samp = (subchunk2_size << 3) / (
num_ch * *bits_per_samp);
}
void read_wav_data(int *data, unsigned int samp_rate,
unsigned int bits_per_samp, unsigned int num_samp)
{
// freopen ("/Users/ericbrotto/Desktop/iPhoneData/tmp/Hack.wav","r",stdin);
freopen ("C:/Documents and Settings/Eric.Brotto/Desktop/Eric_Other/Files/Hack.wav","r",stdin);
unsigned char buf;
unsigned int i, j;
for (i=0; i < num_samp; ++i) {
unsigned int tmp = 0;
for (j=0; j != bits_per_samp; j+=8) {
fread(&buf, 1, 1, stdin);
tmp += buf << j;
}
data[i] = conv_bit_size(tmp, bits_per_samp);
}
}
int conv_bit_size(unsigned int in, int bps)
{
const unsigned int max = (1 << (bps-1)) - 1;
return in > max ? in - (max<<1) : in; // Supposedly this is not correct: http://ubuntuforums.org/showthread.php?p=10442711
// return in > max ? in - ((max<<1)+2) : in;
}
```
---
On my mac it outputs all the samples in the array (ints roughly between -32000 and 32000). Here I get the output you see in the image followed by a few million zeros.

| Different compilers, different output? | CC BY-SA 2.5 | 0 | 2011-02-18T13:43:03.187 | 2011-02-18T14:04:36.640 | 2011-02-18T14:04:36.640 | 385,559 | 385,559 | [
"compiler-construction"
]
|
5,042,432 | 1 | 5,042,497 | null | 0 | 809 | I have a table which has rows that alternate colors, when I hover over rows they are highlighted yellow.
I would like some of the rows to be highlighted all the time too(not just onhover). I have discovered however that most of the rows that are to be highlighted are right next to each other and it gives the effect that that part of the table is just yellow and it doesn't look that good.
I want to know if it is possible to create a small strip of highlighting through the middle of the row while the outsides remain their natural color.
This is what I have:
```
.resultTable tbody tr:nth-child(2n+1){
background-color:white;
}
.resultTable tbody tr:nth-child(2n){
background-color:#E6EBEC;
}
.resultTable tbody tr:nth-child(n):hover{
background-color: yellow;
}
.highlightedRow{
background-color:#F2F18D !important;
}
```
This is what I want:

UPDATE:
I cant seem to get the border method to work.
This is the closest I get but there is space between the borders.
```
.resultTable{
text-align:center;
width: 100%;
padding: 0px;
margin: 0px;
}
.resultTable thead{
background-color: #000099;
color: white;
font-size:22px;
font-weight:bold;
}
.resultTable caption{
background-color: #000099;
color: white;
font-size:22px;
font-weight:bold;
}
.resultTable tbody tr:nth-child(2n+1){
background-color:white;
border-top:2px solid green;
border-bottom:2px solid green;
}
.resultTable tbody tr:nth-child(2n){
background-color:#E6EBEC;
border-top:2px solid red;
border-bottom:2px solid red;
}
.resultTable td{
border:inherit;
}
.resultTable tbody tr:nth-child(n):hover{
background-color: yellow !important;
}
.highlightedRow{
background-color:#F2F18D !important;
}
```
Gives me:

By the way: i made them red and green on purpose to easily spot the problem.
| Highlight part of a table row | CC BY-SA 2.5 | null | 2011-02-18T14:25:29.207 | 2011-02-18T15:18:52.780 | 2011-02-18T15:18:52.780 | 280,354 | 280,354 | [
"css"
]
|
5,042,508 | 1 | null | null | 5 | 5,603 | I have problem with datatable using Primefaces 2.2.1 and JSF 2.0.
I have used filtering and paging in the datatable. When I try to filter the selected data is displayed and when i remove the filter the entire data is displayed. But after this when i try to use paging then suddendly all the rows becomes blank(empty)
See screenshot below



Any suggestions. Please help.
.xhtml file
```
<p:dataTable var="user" value="#{userManagedBean.searchUsersResults}"
selection="#{userManagedBean.selectedUser}" selectionMode="single"
dynamic="true"
onRowSelectUpdate="userUpdateForm"
onRowUnselectUpdate="userUpdateForm"
rowSelectListener="#{userManagedBean.onUserSelect}"
rowUnselectListener="#{userManagedBean.onUserUnselect}"
paginator="true" rows="10" style="width: 70% ">
<p:column sortBy="#{user.userId}" filterBy="#{user.userId}" >
<f:facet name="header">
<h:outputText value="Id" />
</f:facet>
<h:outputText value="#{user.userId}" />
</p:column>
<p:column sortBy="#{user.username}" filterBy="#{user.username}">
<f:facet name="header">
<h:outputText value="Name" />
</f:facet>
<h:outputText value="#{user.username}" />
</p:column>
<p:column sortBy="#{user.emailId}" filterBy="#{user.emailId}">
<f:facet name="header">
<h:outputText value="Email" />
</f:facet>
<h:outputText value="#{user.emailId}" />
</p:column>
<p:column sortBy="#{user.dob}" filterBy="#{user.dob}">
<f:facet name="header">
<h:outputText value="DOB" />
</f:facet>
<h:outputText value="#{user.dob}" >
<f:convertDateTime pattern="MM/dd/yyyy" />
</h:outputText>
</p:column>
</p:dataTable>
<p:panel id="userDetailsPanelId" header="Users Details" style="width:60%;">
<h:panelGrid columns="2" cellpadding="2" id="userUpdateForm" border="0" >
<h:outputLabel for="#{userManagedBean.selectedUser.userId}" value="UserId"/>
<h:inputText value="#{userManagedBean.selectedUser.userId}" style="width: 100%;" readonly="true"></h:inputText>
<h:outputLabel for="#{userManagedBean.selectedUser.username}" value="Username"/>
<h:inputText value="#{userManagedBean.selectedUser.username}" readonly="true"></h:inputText>
<h:outputLabel for="#{userManagedBean.selectedUser.emailId}" value="EmailId"/>
<h:inputText value="#{userManagedBean.selectedUser.emailId}" readonly="true"></h:inputText>
<h:outputLabel for="#{userManagedBean.selectedUser.gender}" value="Gender"/>
<h:inputText value="#{userManagedBean.selectedUser.gender}" readonly="true"></h:inputText>
<h:outputLabel for="#{userManagedBean.selectedUser.dob}" value="DOB"/>
<h:inputText value="#{userManagedBean.selectedUser.dob}" readonly="true">
<f:convertDateTime pattern="MM/dd/yyyy" />
</h:inputText>
</h:panelGrid>
</p:panel>
</h:form>
</center>
```
| after filtering Empty rows blank rows displayed while paging in the datatable using Primefaces | CC BY-SA 2.5 | null | 2011-02-18T14:31:50.830 | 2011-05-03T14:27:36.157 | null | null | 617,966 | [
"jsf",
"datatable",
"facelets",
"primefaces"
]
|
5,042,702 | 1 | 5,044,050 | null | 5 | 9,527 | I have datatables setup with a basic init. I want to be able to have checkboxes and a submit button below the table. Is there any way to customize the information "row" below the table?
This is what it looks like if I just add the submit button after the table

This is what I want it to look like

I need a solution that accounts for Javascript being on or off.
| jQuery Datatables adding custom form elements | CC BY-SA 2.5 | null | 2011-02-18T14:50:02.157 | 2012-09-26T07:14:05.833 | null | null | 49,887 | [
"jquery",
"datatables"
]
|
5,042,712 | 1 | 5,043,840 | null | 6 | 3,541 | I have several ordered List of X/Y Pairs and I want to calculate a ordered List of X/Y Pairs representing the average of these Lists.
All these Lists (including the "average list") will then be drawn onto a chart (see example picture below).
I have several problems:
1. The different lists don't have the same amount of values
2. The X and Y values can increase and decrease and increase (and so on) (see example picture below)
I need to implement this in C#, altought I guess that's not really important for the algorithm itself.

Sorry, that I can't explain my problem in a more formal or mathematical way.
EDIT: I replaced the term "function" with "List of X/Y Pairs" which is less confusing.
| calculate average function of several functions | CC BY-SA 2.5 | 0 | 2011-02-18T14:51:14.767 | 2011-02-18T19:58:35.200 | 2011-02-18T15:43:52.023 | 561,678 | 561,678 | [
"c#",
"algorithm"
]
|
5,042,728 | 1 | null | null | 0 | 1,004 | Does anyone know of any reason why indentation of a `UITableViewCell` would center the cell's `UIImageView` horizontally? In theory (and judging by the screenshots and apps I've seen in the past), the imageView should always align to the right, keeping a consistent space to the two labels. In my case (screenshot below), it doesn't. This is a default `UITableViewCell` with the `UITableViewCellStyleSubtitle`style. Any clues? I've been looking at this for quite a while and can't seem to figure it out.
apparently `UITableViewCellStyleDefault` doesn't have this issue - imageView's are right-aligned with the (single) label. Why there is a difference between the two styles is beyond me.

(green/blue areas added to illustrate the issue)
| UITableViewCell indentation centering imageView? | CC BY-SA 2.5 | null | 2011-02-18T14:52:14.167 | 2011-02-18T16:20:24.270 | 2011-02-18T15:14:05.540 | 308,364 | 308,364 | [
"iphone",
"ios",
"uitableview",
"uiimageview"
]
|
5,042,902 | 1 | 5,042,928 | null | 53 | 155,826 | I am getting XML from a web service. Here is what the XML looks like:
```
<parent>
<child>
Text
</child>
</parent>
<parent>
<child>
<grandchild>
Text
</grandchild>
<grandchild>
Text
</grandchild>
</child>
<child>
Text
</child>
</parent>
etc.
```
And here is my C# code:
```
StringBuilder output = new StringBuilder();
// Create an XmlReader
using (XmlReader reader = XmlReader.Create(new StringReader(xoResponse.@return)))
{
XmlWriterSettings ws = new XmlWriterSettings();
//ws.Indent = true;
using (XmlWriter writer = XmlWriter.Create(output, ws))
{
// Parse the file and display each of the nodes.
while (reader.Read())
{
switch (reader.NodeType)
{
case XmlNodeType.Element:
writer.WriteStartElement(reader.Name);
break;
case XmlNodeType.Text:
writer.WriteString(reader.Value);
break;
case XmlNodeType.XmlDeclaration:
case XmlNodeType.ProcessingInstruction:
writer.WriteProcessingInstruction(reader.Name, reader.Value);
break;
case XmlNodeType.Comment:
writer.WriteComment(reader.Value);
break;
case XmlNodeType.EndElement:
writer.WriteFullEndElement();
break;
}
}
}
}
```
I believe that the error is thrown on the second parent element. How can I avoid this error? Any help is greatly appreciated.
| XML Error: There are multiple root elements | CC BY-SA 4.0 | 0 | 2011-02-18T15:07:54.687 | 2021-03-21T02:28:25.653 | 2021-03-21T02:28:25.653 | -1 | 486,518 | [
"c#",
"xml"
]
|
5,042,920 | 1 | null | null | 0 | 186 | I'd like to edit HTML document by adding a button and launching an editor.
For example, I add the button in HTML (/abc/def/hello.html),
```
<button type="button">Edit Code</button>
```

And by clicking the `Edit Button`, I want to launch an editor (TextMate for example, or any other editing software) opening `/abc/def/hello.html`.
Of course, the editing is possible only with the machine that made the `/abc/def/hello.html` file.
How can I do that?
## ADDED
If it's not possible to open an editor, is it possible to store the file information into the clipboard or show it with dialog box? I'll give the name of the file, so the job should be easy as it's just showing the file name when user clicks.
| Launching an editor in HTML documents | CC BY-SA 2.5 | null | 2011-02-18T15:09:15.547 | 2011-02-19T01:53:48.463 | 2011-02-19T01:53:48.463 | 260,127 | 260,127 | [
"javascript",
"html"
]
|
5,042,937 | 1 | null | null | 7 | 4,095 | I am using the Nimbus look and feel. According to this [link](http://download.oracle.com/javase/tutorial/uiswing/components/tree.html#display), you should be able to achieve 3 different line styles with your JTree:

While using the following code:
```
theTree.putClientProperty("JTree.lineStyle", "Horizontal");
```
My JTree looks like this:

It has the "None" style and not the "Horizontal" style. Any idea why this might be? Does it have something to do with Nmbus? Do I need to call something special after setting that property?
Thanks
| JTree Line Style and Nimbus | CC BY-SA 2.5 | 0 | 2011-02-18T15:10:27.733 | 2016-01-12T14:57:56.993 | null | null | 489,041 | [
"java",
"swing",
"jtree",
"nimbus"
]
|
5,043,397 | 1 | null | null | 2 | 488 | I've encountered this only on Drupal websites, so it may have to do with the either the Zen or Garland theme default CSS. However, for the life of me I cannot determine why it continues to happen, at random.
The best way to explain is to view the image here. This happens regardless of my `word-wrap` and `white-space` CSS settings, and only at random. Sometimes it's one element, sometimes it's another (here it has happened between 'Our Brand' and 'Submit' in the menu).
The image attached is an inline `<ul>` with links inside each `<li>`.
Any insight would be much appreciated!


Here is a sample of styling for the menu shown in the screenshot:
```
<style type="text/css">
#navbar { float: left; height: 32px; overflow: hidden; margin-left: 0px; margin-right: -100%; padding: 0px; width: 100%; }
#navbar ul { margin: 0px; padding: 0px; text-align: left; }
ul.links li { display: inline; list-style-type: none; padding: 0px 0.5em; }
#navbar li { float: left; padding: 0px 20px 0px 0px; }
#primary a { text-decoration: none !important; white-space: pre !important; }
</style>
```
| Unwanted vertical HTML text - premature shrink wrap effect | CC BY-SA 2.5 | null | 2011-02-18T15:50:01.113 | 2011-02-18T16:00:24.010 | null | null | 435,596 | [
"css",
"drupal",
"text"
]
|
5,043,626 | 1 | 5,043,660 | null | 2 | 2,754 | 
I have two folders in my asp.net website namely VENDORS and ADMIN
i want when any user access any of the page inside the ADMIN folder it redirects to Admin/login.aspx until they login ....
i want when any user access any of the page inside the VENDORS folder it redirects to Vendors/login.aspx until they login ....
How to do that using web.config authorization ....
| How to apply the asp.net authorization in two different folders? | CC BY-SA 2.5 | 0 | 2011-02-18T16:08:06.800 | 2011-02-18T17:00:40.950 | null | null | 594,849 | [
"asp.net",
"web-config",
"forms-authentication"
]
|
5,043,895 | 1 | 5,044,040 | null | 5 | 2,295 | When I have elisp function
```
(defun hello (param)
... )
```
how can I run the `(hello abc.txt)` with org mode? I learned [how to link http](https://stackoverflow.com/questions/5035300/how-to-open-http-xyz-from-my-own-tag-in-org-mode) with `[[mine:...]]` tag. I expect similar way, something like `[[lisp:hello(abc.txt)]]` or something.
## ADDED
As this [post](https://stackoverflow.com/questions/3668914/calling-vim-or-textmate-from-emacs) explains, I have `(runmate)` and `(runeditor (something))` elisp command.
It works fine with `alt-x runmate` in emacs, but when I run `[[lisp:(runmate)]]`, I get the following dialog box.

## SOLVED
It should have used `[[elisp:(runmate)]]`.
| How to call Emacs Lisp functions in Emacs org-mode? | CC BY-SA 3.0 | null | 2011-02-18T16:30:31.497 | 2011-09-04T02:00:50.450 | 2017-05-23T12:30:32.453 | -1 | 260,127 | [
"emacs",
"org-mode"
]
|
5,044,036 | 1 | 5,541,898 | null | 1 | 4,092 | ```
<script type="text/javascript" src="../jquery-qtip-1.0.0-rc3094652/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="../jquery.tablesorter/jquery.tablesorter.js"></script>
<script type="text/javascript" src="../jquery-qtip-1.0.0-rc3094652/jquery.qtip-1.0.0-rc3.min.js"></script>
<script type="text/javascript" src="jquery.tools.min(4).js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(function() {
// if the function argument is given to overlay,
// it is assumed to be the onBeforeLoad event listener
$(".tool-table a[rel]").overlay({
mask: 'darkred',
effect: 'apple',
onBeforeLoad: function() {
// grab wrapper element inside content
var wrap = this.getOverlay().find(".contentWrap");
// load the page specified in the trigger
wrap.load(this.getTrigger().attr("href"));
}
});
});
});
</script>
<style>
/* use a semi-transparent image for the overlay */
#overlay {
background-image:url(http://static.flowplayer.org/img/overlay/transparent.png);
color:#efefef;
height:450px;
}
/* container for external content. uses vertical scrollbar, if needed */
div.contentWrap {
height:441px;
overflow-y:auto;
}
</style>
<div id="table-of-data-div">
<div id="table-div">
<table id="box-table-a" class="tablesorter">
<thead>
<tr>
<th scope="col" style="cursor:pointer;">B-House/Dorm Name</th>
<th scope="col" style="cursor:pointer;">Address</th>
<th scope="col" style="cursor:pointer;">Price Range</th>
<th scope="col" style="cursor:pointer;">Date Added</th>
<th scope="col" style="cursor:pointer;">Status</th>
</tr>
</thead>
<tbody>
<?php
$q=mysql_query("select * from property");
while( $f=mysql_fetch_array($q, MYSQL_ASSOC))
{
$p_id=$f["p_id"];
echo"
<tr>
<td class='tool-table'>
<span class='tool-id' style='display:none'>".$p_id."</span>
<span id='testid' style='cursor:pointer'><a id='wala' href='profile-test.php?q=$p_id' rel='#overlay' style='text-decoration:none; color:#339;'>".$f['p_name']."</a></span></td>
<td id='pretty'>".$f['address']."</td>
<td>".$f['p_name']."</td>
<td>".$f['payment_type']."</td>
<td>".$status."</td>
</tr>
";
}
?>
</tbody>
</table>
<div class="apple_overlay" id="overlay">
<!-- the external content of overlay is loaded inside this tag -->
<div class="contentWrap"></div>
</div>
</div>
</div>
```
i have screenshot

| Why is mask not working in my Overlay Plugin in jquery | CC BY-SA 3.0 | null | 2011-02-18T16:44:01.513 | 2011-12-04T13:28:11.677 | 2011-12-04T13:28:11.677 | 84,042 | 2,492,415 | [
"jquery",
"jquery-plugins"
]
|
5,044,285 | 1 | null | null | 5 | 1,526 | Earlier this month I asked this question ['What is a runloop?'](https://stackoverflow.com/questions/4947556/what-is-a-runloop) After reading the answers and did some tries I got it to work, but still I do not understand it completely. If a runloop is just an loop that is associated with an thread and it don't spawn another thread behind the scenes how can any of the other code in my thread(mainthread to keep it simple) execute without getting "blocked"/not run because it somewhere make an infinite loop?
That was question number one. Then over to my second.
If I got something right about this after having worked with this, but not completely understood it a runloop is a loop where you attach 'flags' that notify the runloop that when it comes to the point where the flag is, it "stops" and execute whatever handler that is attached at that point? Then afterwards it keep running to the next in que.

So in this case no events is placed in que in connections, but when it comes to events it take whatever action associated with tap 1 and execute it before it runs to connections again and so on. Or am I as far as I can be from understanding the concept?
| How a runloop actually works | CC BY-SA 2.5 | 0 | 2011-02-18T17:08:41.237 | 2011-02-18T20:30:45.433 | 2017-05-23T10:32:35.693 | -1 | 454,049 | [
"iphone",
"nsthread",
"runloop"
]
|
5,044,586 | 1 | 5,044,623 | null | 0 | 1,420 | >
[How to apply the asp.net authorization in two different folders ?](https://stackoverflow.com/questions/5043626/how-to-apply-the-asp-net-authorization-in-two-different-folders)
How to use the multiple login for multiple folders ?

i have two different login pags in folders ADMIn and VEndors ...i want when any of the user directly access any of the page inside admin folder then it redirect to login page of Admin folder ......
and if any of the user directly access any of the page inside Vendors folder then it redirect to login page of Vendors folder ......
| How to use the multiple login for multiple folders using web.config? | CC BY-SA 2.5 | null | 2011-02-18T17:34:28.863 | 2011-02-18T17:39:42.670 | 2017-05-23T12:13:29.403 | -1 | 594,849 | [
"asp.net",
"visual-studio-2008",
"web-config",
"forms-authentication"
]
|
5,044,671 | 1 | 5,045,389 | null | 1 | 262 | With emacs/org-mode, I use `[[link][display]]` format to show and link whatever necessary. The problem is that sometimes, the automatic formatter kicks in, and break the line to have an ugly link as follows.

The solution can be (1) remove the leading blanks of the second line, and (2) join the first and second string.

How can I do that with emacs or org-mode? If org-mode has a solution to this problem, it would be better, as I don't need to delete `[` or `]` to make it editable.
| Joining the automatically broken lines by org-mode | CC BY-SA 2.5 | null | 2011-02-18T17:43:40.653 | 2011-02-18T18:57:23.100 | null | null | 260,127 | [
"emacs",
"org-mode"
]
|
5,044,805 | 1 | null | null | 2 | 1,867 | I'm running into the traditional tile/mipmap problem on the iPad using OpenGL ES. Basically, if you have a large texture (larger than 1k X 1k), you can break it up into pieces and map those pieces onto individual polygons. You can clamp the texture coordinates to the edges and it mostly works, but you get artifacts along the boundaries.
Now I know why you get this and know what the traditional solution is. To wit, you make a border around the outside of each littler texture (say 6 pixels). You sample from the little textures into the big one so you're just using those inside pixels (say 256-2*6). Then you smear the valid pixels out into the border area. Lastly, you map your texture coordinates to just use those valid inside pixels. Works okay.
If you're not nodding along at this point, don't try to answer. :-)
Anyway, OpenGL introduced clamping modes way back in the day to solve this. I don't see those modes in OpenGL ES (at least on this hardware) and I see other references to this problem. What I'm wonder is if I'm missing something. Is there a newer way to solve the tile/edge problem that I'm not aware of?
[Update]
A screen shot of the result is attached here. The visible line is at the end of one texture and the start of another. This is using CLAMP_TO_EDGE.
| OpenGL ES Tiled Texture Mipmap problem - iPad/iPhone | CC BY-SA 2.5 | null | 2011-02-18T17:56:09.173 | 2011-05-13T20:22:04.107 | 2011-02-21T18:09:08.877 | 181,269 | 181,269 | [
"iphone",
"ipad",
"ios",
"opengl-es",
"texture-mapping"
]
|
5,044,859 | 1 | 5,064,306 | null | 1 | 632 | is it possible to get the value of an entity
```
<!ENTITY gatwayError "Gateway error">
```
? For now I reference them in my xul file using
```
&gatewayError;
```
In my `ff-sidebar.xul` within the `<page>` I have
```
<stringbundleset id="stringbundleset">
<stringbundle id="strings"
src="chrome://myaddon/locale/de/sidebar.properties"/>
</stringbundleset>
```
In my `ff-sidebar.js` I do on click:
```
var strbundle = document.getElementById("strings");
var localizedString = strbundle.getString("test");
```
This gives me following error

Should it not be
```
var strbundle = document.getElementById("stringbundleset");
```
This gives me no error but no result too.
| How to use locale entity in js-code | CC BY-SA 2.5 | 0 | 2011-02-18T18:02:05.020 | 2011-02-21T15:17:13.810 | 2011-02-21T15:17:13.810 | 401,025 | 401,025 | [
"firefox-addon"
]
|
5,045,205 | 1 | null | null | 3 | 1,931 | Basically I'm reading vehicle license plates using tessract OCR, however despite being able to emphasise text easily enough via changing contrast, reducing noise an so on, some 'parts' of the vehicle remain on the image which does cause the OCR to throw bad results.
For example take:

I can change this easily enough, such as:

I'm looking to eliminate the edges off each plate, here's another example:

I could remove the edges using pixel manipulation algorithm, however I don't feel it's the right method, and would cause quite a lot of problems.
I've been using the following application to test various methods such as morphology and eliminating the unwanted data, so far I haven't been successful.
[http://www.codeproject.com/KB/GDI-plus/Image_Processing_Lab.aspx](http://www.codeproject.com/KB/GDI-plus/Image_Processing_Lab.aspx)
However someone with knowledge of this could use the application on the article above to achieve want I'm trying, so feel free to give it a try.
Thanks
| Image OCR - Filtering unwanted data | CC BY-SA 2.5 | 0 | 2011-02-18T18:36:42.080 | 2012-10-20T08:41:51.683 | 2020-06-20T09:12:55.060 | -1 | 408,757 | [
"c#",
"image-processing",
"ocr"
]
|
5,045,250 | 1 | 5,045,445 | null | -1 | 4,510 | I have a problem while running sql stored procedure (MSSQL 2005). Here is the code of it:
```
CREATE PROCEDURE [GetItemColors]
@FetchCount int
AS
BEGIN
SELECT
TOP (@FetchCount) item.Id as ItemId, item.Published as Published, attributeValue.String as Color
FROM tblItem item, tblAttribute attributeValue, tblAttributeDefinition attributeDef
WHERE
item.Id = attributeValue.fkItemId
AND item.Deleted = 0
AND item.PendingPublish = 0
AND attributeValue.fkAttributeDefinitionId = attributeDef.Id
AND attributeDef.[Name] = 'Color'
ORDER BY item.Published DESC
END;
```
Some times the execution of the procedure ends with exception:
```
SqlException: Transaction (Process ID 66) was deadlocked on lock | communication buffer resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
```
Does anyone know how to rewrite the procedure to avoid the exception?
Is there anyway of 'pre-locking' tables within the stored procedure invocation so other code can't interrupt the execution?
Thanks in advance for you help!
---
edit 1: Estimated execution plan attached

---
edit 2: I get Deadlock Graph as the exception happens couple times per day in the live environment only. I'm not allowed to run profiler in live environment. I didn't manage to reproduce the deadlock in development environment.
---
edit 3: I didn't managed to get the deadlock winner.
| Stored procedure SQL Server 2005 transaction deadlock problem | CC BY-SA 2.5 | 0 | 2011-02-18T18:41:44.143 | 2011-02-18T19:21:13.537 | 2011-02-18T19:18:15.420 | 157,833 | 157,833 | [
"sql",
"sql-server-2005",
"stored-procedures"
]
|
5,045,328 | 1 | 5,081,126 | null | 0 | 1,709 | I've developed a mobile website based on jQuery Mobile. Everything works on my own Windows Mobile device with Opera Mobile 10, but a customer of mine always sees the page magnified.
I thought that he might have a zoom setting >100% in Opera Mobile, but he claims that this is definitely not the case.
The same problem also occurs on the jQuery Mobile test site ( [http://jquerymobile.com/test/](http://jquerymobile.com/test/) ) . Here's a screenshot of the site as displayed on my customer's device:

Any idea what might be going wrong here? I was unable to reproduce this problem on my own device or in an emulator.
My customer's device is a HTC HD2 runing Windows Mobile 6.5 and Opera 10.
Thanks,
Adrian
| jQuery Mobile website is strangely magnified in Opera Mobile 10 despite 100% zoom level | CC BY-SA 2.5 | null | 2011-02-18T18:51:09.857 | 2013-01-25T06:44:07.000 | 2011-02-19T00:49:20.397 | 59,301 | 59,301 | [
"opera",
"mobile-website",
"jquery-mobile"
]
|
5,045,365 | 1 | 5,045,402 | null | 0 | 132 | I had an issue with this scroll as in this image:

The issue is that I want only the vertical scroll to appear and not the horizontal scroll. I had used `overflow:scroll` attribute while coding. Will it look the same in Firefox and IE or is there any other way to do that?
| issue with scroll | CC BY-SA 2.5 | null | 2011-02-18T18:55:39.660 | 2011-02-18T19:40:29.553 | 2011-02-18T19:40:29.553 | 161,052 | 197,241 | [
"html",
"css"
]
|
5,045,462 | 1 | 5,045,506 | null | 0 | 239 | [i am using this plugin](http://code.drewwilson.com/entry/autosuggest-jquery-plugin) as an autocomplete suggestion box but one issue is that it allows me to enter the same tag more than once. For example, if you
1. Use the example and type in "m" and choose Mick Jagger and then select that item (which adds it as a tag)
2. Then type in "m" again, Mick Jagger still shows up on the list. If you select it from the dropdown, it will add it to the textbox again.
3. Then type in "m" again and Mick Jagger is no longer in the dropdown list.
This doesn't make sense to me why it would allow you to duplicate it once but not more than once. For all further entries it does seem to eliminate existing items from the list so you can't have duplicate entries.
Is this just a bug in the jquery plugin?
Here is a picture of me having the ability to enter this same tag twice.

| is this a bug in the jquery autosuggest plugin | CC BY-SA 2.5 | 0 | 2011-02-18T19:05:29.660 | 2012-03-08T22:03:59.010 | null | null | 4,653 | [
"jquery",
"json",
"autocomplete"
]
|
5,045,468 | 1 | 5,045,874 | null | 1 | 447 | I have added ALAssetsLibrary framework to my project and for some reason XCode doesnt detect it.
I have no code completion, and XCode gives a warning and then crashes when I use the following code
```
ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
[library enumerateGroupWithTypes:ALAssetsGroupAlbum
usingBlock:assetGroupEnumerator
failureBlock:^(NSError *error){
NSLog(@"A problem occured");
}];
```
It doesnt detect what ALAssetsLibrary is and the warning which leads to a crash is
> warning: 'ALAssetsLibrary' may not respond to '-enumerateGroupWithTypes:usingBlock:failureBlock:'

Why isnt XCode detecting the framework?
I have added it to my project as well as imported it.


I would really appreciate the help with this, I dont understand what I did wrong. Thanks
| Xcode deosn't detect a framework | CC BY-SA 2.5 | null | 2011-02-18T19:06:31.957 | 2012-04-06T14:46:36.100 | 2011-02-18T19:52:14.213 | 41,116 | 356,387 | [
"iphone"
]
|
5,045,496 | 1 | 5,045,556 | null | 0 | 381 | I have the following VBScript code, which I would like to express instead in JavaScript:
```
Sub GxUIProxyVB_OnLogon
Dim EntityProxy
For Each EntityProxy In GxUIProxyVB.ListEntityProxy
MsgBox EntityProxy.Name
Next
End Sub
```
To give context this code is a post-logon event handler of an ActiveX control's logon event. The ActiveX control is hosted in a web page running in Internet Explorer 8. The user of the web page triggers this code's execution by successfully logging on via the ActiveX control's logon mechanism.
In the code is a reference to the ActiveX control's object embedded in the DOM via an HTML element.
This is the JavaScript I have so far:
```
function GxUIProxyVB::OnLogon()
{
var EntityProxy;
// For Each EntityProxy In GxUIProxyVB.ListEntityProxy
// alert(EntityProxy.Name);
// Next
}
```
I have commented out the part I am struggling with:
This screen shot from IE8's watch list shows the members of the object

As a workaround I realize I could just leave the code in VBScript as the users will probably only be using Internet Explorer to access this content, but I'd rather have it in JavaScript for code maintainablity. (I don't want future web developers who maintain this code to need to be proficient in VBScript.)
| Using an Enumerator in JavaScript | CC BY-SA 2.5 | 0 | 2011-02-18T19:09:45.980 | 2011-02-18T19:42:34.100 | 2011-02-18T19:42:34.100 | 392,176 | 392,176 | [
"javascript",
"internet-explorer",
"vbscript",
"activex"
]
|
5,045,960 | 1 | 5,046,021 | null | 4 | 2,164 | Some items don't have write access right due to workflow state write not being granted.
When I click write access right in Access Viewer

Access Viewer informs me that selected user don't have access right due to workflowstate write acess right:

Unfortunately I'm not able to set it 'manualy' through security editor:

Can anyone shed some light on this ?
Thanks
| How to enable workflow state 'write' on selected item? | CC BY-SA 2.5 | 0 | 2011-02-18T20:02:10.893 | 2017-04-06T17:27:04.563 | null | null | 39,715 | [
"asp.net",
"sitecore"
]
|
5,045,945 | 1 | 5,046,040 | null | 0 | 3,553 | When I have this PHP script.
```
<?php
exec('/usr/local/bin/mate hello.txt');
?>
```
It doesn't work on web browser with [http://abc/hello.php](http://abc/hello.php), for example.
The command of mate is 'TextMate app', and it's just for editing hello.txt.
Is this some php permission problem?
I just need to run some commands on my local web server (I'm the only user), so I can open the permission to run this seemingly dangerous `exec()` function.
- `exec()`
I use Mac OS X 10.6.6/Apache/PHP5.
## ADDED
I guess it's not possible to launch something with PHP on my Mac, but for my purposes to open an TextMate editor to edit something, using txmt protocol works perfectly fine.
## SOLVED
In terms of launching an Application in web browser (especially Safari) cannot be done with php, but with protocol handler.
### Launching TextEditor to edit something.
TextEditor provides its own protocol handler `txmt://open/?url=file://THE_FILE_TO_EDIT"`.
Or, you can have a button to edit the file when clicked.
```
<form action="txmt://open/?url=file://FILE_TO_EDIT" method="post">
<button type="submit">Edit</button>
</form>
```
### Launching other app
You need to come up with your own protocol handler. has all the necessary information with an example.
For example, for launching PathFinder
Make URL types/schemes at Info.plist.
You may want to main window that pops up. You can set `Application is agent`.

Make the `pf:` protocol handler.
It just analyzes the input of `pf:INPUT_GINVEN`, to get the `INPUT_GIVEN` part to give it as a parameter to PathFInder.
```
@implementation URLHandlerCommand!
- (id)performDefaultImplementation {
NSString *urlString = [self directParameter];
NSLog(@"url :=: %@", urlString);
NSArray *components = [urlString componentsSeparatedByString: @":"];
NSString* string2 = (NSString*) [components objectAtIndex:1];
NSLog(@"url :=: %@", string2);
[[NSWorkspace sharedWorkspace] openFile:string2 withApplication:@"Path Finder"];
[[NSApplication sharedApplication] terminate:nil];
return nil;
}
```
@end
Use the `pf:OPEN_DIRECTORY` protocol.
```
<form action="pf:DIRECORY_TO_OPEN" method="post">
<button type="submit">Open</button>
</form>
```
| How to make it run the `exec()` command in PHP to edit some file in Mac OS X? | CC BY-SA 2.5 | 0 | 2011-02-18T20:00:03.427 | 2011-02-20T17:47:32.683 | 2011-02-20T17:47:32.683 | 260,127 | 260,127 | [
"php",
"macos",
"protocols",
"exec"
]
|
5,046,088 | 1 | 5,046,717 | null | 13 | 3,323 | When using the Graphics2D `scale()` function with two different parameters (scaling by different ratios in x- and y-direction), everything drawn later on this Graphics2D object is scaled too. This has the strange effect that lines drawn in one direction are thicker than those in another direction. The following program produces this effect, it shows this window:

```
public class StrokeExample extends JPanel {
public void paintComponent(Graphics context) {
super.paintComponent(context);
Graphics2D g = (Graphics2D)context.create();
g.setStroke(new BasicStroke(0.2f));
int height = getHeight();
int width = getWidth();
g.scale(width/7.0, height/4.0);
g.setColor(Color.BLACK);
g.draw(new Rectangle( 2, 1, 4, 2));
}
public static void main(String[] params) {
EventQueue.invokeLater(new Runnable(){public void run() {
StrokeExample example = new StrokeExample();
JFrame f = new JFrame("StrokeExample");
f.setSize(100, 300);
f.getContentPane().setLayout(new BorderLayout());
f.getContentPane().add(example);
f.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
f.setVisible(true);
}});
}
}
```
I'm using this coordinate transform to avoid having to manually transform my application model coordinates (the (2,1, 2,4) in this example) to screen (or component) pixel coordinates, but I don't want this stroke distortion. In other words, , independent of current x- and y-scale-factors.
I know what produces this effect (the Stroke object creates a stroked shape of the rectangle to be painted in user coordinates, which then are translated to screen coordinates), but I'm not sure on how to solve this.
- - -
| AffineTransform without transforming Stroke? | CC BY-SA 2.5 | 0 | 2011-02-18T20:17:10.730 | 2016-04-08T20:11:47.043 | null | null | 600,500 | [
"java",
"awt",
"java-2d",
"affinetransform",
"stroke"
]
|
5,046,112 | 1 | 5,046,165 | null | 1 | 283 | I have to pull some data from an ERP system (SAP) in C#.
Without going into details about SAP (I'm sure you wouldn't want to know about it).
I'm calling some Remote Function from within C# and its working but I'm having a strange issue. One of the functions I have to call in SAP from C# is called BAPI_USER_GET_DETAIL.
So I do this in C#:
```
s.Bapi_User_Get_Detail("No","10217502", out address, out alias, out companyName,
out defaults, out islocked, out lastmodified, out logonData, out ref_user, out snc, out uclass,
ref activeGroups, ref addcomrem, ref addfax, ref addpag, ref addprt, ref addrfc,
ref addrml, ref addsmtp, ref addssf, ref addtel, ref addtlx, ref addttx, ref adduri,
ref addx400, ref extidhead, ref extidpart, ref groups, ref parameter, ref parameter1,
ref profiles, ref return0, ref systems, ref uclasssys);
Console.WriteLine(companyName._Company);
Console.ReadLine();
```
SAP requires all these fields so that is quite normal code. I need to pull one of the `out` arguments within this function. Namely the argument `company` that is after I execute this procedure I should have a value inside of this `company` field and the watch shows that right here:

The issue I'm having is notice that _Company has the value I need but I cannot do `companyName._Company` (visual studio doesnt like this). However if I do it in my watch as shown above it displays it correctly. It gives me the company name. So how is it that the watch shows the value correctly. I must be doing something simple in C# incorrectly.
### Edit
Err looks like it is some sort of error due to protection level in SAP..I wonder how I can expose this...
| Adding variable watch shows field but compiling doesnt like the field? | CC BY-SA 4.0 | null | 2011-02-18T20:19:00.500 | 2020-12-28T17:18:14.140 | 2020-12-28T17:18:14.140 | 9,150,270 | 168,703 | [
"c#",
"sap-erp",
"sap-dotnet-connector"
]
|
5,046,410 | 1 | 9,368,957 | null | 1 | 1,130 | We have been using TFS 2010 for about 6 months and we have decided to alter the default CMMI v5 Process Template to add default memberships to the TFS security groups.
When creating a new Team Project we want to default the membership of the and groups with known Active Directory Groups. We have successfully added the to the projects group. So all of Technology has read access to all newly created TFS Team Projects. (We have a rather small technology division so this is not a security issues for us, it may be for others.)
We would also like to add the to the Group. Unfortunately we we have been unsuccessful at this as the process template does not show the Group.
We have tried altering the underling xml files by adding the group manually, but this also did not work. When creating a new TFS Project with this template I received an error on creation, my assumption is that it failed when attempting to create the group and one already existed.
Has any one had any luck ad altering the default membership of the Project Administrators group?
Here is an image of the default groups that are listed in the process template.
TFS Process Template Permissions -->

| TFS Default Group Membership for the Project Administrator group | CC BY-SA 3.0 | 0 | 2011-02-18T20:49:06.987 | 2012-02-20T21:51:50.733 | 2011-11-27T03:07:49.920 | 234,976 | 317,645 | [
"tfs",
"tfs-process-template"
]
|
5,046,560 | 1 | 5,047,127 | null | 1 | 2,352 | Imagine moving your mouse left to right across this webpage fragment:

The gray box is a DIV. I want a onMouseOver when mousing into it, and a onMouseOut when exiting it.
What I actually get (left to right):
```
onMouseOver DIV
onMouseOut DIV
onMouseOver Flag
onMouseOut Flag
onMouseOver DIV
onMouseOut DIV
onMouseOver USA
onMouseOut USA
onMouseOver DIV
onMouseOut DIV
onMouseOver 2
onMouseOut 2
onMouseOver DIV
onMouseOut DIV
```
Whew!
How can I just get a single onMouseOver and onMouseOut for the container DIV?
| Mayhem: onMouseOver onMouseOut with div | CC BY-SA 2.5 | null | 2011-02-18T21:05:17.930 | 2011-02-18T22:09:31.533 | 2011-02-18T21:54:09.660 | 256,241 | 256,241 | [
"javascript",
"html",
"onmouseover",
"onmouseout"
]
|
5,046,692 | 1 | 5,046,714 | null | -1 | 144 | Firefox and Opera seem to put articles after each other while Chrome gives a line break after each one. Which one is correct and how would you get them display the preferred style the same cross browser?
```
<html>
<body>
<article>
Item 1
</article>
<article>
Item 2
</article>
<article>
Item 3
</article>
<article>
Item 4
</article>
</body>
</html>
```
Opera 11.01

Chrome 9.0

| How to display a list of <article> the same cross-browser? | CC BY-SA 2.5 | null | 2011-02-18T21:21:35.770 | 2011-02-18T21:27:17.870 | 2011-02-18T21:27:17.870 | 27,862 | 66,003 | [
"html",
"cross-browser",
"article"
]
|
5,046,845 | 1 | 5,046,981 | null | 3 | 5,760 | I'm trying to integrate this function:

However I'm running into an error of:
```
Traceback (most recent call last):
File "<ipython console>", line 1, in <module>
File "siestats.py", line 349, in NormalDistro
P_inner = scipy.integrate(NDfx,-dev,dev)
TypeError: 'module' object is not callable
```
My code runs this:
```
# Definition of the mathematical function:
def NDfx(x):
return((1/math.sqrt((2*math.pi)))*(math.e**((-.5)*(x**2))))
# This Function normailizes x, u, and o2 (position of interest, mean and st dev)
# and then calculates the probability up to position 'x'
def NormalDistro(u,o2,x):
dev = abs((x-u)/o2)
P_inner = scipy.integrate(NDfx,-dev,dev)
P_outer = 1 - P_inner
P = P_inner + P_outer/2
return(P)
```
Function NormalDistro is mean for import and used like this:
```
foo.NormalDistro(30,2.5,1.25)
```
As an example.
| Mathematical Integration of a function in Python | CC BY-SA 2.5 | null | 2011-02-18T21:35:57.917 | 2011-03-03T03:25:34.893 | 2011-02-19T08:39:27.853 | 579,145 | 447,015 | [
"python",
"function",
"scipy"
]
|
5,046,909 | 1 | 5,047,379 | null | 0 | 655 | So, I have been looking for solution more than 12 hours(but without success). How should I change ListView ControlTemplate to get effect like this:

(This question is about this buttons that working like scrollview)
Have you another ideas how to create control like this?
| Custom ListView Control | CC BY-SA 2.5 | null | 2011-02-18T21:42:24.840 | 2011-02-18T22:47:35.787 | 2011-02-18T22:12:01.660 | 398,429 | 398,429 | [
"c#",
"wpf",
"xaml",
"expression-blend"
]
|
5,047,438 | 1 | 5,048,211 | null | 0 | 1,965 | This is probably just lack of experience with the `NSOutlineView` but I can't see a way to do this. I have a `NSOutlineView` (implemented with the excellent [PXSourceList](https://github.com/Perspx/PXSourceList)) with an add button that is totally functional in the aspect that I save/write/insert/delete rows correctly. I do not use a `NSTreeController`, and I don't use bindings. I add the entity using the following code:
```
- (void)addEntity:(NSNotification *)notification {
// Create the core data representation, and add it as a child to the parent node
UABaseNode *node = [[UAModelController defaultModelController] createBaseNode];
[sourceList reloadData];
for (int i = 0; i < [sourceList numberOfRows]; i++) {
if (node == [sourceList itemAtRow:i]) {
[sourceList selectRowIndexes:[NSIndexSet indexSetWithIndex:i] byExtendingSelection:NO];
[sourceList editColumn:0 row:i withEvent:nil select:NO];
break;
}
}
}
```
When the add button is pressed, a new row is inserted like this:

If I click away, then select the row and press `enter` to edit it, it now looks like this:

My question is:
| Autoselect, focus and highlight a new NSOutlineView row | CC BY-SA 2.5 | 0 | 2011-02-18T22:56:11.170 | 2011-02-19T01:18:53.077 | 2011-02-18T23:23:11.740 | 69,634 | 69,634 | [
"cocoa",
"nstableview",
"nsoutlineview",
"selectedindex",
"pxsourcelist"
]
|
5,047,463 | 1 | 5,047,645 | null | 6 | 1,518 | On my Samsung Galaxy, application icons displayed on my Home Screen often don't match those displayed on the Applications Menu.
Firstly, I want to know if this is peculiar to Samsung/Galaxy (or some subset of Android phones), or if this is across the platform? Secondly, I'd like to know how to set this up in my Android project.
To illustrate what I'm asking, please refer to the following image:

Icons 1 and 2 are typical of a lot of third-party apps: on the Home Screen the icon transparency is honoured, but on the Applications Menu the icon is over-layed onto a button graphic. On my phone the latter is more-often-than-not a dirty-green, radial pattern.
Some apps have over-ridden this behaviour, however: icons 3 and 4 show that MapQuest has been able to specify a different base colour for the button (same radial pattern, though); and icons 5 and 6 show what appears to be a complete replacement of the button image or Application Menu icon.
Can anyone explain what I need to do to specify both forms of the icon in my project?
Thanks, in advance.
| Android Icons: Home Screen vs Applications Menu | CC BY-SA 2.5 | 0 | 2011-02-18T22:59:53.187 | 2011-02-19T06:08:33.593 | 2011-02-18T23:06:48.563 | 623,877 | 623,877 | [
"android",
"icons",
"homescreen"
]
|
5,047,590 | 1 | 5,068,529 | null | 1 | 990 | I've created a smaller UIWebView on the iPad, and so I've written my own HTML5 controllers for the video. Currently when I maximize the video it's showing a pure black screen (Rather than the actual video). The sound is still working and i can still pause and hit play, however just have a black video. (also when i go back to my minimized mode video isn't there any more).
This of course works fine in the web browser, just not on the iPad.
Here is the maximize code:
```
function fullScreenOn(){
videoIsFullScreen = true;
videoOrigWidth = video.offsetWidth;
videoOrigHeight = video.offsetHeight;
video.style.width = window.innerWidth + "px";
video.style.height = window.innerHeight + "px";
video.style.position = "fixed";
video.style.left = 0;
video.style.top = 0;
controls.style.position = "fixed";
positionController();
fullScreenControl.className = "fs-active control";
}
function fullScreenOff(){
videoIsFullScreen = false;
video.style.width = videoOrigWidth + "px";
video.style.height = videoOrigHeight + "px";
video.style.position = "static";
controls.style.position = "absolute";
positionController();
fullScreenControl.className = "control";
}
```
the video variable is my container.
If it entertains you.. the screenshot:

Cheers
| HTML5: Video on the iPad - Custom Zoom Control | CC BY-SA 2.5 | 0 | 2011-02-18T23:18:33.540 | 2011-02-21T16:33:21.777 | null | null | 123,389 | [
"javascript",
"css",
"ipad",
"html"
]
|
5,047,576 | 1 | 5,048,141 | null | 59 | 62,278 | The selected item in a WPF TreeView has a dark blue background with "sharp" corners. That looks a bit dated today:

I would like to change the background to look like in Explorer of Windows 7 (with/without focus):
 
What I tried so far does not remove the original dark blue background but paints a rounded border on top of it so that you see the dark blue color at the edges and at the left side - ugly.

Interestingly, when my version does not have the focus, it looks pretty OK:

I would like to refrain from redefining the control template as [shown](http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b1551151-69e6-4376-900d-a763c9656267/) here or [here](http://social.msdn.microsoft.com/Forums/en/wpf/thread/358b4e2d-1ddc-4504-b9cb-a2abd8495bb5). I want to set the minimum required properties to make the selected item look like in Explorer.
I would also be happy to have the focused selected item look like mine does now when it does not have the focus. When losing the focus, the color should change from blue to grey.
Here is my code:
```
<TreeView
x:Name="TreeView"
ItemsSource="{Binding TopLevelNodes}"
VirtualizingStackPanel.IsVirtualizing="True"
VirtualizingStackPanel.VirtualizationMode="Recycling">
<TreeView.ItemContainerStyle>
<Style TargetType="{x:Type TreeViewItem}">
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="BorderBrush" Value="#FF7DA2CE" />
<Setter Property="Background" Value="#FFCCE2FC" />
</Trigger>
</Style.Triggers>
</Style>
</TreeView.ItemContainerStyle>
<TreeView.Resources>
<HierarchicalDataTemplate DataType="{x:Type viewmodels:ObjectBaseViewModel}" ItemsSource="{Binding Children}">
<Border Name="ItemBorder" CornerRadius="2" Background="{Binding Background, RelativeSource={RelativeSource AncestorType=TreeViewItem}}"
BorderBrush="{Binding BorderBrush, RelativeSource={RelativeSource AncestorType=TreeViewItem}}" BorderThickness="1">
<StackPanel Orientation="Horizontal" Margin="2">
<Image Name="icon" Source="/ExplorerTreeView/Images/folder.png"/>
<TextBlock Text="{Binding Name}"/>
</StackPanel>
</Border>
</HierarchicalDataTemplate>
</TreeView.Resources>
</TreeView>
```
---
## Solution
With the excellent answers of Sheridan and Meleak my TreeView now looks like this in code (a result I am very happy with and which is pretty near Explorer's style):
```
<TreeView
...
<TreeView.ItemContainerStyle>
<Style TargetType="{x:Type TreeViewItem}">
<!-- Style for the selected item -->
<Setter Property="BorderThickness" Value="1"/>
<Style.Triggers>
<!-- Selected and has focus -->
<Trigger Property="IsSelected" Value="True">
<Setter Property="BorderBrush" Value="#7DA2CE"/>
</Trigger>
<!-- Mouse over -->
<Trigger Property="helpers:TreeView_IsMouseDirectlyOverItem.IsMouseDirectlyOverItem" Value="True">
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
<GradientStop Color="#FFFAFBFD" Offset="0"/>
<GradientStop Color="#FFEBF3FD" Offset="1"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="BorderBrush" Value="#B8D6FB"/>
</Trigger>
<!-- Selected but does not have the focus -->
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="True"/>
<Condition Property="IsSelectionActive" Value="False"/>
</MultiTrigger.Conditions>
<Setter Property="BorderBrush" Value="#D9D9D9"/>
</MultiTrigger>
</Style.Triggers>
<Style.Resources>
<Style TargetType="Border">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Style.Resources>
</Style>
</TreeView.ItemContainerStyle>
<TreeView.Resources>
<HierarchicalDataTemplate DataType="{x:Type viewmodels:ObjectBaseViewModel}" ItemsSource="{Binding Children}">
<StackPanel Orientation="Horizontal" Margin="2,1,5,2">
<Grid Margin="0,0,3,0">
<Image Name="icon" Source="/ExplorerTreeView/Images/folder.png"/>
</Grid>
<TextBlock Text="{Binding Name}" />
</StackPanel>
</HierarchicalDataTemplate>
<!-- Brushes for the selected item -->
<LinearGradientBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" EndPoint="0,1" StartPoint="0,0">
<GradientStop Color="#FFDCEBFC" Offset="0"/>
<GradientStop Color="#FFC1DBFC" Offset="1"/>
</LinearGradientBrush>
<LinearGradientBrush x:Key="{x:Static SystemColors.ControlBrushKey}" EndPoint="0,1" StartPoint="0,0">
<GradientStop Color="#FFF8F8F8" Offset="0"/>
<GradientStop Color="#FFE5E5E5" Offset="1"/>
</LinearGradientBrush>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="Black" />
<SolidColorBrush x:Key="{x:Static SystemColors.ControlTextBrushKey}" Color="Black" />
</TreeView.Resources>
</TreeView>
```
| WPF TreeView: How to style selected items with rounded corners like in Explorer | CC BY-SA 2.5 | 0 | 2011-02-18T23:16:06.510 | 2020-06-09T13:35:24.877 | 2011-08-26T20:40:30.913 | 318,425 | 234,152 | [
"wpf",
"xaml",
"treeview",
"styles",
"selecteditem"
]
|
5,047,673 | 1 | 5,047,919 | null | 2 | 6,516 | I have a view which pushes a new view onto the screen.
When the new view is shown, there is no back button in the navigation controller.
I have the following in one view

and I push a new view using the following code
```
[photoViewController setAsset:[assets objectAtIndex:(cell.rowNumber * 4) + index]];
[[self navigationController] pushViewController:photoViewController animated:YES];
[photoViewController release];
```
When the view appears the following is visible

How do I add the back button and where would I add the same share button to the bar in the second view?
Thanks. :)
| Navigation controller doesnt add back button | CC BY-SA 2.5 | null | 2011-02-18T23:32:36.763 | 2011-02-19T09:16:31.263 | 2020-06-20T09:12:55.060 | -1 | 356,387 | [
"iphone",
"uinavigationcontroller"
]
|
5,047,704 | 1 | 5,047,890 | null | 0 | 1,961 | I'd like to learn how to use some kind of collection separator, such as in this example from Interface Builder:

I haven't seen anything about these online, but I don't think I'm searching with the right keywords. Can someone point me in a direction?
| How do you insert separators in something like an NSTableView? | CC BY-SA 2.5 | null | 2011-02-18T23:38:24.737 | 2011-02-19T00:14:52.280 | null | null | 482,219 | [
"objective-c",
"cocoa"
]
|
5,047,724 | 1 | null | null | 0 | 82 | What kind of toolbars are these at the top and bottom of the view?

How are these added in the code rather than in IB?
| Adding toolbars to a view | CC BY-SA 2.5 | null | 2011-02-18T23:40:31.673 | 2011-02-19T00:19:28.537 | null | null | 356,387 | [
"iphone"
]
|
5,047,779 | 1 | 5,047,804 | null | 1 | 1,390 | I am developing an application where i have to display names of users in following structure :

In above structure, in the name field, it may exceed the right border of the outer `<div>` tag, i want to cut the name value just before it touches the right border and append the a string '...' in the end just like below

How can i make it work for UTF-8, unicode or Normal english letters in the name field?
P.S. I m using PHP for server side processing.
| HTML: How can i do this...! | CC BY-SA 2.5 | 0 | 2011-02-18T23:49:34.990 | 2011-02-19T00:07:09.890 | 2011-02-19T00:00:11.710 | 364,708 | 547,573 | [
"html",
"xhtml"
]
|
5,047,947 | 1 | 5,048,069 | null | 1 | 585 | I am using [gchart](http://keith-wood.name/gChart.html) and I am trying to use markers to label my bar char with numbers. So that ever bar has a number value on top of it.
I tried
```
markers: [$.gchart.marker('number', 'red', -1)]
markers: [$.gchart.marker('number', 'red', -1, -1)]
markers: [$.gchart.marker('number', 'red', -1, 'every')]
markers: [$.gchart.marker('number', 'red', -1, 'every1')]
```
I can only make it appear on the one bar. I want it to show up on every bar.
What am I doing wrong?

See it has no label on the first one.
```
https://chart.apis.google.com/chart?chs=400x500&cht=bvg&chd=t:55|47&chco=FDFF0F,1FEEFF&chm=N,ff0000,-1,-1,10,0&chdl=test2|test1&chdlp=b|l&chxt=x,y&chxl=0:|atest
$('#id').gchart({
type: 'barVertGrouped',
markers: [$.gchart.marker('number', 'red',-1)],
height: 500,
width: 400,
series: data, // xml data from server.
legend: 'bottom',
extension: { chxt: 'x,y', chxl: '0:|atest' }
});
```
| How to label my bar chart with numbers? | CC BY-SA 2.5 | null | 2011-02-19T00:22:49.537 | 2011-02-19T00:45:06.650 | 2017-02-08T14:31:34.397 | -1 | 130,015 | [
"jquery-plugins",
"google-api",
"google-visualization",
"gchart"
]
|
5,048,186 | 1 | 5,104,414 | null | 1 | 351 | I am attempting to search for
```
using (var context = new $DataContext$())
```
where DataContext is any class that extends `System.Data.Linq.DataContext` using Resharpers 'Search with Pattern'.
The pattern I'm using is:
```
using($type$ $var$ = new $type$($args$))
{
$stmt$
}
```

This appears to return using statements, eg using StreamWriter, using FileStream, things that clearly do not derive from `System.Data.Linq.DataContext`
How can you return only the types indicated?
I am using VS 2010 SP1 Beta and ReSharper 5.1 C# Edition build 5.1.1727.12
| resharper search with pattern for using(... new System.Data.Linq.DataContext) | CC BY-SA 2.5 | 0 | 2011-02-19T01:09:51.220 | 2015-04-22T13:21:46.703 | 2015-04-22T13:21:46.703 | 4,510 | 224,410 | [
"c#",
"resharper",
"resharper-5.0",
"structural-search"
]
|
5,048,391 | 1 | null | null | -1 | 465 | Ok not really sure how to explain this but here goes ...
I have a database lets call it foo with 1 table that has 3 rows row1,2,3 (row1 being id int auto) and I have 2 insert sql queries I need to merge so they align:
```
INSERT INTO `table` (`row2`) VALUES ('value');
INSERT INTO `table` (`row3`) VALUES ('value');
```
1, Is it possible?
2, If so how?
I know its badly written but like I said not really sure how to expain ..:( ok lets try again ...Here is the basic structure as an export..
```
INSERT INTO `bookmarks` (`id`, `name`, `url`) VALUES
(1, '', 'http://twitter.com'),
(2, '', 'http://digg.com'),
(3, '', 'http://stumbleupon.com'),
(4, '', 'http://reddit.com'),
continued further down...this is where I lose the url but gain the name
(830, 'Twitter', ''),
(831, 'Digg', ''),
(832, 'Stumbleupon', ''),
(833, 'Reddit', '');
```
I need to add the name row to the 1st part so it becomes
(4, 'Reddit', '[http://reddit.com](http://reddit.com)'),

I need to bump the rows/columns up
| Merge 2 SQL insert queries | CC BY-SA 2.5 | null | 2011-02-19T02:10:34.523 | 2011-02-19T02:38:52.277 | 2011-02-19T02:38:52.277 | 576,638 | 576,638 | [
"sql",
"merge",
"insert"
]
|
5,048,519 | 1 | 5,048,579 | null | 0 | 424 | I am using the css above to style my h1 and it works good on most browsers except opera that changes the positioning a lot:
```
h1{
position:fixed;
left:5px;
top:5px;
color:#111;
font-family:'Josefin Sans', Arial, serif;
font-size:3.3em;
margin:0px;
margin-top: 2px;
margin-bottom: 2px;
padding: 0px;;
}
```
I tried replacing h1's with h2's and everything works nice on all browsers again even positioning in opera seems to be good, but now the font-size is not good and the font used is probably browsers default...Is there something I should know about heading in opera that I don't?please advice...!
all other browsers:

opera:

EDIT:
the main problem seems to be that it doesn't implement a font I have used from google(that all other browsers do...) but it implements another really similar on above...
| <h1> and <h2> are not displayed as expected in Opera browser | CC BY-SA 2.5 | null | 2011-02-19T02:50:46.683 | 2011-03-01T23:33:27.540 | 2011-02-19T03:42:37.200 | 319,650 | 319,650 | [
"css",
"cross-browser",
"opera"
]
|
5,048,450 | 1 | 5,500,054 | null | 2 | 13,086 | I'm trying to initialize a 2 GB SanDisk SD card on a [Cypress PSoC](http://en.wikipedia.org/wiki/PSoC) 5 using the SPI interface. I'm using the sample bit banging code from [FatFs - Generic FAT File System Module](http://elm-chan.org/fsw/ff/00index_e.html). I've analyzed the interface on a logic analyzer (see ). The problem is that the data out line from the SD card is always high, I should be getting back a 0x01 from the card init command. The SD card reads fine on the PC however. The code I am using is below, what could the problem be?
I'm using an SD socket from [http://ucontroller.com/documentation/SDCardDoc.html](http://ucontroller.com/documentation/SDCardDoc.html).
```
/*------------------------------------------------------------------------/
/ Bitbanging MMCv3/SDv1/SDv2 (in SPI mode) control module
/-------------------------------------------------------------------------/
/
/ Copyright (C) 2010, ChaN, all right reserved.
/
/ * This software is a free software and there is NO WARRANTY.
/ * No restriction on use. You can use, modify and redistribute it for
/ personal, non-profit or commercial products UNDER YOUR RESPONSIBILITY.
/ * Redistributions of source code must retain the above copyright notice.
/
/--------------------------------------------------------------------------/
Features and Limitations:
* Very Easy to Port
It uses only 4-6 bit of GPIO port. No interrupt, no SPI port is used.
* Platform Independent
You need to modify only a few macros to control GPIO ports.
* Low Speed
The data transfer rate will be several times slower than hardware SPI.
* No Media Change Detection
Application program must re-mount the volume after media change or it
results a hard error.
/-------------------------------------------------------------------------*/
#include <device.h>
#include "diskio.h" /* Common include file for FatFs and disk I/O layer */
/*-------------------------------------------------------------------------*/
/* Platform dependent macros and functions needed to be modified */
/*-------------------------------------------------------------------------*/
#include <device.h> /* Include device specific declareation file here */
#define INIT_PORT() /* Initialize MMC control port (CS/CLK/DI:output, DO/WP/INS:input) */
#define DLY_US(n) CyDelayUs(n) /* Delay n microseconds */
#define CLK_DELAY() CyDelayUs(1)
#define CS_H() CyPins_SetPin(ss_0) /* Set MMC CS "high" */
#define CS_L() CyPins_ClearPin(ss_0) /* Set MMC CS "low" */
#define CK_H() CyPins_SetPin(clk_0) /* Set MMC SCLK "high" */
#define CK_L() CyPins_ClearPin(clk_0) /* Set MMC SCLK "low" */
#define DI_H() CyPins_SetPin(spiout_0) /* Set MMC DI "high" */
#define DI_L() CyPins_ClearPin(spiout_0) /* Set MMC DI "low" */
#define DO CyPins_ReadPin(spiin_0) /* Get MMC DO value (high:true, low:false) */
#define INS (1) /* Card is inserted (yes:true, no:false, default:true) */
#define WP (0) /* Card is write protected (yes:true, no:false, default:false) */
/*--------------------------------------------------------------------------
Module Private Functions
---------------------------------------------------------------------------*/
/* MMC/SD command (SPI mode) */
#define CMD0 (0) /* GO_IDLE_STATE */
#define CMD1 (1) /* SEND_OP_COND */
#define ACMD41 (0x80+41) /* SEND_OP_COND (SDC) */
#define CMD8 (8) /* SEND_IF_COND */
#define CMD9 (9) /* SEND_CSD */
#define CMD10 (10) /* SEND_CID */
#define CMD12 (12) /* STOP_TRANSMISSION */
#define ACMD13 (0x80+13) /* SD_STATUS (SDC) */
#define CMD16 (16) /* SET_BLOCKLEN */
#define CMD17 (17) /* READ_SINGLE_BLOCK */
#define CMD18 (18) /* READ_MULTIPLE_BLOCK */
#define CMD23 (23) /* SET_BLOCK_COUNT */
#define ACMD23 (0x80+23) /* SET_WR_BLK_ERASE_COUNT (SDC) */
#define CMD24 (24) /* WRITE_BLOCK */
#define CMD25 (25) /* WRITE_MULTIPLE_BLOCK */
#define CMD41 (41) /* SEND_OP_COND (ACMD) */
#define CMD55 (55) /* APP_CMD */
#define CMD58 (58) /* READ_OCR */
/* Card type flags (CardType) */
#define CT_MMC 0x01 /* MMC ver 3 */
#define CT_SD1 0x02 /* SD ver 1 */
#define CT_SD2 0x04 /* SD ver 2 */
#define CT_SDC (CT_SD1|CT_SD2) /* SD */
#define CT_BLOCK 0x08 /* Block addressing */
static
DSTATUS Stat = STA_NOINIT; /* Disk status */
static
BYTE CardType; /* b0:MMC, b1:SDv1, b2:SDv2, b3:Block addressing */
static char buf[80];
/*-----------------------------------------------------------------------*/
/* Transmit bytes to the MMC (bitbanging) */
/*-----------------------------------------------------------------------*/
static
void xmit_mmc (
const BYTE* buff, /* Data to be sent */
UINT bc /* Number of bytes to send */
)
{
BYTE d;
do {
d = *buff++; /* Get a byte to be sent */
if (d & 0x80) DI_H(); else DI_L(); /* bit7 */
CK_H(); CLK_DELAY(); CK_L(); CLK_DELAY();
if (d & 0x40) DI_H(); else DI_L(); /* bit6 */
CK_H(); CLK_DELAY(); CK_L(); CLK_DELAY();
if (d & 0x20) DI_H(); else DI_L(); /* bit5 */
CK_H(); CLK_DELAY(); CK_L(); CLK_DELAY();
if (d & 0x10) DI_H(); else DI_L(); /* bit4 */
CK_H(); CLK_DELAY(); CK_L(); CLK_DELAY();
if (d & 0x08) DI_H(); else DI_L(); /* bit3 */
CK_H(); CLK_DELAY(); CK_L(); CLK_DELAY();
if (d & 0x04) DI_H(); else DI_L(); /* bit2 */
CK_H(); CLK_DELAY(); CK_L(); CLK_DELAY();
if (d & 0x02) DI_H(); else DI_L(); /* bit1 */
CK_H(); CLK_DELAY(); CK_L(); CLK_DELAY();
if (d & 0x01) DI_H(); else DI_L(); /* bit0 */
CK_H(); CLK_DELAY(); CK_L(); CLK_DELAY();
DLY_US(10);
//snprintf(buf, sizeof buf, "sent 0x%02x\r\n", d);
//UART_1_PutString(buf);
} while (--bc);
}
/*-----------------------------------------------------------------------*/
/* Receive bytes from the MMC (bitbanging) */
/*-----------------------------------------------------------------------*/
static
void rcvr_mmc (
BYTE *buff, /* Pointer to read buffer */
UINT bc /* Number of bytes to receive */
)
{
BYTE r;
DI_H(); /* Send 0xFF */
do {
r = 0; if (DO) r++; /* bit7 */
CK_H(); CLK_DELAY(); CK_L(); CLK_DELAY();
r <<= 1; if (DO) r++; /* bit6 */
CK_H(); CLK_DELAY(); CK_L(); CLK_DELAY();
r <<= 1; if (DO) r++; /* bit5 */
CK_H(); CLK_DELAY(); CK_L(); CLK_DELAY();
r <<= 1; if (DO) r++; /* bit4 */
CK_H(); CLK_DELAY(); CK_L(); CLK_DELAY();
r <<= 1; if (DO) r++; /* bit3 */
CK_H(); CLK_DELAY(); CK_L(); CLK_DELAY();
r <<= 1; if (DO) r++; /* bit2 */
CK_H(); CLK_DELAY(); CK_L(); CLK_DELAY();
r <<= 1; if (DO) r++; /* bit1 */
CK_H(); CLK_DELAY(); CK_L(); CLK_DELAY();
r <<= 1; if (DO) r++; /* bit0 */
CK_H(); CLK_DELAY(); CK_L(); CLK_DELAY();
*buff++ = r; /* Store a received byte */
DLY_US(10);
//snprintf(buf, sizeof buf, "received 0x%02x\r\n", r);
//UART_1_PutString(buf);
} while (--bc);
}
/*-----------------------------------------------------------------------*/
/* Wait for card ready */
/*-----------------------------------------------------------------------*/
static
int wait_ready (void) /* 1:OK, 0:Timeout */
{
BYTE d;
UINT tmr;
for (tmr = 5000; tmr; tmr--) { /* Wait for ready in timeout of 500ms */
rcvr_mmc(&d, 1);
if (d == 0xFF) return 1;
DLY_US(100);
}
return 0;
}
/*-----------------------------------------------------------------------*/
/* Deselect the card and release SPI bus */
/*-----------------------------------------------------------------------*/
static
void deselect (void)
{
BYTE d;
CS_H();
rcvr_mmc(&d, 1);
}
/*-----------------------------------------------------------------------*/
/* Select the card and wait for ready */
/*-----------------------------------------------------------------------*/
static
int select (void) /* 1:OK, 0:Timeout */
{
CS_L();
if (!wait_ready()) {
deselect();
return 0;
}
return 1;
}
/*-----------------------------------------------------------------------*/
/* Receive a data packet from MMC */
/*-----------------------------------------------------------------------*/
static
int rcvr_datablock ( /* 1:OK, 0:Failed */
BYTE *buff, /* Data buffer to store received data */
UINT btr /* Byte count */
)
{
BYTE d[2];
UINT tmr;
for (tmr = 1000; tmr; tmr--) { /* Wait for data packet in timeout of 100ms */
rcvr_mmc(d, 1);
if (d[0] != 0xFF) break;
DLY_US(100);
}
if (d[0] != 0xFE)
return 0; /* If not valid data token, retutn with error */
rcvr_mmc(buff, btr); /* Receive the data block into buffer */
rcvr_mmc(d, 2); /* Discard CRC */
return 1; /* Return with success */
}
/*-----------------------------------------------------------------------*/
/* Send a data packet to MMC */
/*-----------------------------------------------------------------------*/
static
int xmit_datablock ( /* 1:OK, 0:Failed */
const BYTE *buff, /* 512 byte data block to be transmitted */
BYTE token /* Data/Stop token */
)
{
BYTE d[2];
if (!wait_ready())
return 0;
d[0] = token;
xmit_mmc(d, 1); /* Transmit a token */
if (token != 0xFD) { /* Is it data token? */
xmit_mmc(buff, 512); /* Transmit the 512 byte data block to MMC */
rcvr_mmc(d, 2); /* Dummy CRC (FF,FF) */
rcvr_mmc(d, 1); /* Receive data response */
if ((d[0] & 0x1F) != 0x05) /* If not accepted, return with error */
return 0;
}
return 1;
}
/*-----------------------------------------------------------------------*/
/* Send a command packet to MMC */
/*-----------------------------------------------------------------------*/
static
BYTE send_cmd ( /* Returns command response (bit7==1:Send failed)*/
BYTE cmd, /* Command byte */
DWORD arg /* Argument */
)
{
BYTE n, d, buf[6];
if (cmd & 0x80) { /* ACMD<n> is the command sequense of CMD55-CMD<n> */
cmd &= 0x7F;
n = send_cmd(CMD55, 0);
if (n > 1) return n;
}
/* Select the card and wait for ready */
deselect();
if (!select()) {
return 0xFF;
}
/* Send a command packet */
buf[0] = 0x40 | cmd; /* Start + Command index */
buf[1] = (BYTE)(arg >> 24); /* Argument[31..24] */
buf[2] = (BYTE)(arg >> 16); /* Argument[23..16] */
buf[3] = (BYTE)(arg >> 8); /* Argument[15..8] */
buf[4] = (BYTE)arg; /* Argument[7..0] */
n = 0x01; /* Dummy CRC + Stop */
if (cmd == CMD0)
n = 0x95; /* (valid CRC for CMD0(0)) */
if (cmd == CMD8)
n = 0x87; /* (valid CRC for CMD8(0x1AA)) */
buf[5] = n;
xmit_mmc(buf, 6);
/* Receive command response */
if (cmd == CMD12)
rcvr_mmc(&d, 1); /* Skip a stuff byte when stop reading */
n = 10; /* Wait for a valid response in timeout of 10 attempts */
do
rcvr_mmc(&d, 1);
while ((d & 0x80) && --n);
return d; /* Return with the response value */
}
/*--------------------------------------------------------------------------
Public Functions
---------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------*/
/* Get Disk Status */
/*-----------------------------------------------------------------------*/
DSTATUS disk_status (
BYTE drv /* Drive number (0) */
)
{
DSTATUS s = Stat;
if (drv || !INS) {
s = STA_NODISK | STA_NOINIT;
} else {
s &= ~STA_NODISK;
if (WP)
s |= STA_PROTECT;
else
s &= ~STA_PROTECT;
}
Stat = s;
return s;
}
/*-----------------------------------------------------------------------*/
/* Initialize Disk Drive */
/*-----------------------------------------------------------------------*/
DSTATUS disk_initialize (
BYTE drv /* Physical drive nmuber (0) */
)
{
BYTE n, ty, cmd, buf[4];
UINT tmr;
DSTATUS s;
INIT_PORT(); /* Initialize control port */
s = disk_status(drv); /* Check if card is in the socket */
if (s & STA_NODISK) return s;
CS_H();
for (n = 10; n; n--) rcvr_mmc(buf, 1); /* 80 dummy clocks */
ty = 0;
if (send_cmd(CMD0, 0) == 1) { /* Enter Idle state */
if (send_cmd(CMD8, 0x1AA) == 1) { /* SDv2? */
rcvr_mmc(buf, 4); /* Get trailing return value of R7 resp */
if (buf[2] == 0x01 && buf[3] == 0xAA) { /* The card can work at vdd range of 2.7-3.6V */
for (tmr = 1000; tmr; tmr--) { /* Wait for leaving idle state (ACMD41 with HCS bit) */
if (send_cmd(ACMD41, 1UL << 30) == 0) break;
DLY_US(1000);
}
if (tmr && send_cmd(CMD58, 0) == 0) { /* Check CCS bit in the OCR */
rcvr_mmc(buf, 4);
ty = (buf[0] & 0x40) ? CT_SD2 | CT_BLOCK : CT_SD2; /* SDv2 */
}
}
} else { /* SDv1 or MMCv3 */
if (send_cmd(ACMD41, 0) <= 1) {
ty = CT_SD1; cmd = ACMD41; /* SDv1 */
} else {
ty = CT_MMC; cmd = CMD1; /* MMCv3 */
}
for (tmr = 1000; tmr; tmr--) { /* Wait for leaving idle state */
if (send_cmd(ACMD41, 0) == 0) break;
DLY_US(1000);
}
if (!tmr || send_cmd(CMD16, 512) != 0) /* Set R/W block length to 512 */
ty = 0;
}
}
else {
UART_1_PutString("send CMD 0 failed");
}
CardType = ty;
if (ty) /* Initialization succeded */
s &= ~STA_NOINIT;
else /* Initialization failed */
s |= STA_NOINIT;
Stat = s;
deselect();
return s;
}
/*-----------------------------------------------------------------------*/
/* Read Sector(s) */
/*-----------------------------------------------------------------------*/
DRESULT disk_read (
BYTE drv, /* Physical drive nmuber (0) */
BYTE *buff, /* Pointer to the data buffer to store read data */
DWORD sector, /* Start sector number (LBA) */
BYTE count /* Sector count (1..128) */
)
{
DSTATUS s;
s = disk_status(drv);
if (s & STA_NOINIT) return RES_NOTRDY;
if (!count) return RES_PARERR;
if (!(CardType & CT_BLOCK)) sector *= 512; /* Convert LBA to byte address if needed */
if (count == 1) { /* Single block read */
if ((send_cmd(CMD17, sector) == 0) /* READ_SINGLE_BLOCK */
&& rcvr_datablock(buff, 512))
count = 0;
}
else { /* Multiple block read */
if (send_cmd(CMD18, sector) == 0) { /* READ_MULTIPLE_BLOCK */
do {
if (!rcvr_datablock(buff, 512)) break;
buff += 512;
} while (--count);
send_cmd(CMD12, 0); /* STOP_TRANSMISSION */
}
}
deselect();
return count ? RES_ERROR : RES_OK;
}
/*-----------------------------------------------------------------------*/
/* Write Sector(s) */
/*-----------------------------------------------------------------------*/
DRESULT disk_write (
BYTE drv, /* Physical drive nmuber (0) */
const BYTE *buff, /* Pointer to the data to be written */
DWORD sector, /* Start sector number (LBA) */
BYTE count /* Sector count (1..128) */
)
{
DSTATUS s;
s = disk_status(drv);
if (s & STA_NOINIT) return RES_NOTRDY;
if (s & STA_PROTECT) return RES_WRPRT;
if (!count) return RES_PARERR;
if (!(CardType & CT_BLOCK)) sector *= 512; /* Convert LBA to byte address if needed */
if (count == 1) { /* Single block write */
if ((send_cmd(CMD24, sector) == 0) /* WRITE_BLOCK */
&& xmit_datablock(buff, 0xFE))
count = 0;
}
else { /* Multiple block write */
if (CardType & CT_SDC) send_cmd(ACMD23, count);
if (send_cmd(CMD25, sector) == 0) { /* WRITE_MULTIPLE_BLOCK */
do {
if (!xmit_datablock(buff, 0xFC)) break;
buff += 512;
} while (--count);
if (!xmit_datablock(0, 0xFD)) /* STOP_TRAN token */
count = 1;
}
}
deselect();
return count ? RES_ERROR : RES_OK;
}
/*-----------------------------------------------------------------------*/
/* Miscellaneous Functions */
/*-----------------------------------------------------------------------*/
DRESULT disk_ioctl (
BYTE drv, /* Physical drive nmuber (0) */
BYTE ctrl, /* Control code */
void *buff /* Buffer to send/receive control data */
)
{
DRESULT res;
BYTE n, csd[16];
WORD cs;
if (disk_status(drv) & STA_NOINIT) /* Check if card is in the socket */
return RES_NOTRDY;
res = RES_ERROR;
switch (ctrl) {
case CTRL_SYNC : /* Make sure that no pending write process */
if (select()) {
deselect();
res = RES_OK;
}
break;
case GET_SECTOR_COUNT : /* Get number of sectors on the disk (DWORD) */
if ((send_cmd(CMD9, 0) == 0) && rcvr_datablock(csd, 16)) {
if ((csd[0] >> 6) == 1) { /* SDC ver 2.00 */
cs= csd[9] + ((WORD)csd[8] << 8) + 1;
*(DWORD*)buff = (DWORD)cs << 10;
} else { /* SDC ver 1.XX or MMC */
n = (csd[5] & 15) + ((csd[10] & 128) >> 7) + ((csd[9] & 3) << 1) + 2;
cs = (csd[8] >> 6) + ((WORD)csd[7] << 2) + ((WORD)(csd[6] & 3) << 10) + 1;
*(DWORD*)buff = (DWORD)cs << (n - 9);
}
res = RES_OK;
}
break;
case GET_BLOCK_SIZE : /* Get erase block size in unit of sector (DWORD) */
*(DWORD*)buff = 128;
res = RES_OK;
break;
default:
res = RES_PARERR;
}
deselect();
return res;
}
```
| C - Initializing an SD card in SPI mode, always reads back 0xFF | CC BY-SA 3.0 | null | 2011-02-19T02:29:32.500 | 2012-09-29T02:06:35.180 | 2012-09-29T01:48:43.987 | 63,550 | 258,526 | [
"c",
"sd-card",
"spi"
]
|
5,048,590 | 1 | null | null | 1 | 1,074 | Would like to add a third party test framework (such as NUnit or MbUnit) to the drop-down list of test projects for the ASP.NET MVC3 type project in Visual Studio 2010.

This had worked before for ASP.NET MVC2 and prior, but the msdn instructions are not accurate and does not work. Creating the registry keys in the HKEY_CURRENT_USER seem to delete the keys every time the VS-2010 starts, the HKEY_LOCAL_MACHINE does not follow the same tree structure.
Does anyone know how to add a third party framework under ASP.NET MVC3?

[This resource](http://msdn.microsoft.com/en-us/library/dd381614.aspx) and [this rant](http://www.geekbeing.com/2010/07/21/asp-mvc-2-nunit-based-unit-test-project-template/) do not work for MVC3
| adding a 3rd party test framework for ASP.NET MVC3 and Razor view engine | CC BY-SA 2.5 | null | 2011-02-19T03:08:16.817 | 2012-02-20T02:47:03.867 | null | null | 203,635 | [
"asp.net",
"testing",
"asp.net-mvc-3",
"nunit",
"razor"
]
|
5,048,905 | 1 | 5,261,489 | null | 0 | 1,091 | I am using greybox to display images in an image set. When I clock on one of the links, the image set appears, but the pictures do not load the first time (it just shows a white background - see attached image). If I move forward one place in the image set and then back it will render properly.
I am loading the following files in the section, and the GB_ROOT_DIR variable is set. Any suggestions? Thanks!
```
<script type="text/javascript" src="greybox/AJS.js"></script>
<script type="text/javascript" src="greybox/AJS_fx.js"></script>
<script type="text/javascript" src="greybox/gb_scripts.js"></script>
<link href="greybox/gb_styles.css" rel="stylesheet" type="text/css" />
```

| Greybox Image Gallery - Images don't load on initial click | CC BY-SA 2.5 | null | 2011-02-19T04:45:40.377 | 2014-02-01T09:00:42.323 | null | null | 427,683 | [
"javascript",
"greybox"
]
|
5,049,100 | 1 | 5,049,504 | null | 1 | 3,973 | i'm working on extjs and came across one small problem it is , wen i resize the window everything works fine execpt for the disabled component....
before resizing the browser the disabled component looks fine

but after resizing the browser the panel and button behind the disabled css are exanding but the css does not

here's the code:
```
var topdetailpanel = new Ext.Panel(
{
flex: 1,
padding: 1,
disabled: false,
monitorOrientation:true,
layout: {
type: 'vbox',
pack: 'center',
align: 'stretch'
},
stretchX: true,
items: [
{
xtype: 'button',
id: 'topdetailid',
flex: 1,
baseCls: 'round',
monitorOrientation:true,
stretchX: true,
html: noresult,
handler: function ()
{
window.location = 'DetailsPanel.html?type=' + typeval + '&event=' + eventval + '&price=' + priceval + '&free=0&pos=1'
}}]
});
var bottomdetailpanel = new Ext.Panel(
{
flex: 1,
id: 'ctrlBtn2',
padding: 1,
monitorOrientation:true,
disabled: true,
layout: {
type: 'vbox',
pack: 'center',
align: 'stretch'
},
stretchX: true,
items: [
{
xtype: 'button',
flex: 1,
monitorOrientation:true,
id: 'bottomdetailid',
baseCls: 'round',
stretchX: true,
html: noresult,
handler: function ()
{
window.location = 'DetailsPanel.html?type=' + typeval + '&event=' + eventval + '&price=' + priceval + '&free=0&pos=2'
}}]
});
```
and for disabling i use :
bottomdetailpanel.setDisabled(true);
please help.......................
Thank you in advance.......
| how to handle the rotation or orientation in sencha? | CC BY-SA 2.5 | null | 2011-02-19T05:34:44.950 | 2011-02-19T07:27:35.160 | null | null | 438,864 | [
"javascript",
"html",
"css",
"extjs"
]
|
5,049,180 | 1 | 5,268,542 | null | 0 | 225 | I have an interesting problem. When my map loads, and the user location is being set, an artifact from the animation remains on screen. Touching and moving the map will remove the artifact. What might cause this issue? What might fix this issue?

| User Location leaving artifacts in map kit | CC BY-SA 2.5 | null | 2011-02-19T05:59:24.843 | 2011-03-11T03:07:12.853 | null | null | 146,165 | [
"ios",
"mapkit"
]
|
5,049,290 | 1 | 5,381,473 | null | 4 | 1,665 | I am drawing a line beside a `TextView` using the `drawableRight` property. There are a number of `TextView`s in the table and all I want is column divider. Heres the `TextView` code:
```
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="units"
android:drawablePadding="2pt"
android:drawableRight="@drawable/linetable"
android:gravity="center"
android:layout_margin="2pt"
android:padding="2pt" />
```
:
```
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="line">
<solid android:color="#000000"></solid>
<stroke
android:width="2pt"
android:color="#000000"
android:dashWidth="8pt"
android:dashGap="8pt"/>
</shape>
```
So I expected to draw a column beside all `TextViews` and this may look like a column border. But it isnt working.
The images show what I am trying to achieve and what I have achieved.
I just need guidance. Thank You.


| Right Drawable in Android. Not Working | CC BY-SA 3.0 | 0 | 2011-02-19T06:33:57.193 | 2015-05-09T09:40:16.473 | 2015-05-09T09:40:16.473 | 3,810,333 | 557,869 | [
"android",
"xml",
"user-interface",
"android-layout",
"android-styles"
]
|
5,049,808 | 1 | 5,049,834 | null | 1 | 359 | How to achieve this following kind of screen in java Swing -

I tried to achieve the same but I could reach as below -

Suggest me the way to get the desired output.
| How to achieve the following screen/layout in JAVA Swing | CC BY-SA 2.5 | null | 2011-02-19T08:47:54.430 | 2011-02-19T08:54:18.117 | null | null | 552,521 | [
"java",
"swing"
]
|
5,050,173 | 1 | null | null | 7 | 6,228 | I want to authenticate a user using Google account. I had developed oauth using some libraries.
But it is giving me a message like some website is .
I developed oauth using Zend PHP library.
And see the screenshots


Thank You
| How to authenticate a user with Google gmail account like stackoverflow | CC BY-SA 2.5 | 0 | 2011-02-19T10:16:51.530 | 2019-07-20T05:39:16.347 | 2011-02-19T11:47:36.263 | 510,435 | 510,435 | [
"php",
"zend-framework",
"authentication",
"oauth"
]
|
5,050,721 | 1 | 5,050,790 | null | 2 | 2,489 | When you long press on an email in Gmail application the dialog box is shown. I'm wondering is it just a dialog or an activity represented as dialog? Thank you.

| Is this a dialog or activity? | CC BY-SA 2.5 | 0 | 2011-02-19T12:18:37.347 | 2012-03-22T20:19:41.817 | null | null | 397,991 | [
"android"
]
|
5,050,727 | 1 | 5,051,612 | null | 0 | 1,188 | I'm phrasing the question title poorly as I'm not sure what to call what I'm trying to do but it really should be simple.
I've a link / join table with two ID columns. I want to run a check before saving new rows to the table.
The user can save attributes through a webpage but I need to check that the same combination doesn't exist before saving it. With one record it's easy as obviously you just check if that attributeId is already in the table, if it is don't allow them to save it again.
However, if the user chooses a combination of that attribute and another one then they should be allowed to save it.
Here's an image of what I mean:

So if a user now tried to save an attribute with ID of 1 it will stop them, but I need it to also stop them if they tried ID's of 1, 10 so long as both 1 and 10 had the same productAttributeId.
I'm confusing this in my explanation but I'm hoping the image will clarify what I need to do.
This should be simple so I presume I'm missing something.
| SQL query select from table and group on other column | CC BY-SA 2.5 | 0 | 2011-02-19T12:20:09.960 | 2011-02-21T14:06:11.507 | 2011-02-19T21:11:11.840 | 573,261 | 626,721 | [
"sql",
"sql-server",
"grouping"
]
|
5,050,787 | 1 | 5,058,678 | null | 2 | 3,333 | 
I keep wondering why did facebook use like submit from button and not just simple link to do the action with, following is there like button code.
```
<form rel="async" class="live_184361748268334 commentable_item autoexpand_mode" method="post" action="/ajax/ufi/modify.php" data-live="{"seq":0}" onsubmit="return Event.__inlineSubmit(this,event)">
<input name="charset_test" value="€,´,€,´,水,Д,Є" type="hidden">
<input autocomplete="off" name="post_form_id" value="1ef694751d74ce24382cfa6181f1adfe" type="hidden">
<input name="fb_dtsg" value="_19R5" autocomplete="off" type="hidden">
<input autocomplete="off" name="feedback_params" value="{"actor":"514782389","target_fbid":"184361748268334","target_profile_id":"514782389","type_id":"17","source":"1","assoc_obj_id":"","source_app_id":"2309869772","extra_story_params":[],"content_timestamp":"1298066944","check_hash":"e76c88ca6e20b4a0"}" type="hidden">
<div class="UIImageBlock clearfix"><i class="UIImageBlock_Image UIImageBlock_ICON_Image img sp_4b2fk0 sx_b64365"></i>
<div class="UIImageBlock_Content UIImageBlock_ICON_Content"><span class="uiStreamSource"><a href="/aleem.sheikh/posts/184361748268334"><abbr title="Saturday, February 19, 2011 at 3:09am" data-date="Fri, 18 Feb 2011 14:09:04 -0800" class="timestamp">4 hours ago</abbr></a></span><span class="UIActionLinks UIActionLinks_bottom" data-ft="{"type":"action"}"> ·
<button class="like_link stat_elem as_link" title="Like this item" type="submit" name="like" onclick="fc_click(this, false); return true;"><span class="default_message">Like</span><span class="saving_message">Unlike</span></button>
·
<label class="uiLinkButton comment_link" onclick="return fc_click(this);" title="Leave a comment">
<input value="Comment" type="button">
</label>
· <a title="Send this to friends or post it on your profile." href="/ajax/share_dialog.php?s=99&appid=2309869772&p%5B0%5D=514782389&p%5B1%5D=184361748268334" rel="dialog">Share</a></span></div>
</div>
<ul class="uiList uiUfi focus_target fbUfi" data-ft="{"type":"ufi"}">
<li class="ufiNub uiListItem uiListVerticalItemBorder"><i></i>
<input autocomplete="off" name="xhp_ufi" value="1" type="hidden">
</li>
<li class="ufiItem uiUfiLike">
<div class="UIImageBlock clearfix"><a class="UIImageBlock_Image UIImageBlock_ICON_Image" tabindex="-1">
<label onclick="this.form.like.click();"><i class="img sp_8dfqpl sx_4ac53f" title="Like this item"></i></label>
</a>
<div class="UIImageBlock_Content UIImageBlock_ICON_Content"><a href="http://www.facebook.com/profile.php?id=100000407120411">Syed Murtaza Zaidi</a> likes this.</div>
</div>
</li>
<li class="uiUfiComments uiListItem uiListVerticalItemBorder hidden_elem">
<ul class="commentList">
</ul>
</li>
<li class="uiUfiAddComment clearfix ufiItem ufiItem uiListItem uiListVerticalItemBorder uiUfiAddCommentCollapsed">
<div><img class="uiProfilePhoto actorPic UIImageBlock_Image UIImageBlock_ICON_Image uiProfilePhotoMedium img" src="http://profile.ak.fbcdn.net/hprofile-ak-snc4/41709_1014341698_4889488_q.jpg" alt="">
<div class="commentArea UIImageBlock_Content UIImageBlock_ICON_Content">
<div class="commentBox">
<textarea class="DOMControl_placeholder uiTextareaNoResize uiTextareaAutogrow textBox textBoxContainer" title="Write a comment..." placeholder="Write a comment..." name="add_comment_text" onfocus="return wait_for_load(this, event, function() {if (!this._has_control) {new TextAreaControl(this).setAutogrow(true);this._has_control = true;}});">Write a comment...</textarea>
</div>
<label class="mts mts commentBtn stat_elem optimistic_submit uiButton uiButtonConfirm" for="u127419_35">
<input value="Comment" name="comment" id="u127419_35" type="submit">
</label>
</div>
</div>
</li>
</ul>
<input value="{"src":10,"sty":263,"actrs":"514782389","object_id":184361748268334,"pub_time":1298066944,"fbid":"184361748268334","qid":"5575216616647978849","mf_objid":184361748268334,"s_obj":5,"s_edge":1,"s_prnt":3,"pos":9,"filter":"h"}" name="link_data" type="hidden">
</form>
```
| Why did facebook used submit button and not just links for the like button? | CC BY-SA 3.0 | 0 | 2011-02-19T12:33:14.130 | 2013-09-11T18:52:34.807 | 2013-09-11T18:52:34.807 | 642,148 | 75,799 | [
"html",
"ajax",
"forms",
"button",
"hyperlink"
]
|
5,050,843 | 1 | null | null | 9 | 29,469 | how to organize html code (with usage ol\li ect.) to present such lists (with sublists)
```
1. BLA-BLA-BLA
1.1. Bla-bla-bla.
1.2. Bla-bla-bla.
1.3. Bla-bla-bla:
lalal - balalala;
lalal - balalala;
lalal - lalalla.
1.4. Blal-a lalslas
1.4.1. bklalala
1.4.2. sdsdsdsdsd
```
note: It is not the same that I want

| present lists and sublists in html | CC BY-SA 2.5 | 0 | 2011-02-19T12:47:05.823 | 2018-12-14T06:24:00.190 | 2012-06-02T13:11:46.403 | 480,659 | 395,034 | [
"html",
"html-lists"
]
|
5,051,102 | 1 | 5,051,184 | null | 0 | 614 | I am trying to set the score in a game but it isn't doing anything at the moment.
I have declared a score variable:
```
static int score = 0;
```
When an answer is shown in another textview as "Correct" I want the score to increment and show this in another textfield which will be for the score.
So far I have tried this:
```
public void score(){
check.getText();
if(check.equals("Correct")){
score++;
Score.setText(String.valueOf(score));
}
```
check is a Textfield which shows Correct or Incorrect. Score is another textfield.
and then I put the method score() into an onclick, but this doesn't update the textfield.
I would appreciate any advice on this.
Thanks
Edit:

| Setting the score on textview | CC BY-SA 2.5 | null | 2011-02-19T13:47:23.807 | 2011-02-19T17:22:23.947 | 2011-02-19T17:22:23.947 | 608,658 | 608,658 | [
"android"
]
|
5,051,131 | 1 | 5,051,193 | null | 2 | 133 | I have written is code below, but button isn't shown because i've set FILL_PARENT in bar layoutParametrs. How i could fixed it without using XML?
```
TableRow myLayout = new TableRow (this);
myLayout.setAlwaysDrawnWithCacheEnabled(true);
TextView text = new TextView (this);
text.setText("Test: ");
SeekBar bar = new SeekBar (this);
ToggleButton button = new ToggleButton (this);
myLayout.addView( text , new TableRow.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));
myLayout.addView( bar , new TableRow.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));
myLayout.addView( button , new TableRow.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));
```
If FILL_PARENT set for bar

If isn't

both variant is wrong
| How to make visible all of the widgets from a single line(RowTable)? | CC BY-SA 2.5 | null | 2011-02-19T13:53:33.610 | 2011-02-19T16:57:48.363 | null | null | 590,952 | [
"java",
"android",
"android-layout"
]
|
5,051,716 | 1 | 5,052,303 | null | 0 | 141 | I am trying to make a score increment when an answer is shown as correct in a textfield. The code is as follows:
Variable is declared:
```
static int score = 0;
```
Method:
```
public void score(){
if(check.getText().equals("Correct")){
score++;
}
Score.setText(String.valueOf(score));
}
```
The Score is a textfield and check is another textfield
Then this is called in onclick as score();
I appreciate any ideas on why this gets a process closed error when I am clicking the button.
Thanks.
Edit:

| Android Process closed onClick | CC BY-SA 2.5 | null | 2011-02-19T15:45:10.747 | 2011-02-19T17:22:13.283 | 2011-02-19T17:18:54.763 | 608,658 | 608,658 | [
"android"
]
|
5,051,713 | 1 | null | null | 1 | 491 | I need to set the height and width of a EditText widget programmatically. I am using a RelativeLayout to do this, and it works fine as far as the size goes, but the actual widget paints itself incorrectly:

I would have expected it to paint like this (which it will if I set the height to ViewGroup.LayoutParams.WRAP_CONTENT instead of my requested height - sometimes):

```
EditText et = new EditText(this);
et.setFocusable(true);
et.setSingleLine(true);
et.setHint(label);
et.setText(text);
et.setTextSize(TypedValue.COMPLEX_UNIT_PX,(h/3)+5);
et.setId(cn);
rllp = new RelativeLayout.LayoutParams(w,h);
rllp.leftMargin = x;
rllp.topMargin = y;
layout.addView(et,rllp);
```
| How to make single-line EditText draw itself correctly when using a specific size | CC BY-SA 2.5 | null | 2011-02-19T15:44:16.830 | 2011-02-19T23:16:35.057 | 2011-02-19T23:16:35.057 | 16,909 | 16,909 | [
"java",
"android",
"android-edittext"
]
|
5,051,784 | 1 | 5,051,853 | null | 17 | 8,797 | I'd like to keep all my small images in one sprite file, for example:

Now suppose I want to add a thin background image which is meant to repeat-x over 100% the width of an element:

Does this have to be stored as a seperate entity, or can I somehow store it in the sprite image? I can't work out if it's possible to do a background-repeat over a section of a sprite, I think not but I'm fairly sure I've seen it done somewhere.
| CSS Sprites and repeating backgrounds | CC BY-SA 2.5 | 0 | 2011-02-19T15:57:17.077 | 2011-02-19T16:23:27.483 | null | null | 356,635 | [
"html",
"css",
"css-sprites"
]
|
5,051,868 | 1 | 5,051,940 | null | 1 | 527 | I have recently started using Visual Studio 2010 and ReSharper 5.1. It's working pretty well for me so far except for this one issue which I'm hoping someone has the answer for. Basically, like many others, I tend to use a dark colour scheme to improve readability over the default VS colour scheme. Having installed ReSharper I have noticed that when I navigate to a class name, the class name and any references to it get highlighted. That in itself is fine but with the colour scheme I've chosen, I'm getting a light-on-light combination which is unreadable.
I've gone through the Tools->Options->Fonts and Colors menu a few times but there doesn't seem to be an appropriate ReSharper item.
Here is a screenshot illustrating the highlighting problem

| Visual Studio 2010 + ReSharper 5.1 Class Highlighting Problem | CC BY-SA 2.5 | 0 | 2011-02-19T16:14:07.573 | 2011-02-19T16:32:21.353 | null | null | 137,001 | [
"visual-studio",
"resharper"
]
|
5,052,031 | 1 | null | null | 6 | 2,382 | I'm writing a BHO for Internet Explorer where I'm searching for specific words in a web page and encapsulates words found in a HTML-tag, for styling purposes.
I have code to change the style-property when hoovering over the tag, but what I want to do is show a "box" around the word, but I don't want to move the text to any other position than it's original one.
To illustrate, I've made a picture (imagine the word "Overflow!" is in it's own HTML-tag) :
Picture #1 is before, and #2 is when the mouse hoovers the word!

Can anyone please help me with any suggestions regarding how to solve this problem? Javascript? CSS-styling?
| How to show a "box" around text in HTML tag on mouse over? | CC BY-SA 2.5 | 0 | 2011-02-19T16:38:59.733 | 2011-02-20T13:42:23.240 | 2011-02-20T13:42:23.240 | 289,319 | 458,861 | [
"javascript",
"html",
"css",
"internet-explorer",
"mouseover"
]
|
5,052,073 | 1 | 5,052,329 | null | 1 | 497 | Bad:

Good:

The image above shows check-boxes parallel to eachother vertically, however this is IE6 and shows a noticeable error compared to other browsers.
The check-box has spacing almost like a margin around the perimeter of the box itself, in other browsers this does not exist but if there is a fix I would like to do so.
How would I remove the margin or fix this error in IE6 and possibly other browsers?
I want a permanent fix that is compliant with any browser.
| Checkbox CSS assistance or IE6 hack | CC BY-SA 2.5 | null | 2011-02-19T16:44:24.830 | 2011-02-19T18:45:55.770 | 2011-02-19T16:52:06.827 | 605,850 | 605,850 | [
"html",
"css"
]
|
5,052,222 | 1 | 5,052,394 | null | 2 | 550 | I have a tableview which each row has 4 images. I have implemented a share option which will allow the user to select multiple images. How can I add an overlay or some kind of visual effect to show that the image is selected?

I would like to add some overlay to display that an image is selected, but How would this be done without adding a new set of subview for each thumbnail? And once that is done, how would the selection of the new views be linked back to the images behind them so that they can be added to an array?
Or is there an easier way to do this?
Thanks
| Adding an overlay to a grid tableView | CC BY-SA 2.5 | null | 2011-02-19T17:10:11.980 | 2011-02-19T17:53:28.580 | null | null | 356,387 | [
"iphone"
]
|
5,052,374 | 1 | 5,052,389 | null | 4 | 3,796 | Here's a part of my .php file:
```
<html xmlns:fb="http://www.facebook.com/2008/fbml" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="IE=8" http-equiv="X-UA-Compatible">
<meta content="en-us" http-equiv="Content-Language">
<meta content="TEST" http-equiv="description">
<meta content="checkin, check-in, checkins, check-ins, checking-in, recommendations, popular, social, television, tv, show, shows, movie, movies, book, books, music, celebrity, game, games, video game, video games" http-equiv="keywords">
<title> Recommend Me: Find Me a Movie</title>
<link href="/css/reset.css" media="screen,projection" type="text/css" rel="stylesheet"/>
<link href="/css/home.css" media="screen,projection" type="text/css" rel="stylesheet"/>
<link href="/css/dialog.css" media="screen,projection" type="text/css" rel="stylesheet"/>
<link href="/css/modals.css" media="screen,projection" type="text/css" rel="stylesheet"/>
<script type="text/javascript">var _sf_startpt=(new Date()).getTime()</script>
</head>
<body>
```
The file structure is here:

Why can't I get the page formatted as the css?
Removing those links to the css made no difference at all!
| CSS not applying to PHP page | CC BY-SA 2.5 | 0 | 2011-02-19T17:34:28.347 | 2011-02-19T17:40:01.103 | null | null | 95,265 | [
"php",
"css"
]
|
5,052,356 | 1 | 5,069,256 | null | 7 | 3,793 | I'm trying to print a `FlowDocument` with `PrintDialog` to an XPS file. The resulting printed content only appears to stretch across the XPS page, not the entire width of the page. Here is an example of what the resulting XPS document looks like in Windows XPS viewer:

This is the code I'm using to print this document:
```
void Print()
{
PrintDialog printDialog = new PrintDialog();
bool? result = printDialog.ShowDialog();
if (!result.HasValue)
return;
if (!result.Value)
return;
double pageWidth = printDialog.PrintableAreaWidth;
double pageHeight = printDialog.PrintableAreaHeight;
FlowDocument flowDocument = CreateFlowDocument(pageWidth, pageHeight);
printDialog.PrintDocument(
((IDocumentPaginatorSource)flowDocument).DocumentPaginator,
"Test print job");
}
FlowDocument CreateFlowDocument(double pageWidth, double pageHeight)
{
FlowDocument flowDocument = new FlowDocument();
flowDocument.PageWidth = pageWidth;
flowDocument.PageHeight = pageHeight;
flowDocument.PagePadding = new Thickness(30.0, 50.0, 20.0, 30.0);
flowDocument.IsOptimalParagraphEnabled = true;
flowDocument.IsHyphenationEnabled = true;
flowDocument.IsColumnWidthFlexible = true;
Paragraph header = new Paragraph();
header.FontSize = 18;
header.Foreground = new SolidColorBrush(Colors.Black);
header.FontWeight = FontWeights.Bold;
header.Inlines.Add(new Run("Title of my document (will be cut off in XPS)";));
flowDocument.Blocks.Add(header);
Paragraph test = new Paragraph();
test.FontSize = 12;
test.Foreground = new SolidColorBrush(Colors.Black);
test.FontWeight = FontWeights.Bold;
test.Inlines.Add(new Run("This text should stretch across the entire width of the page. Let's see if it really does, though."));
flowDocument.Blocks.Add(test);
return flowDocument;
}
```
`pageWidth` is and `pageHeight` is , which should be than big enough to accommodate my text. What could be going wrong?
---
Here are some other things I've tried:
- `StackPanel``Paragraph``FlowDocument`- `FlowDocument.PageWidth`
| WPF printing FlowDocuments to XPS: printed content not stretching across page. Why? | CC BY-SA 3.0 | null | 2011-02-19T17:32:14.810 | 2012-10-05T16:57:23.523 | 2011-11-23T14:41:02.630 | 18,505 | 18,505 | [
"wpf",
"printing",
".net-3.5"
]
|
5,052,379 | 1 | 5,052,413 | null | 0 | 395 | 

(Note: There are no scrollbars on these divs, so there is literally no way to scroll to the left, whether it be in the body or within the divs themselves.)
The problem (pictured above in FF and Opera), which exists on both the "Baroque" and "Spotlights" theme selections (see below for links), is that when you shrink the browser small (e.g. under ~900 width), the horizontal scroll bar does not scroll to the left. It will scroll to the right just fine, but it doesn't care at all if the navigation menu gets shoved off the left side of the screen and is completely inaccessible.
What would make it do this?
Here is the pertinent HTML:
```
<div class="center1">
<div class="center2">
<div style="position:relative; top:180px; width:1226px;" id="containerBGimgLParent">
<div id="containerBGimgL"></div><img src="images/skin3/dark_interface_parts5b.png">
</div>
</div>
</div>
<div class="center1">
<div class="center2">
<div id="containerBG">
<div id="NavMenu">
<ul class="kwicks">
<li id="kwick1"></li>
<li id="kwick2"></li>
<li id="kwick3"></li>
<li id="kwick4"></li>
<li id="kwick5"></li>
<li id="kwick6"></li>
<li id="kwick7"></li>
</ul>
</div>
</div>
</div>
</div>
<div id="contentdiv"></div>
```
... and CSS:
```
body {
background-image: url("../images/skin3/DIBG.png");
background-repeat: repeat;
font-family: "Times New Roman";
}
#NavMenu {
float:left;
width:170px;
background-color: #000;
padding:5px;
}
.center1 {
position:absolute;
right:50%;
}
.center2 {
position:relative;
left:50%;
}
#containerBGimgL {
background-image:url('../images/skin3/dark_interface_parts5a.png');
background-repeat: no-repeat;
width:1040px;
height:672px;
display:inline-block;
}
#containerBG {
width: 980px;
position:relative;
top:274px;
}
#contentdiv
{
position:absolute;
top:320px;
left:700px;
width:600px;
height:526px;
text-align:left;
padding: 0px 20px 0px 0px;
background-color: #000;
overflow-y: scroll;
color:#fff;
}
```
The javascript resize function changes the dimensions of a few divs, but does nothing that would result in this problem. It does not, for example, change any div's overflow to hidden.
To see the problem in action, click here: [http://www.solarcoordinates.com/testing3/index.html](http://www.solarcoordinates.com/testing3/index.html). (I don't currently have it working when JS is disabled, so JS will have to be enabled if you want to look.)
| Why do my center-aligned divs not scroll to the left? | CC BY-SA 2.5 | null | 2011-02-19T17:35:06.587 | 2011-02-19T17:54:11.437 | 2011-02-19T17:54:11.437 | 496,336 | 496,336 | [
"css",
"html"
]
|
5,052,941 | 1 | 5,053,627 | null | 0 | 932 | I have installed PHP manager. But then when I try to access PHPinfo. I got the following screen.

What should I do?
| 404 error after installing PHP on IIS 7.5 | CC BY-SA 4.0 | 0 | 2011-02-19T19:13:15.317 | 2018-08-02T15:36:36.323 | 2018-08-02T15:36:36.323 | 11,182 | 95,265 | [
"php",
"iis",
"installation",
"php-manager"
]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.