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,149,214 | 1 | 4,149,373 | null | 2 | 3,626 | I have a large dataset with the lifespan of threads on an discussion board. I want a histogram that shows the distribution of lifespan, so I did this:
```
dall <- read.csv("lifespan.csv")
colnames(dall) <- c("thread.id", "seconds.alive", "start.time")
hist(dall$seconds.alive)
```
which generated this hard to read image:

My questions are
a) is changing y-axis to a log-scale a good way to make it more readable? Apparently [some people think is a bad idea](http://finzi.psych.upenn.edu/Rhelp10/2010-August/250909.html) to change y-axis to log.
b) how do I do that?
| how to use a log scale for y-axis of histogram in R? | CC BY-SA 2.5 | 0 | 2010-11-10T21:23:50.123 | 2016-02-21T12:08:10.317 | null | null | 114,989 | [
"r",
"statistics",
"histogram"
] |
4,149,310 | 1 | 4,149,400 | null | -3 | 1,380 | I am using the [Z-transform](http://en.wikipedia.org/wiki/Z-transform) properties with the inverse Z-transform by MATLAB.
I cannot find a function that would apply the Z-tranform properties to convert the result by `residuez` to the time domain. Here is the image of question,

## Edit
I can't believe such a powerful math language does not have functions to convert using the Z-transform table and Laplace transform tables.
| Using the Z-transform properties with the inverse z transform by MATLAB | CC BY-SA 2.5 | null | 2010-11-10T21:35:35.887 | 2014-04-14T10:54:57.250 | 2011-03-27T14:42:49.450 | 63,550 | 287,745 | [
"function",
"matlab"
] |
4,149,419 | 1 | 4,149,760 | null | 2 | 2,779 | This is default layout of the panes in dnn 5.5.

Is it possible to change that into 3x3 grid with equal sized squares ?
| How to change layout in dot net nuke 5.5? | CC BY-SA 3.0 | 0 | 2010-11-10T21:46:37.837 | 2013-02-03T21:59:33.827 | 2013-02-03T21:59:33.827 | 1,921,273 | 423,278 | [
"layout",
"dotnetnuke"
] |
4,149,523 | 1 | 4,149,704 | null | 0 | 4,594 | I have a little weird behavior with my ASP.NET MVC 2 application.
I'm using IIS 7.5, Windows Authentication and ASP.NET Impersonation for my webpage to load.
After several searches, I didn't found a nice way to get rid of the 500.24 Request that I keep getting on every page load (The favicon.ico at the root directory triggers this) :

I've looked at some articles like [this one](http://mvolo.com/blogs/serverside/archive/2007/12/08/IIS-7.0-Breaking-Changes-ASP.NET-2.0-applications-Integrated-mode.aspx) or [that one](http://haacked.com/archive/2008/07/14/make-routing-ignore-requests-for-a-file-extension.aspx) but this doesn't seems to solve my issue. I need these settings on for my application to work here : .NET 4 Framework Integrated Mode pipeline, Windows Authentification and ASP.NET Impersonation.
Here's a simplified version of my web.config, if it can help anyone (of course, I've removed the connections strings for security reasons..)
```
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<customErrors mode="Off" />
<identity impersonate="true" />
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add assembly="System.Data.Entity.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</assemblies>
</compilation>
<authentication mode="Windows">
<!-- roleManager enabled="true" defaultProvider="AspNetWindowsTokenRoleProvider" / -->
<!-- forms loginUrl="~/Account/LogOn" timeout="2880" / -->
</authentication>
<membership>
<providers>
<clear />
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/Globe" />
</providers>
</membership>
<profile>
<providers>
<clear />
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/Globe" />
</providers>
</profile>
<roleManager enabled="false">
<providers>
<clear />
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/Globe" />
<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/Globe" />
</providers>
</roleManager>
<pages>
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
</namespaces>
</pages>
</system.web>
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="X-UA-Compatible" value="IE=edge" />
</customHeaders>
</httpProtocol>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true">
<remove name="WebDAVModule" />
</modules>
<security>
<requestFiltering>
<verbs>
<add verb="PUT" allowed="true" />
<add verb="DELETE" allowed="true" />
</verbs>
</requestFiltering>
</security>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
</system.serviceModel>
</configuration>
```
My application IS working, the favicon.ico IS loading, I'm just wondering why it does fires a 500.24 on every request (Of course, maybe it's Fiddler who can't authenticate itself and causes de 500.24 HTTP Error, but when it does normally it triggers a 401.2 - Unauthorized instead...)
| ASP.NET MVC 2 & IIS : HTTP 500.24 favicon.ico Error | CC BY-SA 2.5 | null | 2010-11-10T21:58:14.737 | 2010-11-11T16:33:19.550 | 2010-11-11T09:52:23.477 | 419 | 464,209 | [
"iis",
"asp.net-mvc-2",
"httprequest",
"fiddler",
"favicon"
] |
4,149,644 | 1 | 4,149,850 | null | 0 | 975 | OK I'm pulling my hair on on this, it makes no sense so it must either be a bug, or some extremely stupid mistake I'm making.
Here's the situation: I have a UIViewController with a xib file. It has a UIView hooked up to the view property, a UIImageView hooked up to a property called imageView, and a UISegmentedControl hooked up to segmentControl.
Yet in my code, I'm unable to assign an image to the image view. When I NSLog the object, I'm getting the address of 0x0, so it's not associating at all. I have the bindings set up in Interface builder, I've restarted XCode and clean and built the project. Nothing is working and I've wasted a stupid amount of time trying to figure this out at this point. I've also NSLoged the segmentControl object and am getting 0x0 as well. So nothing from the XIB is hooking up with the code, but the XIB itself is loading because the objects are displayed on the screen.
Does anyone have any ideas offhand of what I could be missing? This is such a simple thing, it's incredibly frustrating that it's refusing to work all of a sudden.
---
Here's the code below, in this case I'm accessing the objects in the setter for projectId, but I also tried accessing the imageView from another class and it didn't work either (and yes I had a @property declaration and synthesize for imageView when I tried).
DiagramViewController.h:
```
#import <UIKit/UIKit.h>
@interface DiagramViewController : UIViewController
{
NSUInteger projectId;
IBOutlet UIImageView *imageView;
IBOutlet UISegmentedControl *segmentControl;
}
@property NSUInteger projectId;
@end
```
DiagramViewController.m:
```
#import "DiagramViewController.h"
@implementation DiagramViewController
@synthesize projectId;
-(void)setProjectId:(NSUInteger)projId
{
NSLog(@"imageView: %@", imageView);
NSLog(@"segmentControl: %@", segmentControl);
projectId = projId;
NSString *filePath = [[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"%i_schem", projectId] ofType:@"png" inDirectory:@"project-details/images/diagrams"];
NSData *imageData = [NSData dataWithContentsOfFile:filePath];
imageView.image = [UIImage imageWithData:imageData];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Overriden to allow any orientation.
return YES;
}
- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
- (void)viewDidUnload {
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (void)dealloc {
[super dealloc];
}
@end
```
And here's an image of the Interface Builder hookups:

| Objects in nib file not associating with IBOutlet objects in code | CC BY-SA 2.5 | null | 2010-11-10T22:14:07.687 | 2010-11-10T22:54:08.657 | 2010-11-10T22:42:10.100 | 299,262 | 299,262 | [
"iphone",
"objective-c"
] |
4,149,786 | 1 | null | null | 0 | 2,093 | I've downloaded [Eclipse for C/C++ for Mac OSX](http://www.eclipse.org/downloads/packages/eclipse-ide-cc-developers/heliossr1). I'm running Snow Leopard. Now, when trying to run the Hello World application on Eclipse, it is complaining that

What might be the issue? Maybe I don't have (or Eclipse can't find) where my C++ compiler is? If that is the issue, what should I install and how should I proceed so that Eclipse recognizes it?
| Making Eclipse for C++ developers compile | CC BY-SA 3.0 | null | 2010-11-10T22:34:13.753 | 2013-02-03T22:08:59.953 | 2013-02-03T22:08:59.953 | 1,921,273 | 130,758 | [
"c++",
"eclipse",
"macos",
"osx-snow-leopard"
] |
4,149,953 | 1 | null | null | 12 | 15,286 | My app has a tabhost with four tabs, and now I'm trying to make nice layouts for landscape mode. In order to make use of additional horizontal space I want to put TabWidget at the right side of the screen, and of cource all tabs must be one under another (like in a column).
But when switching to landscape mode all tabs get aligned in a row, it looks quite ugly. How to fix that?

```
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_weight="1">
<include layout="@layout/filter_wizard"/>
<include layout="@layout/filter_wizard"/>
<include layout="@layout/filter_wizard"/>
<include layout="@layout/filter_wizard"/>
</FrameLayout>
<TabWidget
android:background="#75ffffff"
android:id="@android:id/tabs"
android:layout_width="wrap_content" android:orientation="vertical"
android:layout_height="fill_parent" android:layout_weight="0" />
</LinearLayout>
</TabHost>
```
| android:orientation="vertical" does not work for TabWidget | CC BY-SA 3.0 | 0 | 2010-11-10T23:00:05.717 | 2014-10-02T11:52:02.087 | 2011-12-04T01:08:33.743 | 84,042 | 461,774 | [
"android",
"tabwidget"
] |
4,150,171 | 1 | 4,152,016 | null | 154 | 318,348 | In R I can create the desired output by doing:
```
data = c(rep(1.5, 7), rep(2.5, 2), rep(3.5, 8),
rep(4.5, 3), rep(5.5, 1), rep(6.5, 8))
plot(density(data, bw=0.5))
```

In python (with matplotlib) the closest I got was with a simple histogram:
```
import matplotlib.pyplot as plt
data = [1.5]*7 + [2.5]*2 + [3.5]*8 + [4.5]*3 + [5.5]*1 + [6.5]*8
plt.hist(data, bins=6)
plt.show()
```

I also tried [the normed=True parameter](http://matplotlib.sourceforge.net/examples/api/histogram_demo.html) but couldn't get anything other than trying to fit a gaussian to the histogram.
My latest attempts were around `scipy.stats` and `gaussian_kde`, following examples on the web, but I've been unsuccessful so far.
| How to create a density plot in matplotlib? | CC BY-SA 2.5 | 0 | 2010-11-10T23:39:59.287 | 2020-10-23T17:02:28.227 | null | null | 125,801 | [
"python",
"r",
"numpy",
"matplotlib",
"scipy"
] |
4,150,196 | 1 | 4,150,204 | null | 0 | 293 | I'm getting started with JQuery, and I've built a little js function that adds fields to a form when it gets called.
```
function newPoint(time){
$('<br/>At '+ time + ' seconds, bring object <select><option>in</option><option>out</option></selection> at <select><option>regular</option><option>slow</option><option>fast</option></selection> speed.<br/>').insertBefore('#submitBtn');
}
```
Here's the html...
```
<div id="rightSide">
<form> <input id="submitBtn" type="submit" value="Go"></form>
</div>
```
When the function runs, the insert works but the word 'at' in between the drop downs and the word 'speed' at the end don't get inserted.

Why is this? I imagine I'm misunderstanding something pretty key to the way jquery or js works. (I'm just getting my feet wet.) If that's the case, can you point me in the right direction of understanding, rather than just helping me figure out the issue here?
Thanks!
Edit: With that fixed (stupid fingers), another question pops up...
When I remove the line break <br/> at the beginning of the insert, I lose the text up to the the first drop down box. Any thoughts on why that is?
| Text goes missing with jquery .insertBefore() | CC BY-SA 2.5 | null | 2010-11-10T23:45:40.577 | 2010-11-11T00:13:03.667 | 2010-11-11T00:13:03.667 | 336,781 | 336,781 | [
"javascript",
"jquery",
"ajax"
] |
4,150,276 | 1 | 4,175,998 | null | 1 | 733 | 
That is how devise is sending the registration confirmation: `subjectConfirmation instructions` is strange. Why is the subject wacky and how can I change it?
| Devise registration confirmation wacky | CC BY-SA 2.5 | 0 | 2010-11-10T23:59:53.057 | 2010-11-14T03:03:36.037 | null | null | 225,727 | [
"ruby-on-rails",
"email",
"devise"
] |
4,150,903 | 1 | 4,151,080 | null | 20 | 8,463 | I'm trying to emulate Apple's "Slide to Unlock" feature in my application. I get to this point (image below), but as you can see the UISlider's "track" is visible and is covering up my text. Is there a way to change an attribute programmatically that will make the "track" invisible?

Please let me know if you need any of my code.
Thanks in advance!
EDIT: If I change the slider's alpha to 0, it gets rid of my sliding button, so doing that won't work unless I'm doing it wrong. :)
| How to make UISlider's "track" invisible? | CC BY-SA 2.5 | 0 | 2010-11-11T02:25:16.770 | 2018-07-28T05:18:24.090 | 2010-11-11T02:34:33.107 | 456,851 | 456,851 | [
"iphone",
"objective-c",
"opacity",
"uislider"
] |
4,151,013 | 1 | null | null | 4 | 463 | Does anyone know why the search text remains on the bottom of screen (as shown in image below). Steps to get there:
- - -

-

. This does not happen all the time.
- -
| Auto complete text remaining on screen | CC BY-SA 2.5 | null | 2010-11-11T02:55:19.380 | 2011-08-31T20:33:20.443 | 2010-11-15T19:11:09.673 | 2,186,261 | 2,186,261 | [
"android",
"autocomplete",
"android-sdk-2.1"
] |
4,151,162 | 1 | 4,414,525 | null | 2 | 1,135 | I'm trying to figure out the best patterns for making a jQuery-based or CSS-based pop-up menu when clicking a button.
I'd like to have something like this:

