Id
int64 1.68k
75.6M
| PostTypeId
int64 1
2
| AcceptedAnswerId
int64 1.7k
75.6M
⌀ | ParentId
int64 1.68k
75.6M
⌀ | Score
int64 -60
3.16k
| ViewCount
int64 8
2.68M
⌀ | Body
stringlengths 1
41.1k
| Title
stringlengths 14
150
⌀ | ContentLicense
stringclasses 3
values | FavoriteCount
int64 0
1
⌀ | CreationDate
stringlengths 23
23
| LastActivityDate
stringlengths 23
23
| LastEditDate
stringlengths 23
23
⌀ | LastEditorUserId
int64 -1
21.3M
⌀ | OwnerUserId
int64 1
21.3M
⌀ | Tags
list |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4,318,800 | 1 | 4,581,448 | null | 0 | 556 | I am using DataAnnotations to enable client-side validation in an ASP.NET MVC 2 project. I am having an issue where my URL validation regex passes my unit test, but it fails in the actual website.
## Model
```
[RegularExpression(UrlValidation.Regex, ErrorMessage = UrlValidation.Message)]
public string Url { get; set; }
Regex = "(([\w]+:)?//)?(([\d\w]|%[a-fA-f\d]{2,2})+(:([\d\w]|%[a-fA-f\d]{2,2})+)?@)?([\d\w][-\d\w]{0,253}[\d\w]\.)+[\w]{2,4}(:[\d]+)?(/([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)*(\?(&?([-+_~.\d\w]|%[a-fA-f\d]{2,2})=?)*)?(#([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)?"
```
Message = "Invalid Url"
## View
```
<div class="editor-label">
<%: Html.LabelFor(model => model.Url) %>
</div>
<div class="editor-field">
<%: Html.TextBoxFor(model => model.Url) %>
<%: Html.ValidationMessageFor(model => model.Url) %>
</div>
```
Result With URL = `http://www.chicagoshakes.com/main.taf?p=7,8`

## Passing Unit Test
```
[Test]
public void GetVarUrlPasses()
{
var url = "http://www.chicagoshakes.com/main.taf?p=7,8";
var regex = new Regex(UrlValidation.Regex);
Assert.IsTrue(regex.IsMatch(url));
}
```
Does anyone have any idea why this is passing the unit test, but failing when I test the view in a browser?
| ASP.NET MVC 2 client-side validation triggering incorrectly | CC BY-SA 2.5 | null | 2010-11-30T21:22:50.220 | 2011-01-03T01:08:25.573 | 2010-12-01T00:38:12.370 | 20,938 | 72,838 | [
"c#",
"regex",
"asp.net-mvc-2",
"data-annotations",
"validation"
] |
4,318,807 | 1 | null | null | 2 | 1,276 | I am trying to make a GUI that looks something like this: 
I only know how to use the BorderLayout which has space for 5 buttons. North, West, Center, East, and South.
Since I need to have 6 components on the top line, this approach can't work. I'm not sure how to make it so that I can have more than 1 component on the top line. Are there other layouts that I can use or is there some way I can manipulate BorderLayout so that I can put 6 components on the top line?
| Question about making a JAVA GUI of a certain format | CC BY-SA 2.5 | null | 2010-11-30T21:23:38.493 | 2010-11-30T22:46:52.200 | 2010-11-30T21:29:32.003 | 488,830 | 525,750 | [
"java",
"user-interface",
"swing",
"components",
"panel"
] |
4,318,837 | 1 | 4,686,031 | null | 2 | 8,139 | How do I add a combination button/dropdown in office (see below). Preferably with code.

If it helps any, code isn't needed.
| Combination button/dropdown in office | CC BY-SA 2.5 | null | 2010-11-30T21:26:16.763 | 2011-01-13T22:24:38.603 | 2010-12-02T18:09:05.687 | 258,482 | 258,482 | [
"ms-office",
"office-2003"
] |
4,319,031 | 1 | 4,364,974 | null | 24 | 13,477 | I have a simple TextBlock defined like this
```
<StackPanel>
<Border Width="106"
Height="25"
Margin="6"
BorderBrush="Black"
BorderThickness="1"
HorizontalAlignment="Left">
<TextBlock Name="myTextBlock"
TextTrimming="CharacterEllipsis"
Text="TextBlock: Displayed text"/>
</Border>
</StackPanel>
```
Which outputs like this

