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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4,969,428 | 1 | 4,969,513 | null | 2 | 9,170 | I just asked a question about this subject; [All Row has a Delete Button in Gridview](https://stackoverflow.com/q/4955759/447156)
I have a simple table `AVUKAT`
Columns --> `HESAP`, `MUSTERI`, `AVUKAT`
And I show the data in a Gridview.
I activate `AutoGenerateDeleteButton`.

But when I click the Delete button for a row, I am getting an error like this.
```
Server Error in '/' Application.
Deleting is not supported by data source 'GridviewDataSource' unless DeleteCommand is specified.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NotSupportedException: Deleting is not supported by data source 'GridviewDataSource' unless DeleteCommand is specified.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
```
Which Function is activated when I click the delete button?
What should be the code of this function?
| Gridview Delete Button in ASP.NET | CC BY-SA 3.0 | null | 2011-02-11T13:18:05.807 | 2013-11-15T20:33:08.963 | 2017-05-23T12:30:36.930 | -1 | 447,156 | [
"c#",
".net",
"asp.net",
"gridview",
"delete-row"
]
|
4,969,708 | 1 | 4,969,817 | null | 2 | 731 | I saw a picture in @Matthieu's blog [http://wp7wonders.wordpress.com/](http://wp7wonders.wordpress.com/) yesterday(sorry,I can't find it now.
This picture have a textbox within a microphone icon just like the search page in phone.
My qusetion is can I use this feature in my application?How?

thanks.
| Is it possible to use Speech Recognition module in my application? | CC BY-SA 2.5 | null | 2011-02-11T13:45:29.183 | 2011-02-11T13:58:11.307 | 2011-02-11T13:58:11.307 | 590,967 | 590,967 | [
"windows-phone-7",
"voice-recognition"
]
|
4,969,907 | 1 | null | null | 1 | 1,034 | Simple website that will have an image in the background. Always fixed image.
Then the user will upload an image which will be overlay with the background image. Then user can resize the image they uploaded and then rotate, resize etc to suit the background.
Finally once uploaded image is loaded correctly they save. This has be using javascript and php. User can do all the rotating, zooming of their uploaded image and save file in php to send new file to user.
Question is how to create the system that accepts and image and allows user to rotate and resize their images to fit the background on the browser. Any recommended javascript plugin that can allow rotation and resizing image so that user can fit it with the background image?
Please see attachment explaining in detail

| Place and image over another image - Javascript & PHP | CC BY-SA 2.5 | 0 | 2011-02-11T14:04:55.193 | 2011-02-11T14:36:07.570 | 2011-02-11T14:18:16.850 | 79,523 | 79,523 | [
"php",
"javascript",
"jquery",
"image-processing",
"imagemagick"
]
|
4,969,947 | 1 | 4,970,127 | null | 9 | 903 | I have an problem as seen below the one on top is the original image the one on the bottom is titlted to the left 90 degrees. Is there a way to calculate the change in angle. I have tried Hough's Transform, I can detect the location, however I cannot detect the angel that is changed. Is there an alternative to detect the degreeschanged.


| Comparing image on how much degrees tilted | CC BY-SA 2.5 | 0 | 2011-02-11T14:09:58.677 | 2011-02-11T21:35:52.133 | null | null | 288,231 | [
"c#",
"image-processing"
]
|
4,970,420 | 1 | null | null | 0 | 3,623 | I want to set the custom image as background for alert view.If i set the image view frame size as static, then it displayed properly. But i have passed the message contents are dynamically displayed, so some times the contents is small and some times it comes huge amount of data displayed in the alert view.So how can i set the image view frame size which depends on the alert view frame size.
Here my sample code,
```
UIAlertView *notesAlert = [[UIAlertView alloc] initWithTitle:@"" message:notes delegate:self cancelButtonTitle:@"Close" otherButtonTitles:nil];
UIImage *alertBoxImage = [UIImage imageNamed:@"AlertViewBG.png"];
UIImageView *_backgroundImageView = [[UIImageView alloc] initWithImage:alertBoxImage];
_backgroundImageView.frame = CGRectMake(0, 0, 282, 130);
_backgroundImageView.contentMode = UIViewContentModeScaleToFill;
[notesAlert addSubview:_backgroundImageView];
[notesAlert sendSubviewToBack:_backgroundImageView];
NSLog(@"The Alert view frame height %f and width %f", notesAlert.frame.size.height, notesAlert.frame.size.width);
// height 0.000000 and width 0.000000
[notesAlert show];
NSLog(@"After showing the Alert view frame height %f and width %f", notesAlert.frame.size.height, notesAlert.frame.size.width);
// height 173.800003 and width 312.399994
```
see my screen shot:

So how to set the image frame size which depends on the alert view frame?
Please Help me out.
Thanks.
| How to set the Background image for UIAlert view in iPhone? | CC BY-SA 2.5 | null | 2011-02-11T14:56:20.083 | 2014-09-08T22:54:42.893 | 2011-02-11T15:08:10.590 | 249,916 | 249,916 | [
"iphone",
"uialertview"
]
|
4,970,466 | 1 | 4,970,696 | null | 7 | 19,700 | I'd like to crop an image using imagecreatetruecolor and it always crops it leaving black spaces, or the zoom is too big. I want the image to be exactly 191px wide and 90px high, so I also need to resize the image, as well as crop, because the ratio has to be kept. Well, there are some samples of the project:

The resize script (simplified) goes like this:
```
$src_img=imagecreatefromjpeg($photoTemp);
list($width,$height)=getimagesize($photoTemp);
$dst_img=imagecreatetruecolor(191, 90);
imagecopyresampled($dst_img, $src_img, 0, 0, $newImage['crop']['x'], $newImage['crop']['y'], $newImage['crop']['width'], $newImage['crop']['height'], $width, $height);
```
The $newImage['crop'] array includes:
```
['x'] => $_POST['inp-x']
['y'] => $_POST['inp-x']
['width'] => $_POST['inp-width']
['height'] => $_POST['inp-height']
```
But what I get is:

Anyone sees, what I'm doing wrong?
Thanks, Mike.
| PHP - cropping image with imagecopyresampled()? | CC BY-SA 2.5 | 0 | 2011-02-11T14:59:29.253 | 2016-10-03T18:58:59.673 | 2011-02-11T15:10:37.517 | 134,602 | 134,602 | [
"php",
"image",
"resize",
"crop"
]
|
4,970,847 | 1 | 4,970,873 | null | 0 | 360 | I have a div (with a background image) and the image's width is 40px.
Now when I change the width to 20px it trims the image's right side. Is there any way to make it trim the left side instead?
Explanation : I have a square (4 images for corners and 1 image for upper and lower strip (the strip images are just 1x20 with repeat-x)). If I go to the welcome page which only contains the word "Welcome!", that the square's size will decrease. If I go to the 'My Character' page, the square's size will increase.
Meaning the square will always fit the content.
```
<table align="center">
<tr>
<td>
<div id="dynamic" class="DynamicWidth" >
<div class="ContentTL ContentCorners">
</div>
<asp:Panel ID="ContentTC" runat="server" CssClass="ContentTC ContentStrips">
</asp:Panel>
<div class="ContentTR ContentCorners">
</div>
<div class="ContentDiv">
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
<div class="ContentBL ContentCorners">
</div>
<asp:Panel ID="ContentBC" CssClass="ContentBC ContentStrips" runat="server">
</asp:Panel>
<div class="ContentBR ContentCorners">
</div>
</div>
</td>
</tr>
</table>
```
Problem : Now, for the square's size to decrease and increase I can't use the 'px' unit since in the welcome screen, the whole square's width (2 corners and strip) might be 200px and in other pages, it's gonna be 1000px.
So I decided to use '%' - both corner with same % of width and the strip's width will complete to 100% (Ex: corners are 3% each, strip will be 96%)
It's all well but there's a problem - my corner image looks like this - bottom right() and bottom left(). if the page is really small - my left corner is ok but my right corner losses its roundness - almost looks like a square. (3% of 200px is really small and instead of trimming the left side of the picture it trims the right one which results in loss of the round size)
Solution : For this thing to work I asked you for a way to trim the image from the other side but than I thought of another solution : I took bottom left image () and simply flipped it (`-moz-transform: scaleX(-1);` I also have ones for opera,safari and IE) and the the width changes while triming it from the other side.
BTW : Now, I only need 2 images for corners instead of 4
| Change Which Side of a Background Image is Trimmed When its Container Changes Size? | CC BY-SA 2.5 | null | 2011-02-11T15:30:11.100 | 2011-02-13T23:04:22.453 | 2011-02-13T23:04:22.453 | 76,337 | 168,837 | [
"image",
"html",
"trim"
]
|
4,971,164 | 1 | 4,971,299 | null | 0 | 2,013 | Recently searching for a 'technical article' I stumbled upon this Microsoft page: [http://academic.research.microsoft.com/](http://academic.research.microsoft.com/). I found the paper I was looking for but was amazed by its feature.
Have a look at this page: [http://academic.research.microsoft.com/VisualExplorer#2037349](http://academic.research.microsoft.com/VisualExplorer#2037349).
The above page uses `SilverLight` and will recommend you to .
Like a curious human being I am now thinking of possible ways to implement it. A part of it seems easy:
1. Parse the documents
2. Make a list a authors(V) and distance between them (E) (i.e. co-author or co-co-author)
3. Traverse the above graph (Breadth First)
4. Show the top 5 or 6 connections
I know (or rather feel) this could be easily done in Flash, javascript or silverlight. But is there a way to do this using Java 2D/3D or OpenGL bindings?
Any or every thoughts are welcome.
---

| Interactive graphs using java graphics API (2D/3D/OpenGL/etc)? | CC BY-SA 2.5 | 0 | 2011-02-11T15:57:06.007 | 2011-02-11T16:09:07.370 | 2011-02-11T16:02:56.003 | 373,861 | 373,861 | [
"java",
"graph",
"java-2d",
"java-3d"
]
|
4,971,261 | 1 | null | null | 0 | 130 | How can I create a simple block of content, similar to the "Unrest in the Middle East" section on [The Economist](http://www.economist.com/)?

Any help will be greatly appreciated.
| Create block of content? | CC BY-SA 2.5 | null | 2011-02-11T16:05:06.627 | 2013-05-30T23:46:22.653 | 2013-05-30T23:46:22.653 | 225,647 | 586,634 | [
"php",
"html",
"css",
"drupal",
"drupal-blocks"
]
|
4,971,254 | 1 | 4,971,522 | null | 1 | 11,213 | I have a main page, call it Main.php. On this page, is a button that when clicked, sets a div's innerHTML (already on Main.php, called divResults) with the results from Results.php.
When Results.php is called, the returned HTML "These Are The Results" is properly received and set as the contents to divResults on Main.php. However, any javascript from Results.php is not executed. As an example, I attempt to do a simple window.alert. Here is example code:
Main.php link button to begin the action:
```
<img src="$MyImageSource" onclick=\"ExpandDropdownDiv()\" />
```
Main.php javascript function ExpandDropdownDiv():
```
function ExpandDropdownDiv(){
if (window.XMLHttpRequest)/* code for IE7+, Firefox, Chrome, Opera, Safari */
{
xmlhttp=new XMLHttpRequest();
}
else
{/* code for IE6, IE5 */
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4)/* && xmlhttp.status==200) */
{
document.getElementById("divResults").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","Results.php",true);
xmlhttp.send();
}
```
Results.php code example:
```
<script type="text/javascript">
alert("Success");
</script>
These Are The Results
```
The simple alert, from Results.php is just an example. If I were able to get this to work, I believe I could solve the rest of my problem on my own. However, I noticed a few comments suggesting to just place the alert in Main.php's javascript after i set the div's innerHTML. So, let me explain what I truly want to do with the javascript, after the div is set.
, shows some normal "Select" html elements, that have been transformed using jquery and the dropdown-check-list extension (.js). When the user clicks the colorful down arrow at the bottom, the div expands, and two more "Select" elements are generated within this other .php file... the html is returned, and placed in the div. Thus, i do not need to reload the entire page, and can place the new select dropdowns just beneath the existing ones.
The problem is, to "transform" these normal select elements, there is some javascript that needs to be executed against that HTML:
```
$(document).ready(function() {
$(".MultiSelect").dropdownchecklist( {firstItemChecksAll: true, maxDropHeight: 300 , searchTextbox: true, width: 100, textFormatFunction: function(options) {
var selectedOptions = options.filter(":selected");
var countOfSelected = selectedOptions.size();
var size = options.size();
switch(countOfSelected) {
case 0: return "All";
case 1: return selectedOptions.text();
/* case size: return "All"; */
default: return countOfSelected + " selected";
}
}
}
);
}
```
So, somehow I need to be able to execute javascript against the HTML that is generated from this other .php file. And simply calling the above code, after my divs innerHTML is filled, only re-generates the already existing dropdowns, not the two new ones.


| javascript XMLHttpRequest open php file and execute more javascript | CC BY-SA 2.5 | null | 2011-02-11T16:04:22.733 | 2011-02-11T17:09:46.673 | 2011-02-11T17:09:46.673 | 558,552 | 558,552 | [
"php",
"javascript",
"ajax",
"httprequest",
"activexobject"
]
|
4,971,452 | 1 | 4,983,379 | null | 1 | 1,566 | On selection I change the height of an UITableViewCell (loaded from a nib).
But the separator line is at a wrong position when I do this.

In the screenshot the first row is selected, and therefore bigger than the other ones.
From the separator positions it looks like the cell after the selected cell would be the big one. The second cell "has" exactly the size the first cell should have.
To change the height I save the selected indexpath in `tableView:didSelectRowAtIndexPath:` and compare it in `tableView:heightForRowAtIndexPath:`. If the indexpaths are the same I return the increased height. With the help of some NSLog I made sure that the correct height is returned.
And if I would resize the wrong cells the views of the cell would overlap, this doesn't happen.
If I click `Line 3` of the first cell the `tableView:didSelectRowAtIndexPath:` fires and the indexpath is the one for the first cell. So I guess the heights are correct, and the tableview draws the separators on the wrong position.
---
Does anybody has an idea what I did wrong?
Any solutions? Or should I file another bug with apple?
---
Edit: If I don't reuse my cells it works as expected.
| UITableView separator at wrong position | CC BY-SA 2.5 | null | 2011-02-11T16:23:12.943 | 2014-11-30T12:46:50.557 | 2011-02-11T16:39:27.620 | 457,406 | 457,406 | [
"iphone",
"cocoa-touch",
"uitableview"
]
|
4,971,456 | 1 | 4,971,537 | null | 0 | 72 | 
i have two arrays one for search bar and other for contact array. and first one display as tableview. the problem is that when i select two contacts from contact list and then i try to go on my search bar the selected contacts gone as shown in figure 2.
i try to reload table data but it didnot work. please help me... tha nks in advance.
| iphone Table View Issue | CC BY-SA 2.5 | null | 2011-02-11T16:23:46.390 | 2011-02-11T18:23:18.107 | null | null | 428,240 | [
"iphone"
]
|
4,971,484 | 1 | 5,002,397 | null | 2 | 2,448 | I just added an new rewrite rule so I can redirect pages like:
www.Domain.com/PartnerNameHere/
www.Domain.com/LandingPage?page=PartnerNameHere
However now all axd references are not working.
How do I set: ignore extensions for css,jpg,png axd..

| IIS7 Rewrite Rules How to Add: ignore extensions | CC BY-SA 2.5 | 0 | 2011-02-11T16:25:48.047 | 2011-02-15T17:14:33.967 | 2011-02-11T16:43:21.857 | 87,302 | 87,302 | [
"iis-7",
"url-rewriting"
]
|
4,971,543 | 1 | 4,971,665 | null | 2 | 71 | Anyone know where I can find a Windows.Forms control like this one here? I would like to use one in my application
| Looking for a .net Control like the one used in Task manager | CC BY-SA 2.5 | null | 2011-02-11T16:31:42.200 | 2011-02-11T16:43:31.680 | null | null | 64,758 | [
".net",
"controls"
]
|
4,971,626 | 1 | 4,971,648 | null | 1 | 573 | I use css to apply rounded corners to li navigation elements. This elements have a border too.
So this is how it looks like:

Like you can see the quality of the rounded corner - border combination is strange, there is a bit of white shining through.
Any idea how to fix that? Do I have to use bg-images?
| Css rounded corners with border | CC BY-SA 2.5 | 0 | 2011-02-11T16:39:17.480 | 2011-02-11T22:36:25.837 | null | null | 401,025 | [
"css",
"rounded-corners"
]
|
4,971,862 | 1 | 4,971,936 | null | 0 | 1,172 | I would like to trim the contents of a TextBlock at the bottom of the container when it runs out of space. The image below shows what I am trying to achieve.

The left cell contains text that is being wrapped at the end of the line, but is being cropped on the final line. The right cell (which I edited by hand) shows the effect I want to achieve by trimming the text on the last line.
Is there an (easy) way to achieve this in WPF?
| Is it possible to Trim Wrapped Text at the bottom of the container in WPF? | CC BY-SA 2.5 | null | 2011-02-11T17:04:13.563 | 2011-02-11T17:50:43.137 | null | null | 598,346 | [
"wpf",
"word-wrap",
"texttrimming"
]
|
4,972,271 | 1 | 4,972,416 | null | 5 | 6,161 | I'd like to convert an existing table into the 1st normal form (simplest normalization possible; see the example).
Do you happen to know what is the T-SQL is for this sort of problem? Many thanks!

Tried the answer below, it worked perfectly. Here is the steps I used to test the answer:
1. Start up Microsoft SQL Management Studio.
2. Create the tables, with the data below.
3. Make sure that the ID in "Customer" is set to "Primary Key", and "identity".
4. Make sure that the ID in "Order" has no special settings (its a foreign key).
5. Open up a database diagram, then create a 1:* relationship between the "Customer" and "Order" tables.
6. Execute the script on the "Customer" table and the "Order" table, it will automatically normalize the data properly for you.
7. This is very useful if you are starting from a flat .csv file that has just been imported, and you want to copy the information into a normalized form in the database.
| What is the T-SQL to normalize an existing table? | CC BY-SA 2.5 | 0 | 2011-02-11T17:43:03.723 | 2015-08-09T08:49:05.290 | 2011-02-13T18:46:34.067 | 107,409 | 107,409 | [
"sql",
"sql-server-2008"
]
|
4,972,452 | 1 | 4,972,479 | null | 0 | 371 |
# Problem
I have the following mark-up:
```
<div id="progress-bar">
<div id="step-1" class="active"><p>1. Select Room</p></div>
<div id="step-2" class="incomplete"><p>2. Choose Date</p></div>
<div id="step-3" class="incomplete"><p>3. Confirm Order</p></div>
<div id="step-4" class="incomplete"><p>4. Make Payment</p></div>
</div>
```
The border it meant to surround all of the "steps", but instead cuts them in half, the only way I've found to solve is to explicitly set the height on this, although I thought the content inside would do this when not setting a height.

According to Chrome's Inspect Element, these are all of the CSS rules applied to it:
Progress Bar:
```
div#progress-bar {
padding-top: 10px;
padding-bottom: 10px;
border: 1px solid black;
}
```
Individual Steps only have mark-up for font styling (text-shadow, font-size), as well as (Where step-x corresponds to step-1,step-2 etc.):
```
div#step-x {
padding: 10px;
width: 227.5px;
float: left;
}
```
I did use a CSS reset, although I assumed the idea behind those was to remove all styling, so could that be an issue?
Any links to this specific problem elsewhere (further reading, if it's a known bug, perhaps a workaround) are welcome.
| Strange DIV behaviour (in Chrome, IE, FF) | CC BY-SA 2.5 | null | 2011-02-11T18:03:13.707 | 2011-02-11T18:06:15.487 | null | null | 481,011 | [
"html",
"css"
]
|
4,972,476 | 1 | 4,972,871 | null | 7 | 5,008 | I'm using WPF 3.5 SP1 and I want to achieve something like this (the glass-part is already done):
[](https://i.stack.imgur.com/lEMPR.jpg)
[ggpht.com](http://lh3.ggpht.com/_0B12UOQNmgU/SwPqI4FcYaI/AAAAAAAAASM/HKFPyZ9uX3o/Aero%20Glass.jpg)
([Source](http://www.nullskull.com/q/10129520/use-drawthemetextex-on-painted-windows-form.aspx))

([Source](https://www.codeproject.com/Articles/38780/Glass-Effect-Extender-Library-for-your-Application))
You can see nice blur around the text, which makes it very well readable. I also found out that correct approach is to use API `DrawThemeTextEx`, which renders the blur using recommended system options. However, how can I achieve the same effect using WPF?
I was able to find these links which contain helpful resources:
[How to make WPF text on Aero glass background readable?](https://stackoverflow.com/questions/4114590/how-to-make-wpf-text-on-aero-glass-background-readable)
[Glowing Label Controls On A Glass Surface](https://stackoverflow.com/questions/2804265/glowing-label-controls-on-a-glass-surface)
They do it by duplicating the TextBlock, and setting a Blur effect on it. However, this is not a real solution. Here is how it looks like:
[](https://i.stack.imgur.com/yAK0n.png)
Compare the result effect with the images above, and you will see the solution is still far away. So how can I properly get the desired effect using WPF? I'm fine with emulation (no use of `DrawThemeTextEx` API), as far as the result is pretty similar.
Thank you.
| Make Label/TextBlock readable on glass using blur effect | CC BY-SA 4.0 | 0 | 2011-02-11T18:05:47.987 | 2019-08-08T22:16:34.180 | 2019-08-08T22:16:34.180 | 4,751,173 | 298,609 | [
"c#",
".net",
"wpf",
"presentation"
]
|
4,972,484 | 1 | 4,979,459 | null | 1 | 484 | Hello I added a JQuery SlideShow with 6 png images each with the size 548px X 320px
For some reason, sometimes when the page first loads these images appear very tiny. When I refresh the page, the images appear normal size. Again this doesnt happen every time. Im not sure if this could be a JavaScript error because when I run this in JFiddle there are JavaScript errors from the plugin's js file.
[http://jsfiddle.net/Mutant_Tractor/Re9pt/3/](http://jsfiddle.net/Mutant_Tractor/Re9pt/3/)

I've noticed on other sites that they implement some type of PreLoad(). I dont have that.
Here is the HTML:
```
<div id="top-feature">
<div class="slideshow">
<img alt="image1" src="images/slide1.png" />
<img alt="image2" src="images/slide2.png" />
<img alt="image3" src="images/slide3.png" />
<img alt="image4" src="images/slide4.png" />
<img alt="image5" src="images/slide5.png" />
<img alt="image6" src="images/slide6.png" />
</div>
```
Here is the CSS:
```
#top-feature {
height: 320px;
width: 848px;
margin: 12px 0 0 16px;
background: orange;
/*padding: 10px 0 0 10px;*/
position: absolute;
text-align: left;
}
#top-feature div {
/*float: left;*/
}
.slideshow {
height: 320px;
width: 548px;
margin: 0 0 0 0;
/*background: blue;*/
position: absolute;
}
```
| Images of JQuery SlideShow not always loading with correct size | CC BY-SA 2.5 | 0 | 2011-02-11T18:06:49.640 | 2011-02-12T17:26:53.207 | 2011-02-11T23:54:53.970 | 598,931 | 598,931 | [
"javascript",
"html",
"css"
]
|
4,972,816 | 1 | 4,972,915 | null | 0 | 10,410 | We are trying to build a JSF application with JPA. For now, we want to make the login feature, but when we run the application on our glassfish server, there is the exception:
javax.persistence.PersistenceException: No Persistence provider for EntityManager named siteMami
We think the problem is somewhere from persistence.xml, maybe at the provider, please help us. Thanks! Here is the directory structure:

persistence.xml:
```
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
version="1.0">
<persistence-unit name="siteMami" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<class>model.Admin</class>
<class>model.User</class>
<class>model.Client</class>
<properties>
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" />
<property name="javax.persistence.jdbc.url"
value="jdbc:mysql://localhost/siteMami" />
<property name="javax.persistence.jdbc.user" value="root" />
<property name="javax.persistence.jdbc.password" value="" />
</properties>
</persistence-unit>
</persistence>
```
User.java:
```
/**
*
*/
package model;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;
import javax.persistence.Transient;
@Entity
@Table(name = "useri")
@Inheritance(strategy = InheritanceType.JOINED)
public class User implements Serializable
{
@Transient
private static long serialVersionUID = 6837935606727700935L;
@Id
@GeneratedValue
@Column(name = "idUseri")
private long id;
@Column(unique = true)
private String username;
private String password;
/**
* @param id
* @param userName
* @param password
*/
public User(long id, String username, String password)
{
super();
this.id = id;
this.username = username;
this.password = password;
}
/**
* @return the id
*/
public long getId()
{
return id;
}
/**
* @return the userName
*/
public String getUsername()
{
return username;
}
/**
* @return the password
*/
public String getPassword()
{
return password;
}
public void setId(long id)
{
this.id = id;
}
public void setUsername(String userName)
{
this.username = userName;
}
public void setPassword(String password)
{
this.password = password;
}
}
```
UserManager.java:
```
package dao;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
import javax.persistence.Persistence;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import model.User;
public class UserManager
{
private EntityManagerFactory factory;
public UserManager()
{
factory = Persistence.createEntityManagerFactory("siteMami");
}
public User getUser(String username, String password)
{
EntityManager entityManager = factory.createEntityManager();
EntityTransaction entityTransaction = entityManager.getTransaction();
entityTransaction.begin();
Query q = entityManager.createQuery("SELECT * FROM User WHERE User.username = '" + username + "' and User.password = '" + password + "'");
entityTransaction.commit();
return (User) q.getSingleResult();
}
}
```
| Can't figure it out how to resolve javax.persistence.PersistenceException | CC BY-SA 2.5 | null | 2011-02-11T18:46:39.233 | 2011-02-11T19:42:06.517 | 2011-02-11T18:52:07.700 | 297,762 | 432,580 | [
"java",
"jsf",
"jpa",
"persistence.xml"
]
|
4,972,930 | 1 | null | null | 2 | 337 | We have some 2d data parser that recives images of size 8x8 (roiSize=8) which are sent to our parser from something like:
```
void UseOurParser(IplImage* destination)
{
int w = destination->width;
int h = destination->height;
original = cvCreateImage(cvSize(w, h),IPL_DEPTH_8U,1);
cvCvtColor(destination,original,CV_RGB2GRAY);
cout << endl << "Progress:";
for(int j = 1; j < original->width/roiSize-1; j=j++) {
cout << "." ;
for(int i = 1; i < original->height/roiSize-1; i=i++) {
cvSetImageROI(original, cvRect(j*roiSize, i*roiSize,roiSize, roiSize));
IplImage *cropSource = cvCreateImage(cvGetSize(original), original->depth, original->nChannels);
cvCopy(original, cropSource, NULL);
ProcessOurParser(cropSource, j, i);
cvResetImageROI(original);
}
} //...
```
Our parser takes an image j, i and inside it can determine if an object was found on an image. And if it was found it performs another operation that determins some feature value (some float). I want somehow to create a 2d representation of my data (of size like (original->width/roiSize-2) X (original->height/roiSize-2)) so to each roi I'd have a value declaring if feature was found in it or not and if it was its feature value. What I need is to be capable to iterate through generated data. and implement some kind of region grouse algorithm so that if feature on one roi is == to feature on another that is one of 8 surrounding it we somehow grow region and check again and again so we find regions...
So if we were searching for lines and our features were bool for line existence and angle float (as I do) we would do something like
1) (we stand on blue 1 and 2 yellow 1s are points of our interest)

We submited to our "line" that 2 regions and continue searching

We found hat feature on one roi is related to our line and another is not so we will return to that roi later

so is there any help in boost on how to do such thing or any code help you can provide?
| C++ How to create simple 2d region grouse algorithm? | CC BY-SA 2.5 | 0 | 2011-02-11T19:00:22.143 | 2011-03-17T14:47:22.033 | null | null | 434,051 | [
"c++",
"boost",
"opencv",
"region"
]
|
4,973,137 | 1 | null | null | 0 | 263 | We have some code inside our application that captures an image of a window and saves it to a PNG file and copies it to the clipboard (C++ API code).
Works perfectly on Windows XP. It also works on Windows 7, except that it looks as if the top few pixel lines of the image have been chopped off, as if the area that was captured did not include the top few lines of the window. Yet our code clearly copies from the top of the image, shown below.

(On Windows XP you see the full X on the right hand side plus the top border of the Window)
Is this some aero or other display effect on Windows 7, or is there a way to compensate for this?Or could something in our code possibly be causing this?
Sure, we can determine the window area and capture it from the client window, and capture a few lines higher up, but how may lines, and that seems arbitrary.
There must be some fundamental flaw or issue here?
Our code is roughly as follows:
```
RECT wndRect;
GetWindowRect(hwnd, &wndRect);
int Width = wndRect.right - wndRect.left;
int Height = wndRect.bottom - wndRect.top;
BYTE *pBits = 0;
BITMAPINFO bmpinfo = {sizeof(BITMAPINFO)};
bmpinfo.bmiHeader.biWidth = Width;
bmpinfo.bmiHeader.biHeight = Height;
bmpinfo.bmiHeader.biPlanes = 1;
bmpinfo.bmiHeader.biBitCount = 24;
bmpinfo.bmiHeader.biCompression = BI_RGB;
HBITMAP hBmp = CreateDIBSection(NULL, &bmpinfo, DIB_RGB_COLORS, (void**)&pBits, NULL, 0);
HDC hWndDC = GetWindowDC(hwnd);
HDC hDC = CreateCompatibleDC(hWndDC);
HBITMAP hOldBmp = (HBITMAP)SelectObject(hDC, hBmp);
BitBlt(hDC, 0, 0, Width, Height, hWndDC, 0, 0, SRCCOPY);
```
| Very top of window gets cut off in image capture on Windows 7 | CC BY-SA 2.5 | null | 2011-02-11T19:23:59.190 | 2011-08-15T22:07:22.367 | null | null | 448,548 | [
"bitmap",
"screen",
"capture"
]
|
4,973,401 | 1 | 4,975,595 | null | 12 | 1,897 | I am designing a little soccer game where the game engine (that computes player moves etc.) runs on a server, and rendering and keyboard/mouse handling is done by the client. For the server (Haskell) I want to use
- -
Every 20ms or so, the client should send keyboard and mouse events to the server via HTTP GET, receive the current game status (JSON-encoded ball and player positions) and render it. I am thinking about using SDL infrastructure for the game loop, input handling and rendering.
The server basically runs two threads: A happstack server receives the HTTP GET, puts the keyboard / mouse commands in a queue, reads the current game status from a second queue and answers the HTTP GET request.
The second thread runs a Yampa game engine, as described in the [Yampa Arcade paper](http://www.google.de/url?sa=t&source=web&cd=1&ved=0CBgQFjAA&url=http%3A%2F%2Fciteseerx.ist.psu.edu%2Fviewdoc%2Fdownload%3Fdoi%3D10.1.1.65.8016%26rep%3Drep1%26type%3Dpdf&ei=3Y5VTdOrBs74sgaQhJzmDA&usg=AFQjCNEIW_IZQ9qAg-Jc8RbGfx9981RJBw): The game engine computes the new round as quickly as possible (no ticks) and puts the result in the render queue.

General question: Does this look like a feasible architecture?
Specific question: How would one design the server side rendering queue: Would one use a Chan for this? If the game engine is quicker on average than the "ticking" on the client side, the queue will get longer and longer. How could this be handled with Chan?
Your comments are very welcome!
| How to best synchronize game engine and network server in Haskell? | CC BY-SA 2.5 | 0 | 2011-02-11T19:55:33.077 | 2011-02-14T18:42:36.407 | 2011-02-12T00:29:21.973 | 203,251 | 317,984 | [
"haskell",
"concurrency",
"game-engine",
"frp"
]
|
4,973,677 | 1 | 4,973,865 | null | 1 | 543 | how can one create a css layout as seen on google wave that resizes automatically according to window size without the need for scrolling (apart from the specific elements on each page which are using scrollbars) with each div positioned in a similar fashion as seen on the website? i really love this interface and have been trying to create it on dreamweaver (web programming is a hobby) without using tables as practice.
i am learning css from scratch.
i have included an image for reference.
many thanks!

| google wave css layout | CC BY-SA 2.5 | 0 | 2011-02-11T20:26:52.800 | 2011-02-11T21:13:08.617 | null | null | 436,493 | [
"css"
]
|
4,973,705 | 1 | 4,973,812 | null | 0 | 233 | I have an error on my site triggered by Internet Explorer 8 when I first enter the page. The debugger says:
> Object doesn't support this property or method widget, line 48 character 3
I click on the error to take me to the line. It leads me to HTML. How is it possible that HTML triggered a JS error?

I have not clicked this anchor. The error appeared upon page load. Can someone give me leads on where I should be looking to find the problem?
Live site: [http://veetle.com/index.php/widget#3D598BC5A2144C53D2797CF7EDEF083A/true/default](http://veetle.com/index.php/widget#3D598BC5A2144C53D2797CF7EDEF083A/true/default)
| Internet Explorer javascript error points to HTML | CC BY-SA 2.5 | null | 2011-02-11T20:29:31.540 | 2011-02-11T20:40:25.587 | null | null | 459,987 | [
"javascript",
"html",
"internet-explorer-8"
]
|
4,974,347 | 1 | null | null | 4 | 3,360 | I have a page setup that looks similar to this:
```
<body>
<div id="wrapper">
<!--- ... content ... -->
</div>
</body>
```
The body has a background color and a tiling image that adds some noise and grain to the background. On top of that, #wrapper has a linear gradient as background that goes from rgba(0,0,0,.3) to rgba(0,0,0,0) and the gradient expands over 24 pixels at the top of the div, which is at the top of the page --- to add a shadow.
My problem is, that the color that the background of #wrapper holds after the 24 pixel gradient is done, is not true transparency, even though the end color of the gradient has an alpha value of zero. What this leaves me with, is a not true transparent background on #wrapper, that leaves a visible "split-line" on the body-background at the spot where #wrapper stops.
How do I get the gradient to go in to full transparency? I would guess an alpha value of zero would do this. Also, using the `transparent` keyword doesn't solve it either.
I have added pictures to show the problem. The first picture is the actual look, and the second significantly shows where the line is, because it's there, though very unclear on the first picture.


As you can see, the gradient doesn't go in to true transparency. Not when the to-color is specified as `rgba(0,0,0,0)` or `transparent`.
-- Chris Buchholz
| CSS3 linear gradient + rgba, not so true transparency | CC BY-SA 2.5 | null | 2011-02-11T21:37:57.580 | 2014-12-03T19:56:11.747 | 2014-12-03T19:56:11.747 | 64,046 | 499,997 | [
"css",
"transparency",
"gradient",
"linear-gradients"
]
|
4,974,404 | 1 | null | null | 1 | 916 | I'm investigating the feasibility of using Raphael for a user-research project. One of the features allows for users to drag images onto a canvas and we record where they placed it. The pool of images is potentially quite large and we'll have them in a scrollable box in the tool.
I put together a quick wireframe of the issue I'm looking into since it'll probably be clearer than my explanation.
Please see the wireframe:

| Dragging images from a scrollable region in Raphael? | CC BY-SA 2.5 | 0 | 2011-02-11T21:44:56.973 | 2011-03-31T13:03:54.363 | 2011-02-12T03:54:52.493 | 405,017 | 70,873 | [
"drag-and-drop",
"svg",
"raphael"
]
|
4,975,077 | 1 | 4,975,111 | null | 9 | 3,238 | I add my menu items shortcut keys, but they are poorly arranged.

and I need to make it like this:

| How do I right align the shortcut keys in Menu? | CC BY-SA 2.5 | 0 | 2011-02-11T23:25:26.180 | 2011-07-17T05:51:40.760 | 2011-07-17T05:42:51.473 | 366,904 | 450,466 | [
"winforms",
"winapi",
"menu",
"alignment",
"shortcut"
]
|
4,975,191 | 1 | 4,975,209 | null | 3 | 3,754 | In our html we have:
```
<div id="error2"></div>
```
This displays dynamic error message.
In the css I have:
```
#error2 {
background:url(../images/cross.png) left center no-repeat;
color: #ff2217;
font-size:16px;
font-weight:bold;
position:absolute;
top:175px;
left:32px;
}
```
What I get is:

What I want is:

| display icon to left of text | CC BY-SA 2.5 | null | 2011-02-11T23:47:21.393 | 2011-02-11T23:53:05.897 | 2011-02-11T23:50:08.417 | 405,143 | 501,173 | [
"css"
]
|
4,975,254 | 1 | null | null | 1 | 152 | Example:

Does anyone know how these dialog box rule-lines are created? Can they be created at design-time using a common control or are they custom-controls?
I'd like to simply drag one on my form and position it, but I cannot find the control (if it does exist).
Anyone have any experience creating these?
(I'm using Visual Studio .NET 2010; C#)
| Rule-Lines in Dialog Boxes | CC BY-SA 3.0 | null | 2011-02-11T23:57:06.287 | 2011-04-21T09:49:48.977 | 2011-04-21T09:49:48.977 | 46,594 | 613,787 | [
".net",
"dialog"
]
|
4,975,266 | 1 | null | null | 6 | 31,841 | I need to convert a html file to doc.
I am using html2pdf for pdf conversion.
Is there is any same kind of library for html2doc?
(PS must be free/open source)
After Mark Eirich comment..
Here are two screenshots. Word document is not proper aligned. Check y-scroll in word document.
[WORD document, check y scroll..](https://i.stack.imgur.com/Gcvyl.png)

Body tag is:--
```
<body style="margin-left:350px; margin-right:350px;">
```
I tried to adjust it but no effect..
after Mark Eirich second comment i came to know word is taking things in pixel not in %age.. I am having last issue of back ground.. Any help.. please check the two screen shots. The difference is outer box. and thats y html generated doc is looking odd.


| How to convert html to doc in php | CC BY-SA 3.0 | 0 | 2011-02-11T23:58:51.633 | 2014-03-05T01:23:08.437 | 2012-05-07T17:03:21.540 | 179,855 | 179,855 | [
"php",
"html",
"doc"
]
|
4,975,437 | 1 | 5,007,157 | null | 6 | 36,488 | I am running ReportViewer 10 using a local report (rdl) file in an MVC web site. I am passing in a DataSet that has the correct data with column names that match the report definition.
```
var reportDataSource = new ReportDataSource("dataset1", resultSet);
ReportViewer1.LocalReport.ReportPath = Server.MapPath("/Reports/Report2.rdl");
ReportViewer1.LocalReport.DataSources.Clear();
ReportViewer1.LocalReport.DataSources.Add(reportDataSource);
List<ReportParameter> lst = new List<ReportParameter>();
ReportParameter rptParam1 = new ReportParameter("Id", "54");
lst.Add(rptParam1);
ReportViewer1.LocalReport.SetParameters(lst);
ReportViewer1.LocalReport.Refresh();
```
The error I am getting is:

I am unable to find any more specific information on the exact error.
Is there a log file somewhere I can look at?
Thank you.
| SSRS local report fails - error "An error has occurred during report processing" | CC BY-SA 2.5 | 0 | 2011-02-12T00:30:39.737 | 2016-05-04T13:58:42.490 | 2011-02-14T22:15:14.123 | 131,818 | 131,818 | [
"reporting-services",
"ssrs-2008"
]
|
4,975,462 | 1 | 4,975,551 | null | 12 | 5,674 | I've been using jQuery and YUI side-by-side with no issues until recently. Occasionally, inside of a callback for, say, a YUI button, `$` will be shadowed by some other function (click for big version):
[](https://i.stack.imgur.com/o0y4B.png)
and for the life of me, . Yes, I know I could be safe and use `jQuery` or `window.$` everywhere instead of just `$`, but that's just a workaround and not an actual fix.
At runtime, how can I find where this `$` impostor is coming from? - e.g. find where it's declared, and why it's in my bleedin' scope.
---
It turns out that this behavior is easily reproduced (at least in Chrome and Firefox 4) right here on Stack Overflow, since SO uses jQuery (again, click for full size):
[](https://i.stack.imgur.com/DSwZ3.png)
[](https://stack.i.imgur.com/9c4aL.png)
I can only infer that `$` as
```
function () {
return document.getElementById.apply(document, arguments)
}
```
must be from the console itself!
## Found it.
`with` strikes again.


Chromium bug for this: [http://code.google.com/p/chromium/issues/detail?id=70969](http://code.google.com/p/chromium/issues/detail?id=70969)
| How do I find where a variable is defined at runtime? | CC BY-SA 3.0 | null | 2011-02-12T00:35:21.363 | 2017-02-02T17:36:30.183 | 2017-02-02T17:36:30.183 | 155,005 | 139,010 | [
"javascript",
"shadowing"
]
|
4,975,549 | 1 | 4,975,653 | null | 2 | 407 | I'm doing Example 3 on the [Notepad tutorial](http://developer.android.com/resources/tutorials/notepad/notepad-ex3.html) on developer.android.com.
It's time to run my code, but I can't even compile, because I have errors on lines that call `R.layout.*something*` or `R.string.*something*`. Every error is of the type...
" cannot be resolved or is not a field."
...which signals to me that maybe I named something wrong or forgot to name it in the XML. So I check my XML files and do a little cleanup. Everything seems to be normal. No red Xs.
I go back to the class, where I see what looks odd to me. In two separate lines that call to two separate elements in the same layout file, one yields an error and one doesn't:
```
mTitleText = (EditText) findViewById(R.id.title); // no error
mBodyText = (EditText) findViewById(R.id.body); // error: "body cannot be resolved or is not a field"
```

Again, Eclipse isn't showing me any errors on the XML file:

What might I have done wrong that some of the resources are resolving in the code and some aren't? Is this something Eclipse can sort out, similar to ?
If it makes any difference, I picked Android 2.1 as a build target. And I importing android.R.
Thanks in advance for any help.
| How can I get Android to resolve XML resources? | CC BY-SA 2.5 | null | 2011-02-12T00:54:19.350 | 2013-08-13T14:33:46.290 | 2013-08-13T14:33:46.290 | null | 472,783 | [
"android",
"xml"
]
|
4,975,713 | 1 | 4,975,762 | null | 1 | 10,741 | I am trying to create a blank database with mySQL Workbench that I can connect to with php. All this is on my local machine.
Here's what I think you do.
1. Click on Create New EER Model
2. Create a new Physical Schemata
3. Give it a name
4. Save Model to Current File
5. I think the name you add here is the database name?
However I can't connect to that name in php.
I have been trying this with a few options and one of them worked, but I can't see what's different about the ones that don't work.
There must be something very simple I am missing here.
eg this works:
```
$dbname = 'test';
$db = mysql_select_db($dbname);
echo '<br>db test is '.$db;
```

| How do you create a database in mySQL Workbench that you can connect to with php? | CC BY-SA 2.5 | 0 | 2011-02-12T01:31:06.873 | 2015-02-20T16:44:12.920 | 2015-02-20T16:44:12.920 | 488,195 | 24,696 | [
"php",
"mysql",
"eer-model"
]
|
4,975,726 | 1 | null | null | 0 | 753 | I have a simple, reproducable memory leak associated with the Spark Combo box, however I'm convinced it must be something I'm doing wrong, rather than an SDK bug.
```
// Application.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
<s:layout>
<s:VerticalLayout />
</s:layout>
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;
private var hasElement:Boolean;
protected function toggleContainer():void
{
if (hasElement)
{
button.setFocus();
comboBoxContainer.removeAllElements();
hasElement = false;
} else {
var vew:ComboBoxView = new ComboBoxView();
comboBoxContainer.addElement(vew);
hasElement = true;
}
}
]]>
</fx:Script>
<s:Button id="button" label="Add container" click="toggleContainer()" />
<s:Group id="comboBoxContainer" />
</s:Application>
// ComboBoxView.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:VGroup xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
>
<s:ComboBox />
</s:VGroup>
```
When compiled against Flex 4.1, this appears to create a memory leak, where ComboBoxView is never GC'd -- because of a lingering reference to the ComboBox.
Here's the output from the profiler:

Steps to reproduce:
- `Application.mxml``ComboBoxView.mxml`- - - - - - - -
Note - this doesn't occur when the application is compiled against Flex Hero.
It appears as though this is a bug, but I cannot believe that the ComboBox has a memory leak -- surely this would've been fixed before 4.1 was shipped?
What am I doing wrong here? Why isn't the view being GC'd?
I've done further investigation into this, and believe the issue lies in a problem with the RichEditableText component that the ComboBoxSkin uses. See details here:
[Spark memory leaks](https://stackoverflow.com/questions/4994651/spark-memory-leaks)
| Spark Combox Memory Leak | CC BY-SA 2.5 | null | 2011-02-12T01:34:30.583 | 2015-08-08T23:23:47.967 | 2017-05-23T12:13:26.330 | -1 | 59,015 | [
"apache-flex",
"memory-leaks",
"flex4",
"flex-spark"
]
|
4,975,863 | 1 | 4,975,916 | null | 24 | 14,361 | I have an unordered list that wraps onto a second line, and needs to be centered horizontally within the containing UL. Each LI is a set width and height. I've seen many approaches that work for a single line, but nothing I've tried is working when the list wraps to a second line. Would be ideal if this worked in IE7+ -- Thanks for the help.
See here for an illustration:

[http://grab.by/8UIl](http://grab.by/8UIl)
| Horizontal Centering of Multi-Line List Items in Unordered List | CC BY-SA 3.0 | 0 | 2011-02-12T02:07:28.027 | 2011-11-29T02:56:55.303 | 2011-11-29T02:56:55.303 | 234,976 | 514,225 | [
"css",
"list",
"centering",
"html-lists"
]
|
4,976,049 | 1 | 4,976,147 | null | 0 | 156 | I'm in a class that has a labview course, the teacher gave us a PDF with a block diagram picture in which several icons are displayed. One of the icons is unknown to us, we are trying to find it, is it part of labview, or have you seen it before in the function libraries?

| Unable to find function in labview labeled "si wave" | CC BY-SA 2.5 | null | 2011-02-12T03:03:44.677 | 2013-06-28T04:44:27.413 | 2011-02-12T03:16:59.583 | 160,978 | 160,978 | [
"labview"
]
|
4,976,202 | 1 | 4,976,258 | null | 1 | 2,830 | Got a question about C++ Pointer addition. If you look at the screen shot provided you can basically see I'm doing a memcpy(m_pBuf + m_iWritePtr .... and this memory pointer addition is not working as expected.
I had thought that the addition of m_pBuf + m_iWritePtr would add m_iWritePtr bytes to my memory address m_pBuf. m_pBuf is a pointer to a structure array; i.e. (T *)m_pBuf = new T[cnt] where T is a typename and cnt is the number of T objects allocated. T is, in this case a simple structure. The sizeof(T) in this case is 260.
The memcpy call is throwing a fault and I know my pointer math is wrong but I'm not 100% sure why. The memcpy is coded to, I thought, to take the base address and add some n * 260 bytes to get an offset into the buffer. NOTE: This code use to work when this was not a template implementation and T was simply a char *. Now that T is a template of some typename, the offset addition no longer works as expected.
So if you look at the screen shot below, here are the results of various calculations/references I did using the compiler's debugger/inspector and a calculator:
```
The memory address of m_pBuf = 0x01E7E0E0
The memory address of m_pBuf[1] = 0x01E8EE04
the memory address of m_pBuf+1 = 0x01E8EE04
the memory address of m_pBuf++ = 0x01E8EBFC
the memory address of m_pBuf+260 = 0x01E7E1E4 (the calculator's result)
```
I'm trying to understand what's going on here. The first two seem correct but I don't understand why none of these are equal. This is 32bit compiler on Windows 7-64bit.

To further explain, this is a ring buffer of type T with a size of n * T objects of storage. Here is the code:
```
template<typename T>
bool TMsgBuffer<T>::PutMsgEx(T *pBuf, unsigned long nObjCount )
{
bool bResult = false;
unsigned long MaxWriteSize, nPutLen;
Lock();
MaxWriteSize = GetMaxWriteSize(); // this returns size of my buffer in total.
nPutLen = nObjCount * m_nObjSize; // m_nObjSize is set else where to sizeof(T)
if(nPutLen <= MaxWriteSize)
{
// easy case, no wrapping
if( m_iWritePtr + nPutLen <= m_nBufSize )
{
memcpy(m_pBuf + m_iWritePtr, pBuf, nPutLen);
m_iWritePtr += nPutLen;
}
else // need to wrap
{
m_iFirstChunkSize = m_nBufSize - m_iWritePtr;
m_iSecondChunkSize = nPutLen - m_iFirstChunkSize;
memcpy(m_pBuf + m_iWritePtr, pBuf, m_iFirstChunkSize );
memcpy(m_pBuf, pBuf + m_iFirstChunkSize, m_iSecondChunkSize );
m_iWritePtr = m_iSecondChunkSize;
}
//m_MsgCount++;
m_MsgCount+= nObjCount;
bResult = true;
}
Unlock();
return bResult;
}
```
| C++ Pointer Math | CC BY-SA 2.5 | 0 | 2011-02-12T03:51:18.940 | 2011-02-12T04:27:41.603 | 2011-02-12T04:27:41.603 | 12,937 | 12,937 | [
"c++",
"math",
"pointers"
]
|
4,976,308 | 1 | 4,976,342 | null | 0 | 884 | Is there a way to have one container div that I can put links on the left side and simple text on the right side? I know this can be done, but I've been struggling to get it to work. The code CSS I have would have to be highly modified due to the content I'm serving, so, I've uploaded a moc draft of what I want and see if you guys can help me out.

| CSS: Multiple Content in one div? | CC BY-SA 2.5 | null | 2011-02-12T04:24:55.590 | 2012-06-27T14:18:39.873 | 2012-06-27T14:18:39.873 | 44,390 | 259,717 | [
"css",
"html",
"css-float"
]
|
4,976,341 | 1 | 4,976,427 | null | 1 | 521 | I have a table view as shown. It displays various European Languages from database. When I scroll the tableview the scrolling isn't smooth and at times it gets stuck for a second or two. What could be wrong?
I am decoding the languages using below code:
```
NSString *cellText = [[langArray objectAtIndex:i] valueForKey:[NSString stringWithFormat:@"%@",lblshortName.text]];
if (cellText != (NSString *)[NSNull null] && ![cellText isEqualToString:@""] ) {
NSString *decodedString3 = [NSString stringWithUTF8String:[cellText cStringUsingEncoding:[NSString defaultCStringEncoding]]];
[cellTextArray addObject:[NSString stringWithFormat:@"%@ : %@",lblshortName.text, decodedString3]];
}
else {
[cellTextArray addObject:@"<empty>"];
}
```

| iPHONE: TableView Scroll isn't smooth - What could be wrong? | CC BY-SA 2.5 | null | 2011-02-12T04:31:35.817 | 2011-06-06T07:54:28.917 | 2020-06-20T09:12:55.060 | -1 | 480,346 | [
"iphone",
"objective-c",
"cocoa-touch",
"iphone-sdk-3.0",
"ios4"
]
|
4,976,415 | 1 | null | null | 1 | 188 | I want to add a completely custom content type to the WordPress admin panel as per my image below. I don't believe this is called a plugin as I did a tutorial on those and they don't have an admin interface. I want to define a custom create/edit/delete screen for this content.
Is this possible?
What should I be searching for to get help on this?

| How do I add content types other than Posts in the WordPress admin area? | CC BY-SA 2.5 | null | 2011-02-12T04:53:12.633 | 2011-02-13T15:09:59.667 | 2011-02-12T17:08:03.483 | 85,385 | 24,696 | [
"wordpress"
]
|
4,976,520 | 1 | 4,976,533 | null | 2 | 19,686 | I want to select "Algeria" as default selected value in drop down list.I am fetching countrylist from database using handler ( LoadCountryList.ashx ) in JSON data format and binding it to dropdownlist on aspx page using Jquery's $.getJSON precedure given below
```
function AddOptions(objSelect)
{
var URL ="~/LoadCountryList.ashx";
$.getJSON(URL,function(countries){
$.each(countries,function(){
var vCountry = this['Country'];
$(objSelect).append($("<option></option>").val(this['ID']).html(vCountry));
});
});
}
```
and finally i tried to set its default value "Algeria".
```
$(objSelect).find("option[text='Algeria']").attr("selected","selected");
OR
$(objSelect).find("option[value='3']").attr("selected","selected");
```
but its not worked.Does anyone suggest me how to do it.

Also i want to show waiting message like Loading... until it get complete country list from database.
| How to select default value in drop down list using JQuery | CC BY-SA 2.5 | null | 2011-02-12T05:27:54.453 | 2014-09-29T10:18:55.643 | 2011-02-12T06:53:36.750 | 503,125 | 503,125 | [
"jquery",
"asp.net",
"json",
"drop-down-menu"
]
|
4,976,899 | 1 | 5,001,590 | null | 1 | 226 | I am developing an application in [.NET](http://en.wikipedia.org/wiki/.NET_Framework) Windows for mathematics. I want to show these expressions:

Which font do I have to use and how do I display these?
| Trignometric / mathematical expressions on windows form in .NET | CC BY-SA 3.0 | null | 2011-02-12T07:22:08.313 | 2012-06-18T02:01:29.940 | 2012-06-18T01:57:43.467 | 63,550 | 165,309 | [
".net",
"windows",
"trigonometry"
]
|
4,977,032 | 1 | null | null | 3 | 13,572 | I'm using [http://gmap.nurtext.de/documentation.html](http://gmap.nurtext.de/documentation.html) library to display the map for my address field (mysql table)
How I can get the `latitude` and `longitude` for each address, for example:
I have this address: 'McLester road'

my visitor (user) who added the address (into Mysql table)
| How to get `latitude` and `longitude` for an address? Google Maps | CC BY-SA 2.5 | 0 | 2011-02-12T07:57:25.497 | 2015-02-18T09:49:12.403 | 2011-02-12T08:15:59.607 | 521,466 | 521,466 | [
"google-maps-api-3",
"maps",
"google-maps-markers"
]
|
4,977,291 | 1 | 4,977,343 | null | 0 | 234 | I am using float and then clearing both. but still i have getting some error in the layout. can some one point out what the problem is ?
[http://uniquedl.com/3closets/about.html](http://uniquedl.com/3closets/about.html)
i want Sneak-peek control div and sneak peek products div to be next to each other. i am using this code to make it next to each other
```
.grid {
display:inline;
float:left;
}
```
But sneek-control is taking a lot of margin to the left and not sitting below the above div block

i want the layout to look like this

| CSS float clearing issue | CC BY-SA 4.0 | null | 2011-02-12T09:18:45.773 | 2020-07-09T10:17:20.853 | 2020-07-09T10:17:20.853 | 8,422,953 | 155,196 | [
"html",
"css",
"css-float"
]
|
4,977,325 | 1 | 4,977,334 | null | 1 | 1,067 | I'm creating a UserControl which will be used in various scenarios. I need to expose a collection of strings from the UserControl and I'm not sure how to do it.
The two possible uses I see are:
- -
I can get the former to work with a public ObservableCollection<String> property on the UserControl but it won't work for the latter. (I get "Object of type 'System.Windows.Data.Binding' cannot be converted to type 'System.Collections.ObjectModel.ObservableCollection`1[System.String]'.")
Is there a solution that will work for both?
This is my stab at a UML diagram showing what I'm doing:

| How should I expose a collection on a UserControl? | CC BY-SA 2.5 | null | 2011-02-12T09:27:40.720 | 2011-02-12T17:53:50.517 | 2011-02-12T17:53:50.517 | 17,516 | 481,564 | [
"silverlight",
"data-binding",
"silverlight-4.0",
"binding",
"observablecollection"
]
|
4,977,392 | 1 | 4,978,164 | null | 1 | 1,238 | Which set is more "random"?
Math.random() for Java or random for Mathematica? Java is in blue, Mathematica in red.
numbers are from 0 to 50 (51?) 
EDIT:
It's a histogram generated in Mathematica.
Java Source (ugly)
```
public static void main(String[] args) {
// TODO Auto-generated method stub
int i = 0;
int sum = 0;
int counter = 0;
String randomNumberList = " ";
int c = 0;
while (c != 50){
while (i != 7) {
i = (int) (51 * Math.random());
sum += i;
++counter;
randomNumberList += " " + i;
}
i = 0;
System.out.print("\n" + randomNumberList);
++c;
}
}
```
Mathematica source (output.txt is the dump from Java)
```
dataset = ReadList["~/Desktop/output.txt", Number]
dataset2 = RandomReal [{0, 50}, 50000]
Histogram[{dataset, dataset2}]
```
[EDIT]: I was just learning loops when I did the code. Sorry for the confusion. Now I made a cleaner version and they are about equally distributed. I guess that arbitrary loop ending made a big difference.

new code:
```
public class RandomNums {
public static void main(String[] args) {
int count = 0;
for (int i = 0; i <= 50000; i++){
int j = (int) (50 * Math.random());
System.out.print(j + " ");
count++;
if (count == 50){
System.out.println("\n");
count = 0;
}
}
}
}
```
| Random numbers Mathematica vs Java | CC BY-SA 3.0 | null | 2011-02-12T09:45:04.057 | 2011-05-13T04:41:19.533 | 2011-05-13T04:41:19.533 | 548,024 | 548,024 | [
"java",
"random",
"wolfram-mathematica"
]
|
4,977,807 | 1 | 4,977,888 | null | 1 | 8,184 | i have some problems with styling an UL as navigation bar (sorry for this question, but iam a developer, not designer..)
The Problem occours in Safari on Mac (FF is working fine) See first picture (FF)


Css:
```
.multiPoint {
list-style-image:url(../images/punkte.jpg); }
.directionRight{
direction:rtl;
padding-right:3em;
margin-right:0.5em;
}
#navigation {
text-align: left;
}
```
HTML:
```
<div id="navigation" class="span-6 directionRight">
<ul>
<li class="multiPoint">Sie</li>
</ul>
</div>
```
| UL - LI Bullets as Image an right side next to the text | CC BY-SA 2.5 | null | 2011-02-12T11:32:54.210 | 2011-12-28T15:54:37.753 | null | null | 118,027 | [
"html"
]
|
4,977,873 | 1 | 4,978,611 | null | 0 | 2,942 | I have some problems skinning a rounded corner table.
Take a look at the image please:

And here goes the code:
```
<table id="whitePanel" width="190px" cellpadding="0" cellspacing="0" border="0" >
<tr>
<td>
<img src="assets/images/lightRoundedCorners/tl.png" width="8" height="8" border="0" alt="..." />
</td>
<td>
<img src="assets/images/lightRoundedCorners/t.png" alt="..." height="8" width="100%" />
</td>
<td>
<img src="assets/images/lightRoundedCorners/tr.png" width="8" height="8" border="0" alt="..." />
</td>
</tr>
<tr>
<td>
<img src="assets/images/lightRoundedCorners/l.png" width="8" alt="..." height="100%" border="0"/>
</td>
<td align="center" border="0" style="background: url(assets/images/lightRoundedCorners/c.png) repeat">
ACTUAL CONTENT
<p>1. Item 1</p>
<p>1. Item 1</p>
<p>1. Item 1</p>
</td>
<td>
<img src="assets/images/lightRoundedCorners/r.png" width="8" alt="..." height="100%" border="0"/>
</td>
</tr>
<tr>
<td>
<img src="assets/images/lightRoundedCorners/bl.png" width="8" height="8" border="0" alt="..." />
</td>
<td>
<img src="assets/images/lightRoundedCorners/b.png" alt="..." height="8" width="100%" border="0"/>
</td>
<td>
<img src="assets/images/lightRoundedCorners/br.png" width="8" height="8" border="0" alt="..." />
</td>
</tr>
```
Any suggestions?
| Table rounded corner problems | CC BY-SA 3.0 | null | 2011-02-12T11:50:50.470 | 2016-01-27T08:21:23.917 | 2016-01-27T08:21:23.917 | 2,544,762 | 210,631 | [
"html",
"css",
"rounded-corners"
]
|
4,977,968 | 1 | 4,977,984 | null | 0 | 253 | I am making an iPhone app which has its database on the web server. The database is in MySQL. I retrieve the data from server onto the iPhone using JSON parsing.
I have trouble retrieving the TimeStamp datatype that I store in my database. When I try to retrieve the timestamp on iPhone, it shows datetime as shown in the screenshot.

It is basically like this
```
/Date(1297432377000-0700)\\/
```
What could be wrong?
| Failure retrieving date from MySQL on web server onto iPhone | CC BY-SA 3.0 | null | 2011-02-12T12:06:09.873 | 2017-10-17T10:25:15.483 | 2017-10-17T10:25:15.483 | 472,495 | 463,857 | [
"iphone",
"mysql",
"datetime",
"date",
"ios4"
]
|
4,978,090 | 1 | null | null | 3 | 3,266 | 
I would like to create a restaurant style menu card.
I do not want to use tables. I'm trying to accomplish this using DIVs only.
This is what I have:
```
.review-row { // (1)
padding: 0;
}
.review-cat { // (2)
font-size: 25px;
float: left;
}
.review-dots { // (3)
padding-bottom: 5px;
float: left;
}
.review-dots-inner { // (3)
height: 5px;
border-bottom: 3px dotted #E65540;
}
.review-rating { // (4)
float: right;
font-size: 50px;
}
```
In the image think of (3) as being 2 DIVS, the inner div is there to get the dots on the same baseline as the text.
Now this doesn't work. How to proceed?
- -
| 3 divs, middle div needs to be a variable length dotted line | CC BY-SA 2.5 | null | 2011-02-12T12:35:17.497 | 2018-03-05T05:36:43.807 | null | null | 433,384 | [
"css",
"html",
"positioning"
]
|
4,978,106 | 1 | 4,978,124 | null | 0 | 1,509 | I have this code, which uses ob_start php function. Which basically puts the echoed data into an html file. It works before. I do not know what version of php I was using then. But my current version is 5.3.0. I cannot explain why it wouldn't work. Because the script below is working and it just puts the output of that script into the html file:
```
<?php
ob_start();
?>
<h2>Customer Payment Summary</h2>
<a href="pdftransactions.php?acts=customerpay&ofile=<?php echo $customer.' customerpay '.$date; ?>"><img id="tablez" src="../img/system/icons/Oficina-PDF-icon.png"></img></a>
<?php
if($amtopay>=$curcred){
$custchange=$amtopay - $curcred;
$newcred = 0;
echo "Change: ". $custchange."<br/>";
query_database("DELETE FROM sales_transaction WHERE Cust_Name='$customer'", "onstor", $link);
}else{
query_database("UPDATE customer_credit SET CREDIT='$newcred' WHERE Cust_Name='$customer'", "onstor", $link);
echo "Remaining Balance: ". $newcred."<br/>";;
}
echo "Customer: ".$customer."<br/>";
echo "Amount paid: ". $amtopay. "<br/>";
echo "Date: ". $date." ". date('A');
close_connection($link);
?>
<?php
file_put_contents('../tmp/customerpay.html', ob_get_contents());
?>
```
Here's the output of the code above:

But when I checked the html file which I specified in the file_put_contents. It gives me this. And I don't really understand why:

My problem is how to get the correct output from the html file that is being produced.
| Problem with ob_start function in php | CC BY-SA 2.5 | null | 2011-02-12T12:39:20.383 | 2011-02-12T17:28:33.960 | 2011-02-12T17:28:33.960 | 332,019 | 225,269 | [
"php",
"html"
]
|
4,978,133 | 1 | 5,005,916 | null | 13 | 5,774 | I have a question about Paperclip. Many modern cameras and phones add GPS metadata to a photo when taken:

Users of my Rails app can upload photos and manually add the location data to them. However, this sucks as users don't want to enter that: they want it to be there .
Can, and how can I get GPS metadata from a photo (always JPEG) with Paperclip and Ruby on Rails? Can it be done with Paperclip or do I need another gem?
| Getting GPS metadata from a picture with Paperclip | CC BY-SA 2.5 | 0 | 2011-02-12T12:47:12.590 | 2013-11-13T20:07:22.290 | null | null | null | [
"ruby-on-rails",
"metadata",
"paperclip",
"jpeg",
"user-experience"
]
|
4,978,267 | 1 | 5,968,742 | null | 0 | 468 | i had a working application until i changed the package name in the AndroidManifest.xml. I changed it back, but then i found that i had two files in the gen folder.
I usually (as now) have sg like this:

But that time had something else in my gen folder: just "com.bfarago" as far as i remember and another R.java inside that was complaining about the package name. I deleted this package with the R.java and since then i cannot launch the application.
I exited and restarted eclipse and at the launch its stuck at this point:
```
[2011-02-12 14:04:55 - Nevnap] Android Launch!
[2011-02-12 14:04:55 - Nevnap] adb is running normally.
[2011-02-12 14:04:55 - Nevnap] Performing com.bfarago.nevnap.MainActivity activity launch
[2011-02-12 14:04:55 - Nevnap] Automatic Target Mode: launching new emulator with compatible AVD 'my_avd'
[2011-02-12 14:04:55 - Nevnap] Launching a new emulator with Virtual Device 'my_avd'
[2011-02-12 14:04:55 - Emulator] emulator: ERROR: the user data image is used by another emulator. aborting
[2011-02-12 14:04:59 - Nevnap] New emulator found: emulator-5554
[2011-02-12 14:04:59 - Nevnap] Waiting for HOME ('android.process.acore') to be launched...
```
Logcat:
```
02-12 14:06:21.795: WARN/MountService(65): Waiting too long for mReady!
```
Later i will need to recreate the whole app but now i want this to work again.
Please help me..
| Android app is not launching | CC BY-SA 2.5 | 0 | 2011-02-12T13:23:20.363 | 2011-05-11T18:17:58.890 | 2011-02-12T13:31:36.200 | 571,648 | 571,648 | [
"android"
]
|
4,978,689 | 1 | 4,978,841 | null | 3 | 2,135 | What custom button should I use which could be slided right and left such as on turn on/off location button on android's twitter app as the picture below:


and also any link or guide to create such button ?
Thanks
| How can I create a toggle button similar to the Twitter apps location toggle button? | CC BY-SA 2.5 | 0 | 2011-02-12T14:54:11.620 | 2011-02-12T15:27:59.557 | 2020-06-20T09:12:55.060 | -1 | 436,498 | [
"android",
"togglebutton"
]
|
4,978,723 | 1 | null | null | 5 | 78,792 | I need to create a grid. It should be editable
And i should set row and column count.
for example
```
mygrid.RowCount = 3;
mygrid.ColumnCount = 3;
```
Here is how it should look like:

How to BIND 2D array to DataGrid?
| Grid Table in WPF | CC BY-SA 2.5 | 0 | 2011-02-12T14:59:39.440 | 2011-02-12T19:14:05.077 | 2011-02-12T19:14:05.077 | 595,290 | 595,290 | [
"c#",
".net",
"wpf",
"wpf-controls"
]
|
4,978,796 | 1 | 4,978,827 | null | 0 | 2,530 | How can I delete this header from my phpbb3.

Thanks
| remove header from phpbb3 | CC BY-SA 2.5 | 0 | 2011-02-12T15:16:53.537 | 2012-05-05T21:26:09.803 | 2012-05-05T21:26:09.803 | 1,351,522 | 580,350 | [
"php",
"header",
"phpbb",
"phpbb3"
]
|
4,978,958 | 1 | 4,979,025 | null | 1 | 4,329 | 
I am trying to make this image using css with 2 masks, but i am getting absolutely nowhere.
Ive tried to use the code example from this page:
[http://www.ajaxandicons.com/2010/04/image-masking-with-css/](http://www.ajaxandicons.com/2010/04/image-masking-with-css/)
My two images are:

and

I cant get it to work for the life of me. Can someone jsfiddle or put a working result here showing me how to properly mask the image?
| Masking an Image | CC BY-SA 2.5 | 0 | 2011-02-12T15:52:42.697 | 2011-02-12T16:12:32.677 | null | null | 544,140 | [
"css",
"masking"
]
|
4,979,195 | 1 | 5,009,643 | null | 3 | 3,181 | How to create page's Init, Load, PreRender etc. event handlers in VS 2008? When we double click on the page, it will create Page_Load event. How to create othere events of page? I am using c# in ASP.NET application. There is no Event tab in image.
| How to subscribe to Page Events in Visual Studio 2008 IDE | CC BY-SA 2.5 | 0 | 2011-02-12T16:40:22.117 | 2011-12-21T07:18:18.243 | 2011-02-15T17:34:58.830 | 606,537 | 606,537 | [
"c#",
".net",
"asp.net",
"visual-studio-2008",
"page-lifecycle"
]
|
4,979,315 | 1 | null | null | 12 | 9,038 | Hi I have problem with setting properties for window installer such as Author, Description...
Project for which I want create installer package is WPF app. I set assembly properties in WPF project.

I create new project Visual Studio Project -> Setup project and add WPF assembly.
Build this project and try run app. As destionation folder I see:
C:\Program Files\Default Company Name\Spirit\
I suppose that Company name will be comapny name of assembly for which I created installation package.
I try find how set this projeties in setup project but I can’t find way how can I set this properties on setup project.
If I try set properties of setup project I see this:

I use Visual Studio 2010.
| Setting properties for window installer such as Author, Description | CC BY-SA 2.5 | 0 | 2011-02-12T17:00:14.717 | 2013-10-18T04:33:08.697 | 2013-10-18T04:33:08.697 | 168,868 | null | [
"windows",
"visual-studio-2010",
"installation"
]
|
4,980,065 | 1 | 4,982,418 | null | 5 | 288 | I am currently implementing a 2D Range Tree. I am having trouble coming up with a plausible model (in Java) for my Node class.
A node in the tree may have any of the following: midrange value, right and left child pointer, subtree, data pointer and/or previous and next pointers.
I have broken down the Node into three separate logical pieces
- - -
I tried applying Composite and Decorator patterns, but to no avail.
I tried making:
1. Node interface with all the possible getters/setters, i.e.: getMidRange, getLeft, getRight, setLeft, setRight, etc...
2. Having two classes implement the interface: Node2D and LinkedNode (leaf node). Node2D did everything except keep the links to next and previous. While LinkedNode only kept links to next and previous.
It works like that, but I was wandering if there is a nicer way of modeling this as a set of classes?
EDIT: (short info): In range trees - all data is stored in the Leaf nodes, and the tree is always balanced. Furthermore all leafs are at the same height. Also, the leaves are sorted, and linked together by a doubly linked list. Last, but not least, each non-leaf node has a subtree - which is also a range tree, but with the leaves sorted on next attribute (say if original tree was sorted on ).

| Modeling a Node in a RangeTree | CC BY-SA 2.5 | 0 | 2011-02-12T19:18:36.453 | 2017-01-19T19:44:47.330 | 2017-01-19T19:44:47.330 | 3,768,871 | 74,865 | [
"java",
"design-patterns",
"modeling",
"range-tree"
]
|
4,980,392 | 1 | 4,982,414 | null | 1 | 5,366 | I've looked at the similar questions regarding TreeView data binding to nested collections, and I've read several "Josh 'n Bea" articles about this topic, but my design differs in that i have "static" `TreeViewItems` that serve as collapsible containers for the nested collection items. It's best to illustrate what I'm looking for.
Given these ViewModel classes:
```
namespace TreeViewSample
{
public class ApplicationViewModel
{
public ApplicationViewModel() { Projects = new List<ProjectViewModel>(); }
public IEnumerable<ProjectViewModel> Projects { get; set; }
}
public class ProjectViewModel
{
public ProjectViewModel() { Maps = new List<MapViewModel>(); }
public string Name { get; set; }
public IEnumerable<MapViewModel> Maps { get; set; }
}
public class MapViewModel
{
public MapViewModel() { Tables = new List<TableViewModel>(); }
public string Name { get; set; }
public IEnumerable<TableViewModel> Tables { get; set; }
}
public class TableViewModel
{
public TableViewModel() { Fields = new List<FieldViewModel>(); }
public string Name { get; set; }
public IEnumerable<FieldViewModel> Fields { get; set; }
}
public class FieldViewModel
{
public string Name { get; set; }
}
}
```
This is the result i want:

Can anyone help me with the XAML for this TreeView? I thought i understood how `HierarchicalDataTemplates` work, but the "static" container nodes ("Tables", "Fields", "Maps") seem to confuse me.
Thank you and have a pleasant day!
| WPF TreeView - Binding to ViewModels with nested collections AND "Static nodes" | CC BY-SA 3.0 | 0 | 2011-02-12T20:20:20.637 | 2013-01-15T12:52:38.490 | 2013-01-15T12:52:38.490 | 1,871,700 | 1,670,022 | [
".net",
"wpf",
"data-binding",
"mvvm",
"treeview"
]
|
4,981,016 | 1 | null | null | 7 | 2,299 |
```
data(Ord a, Show a, Read a) => BST a = Void | Node {
val :: a,
left, right :: BST a
} deriving (Eq, Ord, Read, Show)
fold :: (Read a, Show a, Ord a) => (a -> b -> b -> b) -> b -> BST a -> b
fold _ z Void = z
fold f z (Node x l r) = f x (fold f z l) (fold f z r)
```
The is to check that a node value is greater then all values in left-subtree and smaller than all values in its right-subtree. This must be `True` for all nodes in the tree. A function `bstList` simply output the list of (ordered) values in the BST.
Of course something like this won't work:
```
--isBST :: (Read a, Show a, Ord a) => BST a -> Bool
isBST t = fold (\x l r -> all (<x) (bstList l) && all (>x) (bstList r)) (True) t
```
because, for example, applying the fold function to the node `19` ends up `all (<19) (bstList True) && all (>19) (bstList True)`.

| How can I check if a BST is valid? | CC BY-SA 2.5 | 0 | 2011-02-12T22:22:48.080 | 2012-09-20T20:57:36.540 | 2012-09-20T20:57:36.540 | 1,288 | 220,180 | [
"haskell",
"binary-search-tree",
"fold"
]
|
4,981,228 | 1 | null | null | 8 | 1,677 | I have the following scenario in my database. It is a record of Studies and those studies have other studies as prerequisites. In my DB design, it looks like this:

And my code looks something like this:
```
public class Study
{
public int ID { get; set; }
public string Topic { get; set; }
public byte TypeID { get; set; }
public virtual StudyType Type { get; set; }
public bool Deprecated { get; set; }
public virtual ICollection<Study> Prerequisites { get; set; }
}
public class StudyType
{
public byte ID { get; set; }
public string Name { get; set; }
public virtual ICollection<Study> Studies { get; set; }
}
public class MyContext : DbContext
{
public DbSet<Study> Studies { get; set; }
public DbSet<StudyType> StudyTypes { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Study>()
.HasMany(p=>p.Prerequisites)
.WithMany().Map(ps =>
{
ps.ToTable("Prerequisites");
ps.MapLeftKey(x=>x.ID,"StudyID");
ps.MapRightKey(y=>y.ID,"PrerequisiteID");
});
}
```
I'm not super good at the EF syntax, but from what I've found Googling, that seems like it should work. Instead, I get `Sequence contains more than one matching element`.
I found this, but since the entity is referencing itself, I can't exactly rename the key field in only one of the tables: [http://social.msdn.microsoft.com/Forums/eu/adonetefx/thread/745a2c4f-cb66-41ad-9524-15aa198c40c7](http://social.msdn.microsoft.com/Forums/eu/adonetefx/thread/745a2c4f-cb66-41ad-9524-15aa198c40c7)
Anybody help me through this?
Here is the full stack trace of the exception:
It executes on a line of LINQ: `var x = from s in db.Studies select s;`
```
Server stack trace:
at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
at System.Data.Entity.ModelConfiguration.Configuration.Properties.Navigation.ManyToManyAssociationMappingConfiguration`2.Configure(DbAssociationSetMapping associationSetMapping)
at System.Data.Entity.ModelConfiguration.Configuration.Properties.Navigation.NavigationPropertyConfiguration.Configure(DbDatabaseMapping databaseMapping)
at System.Data.Entity.ModelConfiguration.Utilities.IEnumerableExtensions.Each[T](IEnumerable`1 ts, Action`1 action)
at System.Data.Entity.ModelConfiguration.Configuration.Types.EntityTypeConfiguration.ConfigureAssociationMappings(DbDatabaseMapping databaseMapping)
at System.Data.Entity.ModelConfiguration.Configuration.Types.EntityTypeConfiguration.Configure(DbEntityTypeMapping entityTypeMapping, DbDatabaseMapping databaseMapping, DbProviderManifest providerManifest)
at System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration.Configure(DbDatabaseMapping databaseMapping, DbProviderManifest providerManifest)
at System.Data.Entity.ModelConfiguration.ModelBuilder.Build(DbProviderManifest providerManifest, DbProviderInfo providerInfo, Boolean validateModel)
at System.Data.Entity.ModelConfiguration.ModelBuilder.Build(DbConnection providerConnection)
at System.Data.Entity.Internal.LazyInternalContext.CreateModel()
at System.Lazy`1.CreateValue()
Exception rethrown at [0]:
at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
at System.Data.Entity.ModelConfiguration.Configuration.Properties.Navigation.ManyToManyAssociationMappingConfiguration`2.Configure(DbAssociationSetMapping associationSetMapping)
at System.Data.Entity.ModelConfiguration.Configuration.Properties.Navigation.NavigationPropertyConfiguration.Configure(DbDatabaseMapping databaseMapping)
at System.Data.Entity.ModelConfiguration.Utilities.IEnumerableExtensions.Each[T](IEnumerable`1 ts, Action`1 action)
at System.Data.Entity.ModelConfiguration.Configuration.Types.EntityTypeConfiguration.ConfigureAssociationMappings(DbDatabaseMapping databaseMapping)
at System.Data.Entity.ModelConfiguration.Configuration.Types.EntityTypeConfiguration.Configure(DbEntityTypeMapping entityTypeMapping, DbDatabaseMapping databaseMapping, DbProviderManifest providerManifest)
at System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration.Configure(DbDatabaseMapping databaseMapping, DbProviderManifest providerManifest)
at System.Data.Entity.ModelConfiguration.ModelBuilder.Build(DbProviderManifest providerManifest, DbProviderInfo providerInfo, Boolean validateModel)
at System.Data.Entity.ModelConfiguration.ModelBuilder.Build(DbConnection providerConnection)
at System.Data.Entity.Internal.LazyInternalContext.CreateModel()
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
at System.Data.Entity.Internal.Linq.InternalSet`1.get_Provider()
at System.Linq.Queryable.Select[TSource,TResult](IQueryable`1 source, Expression`1 selector)
at DataAccess.Sql.SqlStudyRepository.GetAll() in C:\Side Work\Rephidim Church\Tuchikos 2011\Program\DataAccess\Sql\SqlStudyRepository.cs:line 22
at API.Controllers.StudiesController.Index() in C:\Side Work\Rephidim Church\Tuchikos 2011\Program\API\Controllers\StudiesController.cs:line 24
at lambda_method(Closure , ControllerBase , Object[] )
at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12()
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
```
| Entity Framework 4 CTP 5 Self Referencing Many-to-Many | CC BY-SA 2.5 | 0 | 2011-02-12T23:11:04.957 | 2011-04-19T21:10:06.800 | 2011-02-16T03:21:25.163 | 331,855 | 331,855 | [
"entity-framework-4",
"many-to-many",
"entity-framework-ctp5",
"self-reference"
]
|
4,981,440 | 1 | 25,516,223 | null | 62 | 56,375 | I'm a bit confused as to how cookies work with Scrapy, and how you manage those cookies.
This is basically a simplified version of what I'm trying to do:

---
## The way the website works:
When you visit the website you get a session cookie.
When you make a search, the website remembers what you searched for, so when you do something like going to the next page of results, it knows the search it is dealing with.
---
## My script:
My spider has a start url of searchpage_url
The searchpage is requested by `parse()` and the search form response gets passed to `search_generator()`
`search_generator()` then `yield`s lots of search requests using `FormRequest` and the search form response.
Each of those FormRequests, and subsequent child requests need to have it's own session, so needs to have it's own individual cookiejar and it's own session cookie.
---
I've seen the section of the docs that talks about a meta option that stops cookies from being merged. What does that actually mean? Does it mean the spider that makes the request will have its own cookiejar for the rest of its life?
If the cookies are then on a per Spider level, then how does it work when multiple spiders are spawned? Is it possible to make only the first request generator spawn new spiders and make sure that from then on only that spider deals with future requests?
I assume I have to disable multiple concurrent requests.. otherwise one spider would be making multiple searches under the same session cookie, and future requests will only relate to the most recent search made?
I'm confused, any clarification would be greatly received!
---
## EDIT:
Another options I've just thought of is managing the session cookie completely manually, and passing it from one request to the other.
I suppose that would mean disabling cookies.. and then grabbing the session cookie from the search response, and passing it along to each subsequent request.
Is this what you should do in this situation?
| Scrapy - how to manage cookies/sessions | CC BY-SA 2.5 | 0 | 2011-02-12T23:51:01.863 | 2022-07-26T12:51:15.407 | 2011-02-13T00:28:25.950 | 311,220 | 311,220 | [
"python",
"session",
"cookies",
"session-cookies",
"scrapy"
]
|
4,981,764 | 1 | 4,982,098 | null | 4 | 1,933 | I have two area plots (call them 'blue' and 'green') where the `green` is mostly under the `blue` plot, but on a very few points, it is higher than the `blue` plot. I want to use transparency say `alpha = 0.2` for both, and also be able to specify the colors for each. My problem now is that since the `green` plot is mostly under the `blue` plot, its area mostly has the color `blue` + `green` = some other color, and in only a few places shows its "true" green color. However the of course shows the `blue` plot mapped to blue and the `green` plot mapped to green. Problem is, when someone looks at the graph, they will be confused since the `green` plot mostly looks non-green (because it's overlapping with blue most of the time).
Here's my code (super simplified version of my real application).
```
df <- data.frame( date = 1:5, blue = 10, green = c(1,5,11,5,1))
df.m <- melt( df, id = 'date', variable_name = 'type' )
df.m$type <- ordered( df.m$type, c('green', 'blue'))
ggplot(df.m, aes(date,value)) +
geom_area( aes(fill = type), position = 'identity', alpha = 0.2) +
scale_fill_manual ( values = c('green', 'blue') )
```

As you can see, the "true green" area of the green plot is very small, so the legend color for `green` doesn't really match the majority of the `green` plot. This is of course the right behavior by design, but I am wondering if there is some way I can get the legend colour for `green`, and the overlapping `blue+green` color to match up. One thing I did try is to transform the `blue` variable to `blue - green`, and then make the area plots (with `position = "stack"`). This almost works but isn't quite satisfactory because the color on the dates where the new `blue` variable is negative looks strange.
Are there other ways to get the legend color for `green` and the color of the "overlapping blue/green" area to match up? Maybe a way to directly specify the legend color? Any help appreciated!
| R/ggplot2: how to match legend and plot colors in overlapping area plots? | CC BY-SA 2.5 | 0 | 2011-02-13T01:02:30.860 | 2011-02-13T02:41:39.467 | null | null | 415,690 | [
"r",
"colors",
"ggplot2"
]
|
4,981,802 | 1 | 4,981,835 | null | 1 | 666 | Is it possible to create an app like Runtastic, RunKeeper or SportsTracker (all of them Android apps) in WP7 using Bing Maps? Or maybe there is an app with that functionality already out?
These apps basically trace the route you run/cycle/jogg/etc in Google maps, displaying your current speed, altitude, cal lost, direction, etc. Then they have an option for storing the tracks and displaying their related information later. They can display charts as well.
Also, what sensors does WP7 devices have?
The image below is runtastic, tracing the path as you go

Thanks
| Is it possible to create an Geotracking app in WP7 using Bing Maps? | CC BY-SA 2.5 | null | 2011-02-13T01:14:20.060 | 2011-02-13T01:48:49.303 | null | null | 485,397 | [
"windows-phone-7",
"bing-maps",
"geotagging"
]
|
4,981,888 | 1 | 4,989,914 | null | 7 | 27,308 | I'm trying to develop a table that can be used to edit database information (for non-database users). Here's what I have (for html):
```
<table id="myTable" cellspacing='0'>
<tr><th>Column 1</th><th>Column 2</th><th>Column 3</th></tr>
<tr id='1'><td>1</td><td>1</td><td>2</td>
<td style=" table-layout:fixed">
<div style="width:0px;overflow:visible;position:relative">
<a style="display:block;position:relative;left:20px">-</a>
</div>
</td>
</tr>
<tr id='2' class='even'><td>3</td><td>5</td><td>8</td></tr>
<tr id='3'><td>13</td><td>21</td><td>34</td></tr>
<tr id='4' class='even'><td>55</td><td>89</td><td>144</td></tr>
<tr id='5'><td>233</td><td>377</td><td>610</td></tr>
</table>
<input class="addRow" type="button" value="+">
</table>
```
Here's the CSS:
```
table {
background: #E0F5F9;
margin-left: 20px;
margin-right: 20px;
margin-top: 20px;
margin-bottom: 0px;
border-style: solid;
border-width: 2px;
border-color: #1C9CBC;
-moz-border-radius:10px;
-webkit-border-radius:10px;
border-radius:10px;
}
table th {
padding:4px 10px;
background: #A8A8A8;
}
table td {
background:#fff;
padding:2px 10px 4px 10px;
}
div.editableTable {
display: inline;
}
input.addRow {
margin-left: 10px;
border: solid 2px #1C9CBC;
-moz-border-radius:10px;
-webkit-border-radius:10px;
border-radius:10px;
padding-left: 5px;
padding-right: 5px;
background: #A8A8A8;
}
table tr.even td {background:#98E6F9}
table tr td {
background: #E0F5F9;
}
table tr.editing td {
background: #FF0000;
}
table tr.selectedEven td {
background: #98E6F9;
border-left-width: 0px;
border-top-width: 1px;
border-bottom-width: 1px;
border-right-width: 0px;
border-style: solid;
border-color: #03C100;
}
table tr.selectedEven td:first-child {
border-left-width: 1px;
border-top-width: 1px;
border-bottom-width: 1px;
border-right-width: 0px;
border-style: solid;
border-color: #03C100;
-moz-border-radius-topleft:10px;
-moz-border-radius-bottomleft:10px;
-webkit-border-bottom-left-radius:10px;
border-bottom-left-radius:10px;
-webkit-border-top-left-radius:10px;
border-top-left-radius:10px;
}
table tr.selectedEven td:last-child {
border-left-width: 1px;
border-top-width: 1px;
border-bottom-width: 1px;
border-right-width: 0px;
border-style: solid;
border-color: #03C100;
-moz-border-radius-topright:10px;
-moz-border-radius-bottomright:10px;
}
table tr.selectedEven td:last-child {
border-left-width: 0px;
border-top-width: 1px;
border-bottom-width: 1px;
border-right-width: 1px;
border-style: solid;
border-color: #03C100;
}
table tr.selected td {
/* background: #E0F5F9; */
border-left-width: 0px;
border-top-width: 1px;
border-bottom-width: 1px;
border-right-width: 0px;
border-style: solid;
border-color: #03C100;
}
table tr.selected td:first-child {
border-left-width: 1px;
border-top-width: 1px;
border-bottom-width: 1px;
border-right-width: 0px;
border-style: solid;
border-color: #03C100;
-moz-border-radius-topleft:10px;
-moz-border-radius-bottomleft:10px;
-webkit-border-bottom-left-radius:10px;
border-bottom-left-radius:10px;
-webkit-border-top-left-radius:10px;
border-top-left-radius:10px;
}
table tr.selected td:last-child {
border-left-width: 1px;
border-top-width: 1px;
border-bottom-width: 1px;
border-right-width: 0px;
border-style: solid;
border-color: #03C100;
-moz-border-radius-topright:10px;
-moz-border-radius-bottomright:10px;
}
table tr.selected td:last-child {
border-left-width: 0px;
border-top-width: 1px;
border-bottom-width: 1px;
border-right-width: 1px;
border-style: solid;
border-color: #03C100;
}
table tr:last-child td:first-child {
-moz-border-radius-bottomleft:10px;
-webkit-border-bottom-left-radius:10px;
border-bottom-left-radius:10px}
table tr:last-child td:last-child {
-moz-border-radius-bottomright:10px;
-webkit-border-bottom-right-radius:10px;
border-bottom-right-radius:10px
}
```
And, here's what it looks like:

This is fine, except that the delete button on the right side is a little off from the row. This means that once we add ~13 or 14 rows, the delete button is way off from the row that it's going to be deleting. Thus, it's unclear to the user exactly which row will be removed when they hit remove.
I'd like to find some method that will allow me to align a button (or, in this case, a few buttons) with the row of the table in question, using CSS. Is this possible? I tried initially (without success) to do this without a second table, but that led me to the current situation, where I have a table for alignment purposes only on the right of the table that actually contains the data.
The big problem I'm faced with is that I can't seem to figure out how to align something with a row in a table. I could probably do it with jQuery, but this seems like taking a hammer to a screw. I'll admit I'm not as experienced at CSS as I am at programming, and so I usually tend to look to the programming answer. Can someone help me figure out how to have these buttons aligned correctly?
Thank you!
| Aligning buttons with a row in a table using css | CC BY-SA 2.5 | 0 | 2011-02-13T01:38:56.560 | 2011-02-14T07:56:35.857 | 2011-02-14T01:44:54.320 | 281,460 | 281,460 | [
"html",
"css"
]
|
4,982,168 | 1 | 4,982,259 | null | 4 | 42 | I've been getting some odd behavior using a foreach today. I have a `dataset` that's pulling in a JSON document. Part of it is an array, which I `pick()` out and send to the foreach. Here's my global block:
```
global {
dataset appserver <- "http://imaj-app.lddi.org:8010/list/popular" cachable for 1 hour;
popular = appserver.pick("$..images")
}
```
There's one rule first that sets up the page. It looks like this:
```
rule setup {
select when web pageview "www\.google\.com"
pre {
imagelist = <<
<div id="462popular" style="margin-left:auto;margin-right:auto;width:450px">
<p>Popular images from the CS 462 <a href="http://imaj-web.lddi.org/">Image Project</a></p>
<span class="image"></span>
</div>
>>;
}
prepend('#footer', imagelist);
}
```
And here's the rule that's not working:
```
rule images {
select when web pageview "www\.google\.com"
foreach popular setting (image)
pre {
thumburl = image.pick("$..thumburl");
viewurl = "http://imaj-web.lddi.org/view?imagekey=" + image.pick("$..imagekey");
html = <<
<span class="image"><a href="#{viewurl}"><img src="#{thumburl}" style="border:none"/></a></span>
>>;
}
after('#462popular .image', html);
}
```
I get something like this (notice how small the scrollbar thumb is):

Any ideas what's going on here?
| Weird KRL foreach behavior | CC BY-SA 2.5 | null | 2011-02-13T02:58:28.377 | 2011-02-13T03:29:12.103 | null | null | 191,521 | [
"krl"
]
|
4,982,247 | 1 | null | null | 0 | 905 | This [post](http://blogs.msdn.com/b/ms_joc/archive/2005/04/08/406608.aspx) has the info about how to run profiler as the following batch file
```
vsperfcmd /start:coverage /output:run.coverage
hello
vsperfcmd /shutdown
```
into C# code
```
// A guid is used to keep track of the run
Guid myrunguid = Guid.NewGuid();
Monitor m = new Monitor();
m.StartRunCoverage(myrunguid, "run.coverage");
// TODO: Launch some tests or something
// that can exercise myassembly.exe
// Complete the run
m.FinishRunCoverage(myrunguid);
```
For the `TODO:` part, I used this code
```
p = new Process();
p.StartInfo.FileName = "hello.exe";
p.Start();
p.WaitForExit();
// Look at return code – 0 for success
if (p.ExitCode != 0) {
Console.Error.WriteLine("Error in profiling");
System.Environment.Exit( -3 );
}
```
The code runs fine, but I can't the profiled result I did with running batch file.
This is the result from running batch file which has all the info.

This is the result from C# code which doesn't have profiled info, but only schema

What might be wrong?
| Getting profiling results with VS2010: C# API vs vsperfcmd | CC BY-SA 2.5 | null | 2011-02-13T03:26:40.727 | 2011-06-03T21:20:32.143 | 2011-02-14T13:23:03.330 | 260,127 | 260,127 | [
"visual-studio-2010",
"profiling",
"code-coverage",
"profiler"
]
|
4,982,274 | 1 | null | null | 2 | 1,274 | I have a layout with graphics drawn in custom Views using the Canvas drawing primitives, plus a TextView and 2 buttons. The emulator is set to the same pixel width as the phone (400 pixels) and the 2D graphics are specified in pixel dimensions.
 (Emulator on the left, phone on the right.)
Note the the graphics match. (the actual content of the graphics are different because the data is different ) Here's the XML -
```
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:background="#303080"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView android:id="@+id/eventSummary"
android:layout_width="250dp"
android:background="#202090"
android:layout_height="fill_parent"
android:minLines="4"
android:singleLine="false"
android:text="text" />
<Button android:id="@+id/PrevButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="prevButtonHandler"
android:text="<"
/>
<Button android:id="@+id/NextButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="nextButtonHandler"
android:text=">"
/>
</LinearLayout>
```
... I've tried specifying the TextView width using SP's and DP's. Why is there such a big difference and how can I get the Emulator and phone to match? (FWIW the phone is an HTC Droid Incredible).
Thanks in advance!
| Android Emulator doesn't match phone | CC BY-SA 2.5 | null | 2011-02-13T03:34:12.617 | 2011-07-25T15:45:31.203 | null | null | 424,690 | [
"android"
]
|
4,982,476 | 1 | 4,983,518 | null | 1 | 3,189 | I'm using Facebook connect to let users import some photos.
The only permission I've requested is `user_photos` but facebook adds the default one `Access my basic information` at the top which says they are also giving me access to their name, list of friends, and "any other information I've shared with everyone".
I really only want access to the photos, and I think the "basic information" box will scare off some users who don't want to give access to this. Is there any way to get rid of that part?

| Any way to eliminate "Access my basic information" from Facebook Connect? | CC BY-SA 2.5 | null | 2011-02-13T04:48:33.360 | 2015-05-06T02:53:39.137 | null | null | 76,486 | [
"facebook",
"facebook-graph-api"
]
|
4,982,485 | 1 | 4,991,131 | null | 4 | 1,832 | I'm using Ivy on my project, with the Ivy Eclipse plugin.
It appears that certain jars which are downloaded and added to my project are the javadoc jars, not the jars with the actual code. Note - this doesn't happen with all jars.
For example, adding this to my ivy.xml file:
```
<dependency org="junit" name="junit" rev="4.8.2"/>
```
caused the javadocs for junit to be downloaded and added to my classpath:

This breaks compilation for my project, as none of the unit tests are working.
This was working fine until I added a reference to Spring, and everything broke. I've tried removing the reference, and deleting junit from my local cache to force ivy to fetch it again, but the problem persists.
Here's my total dependency block (with spring removed):
```
<dependencies>
<dependency org="org.hamcrest" name="hamcrest-library" rev="1.3.RC2"/>
<dependency org="junit" name="junit" rev="4.8.2"/>
<dependency org="org.mockito" name="mockito-core" rev="1.8.5"/>
<dependency org="javax.persistence" name="persistence-api" rev="1.0"/>
</dependencies>
```
Here's my `ivysettings.xml` for the project:
```
<ivysettings>
<caches artifactPattern="[organisation]/[module]/[revision]/[artifact].[ext]" />
<settings defaultResolver="local.ibiblio.jboss.java-net.springsource" checkUpToDate="true" />
<resolvers>
<chain name="local.ibiblio.jboss.java-net.springsource">
<filesystem name="libraries">
<artifact pattern="${basedir}/ivy-repo/[artifact]-[revision].[type]" />
</filesystem>
<ibiblio name="ibiblio" m2compatible="true" />
<ibiblio name="jboss" m2compatible="true"
root="https://repository.jboss.org/nexus/content/groups/public-jboss" />
<ibiblio name="java.net" m2compatible="true"
root="https://repository.jboss.org/nexus/content/repositories/java.net-m2/" />
<ibiblio name="java.net" m2compatible="true"
root="http://repository.codehaus.org/" />
<url name="com.springsource.repository.libraries.release">
<ivy pattern="http://repository.springsource.com/ivy/libraries/release/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
<artifact pattern="http://repository.springsource.com/ivy/libraries/release/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
</url>
<url name="com.springsource.repository.libraries.external">
<ivy pattern="http://repository.springsource.com/ivy/libraries/external/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
<artifact pattern="http://repository.springsource.com/ivy/libraries/external/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
</url>
<url name="com.springsource.repository.bundles.release">
<ivy pattern="http://repository.springsource.com/ivy/bundles/release/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
<artifact pattern="http://repository.springsource.com/ivy/bundles/release/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
</url>
<url name="com.springsource.repository.bundles.external">
<ivy pattern="http://repository.springsource.com/ivy/bundles/external/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
<artifact pattern="http://repository.springsource.com/ivy/bundles/external/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
</url>
</chain>
</resolvers>
</ivysettings>
```
| Ivy appears to fetch javadoc jars only | CC BY-SA 2.5 | 0 | 2011-02-13T04:52:30.473 | 2011-02-14T10:36:09.483 | 2011-02-13T04:58:22.793 | 59,015 | 59,015 | [
"java",
"ivy"
]
|
4,982,635 | 1 | 4,983,690 | null | 15 | 31,513 | [In this demo of jqGrid](http://www.trirand.com/blog/jqgrid/jqgrid.html), when you click on the "Edit Selected Row" button:

it brings up an edit form.

Is there any way to double click on a row in the grid to bring up this same edit form?
| In jqGrid, can you double click a row to bring up the edit form? | CC BY-SA 2.5 | 0 | 2011-02-13T05:34:30.980 | 2020-06-10T17:51:39.320 | 2011-02-24T19:42:04.927 | 63,550 | 4,653 | [
"jquery",
"jqgrid"
]
|
4,982,808 | 1 | 4,982,927 | null | 0 | 134 | Can you give me some guide on how to determine whats the problem if the same piece of code works on guest os. And doesn't work on the host os?
I've created the project on Windows 7 but now it seems to be working on XP only.
Here's what I have installed on the host os(Windows 7):

And here's what I got on the guest os:

And here's the screenshot. The guest os and host os side by side:

Other things which are the same:
- - - -
Here's the code of checkout.php:
[http://cu.pastebin.com/YeBR9rTs](http://cu.pastebin.com/YeBR9rTs)
Forgive me if its messy.
| Php code works on guest os but doesn't work on host os | CC BY-SA 2.5 | null | 2011-02-13T06:32:12.967 | 2011-02-13T07:53:44.493 | 2011-02-13T06:48:39.560 | 472,034 | 472,034 | [
"php",
"virtual-machine"
]
|
4,982,955 | 1 | 4,982,965 | null | 5 | 16,202 | How can we do like the bottom, the simple way ?
 ?
it updates when we change the input.
| jquery text change when input change | CC BY-SA 2.5 | 0 | 2011-02-13T07:12:47.097 | 2011-11-02T23:14:17.243 | 2011-11-02T23:14:17.243 | 220,819 | 320,486 | [
"javascript",
"jquery",
"ajax"
]
|
4,982,976 | 1 | 4,983,082 | null | 1 | 1,148 | I have a transparent `.png` image that lays over an `NSView` and it should look like this:

However, sometimes, with no rhyme or reason or indication that it is going to do this, the `NSImageView` falls behind the `NSView`:

I am not sure how to keep the `NSImageView` above the `NSView`, or why it even falls behind the `NSView`.
Here is what it looks like in Interface Builder:

## Update:
I have tried the following with same results:
```
[header removeFromSuperview];
[mainView addSubview:header positioned:NSWindowAbove relativeTo:nil];
```
| Transparent NSImageView falls behind NSView | CC BY-SA 2.5 | 0 | 2011-02-13T07:18:01.557 | 2011-02-13T20:00:28.260 | 2011-02-13T18:50:36.077 | 171,206 | 171,206 | [
"macos",
"interface-builder",
"nsview",
"nsimageview"
]
|
4,983,349 | 1 | null | null | 1 | 1,054 | when i execute vs2005 project on vs2010 so the break point appear and the message appear
on that line
chartPage.Export(@"C:\excel_chart_export.jpg", "JPG", misValue);
give me the solution so i can use without any error in vs2010?
| System.Runtime.InteropServices.COMException error occur in vs2010 c# | CC BY-SA 2.5 | null | 2011-02-13T09:08:32.317 | 2011-02-13T12:50:03.783 | null | null | 575,620 | [
"c#"
]
|
4,983,423 | 1 | null | null | 2 | 2,414 | I have some user control that I am putting in a window control , i dont want to have a fixed size in the user control i want it to catch all the space were i put it . What should i add to my code ?
```
<UserControl x:Class="DBTool.View.SelectDataBase"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
>
<UserControl.Background >
<ImageBrush ImageSource="..\Resources\DBSelection.jpg" ></ImageBrush >
</UserControl.Background >
<Grid>
<ItemsControl FontWeight="Normal" ItemsSource="{Binding Path=AvailableBeanTypes}" >
<ItemsControl.ItemTemplate>
<DataTemplate>
<RadioButton
Content="{Binding Path=DisplayName}"
IsChecked="{Binding Path=IsSelected}"
GroupName="BeanType"
Margin="2,3.5"
/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
</UserControl>
```
My window code
```
<Window x:Class="DBTool.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:View="clr-namespace:DBTool.View"
xmlns:ViewModel="clr-namespace:DBTool.ViewModel"
Title="MainWindow" Height="332" Width="528" >
<Window.Resources>
<!-- These four templates map a ViewModel to a View. -->
<DataTemplate DataType="{x:Type ViewModel:SelectDataBaseViewModel}">
<View:SelectDataBase />
</DataTemplate>
<DataTemplate DataType="{x:Type ViewModel:MySqlPageViewModel}">
<View:MySqlPageView />
</DataTemplate>
</Window.Resources>
<DockPanel LastChildFill="True" >
<ToolBar Height="26" HorizontalAlignment="Stretch" VerticalAlignment="Top" Name="toolBar1" Width="Auto" DockPanel.Dock="Top" />
<Grid VerticalAlignment="Bottom" DockPanel.Dock="Bottom" >
<Grid.RowDefinitions>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Button Grid.Row="0" Grid.Column="4" Background="Azure" Margin="10" Command="{Binding Path=MoveNextCommand}" > Next </Button>
<Button Grid.Row="0" Grid.Column="3" Background="Azure" Margin="10" Command="{Binding Path=MovePreviousCommand}"> Previous </Button>
<TextBox Name="txtInput" Grid.Column="1"/>
<Label Content="{Binding Text, ElementName=txtInput,
UpdateSourceTrigger=PropertyChanged}" Grid.Column="2" />
</Grid>
<!-- <View:SelectDataBase x:Name="DetailView"/>-->
<Border Background="White" Grid.Column="1" Grid.Row="0">
<HeaderedContentControl
Content="{Binding Path=CurrentPage}"
Header="{Binding Path=CurrentPage.DisplayName}"
/>
</Border>
</DockPanel>
</Window>
```

But i want to see the image take the whole white space there .
| make user control stretch to all given space | CC BY-SA 2.5 | null | 2011-02-13T09:27:25.100 | 2011-02-13T11:00:50.263 | 2011-02-13T11:00:50.263 | 140,100 | 140,100 | [
"c#",
"wpf",
"xaml"
]
|
4,983,528 | 1 | 4,983,536 | null | 2 | 3,027 | I am not sure how to call this kind of feature but my question is, is there a way to set the color of the following effect:

Using just `border` doesn't make it.
| How to set <input> border | CC BY-SA 2.5 | 0 | 2011-02-13T09:57:04.443 | 2011-02-13T10:03:51.823 | 2011-02-13T09:59:46.613 | 7,586 | 401,025 | [
"html",
"css"
]
|
4,983,534 | 1 | 4,983,555 | null | 1 | 2,219 | I keep getting the following memory leak using the "Leaks" tool in Xcode. As this is a library, I'm just wondering what would be the best way to fix such a leak. Any help would be greatly appreciated. I am happy to share more code if needed.
UPDATE: I found this article, which doesn't seem promising. Has anyone got any suggestions as to how to fix this?
[http://code.google.com/p/json-framework/issues/detail?id=13](http://code.google.com/p/json-framework/issues/detail?id=13)

This is how I'm using the library.
```
- (void)getFacebookProfileFinished:(ASIHTTPRequest *)request {
NSString *responseString = [request responseString];
NSMutableDictionary *responseJSON = [responseString JSONValue]; //memory leak 100%
NSString *username;
NSString *firstName = [responseJSON objectForKey:@"first_name"];
NSString *lastName = [responseJSON objectForKey:@"last_name"];
NSString *facebookId = [responseJSON objectForKey:@"id"];
if (firstName && lastName) {
username = [NSString stringWithFormat:@"%@ %@", firstName, lastName];
} else {
username = @"";
}
UIAppDelegate.userSessionId = facebookId;
UIAppDelegate.userFullName = username;
if (UIAppDelegate.userSessionId != nil) {
Service1 *service = [[Service1 alloc] init];
[service UserExists:self action:@selector(handlerUserExists:) facebookUserId:UIAppDelegate.userSessionId];
[service release];
} else {
[Utility displayAlertMessage:@"There has been an error. Please try again later." withTitle:@"Error"];
[self logoutCompletely];
}
}
```
| iPhone - Objective-C Memory Leak with SBJsonParser | CC BY-SA 2.5 | 0 | 2011-02-13T09:58:18.130 | 2011-04-11T18:19:15.617 | null | null | 264,802 | [
"iphone",
"objective-c",
"json",
"memory-leaks",
"autorelease"
]
|
4,983,575 | 1 | 4,983,990 | null | 5 | 2,040 | I've been making a program that uses a JFileChooser. I've set the application up with
> UIManager.getSystemLookAndFeelClassName()
Which works just fine for pretty much everything under Ubuntu. The only problem I've run into so far is that the JFileChooser comes out looking pretty awful:

Is there a way to make this look like the default file chooser in Ubuntu? ie.

I've tried using
> UIManager.getCrossPlatformLookAndFeelClassName()
Which makes the JFileChooser dialog look , but still not native looking, and it ruins the rest off the application's feel too.
Thanks.
| Is there a way to improve JFileChooser look and feel under Ubuntu? | CC BY-SA 2.5 | 0 | 2011-02-13T10:10:01.303 | 2013-04-27T20:36:01.157 | 2011-02-13T10:13:11.737 | 21,234 | 324,817 | [
"java",
"user-interface",
"swing",
"look-and-feel",
"jfilechooser"
]
|
4,983,665 | 1 | 4,983,676 | null | 0 | 1,214 | I am getting the following memory leak when using `NSURL`. I use this method in quite a few different places and receive memory leaks all the time using the Leaks instruments.
Object Management:
```
self.objManager = [[HJObjManager alloc] init];
NSString *cacheDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@"/Library/Caches/App"];
HJMOFileCache *fileCache = [[[HJMOFileCache alloc] initWithRootPath:cacheDirectory] autorelease];
self.objManager.fileCache = fileCache;
fileCache.fileCountLimit = 100;
fileCache.fileAgeLimit = 60*60*24;
[fileCache trimCacheUsingBackgroundThread];
```
Where it's used:
```
HJManagedImageV *mi = [[[HJManagedImageV alloc] initWithFrame:CGRectMake(self.myHeaderView.profilePictureImageView.bounds.origin.x,
self.myHeaderView.profilePictureImageView.bounds.origin.y,
self.myHeaderView.profilePictureImageView.bounds.size.width,
self.myHeaderView.profilePictureImageView.bounds.size.height)] autorelease];
mi.layer.masksToBounds = YES;
mi.layer.cornerRadius = 8.0;
mi.layer.borderColor = [[UIColor blackColor] CGColor];
mi.layer.borderWidth = 1.0;
mi.url = [NSURL URLWithString:profilePictureUrl];
[mi showLoadingWheel];
[self.myHeaderView.profilePictureImageView addSubview:mi];
[self.objManager manage:mi];
```
Dealloc:
```
- (void)viewDidUnload {
self.tv = nil;
self.friends = nil;
self.sortedFriends = nil;
self.detailView = nil;
self.profileView = nil;
self.objManager = nil;
[super viewDidUnload];
}
- (void)dealloc {
[tv release];
[friends release];
[sortedFriends release];
[detailView release];
[profileView release];
[objManager release];
[super dealloc];
}
```

| iPhone - Objective-C NSURL Memory Leaks galore | CC BY-SA 2.5 | null | 2011-02-13T10:33:01.737 | 2011-02-13T11:53:50.260 | 2011-02-13T11:53:50.260 | 264,802 | 264,802 | [
"iphone",
"objective-c",
"memory-leaks",
"nsurlconnection",
"core-foundation"
]
|
4,983,844 | 1 | 4,984,107 | null | 3 | 6,194 | How do I use Queue here?
I can't get the import to work because Queue.class is not in a package.
I have tried everything in this universe, and more.

[http://i.stack.imgur.com/AFrrc.jpg](https://i.stack.imgur.com/AFrrc.jpg)
| Importing classes inside JAR files that are in the default package | CC BY-SA 3.0 | 0 | 2011-02-13T11:25:10.317 | 2015-04-05T16:11:53.910 | 2011-12-12T00:15:47.480 | 234,976 | 614,998 | [
"java",
"eclipse",
"import"
]
|
4,983,858 | 1 | 4,984,158 | null | 2 | 206 | I AM getting an error while opening blogengine.net 2.0 in visual studio 2010 designer view.It is showing the master page error.
But while executing the page it is loading correctly.

| Blog Engine 2.0 Error | CC BY-SA 2.5 | null | 2011-02-13T11:29:06.380 | 2011-02-13T12:40:29.180 | null | null | 579,474 | [
"c#",
".net",
"asp.net",
"c#-4.0",
"blogengine.net"
]
|
4,984,243 | 1 | 4,987,823 | null | 1 | 3,064 | Hello i will like to implement this code in my application but i don't know how to add the image name into database when a file is uploaded
```
sing System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using accomm2.Models;
using System.IO;
using System.Drawing;
using System.Drawing.Drawing2D;
namespace accomm2.Controllers
{
public class AdminController : Controller
{
dataEntities3 _db = new dataEntities3();
//fileupload
public ActionResult UploadImage()
{
ViewBag.Message = "Welcome to GeeksShip.com! Example Upload & Resize Images";
const string folderThumbPath = "/Content/StoredImages/Thumbs/";
var directoryThumbs = new DirectoryInfo(Server.MapPath(folderThumbPath));
var listImages = directoryThumbs.GetFiles().Select(file => file.Name).ToList();
ViewBag.listImages = listImages;
return View("UploadImage");
}
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult UploadImage(string str)
{
if (ModelState.IsValid)
{
if (Request.Files != null)
{
var posted = Request.Files["uploadFile"];
if (posted.FileName != "")
{
const string pathStoredImage = "/Content/StoredImages/Images/";
const string pathStoredThumbs = "/Content/StoredImages/Thumbs/";
var imageName = Path.GetFileName(posted.FileName);
var filePath = pathStoredImage + imageName;
posted.SaveAs(Server.MapPath(filePath));
ResizeImage(filePath, 150);
ViewBag.message = ViewBag.message + "<br >" +
"Đã upload <b>" + posted.FileName + "</b> hình ảnh thành công!";
}
}
}
return RedirectToAction("UploadImage");
}
public void ResizeImage(string filepath, int imageSize)
{
var newImage = new Bitmap(Server.MapPath(filepath));
int thumbnailSize = imageSize;
int newWidth, newHeight;
if (newImage.Width > newImage.Height)
{
newWidth = thumbnailSize;
newHeight = newImage.Height * thumbnailSize / newImage.Width;
}
else
{
newWidth = newImage.Width * thumbnailSize / newImage.Height;
newHeight = thumbnailSize;
}
var thumbnailBitmap = new Bitmap(newWidth, newHeight);
var thumbnailGraph = Graphics.FromImage(thumbnailBitmap);
thumbnailGraph.CompositingQuality = CompositingQuality.HighQuality;
thumbnailGraph.SmoothingMode = SmoothingMode.HighQuality;
thumbnailGraph.InterpolationMode = InterpolationMode.HighQualityBicubic;
var imageRectangle = new Rectangle(0, 0, newWidth, newHeight);
thumbnailGraph.DrawImage(newImage, imageRectangle);
filepath = filepath.Replace("/StoredImages/Images/", "/StoredImages/Thumbs/");
thumbnailBitmap.Save(Server.MapPath(filepath));
thumbnailGraph.Dispose();
thumbnailBitmap.Dispose();
newImage.Dispose();
}
}
}
```
My actual db:

thank you
| MVC image upload with filename stored in db | CC BY-SA 2.5 | null | 2011-02-13T12:55:36.980 | 2011-02-14T00:12:09.053 | null | null | 397,865 | [
"asp.net-mvc",
"file-upload"
]
|
4,984,466 | 1 | null | null | 4 | 2,027 | Following [MXBeans in Java SE 6: Bundling Values Without Special JMX Client Configurations](http://java.sun.com/developer/technicalArticles/J2SE/mxbeans/) I managed to implement a MXBean which exposes a `Map<String, String>` for a list of configuration parameters. It appears in JConsole as expected, but all values are readonly.
In the MXBEans article, this illustration shows an example where it makes sense that the attributes are read-only as they are memory usage values.

Is there a way to make the attributes editable in JConsole?
| Are JMX CompositeDataSupport attributes always read-only in JConsole? | CC BY-SA 2.5 | 0 | 2011-02-13T13:44:50.167 | 2011-07-13T14:35:48.310 | 2011-02-14T05:49:28.037 | 80,901 | 80,901 | [
"java",
"jmx",
"jconsole"
]
|
4,984,516 | 1 | 4,991,519 | null | 19 | 650 | Can anyone think of a way to approach converting the following scheme into a non-table html layout?

A few things worth mentioning, perhaps.
- - - - -
Thanks in advance!
| Tricky HTML layout | CC BY-SA 2.5 | 0 | 2011-02-13T13:57:14.680 | 2011-02-15T12:20:40.893 | 2011-02-14T09:29:49.117 | 313,758 | 1,320,152 | [
"html",
"css"
]
|
4,984,585 | 1 | null | null | 0 | 191 | I would like to list out all the students who have yet to pay off their course fee
i.e. when a student is clicked, list out all pending fees by months.
This is what I have done so far..
These are all the students active courses.

Below are the payments record paid by student to their course.

Now i would like to list out all the pending payment foreach students
e.g. last payment to the course is on 2/11/2011. If the datetime now is May, Then i would like to show the pending amount as
Month Amount
March 100
April 200
May 400
This is what I tried..
```
foreach (var result in activeCourses)
{
//Show all the pending paid coures from dateJoin till datetime.Now
DateTime JoinedDate = Convert.ToDateTime(result.cus.Date);
for (DateTime d = JoinedDate; d.Month <= DateTime.Now.Month; d = d.AddMonths(1))
{
Payment payment = new Payment();
payment.Course.Id = result.c.Id;
payment.Course.Name = result.c.Name;
payment.Course.Fee = result.c.Fee;
payment.CourseByStudent.CourseUserStatus.Date = result.cu.Date;
payment.CourseByTutor.TutorId = result.t.TutorId;
payment.User.Name = result.u.Name;
payment.MonthId = d.Month;
payment.MonthToPay = d.ToString("MMM");
output.Add(payment);
}
}
```
The logic given above does not seem to be efficient in case the student does not pay anything for his courses, then I have to check the pending payment since his first JoinedDate. OtherWise I need to check the pending payment from the DateIssue in the Payment table according to that particular course..please advice thanks
| question on linq select join | CC BY-SA 2.5 | null | 2011-02-13T14:09:18.503 | 2011-02-14T07:58:23.013 | 2011-02-14T07:58:23.013 | 529,196 | 606,543 | [
"linq"
]
|
4,984,805 | 1 | 4,985,369 | null | 0 | 1,170 | I've been working on a lab for school and everything was going swimmingly until I hit a snag. I have to write a program that asks the user for a salesperson's initial (C, D, or M) and the price of the sale they made. I also have to keep a running tally of the commission earned by each salesman until I hit clear, or exit the program.
When I hit the calculate commission, it of course should calculate the commission (which it does), but because the variables are method level (or some lower access level) and I can't seem to return them I can't pass the 2nd method the information it needs from the "...C" variables.

```
namespace SunshineHotTubs
{
public partial class FrmSalesCommission : Form
{
double cliffS = 0;
double dinoS = 0;
double marshaS = 0;
public FrmSalesCommission()
{
InitializeComponent();
}
public void btnCalcCommission_Click(object sender, EventArgs e)
{
string salesperson = txtInitial.Text;
double sale = Convert.ToDouble(txtSaleTotal.Text);
switch(salesperson)
{
case "c":
case "C":
cliffS += sale;
double cliffC = cliffS * .10;
lblCommission.Text = Convert.ToString(cliffC);
break;
case "d":
case "D":
dinoS += sale;
double dinoC = dinoS * .10;
lblCommission.Text = Convert.ToString(dinoC);
break;
case "m":
case "M":
marshaS += sale;
double marshaC = marshaS * .10;
lblCommission.Text = Convert.ToString(marshaC);
break;
}
}
private void btnDisplayCommission_Click(object sender, EventArgs e)
{
MessageBox.Show("Cliff's Commission: " + cliffC + "\n"
+ "Dino's Commission: " , "Total Commissions");
}
}
}
```
What's the simplest way for me the get the information I need to my btnDisplayCommission_Click event?
| How to access a variable from a seperate event handler | CC BY-SA 2.5 | null | 2011-02-13T14:57:03.620 | 2011-02-13T17:17:12.993 | 2011-02-13T17:09:19.360 | 489,556 | 489,556 | [
"c#",
"visual-studio-2010",
"scope"
]
|
4,984,885 | 1 | null | null | 4 | 9,693 | I am building an ohms law app. Please keep in mind that is my first program ever (without tutorials) so please be kind =) Here's how it looks when you run it:

The combo box has options to calculate volts, calculate ohms, etc...
The center panel is set to invisible until you make a choice from the combobox. Here's what it should look like when you make a selection:

The problem I am facing, is that the time I make a selection, only one of the JLabel/JTextArea combos (each pair is on its own panel inside a vertical box) are displayed:

If i click the comboBox and make the same selection again, it displays correctly. I can't figure out why it acts incorrectly on the first click. Perhaps I am taking the wrong approach in building the GUI. Here's the code so far:
```
private JFrame frame;
private String[] choiceList = {"", "Calculate Volts", "Calculate Amps", "Calculate Ohms", "Calculate Watts"};
private JTextField textField_2;
private JPanel centerPanel;
private String volts = "Volts";
private String amps = "Amps";
private String ohms = "Ohms";
private String watts = "Watts";
private JLabel var1Label;
private JLabel var2Label;
private JLabel var3Label;
private JFormattedTextField var1TextField;
private JFormattedTextField var2TextField;
private JFormattedTextField var3TextField;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
GUI window = new GUI();
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the application.
*/
public GUI() {
initialize();
}
/**
* Initialize the contents of the frame.
*/
private void initialize() {
frame = new JFrame();
frame.setTitle("BotsOne ElectriCalc");
frame.setBounds(100, 100, 450, 300);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel northPanel = new JPanel();
northPanel.setIgnoreRepaint(true);
northPanel.setBorder(new LineBorder(Color.GRAY));
frame.getContentPane().add(northPanel, BorderLayout.NORTH);
JLabel choiceLabel = new JLabel("Please make a selection:");
northPanel.add(choiceLabel);
JComboBox choiceCombo = new JComboBox(choiceList);
northPanel.add(choiceCombo);
choiceCombo.addActionListener(new ChoiceComboListener());
JPanel southPanel = new JPanel();
southPanel.setIgnoreRepaint(true);
southPanel.setBorder(new LineBorder(Color.GRAY));
frame.getContentPane().add(southPanel, BorderLayout.SOUTH);
JLabel label = new JLabel("Answer:");
southPanel.add(label);
textField_2 = new JTextField();
textField_2.setColumns(10);
southPanel.add(textField_2);
centerPanel = new JPanel();
centerPanel.setVisible(false);
centerPanel.setBorder(new LineBorder(Color.GRAY));
frame.getContentPane().add(centerPanel, BorderLayout.CENTER);
Box centerPanelVertBox = Box.createVerticalBox();
centerPanelVertBox.setAlignmentX(Component.CENTER_ALIGNMENT);
centerPanel.add(centerPanelVertBox);
centerPanelVertBox.setVisible(true);
centerPanelVertBox.setBorder(null);
JLabel pleaseEnterLabel = new JLabel("Please enter 2 of 3 values:");
pleaseEnterLabel.setBorder(new EmptyBorder(15, 0, 10, 0));
pleaseEnterLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
centerPanelVertBox.add(pleaseEnterLabel);
JPanel var1Panel = new JPanel();
centerPanelVertBox.add(var1Panel);
var1Label = new JLabel("xxx");
var1Label.setAlignmentX(Component.CENTER_ALIGNMENT);
var1Panel.add(var1Label);
var1TextField = new JFormattedTextField(NumberFormat.getInstance());
var1TextField.setColumns(10);
var1Panel.add(var1TextField);
Panel var2Panel = new Panel();
centerPanelVertBox.add(var2Panel);
var2Label = new JLabel("xxx");
var2Label.setAlignmentX(Component.CENTER_ALIGNMENT);
var2Panel.add(var2Label);
var2TextField = new JFormattedTextField(NumberFormat.getInstance());
var2TextField.setColumns(10);
var2Panel.add(var2TextField);
Panel var3Panel = new Panel();
centerPanelVertBox.add(var3Panel);
var3Label = new JLabel("xxx");
var3Label.setAlignmentX(Component.CENTER_ALIGNMENT);
var3Panel.add(var3Label);
var3TextField = new JFormattedTextField(NumberFormat.getInstance());
var3TextField.setColumns(10);
var3Panel.add(var3TextField);
Panel calculatePanel = new Panel();
centerPanelVertBox.add(calculatePanel);
JButton calculateButton = new JButton("Calculate");
calculatePanel.add(calculateButton);
}
public class ChoiceComboListener implements ActionListener { //combobox actionlistener
public void actionPerformed(ActionEvent ev) {
JComboBox cb = (JComboBox)ev.getSource();
String currentComboSelection = (String)cb.getSelectedItem();
if (currentComboSelection.equals(choiceList[1])) { //choice 1 (Calculate Volts)
centerPanel.setVisible(true);
var1Label.setText(amps);
var2Label.setText(ohms);
var3Label.setText(watts);
//centerPanel.repaint();
}
if (currentComboSelection.equals(choiceList[2])) { //choice 2 (Calculate Amps)
centerPanel.setVisible(true);
var1Label.setText(volts);
var2Label.setText(ohms);
var3Label.setText(watts);
centerPanel.repaint();
}
if (currentComboSelection.equals(choiceList[3])) {
centerPanel.setVisible(true);
var1Label.setText(volts);
var2Label.setText(amps);
var3Label.setText(watts);
}
if (currentComboSelection.equals(choiceList[4])) {
centerPanel.setVisible(true);
var1Label.setText(volts);
var2Label.setText(amps);
var3Label.setText(ohms);
}
if (currentComboSelection.equals(choiceList[0])) {
centerPanel.setVisible(false);
//centerPanel.repaint();
}
}
}
```
If you look at the bottom, there is an inner class called ChoiceComboListener, this is the comboBox listener, I have tried playing around with repaint(), and various other things, but I can't come up with anything. Any help, guidance, or criticism is appreciated.
| JPanel set to invisible, combobox choice other than default sets it to visible, but components are missing | CC BY-SA 3.0 | null | 2011-02-13T15:12:04.860 | 2012-11-25T18:45:48.550 | 2012-05-08T17:05:16.373 | 664,054 | 537,155 | [
"java",
"swing",
"jpanel",
"visibility",
"jcombobox"
]
|
4,984,969 | 1 | 4,985,822 | null | 10 | 19,347 | I have a [jqGrid](http://www.trirand.com/jqgridwiki/doku.php?id=start) with a lot of columns, and it shows up like this when the sum of the column widths are bigger than the fixed width container:

Instead of having a horizontal scroll bar if the width of the grid is too big.
How can I get a horizontal scroll bar for jQgrid so there is a fixed max size of the grid and if I add more columns it will simply scroll?
Also, assuming this is possible, can you freeze the first few columns?
| Does jQuery jqGrid support horizontal scroll bar and frozen columns? | CC BY-SA 2.5 | 0 | 2011-02-13T15:26:04.113 | 2013-08-20T12:05:56.063 | 2011-02-25T18:22:21.440 | 63,550 | 4,653 | [
"jquery",
"jqgrid",
"horizontal-scrolling"
]
|
4,985,678 | 1 | 4,985,781 | null | 0 | 1,444 | I'm making a game using ActionScript 3.0 and the 2D game library FlashPunk.
I can't compile my program without getting these errors:
```
1086 Syntax Error: expecting semicolon before name.
1093 Syntax Error
1093 Syntax Error
1093 Syntax Error
```
Here's a screenshot showing them in Flash Builder:

All the files check out OK. None of them have little red X's to imply that's where the error is coming from. I really don't know where these errors are or how to debug them.
Anyone know how to debug this? Thanks in advance.
| Not sure where these syntax errors are coming from | CC BY-SA 3.0 | null | 2011-02-13T17:29:16.730 | 2013-04-18T09:38:04.757 | 2013-04-18T09:38:04.757 | 664,177 | 468,461 | [
"flash",
"actionscript-3",
"flash-builder"
]
|
4,985,814 | 1 | 4,985,996 | null | 1 | 215 | It's kind of tricky question, It's hard for me to expain what I want so please comment this post what should be edited. Thnx.
So there's a situation where there will be tons of dynamic form inputs. What do I mean by word "dynamic" is that - every attribute (form input) will be stored in table not as column but as value and name of form can be easily edited in the feature with out using migrations. Here's a scheme:

I want to have automatic modelform generated from this scheme. Django could just pick all field names/values/types from table1_attr table. And handle them as it's done with one-column-per-field scheme.
I know that it's possible to add any field later into the model, and then to use "south", but I really afraid of data migration with south. Because I had a lot of segfaults and errors before with this tool. Ofcourse this is an option, and if this scheme will fail - then I'll use usual solution. Btw middleware solutions also fine.
| Django: How to use modelform on dynamic attributes..? | CC BY-SA 2.5 | null | 2011-02-13T17:53:22.910 | 2011-02-13T18:27:54.990 | null | null | 310,662 | [
"django",
"django-models"
]
|
4,985,909 | 1 | 4,986,318 | null | 4 | 13,697 | I am helping a friend to finish a final year project in which he has this circuit that we want to switch on and off using a C++ program.

I initially thought it would be easy, but I have failed to implement this program.
The main problem is that
- [some websites](http://www.beyondlogic.org/porttalk/porttalk.htm)- -
- -
| How to set and read pins on the parallel port from C++? | CC BY-SA 3.0 | 0 | 2011-02-13T18:11:31.913 | 2015-04-30T02:12:31.577 | 2012-09-21T09:57:01.700 | 156,771 | 200,399 | [
"c++",
"serial-port",
"device-driver"
]
|
4,986,087 | 1 | 4,988,234 | null | 0 | 586 | Not moved toolstrip in ubuntu.
I create in vs 2010 with Mono.
In Windows Seven all rigth.
because of what this can happen?


| Does not move toolstrip | CC BY-SA 2.5 | null | 2011-02-13T18:44:54.613 | 2011-02-14T02:03:19.910 | 2011-02-13T19:53:15.337 | 450,466 | 450,466 | [
"c#",
"winforms",
"visual-studio-2010",
"mono"
]
|
4,986,229 | 1 | 4,986,306 | null | 1 | 635 | TortoiseSVN and Dropbox both have Windows shell extensions that make file icons within Windows Explorer show a small icon beside the main one, showing the file's status - has it been synced, etc

How can I make my application show icons beside files like that using the Windows API? Or is there some file attribute to do that?
| Windows shell API for status icons beside file icons | CC BY-SA 2.5 | null | 2011-02-13T19:09:57.213 | 2011-02-13T19:22:50.137 | 2011-02-13T19:12:05.230 | 47,550 | 400,727 | [
".net",
"vb.net",
"explorer",
"windows-shell"
]
|
4,986,230 | 1 | 5,060,464 | null | 3 | 791 | I'm having a really weird layout problem... basically the first button in this RadioGroup is losing it's first letter, as per this screenshot (it should say "Booked Off", not "ooked Off"):

The XML fragment is fairly simple (and I've got nothing funny in an external style or anything):
```
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RadioGroup android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<RadioButton android:id="@+shift_edit/bookoff"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Booked Off" />
<RadioButton android:id="@+shift_edit/ado"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ADO" />
<RadioButton android:id="@+shift_edit/working"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Working" />
</RadioGroup>
</LinearLayout>
```
Does anyone recognise the problem here and can offer a solution? I'm using 1.6 if it matters, because the device I'm targetting only has a 1.6 ROM.
| Why is my android RadioButton text being truncated at the beginning? | CC BY-SA 2.5 | 0 | 2011-02-13T19:10:06.993 | 2011-02-20T22:19:33.653 | 2011-02-14T00:39:05.287 | 60,003 | 60,003 | [
"android",
"android-layout"
]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.