I'm not even sure how to conceptualize going about this, so any help would be appreciated. Make it high-level if you want, though a working example (JSFiddle) would be best.
Thanks!
| Patterns for a jQuery or CSS pop-up menu from a button | CC BY-SA 2.5 | null | 2010-11-11T03:35:45.283 | 2010-12-11T00:45:06.703 | null | null | 373,496 | [
"jquery",
"css",
"menu",
"popup"
] |
4,151,302 | 1 | null | null | 3 | 6,439 | I'm learning java and I would like to know how to compile a java program from other directory.
For example, my compiler is in my drive `c:\` and I want to compile my java program from drive `e:\`
How should I do that?
I'm getting this error, what does it mean?

| How to compile a java program from directory? | CC BY-SA 2.5 | 0 | 2010-11-11T04:10:25.280 | 2011-01-14T17:04:12.580 | null | null | 396,335 | [
"java",
"compilation"
] |
4,151,696 | 1 | null | null | 1 | 1,441 | I've got a file that is a binary java file that was compiled using a proprietary program. I've tried to open this up in some of the standard decompilers but they will not recognize it.
I suspect it's because some specific proprietary headers have been added, based on looking at the file in a hex editor. Is there any way to detect where the java bytecode begins and ends on this file, or how to extract it so I can run it through a decompiler like [this](http://java.decompiler.free.fr) one? Any help is much appreciated.
As a side note i'd like to know how this was achieved, in other words what facility/feature of Java allows you to use their compiler in such a customized way as this?

P.S. The image is bigger if you open it in another tab.

| Decompile compiled Java file with proprietary headers | CC BY-SA 2.5 | null | 2010-11-11T05:48:28.033 | 2015-06-15T03:37:31.277 | 2015-06-15T03:37:31.277 | 64,046 | 56,753 | [
"java",
"decompiling"
] |
4,151,815 | 1 | 4,198,424 | null | 14 | 2,185 | When you view a page from my site in [Google Instant Previews](http://www.google.com/landing/instantpreviews/), you see an AJAX error message (caused by some AJAX that fires on document ready):

I assume the way to fix this is to make my javascript compatible with whatever javascript engine Google's "browser" uses (like one might design for IE6).
So: what javascript does Google Instant Previews understand?
| How do I make my page look good in Google Instant Previews? | CC BY-SA 2.5 | 0 | 2010-11-11T06:10:57.300 | 2010-11-19T06:54:30.167 | null | null | 25,068 | [
"javascript",
"cross-browser",
"google-instant-previews"
] |
4,152,032 | 1 | 4,161,181 | null | 0 | 401 | Pawnshop business model:
CLIENTES (customer table), LOTES (lot table), ARTICULOS (item table) and TRANSACCIONES (transaction table).
The reason I defined a lot table is because when customers pawn or sell items, the pawnshop groups all these items into one lot, calculates the total loan or purchase amount, stores these values under one transaction and prints the ticket with a description of all the items and total amount. So I want the ability to say, if customer defaults on interest payments or does not redeem pawn, then customer forfeits all items and pawnshop may choose to sell some items to gold refinery and/or transfer other non-gold items to inventory to sell to the public. In other words, I want the ability to do a break-out explosions of each item.
Would the above ER be adequate for this capability?
| Is this a correct schema design for what I need to accomplish? | CC BY-SA 2.5 | null | 2010-11-11T06:53:33.573 | 2010-11-12T02:45:49.873 | null | null | 366,797 | [
"schema",
"modeling",
"database-design"
] |
4,152,346 | 1 | 4,152,719 | null | 17 | 9,948 | We're trying to figure out validation in the mvvm doing validation in the business logic or model.
I've implemented the validate by exception type in our business logic - a simplified diagram can be found here:

If we've got lot's of inputs that are independent of each other, there is no problem, the exception is thrown, the textbox catches it an marks it's borders red for each wrong input. However, when we've got dependent values we're in trouble.
e.g.
- Value1 and Value2 in the model must not be the same, so we've got a validate function in each of those looking for the equals value and throw an exception if that happens- now, if we set Value1 to 0 and Value2 to 1 everything is fine- Value1 gets set in the GUI to 1 --> this one gets marked red, because the validation of the other values is not triggered, so Value2 in the GUI is not marked faulty- Value2 gets set to 2 in the GUI, now we've reached a valid state, but only Value2 gets validated, so Value1 still is marked as faulty
Is there a common pattern to solve that issue? we don't want to introduce a dependency in the GUI between the two textboxes, because this logic should only be present in the business logic layer.
Instead of implementing the validate by exception one could also implement the IDataErrorInfo interface, but the problem still exists, there is no way to force depending values to validate their values again, at least none that i can see :)
Any help is appreciated
cheers,
manni
---
[cleanup, removed unecessary step]
---
15.11.2010 - Part2
ok, big rethought here, we're going with the businesslogic tier. here is our current planned configuration:

( the image is a bit small scaled here, please open it on a separate window to show it in full size)
everything is more or less clear, except how to notify all the viewmodels/model clones of the different editors if the data-model under the business logic gets changed. one way to do it is to track the cloned models in the business logic which creates them. When the data-model is changed using the business logic commit(), all the other registered model clones can be notified of the changes and propagate them further. alternatively the business logic could post an event to which all the viewmodels subscribe so that they get the changes as well - could anyone give me a hint what's better?
Thanks again for the help, sorry i'm so mind-blocked ;)
| MVVM - Validation | CC BY-SA 2.5 | 0 | 2010-11-11T07:54:04.697 | 2015-08-21T20:03:03.513 | 2010-11-16T12:50:31.387 | 435,608 | 435,608 | [
"c#",
"validation",
"mvvm",
"business-logic"
] |
4,152,579 | 1 | 4,152,595 | null | 0 | 100 | Hi all i am having a text file which consists of some data and each and every line in that particular is fixed to 94. Now when the user opened the particular text file and if my condition satisfies i will show it to datagridview. But when displaying to datagridview even the length of each and every line is 94 the content displaying in grid varies why it is happening . How to make sure that each and every row in datagridview should be displayed in a constant way

Any idea please
| How to make the grid content to be viewed with out varying the size | CC BY-SA 2.5 | 0 | 2010-11-11T08:34:41.620 | 2010-11-11T08:48:25.537 | null | null | 388,388 | [
"c#",
"winforms",
"datagridview"
] |
4,152,622 | 1 | 4,152,648 | null | 0 | 205 | This may be a dumb question, but that fuzzy blue color that you get when focusing on stuff? Yeah, the one I'm getting when focused on this `textarea` right now. I'm guessing it's a browser thing, but I want to know: what causes this?
More importantly, I notice that when -bing around my own web app, . What am I doing to cause this behavior to break, or alternately, what can I do to enable this behavior on my own site?
: There seems to be confusion about exactly what behavior I'm referring to, so here it is:

| How are inputs, links, buttons, etc able to turn that fuzzy blue color? | CC BY-SA 2.5 | null | 2010-11-11T08:40:23.830 | 2012-02-01T08:44:14.870 | 2010-11-11T08:52:00.913 | 373,496 | 373,496 | [
"css",
"keyboard",
"navigation"
] |
4,152,794 | 1 | null | null | 4 | 1,270 | I am trying to develop an app for which I want multiple screen support. I have read the Android article on Best practices for Multiple Screen Support. As per the article we have to follow 3 important things:
1. Mention support for different screen sizes(large, medium and small) and any density in AndroidManifest.xml.
2. Place images of 3 dpi's (120, 160, 240) in 3 folders res/ldpi, res/mdpi and res/hdpi.
3. In layout's the dimension should be mentioned in "dip" units. Then Android will take care of the scaling on its own.
I have implemented all these points in my project. The images are picked up correctly from the appropriate folders. But the arrangements of the controls in not same.
e.g. I ran the app on three emulators
1. Resolution 240*320 dpi 120.
2. Resolution 240*320 dpi 160.
3. Resolution 240*320 dpi 240.
(All the emulator have same resolution but different density. )
The problem is the position of the controls is not same on all the three emulator. As per my understanding if the android:layout_marginLeft and android:layout_marginTop are mentioned in "dip" then this problem should not occur. As the density of the emulator increases the controls get placed more towards the right.
Is it absolutely necessary that i provide layouts for all combination's of screen dimension and density even if the layout is same for all the devices?
Am I missing some important point?
```
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ImageView android:layout_width="fill_parent"
android:layout_height="fill_parent" android:src="@drawable/bgd" android:scaleType="fitXY">
</ImageView>
<ImageView android:id="@+id/wtButton"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:src="@drawable/button" android:layout_marginLeft="170dip"
android:layout_marginTop="9dip"></ImageView>
<ImageView android:id="@+id/htButton"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:src="@drawable/button2" android:layout_marginLeft="220dip"
android:layout_marginTop="90dip"></ImageView>
</RelativeLayout>
```
Images:

| Layout issues related to Multiple Screens Support | CC BY-SA 3.0 | null | 2010-11-11T09:08:04.730 | 2014-04-06T07:44:23.280 | 2014-03-21T20:42:15.983 | 321,731 | 370,075 | [
"android",
"layout",
"screen"
] |
4,152,840 | 1 | 4,152,942 | null | 1 | 960 | I am facing attached warning message in all HTTPS pages in IE browser. I know it throw this warning when some thing is requested from HTTP serer on HTTPS pages.
I checked everything. All images are pointing HTTPS links. JS files are also pointing to HTTPS links. But I don't know why this warning is still there.
And IE display this warning after loading the page not in between the loading process.
Can you guys point me in the right direction.
Thanks.

| How to resolve IE8 Security warning in a developer prospective | CC BY-SA 2.5 | null | 2010-11-11T09:15:11.673 | 2010-11-11T09:36:13.253 | null | null | 472,375 | [
"javascript",
"html"
] |
4,153,467 | 1 | null | null | 2 | 1,037 | I have the following controller:
```
<?php defined('SYSPATH') or die('No direct script access.');
class Controller_Static extends Controller_DefaultTemplate {
public function action_index()
{
View::set_global('message', '<span class="highlight">This is a global message.</span>');
$data = array (
'siteTitle' => 'Kohana Test Site',
'siteSubtitle' => 'A site to learn Kohana',
'menu' => View::factory('blocks/menu'),
);
$view = View::factory('templates/layout', $data);
$this->request->response = $view->render();
}
}
```
but kohana gives me the error:
> ErrorException [ Fatal Error ]: Class
'Controller_DefaultTemplate' not found
although Eclipse can find the file (via F3) and I thought Kohana was able to find all classes via autoloading?

| Why can't Kohana find my controller? | CC BY-SA 2.5 | null | 2010-11-11T10:32:49.747 | 2010-11-18T18:29:41.610 | 2010-11-18T18:29:41.610 | 213,269 | 4,639 | [
"kohana",
"autoload"
] |
4,153,445 | 1 | null | null | 0 | 1,107 | I found the GC kicks in frequently freeing memory in my map activity, I couldn't trace out the reason and this happens when map start constructing titles i.e when we slide the map. And eventually the activity stops to force quit due to memory out of bound exception. The activity points the geo points of various location stored in the arraylist. The image enclose show this.
```
public class DetailMapTab extends MapActivity{
private MapView map=null;
private MyLocationOverlay me=null;
private SitesOverlay sites=null;
String placename;
int position;
String lat;
String lon;
ArrayList<HashMap<String, String>> mylist =new ArrayList<HashMap<String, String>>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.mapdetail);
//position -> is the selected record of the list
//mylist -> contains record sets to display like name , lat and lon of various location
placename=mylist.get(position).get("Name");
lat=mylist.get(position).get("Latitude");
lon=mylist.get(position).get("Longitude");
map=(MapView)findViewById(R.id.map);
map.getController().setCenter(getPoint(Double.valueOf(lat),Double.valueOf(lon)));
map.getController().setZoom(17);
map.setBuiltInZoomControls(true);
sites=new SitesOverlay();
map.getOverlays().add(sites);
me=new MyLocationOverlay(this, map);
map.getOverlays().add(me);
}//oncreate
@Override
public void onResume() {
super.onResume();
me.enableCompass();
}
@Override
public void onPause() {
super.onPause();
me.disableCompass();
}
@Override
protected boolean isRouteDisplayed() {
return(false);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_S) {
map.setSatellite(!map.isSatellite());
return(true);
}
else if (keyCode == KeyEvent.KEYCODE_Z) {
map.displayZoomControls(true);
return(true);
}
else if (keyCode == KeyEvent.KEYCODE_H) {
return(true);
}
return(super.onKeyDown(keyCode, event));
}
private GeoPoint getPoint(double lat, double lon) {
return(new GeoPoint((int)(lat*1000000.0),(int)(lon*1000000.0)));
}
private class SitesOverlay extends ItemizedOverlay<CustomItem> {
private List<CustomItem> items=new ArrayList<CustomItem>();
public SitesOverlay() {
super(null);
//show selected record geo-point with a new map pin1
items.add(new CustomItem(getPoint(Double.valueOf(lat),Double.valueOf(lon))," ", placename,getMarker(R.drawable.pin1)));
//show the geo-points names with pin2
for(int i=0;i<mylist.size();i++)
{
if(position!=i)
{
items.add(new CustomItem(getPoint(Double.valueOf(mylist.get(i).get("Latitude")),Double.valueOf(mylist.get(i).get("Longitude"))),"",mylist.get(i).get("Name"),getMarker(R.drawable.pin2)));
}
}
}
}
populate();
}
@Override
protected CustomItem createItem(int i) {
return(items.get(i));
}
@Override
public void draw(Canvas canvas, MapView mapView,boolean shadow) {
super.draw(canvas, mapView, shadow);
}
@Override
protected boolean onTap(int i) {
//OverlayItem item=getItem(i);
Toast.makeText(getApplicationContext(),items.get(i).getSnippet(),Toast.LENGTH_SHORT).show();
return(true);
}
@Override
public int size() {
return(items.size());
}
private Drawable getMarker(int resource) {
Drawable marker=getResources().getDrawable(resource);
marker.setBounds(0, 0, marker.getIntrinsicWidth(),marker.getIntrinsicHeight());
boundCenterBottom(marker);
return(marker);
}
}
class CustomItem extends OverlayItem {
Drawable marker=null;
CustomItem(GeoPoint pt, String name, String snippet, Drawable marker) {
super(pt, name, snippet);
this.marker=marker;
}
@Override
public Drawable getMarker(int stateBitset) {
Drawable result= marker;
setState(result, stateBitset);
return(result);
}
}
public void onDestroy(){
super.onDestroy();
map=null;
me=null;
sites=null;
gr=null;
placename=null;
lat=null;
lon=null;
mylist =null;
System.gc();
}
}
```
I am glad to know the reason. The log shown as when I slide the map
```
11-11 15:39:55.072: DEBUG/dalvikvm(222): GC freed 439 objects / 83360 bytes in 106ms
11-11 15:39:56.052: DEBUG/dalvikvm(107): GC freed 3568 objects / 197464 bytes in 138ms
11-11 15:39:57.451: DEBUG/dalvikvm(222): GC freed 135 objects / 41456 bytes in 101ms
11-11 15:39:59.891: DEBUG/dalvikvm(222): GC freed 94 objects / 42112 bytes in 134ms
11-11 15:44:27.481: DEBUG/dalvikvm(104): GC freed 7472 objects / 406240 bytes in 140ms
```

| Reason for High Memory usage in Android MapView | CC BY-SA 2.5 | null | 2010-11-11T10:29:48.233 | 2010-11-11T11:49:25.220 | 2010-11-11T11:25:02.233 | 107,009 | 286,044 | [
"android",
"google-maps",
"android-mapview"
] |
4,153,579 | 1 | null | null | 0 | 3,842 | I am getting paging issue when i delete the final record from last page, how can i resolve the paging issue, pls view the screen shot which i have attached.

In Store save event i will reload the store for update the grid for remote sort.
like this
```
var fGridStore = new Ext.data.Store({
proxy:ApGrpFGrdProxy,
autoLoad :false,
autoSave:false,
idProperty:'airBasicIndex',
baseParams:{start:0, limit:25},
reader:firstGridreader,
writer: fssuperGrdWriter,
listeners:{
save :function ( St, records, options ){
St.reload();
}
},
remoteSort:true
});
```
In Grid..
```
bbar: new Ext.PagingToolbar({
pageSize: 25,
store: fGridStore,
displayInfo: true,
emptyMsg: "No records to display"
}),
```
Thanks in advance
| Extjs Grid Paging bar problem | CC BY-SA 2.5 | null | 2010-11-11T10:46:14.427 | 2012-09-24T23:36:01.010 | 2010-11-12T20:20:23.277 | 402,253 | 95,373 | [
"extjs"
] |
4,154,177 | 1 | 4,154,270 | null | 10 | 36,792 | Firstly, I would like to show you a image(made in paint).

Okay "current" is what I have now. I want to place a box over the image to the right, with black background, and then have text inside this box.
I tried myself using z-index and so, but without any success. Here's what I tried:
```
<div> <!-- start div for image -->
<img style="z-index: -1;" src="1.jpg" width="860" height="240"> <!-- the image -->
</div> <!-- end div -->
<div style="z-index: 1; width: 300px; background: #000; position: relative;">
<div style="margin: auto;">
text text text
</div>
</div>
```
but this didnt turn out any good. How can i do this?
| CSS: Box+text over image | CC BY-SA 3.0 | 0 | 2010-11-11T12:02:26.783 | 2015-04-20T20:08:49.257 | 2014-09-20T14:05:35.237 | 124,238 | 267,304 | [
"html",
"css",
"overlay",
"z-index"
] |
4,154,193 | 1 | null | null | 3 | 2,910 | What is this widget called (the one with the three buttons), anyone knows?

| How is this floating menu implemented? | CC BY-SA 2.5 | 0 | 2010-11-11T12:04:10.817 | 2017-07-25T17:45:44.967 | 2010-11-11T12:13:56.153 | 28,169 | 102,092 | [
"android",
"android-custom-view"
] |
4,154,233 | 1 | 4,154,422 | null | 0 | 3,229 | I include jquery into my module with `DotNetNuke.Framework.jQuery.RequestRegistration();` and it works like expected.
Other scripts I include into my DNN portal via Page Settings/Advanced Settings/Page Header Tags.
They also get loaded, but they don't work as expected.
In my case I want to have tabs in one of my dnn modules and I'm using jqueryUI to do this. If I test this module outside of DNN it works like it should, but when installed into DNN something goes wrong.
I get the tabs created but I can't switch betwen them. Actualy I see all of the content which should be in separated tabs in the same page.

This is my Js code from module.ascx file.
```
<script type="text/javascript">
jQuery(document).ready(function ($) {
$("#<%= pnlTabs.ClientID %>").tabs();
});
</script>
```
how to correct this ?
I think that problem is that all this different JS libs get mixed. So what is the correct way to include another JS libs into DNN module.
---
EDIT:
I found the problem. Can you help fix it ?
```
<li><a href="DesktopModules/OsControl/#dnn_ctr380_osControl_pnlProcesses">Processes</a></li>
<div id="dnn_ctr380_OsControl_pnlProcesses" style="text-align:left;">
```
Problem is that DNN prepends "DesktopModules/OsControl/" to the link in "li" element. How to prevent this or any other way around this ?
---
EDIT2:
```
<asp:BulletedList ID="BulletedList1" runat="server" BulletStyle="NotSet" DisplayMode="HyperLink">
<asp:ListItem Value="#OsControl_pnlProcesses">Processes</asp:ListItem>
<asp:ListItem Value="#OsControl_pnlServices">Services</asp:ListItem>
<asp:ListItem Value="#OsControl_pnlEvents">Events</asp:ListItem>
</asp:BulletedList>
```
This is how I create links.
| How to proper include JS libs (jqueryUI, jquery plugins) into DNN 5 module ? | CC BY-SA 3.0 | 0 | 2010-11-11T12:09:18.320 | 2013-03-07T19:39:12.173 | 2013-03-07T19:39:12.173 | 918,414 | 423,278 | [
"javascript",
"jquery-ui",
"dotnetnuke",
"dotnetnuke-module"
] |
4,154,260 | 1 | 4,154,276 | null | 0 | 253 | I have two tables (picture), AirportIn is a foreign key of AirportID, and AirportOut is also a foreign key of AirportID.

The problem is I can't make relations between these tables like this:
```
dataset.Relations.Add("AirportFlight", dataset.Tables["Airport"].Columns["AirportID"], dataset.Tables["Flight"].Columns["AirportIn"]);
dataset.Relations.Add("AirportFlight", dataset.Tables["Airport"].Columns["AirportID"], dataset.Tables["Flight"].Columns["AirportOut"]);
```
In runtime I get an error. How to solve the problem ?
| Relations between tables | CC BY-SA 2.5 | null | 2010-11-11T12:12:50.627 | 2010-11-11T12:15:09.480 | null | null | 108,686 | [
"c#",
".net",
"ado.net"
] |
4,154,307 | 1 | 13,050,900 | null | 6 | 8,736 | i do have a question about layouting with a listview inside of a scrollviewer. Once a listview is inside a scrollviewer it does use it's maximum size and doesn't scroll itself cause the scrollviewer offers unlimited amount of space to the controls inside of it.
The problem is, that controls that are below a long list are only visible if the user scrolls down and I want to make the listview only use the space that is necessary and use a scrollbar itself. Pictures do tell more information than words (links for pictures also do tell much as my reputation isn't at 10 yet.. Edit2: well i can use only one link so i copied all pictures onto one).
If the lists isn't long everything is okay:
Picture 1 : 
Now if the list is longer the controls below move down into the invisible land:
Picture 2 : see link from picture 1
What I do want to happen now is this:
Picture 3 : see link from picture 1
That itself isn't really a problem cause we could put everything in a dockpanal and do dock the controls below to Dock.Below and Top to Top and let the listview fill the center with "lastchildfill". Now for the real problem. What if the window gets smaller? Then at first the listview disappears and then also everything else without having a scrollbar to scroll to the controls on the bottom.
Picture 4 : see link from picture 1
The ideal i am searching for is to have scrollbars on the window (or a root scrollviewer) which would enable us to scroll to every section of the window like this and just have the outer scrollbars to be visible once everything is a minimum size.
Picture 5 : see link from picture 1
ANY IDEAS? too many pictures? here's a little bit of xaml for everyone to try making it work (it's just a fast example windows...)
```
<Window x:Class="WpfTest1.ScrollTestWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
Title="ScrollTestWindow" Height="400" Width="700">
<ScrollViewer >
<DockPanel LastChildFill="True" ScrollViewer.CanContentScroll="True" ScrollViewer.HorizontalScrollBarVisibility="Visible">
<Grid DockPanel.Dock="Top">
<TextBlock Text="Example controls above listview" Background="LightGray" FontSize="30"></TextBlock>
</Grid>
<Grid DockPanel.Dock="Bottom">
<TextBlock Text="Example controls below listview" Background="LightGray" FontSize="30"></TextBlock>
</Grid>
<ListView FontSize="30">
<ListView.View>
<GridView>
<GridViewColumn Width="190" Header="Date" />
<GridViewColumn Width="200" Header="Day Of Week" DisplayMemberBinding="{Binding DayOfWeek}" />
<GridViewColumn Width="120" Header="Year" DisplayMemberBinding="{Binding Year}" />
</GridView>
</ListView.View>
<sys:DateTime>1/1/1</sys:DateTime>
<sys:DateTime>1/1/1</sys:DateTime>
<sys:DateTime>1/1/1</sys:DateTime>
<sys:DateTime>1/1/1</sys:DateTime>
<sys:DateTime>1/1/1</sys:DateTime>
<sys:DateTime>1/1/1</sys:DateTime>
<sys:DateTime>1/1/1</sys:DateTime>
<sys:DateTime>1/1/1</sys:DateTime>
</ListView>
</DockPanel>
</ScrollViewer>
```
| WPF: ListView inside of Scrollviewer; Layout question | CC BY-SA 2.5 | 0 | 2010-11-11T12:18:07.210 | 2012-10-24T14:12:20.910 | 2010-11-18T09:24:05.067 | 221,386 | 221,386 | [
"c#",
"wpf",
"listview",
"layout",
"scrollviewer"
] |
4,154,770 | 1 | null | null | 1 | 1,335 | I have a tree.There are category and sub category as you can see from the image.I want that categories will have the lower line but subcategories will not .Can you please help me how i can do this? from this javascript?

| category subcategory tree issue javascript | CC BY-SA 2.5 | null | 2010-11-11T13:16:09.513 | 2011-02-27T14:24:03.480 | 2011-02-27T14:24:03.480 | 277,632 | 447,394 | [
"javascript",
"tree"
] |
4,154,802 | 1 | 4,154,968 | null | 5 | 36,293 | This is my code to render a JTable and change the color of rows, but it doesn't show a checkbox in column 6, only string (true,false).
Can you provide a solution to fix this?
Thanks in advance.
```
public class JLabelRenderer extends JLabel implements TableCellRenderer
{
private MyJTable myTable;
/**
* Creates a Custom JLabel Cell Renderer
* @param t your JTable implmentation that holds the Hashtable to inquire for
* rows and colors to paint.
*/
public JLabelRenderer(MyJTable t)
{
this.myTable = t;
}
/**
* Returns the component used for drawing the cell. This method is
* used to configure the renderer appropriately before drawing.
* see TableCellRenderer.getTableCellRendererComponent(...); for more comments on the method
*/
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
{
setOpaque(true); //JLabel isn't opaque by default
setText(value.toString());
setFont(myTable.getFont());
if(!isSelected)//if the row is not selected then use the custom color
setBackground(myTable.getRowToPaint(row));
else //if the row is selected use the default selection color
setBackground(myTable.getSelectionBackground());
//Foreground could be changed using another Hashtable...
setForeground(myTable.getForeground());
// Since the renderer is a component, return itself
return this;
}
// The following methods override the defaults for performance reasons
public void validate() {}
public void revalidate() {}
protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) {}
public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue) {}
}
```
This is the table:
```
import javax.swing.JTable;
import javax.swing.table.*;
import java.util.Hashtable;
import java.awt.Color;
public class MyJTable extends JTable
{
Hashtable rowsToPaint = new Hashtable(1);
/**
* Default Constructor
*/
public MyJTable()
{
super();
}
/**
* Set the TableModel and then render each column with a custom cell renderer
* @param tm TableModel
*/
public void setModel(TableModel tm)
{
super.setModel(tm);
renderColumns(new JLabelRenderer(this));
}
/**
* Add a new entry indicating:
* @param row the row to paint - the first row = 0;
* @param bgColor background color
*/
public void addRowToPaint(int row, Color bgColor)
{
rowsToPaint.put(new Integer(row), bgColor);
this.repaint();// you need to repaint the table for each you put in the hashtable.
}
/**
* Returns the user selected BG Color or default BG Color.
* @param row the row to paint
* @return Color BG Color selected by the user for the row
*/
public Color getRowToPaint(int row)
{
Color bgColor = (Color)rowsToPaint.get(new Integer(row));
return (bgColor != null)?bgColor:getBackground();
}
/**
* Render all columns with the specified cell renderer
* @param cellRender TableCellRenderer
*/
public void renderColumns(TableCellRenderer cellRender)
{
for(int i=0; i<this.getModel().getColumnCount(); i++)
{
renderColumn(this.getColumnModel().getColumn(i), cellRender);
}
}
/**
* Render a TableColumn with the sepecified Cell Renderer
* @param col TableColumn
* @param cellRender TableCellRenderer
*/
public void renderColumn(TableColumn col, TableCellRenderer cellRender)
{
try{
col.setCellRenderer(cellRender);
}catch(Exception e){System.err.println("Error rendering column: [HeaderValue]: "+col.getHeaderValue().toString()+" [Identifier]: "+col.getIdentifier().toString());}
}
}
```
here is my screen

| How to render a checkbox in a JTable? | CC BY-SA 3.0 | 0 | 2010-11-11T13:19:57.537 | 2015-06-23T16:37:20.757 | 2015-06-23T16:37:20.757 | 2,074,605 | 326,878 | [
"java",
"swing",
"checkbox",
"jtable"
] |
4,154,861 | 1 | 4,169,295 | null | 1 | 797 | I haven't enough rep points to post an image yet but given a Silverlight 4 chart example using ColumnSeries, how can I make each of the sub columns within a single column that are currently stacked up on top of each other sit side by side?
e.g Column NVQ2 shows value columns for 5 different locations, Column NVQ3 shows value columns for 5 different locations
I need the locations to sit side by side and not be stacked on top of each other.
Code for the graph:
```
foreach (ER_Location theLocation in UserSelections.TheDataSet.ER_Locations)
{
ER_Year myYear = (ER_Year)SeriesSelection.SelectedItem;
ColumnSeries newSeries = new ColumnSeries();
newSeries.ItemsSource = UserSelections.GetDataRowsByYearAndLocation(theLocation.Location_ID, (int)myYear.Year);
newSeries.IndependentValueBinding = new System.Windows.Data.Binding("Variable_ID");
newSeries.DependentValueBinding = new System.Windows.Data.Binding("Value");
newSeries.Title = theLocation.Name;
newSeries.IsSelectionEnabled = true;
MainChart.Series.Add(newSeries);
}
```
This is how the chart is rendering at present:

| Silverlight Chart Question | CC BY-SA 2.5 | null | 2010-11-11T13:26:47.983 | 2012-12-01T06:58:31.413 | 2010-11-12T15:39:19.120 | 492,035 | 492,035 | [
"silverlight",
"silverlight-4.0",
"charts"
] |
4,154,924 | 1 | 4,155,067 | null | 8 | 2,365 | Is there an elegant way to change the diagonals of a matrix to a new list of values, the
equivalent of Band with SparseArray?
Say I have the following matrix (see below)
```
(mat = Array[Subscript[a, ##] &, {4, 4}]) // MatrixForm
```
and I'd like to change the main diagonal to the following to get "new mat" (see below)
```
newMainDiagList = Flatten@Array[Subscript[new, ##] &, {1, 4}]
```
I know it is easy to change the main diagonal to a given value using ReplacePart. For example:
```
ReplacePart[mat, {i_, i_} -> 0]
```
I'd also like not to be restricted to the main diagonal (in the same way that Band is not so restricted with SparseArray)
(The method I use at the moment is the following!)
```
(Normal@SparseArray[Band[{1, 1}] -> newMainDiagList] +
ReplacePart[mat, {i_, i_} -> 0]) // MatrixForm
```
(Desired Output is 'new mat')

| Changing the Diagonals of a Matrix with Mathematica | CC BY-SA 2.5 | 0 | 2010-11-11T13:33:29.157 | 2010-11-11T14:49:22.587 | null | null | 499,167 | [
"wolfram-mathematica"
] |
4,154,962 | 1 | 4,155,068 | null | 1 | 145 | I parsed the XML data from a feed. I stored all data in `NSArray`. I loaded the images and title in `UITableview` using `UILable`. But when I use the scroll, the text will be collapsed as follows.

My code is as follows...
```
-(UITableViewCell *)tableView:(UITableView *)tableView1 cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView1 dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil){
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
}
CGRect frame = CGRectMake(70.0, 00.0, 250.0, 55);
valueField = [[UILabel alloc] initWithFrame:frame];
[valueField setAutoresizingMask:UIViewAutoresizingFlexibleLeftMargin];
valueField.tag = 111;
valueField.font=[UIFont fontWithName:@"Helvetica" size:13.0];
valueField.textAlignment = UITextAlignmentLeft;
valueField.lineBreakMode=UILineBreakModeWordWrap;
valueField.numberOfLines = 0;
valueField.textColor = [UIColor whiteColor];
valueField.text=[title1 objectAtIndex:indexPath.row];
valueField.highlightedTextColor = [UIColor whiteColor];
valueField.baselineAdjustment = UIBaselineAdjustmentAlignCenters;
valueField.adjustsFontSizeToFitWidth = YES;
valueField.backgroundColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.0];
[cell.contentView addSubview:valueField];
[valueField release];
UIImage *patternImage = [UIImage imageNamed:@"bg.jpg"];
UIView *backView = [[[UIView alloc] initWithFrame:CGRectZero] autorelease];
backView.backgroundColor = [UIColor colorWithPatternImage: patternImage];
cell.backgroundView = backView;
NSString *image1 =[images objectAtIndex:indexPath.row];
NSLog(@"Images ..... = %@",image1);
NSData *mydata = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:[images objectAtIndex:indexPath.row]]];
UIImage *myimage = [[UIImage alloc] initWithData:mydata];
UIImageView *imageView = [ [ UIImageView alloc ] initWithImage: myimage ];
imageView.frame = CGRectMake(0.0f, 00.0f, 60.0f, 63.0f);
[cell.contentView addSubview:imageView];
//cell.imageView.image = myimage;
return cell;
}
```
I don't know how to solve this issue.
| UITableviewcell loading data issue | CC BY-SA 3.0 | null | 2010-11-11T13:38:05.527 | 2017-12-16T23:11:21.170 | 2017-12-16T23:11:21.170 | 472,495 | 409,571 | [
"objective-c",
"ios",
"cocoa-touch"
] |
4,155,206 | 1 | 4,157,073 | null | 2 | 1,465 | Suppose I have a button nested in the `Template` of a `ListBoxItem`, can I set the `IsMouseOver` property of the button to true, so that it looks like its moused over?
Just for illustration, the notifications on the top of the window are what I am referring to. Its basically `ListBoxItem`'s with a `TextBlock` and `Button`

| WPF: Can I Set IsMouseOver Property of a ChildElement When The Parent Is Moused Over? | CC BY-SA 2.5 | null | 2010-11-11T14:10:39.237 | 2010-11-11T17:06:16.763 | null | null | 292,291 | [
"wpf",
"templates",
"listbox",
"styles"
] |
4,155,397 | 1 | 4,155,440 | null | 1 | 2,912 | I need to overlay some textures onto a video in a layered fashion (i.e. the first texture should appear under, the second texture when they are both semi-transparent etc).
The textures all have different Z values so there should be no conflicts there. Images speak a thousand words so I have attached one below:

As you can see, the arrows are semi-transparent are cross over each other. Only the blue and red arrows seem to interact however. For arguments sake, lets say the red arrows have a z (vertical in this case) value of 4, the blue of 6 and the white of 10.
The blend function I am using is:
`gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);`
and `GL_DEPTH_TEST` is enabled.
I am looking for all the overlaid textures to interact the same as the red and blue ones do. i.e. You can see the red arrow beneath the white arrow and for a darker red to be shown where the darker 2 red arrows cross over. Can anyone point me in the right direction?
EDIT: Below is the code used to setup openGL for each frame render.
```
public void display(final GL gl, final GLProjection projection, final FieldMask fieldMask)
{
layerTextureShader.updateShader(gl, projection, fieldMask);
if (useMask)
{
layerMaskShader.updateShader(gl, projection, fieldMask);
}
gl.glTexEnvf(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE, GL.GL_MODULATE);
gl.glBindBuffer(GL.GL_ARRAY_BUFFER, getVertexBufferObject());
gl.glBufferData(GL.GL_ARRAY_BUFFER, getNoOfVertices() * 3 * 4, getVertices(), GL.GL_STREAM_DRAW);
gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
gl.glBindBuffer(GL.GL_ARRAY_BUFFER, getTexCoordBufferObject());
gl.glBufferData(GL.GL_ARRAY_BUFFER, getNoOfVertices() * 2 * 4, getTexCoords(), GL.GL_STREAM_DRAW);
gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
gl.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, getIndicesBufferObject());
gl.glBufferData(GL.GL_ELEMENT_ARRAY_BUFFER, getNoOfIndices() * 4, getIndices(), GL.GL_STREAM_DRAW);
gl.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, 0);
gl.glBindBuffer(GL.GL_ARRAY_BUFFER, getColorBufferObject());
gl.glBufferData(GL.GL_ARRAY_BUFFER, getNoOfVertices() * 4 * 4, getColors(), GL.GL_STREAM_DRAW);
gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
if (useMask)
{
gl.glBindBuffer(GL.GL_ARRAY_BUFFER, getMaskColorBufferObject());
gl.glBufferData(GL.GL_ARRAY_BUFFER, getNoOfVertices() * 4 * 4, getMaskColors(), GL.GL_STREAM_DRAW);
gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
}
gl.glEnable(GL.GL_TEXTURE_2D);
gl.glActiveTexture(GL.GL_TEXTURE0);
gl.glBindTexture(GL.GL_TEXTURE_2D, textureId);
gl.glEnable(GL.GL_BLEND);
gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
if (useMask)
{
gl.glBlendEquation(GL.GL_MIN);
layerMaskShader.use(gl);
display(gl, true);
layerMaskShader.release(gl);
}
gl.glBlendEquation(GL.GL_MAX);
layerTextureShader.use(gl);
display(gl, false);
layerTextureShader.release(gl);
gl.glDisable(GL.GL_TEXTURE_2D);
gl.glDepthMask(true);
gl.glDisable(GL.GL_BLEND);
}
```
| Problems with layers, depth and blending in openGL | CC BY-SA 2.5 | null | 2010-11-11T14:29:53.940 | 2013-01-29T16:35:11.717 | 2010-11-11T15:02:02.987 | 410,921 | 410,921 | [
"opengl",
"alphablending",
"layer",
"depth"
] |
4,155,620 | 1 | 4,155,849 | null | 1 | 1,774 | I have looked around and have yet to find a solution to this problem. I have a list menu with markup like so
```
<div id="menu">
<ul>
<li>Category #1
<ul>
<li>Item #1</li>
<li>Item #2</li>
<li>Item #3</li>
</ul>
</li>
<li>Category #2
<ul>
<li>Item #1</li>
<li>Item #2</li>
<li>Item #3</li>
</ul>
</li>
<li>Category #3
<ul>
<li>Item #1</li>
<li>Item #2</li>
<li>Item #3</li>
</ul>
</li>
<li>Category #4
<ul>
<li>Item #1</li>
<li>Item #2</li>
<li>Item #3</li>
</ul>
</li>
</ul>
</div>
```
What I am trying to do is make it so that the menu is entirely horizontal, when you hover over a category it will slide out the Items next to it.
Visual example here

Its quite important that it is built on a structured list and as I said as far as I can tell, none of the accordions I have checked so far support this feature.
Any idea's?
| Accordion Style multi tier list menu | CC BY-SA 2.5 | null | 2010-11-11T14:49:13.503 | 2012-06-03T21:31:58.730 | 2012-06-03T21:31:58.730 | 480,659 | 487,787 | [
"jquery",
"html",
"css",
"menu",
"html-lists"
] |
4,155,705 | 1 | 4,156,171 | null | 2 | 4,973 | I'd like to add extra spacing on the sides and between tabs on the tab widget, but padding and margins dont seem to make any difference. I also played with setting the divider, tab strip left and right drawables, which didn't seem to make any difference either.
Trying to make the tabs look like this:

| How to add spacing to tab widget in Android? | CC BY-SA 2.5 | 0 | 2010-11-11T14:57:24.247 | 2012-10-17T10:03:33.193 | null | null | 246,793 | [
"android",
"coding-style",
"spacing",
"tabwidget"
] |
4,155,911 | 1 | 4,155,976 | null | 7 | 2,998 | I manually drew a sphere, at last :) I want my sphere to be red, but the outlines to be green:

In order to achieve this I did the following. I drew a solid sphere in red, and then I drew the same sphere, but wireframe and green. When I turned DEPTH_TEST on, I got some weird behavior, like this:
And in order to avoid this weird behavior I just drew the wired sphere scaled by `(1.001, 1.001, 1.001)` and everything is drawn perfectly, as in the first picture. My question is, am I, a real newbie, doing it in a bad way? Are there any better ways to do what I want to do? Thanks in advance.
P.S. I am drawing the sphere manually for an exercise's sake, I am aware of the existence of glu quadrics routines and glut's sphere.
| openGL sphere that is both wireframe and solid | CC BY-SA 2.5 | 0 | 2010-11-11T15:16:26.960 | 2015-03-14T03:24:42.867 | 2020-06-20T09:12:55.060 | -1 | 469,935 | [
"c++",
"opengl",
"geometry",
"outlining"
] |
4,156,059 | 1 | 4,156,139 | null | 7 | 4,459 | OK, I have to make a nim game and try to find the strategy to always win with the following nim game:
21 matches, player 1 and 2 each take 1, 2, 3, 4, or 5 matches each turn, and one cannot take the same amount of matches the previous player takes. Th eplayer wins if/when they take the last match.
I have to program something for this, but I don't even understand were to start. How can i find the winning strategy with this type of nim game?
EDIT:
So I figured you'll always win when you get to 7 matches still in the middle. The other can take 2-5 and you can add up to 7 taking the last one. when the other takes 1, you take 3 (the other can't take 3 as well then) and has to pick 1 or 2 in which case you'll get the alst one and win as well.
However, going from 21 to 7 is a puzzle for me i cant figure out how you can always be the person getting to 7.
EDIT 2:
ok so without the rule that you can't take the same as the previous player it is quite simple i think.
You'd make k = 5 + 1 = 6. then you should make the first move such that the matches left then % 6 = 0. So in this case take 3 first and then afterwards fill up the move of the other player to 6. However in this case that won't work because the other player can take 3 after which you can't take 3 to fill up to 6. So there is my problem. Any ideas?
EDIT3:
ok so you say I can force 7 matches. However suppose I take the same thinking to the 14-7 matches step. (it then is the other's turn)
there are two scenarios then:
1: he takes 2-5 and I fill it up to seven which let 7 there and I win.
2: he takes 1, so there are 13 left. When i take 3 as i do in the (7-0)-step it becomes 10. Then he takes 5 and i can't take 5 anymore to finish and i will loose.
Here lies the problem, where scenario 2 is no problem in the (7-0)-step it is now. How do I solve this?
YES, THE SOLUTION:
btw, na speler 1 means: after player 1's turn etc (I'm dutch).

Ok so i tried some things and i think i have the solution. You have to take 1 match as the first player first. Then the other guys can take 2-5 matches. You match (pun intended) his amount up to 7 so you'll have (21-1-7=) 13 matches left in the middle always. Then it is Player 2's turn again and there are two scenarios: player 2 takes 1,2,4,or5 matches, in which case you take as much matches that there will be 7 in the left. (as told earlier when you take matches such that there are 7 left you'll always win). The second scenario is that player 2 takes 3 matches in which case there are 10 in the middle when it is your turn. You can't take 3 to make 7 because you can't take 2 times the same amount. So you take 5 so there are 5 left. Player 2 then can't take 5 to win and has to pick 1-4 after which you can take the remaining ones and win.
This is the solution i guess. I somehow came onto it because i noticed this:
Normal Nim game with modulo etc:
```
P2 1 2 3 4 5
P1 5 4 3 2 1
------------------
6 6 6 6 6
```
But you cant do 3,3 here so it is liek this:
```
p2 1 2 3 4 5
p1 5 4 3 2 1
---------------------
7 7 7 7
```
So you can make 7 everytime and 1 is a special case. I don't know why but i intuitively took 1 as starting point as it feels like you need to take initiative to be able to control the other's moves. (one cannot do two times 1 so the other has to take 2-5 which makes you in control)
Anyway, THANKS a lot for all the help. Also for the whole program that was written. I couldn't use it because it wouldn't compile as a lack good java skills :) and i also wanted to solve it myself.
Anyway, i saw this is a wiki, good luck for people in the future trying to solve this!
| Nim game question | CC BY-SA 2.5 | null | 2010-11-11T15:29:12.980 | 2010-11-11T17:46:12.160 | 2010-11-11T17:45:22.317 | 489,284 | 489,284 | [
"java",
"variable-assignment"
] |
4,156,155 | 1 | 4,161,757 | null | 1 | 3,364 | I have an asp.net button on a web page.
The OnClientClick code disables the button so that the user cannot submit more than once.
It also changes the text of the button to "Please wait..."
All good so far!
Trouble is, because it is getting disabled the "Please wait..." text looks rubbish...
How can I style the button so that even though it is disabled, it looks enabled, within javascript.
```
<script type="text/javascript">
function btnSubmit_ClientClick(Client) {
var ok = Page_ClientValidate();
if (ok) {
Client.style.color = 'White';
Client.style.backgroundColor = '#9A4D9E';
Client.value = 'Please wait...';
Client.disabled = true;
}
}
</script>
```
Start of Edit:
Here's the enabled button:

and here's the disabled button:

... as you can see the text is kind of grey and white?
For further clarity @user503034 suggested using [disabled] in the CSS.
Here's my code, however I still have the same issue:
```
button[disabled]:active, button[disabled], input[type="reset"][disabled]:active, input[type="reset"][disabled], input[type="button"][disabled]:active, input[type="button"][disabled], select[disabled] > input[type="button"], select[disabled] > input[type="button"]:active, input[type="submit"][disabled]:active, input[type="submit"][disabled]
{
color: Green;
background-color: #9A4D9E;
cursor: default;
}
```
| Styling a button using javascript & OnClientClick | CC BY-SA 2.5 | 0 | 2010-11-11T15:38:42.657 | 2010-11-12T11:10:01.150 | 2010-11-12T11:10:01.150 | 176,600 | 176,600 | [
"javascript",
"asp.net",
"css",
"onclientclick"
] |
4,156,447 | 1 | 4,157,519 | null | 0 | 95 |
## The layout

I really dont have any idea of where to begin to make this with DIVs or with tables specially with the fact that i need a top-backgroud and a botton-background. Please i need orientation with this, if you can make the css with the names i put on the image i will understand the code whitout any explanations. Thanks a lot for any help.
| How to make this layout? | CC BY-SA 3.0 | null | 2010-11-11T16:07:27.183 | 2012-06-30T12:08:28.550 | 2012-06-30T12:08:28.550 | 533,552 | 310,648 | [
"css",
"layout"
] |
4,156,476 | 1 | 4,163,829 | null | 3 | 1,957 | Right, since watching [Rasmus Lerdorf's talk on PHP performance](http://about.digg.com/blog/rasmus-lerdorf-php-performance) I've been wanting to profile the ERP / Accounting application I am working on, not least because I know there are performance issues with it, profiling should highlight the major problems for me to investigate.
So downloaded `xdebug` and put the following few lines in my `php.ini` file:
```
zend_extension="/usr/lib/php5/20090626+lfs/xdebug.so"
xdebug.profiler_output_dir="/home/me/xdebug/profiles/"
xdebug.ptofiler_enable_trigger=On
```
With this I simply aim my browser as my app with `&XDEBUG_PROFILE` in the query string and the profiling begins. The problem is the output I am viewing with KCacheGrind doesn't include any of the functions from with my application, and no flow between entities.
When the page is executing I copied (in the terminal) the profile file to a separate file, to capture it's state throughout the profile. I loaded each of these separately into KCacheGrind and they all show the full profile of the application, all but the last one?
Can anyone tell me why the full profile isn't being output? Looking at the file sizes of my copied files it appears the first few are rather large, but the last one is significantly smaller, is `xdebug` messing with them after it has been captured?
Many thanks :-)
Just to help, this is what I see when I open up one of the copied profiles (before the profile has completed), I'm sure there is much more to this.

And this is what I get from the final profile, no relationships, just a bunch of PHP functions. I want to see all the full profile.

So here I am constantly running the `ls -als` command, the last list is the cut down version, the previous one is the last `ls` where the file was at it's full size.

I cannot upload the large file as it's over 3 million lines long, if it helps here is the `xdebug` php info section.

| xdebug, having problems with profiler output | CC BY-SA 2.5 | 0 | 2010-11-11T16:09:43.933 | 2010-11-12T10:46:04.350 | 2010-11-12T09:58:32.080 | 80,111 | 80,111 | [
"php",
"performance",
"optimization",
"xdebug"
] |
4,156,478 | 1 | 5,346,867 | null | 1 | 13,247 | I am trying to use AddThis button on a web page of mine, which you can share, like (facebook), and tweet (twitter) -

the AddThis code is pretty straight forward below,
```
<!-- AddThis Button BEGIN -->
<div id="share" class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
<a class="addthis_button_tweet"></a>
<a class="addthis_counter addthis_pill_style"></a><!---->
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#username=xa-4cdb5be51dc49c98"></script>
<!-- AddThis Button END -->
```
but I don't understand - in the code above, where can I put the image or video url which I have uploaded and posted on my fb page? for instance the url below is the image from my facebook page that I want to track how many people like this picture through my website,
[http://www.facebook.com/photo.php?fbid=10150115644909972&set=a.10150115644754972.329183.55239684971](http://www.facebook.com/photo.php?fbid=10150115644909972&set=a.10150115644754972.329183.55239684971)
I have read through the documentation on AddThis but it doesnt explain this at all!
[http://www.addthis.com/help/client-api#configuration-sharing](http://www.addthis.com/help/client-api#configuration-sharing)
It points me to this,
[http://developers.facebook.com/docs/reference/plugins/like#](http://developers.facebook.com/docs/reference/plugins/like#)
again, this is a Facebook plugin, no used within AddThis. If I am using the Like button from the Facebook API, then I cannot use the AddThis plugin above, can I?
furthermore, The Like button from Faebook API seems to work on the Facebook page, but not an individual picture or video I uploaded/ posted on my Facebook Page, for instance, I tried this on my localhost, the picture on my Facebook Page won't collect the number of likes even though I have clicked the Like button on my screen.
```
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="http://www.facebook.com/photo.php?fbid=10150115644909972&set=a.10150115644754972.329183.55239684971" layout="button_count" font="arial"></fb:like>
```
so my main doubt on the Like button itself - does it work on facebook only or does it apply to the individual picture/ video on my facebook page? I tried to find this answer from the [facebook Like documentation](http://developers.facebook.com/docs/reference/plugins/like#) but it doesn't explain anything about this.
it would be grateful if you have any idea. thanks!
| AddThis button + Facebook Like button | CC BY-SA 3.0 | 0 | 2010-11-11T16:09:51.707 | 2013-01-03T20:57:55.800 | 2013-01-03T20:57:55.800 | 21,062 | 413,225 | [
"facebook",
"facebook-like",
"addthis"
] |
4,156,704 | 1 | 4,157,719 | null | 1 | 951 | I'm trying to draw a bunch of rectangles in an NSView which is inside an NSScrollView. The code is working pretty well, but it seems like the computer is drawing at the wrong points.
When I use `NSLog()` to log the current `x` and `y` the values are right, but when I look at my view, there is extra space added before the drawing coordinate.
This is the code:
```
//
// CoverFlowView.m
// iWatch
//
// Created by ief2 on 03/11/10.
//
//
#import "CoverFlowView.h"
#pragma mark Defaults
#define COVER_HEIGHT2WIDTH(a) ((float)a / 1.4)
#define COVER_HEIGHT (200.0)
#define COVER_WIDTH (COVER_HEIGHT2WIDTH(COVER_HEIGHT))
#define COVER_SPACE_MIN (20.0)
#pragma mark Private Methods
@interface CoverFlowView (PrivateMethods)
- (CGFloat)coverSpaceForMoviesPerLine:(NSUInteger *)n;
- (void)frameDidChange;
- (void)updateFrame;
@end
NSColor *RandomColor() {
float red = (float)(rand() % 255) / 254.0;
float green = (float)(rand() % 255) / 254.0;
float blue = (float)(rand() % 255) / 254.0;
NSColor *theColor = [[NSColor colorWithDeviceRed:red
green:green
blue:blue
alpha:1.0] retain];
return [theColor autorelease];
}
#pragma mark Implementation
@implementation CoverFlowView
#pragma mark Init and Dealloc
- (void)awakeFromNib {
srand(time(NULL));
NSMutableArray *colors = [[NSMutableArray alloc] initWithCapacity:100];
register int i;
for(i = 0; i < 100; i++) {
[colors addObject:RandomColor()];
}
self.movies = colors;
[colors autorelease];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(frameDidChange)
name:NSViewFrameDidChangeNotification
object:self];
}
- (id)initWithFrame:(NSRect)frame movies:(NSArray *)movs {
self = [super initWithFrame:frame];
if(self != nil) {
self.movies = movs;
// FIXME: Debug color array to movie
NSMutableArray *colors = [[NSMutableArray alloc] initWithCapacity:100];
register int i;
srand((unsigned int)time(NULL));
for(i = 0; i < 100; i++) {
[colors addObject:RandomColor()];
}
}
return self;
}
- (void)dealloc {
[_movies release];
[super dealloc];
}
#pragma mark Drawing
- (void)drawRect:(NSRect)dirtyRect {
[[NSColor blackColor] setFill];
NSRectFill(dirtyRect);
NSUInteger moviesPerLine = 0;
CGFloat coverSpace = 0;
// Get the values
coverSpace = [self coverSpaceForMoviesPerLine:&moviesPerLine];
// if it's less than 1, break the drawing
if(moviesPerLine < 1) {
return;
}
// get the rows not to draw
// p = top left point's y
// h = movie cover height ->\
// s = space between -->The movies height and it's space above it
//
// p
// f(x) = -------
// h + s
double rows = ((dirtyRect.origin.y) / (COVER_HEIGHT + coverSpace));
// get the first movie that has to be drawn
// could be half-draw
//
// (NSUInteger)rows * moviesPerLine
NSUInteger index = (NSUInteger)rows * moviesPerLine;
if(!(index < [self.movies count]))
return;
// variable declaration
CGFloat curY;
CGFloat curX;
// start drawing until the line after max
// start the loop
do {
NSUInteger rowIndex;
// get the y for the movie
// x = movie index (start from 1)
// m = movies per row
// h = movie height
// s = movie space
//
// [x - (x % m)]
// f(x) = (|-----------|) * (h + s) + s
// [ m ]
// BUT: if rows == 2, rows -= 1
rowIndex = ((index + 1) - ((index + 1) % moviesPerLine)) / moviesPerLine;
((index + 1) % moviesPerLine == 0) ? (rowIndex -= 1) : (rowIndex = rowIndex);
curY = rowIndex * (COVER_HEIGHT + coverSpace) + coverSpace;
// get the x fot the movie
// x = movie index (start from 1)
// m = movies per line
// w = movie width
// s = cover space
//
//
// f(x) = ((x - (x - (x % m))) - 1) * (w + s) + s
// BUT: if row == 0, row = m
//
rowIndex = (index+1) - (((index+1) - ((index + 1) % moviesPerLine)));
(rowIndex == 0) ? (rowIndex = moviesPerLine) : (rowIndex = rowIndex);
curX = (rowIndex - 1) * (COVER_WIDTH + coverSpace) + coverSpace;
NSLog(@"%s index: %3u || x: %5.0f || y: %5.0f", __FUNCTION__, index, curX, curY);
// Start the drawing
NSRect bezierPathRect = NSMakeRect(curX + coverSpace, curY, COVER_WIDTH, COVER_HEIGHT);
NSBezierPath *path = [NSBezierPath bezierPathWithRect:bezierPathRect];
[path setLineWidth:2.0];
[[NSColor whiteColor] setStroke];
[(NSColor *)[self.movies objectAtIndex:index] setFill];
[path fill];
[path stroke];
// add up values
index++;
if(!(index < [self.movies count]))
return;
} while(curY - (COVER_HEIGHT + coverSpace) < dirtyRect.origin.y + dirtyRect.size.height);
}
- (BOOL)isFlipped {
return YES;
}
#pragma mark Private Methods
- (void)frameDidChange {
}
- (CGFloat)coverSpaceForMoviesPerLine:(NSUInteger *)n {
// x = number of covers
// w = view width
// m = cover width
// y = the space
//
// w - (mx)
// f(x) = --------
// x + 1
CGFloat m = COVER_WIDTH;
CGFloat w = [self bounds].size.width;
register NSUInteger x = 1;
CGFloat space;
while(1) {
space = ((w-(m*x)) / ( x + 1.0));
if(space < COVER_SPACE_MIN) {
x--;
space = ((w - (m*x)) / (x + 1.0));
break;
}
x++;
}
if(n) *n = x;
return space;
}
#pragma mark Properties
@synthesize movies=_movies;
- (void)setMovies:(NSArray *)ar {
if(ar != _movies) {
[_movies release];
_movies = [ar retain];
// Update frame size
NSUInteger m;
CGFloat space = [self coverSpaceForMoviesPerLine:&m];
NSUInteger lines = [ar count] / m;
CGFloat height = (COVER_HEIGHT + space) * ((CGFloat)lines) + space;
CGFloat width = [self frame].size.width;
NSRect frame = [self frame];
frame.size = NSMakeSize(width, height);
[self setFrame:frame];
[self setNeedsDisplay:YES];
}
}
@end
```
and here you can find a screen shot of the running application:

If someone can tell me what I'm doing wrong, I'd really appreciate it!
Thank you,
ief2
EDIT: Don't mind the wrong titles, I made mistake giving the files a name :-)
| Drawing in Cocoa, wrong xy value | CC BY-SA 2.5 | null | 2010-11-11T16:31:18.067 | 2010-11-11T18:06:55.500 | null | null | 262,660 | [
"objective-c",
"cocoa",
"macos",
"drawing",
"nsview"
] |
4,157,226 | 1 | 4,157,475 | null | 1 | 803 | I'm trying to display some very simple data using Google Charts API.
My data are a serie of X,Y points:
(1,44) (2,46) (3,46) (4,43) (5,46) and (6,44).
X-axis : from 0 to 300, step 50
Y-axis : from 1 to 50, step 5
I should end up with a line almost in the top, to the left, of the chart (43-46 are near 50).
But here is what I get:
URL = [http://chart.apis.google.com/chart?cht=lxy&chs=500x300&chd=t:1,2,3,4,5,6|44,46,46,43,46,44&chxt=x,y&chxr=0,0,300,50|1,0,50,5](http://chart.apis.google.com/chart?cht=lxy&chs=500x300&chd=t:1,2,3,4,5,6|44,46,46,43,46,44&chxt=x,y&chxr=0,0,300,50|1,0,50,5)

If I change Y-axis, 1 to 100 (instead of 50), it's ok...
URL = [http://chart.apis.google.com/chart?cht=lxy&chs=500x300&chd=t:1,2,3,4,5,6|44,46,46,43,46,44&chxt=x,y&chxr=0,0,300,50|1,0,100,5](http://chart.apis.google.com/chart?cht=lxy&chs=500x300&chd=t:1,2,3,4,5,6|44,46,46,43,46,44&chxt=x,y&chxr=0,0,300,50|1,0,100,5)
I'm probably mistaking, but I can't find what is wrong.
| google charts api : wrong axis with LXY chart? | CC BY-SA 2.5 | null | 2010-11-11T17:23:14.947 | 2010-11-11T17:44:24.377 | null | null | 446,576 | [
"google-visualization"
] |
4,157,254 | 1 | 4,158,316 | null | 0 | 90 | How can I make my website look more like the second image presented below? (Notice the left margin in the second image, versus no margin in the first one.)
[http://fotografcim-2.hosting.parking.ru/](http://fotografcim-2.hosting.parking.ru/) (This is a demo site.)
No margin:

Margin:

| How can I add a margin to the header and footer? [screenshots included] | CC BY-SA 2.5 | null | 2010-11-11T17:25:03.420 | 2010-11-12T08:12:51.193 | 2010-11-12T08:12:51.193 | 173,718 | 173,718 | [
"css",
"html",
"margin"
] |
4,157,293 | 1 | 4,157,492 | null | 22 | 56,577 | I have two JTabbedPanes, JTabbedPane1 & 2
How can I press button in JTabbedPane2 to show JTabbedPane1 ?
Here is the code for JTabbedPane:
```
public class TabbedPane extends JFrame {
public TabbedPane() {
setTitle("Tabbed Pane");
setSize(300,300);
JTabbedPane jtp = new JTabbedPane();
getContentPane().add(jtp);
JPanel1 jp1 = new JPanel1();//This will create the first tab
JPanel jp2 = new JPanel2();//This will create the second tab
//add panel .........
//example usage
public static void main (String []args){
TabbedPane tab = new TabbedPane();
}
}
```
here is class JPane1:
```
... JLabel label1 = new JLabel();
label1.setText("This is Tab 1");
jp1.add(label1);
```
and class Jpane2 with button on int
JButton test = new JButton("Press");
jp2.add(test);
```
ButtonHandler phandler = new ButtonHandler();
test.addActionListener(phandler);
setVisible(true);
```
}
so problem is here in ActionListener of button on Jpanel2
```
class ButtonHandler implements ActionListener{
public void actionPerformed(ActionEvent e){
// what i do now ? to call jpanel 1 show ![alt text][1]
}
}
```

| How to switch tabs in jTabbedPane by clicking a Button? | CC BY-SA 3.0 | 0 | 2010-11-11T17:27:52.257 | 2022-04-24T20:32:23.230 | 2015-07-09T04:39:10.100 | 5,030,083 | 326,878 | [
"java",
"swing",
"jtabbedpane"
] |
4,157,398 | 1 | null | null | 2 | 1,363 | I’m currently trying to make my C# application look better when run within Windows Vista or Windows 7. By default, Windows Forms applications use the font, which does not link properly to Asian clear type fonts such as .
To fix this issue, I set all the fonts to (or `SystemFonts.MessageBoxFont`) instead. This works quite well for most of Controls, but I noticed it causes weird display glitches with at least the `ComboBox` control:

The `ComboBox` fails to display this list correctly. Characters get cropped oddly and the selected item looks like it requires more space than originally reserved.
Is there any solution or workaround to this behaviour?
In case you want to try it for yourself, here's my list of items:
- - -
Thanks!
| ComboBox with Segoe UI and Japanese text | CC BY-SA 2.5 | 0 | 2010-11-11T17:36:54.883 | 2013-09-02T06:33:31.790 | 2012-04-29T20:38:41.117 | 1,079,354 | 427,077 | [
"winforms",
"unicode",
"fonts",
"combobox",
"cleartype"
] |
4,158,171 | 1 | 4,158,211 | null | 6 | 1,559 | I have a C# application that uses Click-Once to install(puts an icon on the desktop that points to the application) itself on computers on the network. I have recently been integrating NHibernate into the program and everything runs smooth on my box. Its ready for internal testing and I need to put it on our network share (Same share as production, different folder).
When I place it on the network share and run it I recieve an error saying the application cannot run in partial trust.
I have googled this to no end and every solution seems to talk about a Web Application experiencing this. Is there anyway I can set the application to run in full trust mode on a network share. Setting the folder/exe to full trust? Is this simply allowing "Full Control" in the security tab of my applications properties?
Here is the error I recieve when running the application

Thanks for any input
| Application Trust Level on Network Drive for Nhibernate C# Application | CC BY-SA 2.5 | null | 2010-11-11T18:57:51.330 | 2022-01-29T09:44:41.867 | 2022-01-29T09:44:41.867 | 5,779,732 | 337,422 | [
"c#",
"activerecord",
".net-3.5",
"full-trust"
] |
4,158,234 | 1 | 4,158,278 | null | 0 | 1,041 | I am not sure what this style is called, but I guess you can call it stripped colors:
So basically one color for the first row, another color for the next row, and repeat.
Btw this image shows a ListView but I am trying to do it for a TreeView, so when you expand/collapse a node, it should still look correct.
I imagine this is more about styling the background than the cells themselves, right?

| How can I set a WPF TreeView cells in this style? | CC BY-SA 2.5 | null | 2010-11-11T19:04:45.943 | 2022-01-29T09:07:15.167 | null | null | 51,816 | [
"c#",
".net",
"wpf",
"treeview"
] |
4,158,230 | 1 | 4,177,932 | null | 1 | 1,263 | If I set `<compilation targetFramework="4.0">` in web.config, Visual Studio 2010 shows all Linq extension methods in ASPX files (not codebehinds). But when I change my project to target 3.5 (which supports Linq extension methods) Visual Studio removes the previously mentioned attribute in web.config, but Linq intellisense in APSX files goes with it as well.
## Question
Is it possible to convince Visual Studio 2010 to not assume and fall back to 2.0 when editing ASPX files, so Linq extension methods would still be listed in intellisense dropdown?
## Edit
Manually adding assemblies and import namespaces doesn't do the trick as I've pointed out in [one of my previous questions](https://stackoverflow.com/q/4153504/75642), when I didn't know what was going on.
## Problem reproduction
To reproduce this issue do the following:
1. In Visual Studio 2010 open Asp.net MVC project properties and target NetFx 3.5
2. Open web.config and remove targetFramework attribute if it's still there.
3. Write some code in the view itself (ASPX) that uses Linq extension method (ie. (new List<string>()).Any(s => string.IsNullOrEmpty())). You should see that Any is not recognised by Visual Studio 2010.
4. Start adding one configuration setting by one in web.config. There should be no difference about Any method.
5. Add <% @ Imports ... %> to the view. There should be no difference about Any method either.
Running the application is not a problem. It runs and it also executes `Any` Linq extension method. No problem with that. Design time support is the issue here.
## My web.config file
This is the complete content of my web.config file, that doesn't do the expected (I can include commented out parts as well, but that doesn't make any difference - original Asp.net MVC 2 project template doesn't include these either):
```
<?xml version="1.0"?>
<configuration>
<system.web>
<httpHandlers>
<add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/>
</httpHandlers>
<compilation debug="true" batch="true">
<assemblies>
<!--
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
-->
<add assembly="System.Web.Abstractions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
</compilation>
<pages enableViewState="false">
<controls>
<add tagPrefix="SharePoint" assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" namespace="Microsoft.SharePoint.WebControls" />
</controls>
<namespaces>
<add namespace="Microsoft.SharePoint"/>
<add namespace="System.Collections.Generic"/>
<add namespace="System.Linq"/>
<add namespace="System.Web.Mvc"/>
<add namespace="System.Web.Mvc.Html"/>
<add namespace="System.Web.Routing"/>
<add namespace="MyApp.Objects"/>
<add namespace="MyApp.Web.General"/>
<add namespace="MyApp.Web.Helpers"/>
</namespaces>
</pages>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<handlers>
<remove name="BlockDirectAccessHandler"/>
<add name="BlockDirectAccessHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers>
</system.webServer>
</configuration>
```
This is how it looks like in Visual Studio 2010. In the image you can't see the extra line `<%@ Import Namespace="System.Linq" %>` that should be right after `<%@ Control ... %>`, but I've tried with and without. `system.web/pages/namespaces` is the global setting for this anyway.

| Visual Studio 2010, Linq extension methods and framework 3.5 | CC BY-SA 2.5 | 0 | 2010-11-11T19:04:19.987 | 2011-02-22T10:35:37.260 | 2017-05-23T12:07:02.087 | -1 | 75,642 | [
"linq",
"visual-studio-2010",
".net-3.5",
"intellisense"
] |
4,159,013 | 1 | 4,159,836 | null | 2 | 379 | I've got this strange bug in my app. I'm making a subview and drawing it over the top of my main view. To get rid of it I'd just hide it. Here's the problem: There I can see part of the view underneath peeking through the bottom in a line that seems to be the same size as the status bar. I've put how I'm adding my subview below, along with a screenshot to illustrate my problem.
```
theLaunch = [[firstLaunch alloc] init];
[window addSubview:theLaunch.view]; // it goes on top
[window makeKeyAndVisible];
```
Here's the screenshot...the view underneath is grey.

| Subview is showing the main view underneath | CC BY-SA 2.5 | null | 2010-11-11T20:36:03.210 | 2010-12-06T19:13:51.353 | 2010-12-06T19:13:51.353 | 456,851 | 456,851 | [
"iphone",
"objective-c",
"uiview",
"subview",
"statusbar"
] |
4,159,337 | 1 | 4,159,512 | null | 1 | 3,642 | I have a TableLayout with 3 TableRows, each TableRow has 3 ImageViews. Each ImageView has fitCenter for Scale type, and a weight and width per this stackoverflow [answer](https://stackoverflow.com/questions/2865497/xml-table-layout-two-equal-width-rows-filled-with-equally-width-buttons/2865558#2865558). Now all the images scale to fit into the row, but each row is way taller then it needs to be. Here's an excerpt of the xml:
```
<TableLayout android:id="@+id/TableLayout01"
android:layout_height="wrap_content"
android:padding="10dip"
android:stretchColumns="0,1,2"
android:shrinkColumns="0,1,2"
android:layout_weight="1"
android:layout_width="wrap_content">
<TableRow android:id="@+id/TableRow01"
android:layout_width="fill_parent"
android:layout_gravity="center_vertical|center_horizontal"
android:baselineAligned="false"
android:gravity="center_vertical|center_horizontal"
android:layout_height="wrap_content">
<ImageView android:id="@+id/image1"
android:src="@drawable/avocado3"
android:scaleType="fitCenter"
android:layout_width="0dip"
android:layout_weight="1"
android:layout_height="wrap_content"/>
<ImageView android:id="@+id/image2"
android:src="@drawable/avocado3"
android:layout_width="0dip"
android:layout_weight="1"
android:layout_height="wrap_content"
android:scaleType="fitCenter"/>
<ImageView android:id="@+id/image3"
android:src="@drawable/avocado3"
android:layout_width="0dip"
android:layout_weight="1"
android:layout_height="wrap_content"
android:scaleType="fitCenter"/>
</TableRow>
...
</TableLayout>
```
And here's the first row:

And the end of the first row and start of the second:

The ImageViews are set to a drawable that is small (@drawable/avocado3), and in the activity's onCreate() it fetches 9 images from the internet and calls setImageBitmap().
Anyone have any ideas on what I'm doing wrong?
| TableRow heights getting blown out | CC BY-SA 2.5 | null | 2010-11-11T21:14:55.490 | 2010-11-11T21:35:24.170 | 2017-05-23T12:13:26.330 | -1 | 482,494 | [
"android",
"imageview",
"tablelayout",
"tablerow"
] |
4,159,358 | 1 | null | null | 3 | 758 | i know i might be asking the same question as other used to ask but i'm really confused with when to use ID and class. I have googled about it and read some posted questions on Stackoverflow here as well but still have doubt about it. I understand that ID can only be used once in a page and class can be use more than one within a class
The below here is CSS style sheet i've practiced on:
```
html,body{
padding:0px;
margin:0px;
height:100%;
background-color:#E9E9E9;
}
.infoBoxPad{
background-color:#DFDFDF;
width:990px;
height:19px;
border:solid thin #CCC;
margin:auto;
display:block;
}
#info1{
float:left;
width:125px;
height:16px;
line-height:15px;
border-right:thin solid #999;
padding-left:20px;
padding-right:20px;
display:block;
}
#info2{
float:left;
width:236px;
height:15px;
line-height:15px;
border-right:thin solid #999;
padding-left:20px;
padding-right:20px;
display:block;
}
#info2-link{
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
color:#000;
margin-left:11px;
margin-right:11px;
float:left;
text-decoration:none;
}
#info2-link:hover{
text-decoration:underline;
color:#03F;
}
#info3{
float:left;
width:183px;
height:16px;
line-height:15px;
padding-left:20px;
padding-right:20px;
display:block;
}
#info3-link{
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
color:#000;
margin-right:15px;
float:left;
text-decoration:none;
}
#info3-link:hover{
text-decoration:underline;
color:#03F;
}
#info-text-bold{
float:left;
font-family:Arial, Helvetica, sans-serif;
font-size:13px;
font-weight:600;
padding-right:20px;
color:#000;
text-decoration:none;
}
#info-text-bold1{
float:left;
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
font-weight:600;
padding-right:20px;
color:#000;
text-decoration:none;
}
#info-text-bold1:hover{
text-decoration:underline;
color:#03F;
}
#info1-novice{
color:#09F;
text-decoration:none;
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
font-weight:600;
}
#info1-novice:hover{
text-decoration:underline;
}
.header{
background-color:#FFF;
width:990px;
height:80px;
position:relative;
display:block;
margin:auto;
}
#header-logo{
margin-left:10px;
margin-top:20px;
}
.nav-bar-wrapper{
background-image:url(nav-bar.gif);
background-color:#333;
width:990px;
height:40px;
margin:auto;
}
#nav-bar{
margin:0;
padding:0;
}
#nav-bar ul{
margin:0 0 0 20px;
padding:0;
}
#nav-bar li{
margin:0;
padding:0;
list-style:none;
float:left;
position:relative;
}
#nav-bar ul li a{
text-align:center;
font-family:Arial, Helvetica, sans-serif;
font-size:14px;
font-weight:600;
text-decoration:none;
color:#FFF;
width:105px;
height:40px;
display:block;
line-height:35px;
border-right:1px solid #FFF;
}
#nav-bar ul li:hover{
background-color:#666;
height:35px;
}
.content{
width:990px;
height:1000px;
background-color:#FFF;
position:relative;
margin:auto;
}
#earn-point{
background-image:url(earnNow.gif);
width:300px;
height:60px;
}
#content-earnpoint{
background-color:#fffbe8;
width:278px;
height:100px;
border:solid thin #F90;
display:block;
padding:10px;
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
}
/**************************************************************************************************************Left Column*/
#leftcolumn{
background-color:#FFF;
width:300px;
margin:25px 10px 0px 10px;
float:left;
}
#guessing-game{
width:278px;
height:37px;
margin-top:25px;
}
#guessing-game-image{
float:left;
margin-right:5px;
}
#guessing-game-text{
float:left;
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
}
#guessing-game-text1{
color:#00C;
text-decoration:none;
font-weight:600;
}
#guessing-game-text1:hover{
text-decoration:underline;
}
/***********************************************************************************************************Right Column*/
#rightcolumn{
background-color:#FFF;
width:640px;
margin:25px 10px 0px 0px;
float:left;
}
#advert{
width:640px;
height:80px;
margin-bottom:10px;
}
#earn-reward{
background-color:#FC3;
width:640px;
height:16px;
padding:5px;
font-family:Arial, Helvetica, sans-serif;
font-size:18px;
line-height:14px;
}
#total-reward-points{
background-image:url(total%20reward%20points-background.gif);
width:268px;
height:184px;
margin:20px 0px 0px 0px;
padding:9px 15px 0px 15px;
border:1px thin solid;
}
#image-counter-heading{
margin:5px 10px 10px 0px;
display:inline;
}
#total-update-counter{
background-color:#F00;
width:264px;
height:33px;
margin:0px;
padding:8px 0px 5px 0px;
}
#homecounter-heading-wrapper{
width:268px;
height:48px;
margin:17px 0px 0px 0px;
display:block;
}
#homecounter-heading{
float:left;
}
#online-shopping{
width:650px;
height:30px;
margin-bottom:5px;
padding-top:15px;
padding-left:10px;
display:block;
}
#onlineshopping-logo{
margin-top:5px;
}
```
And html here:
```
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Smile City</title>
<link href="smilecity style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="infoBoxPad">
<!--info1-->
<div id="info1"><div id="info-text-bold">Jesso</div>
<img src="novice.gif" /> <a href="#" id="info1-novice">Novice</a></div>
<!--info2-->
<div id="info2">
<a href="#" id="info2-link">Points:118</a>
<a href="#" id="info2-link">Entries:29</a>
<a href="#" id="info2-link">Exp:108</a>
</div>
<!--info3-->
<div id="info3">
<a href="#" id="info3-link">Account Setting</a>
<a href="#" id="info-text-bold1">Sign Out</a>
</div>
</div><!--End infoBoxPad-->
<div class="header">
<img src="smilecity logo.gif" id="header-logo" />
</div><!--End header-->
<div class="nav-bar-wrapper">
<div id="nav-bar">
<ul class="nav-bar">
<li><a href="#">Home</a></li>
</ul>
<ul class="nav-bar">
<li><a href="#">Join</a></li>
</ul>
<ul class="nav-bar">
<li><a href="#">Earn</a></li>
</ul>
<ul class="nav-bar">
<li><a href="#">Redeem</a></li>
</ul>
<ul class="nav-bar">
<li><a href="#">Account</a></li>
</ul>
<ul class="nav-bar">
<li><a href="#">Help</a></li>
</ul>
</div><!--End nav-bar-->
</div><!--End nav-bar-wrapper-->
<div class="content">
<!--
-->
<div id="leftcolumn">
<div id="earn-point"></div>
<div id="content-earnpoint">
<strong>Hi Jesse, </strong>here's what you can do to earn points right now:
<div id="guessing-game">
<img src="gameYellowBg.gif" id="guessing-game-image" />
<a href="#" id="guessing-game-text1">Play the Guessing Game</a> and you could win up to 105,000 points.
</div>
</div><!--End Content-earnpoint-->
<div id="total-reward-points">
<img src="counterHeading1.gif" id="image-counter-heading" />
<div id="total-update-counter"></div>
<div id="homecounter-heading-wrapper">
<img src="homeCounterHeading2.gif" id="homecounter-heading" />
<img src="checkSml_sc.jpg" id="homecounter-heading" />
</div>
</div><!--End Total reward points-->
</div><!--End Left column-->
<div id="rightcolumn">
<div id="advert"><img src="ads.jpg" /></div>
<div id="earn-reward">
<strong>Earn Rewards</strong>
</div>
<div id="online-shopping">
<img src="onlineShoppingHome.gif" id="onlineshopping-logo" />
</div><!--End Online-shopping-->
</div><!--End Right Column-->
</div><!--End Content-->
</body>
</html>
```
I think i've made a mess in this css style sheet there since i've use heaps of IDs.
Please guys, tell me when/how to use ID and class?
Thanks in advance!
Edit:How about this picture? is that how you define when to use ID and Class?

| Class vs. ID in css (confusion) | CC BY-SA 2.5 | null | 2010-11-11T21:18:55.240 | 2012-11-03T18:38:41.803 | 2010-11-11T21:35:13.500 | 324,753 | 324,753 | [
"html",
"css"
] |
4,159,434 | 1 | 4,159,545 | null | 0 | 264 | Go this tag:
`<a href="javascript:{}" onclick="document.getElementById('_paypal').submit(); return false;"><span id="order_now_btn">Order Now</span></a>`
Here's the CSS:
```
#order_now_btn {
background: transparent url("../images/order_now_btn.gif") 0 0px no-repeat;
height: 33px;
width: 111px;
display: block;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:12px;
font-weight: bold;
cursor:pointer;
color: #fff;
}
```
Problem is, I can't get the text to fit in the right place...
Here's the button image:

Is there a better way to do this? I have quite a few of these to do.
| CSS image button not right | CC BY-SA 2.5 | null | 2010-11-11T21:26:16.300 | 2010-11-11T21:40:19.320 | 2020-06-20T09:12:55.060 | -1 | 338,403 | [
"css",
"image",
"button"
] |
4,159,601 | 1 | 4,159,619 | null | 1 | 798 | I've written small tcp socket client and server applications. Server sends text msg to client.
Part of servers code:
```
new_sock.Send(Encoding.UTF8.GetBytes("efgh"));
```
Part of clients code:
```
byte[] buffer = new byte[100];
int count = sock.Receive(buffer);
sock.Close();
textBox_received.Text = Encoding.UTF8.GetString(buffer);
```
In windows forms application everything is OK but in WPF application after received text always appears "boxes":

What is the reason and what can I do to avoid it?
| Strange characters in textbox after receiving via socket | CC BY-SA 2.5 | null | 2010-11-11T21:46:41.703 | 2010-11-11T21:51:42.590 | null | null | 43,842 | [
"c#",
"wpf",
"sockets"
] |
4,159,857 | 1 | null | null | 28 | 21,008 | I have a WPF app - an XBAP - with a ComboBox on the main page. When I select an item in the ComboBox, an event handler rebuilds a collection which is the data source for a listbox. Seems like pretty simple stuff, all stuff I've done in WPF before.
This is what my dropdown looks like after selecting an item from the list:

Where on earth did the red border come from? I am building the form from scratch, there is no styling or anything on it right now. The text "red" is not even mentioned anywhere in the project. It will not go away once it appears, and it shows up over anything that I place on top of the control.
Here's the markup:
```
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource ResourceKey=DeviceInfoNameConverter}}"></TextBlock>
</DataTemplate>
</ComboBox.ItemTemplate>
```
Some more details:
- - - -
My only guess so far from searching is that there is some sort of default error template that is being applied to the control. I'm working with WIA, and there are several COM exceptions that appear in the VS output window, apparently related to the databinding for the ListView. The data source to the control is a WIA.DeviceInfo object, the converter is just getting the name property for the dropdown text.
| Mysterious red border appears around ComboBox | CC BY-SA 2.5 | 0 | 2010-11-11T22:22:38.957 | 2021-04-10T07:09:53.810 | null | null | 20,846 | [
"wpf",
"xbap"
] |
4,159,867 | 1 | 4,160,497 | null | 2 | 676 | I recently tried adding parallax occlusion mapping to my landscape renderer and it looks and works fine, but I've faced some problems.
Here are 2 images


These are obviously the result of the ray approximation, which is a part of the parallax occlusion technique, but I'm pretty sure there are some ways to improve the visual effect.
Thanks.
| Parallax shader | CC BY-SA 2.5 | null | 2010-11-11T22:23:41.703 | 2010-11-12T00:08:13.600 | 2010-11-11T23:03:22.730 | 346,332 | 346,332 | [
"c++",
"mapping",
"shader",
"occlusion"
] |
4,160,207 | 1 | null | null | 3 | 9,371 | I have an app that uses a UIViewController to display articles in a UIWebView, some of which have images. I have it set up so that when an image is clicked it calls
```
- (void)displayImage:(NSInteger)i {
ImageViewController * imageVC = [[ImageViewController alloc] initWithImageId:i];
[self.navigationController pushViewController:imageVC animated:YES];
[imageVC release];
```
}
This loads another UIViewController.
All of my views responds perfectly fine to rotations. The ImageViewController maintains the proportions of the image and my ArticleViewController fills the screen with text. However, whenever I rotate the screen to landscape mode while viewing my ImageViewController and press the back button. The previous UIViewController autoresizes incorrectly, increasing the font size of the text rather than putting more words on a line.
EDIT:
This is an article view controller:

This is the ImageViewController that comes up when you click the image:

Now if we change the orientation here...

And hit the back button, the article content has been inappropriately resized to fit the window.

This can be corrected by turning the iPhone twice. This is what the article should look like in landscape.

The problem has something to do with the UIWebView not autoresizing appropriately when it isn't currently visible. What can I do to fix this?
| UIWebView not autoresizing to fit screen | CC BY-SA 2.5 | null | 2010-11-11T23:15:20.883 | 2012-12-28T19:06:21.477 | 2010-11-12T18:29:20.383 | 129,753 | 129,753 | [
"iphone",
"objective-c",
"uiviewcontroller",
"autoresize"
] |
4,160,224 | 1 | null | null | 24 | 29,732 | Is there program that allows output of a git-diff command to be explored in a GUI?
What i am looking for is something similar to the how SmartGit displays its view of the differences between the working copy and the HEAD. Where each of the files that are different to the HEAD are displayed and the diff for the focused file is displayed.
I am not sure if it is possible to make SmartGit display the output of a "git diff" command.

| Explore git-diff output in a GUI? | CC BY-SA 2.5 | 0 | 2010-11-11T23:17:16.107 | 2021-05-24T12:15:07.070 | null | null | 4,474 | [
"git",
"git-diff"
] |
4,160,608 | 1 | 4,160,671 | null | 0 | 8,754 | I am trying to make this picture showing but I had no success.
If I do
```
$.blockUI.defaults.message = '<img src="../images/blockUI_Loader.gif" />';
```
I get from fiddler

If I do
```
$.blockUI.defaults.message = '<img src="../_assets/images/blockUI_Loader.gif" />';
```
I get from fiddler

If I use
```
$.blockUI.defaults.message = '<img src="~/_assets/images/blockUI_Loader.gif" />';
```
I get from fiddler

My folder structure is as follow

the js file is in the `js` folder.
| relative path in javascript external file | CC BY-SA 2.5 | 0 | 2010-11-12T00:29:29.240 | 2010-11-12T01:24:09.743 | 2010-11-12T00:43:14.210 | 431,537 | 431,537 | [
"javascript",
"url",
"relative-path"
] |
4,160,983 | 1 | null | null | 2 | 2,051 | I am generating a crystal report and using a C# prog to break or "burst" the file in to individual pdf's (using this prog.... [Crystal Reports "File Break"](https://stackoverflow.com/questions/1822120/crystal-reports-file-break) )
When move the PageHeader section to the "Report Head" section, the details part of crystal reports does not show after the C# prog generates.
When I preview the crystal report from "preview" in crystal reports the detail section is there.....
Any Ideas?
Thanks in advance!!
I would post images but the site will not let me with out more than 10 rep points..


And this is after i generated the pdf.... See how the details section is not being populated, even tho in the preview in CR the activities are showing.... This all happened when i switched the top image to be in the group head instead of the page head....
| Crystal report to pdf's not generating as seen in Preview of Crystal Reports | CC BY-SA 2.5 | 0 | 2010-11-12T01:55:00.983 | 2011-03-03T18:42:24.407 | 2020-06-20T09:12:55.060 | -1 | 284,767 | [
"crystal-reports",
"pdf-generation"
] |
4,161,113 | 1 | 4,161,129 | null | 1 | 633 | My program compiles and runs correctly but after the execution, my program crashes.

Below is my code:
```
public class Hi
{
public static void main (String[]args)
{
System.out.println("Hi");
}
}
```
Can anyone help me regarding this... thanks.
| Why does my java program crashes? | CC BY-SA 2.5 | null | 2010-11-12T02:28:19.817 | 2010-11-12T02:54:18.323 | null | null | 396,335 | [
"java"
] |
4,161,511 | 1 | 4,466,668 | null | 1 | 1,254 | I followed most of the suggestions that I found online but I still got this error when I start integrating TFS and SP

I dont have firewall thats why it does not make sense, any idea why this is happening. My settings on Sharepoint Web Applications is

I also get this error when I create a Sharepoint Page for my project
but I dont allow anonymous access to my website. Any ideas?
| Team Foundation Server 2010 and Sharepoint Foundation 2010 Integration Error | CC BY-SA 2.5 | 0 | 2010-11-12T04:01:30.453 | 2016-02-12T00:26:17.620 | 2016-02-12T00:26:17.620 | 781,754 | 412,519 | [
"sharepoint",
"tfs",
"sharepoint-2010"
] |
4,161,741 | 1 | 4,162,189 | null | 9 | 3,551 | I have styled a tooltip like
```
<Setter Property="ToolTip">
<Setter.Value>
<Border Background="Red" CornerRadius="5" Padding="5" Margin="0">
<TextBlock Text="Hello" Foreground="White" />
</Border>
</Setter.Value>
</Setter>
```
And it gets rendered like

Whats that white "rectangle" about? How can I get rid of it
| WPF, Whats with this weird whitespace in Tooltip/Border | CC BY-SA 3.0 | null | 2010-11-12T04:57:39.290 | 2019-05-10T10:34:04.610 | 2011-09-14T12:11:31.147 | 256,196 | 292,291 | [
"wpf",
"styles"
] |
4,161,846 | 1 | 4,162,870 | null | 1 | 4,372 | I am trying to insert a QWebView into my QMainWindow in Qt Creator. However, I can't find it:
It is supposed to be in there in this group, but it's not.

I am using Qt Creator 2.01 on Ubuntu 10.10 64-bit.
| Where is QWebView? | CC BY-SA 2.5 | null | 2010-11-12T05:18:34.323 | 2010-12-21T16:36:15.920 | null | null | 193,619 | [
"qt",
"qt-creator",
"qwebview"
] |
4,162,020 | 1 | 6,531,522 | null | 76 | 29,504 | Let me start right off the bat by saying that I know this is not the best solution. I know it's kludgy and a hack of a feature.
This question/work builds off [some discussion on Quora with Andrew Bosworth](http://www.quora.com/What-are-best-practices-for-building-something-like-a-News-Feed), creator of Facebook's news feed.
of sorts. It's built solely in `PHP` and `MySQL`.

---
## The MySQL
The relational model for the feed is composed of two tables. One table functions as an activity log; in fact, it's named `activity_log`. The other table is `newsfeed`.
The is `activity_log(uid INT(11), activity ENUM, activity_id INT(11), title TEXT, date TIMESTAMP)`
...and the is `newsfeed(uid INT(11), poster_uid INT(11), activity ENUM, activity_id INT(11), title TEXT, date TIMESTAMP)`.
relevant to the news feed, for example asking a question, immediately.
---
## Generating the news feeds
Then (5 minutes at the moment, will change to 15-30 minutes later), that executes the script below. This script loops through all of the users in the database, finds all the activities for all of that user's friends, and then writes those activities to the news feed.
At the moment, the `SQL` that culls the activity (called in `ActivityLog::getUsersActivity()`) has a `LIMIT 100` imposed for performance* reasons. *Not that I know what I'm talking about.
```
<?php
$user = new User();
$activityLog = new ActivityLog();
$friend = new Friend();
$newsFeed = new NewsFeed();
// Get all the users
$usersArray = $user->getAllUsers();
foreach($usersArray as $userArray) {
$uid = $userArray['uid'];
// Get the user's friends
$friendsJSON = $friend->getFriends($uid);
$friendsArray = json_decode($friendsJSON, true);
// Get the activity of each friend
foreach($friendsArray as $friendArray) {
$array = $activityLog->getUsersActivity($friendArray['fid2']);
// Only write if the user has activity
if(!empty($array)) {
// Add each piece of activity to the news feed
foreach($array as $news) {
$newsFeed->addNews($uid, $friendArray['fid2'], $news['activity'], $news['activity_id'], $news['title'], $news['time']);
}
}
}
}
```
---
## Displaying the news feeds
In the client code, when fetching the user's news feed, I do something like:
```
$feedArray = $newsFeed->getUsersFeedWithLimitAndOffset($uid, 25, 0);
foreach($feedArray as $feedItem) {
// Use a switch to determine the activity type here, and display based on type
// e.g. User Name asked A Question
// where "A Question" == $feedItem['title'];
}
```
---
## Improving the news feed
Now forgive my limited understanding of the best practices for developing a news feed, but I understand the approach I'm using to be a limited version of what's called , limited in the sense that I'm running a cron job as an intermediate step instead of writing to the users' news feeds directly. But this is very different from a pull model, in the sense that the user's news feed is not compiled on load, but rather on a regular basis.
This is a large question that probably deserves a large amount of back and forth, but I think it can serve as a touchstone for many important conversations that new developers like myself need to have. I'm just trying to figure out what I'm doing wrong, how I can improve, or how I should maybe even start from scratch and try a different approach.
One other thing that bugs me about this model is that it works based on recency rather than relevancy. If anyone can suggest how this can be improved to work relevancy in, I would be all ears. I'm using Directed Edge's API for generating recommendations, but it seems that for something like a news feed, recommenders won't work (since nothing's been favorited previously!).
| How can I improve this PHP/MySQL news feed? | CC BY-SA 2.5 | 0 | 2010-11-12T05:55:33.633 | 2022-08-29T08:57:48.327 | 2010-11-12T06:01:41.620 | 373,496 | 373,496 | [
"php",
"mysql",
"web-applications",
"feed"
] |
4,162,157 | 1 | 4,242,839 | null | 11 | 8,985 | We want to create a screen which should have different list views and the user can slide (Left or right) to view another list view (just like in TweetDeck and in home screen on some Android OS version). There is also a list of dots which identify how many list views are there.
Please refer to the screen shot.

Thanks in advance,
Afzal.
| How to create a slider screen (As in Tweetdeck) in Android? | CC BY-SA 2.5 | 0 | 2010-11-12T06:24:41.017 | 2012-02-21T16:40:13.157 | null | null | 231,849 | [
"android",
"screen"
] |
4,162,327 | 1 | 4,163,147 | null | 2 | 1,636 | So I am trying to have a message displayed when the input is invalid, suppose I want something other than a `ToolTip`, something that stays until the error is corrected. I tried having an `ErrorTemplate`
```
<Style TargetType="{x:Type TextBox}">
<Setter Property="Validation.ErrorTemplate">
<Setter.Value>
<ControlTemplate>
<StackPanel>
<Border BorderBrush="Red" BorderThickness="1">
<AdornedElementPlaceholder x:Name="adornedErrorElement" />
</Border>
<Label Background="Red" Foreground="White" FontSize="9" Content="{Binding ElementName=adornedErrorElement, Path=AdornedElement.(Validation.Errors)[0].ErrorContent}" />
</StackPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<StackPanel Margin="20">
<TextBlock Text="Name" />
<TextBox Text="{Binding Name}" />
<TextBlock Text="Email" />
<TextBox Text="{Binding Path=Email, ValidatesOnDataErrors=True}" />
<Button Content="Submit" />
</StackPanel>
```
I get

Where the label overlays elements after it. How can I have it such that it works just like another element in the stackpanel?
# UPDATE: Using The VSM
Now, I want to go 1 step further and animate the error label up and down. I am considering VSM following @robertos answer. I tried implementing in in Blend. A few problems I faced. I tried
```
<ControlTemplate TargetType="{x:Type TextBox}">
<StackPanel Orientation="Vertical">
<Microsoft_Windows_Themes:ListBoxChrome ...>
<VisualStateManager.VisualStateGroups>
...
</VisualStateManager.VisualStateGroups>
<ScrollViewer ... />
</Microsoft_Windows_Themes:ListBoxChrome>
<Label Content="Error Here" />
</StackPanel>
</ControlTemplate>
```
Then I lost access to VisualStates in Blend. Then I tried
```
<Microsoft_Windows_Themes:ListBoxChrome>
<StackPanel>
<ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="2,0,-2,0"/>
<TextBlock x:Name="textBlock" Background="Red" Foreground="White" FontWeight="Bold" Text="Hello" Visibility="Collapsed" />
</StackPanel>
</Microsoft_Windows_Themes:ListBoxChrome>
```
Not ideal as the StackPanel is within the border. Also my attempts at animation looks just weird
[http://screenr.com/byk](http://screenr.com/byk)
http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0' width='560' height='345'>http://screenr.com/Content/assets/screenr_1116090935.swf' >http://screenr.com/Content/assets/screenr_1116090935.swf' flashvars='i=130553' allowFullScreen='true' width='560' height='345' pluginspage='[http://www.macromedia.com/go/getflashplayer](http://www.macromedia.com/go/getflashplayer)' >
1st I must make the label hidden instead of collapsed the animate just the opacity. I want the label to appear like its coming out from the textbox
| Displaying Errors, Having Controls After to Move Downwards | CC BY-SA 2.5 | null | 2010-11-12T07:02:50.087 | 2011-08-13T15:57:24.353 | 2011-08-13T15:57:24.353 | 305,637 | 292,291 | [
"wpf",
"validation",
"templates",
"styles"
] |
4,162,631 | 1 | 4,164,723 | null | 4 | 726 | is there an Android control for getting the user to slide something on the screen? Here's a mockup of the kind of widget I am looking for, in two states:

| control for "slide to unlock" -type use-cases | CC BY-SA 2.5 | 0 | 2010-11-12T07:57:51.877 | 2011-06-27T11:14:43.433 | null | null | 15,721 | [
"android"
] |
4,162,781 | 1 | null | null | 1 | 1,273 | I am searching for a way to make this:

As you see, my aim is to build something in explorer UI. Also, it looks very like like the Control Panel stuff.
I would like to get code example how to do this C# (which is my "primary" language), C++ or any other programming language.
Thank you.
P.S: It there are any differences between making this in Windows XP, Windows Vista and Windows Seven, please say them.
The application will be somehow (that's the question) into windows explorer.
How application will be runned (actually "viewed")? User will open Windows Explorer, type "My Application" into address bar, press enter and he will see something like above.
Thank you.
Eh... I just came in this website in MSDN [http://msdn.microsoft.com/en-us/library/bb757044.aspx](http://msdn.microsoft.com/en-us/library/bb757044.aspx).
I gues that the only simple way to accomplish my idea is to make control panel applet.
---
Maybe anybody knows, how to map Control Panel paths. For example user goes to "My Application", but gets redirected to "Control Panel\My Application"?
Thank you.
| Windows explorer like application | CC BY-SA 2.5 | 0 | 2010-11-12T08:26:56.750 | 2022-02-05T09:06:11.357 | 2010-11-12T11:33:35.843 | 366,904 | 175,908 | [
".net",
"windows",
"user-interface",
"explorer"
] |
4,162,837 | 1 | null | null | 0 | 196 | 
I know `0D 0A` means new line,What's `09 09 09 09 09 09 09 3F` ?
It's from UTF-8.
| What's the hex for? | CC BY-SA 2.5 | null | 2010-11-12T08:36:20.427 | 2010-11-12T08:46:01.663 | 2010-11-12T08:46:01.663 | 477,822 | 477,822 | [
"character-encoding"
] |
4,163,299 | 1 | null | null | 0 | 1,355 | Will datetime datatype in a table column(last_modified_timestamp) update the current time automatically?
i have a table column as shown below , i need to know whether it will insert the current time in the column automatically?
How i know currently i have default settings in my table?
i changed it to insert ...not for updating !

| Will datetime datatype in a table column update the current time automatically? | CC BY-SA 2.5 | null | 2010-11-12T09:41:45.100 | 2010-11-12T22:22:53.943 | 2010-11-12T09:48:23.007 | 106,528 | 106,528 | [
"sql",
"sql-server",
"sql-server-2005",
"tsql"
] |
4,163,637 | 1 | 4,163,805 | null | 4 | 26,806 | My Boss give me an image (please see below) and told him I would make his site look the same. Here is my code, but it doesn't look like the image:
HTML
```
<div class="clearfix" id="footer">
<ul>
<li><a href="/pages/facility">Become a Virtual Active Facility</a></li>
<li><a href="/pages/about">About Us</a></li>
<li class="last"><a href="/pages/contact">Contact</a></li>
</ul>
</div>
```
CSS
```
#footer {
background: -moz-linear-gradient(left center, white, white) repeat scroll 0 0 transparent;
margin-bottom: 25px;
margin-top: 25px;
opacity: 0.6;
padding: 10px 25px;
width: 914px;
}
```

How can I get the result to look the same?
| Gradient from transparent to color in CSS | CC BY-SA 3.0 | 0 | 2010-11-12T10:22:40.613 | 2016-07-17T23:01:14.070 | 2012-11-23T08:07:27.093 | 278,666 | 278,666 | [
"html",
"css"
] |
4,163,948 | 1 | 4,186,155 | null | 2 | 4,170 | I'm trying to get this to work with code in a ViewController's view:

but I can't get it to work.
I've tried
```
-(void)loadView {
UIView *contentView = [[[UIView alloc] init] autorelease];
self.view = contentView;
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
button.frame = CGRectMake(5,5,0,100);
button.autoresizingMask = UIViewAutoresizingFlexibleWidth;
[contentView addSubview:button];
}
```
but the width of the button is still the width of the superview...
I'm sure there's an easy explanation.
Thanks, everybody!
Antonio
| Trouble with autoresizingMask and fixed margins | CC BY-SA 2.5 | null | 2010-11-12T11:00:46.427 | 2011-07-14T00:56:25.740 | 2010-11-15T15:19:49.900 | 76,186 | 76,186 | [
"iphone",
"ios",
"autoresize",
"autoresizingmask"
] |
4,164,011 | 1 | 4,164,063 | null | 3 | 10,046 | I created a Java project that contains three configuration file
- - -
I put these three files into a resource folder.
Then I created a jar file of my project. This jar file is added to another project. It isn't able to find the correct location of the configuration files.
My file structure:

Thanks
---
| How to get correct path of configuration file? | CC BY-SA 2.5 | null | 2010-11-12T11:10:34.147 | 2010-11-12T11:43:07.960 | 2010-11-12T11:19:00.537 | 201,078 | 423,620 | [
"java",
"configuration"
] |
4,164,466 | 1 | 4,164,517 | null | 5 | 9,850 | I am trying to add a simple compact `fshare` button on my website. The only code I found was this one:
```
<div style="float:left;padding:4px;">
<a expr:share_url='data:post.url' name='fb_share' rel='nofollow' type='button_count'/>
<script type="text/javascript" src="http://static.ak.fbcdn.net/connect.php/js/FB.Share"/>
</div>
```
Which should render as

But it is not redering correct. It seems it is trying to create multiple buttons and "crashes" all the page. It corrupts the HTML, change the background of a entire div and so on...

Why is that? Is this the correct code?
| Compact facebook share button with count? | CC BY-SA 2.5 | 0 | 2010-11-12T12:11:14.923 | 2013-06-29T16:44:55.423 | 2010-11-18T23:34:49.223 | 75,505 | 340,760 | [
"facebook",
"facebook-sharer"
] |
4,164,503 | 1 | null | null | 2 | 491 | I am creating a web setup project using .net 2010. the setup is build successfuly. but when i install the setup it install the web site in virtual directory.
like this

Now i want Place web app in IIS default website not virtual directory or enable site textbox for entry.
Thanks.
| web setup project - Place web app in IIS default website not virtual directory | CC BY-SA 2.5 | 0 | 2010-11-12T12:16:17.940 | 2010-11-15T11:14:04.643 | null | null | 379,737 | [
"iis-6",
"setup-deployment",
"web-setup-project"
] |
4,164,599 | 1 | null | null | 4 | 399 | I've developed a simple windows forms application to capture the windows of a video chat application (inbound, aka Remote, and outbound, aka Local).
I use unmanaged Windows API code for this. Here is the Capture code:
```
// Set Local Window
localHandle = FindWindow(null, "local");
// Backup parent window for local
prevLocalHandle = GetParent(localHandle);
SetParent(localHandle, this.pBoxLocal.Handle);
SetWindowLong(localHandle, GWL_STYLE, WS_VISIBLE + (WS_MAXIMIZE | WS_BORDER | WS_DISABLED));
MoveWindow(localHandle, 0, -TOP_BAR_HEIGHT, this.pBoxLocal.Width, this.pBoxLocal.Height + LOWER_BAR_HEIGHT, true);
// Set Remote Window
remoteHandle = FindWindow(null, "remote");
// Backup parent window for remote
prevRemoteHandle = GetParent(remoteHandle);
SetParent(remoteHandle, this.pBoxRemote.Handle);
SetWindowLong(remoteHandle, GWL_STYLE, WS_VISIBLE + (WS_MAXIMIZE | WS_BORDER | WS_DISABLED));
MoveWindow(remoteHandle, 0, -TOP_BAR_HEIGHT, this.pBoxRemote.Width, this.pBoxRemote.Height + LOWER_BAR_HEIGHT, true);
```
Here is the Return code:
```
// Return Windows
SetParent(localHandle, prevLocalHandle);
SetWindowLong(localHandle, GWL_STYLE, (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX));
MoveWindow(localHandle, 0, 0, NORMAL_WIDTH, NORMAL_HEIGHT, true);
SetParent(remoteHandle, prevRemoteHandle);
SetWindowLong(remoteHandle, GWL_STYLE, (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX));
MoveWindow(remoteHandle, 0, 0, NORMAL_WIDTH, NORMAL_HEIGHT, true);
```
The goal is to go from this:

To this:

And then back again! :)
There are currently two issues with my way of doing things:
- first of all, when I return the windows to the video chat application, ocasionally a black rectangle is left on my top-left corner of the screen. It disappears when I refresh the area.- second and most important of all, there are times that when I capture the window of the application, I also capture its toolbars (although the measurements I supply are just the ones regarding the video area of the window).
Is there a better way of doing this? Even if its just better functions! Remember: I want to obtain the windows of the video chat application and return them afterwards.
Thanks in advance for any tips!
| What is the best way to capture an application window in C#? | CC BY-SA 2.5 | null | 2010-11-12T12:28:37.910 | 2012-11-06T10:05:02.483 | null | null | 135,514 | [
"c#",
"winapi",
"unmanaged"
] |
4,164,689 | 1 | 4,164,725 | null | 7 | 6,774 | 
I want to hide HTML Button selection like in above image whenever i click on buttons from 1 to 25 Its shows that it is selected like now I want to hide this for security purpose how can i do this any idea will help me
| how to hide HTML button selection? | CC BY-SA 2.5 | 0 | 2010-11-12T12:37:53.870 | 2011-07-15T13:08:27.650 | 2010-11-12T12:42:24.997 | null | 435,559 | [
"html",
"css"
] |
4,165,767 | 1 | 4,165,784 | null | 0 | 651 | see the application bar in WP7, for example this one : 
You have the + icon and the - icon. On the right, there's three dot ...
How can I remove them (I found them ugly) and the fonctionnaly ?
Thanks in advance for any help
| Remove three dot of applicationbar in WP7 | CC BY-SA 2.5 | null | 2010-11-12T14:46:42.633 | 2011-11-10T09:39:20.163 | null | null | 491,723 | [
"silverlight",
"windows-phone-7"
] |
4,166,002 | 1 | null | null | 4 | 11,023 | I have a ExtJS page that is outputting the following DOM.
I want to select a specific element so that I can respond to a click on it.
However, the following code never selected the elements that are built with the extJS library. JQuery can't seem to select them either.
ExtJS can't even find an element that is defined in the `<body>` element in the HTML file itself. However, JQuery can indeed select an element defined in the `<body>` element.
I have been reading [this guide](http://www.ajaxray.com/blog/2009/04/05/extjs-quick-start-guide-for-jquery-developers-javascript-howto/) which seems to indicate it should be no problem to just use `Ext.get()` and `Ext.select()` to get elements, however, as the following code shows, the elements are never selected.
```
var members = Ext.select('x-panel');
for (var i = members.length - 1; i >= 0; i--){
element = members[i];
element.on('click', function() { alert('test');})
};
```


| How can I select elements in ExtJS? | CC BY-SA 2.5 | 0 | 2010-11-12T15:12:15.277 | 2012-11-15T02:28:31.877 | 2010-11-12T15:57:22.247 | 4,639 | 4,639 | [
"extjs",
"event-handling"
] |
4,166,114 | 1 | 4,184,884 | null | 3 | 278 | After publishing my XBAP application, I am missing all (or some) TextBlocks. It looks like this:

The buttons should be labeled, there should be various TextBlocks all over the main screen.
To make things more strange:
- - - - -
Any Ideas what might be causing this? Please ask if you need more information! Thanks!
I've made a small project to reproduce the bug. You can find it published [here](http://v468.ncsrv.de/xbap/BugDemo.xbap). Note that this bug seems to affecct .NET 4.0 only.
Starting with a WPF Browser application, this is my code in Page1.xaml
```
<Page x:Class="BugDemo.Page1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
<Grid x:Name="LayoutRoot">
<TextBlock FontSize="35" Text="Vanishing Text" />
<Grid.LayoutTransform>
<ScaleTransform />
</Grid.LayoutTransform>
</Grid>
</Page>
```
CodeBehind:
```
public partial class Page1 : Page
{
public Page1()
{
InitializeComponent();
this.Loaded += AppPage_Loaded;
}
public double Scale
{
get { return ((ScaleTransform)this.LayoutRoot.LayoutTransform).ScaleX; }
set
{
((ScaleTransform)this.LayoutRoot.LayoutTransform).ScaleX = value;
((ScaleTransform)this.LayoutRoot.LayoutTransform).ScaleY = value;
}
}
void AppPage_Loaded(object sender, RoutedEventArgs e)
{
App.Current.MainWindow.SizeChanged += (o, args) => UpdateScale();
UpdateScale();
}
private void UpdateScale()
{
double xscale = (App.Current.MainWindow.ActualWidth) / 300;
double yscale = (App.Current.MainWindow.ActualHeight) / 200;
Scale = Math.Min(xscale, yscale);
}
}
```
After publishing this, The "Vanishing Text" can only be seen at some zoom levels. It works fine in Debug.
| XBAP: Missing texts in published version | CC BY-SA 2.5 | 0 | 2010-11-12T15:24:33.417 | 2010-11-15T13:38:37.163 | 2010-11-15T10:53:54.560 | 276,070 | 276,070 | [
"c#",
".net",
"wpf",
"xbap"
] |
4,166,217 | 1 | 4,185,737 | null | 0 | 532 | I have a question about WiX installers
Currently if the user selects Custom Setup, they get this screen. It defaults to having nothing selected to install, but the “Next” button is still enabled. If the user clicks “Next” when nothing is selected, the installation attempts to proceed, but encounters throws and exception.

What I would like is for the top level item to be selected by default (and not allow deselect) or have the next button disabled when nothing is selected. Do you have any suggestions?
By the way, I do have Absent=”disallow” set on the object, so you can’t deselect it once it is selected, but for some reason it is deselected by default.

Thanks,
| How to make WiX custom setup items selected for install by default? | CC BY-SA 2.5 | null | 2010-11-12T15:35:39.743 | 2010-11-15T15:14:24.593 | null | null | 381,422 | [
"installation",
"wix"
] |
4,166,400 | 1 | null | null | 3 | 9,386 | i have an dynamic image gallery to display, using PHP...

the style & positioning should be that if there is not enough space for a whole div, like in the image above, then the DIVs in the row should position them like the following
centered and equi distant...
[here is JS-Fiddle](http://jsfiddle.net/u7qBz/1) basic template set, if somebody wants to try something on jsFiddle
| CSS Advanced Div Positioning. Auto Arrange to Grid | CC BY-SA 2.5 | 0 | 2010-11-12T15:52:21.843 | 2021-03-13T14:17:10.733 | 2010-11-12T16:06:37.083 | 158,455 | 158,455 | [
"css",
"positioning",
"html"
] |
4,166,403 | 1 | 4,166,508 | null | 24 | 76,817 | I search an example or sample to filter the WPF DataGrid column elements by a textbox.

Something similar to [this](http://www.codeproject.com/KB/WPF/wpf_datagrid_filter.aspx) (the given example uses a ... apparently abandoned by Microsoft...)
XAML
```
<Canvas>
<DataGrid Height="200" Name="dataGrid1" Width="200" Canvas.Top="23" />
<TextBox Name="textBox1" Width="120" />
</Canvas>
```
cs:
```
public partial class MainWindow : Window
{
private List<Personne> persons;
ICollectionView cvPersonnes;
public MainWindow()
{
InitializeComponent();
persons = new List<Personne>();
persons.Add(new Personne() { Id = 1, Nom = "Jean-Michel", Prenom = "BADANHAR" });
persons.Add(new Personne() { Id = 1, Nom = "Gerard", Prenom = "DEPARDIEU" });
persons.Add(new Personne() { Id = 1, Nom = "Garfild", Prenom = "THECAT" });
persons.Add(new Personne() { Id = 1, Nom = "Jean-Paul", Prenom = "BELMONDO" });
cvPersonnes = CollectionViewSource.GetDefaultView(persons);
if (cvPersonnes != null)
{
dataGrid1.AutoGenerateColumns = true;
dataGrid1.ItemsSource = cvPersonnes;
cvPersonnes.Filter = TextFilter;
}
}
public bool TextFilter(object o)
{
Personne p = (o as Personne);
if (p == null)
return false;
if (p.Nom.Contains(textBox1.Text))
return true;
else
return false;
}
}
public class Personne
{
public int Id { get; set; }
public string Nom { get; set; }
public string Prenom { get; set; }
}
```
| Filter a DataGrid on a Text box | CC BY-SA 4.0 | 0 | 2010-11-12T15:52:39.830 | 2018-11-15T23:15:07.713 | 2018-11-15T23:15:07.713 | 102,937 | 185,593 | [
"wpf",
"datagrid",
"wpfdatagrid"
] |
4,166,545 | 1 | 4,167,721 | null | 7 | 9,041 | This one's really kicking my backside. I have a form, spawned and owned by the main form of the application, that is used for searching records. The form is laid out in a docked TableLayoutPanel, with a combination of Absolute and Percentage-sized rows/columns so that my labels stay the same size while the data entry and results controls grow. We're talking about 20 controls all told.
The problem is that, although the TableLayoutPanel is fill-docked, and all child controls are also fill-docked, nothing is resizing inside the form when I grab the window edge and drag. Everything resizes just fine in the designer, but not in the actual app.
I did use my Google-fu, and found [this SO question](https://stackoverflow.com/questions/2176426/c-anchored-panel-wont-resize-properly) which pointed me to [this MSKB article](http://support.microsoft.com/kb/953934). I created a derived FlowLayoutPanel and a derived TableLayoutPanel with the threaded calls and put them in, but it's still not working. This is the ONLY form on which this is happening, and another form has some pretty deep nesting as well (it uses a TabControl and TableLayoutPanel to layout the data entry controls, but no RBs).
Other pertinent info:
- - - - -
I'm tearing my hair out here. Help!
: Here are some of the requested pictures showing layout behavior in the designer and in-app:




The controls that begin with "Nested" derive directly from the built-in panel controls, and their only change is an override of OnSizeChanged() to call the base method asynchronously (the workaround from the KB article). It doesn't work with the built-in panels either, as I said before. As you can see from the last two windows, the mainLayout TLP simply does not grow even though it's docked to the window in the designer.
| Anchored controls won't resize when window is resized (56k beware) | CC BY-SA 2.5 | 0 | 2010-11-12T16:05:59.230 | 2012-12-02T23:04:44.927 | 2017-05-23T12:09:13.380 | -1 | 436,376 | [
"c#",
"winforms",
"datagridview",
"mouseevent"
] |
4,168,033 | 1 | 4,282,265 | null | 3 | 5,500 | I need to know if I'm doing the things in a wrong way.
I have the following project structure (a pretty standard one):

then I've configured `javah` as external tool like this:

When I run the external tool on `OSManager4Windows.java` I was expecting to find `it_univpm_quickbackup_utils_OSManager4Windows.h` in `bin/it/univpm/quickbackup/utils/` but it is inside `bin`. Is that correct? Shouldn't be inside the same directory of the .class file?
| Using javah -jni with an Eclipse project structure | CC BY-SA 2.5 | 0 | 2010-11-12T18:50:24.250 | 2010-11-26T03:04:46.163 | null | null | 259,562 | [
"java",
"eclipse",
"java-native-interface",
"external-tools"
] |
4,168,069 | 1 | 4,169,649 | null | 5 | 1,201 | I have a menu very similar to the menu here on StackOverflow. The problem is that my menu looks right in every browser I've tested it on EXCEPT for my iPhone.
Here is a screenshot of the iPhone

Now obviously the "Add Event" button is supposed to be the same size as the rest.
Here's my Markup
```
<div id="menucontainer">
<div class="floatleft">
<ul class="menu">
<li><%: Html.NavigationLink("Now", "Index", "Events")%></li>
<li><%: Html.NavigationLink("Coming", "Coming", "Events")%></li>
<li><%: Html.NavigationLink("Hot", "Hot", "Events")%></li>
<li><%: Html.NavigationLink("Tags", "Index", "Tags")%></li>
<li><%: Html.NavigationLink("Users", "Index", "Users")%></li>
</ul>
</div>
<div class="floatright">
<ul class="menu">
<li><%: Html.NavigationLink("Add Event", "AddEvent", "Events")%></li>
</ul>
</div>
</div>
```
And here's my CSS
```
#menucontainer{position:relative; width:675px; float:right;}
ul.menu
{
padding: 0 0 2px;
position: relative;
margin: 0;
}
ul.menu li
{
display: inline;
list-style: none;
}
ul.menu li a
{
padding: 8px 18px;
font-weight: bold;
text-decoration: none;
line-height: 2.8em;
background-color: #666;
color: #fff;
border: 1px solid black;
text-shadow:#000 0px 1px 1px;
}
ul.menu li a.youarehere
{
background-color:@brand_color;
color: #fff;
}
ul.menu li a:hover
{
background-color:@brand_color;
text-decoration: none;
}
ul.menu li a:active
{
background-color:@brand_color;
text-decoration: none;
}
ul.menu li.selected a
{
background-color:@brand_color;
color: #000;
}
.floatright
{
float: right;
}
.floatleft
{
float: left;
}
```
Unfortunately I can't figure this one out. Thanks in advance for any direction.
# EDIT:
This is the final output being sent to the browser
```
<div id="menucontainer">
<div class="floatleft">
<ul class="menu">
<li><a class="youarehere" href="/">Now</a></li>
<li><a href="/events/coming">Coming</a></li>
<li><a href="/events/hot">Hot</a></li>
<li><a href="/tags">Tags</a></li>
<li><a href="/users">Users</a></li>
</ul>
</div>
<div class="floatright">
<ul class="menu">
<li><a href="/events/addevent">Add Event</a></li>
</ul>
</div>
</div>
```
# EDIT:
Reproduction on jsbin
[http://jsbin.com/akadi3/2](http://jsbin.com/akadi3/2) (note: obviously you need the iOS browser to see the problem)
| Menu Layout works in all browsers EXCEPT iPhone | CC BY-SA 2.5 | 0 | 2010-11-12T18:54:58.947 | 2010-11-12T22:29:45.083 | 2010-11-12T20:49:46.387 | 124,069 | 124,069 | [
"iphone",
"safari",
"css"
] |
4,168,289 | 1 | 4,175,934 | null | 2 | 757 |
## Background
- Multi threaded Core Data application - `NSTreeController` and `NSOutlineView` with bindings- Creates children objects in an NSOperation on a background context- Merges into main context using `mergeChangesFromContextDidSaveNotification`

## Problem
- If I queue 20 children creation operations up, once the merges have completed, I see only about 10-15 child objects in the outline view.- If I set the max concurrent operations to 1, it works perfectly and I see 20 children.
## Question
Is what I'm trying to do impossible? I can see how core data might struggle to do the merges successfully. Or is there an issue with my code?
## Code
```
-(id)init {
self = [super init];
queue = [[NSOperationQueue alloc] init];
[queue setMaxConcurrentOperationCount:10]; // If this is 1, it works like a dream. Anything higher and it bombs.
return self;
}
-(IBAction)addTrainingEntryChild:(id)sender {
moc = [[NSApp delegate] managedObjectContext];
JGTrainingBase *groupToAddTo = [[tree selectedObjects] objectAtIndex:0];
for (NSUInteger i = 0; i < 20; i++) {
JGAddChildrenObjectOperation *addOperation = [[JGAddChildrenObjectOperation alloc] init];
[addOperation addChildObjectToGroup:[groupToAddTo objectID]];
[queue addOperation:addOperation];
}
}
```
```
-(id)addChildObjectToGroup:(NSManagedObjectID *)groupToAddToID_ {
groupToAddToObjectID = groupToAddToID_;
return self;
}
-(void)main {
[self startOperation];
JGTrainingBase *groupToAddTo = (JGTrainingBase *)[imoc objectWithID:groupToAddToObjectID];
JGTrainingBase *entryChildToAdd = [JGTrainingBase insertInManagedObjectContext:imoc];
[groupToAddTo addChildren:[NSSet setWithObject:entryChildToAdd]];
[imoc save];
[self cleanup];
[self finishOperation];
}
-(void)mergeChanges:(NSNotification *)notification {
NSManagedObjectContext *mainContext = [[NSApp delegate] managedObjectContext];
[mainContext performSelectorOnMainThread:@selector(mergeChangesFromContextDidSaveNotification:)
withObject:notification
waitUntilDone:YES];
}
-(void)startOperation {
// Omitted - Manage isExecuting, isPaused, isFinished etc flags
imoc = [[NSManagedObjectContext alloc] init];
[imoc setPersistentStoreCoordinator:[[NSApp delegate] persistentStoreCoordinator]];
[imoc setUndoManager:nil];
[imoc setMergePolicy:NSMergeByPropertyStoreTrumpMergePolicy];
[imoc setStalenessInterval:0];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(mergeChanges:)
name:NSManagedObjectContextDidSaveNotification
object:imoc];
}
-(void)finishOperation {
// Omitted - Manage isExecuting, isPaused, isFinished etc flags
}
```
| Core Data: Merging children added on a background context is funky | CC BY-SA 2.5 | 0 | 2010-11-12T19:23:32.103 | 2010-11-14T02:45:46.887 | 2010-11-12T19:32:43.147 | 69,749 | 60,131 | [
"objective-c",
"multithreading",
"cocoa",
"core-data",
"nsoperation"
] |
4,168,615 | 1 | null | null | 0 | 2,353 | I need to make a menu that looks like this:

The upper entries need to have a right margin of (lets say) 20px.
Problem arises, when I add the sub-menus, especially like the red one with the «large Menu-Entry». The top menu needs to stay in place and all the sub-menus need to be centered under that top menu. But either the top-entry is enlarged (which makes the green part shift to the right) or the sub-entries aren't positioned at the center of the top-entry...
As the menu-entries are dynamic, I can't predict how wide they are and thus I can't apply any math.
Also - the sub-entries are only visible, if the user is on the according page (means - the green part only shows «Menu1» if the user is on the red page)
I «could» use some javascript to do it after the page loaded, but I'm trying to avoid that.
I tried all sorts of stuff, including negative margins and whatnot - but nothing seems to work... Any ideas?
[edit]
some html here - tried to fumble around like crazy with no results (except the one from Brad, but that one doesn't work with IE)
```
<div class="center">
<div class="menu-container">
<div class="menu-title">Title 1</div>
<div class="menu-items">
Testomat<br />
Yo, this is a long text
</div>
</div>
<div class="menu-container">
<div class="menu-title">Title 1</div>
<div class="menu-items">
Testomat<br />
Yo, this is a long text
</div>
</div>
</div>
```
CSS:
```
.menu-container{
width: 100px;
float: left;
}
.menu-items, .menu-title{
text-align: center;
}
```
| css - oversized div within small div | CC BY-SA 2.5 | null | 2010-11-12T20:05:06.983 | 2010-11-13T13:33:42.457 | 2010-11-13T04:08:04.907 | 424,706 | 424,706 | [
"css"
] |
4,168,657 | 1 | 4,168,719 | null | 2 | 1,656 | My table headers contain links that, when clicked, make an AJAX call to change the sort order.
```
<tr><th><a href="Name" style="display:block;">Name</a></th></tr>
```
This is great, I can click anywhere within the table header to activate the link.
Now I want to add sort arrows to indicate the sort order.
```
<tr><th><a href="Name" style="display:block;">Name<img src="arrow.png" /></a></th></tr>
```
This looks good in IE8:

However in FireFox and Chrome the image also has the underline:

I've been playing around with different css properties and I can't get it to work how I want. How can I get this to work in Firefox and Chrome like how it does in IE8?
Note that I want to have the whole cell to be clickable, so I need to use "display:block;" for the link and I also need the link text and image next to each other, so using "display:block;" on the image is not an option.
Thanks!
| How can I remove the underline of a linked image in Firefox and Chrome? | CC BY-SA 2.5 | 0 | 2010-11-12T20:10:50.700 | 2010-11-12T20:32:52.953 | null | null | 274,837 | [
"css"
] |
4,169,159 | 1 | null | null | 6 | 1,600 | I'm having a strange problem when resizing a canvas' parent, which happens to be a ChildWindow.
From a high level, this is what I'm trying to do when a user clicks on a button:
1. Unhide a row, by setting the RowDefinition height from 0 to something larger.
2. Resize the canvas, since everything inside is taller.
3. Resize the canvas' parent (a ChildWindow), since the canvas is taller.
Steps 1 and 2 work fine. The problem is with step 3: when I step through the F#/Silverlight code, all of the sizes appear to be set correctly. The problem is that the ChildWindow gets rendered on the screen as being taller than it really should.
Take a look a the example below:
```
member this.btnWhatever_Click(sender : obj) (args : RoutedEventArgs) =
let parentWindow = this.Parent :?> ChildWindow // get the canvas' parent, and cast it to a ChildWindow
// if the RowDefinition height is set to our standard, the hide it by setting it to 0
if this.aRowDefinition.Height.Value.Equals STANDARD_ROW_HEIGHT then
this.aRowDefinition.Height <- new GridLength(0.)
this.Height <- this.Height - HEDGE_ROW_HEIGHT
parentWindow.Height <- parentWindow.Height - STANDARD_ROW_HEIGHT
this.btnCreateOrRemoveHedge.Content <- "On"
// otherwise, unhide the RowDefinition by setting it to the standard height
else
this.aRowDefinition.Height <- new GridLength(STANDARD_ROW_HEIGHT)
this.Height <- this.Height + STANDARD_ROW_HEIGHT
parentWindow.Height <- parentWindow.Height + STANDARD_ROW_HEIGHT
this.btnWhatever.Content <- "Off"
()
```
In this case, my STANDARD_ROW_HEIGHT is only 23 pixels, and yet an empty space of 92 pixels is being added to the ChildWindow below the title bar after the user clicks the button. What's more, is that when the user clicks the button again (to toggle the row visibility), the row disappears but the extra space at the top of the window remains. Initially, this empty space is not there. See this image:

Any thoughts/help would be greatly appreciated. Thanks!
| Resizing ChildWindow height on-the-fly in Silverlight causes strange behavior | CC BY-SA 2.5 | 0 | 2010-11-12T21:25:37.943 | 2010-11-12T22:02:48.087 | null | null | 107,877 | [
"silverlight",
"xaml",
"silverlight-4.0",
"f#"
] |
4,169,266 | 1 | null | null | 14 | 51,083 | I used Netbeans to create a Spring MVC 3.0 app. I have a simple controller and JSP view. The JSP view appears correctly except for an image that doesn't render. My directory structure looks like this:

In my Home.jsp page, the image that doesn't render is referenced like so:
```
<img src="Images/face.png" />
```
I've verified that face.png is in the Images directory. So why doesn't it appear in the browser? In Spring MVC, where should I place files referenced by JSP views, like images, CSS, JS, etc?
| Where to place images/CSS in spring-mvc app? | CC BY-SA 2.5 | 0 | 2010-11-12T21:39:04.340 | 2015-03-30T09:59:23.173 | null | null | 3,401 | [
"spring-mvc"
] |
4,169,355 | 1 | 4,169,406 | null | 27 | 27,387 | I've been creating stored procedures using Oracle SQL developer.
For some reason, one of the icons does not contain a green circle. What gives? What does this non-green icon mean?

| What does this Oracle SQL Developer icon mean on my stored procedure? | CC BY-SA 2.5 | 0 | 2010-11-12T21:48:01.587 | 2012-03-15T03:38:18.280 | null | null | 28,351 | [
"oracle",
"stored-procedures",
"oracle-sqldeveloper"
] |
4,169,769 | 1 | 4,169,862 | null | 2 | 334 | I am attempting to use the FileDialog construct in VBA to display a list of available files the user may want to open. I would like to also steer the user towards some common folders in which they typically will find the type of content they are looking for. So far I have come short on locating a method to place a link on the left side of the FileDialog box in which they could click to jump to a specific location.
I am hoping there is a means of doing this while calling the FileDialog methods like an example shown below where I have used the `fd.AddLinkMethod "<path goes here>"`.
```
Private Function GetLocation() As String
Dim fd As FileDialog
Dim vrtSelectedItem As Variant
Set fd = Application.FileDialog(msoFileDialogOpen)
fd.ButtonName = "Open"
fd.Title = "Select File To Open"
fd.InitialView = msoFileDialogViewTiles
fd.AddLinkMethod "<path goes here>"
With fd
If .Show = -1 Then
For Each vrtSelectedItem In .SelectedItems
GetLocation= FormatPath(vrtSelectedItem)
Next vrtSelectedItem
End If
End With
Set fd = Nothing
End Function
```
Here is a screenshot of what I am attempting to accomplish?

Any pointers?
Thanks,
| How to create custom links in the Application.FileDialog using VBA? | CC BY-SA 2.5 | 0 | 2010-11-12T22:50:44.820 | 2010-11-13T21:46:00.397 | 2010-11-12T22:57:40.353 | 3,155 | 3,155 | [
"ms-access",
"vba",
"dialog",
"hyperlink",
"openfiledialog"
] |
4,169,883 | 1 | 4,174,368 | null | 1 | 1,458 | I'd like to have my `NSSegmentedControl` with a segment selected when enabled and with no segment selected while disabled (the kind of behavior that the view NSSegmentedControl in iTunes has).
Here some images:

enabled and selected

disabled correctly

disabled but not correctly
(*) I recognize that I could write a function to call whenever the BOOL property changes and in this function I could set all the segments desected or select the appropriate one, BUT I'd like to know if there's a way to accomplish this through Cocoa Bindings or Interface Builder.
added some images of the problem
| How to properly set an NSSegmentedControl enabled | CC BY-SA 4.0 | 0 | 2010-11-12T23:16:22.653 | 2019-08-07T15:19:05.577 | 2019-08-07T15:19:05.577 | 4,751,173 | 370,158 | [
"objective-c",
"cocoa",
"cocoa-bindings",
"nsuserdefaults",
"nssegmentedcontrol"
] |
4,170,134 | 1 | 4,170,296 | null | 3 | 2,004 | I'm doing a project where i need some custom swing components. So far I have made a new button with a series of images (the Java Metal look doesn't fit with my UI at all). Ive implemented `MouseListener` on this new component and this is where my problem arises. My widget changes image on hover, click etc except my `MouseListener` picks up mouse entry into a the entire `GridLayout` container instead of into the image. So I have an image of about 200*100 and the surrounding container is about 400*200 and the `mouseEntered` method is fired when it enters that `GridLayout` section (even blank space parts of it) instead of over the image. How can I make it so that it is only fired when I hover over the image? Ive tried setting size and bounds and other attributes to no avail.
EDIT: Here's a demonstration of my issue. As you can see (sort of, colors are very similar) the bottom right button is highlighted just by entering its section of the `GridlLayout`. I only want it highlighted when I'm over the image actual, not the `GridLayout` section.

I Won't add the `MouseListener` methods because they just involve switching the displayed image.
```
public customWidget()
{
this.setLayout(new FlowLayout());
try {
imageDef=ImageIO.read(new File("/home/x101/Desktop/buttonDef.png"));
imageClick=ImageIO.read(new File("/home/x101/Desktop/buttonClick.png"));
imageHover=ImageIO.read(new File("/home/x101/Desktop/buttonHover.png"));
current=imageDef;
} catch (IOException e)
{
e.printStackTrace();
}
this.addMouseListener(this);
}
protected void paintComponent(Graphics g)
{
super.paintComponents(g);
g.drawImage(current, 0, 0, current.getWidth(), current.getHeight(), null);
}
```
EDIT: added code section
| Java swing JComponent "size" | CC BY-SA 3.0 | null | 2010-11-13T00:13:53.117 | 2011-11-15T03:03:15.180 | 2011-11-15T03:03:15.180 | 418,556 | 490,571 | [
"java",
"user-interface",
"swing",
"jcomponent",
"mouselistener"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.