This will get me "TextBlock: Displayed text"
```
string text = myTextBlock.Text;
```
But is there a way to get the text that's actually displayed on the screen?
Meaning "TextBlock: Display..."
Thanks
| Get Displayed Text from TextBlock | CC BY-SA 3.0 | 0 | 2010-11-30T21:47:54.737 | 2014-01-14T18:17:29.667 | 2011-08-29T19:48:44.167 | 318,425 | 318,425 | [
"wpf",
"text",
"textblock",
"texttrimming"
] |
4,319,351 | 1 | 4,319,552 | null | 0 | 1,640 | I'm currently working on a XNA game prototype. I'm trying to achieve a isometric view of the game world (or is it othographic?? I'm not sure which is the right term for this projection - see pictures).
The world should a tile-based world made of cubic tiles (e.g. similar to Minecraft's world), and I'm trying to render it in 2D by using sprites.
So I have a sprite sheet with the top face of the cube, the front face and the side (visible side) face. I draw the tiles using 3 separate calls to drawSprite, one for the top, one for the side, one for the front, using a source rectangle to pick the face I want to draw and a destination rectangle to set the position on the screen according to a formula to convert from 3D world coordinates to isometric (orthographic?).
(sample sprite:
)
This works good as long as I draw the faces, but if I try to draw fine edges of each block (as per a tile grid) I can see that I get a random rendering pattern in which some lines are overwritten by the face itself and some are not.
Please note that for my world representation, X is left to right, Y is inside screen to outside screen, and Z is up to down.
In this example I'm working only with top face-edges. Here is what I get (picture):

I don't understand why some of the lines are shown and some are not.
The rendering code I use is (note in this example I'm only drawing the topmost layers in each dimension):
```
/// <summary>
/// Draws the world
/// </summary>
/// <param name="spriteBatch"></param>
public void draw(SpriteBatch spriteBatch)
{
Texture2D tex = null;
// DRAW TILES
for (int z = numBlocks - 1; z >= 0; z--)
{
for (int y = 0; y < numBlocks; y++)
{
for (int x = numBlocks - 1; x >=0 ; x--)
{
myTextures.TryGetValue(myBlockManager.getBlockAt(x, y, z), out tex);
if (tex != null)
{
// TOP FACE
if (z == 0)
{
drawTop(spriteBatch, x, y, z, tex);
drawTop(spriteBatch, x, y, z, outlineTexture);
}
// FRONT FACE
if(y == numBlocks -1)
drawFront(spriteBatch, x, y, z, tex);
// SIDE FACE
if(x == 0)
drawSide(spriteBatch, x, y, z, tex);
}
}
}
}
}
private void drawTop(SpriteBatch spriteBatch, int x, int y, int z, Texture2D tex)
{
int pX = OffsetX + (int)(x * TEXTURE_TOP_X_OFFRIGHT + y * TEXTURE_SIDE_X);
int pY = OffsetY + (int)(y * TEXTURE_TOP_Y + z * TEXTURE_FRONT_Y);
topDestRect.X = pX;
topDestRect.Y = pY;
spriteBatch.Draw(tex, topDestRect, TEXTURE_TOP_RECT, Color.White);
}
```
I tried using a different approach, creating a second 3-tiers nested for loop after the first one, so I keep the top face drawing in the first loop and the edge highlight in the second loop (I know, this is inefficient, I should also probably avoid having a method call for each tile to draw it, but I'm just trying to get it working for now).
The results are somehow better but still not working as expected, top rows are missing, see picture:

Any idea of why I'm having this problem? In the first approach it might be a sort of z-fighting, but I'm drawing sprites in a precise order so shouldn't they overwrite what's already there?
Thanks everyone
| XNA isometric tiles rendering issue | CC BY-SA 2.5 | null | 2010-11-30T22:26:41.280 | 2010-11-30T22:53:17.143 | null | null | 412,927 | [
"xna",
"tiles",
"sprite",
"isometric"
] |
4,319,396 | 1 | null | null | 0 | 178 | When going to [http://localhost/](http://localhost/) on my personal machine, I get a blank screen.
I have a site at `C:/inetpub/wwwroot/` but the contents of that folder aren't listed like they should be.
I tried going directly for the site, and I got this error:

Line 16 is the error
```
15: <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
16: <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
17: <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
```
Removing the line from the Web.config doesn't seem to help. The error persists and even claims the line wasn't removed. I made sure I saved my edit.
I then tried making a Virtual Directory and going there. The exact same error showed up.
I added the proper user with the needed rights, but that didn't seem to do anything.

So there are 2 problems here: Localhost won't list folders and this error I keep getting.
Can anyone tell me what I might be doing wrong?
EDIT: code added
| Cannot read ASP localhost, plus problems with virtual directories | CC BY-SA 2.5 | 0 | 2010-11-30T22:32:45.553 | 2010-12-05T20:50:25.763 | 2010-12-02T10:14:53.090 | 80,907 | 80,907 | [
"asp.net",
"web-config",
"localhost"
] |
4,319,561 | 1 | 4,319,665 | null | 3 | 2,028 | I was tasked as a homework assignment to make a task tracker. I wanted to learn entity framework for this assignment, especially how to use the inheritance aspects. Projects, tasks and sub-tasks all have a lot of similar properties, so I thought I would use inheritance, but can't figure out how to query particular projects.
I drew this diagram in Visual Studio:

I then created the database from this model. How can I get an Employees Projects?
I've started with this:
```
ModelContainer m = new ModelContainer();
var employee = (from e in m.Employees
where e.UserName == username
select e).First<Employee>();
```
But `((Employee)employee).Projects` is not available, but `((Employee)employee).Items` is. `((Employee)employee).Items.Projects` is also not available. How do I get an Employee's projects? Should I add a to Employees for this?
| Entity Framework - Querying Inheritance | CC BY-SA 2.5 | null | 2010-11-30T22:54:25.477 | 2010-11-30T23:16:07.387 | null | null | 143,739 | [
".net",
"entity-framework",
"inheritance",
"navigation-properties"
] |
4,319,677 | 1 | 4,319,750 | null | 0 | 1,906 | Now I've see various ways to accomplish this effect:

I used to accomplish this with a table, but I've since decided not to use tables like that. What's the best way to do this? Keeping in mind that there's a right border...
| CSS: Sidebar with folded header ribbon | CC BY-SA 2.5 | null | 2010-11-30T23:11:12.213 | 2013-07-18T13:50:50.393 | 2013-07-18T13:50:50.393 | null | 337,806 | [
"html",
"css"
] |
4,319,873 | 1 | 4,427,621 | null | 15 | 11,434 | Recently uninstalled and reinstalled eclipse with android sdk. Now I don't see the properties tab in the layout resource editor.
Suggestions?
Update: This is all I see in "window > open perspective > other"

| No properties tab in layout resource editor | CC BY-SA 2.5 | 0 | 2010-11-30T23:43:41.667 | 2010-12-13T09:56:04.143 | 2010-12-01T03:20:08.170 | 479,180 | 479,180 | [
"android",
"eclipse"
] |
4,320,021 | 1 | 22,412,921 | null | 179 | 220,544 | I am plotting two similar trajectories in matplotlib and I'd like to plot each of the lines with partial transparency so that the red (plotted second) doesn't obscure the blue.

: Here's the image with transparent lines.

| Matplotlib transparent line plots | CC BY-SA 2.5 | 0 | 2010-12-01T00:05:16.380 | 2019-08-14T19:44:33.833 | 2019-08-14T19:44:33.833 | 353,337 | 415,404 | [
"python",
"matplotlib"
] |
4,320,183 | 1 | 4,402,255 | null | 0 | 7,465 | just started today understanding relations between ms access databases. Can anyone figure out why this isnt working?
I can explain a lot in my way, but I think that the pictures says more then 1000 words




| ms-access: Why isn't this relationship not working? | CC BY-SA 2.5 | null | 2010-12-01T00:35:04.990 | 2010-12-09T19:31:22.247 | null | null | 156,875 | [
"database",
"ms-access",
"relational-database"
] |
4,320,372 | 1 | 4,320,432 | null | 7 | 3,196 | When my app moves to the background while either playing audio or recording audio, I would like to provide something like the the green "In Call" status bar that appears when you are in a call and swap out to another app, giving you a quick "return to app" capability.
I thought this might be a private API, but I noticed the Griffin iTalk app does this when it is recording audio (see picture) - so I know it can be done, but I have not been able to figure out what the API is (the `Info.plist` setting, the `AVAudioSession`, the `UIApplication/Delegate` or the whatever) to make this magic happen. My app is currently working and recording audio in the background and works just fine, I assume there is some bit somewhere I'm not setting to get this behavior.
Can someone either point me to the right docs or sample code that exhibits this behavior? (I've scoured the [Audio docs](http://developer.apple.com/library/ios/#documentation/AudioVideo/Conceptual/MultimediaPG/UsingAudio/UsingAudio.html) and haven't been able to find it).
Thanks!

| How to create a "return to app" status bar when app goes to the background? | CC BY-SA 2.5 | 0 | 2010-12-01T01:10:42.510 | 2011-07-18T19:04:38.530 | null | null | 251,299 | [
"iphone",
"cocoa-touch",
"audio",
"recording",
"uistatusbar"
] |
4,320,409 | 1 | 4,327,196 | null | 12 | 4,623 | I'm attempting to create a framework for allowing controllers and views to be dynamically imported into an MVC application. Here's how it works so far:
- - - `BuildManager.AddReferencedAssembly`- - -
Everything works so far for views using a strongly typed model. Views that use the dynamic model work fine, but when I specify a model type using `@model`, I get a YSOD that says "The view 'Index' or its master was not found".
When debugging my ViewEngine implementation, I can see that:
`this.VirtualPathProvider.FileExists(String.Format(this.ViewLocationFormats[2], viewName, controllerContext.RouteData.GetRequiredString("controller")))` returns true, while
`this.FileExists(controllerContext, String.Format(this.ViewLocationFormats[2], viewName, controllerContext.RouteData.GetRequiredString("controller")))` returns false.
Looking in Reflector, the RazorViewEngine implementation of `FileExists()` ultimately winds up doing this:
```
return (BuildManager.GetObjectFactory(virtualPath, false) != null);
```
However, I can't view `BuildManager.GetObjectFactory()` from Reflector because it's hidden somehow.
I'm suspecting that it has something to do with the fact that the model type is a type that is loaded from MEF, but since I'm already referencing the assemblies discovered by MEF from BuildManager, I'm out of leads. Can anyone provide a little more insight into what might be going on?
---
Turns out I was using an outdated version of Reflector from before .NET 4. I can see GetObjectFactory() now, but I can't really seem to find anything helpful. I've tried adding this into my FindView() overload:
try
{
var path = String.Format(this.ViewLocationFormats[2], viewName, controllerContext.RouteData.GetRequiredString("controller"));
var objFactory = System.Web.Compilation.BuildManager.GetObjectFactory(virtualPath: path, throwIfNotFound: true);
}
catch
{
}
Unfortunately, `objFactory` ends up null, and no exception gets thrown. All the bits that deal with compilation errors are part of private methods or types so I can't debug any of that, but it even seems like they'd end up throwing an exception, which doesn't seem to be happening. Looks like I'm at a dead end again. Help!
---
I've discovered that at the point where FindView() is being called, if I call `AppDomain.CurrentDomain.GetAssemblies()`, the assembly that the model type is in included. However, I cannot load the type using `Type.GetType()`.
---
Here's what I'm seeing:

---
---
Here's the ViewEngine implementation:
```
using System;
using System.Linq;
using System.Web.Mvc;
using System.Web.Hosting;
using System.Web.Compilation;
namespace Site.Admin.Portal
{
public class ModuleViewEngine : RazorViewEngine
{
private static readonly String[] viewLocationFormats = new String[]
{
"~/Views/{0}/{{1}}/{{0}}.aspx",
"~/Views/{0}/{{1}}/{{0}}.ascx",
"~/Views/{0}/{{1}}/{{0}}.cshtml",
"~/Views/{0}/Shared/{{0}}.aspx",
"~/Views/{0}/Shared/{{0}}.ascx",
"~/Views/{0}/Shared/{{0}}.cshtml"
};
public ModuleViewEngine(IModule module)
{
this.Module = module;
var formats = viewLocationFormats.Select(f => String.Format(f, module.Name)).ToArray();
this.ViewLocationFormats = formats;
this.PartialViewLocationFormats = formats;
this.AreaViewLocationFormats = formats;
this.AreaPartialViewLocationFormats = formats;
this.AreaMasterLocationFormats = formats;
}
public IModule Module { get; private set; }
public override ViewEngineResult FindPartialView(ControllerContext controllerContext, String partialViewName, Boolean useCache)
{
var moduleName = controllerContext.RouteData.GetRequiredString("module");
if (moduleName.Equals(this.Module.Name, StringComparison.InvariantCultureIgnoreCase))
{
return base.FindPartialView(controllerContext, partialViewName, useCache);
}
else return new ViewEngineResult(new String[0]);
}
public override ViewEngineResult FindView(ControllerContext controllerContext, String viewName, String masterName, Boolean useCache)
{
var moduleName = controllerContext.RouteData.GetRequiredString("module");
if (moduleName.Equals(this.Module.Name, StringComparison.InvariantCultureIgnoreCase))
{
var baseResult = base.FindView(controllerContext, viewName, masterName, useCache);
return baseResult;
}
else return new ViewEngineResult(new String[0]);
}
}
}
```
| ASP.NET MVC: Views using a model type that is loaded by MEF can't be found by the view engine | CC BY-SA 2.5 | 0 | 2010-12-01T01:20:04.163 | 2011-02-11T21:05:35.277 | 2011-02-11T21:05:35.277 | 2,596 | 2,596 | [
"c#",
"asp.net-mvc",
"razor",
"mef"
] |
4,320,515 | 1 | 4,320,592 | null | 3 | 6,034 | I have 2 embedded Matlab functions which I am using to create a Simulink model. Both functions use the output of the second function as their input. I am getting an error at the moment indicating that this is an invalid loop.
Does anyone know how to implement this type of behaviour?

| How can the output of a Simulink block be fed back as an input? | CC BY-SA 3.0 | null | 2010-12-01T01:46:05.903 | 2013-03-06T21:18:41.213 | 2013-03-06T21:18:41.213 | 2,138,062 | 399,772 | [
"matlab",
"simulink"
] |
4,321,390 | 1 | 4,322,020 | null | 4 | 8,987 | I've seen a dropdown-like button on many apps, including Turf Wars, that simulates a dropdown with a picker.
I need to use the same functionality in my app, but I'm not too sure what the best way to go about it may be.
Example:

I figured I could make two images and set them as a UIButtons background image for the different states and have the button open a pickerview.
Any input would be appreciated.
Rod
| How to make an iPhone dropdown-looking button | CC BY-SA 2.5 | 0 | 2010-12-01T05:11:39.397 | 2013-12-19T10:18:10.993 | 2017-02-08T14:31:07.317 | -1 | 427,315 | [
"iphone",
"objective-c",
"uibutton"
] |
4,321,629 | 1 | 4,322,238 | null | 0 | 1,219 | I need to create a button programmatically just like in the image

I know that this is a destructive button in UIActionSheet. Is there any way to use distructive button as a UIButton ?
Thanks,
Tariq
| Delete Destructive Button like in UIActionSheet | CC BY-SA 2.5 | null | 2010-12-01T05:57:25.463 | 2010-12-01T11:29:05.183 | 2010-12-01T06:00:51.483 | 220,819 | 213,532 | [
"iphone",
"uibutton",
"uiactionsheet"
] |
4,321,881 | 1 | 4,321,895 | null | 4 | 112 | Currently, my DIVS are laid out like this. It's basic `float:left`. Easy

But what if I want to turn some of those square DIVs into one that is twice as wide/long? They will be randomly selected, of course. How would I generate the HTML/javascript and do this?

What's the math behind this? Will `float:left` still work?
Can someone please give a good example of how this can be achieved easily?
| How do I lay my DIVs in a unique grid? | CC BY-SA 3.0 | 0 | 2010-12-01T06:45:44.123 | 2011-12-15T23:38:43.350 | 2011-12-15T23:38:43.350 | 84,042 | 179,736 | [
"javascript",
"jquery",
"html",
"css",
"algorithm"
] |
4,321,856 | 1 | null | null | 1 | 1,453 | We are having a problem with HTML buttons in the Android browser stealing touch events from the surrounding area. It seems like the browser, or the native UI, gives HTML buttons a larger click area than the size of the button displayed on the screen and the button steals touch events that should be captured by nearby areas. The problem occurs on the Android emulator as well as the various hardware platforms. Here's an example web page:
Below, div1 is the top darker rectangle (with the text) and div2 is the bottom lighter
rectangle (with the button).
- - - -

Here is another example using the same page.
- - - -

We have examined the source code for Android and the Android Browser(including webkit) looking for
an explanation for this behavior, but haven't found it. We've also been searching the web for anyone
else reporting this problem and have not found any mention of it!
We are looking for some type of hint that might help us here...
Perhaps a meta tag for the fuzzy-focus? Or a CSS style that would reduce this click-stealing behavior?
Any ideas would be much appreciated, this characteristic makes our web app very frustrating to use.
Here is the code for the page:
```
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" >
<meta name="viewport" content="width=device-width" >
<title>Android click target test</title>
<script type="text/javascript" charset="utf-8">
var div1;
var div2;
var button1;
// OnLoad, install event listeners for touch events, synthesized mouse events, and click events
function doLoad(e) {
div1 = document.getElementById('div1');
div2 = document.getElementById('div2');
button1 = document.getElementById('button1');
messages = document.getElementById('messages');
div1.addEventListener("touchstart", touch_emsg, false);
div1.addEventListener("touchend", touch_emsg, false);
div1.addEventListener("mousedown", emsg, false);
div1.addEventListener("mouseup", emsg, false);
div1.addEventListener("mouseover", emsg, false);
div1.addEventListener("mouseout", emsg, false);
div1.addEventListener("click", emsg, false);
div2.addEventListener("touchstart", touch_emsg, false);
div2.addEventListener("touchend", touch_emsg, false);
div2.addEventListener("mousedown", emsg, false);
div2.addEventListener("mouseup", emsg, false);
div2.addEventListener("mouseover", emsg, false);
div2.addEventListener("mouseout", emsg, false);
div2.addEventListener("click", emsg, false);
button1.addEventListener("touchstart", touch_emsg, false);
button1.addEventListener("touchend", touch_emsg, false);
button1.addEventListener("mousedown", emsg, false);
button1.addEventListener("mouseup", emsg, false);
button1.addEventListener("mouseover", emsg, false);
button1.addEventListener("mouseout", emsg, false);
button1.addEventListener("click", emsg, false);
}
// Messages ring-buffer
var messages;
var lines = 0;
function emsg(e) {
text = "";
text += e.type + "(" + ((e.clientX==undefined)?"?":e.clientX) + "," + ((e.clientY==undefined)?"?":e.clientY) + ")";
if (e.target.id != undefined) {text += " " + e.target.id;}
if (e.currentTarget != undefined && e.currentTarget.id != undefined) {text += "::" + e.currentTarget.id;}
msg(text);
}
function touch_emsg(e) {
if (e.targetTouches != undefined) {
var touch = e.targetTouches[0];
}
text = "";
text += e.type;
if (touch != undefined) {text += "(" + ((touch.clientX==undefined)?"?":touch.clientX) + "," + ((touch.clientY==undefined)?"?":touch.clientY) + ")";}
if (e.target.id != undefined) {text += " " + e.target.id;}
if (e.currentTarget != undefined && e.currentTarget.id != undefined) {text += "::" + e.currentTarget.id;}
msg(text);
}
function msg(text) {
lines++;
if (lines > 15) {clearmsg();}
messages.innerHTML += "<br/>" + " " + text;
}
function clearmsg() {
lines = 0;
messages.innerHTML = "";
}
</script>
</head>
<body onload="doLoad()">
<div id="div1" style="position: absolute; left: 0px; top: 0px; width: 200px; height: 30px; background-color:#c0c0c0; z-index:1;">
div1 text
</div>
<div id="div2" style="position: absolute; left: 0px; top: 30px; width: 200px; height: 40px; background-color:#f0f0f0; z-index:2;">
<button id="button1"> button 1 </button>
</div>
<button id="clearbutton" style="float:right;" onclick="clearmsg();">Clear</button>
<div id="messages" style="position:relative; top:65px; background-color:#aaaaff"></div>
</body>
```
| Touchable area of HTML buttons is too large in Android browser | CC BY-SA 2.5 | null | 2010-12-01T06:39:45.470 | 2019-08-15T21:35:08.177 | 2019-08-15T21:35:08.177 | 4,370,109 | 343,489 | [
"android",
"html",
"button",
"touch",
"dom-events"
] |
4,321,893 | 1 | 4,325,451 | null | 2 | 2,135 | Py2exe seems to run fine although it does mention that a few modules maybe missing.
I had been using the windows option (in my py2exe script) to remove the console window but realized that the process still remained open even after I closed down the gui window i.e. I could still see the process still in task manager... So I switched to using the console option and found the below error printed there. I believe this error is preventing the the app from closing. Apart from that the app runs fine.
Iv tried creating an exe from a very simple wxPython GUI app but even then I still get this error however I have no problem creating executables from apps that do not include wxPython.
```
Debug: src/helpers.cpp(140): 'createActCtx' failed with error 0x0000007b (the filename, directory name, or volume label syntax is incorrect.).)
```

> Python: 2.6.6wxPython: 2.8.11.0Windows 7 py2exe: 0.6.9
```
# -*- coding: utf-8 -*-
from distutils.core import setup
import py2exe
import glob
excludes = ['_gtkagg', '_tkagg', 'bsddb', 'curses', 'email', 'pywin.debugger',
'pywin.debugger.dbgcon', 'pywin.dialogs', 'tcl',
'Tkconstants', 'Tkinter']
dll_excludes = ['libgdk-win32-2.0-0.dll', 'libgobject-2.0-0.dll', 'tcl84.dll', 'tk84.dll',]#'msvcp90.dll']
packages = []#'wx.lib.pubsub']
data_files = [("resources", ['resources/1187958_90214884.jpg'])]
packages = ['wx.lib.pubsub',]
options = {'py2exe': {'compressed': 3,
'optimize': 2,
'excludes': excludes,
'packages': packages,
'dll_excludes': dll_excludes,
'bundle_files': 1,
'dist_dir': 'dist',
'xref': False,
'skip_archive': False,
'ascii': False,
'packages': packages,
'custom_boot_script': '',
}
}
#windows=[{'script':'gui.py'}]
for script in ["gui.py"]:
windows=[{
'script':[script]
}]
setup(options=options, console=[script], zipfile=None, data_files=data_files)
```
| Error after creating exe with Py2exe | CC BY-SA 2.5 | null | 2010-12-01T06:48:47.793 | 2010-12-01T14:39:00.760 | 2010-12-01T12:54:33.760 | 252,701 | 252,701 | [
"python",
"wxpython",
"py2exe"
] |
4,322,025 | 1 | 4,322,540 | null | 0 | 407 | I have a drop down list and I have a footer, when I pull down the drop down list... the footer always is in front of the list blocking the view, how can I eliminate this:

My css for the footer is:
```
#footer {
height:45px;
padding:10px 0;
position:relative;
}
#footer .inner {
position:relative;
z-index:2;
}
#ie6 #footer .inner {
}
#footer .bg {
background:url("http://jqueryui.com/images/footer_bg.png") no-repeat scroll left top transparent;
height:65px;
left:0;
position:absolute;
top:0;
width:100%;
z-index:1;
}
#ie6 #footer .bg {
background:none repeat scroll 0 0 transparent;
}
#footer p {
color:#5E5E5E;
font:9px 'Arial','Helvetica',sans-serif;
margin:0;
padding:0;
text-transform:uppercase;
}
#footer p a {
color:#BBBBBB;
}
#footer span.first {
display:block;
float:left;
padding:6px 0 0 16px;
}
#footer .block {
display:block;
float:left;
}
#footer .block span, #footer span.empty {
display:none;
}
#footer .liferay {
background:url("http://jqueryui.com/images/icon_liferay.gif") repeat scroll 0 0 transparent;
border:0 none;
height:22px;
margin:3px 10px 0;
width:98px;
}
#footer .filamentgroup {
background:url("../images/oracle.png") ;
border:0 none;
height:18px;
margin:3px 22px 0 3px;
width:90px;
}
```
and here's the actual footer code:
| CSS, drop down and transparency problem | CC BY-SA 2.5 | null | 2010-12-01T07:10:41.783 | 2010-12-01T08:42:45.337 | 2010-12-01T08:40:44.963 | 75,642 | 95,265 | [
"html",
"css"
] |
4,322,088 | 1 | 4,324,612 | null | 0 | 5,165 | I am having problems trying to get the user's current position to display on an MKMapView. Here is the relevant code:
```
// ParkingMapViewController.m
#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>
@interface ParkingMapViewController : UIViewController <MKMapViewDelegate, CLLocationManagerDelegate> {
MKMapView *mapView;
CLLocationManager *locationManager;
}
@property (nonatomic, retain) IBOutlet MKMapView *mapView;
@property (nonatomic, retain) CLLocationManager *locationManager;
-(void)loadAnnotations;
-(void)showCurrentLocationButtonTapped:(id)sender;
@end
```
```
// ParkingMapViewController.m
- (void)viewDidLoad {
[super viewDidLoad];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:100 target:self action:@selector(showCurrentLocationButtonTapped:)];
[self loadAnnotations];
CLLocationCoordinate2D centerCoord = { UCD_LATITUDE, UCD_LONGITUDE };
[mapView setCenterCoordinate:centerCoord zoomLevel:13 animated:NO]; //from "MKMapView+ZoomLevel.h"
}
- (void)showCurrentLocationButtonTapped:(id)sender {
NSLog(@"Showing current location.");
//[self.mapView setShowsUserLocation:YES];
//mapView.showsUserLocation = YES;
//[sender setEnabled:NO]; //TODO: Uncomment and test
locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
locationManager.distanceFilter = kCLDistanceFilterNone; // whenever we move
locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters; // 100 m
[locationManager startUpdatingLocation];
}
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation {
[mapView setCenterCoordinate:newLocation.coordinate];
if ([mapView showsUserLocation] == NO) {
[mapView setShowsUserLocation:YES];//when this line is commented, there is no problem
}
[mapView setCenterCoordinate:newLocation.coordinate zoomLevel:13 animated:YES];
}
- (void)viewDidUnload {
[super viewDidUnload];
[mapView setShowsUserLocation:NO];
}
- (void)dealloc {
[locationManager release];
[mapView release];
[super dealloc];
}
```
When running the application, the map view displays just fine with the annotations and everything, but when the current location button is pressed, the map re-centers to its new location(slight move) and a fraction of a second later, it crashes. When I comment out `[mapView setShowsUserLocation:YES];` there is no problem, but otherwise it spits out this error in the console:
```
2010-11-30 22:57:20.657 Parking[53430:207] -[MKUserLocation annotationType]: unrecognized selector sent to instance 0x78427f0
2010-11-30 22:57:20.659 Parking[53430:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MKUserLocation annotationType]: unrecognized selector sent to instance 0x78427f0'
*** Call stack at first throw:
(
0 CoreFoundation 0x0266ab99 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x027ba40e objc_exception_throw + 47
2 CoreFoundation 0x0266c6ab -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x025dc2b6 ___forwarding___ + 966
4 CoreFoundation 0x025dbe72 _CF_forwarding_prep_0 + 50
5 Parking 0x00003ddb -[ParkingMapViewController mapView:viewForAnnotation:] + 64
6 MapKit 0x023a8130 -[MKAnnotationContainerView _addViewForAnnotation:] + 175
7 MapKit 0x023a2b2a -[MKAnnotationContainerView _addViewsForAnnotations:animated:] + 251
8 MapKit 0x0239e657 -[MKAnnotationContainerView showAddedAnnotationsAnimated:] + 137
9 MapKit 0x0237837c -[MKMapView _showAddedAnnotationsAndRouteAnimated:] + 102
10 MapKit 0x02376a88 -[MKMapViewInternal delayedShowAddedAnnotationsAnimated] + 191
11 Foundation 0x000571c9 __NSFireTimer + 125
12 CoreFoundation 0x0264bf73 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 19
13 CoreFoundation 0x0264d5b4 __CFRunLoopDoTimer + 1364
14 CoreFoundation 0x025a9dd9 __CFRunLoopRun + 1817
15 CoreFoundation 0x025a9350 CFRunLoopRunSpecific + 208
16 CoreFoundation 0x025a9271 CFRunLoopRunInMode + 97
17 GraphicsServices 0x02f4900c GSEventRunModal + 217
18 GraphicsServices 0x02f490d1 GSEventRun + 115
19 UIKit 0x002cfaf2 UIApplicationMain + 1160
20 Parking 0x000020e0 main + 102
21 Parking 0x00002071 start + 53
)
terminate called after throwing an instance of 'NSException'
```
Googling has indicated that this is most likely an IB problem but I have not been able to spot it. Here is a screen of my set up in IB:

Any help whatsoever will be very much appreciated. Thanks!
| Problems Trying to Find User Location in MKMapView | CC BY-SA 2.5 | 0 | 2010-12-01T07:23:22.580 | 2013-05-10T10:42:23.947 | null | null | 347,339 | [
"ios",
"mkmapview",
"cllocationmanager"
] |
4,322,433 | 1 | 4,322,933 | null | 0 | 916 | i am disigning a calendar application.now i have populated the grid elements.but that grid layout also shows the dates of pervious month.how to disable a particular cell in grid layout? and also if possible let me know how to enable the grid lines?
some thing like this image:
| how to disable a element in gridlayout? | CC BY-SA 2.5 | null | 2010-12-01T08:25:41.060 | 2010-12-01T09:35:34.463 | null | null | 430,652 | [
"android",
"gridview",
"calendar",
"gridlines"
] |
4,322,457 | 1 | 4,322,487 | null | 1 | 784 | my gallery display my images but which image select i don't know how to differentiate selected image and other images.. i want to set border line in my image...now i am attach my screen shots help me....
my screenshot:

i expect this type of screen in my emulator:

```
package videothumb.videothumb;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.provider.MediaStore;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.Gallery;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;
import android.net.Uri;
import android.view.Window;
import android.view.WindowManager;
import android.graphics.Color;
public class videothumb extends Activity{
private final static Uri MEDIA_EXTERNAL_CONTENT_URI =
MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
private final static String _ID = MediaStore.Video.Media._ID;
private final static String MEDIA_DATA = MediaStore.Video.Media.DATA;
//flag for which one is used for images selection
private Gallery _gallery;
private Cursor _cursor;
private int _columnIndex;
private int[] _videosId;
private Uri _contentUri;
private int video_column_index;
//private static final int MENU_ID_ZOOM = 0;
protected Context _context;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
_context = getApplicationContext();
setContentView(R.layout.main);
//set GridView for gallery
_gallery = (Gallery) findViewById(R.id.videoGrdVw);
//set default as external/sdcard uri
_contentUri = MEDIA_EXTERNAL_CONTENT_URI;
//initialize the videos uri
//showToast(_contentUri.getPath());
initVideosId();
//set gallery adapter
setGalleryAdapter();
}
private void setGalleryAdapter() {
_gallery.setAdapter(new VideoGalleryAdapter(_context));
_gallery.setOnItemClickListener(videogridlistener);
}
private void initVideosId() {
try
{
//Here we set up a string array of the thumbnail ID column we want to get back
String [] proj={_ID};
// Now we create the cursor pointing to the external thumbnail store
_cursor = managedQuery(_contentUri,
proj, // Which columns to return
null, // WHERE clause; which rows to return (all rows)
null, // WHERE clause selection arguments (none)
null); // Order-by clause (ascending by name)
int count= _cursor.getCount();
System.out.println("total"+_cursor.getCount());
// We now get the column index of the thumbnail id
_columnIndex = _cursor.getColumnIndex(_ID);
//initialize
_videosId = new int[count];
//move position to first element
_cursor.moveToFirst();
for(int i=0;i<count;i++)
{
int id = _cursor.getInt(_columnIndex);
//
_videosId[i]= id;
//
_cursor.moveToNext();
//
}
}catch(Exception ex)
{
showToast(ex.getMessage().toString());
}
}
protected void showToast(String msg)
{
Toast.makeText(_context, msg, Toast.LENGTH_LONG).show();
}
private OnItemClickListener videogridlistener = new OnItemClickListener() {
public void onItemClick(AdapterView parent, View v, int position,
long id) {
// Now we want to actually get the data location of the file
String [] proj={MEDIA_DATA};
// We request our cursor again
_cursor = managedQuery(_contentUri,
proj, // Which columns to return
null, // WHERE clause; which rows to return (all rows)
null, // WHERE clause selection arguments (none)
null);
//System.gc();
// video_column_index =
_cursor.getColumnIndexOrThrow(MediaStore.Video.Media.DATA);
_columnIndex = _cursor.getColumnIndex(MEDIA_DATA);
// Lets move to the selected item in the cursor
_cursor.moveToPosition(position);
String filename = _cursor.getString(_columnIndex);
Intent intent = new Intent(videothumb.this, ViewVideo.class);
intent.putExtra("videofilename", filename);
startActivity(intent);
showToast(filename);
// Toast.makeText(videothumb.this, "" + position, Toast.LENGTH_SHORT).show();
}
};
private class VideoGalleryAdapter extends BaseAdapter
{
public VideoGalleryAdapter(Context c)
{
_context = c;
}
public int getCount()
{
return _videosId.length;
}
public Object getItem(int position)
{
return position;
}
public long getItemId(int position)
{
return position;
}
public View getView(int position, View convertView, ViewGroup parent)
{
ImageView imgVw= new ImageView(_context);
try
{
if(convertView!=null)
{
imgVw= (ImageView) convertView;
}
imgVw.setImageBitmap(getImage(_videosId[position]));
imgVw.setAdjustViewBounds(true);
//imgVw.draw(canvas);
//imgVw.setBackgroundColor(Color.BLACK);
imgVw.setLayoutParams(new Gallery.LayoutParams(150, 100));
imgVw.setPadding(5,5,5,5);
}
catch(Exception ex)
{
System.out.println("StartActivity:getView()-135: ex " + ex.getClass() +",
"+ ex.getMessage());
}
return imgVw;
}
// Create the thumbnail on the fly
private Bitmap getImage(int id) {
Bitmap thumb = MediaStore.Video.Thumbnails.getThumbnail(getContentResolver(),id,
MediaStore.Video.Thumbnails.MICRO_KIND, null);
System.out.println("ff"+MediaStore.Video.Thumbnails.getThumbnail
(getContentResolver(),
id, MediaStore.Video.Thumbnails.MICRO_KIND, null));
return thumb;
}
}
}
```

i am set background color....
| border not display in my images | CC BY-SA 2.5 | null | 2010-12-01T08:28:29.460 | 2010-12-01T09:27:02.533 | 2010-12-01T09:27:02.533 | 486,554 | 486,554 | [
"java",
"android",
"border"
] |
4,322,493 | 1 | 4,322,820 | null | 0 | 3,168 | I have this code
```
vector <int> a[100001];
a[1].push_back(1);
if( a[1][0] == 1)
cout<<"OK!";
```
But when I try to access a[1](https://i.stack.imgur.com/p79dG.png)[0] it says:
```
CXX0058: Error: overloaded operator not found
```
Full code:
```
#include<stdio.h>
#include<vector>
using namespace std;
FILE *f=fopen("chei.in","r");
FILE *g=fopen("chei.out","w");
int t[100001],N,x,nr,k,d;
vector <int> a[100001];
int main(){
fscanf(f,"%d",&N);
for(int i=1;i<=N;++i)
{ fscanf(f,"%d",&x);
for(k=0;k<a[i].size();++k){
if( a[i][k]== x)
break;}
if(k==0 || ( k==a[x].size() && a[i][k] == x )){
t[i]=x;
a[x].push_back(i);
}
}
for(int i=1;i<=N;i++){
if(t[i]==i || t[i]==0)
nr++;}
fprintf(g,"%d",nr);
return 0;
}
```
Here's a screenshot of the watch:

| Can't access vector element? | CC BY-SA 3.0 | 0 | 2010-12-01T08:34:36.297 | 2017-07-20T15:02:09.640 | 2017-07-20T15:02:09.640 | 1,033,581 | 407,650 | [
"c++",
"vector"
] |
4,322,579 | 1 | 4,322,614 | null | 3 | 2,786 | We have 2 computer. Fist computer's operating system is Linux( any version( not important for me) ) and another operating system is Windows( any version, i don't care). They are connected via 9 pin serial port.
I want to know how can I change Linux's default display output to serial port instead of it's own monitor. I want to view all Linux outputs( from first word of boot time ) via hyper terminal in Windows XP.

BTW it's just a research for future uses ! I know there is no easy solution for doing this. Maybe I should compile Linux again ! I don't know. Please give me some suggestions.
| How to pass display output to serial port under Linux? | CC BY-SA 2.5 | null | 2010-12-01T08:48:57.373 | 2010-12-01T08:54:59.143 | 2010-12-01T08:54:59.143 | 169,545 | 169,545 | [
"c++",
"c",
"linux",
"serial-port"
] |
4,322,788 | 1 | 4,322,824 | null | 1 | 555 | I made a .exe program in c# and locally works fine... but if I put the .exe into a remote path, when I launch, it gives error..
I use framework 2.0
how can I solve this?
thanks
edit:
this is the error:

and if I launch the program locally, it works fine ( I copied all the folder with directories...)
| c# launch .exe from a remote folder | CC BY-SA 2.5 | null | 2010-12-01T09:17:10.797 | 2010-12-01T10:04:22.053 | 2010-12-01T09:48:12.480 | 349,045 | 349,045 | [
"c#",
"networking"
] |
4,322,856 | 1 | 4,334,177 | null | 1 | 352 | I've got a 3rd party video capture control in my system ([LeadTools Capture control](http://leadtools.com/sdk/multimedia/capture.htm)), which is licensed and works perfectly in my Dev environment.
When it's deployed as a ClickOnce app, however, it bombs out with the following error:

What could the problem be, and how do you fix it?
| Licensing problem with ClickOnce application | CC BY-SA 2.5 | null | 2010-12-01T09:25:17.993 | 2010-12-02T10:56:36.680 | null | null | 7,850 | [
"deployment",
"licensing",
"clickonce"
] |
4,322,881 | 1 | 10,136,160 | null | 7 | 5,961 | I would like to create Design QR codes with Java.
Design QR codes may contain a logo in form of a graphic. Here's an example for such designed codes.

How to create such QR codes?
| How to create Design QR codes with Java? | CC BY-SA 3.0 | 0 | 2010-12-01T09:29:20.750 | 2022-03-31T07:15:59.367 | 2016-02-25T07:55:18.430 | 457,268 | 32,043 | [
"java",
"qr-code"
] |
4,322,994 | 1 | 4,328,734 | null | 3 | 2,078 | Damn you short titles! :p
Basically I have an entity named "threads" and I have an entity named "messages". I have a one to many relationship from threads ->> messages (and a one to one inverse relationship).
What I need to do is get all the records from the threads entity and for each one I need to get the message with the latest timestamp (this is just an int in the "lastUpdated" attribute, so the highest number I guess will suffice).
I'm not sure what other information you may want, here is a screenshot of my entities:

I'm sure there must be a better way than iterating through all the records and comparing the threadIds?
Thank you.
| CoreData - select specific entry from one to many relationship | CC BY-SA 2.5 | 0 | 2010-12-01T09:42:49.607 | 2010-12-01T20:24:41.863 | 2010-12-01T09:59:29.127 | 106,224 | 414,972 | [
"iphone",
"objective-c",
"core-data"
] |
4,323,093 | 1 | null | null | 2 | 291 | 
I am using web view in my activity. I am using an url to load the page.
The page contains text field which takes user-name and password as input from user.
When I click on nay of the field a corresponding small field is shown overlapping the other.
Here I am attaching image how it looks when i click password field..
can anybody tell me how to solve this?
Thanks.
| android webview showing two edit fields | CC BY-SA 2.5 | null | 2010-12-01T09:54:46.887 | 2013-04-10T16:31:50.050 | 2011-02-21T19:11:23.190 | 179,850 | 289,597 | [
"android"
] |
4,323,141 | 1 | null | null | 1 | 145 | I have created this Android layout:

This has a custom title bar and a TextView containing some sample text. The TextView is inside a ScrollView.
The 'start/stop' button is supposed to start and stop the text automatically scrolling.
I am using a Scroller object but I can't find a method to pause the scrolling. Does such a method exist or should I be using an alternative approach (and if so, what)?
| How do I pause autoscrolling of an Android application? | CC BY-SA 3.0 | 0 | 2010-12-01T10:03:02.053 | 2012-08-17T13:23:44.300 | 2012-08-17T13:23:44.300 | 4,023 | 395,661 | [
"java",
"android"
] |
4,323,151 | 1 | 4,323,254 | null | 1 | 1,130 | on the site I am currently developing I'm trying to cycle through a load of `<li>`'s, but at alternating times. For example:
1. To start off with I'd be showing the first two <li> items.
2. Item 1 would fade out.
3. Item 3 would fade in, in place of item 1.
4. Item 2 would fade out.
5. Item 4 would fade in, in place of item 2.
HTML:
```
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>
</ul>
```

Any idea how I can achieve this effect?
Thanks!
| jQuery - Cycle alternate <li>'s? | CC BY-SA 2.5 | 0 | 2010-12-01T10:04:40.260 | 2010-12-01T10:31:06.190 | 2010-12-01T10:10:24.327 | 39,992 | 229,558 | [
"jquery"
] |
4,323,153 | 1 | 4,324,361 | null | 0 | 1,029 | I have some custom A panels on a canvas, where there a also B panels, how can I A panels located the mouse cursor actually?
I know that this could be achieved with `VisualTreeHelper.HitTest`, but didn't have much chance, it returns always the elements on the custom panels or nothing at all...
this is my code
```
<UserControl x:Class="WpfApplication7.UserControl1">
<Grid>
<Label Content="Label" Height="44" HorizontalAlignment="Left" Name="label1" VerticalAlignment="Top" FontSize="20" FontWeight="Bold" Width="78" Background="#FF4B9FC4" BorderBrush="#FF020A0D" BorderThickness="1" />
</Grid>
</UserControl>
<Window x:Class="WpfApplication7.MainWindow"
PreviewMouseLeftButtonDown="Window_PreviewMouseLeftButtonDown" xmlns:my="clr-namespace:WpfApplication7">
<Grid>
<my:UserControl1 HorizontalAlignment="Left" Margin="82,88,0,0" x:Name="userControl11" VerticalAlignment="Top" />
<my:UserControl1 HorizontalAlignment="Left" Margin="168,166,0,0" x:Name="userControl12" VerticalAlignment="Top" />
<my:UserControl1 HorizontalAlignment="Left" Margin="231,130,0,0" x:Name="userControl13" VerticalAlignment="Top" />
</Grid>
</Window>
```
.cs
```
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
List<UserControl1> ucs = new List<UserControl1>();
private void Window_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
GetUcsCount(e);
Console.WriteLine("ucs.Count = {0}", ucs.Count);
}
private void GetUcsCount(MouseButtonEventArgs e)
{
ucs.Clear();
Point p = e.GetPosition(this);
VisualTreeHelper.HitTest(this, null,
new HitTestResultCallback(MyHitTestCallback),
new PointHitTestParameters(p));
}
HitTestResultBehavior MyHitTestCallback(HitTestResult result)
{
if (result.VisualHit.GetType() == typeof(UserControl1))
{
ucs.Add(result.VisualHit as UserControl1);
}
return HitTestResultBehavior.Continue;
}
}
```
the `result == 0` anywhere I click...

