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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6,402,493 | 1 | 6,648,632 | null | 0 | 1,045 |
I got an issue with Visual Studio, Silverlight 5 Beta SDK and XNA.
I did a fresh install of all Visual Studio components I need to create the application I have in mind:
1. Visual C# 2010 Express
2. XNA Game Studio 4.0
3. Visual Web Developer 2010 Express
4. Visual Studio 2010 Express for Windows Phone
5. Visual Studio 2010 SP1
6. Silverlight 5 Beta Tools
However, when I start VS 2010 Express for Windows Phone and go to create a new project these are the templates I have:
[Missing Templates](https://i.stack.imgur.com/SJLkY.png)

But there are a few templates missing.
How can I make appear the following templates:
[Full list of templates](https://i.stack.imgur.com/bKucp.png)

So what am I missing in this? I believe I installed everything and still nothing appears.
Is it because I'm using the express edition of visual studio? it doesn't make much sense though.
|
WP7 XNA+Silverlight Templates missing
|
CC BY-SA 3.0
| null |
2011-06-19T13:00:50.677
|
2012-02-28T07:09:31.687
|
2011-11-15T18:23:11.983
| 92,837 | 805,343 |
[
"c#",
"silverlight",
"visual-studio-2010",
"templates",
"xna"
] |
6,402,600 | 1 | 6,632,384 | null | 5 | 234,399 |
```
<body style="background-color: paleturquoise">
<h2 style="color: red">Duke's soccer League: Home Page<br/></h2>
<ul style="list-style-type: circle">
<li style="font-size: larger"><a href="league_list.in">All Leagues list</a></li>
<li style="font-size: larger">Register for a League (TBA)<br/><br/></li>
</ul>
<h2 style="color: red">League Administrator</h2>
<ul style="list-style-type: square">
<li style="font-size: larger"><a href="add_league.in">Add a new League (TBA)</a></li>
<img src="C:\Users\VIRK\Desktop\66.jpg" width="400" height="400" ></img>
</ul>
</body>
```
I am currently practice with JSP and I try this html code to make a web page on NetBeans IDE 7.0 but when I'm build and run the page no error in code but the image is not showing in the browser.

Here I have given the screenshot of the NetBeans IDE where you can see the image is existing in Web-INF folder and the index.jsp page too and I tried with `"/"` before the image name but it won't work. The exact path of my project is C:\Users\VIRK\Documents\NetBeansProjects\practiceJSP .
```
<img src="/66.jpg" width="400" height="400" ></img>
```
|
Image is not showing in browser?
|
CC BY-SA 3.0
| 0 |
2011-06-19T13:26:22.373
|
2021-11-30T09:43:56.453
|
2016-07-26T06:16:39.260
| 6,280,781 | 709,458 |
[
"html",
"image",
"jsp"
] |
6,402,857 | 1 | 6,403,039 | null | 2 | 1,652 |
In HTML, with CSS, one can do "float" for images, just like this

the image is surrounded by text.
How can I do it ?
I can't use UIWebview, because
1. UIWebView has a slight lag after you loadHTML. Its content doesn't show immediately, not like UILabel or UIImage
2. The image is async loaded, so I need a white space holder there with UIActivityView spinning
Is that possible I just use a UIImageView & UILabel to do ?
Thanks
|
iphone - How to implement the effect of "float" for image, just like in CSS style
|
CC BY-SA 3.0
| 0 |
2011-06-19T14:11:24.217
|
2011-06-19T14:40:40.250
| null | null | 759,076 |
[
"iphone",
"css-float"
] |
6,403,177 | 1 | 6,403,209 | null | 2 | 520 |
I need some help to structure some tables that will help me out having a good personalized way to have different access name per client with personalized allowed commands in each acess level.
So consider client A has create site Y, which he wants to create the follow access groups:
- - - -
The same way client A create his personalized access I want all my other clients to be able to create their own personalized access where they can name it anything they see fit in their own language and later just put in what commands they will have access to by being on that given access level.
I have the follow tables as example (sorry that this isnt a datagram, work bench keep crashing on me when I make example and I am open to suggestion for alternatives to create datagrams as good as or better than workbench):
- client TABLE:```
id int,
username varchar,
password varchar,
status varchar
```
- site TABLE:```
id int,
owner_client_id,
name varchar
```
- access TABLE:```
id int,
name varchar,
commands int (bitmask?)
```
- site_access TABLE```
id int,
client_id,
site_id,
access_id
```
- commands```
id int,
action varchar,
alias varchar,
description varchar
```
On my application all the commands actions are alredy pre-defined and the user cannot change them in what they do or the default name, but they are allowed to create alias.
So let's say I have the command kick, they could make an alias to name it "k" or "explosion" or they could name the alias anything they want.
# Some of my doubts:
1. Initially I tought of using site_access to link everything together, client that has access to site and what access it has and from their access what commands each have, is that a good way to go with it ?
2. I have many commands that will be pulled from the database but since some have their own alias I dont thin I could use a bitmask for the acess and still being able to query the alias if not null could I so I would have to use a list of commands or are there good options ?
3. What engine should I use, InnoDB or MyISAM in my case ?
4. Is it ok to mix engines or not a good idea at all ?
5. What should I change on my current table structure and could you provide any samples too (if possible) ?

```
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL';
CREATE SCHEMA IF NOT EXISTS `mydb` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci ;
USE `mydb` ;
-- -----------------------------------------------------
-- Table `mydb`.`clients`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `mydb`.`clients` ;
CREATE TABLE IF NOT EXISTS `mydb`.`clients` (
`id` INT NOT NULL,
`username` VARCHAR(45) NOT NULL ,
`password` VARCHAR(45) NOT NULL ,
PRIMARY KEY (`id`) ,
UNIQUE INDEX `username_UNIQUE` (`username` ASC) )
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `mydb`.`sites`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `mydb`.`sites` ;
CREATE TABLE IF NOT EXISTS `mydb`.`sites` (
`id` INT NOT NULL AUTO_INCREMENT ,
`name` VARCHAR(45) NOT NULL ,
PRIMARY KEY (`id`) )
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `mydb`.`groups`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `mydb`.`groups` ;
CREATE TABLE IF NOT EXISTS `mydb`.`groups` (
`id` INT NOT NULL ,
`name` VARCHAR(45) NOT NULL ,
`alias` VARCHAR(45) NOT NULL ,
`commands` VARCHAR(45) NOT NULL ,
PRIMARY KEY (`id`) )
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `mydb`.`membership`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `mydb`.`membership` ;
CREATE TABLE IF NOT EXISTS `mydb`.`membership` (
`client_id` INT NOT NULL ,
`group_id` INT NOT NULL ,
PRIMARY KEY (`client_id`, `group_id`) ,
INDEX `client_id` (`client_id` ASC) ,
INDEX `group_id` (`group_id` ASC) ,
CONSTRAINT `client_id`
FOREIGN KEY (`client_id` )
REFERENCES `mydb`.`clients` (`id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `group_id`
FOREIGN KEY (`group_id` )
REFERENCES `mydb`.`groups` (`id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `mydb`.`access`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `mydb`.`access` ;
CREATE TABLE IF NOT EXISTS `mydb`.`access` (
`site_id` INT NOT NULL ,
`group_id` INT NOT NULL ,
PRIMARY KEY (`site_id`, `group_id`) ,
INDEX `site_id` (`site_id` ASC) ,
INDEX `group_id` (`group_id` ASC) ,
CONSTRAINT `site_id`
FOREIGN KEY (`site_id` )
REFERENCES `mydb`.`sites` (`id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `group_id`
FOREIGN KEY (`group_id` )
REFERENCES `mydb`.`groups` (`id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
```
|
MySQL structure for personalized users access per site?
|
CC BY-SA 3.0
| null |
2011-06-19T15:04:57.077
|
2013-07-08T10:03:32.430
|
2011-06-19T22:43:16.767
| 342,740 | 342,740 |
[
"mysql",
"database-design",
"database-schema",
"database-engine"
] |
6,403,333 | 1 | 6,403,969 | null | 3 | 282 |
I'm trying to draw the following image:

Using this objective-c code:
```
CGContextSetFillColorWithColor(ctx, [[UIColor redColor] CGColor]);
CGContextMoveToPoint(ctx, position.X - (size.width / 2), position.Y - (size.height / 2));
CGContextAddLineToPoint(ctx, position.X - (size.width / 2), position.Y + (size.height / 2));
CGContextAddLineToPoint(ctx, position.X - (size.width / 4), position.Y + (size.height / 2));
CGContextAddArc(ctx, position.X, position.Y + (size.height / 2), (size.width / 4), -M_PI, M_PI, 0);
CGContextAddLineToPoint(ctx, position.X + (size.width / 2), position.Y + (size.height / 2));
CGContextAddLineToPoint(ctx, position.X + (size.width / 2), position.Y - (size.height / 2));
CGContextFillPath(ctx);
```
But it doesn't work. I get this image:

The width of the image is size.width and the height is size.height.
The origin is `(position.X, position.Y)`. This point is in center, at (size.width /2, size.height / 2).
The first point is the upper left corner, and the second one is the bottom left corner. And then continues to the right.
Here is a better explanation:

Sorry for my English.
Any advice?
|
Drawing a bridge with Quartz 2D
|
CC BY-SA 3.0
| 0 |
2011-06-19T15:33:06.590
|
2011-06-19T17:28:21.273
|
2011-06-19T16:27:34.013
| 68,571 | 68,571 |
[
"iphone",
"quartz-graphics",
"quartz-2d",
"objective-c-2.0"
] |
6,403,371 | 1 | 6,403,388 | null | 0 | 484 |
How can I add some padding between the button and its text?

```
<Button
android:text="@string/routes_btn_title"
android:drawableTop="@drawable/temp_button_icon"
android:layout_gravity="top|center_horizontal"/>
```
|
Add padding above Button Text
|
CC BY-SA 3.0
| null |
2011-06-19T15:38:19.680
|
2011-06-19T15:40:50.433
| null | null | 723,980 |
[
"android",
"text",
"button"
] |
6,403,412 | 1 | 6,404,247 | null | 3 | 438 |
How it is possible in open&save dialogs to force zip archives to be displayed as files, not as folders?
By displayed as folders I mean like this:

|
TOpenDialog - zip as files
|
CC BY-SA 3.0
| 0 |
2011-06-19T15:44:01.700
|
2011-06-19T21:23:13.843
|
2011-06-19T21:22:57.823
| 505,088 | 537,311 |
[
"delphi",
"windows-7",
"delphi-xe"
] |
6,403,610 | 1 | 6,403,646 | null | 1 | 344 |
I'm trying to figure out how Alien Blue, a Reddit App for iPad and iPhone, puts a link to their app after the comment link on Facebook posts. Here is a picture of what I'm referring to:

It's the link with text of "Get Alien Blue" that links directly to their website.
|
How does Alien Blue put a link to their app on Facebook.com posts?
|
CC BY-SA 3.0
| null |
2011-06-19T16:26:01.327
|
2011-06-19T16:33:06.683
| null | null | 274,817 |
[
"facebook"
] |
6,403,719 | 1 | 6,403,774 | null | 6 | 246 |
I was wondering if is it possible to make same thing by myself, or Search Engines does that by themselves?
I want to add some links like here: 
|
how to make my site look like in following image on search engines result
|
CC BY-SA 3.0
| 0 |
2011-06-19T16:46:11.383
|
2011-06-20T06:37:04.897
| null | null | 572,737 |
[
"web",
"seo",
"search-engine",
"meta-tags"
] |
6,403,731 | 1 | 6,403,777 | null | 0 | 586 |
I have a UIPicker view containing 4 columns with the same array of 6 images in each column (colors). I have a button which, when pressed, will display the 4 images on the UIPickerView in separate views. Problem is, I can't seem to find a way to get the UIView from a UIPickerView.
Here is a picture of what the finished app will look like:

As you can see, the user will set the 4 columns to some colors and when they press the Guess button, it should display the 4 guesses in the space below (either in ImageViews or in a canvas).
Thanks in advance for any help you can offer :)
|
Getting UIView from UIPickerView with images
|
CC BY-SA 3.0
| null |
2011-06-19T16:47:47.030
|
2011-06-19T16:56:25.190
|
2011-06-19T16:50:52.833
| 250,728 | 778,329 |
[
"iphone",
"objective-c",
"xcode",
"ipad",
"uipickerview"
] |
6,403,918 | 1 | null | null | 2 | 666 |
What is the WPF version of [Control.ScaleControl](http://msdn.microsoft.com/en-us/library/system.windows.forms.control.scalecontrol.aspx)?
---
i am trying to honor the user's font preference by setting the font to the [IconTitleFont](http://msdn.microsoft.com/en-us/library/system.drawing.systemfonts.icontitlefont.aspx):
```
private void ApplyUserFontPreferences()
{
this.FontFamily = SystemFonts.IconFontFamily;
this.FontSize = SystemFonts.IconFontSize;
this.FontStyle = SystemFonts.IconFontStyle;
this.FontWeight = SystemFonts.IconFontWeight;
}
```
Unlike WinForms, the contents of the form are not scaled with the font change:


In reality all controls on the form (including the size of buttons, the width of listview columns, etc) should scale to match the new layout:

Since WPF doesn't ([unlike WinForms](http://msdn.microsoft.com/en-us/library/system.windows.forms.autoscalemode.aspx)) respond to font sizes changes, i was going to workaround the issue by trying to scale the WPF form myself, using a hypothetical WPF version of [ScaleControl](http://msdn.microsoft.com/en-us/library/system.windows.forms.control.scalecontrol.aspx):
```
private void ApplyUserFontPreferences()
{
Double scaleFactor = (SystemFonts.IconFontSize / this.FontSize); //i.e. new / old
this.ScaleControl(scaleFactor); //doesn't exist
this.FontFamily = SystemFonts.IconFontFamily;
// this.FontSize = SystemFonts.IconFontSize;
this.FontStyle = SystemFonts.IconFontStyle;
this.FontWeight = SystemFonts.IconFontWeight;
}
```
---
Another example of wanting to scale a control (and all child controls) is when i need to scale a control (and all child controls) to fit in a given size. In this case i don't want to scale an entire form, i only want to scale a particular control.
|
WPF version of .ScaleControl?
|
CC BY-SA 3.0
| null |
2011-06-19T17:21:44.343
|
2011-06-20T18:32:20.033
|
2011-06-20T17:19:40.837
| 1,152,862 | 12,597 |
[
"c#",
"wpf",
"winforms",
"scaling",
"user-preferences"
] |
6,403,987 | 1 | null | null | 5 | 3,728 |
strange behavior:
(xcode 4 breakpoint screenshot)

why does this comparison yield true? I really dont get it..
|
float comparison problem objective c
|
CC BY-SA 3.0
| 0 |
2011-06-19T17:31:20.977
|
2012-05-16T13:32:57.157
|
2012-05-16T13:32:57.157
| 44,390 | 716,822 |
[
"objective-c",
"xcode",
"comparison",
"floating-point"
] |
6,404,459 | 1 | 6,406,182 | null | 3 | 537 |
I'm creating a simple interface with NavigationController and BandListViewController(UITableViewController) inside Interface Builder and setting the delegation to AppDelegate properties.
```
@interface CRUDAppDelegate : NSObject <UIApplicationDelegate> {
UINavigationController *bandNav;
BandListViewController *bandList;
}
```
and

However, I can't figure out how can I initialize my BandListViewController passing the paramater managedObjectContext without setting it on awakeFromNib. The CRUDAppDelegate already init this controller and set his own nib into the navigationController, but then when I try to make a new BandListViewController in didFinishLaunchingWithOptions with initInManagedObjectContext, the display (TableViewController) remains of the old bandList. (with managedObjectContext = null)
What I've done so far is keeping the bandList managedObjectContext at awakeFromNib as Apple suggests.
```
- (void)awakeFromNib
{
/*
Typically you should set up the Core Data stack here, usually by passing the managed object context to the first view controller.
self.<#View controller#>.managedObjectContext = self.managedObjectContext;
*/
self.bandList.managedObjectContext = self.managedObjectContext;
}
```
What I wanted
```
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.bandList = [[BandListViewController alloc] initInManagedObjectContext:self.managedObjectContext];
// Override point for customization after application launch.
[self.window addSubview:bandNav.view];
[self.window makeKeyAndVisible];
return YES;
}
```
|
How to custom init a UIViewController of Interface Builder with managed context
|
CC BY-SA 3.0
| null |
2011-06-19T18:54:58.393
|
2016-03-31T22:56:49.003
|
2016-03-31T22:56:49.003
| 420,661 | 420,661 |
[
"iphone",
"ios",
"core-data",
"interface-builder",
"nsmanagedobjectcontext"
] |
6,404,560 | 1 | null | null | 0 | 1,840 |
Hmmm……
A question about UILocalNotification and the notificaton's alertLaunchImage.
My app uses UILocalNotifiaction(s) to get users' attention. As usual, an alert is presented with "Action" and "Close" buttons. When the user taps Action, the image specified by alertLaunchImage is presented. The alertLaunchImage is a screenshot of of one of the views of the app which is shown after the data is initialized when launched normally.
Here are the 3 cases when the notification is delivered:
1. App is running in foreground - no alert, no launchImage is shown as designed. No problems.
2. If my app is running in background when the notification is delivered, the launchImage works like a charm. No problems. The launchImage with no app-related data is shown and then the app fills up the data. This part works seamlessly.
3. However, if the app is not running when the notification is delivered, the sequence is confusing - or I missed something. The app gets launched and shows the alertLaunchImage instead of the Default image. Then is goes thru several other screens (as part of initialization and data processing) before the actual screen (live version of alertLaunchImage) is shown.
This can get very confusing to the user. My question comes in here. How can this be avoided?
R/-
Sam.!


|
UILocalNotification and alertLaunchImage
|
CC BY-SA 3.0
| null |
2011-06-19T19:14:44.163
|
2012-06-27T08:22:37.600
| null | null | 626,265 |
[
"uilocalnotification"
] |
6,404,739 | 1 | 6,404,898 | null | 4 | 1,865 |
I'm trying to show several rows from database in a TreeView but all I am getting are some dummy rows as you can see in the image below.

```
class SettingsDialog(gtk.Dialog):
def __init__(self):
gtk.Dialog.__init__(self, "Server Settings", self, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT)
# Instantiate ServerManager
self.server_manager = ServerManager()
# Create TreeStore for Server list
self.liststore = gtk.ListStore(str, str)
self.treeview = gtk.TreeView(self.liststore)
# Create TreeViewColumns to display data
cell = gtk.CellRendererText()
col = gtk.TreeViewColumn("Name")
col.pack_start(cell, True)
self.treeview.append_column(col)
cell = gtk.CellRendererText()
col = gtk.TreeViewColumn("URL")
col.pack_start(cell, True)
self.treeview.append_column(col)
self.vbox.pack_start(self.treeview)
self.resize(500,350)
self.set_position(gtk.WIN_POS_CENTER)
self.show_all()
self.load_server_list()
def load_server_list(self):
self.liststore.clear()
servers = self.server_manager.list()
for name, url in servers.iteritems():
self.liststore.append([name, url])
self.show_all()
```
Data returned from `self.server_manager.list()` is valid an added to the list store perfectly. There seems to be something wrong with the `CellRenderers` but I wasn't able to find the error.
|
PyGTK TreeView showing blank rows from ListStore
|
CC BY-SA 3.0
| 0 |
2011-06-19T19:46:08.433
|
2013-01-23T05:00:38.853
|
2013-01-23T05:00:38.853
| 278,878 | 220,988 |
[
"python",
"gtk",
"gtktreeview"
] |
6,404,797 | 1 | 6,405,057 | null | 2 | 726 |
This is testTray.py
```
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import imgAgent_rc
class Window(QDialog):
def __init__(self):
super(Window, self).__init__()
self.trayIcon = QSystemTrayIcon(self)
icon = QIcon(':/images/logo/image_16x16.png') # Problem
#icon = QIcon('images/logo/image_16x16.png') # OK
self.trayIcon.setIcon(icon)
self.trayIcon.setVisible(True)
self.trayIcon.show()
if __name__ == '__main__':
app = QApplication(sys.argv)
window = Window()
window.show()
sys.exit(app.exec_())
```
This is the directory structure:
```
imgAgent.qrc
imgAgent_rc.py
testTray.py
+images
|---+logo
|---image_16x16.png
```
imgAgent.prc
```
<RCC>
<qresource prefix="logo">
<file>images/logo/image_16x16.png</file>
...
</qresource>
</RCC>
```
I generated the .py resource file using:
`pyrcc4.exe -py3 -o imgAgent_rc.py imgAgent.qrc`
The System tray icon AND the window icon do not appear when referenced from the resource, but appear normally when referenced by the relative path.
 
|
Window and system tray icon does not appear when referenced from resources
|
CC BY-SA 3.0
| null |
2011-06-19T19:58:09.953
|
2013-06-28T22:20:55.453
|
2013-06-28T22:20:55.453
| 1,908,677 | 450,827 |
[
"python",
"resources",
"python-3.x",
"pyqt"
] |
6,404,786 | 1 | 6,409,528 | null | 10 | 5,991 |
> Ended up with doing this:
[Easiest way to support multiple orientations? How do I load a custom NIB when the application is in Landscape?](https://stackoverflow.com/questions/2496554/easiest-way-to-support-multiple-orientations-how-do-i-load-a-custom-nib-when-the/2496719#2496719) Works superb!
I have made an image in Photoshop which I want to use as background for my info-screen in my iPad application. The image contains text and some icons also. Around the image I have a border which is green.
The effect I am trying to achieve is:
When the user goes from the portrait orientation to landscape orientation I want the image (just the frame and the icons) to rotate 90 degrees so the image appear in landscape mode, instead of having a portrait view of the frame in landscape. The text and icons are decoupled (different layers which I have organized in different UIImageView's)they shall rotate 90 degrees.
What I have done already is the following:
Experimented a bit with this method:
```
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:
```
and tried to do this:
```
self.btnFacebook.transform = CGAffineTransformMakeRotation(1.5707964);
```
which I think will rotate the btnFacebook property 90 degrees to the right (correct me if I am wrong) since it specifies positive radians. I can't seem to get it to work correctly though. Should'nt this rotate the button 90 degrees around its center coordinate in the frame? That wouldn't cause a change in the position of the button (the button is square)?
## EDIT
Made an image:

As the image shows the image background (some custom graphics on it which looks good in both orientations) goes from portrait to landscape and rotates so it does not appear as portrait in landscape, the icons are decoupled from the background so they need to rotate as well because they need to be in the right orientation (it is social icons). The text however are on the same position, it only rotates 90 degrees without repositioning.
|
Rotating an image 90 degrees on same position when orientation changes
|
CC BY-SA 3.0
| 0 |
2011-06-19T19:56:40.460
|
2013-08-12T20:09:37.630
|
2017-05-23T10:29:16.750
| -1 | 454,049 |
[
"iphone",
"uiimageview",
"cgaffinetransform"
] |
6,404,792 | 1 | null | null | 3 | 2,003 |
This code makes call successfully from my app
```
Intent dialer = new Intent("android.intent.action.CALL_PRIVILEGED");
mail.setData(Uri.parse("tel:65465446"));
startActivity(dialer);
```
---
But when trying to use an activity chooser like this:
```
Intent dialer = new Intent("android.intent.action.CALL_PRIVILEGED");
dialer.setData(Uri.parse("tel:65465446"));
Intent chooser = null;
chooser = Intent.createChooser(dialer,"Select Dialing Software...");
startActivity(chooser);
```

it throws following Logcat error if I select option, whereas works just fine
```
E/AndroidRuntime( 384): FATAL EXCEPTION: main
E/AndroidRuntime( 384): java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.CALL_PRIVILEGED dat=tel:65465446 flg=0x3000000 cmp=com.android.phone/.PrivilegedOutgoingCallBroadcaster } from ProcessRecord{44f4de30 384:com.dialer/10036} (pid=384, uid=10036) requires android.permission.CALL_PRIVILEGED
E/AndroidRuntime( 384): at android.os.Parcel.readException(Parcel.java:1247)
E/AndroidRuntime( 384): at android.os.Parcel.readException(Parcel.java:1235)
E/AndroidRuntime( 384): at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:1298)
E/AndroidRuntime( 384): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1373)
E/AndroidRuntime( 384): at android.app.Activity.startActivityForResult(Activity.java:2817)
E/AndroidRuntime( 384): at android.app.Activity.startActivity(Activity.java:2923)
E/AndroidRuntime( 384): at com.android.internal.app.ResolverActivity.onClick(ResolverActivity.java:190)
E/AndroidRuntime( 384): at com.android.internal.app.AlertController$AlertParams$3.onItemClick(AlertController.java:874)
E/AndroidRuntime( 384): at android.widget.AdapterView.performItemClick(AdapterView.java:284)
E/AndroidRuntime( 384): at android.widget.ListView.performItemClick(ListView.java:3382)
E/AndroidRuntime( 384): at android.widget.AbsListView$PerformClick.run(AbsListView.java:1696)
E/AndroidRuntime( 384): at android.os.Handler.handleCallback(Handler.java:587)
E/AndroidRuntime( 384): at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime( 384): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 384): at android.app.ActivityThread.main(ActivityThread.java:4627)
E/AndroidRuntime( 384): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 384): at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 384): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
E/AndroidRuntime( 384): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
E/AndroidRuntime( 384): at dalvik.system.NativeStart.main(Native Method)
```
manifest has `<uses-permission android:name="android.permission.CALL_PRIVILEGED"/>` added
Thanks for your any help.
|
Activity chooser menu problem : Dialing a number
|
CC BY-SA 3.0
| null |
2011-06-19T19:57:26.990
|
2011-06-19T20:11:58.560
| null | null | 474,986 |
[
"android",
"android-activity",
"android-intent"
] |
6,404,975 | 1 | null | null | 1 | 4,203 |
In the screenshot below, the checkbox is not centered below the edittext above. How can I center the checkbox so that it is centered right below the edittext?

The layout I am using to generate the above UI is:
```
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:id="@+id/textView1"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:padding="5dip"
android:gravity="center"
android:text="text 1"/>
<EditText
android:id="@+id/editText1"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_toRightOf="@+id/textView1"
android:layout_alignTop="@+id/textView1"
android:layout_alignBottom="@+id/textView1"
android:padding="5dip"
android:gravity="center"
android:inputType="number"
android:text="1"/>
<CheckBox
android:id="@+id/checkBox"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_below="@+id/editText1"
android:layout_toRightOf="@+id/textView1"
android:text="check"/>
</RelativeLayout>
```
Things, I have already tried on the CheckBox widget with no success:
1. android_layoutAlignRight with the EditText widget.
2. `android:layout_gravity="center_horizontal" on the relative layout
I know I can achieve the 'centering' by nesting the CheckBox in another relative layout and using `android:layout_gravity="center"` on the inner relative layout but I would prefer a solution that avoids nested layouts.
Any suggestions? Thanks.
|
How to center a CheckBox below a EditText without using nested layouts?
|
CC BY-SA 3.0
| null |
2011-06-19T20:36:33.420
|
2014-05-30T00:13:01.130
| null | null | 767,953 |
[
"android",
"layout",
"centering"
] |
6,405,068 | 1 | 6,405,271 | null | 3 | 3,786 |
I have a question regarding editing a UITableView. I want to know how to hide a subview when the deletion control is tapped and the the delete button appears. I've figured out how to hide the subview when the delete button is tapped, but that is too late. I used the following code to accomplish that:
```
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
exerciseDate = (UILabel *)[cell viewWithTag:8989];
exerciseDate.hidden = YES;
```
As you can see in the screenshots below, the text 'Today' and 'Yesterday' is the subview of each cell. I want to hide this subview when the deletion control (the red round button to the left) is tapped and the delete button appears (screen shot 2). Do I need to set up a listener for the deletion control? If so, how would I do that?
Thank you in advance!


|
iOS editing tableview hide subview in cell
|
CC BY-SA 3.0
| null |
2011-06-19T20:55:05.390
|
2016-07-19T12:51:10.767
| null | null | 661,904 |
[
"iphone",
"ios",
"uitableview"
] |
6,405,189 | 1 | 6,405,247 | null | 4 | 1,416 |
This is an assignment I'm working on. It must use semaphores, not mutex.
```
#include <stdio.h>
#include <pthread.h>
#include <assert.h>
#include <unistd.h>
#include <semaphore.h>
#include <fcntl.h>
sem_t *ab, *ac, *ad, *de, *ce, *bf, *ef;
void *a(void *arg) {
printf("Entering A...\n");
sleep(1);
printf("Exiting A...\n");
assert(sem_post(ab)==0);
assert(sem_post(ac)==0);
assert(sem_post(ad)==0);
pthread_exit((void *)99);
}
void *b(void *arg) {
assert(sem_wait(ab)==0);
printf("Entering B...\n");
sleep(1);
printf("Exiting B...\n");
assert(sem_post(bf)==0);
pthread_exit((void *)99);
}
void *c(void *arg) {
assert(sem_wait(ac)==0);
printf("Entering C...\n");
sleep(1);
printf("Exiting C...\n");
assert(sem_post(ce)==0);
pthread_exit((void *)99);
}
void *d(void *arg) {
assert(sem_wait(ad)==0);
printf("Entering D...\n");
sleep(1);
printf("Exiting D...\n");
assert(sem_post(de)==0);
pthread_exit((void *)99);
}
void *e(void *arg) {
assert(sem_wait(ce)==0);
assert(sem_wait(de)==0);
printf("Entering E...\n");
sleep(1);
printf("Exiting E...\n");
assert(sem_post(ef)==0);
pthread_exit((void *)99);
}
void *f(void *arg) {
assert(sem_wait(bf)==0);
assert(sem_wait(ef)==0);
printf("Entering F...\n");
sleep(1);
printf("Exiting F...\n");
pthread_exit((void *)99);
}
int main() {
pthread_t _a, _b, _c, _d, _e, _f;
int r1, r2, r3, r4, r5, r6;
ab=sem_open("foobar", O_CREAT, 0700, 0);
ac=sem_open("foobar", O_CREAT, 0700, 0);
ad=sem_open("foobar", O_CREAT, 0700, 0);
ce=sem_open("foobar", O_CREAT, 0700, 0);
de=sem_open("foobar", O_CREAT, 0700, 0);
ef=sem_open("foobar", O_CREAT, 0700, 0);
bf=sem_open("foobar", O_CREAT, 0700, 0);
/*sem_init(ab,0,1);
sem_init(ac,0,1);
sem_init(ad,0,1);
sem_init(ce,0,1);
sem_init(de,0,1);
sem_init(ef,0,1);
sem_init(bf,0,1);*/
assert(pthread_create(&_a, NULL, a, &r1) == 0);
assert(pthread_create(&_b, NULL, b, &r2) == 0);
assert(pthread_create(&_c, NULL, c, &r3) == 0);
assert(pthread_create(&_d, NULL, d, &r4) == 0);
assert(pthread_create(&_e, NULL, e, &r5) == 0);
assert(pthread_create(&_f, NULL, f, &r6) == 0);
assert(pthread_join(_a, NULL) == 0);
assert(pthread_join(_b, NULL) == 0);
assert(pthread_join(_c, NULL) == 0);
assert(pthread_join(_d, NULL) == 0);
assert(pthread_join(_e, NULL) == 0);
assert(pthread_join(_f, NULL) == 0);
assert( sem_close(ab)==0 );
assert( sem_close(ac)==0 );
assert( sem_close(ad)==0 );
assert( sem_close(ce)==0 );
assert( sem_close(de)==0 );
assert( sem_close(bf)==0 );
assert( sem_close(ef)==0 );
return 0;
}
```
It's pretty simple but for some reason it's not executing in the right order. The output is far from consistent but always incorrect. Here is one sample output:
Entering A...
Entering B... <----sem_post(ab) has not even been called yet
Exiting A...
Entering C...
Entering D...
Exiting B...
Exiting D...
Exiting C...
Entering E...
Entering F...
Exiting F...
Exiting E...
It should be following this diagram:

Any help with this will be greatly appreciated, but it's an assignment so don't start telling me to do it a completely different way and don't give the answer straight up, just point me in the right direction.
|
pthreads + semaphores, why is this not executing properly?
|
CC BY-SA 3.0
| 0 |
2011-06-19T21:23:19.320
|
2012-12-17T14:36:09.027
|
2012-12-17T14:36:09.027
| 1,288 | 785,302 |
[
"c",
"concurrency",
"pthreads",
"semaphore"
] |
6,405,249 | 1 | 6,410,814 | null | 4 | 6,069 |
Seems Safari is having some problems rendering my SVG, while other browsers does it correctly. Any idea on what is wrong?
Here is the URL:
[http://bcndevcon.org/dev/infographic/](http://bcndevcon.org/dev/infographic/)
I've seen a lot of examples using iFrame, I don't know if it has something to do with the problem.

Newbie error :)
|
SVG not drawing on safari
|
CC BY-SA 3.0
| 0 |
2011-06-19T21:36:58.217
|
2011-06-23T14:15:40.190
|
2011-06-23T14:15:40.190
| 210,631 | 210,631 |
[
"javascript",
"html",
"safari",
"svg"
] |
6,405,617 | 1 | 6,405,957 | null | 2 | 3,447 |
I would like to know if we can customise a button to show like the Apple iOS button in Android?
The button that I would like to draw is

If this is possible, can someone give me the pointers to it.
Thanks.
|
Can we create a back button like iOS in Android using the custom shape API
|
CC BY-SA 3.0
| null |
2011-06-19T23:09:04.357
|
2013-06-18T06:33:16.813
| null | null | 402,637 |
[
"android",
"android-widget"
] |
6,405,907 | 1 | null | null | 1 | 2,283 |
Video can be restricted, if it's video is set to be not available for users region, if it is private or if video owner has set limitations on where it can be displayed. I don't want to display them.
Query what I have at the moment:
```
Feed<Video> videoFeed = request.GetStandardFeed(
"http://gdata.youtube.com/feeds/api/videos?v=2" +
"&format=5&iv_load_policy=3&q=" + this.textBox1.Text);
```
Initially I build a list of type item, that acts as a datasource. Precondition here could also fix my problem.
```
foreach (Video entry in feed.Entries)
dsList.Add(new item { ID = entry.VideoId, TITLE = entry.Title });
```
How do I use the Youtube API to check if a video viewing is restricted?
## edit:
I assumed, I can use:
```
foreach (Video entry in feed.Entries)
if (entry.Status == null)
dsList.Add(new item { ID = entry.VideoId, TITLE = entry.Title });
```
But there are at least 2 problems with that:
1. Youtube api can maximally return 50 items over 10 pages per query. Maximum of 500 items - that is more, then gets used in average case. But if restricted content has higher ordering precedence (example: major label music videos), then 99% or more results can get thrown away.
2. Filter works for most cases, but it does not seem to work for (EMI : Coldplay - Every Teardrop Is A Waterfall (Official)), that is listed under top rated videos feed. I don't want to display:

|
How do I use the Youtube API to check if a video viewing is restricted?
|
CC BY-SA 3.0
| null |
2011-06-20T00:23:59.193
|
2017-05-08T14:50:23.460
|
2020-06-20T09:12:55.060
| -1 | 97,754 |
[
"c#",
"youtube",
"youtube-api"
] |
6,406,174 | 1 | 6,406,197 | null | 2 | 143 |
I was following the tutorial at [developer.apple.com](http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjCTutorial/06Controller/06Controller.html) for learning Cocoa, and I found something in my project that was not in the tutorial. It was the Application Delegate that was made when I started the project. In their tutorial it shows this in interface builder:

The file I have on my Mac, opened in Interface Builder, looks like this:

Also, I cannot add the Controller class to my xib file. It gives me the error:
> Parsed 1 source file, but no classes were found or changed.
Is the tutorial old or am I doing something wrong? And what is the App Delegate class?
|
Discrepancy between tutorial on developer.apple.com and Xcode project template
|
CC BY-SA 3.0
| null |
2011-06-20T01:42:22.090
|
2012-04-14T12:46:17.000
|
2012-04-14T12:46:17.000
| 1,270,812 | 239,312 |
[
"objective-c",
"xcode",
"interface-builder",
"xcode-template"
] |
6,406,368 | 1 | 6,406,750 | null | 144 | 181,849 |
I'm using Matplotlib to plot a histogram.
Using tips from my previous question: [Matplotlib - label each bin](https://stackoverflow.com/questions/6352740/matplotlib-label-each-bin),
I've more or less go the kinks worked out.
There's one final issue - previously - the x-axis label ("Time (in milliseconds)") was being rendered underneath the x-axis tickmarks (0.00, 0.04, 0.08, 0.12 etc.)

Using the advice from Joe Kingston (see question above), I tried using:
```
ax.tick_params(axis='x', pad=30)
```
However, this moves both the x-axis tickmarks (0.00, 0.04, 0.08, 0.12 etc.), as well as the x-axis label ("Time (in milliseconds)"):

Is there any way to move only the x-axis label to underneath the three rows of figures?
|
Matplotlib - Move X-Axis label downwards, but not X-Axis Ticks
|
CC BY-SA 3.0
| 0 |
2011-06-20T02:36:48.797
|
2017-10-06T08:20:13.583
|
2017-10-06T08:20:13.583
| 4,720,935 | 139,137 |
[
"python",
"matplotlib",
"graphing"
] |
6,406,489 | 1 | 6,406,499 | null | 0 | 206 |
I don't know why the comparation of CellType to "Hamster" is false. Wonder why it happened!

They are exactly the same, even in case sensitive.
Please help me.
|
Strange String comparation
|
CC BY-SA 3.0
| null |
2011-06-20T03:09:58.200
|
2011-06-20T03:21:26.347
| null | null | 653,457 |
[
"java",
"android",
"string",
"comparator"
] |
6,406,590 | 1 | 22,797,841 | null | 61 | 43,828 |
I'm setting up a new server on Windows 2008 (x64) with IIS 7.5. I have installed Web Deploy 2.1 from the Web Platform Installer.
But the server is missing the Web Management Service, and as a result any web deploy fails with this message:
```
Error 1 Web deployment task failed.(Could not complete the request to remote agent URL 'https://url:8172/MsDeploy.axd?site=Default Web Site'.)
This error indicates that you cannot connect to the server. Make sure the service URL is correct, firewall and network settings on this computer and on the server computer are configured properly, and the appropriate services have been started on the server.
Error details:
Unable to connect to the remote server
No connection could be made because the target machine actively refused it
```
I checked the services and found the necessary service is missing:

The Web Deployment agent service is installed (this is the IIS6 service), but not the Web Management service (the IIS7 deploy service).
How can I fix this? Does the Web Platform Installer not work for Web Deploy?
|
Web deploy in Visual Studio 2010 - web management service is missing
|
CC BY-SA 3.0
| 0 |
2011-06-20T03:33:54.293
|
2016-03-04T01:06:00.320
| null | null | 325,727 |
[
"c#",
"visual-studio-2010",
"web-deployment-project",
"web-platform-installer"
] |
6,406,758 | 1 | null | null | 0 | 1,740 |
I have a messagesTableView which is shown in a ViewController in a NavigationController.
In viewDidLoad:
```
[self.messagesTableView reloadData];
NSInteger t;
if ((t = [self.messagesTableView numberOfRowsInSection:0]) > 0) {
NSLog(@"ViewDidLoad: number of rows:%d Messages Count:%d", t, [messages count]);
NSIndexPath* ip = [NSIndexPath indexPathForRow: (t-1) inSection:0];
[self.messagesTableView scrollToRowAtIndexPath:ip atScrollPosition:UITableViewScrollPositionNone animated:NO];
}
```

and in viewDidAppear:
```
[self.messagesTableView reloadData];
NSInteger t;
if ((t = [self.messagesTableView numberOfRowsInSection:0]) > 0) {
NSLog(@"ViewDidAppear: number of rows:%d Messages Count:%d", t, [messages count]);
NSIndexPath* ip = [NSIndexPath indexPathForRow: (t - 1) inSection:0];
[self.messagesTableView scrollToRowAtIndexPath:ip atScrollPosition:UITableViewScrollPositionTop animated:NO];
}
```

The scrollToRowAtIndexPath in viewDidLoad scrolls to second last row instead of the last row whereas the same function in viewDidAppear scrolls to the last row.. The only problem is that it takes a while for the viewDidAppear function to be called..
but why does it behave differently in viewDidLoad and viewDidAppear (the NSLog is printing the same values for both)?
|
scrollToRowAtIndexPath scrolls to the second last row instead of the last row
|
CC BY-SA 3.0
| 0 |
2011-06-20T04:15:14.277
|
2014-08-05T09:27:05.730
|
2011-06-20T07:22:58.683
| 345,652 | 345,652 |
[
"iphone",
"uitableview",
"uinavigationcontroller",
"scrollto",
"viewdidload"
] |
6,407,114 | 1 | 6,407,941 | null | 0 | 220 |
I have a tabbarview application that has a button in one of the tabs. When Pressing that button, something will happen, and the user will be switched to another tab.
I made an animation in that button:
```
UIView * fromView = self.tabBarController.selectedViewController.view;
UIView * toView = [[self.tabBarController.viewControllers objectAtIndex:0] view];
[UIView transitionFromView:fromView
toView:toView
duration:0.6
options:(UIViewAnimationOptionTransitionCurlDown)
completion:^(BOOL finished) {
if (finished) {
self.tabBarController.selectedIndex = 0;
}
}];
```
Which I got from [here](https://stackoverflow.com/questions/5161730/iphone-how-to-switch-tabs-with-an-animation/5180104#5180104). However the problem is that after animating, I seem to have a gap on the top of the screen that is about as high as the status bar. Does anyone know what's causing this? This gap quickly closes when the animation finishes (which is when we do `self.tabBarController.selectedIndex = 0`

By the way, the problem still persist if I swap the animation to something else or even without animation.
Additional info, here's the frame details:
```
from frame: x:0.000000, y:0.000000, w:320.000000, h:411.000000
to frame: x:0.000000, y:0.000000, w:320.000000, h:431.000000
```
|
UIView has gap on top after animating
|
CC BY-SA 3.0
| null |
2011-06-20T05:25:18.990
|
2011-06-20T07:15:48.050
|
2017-05-23T12:07:02.087
| -1 | 361,247 |
[
"iphone",
"uitabbar",
"uiviewanimation"
] |
6,407,501 | 1 | 7,076,367 | null | 1 | 1,029 |
I want to have this [layout](http://imageshack.us/photo/my-images/703/samplewu.jpg/) in crystal reports:
How to do this?

|
Crystal report flowing text around image
|
CC BY-SA 3.0
| 0 |
2011-06-20T06:20:59.043
|
2012-06-30T01:45:22.687
|
2012-06-30T01:45:22.687
| 918,414 | 609,219 |
[
"vb.net",
"crystal-reports"
] |
6,408,185 | 1 | 6,408,911 | null | 2 | 2,644 |
I am designing a project in asp.net mvc3, i have designed my database in sql server, add i am using ado.net.
This is my controller action
```
public ViewResult ProductFormulationIndex()
{
return View(db.ProductFormulation.ToList());
}
```
means i want to display all fields of ProductFormulation table.
this is my table:-

and this is my productCategory Table

in my ProductFormulationIndex.cshtml i want to display Code of ProductCategory Table, not only id. So what should i do in controller or in Model for it ?
you may suggest tutorial related to it.
Thanks in advance.
|
how can get data from another Table
|
CC BY-SA 3.0
| 0 |
2011-06-20T07:46:54.873
|
2011-06-20T11:51:31.733
|
2011-06-20T11:51:31.733
| 27,615 | 887,872 |
[
"asp.net-mvc-3"
] |
6,408,275 | 1 | 6,428,556 | null | 3 | 2,443 |
I am trying to use this code to get changes in a site collection. But i don't know how to get the databaseId.
```
SiteData.SiteData siteData = new SiteData.SiteData();
siteData.UseDefaultCredentials = true;
siteData.Url = "http://localhost:333/_vti_bin/sitedata.asmx";
string lastChangeID = String.Empty;
string result = siteData.GetContent(SiteData.ObjectType.SiteCollection, "", "", "", false, false, ref lastChangeID);
XmlDocument doc = new XmlDocument();
doc.LoadXml(result);
string startChangeId = string.Empty;
string endChangeId = doc.ChildNodes[0].ChildNodes[0].Attributes["ChangeId"].Value;
bool moreChanges;
string databaseId = "";
string result2 = siteData.GetChanges(SiteData.ObjectType.SiteCollection, databaseId, ref startChangeId, ref endChangeId, 5, out moreChanges);
MessageBox.Show(result2);
```
Thank you for your time.
This is the GetContent Result:

|
Using GetChanges in Sharepoint SiteData web service
|
CC BY-SA 3.0
| null |
2011-06-20T07:57:06.467
|
2011-06-21T16:11:53.243
|
2011-06-20T08:22:54.160
| null | null |
[
"c#",
"web-services",
"sharepoint-2010",
"sharepoint-2007"
] |
6,408,288 | 1 | 6,408,325 | null | 2 | 335 |
I have different xml's (for diff os), I am posting only relevant xml part for SunOs xml.
```
<osname>SunOS
</osname>
```
This is fetched by jQuery
```
var osname = $(this).find('osname').text();
```
Later in the code when I compare, it always goes in to `else` part, I used `console.info` for firebug and attached a screenshot of my output
```
console.info("Before checking:"+osname);
if(osname=="HP-UX")
console.info("HP-UX");
else if(osname=="AIX")
console.info("AIX");
else if(osname=="SunOS")
console.info("SunOS");
else
{
console.info("Linux -");
}
```
Screenshot of `console.info`

My question is why can't it check for `SunOs` or any other?
: I think there is a extra character after the osname, I also made a `xsl` in that when I check i do something like below, how can i do it in JS?
XSL code
```
<xsl:if test="$sunos='SunOS
'">
```
I have also tried `if(osname=="SunOS
")`
|
What is wrong with string compare in my javascript code?
|
CC BY-SA 3.0
| null |
2011-06-20T07:58:48.040
|
2011-06-20T08:04:47.523
| null | null | 707,414 |
[
"javascript",
"jquery",
"xml",
"xslt"
] |
6,408,483 | 1 | 6,408,677 | null | 0 | 326 |
I need to import data from an excel - sheet that has this layout:

I would like to convert this into a simple table like this:

Is there any easy way for this?
|
Excel - from a business card layout to a simple table
|
CC BY-SA 3.0
| 0 |
2011-06-20T08:19:08.903
|
2014-10-26T01:09:28.083
|
2018-07-09T18:41:45.953
| -1 | 13,442 |
[
"excel",
"vba"
] |
6,408,544 | 1 | 6,408,590 | null | 12 | 9,498 |
I have a string array in strings.xml, in the values I need to have shutter speeds.
For example:
> 3"2
or
> 0"8
I try to enter the data in the xml, but that does not work. Alternatively; when I enter the value in the graphical interface of the strings.xml file, it places the data as

Which does not display when I place the array in a spinner later on.
Basically, I would like to know how to display a single quotation mark in a string of a string array and have it display in a spinner later on.
Thanks for any help, have a nice day.
|
Android XML values - String Array :: Placing a quote in the value?
|
CC BY-SA 3.0
| 0 |
2011-06-20T08:27:07.410
|
2011-06-20T08:31:23.577
| null | null | 688,573 |
[
"android",
"xml",
"arrays"
] |
6,409,086 | 1 | 6,409,183 | null | 1 | 1,826 |
I want to know if the exception is a "memoryoverflow exception" for example. But if the language on the Operating system is not English but Chinese for example or German, the message changes. And I cannot look the the message string anymore. On [MSDN](http://msdn.microsoft.com/de-de/library/system.exception.aspx) I have not found a exception number to work with. How to find a exception number?
```
Public Shared Sub Main()
Dim x As Integer = 0
Try
Dim y As Integer = 100 / x
Catch e As Exception'here, 123 is not working
if e is ArithmeticException(123) then Console.WriteLine("Generic Exception Handler: {0}", e.ToString())
End Try
End Sub
```

(look at the <-- line)
```
Try
m_DxFilGraphManager.Run()
Catch ex As System.Runtime.InteropServices.COMException
If ex.Message.Contains("0x800705AA") Then '<-- Bad methode. How to do it better?
Return "#ERROR: Can not start capturing. It seems to be a possiblity to change the IEEE 1394 bus host controler system driver in your device manager to 'legacy / alt'. " & ex.Message
Else
Return "#ERROR: " & ex.Message
End If
End Try
```
|
Exception number needed instead of message string
|
CC BY-SA 3.0
| null |
2011-06-20T09:17:45.967
|
2011-06-20T09:46:36.797
|
2011-06-20T09:46:36.797
| 375,368 | 375,368 |
[
".net",
"exception",
"error-handling"
] |
6,409,196 | 1 | 6,411,510 | null | 0 | 116 |
I downloaded and installed the FitNesse release from 20110104
The Acceptance tests all run and pass.
Reading through the documentation I arrived at Fitnesse.UserGuide.QuickReferenceGuide, but this page didn't render correctly. It claims that loads of variables are undefined (HDR, DIVend, pagePATH etc. etc.)
Went back to fitnesse.org and the page renders fine.
The diffs were slightly different, so I copied the version from the web onto my local installation, but it still renders incorrectly (see image). Any help would be appreciated.

You can see the wiki markup at [fitnesse.org](http://fitnesse.org/FitNesse.UserGuide.QuickReferenceGuide?edit)
|
Why does Fitnesse.UserGuide.QuickReferenceGuide not work locally
|
CC BY-SA 3.0
| 0 |
2011-06-20T09:26:26.883
|
2011-06-20T22:18:45.197
|
2011-06-20T09:40:25.317
| 12,405 | 12,405 |
[
"tdd",
"wiki",
"fitnesse"
] |
6,409,420 | 1 | 6,409,704 | null | 0 | 115 |
I have used the following query to get all the records which matches the given time in WHERE clause. But I am getting different results. If you look into tat picture you can see the 2 records have minutes <> 30 but still it is listed as the query result. However if i change the hour they are not listed. What might be the problem ?
`SELECT * FROM pos_takeaways WHERE STR_TO_DATE(time,'%d/%m/%y %H:%U:%S') = STR_TO_DATE('20/6/2011 22:30:00','%d/%m/%Y %H:%U:%S')`
Output:

|
Mysql listing records based on time
|
CC BY-SA 3.0
| null |
2011-06-20T09:46:45.437
|
2011-06-21T05:50:02.420
| null | null | 402,610 |
[
"mysql"
] |
6,409,577 | 1 | 6,409,761 | null | 1 | 3,064 |
So at the moment when i click an itemized overlay item , i just display a simple dialog, i would like to create something more in the lines of the below

How would i go about doing this for the android phone>?
|
How to create a custom dialog for a itemized overlay item?
|
CC BY-SA 3.0
| 0 |
2011-06-20T09:59:56.243
|
2011-06-20T11:18:00.360
| null | null | 286,630 |
[
"java",
"android",
"dialog",
"android-mapview",
"itemizedoverlay"
] |
6,409,759 | 1 | 6,495,286 | null | 46 | 6,161 |
: I'm trying to extract segments from an image. Thanks to openCV's `findContours()` method, I now have a list of 8-connected point for every contours. However, these lists are not directly usable, because they contain a lot of duplicates.
:
Possible solutions:
- `approxPolyDP()`

Here is the result of `approxPolyDP()`: (9 segments! Some overlap)

but what I want is more like:

It's bad because `approxPolyDP()` can convert something that "looks like several segments" in "several segments". However, what I have is a list of points that tend to iterate several times over themselves.
For example, if my points are:
```
0 1 2 3 4 5 6 7 8
9
```
Then, the list of point will be `0 1 2 3 4 5 6 7 8 7 6 5 4 3 2 1 9`... And if the number of points become large (>100) then the segments extracted by `approxPolyDP()` are unfortunately not duplicates (i.e : they overlap each other, but are not strictly equal, so I can't just say "remove duplicates", as opposed to pixels for example)
- `approxPolyDP()`
To sum up: I've got a tedious method, that I've not yet implemented as it seems error-prone. However, I ask , people at Stack Overflow: are there other existing methods, possibly with good implementations?
---
Edit: To clarify, once I have a tree, I can extract "branches" (branches start at leaves or nodes linked to 3 or more other nodes) Then, the algorithm in openCV's `approxPolyDP()` is the [Ramer–Douglas–Peucker algorithm](https://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm), and here is the Wikipedia picture of what it does:

With this picture, it is easy to understand why it fails when points may be duplicates of each other
---
Another edit: In my method, there is something that may be interesting to note. When you consider points located in a grid (like pixels), then generally, the minimal spanning tree algorithm is not useful because there are many possible minimal trees
```
X-X-X-X
|
X-X-X-X
```
is fundamentally very different from
```
X-X-X-X
| | | |
X X X X
```
but both are minimal spanning trees
However, in my case, my nodes rarely form clusters because they are supposed to be contours, and there is already a thinning algorithm that runs beforehand in the `findContours()`.
---
Answer to Tomalak's comment:

If DP algorithm returns 4 segments (the segment from the point `2` to the center being there twice) I would be happy! Of course, with good parameters, I can get to a state where "by chance" I have identical segments, and I can remove duplicates. However, clearly, the algorithm is not designed for it.
Here is a real example with far too many segments:

|
Extracting segments from a list of 8-connected pixels
|
CC BY-SA 4.0
| 0 |
2011-06-20T10:20:17.683
|
2019-12-29T08:06:43.820
|
2019-12-29T08:06:43.820
| 1,033,581 | 596,951 |
[
"c++",
"image-processing",
"graph",
"opencv",
"boost-graph"
] |
6,409,827 | 1 | 6,410,044 | null | 1 | 1,877 |
I have created a map which allows the user to plot multiple markers with the intention on storing them in a database table. The original plan was to store multiple rows per one map like so:
```
------------------------------------
| mapentryid | mapid | Long | Lat |
------------------------------------
| 1 | 1 | X.XX | X.XX |
| 2 | 1 | X.XX | X.XX |
| 3 | 1 | X.XX | X.XX |
| 4 | 2 | X.XX | X.XX |
| 5 | 2 | X.XX | X.XX |
| 6 | 2 | X.XX | X.XX |
| 7 | 2 | X.XX | X.XX |
------------------------------------
```
But I have since found out that you are able to store [multilinestring](http://dev.mysql.com/doc/refman/5.0/en/gis-class-multilinestring.html)'s in MySQL which sounds perfect for what I want (I think?)
I can insert the data correctly using the following SQL query format:
```
INSERT INTO table (LatLng)
VALUES (
MultiLineString(
LineString(Point(x),Point(y)),
LineString(Point(x),Point(y)),LineString(Point(x),Point(y))
)
```
This adds the multilinestring OK, although they actually come up as the following:

The question is, is the above OK? If so, how can I convert this data back into something I am able to display on Google Maps?
|
MySQL storing google maps lat/long data
|
CC BY-SA 3.0
| 0 |
2011-06-20T10:27:51.947
|
2011-06-20T10:49:47.147
| null | null | 475,125 |
[
"mysql",
"google-maps",
"geolocation",
"multilinestring"
] |
6,409,837 | 1 | 6,416,253 | null | 1 | 968 |
I am working through one of the [ArgoUML Tours](http://argouml.tigris.org/tours/index.html) and I am stuck on [Build a Class Diagram: Step #11](http://argouml.tigris.org/tours/bdClassDiagram11.html).
This step asks you to build anonymous realizations between the `Teacher` interface and the `Grad` and `Prof` classes. I can build realizations, as shown in , below; however, I haven't figured out how I can get both `Grad` and `Prof` to show up as they do in Step 11 of the Tour.
Other than the Tour, the ArgoUML documentation is rather sparse; I can't find information on these kind of realizations in [The ArgoUML User Manual](http://argouml-stats.tigris.org/documentation/manual-0.32/). Can someone walk me through the steps to make my diagram look like theirs ()? I am using the latest stable copy of ArgoUML (Version 0.32.2).
: My attempt at drawing realizations of `Teacher`

: The class diagram, as shown in the ArgoUML Tours - [Build a Class Diagram: Step #11](http://argouml.tigris.org/tours/bdClassDiagram11.html)

EDIT:
Originally, I thought `Grad` and `Prof` were multiple realizations of the same interface. Thanks to Tom Morris for clarifying.
|
How can I complete this step in the ArgoUML Class diagram Tour?
|
CC BY-SA 3.0
| null |
2011-06-20T10:29:27.810
|
2011-06-20T20:34:51.837
|
2011-06-20T20:34:51.837
| 667,301 | 667,301 |
[
"language-agnostic",
"uml",
"class-diagram",
"argouml"
] |
6,409,878 | 1 | 6,411,381 | null | 1 | 2,480 |
When I read the following image into Matlab I am obtaining a 3D matrix which basically contains the values of RGB colour samples which compose every pixel within the image.

Is there any Matlab function which I can use to assign a scalar value between lets say [-10, 10] to every pixel within the image based on the RGB values? Pure red should be like 10, yellow should be 5, green should be 0, blue should be like -8 and cyan should be like -10.
|
Matlab - attach scalar value to RGB colours
|
CC BY-SA 3.0
| null |
2011-06-20T10:33:44.270
|
2011-06-20T12:48:58.127
|
2011-06-20T10:39:09.617
| 442,124 | 442,124 |
[
"matlab"
] |
6,410,146 | 1 | 6,739,406 | null | 9 | 13,512 |
In Visual Studio 2010, Dockable Windows seem to work like expected in every situation.
If a "Floating" document is active and some menu is selected (e.g Edit -> Paste), then the "Floating" document still has Focus and the command will be executed against that "Floating" window. Also, notice how this is clearly visible in the UI. MainWindow.xaml is still active and the Main window in Visual Studio is inactive even though the Team-menu is selected.

I've been trying to get the same behavior using alot of different 3rd-party docking components but they all have the same problem: once I select the menu, the MainWindow is focused and my floating window does not have focus anymore. Does anyone know of a way to get the same behavior here as in Visual Studio?
At the moment I'm using [Infragistics xamDockManager](http://www.infragistics.com/dotnet/netadvantage/wpf/xamdockmanager.aspx#Overview) and the problem can be reproduced with the following sample code.
- - -
xmlns:igDock="http://infragistics.com/DockManager"
```
<DockPanel LastChildFill="True">
<Menu DockPanel.Dock="Top">
<MenuItem Header="_File">
<MenuItem Header="_New"/>
</MenuItem>
</Menu>
<Grid>
<igDock:XamDockManager x:Name="dockManager" Theme="Aero">
<igDock:DocumentContentHost>
<igDock:SplitPane>
<igDock:TabGroupPane>
<igDock:ContentPane Header="Header 1">
<TextBox Text="Some Text"/>
</igDock:ContentPane>
<igDock:ContentPane Header="Header 2">
<TextBox Text="Some Other Text"/>
</igDock:ContentPane>
</igDock:TabGroupPane>
</igDock:SplitPane>
</igDock:DocumentContentHost>
</igDock:XamDockManager>
</Grid>
</DockPanel>
```
|
Dockable Windows. Floating Window and MainWindow Menu Integration
|
CC BY-SA 3.0
| 0 |
2011-06-20T10:58:30.713
|
2018-01-07T09:29:52.620
| null | null | 318,425 |
[
"wpf",
"visual-studio",
"visual-studio-2010",
"xaml",
"dockable-windows"
] |
6,410,226 | 1 | 6,891,765 | null | 2 | 1,193 |
I have been able to build [PJSUA](http://www.pjsip.org/pjsua.htm). The softphone runs perfectly on Windows XP, but on Windows 7 but it gives me the following error

It seems to be an issue with PJSUA on Windows 7. Has anyone been able to resolve this?
|
Windows 7 Default Audio Device Problems, PJLIB VOIP SDK
|
CC BY-SA 3.0
| 0 |
2011-06-20T11:04:43.970
|
2013-02-25T08:22:12.403
| null | null | 759,019 |
[
"windows-7",
"voip",
"sip",
"pjsip"
] |
6,410,244 | 1 | null | null | 2 | 5,165 |
I'm using GVim on Windows 7 and trying to compile and run my code right in Vim(just like in visual studio).
I've installed minGW, and correctly set the Environment Variable of Windows.
Look at the image below, when i click the shovel, whose function is to "make current project", error message appear(in lower part of screen).

How to fix this~~ thanks^^
|
How to compile and run C code in GVim on Windows?
|
CC BY-SA 3.0
| null |
2011-06-20T11:06:49.833
|
2011-06-21T04:57:03.270
| null | null | 784,593 |
[
"c",
"windows",
"vim",
"for-loop",
"mingw"
] |
6,410,414 | 1 | 6,437,708 | null | 1 | 255 |
I am starting to use Xcode 4 on a regular basis, but still find it easier to do some things within Xcode 3. I updated to Xcode 4 to the regular directory and then created another separate directory to which I downloaded Xcode 3. I then noticed that the complete Xcode 3 folder is a whopping 8.85GB!
I only develop iPhone and iPad apps. Are there any things in Xcode 3 folder that I can delete? Or move to a external hard drive and then pull back up when I need it? I could really use the space as I am on a Macbook Air.
Thanks!

---
I just noticed that Xcode 4 takes up 12.75 GB. So if anyone knows what I can get rid of there, that would be also fantastic :)
|
What parts of the Xcode 3 and Xcode 4 IDE package can I delete to save memory space
|
CC BY-SA 3.0
| null |
2011-06-20T11:25:23.893
|
2011-06-22T09:26:44.310
|
2011-06-21T10:31:24.353
| 385,559 | 385,559 |
[
"iphone",
"xcode",
"ipad",
"xcode4"
] |
6,410,418 | 1 | 6,487,156 | null | 2 | 3,478 |
Hi all i have declared a global vriable with 2 repetition,
as i know i have declared it with 2 repetition so that it should store maximum two value but i dont know how to insert multiple value when we declare global variable with more then 1 repetition.
what i want : declare global variable with repetition 2
it will look like $$arr[2]
i want to insert two values so that arr[1](https://i.stack.imgur.com/faO9o.png) refer first value and arr[2] refer 2nd value......
Here i have entered a snap where u can see thet i have declared repetition 2..
Thanks in advance.
|
working with global variable with multiple repetition in filemaker pro 10
|
CC BY-SA 3.0
| 0 |
2011-06-20T11:25:34.943
|
2011-06-26T22:51:42.390
|
2011-06-20T11:54:10.973
| 430,803 | 430,803 |
[
"filemaker"
] |
6,410,635 | 1 | null | null | 2 | 725 |
I have a WPF 3D application (C# .NET 4.0) that has a lot of 3D geometries. Now I need to color these geometries by applying a texture. The source for the texture is one large .PNG file like the following:

The .PNG file contains repeating sections. One section for each combination of Case, Deviation and Harmonic. Cases have one or more deviations (nDev). Cases also have one or more harmonics (nHarm). So the number of sections is equal to the sum of the nDev * nHarm of each Case.
Each row of pixels within a section maps to exactly one geometry.

The end-user should be able to select a Case (trough combobox), Deviation (trough slider) and Harmonic (trough slider). This combination leads to a section offset. The basic idea is that this section offset can be used to reposition the "mapping area" over the orignal .png, using a TranslateTransform.
Now the challenge(s) I'm facing. A normal resultsfile contains about:
200 to 400 rows per section
32 to 64 harmonics
up till 250 deviations
20 till 30 cases
In order to get maximum performance, I should use textures that stay within the `RenderCapability.MaxHardwareTextureSize` bounds. So I want to split up the .png per Case (and if necessary per deviation and/or harmonic).
Question: How can I split up the original .png file in multiple brushes? And which brush to use for maximum performance? Should I stick with ImageBrush (since it's static after initial splitting up) or use a BitmapCacheBrush i.e.?
|
Which WPF Brush to use and how to create it
|
CC BY-SA 3.0
| null |
2011-06-20T11:46:12.203
|
2011-07-07T17:46:45.423
| null | null | 414,758 |
[
"wpf",
"3d",
"transform",
"textures",
"brush"
] |
6,410,652 | 1 | 6,411,625 | null | 2 | 12,629 |
I've got a `<span class="name">` next to an `<img>` inside a `<div>`. Inside this span I have some text which I want to turn 90 degrees. However, when I do this (as code suggests below) the span ends up in a somewhat weird position on top of the image.
In IE, the text doesn't rotate at all.
```
.name {
display: block;
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
}
```
Any suggestions as to how I solve this?


|
Positioning rotated span css
|
CC BY-SA 3.0
| null |
2011-06-20T11:48:11.640
|
2011-06-20T13:13:36.003
|
2011-06-20T13:13:36.003
| 383,609 | 769,086 |
[
"html",
"css"
] |
6,411,048 | 1 | 7,714,012 | null | 0 | 1,020 |
I am using doctrine for development activity for my project. However in one of the modules I am getting the below error message on my production server. But the error doesn't surface on the development environment
" Oops! An Error Occurred
The server returned a "500 Internal Server Error" "


|
server error in PHP Symfony
|
CC BY-SA 3.0
| null |
2011-06-20T12:22:12.663
|
2012-08-05T09:20:04.717
|
2012-08-05T09:20:04.717
| 569,101 | 159,079 |
[
"php",
"symfony-1.4"
] |
6,411,262 | 1 | 6,458,575 | null | 3 | 598 |
okay i'm kind of new to this 3D math and it was a major milestone was to get the projection & modelview matrices right last night :]
so i've got this simple model which renders correctly from this angle:

but when i rotate around the y axis, there's something wrong with the depth like this:

that might look interesting, but is not what i want currently. Basically the depth of these walls get mixed up?
can someone point me to the necessary steps on how to solve this? i need a depth buffer or something... right?
|
OpenGL ES 2 - noob question regarding depth
|
CC BY-SA 3.0
| null |
2011-06-20T12:38:50.513
|
2011-06-23T18:02:11.957
| null | null | 252,641 |
[
"ios",
"opengl-es-2.0"
] |
6,411,376 | 1 | 6,425,891 | null | 0 | 1,126 |
Gidday,
I have a page with XSLT doing small amounts of awesome, and it has mostly been going quite well, but I've hit a roadblock.
This page: [http://codefinger.co.nz/_testing/build_2011/](http://codefinger.co.nz/_testing/build_2011/) chokes on CDATA sections that aren't actually in part of my .xsl file, they seem to be inserted during transformation (Javascript parse errors thrown).
Interestingly, this SO question: [xslt, javascript and unescaped html entities](https://stackoverflow.com/questions/435005/xslt-javascript-and-unescaped-html-entities) solved the problem on my local test site (I wrapped the contents of my script blocks with the disable-output-escaping XSL tags), which is a WAMP 2.0 stack with this XSL config:

My live, hosted server has this config: [http://codefinger.co.nz/php-info.php](http://codefinger.co.nz/php-info.php), and this same approach does not work.
Here's the source .xsl file: [http://codefinger.co.nz/_testing/build_2011/xsl/siteContent.xsl](http://codefinger.co.nz/_testing/build_2011/xsl/siteContent.xsl), the associated .xml is valid, it is here: [http://codefinger.co.nz/_testing/build_2011/xml/siteContent.xml](http://codefinger.co.nz/_testing/build_2011/xml/siteContent.xml).
Any ideas?
It should be noted that I really don't fancy moving 2 of the 3 scripts blocks to external files - one is Cufon font replacement (so I move it), the other is a wee script in the head tag by Luke Smith, which is converted to CSS when JS is available.
|
XSLT disable-output-escaping not holding across two diff servers
|
CC BY-SA 3.0
| null |
2011-06-20T12:48:27.143
|
2011-06-21T13:20:03.267
|
2017-05-23T12:30:37.427
| -1 | 283,933 |
[
"javascript",
"xslt",
"escaping"
] |
6,411,464 | 1 | 6,414,122 | null | 2 | 326 |
In my form panel, i have some fields who are required .
I explain :
If user clik on tree , if is directory any fields are required but for leaf ( file )
somes fields are required .
I add allowBlank properties like this :
```
Ext.apply(cmp,{
allowBlank : false
});
```
That works but i haven't got the exclamation point on my panel !
You can see result on this picture : 
An idea ?
The exclamation.gif is well declared on sencha's css and it is present on the extjs 's folder.
Thanks lot :)
|
Why point exclamation is not display?
|
CC BY-SA 3.0
| null |
2011-06-20T12:55:29.123
|
2011-06-20T16:01:33.633
| null | null | 715,091 |
[
"extjs"
] |
6,411,801 | 1 | 6,411,827 | null | 4 | 2,521 |
I am trying to build a simple vertical thermometer with CSS. I took some sample code from a tutorial which had the "mercury" in a horizontal thermometer growing from left to right.
Now that I am trying to make a vertical bar, how can I make the "mercury" grow from bottom to top?
It's coming out like this: 
But, I want the red section to be aligned at the bottom of the grey.
I've tried adding `top: 100%` to `#vertmeter-bar` which starts the red section in the right place. But, providing a negative `height` attribute for `#vertmeter-bar` doesn't seem to work.
Here's my CSS:
```
#vertmeter
{
height:350px;
width:30px;
background-color:#D1D7DF;
}
#vertmeter_bar
{
background-color:#CF3500;
width:100%;
}
```
The HTML:
```
<div id="vertmeter">
<div id="vertmeter_bar" style="height:0%;">
</div>
</div>
```
And a jquery fragment to animate a transition:
```
$('#vertmeter_bar').animate({height:"10%"}, 1000, 'swing');
```
|
Vertical CSS bar chart appearing upside-down
|
CC BY-SA 3.0
| 0 |
2011-06-20T13:21:39.697
|
2011-06-20T13:24:49.417
| null | null | 283,981 |
[
"jquery",
"html",
"css"
] |
6,412,152 | 1 | null | null | 11 | 6,819 |
I want to make a demo using javascript and `<canvas>`, I was thinking of doing a little moving creature, seen from the top and swimming in a water environment.
Concept "art" :

Is there something I can use to start this project, or do I need to create everything from scratch ?
|
Is there a water physics engine for javascript?
|
CC BY-SA 3.0
| 0 |
2011-06-20T13:43:51.347
|
2011-08-02T21:38:27.480
| null | null | 113,305 |
[
"javascript",
"animation",
"canvas",
"physics-engine"
] |
6,412,376 | 1 | 6,412,595 | null | 2 | 21,876 |
I have a set of products with Qty, price and Sum in each line like in this picture:

I want to make it with jquery to auto calculate the Sum in each line and the total in the end, without quitting the page.
I don't have a big experience with jquery.
How can I do that ?
Thanks a lot.
|
jquery - Calculate the sum and total of products
|
CC BY-SA 3.0
| 0 |
2011-06-20T13:58:52.557
|
2015-08-25T15:04:18.133
| null | null | 536,116 |
[
"jquery"
] |
6,412,398 | 1 | 6,412,911 | null | 5 | 7,036 |
I've following data:

I want to plot a graph shows for all x the mean connected with lines (linespoint) and also showing all the confidence interval [ci_lower, ci_upper]. I managed to do that using 2 plots.
```
set xrange [0:1100000]
set yrange [0:5000]
plot \
'2011-06-16_1n_result.txt' using 1:7 title '1 node' with lines, \
'2011-06-16_1n_result.txt' using 1:7:10:11 notitle with errorbars
```
However it doesn't look nice with two colors and I have the feeling that there should be a way to do that with a single plot.
What's the solution code to that?
Best,
Will
|
Gnuplot: linespoint with confidence interval
|
CC BY-SA 3.0
| 0 |
2011-06-20T14:00:16.967
|
2011-06-20T14:36:33.473
| null | null | 715,236 |
[
"gnuplot",
"confidence-interval"
] |
6,412,438 | 1 | 6,412,523 | null | 1 | 119 |
This is what I see in the solution explorer (simple wpf project):

This is what I would like to have:

There are files dependent of the `MainWindow.xaml`
The obvious drag & drop of `MainWindowViewModel.cs` to `MainWindow.xaml` yields an error
> can't move file. Same destination
folder.
How can I achieve this? Should be simple, but I can't find it ...
Thanks for any hints
|
How to attach more than one file to a xaml in solution explorer window
|
CC BY-SA 3.0
| null |
2011-06-20T14:03:15.983
|
2011-06-20T14:09:12.743
| null | null | 220,636 |
[
"c#",
"visual-studio-2010"
] |
6,412,573 | 1 | null | null | 0 | 792 |
I have a Java EE6 EAR application deployed on an Open Source GlassFish v3.1 server running on a Windows 2003 R2 Server on 2 clusters with 2 instances each. To load balance the work load, I am using an apache http server with mod_jk. When I look at the jk status page however I see that the work is being distributed to only one of the instances in each cluster even though all four have the same lbfactor of 1. Any ideas?

Here is my workers.properties config:
```
worker.list=loadbalancerLocal,status
worker.status.type=status
worker.ViewerLocalInstance1.type=ajp13
worker.ViewerLocalInstance1.host=localhost
worker.ViewerLocalInstance1.port=8109
worker.ViewerLocalInstance1.lbfactor=1
worker.ViewerLocalInstance1.socket_keepalive=1
worker.ViewerLocalInstance1.socket_timeout=1000
worker.ViewerLocalInstance2.type=ajp13
worker.ViewerLocalInstance2.host=localhost
worker.ViewerLocalInstance2.port=8209
worker.ViewerLocalInstance2.lbfactor=1
worker.ViewerLocalInstance2.socket_keepalive=1
worker.ViewerLocalInstance2.socket_timeout=1000
worker.ViewerLocalInstance3.type=ajp13
worker.ViewerLocalInstance3.host=localhost
worker.ViewerLocalInstance3.port=8309
worker.ViewerLocalInstance3.lbfactor=1
worker.ViewerLocalInstance3.socket_keepalive=1
worker.ViewerLocalInstance3.socket_timeout=1000
worker.ViewerLocalInstance4.type=ajp13
worker.ViewerLocalInstance4.host=localhost
worker.ViewerLocalInstance4.port=8409
worker.ViewerLocalInstance4.lbfactor=1
worker.ViewerLocalInstance4.socket_keepalive=1
worker.ViewerLocalInstance4.socket_timeout=1000
worker.loadbalancerLocal.type=lb
worker.loadbalancerLocal.sticky_session=True
worker.loadbalancerLocal.balance_workers=ViewerLocalInstance1,ViewerLocalInstance2,ViewerLocalInstance3,ViewerLocalInstance4
```
Here is my httpd config for mod_jk
```
LoadModule jk_module modules/mod_jk.so
JkWorkersFile conf/workers.properties
# Where to put jk logs
JkLogFile logs/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel info
# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"
JkMount /Viewer/* loadbalancerLocal
JkMount /Viewer loadbalancerLocal
JkMount /jkstatus/* status
```
|
apache mod_jk loadbalancing glassfish cluster instances issue
|
CC BY-SA 3.0
| 0 |
2011-06-20T14:12:53.563
|
2011-12-22T16:31:54.240
| null | null | 97,233 |
[
"apache",
"jakarta-ee",
"glassfish",
"mod-jk"
] |
6,412,586 | 1 | null | null | 0 | 685 |
I followed the instructions on this site: [Getting Started With Google App Engine and NetBeans](http://rocky.developerblogs.com/tutorials/getting-started-google-app-engine-netbeans/).
When I try to add a Google App Engine server, I correctly point it to the .app file on my computer. But it still complains to "Provide a valid Google App Engine location". Why is this so? Which location does the plug-in want?

|
Google App Engine plugin on NetBeans 6.9.1
|
CC BY-SA 3.0
| 0 |
2011-06-20T14:14:28.203
|
2012-11-19T05:16:09.880
| null | null | 366,309 |
[
"google-app-engine",
"macos",
"netbeans-6.9"
] |
6,412,598 | 1 | 6,412,661 | null | 1 | 636 |
I'm working on a UI that has a bunch of images and buttons, but since they're too long to fit on one screen, I decided to put it in a ScrollView. Problem is, once I do that, everything disappears except my first image. Here's my code:
```
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/bg"
android:baselineAligned="true"
android:orientation="vertical">
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/scrollView1">
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageView1"
android:src="@drawable/header3000"
android:layout_gravity="center"
android:layout_marginTop="10dip"></ImageView>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageView2"
android:src="@drawable/websitetuneup"
android:layout_gravity="center_horizontal"></ImageView>
<Button
android:layout_width="wrap_content"
android:text="Read More" android:id="@+id/readmore_w1"
android:layout_height="wrap_content"
android:layout_marginLeft="15dip"></Button>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageView3"
android:src="@drawable/inboundmarketing"
android:layout_marginLeft="15dip"></ImageView>
<Button
android:layout_width="wrap_content"
android:text="Read More" android:id="@+id/readmore_w2"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginRight="15dip"></Button>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageView4"
android:src="@drawable/socialmedia"
android:layout_marginLeft="15dip"></ImageView>
<Button
android:layout_width="wrap_content"
android:text="Read More" android:id="@+id/readmore_w3"
android:layout_height="wrap_content"
android:layout_marginLeft="15dip"></Button>
</LinearLayout>
</ScrollView>
</LinearLayout>
```
Here's what it looks like

Notice how the first image appears fine, but all the rest are minimized into a small portion to the right of the image.
How should I fix this? Thanks in advance for your help, and sorry for the long post
|
I'm having a frustrating problem with ScrollView
|
CC BY-SA 3.0
| null |
2011-06-20T14:15:14.283
|
2011-06-20T14:20:18.207
| null | null | 800,462 |
[
"android",
"xml",
"eclipse",
"scrollview"
] |
6,412,660 | 1 | null | null | 2 | 826 |
Why does my `jQuery.ajax()` function work perfectly on my local server, but when uploaded I now get an 'aborted' response in Firebug?

The ajax function is calling the same domain, and looks like this
```
jQuery.ajax({
url: homeUrl+'/engine/check/',
data: jQuery('#post').serialize(),
type: 'post',
beforeSend:function(){
jQuery('#checker span').text('checking status...').parent().show();
},
success: function(data){
if(data == 'not_gallery'){
jQuery('#checker').hide();
}
if(data == 'no_folder'){
jQuery('#loader').hide();
jQuery('#checker span').html('please ensure you have chosen a folder to connect to this gallery');
}
if(data == 'complete'){
jQuery('#loader').hide();
jQuery('#checker span').html('Gallery Active');
}
if(data == 'in_crunch'){
jQuery('#loader').show();
jQuery('#checker span').html('Crunching in progress. This may take a while...');
refreshIntervalId = setInterval( 'check_poll()', 15000 );
}
if(data == 'init_crunch'){
jQuery('#loader').show();
jQuery('#checker span').html('Crunching in progress. This may take a while...');
jQuery.post(homeUrl+'/engine/crunch/', jQuery('#post').serialize(), function(data){
if(data == 'done'){
jQuery('#loader').hide();
jQuery('#checker span').html('Gallery Active');
}
});
}
}
});
```
Could it be my nested ajax functions?
|
why does my jquery.ajax() function show 'Aborted' when uploaded to a live server
|
CC BY-SA 3.0
| 0 |
2011-06-20T14:19:31.533
|
2013-11-25T03:37:38.417
|
2013-01-15T18:50:00.677
| 995,926 | 220,519 |
[
"jquery",
"ajax",
"firebug",
"abort"
] |
6,412,973 | 1 | null | null | 0 | 364 |
I'm trying to come up with a structure for my simple blackberry app. I want to have a static header and 3 containers that will slide into view once the user makes a selection in the previous one. Here is a diagram of it:

The red box is the visible screen. The header will be a manager as will each of the content containers. The 3 containers may be inside a manager themselves if it makes it easier to move them around.
My problem is the `Manager` class does not have any methods to do with its own position. I'm a bit stuck as to how I can create this layout. Can anyone point me in the right direction?
Thanks in advance!
|
blackberry 5.0 api manager/ui layout
|
CC BY-SA 3.0
| null |
2011-06-20T14:41:28.197
|
2011-06-20T16:04:27.547
| null | null | 295,852 |
[
"blackberry",
"blackberry-eclipse-plugin",
"blackberry-jde"
] |
6,413,174 | 1 | 6,413,364 | null | 0 | 427 |
Is there a equivalent to the below control in IOS, basically I am looking to display a list of items either as a list view (table) or as a coverflow view.?

|
switch view control in IOS
|
CC BY-SA 3.0
| null |
2011-06-20T14:56:05.233
|
2011-06-20T15:08:06.157
| null | null | 131,667 |
[
"view",
"ios4"
] |
6,413,128 | 1 | null | null | 0 | 6,795 |
I am having 2 div's as follows based on checking i will show corresponding `DIV` but when i am showing 2nd div the empty space that was occupied by first div is showing an empty space and the 2nd div is showing in its place. This is how i write
Style Sheet
```
<style type="text/css">
.style1
{
width: 268px;
height: 19px;
position: absolute;
top: 16px;
left: 335px;
float: left;
z-index: 1;
}
.style2
{
width: 502px;
height: 20px;
position: absolute;
top: 51px;
left: 226px;
z-index: 1;
float:left;
}
.style3
{
position: absolute;
top: 68px;
left: 773px;
float: right;
z-index: 1;
background-color: #c0c0c0;
height: auto;
width: 162px;
}
.add_emp_bor
{
text-align: center;
border: 1px dotted #000;
background-color: #c0c0c0;
}
.add_emp_bor1
{
text-align: center;
border: 1px dotted #000;
}
.center
{
text-align: center;
background-color: #c0c0c0;
}
.style4
{
width: 83px;
height: 19px;
position: absolute;
top: 96px;
left: 353px;
z-index: 1;
}
.ddlcenter
{
text-align: center;
}
.style5
{
width: 933px;
height: 40px;
position: absolute;
top: 244px;
left: 9px;
z-index: 1;
}
.style6
{
width: 164px;
position: absolute;
top: 325px;
left: 23px;
z-index: 1;
}
.style7
{
width: 164px;
position: absolute;
top: 325px;
left: 221px;
z-index: 1;
}
.style8
{
width: 164px;
height: 21px;
position: absolute;
top: 325px;
left: 426px;
z-index: 1;
}
.style9
{
width: 164px;
height: 21px;
position: absolute;
top: 324px;
left: 622px;
z-index: 1;
}
.style10
{
width: 164px;
height: 21px;
position: absolute;
top: 324px;
left: 812px;
z-index: 1;
}
.style11
{
width: 995px;
height: 20px;
position: absolute;
top: 340px;
left: 11px;
float:left;
z-index: 1;
}
.style12
{
position: absolute;
top: 373px;
left: 13px;
float: left;
z-index: 1;
}
.style13
{
width: 357px;
height: 27px;
position: absolute;
top: 17px;
left: 654px;
float: left;
z-index: 1;
}
.style14
{
width: 629px;
height: 27px;
position: absolute;
top: 52px;
left: 16px;
float: left;
z-index: 1;
}
.style15
{
width: 634px;
height: 27px;
position: absolute;
top: 93px;
left: 15px;
float: left;
z-index: 1;
}
.style16
{
width: 312px;
height: 52px;
position: absolute;
top: 60px;
left: 676px;
float: left;
z-index: 1;
}
.style17
{
width: 65px;
height: 19px;
position: absolute;
top: 117px;
left: 786px;
float:left;
z-index: 1;
}
.style18
{
width: 998px;
height: 20px;
position: absolute;
top: 125px;
left: 2px;
float: left;
z-index: 1;
}
.style19
{
width: 89px;
height: 77px;
position: absolute;
top: 37px;
left: 12px;
float:left;
z-index: 1;
}
.style20
{
width: 137px;
height: 39px;
position: absolute;
top: 532px;
left: 11px;
float: left;
z-index: 1;
}
.style21
{
width: 96px;
height: 77px;
position: absolute;
top: 37px;
float:left;
left: 135px;
z-index: 1;
}
.style22
{
width: 96px;
height: 77px;
position: absolute;
top: 38px;
left: 270px;
float:left;
z-index: 1;
}
.style23
{
width: 96px;
height: 76px;
position: absolute;
top: 39px;
left: 403px;
float:left;
z-index: 1;
}
.style24
{
width: 96px;
height: 77px;
position: absolute;
top: 36px;
left: 547px;
float:left;
z-index: 1;
}
.style25
{
width: 306px;
height: 72px;
position: absolute;
top: 48px;
left: 677px;
z-index: 1;
}
.style26
{
width: 137px;
height: 39px;
position: absolute;
top: 686px;
left: 11px;
float: left;
z-index: 1;
}
.style27
{
width: 8px;
height: 43px;
position: absolute;
top: 56px;
left: 532px;
float:left;
z-index: 1;
}
.style28
{
width: 137px;
height: 52px;
position: absolute;
top: 33px;
float:left;
left: 103px;
z-index: 1;
}
.style29
{
width: 95px;
height: 52px;
position: absolute;
top: 32px;
float:left;
left: 0px;
z-index: 1;
}
.style30
{
width: 8px;
height: 43px;
position: absolute;
top: 36px;
left: 223px;
float:left;
z-index: 1;
}
.style31
{
width: 412px;
height: 27px;
position: absolute;
top: 20px;
left: 0px;
float:left;
}
.style32
{
width: 412px;
height: 27px;
position: absolute;
top: 16px;
left: 245px;
float:left;
z-index: 1;
}
.style33
{
width: 306px;
height: 72px;
position: absolute;
top: 29px;
float:left;
left: 677px;
z-index: 1;
}
.style34
{
width: 65px;
height: 19px;
position: absolute;
top: 91px;
left: 786px;
float:left;
z-index: 1;
}
.style35
{
width: 998px;
height: 20px;
position: absolute;
top: 100px;
left: 2px;
float: left;
z-index: 1;
}
</style>
<div id="divStarr" runat="server" class="style12" visible="false">
<div style="float: left; border-bottom: 1px solid #000; font-weight: bold;">
STAAR
</div>
<br />
<div class="style13">
<asp:CheckBoxList ID="chklstStaar" runat="server" RepeatDirection="Horizontal" Width="357px">
<asp:ListItem Text="Accomodated"></asp:ListItem>
<asp:ListItem Text="Modified"></asp:ListItem>
<asp:ListItem Text="Alternate"></asp:ListItem>
</asp:CheckBoxList>
</div>
<div class="style14">
<asp:CheckBoxList ID="ChkEnglish" runat="server" RepeatDirection="Horizontal">
<asp:ListItem Text="Reading English "></asp:ListItem>
<asp:ListItem Text="Math English "></asp:ListItem>
<asp:ListItem Text="Science English "></asp:ListItem>
<asp:ListItem Text="Social Studies English "></asp:ListItem>
<asp:ListItem Text="Writing English "></asp:ListItem>
</asp:CheckBoxList>
</div>
<div class="style15">
<asp:CheckBoxList ID="chkSpanish" runat="server" RepeatDirection="Horizontal">
<asp:ListItem Text="Reading Spanish"></asp:ListItem>
<asp:ListItem Text="Math Spanish"></asp:ListItem>
<asp:ListItem Text="Science Spanish"></asp:ListItem>
<asp:ListItem Text="Social Studies Spanish"></asp:ListItem>
<asp:ListItem Text="Writing Spanish"></asp:ListItem>
</asp:CheckBoxList>
</div>
<div class="style16">
<asp:TextBox ID="txtComments" CssClass="add_emp_bor1" runat="server" Height="52px"
Width="306px"></asp:TextBox>
</div>
<div style="text-align: center;" class="style17">
Comments
</div>
<div style="border-bottom: 1px solid #000;" class="style18">
</div>
</div>
<div id="divCourse" runat="server" class="style20" visible="false">
<div style="float: left; border-bottom: 1px solid #000; font-weight: bold;">
End of Course Exam
</div>
<div class="style19">
<asp:CheckBoxList ID="chklstCourse" runat="server" RepeatDirection="Vertical" Width="96px">
<asp:ListItem Text="English I"></asp:ListItem>
<asp:ListItem Text="English II"></asp:ListItem>
<asp:ListItem Text="English III"></asp:ListItem>
</asp:CheckBoxList>
</div>
<div class="style21">
<asp:CheckBoxList ID="chklstCourse1" runat="server" RepeatDirection="Vertical" Width="105px">
<asp:ListItem Text="Algebra I"></asp:ListItem>
<asp:ListItem Text="Geometry"></asp:ListItem>
<asp:ListItem Text="Algebra II"></asp:ListItem>
</asp:CheckBoxList>
</div>
<div class="style22">
<asp:CheckBoxList ID="chklstCourse2" runat="server" RepeatDirection="Vertical" Width="101px">
<asp:ListItem Text="Biology"></asp:ListItem>
<asp:ListItem Text="Chemistry"></asp:ListItem>
<asp:ListItem Text="Physics"></asp:ListItem>
</asp:CheckBoxList>
</div>
<div class="style23">
<asp:CheckBoxList ID="chklstCourse3" runat="server" RepeatDirection="Vertical" Width="146px">
<asp:ListItem Text="World Geography"></asp:ListItem>
<asp:ListItem Text="World History"></asp:ListItem>
<asp:ListItem Text="U.S. History"></asp:ListItem>
</asp:CheckBoxList>
</div>
<div style="border-right: 1px solid #808080;" class="style27">
</div>
<div class="style24">
<asp:CheckBoxList ID="chklstCourse4" runat="server" RepeatDirection="Vertical" Width="125px">
<asp:ListItem Text="Accommodated"></asp:ListItem>
<asp:ListItem Text="Modified"></asp:ListItem>
<asp:ListItem Text="Alternate"></asp:ListItem>
</asp:CheckBoxList>
</div>
<div class="style25">
<asp:TextBox ID="txtComments1" CssClass="add_emp_bor1" runat="server" Height="52px"
Width="306px"></asp:TextBox>
</div>
<div style="text-align: center;" class="style17">
Comments
</div>
<div style="border-bottom: 1px solid #000;" class="style18">
</div>
</div>
```
Sample image

My code to visible a div
```
protected void chkTaks_CheckedChanged(object sender, EventArgs e)
{
if (chkTaks.Checked)
{
divTAKS.Visible = true;
}
else
{
divTAKS.Visible = false;
}
}
```
|
Why empty spacing is showing when i hide a DIV
|
CC BY-SA 3.0
| 0 |
2011-06-20T14:53:15.023
|
2011-06-20T15:02:20.507
|
2011-06-20T15:00:27.113
| 388,388 | 388,388 |
[
"html"
] |
6,413,473 | 1 | null | null | 3 | 4,031 |
How can i create this sort of listview in .NET application , are there any free components on the market that could do that 'out of the box' ? Many thanks

|
.NET Winform - Multiline listview (see Screenshot)
|
CC BY-SA 3.0
| null |
2011-06-20T15:15:56.743
|
2016-11-05T05:28:53.807
| null | null | 730,096 |
[
".net",
"winforms",
"listview"
] |
6,413,741 | 1 | 6,415,413 | null | 3 | 310 |
I'm trying to achieve something similar to the "Clear History" and "Clear Cookies" cells in my apps settings (see screenshot):

I already have a few settings implemented that use toggle switches and Multi Value options.
When I edit my Root.plist the only options for an item are group, multi value, slider, text field, title & toggle switch. I'm pretty much trying to replicate the "Clear History" (ie press it once and clear an array), it doesn't store any settings or preferences, it's a one off event.
I hope that makes sense. How is this achieved?
Thanks for your help.
|
App preferences in Settings.app
|
CC BY-SA 3.0
| null |
2011-06-20T15:34:16.453
|
2011-06-20T18:00:41.000
|
2011-06-20T16:27:47.370
| 446,524 | 446,524 |
[
"iphone",
"application-settings",
"settings.bundle",
"root.plist"
] |
6,413,977 | 1 | 7,164,756 | null | 5 | 686 |
Is there any way to have a Shortcut Recorder in Objective-C, where the user can choose the shortcut?
I tried `DDHotKey`, which worked for me, but with this library users can not choose the shortcut themselves.
Then I tried to implement the `Shortcut Recorder`, but there I can only work with Xcode 3 because of the ibplugin.
So is there any way to have something like this in Xcode 4 ? :
DDHotKey: [Here](https://github.com/davedelong/DDHotKey)
Shortcut Recorder:[Here](https://code.google.com/p/shortcutrecorder/)
|
Get Shortcut Recorder working in Xcode 4
|
CC BY-SA 3.0
| 0 |
2011-06-20T15:52:09.540
|
2015-04-17T07:35:02.967
|
2015-04-17T07:35:02.967
| 720,133 | 720,133 |
[
"xcode",
"shortcut",
"hotkeys",
"recorder"
] |
6,414,267 | 1 | 6,416,351 | null | 3 | 1,376 |
I'm interested in implementing something like the combobox used in GMail to easily select emails. The "default" selection of the combobox has a checkbox that can be clicked to select all emails, otherwise you can dropdown the box and choose another selection option.

How would you go about implementing this in GWT?
|
GMail like selection combobox implemented in GWT
|
CC BY-SA 3.0
| 0 |
2011-06-20T16:13:04.733
|
2011-06-20T19:42:38.557
| null | null | 502,360 |
[
"gwt",
"combobox"
] |
6,414,299 | 1 | 6,414,751 | null | 3 | 3,429 |
I'm trying to allow the user to change the title of a window in Java without adding components to the window itself. I'm actually trying this with a `JInternalFrame`, but figure the solution should be similar for a `JFrame`. I simply want to add an additional menu item in the context menu that pops up when right clicking on a window title bar. For example, the below:

This example is on Windows XP, but perhaps there's a way to get the window context menu OS independently perhaps similar to the `SystemTray.getSystemTray()` (but for individual windows an application). From this I would be able to provide my own `ActionListener` to popup a dialog for the user to enter a new title.
Is this a much bigger task than I'm guessing it is? Does anyone have solutions they've used before?
|
Custom Java Window Title Bar Menu
|
CC BY-SA 3.0
| 0 |
2011-06-20T16:15:40.903
|
2011-06-20T16:58:33.450
|
2011-06-20T16:45:39.987
| 714,968 | 561,624 |
[
"java",
"swing",
"contextmenu",
"jinternalframe",
"custom-titlebar"
] |
6,414,560 | 1 | 6,422,730 | null | 2 | 1,129 |
Solved. Look my comment
I have a VisualHost control with overriden
`VisualChildrenCount` and `GetVisualChild(int index)`.
Also it has a collection of Visuals
`public List<Visual> Children { get; set; }`
When i reorder items in the collection, their z-index for HitTest changes, but it displays still in wrong order.
Should display order change or not ? If not then how can i change the display order of elements ?
On the image you can see that Rectangle is drawn nearly first, but oval and arc appear behind it.

Thanks.
P.S. Of Course, after reordering i call InvalidateVisual()
|
Z-Index of DrawingVisual on VisualHost
|
CC BY-SA 3.0
| null |
2011-06-20T16:39:00.760
|
2011-06-21T08:56:39.993
|
2011-06-20T17:53:16.433
| 435,828 | 435,828 |
[
"wpf"
] |
6,414,599 | 1 | 6,414,928 | null | 1 | 886 |
Please help me export my application to iTunes Connect. I dont understand the documents, I have tried my best. I cant find the release of my .app, only the debug version.
I am using xcode 4. Also I dont know if I have signed the application correctly.
Here is a screenshot of my build settings, are these correct.
I setup a distribution certificate, an app ID with a wildcard mask, and a provisioning profile for the App Store, this provisioning profile is then imported into the organizer and on the screenshot below, you see I have assigned it to the Release build.
I cant find the release build at all on my system, only the debug file and would you say my certificates/profiles are set up currently.

|
Generating an application bundle for submission with Xcode 4
|
CC BY-SA 3.0
| 0 |
2011-06-20T16:42:16.090
|
2011-06-20T17:48:36.273
|
2011-06-20T17:48:36.273
| 41,116 | 1,228,006 |
[
"iphone",
"xcode"
] |
6,414,687 | 1 | 6,814,714 | null | 3 | 4,311 |
I'm trying to write Linq query on this Products table based on FacetTypes that need to be grouped by their Facet.
This is the table structure:

I get passed an array of facetTypeIds, say 9, 6, 52
```
FacetTypeId 9 has a name of "160" and is a Facet of "Size"
FacetTypeId 6 has a name of "157" and is a Facet of "Size"
FacetTypeId 52 has a name of "Cool Brand" and is a Facet of "Brand"
```
They need to be constructed into a query that joins based on the facet, like this:
```
select * from products p
inner join (select productId from productFacets where facetTypeId in (9, 6))
p1 on p1.productId = p.productId
inner join (select productId from productFacets where facetTypeId in (52))
p2 on p2.productId = p.productId
```
The outcome is a result set that says:
Get me Products which have brand "Cool Brand" and Sizes of (160 or 157)
How would I go about creating a linq query that will dynamically build this?
I'm kinda stuck as to how this would be formed in linq.
This is the code I've sort of come up with however it feels pretty inefficient.
```
MyDbContext _context;
// Groups FacetTypeIds by Facet into int lists
Dictionary<int, List<int>> createFacetGroup(int[] facetTypeIds)
{
var facets = new Dictionary<int, List<int>>();
var facetTypes = from ft in _context.FacetTypes where facetTypeIds.Contains(ft.FacetTypeId) select ft;
foreach (var facetType in facetTypes)
{
if (facets.ContainsKey(facetType.Facet.FacetId))
facets[facetType.Facet.FacetId].Add(facetType.FacetTypeId);
else
facets.Add(facetType.Facet.FacetId, new List<int> { facetType.FacetTypeId });
}
return facets;
}
public List<Product> FindProductsByGroupedFacetTypeIds(int[] facetTypeIds)
{
var groupedFacetTypeIds = createFacetGroup(facetTypeIds);
// this seem very inefficient but ToList needs to be called
// otherwise the results products in the foreach loop dont end
// up with the correct result set
var products = _context.Products.ToList();
foreach (var facetTypeIdGroup in groupedFacetTypeIds)
{
var facetTypeIdGroupArray = facetTypeIdGroup.Value.ToArray();
products = (from p in products where p.FacetTypes.Any(x => facetTypeIdGroupArray.Contains(x.FacetTypeId)) select p).ToList();
}
return products;
}
```
|
Linq and EntityFramework 4 with multiple inner joins with nested subqueries
|
CC BY-SA 3.0
| 0 |
2011-06-20T16:51:25.197
|
2011-07-25T10:27:30.730
|
2011-06-21T09:26:26.023
| 43,603 | 43,603 |
[
"c#",
"linq",
"entity-framework",
"entity-framework-4"
] |
6,414,818 | 1 | 6,415,667 | null | 1 | 549 |
I've been looking into some graphing libraries but have only found ones for bar graphs, pie charts, scatter plots, and other things that are not what I'm looking for... How do I make a graph with directed lines of different thicknesses between labels, indicating the strength of the connection between the two? (Also, what is this called, more specifically than "graph"?)
Here's a sketch:

|
How to make this type of graph in Android?
|
CC BY-SA 3.0
| null |
2011-06-20T17:04:41.927
|
2011-06-20T18:22:09.347
|
2017-02-08T14:32:31.007
| -1 | 794,243 |
[
"java",
"android",
"graph"
] |
6,414,868 | 1 | 6,414,951 | null | 0 | 52 |
I am trying to style the Select element using [http://ryanfait.com/resources/custom-checkboxes-and-radio-buttons/](http://ryanfait.com/resources/custom-checkboxes-and-radio-buttons/)


the options are starting well above the button.
Am not able to style it. could someone help me how to modify it.
Link: [http://bakasura.in/king/forms.html](http://bakasura.in/king/forms.html)
|
HTML Select Element
|
CC BY-SA 3.0
| null |
2011-06-20T17:09:17.897
|
2011-06-20T22:13:01.503
|
2011-06-20T22:13:01.503
| 285,873 | 155,196 |
[
"css",
"forms",
"selecteditem"
] |
6,414,860 | 1 | 6,414,916 | null | 0 | 248 |
In Firefox 4 and Chrome (unverified in other browsers), the table cell has a small black border on the bottom with `<!DOCTYPE html>` (i.e. html5 mode). Take it out (i.e. quirk mode) and the border disappears. I was wondering how can I have the border-less version in html5 mode. Am I missing something in the stylesheet?
`<!DOCTYPE html>`

`<!DOCTYPE html>`

Thanks
```
<!DOCTYPE html>
<html>
<head>
<style>
table.icon {
display: inline-table;
border-collapse: collapse;
border-spacing: 0px;
text-align: center;
vertical-align: middle;
padding: 0px;
margin: 2px 0px;
border: hidden;
}
table.icon td.content {
vertical-align: middle;
background-color: black;
width: 100px;
height: 100px;
padding: 0px;
margin: 0px 0px;
border: hidden;
}
.block {
width:50px;
height:100px;
background-color: green;
}
</style>
</head>
<body>
<table class="icon">
<tr>
<td class="content"><img class="block"></td>
</tr>
</table>
</body>
</html>
```
|
Table cell sizing in quirk mode
|
CC BY-SA 3.0
| null |
2011-06-20T17:08:43.940
|
2011-06-21T07:22:20.137
|
2011-06-21T07:22:20.137
| 408,391 | 408,391 |
[
"html",
"css"
] |
6,415,017 | 1 | 7,653,413 | null | 0 | 1,655 |
I have a table for product category that has a hierarchical structure. Each Category_ID may have a number of children determined by their Parent_id. For example Air Fresheners (26) has children 26, 27 and 28 as they have a Parent_id of 25.

I would like to set up a page to drill through the categories with dropdowns. A user would select a level 2 category such as Air Fresheners they would then get a dropdown containing children of the previous selection.
What is the best way to do this? I am considering jQuery and JSON, but there might be a better way.
I have the following GetCategoryChildren method:
```
public string ThisName { get; set; }
public int ThisHLevel { get; set; }
public IEnumerable<SelectListItem> Children { get; set; }
public GetCategoryChildren(int category_ID)
{
var rep = new Product_CategoryRepository();
Children = rep.All.Where(x => x.Parent_id == category_ID).ToList()
.Select(x => new SelectListItem
{
Text = x.Name,
Value = x.Category_ID.ToString()
});
ThisName = rep.All.Where(x => x.Category_ID == category_ID)
.FirstOrDefault().Name;
ThisHLevel = rep.All.Where(x => x.Category_ID == category_ID)
.FirstOrDefault().HLevel;
}
```
Lend me your brains.
|
MVC3 Dropdown drillthrough hierarchy
|
CC BY-SA 3.0
| null |
2011-06-20T17:22:29.563
|
2011-10-04T20:04:14.073
| null | null | 608,694 |
[
"asp.net-mvc-3",
"drop-down-menu",
"hierarchy",
"drilldown"
] |
6,415,104 | 1 | 6,444,658 | null | 7 | 3,836 |
I was trying to add a tooltip to show the full content of a truncated ObjectListView, until it turned out it had such a feature built-in:

I tried making my own tool tips using wx.TipWindow, wx.PopupWindow and SuperToolTip, but none of them looked as 'native' as this one.
 
While [I'm aware of this wiki article](http://wiki.wxpython.org/wxListCtrl%20ToolTips) that supposedly enables the tooltip for truncated wx.Listrctrls, I didn't really understand how to get it working. I also expect that it only works when something is truncated, whereas I'd like to be able to use it to display some more information.
I guess the SuperToolTip comes close, but when you remove the 'header' it leaves it with empty space at the top, rather than centering the text in the middle of the tooltip and making it fit.
I tried looking through the source code of ObjectListView, SuperToolTip and wxpython to try and find how tooltips are being created, but I can't really find the low level parts that make it happen.
The code to generate my current popups was:
```
text = "I'm a popup"
class PopUp(wx.TipWindow):
def __init__(self, parent, text):
wx.TipWindow.__init__(self, parent, text)
class PopUp2(wx.PopupWindow):
def __init__(self, parent, text):
wx.PopupWindow.__init__(self, parent)
st = wx.StaticText(self, parent, text)
# Import `from agw import supertooltip as STT`
popup3 = STT.SuperToolTip(text)
```
|
How to tweak my tooltips in wxpython?
|
CC BY-SA 3.0
| 0 |
2011-06-20T17:31:57.260
|
2011-06-22T18:24:34.770
| null | null | 77,595 |
[
"python",
"wxpython",
"tooltip"
] |
6,415,146 | 1 | null | null | 0 | 544 |
please refer to the picture to get a better visual idea.
I do not have access to Table element because the free edition of the framework I am using "ZK framework" does not have tables but it has DIV .
so think of a Table with some rows and three columns: I used a DIV tag with Left Margin and drew the elements of my left column..
```
<div id="leftColumn" width= "45%" align="left" style = "margin-top:10px;margin-bottom:10px;margin-right:30px;margin-left:20px;">
```
I am thinking of using the second column of this table for the spacing between elements on each row and using the third column to put my right hand side elements on it...
so now for the other two DIVs how should I set its properties to look correct?
and actually do you have any better design thoughts?
Thank you.

|
How to utilize DIV tags to work like Table Columns
|
CC BY-SA 3.0
| null |
2011-06-20T17:36:18.340
|
2011-06-20T17:51:02.553
|
2011-06-20T17:51:02.553
| 320,724 | 320,724 |
[
"html"
] |
6,415,284 | 1 | 6,416,069 | null | 19 | 4,565 |
When I start development storage emulator, I get an error
`The process cannot access the file because it is being used by another process`
I guess this is happening only for BLOB, other services i.e. Queue and Tables start successfully
What could be the problem? I am using Azure SDK v1.4

|
windows azure development storage blob service not starting
|
CC BY-SA 3.0
| 0 |
2011-06-20T17:49:47.913
|
2023-01-20T19:27:02.903
|
2012-06-26T00:29:10.790
| 272,109 | 398,368 |
[
"azure",
"azure-storage",
"azure-storage-emulator"
] |
6,415,344 | 1 | 6,415,782 | null | 17 | 17,300 |
I use Chrome 12 on Mac OS X and I've included jQuery 1.6.1 within the document.
I try to read the contents of a file as text and save it in a data-object with the following function:
```
this.upload = function(file) {
console.log('FileHandler.upload called with ' + file.name + '.');
console.log(file);
console.log(this.reader);
data = {
content: this.reader.readAsText(file)
}
console.log('Content: ' + data.content);
}
```
"file" seams to be a valid file-object and "this.reader" is a fresh instance of type FileReader. This code creates the following console output:
[http://cl.ly/1Y2b383G2F272x1m1P0N](http://cl.ly/1Y2b383G2F272x1m1P0N)

|
HTML5 File API: FileReader.readAsText() returns "undefined"
|
CC BY-SA 3.0
| 0 |
2011-06-20T17:55:14.357
|
2022-03-07T18:50:44.067
|
2012-11-12T15:43:40.043
| 249,341 | 711,553 |
[
"javascript",
"html",
"filereader",
"fileapi"
] |
6,415,693 | 1 | 6,415,778 | null | 1 | 943 |
I need a simple image gallery so I decided to build it entirly on CSS, and tried to find something appropriate in the net.I found something very close to what I want, here are the applied CSS styles:
```
<html>
<head>
<title>Gallery</title>
<style type="text/css">
body {
margin: 0 auto;
padding: 0;
width: 500px;
color: #000000;
font: normal 80%/120% Georgia, "Times New Roman", Times, serif;
}
a
{
color: #000000;
}
.gallery {
list-style: none;
margin: 0;
padding: 0;
}
.gallery li {
margin: 10px;
padding: 0;
float: left;
position: relative;
width: 120px;
height: 100px;
}
.gallery img {
background: #fff;
border: solid 1px #ccc;
padding: 4px;
width: 110;
height: 90;
}
.gallery span {
width: 77px;
height: 27px;
display: block;
position: absolute;
top: -12px;
left: 50px;
background: url(images/tape.png) no-repeat;
}
.gallery a:hover img {border: 1px solid #0000ff; width:400; height:300; overflow: auto}
</style>
</head>
<body>
<ul class="gallery">
<li><a href="#"><span></span><img src="image/8.jpg" alt="image" /></a></li>
<li><a href="#"><span></span><img src="image/9.jpg" alt="image" /></a></li>
<li><a href="#"><span></span><img src="image/4.jpg" alt="image" /></a></li>
<li><a href="#"><span></span><img src="image/7.jpg" alt="image" /></a></li>
<li><a href="#"><span></span><img src="image/5.jpg" alt="image" /></a></li>
<li><a href="#"><span></span><img src="image/6.jpg" alt="image" /></a></li>
<li><a href="#"><span></span><img src="image/3.jpg" alt="image" /></a></li>
<li><a href="#"><span></span><img src="image/1.jpg" alt="image" /></a></li>
<li><a href="#"><span></span><img src="image/2.jpg" alt="image" /></a></li>
</ul>
</body>
</html>
```
In fact I don't even know why i need `.gallery span{}` (maybe some tips here) But the main problem is this:
Pic1:

This is how my gallery looks and I want it to look just like that, but when i a:hover and enlarge the image here's what happen
Pic2:

and to make it clear one more picture
Pic3:

What I need, and want to accomplish is all enlarged images to appear like this:
Pic4:

but obviously in front of the thumbnails.Any help please.
Thanks
Leron
|
CSS Image Gallery adjustments
|
CC BY-SA 3.0
| null |
2011-06-20T18:24:26.753
|
2011-06-20T18:33:42.137
| null | null | 649,737 |
[
"css",
"gallery"
] |
6,415,928 | 1 | 6,456,704 | null | 2 | 1,548 |
I'm using the [Smooth Div Scroll jQuery Plugin](http://www.smoothdivscroll.com/) to have a moving filmstrip on a website. The images loaded into the film strip are of a custom post type and each have a title and contain a single image. The plugin scrolls horizontally across a long div containing any amount of images. My problem is that I can scroll for a seemingly infinite amount of time even after the images are gone.
- - -


```
jQuery(window).load(function() {
jQuery("div#makeMeScrollable").smoothDivScroll({
autoScroll: "onstart" ,
autoScrollDirection: "backandforth",
autoScrollStep: 1,
autoScrollInterval: 15,
visibleHotSpots: "always"
});
```
```
jQuery(document).ready(function() {
jQuery("#makeMeScrollable").smoothDivScroll("disable");
});
```
I should also mention, the images for the posts are surrounded by "p" tags but I don't see why that would be the issue.
Thanks for reading!
Here is some more code, most of it is stock and working when just plain IMGs are place instead of the loop.
[http://www.smoothdivscroll.com/basicDemo.htm](http://www.smoothdivscroll.com/basicDemo.htm)
```
function jQuery_from_Google() {
if ( !is_admin() ) { // actually not necessary, because the Hook only get used in the Theme
wp_deregister_script( 'jquery' ); // unregistered key jQuery
wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js', false, '1.5.2'); // register key jQuery with URL of Google CDN
wp_enqueue_script( 'jquery' ); // include jQuery
}
}
// nur for Themes since WordPress 3.0
add_action( 'after_setup_theme', 'jQuery_from_Google' ); // Theme active, include function
function jQueryUI_from_Google() {
if ( !is_admin() ) { // actually not necessary, because the Hook only get used in the Theme
wp_register_script( 'jqueryui', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js'); // register key jQueryUI with URL of Google CDN
wp_enqueue_script( 'jqueryui' ); // include jQueryUI
}
}
// nur for Themes since WordPress 3.0
add_action( 'after_setup_theme', 'jQueryUI_from_Google' ); // Theme active, include function
```
```
<?php // Smooth Div Scroll inport for filmstrip galleries ?>
<script type="text/javascript" src="<?php bloginfo( 'stylesheet_directory' ); ?>/javascript/filmstrip.js"></script>
<script type="text/javascript" src="<?php bloginfo( 'stylesheet_directory' ); ?>/SmoothDivScroll-1.1/js/jquery.smoothDivScroll-1.1-min.js"></script>
</body>
</html>
```
```
<?php if(is_page('engagements')) { ?>
<div id="makeMeScrollable">
<div class="scrollingHotSpotLeft"></div>
<div class="scrollingHotSpotRight"></div>
<div class="scrollWrapper">
<div class="scrollableArea">
<?php
$args = array( 'post_type' => 'engagement_photos' );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
the_content();
endwhile;
?>
</div>
</div>
</div>
<?php } else if(is_page('weddings')) { ?>
```

|
How can I run a jQuery method after posts are loaded in WordPress?
|
CC BY-SA 3.0
| 0 |
2011-06-20T18:48:48.617
|
2011-06-23T15:34:06.027
|
2011-06-20T19:44:56.950
| 2,019,325 | 2,019,325 |
[
"javascript",
"jquery",
"wordpress",
"jquery-ui",
"jquery-plugins"
] |
6,416,013 | 1 | null | null | 4 | 380 |
I'm experiencing difficulty with a custom-made User Control, and my searching on Stack Overflow, MSDN, and Google didn't pop up any troubles quite like the one I'm experiencing.
I have a very simple User Control: It's a label, a text box, and a button, with a SaveFileDialog and a FolderSelectDialog available. The text box and button are anchored Left,Right and Right respectively, with the intent that if the control is resized larger, the text box will enlarge to fill the gap, and the button will stay on the right edge of the control.
The problem I am encountering is that when the control is enlarged, the area to the right of the default width of the control becomes blank space when the project is built and run. The pictures here will illustrate what I mean:
In editor:

Running:

The control is smallish in its design window, but when I add it to a form and widen it, it behaves as intended. However, when I run the form the control was added to, half the control isn't visible.
I suspect that I'm overlooking something fairly straightforward, but I wasn't able to find anything addressing this point in my search. Help would be much appreciated.
|
Graphical hiccups in C# User Control - Resize obscures components
|
CC BY-SA 3.0
| null |
2011-06-20T18:57:53.503
|
2011-06-20T19:44:39.960
|
2011-06-20T19:01:21.443
| 116,923 | 786,062 |
[
"c#",
"winforms"
] |
6,416,082 | 1 | 6,416,317 | null | 3 | 10,104 |
I am trying to create more sections in my UITableView and I cannot seem to figure it out. I am looking to move the "View full website" and "Video" links into their own section and change the height of those cells to 75. I can create a new cell, but I cannot figure out how to position it properly.
```
typedef enum { SectionHeader, SectionDetail } Sections;
typedef enum { SectionHeaderTitle, SectionHeaderDate, SectionHeaderURL, SectionHeaderEnclosure } HeaderRows;
typedef enum { SectionDetailSummary } DetailRows;
@implementation MediaDetailTableViewController
@synthesize item, dateString, summaryString, teachings;
#pragma mark -
#pragma mark Initialization
- (id)initWithStyle:(UITableViewStyle)style {
if ((self = [super initWithStyle:style])) {
}
return self;
}
#pragma mark -
#pragma mark View lifecycle
- (void)viewDidLoad {
// Super
[super viewDidLoad];
// Date
if (item.date) {
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateStyle:NSDateFormatterMediumStyle];
[formatter setTimeStyle:NSDateFormatterMediumStyle];
self.dateString = [formatter stringFromDate:item.date];
[formatter release];}
// Summary
if (item.summary) {
self.summaryString = [item.summary stringByConvertingHTMLToPlainText];
} else {
self.summaryString = @"[No Summary]";
}
}
#pragma mark -
#pragma mark Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
// Return the number of sections.
return 2;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
// Return the number of rows in the section.
switch (section) {
case 0: return 4;
default: return 1;
}
}
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
// Get cell
static NSString *CellIdentifier = @"CellA";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
}
// Display
cell.textLabel.textColor = [UIColor blackColor];
cell.textLabel.font = [UIFont systemFontOfSize:15];
if (item) {
// Item Info
NSString *itemTitle = item.title ? [item.title stringByConvertingHTMLToPlainText] : @"[No Title]";
// Display
switch (indexPath.section) {
case SectionHeader: {
// Header
switch (indexPath.row) {
case SectionHeaderTitle:
cell.textLabel.font = [UIFont boldSystemFontOfSize:15];
cell.textLabel.text = itemTitle;
break;
case SectionHeaderDate:
cell.textLabel.text = dateString ? dateString : @"[No Date]";
break;
case SectionHeaderURL:
cell.textLabel.text = @"View Full Website";
cell.textLabel.textColor = [UIColor blackColor];
cell.selectionStyle = UITableViewCellSelectionStyleBlue;
cell.imageView.image = [UIImage imageNamed:@"Safari.png"];
break;
case SectionHeaderEnclosure:
cell.textLabel.text = @"Video";
cell.textLabel.textColor = [UIColor blackColor];
cell.selectionStyle = UITableViewCellSelectionStyleBlue;
cell.imageView.image = [UIImage imageNamed:@"Video.png"];
break;
}
break;
}
case SectionDetail: {
// Summary
cell.textLabel.text = summaryString;
cell.textLabel.numberOfLines = 0; // Multiline
break;
}
}
}
return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == SectionHeader) {
// Regular
return 34;
} else {
// Get height of summary
NSString *summary = @"[No Summary]";
if (summaryString) summary = summaryString;
CGSize s = [summary sizeWithFont:[UIFont systemFontOfSize:15]
constrainedToSize:CGSizeMake(self.view.bounds.size.width - 40, MAXFLOAT) // - 40 For cell padding
lineBreakMode:UILineBreakModeWordWrap];
return s.height + 16; // Add padding
}
}
#pragma mark -
#pragma mark Table view delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// Open URL
if (indexPath.section == SectionHeader && indexPath.row == SectionHeaderURL) {
if (item.link) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:item.link]];
}
}
if (indexPath.section == SectionHeader && indexPath.row == SectionHeaderEnclosure) {
if (item.enclosures) {
for (NSDictionary *dict in item.enclosures){
NSString *baseUrl = @"http://www.calvaryccm.com";
NSString *url = [dict objectForKey:@"url"];
NSString *finalURL;
finalURL = [baseUrl stringByAppendingFormat:url];
NSLog(@" finalUrl is : %@",finalURL);
NSLog(@" Url is : %@",url);
MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:finalURL]];
// Register to receive a notification when the movie has finished playing.
//[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayBackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:moviePlayer];
if ([moviePlayer respondsToSelector:@selector(setFullscreen:animated:)]) {
// Use the 3.2 style API
moviePlayer.controlStyle = MPMovieControlStyleDefault;
moviePlayer.shouldAutoplay = YES;
[self.view addSubview:moviePlayer.view];
[moviePlayer setFullscreen:YES animated:YES];
} else {
// Use the 2.0 style API
moviePlayer.movieControlMode = MPMovieControlModeHidden;
[moviePlayer play];
}
}
}
}
// Deselect
[self.tableView deselectRowAtIndexPath:indexPath animated:YES];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return YES;
}
#pragma mark -
#pragma mark Memory management
- (void)dealloc {
[dateString release];
[summaryString release];
[item release];
[teachings release];
[super dealloc];
}
@end
```
Here is a picture for reference:

Thank you for all your help!
|
iPhone UITableView Create Sections
|
CC BY-SA 3.0
| 0 |
2011-06-20T19:03:29.933
|
2011-06-20T19:24:41.097
|
2011-06-20T19:05:15.753
| 544,050 | 616,454 |
[
"iphone",
"objective-c",
"xcode",
"uitableview"
] |
6,416,139 | 1 | 6,416,199 | null | 22 | 7,770 |
I have this scenario where I want to share the column size among all the ListViewItems, and I'm using SharedSizeGroup on the column definitions but it doesn't work:
```
<ListView ItemsSource="{Binding}">
<ListView.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="A" />
<ColumnDefinition Width="Auto" SharedSizeGroup="B" />
<ColumnDefinition Width="Auto" SharedSizeGroup="C" />
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Margin="10,0" Text="{Binding Text1}" />
<TextBlock Grid.Column="1" Margin="10,0" Text="{Binding Text2}" />
<TextBlock Grid.Column="2" Margin="10,0" Text="{Binding Text3}" />
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
```
I know a possible solution is using a GridView as the ListView.View, but there's a few design issues that prevent us from doing this. Is there any other way I can achieve sharing the column widths?
This is what I want to achieve (the columns with the same colors should share width):

Thanks in advance.
|
SharedSizeGroup in ListView.ItemTemplate
|
CC BY-SA 3.0
| 0 |
2011-06-20T19:08:04.583
|
2013-01-09T00:57:34.033
|
2011-06-20T19:58:19.897
| 546,730 | 62,642 |
[
"wpf",
"xaml",
"layout",
"controls",
"grid"
] |
6,416,303 | 1 | 6,416,713 | null | 0 | 214 |
So basically what I want to try to do, is make a simple form that the user can enter login information into (to log them into a mysql DB. Then the program will query the database, display the info, and the user can do some manipulation.
What I want to avoid is having a bunch of popup window forms (one to log in, one to select the query for the database, etc)...
So what I was thinking was in my mainform, have "sub forms" embedded into it. I was reading up about this, and discovered most people said it is better to nest user controls into forms, vs. other forms.
Just so you can see what I am talking about, this is a VERY basic skeleton of what I want it to look like:

As you can see, very simple, just instead of having all the popup boxes, embedding the user input stuff into the right side of the form
So, should I indeed be using user controls for this?
If so, I am having some issues with getting values back to the main form from the user control (because there is no showDialog() method or dialog results from user controls, so I do not know when the user has entered all their log in data for the sql server, for example.)
I have attempted to use call by reference to pass in the values to the usercontrol which I want to be set BY the user control - but I havent been able to make that work...
Anyways, If I should be using a userControl here vs. a userForm, how should I be getting the user input back to the mainform??
|
Should I be using a User Control?
|
CC BY-SA 3.0
| null |
2011-06-20T19:22:37.073
|
2011-06-20T21:01:12.993
|
2011-06-20T21:01:12.993
| 60,761 | 607,079 |
[
"c#",
"winforms",
"user-controls"
] |
6,416,403 | 1 | null | null | 0 | 2,810 |
I can't figure out why this multi-table insert (stored procedure) using scope_identity() is not working. This is the gist of it (forgive the unimaginative naming here, please):

TableB's RowID column is obviously an int, not set as identity auto-increment or anything like that.
If I run it in management studio, it says 1 row was affected, but it does not do the inserts.
If I run it from code I get an error saying that I can't insert a NULL value in TableB, RowID, which is correct, it has a not null constraint. But it should be getting the scope_identity() from the first table.
I've tried it in and out of transactions and with various parameter initializations... It's killing me. Thanks in advance for any assistance.
|
SQL Server Scope_Identity() Usage Problem
|
CC BY-SA 3.0
| null |
2011-06-20T19:31:45.643
|
2011-06-20T21:43:20.733
| null | null | 856 |
[
"sql-server-2008",
"insert",
"scope-identity"
] |
6,416,725 | 1 | 25,971,824 | null | 6 | 1,134 |

When my AABB physics engine resolves an intersection, it does so by finding the axis where the penetration is smaller, then "push out" the entity on that axis.
Considering the "jumping moving left" example:
- -
How can I solve this problem?
## Source code:
```
public void Update()
{
Position += Velocity;
Velocity += World.Gravity;
List<SSSPBody> toCheck = World.SpatialHash.GetNearbyItems(this);
for (int i = 0; i < toCheck.Count; i++)
{
SSSPBody body = toCheck[i];
body.Test.Color = Color.White;
if (body != this && body.Static)
{
float left = (body.CornerMin.X - CornerMax.X);
float right = (body.CornerMax.X - CornerMin.X);
float top = (body.CornerMin.Y - CornerMax.Y);
float bottom = (body.CornerMax.Y - CornerMin.Y);
if (SSSPUtils.AABBIsOverlapping(this, body))
{
body.Test.Color = Color.Yellow;
Vector2 overlapVector = SSSPUtils.AABBGetOverlapVector(left, right, top, bottom);
Position += overlapVector;
}
if (SSSPUtils.AABBIsCollidingTop(this, body))
{
if ((Position.X >= body.CornerMin.X && Position.X <= body.CornerMax.X) &&
(Position.Y + Height/2f == body.Position.Y - body.Height/2f))
{
body.Test.Color = Color.Red;
Velocity = new Vector2(Velocity.X, 0);
}
}
}
}
}
```
---
```
public static bool AABBIsOverlapping(SSSPBody mBody1, SSSPBody mBody2)
{
if(mBody1.CornerMax.X <= mBody2.CornerMin.X || mBody1.CornerMin.X >= mBody2.CornerMax.X)
return false;
if (mBody1.CornerMax.Y <= mBody2.CornerMin.Y || mBody1.CornerMin.Y >= mBody2.CornerMax.Y)
return false;
return true;
}
public static bool AABBIsColliding(SSSPBody mBody1, SSSPBody mBody2)
{
if (mBody1.CornerMax.X < mBody2.CornerMin.X || mBody1.CornerMin.X > mBody2.CornerMax.X)
return false;
if (mBody1.CornerMax.Y < mBody2.CornerMin.Y || mBody1.CornerMin.Y > mBody2.CornerMax.Y)
return false;
return true;
}
public static bool AABBIsCollidingTop(SSSPBody mBody1, SSSPBody mBody2)
{
if (mBody1.CornerMax.X < mBody2.CornerMin.X || mBody1.CornerMin.X > mBody2.CornerMax.X)
return false;
if (mBody1.CornerMax.Y < mBody2.CornerMin.Y || mBody1.CornerMin.Y > mBody2.CornerMax.Y)
return false;
if(mBody1.CornerMax.Y == mBody2.CornerMin.Y)
return true;
return false;
}
public static Vector2 AABBGetOverlapVector(float mLeft, float mRight, float mTop, float mBottom)
{
Vector2 result = new Vector2(0, 0);
if ((mLeft > 0 || mRight < 0) || (mTop > 0 || mBottom < 0))
return result;
if (Math.Abs(mLeft) < mRight)
result.X = mLeft;
else
result.X = mRight;
if (Math.Abs(mTop) < mBottom)
result.Y = mTop;
else
result.Y = mBottom;
if (Math.Abs(result.X) < Math.Abs(result.Y))
result.Y = 0;
else
result.X = 0;
return result;
}
```
|
Platform jumping problems with AABB collisions
|
CC BY-SA 3.0
| 0 |
2011-06-20T19:58:30.887
|
2014-09-22T10:24:55.873
| null | null | 598,696 |
[
"c#",
"collision-detection",
"physics",
"aabb"
] |
6,416,970 | 1 | 6,419,090 | null | 1 | 209 |
In my GWT application, I have been saving everything that the user does instantly to the datastore in the background whenever they make changes. So far this has been fine because the things that the user can change aren't being changed a whole lot.
But now I have added a series of check boxes that the user can check & uncheck:

Would it be proper to save everything instantly to the database the user checks/unchecks a box? The thing that's on my mind is reducing the amount of times my web application has to go to the server to save data. Facebook, Google, (and many many others) use a "Save" button whenever a user makes changes to a large amount of fields (say, to their user information).
I am trying to stay away from having a Save button, and so the thought came to mind about saving these values whenever the user closed or refreshed the page. I don't know if that's proper either (what if there is a loss of power, and their system shuts down!), but I know that I could use it like this:
```
public void onClose(CloseEvent<Window> event) {
//save changes to the datastore
}
```
I'm torn between the three methods and don't know which path to take! Any information will be helpful
Thank you!
|
Saving data instantly, onClose, save button? Which is better in this situation
|
CC BY-SA 3.0
| null |
2011-06-20T20:19:03.700
|
2011-06-21T06:36:14.643
|
2011-06-21T06:36:14.643
| 586,621 | 586,621 |
[
"google-app-engine",
"gwt",
"google-cloud-datastore"
] |
6,417,111 | 1 | null | null | 1 | 96 |
Here is what I have.
I played with DIV tags but still cannot figure out how to use them to design this page?

one of the problems I am having is that I cannot correctly align the "Alias" label with its TextBox that is under it...and also putting these controls on the same line - for example Reference Sequence and Ancestry is another problem I could not fix yet.
|
The correct way to design this page without using Tables
|
CC BY-SA 3.0
| null |
2011-06-20T20:30:53.233
|
2011-06-20T21:12:16.180
|
2011-06-20T20:54:33.507
| 633,387 | 320,724 |
[
"css",
"html",
"zk"
] |
6,417,351 | 1 | 6,418,522 | null | 2 | 2,525 |
I am using the Microchip C18 compiler and on occurrence of an interrupt I am experiencing a quite long delay before the ISR code starts running.
As an experiment, this is in my main function:
```
while(1)
{
LATAbits.LATA4 = 1;
LATAbits.LATA4 = 0;
}
```
As interrupt handler I am using this code I copied from some example (I don't know why it's done this way):
```
#pragma interrupt high_isr
void high_isr(void)
{
LATAbits.LATA4 = 1;
LATAbits.LATA4 = 1;
LATAbits.LATA4 = 0;
LATAbits.LATA4 = 1;
LATAbits.LATA4 = 1;
LATAbits.LATA4 = 0;
}
#pragma code high_vector=0x08
void interrupt_at_high_vector(void)
{
_asm GOTO high_isr _endasm
}
```
I am receiving bytes via SPI and shortly after a byte is received, the main loop stops. Then a delay of 16.5 µs follows before the ISR code starts running. That is 165 instruction cycles!

[enlarge image](https://i.stack.imgur.com/Vdpol.png)
I know there is some context saving associated with interrupts and that it's even worse with low priority interrupts. I have disabled and I am using only the high priority vector. Is 165 instructions a normal duration for context saving?
|
What is a normal interrupt latency and context saving time on Microchip C18?
|
CC BY-SA 3.0
| null |
2011-06-20T20:51:58.080
|
2012-02-09T16:03:09.943
|
2011-06-20T21:01:30.157
| 476,074 | 476,074 |
[
"microcontroller",
"interrupt",
"pic",
"pic18"
] |
6,417,451 | 1 | null | null | 1 | 467 |
See my screen shot to found that what is I want.
I want increase top of my form in windows 7:

|
how to increase height of top form
|
CC BY-SA 3.0
| null |
2011-06-20T21:00:19.697
|
2011-06-20T21:25:17.127
|
2011-06-20T21:25:17.127
| 570,357 | 438,497 |
[
"vb.net",
"visual-studio-2010"
] |
6,417,511 | 1 | 6,418,003 | null | 0 | 314 |
I want to extract information from three tables which are linked by certain ids to each other. Can you please suggest me how can i do that. I tried but three tables is bit too complex. Here is what i am trying to do:

So basically from above three tables i want to match USER against respective PID showing the count of only specific SPEC type, e.g ROUND as shown in the example. (It can also happen that same PID is assinged to two different users like PID=1 for user AAA & BBB).
Can you please tell me how to go about it?
|
MySQL query: merge rows in three tables and output as one
|
CC BY-SA 3.0
| null |
2011-06-20T21:05:08.393
|
2011-06-20T21:51:41.440
| null | null | 750,965 |
[
"mysql",
"sql"
] |
6,417,713 | 1 | 6,499,639 | null | 5 | 3,492 |
I made a calendar like it is shown on the screenshot.. but I need to do that week start with monday instead of sunday... i tied to do `Calendar cal = Calendar.getInstanty(); cal.setFirstDayOfWeek(Calendar.MONDAY);`
but this didn't help.. any ideas?
Thanks you

```
import java.util.Calendar;
import java.util.Locale;
import android.content.Context;
import android.graphics.Color;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.Spinner;
import android.widget.TableLayout;
import android.widget.TableRow;
import android.widget.TextView;
import android.text.format.DateFormat;
import android.text.format.DateUtils;
public class CalendarView extends LinearLayout {
public CalendarView(Context context) {
super(context);
init(context);
}
public CalendarView(Context context, AttributeSet attrs) {
super(context, attrs);
init(context);
}
public interface OnMonthChangedListener {
public void onMonthChanged(CalendarView view);
}
public void setOnMonthChangedListener(OnMonthChangedListener l) {
_onMonthChangedListener = l;
}
public interface OnSelectedDayChangedListener {
public void onSelectedDayChanged(CalendarView view);
}
public void setOnSelectedDayChangedListener(OnSelectedDayChangedListener l) {
_onSelectedDayChangedListener = l;
}
public Calendar getVisibleStartDate() {
return _calendar.getVisibleStartDate();
}
public Calendar getVisibleEndDate() {
return _calendar.getVisibleEndDate();
}
public Calendar getSelectedDay() {
return _calendar.getSelectedDay();
}
private void init(Context context) {
View v = LayoutInflater.from(context).inflate(R.layout.calendar, this, true);
_calendar = new CalendarWrapper();
_days = (TableLayout) v.findViewById(R.id.days);
_up = (TextView) v.findViewById(R.id.up);
_prev = (Button) v.findViewById(R.id.previous);
_next = (Button) v.findViewById(R.id.next);
refreshCurrentDate();
// Days Table
String[] shortWeekDayNames = _calendar.getShortDayNames();
for (int i = 0; i < 7; i++) { // Rows
TableRow tr = (TableRow) _days.getChildAt(i);
for (int j = 0; j < 7; j++) { // Columns
Boolean header = i == 0; // First row is weekday headers
TextView tv = (TextView) tr.getChildAt(j);
if (header)
tv.setText(shortWeekDayNames[j]);
else
tv.setOnClickListener(_dayClicked);
}
}
refreshDayCells();
// Listeners
_calendar.setOnDateChangedListener(_dateChanged);
_prev.setOnClickListener(_incrementClicked);
_next.setOnClickListener(_incrementClicked);
setView(MONTH_VIEW);
}
private OnClickListener _incrementClicked = new OnClickListener() {
public void onClick(View v) {
int inc = (v == _next ? 1 : -1);
if (_currentView == MONTH_VIEW)
_calendar.addMonth(inc);
else if (_currentView == DAY_VIEW) {
_calendar.addDay(inc);
invokeSelectedDayChangedListener();
}
else if (_currentView == YEAR_VIEW) {
_currentYear += inc;
refreshUpText();
}
}
};
private OnDateChangedListener _dateChanged = new OnDateChangedListener() {
public void onDateChanged(CalendarWrapper sc) {
Boolean monthChanged = _currentYear != sc.getYear() || _currentMonth != sc.getMonth();
if (monthChanged) {
refreshDayCells();
invokeMonthChangedListener();
}
refreshCurrentDate();
refreshUpText();
}
};
private OnClickListener _dayClicked = new OnClickListener() {
public void onClick(View v) {
}
};
private void refreshDayCells() {
int[] dayGrid = _calendar.get7x6DayArray();
int monthAdd = -1;
int row = 1; // Skip weekday header row
int col = 0;
for (int i = 0; i < dayGrid.length; i++) {
int day = dayGrid[i];
if (day == 1)
monthAdd++;
TableRow tr = (TableRow) _days.getChildAt(row);
TextView tv = (TextView) tr.getChildAt(col);
//Clear current markers, if any.
tv.setBackgroundDrawable(null);
tv.setWidth(0);
tv.setTextSize(12);
tv.setText(dayGrid[i] + " 100€");
tv.setBackgroundColor(Color.WHITE);
if (monthAdd == 0)
tv.setTextColor(Color.BLACK);
else
tv.setTextColor(Color.LTGRAY);
tv.setTag(new int[] { monthAdd, dayGrid[i] });
col++;
if (col == 7) {
col = 0;
row++;
}
}
}
private void setView(int view) {
if (_currentView != view) {
_currentView = view;
_days.setVisibility(_currentView == MONTH_VIEW ? View.VISIBLE : View.GONE);
refreshUpText();
}
}
private void refreshUpText() {
switch (_currentView) {
case MONTH_VIEW:
_up.setText(_calendar.toString("MMMM yyyy"));
break;
case YEAR_VIEW:
_up.setText(_currentYear + "");
break;
case CENTURY_VIEW:
_up.setText("CENTURY_VIEW");
break;
case DECADE_VIEW:
_up.setText("DECADE_VIEW");
break;
case DAY_VIEW:
_up.setText(_calendar.toString("EEEE, MMMM dd, yyyy"));
break;
case ITEM_VIEW:
_up.setText("ITEM_VIEW");
break;
default:
break;
}
}
private void refreshCurrentDate() {
_currentYear = _calendar.getYear();
_currentMonth = _calendar.getMonth();
_calendar.getDay();
int month = cal.get(Calendar.MONTH);
int year = cal.get(Calendar.YEAR);
if(month == _calendar.getMonth() && year== _calendar.getYear()){_prev.setVisibility(INVISIBLE);}
else {_prev.setVisibility(VISIBLE);}
}
private void invokeMonthChangedListener() {
if (_onMonthChangedListener != null)
_onMonthChangedListener.onMonthChanged(this);
}
private void invokeSelectedDayChangedListener() {
if (_onSelectedDayChangedListener != null)
_onSelectedDayChangedListener.onSelectedDayChanged(this);
}
private final int CENTURY_VIEW = 5;
private final int DECADE_VIEW = 4;
private final int YEAR_VIEW = 3;
private final int MONTH_VIEW = 2;
private final int DAY_VIEW = 1;
private final int ITEM_VIEW = 0;
private CalendarWrapper _calendar;
private TableLayout _days;
private TextView _up;
private Button _prev;
private Button _next;
// private Spinner sailFromSpinner;
private OnMonthChangedListener _onMonthChangedListener;
private OnSelectedDayChangedListener _onSelectedDayChangedListener;
private int _currentView;
private int _currentYear;
private int _currentMonth;
public Calendar cal = Calendar.getInstance();
}
class CalendarWrapper {
public interface OnDateChangedListener {
public void onDateChanged(CalendarWrapper sc);
}
public CalendarWrapper() {
_calendar = Calendar.getInstance();
_shortDayNames = new String[_calendar.getActualMaximum(Calendar.DAY_OF_WEEK)];
_shortMonthNames = new String[_calendar.getActualMaximum(Calendar.MONTH) + 1]; // Months are 0-based so size is Max + 1
for (int i = 0; i < _shortDayNames.length; i++) {
_shortDayNames[i] = DateUtils.getDayOfWeekString(i +1 , DateUtils.LENGTH_SHORT);
}
for (int i = 0; i < _shortMonthNames.length; i++) {
_shortMonthNames[i] = DateUtils.getMonthString(i, DateUtils.LENGTH_SHORT);
}
}
public int getYear() {
return _calendar.get(Calendar.YEAR);
}
public int getMonth() {
return _calendar.get(Calendar.MONTH);
}
public int getDayOfWeek() {
return _calendar.get(Calendar.DAY_OF_WEEK);
}
public int getDay() {
return _calendar.get(Calendar.DAY_OF_MONTH);
}
public void setYear(int value) {
_calendar.set(Calendar.YEAR, value);
invokeDateChangedListener();
}
public void setYearAndMonth(int year, int month) {
_calendar.set(Calendar.YEAR, year);
_calendar.set(Calendar.MONTH, month);
invokeDateChangedListener();
}
public void setMonth(int value) {
_calendar.set(Calendar.MONTH, value);
invokeDateChangedListener();
}
public void setDay(int value) {
_calendar.set(Calendar.DAY_OF_MONTH, value);
invokeDateChangedListener();
}
public void addYear(int value) {
if(value != 0) {
_calendar.add(Calendar.YEAR, value);
invokeDateChangedListener();
}
}
public void addMonth(int value) {
if(value != 0) {
_calendar.add(Calendar.MONTH, value);
invokeDateChangedListener();
}
}
public void addMonthSetDay(int monthAdd, int day) {
_calendar.add(Calendar.MONTH, monthAdd);
_calendar.set(Calendar.DAY_OF_MONTH, day);
invokeDateChangedListener();
}
public void addDay(int value) {
if(value != 0) {
_calendar.add(Calendar.DAY_OF_MONTH, value);
invokeDateChangedListener();
}
}
public String[] getShortDayNames() {
return _shortDayNames;
}
public String[] getShortMonthNames() {
return _shortMonthNames;
}
public int[] get7x6DayArray() {
_visibleStartDate = null;
_visibleEndDate = null;
int[] days = new int[42];
Calendar tempCal = (Calendar) _calendar.clone();
tempCal.setFirstDayOfWeek(2);
tempCal.set(Calendar.DAY_OF_MONTH, 1);
int dayOfWeekOn1st = tempCal.get(Calendar.DAY_OF_WEEK);
int maxDay = tempCal.getActualMaximum(Calendar.DAY_OF_MONTH);
int previousMonthCount = dayOfWeekOn1st - 1;
int index = 0;
if (previousMonthCount > 0) {
tempCal.set(Calendar.DAY_OF_MONTH, -1);
int previousMonthMax = tempCal.getActualMaximum(Calendar.DAY_OF_MONTH);
for (int i = previousMonthCount; i > 0; i--) {
int day = previousMonthMax - i + 1;
if(i == previousMonthCount) {
_visibleStartDate = (Calendar)tempCal.clone();
// _visibleStartDate.setFirstDayOfWeek(2);
_visibleStartDate.set(Calendar.DAY_OF_MONTH, day);
}
days[index] = day;
index++;
}
}
for (int i = 0; i < maxDay; i++) {
if(i == 0 && _visibleStartDate == null)
_visibleStartDate = (Calendar)tempCal.clone();
days[index] = (i + 1);
index++;
}
int nextMonthDay = 1;
for (int i = index; i < days.length; i++) {
if(i == index)
days[index] = nextMonthDay;
nextMonthDay++;
index++;
}
_visibleEndDate = (Calendar) _calendar.clone();
_visibleEndDate.add(Calendar.MONTH, 1);
_visibleEndDate.set(Calendar.DAY_OF_MONTH, days[41]);
return days;
}
public Calendar getSelectedDay() {
return (Calendar)_calendar.clone();
}
public Calendar getVisibleStartDate() {
return (Calendar) _visibleStartDate.clone();
}
public Calendar getVisibleEndDate() {
return (Calendar) _visibleEndDate.clone();
}
public void setOnDateChangedListener(OnDateChangedListener l) {
_onDateChangedListener = l;
}
public String toString(CharSequence format) {
return DateFormat.format(format, _calendar).toString();
}
private void invokeDateChangedListener() {
if (_onDateChangedListener != null)
_onDateChangedListener.onDateChanged(this);
}
private Calendar _calendar;
private String[] _shortDayNames;
private String[] _shortMonthNames;
private OnDateChangedListener _onDateChangedListener;
private Calendar _visibleStartDate;
private Calendar _visibleEndDate;
}
```
|
Android Calendar - Start week with monday
|
CC BY-SA 3.0
| 0 |
2011-06-20T21:24:37.183
|
2011-06-29T15:42:59.620
| null | null | 764,644 |
[
"java",
"android",
"calendar"
] |
6,418,099 | 1 | 11,377,688 | null | 1 | 1,411 |
This is the Lightbox CSS sheet:
```
#lightbox{ position: absolute; left: 0; width: 100%; z-index: 100; text-align: center; line-height: 0;}
#lightbox img{ width: auto; height: auto;}
#lightbox a img{ border: none; }
#outerImageContainer{ position: relative; background-color: #fff; width: 250px; height: 250px; margin: 0 auto; }
#imageContainer{ padding: 10px; }
#loading{ position: absolute; top: 40%; left: 0%; height: 25%; width: 100%; text-align: center; line-height: 0; }
#hoverNav{ position: absolute; top: 0; left: 0; height: 100%; width: 100%; z-index: 10; }
#imageContainer>#hoverNav{ left: 0;}
#hoverNav a{ outline: none;}
#prevLink, #nextLink{ width: 49%; height: 100%; background-image: url(data:image/gif;base64,AAAA); /* Trick IE into showing hover */ display: block; }
#prevLink { left: 0; float: left;}
#nextLink { right: 0; float: right;}
#prevLink:hover, #prevLink:visited:hover { background: url(../images/prevlabel.gif) left 15% no-repeat; }
#nextLink:hover, #nextLink:visited:hover { background: url(../images/nextlabel.gif) right 15% no-repeat; }
#imageDataContainer{ font: 10px Verdana, Helvetica, sans-serif; background-color: #fff; margin: 0 auto; line-height: 1.4em; overflow: auto; width: 100% ; }
#imageData{ padding:0 10px; color: #666; }
#imageData #imageDetails{ width: 70%; float: left; text-align: left; }
#imageData #caption{ font-weight: bold; }
#imageData #numberDisplay{ display: block; clear: left; padding-bottom: 1.0em; }
#imageData #bottomNavClose{ width: 66px; float: right; padding-bottom: 0.7em; outline: none;}
#overlay{ position: absolute; top: 0; left: 0; z-index: 90; width: 100%; height: 500px; background-color: #000; }
```
But using it I get my pictures like this :
Pic1:

in other words - on the whole width of my page, I want to customise it in a way to get this result :
Pic2 :

I want to get 3-4 pics on each row, I tried by simply doing this:
```
<body style="width: 500px;">
<a href="pic/1.jpg" rel="lightbox[roadtrip]"><img src="pic/1.jpg" width="110" height="90" alt="image" /></a>
<a href="pic/2.jpg" rel="lightbox[roadtrip]"><img src="pic/2.jpg" width="110" height="90" alt="image" /></a>
</body>
```
But this leads to a bug when I go to large view for a single picture...
Thanks
Leron
|
Lightbox CSS customizing
|
CC BY-SA 3.0
| 0 |
2011-06-20T22:01:44.407
|
2012-07-07T18:42:01.363
|
2011-06-20T22:22:06.333
| 364,708 | 649,737 |
[
"css",
"lightbox"
] |
6,418,180 | 1 | null | null | 2 | 330 |
I made a GUI in Eclipse using the Google WindowBuilder plugin. The problem is that when I right-click on the design representation of my code and click, "Test/Preview," my GUI works and looks perfectly (the picture on the right), but when I click the "run" button in Eclipse to actually run the code, the GUI looks all weird (the picture on the left).
Does anybody have a clue as to what the problem is?

|
Google WindowBuilder for Java
|
CC BY-SA 3.0
| 0 |
2011-06-20T22:12:10.780
|
2015-02-20T21:41:12.723
|
2014-01-16T12:10:36.457
| 321,731 | 794,346 |
[
"java"
] |
6,418,222 | 1 | 6,419,136 | null | 1 | 521 |
I'm trying to write sessions to database using `session_set_save_handler()`. I'm getting an infinite loop, where my system wants to log me in, but cannot find the session, so it logs me out... but the session exists apparently - just not in the table.
Anyway, here's my code for the session functions - I don't think there's anything wrong here:
```
<?php
// session.functions.php
$db = new mysqli("127.0.0.1", "user", "pass", "db");
// define 'openSession()' function
function openSession($sessionPath, $sessionName) {
return true;
}
// define 'closeSession()' function
function closeSession() {
return true;
}
// define 'readSession()' method
function readSession($sessionId) {
global $db;
// escape session ID
$sessionId = $db->real_escape_string($sessionId);
$result = $db->query("SELECT sessiondata FROM sessions WHERE
sessionid='$sessionId' AND expiry > NOW()");
if ($result->num_rows > 0) {
$row = $result->fetchRow();
return $row['sessiondata'];
}
// return empty string
return "";
}
// define 'writeSession()' function
function writeSession($sessionId, $sessionData) {
global $db;
$expiry = time() + get_cfg_var('session.gc_maxlifetime') - 1;
// escape session ID & session data
$sessionId = $db->real_escape_string($sessionId);
$sessionData = $db->real_escape_string($sessionData);
$result = $db->query("SELECT sessionid FROM sessions WHERE
sessionid='$sessionId'");
// check if a new session must be stored or an existing one must be updated
($result->num_rows > 0) ? $db->query("UPDATE sessions SET sessionid='$sessionId',expiry='$expiry',sessiondata=
'$sessionData' WHERE sessionid='$sessionId'") or die(mysqli_error($db)) : $db->query("INSERT INTO sessions (sessionid,expiry,sessiondata) VALUES ('$sessionId','$expiry','$sessionData')") or die(mysqli_error($db));
return true;
}
// define 'destroySession()' function
function destroySession($sessionId) {
global $db;
// escape session ID
$sessionId = $db->real_escape_string($sessionId);
$db->query("DELETE FROM sessions WHERE sessionid='$sessionId'");
return true;
}
// define 'gcSession()' function
function gcSession($maxlifetime) {
global $db;
$db->query("DELETE FROM sessions WHERE expiry < NOW()");
return true;
}
?>
```
This is the session setting for login:
```
$this->set_session(array_merge($rs->fetch_assoc(), array('expires' => time() + (15 * 60))));
```
set by function:
```
private function set_session($a=false) {
if (!empty($a)) {
$_SESSION['exp_user'] = $a;
}
}
```
How does my login system check to see if I'm already logged in?
```
public function check_status() {
if (empty($_SESSION['exp_user']) || @$_SESSION['exp_user']['expires'] < time()) {
return false;
} else {
return true;
}
}
```
Turns out, the value of $_SESSION, according to var_dump is array(0) { }
and the check in the web application itself:
```
// This is in authorisation.php
if(empty($_SESSION['exp_user']) || @$_SESSION['exp_user']['expires'] < time()) {
header("location:/login.php"); //@ redirect
} else {
$_SESSION['exp_user']['expires'] = time()+(15*60); //@ renew 15 minutes
//echo $SID = session_id();
}
```
Now, this is what I have in that index.php file at the top:
```
require('includes/session.functions.php');
session_set_save_handler('openSession', 'closeSession', 'readSession', 'writeSession', 'destroySession', 'gcSession');
session_start();
include('includes/authorisation.php');
```
Here's the database:

If I comment out `session_set_save_handler()`, we don't get the loop, however, if I keep it there in action, I get the loop between index and the login system (already logged in -> index ::check login loop.)
```
print_r(session_set_save_handler('openSession', 'closeSession', 'readSession', 'writeSession', 'destroySession', 'gcSession')); == 1
var_dump(session_set_save_handler('openSession', 'closeSession', 'readSession', 'writeSession', 'destroySession', 'gcSession')); == bool(true)
```
Any ideas what I'm doing wrong?
|
session_set_save_handler causing login loop
|
CC BY-SA 3.0
| null |
2011-06-20T22:16:10.753
|
2011-06-21T00:38:51.727
|
2011-06-20T22:38:42.393
| 114,865 | 114,865 |
[
"php",
"mysql",
"session"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.