Id
int64 1.68k
75.6M
| PostTypeId
int64 1
2
| AcceptedAnswerId
int64 1.7k
75.6M
⌀ | ParentId
int64 1.68k
75.6M
⌀ | Score
int64 -60
3.16k
| ViewCount
int64 8
2.68M
⌀ | Body
stringlengths 1
41.1k
| Title
stringlengths 14
150
⌀ | ContentLicense
stringclasses 3
values | FavoriteCount
int64 0
1
⌀ | CreationDate
stringlengths 23
23
| LastActivityDate
stringlengths 23
23
| LastEditDate
stringlengths 23
23
⌀ | LastEditorUserId
int64 -1
21.3M
⌀ | OwnerUserId
int64 1
21.3M
⌀ | Tags
sequence |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3,946,156 | 1 | 3,949,108 | null | 0 | 247 | We have three anchor tags. When all on one line they display correctly in IE8:

But when you separate the anchor tags onto separate lines for better code readability they do NOT appear correctly (there is a random extra "e" character and the alignment is off):

Any ideas?
| Anchor <a> alignment off in IE8? | CC BY-SA 2.5 | null | 2010-10-15T21:09:38.903 | 2010-10-16T13:40:58.407 | null | null | 47,281 | [
"css",
"internet-explorer-8",
"alignment",
"anchor"
] |
3,946,250 | 1 | 3,946,302 | null | 0 | 55 | I'm using ASP.NET MVC 2 and playing around with iCal Events.
I Generated my own `.ics` file and with Thunderbird I subscribe to that Calendar. Every time I change an Event in Thunderbird, it's fires a `PUT` and a `PROPFIND` methods.
In the `PUT` it sends the calendar file modified.
> can I get that in an Action?

my current action is:
```
[HttpPut]
public void Index(string id)
{
}
```
and it is fired normally, but how do I get the content?
| How to get the content of an html method? | CC BY-SA 2.5 | null | 2010-10-15T21:22:03.330 | 2010-10-15T21:39:14.303 | 2010-10-15T21:39:14.303 | 148,403 | 28,004 | [
"c#",
"stream"
] |
3,946,283 | 1 | 3,946,518 | null | 5 | 7,942 | I'm doing a to allow sync between Calendar instances and runs fantastic on (under VS2010 Web Server)
But now That I hosted on a Windows 2008 R2 (IIS 7.5.7600) :-o
always said

So I rush into and found out the problem

a error