| count controls of type A under the mouse in WPF | CC BY-SA 2.5 | null | 2010-12-01T10:04:45.130 | 2010-12-01T14:37:11.533 | 2010-12-01T14:37:11.533 | 185,593 | 185,593 | [
".net",
"wpf",
"hittest"
] |
4,323,584 | 1 | 4,323,669 | null | 7 | 12,548 | 
See the SQL Statements indicated in this SQL Profiler view. All these events are coming from one Client machine that is busy with a long-running process, working through a couple thousand rows. Each processing of a row takes about 6.5 seconds, which is what the SQL Profiler is showing as the time between logouts, even though the actual update statement takes only 1ms. Each login/logout uses the same SPID. See that between any given Login and Logout event, the SQL Statements indicate a Reads count of 17 and a Writes count of 0.
Yet, the Logout event indicates a total Reads count in excess of 2million and a writes count in excess of 10k. What events do I need to be profiling to try to figure out what statement is causing those reads/writes, because I suspect that those are the ones causing the 6.5 second delay, yet I can't see them happening?
| Making sense of the number of reads/writes in SQL Profiler | CC BY-SA 2.5 | 0 | 2010-12-01T10:57:38.143 | 2010-12-01T11:12:14.360 | 2010-12-01T11:06:55.650 | 476,074 | 374,189 | [
"sql-server"
] |
4,323,619 | 1 | 4,323,671 | null | 9 | 5,620 | How can I those four RED points drawn in image

Those four points make that polygon a concave polygon that’s why I want to remove it.
My goal is to convert concave polygon to convex by removing this kind of point by identifying and removing those points.
Is there any way to identify and remove these kind of points?
| Concave and Convex Polygon - Turn arbitrary polygon into a convex polygon | CC BY-SA 4.0 | 0 | 2010-12-01T11:01:35.110 | 2020-03-31T17:31:13.067 | 2020-03-31T17:31:13.067 | 276,052 | 468,968 | [
"math"
] |
4,323,621 | 1 | null | null | 0 | 4,777 | I have a sunrays image. I like to put it on the background and make it rotate continuosly in a slow motion..
The image is this..

i've tried rotating it with CABasicAnimation, but it rotates the whole frame.. i want just the sunrays to revolve at the background not the whole frame..
Is there any way to do it???
Here is what m doing...please point out my mistakes... :(
i didn't got wat u've explained.. :(
here is what m doing...
```
- (void)viewDidLoad {
sunraysContainer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 1024, 768)];
sunraysContainer.clipsToBounds = YES;
[self.view addSubview:sunraysContainer];
sunrays = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 1024, 768)];
[sunrays setImage:[UIImage imageNamed:@"sunlight-background copy2.jpg"]];
[sunraysContainer addSubview:sunrays];
backgroundBuilding = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 1024, 768)];
[backgroundBuilding setImage:[UIImage imageNamed:@"hira-background_fade.png"]];
[sunraysContainer addSubview:backgroundBuilding];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:5];
CABasicAnimation *rotationAnimation;
rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
rotationAnimation.toValue = [NSNumber numberWithFloat:M_PI * 2.0 * 4.0];
rotationAnimation.duration = 1;
rotationAnimation.cumulative = YES;
rotationAnimation.repeatCount = 10;
rotationAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];
[sunrays.layer addAnimation:rotationAnimation forKey:@"rotationAnimation"];
[UIView commitAnimations];
}
```
Update...
I did what u said nacho...thanks for your reply,but m getting a blankscreen.. :(
i've coded dis...
```
sunrays = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"sunlight-background copy2.jpg"]];
UIView *container = [[UIView alloc] initWithFrame:CGRectMake(0,0,sunrays.frame.size.height,sunrays.frame.size.height)];
[container setClipsToBounds:YES];
[container addSubview:sunrays];
[sunrays setCenter:CGPointMake(container.bounds.size.width/2, container.bounds.size.height/2)];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:5];
CABasicAnimation *rotationAnimation;
rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
rotationAnimation.toValue = [NSNumber numberWithFloat:M_PI * 2.0 * 4.0];
rotationAnimation.duration = 1;
rotationAnimation.cumulative = YES;
rotationAnimation.repeatCount = 10;
rotationAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];
[sunrays.layer addAnimation:rotationAnimation forKey:@"rotationAnimation"];
[UIView commitAnimations];
```
what is wrong wid the code??
| Rotation Animation on UIImageView | CC BY-SA 3.0 | 0 | 2010-12-01T11:01:40.640 | 2017-12-15T16:43:16.233 | 2017-12-15T16:43:16.233 | 5,638,630 | 462,533 | [
"ios",
"iphone",
"animation",
"uiimageview",
"core-animation"
] |
4,324,096 | 1 | null | null | 0 | 573 | On the Joomla frontpage i want to have this kind of menu

Every item has a title and description and .
This list must be available for modification by administrator.
Is it possible to do it? I know how to modify menu to look like this, but standart menu doesn't support descriptions.
| joomla article list with descriptions | CC BY-SA 2.5 | null | 2010-12-01T11:58:27.887 | 2010-12-01T17:10:14.913 | null | null | 137,229 | [
"menu",
"joomla"
] |
4,324,099 | 1 | 4,324,199 | null | 0 | 1,939 | my textview display in emulator top..how to change into the bottom...
```
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/tv">
<TextView
android:text="EmbDes Technologies"
android:id="@+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ff000000"
android:textStyle="bold"
android:gravity="bottom"/>
<Gallery xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/videoGrdVw"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
</RelativeLayout>
```

| how to set textview in bottom | CC BY-SA 2.5 | null | 2010-12-01T11:59:04.397 | 2011-03-11T12:50:16.977 | 2010-12-01T12:25:36.607 | 486,554 | 486,554 | [
"java",
"android",
"textview"
] |
4,324,221 | 1 | null | null | 24 | 5,870 | I am trying to make a custom UI based on a `JWindow` for the purpose of selecting an area of the screen to be shared. I have extended `JWindow` and added code to make it resizable and to 'cut out' the centre of the window using `AWTUtilities.setWindowShape()`.
When running the code I am experiencing a flicker as the window is resized in negative x and y directions, i.e. up and left. What appears to be happening is that the window is resized and drawn before the components are updated. Below is a simplified version of the code. When run the top panel can be used to resize the window up and to the left. The background of the window is set to green to make it clear where the pixels I do not want showing are.
Improved the code to shape the window correctly using a `ComponentListener` and added a dummy component at bottom to further illustrate flicker (also updated screenshots).
```
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Rectangle;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.geom.Area;
import javax.swing.JPanel;
import javax.swing.JWindow;
import javax.swing.border.CompoundBorder;
import javax.swing.border.EmptyBorder;
import javax.swing.border.EtchedBorder;
import javax.swing.border.LineBorder;
import com.sun.awt.AWTUtilities;
public class FlickerWindow extends JWindow implements MouseListener, MouseMotionListener{
JPanel controlPanel;
JPanel outlinePanel;
int mouseX, mouseY;
Rectangle windowRect;
Rectangle cutoutRect;
Area windowArea;
public static void main(String[] args) {
FlickerWindow fw = new FlickerWindow();
}
public FlickerWindow() {
super();
setLayout(new BorderLayout());
setBounds(500, 500, 200, 200);
setBackground(Color.GREEN);
controlPanel = new JPanel();
controlPanel.setBackground(Color.GRAY);
controlPanel.setBorder(new EtchedBorder(EtchedBorder.LOWERED));
controlPanel.addMouseListener(this);
controlPanel.addMouseMotionListener(this);
outlinePanel = new JPanel();
outlinePanel.setBackground(Color.BLUE);
outlinePanel.setBorder(new CompoundBorder(new EmptyBorder(2,2,2,2), new LineBorder(Color.RED, 1)));
add(outlinePanel, BorderLayout.CENTER);
add(controlPanel, BorderLayout.NORTH);
add(new JButton("Dummy button"), BorderLayout.SOUTH);
setVisible(true);
setShape();
addComponentListener(new ComponentAdapter() {
@Override
public void componentResized(ComponentEvent e) {
setShape();
}});
}
public void paint(Graphics g) {
// un-comment or breakpoint here to see window updates more clearly
//try {Thread.sleep(10);} catch (Exception e) {}
super.paint(g);
}
public void setShape() {
Rectangle bounds = getBounds();
Rectangle outlineBounds = outlinePanel.getBounds();
Area newShape = new Area (new Rectangle(0, 0, bounds.width, bounds.height));
newShape.subtract(new Area(new Rectangle(3, outlineBounds.y + 3, outlineBounds.width - 6, outlineBounds.height - 6)));
setSize(bounds.width, bounds.height);
AWTUtilities.setWindowShape(this, newShape);
}
public void mouseDragged(MouseEvent e) {
int dx = e.getXOnScreen() - mouseX;
int dy = e.getYOnScreen() - mouseY;
Rectangle newBounds = getBounds();
newBounds.translate(dx, dy);
newBounds.width -= dx;
newBounds.height -= dy;
mouseX = e.getXOnScreen();
mouseY = e.getYOnScreen();
setBounds(newBounds);
}
public void mousePressed(MouseEvent e) {
mouseX = e.getXOnScreen();
mouseY = e.getYOnScreen();
}
public void mouseMoved(MouseEvent e) {}
public void mouseClicked(MouseEvent e) {}
public void mouseReleased(MouseEvent e) {}
public void mouseEntered(MouseEvent e) {}
public void mouseExited(MouseEvent e) {}
}
```
The overridden `paint()` method can be used as a breakpoint or the `Thread.sleep()` can be uncommented there to provide a clearer view of the update as it happens.
My problem seems to stem from the `setBounds()` method causing the window to be painted to the screen before being laid out.
---
Window before resizing, as it should look:

---
Window during resizing larger (up and left) as seen at breakpoint at overridden `paint()` method):

---
Window during resizing smaller (down and right) as seen at breakpoint at overridden `paint()` method):

---
Granted these screenshots are taken during aggressive mouse drag movements but the flicker becomes quite annoying even for more moderate mouse drags.
The green area on the resize to larger screenshot shows the new background that gets drawn before any painting/layout is done, it seems to happen in the underlying `ComponentPeer` or native window manager. The blue area on the 'resize to smaller' screenshot shows the `JPanel`'s background being pushed into view but is now out of date. This happens under Linux(Ubuntu) and Windows XP.
Has anyone found a way to cause a `Window` or `JWindow` to resize to a back buffer before any changes are made to the screen and thus avoid this flickering effect? Maybe there is a `java.awt....` system property that can be set to avoid this, I could not find one though.
---
Comment out the call to `AWTUtilities.setWindowShape()` (and optionally uncomment the `Thread.sleep(10)` line in `paint()`) then drag the top panel around aggressively in order to clearly see the nature of the flicker.
Is anyone able to test this behaviour under Sun Java on Windows 7 or Mac OSX ?
| How can a Swing JWindow be resized without flickering? | CC BY-SA 2.5 | 0 | 2010-12-01T12:12:08.370 | 2010-12-05T01:41:27.633 | 2010-12-02T08:55:36.763 | 283,553 | 283,553 | [
"java",
"swing",
"resize",
"flicker",
"jwindow"
] |
4,324,505 | 1 | 4,324,660 | null | 1 | 2,172 | I'm trying to get sum of some values by grouping and I'm stuck. This is the sample structure of my table:

What I want to get is:
The trick is that I need to display a zero or a null value if a user is in a project and the user doesn't have any work time yet.
Example result should be like this:
```
Username Project Total Time
User1 Project1 15
User1 Project2 --
User2 Project1 10
```
How can I accomplish this?
| Sum and Group By in Linq to Entities | CC BY-SA 2.5 | null | 2010-12-01T12:48:01.213 | 2010-12-01T13:49:39.583 | 2010-12-01T12:55:35.740 | 424,950 | 424,950 | [
".net",
"entity-framework",
".net-3.5"
] |
4,324,764 | 1 | 4,325,347 | null | 1 | 2,443 | I've added a button to a lower toolbar like this:
```
UIImage *locationImage = [UIImage imageNamed:@"193-location-arrow.png"];
UIBarButtonItem *locationButton = [[UIBarButtonItem alloc] initWithImage:locationImage style:UIBarButtonItemStyleBordered target:self action:@selector(updateCurrentLocation)];
NSArray *items = [[NSArray alloc] initWithObjects:locationButton,nil];
[toolbar setItems:items];
[items release];
[locationButton release];
```
This works great, the alpha of the image is picked up fine, the button displays like this:

So, I took this code and modified slightly to create a button in my navigation bar:
```
UIImage *favouriteImage = [UIImage imageNamed:@"28-star.png"];
UIBarButtonItem *favouriteButton = [[UIBarButtonItem alloc] initWithImage:favouriteImage style:UIBarButtonItemStyleBordered target:self action:nil];
self.navigationItem.rightBarButtonItem = favouriteButton;
[favouriteButton release];
```
The alpha doesn't seem to be picked up on this one - it looks greyed out:

Is there something I need to set when using custom images in the navigation bar?
Thanks and Regards,
Rich
| iPhone UIBarButtonItem alpha of button image | CC BY-SA 2.5 | 0 | 2010-12-01T13:23:27.120 | 2010-12-01T14:27:37.127 | null | null | 122,004 | [
"iphone",
"image",
"uibarbuttonitem",
"alpha"
] |
4,325,011 | 1 | 4,326,611 | null | 1 | 90 | Following a very interesing discussion with Bart Kiers [on parsing a noisy datastream with ANTLR](https://stackoverflow.com/questions/4310699/antlr-on-a-noisy-data-stream), I'm ending up with another problem...
The aim is still the same : only extracting useful information with the following grammar,
```
VERB : 'SLEEPING' | 'WALKING';
SUBJECT : 'CAT'|'DOG'|'BIRD';
INDIRECT_OBJECT : 'CAR'| 'SOFA';
ANY : . {skip();};
parse
: sentenceParts+ EOF
;
sentenceParts
: SUBJECT VERB INDIRECT_OBJECT
;
```
a sentence like `it's 10PM and the Lazy CAT is currently SLEEPING heavily on the SOFA in front of the TV.` will produce the following

This is perfect and it's doing exactly what I want.. from a big sentence, I'm extracting only the words that had a sense for me.... But the, I founded the following error. If somewhere in the text I'm introducing a word that begin exactly like a token, I'm ending up with a `MismathedTokenException` or a `noViableException`
produce an error :

`DOGGY` is interpreted as the beginning for `DOG` which is also a part of the TOKEN `SUBJECT` and the lexer is lost... How could I avoid this without defining `DOGGY` as a special token... I would have like the parser to understand `DOGGY` as a word in itself.
| ANTLR on a noisy data stream Part 2 | CC BY-SA 2.5 | null | 2010-12-01T13:51:10.003 | 2010-12-01T19:20:51.507 | 2017-05-23T12:13:26.330 | -1 | 462,384 | [
"antlr",
"grammar",
"noise-words"
] |
4,325,021 | 1 | 4,325,048 | null | 1 | 2,330 | I'm facing some locks at our DB server created by our application. What I don't understand is how a process that is Sleeping is having an Open Transaction (that process 71 is the one creating the Lock).
As far as I know when a process finishes it closes all the opened transactions. Is that rigth?
Thanks in advance mates.

| How can have a SQL connection that is sleeping a pending transaction? | CC BY-SA 2.5 | 0 | 2010-12-01T13:52:27.490 | 2010-12-01T13:58:29.707 | 2010-12-01T13:58:29.707 | 444,382 | 166,452 | [
"sql",
"sql-server",
"transactions",
"locking"
] |
4,325,151 | 1 | null | null | 30 | 158,694 | here's my code. It correctly adds the pictures I want and everything works that the images are using their native resolution, so if the image is big it's being cropped to fit the page.
Is there some way to have the picture use like a Zoom feature to stretch to fit, but also maintain the aspect ratio? There has to be something I'm missing there. :P
Here's a picture to illustrate the problem:

```
using System;
using System.IO;
using iTextSharp.text;
using iTextSharp.text.pdf;
using System.Drawing;
using System.Collections.Generic;
namespace WinformsPlayground
{
public class PDFWrapper
{
public void CreatePDF(List<System.Drawing.Image> images)
{
if (images.Count >= 1)
{
Document document = new Document(PageSize.LETTER);
try
{
// step 2:
// we create a writer that listens to the document
// and directs a PDF-stream to a file
PdfWriter.GetInstance(document, new FileStream("Chap0101.pdf", FileMode.Create));
// step 3: we open the document
document.Open();
foreach (var image in images)
{
iTextSharp.text.Image pic = iTextSharp.text.Image.GetInstance(image, System.Drawing.Imaging.ImageFormat.Jpeg);
document.Add(pic);
document.NewPage();
}
}
catch (DocumentException de)
{
Console.Error.WriteLine(de.Message);
}
catch (IOException ioe)
{
Console.Error.WriteLine(ioe.Message);
}
// step 5: we close the document
document.Close();
}
}
}
}
```
| Adding an image to a PDF using iTextSharp and scale it properly | CC BY-SA 2.5 | 0 | 2010-12-01T14:06:03.413 | 2016-11-16T08:29:10.840 | 2010-12-01T14:45:39.403 | null | null | [
"c#",
"image",
"itext"
] |
4,325,403 | 1 | 4,325,485 | null | 0 | 148 | I have this method:
```
- (void)reloadMessages:(NSNotification *)notification {
NSLog(@"RECIEVED NEW MESSAGES TO MessagesRootViewController");
// we need to get the threads from the database...
NSFetchRequest *theReq = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Thread" inManagedObjectContext:managedObjectContext];
[theReq setEntity:entity];
threads = [[managedObjectContext executeFetchRequest:theReq error:nil] retain];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"New Message" message:@"New message" delegate:nil cancelButtonTitle:@"Thanks" otherButtonTitles:nil];
[alert show];
[alert release];
[self.tableView reloadData];
}
```
If I call `[self reloadMessages:nil]` then the function works exactly as prescribed above.
If its called from an NSNotificationCenter notification: `[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadMessages:) name:@"newMessagesArrived" object:nil];` then it gets to `[alert show]` and stops with the screen dimmed as per this screenshot:

Any idea why this is happening?
If I take away the UIAlertView bit and just leave `[self.tableView reloadData];` then it calls that function, but it stops at some point. NSLogging on the table view datasource methods reveals that the table view is updated with the correct number of rows (suggesting the core data request isn't causing a problem) but that `cellForRowAtIndexPath` isn't being called.
The program isn't crashing. Without the alert view the table view doesn't quite reload completely as above, but the view is still useable and moving the table view causes the rows to update appropriately (as does going to the contacts tab and back again).
If you need any more information then I can give you it.
Thanks for any help. :)
Tom
| NSNotification stops method from working completely | CC BY-SA 2.5 | null | 2010-12-01T14:33:48.037 | 2010-12-01T14:42:55.243 | 2010-12-01T14:36:14.897 | 137,350 | 414,972 | [
"iphone",
"objective-c",
"cocoa-touch"
] |
4,325,628 | 1 | 4,326,912 | null | 6 | 13,528 | I'm learning about Android dialogs and I'm confused about what determines their height. If I use this XML for my dialog layout . . .
```
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<Button
android:id="@+id/AButton"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginLeft="10px"
android:text="Click Me to Dismiss"
/>
<TextView android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_toLeftOf="@id/AButton"
android:text="Click this button: "
/>
<ImageView
android:id="@+id/an_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="42px"
android:src="@drawable/screw50">
</ImageView>
/>
```
I get this dialog . . .

But Developer.Android.com says that...
""
... so why is the dialog so much higher than it needs to be?
If I replace the layout height with
```
android:layout_height="200px"
```
it makes a properly short dialog but I don't want to use explicit pixel heights (it's not good practice). How do I make the dialog be just big enough for its content?
| Android custom dialog height | CC BY-SA 2.5 | null | 2010-12-01T14:57:54.207 | 2011-07-26T15:45:47.577 | null | null | 424,690 | [
"android",
"dialog"
] |
4,325,654 | 1 | 4,328,025 | null | 5 | 822 | I have a Winforms application that the user uses to take a region based screenshot. I want to have a small preview pane, but i'm not sure how to do it. So far i tried recreating a bitmap on mouse move and its just way too laggy to be usable. So i thought if i used a pre-defined image (screenshot of the whole screen) and moved it inside the picturebox based off the mouse location so that you get a zoomed in look at the screen (to select the precise pixels you want to take the screenshot with easier). I'm not sure how i can implement this, i am also pretty new to drawing so i will show you what i have now.
```
private void falseDesktop_MouseMove(object sender, MouseEventArgs e)
{
zoomBox.Image = showZoomBox(e.Location);
zoomBox.Invalidate();
}
private Image showZoomBox(Point curLocation)
{
int x = 0;
int y = 0;
if (curLocation.X - 12 <= 0)
{
x = curLocation.X - 12;
}
else
{
x = curLocation.X;
}
if (curLocation.Y - 11 <= 0)
{
y = curLocation.Y - 11;
}
else
{
y = curLocation.Y;
}
Point start = new Point(curLocation.X - 12, curLocation.Y - 11);
Size size = new Size(24, 22);
Rectangle rect = new Rectangle(start, size);
Image selection = cropImage(falseDesktop.Image, rect);
return selection;
}
private static Image cropImage(Image img, Rectangle cropArea)
{
if (cropArea.Width != 0 && cropArea.Height != 0)
{
Bitmap bmpImage = new Bitmap(img);
Bitmap bmpCrop = bmpImage.Clone(cropArea, bmpImage.PixelFormat);
bmpImage.Dispose();
return (Image)(bmpCrop);
}
return null;
}
```
EDIT:
Here is a mock up like requested:
The black part of this image is a panel, of course the text being a label and the area where you see the image (stack overflow) would be the picturebox (called zoomBox) the lines on top of the zoomBox would be a guide and where the 2 lines intersect would be the mouse position. Hope this is a better assist to help you understand my issue.

Another thing that might help explain my issue is The form actually fills the entire screen with a "false desktop". its a picturebox that covers the entire screen with a screenshot of the desktop when "printscreen" was pressed. So I want this little "preview pane" to basically be a zoomed in location of where the mouse is.
| How to draw a screenshot "preview" window? | CC BY-SA 3.0 | null | 2010-12-01T15:00:36.113 | 2014-05-04T08:12:10.603 | 2014-05-04T08:12:10.603 | 321,731 | 450,782 | [
"c#",
"winforms",
"drawing",
"screenshot"
] |
4,325,714 | 1 | 4,325,760 | null | 2 | 6,342 | I just want to delete those null rows, i tried to use them and it wont even let me edit them, i get the same error trying to delete or edit them.

| won't let me delete rows in sql server 2005 management studio | CC BY-SA 2.5 | null | 2010-12-01T15:06:39.243 | 2010-12-01T15:12:21.277 | null | null | 497,470 | [
"sql",
"sql-server-2005"
] |
4,326,078 | 1 | 4,326,312 | null | 0 | 2,252 | How to get code completion to work for PHP in Netbeans 6.9.1?
I want Netbeans to suggest native PHP functions.