That says PUT is not allowed :(
> Application Pool? WebSite definition? IIS Settings?
| Enabling html PUT method on IIS 7.5 | CC BY-SA 2.5 | 0 | 2010-10-15T21:29:17.307 | 2016-04-28T21:02:50.577 | null | null | 28,004 | [
"asp.net-mvc-2",
"web-applications",
"configuration",
"iis-7.5"
] |
3,946,466 | 1 | 3,947,589 | null | 0 | 460 | I am using AdWhirl for my ads and they aren't showing in my app when I run it in the emulator. I heard it sometimes takes a while, so i left it for 10 minutes but still nothing. I have disabled AdSense just to see if it would work with just AdMob, but it didn't help.
In my DDMS it shows this:

It shows the same when AdSense is enabled except it says "AdSense Failure". Has anyone any ideas as to why they aren't showing?
| Ads aren't showing in android app | CC BY-SA 2.5 | null | 2010-10-15T21:59:40.747 | 2010-10-16T03:47:07.483 | null | null | 348,261 | [
"android",
"adsense",
"admob",
"ads",
"adwhirl"
] |
3,946,574 | 1 | null | null | 1 | 187 | I'm using IIS7 url rewrite module.
Here is my blog link: [http://www.kad1r.com/](http://www.kad1r.com/)
After rewrite here is some images paths.
[http://www.kad1r.com/article/157/ASP.Net/images/comment.gif](http://www.kad1r.com/article/157/ASP.Net/images/comment.gif)
But some images are ok (like google image).

| iis7 urlrewriting (iis module) image problem | CC BY-SA 2.5 | null | 2010-10-15T22:22:01.113 | 2011-05-17T18:49:15.963 | 2020-06-20T09:12:55.060 | -1 | 292,320 | [
"asp.net",
"iis-7",
"url-rewriting"
] |
3,946,602 | 1 | 3,946,903 | null | 4 | 865 | In this image, the content from one panorama item bleeds over onto the previous item:

How can I do this in Expression Blend / with XAML?
Here is my XAML currently:
```
<controls:Panorama Margin="0,0,-1732,8" Grid.Row="1" Title="ODP">
<controls:PanoramaItem Header="new">
<local:StoryList/>
</controls:PanoramaItem>
<controls:PanoramaItem Header="few">
<local:StoryList/>
</controls:PanoramaItem>
<!-- ... -->
```
It works, but the content doesn't overlap so it's harder for the user to know they can scroll over.
| Silverlight Panorama Control: Control overlap? | CC BY-SA 2.5 | 0 | 2010-10-15T22:28:10.817 | 2010-11-14T16:31:54.147 | null | null | 147,601 | [
"silverlight",
"windows-phone-7"
] |
3,946,886 | 1 | 3,946,895 | null | 0 | 1,231 | In my rails app I'm displaying some posts using nested loops. In development mode, after each loop completes the post objects are dumped in plain text in sequence. So it looks like this:
It's unnecessary and kind of obnoxious. What causes this behavior and how do disable it? Edit: here is the loop:
```
= @posts.each do |post|
.post
%p= post.text
.replies
= if post.children != 0
= link_to "#{post.children} replies", '#',:toggled=>'no',:id=>"parent#{post.id}",:class=>"viewreplies",:rel=>post.children
%a.reply{:href => '#',:id => "reply#{post.id}",:rel => "thread#{post.thread}",:toggled=>'no' } Reply
%form{:method=>:post, :action => '/create', :class => 'replyform' }
= token_tag
%div{:id=>"replies#{post.id}"}
```
| unnecessary debug info in rails view | CC BY-SA 2.5 | null | 2010-10-15T23:35:17.473 | 2013-05-17T17:26:33.693 | 2010-10-15T23:54:06.157 | 330,565 | 275,552 | [
"ruby-on-rails",
"haml"
] |
3,946,977 | 1 | 3,947,386 | null | 4 | 538 | I'm mocking up an app in Expression Blend. The app bar looks fine in Blend, but when I launch the emulator the icon doesn't display properly.
The XAML for the app bar:
```
<shell:ApplicationBar x:Name="FavoritesBar" IsVisible="True" IsMenuEnabled="True">
<shell:ApplicationBarIconButton IconUri="/assets/appbar.favs.rest.png" Text="favorites"/>
</shell:ApplicationBar>
```
Below left is the way it is rendered in Expression Blend. Below right is the way it appears in the emulator.

What could I be doing wrong here?
| Windows Phone: AppBar icons appearing differently on the device | CC BY-SA 2.5 | null | 2010-10-16T00:03:49.400 | 2010-10-16T02:15:28.483 | null | null | 147,601 | [
"silverlight",
"xaml",
"windows-phone-7"
] |
3,947,494 | 1 | 3,976,015 | null | 2 | 1,189 | I implemented the following Silverlight app after seeing [this instructions](https://www.silverlight.net/learn/quickstarts/deepzoom/), here's my code:
```
public partial class MainPage : UserControl
{
private Point lastMousePos = new Point();
private double zoom = 1;
private Point lastMouseLogicaPos = new Point();
private Point lastMouseViewPort = new Point();
private bool duringDrag = false;
private bool duringOpen = false;
private List<Dot> dots = new List<Dot>();
private bool addDot = false;
public MainPage()
{
InitializeComponent();
this.MouseMove += delegate(object sender, MouseEventArgs e)
{ this.lastMousePos = e.GetPosition(this.ZoomImage); };
ZoomImage.MouseWheel += new MouseWheelEventHandler(ZoomImage_MouseWheel);
this.ZoomImage.UseSprings = false;
}
private void ZoomImage_MouseWheel(object sender, MouseWheelEventArgs e)
{
double newzoom = zoom;
if (e.Delta > 0)
{ newzoom /= 1.3; }
else
{ newzoom *= 1.3; }
Point logicalPoint = this.ZoomImage.ElementToLogicalPoint(this.lastMousePos);
this.ZoomImage.ZoomAboutLogicalPoint(zoom / newzoom, logicalPoint.X, logicalPoint.Y);
zoom = newzoom;
e.Handled = true;
}
private void ZoomImage_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
lastMouseLogicaPos = e.GetPosition(LayoutRoot);
lastMouseViewPort = this.ZoomImage.ViewportOrigin;
foreach (var dot in this.dots)
{ dot.LastMouseLogicPos = e.GetPosition(LayoutRoot); }
if (!this.addDot)
{ duringDrag = true; }
}
private void ZoomImage_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
if (this.addDot)
{
Dot dot = new Dot(this.lastMouseLogicaPos.X, this.lastMouseLogicaPos.Y)
{ Name = "Dot" + (this.dots.Count + 1).ToString() };
this.dots.Add(dot);
this.DotCanvas.Children.Add(dot);
}
else
{ duringDrag = false; }
}
private void ZoomImage_MouseMove(object sender, System.Windows.Input.MouseEventArgs e)
{
if (duringDrag)
{
double zoomFactor = 1 / this.ZoomImage.ViewportWidth;
Point newPoint = lastMouseViewPort;
Point thisMouseLogicalPos = e.GetPosition(LayoutRoot);
newPoint.X += (lastMouseLogicaPos.X - thisMouseLogicalPos.X) / (this.ZoomImage.ActualWidth * zoomFactor);
newPoint.Y += (lastMouseLogicaPos.Y - thisMouseLogicalPos.Y) / (this.ZoomImage.ActualWidth * zoomFactor);
this.ZoomImage.ViewportOrigin = newPoint;
foreach (var dot in this.dots)
{
Point dotLogicPoint = this.ZoomImage.ElementToLogicalPoint(new Point(dot.X, dot.Y));
thisMouseLogicalPos = e.GetPosition(LayoutRoot);
dotLogicPoint.X -= (dot.LastMouseLogicPos.X - thisMouseLogicalPos.X) / ((1 / 1.8) * this.ZoomImage.ViewportWidth);
dotLogicPoint.Y -= (dot.LastMouseLogicPos.Y - thisMouseLogicalPos.Y) / (this.ZoomImage.ActualWidth * this.ZoomImage.ViewportWidth);
dot.X = (this.ZoomImage.LogicalToElementPoint(locLogicPoint).X);
dot.Y = (this.ZoomImage.LogicalToElementPoint(locLogicPoint).Y);
}
}
}
private void ZoomImage_ImageOpenSucceeded(object sender, System.Windows.RoutedEventArgs e)
{ duringOpen = true; }
private void ZoomImage_MotionFinished(object sender, System.Windows.RoutedEventArgs e)
{
if (duringOpen)
{ duringOpen = false; }
}
private void Button_Click(object sender, System.Windows.RoutedEventArgs e)
{
this.addDot = !this.addDot;
if (this.addDot)
{ this.btnAddDot.Content = "Click on Image"; }
else
{ this.btnAddDot.Content = "Add Dot"; }
}
}
```
With this I can zoom and pan on a MultiScaleImage and add my custom Dot object to the DotCanvas canvas. Here's the XAML:
```
<UserControl x:Class="DeepZoomSample.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400" Width="800" Height="600">
<Grid x:Name="LayoutRoot" Background="Black" Margin="0,0,-98,-86">
<MultiScaleImage x:Name="ZoomImage" Source="GeneratedImages/dzc_output.xml"
Margin="8,8,0,0" MouseLeftButtonDown="ZoomImage_MouseLeftButtonDown"
MouseLeftButtonUp="ZoomImage_MouseLeftButtonUp" MouseMove="ZoomImage_MouseMove" ImageOpenSucceeded="ZoomImage_ImageOpenSucceeded"
MotionFinished="ZoomImage_MotionFinished" Height="584" VerticalAlignment="Top" HorizontalAlignment="Left" Width="784"/>
<Canvas x:Name="DotCanvas" HorizontalAlignment="Left" Height="584" Margin="8" VerticalAlignment="Top" Width="784" MouseLeftButtonUp="LocationCanvas_MouseLeftButtonUp"/>
<Button x:Name="btnAddDot" Content="Add Location" HorizontalAlignment="Right" Height="44" Margin="0,0,24,24" VerticalAlignment="Bottom" Width="112" Click="Button_Click"/>
</Grid>
```
Now, the problem is that, since the Dots are placed in a canvas that's over the MultiScateImage (ZoomImage object) when I pan and zoom the Dots will stay in their respective place over the canvas. This code has some missed tries trying to keep the Dots on place while the image is panning and zooming.
Here's an image of the app, the blue dots around are my custom Dot object:

The main question is, how can I keep the Dots in their relative place over the image while the user zooms and pans.
| Keep relative positions over MultiScaleImage | CC BY-SA 2.5 | 0 | 2010-10-16T03:01:13.307 | 2012-04-24T14:25:03.260 | 2010-10-20T01:33:38.217 | 302,684 | 302,684 | [
"c#",
".net",
"silverlight",
"deepzoom"
] |
3,947,729 | 1 | 3,948,043 | null | 11 | 10,653 | I would like to know whether is it possible to use my HTC wildfire (some links would be nice) for android development instead of the emulator.
I have tried to find the information by Google, but so far no useful results.
If I get more information, I'll update here.

[When I used wildfire with eclipse, I got this.]
Thank you very much.
| Using HTC wildfire for android development | CC BY-SA 2.5 | 0 | 2010-10-16T04:55:29.383 | 2012-01-10T12:01:48.043 | 2010-10-16T06:09:30.430 | 16,163 | 16,163 | [
"android"
] |
3,947,984 | 1 | 3,954,346 | null | 1 | 5,581 |
I discovered that if I change the "Base SDK" to "iOS Simulator 3.2" (iPad ???) it does not give me this error when doing Build & Analyze... But this is supposed to be an iPhone App. I am running XCode 3.2.4... am I missing something when I create the Project? I am choosing iPhone as the target device, not sure what's going on.
I am having problems finding a memory leak in my iPhone App. I tried running "Build & Analyze", but when it gets to the MyApp_Prefix.pch file, it says "Analyzer skipped this file due to parse errors" - then 50% of the files after that say "Skipped this file due to parse errors - /var/folders/ ... /MyApp_Prefix.pch file not found".
The App actually compiles and runs, and the Prefix.pch file does exist.
When I open all the errors that appear under the first error, it starts opening files that are in the frameworks, which I don't know why there would be something wrong in there.

Here is the contents of the .pch file:
```
//
// Prefix header for all source files of the 'Tickets' target in the 'Tickets' project
//
#ifdef __OBJC__
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#endif
```
Here are the files that open when I click the 'expected function body after function declarator', 'expected type', etc...
CGPDFContext.h
UIView.h
UIApplication.h
UITextView.h
UIWebView.h
These are all located in the Frameworks.
I tried creating an entirely new project and importing my existing classes, and it gave me the same errors.
I tried running Build & Analyze on one of my older projects, which use the same Frameworks, and it runs fine.
| Errors Compiling Prefix.pch file, Causing bigger problems | CC BY-SA 2.5 | null | 2010-10-16T06:57:34.473 | 2010-10-20T13:33:10.953 | 2010-10-16T19:59:20.670 | 300,129 | 300,129 | [
"iphone",
"memory-leaks",
"prefix",
"pch"
] |
3,948,007 | 1 | 3,948,013 | null | 0 | 428 | I'm trying to add a label I think thats what they are called...

.. just like I've done several times before to exit a function without processing some code and I'm getting the error 'label at end of compound statement' why ? what do i need to do instead ?
| iPhone, label at end of compound statement | CC BY-SA 2.5 | null | 2010-10-16T07:11:32.713 | 2010-10-16T13:20:31.023 | null | null | 450,456 | [
"iphone",
"xcode"
] |
3,948,061 | 1 | 4,717,260 | null | 3 | 5,454 | i need to use sat solver for checking satisfiability of boolean expressions..
I have complex boolean expression like this

is there any automatic cnf file converter so that i can give it straight to sat solver?
I read the cnf format file.. but how to express this expression in .cnf file? i get confused when there is a conjunction inside the paranthesis and how to express --> and <-> ? please help me
| how to convert boolean expression to cnf file? | CC BY-SA 2.5 | 0 | 2010-10-16T07:39:03.050 | 2013-03-10T23:55:59.233 | 2013-03-10T23:55:59.233 | 1,243,762 | 416,123 | [
"java",
"boolean-expression",
"conjunctive-normal-form",
"sat-solvers"
] |
3,948,120 | 1 | 3,948,129 | null | 0 | 774 | I'm getting these analyzer warnings, are they due to goto statements ?

--- snip ---

| iPhone, Are these analyzer warings due to goto statements? | CC BY-SA 2.5 | null | 2010-10-16T08:06:50.930 | 2010-10-16T08:11:59.893 | null | null | 450,456 | [
"iphone",
"xcode"
] |
3,948,224 | 1 | 3,948,235 | null | 0 | 31 | I've struggled to get a login / startup view to show before my mainWindow nav controllers and its finally working, but I'm now getting these analyzer warnings. If I release the navigation controller, the release in the dismiss button with cause an error.
what should I do here ?

| iPhone, why and how do i correct these anlyzer warnings while retaining a view controller? | CC BY-SA 2.5 | null | 2010-10-16T08:56:58.967 | 2010-10-16T09:01:18.840 | null | null | 450,456 | [
"iphone",
"xcode"
] |
3,948,301 | 1 | null | null | 1 | 70 | I'm currently trying to implement a Swing/GUI that could be regarded as a editor.
For each property , I can add/remove one ore more widgets storing the values (JTextField, JScrollPane+JTextArea, JCombo, etc.... ).

I've been trying to use the to put the Components in place but I can get any good result. Any suggestion about how I should use the GridBagLayout for this design ? Or should I use another LayoutManager ?
Thanks,
Pierre
| Help regarding java swing/GridBagLaytout | CC BY-SA 2.5 | null | 2010-10-16T09:17:46.567 | 2010-10-16T09:50:26.177 | null | null | 58,082 | [
"java",
"swing",
"layout-manager",
"gridbaglayout"
] |
3,948,584 | 1 | null | null | 7 | 3,713 | I'm working on an application that is joining two projects in two different courses in my Software Engineering degree:
SWE 490: Component Based Software Engineering
SWE 344: IP and Client Server programing
Here's what's my application about :
: Main function is to capture the webcam video and stream it to the server.
: Main function is to receive the streamed video from the client and display it on the website in real time.
The users will be able to monitor their Webcams remotely by streaming their webcams output to a remote server that is accessible via the web. The system will also serve as a motion detection system (if activated by the user) to notify the users via email if any motion has been detected on their webcams. In addition the system also allows users to schedule recordings and watch them online through live streaming.
---
I'm preparing a proposal for the project and I've made some initial plans for the system structure that is represented below :


My main issues are with the real time video streaming (sending and receiving components) as this is a new topic for me.
I know I can program a socket and send the captured videos as a stream of bytes to the main server, but .
My situation is similar to [this question](https://stackoverflow.com/questions/3359789/video-capturing-uploading-processing-streaming-back-net-c) except that it's for video streaming and not image streaming.
| Developing an Online Webcam Video Surveillance System in .NET (Real Time Video Streaming Issues) | CC BY-SA 2.5 | 0 | 2010-10-16T10:51:59.587 | 2014-02-28T09:44:08.810 | 2017-05-23T11:48:24.847 | -1 | 385,172 | [
"c#",
".net",
"silverlight",
"sockets",
"video-streaming"
] |
3,948,658 | 1 | 3,948,674 | null | 0 | 85 | // Calculate the quarters of a set of integers
```
#include <iostream>
#include <vector>
#include <algorithm>
#include <conio.h>
using std::cin;
using std::cout;
using std::endl;
using std::vector;
using std::sort;
int main()
{
// Ask for a set of integers
cout << "Please input a set of integers: "
<< endl;
// Read the set of integers
// x is the variable to write
int x;
// int_set is the set of integers to write
vector<int> int_set;
while (cin >> x)
{
int_set.push_back(x);
}
// Check if the integer set is vacant
typedef std::vector<int>::size_type vec_sz;
vec_sz size = int_set.size();
if (size == 0)
cout << "There are no data. "
<< "Please try again. ";
// Sort
sort (int_set.begin(), int_set.end());
// The set of integers multiply 1/4
vector<double> int_set_quarter;
cout << "The quarters of the set of integers are: ";
for (int i = 0; i != size; ++i)
{
int_set_quarter[i] = 1/4 * int_set[i];
cout << int_set_quarter[i];
cout << endl;
}
getch();
return 0;
}
```
If you run, then it will collapse...
| Why my prog can't run correctly? | CC BY-SA 2.5 | null | 2010-10-16T11:15:33.870 | 2010-10-16T11:22:02.963 | null | null | 460,367 | [
"c++"
] |
3,948,852 | 1 | 3,997,450 | null | 0 | 1,194 | I am parsing a huge xml file and encoding of file is to be said
The db encoding is utf8 and I am running this query before anything is saved to db
$sql='SET NAMES "utf8" COLLATE "utf8_swedish_ci"';
What the problem is that sometimes some non standard characters comes in the xml file like
Lycka™ : roman
I know that trademark symbol is from windows-1252 encoding.
Im using php. I have tried utf8_encode.
here is saved in db  and
here is the output in browser 
I want it to converted to utf, that's it
| XMLReader -- Getting problem with utf characters | CC BY-SA 2.5 | null | 2010-10-16T12:18:53.123 | 2010-10-22T13:51:59.417 | 2010-10-16T12:52:03.733 | 369,371 | 369,371 | [
"php",
"xml",
"encoding",
"utf-8",
"windows-1252"
] |
3,949,140 | 1 | 3,949,177 | null | -2 | 11,575 | I want to know how I can align text in Illustrator CS5
I've created a logo and I want the text above the logo to have the same with as the logo, but I don't want the text to become deformed.
So what I want is::
```
T E S T
LOGOLOGOLOGOL
```
How can I accomplish this?

Thanks in advance!
| Text align in Illustrator CS5 | CC BY-SA 2.5 | null | 2010-10-16T13:53:06.947 | 2010-10-16T14:04:36.100 | null | null | 387,556 | [
"text",
"adobe-illustrator"
] |
3,949,360 | 1 | 3,949,361 | null | 14 | 7,270 | I don't know the differences between 3.5 and 3.5 `Client Profile`, same for 4.
So, what's up with that?

| What are the 'Client Profile' versions of .net framework 3.5 and 4 in Visual Studio 2010? | CC BY-SA 2.5 | 0 | 2010-10-16T14:50:03.020 | 2018-11-06T16:48:22.880 | null | null | 23,893 | [
".net",
"visual-studio-2010"
] |
3,949,368 | 1 | 3,950,218 | null | 39 | 44,785 | I'm creating a simple application with xcode and objc and I need to load an NSDictionary from a file, but I can't get the path to the file using NSBundle:
```
NSString *l = [[NSBundle mainBundle] pathForResource:@"LoginStatuses" ofType:@"plist"];
NSLog(@"%@", l);
```
When I run this code I get this:
2010-10-16 10:42:42.42 Sample[5226:a0f] (null)
And I don't know why.
I created a group called Resources and there I added the LogingStatuses.plist:

| NSBundle pathForResource is NULL | CC BY-SA 3.0 | 0 | 2010-10-16T14:52:20.040 | 2022-03-31T16:24:27.480 | 2015-03-10T03:30:07.047 | 93,733 | 169,274 | [
"objective-c",
"xcode",
"nsbundle"
] |
3,950,088 | 1 | 3,950,115 | null | 0 | 776 | I'm learning data structures and found out that for binary search trees, there are two ways to reconnect node when you delete item. Are those two ways (below) correct?

[Link to the image to see it non-resized](https://i.stack.imgur.com/gOOwL.jpg)
| Binary tree, deleting item and reconnecting node | CC BY-SA 2.5 | null | 2010-10-16T17:57:18.550 | 2010-10-16T18:06:11.070 | 2010-10-16T18:06:11.070 | 41,360 | 464,525 | [
"binary-tree",
"pseudocode"
] |
3,950,543 | 1 | 3,950,927 | null | 1 | 1,341 | I have to develop a CRUD application, that will be coded in php.
I have 3 main actors (Users, Administrators and Doctors -- this is for an hypothetical
hospital), each one with different Use Cases already defined.
Although I feel the Use Cases are more than enough to successfuly model the Class Diagram, I am being specifically asked to also include DataFlow Diagrams into the project's documentation.
I've been reading about DataFlow diagrams, and it seems you usually have first of all a Level 0 DataFlow Diagram, to which they call Context Diagram.
Being that this is basically a 3-tier application with 3 different Actors, how should I model the Context Diagram?
Being that a Context Diagram is supposed to just tell us what comes in and what comes out of our System, I can't imagine anything more interesting/descriptive than the following diagram:

Is this supposed to be something like this, or am I totally missing the point? This php page will connect to an Oracle database, but I guess that if the idea is to consider the System as a whole in the Context Diagram, I should "hide" that fact in the above diagram.
Where should I go on from here? I know I should "zoom" the System process to something more detailed. Maybe the next step would be to depict each one of the User Cases in a DataFlow diagram? Do I include repositories of data, already? For example, one for Users, other for Doctors and yet another for Administrators?
Thanks
| Some questions regarding Context and DataFlow Diagrams | CC BY-SA 2.5 | null | 2010-10-16T20:01:25.113 | 2015-11-14T04:38:41.733 | null | null | 130,758 | [
"uml",
"diagram",
"dataflow-diagram"
] |
3,950,633 | 1 | 3,950,774 | null | 7 | 15,201 | I am using custom bullet points on a website.
Now this site will also be available in Arabic.
```
.post ul li{
color: #555555;
background: url(images/ico-bullet_round.gif) no-repeat !important;
background-position: 300px 6px !important;
padding-right: 15px !important;
padding-left:0 !important;
direction:rtl;
}
```
However with I am unable to have all the bullet points on the right side. Some are more indented than others.
[Please see a screenshot showing the problem.](http://h-3.abload.de/img/arabic_bullet_pointsth62.jpg)
Any suggestions on how to simply align all bullet points on the right?
UPDATE: Please see this screenshot with set to 0 6px. It has something to do with but I can't figure it out.

| Bullet Points Positioning with Arabic RTL direction | CC BY-SA 2.5 | 0 | 2010-10-16T20:26:09.267 | 2017-08-19T14:10:14.293 | 2010-10-16T20:41:38.247 | 421,262 | 421,262 | [
"html",
"css",
"internationalization"
] |
3,950,973 | 1 | 3,951,068 | null | 1 | 4,829 | After fumbling with some keys on my keyboard while trying to get a script to run by clicking on Run in python IDLE I must of did something, because now python will not open. It opens from the command prompt fine, but the normal way it will not open whatsoever. I tried repairing and reinstalling. Still no luck. I am on Windows 7 machines 64bit, using the 32bit version of python 2.7. No idea what it could be but I did find something on google that mentioned something about keybindings or something? Please help!

| Python IDLE will not open | CC BY-SA 3.0 | null | 2010-10-16T21:56:19.317 | 2011-12-04T00:43:57.510 | 2011-12-04T00:43:57.510 | 234,976 | 478,190 | [
"python",
"startup",
"python-idle"
] |
3,951,202 | 1 | 3,951,401 | null | 3 | 1,874 |
Well, i was unable to find the ENTIRE answer here but i finally got what i was after. thanks very much for all of your help and patience.
i think i may have been having problems with using the int and Number types, upon closer inspection of my solution, i realised that Number was being used and not int. turns out number contains floating points and int doesn't. my numbers were probably rounding whenever i tried to fix this my self. for all i know, TDI's answer might have been spot on and the use of int for the padding might have accumulated rounded numbers.. Oh well, you learn something every day..
the correct code to constrain movie clips to a container movie clip (or sprite or whatever) in the fashion i was looking for is this:
```
var picContainer:PicContainer = new PicContainer();
picContainer.x = stage.stageWidth / 2 - picContainer.width / 2;
picContainer.y = stage.stageHeight / 2 - picContainer.height / 2;
addChild(picContainer);
var totalPics:int = 17;
var pic:Pic = new Pic(); //make an instance just to get its width
var xRange:Number = picContainer.width - pic.width;
var spacing:Number = xRange / (totalPics - 1);
//A little optimization: only need to calculate this number ONCE:
var yLoc:Number = picContainer.height / 2 - pic.height / 2;
for(var i:int = 0; i < totalPics; i++) {
pic = new Pic();
pic.x = i * spacing;
pic.y = yLoc;
picContainer.addChild(pic);
}
```
the logic is pretty simple, and i don't know why i couldn't get it my self, because i drew diagrams that say exactly this logic. however, i must not have put the numbers in the right places or i wouldn't have had to ask, would i ;P
as an added bonus (if anyone finds this thread looking for answers..)
you could also have the 'pic's fan out from the center point (but they'd still be in order of left to right) by using this code:
```
var picContainer:PicContainer = new PicContainer();
picContainer.x = stage.stageWidth / 2 - picContainer.width / 2;
picContainer.y = stage.stageHeight / 2 - picContainer.height / 2;
addChild(picContainer);
var totalPics:int = 5;
var pic:Pic = new Pic(); //make an instance just to get its width
var padding:Number = (picContainer.width - (pic.width * totalPics)) / (totalPics + 1);
for(var i:int = 0; i < totalPics; i++) {
pic = new Pic();
pic.x = padding + i * (pic.width + padding);
pic.y = picContainer.height / 2 - pic.height / 2;
picContainer.addChild(pic);
}
```
Try it out, these make for great thumbnail dock engines!
Well, there is some progress thanks to TDI but not a complete solution.
you see, the problem remains that the movie clips do not squash completely into the container, the last one or two are left sticking out.
```
example:
```

my revised code looks like this:
```
var newPicContainer:picContainer = new picContainer();
var newPic:pic;
var picwidth:int = 100;
var amountofpics:int = 22;
var i:int;
//add a container
addChild(newPicContainer);
//center our container
newPicContainer.x = (stage.stageWidth/2)- (newPicContainer.width/2);
newPicContainer.y = (stage.stageHeight/2)- (newPicContainer.height/2);
var totalpicwidth:int = picwidth*amountofpics;
var totalpadding:int = newPicContainer.width - totalpicwidth;
var paddingbetween:int = (totalpadding / amountofpics);
for (i = 0; i < amountofpics; ++i)
{
//make a new mc called newPic(and i's value) eg. newPic1
this['newPic' + i] = new pic();
this['newPic' + i].width = picwidth;
//add our pic to the container
newPicContainer.addChild(this['newPic' + i]);
//set the new pics X
if (i != 0)
{
// if i is not 0, set newpic(i)s x to the previous pic plus the previous pics width and add our dynamic padding
this['newPic' + i].x = this['newPic' + (i-1)].x + picwidth + paddingbetween;
}
else
{
this['newPic' + i].x = 0;
}
}
```
thanks again to anyone in advance!
Hello, First time posting here. I hope I'm not getting anything wrong . my problem is as follows:
I've got a pretty basic for loop that creates a 'thumbnail' and puts it next to the previous one (With a little padding) inside a containing movie clip.
```
var newPicContainer:picContainer = new picContainer();
var newPic:pic;
var amount:int = 9;
var i:int;
//Add our container
addChild(newPicContainer);
//center our container
newPicContainer.x = (stage.stageWidth/2)- (newPicContainer.width/2);
newPicContainer.y = (stage.stageHeight/2)- (newPicContainer.height/2);
for (i = 0; i < amount; ++i)
{
newPic = new pic();
newPicContainer.addChild(newPic);
//just so i know it's adding them..
trace(newPic.thisOne);
newPic.thisOne = i;
// set this one to its self (+5 for padding..) Times, the amount already placed.
newPic.x = (newPic.width+5) *i;
}
```
I'm wondering if there is some equation or 'magic math' that I can use to figure out what the length of the container is and have the 'thumbnails' be added relative to that number. basically squashing the thumbnails against each other to make them all fit inside..
something along the lines of:
```
newPic.x = (newPic.width *i) - stuff here to make it know not to go past the containing width;
```
I must admit i'm not too great with math and so this part of coding escapes me..
thanks to any takers in advance..
| Actionscript 3: Dynamically adding movieclips constrained to a container | CC BY-SA 3.0 | null | 2010-10-16T23:06:59.023 | 2016-06-18T21:55:26.393 | 2016-06-18T21:55:26.393 | 1,743,880 | 478,222 | [
"actionscript-3",
"for-loop",
"actionscript",
"image-gallery"
] |
3,951,539 | 1 | null | null | 1 | 2,059 | I need an algorithm to intersect a (potentially non-convex) polygon with a rectangle. The rectangle will be parallel to the xy-plane, but the polygon could be any orientation.
Furthermore, I don't just need a true/false result, but also the exact points where the polygon intersects the rectangle, so that I can draw lines where the polygon overlaps the rectangle. For non-convex polygons, this could result in two or more lines of intersection.
This would be for a section-cut module that can slice a set of polygons and create a 2D "cut" where the shapes intersect the "plane," specified by a z-value.
I'm developing in Java, so if Java3(2)D has any built-in methods to help, that would be ideal.
Any help/pointers in the right direction would be greatly appreciated!
Here's a picture... I want the red line as a result of the intersection:

| Intersect polygon with rectangle and create lines (section cut) | CC BY-SA 2.5 | null | 2010-10-17T01:12:24.730 | 2014-01-12T03:19:50.177 | 2014-01-12T03:19:50.177 | 508,666 | 73,501 | [
"java",
"3d",
"polygon",
"intersect"
] |
3,951,722 | 1 | 3,951,826 | null | 234 | 166,545 | Consider:

Is it true that `unicode=utf16`?
Many are saying Unicode is a standard, not an encoding, but most editors support save as Unicode actually.
| What's the difference between Unicode and UTF-8? | CC BY-SA 3.0 | 0 | 2010-10-17T02:17:02.930 | 2020-12-04T10:59:56.200 | 2017-01-04T18:16:17.943 | 63,550 | 454,770 | [
"unicode",
"utf-8"
] |
3,951,715 | 1 | null | null | 1 | 1,601 | I'm building a document based Mac application. I have two classes myDocument and Person. The difficulty I'm having is when I push the button to add a new Person in the table view and display it it doesn't show in the table view. I've placed log statements inside the delegate methods. Since my log statements are not being displayed in the console I know they are not being called. Here are the implementations of the delegate methods
```
- (int)numberOfRowsInTableView:(NSTableView *)aTableView
{
return [employees count];
}
- (id)tableView:(NSTableView *)aTableView
objectValueForTableColumn:(NSTableColumn *)aTableColumn
row:(int)rowIndex
{
// What is the identifier for the column?
NSString *identifier = [aTableColumn identifier];
NSLog(@"the identifier's name is : %s",identifier);
// What person?
Person *person = [employees objectAtIndex:rowIndex];
// What is the value of the attribute named identifier?
return [person valueForKey:identifier];
}
- (void)tableView:(NSTableView *)aTableView
setObjectValue:(id)anObject
forTableColumn:(NSTableColumn *)aTableColumn
row:(int)rowIndex
{
NSString *identifier = [aTableColumn identifier];
Person *person = [employees objectAtIndex:rowIndex];
NSLog(@"inside the setObjectMethod: %@",person);
// Set the value for the attribute named identifier
[person setValue:anObject forKey:identifier];
[tableView reloadData];
}
```
Here is a pic of my .xib
Here are my actions methods
```
#pragma mark Action Methods
-(IBAction)createEmployee:(id)sender
{
Person *newEmployee = [[Person alloc] init];
[employees addObject:newEmployee];
[newEmployee release];
[tableView reloadData];
NSLog(@"the new employees name is : %@",[newEmployee personName]);
}
-(IBAction)deleteSelectedEmployees:(id)sender
{
NSIndexSet *rows = [tableView selectedRowIndexes];
if([rows count] == 0){
NSBeep();
return;
}
[employees removeObjectAtIndexs:rows];
[tableView reloadData];
```
}
| Why are my table view delegate methods not being called? | CC BY-SA 2.5 | null | 2010-10-17T02:14:34.620 | 2010-10-17T06:44:38.787 | 2010-10-17T03:34:17.167 | 259,912 | 259,912 | [
"cocoa"
] |
3,951,787 | 1 | 3,953,994 | null | 1 | 210 | In Visual Studio 2008, there was the device manager for setting up additional templates and options for the emulator. None of these options are available with Visual Studio 2010 which I understand as the features were removed.
When the Phone Tools are installed, the device target box comes back but there are no options at all.

Basically, I was just wondering where this list gets its options from and if there is any way at all to configure it?
The closest I got to was find the `%LocalAppData%\microsoft\phone tools` folder, but not sure this is correct as it appears to be more related to the emulator itself (e.g. if deleted, it gets recreated when you run.).
([Link to something](http://social.msdn.microsoft.com/Forums/en-US/microsoftdeviceemu/thread/5dda0416-a1ce-45fe-9997-d87691fe9f0d) a post that helped me years ago)
| Visual Studio 2010 with phone tools - Any advanced/configurable settings? | CC BY-SA 2.5 | null | 2010-10-17T02:40:16.420 | 2010-12-02T23:23:43.447 | null | null | 1,205,001 | [
"visual-studio",
"windows-phone-7",
"emulation"
] |
3,951,915 | 1 | null | null | 3 | 1,399 | Even if I set the geometry for the QWebView it occupies the whole left over screen.

Even worse if I maxmize the window, there is a gap between the two widgets

Below is my code I wrote:
```
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from PyQt4.QtWebKit import *
class twsearchbox(QWidget):
def __init__(self):
QWidget.__init__(self)
hbx = QHBoxLayout()
self.setLayout(hbx)
self.resize(1024,800)
self.setWindowTitle('layout test')
tbx = QTextEdit()
tbx.setGeometry(0,0, 300, 550)
tbx.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Expanding)
hbx.addWidget(tbx, 0 , Qt.AlignLeft)
wv = QWebView()
wv.load(QUrl('twsearch_template.html'))
wv.setGeometry(0,0,300,550)
wv.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Expanding)
hbx.addWidget(wv, 0 , Qt.AlignLeft)
```
| QWebView not laying out properly | CC BY-SA 2.5 | null | 2010-10-17T03:37:22.993 | 2011-02-16T08:12:08.457 | null | null | 145,682 | [
"python",
"layout",
"pyqt"
] |
3,952,214 | 1 | 3,952,266 | null | 1 | 86 | How to create a gradient background like this

| how to create a gradient in Firefox and Chrome | CC BY-SA 2.5 | 0 | 2010-10-17T06:05:38.043 | 2010-10-17T06:32:46.910 | null | null | 277,696 | [
"css"
] |
3,952,229 | 1 | 3,952,270 | null | 1 | 191 | Someone help in translating the following text from image, it's Chinese.
[alt text](https://i.stack.imgur.com/ihbuD.jpg)

| Please help in translating this Chinese text | CC BY-SA 3.0 | 0 | 2010-10-17T06:15:08.487 | 2012-10-05T15:01:33.787 | 2012-10-05T15:01:33.787 | 127,880 | 213,637 | [
"cjk"
] |
3,952,358 | 1 | null | null | 0 | 1,967 | I'd like to know if it is possible to achieve this scenario for my web design.
I've got company ITIL diagram that I'd like to make it show the hyperlink to a file download for each respective box (mouse hover / over effect)
should I create a HTML table for this or create image mappings from the VISIO diagram .vsd file ?

So when the user hover above one of the box it should display the hyperlinks to the document in another page then click that URL to go to that particular document.
| Creating hover effect in HTML from Visio diagram or JPEG file | CC BY-SA 4.0 | 0 | 2010-10-17T07:10:29.940 | 2020-03-06T08:50:05.250 | 2020-03-06T08:50:05.250 | 472,495 | 453,544 | [
"html",
"css"
] |
3,952,483 | 1 | 3,952,500 | null | 1 | 3,116 | I'm using addSubView twice in my app and both times it adds the view too high up the view, its off the screen at the top. See below... I have load the views like this as I nothing else works, cause me problems.
I just don't understand why they are showing off the screen?
What do I need to do to fix this ?
```
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[window addSubview:rootController.view];
[window makeKeyAndVisible];
lvc = [[GettingStartedViewController alloc]
initWithNibName:@"GettingStartedView" bundle:nil];
[window addSubview:lvc.view];
return YES;
}
```
And in my GettingStartedView ...
```
- (IBAction) showHelp:(id)inSender {
theController = [[HelpViewController alloc] initWithNibName:@"HelpView"
bundle:nil onPage:HelpPageGettingStarted];
[self.view addSubview:theController.view];
}
```

| iphone, addSubview show view too high up, how do I move to down? | CC BY-SA 2.5 | 0 | 2010-10-17T08:00:20.087 | 2010-10-17T08:06:12.723 | null | null | 450,456 | [
"iphone",
"xcode"
] |
3,952,836 | 1 | 3,952,909 | null | 3 | 602 | How to make this inside shadow effect with CSS?

So far I got this [http://jsfiddle.net/yX26J/](http://jsfiddle.net/yX26J/). How to apply shadow only left and top?
| Inset shadow effect | CC BY-SA 2.5 | 0 | 2010-10-17T10:29:41.537 | 2010-10-17T10:57:43.873 | null | null | 351,564 | [
"css"
] |
3,952,888 | 1 | 3,953,153 | null | 2 | 7,317 | I am trying to customize the delete function in jqGrid.
I have enabled the delete button on the grid
```
$("#myGrid").jqGrid('navGrid', '#pager',
{ add: true, addtitle: 'Add Customer',
edit: true, edittitle: 'Edit Customer',
del: true, deltitle: 'Delete Customer',
refresh: true, refreshtitle: 'Refresh data',
search: true, searchtitle: 'Apply filters',
addfunc: addForo, editfunc: editForo,
cloneToTop: true
},
{}, // default settings for edit
{}, // default settings for add
{}, // default settings for delete
{ closeOnEscape: true, multipleSearch: true, closeAfterSearch: true }, // search options
{} // default settings for view
);
```
then I have added (thanks to this [post](https://stackoverflow.com/questions/2360550/custom-delete-button-in-jqgrid)) the following code
```
$("#bDelete").click(function () {
// Get the currently selected row
toDelete = $("#myGrid").jqGrid('getGridParam', 'selrow');
$("#myGrid").jqGrid(
'delGridRow',
toDelete,
{ url: '/Foro/Delete/' + toDelete, mtype: 'post', reloadAfterSubmit: false }
);
});
```
Now when I click on the delete button a dialog is shown asking for delete confirm. But if I click on the delete button I will get the following error message

Where am I wrong?
| Custom Delete Function in jqGrid | CC BY-SA 2.5 | 0 | 2010-10-17T10:51:25.630 | 2010-10-17T12:14:12.357 | 2017-05-23T10:30:21.840 | -1 | 431,537 | [
"asp.net-mvc",
"asp.net-mvc-2",
"jqgrid"
] |
3,952,925 | 1 | null | null | 15 | 15,692 | You must know WP 3's multi-level menu configuration feature on the dashboard.
I was wondering how WordPress is doing that. Yes, I know they are using jQuery UI. But still, how? Is there any documentation?
Or is there any plugin or anything that shall help me?
Thank you all.

| wordpress-menus like multi-level menus | CC BY-SA 2.5 | 0 | 2010-10-17T11:02:51.883 | 2019-03-13T09:05:15.077 | null | null | 305,357 | [
"jquery",
"wordpress"
] |
3,953,143 | 1 | 4,218,255 | null | 0 | 678 | i have problem with UIACtionSheet and iPad keyboard , when try to show an UIActionSheet with `firstResponder` keyboard my sheet becomes like this :

what is the problem ?
| Problem with UIActionSheet and iPad keyboard | CC BY-SA 2.5 | null | 2010-10-17T12:12:21.830 | 2010-11-19T20:44:45.080 | 2010-11-19T20:44:45.080 | 316,469 | 319,097 | [
"ipad",
"ios"
] |
3,953,256 | 1 | null | null | 2 | 2,398 | I want to display something in an `NSOpenGLView`, but since there is a total of zero bytes of documentation on it, and the sample code is as big and complex as the documentation , I can't get any wise out of it. This is my code so far, and my `ANOpenGLView` is an `NSOpenGLView` in a NIB subclassed as `ANOpenGLView`:
```
@implementation ANOpenGLView
@synthesize animationTimer;
// MEM
- (void)dealloc {
[animationTimer release];
[super dealloc];
}
// INIT
- (id)initWithFrame:(NSRect)frameRect {
if (self = [super initWithFrame:frameRect]) {
NSOpenGLPixelFormatAttribute pixelFormatAttributes[] = {
NSOpenGLPFADoubleBuffer,
NSOpenGLPFADepthSize, 32,
0
};
NSOpenGLPixelFormat *format = [[NSOpenGLPixelFormat alloc] initWithAttributes:pixelFormatAttributes];
[self setOpenGLContext:[[[NSOpenGLContext alloc] initWithFormat:format shareContext:nil] autorelease]];
}
return self;
}
- (void)awakeFromNib {
/* 60 FPS */
animationTimer = [[NSTimer timerWithTimeInterval:(1.0f/60.0f) target:self selector:@selector(redraw:) userInfo:nil repeats:YES] retain];
[[NSRunLoop currentRunLoop] addTimer:animationTimer forMode:NSDefaultRunLoopMode];
}
// DRAW
- (void)redraw:(NSTimer*)theTimer {
[self drawRect:[self bounds]];
}
- (void)drawRect:(NSRect)dirtyRect {
NSLog(@"Redraw");
[[self openGLContext] clearDrawable];
[[self openGLContext] setView:self];
[[self openGLContext] makeCurrentContext];
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glDisable(GL_DEPTH_TEST);
glClear(GL_COLOR_BUFFER_BIT);
glLoadIdentity();
glViewport(0, 0, [self frame].size.width, [self frame].size.height);
glMatrixMode(GL_PROJECTION); glLoadIdentity();
glMatrixMode(GL_MODELVIEW); glLoadIdentity();
glTranslatef(-1.5f, 0.0f, -6.0f);
glBegin( GL_TRIANGLES );
glColor3f(1.0f, 0.0f, 0.0f);
glVertex2f(0.0f, 1.0f);
glColor3f(0.0f, 1.0f, 0.0f);
glVertex2f(-1.0f, -1.0f);
glColor3f(0.0f, 0.0f, 1.0f);
glVertex2f(1.0f, -1.0f);
glEnd();
[[self openGLContext] flushBuffer];
[NSOpenGLContext clearCurrentContext];
}
@end
```
How can I get the triangle to show up? The only thing I get is a blank, white screen.
---
---
I have updated my code, and this is what I have now:

| My NSOpenGLView won't work. I've tried everything | CC BY-SA 3.0 | 0 | 2010-10-17T12:42:00.507 | 2015-08-26T11:32:36.920 | 2015-08-26T11:32:36.920 | 3,173,269 | null | [
"objective-c",
"c",
"cocoa",
"opengl",
"nsopenglview"
] |
3,953,354 | 1 | 3,953,401 | null | 0 | 322 | Hi have some problem with compiling GameKit framework on iPad , when xcode compiles my code , it takes me some error !!! i don't know what is it ?

| GameKit Framework not working on iPad | CC BY-SA 2.5 | null | 2010-10-17T13:18:45.360 | 2010-10-17T14:42:49.723 | null | null | 199,173 | [
"iphone",
"sdk"
] |
3,953,500 | 1 | 3,953,557 | null | 1 | 2,684 | I got a code from a client to fix the bug (code was written by some other programmer), So when I open the xib file it simply hang my computer, i restarted my computer 3 times because of that and finally decided to see what's happening by opening the Activity Monitor and it turn out it is opening something with name "" and its eating all of my computer memory. Below is the screenshot.

But here is the interesting thing, it is not opening "" when open "xib" files from other projects, and i can't say anything about this project because this project has only one "nib" file.
But if kill that process, it open the nib file but an error start firing on me after every 10 sec. Below is the screen shot.

App was written initially for ios 2.0 version and we are trying to move the project to ios 4.0. Is this thing has anything to do with this?
| What is "Interface Builder Cocoa Touch Tool" | CC BY-SA 2.5 | null | 2010-10-17T13:54:54.707 | 2010-10-17T14:06:33.450 | null | null | 146,603 | [
"debugging",
"interface-builder",
"crash",
"ios4"
] |
3,953,504 | 1 | 3,953,508 | null | 0 | 930 | I am learning AJAX and I am trying to recreate this fairly simple example:
[http://www.w3schools.com/php/php_ajax_database.asp](http://www.w3schools.com/php/php_ajax_database.asp)
I created this database:


So now to recreate the example I just basically copied and pasted the code:
index.html
```
<html>
<head>
<script type="text/javascript">
function showUser(str)
{
if (str=="")
{
document.getElementById("txtHint").innerHTML="";
return;
}
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("txtHint").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","getuser.php?q="+str,true);
xmlhttp.send();
}
</script>
</head>
<body>
<form>
<select name="users" onchange="showUser(this.value)">
<option value="">Select a person:</option>
<option value="1">Juan</option>
<option value="2">Manuel</option>
</select>
</form>
<br />
<div id="txtHint"><b>Person info will be listed here.</b></div>
</body>
</html>
```
and getuser.php
```
<?php
$q=$_GET["q"];
$con = mysql_connect('localhost', 'root', 'root');
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("ajax_demo", $con);
$sql="SELECT * FROM user WHERE id = '".$q."'";
$result = mysql_query($sql);
echo "<table border='1'>
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
<th>Hometown</th>
<th>Job</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['FirstName'] . "</td>";
echo "<td>" . $row['LastName'] . "</td>";
echo "<td>" . $row['Age'] . "</td>";
echo "<td>" . $row['Hometown'] . "</td>";
echo "<td>" . $row['Job'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?>
```
Now the strange part is that when I go to index.html I can see the age, hometown and job but not Firstname and Lastname:

I realize this might be a very basic mistake but I cant find a workaround.
I am sorry I had to paste in so much code but I did not see any other way I could explain my problem and you could help me.
Thanks a lot in advance!
| Ajax retrieve data from Mysql - Not working properly | CC BY-SA 2.5 | 0 | 2010-10-17T13:55:26.097 | 2010-10-17T13:56:34.997 | null | null | 463,065 | [
"php",
"mysql",
"database",
"ajax"
] |
3,953,544 | 1 | 3,953,741 | null | 0 | 1,183 | I'm using the following code to back up a SQL Database :
```
void BackupDatabase(string sConnect, string dbName, string backUpPath)
{
using (SqlConnection cnn = new SqlConnection(sConnect))
{
cnn.Open();
dbName = cnn.Database.ToString();
ServerConnection sc = new ServerConnection(cnn);
Server sv = new Server(sc);
// Create backup device item for the backup
BackupDeviceItem bdi = new BackupDeviceItem(backUpPath, DeviceType.File);
// Create the backup informaton
Microsoft.SqlServer.Management.Smo.Backup bk = new Backup();
bk.PercentComplete += new PercentCompleteEventHandler(percentComplete);
bk.Devices.Add(bdi);
bk.Action = BackupActionType.Database;
bk.PercentCompleteNotification = 1;
bk.BackupSetDescription = dbName;
bk.BackupSetName = dbName;
bk.Database = dbName;
//bk.ExpirationDate = DateTime.Now.AddDays(30);
bk.LogTruncation = BackupTruncateLogType.Truncate;
bk.FormatMedia = false;
bk.Initialize = true;
bk.Checksum = true;
bk.ContinueAfterError = true;
bk.Incremental = false;
// Run the backup
bk.SqlBackup(sv);
}
}
```
In my system (Win7 x64) it works fine but in destination system (WinXP SP3 x86) I receive the below error :

How can I fix it ?
Thanks.
| SQL Backing up with SMO & C#? | CC BY-SA 2.5 | null | 2010-10-17T14:02:53.740 | 2019-08-27T12:59:01.123 | 2010-10-17T14:09:06.173 | 191,647 | 191,647 | [
"c#",
".net",
"sql-server",
"backup",
"smo"
] |
3,953,734 | 1 | 3,954,043 | null | 11 | 2,567 | The function is defined as
```
void bucketsort(Array& A){
size_t numBuckets=A.size();
iarray<List> buckets(numBuckets);
//put in buckets
for(size_t i=0;i!=A.size();i++){
buckets[int(numBuckets*A[i])].push_back(A[i]);
}
////get back from buckets
//for(size_t i=0,head=0;i!=numBuckets;i++){
//size_t bucket_size=buckets[i].size();
//for(size_t j=0;j!=bucket_size;j++){
// A[head+j] = buckets[i].front();
// buckets[i].pop_front();
//}
//head += bucket_size;
//}
for(size_t i=0,head=0;i!=numBuckets;i++){
while(!buckets[i].empty()){
A[head] = buckets[i].back();
buckets[i].pop_back();
head++;
}
}
//inseration sort
insertionsort(A);
}
```
where `List` is just `list<double>` in STL.
`[0,1)` Theoretically bucket sort should be faster than quicksort for large size for it's O(n),but it fails as in the following graph.

I use `google-perftools` to profile it on a 10000000 double array. It reports as follow

It seems I should not use STL list,but I wonder why? Which does `std_List_node_base_M_hook` do? Should I write list class myself?
I have tried just leave the codes of putting in buckets and this explained that most time is used on building up buckets.
The following improvement is made:
- Use STL vector as buckets and reserve reasonable space for buckets
- Use two helper array to store the information used in building buckets,thus avoiding the use of linked list,as in following code
```
void bucketsort2(Array& A){
size_t numBuckets = ceil(A.size()/1000);
Array B(A.size());
IndexArray head(numBuckets+1,0),offset(numBuckets,0);//extra end of head is used to avoid checking of i == A.size()-1
for(size_t i=0;i!=A.size();i++){
head[int(numBuckets*A[i])+1]++;//Note the +1
}
for(size_t i=2;i<numBuckets;i++){//head[1] is right already
head[i] += head[i-1];
}
for(size_t i=0;i<A.size();i++){
size_t bucket_num = int(numBuckets*A[i]);
B[head[bucket_num]+offset[bucket_num]] = A[i];
offset[bucket_num]++;
}
A.swap(B);
//insertionsort(A);
for(size_t i=0;i<numBuckets;i++)
quicksort_range(A,head[i],head[i]+offset[i]);
}
```
The result in the following graph

where line start with list using list as buckets,start with vector using vector as buckets,start 2 using helper arrays.By default insertion sort is used at last and some use quick sort as the bucket size is big.
Note "list" and "list,only put in" ,"vector,reserve 8" and "vector,reserve 2" nearly overlap.
I will try small size with enough memory reserved.
| What makes this bucket sort function slow? | CC BY-SA 2.5 | 0 | 2010-10-17T14:57:36.010 | 2011-08-31T22:09:25.350 | 2010-10-18T06:24:33.877 | 477,967 | 477,967 | [
"c++",
"algorithm",
"performance",
"stl"
] |
3,954,238 | 1 | 3,975,910 | null | 10 | 2,259 |
## Background
I've got the following tree of objects:
```
Name Project
Users nil
John nil
Documents nil
Acme Project Acme Project <--- User selects a project
Proposal.doc Acme Project
12:32-12:33 Acme Project
13:11-13:33 Acme Project
...thousands more entries here...
```
- The user can assign a group to a project. All descendants get set to that project.- This locks up the main thread so I'm using NSOperations.- I'm using the Apple approved way of doing this, watching for `NSManagedObjectContextDidSaveNotification` and merging into the main context.
## The Problem
My saves have been failing with the following error:
`Failed to process pending changes before save. The context is still dirty after 100 attempts. Typically this recursive dirtying is caused by a bad validation method, -willSave, or notification handler.`
## What I've Tried
I've stripped all the complexities of my app away, and made the simplest project I could think of. And the error still occurs. I've tried:
- Setting the max number of operations on the queue to 1 or 10.- Calling `refreshObject:mergeChanges:` at several points in the NSOperation subclass.- Setting merge policies on the managed object context.- Build and Analyze. It comes up empty.
## My Question
How do I set relationships in an NSOperation without my app crashing? Surely this can't be a limitation of Core Data? Can it?
## The Code
Download my project: [http://synapticmishap.co.uk/CDMTTest1.zip](http://synapticmishap.co.uk/CDMTTest1.zip)
```
@implementation JGMainController
-(IBAction)startTest:(id)sender {
NSManagedObjectContext *imoc = [[NSApp delegate] managedObjectContext];
JGProject *newProject = [JGProject insertInManagedObjectContext:imoc];
[newProject setProjectName:@"Project"];
[imoc save];
// Make an Operation Queue
NSOperationQueue *queue = [[NSOperationQueue alloc] init];
[queue setMaxConcurrentOperationCount:1]; // Also crashes with a higher number here (unsurprisingly)
NSSet *allTrainingGroupsSet = [imoc fetchAllObjectsForEntityName:@"TrainingGroup"];
for(JGTrainingGroup *thisTrainingGroup in allTrainingGroupsSet) {
JGMakeRelationship *makeRelationshipOperation = [[JGMakeRelationship alloc] trainGroup:[thisTrainingGroup objectID] withProject:[newProject objectID]];
[queue addOperation:makeRelationshipOperation];
makeRelationshipOperation = nil;
}
}
// Called on app launch.
-(void)setupLotsOfTestData {
// Sets up 10000 groups and one project
}
@end
```
```
@implementation JGMakeRelationshipOperation
-(id)trainGroup:(NSManagedObjectID *)groupObjectID_ withProject:(NSManagedObjectID *)projectObjectID_ {
appDelegate = [NSApp delegate];
imoc = [[NSManagedObjectContext alloc] init];
[imoc setPersistentStoreCoordinator:[appDelegate persistentStoreCoordinator]];
[imoc setUndoManager:nil];
[imoc setMergePolicy:NSMergeByPropertyStoreTrumpMergePolicy];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(mergeChanges:)
name:NSManagedObjectContextDidSaveNotification
object:imoc];
groupObjectID = groupObjectID_;
projectObjectID = projectObjectID_;
return self;
}
-(void)main {
JGProject *project = (JGProject *)[imoc objectWithID:projectObjectID];
JGTrainingGroup *trainingGroup = (JGTrainingGroup *)[imoc objectWithID:groupObjectID];
[project addGroupsAssignedObject:trainingGroup];
[imoc save];
trainingGroupObjectIDs = nil;
projectObjectID = nil;
project = nil;
trainingGroup = nil;
}
-(void)mergeChanges:(NSNotification *)notification {
NSManagedObjectContext *mainContext = [appDelegate managedObjectContext];
[mainContext performSelectorOnMainThread:@selector(mergeChangesFromContextDidSaveNotification:)
withObject:notification
waitUntilDone:YES];
}
-(void)finalize {
appDelegate = nil;
[[NSNotificationCenter defaultCenter] removeObserver:self];
imoc = nil;
[super finalize];
}
@end
@implementation NSManagedObjectContext (JGUtilities)
-(BOOL)save {
// If there's an save error, I throw an exception
}
@end
```

I've experimented some more, and even without the merge, the exception is still thrown. Just saving the managed object context in another thread after modifying a relationship is enough.
I have a shared persistent store coordinator with the app delegate. I've tried making a separate NSPersistentStoreCoordinator for the thread with the same URL as my data store, but Core Data complains.
I'd love to suggestions on how I can make a coordinator for the thread. The core data docs allude to there being a way of doing it, but I can't see how.
| Why is my app crashing when I modify a Core Data relationship in an NSOperation subclass? | CC BY-SA 2.5 | 0 | 2010-10-17T16:56:33.747 | 2016-09-14T03:47:48.890 | 2010-10-19T10:57:33.780 | 60,131 | 60,131 | [
"multithreading",
"cocoa",
"core-data",
"nsoperation"
] |
3,954,825 | 1 | 3,955,858 | null | 2 | 1,104 | We're in the process of creating an iPhone game using [cocos2d](http://www.cocos2d-iphone.org/). We're trying to layer several sprites on top of each other and have them cast shadows.
Right now the shadows are rendered as sprites which works fine for the most part. But we only want the shadows to hit the closest layer.
I've made an image that hopefully explains what we're trying to accomplish:

And here's what we have at the moment:

Basically we want the sprite to only render the part of the shadow that is at the same depth as the z-buffer.
We've played around with `glDepthFunc` and `GL_DEPTH_TEST` but nothing seems to work.
Here's how we're rendering the shadow sprite (subclassed CCSprite):
```
- (void)draw {
glDisable( GL_BLEND );
glEnable( GL_DEPTH_TEST );
glDepthFunc( GL_LESS );
glDepthMask( GL_FALSE );
[super draw];
glDepthMask( GL_TRUE );
glDisable( GL_DEPTH_TEST );
glEnable( GL_BLEND );
}
```
The `GL_BLEND` calls are only there so we can see the sprite at all times.
All sprites that aren't shadows use `glDepthMask( GL_TRUE )` and we're clearing the depth buffer on each frame.
Any help would be much appreciated!
| iPhone game 2d shadows | CC BY-SA 2.5 | 0 | 2010-10-17T19:15:48.967 | 2010-10-17T23:58:52.940 | 2017-02-08T14:30:34.733 | -1 | 250,653 | [
"iphone",
"opengl-es",
"cocos2d-iphone",
"shadows"
] |
3,954,881 | 1 | 3,955,049 | null | 4 | 5,956 | I want to tag a release, but I don't see any option for it as below. I am using from eclipse.

| How to tag a project in cvs and eclipse | CC BY-SA 2.5 | 0 | 2010-10-17T19:29:15.887 | 2015-01-09T15:16:48.840 | 2010-10-17T19:58:56.637 | 184,730 | 184,730 | [
"eclipse",
"tags",
"cvs",
"project"
] |
3,954,971 | 1 | 3,956,481 | null | 0 | 734 | Supposedly this is a 10 by 10 square 100 pixels on the x axis from the origin and 100 pixels on the y axis from the origin (origin being the top left corner)
However it quite clearly wrong.

Writing the views frame to NSLog after setting it gives out the same values I put in.
Code:
```
ISScrollDock *bottomSV = [[ISScrollDock alloc] init];
[bottomSV.view setFrame:CGRectMake(100, 100, 10, 10)];
[bottomSV.view setBackgroundColor:[UIColor redColor]];
[self.view addSubview:bottomSV.view];
```
Here is an Xcode project to show my problem: [http://www.qfpost.com/download.do?get=92f03538907e72665ea794d98ff8392b](http://www.qfpost.com/download.do?get=92f03538907e72665ea794d98ff8392b)
| frame size and coordinates off (objective-c, ipad) | CC BY-SA 2.5 | null | 2010-10-17T19:47:42.303 | 2010-10-18T03:42:11.640 | 2020-06-20T09:12:55.060 | -1 | 191,463 | [
"iphone",
"objective-c",
"uiview",
"uiviewcontroller",
"frame"
] |
3,955,012 | 1 | 3,955,056 | null | 4 | 3,532 | I want to tile boxes to look like this picture below,

which all the boxes have the same width and height, accept one of them I need to change its height to 500px for certain occasions. But I cannot make it right!
[http://rokhsanafiaz.co.uk/dump/1.php](http://rokhsanafiaz.co.uk/dump/1.php)
here is my css,
```
* {
margin: 0;
padding: 0;
}
h1,h2,h3,h4,h5,h6,pre,code,address,caption,cite,code,th {
font-size: 1em;
font-weight: normal;
font-style: normal;
}
ul,ol,li {
list-style: none;
margin:0px;
padding:0px;
}
fieldset,img {
border: none;
padding:0px;
margin:0px;
float:left; /** a must so that there is no extra gap at the bottom of each image **/
}
div {
clear:both;
border:1px solid #0066FF;
overflow:hidden;
}
#main {
width:785px;
/**height:837px; a must for IE, to be handled in jquery **/
position:relative !important; /** essential for sticking #company at bottom **/
border:1px solid #000;
}
#main div {
clear:none;
}
.item-global {
width:335px;
height:146px;
background:#ffffff;
padding:15px;
position:relative;
float:left;
margin: 0px 15px 15px 0px;
}
.item-global h3 {
border:0px solid #000;
margin:0px 0px 5px 0px;
}
.item-global h3 a{
font-size:20px;
color:#0099cc;
}
.item-global p{
margin:0px;
padding:0px;
font-size:14px;
line-height:18px;
clear:both;
}
.item-global-current {
height:400px;
}
```
and my markups,
```
<!-- item-global -->
<div class="item-global round-corner">
<h3><a href="#">Topic 1</a></h3>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy Lorem Ipsum has been the industry's standard dummy Lorem Ipsum has been the industry's standard dummy</p>
<a href="#" class="button-plus"><span>more</span></a>
</div>
<!-- item-global -->
<!-- item-global -->
<div class="item-global round-corner item-global-current" style="float:none; clear:none;">
<h3><a href="#">Topic 2</a></h3>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy Lorem Ipsum has been the industry's standard dummy Lorem Ipsum has been the industry's standard dummy</p>
<a href="#" class="button-top-minus"><span>less</span></a>
<a href="#" class="button-bottom-minus"><span>less</span></a>
</div>
<!-- item-global -->
<!-- item-global -->
<div class="item-global round-corner">
<h3><a href="#">Topic 3</a></h3>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy Lorem Ipsum has been the industry's standard dummy Lorem Ipsum has been the industry's standard dummy</p>
<a href="#" class="button-plus"><span>more</span></a>
</div>
<!-- item-global -->
<!-- item-global -->
<div class="item-global round-corner">
<h3><a href="#">Topic 4</a></h3>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy Lorem Ipsum has been the industry's standard dummy Lorem Ipsum has been the industry's standard dummy</p>
<a href="#" class="button-plus"><span>more</span></a>
</div>
<!-- item-global -->
<!-- item-global -->
<div class="item-global round-corner">
<h3><a href="#">Topic 5</a></h3>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy Lorem Ipsum has been the industry's standard dummy Lorem Ipsum has been the industry's standard dummy</p>
<a href="#" class="button-plus"><span>more</span></a>
</div>
<!-- item-global -->
<!-- item-global -->
<div class="item-global round-corner">
<h3><a href="#">Topic 6</a></h3>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy Lorem Ipsum has been the industry's standard dummy Lorem Ipsum has been the industry's standard dummy</p>
<a href="#" class="button-plus"><span>more</span></a>
</div>
<!-- item-global -->
```
it would be fantastic if you know the tricks! thanks!
| CSS: tile boxes which come with irregular heights | CC BY-SA 2.5 | null | 2010-10-17T19:56:15.047 | 2012-06-28T14:07:04.847 | 2012-06-28T14:07:04.847 | 44,390 | 413,225 | [
"css",
"css-float",
"tile"
] |
3,955,095 | 1 | 3,957,042 | null | 6 | 5,257 | I am trying to use R to create a raster image from a matrix of data. However, I am getting some weird artifacts on the edge of my image.
The code I am using is as follows:
```
# From the example for rasterImage(). A 3 pixel by 5 pixel b/w checkerboard.
testImage <- as.raster(0:1, nrow=3, ncol=5)
testImage
[,1] [,2] [,3] [,4] [,5]
[1,] "#000000" "#FFFFFF" "#000000" "#FFFFFF" "#000000"
[2,] "#FFFFFF" "#000000" "#FFFFFF" "#000000" "#FFFFFF"
[3,] "#000000" "#FFFFFF" "#000000" "#FFFFFF" "#000000"
png('test.png', width=5, height=3, units='px')
# Just want the image, no margins, boarders or other fancy stuff.
par(mar = c(0,0,0,0) )
plot.new()
plotArea = par('fig')
rasterImage(testImage, plotArea[1], plotArea[3],
plotArea[2], plotArea[4], interpolate = FALSE )
dev.off()
```
This was executed in R 2.12.0 on OS X but I get the same output from R 2.11.0.
---
The output I am getting is the following (scaled from 5x3 to 150x90)

The pixels in the corners should be black which suggests some form of interpolation is occurring.
---
The output I am expecting to see is:

Any suggestions on why my code fails to faithfully produce a raster image from a matrix?
---
## Intended Use
This is for a package I am working on so I would like to stay within the R base packages if possible so as not to introduce additional dependencies. The package implements a graphics device, so if anyone has a C level solution picks up from the info passed by `GERaster()` in `src/main/engine.c` and creates a PNG using only the R libraries, I would be willing to give that a shot as well.
---
## Solutions for OS X
As pointed out by nico, the errant behavior is the result of antialiasing. The plot behaves as expected if `png()` is told to use an output method for which antialiasing can be disabled, such as Cairo graphics:
```
png('test.png', width=5, height=3, units='px', type='cairo', antialias=NULL)
```
On OS X the default backend for `png()` is Quartz, however `png(..., type='quartz')` currently ignores directives set by `quartz.options()`. Faithful output can be produced natively on OS X if the device is started by calling `quartz()` directly instead of using `png()`:
```
quartz(file='test.png', type='png', width=5, height=3, dpi=1, antialias=FALSE)
```
---
## Windows Thinks Differently
The following output is generated on Windows:

According to [an answer](http://r.789695.n4.nabble.com/Incorrect-positioning-of-raster-images-on-Windows-tp2999649p3001505.html) given by Paul Murrell (the benevolent dictator of R graphics
devices) on the R-help mailing list:
> This is a rounding (truncation) problem. Working on a fix.
This behavior on Windows should not be noticeable unless the raster image contains a very small number of pixels.
| Creating raster images using R | CC BY-SA 2.5 | 0 | 2010-10-17T20:16:09.960 | 2010-10-19T22:27:52.430 | 2010-10-19T22:27:52.430 | 135,870 | 135,870 | [
"r",
"raster-graphics"
] |
3,955,189 | 1 | 4,028,437 | null | 16 | 12,500 | so currently i'm trying to crop and resize a picture to fit it into a specific size without losing the ratio.
a small image to show what i mean:

i played a bit with [vocaro's categories](http://vocaro.com/trevor/blog/2009/10/12/resize-a-uiimage-the-right-way/) but they don't work with png's and have problems with gifs. also the image doesn't get cropped.
does anyone have a suggestion how to do this resizing the best way or probably have a link to an existing library/categorie/whatever?
thanks for all hints!
p.s.: does ios implement a "select a excerpt" so that i have the right ratio and only have to scale it?!
| resize and crop image centered | CC BY-SA 3.0 | 0 | 2010-10-17T20:42:12.267 | 2020-04-09T18:40:31.087 | 2012-06-24T19:01:48.980 | 312,594 | 253,288 | [
"iphone",
"objective-c",
"cocoa-touch",
"ios"
] |
3,955,205 | 1 | 3,955,234 | null | 5 | 26,414 | I have a very simple select drop down. In Chrome, it doesn't drop down. The code itself works fine, and the drop down works in Safari, but for some reason it won't open in Chrome. Here is the HTML:
```
<select name="pellet_credit" class="item_discount">
<option>1</option>
<option>2</option>
<option>3</option>
</select>
```
It should be pretty simple. It's a dropdown... Here's a screenshot of the select, selected, but not open:

--- edit ---
This is a jsfiddle with the full source included. The dropdown works for me in the jsfiddle view, but not on the actual site.
[http://jsfiddle.net/HSYvf/](http://jsfiddle.net/HSYvf/)
--- edit ---
Other drop downs on the page work fine.
| Why won't this select open up? | CC BY-SA 2.5 | null | 2010-10-17T20:46:02.883 | 2020-01-17T15:37:57.277 | 2010-10-17T21:13:35.373 | 190,902 | 190,902 | [
"html",
"select"
] |
3,955,372 | 1 | 3,955,472 | null | 0 | 285 | Hy, my UIToolbar which I added via the InterfaceBuilder gets been cut if i push to the view, but in the subview's I added via the IB a Toolbar on the bottom side but it cut's it still halfway.

Under the icon there is normally a text..
| UIToolbar is cutted on the bottom | CC BY-SA 2.5 | 0 | 2010-10-17T21:25:51.937 | 2010-10-18T17:39:28.403 | null | null | 1,333,276 | [
"iphone",
"sdk",
"uitoolbar"
] |
3,956,005 | 1 | 3,956,087 | null | 2 | 246 | I wish to migrate some data from a single table into these new THREE tables.
Here's my destination schema:

Notice that I need to insert into the first `Location` table .. grab the `SCOPE_IDENTITY()` .. then insert the rows into the `Boundary` and `Country` tables.
The `SCOPE_IDENTITY()` is killing me :( meaning, I can only see a way to do this via `CURSORS`. Is there a better alternative?
### UPDATE
Here's the scripts for the DB Schema....
```
CREATE TABLE [dbo].[Locations](
[LocationId] [int] IDENTITY(1,1) NOT NULL,
[Name] [nvarchar](100) NOT NULL,
[OriginalLocationId] [int] NOT NULL,
CONSTRAINT [PK_Locations] PRIMARY KEY CLUSTERED
(
[LocationId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
)
```
```
CREATE TABLE [dbo].[Locations_Country](
[IsoCode] [nchar](2) NOT NULL,
[LocationId] [int] NOT NULL,
CONSTRAINT [PK_Locations_Country] PRIMARY KEY CLUSTERED
(
[LocationId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Locations_Country] WITH CHECK ADD CONSTRAINT [FK_Country_inherits_Location] FOREIGN KEY([LocationId])
REFERENCES [dbo].[Locations] ([LocationId])
GO
ALTER TABLE [dbo].[Locations_Country] CHECK CONSTRAINT [FK_Country_inherits_Location]
GO
```
```
CREATE TABLE [dbo].[Boundaries](
[LocationId] [int] NOT NULL,
[CentrePoint] [varbinary](max) NOT NULL,
[OriginalBoundary] [varbinary](max) NULL,
[LargeReducedBoundary] [varbinary](max) NULL,
[MediumReducedBoundary] [varbinary](max) NULL,
[SmallReducedBoundary] [varbinary](max) NULL,
CONSTRAINT [PK_Boundaries] PRIMARY KEY CLUSTERED
(
[LocationId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
ALTER TABLE [dbo].[Boundaries] WITH CHECK ADD CONSTRAINT [FK_LocationBoundary] FOREIGN KEY([LocationId])
REFERENCES [dbo].[Locations] ([LocationId])
GO
ALTER TABLE [dbo].[Boundaries] CHECK CONSTRAINT [FK_LocationBoundary]
GO
```
| How should I migrate this data into these Sql Server tables? | CC BY-SA 2.5 | null | 2010-10-18T00:59:35.887 | 2010-10-18T03:42:11.867 | 2020-06-20T09:12:55.060 | -1 | 30,674 | [
"sql",
"sql-server",
"tsql",
"sql-server-2008",
"data-migration"
] |
3,956,043 | 1 | 3,956,058 | null | 121 | 247,685 | I am trying to position the text element "Bet 5 days ago" in the lower right-hand corner. How can I accomplish this? And, more importantly, please explain so I can conquer CSS!

| CSS: how to position element in lower right? | CC BY-SA 2.5 | 0 | 2010-10-18T01:13:30.913 | 2010-10-18T01:25:46.007 | null | null | 251,257 | [
"css"
] |
3,956,093 | 1 | 3,972,595 | null | 6 | 3,715 | I have an image where I want to find contours but the "contours" in my image don't have corners. Are there some tricks I can use to help find the rectangles that are implied by the lines in this image? I thought about extending all the lines to form the corners but I worry about lines intersecting from other contours and how to determine which intersections I'm interested in. I'm very new to opencv and I don't know much about image processing. Thank you for any help you can give.

| Find rectangles without corners using opencv | CC BY-SA 2.5 | 0 | 2010-10-18T01:31:58.303 | 2014-11-30T10:28:38.647 | null | null | 382,378 | [
"opencv"
] |
3,956,138 | 1 | null | null | 6 | 3,231 | I have a problem adding libs for zip extraction to my iPhone app.
I decided to use [SSZipArchive](http://github.com/samsoffes/ssziparchive#readme). It uses minizip.
After following the instructions:



Symbol(s) not found.
I tried adding -lz to Other Linker Flags and adding lybz.dylib but it didn't help. Please let me know if you know how to get libz to work here.
---
Instead of using a folder, I made a yellow reference group, removed /minizip/ from includes and now everything works.
| Failed build b/c symbols not found zlib | CC BY-SA 3.0 | null | 2010-10-18T01:46:27.243 | 2017-10-30T10:09:40.347 | 2017-07-19T18:08:33.317 | 1,033,581 | 114,446 | [
"ios",
"objective-c",
"xcode",
"ssziparchive"
] |
3,956,320 | 1 | 4,006,281 | null | 3 | 1,085 | What are the requirements for a custom data source to be listed in the 'Data Source' drop-down list when adding a Dataset to a .rdlc report in Report Viewer 2010?
As can been seen from the screen grab, for some reason it is listing potential sources from a variety of referenced assemblies, but I can't see an obvious pattern as to why it is selecting these.

The 'GeneralDataSet' makes sense as that is a strongly-typed Dataset class, but I'm pretty sure most of the others are not, yet the design dialog still lists them.
I'm looking to roll my own custom data source and would prefer it to be selectable from this list.
| Requirements for design-time data source in Report Viewer 2010 | CC BY-SA 2.5 | 0 | 2010-10-18T02:49:40.427 | 2013-04-17T09:10:25.467 | null | null | 25,702 | [
"dataset",
"reportviewer"
] |
3,956,728 | 1 | 3,956,769 | null | 3 | 3,366 | See screenshot. The bounding cyan-bordered box is the button, while the blue fill is the rectangle. I cannot for the life of me figure out how to get rid of the padding in the button. Is there a way to position the rectangle to the top left so it touches the cyan border?

Thanks.
| Why does System.Windows.Controls.Button always have a padding of 10px? | CC BY-SA 2.5 | null | 2010-10-18T05:09:29.797 | 2012-10-19T23:14:49.483 | null | null | 73,398 | [
"silverlight",
"user-controls",
"button",
"padding"
] |
3,957,087 | 1 | 3,958,275 | null | 9 | 5,858 | How can this Mathematica code be ported to Python? I do not know the Mathematica syntax and am having a hard time understanding how this is described in a more traditional language.

Source (pg 5): [http://subjoin.net/misc/m496pres1.nb.pdf](http://subjoin.net/misc/m496pres1.nb.pdf)
| Mathematica to Python | CC BY-SA 2.5 | 0 | 2010-10-18T06:58:07.420 | 2011-11-25T00:52:07.273 | null | null | 3,957 | [
"python",
"wolfram-mathematica"
] |
3,957,899 | 1 | 3,958,009 | null | 0 | 246 | My .jrxml file contains 2 text and one param

Following is my java code for jasper report, When i run the code it creates pdf file but it is always empty any help ?
```
public class TestReport {
public static void runReport(String reportFile) {
try{
Map parameters = new HashMap();
parameters.put("my_var", "Address Report");
JasperDesign jasperDesign = JRXmlLoader.load(reportFile);
JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
JasperPrint jsp = JasperFillManager.fillReport(jasperReport, parameters);
JasperExportManager.exportReportToPdfFile(jsp, "/home/ireports/test1.pdf");
}catch(Exception ex) {
String connectMsg = "Could not create the report " + ex.getMessage() + " " + ex.getLocalizedMessage();
System.out.println(connectMsg);
}
}
public static void main(String args[]){
runReport("/home/ireports/report1.jrxml");
}
}
```
| java jasper params static | CC BY-SA 2.5 | null | 2010-10-18T09:31:07.717 | 2010-10-18T09:46:39.233 | null | null | 216,431 | [
"java",
"jasper-reports"
] |
3,958,783 | 1 | 3,958,811 | null | 0 | 59 | Is there any way of showing a link's destination from a swf in the browser? The answer might be a simple no.
Hard to explain, so I have attached a screenshot that makes it clearer.

| Hovering over a link in a Flash file - browser highlighting | CC BY-SA 2.5 | null | 2010-10-18T11:47:42.000 | 2010-10-18T11:54:16.343 | null | null | 311,074 | [
"html",
"browser",
"flash"
] |
3,958,851 | 1 | null | null | 6 | 1,728 | Suppose I've got a ton (a continuous stream) of requests to process, and each request has several stages. For example: "connecting to data source", "reading data from data source", "validating data", "processing data", "connecting to data sink", "writing result to data sink".
Which visualization methods or even tools fit well to visualize the behavior of such a system?
I'd like to be able to see which stages are taking a long time, and how the stages of different requests are aligned with respect to each other (for example, to see that the data source responds longer when accessed by too many requests at once).
If there were just a few dozen requests, I'd be OK with a few dozen individual colored timelines, but for a few thousand that doesn't fit well. I think I can get away with N colored timelines, where N is the "concurrency factor", but 1) perhaps there's something better, 2) perhaps there exist tools for this?
P.S. Shameless plug: Once I figure out the best way of visualization, I'll add it to my nifty tool called [timeplot](http://hackage.haskell.org/package/timeplot) ;)
P.P.S. Another shameless plug: I decided to write a separate tool: [splot](http://hackage.haskell.org/package/splot). Here's what it can do, based on a trivially simple log and an awk one-liner:

It's showing 160 cores of a cluster performing tasks fed to them by RabbitMQ. Blue is "fetching data", orange is "computing", white is "doing nothing". Several problems are immediately obvious from this diagram, which would be very hard to find by just looking at the logs.
| How to visualize the behavior of many concurrent multi-stage processes? | CC BY-SA 3.0 | 0 | 2010-10-18T11:56:13.210 | 2015-01-26T21:23:26.533 | 2015-01-26T21:23:26.533 | 1,143,013 | 278,042 | [
"debugging",
"concurrency",
"monitoring",
"visualization",
"distributed"
] |
3,959,122 | 1 | null | null | 23 | 34,332 | This is a memory stack (serves as a cache) that consist of nothing but a static ConcurrentHashMap (CHM).
All incoming HTTP request data are store in this ConcurrentHashMap. And there is a asynch scheduler process that takes the data from the same ConcurrentHashMap and remove the key.value after storing them into the Database.
This system runs fine and smooth but just discover under following criteria, the memory was fully utilized (2.5GB) and all CPU time was taken to perform GC:
-concurrent http hit of 1000/s
-maintain the same concurrent hit for a period of 15 minutes
The asynch process log the remaining size of the CHM everytime it writes to database. The CHM.size() maintain at around Min:300 to Max:3500
I thought there is a Memory Leak on this application. so i used Eclipse MAT to look at the Heap Dump. After running the Suspect Report, i got these comments from MAT:
> One instance of "org.apache.catalina.session.StandardManager" loaded by "org.apache.catalina.loader.StandardClassLoader @ 0x853f0280" occupies 2,135,429,456 (94.76%) bytes. The memory is accumulated in one instance of "java.util.concurrent.ConcurrentHashMap$Segment[]" loaded by "".
```
3,646,166 instances of java.util.concurrent.ConcurrentHashMap$Segment retain >= 2,135,429,456 bytes.
```
and
```
Length # Objects Shallow Heap Retained Heap
0 3,646,166 482,015,968 >= 2,135,429,456
```
The length 0 above i translate it as empty length record inside the CHM (each time i call CHM.remove() method). It is consistent to the number of record inside the database, 3,646,166 records was inside the database when this dump was created
: if i pause the stress test, the utilization in Heap Memory will gradually release down to 25MB.This takes about 30-45 minutes. i have re-simulate this application and the curves looks similar to the VisualVM Graph below:

Heres the questions:
1) Does this looks like a Memory Leak?
2) Each remove call `remove(Object key, Object value)` to remove a `<key:value>` from CHM, does that removed object get GC?
3) Is this something to do with the GC settings? i have added the following GC parameters but without help:
```
-XX:+UseParallelGC
-XX:+UseParallelOldGC
-XX:GCTimeRatio=19
-XX:+PrintGCTimeStamps
-XX:ParallelGCThreads=6
-verbose:gc
```
4) Any idea to resolve this is very much appreciated! :)
5) Could it be possible because all my reference are hard reference? My understanding is as long as the HTTP session is ended, all those variables that is not static are now available for GC.
Note I tried replace the CHM with ehcache 2.2.0, but i get the same OutOfMemoryException problem. i suppose ehcache is also using ConcurrentHashMap.
Server Spec:
-Xeon Quad core, 8 threads.
-4GB Memory
-Windows 2008 R2
-Tomcat 6.0.29
| Memory Fully utilized by Java ConcurrentHashMap (under Tomcat) | CC BY-SA 2.5 | 0 | 2010-10-18T12:29:58.193 | 2014-08-22T13:40:00.103 | 2010-10-21T10:55:35.057 | 294,415 | 294,415 | [
"java"
] |
3,959,235 | 1 | 4,227,861 | null | 1 | 481 | I've got a WPF FlowDocument with a list of MarkerType 'Upper Latin'. It's looking like this:

Notice that the list item alignment is on the periods after the marker, but since the text is variable width, the D, E, and F look silly. I would rather have the list markers be left aligned than right aligned, but I can't figure out how to do it. TextAlignment on the List or ListItem makes no difference.
| WPF Flowdocument - can't left-align ListItem markers | CC BY-SA 2.5 | null | 2010-10-18T12:43:11.633 | 2010-11-19T17:48:17.247 | null | null | 945 | [
"wpf",
"alignment",
"flowdocument",
"listitem"
] |
3,959,334 | 1 | null | null | 5 | 894 | I found a strange behavior in the component TwebBrowser, when I load certain pages they are shown with larger fonts. different from what is used in internet explorer.
see these sample images
Here in this link [http://docwiki.embarcadero.com/RADStudio/en/Main_Page](http://docwiki.embarcadero.com/RADStudio/en/Main_Page) is loaded with larger fonts in TWebBrowser and with small fonts (another style) in IE.

this page [https://stackoverflow.com/](https://stackoverflow.com/) is loaded with same style in the TWebBrowser component and IE.

I tried it on different machines and same thing happens.
how can i fix this behavior ? this is a problem with a CSS?
| TWebrowser load page with big fonts | CC BY-SA 2.5 | 0 | 2010-10-18T12:56:10.383 | 2010-12-15T12:16:39.683 | 2017-05-23T12:30:36.930 | -1 | 167,454 | [
"delphi",
"browser"
] |
3,960,107 | 1 | 3,960,139 | null | 2 | 4,034 | I downloaded setup.exe, and then begin to install and it immediately crashes.
On win7 it worked fine. On XP it doesn't work.

Error text:
> Unable to install or run the
application. The application requires
that assemble stdole Version
7.0.3300.0 be installed in the Global Assembly Cache (GAC) first.
| Problem installing a ClickOnce application | CC BY-SA 2.5 | 0 | 2010-10-18T14:20:33.240 | 2010-10-18T16:26:52.190 | 2010-10-18T16:26:52.190 | 1,321 | 450,466 | [
"c#",
"wpf",
"clickonce"
] |
3,960,383 | 1 | null | null | 3 | 1,291 | I want to do custom cloud (system balloon) as i paint in attach picture.
Is it possible?

| is it possible: custom trayicon balloon? | CC BY-SA 2.5 | 0 | 2010-10-18T14:54:57.153 | 2010-10-18T15:44:00.213 | null | null | 395,034 | [
"qt",
"winapi"
] |
3,960,426 | 1 | 3,961,176 | null | 1 | 135 | I downloaded Wix V3.0 and installed. An unhandled exception happened each time when I tried to use the Click Through for Isolated Applications type. So i cannot use it. 
we are using .Net 3.5 we cannot upgrade to .Net 4. anybody knows a workaround?
thanks,
| WiX exception at very beginning | CC BY-SA 2.5 | null | 2010-10-18T14:59:32.057 | 2010-10-18T16:29:11.287 | null | null | 117,039 | [
"c#",
".net",
"wix"
] |
3,960,960 | 1 | 17,566,124 | null | 1 | 3,603 | I crawled all the web, but nothing.
I have a to .
It's a collection of images that you can scroll .
```
for (int i = 0; i < NIMAGES; i++) {
NSString *filename = [NSString stringWithFormat:@"image%d.png", i+1];
ScrollerImage *iv = [[ScrollerImage alloc] initWithNibName:@"ScrollerImage" bundle:nil];
[iv initWithImage:[UIImage imageNamed:filename]];
iv.frame = CGRectMake(i * 320.0f, 0.0f, 320.0f, 150.0f);
iv.exclusiveTouch = YES;
iv.userInteractionEnabled = YES;
[sv addSubview:iv];
[iv release];
}
```
The class is an
```
#import <UIKit/UIKit.h>
@interface ScrollerImage : UIImageView {
}
@end
```
(not necessary a move, also a copy of view, or an id of view, anything that permit me to identify the image) ?
It's like a shopping cart, where you can drag items at the bottom view (cart).
Like this:

| Drag an UIImageView from UIscrollView to another view | CC BY-SA 3.0 | 0 | 2010-10-18T16:04:23.767 | 2014-01-06T16:32:33.170 | 2014-01-06T16:32:33.170 | 759,866 | 88,461 | [
"objective-c",
"uiview",
"drag-and-drop",
"uiscrollview",
"uiimageview"
] |
3,961,062 | 1 | 3,961,321 | null | 1 | 130 | i have wrote today because i need some help with a simple function in jquery for modify the structure of an input [reCaptcha] and hide the image showed.
The code of the page(s) that contains the reCaptcha plugin is:
[http://pastebin.com/Qahph2ZB](http://pastebin.com/Qahph2ZB)
Is possible to make this in Jquery?
BEFORE ------------------------------------------------------------> AFTER
 > 
(Because i have saw a video of a script[Made in Js/Jquery] that make this effect :-(
I have tryed but nothing :-(
P.S: I can't modify the original structure of the page :-( ... I would like to inject the Jquery with Greasemonkey.
Thanks in advance.
Kind Regards
Luca.
| jQuery: Modify the structure of an input | CC BY-SA 3.0 | null | 2010-10-18T16:14:10.940 | 2014-08-24T03:48:08.343 | 2014-08-24T03:48:08.343 | 3,366,929 | 441,720 | [
"javascript",
"jquery",
"input",
"structure"
] |
3,961,652 | 1 | 3,961,716 | null | 14 | 21,533 | i have content i need to display above my listview and below, so much that a scrollview would be great to use if you could use scrollviews and listviews together. Since thats not the best solution, i've been trying to do a couple of things to add footer content to my listview,
here the pic below shows what happens when i add a different type of row as the last row. I can't get my content to fill the width of the row

I have a couple of buttons that need to go in the footer. I'm using a custom adapter that extends BaseAdapter.
I have also tried using the addFooterView but i'm confused on how to use the addFooterView method if you are implementing your own adapter. Anyone have any simple examples of how to implement addFooterView on a custom adapter
or
is there a way i can get the row at this position (as seen in the picture ) to display better, here is the code i'm using to create this footer row
```
View v = getLayoutInflater().inflate(R.layout.item_listview_footer, null);
LinearLayout ll = (LinearLayout) v.findViewById(R.id.ll);
return ll; // return ll as convertView in getView function
```
edit:
here is the xml for my footer layout
```
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:layout_width="fill_parent" android:background="@drawable/red" android:orientation="vertical" android:id="@+id/ll">
<Button android:id="@+id/specialInsButton" style="@style/button" android:text="Add Special Instructions" android:layout_width="fill_parent"/>
<Button android:id="@+id/addToBagButton" style="@style/button" android:text="Add To Bag"/>
<EditText android:id="@+id/quantity" style="@style/standard" android:text="1"/>
</LinearLayout>
```
here is the xml for style/button
```
<style name="button">
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:textSize">17px</item>
<item name="android:textStyle">bold</item>
<item name="android:typeface">sans</item>
<item name="android:gravity">center</item>
<item name="android:layout_gravity">center</item>
</style>
```
standard style
```
<style name="standard">
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">wrap_content</item>
</style>
```
| listview addFooterView problems | CC BY-SA 2.5 | 0 | 2010-10-18T17:26:31.343 | 2010-10-18T20:28:32.733 | 2010-10-18T20:28:32.733 | 202,064 | 202,064 | [
"android",
"listview",
"android-linearlayout",
"android-listview"
] |
3,961,755 | 1 | null | null | 2 | 451 | I have this weird bug with UITextField, sometimes there's a line (actually more of a transparent strip) through it. Does anyone know how to get rid of it?
Here's the picture

A link to xib file: [http://db.tt/7l2Bq42](http://db.tt/7l2Bq42)
A link to the code: [http://db.tt/DW0mlqQ](http://db.tt/DW0mlqQ)
.
| Line through UITextField | CC BY-SA 2.5 | 0 | 2010-10-18T17:39:08.040 | 2010-10-30T05:41:25.090 | 2010-10-30T05:41:25.090 | 394,526 | 394,526 | [
"iphone",
"uitextfield"
] |
3,962,174 | 1 | 3,964,554 | null | 1 | 511 | With the following code, I can't get the background image to display at its original size (it's always a fair bit larger). I tried changing the `Stretch` property, but "None" seems to be the most appropriate value.
```
<Canvas Width="500" Height="500">
<Canvas.Background>
<ImageBrush
ImageSource="{Binding ElementName=w_window, Path=BackgroundImagePath}"
Stretch="None"
AlignmentX="Left"
AlignmentY="Top"
/>
</Canvas.Background>
</Canvas>
```
In the image below, you can see my app on the left and photo viewer (set to original size) on the right.

Any advice? (BTW, setting `ClipToBounds="True"` doesn't work.)
It seems that my problem isn't restricted to when the image is a background. The following code, in which an `Image` is the only element, has the same sizing problem. It's not just my machine having this problem (i.e. the app has this problem on other machines).
```
<Window x:Class="DiagramDesigner.Window2"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window2" Height="300" Width="1000">
<Image
Source="C:\Users\patk\Downloads\Bottom_wnums.jpg"
Stretch="None"
HorizontalAlignment="Left"
VerticalAlignment="Top"
/>
</Window>
```
| Background image won't display at its original size | CC BY-SA 2.5 | null | 2010-10-18T18:27:55.647 | 2010-10-19T00:34:45.603 | 2010-10-18T20:35:36.413 | 116,891 | 116,891 | [
".net",
"wpf",
"image",
"background-image"
] |
3,962,195 | 1 | 3,962,985 | null | 10 | 5,454 | One of my favorite features of Eclipse is the ability to open a [caller/callee hierarchy](http://eclipse-tools.sourceforge.net/call-hierarchy/index.html) of a method.
By default, the view shows calls to/from classes that are outside of my codebase... which I don't usually care about.
There is an option to filter specific package names I don't want, but I need to do the opposite... to filter all packages the I want. What is the appropriate regex to use here to "match all strings except those that start with `com.mycompany.`?"

| Filter Eclipse's "Open Call Hierarchy" to just my company/project | CC BY-SA 2.5 | 0 | 2010-10-18T18:31:48.853 | 2018-01-20T10:03:26.277 | null | null | 176,741 | [
"regex",
"eclipse",
"language-agnostic",
"call-hierarchy"
] |
3,962,251 | 1 | 3,962,507 | null | 0 | 905 | The website I am creating has a fairly large title text for its banner. Using a plain font gives it a very jagged look, but it seems like an anti-aliased image would be a fairly large download. Which way would be the best choice, or is there a better method for large titles?
Here is the banner with pure text. Scaled down it is not as noticeable, but full size it's about 600px across. Open the image separately for the full effect:

| Text vs Image for Website Title Banner? | CC BY-SA 2.5 | null | 2010-10-18T18:38:44.490 | 2010-10-18T19:34:02.113 | 2010-10-18T18:40:09.020 | 21,234 | 326,402 | [
"web"
] |
3,962,387 | 1 | 3,962,643 | null | 0 | 472 | I've got a table from an existing LabView VI (ewww!) that I need to replicate in C#. The table is shown in the image below. Each field will be populated with data returned by status queries to an external device, likely from within a dedicated status thread (when I implement it...). Is there any control, or direction I should take when extending an existing control for the table-like display of my query results? DataGridView seems like overkill for this, but the table layout container populated with TextBox controls seems inelegant. I'd like some insight, if anyone can offer it. Also, please feel free to shut me down if this has been asked already (though my search turned up nothing I could relate to...). Thanks.

| How would I create a table control similar to the one shown? | CC BY-SA 2.5 | null | 2010-10-18T18:58:26.147 | 2010-10-18T19:32:26.610 | null | null | 416,190 | [
"c#",
"datagrid"
] |
3,962,448 | 1 | 3,962,468 | null | 3 | 1,332 | I have two overlapping shapes in my C# app, defined by `Point` arrays. I need to find the points that define the shape where these two overlap. In this image, I know the red and green points, but I need the yellow points.

Here is some dummy code that might help:
```
Point[] GetIntersection(Point[] red, Point[] green)
{
Point[] yellow = ?!?;
return yellow;
}
```
There are certainly ways you could do this assuming nice easy rectangles. In practice, I need to be able to handle polygons and maybe even circles (although I can live without circles).
Any ideas? I'm hoping there is a nifty GDI+ function that will just spit this out.
| Finding the shape created by two other intersecting shapes | CC BY-SA 2.5 | 0 | 2010-10-18T19:05:28.070 | 2010-10-18T19:09:52.240 | null | null | 27,414 | [
"c#",
".net",
"gdi+",
"shapes"
] |
3,962,531 | 1 | 4,023,937 | null | 0 | 395 | So I have two pictures of the weirdness that is occuring

As you can see in the picture above, the scroll bar on the right hand side is being cut off a little bit by the screen, and even when you scroll to the right, you don't get the bar back, it remains cut off.
Here is the other scenario:

Here, you can see that when I scroll down in this grid, the scroll bar kind of fits into the bottom of the grid and doesn't even go all the way down. You need to manually click into the grid and hit the down arrow to get the rest of the way down.
What could be causing both of these weird issues?
Edit:
Here is the code to generate the grid (Ext created through VB controls):
```
Dim VehicleOptionsGrid As New Akcelerant.Framework.WebControls.Grids.Grid
With VehicleOptionsGrid
.ID = "VehicleOptionsGrid"
.Title = "Vehicle Options"
.Toolbar.UseDefaultButtons = False
.Mode = Grids.Grid.GridMode.Control
.Panel.Border = False
.Panel.Style = "border-width:1px;margin-bottom:5px"
.Ref = "../../../../../VehicleOptionsGrid"
.Editable = True
With .Columns.Add("IsSelected", "Selection", Akcelerant.Framework.WebControls.Grids.Grid.ColumnDataType.Boolean)
.Renderer = "renderVehicleCheckbox"
End With
.Columns.Add("CollateralId", "").Hidden = True
.Columns.Add("OptionId", "OptionId").Hidden =True
.Columns.Add("OptionName", "Name").Width = 200
.GridHeight = 400
.DataBind()
ViewResponse.AddScript(.ToString(False))
ViewResponse.AddScript("VehicleOptionsGrid.grid.addListener('cellclick', changeOptionStatus);")
End With
```
Here is where we add the grid to the page:
```
With .AddPanel
With .AddPanel
.Title = ""
.Html = "Standard Options are preselected. Please select additional options as needed."
.Style = "padding-bottom:5px"
End With
.Ref = "../../../../VehicleOptionsPanel"
.Title = "Vehicle Options"
.Frame = True
.Style = "padding-bottom:5px"
.Layout = Pages.Panel.LayoutType.Column
.Height = 400
.Collapsed = True
.AddExtObject("VehicleOptionsGrid.grid")
End With
```
| ExtJs Grid acting very strange | CC BY-SA 2.5 | null | 2010-10-18T19:19:11.783 | 2010-10-26T13:06:00.330 | 2010-10-18T20:19:35.000 | 434,970 | 434,970 | [
"asp.net",
"extjs",
"grid"
] |
3,962,558 | 1 | 4,638,434 | null | 86 | 151,640 | I have a `div` layer with `overflow` set to `scroll`.
When scrolled to the bottom of the `div`, I wanna run a function.

| javascript: detect scroll end | CC BY-SA 3.0 | 0 | 2010-10-18T19:22:15.647 | 2023-02-11T16:46:41.883 | 2017-02-08T14:30:36.593 | -1 | 2,058,243 | [
"javascript",
"jquery",
"html",
"scrollbar",
"scroll"
] |
3,962,590 | 1 | 4,017,041 | null | 3 | 2,028 | In Visual Studio 2005, my coworker can right click a tab and he has an option "Find in Solution Explorer". I know this is from ReSharper and I'm running ReSharper 5.1 - how do I enable this extra context menu? I also know about the Shift+Alt+L shortcut for the same command but want to add the context menu.
This is what I see when I right click on a tab. The picture below is when I right clicked on a .cs file.

EDIT: Typo in the title.
| Adding ReSharper options to context menu in Visual Studio | CC BY-SA 2.5 | 0 | 2010-10-18T19:25:46.103 | 2010-10-25T17:07:16.263 | 2010-10-18T19:30:49.757 | 1,444,511 | 1,444,511 | [
"resharper"
] |
3,962,705 | 1 | 3,963,815 | null | 0 | 280 | Hi my application runs fine but when I try to run the unit tests I am getting this error...
```
2010-10-19 00:27:49.919 AssignmentUnitTest[27988:903] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason:
'*** -[NSURL initFileURLWithPath:]: nil string parameter'
```
Irony is I have searched the whole project & I dont have any similar line of code that uses `**[NSURL initFileURLWithPath:]**`
I have pretty much wasted half of my day on it without any success.
I am using coredata in the project & below is the screen shot with stack trace.
Can anyone please guide me to the right direction.
Thanks

**EDIt : ** The solution to this problem is to add not only the .xcdatamodel file but the root file .xcdatamodeld. Core Data was having trouble finding my model so was displaying this error. Hope it helps somebody someday.
| Error compiling for unit test using google toolbox for mac | CC BY-SA 2.5 | null | 2010-10-18T19:38:49.310 | 2010-10-19T01:34:21.450 | 2010-10-19T01:34:21.450 | 197,688 | 197,688 | [
"iphone",
"xcode",
"unit-testing",
"ios",
"google-toolbox-for-mac"
] |
3,962,722 | 1 | 3,962,759 | null | 0 | 890 | I'm looking to create a listview screen similar to the Sound Setting screen (in the built in Settings app, see image below), i.e I want some rows to have text + checkboxes, other rows to have text + "pop up" buttons, some rows should have text only etc.
What is the best way to accomplish this?

| Android: how do I create a listview screen with different content for each row | CC BY-SA 2.5 | null | 2010-10-18T19:40:19.883 | 2010-10-18T20:35:55.927 | null | null | 277,711 | [
"android",
"listview",
"varying"
] |
3,963,002 | 1 | 3,963,022 | null | 3 | 4,428 | I think this is because I'm floating all three divs "columns" to the left, inside of the main body div.
How can I tell the main body div to expand as big as it needs to fit the content divs?
Here it's with min-height:

And here with the min-height taken away:

Here is my relevant code.
```
#body
{
border:1px solid blue;
width:950px;
margin-left:auto;
margin-right:auto;
margin-top:15px;
}
#leftcolumn
{
min-height:500px;
float:left;
width:190px;
}
#contactarea
{
font-family:Arial;
}
#contactarea p.heading
{
Color:#000;
font-size:large;
position:relative;
left:14px;
}
#contactarea p.tag
{
color:#000;
font-size:medium;
position:relative;
left:10px;
}
#leftnavigation ul
{
margin:0;
padding: 0;
list-style: none;
}
#leftnavigation ul li {
border-top: 1px solid #333;
border-bottom: 1px solid #111;
}
#leftnavigation ul li:first-child {border-top: none;}
#leftnavigation ul li:last-child {border-bottom: none;}
#leftnavigation ul li a
{
padding: 10px;
display: block;
color: #fff;
background-color:#222222;
text-decoration: none;
}
#leftnavigation ul li a:hover {background: #111;}
#contentarea
{
border:1px solid blue;
min-height:500px;
float:left;
width:594px;
margin-left:5px;
margin-right:5px;
}
#advertisingarea
{
width:150px;
float:left;
min-height:500px;
background-image:url('images/advertisingAreaBackground.png');
background-repeat:repeat-y;
}
.advert
{
height:190px;
overflow:hidden;
}
.advert img
{
padding:0;
margin:0;
position:relative;
left:25px;
top:5px;
}
.advert p
{
font-size:x-small;
font-family:Arial;
margin-left:8px;
margin-right:8px;
margin-top:5px;
}
<div id="body">
<div id="leftcolumn">
<div id="leftnavigation">
<ul>
<li><a href="#">Automoviles</a></li>
<li><a href="#">Clases y Talleres</a></li>
<li><a href="#">Electronicos</a></li>
<li><a href="#">Inmobiliaria</a></li>
<li><a href="#">Libros</a></li>
<li><a href="#">Musica, Peliculas y Juegos</a></li>
<li><a href="#">Ninos</a></li>
<li><a href="#">Otros</a></li>
<li><a href="#">Ropa</a></li>
</ul>
</div>
<div id="contactarea">
<p class="heading">Anuncios Premium</p>
<p class="tag">Destaque sus anuncios con una cuenta premium!</p>
</div>
</div>
<div id="contentarea">sdfg<h1>asdasd</h1></div>
<div id="advertisingarea">
<div class="advert">
<a href="#"><img src="../../Content/images/advertImage.png" alt="Advert" /></a>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris nibh nisi, volutpat a vehicula eget</p>
</div>
<div class="advert">
<a href="#"><img src="../../Content/images/advertImage.png" alt="Advert" /></a>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris nibh nisi, volutpat a vehicula eget</p>
</div>
<div class="advert">
<a href="#"><img src="../../Content/images/advertImage.png" alt="Advert" /></a>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris nibh nisi, volutpat a vehicula eget</p>
</div>
</div>
</div>
```
| Div doesn't have height unless I give it min-height | CC BY-SA 2.5 | 0 | 2010-10-18T20:15:05.750 | 2010-10-18T23:56:32.103 | null | null | null | [
"css",
"layout",
"html"
] |
3,963,046 | 1 | 3,964,704 | null | 1 | 4,967 | I have a the following setup
```
m_handsets = From p In RL.App.TComEntities.tblTelephoneNumbers _
Where p.companyId = m_CompanyID _
Select p
m_handsets = DirectCast(m_handsets, ObjectQuery(Of RL.TelephoneNumbers)).Include("tblCalls")
```
where m_handsets is defined as
```
Private m_handsets As IQueryable(Of RL.tblTelephoneNumbers)
```
which works as expected however what I want to do know is query the Navigation property (tblCalls) so I can do something like the following
```
From p In m_handsets.tblCalls
Where m_handsets.tblCalls.price > 100
```
but I have no idea of the proper syntax, can anyone help?
I think the complexity comes here because in this instance I could have 5 tblTelephoneNumbers in m_handsets and then x amount of calls for that particular telephone number. I am interested in the tblCalls for each but I would like to filter them all for each tblTelehoneNumber.
Entity Diagram which (hopefully) should illustrate further

So I currently know all the handsets that are associated with the company I am interested in. I can also see the calls loaded as a navigation property in debug mode, but I want to say is take this filter (in this example price>100 and apply it to all handsets->calls
| Entity Framework How to query data in a Navigation property table | CC BY-SA 2.5 | 0 | 2010-10-18T20:21:28.527 | 2010-10-21T14:38:52.120 | 2010-10-19T11:55:39.173 | 11,802 | 11,802 | [
"vb.net",
"entity-framework",
"linq-to-entities"
] |
3,963,122 | 1 | 3,963,408 | null | 5 | 1,829 | What packages and functions in R can perform a two dimensional non-additive local regression/smooth. For example consider
```
b<-seq(-6*pi,6*pi,length=100)
xy<-expand.grid(b,b)
x=xy[[1]]
y=xy[[2]]
z= sin(x)+cos(y) + 2*sin(x)*cos(y)
contour(b,b,matrix(z,100,100))
```

What functions could estimate this?
| R: Two dimensional non-parametric regression | CC BY-SA 2.5 | 0 | 2010-10-18T20:30:32.687 | 2010-10-19T01:43:30.697 | null | null | 65,148 | [
"r",
"statistics"
] |
3,963,729 | 1 | 3,966,179 | null | 0 | 439 | Here's an example of what an Exclusivity Arc is (the green arc); what it's saying is that a Plane can have either Propellers or Jet Engines - but not both.
> In Barker ER notation, an exclusion
constraint over two or more roles is
shown as an “exclusive arc” connected
to the roles with a small dot or
circle.
- [http://www.orm.net/pdf/JCM12.pdf](http://www.orm.net/pdf/JCM12.pdf)
By the way - can you have them in DDD? (I'm assuming you can if they're part of UML).
- my question around DDD isa bit misleading and I put it inas an after-thought, but @sfinnies answer raises another valid question which I'll ask separately (after some research).

| What's an Exclusivity Arc called in UML | CC BY-SA 2.5 | null | 2010-10-18T21:56:04.683 | 2010-10-19T07:47:57.693 | 2010-10-19T07:47:57.693 | 39,094 | 39,094 | [
"domain-driven-design",
"data-modeling",
"uml"
] |
3,963,735 | 1 | null | null | 2 | 707 | I have already found following question with almost similar content: [How to indent list items using CSS when you have floating blocks?](https://stackoverflow.com/questions/3797713/how-to-indent-list-items-using-css-when-you-have-floating-blocks)
And here is my situation: if a list item gets too long, so that it automatically makes a line break, the text flow continues without the indentation.
Here is what I am expecting:

I can handle this using outside position property, modifying the margin or padding of an `li` element, if the text height is smaller than the image height. But if the text continues, especially on the bottom border of the image - it looks totally destroyed.
A good code to play with can be found here: [http://csscreator.com/node/30984](http://csscreator.com/node/30984) on the second post.
Any help will be deeply appreciated
| Indent list items with floating image: problem | CC BY-SA 2.5 | null | 2010-10-18T21:56:35.523 | 2016-07-12T02:46:37.943 | 2017-05-23T12:30:36.930 | -1 | 479,831 | [
"html",
"css"
] |
3,963,903 | 1 | null | null | 1 | 176 | I am trying to figure out a way to move two points, X and Y, independently of one another along the edges of an equilateral triangle with vertices A, B, and C. There are also some collision rules that need to be taken into account:
(1) If X is at a vertex, say vertex A, then Y cannot be on A or on the edges adjacent to it. i.e., Y can only be on vertices B or C or the edge BC.
(2) If X is on an edge, say AB, then Y cannot be on A, nor B, nor any of the edges adjacent to A and B. i.e., Y must be on vertex C
I have figured out how to move the two points along the triangle using a pair of sliders, but I can't figure out how to implement the collision rules. I tried using the Exclusions option for Slider but the results are not what I expect. I would prefer to drag the points along the triangle rather than using sliders, so if someone knows how to do that instead it would be helpful. Ideally, I would be able to
move the two points from a vertex to either one of the edges instead of coming to a stop at one of them. Here is my code so far.
`MyTriangle[t_] := Piecewise[{{{-1, 0} + (t/100) {1, Sqrt[3]}, 100 > t >= 0}, {{0, Sqrt[3]} + (t/100 - 1) {1, -Sqrt[3]}, 200 > t >= 100}, {{1, 0} + (t/100 - 2) {-2, 0}, 300 >= t >= 0}}] excluded[x_] := \[Piecewise] { {Range[0, 99]~Join~Range[201, 299], x == 0}, {Range[0, 199], x == 100}, {Range[101, 299], x == 200}, {Range[0, 199]~Join~Range[201, 299], 0 < x < 100}, {Range[1, 299], 100 < x < 200}, {Range[0, 99]~Join~Range[101, 299], 200 < x < 300} } {Dynamic[t], Dynamic[x]} {Slider[Dynamic[t], {0, 299, 1}, Exclusions -> Dynamic[excluded[x]]], Dynamic[t]} {Slider[Dynamic[x], {0, 299, 1}, Exclusions -> Dynamic[excluded[t]]], Dynamic[x]} Dynamic[Graphics[{PointSize[Large], Point[MyTriangle[t]], Point[MyTriangle[x]], Line[{{-1, 0}, {1, 0}, {0, Sqrt[3]}, {-1, 0}}]}, PlotRange -> {{-1.2, 4.2}, {-.2, 2}}]]`

| Visualizing a geometric puzzle with mathematica | CC BY-SA 3.0 | null | 2010-10-18T22:25:21.517 | 2012-01-02T21:43:06.073 | 2012-01-02T21:43:06.073 | 615,464 | 479,848 | [
"math",
"dynamic",
"wolfram-mathematica",
"visualization"
] |
3,963,935 | 1 | null | null | 0 | 738 | I have a UIViewController whose view is a UIWebView with an embedded movie. When the movie is playing full screen, and the device is rotated, the title bar ends up behind the status bar after the movie is dismissed. Why might this happen?

| Why is the title bar appearing behind the status bar after a rotation? | CC BY-SA 2.5 | null | 2010-10-18T22:30:53.853 | 2014-12-10T02:28:05.560 | null | null | 144,776 | [
"iphone",
"uiviewcontroller",
"uiwebview",
"rotation"
] |
3,964,008 | 1 | 3,964,127 | null | 0 | 276 | Top: IE8
Bottom: IE7

How do you fix IE7 so it doesn't split my anchor into two pieces? I know and would solve this, but I'd rather have it be inline. This way, I can have text both to the left and right of any arbitrarily placed anchor button.
```
#launchChrome {
font-weight: bold;
text-decoration: none;
text-shadow: 0 1px 0 rgba(255,255,255,1);
background: #eee;
background: -moz-linear-gradient(center top, #fff, #cfd5e3);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fff), color-stop(1, #cfd5e3));
border: 1px solid;
border-color: #ccc #ccc #999 #ccc;
-moz-border-radius: 0.4em;
-webkit-border-radius: 0.4em;
text-shadow: 0 1px 0 rgba(255,255,255,0.7);
color: #666;
font-size: 1.4em;
padding: 0.2em 0.6em;
margin: 0 0 0 1em;
-moz-box-shadow: 0 0.1em 0.1em rgba(0,0,0,0.1);
-webkit-box-shadow: 0 0.1em 0.1em rgba(0,0,0,0.1);
}
<a id="launchChrome" href="javascript:void(0)" onclick="launch()">
<img src="<?=base_url()?>images/spacer.gif" class="spriteChannel googleChromeSmall">
Launch Chrome
</a>
```
| Anchor split into two pieces on IE7 | CC BY-SA 2.5 | null | 2010-10-18T22:42:10.460 | 2010-10-18T23:06:57.433 | null | null | 459,987 | [
"javascript",
"css",
"internet-explorer",
"anchor"
] |
3,964,219 | 1 | 3,964,308 | null | 0 | 2,417 | When you send a PDT transaction ID back to paypal, you get back a list of transaction data. It has SUCCESS on the first line, and then a list of key=value pairs. One pair per line. For example:
```
SUCCESS
[email protected]
charset=windows-1252
custom=
first_name=Alice
handling_amount=0.00
invoice=NN0005
item_name=Bear
item_number=BEAR05
last_name=Foobar
mc_currency=SEK
mc_fee=13.00
mc_gross=250.00
[email protected]
payer_id=UC9DXVX7GRSTN
payer_status=unverified
payment_date=09:08:06 Oct 18, 2010 PDT
payment_fee=
payment_gross=
payment_status=Completed
payment_type=instant
protection_eligibility=Ineligible
quantity=1
receipt_id=2479-2605-1192-2880
[email protected]
receiver_id=8Y670ENTB8BY6
residence_country=NO
shipping=0.00
tax=0.00
transaction_subject=Bear
txn_id=1PH815997L239283J
txn_type=web_accept
```
What is a good, quick and clean way to check if the first line equals SUCCESS and then convert this into an associative array? I am able to do it, and it works, but I'm curious if there are better or cleaner ways of doing it cause what I end up with isn't always that nice. Notice that some of the keys don't have any value as well.
So, what I would like to end up with is essentially:
```
array(
'business' => '[email protected]',
'charset' => 'windows-1252',
'custom' => NULL,
'first_name' => Alice,
// And so on
);
```
The order doesn't matter.
---
# Benchmark results
Got curious to what I should choose here, so I benchmarked how I should do different parts. Had various ideas myself, got some from here and other places as well. When I had found the fastest I could manage, I created a benchmark and put it to the test against all of the answers so far. For the ones that had skipped the splitting or the checking for success I added an `explode` and a `strpos` check accordingly. I also added urldecode to all the solutions as well, except @dynamism who tackled that so nicely. Anyways, here are the results:

The benchmark was run using the [codebench](http://www.geertdedeckere.be/article/introducing-codebench) [Kohana 3](http://kohanaframework.org/) module. Here is the benchmark code:
```
<?php defined('SYSPATH') or die('No direct script access.');
/**
* Test various methods of checking for SUCCESS
*
* @package PayPal
* @category PDT
* @author Torleif Berger
*/
class Bench_ProcessPDT extends Codebench
{
public $description = 'Various ways of checking that a string starts with SUCCESS';
public $loops = 100000;
public function bench_mine($subject)
{
if(strpos($subject, 'SUCCESS') === 0)
{
$subject = urldecode(substr($subject, 7));
preg_match_all('/^([^=]++)=(.*+)/m', $subject, $result, PREG_PATTERN_ORDER);
$result = array_combine($result[1], $result[2]);
return array(count($result), array_shift($result), array_shift($result));
}
return FALSE;
}
// http://stackoverflow.com/questions/3964219/3964308#3964308
public function bench_dynamism_substr($subject)
{
if(substr($subject, 0, 7) == 'SUCCESS')
{
$subject = substr_replace($subject, '', 0, 7);
$subject = str_replace(array("\n", "\r", "\r\n"), '&', $subject);
parse_str($subject, $result);
return array(count($result), array_shift($result), array_shift($result));
}
return FALSE;
}
// http://stackoverflow.com/questions/3964219/3964308#3964308
public function bench_dynamism_strpos($subject)
{
if(strpos($subject, 'SUCCESS') === 0)
{
$subject = substr_replace($subject, '', 0, 7);
$subject = str_replace("\r\n", '&', $subject);
parse_str($subject, $result);
return array(count($result), array_shift($result), array_shift($result));
}
return FALSE;
}
// http://stackoverflow.com/questions/3964219/3964520#3964520
public function bench_mellowsoon($subject)
{
$subject = urldecode($subject);
$lines = explode("\r\n", $subject);
$lines = array_map('trim', $lines);
$status = array_shift($lines);
if($status == 'SUCCESS')
{
$result = array();
foreach($lines as $line)
{
list($key, $value) = explode('=', $line, 2);
$result[$key] = $value;
}
return array(count($result), array_shift($result), array_shift($result));
}
return FALSE;
}
// http://stackoverflow.com/questions/3964219/3964265#3964265
public function bench_amber($subject)
{
if(strpos($subject, 'SUCCESS') === 0)
{
$subject = explode("\r\n", urldecode($subject));
array_shift($subject); // Remove is empty
$result = array();
foreach($subject as $line)
{
$bits = explode('=', $line);
$field_name = array_shift($bits);
$field_contents = implode('=', $bits);
$result[$field_name] = $field_contents;
}
return array(count($result), array_shift($result), array_shift($result));
}
return FALSE;
}
// http://stackoverflow.com/questions/3964219/3964366#3964366
public function bench_GigaWatt($subject)
{
if(strpos($subject, 'SUCCESS') === 0)
{
$subject = explode("\r\n", urldecode($subject));
$result = array();
foreach($subject as $line)
{
if (strpos($line, "=") === FALSE)
continue;
list($var, $value) = explode("=", trim($line));
$result[$var] = empty($value) ? NULL : $value;
}
return array(count($result), array_shift($result), array_shift($result));
}
return FALSE;
}
// http://stackoverflow.com/questions/3964219/3964366#3964366
public function bench_GigaWatt2($subject)
{
if(strpos($subject, 'SUCCESS') === 0)
{
$subject = explode("\r\n", urldecode($subject));
$result = array();
foreach($subject as $line)
{
if (strpos($line, "=") === FALSE)
continue;
list($var, $value) = explode("=", trim($line));
$result[$var] = $value;
}
return array(count($result), array_shift($result), array_shift($result));
}
return FALSE;
}
// http://stackoverflow.com/questions/3964219/3964323#3964323
public function bench_dvhh($subject)
{
if(strpos($subject, 'SUCCESS') === 0)
{
$subject = explode("\r\n", urldecode($subject));
$result = array();
foreach($subject as $line)
{
$lineData = preg_split("/\s*=\s*/", $line);
if(count($lineData) == 2)
{
$result[$lineData[0]] = $lineData[1];
}
}
return array(count($result), array_shift($result), array_shift($result));
}
return FALSE;
}
public $subjects = array
(
"SUCCESS\r\[email protected]\r\ncharset=windows-1252\r\ncustom=\r\nfirst_name=Alice\r\nhandling_amount=0.00\r\ninvoice=AF000001\r\nitem_name=Stuffed bear\r\nitem_number=BEAR05\r\nlast_name=Foobar\r\nmc_currency=USD\r\nmc_fee=2.00\r\nmc_gross=20.00\r\[email protected]\r\npayer_id=UC9DXVX7GRSTN\r\npayer_status=unverified\r\npayment_date=09:08:06 Oct 18, 2010 PDT\r\npayment_fee=\r\npayment_gross=\r\npayment_status=Completed\r\npayment_type=instant\r\nprotection_eligibility=Ineligible\r\nquantity=1\r\nreceipt_id=2479-2605-1192-2880\r\[email protected]\r\nreceiver_id=8Y670ENTB8BY6\r\nresidence_country=USD\r\nshipping=0.00\r\ntax=0.00\r\ntransaction_subject=Bear\r\ntxn_id=1PH815997L239283J\r\ntxn_type=web_accept",
"FAIL\r\nError: 4003",
"INVALID",
);
}
```
If anyone has any further tips for improvement, please let me know :)
| PHP: How to quickly split a key=value file into associative array | CC BY-SA 2.5 | null | 2010-10-18T23:17:19.113 | 2022-04-18T13:26:15.173 | 2010-10-19T14:29:01.590 | 39,321 | 39,321 | [
"php",
"string",
"paypal"
] |
3,964,362 | 1 | 3,972,828 | null | 3 | 1,627 | I've been playing around with the [samus mongodb driver](http://github.com/samus/mongodb-csharp), particularly the benchmark tests. From the output, it appears the size of the documents can have a drastic effect upon how long operations on those collections take.

Is there some documentation available that recommends what balance to strive for or some more "real" numbers around what document size will do to query times? Is this poor performance more a result of the driver and any serialization overhead? Has anyone else noticed this?
| MongoDB Performance Based on Document Size | CC BY-SA 2.5 | 0 | 2010-10-18T23:45:08.160 | 2010-10-19T21:15:03.570 | null | null | 8,873 | [
"c#",
"performance",
"mongodb"
] |
3,964,617 | 1 | null | null | 4 | 1,880 | I have some code on an aspx page then when it starts downloading a zip. Looks like this:
```
Response.ContentType = "application/octet-stream";
Response.AppendHeader("Content-Disposition", "attachment; filename=" + fileSaveName);
Response.TransmitFile(zipPath);
Response.End();
```
The problem is the FIRST time this is hit I get the following error:

The zip file exists and is not in my wwwroot. If I refresh the page the file will download fine.
If I wrap the code in a Try Catch I get a System.Threading.Threadabort exception with the message:
```
Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.
```
Thanks for any help!
| ASP.NET Response.TransmitFile Failing on First Download | CC BY-SA 2.5 | null | 2010-10-19T00:47:41.037 | 2010-12-30T17:57:29.937 | null | null | 423,079 | [
"c#",
"asp.net",
"download"
] |
3,964,707 | 1 | 3,973,542 | null | 1 | 10,152 | I wrote a .NET application where memory usage is growing over time. As a test,
I set it up to download 800 * 5K (average) size files and doing XML transform and using DTComcontroller to generate manifest, inside 1 hour with an interval of 15 Minutes. During a period of about 5 hours, memory usage grows from 35M to about 70M.
Not sure if this is normal or not. I'm already forcing it by doing
```
GC.collection();
GC.WaitForPendingFinalizers();
```
at end of each working circle just to make sure the memory are released in a timely manner.
I already make sure close filehandle, clear stream or other resources after used it. And some objects are just using local references inside a function and I assume they will be discarded at the end of local function and go away with GC.collction().
Also Memory Profiler (ANTS) shows that there are no objects with my application's namespace left at the end of each of the working circle, and no new objects with source code available left as well. The new instances of objects created during each working circle are basically called RuntimeModule, RuntimeAssembly, and DeviceContext. Doesn't looks like I could do anything about it?
This is basically my first application which are suppose to run 24/7 and I really don't know much about memeory leak. More likely than not, there are still problems with memory usage in my application. I just don't know where to look at this stage.
Also, I don't know it's related or not, I am using .net Trace/debug for keep a log. Guess it worth trying to turn off the log to see the memory usage grow.
Update:

Dose it look like circle reference of sslstate and sslstream and also other Classes in the class Reference Explorer. Also not sure if that is a circle reference in ANTS generated graph, that means there is actually circle reference in my code somewhere?
I did a few changes by reusing the same object for XMLtransform and Manifest creation, and manually set each Object to null after finish used them in the end of working iteration. Now the memory are greatly reduced, still increase private memory usage as it is working, but much slowly.
I think for my particular case--create lots of objects inside a working circle, and every data is kept in a working thread. If I didn't explicitly release object references, let .NET GC doing that will lead to lots of memory used by the application as it is keep working most of the time, and GC may never get a chance to probably doing house keeping unless the application been manually closed, I have to do the object release much more manually.
@WeNeedAnswers:
```
XmlDocument doc = new XmlDocument();
XmlTextReader textReader = new XmlTextReader(dataFile);
textReader.Read();
doc.Load(textReader);
```
| .NET Application Memory usage grow over time, memory leak or not? | CC BY-SA 2.5 | 0 | 2010-10-19T01:15:28.393 | 2021-08-09T06:05:56.067 | 2010-10-21T01:55:02.127 | 301,218 | 301,218 | [
".net",
"memory"
] |
3,964,805 | 1 | 3,964,862 | null | 0 | 1,599 | I have some OAM code here, and I've looked up all the instructions, what they do how they act, and I've re written it all pseudo, but I'm having a problem locating (so I can count how many) loops are in the program. I feel like it should be staring me in the eyes, and I've done a thousand factorial programs in C/Java etc.. but I can't see it here.

So it takes in user entry
if == 0 it breaks to done [brz]
if > 0 break to skip [brp]
neg used to negate value for abs value
Skip routine does the multiplication and decrememnts,
followed by more conditions to see if it needs to be called again or if the program is done.
I need essentially to find the loops in this program. Like I said, it's probably staring me in the face but it's a loosely asked question on the assigner's part..
EDIT to clarify:
The program doesn't take the factorial of one number, but rather multplies the factorial of each number entered.
So I could put in 3, -4, 2, 0 and the result will be 288.
(3*2*1)(4*3*2*1)(2*1)
EDIT for BRI:
```
read: noop
lda stdin
brp return
neg
return: bri read
```
| Factorial in OAM | CC BY-SA 3.0 | null | 2010-10-19T01:46:49.067 | 2017-09-07T17:20:04.087 | 2017-09-07T17:20:04.087 | 1,033,581 | 460,121 | [
"assembly",
"factorial",
"oam"
] |
3,964,835 | 1 | 3,964,961 | null | 7 | 3,078 | I'd love to stash some .json files on a CDN a la static.mydomain.com. Truth be told, static.mydomain.com is a CNAME in front of an Amazon S3 bucket.
I understand this violates the JavaScript security model. Is there an advised workaround or design? I've seen server-side stuff suggested like a PHP script to suck down data via cURL or file_gets_contents(), but that's a pretty lame approach. Is there any way to load JSON from a foreign server without getting too hacky?
===
UPDATE: Here's the line of thought that led me to believe it's a crossdomain issue for subdomains.
When I visit a page (e.g. static.mydomain.com/json/file.json) in Chrome, it displays as it would plaintext. When I visit the page in Firefox, it tries to get me to save the .json as a download.
I see a peculiar result in Firebug: A with no response body. 
I can't log the direct headers via browser; my Firefox HTTP header plugin doesn't log anything before the download is forced. However here are the headers when loaded via this jQuery snippit (worth noting, the alert below doesn't fire):
```
jQuery.get("https://static.mydomain.com/json/file.json",
function(data){
alert("Data: " + data);
}
);
```
Response Headers
```
x-amz-id-2 wSVtjlvFj5ffOtg7ZbKqKw8PexqlzJic7+PxSk975/FcDUnshSV2CiUP2oPWR8yK
x-amz-request-id 8AD81565A783988D
Date Tue, 19 Oct 2010 00:07:22 GMT
Expires Sat, 17 Oct 2015 22:25:37 GMT
Last-Modified Mon, 18 Oct 2010 01:08:13 GMT
Etag "2f1c7adcc1a7b0fd8fc8ce1478e0bf81"
Content-Type application/json
Content-Length 85966
Server AmazonS3
```
Request Headers
```
Host static.mydomain.com
User-Agent Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
Accept application/json, text/javascript, */*; q=0.01
Accept-Language en-us,en;q=0.5
Accept-Encoding gzip,deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive 115
Connection keep-alive
Referer http://mydomain.com/directory/referrer.html
Origin http://mydomain.com
```
Though the headers seem to me to be fine, to either a get, post, or anything else I can throw at this via jQuery. I see the same result when setting the content type to application/json, text/javascript and text/plain.
Can anyone explain this behavior? I figure I must be doing something wrong on the S3 side, but could it be crossdomain issues in JavaScript or can I rule out cross-subdomain issues?
| Is there any way to load json from a subdomain? | CC BY-SA 2.5 | null | 2010-10-19T01:58:01.550 | 2010-10-19T02:50:23.443 | 2010-10-19T02:07:47.347 | 317,937 | 317,937 | [
"javascript",
"jquery",
"json"
] |
3,964,855 | 1 | 3,965,416 | null | 2 | 1,280 | After stopping my web app, a significant amount of PermGen is not being released. The culprit seems to be the WebappClassLoader (in Tomcat, but it happens in Jetty too), which is kept in memory by references from a bunch of other objects. The following image shows that objects that refer to WebappClassLoader, and the things that refer to them, and so on.

One of the clingy objects seems to be an instance of `net.lag.logging.Level$INFO$`, to which a reference is stored in the static `known` array in `java.util.logging.Level`.
It appears that `java.util.logging.Level` keeps a static reference to all instances of itself. Bad, nasty `java.util.logging.Level`! Can I do anything about it? The java.util.logging framework is used by a third-party library, so I don't think I have the option of not using it.
| Can I stop java.util.logging from contributing to a memory leak? | CC BY-SA 2.5 | 0 | 2010-10-19T02:04:58.327 | 2010-10-19T04:50:03.217 | null | null | 156,410 | [
"java",
"web-applications",
"memory-leaks",
"java.util.logging"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.