### EDIT:
The auto complete only works for reserved vars and reserved keywords but not for native functions. Looking at the example above, it should suggest e.g str_replace, strlen, etc...that doesnt happen even after CTRL + SPC.
| How to get code completion to work for PHP in Netbeans? | CC BY-SA 2.5 | null | 2010-12-01T15:42:18.953 | 2018-03-12T12:14:54.587 | 2010-12-01T19:55:40.877 | 98,204 | 98,204 | [
"php",
"frameworks",
"netbeans",
"code-completion"
] |
4,326,395 | 1 | 4,326,583 | null | 0 | 747 | I have the following form.

These rows reside in a Grid and the darker blue areas, section 1 and section 2, are Grids themselves.
How do I have Grid 2 expand and fill the row when Grid 1 has been collapsed? I attempted a StackPanel but that only moved Grid 2 up and left it the same size.
I'd like it to look like this when Grid 1 has been collapsed:

Any suggestions on how to do this?
Thanks again!
| WPF 2 Grid - hide 1 and the other should expand | CC BY-SA 2.5 | null | 2010-12-01T16:15:40.820 | 2010-12-01T16:33:44.500 | null | null | 302,613 | [
"wpf"
] |
4,326,843 | 1 | 4,326,930 | null | 2 | 2,416 | I posted this on [programmers first](https://softwareengineering.stackexchange.com/questions/22895/vs10-crashes-when-doing-build-or-rebuild-of-c-project), but was told it belongs here. Funny, I didn't think so.
I have VS10 installed on a Windows Server 2008 R2 box, along with several other versions of VS dating back years. This is our production build machine.
When I load or create any C++ project and do a Rebuild or Clean, the IDE crashes. In the crash details, I see this:

I have seen other reports what seems to be the exact same error on the web ([example](http://social.msdn.microsoft.com/Forums/en/vcgeneral/thread/7ed80bdf-b818-468b-a1a5-314eff40c073)). Other than the advice to open a ticket, I've seen no solution.
Has anyone else encountered and fixed this problem? I've opened a ticket with MS, but I'm covering my bases posting here as well.
## EDIT:
I ran a logfile as suggested in comments. These are the only entries that occured after I loaded up VS, so this includes the build & the crash:
```
<entry>
<record>229</record>
<time>2010/12/01 19:35:39.804</time>
<type>Information</type>
<source>VisualStudio</source>
<description>Entering function CVsPackageInfo::HrInstantiatePackage</description>
<guid>{68939055-38E0-4D17-92CB-8909710D8178}</guid>
</entry>
<entry>
<record>230</record>
<time>2010/12/01 19:35:39.836</time>
<type>Information</type>
<source>VisualStudio</source>
<description>Begin package load [Windows Forms Designer Hosting Package]</description>
<guid>{68939055-38E0-4D17-92CB-8909710D8178}</guid>
</entry>
<entry>
<record>231</record>
<time>2010/12/01 19:35:39.882</time>
<type>Information</type>
<source>VisualStudio</source>
<description>End package load [Windows Forms Designer Hosting Package]</description>
<guid>{68939055-38E0-4D17-92CB-8909710D8178}</guid>
</entry>
```
| VS10 Crashes When Doing “Build” or “Rebuild” of C++ Project | CC BY-SA 2.5 | 0 | 2010-12-01T16:57:41.397 | 2014-01-25T09:19:21.477 | 2017-04-12T07:31:21.230 | -1 | 241,536 | [
"c++",
"visual-studio-2010",
"crash"
] |
4,327,074 | 1 | 4,327,124 | null | 0 | 1,001 | I'm creating a JavaScript based calendar control, which when showing a single day needs to list any events occuring. I'd like the use the CSS `float:left` in order to get the browser to automatically layout the events.
I'd like for the events to automatically stack, so that they float to the far left when possible. Then stack as if there is overlap with another event.


How can I achieve this effect using `float`?
| Creating a calendar control using CSS: How to auto layout events | CC BY-SA 2.5 | null | 2010-12-01T17:21:25.710 | 2012-05-10T14:19:28.360 | 2012-05-10T14:19:28.360 | 44,390 | 86,218 | [
"javascript",
"html",
"css",
"css-float"
] |
4,327,475 | 1 | 4,327,504 | null | 1 | 6,707 | I'm having a tough time getting the value of a key in the data attribute. I'm using the jquery metadata plugin.
```
jQuery.metadata.setType("attr", "data");
$('ul li').each(function () {
console.log($(this).metadata())
});
```
```
<ul>
<li data="{someKey:'someValue',anotherKey:'anotherValue'}">Some List Item</li>
<li data="{someKey:'someValue2',anotherKey:'anotherValue2'}">Some List Item 2</li>
<li data="{someKey:'someValue3',anotherKey:'anotherValue3'}">Some List Item 3</li>
</ul>
```
I am outputting the object, but have no idea how to get at the value. I've tried `$(this).metadata().someKey` and `$(this).metadata('someKey')` and now I am grasping for straws.

| jQuery metadata, how to get the value? | CC BY-SA 2.5 | null | 2010-12-01T18:01:59.600 | 2010-12-01T18:06:40.040 | null | null | 150,803 | [
"jquery",
"jquery-plugins",
"metadata"
] |
4,327,712 | 1 | 4,331,577 | null | 1 | 1,067 | I am using core plot to plot about 2000 data points. They load fine, but I only see a smooth line:

I am not sure why it is just a flat line rather than showing a graph of all of my values which are in a large range. Have I done something wrong with setting up the plot space?
```
CPXYPlotSpace *plotSpace = (CPXYPlotSpace *)graph.defaultPlotSpace;
plotSpace.allowsUserInteraction = NO;
plotSpace.xRange = [CPPlotRange plotRangeWithLocation:CPDecimalFromFloat(0.0) length:CPDecimalFromFloat(num_points)];
plotSpace.yRange = [CPPlotRange plotRangeWithLocation:CPDecimalFromFloat(0.0) length:CPDecimalFromFloat(num_points)];
```
Here is my numberForPlot method as well:
```
-(NSNumber *)numberForPlot:(CPPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index
{
NSNumber *num = [sortedArray objectAtIndex:index];
return num;
}
```
Any ideas what I am doing wrong here?
| Core Plot generating a flat line, X or Y range incorrect? | CC BY-SA 2.5 | null | 2010-12-01T18:26:59.177 | 2010-12-02T04:06:12.327 | 2010-12-01T18:49:40.343 | 106,435 | 144,695 | [
"iphone",
"objective-c",
"cocoa-touch",
"core-graphics",
"core-plot"
] |
4,327,809 | 1 | 4,328,890 | null | 1 | 1,531 | I want to draw a square of pixels pending on how many items are in an array. the square represents the array amount so small squares represent small arrays and large squares represent large arrays. I am finding it difficult to conceptualize how I go about this?
EDIT: I am using Java 2D.
The spiral starts at 1 and then advances anti-clockwise towards the outside of the square (i.e. 2,3,4,5 etc). Each square can be represented by the amount of data that square represents.
| Draw Pixels in a square from inside out - Java | CC BY-SA 2.5 | null | 2010-12-01T18:37:51.440 | 2010-12-07T09:12:47.133 | 2010-12-01T20:37:47.717 | 122,099 | 122,099 | [
"java",
"pixel"
] |
4,327,846 | 1 | 4,328,194 | null | 12 | 3,137 | I was sent this nice non-recursive function for computing a fibonacci sequence.

So I coded up a bit of c# and was able to verify all numbers up to 1474 were correct.
The problem comes in when attempting to calculate it for 1475 and above. My c# math skills just aren't up to the task of figuring out a different way. So, does someone have a better way of expressing this particular math function in c#? other than the traditional way of doing a recursive function?
Incidentally, I started to use BigInteger as the return type. But the problem really comes in when trying to raise (1+Math.Sqrt(5) /2) to the 1475th power. I just don't see what data type I need (nor mechanism for that matter) to get this to come back with something other than Infinity.
Here's a starting point.
```
private Double FibSequence(Int32 input) {
Double part1 = (1 / Math.Sqrt(5));
Double part2 = Math.Pow(((1 + Math.Sqrt(5)) / 2), input);
Double part3 = Math.Pow(((1 - Math.Sqrt(5)) / 2), input);
return (part1 * part2) - (part1 * part3);
}
```
And, no, it's not homework. Just a "simple" problem for a slow day.
| Calculating fibonacci | CC BY-SA 2.5 | 0 | 2010-12-01T18:43:30.687 | 2013-05-08T21:24:03.917 | 2013-05-08T21:24:03.917 | 237,838 | 2,424 | [
"c#-4.0",
"fibonacci"
] |
4,328,036 | 1 | 4,334,977 | null | 3 | 353 | Exist any IDE expert to add the structure view to the delphi 5 ide menu?

thanks in advance.
| Adding structure view to delphi 5 ide menu | CC BY-SA 2.5 | null | 2010-12-01T19:02:46.007 | 2010-12-02T12:29:18.453 | null | null | 167,454 | [
"delphi"
] |
4,328,735 | 1 | 4,328,803 | null | 5 | 9,195 | I'm trying to implement maxlength on a textarea. In IE7, `window.clipboardData.getData("Text")` returns the correct number of characters copied. in IE8, the same call returns 0. What's wrong?
here is the js
```
var someRule= {
"textarea" : function(element) {
element.onpaste = function() {
var copied = window.clipboardData.getData("Text");
alert('copied length = '+copied.length);
}
}
};
Behaviour.register(someRule);
```

| window.clipboardData.getData("Text") returns 0 in IE8 | CC BY-SA 3.0 | 0 | 2010-12-01T20:24:43.090 | 2015-06-16T06:47:34.850 | 2015-06-16T06:47:34.850 | 1,446,845 | 322,663 | [
"javascript",
"internet-explorer-8",
"clipboard"
] |
4,329,066 | 1 | 4,329,344 | null | 0 | 2,139 | I am looking for a way to build a dropup menu. Basically, I have a website that has different buttons at the bottom and some of them should have dropup menus so that a few buttons apper above it on mouseover.
Oh, and I'd like to have a solution that works without big libraries and maybe even without javascript (but that's just because it's cleaner, a solution with javascript would also work).
Here's some code:
HTML:
```
<div class="toolbarElement" id="toolbarViewUsers">
<img src="images/usericon.png" />
List users
</div>
<div class="toolbarElement" id="toolbarSettings">
<img src="images/settings.png" />
Settings
</div>
<div class="toolbarElement" id="toolbarLogout">
<img src="images/logout.png" />
Logout
</div>
```
CSS:
```
.toolbarElement img {
display: block;
}
.toolbarElement {
float: left;
text-align: center;
margin-left: 3px;
margin-right: 3px;
}
```
This is how it looks:

Now I tried this, but I still don't know how to place the submenu above the toolbarElement:
CSS:
```
.toolbarElement {
float: left;
text-align: center;
margin-left: 3px;
margin-right: 3px;
position: relative;
}
.submenu {
position: absolute;
bottom: 0px;
left: 0px;
}
```
HTML:
```
<div class="toolbarElement" id="toolbarSettings">
<img src="images/settings.png" />
Settings
<div class="submenu">
Hallo
</div>
</div>
```
| dropup menus in CSS? | CC BY-SA 2.5 | null | 2010-12-01T20:58:02.630 | 2010-12-01T21:29:50.567 | 2010-12-01T21:21:15.047 | 492,364 | 492,364 | [
"css"
] |
4,329,617 | 1 | 4,329,647 | null | 10 | 10,788 | Is there a jQuery plugin that suggests/autocompletes within a textarea?
What I want is to have suggested words or autocompleted text proffered to the user in a textarea like the example image below:

| jQuery plugin that suggests/autocompletes within a textarea | CC BY-SA 3.0 | 0 | 2010-12-01T22:02:40.797 | 2015-06-13T15:48:22.830 | 2011-10-09T23:07:05.573 | 186,099 | 463,065 | [
"jquery",
"autocomplete",
"textarea",
"richtextbox",
"autosuggest"
] |
4,330,076 | 1 | 4,331,147 | null | 2 | 10,792 | My Java GUI application needs to quickly show some text to the end-user, so the `JOptionPane` utility methods seem like a good fit. Moreover, the text must be selectable (for copy-and-paste) and it could be somewhat long (~100 words) so it must fit nicely into the window (no text off screen); ideally it should all be displayed at once so the user can read it without needing to interact, so scrollbars are undesirable.
I thought putting the text into a `JTextArea` and using that for the message in `JOptionPane.showMessageDialog` would be easy but it appears to truncate the text!
```
public static void main(String[] args) {
JTextArea textArea = new JTextArea();
textArea.setText(getText()); // A string of ~100 words "Lorem ipsum...\nFin."
textArea.setColumns(50);
textArea.setOpaque(false);
textArea.setEditable(false);
textArea.setLineWrap(true);
textArea.setWrapStyleWord(true);
JOptionPane.showMessageDialog(null, textArea, "Truncated!", JOptionPane.WARNING_MESSAGE);
}
```

How can I get the text to fit entirely into the option pane without scrollbars and selectable for copy/paste?
| JOptionPane.showMessageDialog truncates JTextArea message | CC BY-SA 2.5 | 0 | 2010-12-01T23:09:03.363 | 2013-08-12T17:37:20.740 | 2010-12-01T23:14:50.473 | 244,128 | 244,128 | [
"java",
"swing",
"jtextarea",
"joptionpane"
] |
4,330,800 | 1 | null | null | 2 | 130 | I Have a Model like this,
My Menu entity have a relation 0..1 to 0..1 with the same entity (in themself) .. for have RootMenu recursively .. but I dont know how is the best way to saveChange with EF he always gave me errors..
Thank you!
| EF 4 relationship in the same entity | CC BY-SA 2.5 | 0 | 2010-12-02T01:13:27.770 | 2010-12-02T09:38:19.300 | null | null | 280,617 | [
"c#",
"entity-framework",
"ado.net"
] |
4,331,585 | 1 | 4,333,211 | null | 0 | 1,072 | i would like to know where does eclipse save entered args?(in which file?)
because these args that i entered -say- a month ago are remembered.
see snapshot:

| eclipse where is args[] stored? | CC BY-SA 2.5 | null | 2010-12-02T04:08:44.817 | 2010-12-02T08:57:13.947 | 2010-12-02T04:17:46.917 | 139,010 | 504,024 | [
"eclipse"
] |
4,331,802 | 1 | 4,372,463 | null | 2 | 3,528 | I'm trying to minimize a window to the tray, but it seems it refuses to hide from the taskbar. I've spent a little time and distilled the problem code down to this. It's not mcuh so I'm wondering if I need something else to hide my app to tray in Windows 7.
```
import sys, os
from PyQt4 import uic
from PyQt4.QtGui import QMainWindow, QApplication
class MyClass(QMainWindow):
def __init__(self, parent = None):
QMainWindow.__init__(self, parent)
self.ui = uic.loadUi(os.path.join("gui", "timeTrackerClientGUI.ui"), self)
def hideEvent(self, event):
self.hide()
def showEvent(self, event):
self.show()
if __name__ == '__main__':
app = QApplication(sys.argv)
wnd = MyClass()
wnd.show()
app.exec_()
```
It seems the application icon does hide but then another one pops up, If I click the taskbar icon multiple times I can get these two icons flickering, looks kind of like this for a splitsecond before the first one hides:

| Hide window from taskbar | CC BY-SA 2.5 | 0 | 2010-12-02T04:54:08.413 | 2010-12-22T15:53:13.723 | 2010-12-22T15:53:13.723 | 98,494 | 197,657 | [
"python",
"qt",
"pyqt"
] |
4,331,858 | 1 | 4,346,441 | null | 0 | 789 | I am using the [syntaxhighlighter](http://alexgorbatchev.com/SyntaxHighlighter/), but it is not working. You can see the page : [http://fast-code.sourceforge.net/templates1.htm](http://fast-code.sourceforge.net/templates1.htm). Any ideas?
: It is working okay now but But now a strange scroll is coming as shown below.

| Syntaxhighlighter is not working | CC BY-SA 2.5 | null | 2010-12-02T05:02:45.467 | 2010-12-05T08:05:44.043 | 2010-12-05T08:05:44.043 | 184,730 | 184,730 | [
"html",
"syntax-highlighting",
"stylesheet",
"code-formatting"
] |
4,331,927 | 1 | 4,334,387 | null | 0 | 381 | I need to create two controls that contain the same amound of items (a dynamic amount), the first control represents the keys, the second represents the values.
I need it so that when the user resizes the upper column width it should affect the same column in the lower row (of the values).
Here is an example to what I desire:
```
<Window
DataContext="{Binding RelativeSource={RelativeSource Self}}"
x:Class="MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Window.Resources>
<ItemsPanelTemplate x:Key="ItemsPanelTemplate">
<VirtualizingStackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</Window.Resources>
<StackPanel>
<ItemsControl ItemsSource="{Binding Keys}"
ItemsPanel="{StaticResource ItemsPanelTemplate}"/>
<ItemsControl Grid.Row="1" ItemsSource="{Binding Values}"
ItemsPanel="{StaticResource ItemsPanelTemplate}"/>
</StackPanel>
</Window>
```
---
```
Imports System.Collections.Specialized
Class MainWindow
Private Sub Window_Loaded(ByVal sender As Object,
ByVal e As RoutedEventArgs) Handles MyBase.Loaded
DataContext =
New StringDictionary From
{
{"key1", "value1"},
{"key2", "value2"},
{"key3", "value3"},
{"key4", "value4"}
}
End Sub
End Class
```
Result:

Again, I want to be able to create a DataGrid-like control that even supports cell borders and cell widths and heights should be connected to the other controls' width + allow resize.
I prefer it to be done xamly.
Note: it's a custom control, so I can declare appropriate properties if necessary. but remember the cells' heights and width has to be dynamic and individual to specific columns/rows.
In reference to [this](https://stackoverflow.com/questions/4251183/wpf-two-dimensional-datagrid-listview) question, I created it in a slightly different way (having a third control for cells), but the question is still the same, I want the height width of the columns and cells to be dynamic, and give the user ability to resize them affecting each other.
[decyclone's answer](https://stackoverflow.com/questions/4331927/connecting-width-height-of-cell-in-two-different-controls/4334387#4334387) is something I would love to implement, but I tried the example he provided setting the `ItemsControl`s' `Grid.IsSharedSizeScope` property to true, but it didn't work, here is the result (cropped):

Is it possible to apply a shared size scope between two different controls?
| Connecting width/height of cell in two different controls? | CC BY-SA 2.5 | null | 2010-12-02T05:17:45.983 | 2010-12-06T06:03:18.320 | 2017-05-23T11:48:22.880 | -1 | 75,500 | [
"wpf",
"binding",
"performance",
"relativesource",
"elementname"
] |
4,332,751 | 1 | 4,332,795 | null | 3 | 5,521 | I want to build excel like utility in HTML. Suppose I've table[id "myTbl"] with 20 rows & 20 columns. I would like to add textbox inside td whenever users clicks on it with td text as its value.
Suppose my table is

I've 2 options to achieve this [both are working fine]
Option I
```
$("#myTbl").bind("click",function(e){
var obj = e.target;
if(obj.nodeName == "TD"){
$(obj).html("<input type='text' value='"+$(obj).html()+"'></input>");
}
});
```
Option II
```
$("#myTbl tr td").bind("click",function(e){
if($("input",$(this)).length==0){
$(this).html("<input type='text' value='"+$(this).html()+"'></input>");
}
});
```
My question is which option is better in terms of performance.
| Binding click event to td vs table | CC BY-SA 2.5 | 0 | 2010-12-02T07:39:33.067 | 2010-12-02T07:45:02.067 | null | null | 459,176 | [
"javascript",
"jquery",
"performance"
] |
4,333,112 | 1 | null | null | 0 | 610 | I have two ListViews with trigger that on selected change the background color to dark gray and the foreground color to white.
The problem is that when I select an item in the first listview and then an item in the second listview the item in the first listview foreground doesn't get black again and it stay white.

the xaml:
```
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="190*" />
<RowDefinition Height="121*" />
</Grid.RowDefinitions>
<Grid.Resources>
<ResourceDictionary>
<Style x:Key="@ListViewItemStyle" TargetType="{x:Type ListViewItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType='{x:Type ListViewItem}'>
<Grid SnapsToDevicePixels="True" Margin="0">
<Border x:Name="Bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" />
<GridViewRowPresenter x:Name="Content" TextBlock.Foreground="{TemplateBinding Foreground}"
Content="{TemplateBinding Content}" Columns="{TemplateBinding GridView.ColumnCollection}" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="true">
<Setter Property="TextElement.Foreground" Value="White" TargetName="Content" />
<Setter Property="Background" Value="DarkGray" TargetName="Bd"/>
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="true" />
<Condition Property="Selector.IsSelectionActive" Value="false" />
</MultiTrigger.Conditions>
<Setter Property="Background" TargetName="Bd"
Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" />
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
</MultiTrigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<DataTemplate x:Key="@TextCellTemplate">
<TextBlock Text="{Binding Name}"/>
</DataTemplate>
<DataTemplate x:Key="@TrubleCellTemplate">
<Rectangle Width="20" Height="20" Fill="Black"></Rectangle>
</DataTemplate>
</ResourceDictionary>
</Grid.Resources>
<ListView ItemsSource="{Binding Persons}" Style="{DynamicResource @ListView}" ItemContainerStyle="{DynamicResource @ListViewItemStyle}">
<ListView.View>
<GridView>
<GridViewColumn Width="40" CellTemplate="{DynamicResource @TextCellTemplate}" />
<GridViewColumn Width="131" CellTemplate="{DynamicResource @TrubleCellTemplate}" />
</GridView>
</ListView.View>
</ListView>
<ListView ItemsSource="{Binding Persons}" Style="{DynamicResource @ListView}" ItemContainerStyle="{DynamicResource @ListViewItemStyle}" Grid.Row="1">
<ListView.View>
<GridView>
<GridViewColumn Width="40" CellTemplate="{DynamicResource @TextCellTemplate}" />
<GridViewColumn Width="131" CellTemplate="{DynamicResource @TrubleCellTemplate}" />
</GridView>
</ListView.View>
</ListView>
</Grid>
```
| WPF - problem with triggers | CC BY-SA 2.5 | null | 2010-12-02T08:39:35.140 | 2011-02-13T03:23:34.063 | 2010-12-02T09:15:32.907 | 138,627 | 138,627 | [
"wpf",
"triggers",
"styles"
] |
4,333,607 | 1 | 7,078,624 | null | 7 | 4,320 | I want to right align a proportionally scaled image, on a page in the report. Seems like images are always aligned left in their bounding box.
The image however, is dynamically assigned. So no, I can't just position the image in the right position.
All ideas welcome :)

| Right align image in RDLC report | CC BY-SA 2.5 | 0 | 2010-12-02T09:51:35.933 | 2017-09-04T15:31:05.530 | 2010-12-02T09:59:14.430 | 26,579 | 26,579 | [
"reporting-services",
"report",
"rdlc"
] |
4,333,764 | 1 | 4,335,836 | null | 3 | 475 | I'm a C++ programmer and I've started a side project to teach me some WPF. I've started making a desktop app to browse images and probably retouch them, something like paint.net.
I want to enclose controls(e.g. see image below) within a child window chrome which has a close button. Something like MDI, but not quite.

The simplest way for now, I thought, was to enclose it within another `<window></window>`, but it seems WPF doesn't like this. It gives a runtime exception.
Is there a simpler way of doing it. I couldn't find any links that explained anything similar.
| WPF:Enclose controls within a child window chrome which has a close button | CC BY-SA 2.5 | null | 2010-12-02T10:12:33.630 | 2010-12-02T14:07:49.050 | null | null | 17,537 | [
".net",
"wpf",
".net-4.0",
"c#-4.0"
] |
4,333,768 | 1 | 4,333,963 | null | 1 | 1,677 | I have a custom styled `ListBoxItem` with a `Border` surrounding a `ContentPresenter`. (Code found below). My border acts as my selection indicator and turns grey when you select it. All is fine when I use the mouse, but the moment I use my keyboard, an ugly dotted grey border comes out. How do I remove it?
## Pics:

You can see that when I mouse over/click on the `ListBoxItem`, a border with included background surrounds the item. But an ugly dotted border pops out when I use the keyboard.
## Code:
```
<Style x:Key="{x:Type ListBoxItem}" TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<StackPanel>
<Border Name="HighlightBorder"
Padding="30"
BorderBrush="Transparent"
BorderThickness="1"
CornerRadius="5"
>
<ContentPresenter/>
</Border>
</StackPanel>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="HighlightBorder" Property="Background" Value="#F3F3F3"/>
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="HighlightBorder" Property="Background" Value="#DFDFDF"/>
</Trigger>
<Trigger Property="IsKeyboardFocused" Value="True">
<Setter TargetName="HighlightBorder" Property="Background" Value="#DFDFDF"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
```
| Remove list box item dotted border | CC BY-SA 2.5 | null | 2010-12-02T10:13:35.803 | 2010-12-02T10:34:05.740 | null | null | 504,310 | [
"c#",
"wpf",
"wpf-controls",
"custom-controls"
] |
4,333,806 | 1 | null | null | 0 | 1,769 | I have this problem. I add images (smiles) into richTextBox control from Extended WPF Toolkit.
In function on converting simple text to text with images I set line height
of paragraph and this paragraph I add to blocks of richTextBox. Here is it:
```
private void RpTextToTextWithEmoticons(string msg)
{
//set line height
var para = new Paragraph {LineHeight = 40};
var r = new Run(msg);
para.Inlines.Add(r);
string emoticonText = GetEmoticonText(r.Text);
//if paragraph does not contains smile only add plain text to richtextbox rtb2
if (string.IsNullOrEmpty(emoticonText))
{
RtbConversation.Document.Blocks.Add(para);
}
else
{
while (!string.IsNullOrEmpty(emoticonText))
{
TextPointer tp = r.ContentStart;
// keep moving the cursor until we find the emoticon text
while (!tp.GetTextInRun(LogicalDirection.Forward).StartsWith(emoticonText))
tp = tp.GetNextInsertionPosition(LogicalDirection.Forward);
// select all of the emoticon text
var tr = new TextRange(tp, tp.GetPositionAtOffset(emoticonText.Length)) { Text = string.Empty };
//relative path to image smile file
string path = _mappings[emoticonText];
var image = new Image
{
Source = new BitmapImage(new Uri(path, UriKind.RelativeOrAbsolute)),
Width = 30,
Height = 30,
};
//insert smile
new InlineUIContainer(image, tp);
if (para != null)
{
var endRun = para.Inlines.LastInline as Run;
if (endRun == null)
{
break;
}
else
{
emoticonText = GetEmoticonText(endRun.Text);
}
}
}
RtbConversation.Document.Blocks.Add(para);
}
}
```
But If I add new paragraphs to blocks all paragraphs have various line height/spacing. I need constat line height/spaccing between individual paragraph, something like chat in skype.
My problem you can see on image:

Where can be problem, I am helpless. Thank for any advance.
| RichTextBox with images - problem with line spacing | CC BY-SA 2.5 | null | 2010-12-02T10:18:21.907 | 2011-04-27T19:04:10.957 | null | null | null | [
"wpf",
"richtextbox",
"spacing",
"css"
] |
4,334,224 | 1 | 4,334,266 | null | 0 | 362 | 
I had some trouble figuring out how to funnel users through different stages on a website I'm building and I figured that drawing a flowchart might help me see things clearer. So I started drawing a chart in [Dia](http://projects.gnome.org/dia/) and an hour later I'd figured out what models and views I need to add and how to interconnect them. Given a little time, I can really see this kind of charting becoming a useful asset in my web development skill set.
One thing that bothered me though was the lack of symbols for common stuff related to web development. A symbol for forms would be nice. Maybe a way to indicate AJAX requests. I'm sure you can think of lots of other stuff. What are people using to visualise such things? Is there a standard set of symbols that I should use? I stumbled across UML years ago but never really got comfortable with it. Could that be used for charting web sites or is it not well suited to this task?
| Are there standards for flowcharting websites? | CC BY-SA 2.5 | 0 | 2010-12-02T11:01:23.657 | 2010-12-02T15:46:17.993 | null | null | 98,374 | [
"uml",
"flowchart"
] |
4,334,290 | 1 | 4,357,273 | null | 3 | 1,175 | I'm trying to sort out my netbeans color theme and I'm almost there apart from one annoying highlight I can't seem to find anywhere! It only shows it self in HTML and CSS that I have seen so far!
Its the highlighting that happens when you click on an Id or class value for html elements, or elements in css
Have a look at the picture below and see if you can identify the option that defines the highlight below!

| Netbeans color theming problem | CC BY-SA 2.5 | 0 | 2010-12-02T11:10:56.870 | 2010-12-05T03:58:13.797 | 2010-12-02T11:49:43.040 | 298,745 | 298,745 | [
"colors",
"themes",
"netbeans-6.9"
] |
4,334,330 | 1 | 4,362,533 | null | 3 | 2,302 | Re-asking the question:
When you add an animation for the contents key, a CATransitionAnimation is apparently being triggered that fades the original contents property to the first value in the animation's values array, resulting in a .25 second fade. And it looks bad! I have suppressed every animatable property using all the methods discussed here (returning null animations through a delegate, into the actions dictionary, using CATransaction), but none of these seem to be targeting this particular transition animation.

I have been looking into what property could possibly be responsible for this, but cannot figure it out.
I need to suppress the transition animation that is occurring when you add an animation to the contents key.
As I'm at such a loss, I will put the keyframe animation that is being added for you to see. I figure maybe I am doing something wrong here? Just a note, that array is just an array of 6 CGImageRefs (the frames of the animation).
```
+ (CAKeyframeAnimation *)moveLeftAnimation {
CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"contents"];
animation.values = [NSArray arrayWithArray:[Setzer walkingLeftSprite]];
animation.duration = 0.5f;
animation.keyTimes = [NSArray arrayWithObjects:
[NSNumber numberWithFloat:0.0],
[NSNumber numberWithFloat:0.2],
[NSNumber numberWithFloat:0.4],
[NSNumber numberWithFloat:0.6],
[NSNumber numberWithFloat:0.8],
[NSNumber numberWithFloat:1.0],
nil];
animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
return animation;
```
}
Also, I have an animation that handles the position key, in the sprite's action dictionary:
```
+ (CABasicAnimation *)moveAnimation {
CABasicAnimation *moveAnimation = [CABasicAnimation animation];
moveAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
moveAnimation.duration = 0.5f;
return moveAnimation;
```
}
I am thinking maybe this transition is occurring when you change the layer's position? I don't know...
Please help! This is driving me NUTS!
| Remove Interpolation of CALayer's contents property | CC BY-SA 2.5 | null | 2010-12-02T11:16:23.760 | 2021-08-19T02:02:42.727 | 2010-12-07T07:44:30.630 | 409,038 | 409,038 | [
"cocoa",
"core-animation",
"calayer"
] |
4,334,341 | 1 | null | null | 26 | 26,453 | The following code is what I got so far. However, there are 2 issues:
1. I want both inner and outer glow effects, which look similar to the Photoshop's blending options. But I only managed to make the outer glow, if I set BlurMaskFilter.Blur.INNER or other value, the whole image is blocked, instead of just edges.
2. Despite I set "FF" as alpha value, the glow color is still very dark. Bitmap alpha = origin.extractAlpha();
BlurMaskFilter blurMaskFilter = new BlurMaskFilter(5, BlurMaskFilter.Blur.OUTER);
Paint paint = new Paint();
paint.setMaskFilter(blurMaskFilter);
paint.setColor(0xffffffff);
Canvas canvas = new Canvas(origin);
canvas.drawBitmap(alpha, 0, 0, paint);
return origin;

| How to make glow effect around a bitmap? | CC BY-SA 3.0 | 0 | 2010-12-02T11:18:04.907 | 2019-03-01T07:30:35.627 | 2015-05-19T13:54:31.823 | 1,308,767 | 423,989 | [
"android",
"graphics",
"bitmap",
"glow"
] |
4,334,427 | 1 | 4,334,721 | null | 1 | 248 | This is a mess and does not work as planned. Banging head against wall. There must be a quicker and cleaner way to achieve this, i have 3 divs all with a "p" tag in each. If the values are between certain setpoint then i'm trying to implement a traffic light system by swapping img src's...
jQuery:
```
$(document).ready(function() {
$.get("db.php?phase=1", function(data){ $("#phase1 p").html(data); });
$.get("db.php?phase=2", function(data){ $("#phase2 p").html(data); });
$.get("db.php?phase=3", function(data){ $("#phase3 p").html(data); });
$.get("db.php?tstamp=1", function(data){ $("#tstamp p").html(data); });
setInterval(function() {
$.get("db.php?phase=1", function(data){ $("#phase1 p").html(data); });
$.get("db.php?phase=2", function(data){ $("#phase2 p").html(data); });
$.get("db.php?phase=3", function(data){ $("#phase3 p").html(data); });
$.get("db.php?tstamp=1", function(data){ $("#tstamp p").html(data); });
}, 60000);
if ($("#phase1 p").val() < 400){
$("#phase1light").attr("src", "/phases/img/green.png");
}
else if (($("#phase1 p").val() > 400 && $("#phase1 p").val() < 500)){
$("#phase1light").attr("src", "/phases/img/amber.png");
}
else if ($("#phase1 p").val() > 500){
$("#phase1light").attr("src", "/phases/img/red.png");
};
if ($("#phase2 p").val() < 400){
$("#phase2light").attr("src", "/phases/img/green.png");
}
else if (($("#phase2 p").val() > 400 && $("#phase2 p").val() < 500)){
$("#phase2light").attr("src", "/phases/img/amber.png");
}
else if ($("#phase2 p").val() > 500){
$("#phase2light").attr("src", "/phases/img/red.png");
};
if ($("#phase3 p").val() < 400){
$("#phase3light").attr("src", "/phases/img/green.png");
}
else if (($("#phase3 p").val() > 400 && $("#phase2 p").val() < 500)){
$("#phase3light").attr("src", "/phases/img/amber.png");
}
else if ($("#phase3 p").val() > 500){
$("#phase3light").attr("src", "/phases/img/red.png");
};
});
```
HTML:
```
<div id="phase1">
<p class="results"></p>
<img id="phase1light" src="/phases/img/red.png" />
</div>
<div id="phase2">
<p class="results"></p>
<img id="phase1light" src="/phases/img/red.png" />
</div>
<div id="phase3">
<p class="results"></p>
<img id="phase1light" src="/phases/img/red.png" />
</div>
```
HELP!

| Cleaner jQuery If Statements | CC BY-SA 2.5 | null | 2010-12-02T11:26:25.497 | 2010-12-02T13:33:20.693 | 2010-12-02T12:02:23.667 | 478,144 | 478,144 | [
"jquery",
"if-statement"
] |
4,334,668 | 1 | null | null | 1 | 591 | i am using slickgrid (js grid) to display some data. because i need to put the data inside " and my content contains programming code, i decode the content with the php function htmlentities($mycontent,ENT_QUOTES,"UTF-8").
Now everything renders fine EXCEPT If i edit the cell. then it does not display "ä" but &_auml; (i used the _to prevent rendering). i want it to be displayed like the normal view.
normal view:

edit view:

i also went into the code ->slickeditor.js to do a html entity decode (manually written) in js but without success.
is there an intelligent solution for this?
| Slickgrid html entities problem in Editor | CC BY-SA 2.5 | null | 2010-12-02T11:53:15.803 | 2011-10-28T10:59:32.363 | null | null | 334,833 | [
"php",
"javascript",
"slickgrid"
] |
4,334,704 | 1 | null | null | 8 | 11,764 | Is it possible to apply an outer bevel effect to the label text in WPF?

as for me, the Glow effect should be sufficient:

| Outer bevel effect on text in WPF | CC BY-SA 2.5 | 0 | 2010-12-02T11:57:19.560 | 2010-12-02T17:27:02.883 | 2010-12-02T15:17:24.627 | 185,593 | 185,593 | [
".net",
"wpf",
"wpf-controls"
] |
4,334,707 | 1 | null | null | 13 | 36,556 | I have a `regionContent` panel which I add to my viewport.
```
...
var regionContent = new Ext.Panel({
id: 'contentArea',
region: 'center',
padding:'10',
autoScroll: true,
html: 'this is the original content'
});
var viewport = new Ext.Viewport({
layout: 'border',
items: [ regionMenu, regionContent ]
});
var newPanel = new Ext.Panel({
region: 'east',
title: 'Info Panel',
width: 300,
html: 'this is a panel that is added'
});
// regionContent.update(newPanel); //renders as javascript code ???
// regionContent.remove(...) //how do I remove ALL CONTENT, I will not know what is in this panel to remove it specifically
regionContent.add(newPanel); //adds to original content but does not replace it
regionContent.doLayout();
...
```
`.update()` does this:

`.add()` does this:

| How can I replace the content of a panel with new content? | CC BY-SA 2.5 | 0 | 2010-12-02T11:57:36.020 | 2017-02-12T23:03:42.923 | 2010-12-02T14:56:10.513 | 4,639 | 4,639 | [
"extjs"
] |
4,334,883 | 1 | null | null | 3 | 1,643 | 
I want to implement a as showing in above screen in my
Please suggest
| Autocomplete email functionality in UITextField | CC BY-SA 2.5 | null | 2010-12-02T12:18:29.637 | 2012-08-29T09:23:35.573 | 2010-12-02T12:32:38.407 | 165,260 | null | [
"iphone",
"objective-c",
"email",
"autocomplete",
"uitextfield"
] |
4,334,908 | 1 | 4,334,932 | null | 27 | 70,065 | I have a custom button layout
```
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape>
<gradient android:startColor="@color/pres1"
android:endColor="@color/pres2" android:angle="270" />
<stroke android:width="5dp" android:color="@color/stro3" />
<corners android:radius="5dp" />
<padding android:left="10dp" android:top="20dp"
android:right="10dp" android:bottom="20dp" />
</shape>
</item>
<item android:state_focused="true">
<shape>
<gradient android:endColor="@color/focu1"
android:startColor="@color/focu2" android:angle="270" />
<stroke android:width="5dp" android:color="@color/stro2" />
<corners android:radius="5dp" />
<padding android:left="10dp" android:top="20dp"
android:right="10dp" android:bottom="20dp" />
</shape>
</item>
<item>
<shape>
<gradient android:endColor="@color/norm1"
android:startColor="@color/norm2" android:angle="270" />
<corners android:radius="5dp" />
<padding android:left="10dp" android:top="20dp"
android:right="10dp" android:bottom="20dp" />
</shape>
</item>
</selector>
```
And for the below lay out
```
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:background="@color/all_white">
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" android:text="@string/hello"
android:textColor="@color/all_red" />
<Button android:id="@+id/mq_categories" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:text="Browse Quiz Categories"
android:background="@drawable/custom_button" />
<Button android:id="@+id/mq_random" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:text="Enter Random Quiz"
android:background="@drawable/custom_button" />
</LinearLayout>
```
following output is generated

I need to add some margin between buttons, Any help appreciated..
| Android custom button margin | CC BY-SA 2.5 | 0 | 2010-12-02T12:21:02.823 | 2015-07-14T00:32:40.953 | null | null | 174,261 | [
"android",
"android-layout"
] |
4,335,103 | 1 | 4,337,129 | null | 0 | 351 | In my Symfony project I'm trying to provide a "save as template"-button for an embedded Form. The embedded form contains dynamic embedded forms itself.
Example:

The user should be able to save the template without saving the whole form. So i'm going to use AJAX to achieve this (as I already did, for the dynamic add-behavior).
The actual problem is that Symfony names the form in dependence on the parent form, e.g.
```
<input name="Project[Workflow][1][name]" />
```
But the template isn't related to "Project" at all. On the other hand, this naming format is required later, when saving the whole form.
Sending the whole form to the server might be a solution, but I think it's a bad practice / overkill / waste of bandwidth.
Is there a common way how to do this?
If not, do you have a basic approach in mind?
Regards,
Uli
| Symfony: How can I create user-templates from filled out forms | CC BY-SA 2.5 | null | 2010-12-02T12:44:27.750 | 2010-12-06T22:01:04.267 | null | null | 395,879 | [
"ajax",
"forms",
"symfony1"
] |
4,335,142 | 1 | 4,335,179 | null | 2 | 1,076 | I am loading a `.php` file via an ExtJS AJAX call like this:
```
menuItemApplication.header.on('click', function() {
Ext.Ajax.request({
url: 'content/view_application.php',
success: function(objServerResponse) {
var responseText = objServerResponse.responseText;
regionContent.update(responseText);
var scripts, scriptsFinder=/<script[^>]*>([\s\S]+)<\/script>/gi;
while(scripts=scriptsFinder.exec(responseText)) {
eval(scripts[1]);
}
}
});
});
```
Javascript in the loaded .php file executes fine:
```
<script type="text/javascript">
regionContent.update('changed region content from within application view');
</script>
```
But if the is being generated via , it is :
```
<?php
echo "<script type=\"text/javascript\">\n";
echo "regionContent.update('changed region content from within application view')';\n";
echo "</script>\n";
?>
```
Yes the responses are the same, as seen in the Firebug Net panel, here with Javascript which :

And here with PHP-generated Javascript, which :

| Why would PHP-generated Javascript not work in file loaded via AJAX? | CC BY-SA 2.5 | null | 2010-12-02T12:48:11.633 | 2010-12-02T12:53:58.510 | null | null | 4,639 | [
"php",
"javascript",
"ajax",
"extjs"
] |
4,335,452 | 1 | null | null | 0 | 2,485 | I do not understand how Oracle works. This is my first tryst with Oracle, so please accept my apologies if this questions sounds silly or even ridiculously silly.
The Oracle DBA team creates a database or a schema (what is the difference?). Let us call it SIT_Release2. I am to setup the ODBC connections for it. I have some file called TNSNames.ora which resides in ORACLE_HOME\Network\Admin path.
The TNSNames.ora has the following information
SIT =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = "IPAddress")(PORT = 1875))
)
(CONNECT_DATA =
(SID = "sit")
(SERVER = DEDICATED)
)
)
Now, the ODBC Connection that already exists for a different database or schema (Name of it is SIT_Release1) is as below. 
The Data Source Name is populated with a certain value.
The Description is populated with a certain value.
The TNS Service Name is populated with value of SIT
The User Id is populated.
The TNSNames.ora just specifies to which server I am connecting and listening via which port.
Where exactly are we specifying that this ODBC connection points to this particular database?
I still do NOT understand how it works. But this is what happened -
The SID="sit" still remains as such, but the credentials I give point it to different databases.
So, in the above screenshot, the TNS Service Name is still the same. However, the username/password is different and I am able to connect to a different database.
| Oracle 10 g - Setting up ODBC Connections and what is TNSNames.ora | CC BY-SA 2.5 | null | 2010-12-02T13:23:28.247 | 2010-12-24T16:14:10.767 | 2010-12-24T16:14:10.767 | 182,978 | 182,978 | [
"oracle10g",
"odbc"
] |
4,335,590 | 1 | 4,336,922 | null | 0 | 904 | I've been wrestling with this for a while. I need to show additional information about the current view (which is a detail view itself).
Here's some images to show what I mean (it's not my app, but will similar design).


The first view is top level navigation view. When the user drills down, they eventually end up with the second view (detail view). On the tab bar there're additional info about the detail (Benelli gun).
The problem is that I do not know a clean way to implement another tabbar controller/tabbar inside the original top level tabbar. Pushing a tabbarcontroller inside tabbar controller is messy and I haven't been able to get it to work cleanly.
So while a second "detail tabbar" would be nice, I'm exploring other ways.
I tried putting in a custom table with detail views but it doesn't look natural under the description (stats).
Looking for design suggestions, thanks.
| iPhone App design question, how to show detail view correctly | CC BY-SA 2.5 | 0 | 2010-12-02T13:38:23.160 | 2020-03-06T15:12:40.617 | null | null | 408,669 | [
"iphone",
"ios",
"uinavigationcontroller",
"uitabbarcontroller",
"uitabbar"
] |
4,335,829 | 1 | null | null | 23 | 10,867 | I'm currently developing a simple text-editing app for iPad.
I want to set left/right margins like the attached picture.
Just adding UITextView into another UIView with larger width won't work because a scroll indicator won't be properly located.
Instead of UIView, I added UITextView into UIScrollView, and it works almost fine. But they sometimes show strange behaviors, and UITextViewDelegate doesn't work with my UIViewController.
Is there any way to set left/right margins only using UITextView?
Thank you.

| How to set a margin in UITextView? | CC BY-SA 2.5 | 0 | 2010-12-02T14:06:40.193 | 2014-03-15T12:07:21.723 | null | null | 434,153 | [
"iphone",
"ipad",
"ios",
"uiscrollview",
"uitextview"
] |
4,335,916 | 1 | 4,336,425 | null | 4 | 16,102 | I have the following Ext.TabPanel:
```
var modules_info_panel = new Ext.TabPanel({
activeTab: 0,
defaults:{autoScroll:true},
//layout: 'fit', // makes component disappear
viewConfig: {
forceFit: true //has no effect
},
// height: auto, //error "auto isn't recognized"
items:[{
title: 'Section 1',
html: 'test'
},{
title: 'Section 2',
html: 'test'
},{
title: 'Section 3',
html: 'test'
}]
});
```
which looks like this:

Here's how the TabPanel is loaded into `regionContent`:
```
regionContent = new Ext.Panel({
id: 'contentArea',
region: 'center',
autoScroll: true
});
function clearExtjsComponent(cmp) {
var f;
while(f = cmp.items.first()){
cmp.remove(f, true);
}
}
function replaceComponentContent(cmpParent, cmpContent) {
clearExtjsComponent(cmpParent);
cmpParent.add(cmpContent);
cmpParent.doLayout();
}
replaceComponentContent(regionContent, modules_info_panel);
```
I see that the height is for this element in the dom is absolute (19px), where is that being set?

# Addendum
McStretch, I tried your idea by putting `layout: 'fit'` in the tabs themselves but the line still is in the same place:
```
var modules_info_panel = new Ext.TabPanel({
activeTab: 0,
defaults:{autoScroll:true},
items:[{
title: 'Section 1',
layout: 'fit',
html: 'test'
},{
title: 'Section 2',
layout: 'fit',
html: 'test'
},{
title: 'Section 3',
layout: 'fit',
html: 'test'
}]
});
```
| How to get height of Ext.Panel to fill parent area | CC BY-SA 2.5 | null | 2010-12-02T14:16:54.233 | 2013-01-22T20:41:17.417 | 2013-01-22T20:41:17.417 | 320,399 | 4,639 | [
"extjs",
"extjs3",
"tabpanel"
] |
4,336,762 | 1 | 4,726,646 | null | 265 | 100,380 | On Android devices that use soft keyboards, I want to prevent the fullscreen keyboard editing view (shown below) from appearing when in landscape mode (i.e. I want to see only the soft keyboard itself and my view behind it).
I assume this can be achieved using the `setExtractViewShown(false)` method on `InputMethodService`, but I am unable to access the default instance of this and do not want to implement a custom input method.

the view to which input is going is not a `TextView` (it's a `View` with a custom `InputConnection` implementation), so `android:imeOptions="flagNoExtractUi"` won't work here.
| Disabling the fullscreen editing view for soft keyboard input in landscape? | CC BY-SA 3.0 | 0 | 2010-12-02T15:42:09.530 | 2020-08-10T15:27:25.833 | 2012-07-09T14:06:18.690 | 204,826 | 204,826 | [
"android",
"android-softkeyboard",
"android-input-method"
] |
4,336,917 | 1 | 4,356,688 | null | 6 | 39,921 | I have a shipping label that needs to print on a Dymo Label printer with slightly different data on each of 3 pages. Can this be done with just one .rpt so the users only need to print one report, rather than three?

| Crystal Reports 11 - How to print different data on multiple pages | CC BY-SA 3.0 | 0 | 2010-12-02T15:54:50.473 | 2012-11-29T08:07:52.393 | 2011-11-27T03:37:07.007 | 234,976 | 528,202 | [
"printing",
"crystal-reports"
] |
4,336,993 | 1 | null | null | 1 | 422 | First of all, math is not my area.
Imagine a problem like this:
I have a number of money to spend, say 500, and i need to spend them on a fixed number of days, say 20. I have a fixed maximum of money to spend per day, like 50. I don't need to spend money on a day.
Now i need to know how to calculate the total number of money I have to spend each day to get a spending curve like the following:

My goal is a function that takes a number of money and a number of days, and returns an tuple with day number and ammount of money for that day.
I know i need to use logarithms of some type, and i've tried pretty much everything that my brain can handle. I've been looking at [wolfram mathworld](http://mathworld.wolfram.com/LeastSquaresFittingLogarithmic.html) and this formula:
y = a + b ln x
But it does not really help me.
An hint or example in PHP, Python or C# would be great, but any language will do.
let me know if you need any more information or if the question is vague, I really want to solve this. Thank you!
| Logarithmic distribution | CC BY-SA 2.5 | 0 | 2010-12-02T16:01:57.523 | 2010-12-06T01:11:47.060 | null | null | 41,596 | [
"math",
"distribution",
"logarithm"
] |
4,337,181 | 1 | null | null | 0 | 960 | I want the boxes to spread out just like this:

exactly 218 pixels across from each other.
I tried to margin both of them together but I can't get it perfect!
```
.box1, .box2 { margin: 0 20px }
```
Is there a better way to get this right?
I forgot to mention, there already floated.
| How to spread these divs out evenly? | CC BY-SA 2.5 | null | 2010-12-02T16:18:50.273 | 2010-12-02T16:28:01.880 | 2010-12-02T16:28:01.880 | 363,551 | 363,551 | [
"css"
] |
4,337,231 | 1 | null | null | 1 | 894 | What's the best way to add an additional property called "UpdateType" to my "User" Entity via a Linq to SQL DBML file? There is NO associated database field in the "User" database table. This is just a property that I want to be included in with my "User" class.

I have the so the DBML designer automatically orders all of the DataMember properties so I can't just extend the partial class and add a new property like I normally would do if it wasn't serialized for WCF.

If I add another property I want the UpdateType to be included in the Order so that i can insure that the order doesn't change and break my service's Contract.
| Add additional Property to a DBML generated Entity not in database | CC BY-SA 2.5 | 0 | 2010-12-02T16:23:32.373 | 2013-08-21T19:28:53.890 | 2013-08-21T19:28:53.890 | 861,716 | 47,167 | [
"wcf",
"linq-to-sql"
] |
4,337,522 | 1 | 4,337,822 | null | 0 | 1,241 | I want a simple loading bar to display while I am loading an html web page. I want something similar to the look and feel of the animation that shows while windows in preparing to copy files (before it starts the percentage loader).

Can't use an animated gif, cause gifs freeze when the browser is overloaded. However, if anyone knows of a gif similar to the loader above, I will be willing to look at it. I have already made a javascript loading animation, but when other large scripts are running, the animation freezes.
This is why I would like to find one in flash. I am not a flash programmer, I code javascript. I just need a simple repeating flash loading animation similar to the one shown. I do not want a percentage to be shown. I have googled it for quite sometime now with no luck.
The answer with the best flash loading animation will be the solution.
Thanks for your help. I am still googling...
| Windows 7-like Loading Animation | CC BY-SA 2.5 | null | 2010-12-02T16:49:26.273 | 2017-04-03T03:22:44.790 | null | null | 358,834 | [
"flash",
"animated-gif",
"pageload"
] |
4,337,511 | 1 | 4,344,370 | null | 0 | 485 | I generate panels dynamically and put them in other states in that way so in one state you have a list of panels on the left and one big panel on the right for example in one state and when you click on the list on the left (with small panels) that panels takes the places of the big panel and the big one goes back in the place. So I have 50 panels on the left and i want to scroll them down but I don't want to big panel to go down with them I want it fixed.
this is where I got and I don't know how to do that
here is my code:
```
enter code here
```
protected function canvas1_creationCompleteHandler(event:FlexEvent):void
{
```
blurEffect= new BlurEffect(myBlur,myUnBlur);
listEventsResult.token=eventService.listEvent();
blurEffect.initFilter(event);
panels=generatePanels(panelNumber);
var vBox:VGroup= new VGroup();
states=statesList.toArray();
trace("stavi sequence i sostojba e"+ states[0].toString());
for(var i:int=0; i<panelNumber ;i++) // get panel from list panels and set states
{
addChild(panels.getItemAt(i) as Panel);
(states[i] as State).overrides=[ new SetProperty(panels.getItemAt(i),"x",110), new SetProperty(panels.getItemAt(i),"y",0),
new SetProperty(panels.getItemAt(i),"width",widthBigPanel), new SetProperty(panels.getItemAt(i),"height",heightBigPanel)
//,new AddChild(g2,(panels.getItemAt(k) as Panel))
//,new SetProperty(panels.getItemAt(i),"scaleZ",110)
];
trace("vlegov override za new state");
var yy:int=0;
for(var k:int=0;k<panelNumber;k++)
{
trace("menuvam state: yy = " + yy);
if(k!=i){
vBox.addChild(panels.getItemAt(k) as Panel);
(states[i] as State).overrides = (states[i] as State).overrides.concat([ new SetProperty(panels.getItemAt(k),"x",x), new SetProperty(panels.getItemAt(k),"y",yy),
new SetProperty(panels.getItemAt(k),"width",widthPanel), new SetProperty(panels.getItemAt(k),"height",heightPanel)
//,new AddChild(g1,(panels.getItemAt(k) as Panel))
]);
yy+=110;
}
}
for(z=0; z<(states[i] as State).overrides.length; ++z){
var tempSetProperty:SetProperty= (states[i] as State).overrides[z] as SetProperty;
trace("\nname: " + tempSetProperty.name);
trace("target: " + tempSetProperty.target);
trace("value: " + tempSetProperty._value);
}
setCurrentState("state0");
addChild(vBox);
}
//sequence.targets=panels.toArray();
t1.targets=panels.toArray();
}
```
| How to scroll elements on canvas in different states and in different containers and not move others | CC BY-SA 2.5 | 0 | 2010-12-02T16:48:22.703 | 2010-12-03T09:58:24.360 | null | null | 519,442 | [
"apache-flex",
"scroll",
"state",
"move",
"dynamic"
] |
4,337,484 | 1 | 4,340,113 | null | 2 | 2,069 | I have used [this page](http://msdn.microsoft.com/en-us/library/ms753256.aspx) from MSDN to apply a custom style to my slider control. It works perfectly at run-time as shown in the image below, but at design time, the entire slider control is not visible (hidden/collapsed??). How can I get the slider to be visible at design time?
Slider at run-time:

The XAML showing my implementation of the custom slider on my WPF window:
```
<Slider Grid.Column="1"
Style="{StaticResource sldGradeability}"
Orientation="Vertical"
Name="sldGrade" Maximum="90" Minimum="0"
SmallChange="1" LargeChange="10"
Margin="5,20,10,20"/>
```
The XAML for my custom slider style:
```
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!--<SnippetSlider>-->
<Style x:Key="SliderButtonStyle"
TargetType="{x:Type RepeatButton}">
<Setter Property="SnapsToDevicePixels"
Value="true" />
<Setter Property="OverridesDefaultStyle"
Value="true" />
<Setter Property="IsTabStop"
Value="false" />
<Setter Property="Focusable"
Value="false" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type RepeatButton}">
<Border Background="Transparent" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--<SnippetThumb>-->
<Style x:Key="SliderThumbStyle"
TargetType="{x:Type Thumb}">
<Setter Property="SnapsToDevicePixels"
Value="true" />
<Setter Property="OverridesDefaultStyle"
Value="true" />
<Setter Property="Height"
Value="16" />
<Setter Property="Width"
Value="25" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Thumb}">
<Polygon x:Name="polyThumb"
Cursor="Hand"
StrokeThickness="1"
Points="0,8 6,16 24,16 24,0 6,0"
Stroke="{StaticResource brsDarkGrayText}"
Fill="{StaticResource ButtonNormal}"/>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver"
Value="True">
<Setter TargetName="polyThumb"
Property="Fill"
Value="{StaticResource ButtonOver}" />
</Trigger>
<Trigger Property="IsDragging"
Value="True">
<Setter TargetName="polyThumb"
Property="Fill"
Value="{StaticResource ButtonDown}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--Template when the orientation of the Slider is Vertical.-->
<ControlTemplate x:Key="VerticalSlider"
TargetType="{x:Type Slider}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid Grid.Column="0">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="90°" Style="{StaticResource SimpleTextRight}"/>
<TextBlock Grid.Row="1" Text="80°" Style="{StaticResource SimpleTextRight}"/>
<TextBlock Grid.Row="2" Text="70°" Style="{StaticResource SimpleTextRight}"/>
<TextBlock Grid.Row="3" Text="60°" Style="{StaticResource SimpleTextRight}"/>
<TextBlock Grid.Row="4" Text="50°" Style="{StaticResource SimpleTextRight}"/>
<TextBlock Grid.Row="5" Text="40°" Style="{StaticResource SimpleTextRight}"/>
<TextBlock Grid.Row="6" Text="30°" Style="{StaticResource SimpleTextRight}"/>
<TextBlock Grid.Row="7" Text="20°" Style="{StaticResource SimpleTextRight}"/>
<TextBlock Grid.Row="8" Text="10°" Style="{StaticResource SimpleTextRight}"/>
<TextBlock Grid.Row="9" Text="0°" Style="{StaticResource SimpleTextRight}"/>
</Grid>
<TickBar Grid.Column="1" x:Name="TopTick"
SnapsToDevicePixels="True"
Placement="Left"
Width="5"
Visibility="Visible"
TickFrequency="10"
Fill="{StaticResource brsDarkGrayText}"/>
<Border x:Name="TrackBackground"
Margin="0"
CornerRadius="2"
Width="5"
Grid.Column="2"
BorderThickness="0">
<Border.Background>
<LinearGradientBrush EndPoint="1,0"
StartPoint="0,0">
<GradientStop Color="{StaticResource LightGrayGradient}"
Offset="0" />
<GradientStop Color="{StaticResource MediumGrayGradient}"
Offset="1" />
</LinearGradientBrush>
</Border.Background>
</Border>
<Track Grid.Column="2"
x:Name="PART_Track">
<Track.DecreaseRepeatButton>
<RepeatButton Style="{StaticResource SliderButtonStyle}"
Command="Slider.DecreaseLarge" />
</Track.DecreaseRepeatButton>
<Track.Thumb>
<Thumb Style="{StaticResource SliderThumbStyle}" />
</Track.Thumb>
<Track.IncreaseRepeatButton>
<RepeatButton Style="{StaticResource SliderButtonStyle}"
Command="Slider.IncreaseLarge" />
</Track.IncreaseRepeatButton>
</Track>
<TickBar x:Name="BottomTick"
SnapsToDevicePixels="True"
Grid.Column="3"
Fill="{StaticResource brsDarkGrayText}"
Placement="Right"
Width="4"
Visibility="Collapsed" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="TickPlacement"
Value="TopLeft">
<Setter TargetName="TopTick"
Property="Visibility"
Value="Visible" />
</Trigger>
<Trigger Property="TickPlacement"
Value="BottomRight">
<Setter TargetName="BottomTick"
Property="Visibility"
Value="Visible" />
</Trigger>
<Trigger Property="TickPlacement"
Value="Both">
<Setter TargetName="TopTick"
Property="Visibility"
Value="Visible" />
<Setter TargetName="BottomTick"
Property="Visibility"
Value="Visible" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<!--Slider Control-->
<Style x:Key="sldGradeability"
TargetType="{x:Type Slider}">
<Setter Property="SnapsToDevicePixels"
Value="true" />
<Setter Property="OverridesDefaultStyle"
Value="true" />
<Setter Property="Visibility"
Value="Visible"/>
<Style.Triggers>
<Trigger Property="Orientation"
Value="Vertical">
<Setter Property="MinWidth"
Value="21" />
<Setter Property="MinHeight"
Value="104" />
<Setter Property="Template"
Value="{StaticResource VerticalSlider}" />
</Trigger>
</Style.Triggers>
</Style>
<!--</SnippetSlider>-->
</ResourceDictionary>
```
| Why is my custom Slider not visible at design time? | CC BY-SA 2.5 | null | 2010-12-02T16:45:17.027 | 2010-12-02T21:45:23.093 | null | null | 107,899 | [
"wpf",
"visual-studio-2010",
"controls",
"styles"
] |
4,337,845 | 1 | 4,338,205 | null | 3 | 1,184 | After I updated my ASP MVC 3 application from the beta version to the realease candidate I encounter this error:
```
{"Method not found: 'Void System.Web.Mvc.GlobalFilterCollection.Add(System.Object, System.Nullable`1<Int32>)'."}
```
The error occurs in `Global.asax` inside this code:
```
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
RegisterGlobalFilters(GlobalFilters.Filters); // <-- Here
RegisterRoutes(RouteTable.Routes);
}
```
Here is my `RegisterGlobalFilters()`
```
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
}
```
Here is the details of my System.Web.MVC.dll:

The System.Web.MVC.dll file is actually missing from the assembly folder, should it be here?

Here is a screenshot of all MVC applications installed on my computer, the beta was unsintalled before I did a new install of RC, I also installed through Microsoft Web Platform Installer so I think it should be ok:

Anyone got a clue?
| Error after updating from ASP MVC 3 Beta to RC | CC BY-SA 2.5 | null | 2010-12-02T17:22:23.603 | 2010-12-02T18:34:43.933 | 2010-12-02T18:34:43.933 | 219,443 | 219,443 | [
"asp.net-mvc",
"asp.net-mvc-3"
] |
4,337,905 | 1 | 4,338,201 | null | 5 | 3,539 | Okay... first off I'm just going to explain something about what the architecture I'm after looks like.

I am trying to implement a Stats Manager for my Stats objects. This stats manager is designed using templates (see declaration in the pic).The StatMgr holds a map (not STL) that maps a string implementation to a smart pointer (which is also a template), ARef. The specific sub-classes of StatMgr statically declare the template class of their parent StatMgr on construction (see LStatMgr and RStatMgr), and so themselves are not template classes.
This allows me to do things like:
```
LStatMgr myLStatMgr(10);
if(myLStatMgr.remove(acKey))
cout << "Remove was good" << endl;
//No need to delete :)
```
OR
```
ARef<LStat> oLStat = NULL;
myLStatMgr.getNextStat(acKey,oLStat);
if(oLStat != NULL)
oLStat->doSomethingLStatLike();
```
However that was before mister linker and madam compiler decided to join forces and thwart my attempts at progress (I still have to test the functionality and memory use!).
As it stands I have the following error and warning per stat class:
> .\StatsMgr.cpp(740) : warning C4661:
'void StatsMgr::vPrint()' : no suitable
definition provided for explicit
template instantiation request
.\StatsMgr.cpp(740) : warning C4661:
'void StatsMgr::vPrint()' : no suitable
definition provided for explicit
template instantiation request
.\StatsMgr.cpp(104) : error C2084:
function 'StatsMgr::StatsMgr(const
enum doCollect,const int)' already has
a body .\StatsMgr.cpp(104) : error
C2084: function 'StatsMgr::StatsMgr(const
enum doCollect,const int)' already has
a body
:: at line 740 there are delarations as so:
```
template class StatsMgr<LStat>;
template class StatsMgr<RStat>;
```
I added this because if I don't do that then I end up with a mess of linker errors (see them below). However there ARE declarations and implementations of vPrint() in all of the Stat subclasses!
The base class "StatsMgr" has a defined COTR, as do the subclasses (LStatMgr & RStatMgr). Why does the inheritance not simply sort this out? Obviously this is something to do with the explicit template instances at the end of the CPP but I cannot understand what exactly is going on.
Below is from StatsMgr.cpp
```
template<class type>
StatsMgr<type>::StatsMgr(const doCollect eOption, const int nListSize) :
oMyMap(wHashString, nListSize), oMyMapIter(oStatsList)
{
m_eCollectionOption = eOption;
}
```
Below is from LStatMgr.cpp
```
LStatMgr::LStatMgr(const doCollect eOption, const int nListSize) :
StatsMgr<LStat> (eOption, nListSize)
{
}
```
I tried substituting
```
class LStatMgr;
class RStatMgr;
```
for the template declarations and this gets passed the compile errors but then the linker cannot find any non-overridden functions. For example if I have a function in StatMgr called "getNextStat()" and override that in RStatMgr but not in LStatMgr, then the linker complains about that. Why is inheritance not covering this situation?
It makes me sad. I may have to fall back to composition (which should be preferred, but not in this situation).
By the way... I am compiling with MSVC++ 4.1 (!!!), so I understand if you cannot duplicate, but please help.
Thanks,
Dennis. (sorry about the very long post)
| C++ How can I use template collections of template objects with inheritance? | CC BY-SA 2.5 | null | 2010-12-02T17:28:29.987 | 2010-12-03T17:49:06.660 | 2010-12-03T17:49:06.660 | 509,614 | 509,614 | [
"c++",
"visual-c++",
"templates",
"inheritance",
"linker"
] |
4,338,174 | 1 | 4,363,830 | null | 0 | 389 | 
Hi everyone,
In sharepoint I am showing the list of titles and on hover it should show me the description. But somehow with my css i cannot see the description properly.
Please find the image on the top and the css below.
CSS:
```
<style>
span.summary {
position: relative;
BACKGROUND: none transparent scroll repeat 0% 0%;
}
.ms-vb span.summary a {
background-color: #DFDFDF;
}
span.summary a span {
display: none;
}
span.summary a:hover {
font-size: 100%;
font-color: #000000;
}
span.summary a:hover span {
display: block;
position: absolute;
margin-top: 10px;
margin-left: -10px;
width: 275px; padding: 5px;
z-index: 900;
color: #001A49;
background: #DFDFDF;
font: 12px "Helvetica";
text-align: left;
text-decoration: none;
}
.ms-alternating .ms-vb {
background-color: #DFDFDF;
}
</style>
```
| hovering on text does not show the description properly | CC BY-SA 2.5 | null | 2010-12-02T17:56:28.960 | 2010-12-06T06:26:08.540 | 2010-12-02T19:01:45.450 | 346,514 | 346,514 | [
"css",
"sharepoint"
] |
4,338,184 | 1 | 4,338,727 | null | 1 | 2,682 | I'm drawing text in OpenGL using FTGL library and everything works just fine, however I would like to add shadow to the text. What I tried is drawing same text with black color and then draw text above that with normal color like this (pseudocode):
```
glColor3f(0, 0, 0); // outline color
DrawText(x-1, y-1, str);
DrawText(x+1, y-1, str);
DrawText(x+1, y+1, str);
DrawText(x-1, y+1, str);
glColor3f(1, 1, 1); // primary color
DrawText(x,y,str);
```
But I have to draw the text 5 times and it still does not look very good.
I would like to get something like on the screenshot

| Drawing text with shadow in OpenGL + FTGL | CC BY-SA 3.0 | 0 | 2010-12-02T17:57:55.187 | 2012-11-02T17:05:33.963 | 2012-07-03T19:02:17.447 | 44,729 | 118,767 | [
"opengl",
"text",
"drawing",
"ftgl"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.