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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5,585,422 | 1 | null | null | 7 | 1,823 |
I want to generate simple linear arrangements like this:

I think I am making this way too hard. I tried just hard coding the positions, but it is a little more complicated because I want splined edges.
I don't particularly care if the edges are above or below, but specifying that would be a nice feature.
|
Simple linear arrangement in graphviz
|
CC BY-SA 3.0
| 0 |
2011-04-07T17:56:10.943
|
2011-10-06T18:04:54.267
|
2011-10-06T18:04:54.267
| 63,733 | 54,024 |
[
"graphviz",
"dot",
"neato"
] |
5,585,704 | 1 | 5,586,003 | null | 1 | 444 |
Heres the code
```
$('#print').click(function(){
$('#compatibility h2').each(function(){
var clicked = $(this);
if($(this).hasClass('collapsed'))
{
$(clicked).removeClass('collapsed');
if($($(this)[0].nextSibling).is('ul'))
{
$(this).next().slideToggle();
}
else
{
$.get("getproducts.php", {cid: $(this).attr('id'), did: $("#deviceId").val()},
function(data)
{
$(clicked).after(data).next().slideToggle(); //adds a <ul> <li> </li> </ul>
});
}
}
});
$('#expandCollapse').attr('value','Collapse All');
print();
});
```
here is what the function of print does

It doesnt wait for the toggle to fully complete before trying to do the print command anyone have any ideas to fix this?? Thanks.
|
Print function for jquery not waiting for slidetoggle to complete
|
CC BY-SA 2.5
| null |
2011-04-07T18:21:38.720
|
2011-04-07T18:48:13.723
| null | null | 290,822 |
[
"jquery",
"ajax",
"printing",
"slidetoggle"
] |
5,586,148 | 1 | 5,670,196 | null | 9 | 1,171 |
Best reader,
I'm stuck on one of my concepts.
I'm making a program which classroom children can measure themselves with.
This is what the program includes;
- 1 webcam (only used for a simple webcam view.)
- 2 phidgets (don't mind these.)
So, this was my plan. I'll draw a rectangle on the webcamview and make it repaint itself constantly.
When the repainting is stopped by one of the phidgets, the rectangle's value will be returned in centimeters or meters.
I've already written the code of the rectangle that's repainting itself and this was my result:
(It's a roundRectangle, the lines are kind of hard to see in this image, sorry about that.)

As you can see, the background is now simply black.
I want to set the background of this JFrame as a webcam view (if possible) and then draw the
rectangle over the webcam view instead of the black background.
I've already looked into jmf, fmj and such but am getting errors even after checking my webcam path and adding the needed jar libraries. So I want to try other options.
So;
- I simply want to open my webcam, use it as background (yes live stream, if possible in some way).
And then draw this rectangle over it.
I'm thus wondering if this is possible, or if there's other options for me to achieve this.
Hope you understand my situation, and please ask if anything's unclear.
EDIT:
I got my camera to open now trough java. The running camera is of type "Process".
This is where I got the code for my camera to open: [http://www.linglom.com/2007/06/06/how-to-run-command-line-or-execute-external-application-from-java/](http://www.linglom.com/2007/06/06/how-to-run-command-line-or-execute-external-application-from-java/)
I adjusted mine a little so it'll open my camera instead.
But now I'm wondering; is it possible to set a process as background of a JFrame?
Or can I somehow add the process to a JPanel and then add it to a JFrame?
I've tried several things without any succes.
My program as it is now, when I run it, opens the measuring frame and the camera view seperatly.
But the goal is to fuse them and make the repainting-rectangle paint over the camera view.
Help much appreciated!
|
Open webcam and set as background (question)
|
CC BY-SA 3.0
| 0 |
2011-04-07T18:58:26.137
|
2011-04-14T21:56:38.340
|
2011-04-08T21:18:47.270
| 652,577 | 652,577 |
[
"java",
"swing",
"background",
"camera",
"jframe"
] |
5,586,246 | 1 | null | null | 1 | 765 |
I have an app that leverages the TouchJSON objective-C library and I'm running the Instruments profiler for memory leaks and getting a leak in that source that I can't figure out how to fix. I should mention that I'm fairly new to Cocoa and objective-C. Instruments is showing that the leak occurs in a method with the following signature:
```
- (BOOL)scanJSONStringConstant:(NSString **)outStringConstant error:(NSError **)outError
```
...and the leak is specifically occurring in this block of code:
```
if (self.options & kJSONScannerOptions_MutableLeaves)
{
*outStringConstant = [theString autorelease];
}
else
{
*outStringConstant = [[theString copy] autorelease]; //LEAK IS HAPPENING HERE
[theString release];
}
```
I've tried a variety of fixes to try and get rid of the leak but with no success. Can someone please educate me on:
1) Why this is a leak
...and...
2) How to fix it
I'm familiar with the rudiments of objective-C memory management ("If you alloc, copy, or new...release is up to you") so I don't need a whole primer on the basics - just some insight as to why this is leaking.
Thanks in advance for any help.
EDIT: Attaching image of debug info.

|
NSString Copy Memory Leak
|
CC BY-SA 2.5
| null |
2011-04-07T19:06:49.027
|
2012-04-18T09:17:29.773
|
2011-04-07T19:59:32.887
| 643,623 | 643,623 |
[
"objective-c",
"cocoa",
"xcode",
"memory-leaks",
"instruments"
] |
5,586,553 | 1 | 5,586,859 | null | 2 | 9,067 |
I have components laid out in a GridBagLayout. I want a 1px black line between all the components, as well as around the JPanel itself.
Currently, I am using a MatteBorder to do this. The parent component has a 1px MatteBorder on the top and left edges. Each child component has a 1px MatteBorder on the right and bottom edges. The horizontal and vertical gaps are zero on the GridBagLayout.
This mostly works, except I'm getting occasional gaps where the child borders meet the parent border.

I suspect this is due to a rounding/floating point inaccuracy in the distribution of extra space to the child components.
Is there a better way to achieve this look?
Attached is a simpler example:
```
public class SSBGuiTest extends JDialog {
public SSBGuiTest(Frame owner) {
super(owner);
initComponents();
}
public SSBGuiTest(Dialog owner) {
super(owner);
initComponents();
}
private void initComponents() {
// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
wrapperPanel = new JPanel();
panelWithTopLeftMatteBorder = new JPanel();
panel1 = new JPanel();
label1 = new JLabel();
panel2 = new JPanel();
label2 = new JLabel();
panel3 = new JPanel();
label3 = new JLabel();
//======== this ========
Container contentPane = getContentPane();
contentPane.setLayout(new BorderLayout());
//======== wrapperPanel ========
{
wrapperPanel.setBorder(new EmptyBorder(15, 15, 15, 15));
wrapperPanel.setLayout(new BorderLayout());
//======== panelWithTopLeftMatteBorder ========
{
panelWithTopLeftMatteBorder.setBorder(new MatteBorder(1, 1, 0, 0, Color.black));
panelWithTopLeftMatteBorder.setLayout(new GridBagLayout());
((GridBagLayout)panelWithTopLeftMatteBorder.getLayout()).columnWidths = new int[] {0, 0};
((GridBagLayout)panelWithTopLeftMatteBorder.getLayout()).rowHeights = new int[] {0, 0, 0, 0};
((GridBagLayout)panelWithTopLeftMatteBorder.getLayout()).columnWeights = new double[] {1.0, 1.0E-4};
((GridBagLayout)panelWithTopLeftMatteBorder.getLayout()).rowWeights = new double[] {1.0, 1.0, 1.0, 1.0E-4};
//======== panel1 ========
{
panel1.setBorder(new MatteBorder(0, 0, 1, 1, Color.black));
panel1.setLayout(new BorderLayout());
//---- label1 ----
label1.setHorizontalAlignment(SwingConstants.CENTER);
label1.setText("label1");
panel1.add(label1, BorderLayout.CENTER);
}
panelWithTopLeftMatteBorder.add(panel1, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
GridBagConstraints.CENTER, GridBagConstraints.BOTH,
new Insets(0, 0, 0, 0), 0, 0));
//======== panel2 ========
{
panel2.setBorder(new MatteBorder(0, 0, 1, 1, Color.black));
panel2.setLayout(new BorderLayout());
//---- label2 ----
label2.setHorizontalAlignment(SwingConstants.CENTER);
label2.setText("label2");
panel2.add(label2, BorderLayout.CENTER);
}
panelWithTopLeftMatteBorder.add(panel2, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0,
GridBagConstraints.CENTER, GridBagConstraints.BOTH,
new Insets(0, 0, 0, 0), 0, 0));
//======== panel3 ========
{
panel3.setBorder(new MatteBorder(0, 0, 1, 1, Color.black));
panel3.setLayout(new BorderLayout());
//---- label3 ----
label3.setHorizontalAlignment(SwingConstants.CENTER);
label3.setText("label3");
panel3.add(label3, BorderLayout.CENTER);
}
panelWithTopLeftMatteBorder.add(panel3, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0,
GridBagConstraints.CENTER, GridBagConstraints.BOTH,
new Insets(0, 0, 0, 0), 0, 0));
}
wrapperPanel.add(panelWithTopLeftMatteBorder, BorderLayout.CENTER);
}
contentPane.add(wrapperPanel, BorderLayout.CENTER);
pack();
setLocationRelativeTo(getOwner());
// JFormDesigner - End of component initialization //GEN-END:initComponents
}
// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
private JPanel wrapperPanel;
private JPanel panelWithTopLeftMatteBorder;
private JPanel panel1;
private JLabel label1;
private JPanel panel2;
private JLabel label2;
private JPanel panel3;
private JLabel label3;
// JFormDesigner - End of variables declaration //GEN-END:variables
}
```
Which looks like this:

|
Swing Draw 1px border lines between components in a GridBagLayout component
|
CC BY-SA 2.5
| null |
2011-04-07T19:33:41.207
|
2017-04-04T06:47:27.140
| null | null | 14,467 |
[
"java",
"swing",
"layout",
"border"
] |
5,586,698 | 1 | 7,344,384 | null | 5 | 408 |
I am wondering if it is possible to have a custom dictionary of suggestions when editing in a certain text field in iOS 4.2
As you can see in the picture below, the default dictionary of suggestions is the english dictionary. What I would like to know is that if it is possible to give it, for example, an array of strings so that the text field would only give out those strings as suggestions.

|
Can one provide a custom source of word suggestions for a UITextField?
|
CC BY-SA 2.5
| null |
2011-04-07T19:45:30.427
|
2011-09-08T07:08:23.577
|
2011-04-07T20:25:09.440
| 335,418 | 675,430 |
[
"ios",
"uitextfield"
] |
5,586,720 | 1 | 5,586,741 | null | 0 | 31 |
I am implementing an eventhandler for ObservableCollection of Product.
I have a NotifyCollectionChangedEventArgs e. e.NewItems[0] returns the first object that has been changed. But this is an object, meaning it is not a Product, the Product is encapsulated in the object somehow, but I am not sure how to extract the Product from this object.
tempPVM is of type "ObjectTypeA" :)
Please refer the following screenshot. :)

|
How to extract an instance of ObjectTypeA encapsulted in an general object? - screenshot attached
|
CC BY-SA 2.5
| null |
2011-04-07T19:47:11.180
|
2011-04-07T19:49:08.657
| null | null | 669,482 |
[
"c#"
] |
5,586,804 | 1 | null | null | 0 | 1,369 |
I have the following problem with my latex document (see the red marked area in the picture). I want to scratch the words like in the green marked area.

I guess that this misbehavior evolves through my style settings.
```
\documentclass[fontsize=12pt,parskip=full,normalheadings,a4paper]{scrartcl}
\usepackage[a4paper,inner=40mm,outer=30mm,top=33mm,bottom=30mm]{geometry}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{times} % font-style
\usepackage{graphicx} % figures
\usepackage[square]{natbib} % for references
\usepackage{csquotes} % quotes
\usepackage{verbatim} % comment-environment
\linespread{1.10} % line distance
\DeclareGraphicsRule{.pdftex}{pdf}{.pdftex}{} % for xfig
\usepackage{tabularx} % tables
\usepackage{srcltx} % forward/reverse search in dvi
\usepackage[perpage,marginal,hang]{footmisc} % make special footnote symbols
\sloppy % prevent overfull boxes
%\usepackage[ngerman]{babel} % damit das Inhaltsverzeichnis auf deutsch ist
%% styling the header and footer
\usepackage[headsepline]{scrpage2} % separation line in the header
\clearscrheadfoot
\automark[subsection]{section}
\lehead[]{\leftmark}
\lohead[]{\rightmark}
\rehead{\pagemark}
\rohead{\pagemark}
\pagestyle{scrheadings}
%% color
\usepackage{color}
\usepackage{xcolor}
\definecolor{darkred}{rgb}{.5,0,0}
\definecolor{darkblue}{rgb}{0,0,.5}
\usepackage[plainpages=false,pdfpagelabels,colorlinks=true,urlcolor=darkblue,pagecolor=darkred,
citecolor=black,linkcolor=black]{hyperref}
%% settings for caption
\usepackage[font=footnotesize,labelfont=bf,textfont=it,singlelinecheck=false,format=hang]{caption}
% counter hack for setting the counter for the listings
\usepackage{chngcntr}
\counterwithin{figure}{section}
\counterwithin{table}{section}
```
If you can, please tell me, which option I have to change in order to get a 'fine word stretching' for the whole document.
As always, thanks for your fast and helpful answers.
Matthias
|
Omit unwanted text stretching in latex documents
|
CC BY-SA 2.5
| null |
2011-04-07T19:54:06.220
|
2011-04-07T20:11:02.957
| null | null | 317,487 |
[
"latex"
] |
5,586,985 | 1 | 5,587,614 | null | 0 | 112 |
i use a picture in two view in my app, the first is in the splash screen and the second in the main view, it's the same picture, same dimensions, the difference is that one called Default.png (splashscreen) and the second called background.png(for the main view), also background.png is changed in opacity but i insist that the dimensions are the same, so when i run the app, it seems not identical, ca you help me please, thx in advance :)


|
[iPhone]the same picture used in different view seems to be not the same
|
CC BY-SA 2.5
| 0 |
2011-04-07T20:08:49.983
|
2011-04-07T21:02:11.793
| null | null | 602,257 |
[
"iphone"
] |
5,587,020 | 1 | null | null | 1 | 1,948 |
I'm trying to position a ribbon image on one of my websites. Unfortunately I can't figure out why it doesn't work as I want it to. I used `position: relative;` and `position: absolute;` to do all the positioning stuff but the problem is that the image is not on top:

I've used to following code:
```
.ribbon { position: relative; }
.ribbon h3 {
background: url("images/ribbon.png") no-repeat scroll 0 0 transparent;
color: #FFFFFF;
font-family: Tahoma,arial,serif;
font-size: 1.4em;
height: 34px;
padding: 7px 0 0 17px;
position: absolute;
right: -36px;
width: 244px;
z-index: 200;
}
```
If you want to take a look at the website you can do it [on this link](http://www.praxis-korbach.de) (user: / pass: ).
It should look like this:

|
CSS: Absolute positioned image - but it's not on top
|
CC BY-SA 4.0
| null |
2011-04-07T20:11:26.127
|
2019-10-02T10:06:57.657
|
2019-10-02T09:53:09.853
| 1,000,551 | 169,217 |
[
"css",
"css-position",
"ribbon"
] |
5,587,045 | 1 | 5,587,102 | null | 2 | 2,952 |
I need to use a part of a image in my canvas. Is there any function to crop a part of a png in android?

|
How to use part of a image in canvas
|
CC BY-SA 2.5
| null |
2011-04-07T20:13:32.197
|
2011-04-07T20:18:31.027
| null | null | 393,639 |
[
"android",
"image",
"canvas",
"bitmap",
"png"
] |
5,587,044 | 1 | 5,587,119 | null | 0 | 875 |
I'm working with geometry in OpenGL and I'm now working with lighting. I'm noticing that if I translate my geometry, the normals don't follow and are thus useless.
How do you apply a tranformation matrix to geometry and maintain the normals?
Currently I'm using the following code:
```
GL.PushMatrix();
if (Offset != null)
{
GL.Translate(Offset.X, Offset.Y, Offset.Z);
}
GL.Begin(BeginMode.Triangles);
foreach (var face in Faces)
{
foreach (var i in face)
{
var point = Points[i - 1];
GL.Normal3(point);
GL.Vertex3(point);
}
}
GL.End();
GL.PopMatrix();
```
When I give the geometry an offset, it doesn't render properly (e.g. the normals don't map correctly.
Any help would be excellent.
p.s., I'm using the OpenTK wrapper, but regular OpenGL translates directly across.
EDIT:
Ok, if I change the above code to the following:
```
GL.PushMatrix();
//if (Offset != null)
//{
// GL.Translate(Offset.X, Offset.Y, Offset.Z);
//}
GL.Begin(BeginMode.Triangles);
foreach (var face in Faces)
{
foreach (var i in face)
{
var point = Points[i - 1];
if (Offset == null)
{
GL.Normal3(point);
GL.Vertex3(point);
}
else
{
var pt = new Vector3d(Offset.X + point.X, Offset.Y + point.Y, Offset.Z + point.Z);
GL.Normal3(pt);
GL.Vertex3(pt);
}
}
}
GL.End();
GL.PopMatrix();
```
everything renders fine.
Here are some screenshots (respective to their code)


|
Matrix Translations with OpenGL Normals
|
CC BY-SA 2.5
| null |
2011-04-07T20:13:26.593
|
2011-04-07T20:48:06.923
|
2011-04-07T20:48:06.923
| 490,326 | 490,326 |
[
"c#",
"opengl",
"graphics",
"opentk",
"normals"
] |
5,587,458 | 1 | 5,587,490 | null | 19 | 137,426 |
That sounds weird I know, but I am having trouble getting a piece of text to move down a tiny bit so it's centered on the tab it's on.
here's what it looks like:

I want buy to be centered vertically.
Here is the html:
```
<div class="row-2">
<ul>
<li><a href="index.html" class="active">Buy</a></li>
</ul>
</div>
```
|
How to move an element down a litte bit in html
|
CC BY-SA 2.5
| 0 |
2011-04-07T20:48:09.683
|
2019-10-16T14:34:48.217
|
2011-04-07T21:02:12.277
| 474,980 | 474,980 |
[
"html",
"css"
] |
5,587,464 | 1 | 5,587,663 | null | 0 | 646 |
even after setting the tr:last-child's border: none, border is still visible. The edit button should be after the last row. But it got position left. [http://jsfiddle.net/priyaa2002/mBfk8/](http://jsfiddle.net/priyaa2002/mBfk8/) Here is how it should be 
|
table last row border visible
|
CC BY-SA 2.5
| null |
2011-04-07T20:48:45.097
|
2011-04-07T21:06:10.703
|
2011-04-07T20:53:45.833
| 629,305 | 629,305 |
[
"html",
"xhtml",
"css"
] |
5,587,690 | 1 | 5,587,822 | null | 2 | 4,461 |
I'm having a problem getting font-face to work correctly. I'm defining it as such:
```
@font-face {
font-family: "creampuff";
src: local("☺"), url(/fonts/CREAMPUF.TTF) format('truetype');
}
```
This works completely fine if this font is installed on the machine (I have 3 machines here, one has the font installed and it works, the other two do not, and it renders a different font.) It only renders incorrectly in Firefox and Chrome, Safari is able to render it just fine:

Both Chome and Firefox render it like this:

However, if I disable the style in Chrome's web inspector (defined as: 'font-family: creampuff;') it definitely has an effect, changing the font to:

I can't really even figure out where to start debugging. I've checked the network tab in Chrome, and it definitely loads the font successfully. Opening the font file shows everything correct, and on my other machine where I have the font installed locally, it functions correctly across all browsers.
Any idea how to go about resolving this?
|
Chrome and Firefox won't render my @font-face, safari will
|
CC BY-SA 2.5
| 0 |
2011-04-07T21:08:33.630
|
2013-04-15T11:53:48.910
| null | null | 548,075 |
[
"css",
"font-face"
] |
5,587,725 | 1 | 5,587,851 | null | 3 | 673 |
I just wanted to create a trend in my activity that would look like the Gingerbread battery one (see picture above)
I am looking deeply in the [Android git](http://android.git.kernel.org/?p=platform/packages/apps/Settings.git;a=blob;f=src/com/android/settings/fuelgauge/PowerUsageSummary.java;h=ea28c595c8bfbcfb229ccf0088465aadef254e39;hb=HEAD) and found what seem to be the correct activity
Unfortunately, I cannot find something related to canvas or drawing and how I can use this code to create my own trend.
If someone could point me where I could find the drawing process or point me another open source sample with a trend activity, would be very helpful.

|
Creating a graph similar to Battery usage in Gingerbread
|
CC BY-SA 3.0
| null |
2011-04-07T21:12:45.187
|
2012-06-04T04:05:14.103
|
2012-06-04T04:05:14.103
| 646,382 | 327,402 |
[
"android",
"graph",
"power-management"
] |
5,588,012 | 1 | 5,594,024 | null | 3 | 3,209 |
I have been 2 days trying to show an OpenGLES view over the camera View preview on the iPhone.
The camera preview alone, works.
The EAGLView(OpenGLES) alone, works.
The problem is when i try to place the EAGLView over the camera preview.
I am able to place both UIViews at the same time, but the camera preview is always over the EAGLView (wrong!). When i set alpha to 0.5 of the camera preview, i can see both UIViews just as i want, but both are blurred (it's normal).
I have tried [self.view bringSubviewToFront:(EAGLView)], but nothing changes.
The EAGLView is on the IB as a class.
The CameraView is added as a subview by code.
Here i put some code, i can upload more if you need it.
Thanks!!!
```
+ (Class)layerClass {
return [CAEAGLLayer class];
}
//The GL view is stored in the nib file. When it's unarchived it's sent -initWithCoder:
- (id)initWithCoder:(NSCoder*)coder {
puntosPintar=(GLfloat*)malloc(sizeof(GLfloat)*8);
puntosPintar[0] = -0.25f;
puntosPintar[1] = -1.22f;
puntosPintar[2] = -0.41f;
puntosPintar[3] = 0.0f;
puntosPintar[4] = 0.35f;
puntosPintar[5] = -1.69f;
puntosPintar[6] = 0.15f;
puntosPintar[7] = 0.0f;
if ((self = [super initWithCoder:coder])) {
// Get the layer
CAEAGLLayer *eaglLayer = (CAEAGLLayer *)self.layer;
eaglLayer.opaque = NO;
eaglLayer.drawableProperties = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithBool:NO], kEAGLDrawablePropertyRetainedBacking, kEAGLColorFormatRGBA8, kEAGLDrawablePropertyColorFormat, nil];
context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1];
if (!context || ![EAGLContext setCurrentContext:context]) {
[self release];
return nil;
}
}
return self;
}
- (void)drawView {
const GLubyte squareColors[] = {
255, 255, 0, 255,
0, 255, 255, 255,
0, 0, 0, 0,
255, 0, 255, 255,
};
[EAGLContext setCurrentContext:context];
glBindFramebufferOES(GL_FRAMEBUFFER_OES, viewFramebuffer);
glViewport(0, 0, backingWidth, backingHeight);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrthof(-1.0f, 1.0f, -1.5f, 1.5f, -1.0f, 1.0f);
glMatrixMode(GL_MODELVIEW);
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glClear(GL_COLOR_BUFFER_BIT);
glVertexPointer(2, GL_FLOAT, 0, puntosPintar);
glEnableClientState(GL_VERTEX_ARRAY);
glColorPointer(4, GL_UNSIGNED_BYTE, 0, squareColors);
glEnableClientState(GL_COLOR_ARRAY);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 8);
glBindRenderbufferOES(GL_RENDERBUFFER_OES, viewRenderbuffer);
[context presentRenderbuffer:GL_RENDERBUFFER_OES];
}
- (void)layoutSubviews {
[EAGLContext setCurrentContext:context];
[self destroyFramebuffer];
[self createFramebuffer];
[self drawView];
}
- (BOOL)createFramebuffer {
glGenFramebuffersOES(1, &viewFramebuffer);
glGenRenderbuffersOES(1, &viewRenderbuffer);
glBindFramebufferOES(GL_FRAMEBUFFER_OES, viewFramebuffer);
glBindRenderbufferOES(GL_RENDERBUFFER_OES, viewRenderbuffer);
[context renderbufferStorage:GL_RENDERBUFFER_OES fromDrawable:(CAEAGLLayer*)self.layer];
glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_RENDERBUFFER_OES, viewRenderbuffer);
glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_WIDTH_OES, &backingWidth);
glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_HEIGHT_OES, &backingHeight);
if (USE_DEPTH_BUFFER) {
glGenRenderbuffersOES(1, &depthRenderbuffer);
glBindRenderbufferOES(GL_RENDERBUFFER_OES, depthRenderbuffer);
glRenderbufferStorageOES(GL_RENDERBUFFER_OES, GL_DEPTH_COMPONENT16_OES, backingWidth, backingHeight);
glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_DEPTH_ATTACHMENT_OES, GL_RENDERBUFFER_OES, depthRenderbuffer);
}
if(glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES) != GL_FRAMEBUFFER_COMPLETE_OES) {
NSLog(@"failed to make complete framebuffer object %x", glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES));
return NO;
}
return YES;
}
```
Load of the view of the Camera
```
[CameraImageHelper startRunning];
UIView *fafa;
fafa= [[UIView alloc]initWithFrame:self.view.bounds]; //returns a UIView with the cameraview as a layer of that view. It works well (checked)
fafa = [CameraImageHelper previewWithBounds:self.view.bounds];
fafa.alpha=0.5; //Only way to show both
[self.view addSubview:fafa];
[self.view bringSubviewToFront:fafa];
```
On the .h i have created
```
IBOutlet EAGLView *openGLVista
```
In the view did load:
```
openGLVista=[[EAGLView alloc]init];
```

```
@interface CameraImageHelper : NSObject <AVCaptureVideoDataOutputSampleBufferDelegate>
{
AVCaptureSession *session;
}
@property (retain) AVCaptureSession *session;
+ (void) startRunning;
+ (void) stopRunning;
+ (UIView *) previewWithBounds: (CGRect) bounds;
@end
```
```
- (void) initialize
{
NSError *error;
AVCaptureDeviceInput *captureInput = [AVCaptureDeviceInput deviceInputWithDevice:[AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo] error:&error];
if (!captureInput)
{
NSLog(@"Error: %@", error);
return;
}
self.session = [[[AVCaptureSession alloc] init] autorelease];
[self.session addInput:captureInput];
}
- (id) init
{
if (self = [super init]) [self initialize];
return self;
}
- (UIView *) previewWithBounds: (CGRect) bounds
{
UIView *view = [[[UIView alloc] initWithFrame:bounds] autorelease];
AVCaptureVideoPreviewLayer *preview = [AVCaptureVideoPreviewLayer layerWithSession: self.session];
preview.frame = bounds;
preview.videoGravity = AVLayerVideoGravityResizeAspectFill;
[view.layer addSublayer: preview];
return view;
}
- (void) dealloc
{
self.session = nil;
[super dealloc];
}
#pragma mark Class Interface
+ (id) sharedInstance // private
{
if(!sharedInstance) sharedInstance = [[self alloc] init];
return sharedInstance;
}
+ (void) startRunning
{
[[[self sharedInstance] session] startRunning];
}
+ (void) stopRunning
{
[[[self sharedInstance] session] stopRunning];
}
+ (UIView *) previewWithBounds: (CGRect) bounds
{
return [[self sharedInstance] previewWithBounds: (CGRect) bounds];
}
@end
```
|
OpenGL + Camera View (iPhone)
|
CC BY-SA 3.0
| 0 |
2011-04-07T21:41:52.010
|
2011-04-08T10:52:38.447
|
2011-04-08T10:42:08.907
| 552,314 | 552,314 |
[
"iphone",
"objective-c",
"xcode",
"uiview",
"opengl-es"
] |
5,588,104 | 1 | 5,593,923 | null | 0 | 344 |
I am taking a look into T4 and scaffolding and I decided to give it a try. So I got the [MvcScaffolding](http://nuget.org/List/Packages/MvcScaffolding) package on NuGet in order to customize a "Create" template in a test project.
After I have done very small changes (added css styles and translated the button texts) I decided to test my template by generating a View with my own "Create" scaffolding template.
Then I got the error bellow. I have checked the references on my project and everything seems there. Any ideas on how to fix this?
I have just realized that some of my VS2010 AddOns were generating this error. Once disabled, it worked but my template wasn't used...

|
4 Errors when trying to use T4 template (View)
|
CC BY-SA 3.0
| null |
2011-04-07T21:52:53.027
|
2013-11-21T21:36:02.760
|
2013-11-21T21:36:02.760
| 297,823 | 296,437 |
[
"visual-studio-2010",
"asp.net-mvc-3",
"visual-studio",
"nuget",
"t4"
] |
5,588,285 | 1 | 5,597,552 | null | 0 | 3,036 |
I would like to parse string value like this :
```
.02234
-.23455
-1.23345
2.
.3
```
but i get an FormatException
```
for (int i = 1; i < 7; i++)
{
var item = Double.Parse(reader.ReadLine(44).Substring(8 * i, 8));
richTextBox1.Text += item.ToString() + "\n";
}
```

the problem that i should convert this numbers like "0.2" or "-.0541" to double or any value type to work with it !!!
|
C# parse value from string
|
CC BY-SA 3.0
| 0 |
2011-04-07T22:11:23.727
|
2016-12-21T21:48:40.917
|
2016-12-21T21:48:40.917
| 1,992,669 | 697,561 |
[
"c#",
"string"
] |
5,588,649 | 1 | null | null | 102 | 64,732 |
I have just seen this within the past few days and cannot figure out how it works. The video I talk about is [here](http://i.min.us/ikq8hS.gif):

It's [the top rated answer](https://stackoverflow.com/questions/5508110/why-is-this-program-erroneously-rejected-by-three-c-compilers/5509538#5509538) from this Stack Overflow question: [Why was this program rejected by three compilers?](https://stackoverflow.com/questions/5508110/why-is-this-program-erroneously-rejected-by-three-c-compilers/5509143)
How is this bitmap able to show a C++ program for "Hello World"?
|
How did this person code "Hello World" with Microsoft Paint?
|
CC BY-SA 3.0
| 0 |
2011-04-07T23:04:49.647
|
2021-06-13T05:10:04.907
|
2017-05-23T11:55:06.673
| -1 | 695,893 |
[
"c++",
"c",
"paint"
] |
5,589,072 | 1 | 5,589,138 | null | 1 | 201 |
In the iPhone Maps application, you get a sort of 'location square' when you tap the disclosure arrow on a dropped pin, like this:

I've seen a few other apps have this. How would I implement this? I haven't found anything specific in MapKit for this.
|
iPhone Maps App 'Location Square'
|
CC BY-SA 3.0
| 0 |
2011-04-08T00:17:30.193
|
2011-04-08T00:52:26.967
| null | null | 219,515 |
[
"iphone",
"cocoa-touch",
"google-maps",
"mapkit"
] |
5,589,223 | 1 | null | null | 1 | 2,838 |
I was introduced to HTML about 10 years ago but barely used it again until about a month ago. It turns out I'm supposed to do everything differently now (or did everything wrong without knowing before), and I'm trying to stick to the standards, but some things are troubling me a lot.
I've been hearing a lot of people bashing the usage of tables for layout for example. I don't really know why (are tables really so bad?), but still I've tried to use divs instead and just can't seem to make them work properly. I have isolated my problems into a quite illustrative one, that involves some things I haven't been able to do with divs (and some that I couldn't even do with tables actually).
Here's the problem:

I've tried many things, and I unfortunately can't even summarize them here cause I don't remember, but here's the code with my attempts to make it work:
```
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<title>Tests</title>
<style type="text/css">
body {height:100%;}
#container
{
overflow: hidden;
width:680px;
padding: 0;
margin-left: auto;
margin-right: auto;
margin-top: 40px;
border: 1px solid red;
}
#column_left
{
float: left;
width: 25%;
height: 100%;
margin: 0;
text-align: right;
border: 1px solid black;
}
#column_middle
{
float: left;
width: 49.2%;/*59.601562%*/
height: 100%;
margin: 0;
text-align: center;
border: 1px solid black;
}
#column_right
{
float: left;
width: 25%;
height: 100%;
margin: 0;
border: 1px solid black;
}
.pad
{
margin: 10px;
padding: 2px;
border: 1px solid black;
}
</style>
</head>
<body style="margin:0;">
<div id="container">
<div id="column_left">
<div class="pad">
Left Column Top<br/>
<br/>
Div only as long as content.<br/>
</div>
<div class="pad">
Left Column Bottom<br/><br/>
I want this DIV to stretch all the way down to the bottom of the container regardless of the lenght of the content.
</div>
</div>
<div id="column_middle">
<div class="pad">
<p>Long Middle Content</p>
<p>Long Middle Content</p>
<p>Long Middle Content</p>
<p>Long Middle Content</p>
<p>Long Middle Content</p>
<p>Long Middle Content</p>
<p>Long Middle Content</p>
<p>Long Middle Content</p>
<p>Long Middle Content</p>
</div>
</div>
<div id="column_right">
<div class="pad">
Right content<br/><br/>
I want this DIV to stretch all the way down to the bottom of the container regardless of the lenght of the content.
</div>
</div>
</div>
</body>
</html>
```
Besides the main question, if you pay attention to the width of the middle column, it's not 50. I tried 50% at first, of course, to sum up 100%, but for some crazy reason everything is messed up:

Anybody knows why?
Another thing I can't do with tables and don't even know if it's possible at all: I wanted the whole layout to be symmetrical. That is, I would like the longer side-content to determine the width of its div, and also of the other div, while the middle div stretches to fit 100% of the page. Anybody knows if it's possible? Not sure if I'd really use it in my final layout, but it's puzzling me.
Sorry if the question is stupid and turns out to be easy to solve. Like I said, I'm new to proper html/css. Any help is appreciated.
|
How to change layout from table to divs with proper widths and heights?
|
CC BY-SA 3.0
| null |
2011-04-08T00:43:53.167
|
2017-01-02T22:13:08.483
|
2017-01-02T22:13:08.483
| 4,370,109 | 686,617 |
[
"html",
"layout",
"width",
"css-tables"
] |
5,589,254 | 1 | 5,589,359 | null | 0 | 310 |
I want to create an item (a link) that will have inner shadows on both sides (left and right) and the rest of the item will be transparent.
It should look something like this:

The point is I don't know how wide my link will be so I need something like:
```
background: url(left-shadow) left center;
background: url(right-shadow) right center;
```
But for one element. Any ideas how to achieve that?
You guys are totally right about multiple backgrounds, but they're not supported even in IE8:
[http://www.quirksmode.org/css/multiple_backgrounds.html](http://www.quirksmode.org/css/multiple_backgrounds.html)
So maybe something else? I forgot to mention that I want my solution to be working at least in IE8 (and would be perfect to see it working in IE7 also).
|
CSS - advanced item background
|
CC BY-SA 3.0
| 0 |
2011-04-08T00:49:25.567
|
2011-04-08T16:58:17.340
|
2011-04-08T00:56:38.410
| 683,068 | 683,068 |
[
"css",
"background",
"background-image"
] |
5,589,260 | 1 | null | null | 0 | 1,853 |

So, how do i delete this? I acidentially wrote about 1,500 blank records with prefix null and code = 0
I tried this query and it does nothing:
```
DELETE FROM Course where prefix IS NULL and code = 0;
```
The feedback I get is 0 results were deleted.
Anyone?
|
Delete Fields Where a Null Value Appeard
|
CC BY-SA 3.0
| null |
2011-04-08T00:50:25.130
|
2011-04-08T00:53:49.983
| null | null | 700,070 |
[
"mysql",
"sql"
] |
5,589,396 | 1 | 5,589,404 | null | 4 | 26,901 |
I am following example commands from other sites but it isn't helping!
What am I doing wrong?
```
chmod +x jdk-6u24-linux-i586-rpm.bin
./jdk-6u24-linux-i586-rpm.bin
```
Results give me:
```
bash: ./jdk-6u24-linux-i586-rpm.bin: /bin/sh: bad interpreter: Permission denied
```
Ok.. after doing
```
sh jdk-6u24-linux-i586-rpm.bin
```
as suggested below, I get this:

Did the install fail? Is the file corrupted??? Thanks!!
|
How to install java jdk in RHEL?
|
CC BY-SA 3.0
| 0 |
2011-04-08T01:15:18.000
|
2012-01-11T23:02:53.423
|
2011-04-08T01:23:07.243
| 556,282 | 556,282 |
[
"linux",
"java",
"redhat"
] |
5,589,544 | 1 | 5,591,092 | null | 0 | 813 |
I'm having a very strange problem with XNA/OpenGL on Windows Phone 7. I'm drawing a sphere using the following code:
```
if (Radius < 0f)
Radius = -Radius;
if (Radius == 0f)
throw new DivideByZeroException("DrawSphere: Radius cannot be 0f.");
if (Precision == 0)
throw new DivideByZeroException("DrawSphere: Precision of 8 or greater is required.");
const float HalfPI = (float)(Math.PI * 0.5);
float OneThroughPrecision = 1.0f / Precision;
float TwoPIThroughPrecision = (float)(Math.PI * 2.0 * OneThroughPrecision);
float theta1, theta2, theta3;
Vector3 Normal = new Vector3(0,0,0), Position = new Vector3();
for (uint j = 0; j < Precision / 2; j++)
{
theta1 = (j * TwoPIThroughPrecision) - HalfPI;
theta2 = ((j + 1) * TwoPIThroughPrecision) - HalfPI;
GL.Begin(BeginMode.TriangleStrip);
for (uint i = 0; i <= Precision; i++)
{
theta3 = i * TwoPIThroughPrecision;
Normal.X = (float)(Math.Cos(theta2) * Math.Cos(theta3));
Normal.Y = (float)Math.Sin(theta2);
Normal.Z = (float)(Math.Cos(theta2) * Math.Sin(theta3));
Position.X = Center.X + Radius * Normal.X;
Position.Y = Center.Y + Radius * Normal.Y;
Position.Z = Center.Z + Radius * Normal.Z;
GL.Normal3(Normal);
GL.TexCoord2(i * OneThroughPrecision, 2.0f * (j + 1) * OneThroughPrecision);
GL.Vertex3(Position);
Normal.X = (float)(Math.Cos(theta1) * Math.Cos(theta3));
Normal.Y = (float)Math.Sin(theta1);
Normal.Z = (float)(Math.Cos(theta1) * Math.Sin(theta3));
Position.X = Center.X + Radius * Normal.X;
Position.Y = Center.Y + Radius * Normal.Y;
Position.Z = Center.Z + Radius * Normal.Z;
GL.Normal3(Normal);
GL.TexCoord2(i * OneThroughPrecision, 2.0f * j * OneThroughPrecision);
GL.Vertex3(Position);
}
GL.End();
}
```
The sphere ends up looking like this (on BOTH the emulator AND the device (HTC HD7):

Any suggestions?
|
WP7 XNA - Only drawing half of my sphere model
|
CC BY-SA 3.0
| null |
2011-04-08T01:42:37.270
|
2011-04-08T06:03:56.900
| null | null | 435,224 |
[
"c#",
"opengl",
"windows-phone-7",
"3d"
] |
5,589,714 | 1 | 13,232,008 | null | 7 | 1,113 |
Please see the picture. After pressing the fullscreen button, the `webview` maximizes the `UIPopover`.

I tried to look out for `MPMoviePlayerDidEnterFullscreenNotification`, no luck.
I really don't want to ship my own `UIPopoverController` but this is my only `"solution"` at the moment. Using anything other than `UIWebView` is also not an option, as I am displaying YouTube-Movies.
I use a `UIWebView`, so there is no way to access the views/classes that are used internally.
|
Howto hide UIPopoverController when UIWebView plays a fullscreen youtube movie?
|
CC BY-SA 3.0
| 0 |
2011-04-08T02:17:38.427
|
2013-02-04T23:43:27.167
|
2013-02-04T23:43:27.167
| 1,730,272 | 83,160 |
[
"ios",
"uiwebview",
"youtube"
] |
5,589,945 | 1 | 5,590,686 | null | 3 | 1,505 |
I have some concurrent code which has an intermittent failure and I've reduced the problem down to two cases which seem identical, but where one fails and the other doesn't.
I've now spent way too much time trying to create a minimal, complete example that fails, but without success, so I'm just posting the lines that fail in case anyone can see an obvious problem.
```
Object lock = new Object();
struct MyValueType { readonly public int i1, i2; };
class Node { public MyValueType x; public int y; public Node z; };
volatile Node[] m_rg = new Node[300];
unsafe void Foo()
{
Node[] temp;
while (true)
{
temp = m_rg;
/* ... */
Monitor.Enter(lock);
if (temp == m_rg)
break;
Monitor.Exit(lock);
}
#if OK // this works:
Node cur = temp[33];
fixed (MyValueType* pe = &cur.x)
*(long*)pe = *(long*)&e;
#else // this reliably causes random corruption:
fixed (MyValueType* pe = &temp[33].x)
*(long*)pe = *(long*)&e;
#endif
Monitor.Exit(lock);
}
```
I have studied the IL code and it looks like what's happening is that the Node object at array position 33 is moving (in very rare cases) despite the fact that we are holding a pointer to a value type within it.
It's as if the CLR doesn't notice that we are passing a heap (movable) object--the array element--in order to access the value type. The 'OK' version has never failed under extended testing on an 8-way machine, but the alternate path fails quickly every time.
- - -
[edit: jitted asm]
Thanks to Hans' reply, I understand better why the jitter is placing things on the stack in what otherwise seem like vacuous asm operations. See [rsp + 50h] for example, and how it gets nulled out after the 'fixed' region. The remaining unresolved question is whether [cur+18h] (lines 207-20C) on the stack is somehow sufficient to protect the access to the value type in a way that is adequate for [temp+33*IntPtr.Size+18h] (line 24A).

[edit]
### summary of conclusions, minimal example
Comparing the two code fragments below, I now believe that #1 is not ok, whereas #2 is acceptable.
(1.) The following (on x64 jit at least); GC can still move the instance if you try to fix it , via an array reference. There's no place on the stack for the reference of the particular object instance (the array element that needs to be fixed) to be published, for the GC to notice.
```
struct MyValueType { public int foo; };
class MyClass { public MyValueType mvt; };
MyClass[] rgo = new MyClass[2000];
fixed (MyValueType* pvt = &rgo[1234].mvt)
*(int*)pvt = 1234;
```
(2.) But you access a structure inside a (movable) object using (without pinning) if you provide an explicit reference on the stack which can be advertised to the GC:
```
struct MyValueType { public int foo; };
class MyClass { public MyValueType mvt; };
MyClass[] rgo = new MyClass[2000];
MyClass mc = &rgo[1234]; // <-- only difference -- add this line
fixed (MyValueType* pvt = &mc.mvt) // <-- and adjust accordingly here
*(int*)pvt = 1234;
```
This is where I'll leave it unless someone can provide corrections or more information...
|
.NET C# unsafe/fixed doesn't pin passthrough array element?
|
CC BY-SA 4.0
| 0 |
2011-04-08T02:59:11.487
|
2018-08-01T01:14:46.163
|
2018-08-01T01:14:46.163
| 147,511 | 147,511 |
[
"c#",
"arrays",
"unsafe",
"value-type"
] |
5,590,476 | 1 | 5,590,594 | null | 0 | 311 |
I'm trying to have the layout of the comments on a progam in the following form:

I want the USER_NAME in Bold, and the DATE in Enphasis (The red part should be normal, I don't want it red). My problem comes with the red part. I cant get the cooment to be displayed like this using layouts, I've been able to get:
 and 
Is there any way to get the comment working like the one I'm showing. I've thought about a multi formatted textView, is it posible??
If getting the comment like this is not possible, just say it's imposible.
|
Multi Formatted TextView
|
CC BY-SA 3.0
| null |
2011-04-08T04:35:00.413
|
2011-04-27T20:07:20.917
| null | null | 652,392 |
[
"android",
"android-layout"
] |
5,590,669 | 1 | 5,648,994 | null | 4 | 1,452 |
I see that the designer generated UI classes be embedded using any of the following methods in Qt,
1. Aggregation as a pointer member
2. Aggregation
3. Multiple, Private inheritance

but it is said that the second method doesn't support custom slots. Can someone elaborate on this? Why can't we implement custom slots, while using aggregation?
Also, elaborate on the advantages and disadvantages in each of the methods.
|
Why is that the designer generated UI classes embedded as "Aggregation" can't implement custom slots?
|
CC BY-SA 3.0
| 0 |
2011-04-08T05:03:50.627
|
2018-11-30T15:11:42.710
|
2011-04-08T05:10:30.363
| 248,643 | 248,643 |
[
"c++",
"oop",
"qt",
"qt-creator",
"qt-designer"
] |
5,590,671 | 1 | 5,600,431 | null | 1 | 768 |

|
Android,SAX parser Problem while reading Html Tags
|
CC BY-SA 3.0
| null |
2011-04-08T05:04:09.030
|
2012-02-04T10:08:10.087
| null | null | 318,403 |
[
"android",
"android-emulator"
] |
5,590,705 | 1 | 5,590,775 | null | 0 | 167 |
I am using custom background for my Tab layout, but it displaying something different. As

but I want as

and my code is as
```
for(int i = 0; i < tabHost.getTabWidget().getChildCount(); i++) {
tabHost.getTabWidget().getChildAt(i).setBackgroundColor(Color.parseColor("#0079AD"));
((TextView) tabHost.getTabWidget().getChildAt(i).findViewById(android.R.id.title)).setTextColor(Color.parseColor("#8CD7F2"));
}
tabHost.getTabWidget().getChildAt(tabHost.getCurrentTab()).setBackgroundColor(Color.parseColor("#009ED6"));
```
how can I solve this?
|
Tab layout not displaying as I want
|
CC BY-SA 3.0
| null |
2011-04-08T05:09:52.430
|
2011-04-08T06:38:32.297
| null | null | 550,966 |
[
"android",
"android-tabhost"
] |
5,590,778 | 1 | 5,590,851 | null | 40 | 156,158 |
I have a jQuery datatable(outlined in red), but what happens is that the table jumps out of the width I have set for the div(which is 650 px).
Here is the screen shot:

Here is my code:
```
<script type="text/javascript">
var ratesandcharges1;
$(document).ready(function() {
/* Init the table*/
$("#ratesandcharges1").dataTable({
"bRetrieve": false,
"bFilter": false,
"bSortClasses": false,
"bLengthChange": false,
"bPaginate": false,
"bInfo": false,
"bJQueryUI": true,
"bAutoWidth": false,
"aaSorting": [[2, "desc"]],
"aoColumns": [
{ sWidth: '9%' },
{ sWidth: '9%' },
{ sWidth: '9%' },
{ sWidth: '9%' },
{ sWidth: '9%' },
{ sWidth: '9%' },
{ sWidth: '9%' },
{ sWidth: '9%' },
{ sWidth: '9%' },
{ sWidth: '9%' },
{ sWidth: '10%' } ]
});
ratesandcharges1.fnDraw();
});
</script>
<div id="ratesandcharges1Div" style="width: 650px;">
<table id="ratesandcharges1" class="grid" >
<thead>
<!--Header row-->
<tr>
<th>Charge Code</th>
<th>Rates</th>
<th>Quantity</th>
<th>Total Charge</th>
<th>VAT %</th>
<th>Calc. Type</th>
<th>Paid By</th>
<th>From</th>
<th>To</th>
<th>VAT</th>
<th>MVGB</th>
</tr>
</thead>
<!--Data row-->
<tbody>
<tr>
<td>Day/Tag</td>
<td>55.00</td>
<td>3.00</td>
<td>165.00</td>
<td>20.00</td>
<td>Rental Time</td>
<td>Bill-to/Agent</td>
<td>5/11/2010</td>
<td>08/11/2010</td>
<td>33.00</td>
<td>1.98</td>
</tr>
<tr>
<td>PAI</td>
<td>7.50</td>
<td>3.00</td>
<td>22.50</td>
<td>20.00</td>
<td>Rental Time</td>
<td>Driver/Cust.</td>
<td>5/11/2010</td>
<td>08/11/2010</td>
<td>4.50</td>
<td>0.00</td>
</tr>
<tr>
<td>BCDW</td>
<td>15.00</td>
<td>3.00</td>
<td>45.00</td>
<td>20.00</td>
<td>Rental Time</td>
<td>Driver/Cust.</td>
<td>5/11/2010</td>
<td>08/11/2010</td>
<td>9.00</td>
<td>0.54</td>
</tr>
<tr>
<td>BTP</td>
<td>7.15</td>
<td>3.00</td>
<td>21.45</td>
<td>20.00</td>
<td>Rental Time</td>
<td>Driver/Cust.</td>
<td>5/11/2010</td>
<td>08/11/2010</td>
<td>4.29</td>
<td>0.26</td>
</tr>
</tbody>
</table>
</div>
```
Any ideas ?
Thanks
|
How to set column widths to a jQuery datatable?
|
CC BY-SA 3.0
| 0 |
2011-04-08T05:21:43.393
|
2022-09-08T17:19:13.803
|
2020-06-20T09:12:55.060
| -1 | 350,648 |
[
"jquery",
"jquery-ui",
"datatables"
] |
5,590,896 | 1 | 5,630,641 | null | 5 | 782 |
When I open up a script without a database connection Visual Studio puts this stupid message in the tab text of "Not Connected"

It takes up half the space on a tab, often sacrificing meaningful parts of the name to display information I don't care about. There's a status bar that says disconnected, that's all I need.
In Options > Database Tools > Transact-SQL Editor, under tab text there's options to remove database name, login name and server name but none seem to remove this message.
Does anyone know how to remove it?
Thanks,
Chris.
|
Remove "Not Connected" suffix from visual studio tabs
|
CC BY-SA 3.0
| 0 |
2011-04-08T05:41:05.710
|
2011-04-12T05:06:19.893
| null | null | 96,822 |
[
"visual-studio",
"visual-studio-2010"
] |
5,591,290 | 1 | 5,591,402 | null | 5 | 7,437 |
I use WPF C# Visual Studio and SQL Compact 3.5. On server explorer, I right click and select "Edit Table Schema", I can only change the data type, length,..etc but I cannot click into the Column Name to change the column name. How to change the column name in Server Explorer?

|
How to edit column name in Visual Studio's SQL Compact?
|
CC BY-SA 3.0
| 0 |
2011-04-08T06:28:58.663
|
2019-03-01T12:10:00.310
| null | null | 529,310 |
[
"c#",
"wpf",
"sql-server-ce"
] |
5,591,393 | 1 | 5,595,032 | null | 0 | 315 |
I have to develop an Android application in that when I click the button in the map view, the view should shrinks to a particular width and should align to the right side. But when I click the button, the width of the mapview is reducing but it is left aligning. I tried a lot to align it to left side, but I couldn’t do it. Any idea plz. The figures are attached.

|
Change the width of the layout and align to the right side while clicking the button
|
CC BY-SA 3.0
| null |
2011-04-08T06:41:44.710
|
2011-04-08T12:28:16.417
| null | null | 536,091 |
[
"android"
] |
5,591,731 | 1 | 5,591,935 | null | 1 | 195 |
I have a PCL file and open it with Notepad ++ to view the source code (with PCL Viewer I see the final results but I need to view the source also).

Please see Lab Number and the rest of the characters. to extract Lab Number and its code with this regex:
```
private static String PATTERN_LABNUMBER = "Lab Number[\\W\\D]*(\\d*)";
```
and it gives me:
```
0092616281
```
I now want to extract Date Reported and I use this regex (after a lot of other tries):
```
private static String PATTERN_DATE_REPORTED =
"Date Reported[\\W\\D]*(\\d\\d/\\d\\d/\\d\\d\\d\\d \\d\\d:\\d\\d)";
```
but it does NOT find it in the PCL file.
I've also tried with:
```
private static String PATTERN_DATE_REPORTED =
"Date Reported[\\W\\D]*([0-9]{2}/[0-9]{2}/[0-9]{4} [0-9]{2}:[0-9]{2})";
```
but the same not found result...
Do you see where I am missing something in this last regex?
Thanks a lot!
:
I use this java code to extract Lab number and Date Reported:
```
public String extractWithRegEx(String regextype, String input) {
String matchedString = null;
if (regextype != null && input != null) {
Matcher matcher = Pattern.compile(regextype).matcher(input);
if (matcher.find()) {
System.out.println("Matcher found for regextype "+regextype);
matchedString = matcher.group(0);
if (matcher.groupCount() > 0) {
matchedString = matcher.group(1);
}
}
}
return matchedString;
}
```
|
Why does this regex fail?
|
CC BY-SA 3.0
| null |
2011-04-08T07:15:13.963
|
2011-04-08T07:56:20.800
|
2011-04-08T07:56:20.800
| 301,832 | 174,349 |
[
"java",
"regex"
] |
5,591,792 | 1 | 5,591,897 | null | 64 | 67,594 |
I want to have a keyboard which has a Next,Previous and Done button on top of it.
I have seen that in many apps.
Especially where there are forms to be filled.

I want to achieve something similar to above keyboard
How can I get that?
|
How to get keyboard with Next, Previous and Done Button?
|
CC BY-SA 3.0
| 0 |
2011-04-08T07:20:43.100
|
2019-07-11T16:57:47.007
| null | null | 463,857 |
[
"iphone",
"cocoa-touch",
"ios4",
"iphone-keypad"
] |
5,591,808 | 1 | 5,591,982 | null | 0 | 1,156 |
I want rounded corners for my . So I just set the background to transparent but this removes the whole background of the cell.
Any idea how to do that using the visual editor?

|
How to format table cell to have rounded corners?
|
CC BY-SA 3.0
| 0 |
2011-04-08T07:21:38.220
|
2011-04-08T07:39:42.127
|
2011-04-08T07:36:43.910
| 401,025 | 401,025 |
[
"xcode",
"uitableview",
"xcode4"
] |
5,591,863 | 1 | 5,592,072 | null | 1 | 620 |
I want to show the rounded image on the left and right menu. You can see the example [here](http://jsfiddle.net/9DENH/). The background image is:

```
<ul>
<li><a class="current" href="">Home</a></li>
<li><a href="">Faq</a></li>
<li><a href="">About</a></li>
</ul>
```
Let me know the trick on CSS to achieve my goal without cutting the current image.
---
The result should be like this

---
[Here](http://jsfiddle.net/9DENH/6/) is the final result using `sliding doors technique`
|
How do I fix my CSS menu with rounded image background
|
CC BY-SA 3.0
| null |
2011-04-08T07:28:21.220
|
2011-04-08T17:41:41.237
|
2011-04-08T08:47:23.953
| 106,111 | 106,111 |
[
"html",
"css"
] |
5,591,872 | 1 | 5,591,957 | null | 0 | 1,085 |
I just wanted to develop location based app which is using GPS. So i just surfing on the internet and i found spherical law of cosines for calculating the latitude and longitude. But while i tried to copy this function, i was stuck with some errors. seem android doesn't support sqlite3_context. so how could i fix it out ?

|
distance function for android
|
CC BY-SA 3.0
| null |
2011-04-08T07:29:12.667
|
2011-05-25T02:45:05.950
|
2011-05-25T02:45:05.950
| 135,152 | 405,219 |
[
"android",
"sqlite"
] |
5,592,090 | 1 | 5,600,764 | null | 3 | 919 |
is it possible to display by using google's api (or any other api) for as3 ?

reference: [http://code.google.com/intl/en-US/apis/youtube/flash_api_reference.html#Retrieving_video_information](http://code.google.com/intl/en-US/apis/youtube/flash_api_reference.html#Retrieving_video_information)
|
as3: youtube api / possible to add youtube's "like-button" (rating)?
|
CC BY-SA 3.0
| null |
2011-04-08T07:50:18.390
|
2014-09-19T09:49:34.633
|
2011-04-08T08:41:33.497
| 365,265 | 365,265 |
[
"flash",
"apache-flex",
"actionscript-3",
"air",
"adobe"
] |
5,592,592 | 1 | 5,592,901 | null | -1 | 175 |
i have a view and i want when i change the orientation this view a slideshow appear
how is called this function and how to do this kind of thing...?

|
haw to create slideshow 3d
|
CC BY-SA 3.0
| null |
2011-04-08T08:40:05.580
|
2011-04-08T09:07:10.467
|
2011-04-08T08:53:51.090
| 673,352 | 673,352 |
[
"iphone",
"objective-c"
] |
5,592,956 | 1 | 5,594,717 | null | 0 | 482 |
I have on my page a grid where I show log history and a refresh button ( onclick I refresh the grid with new data ).
```
<div dojoType="dijit.layout.ContentPane" title="Log history">
<button dojoType="dijit.form.Button" id="btn_refresh" onclick="load_logs" style="float:right; border:1px solid black;">Refresh</button>
<div dojoType="dojo.data.ItemFileReadStore" jsId="log" data="window.store_data_log"> </div>
<div id="grid_log" dojoType="dojox.grid.DataGrid" store="log" structure="window.layout_log" queryOptions="{deep:true}" query="{}" clientSort="true" rowsPerPage="5"> </div>
</div>
```
Before 
After 
Problem is that when I click, in Chrome, my refresh button moves up and become half visible. I tried to put `<BR/>` after the button but then grid is then not visible at all. I tried to put the button in a new but also then grid is not visible at all. What to do ?
|
When I click on refresh it becomes half visible
|
CC BY-SA 3.0
| 0 |
2011-04-08T09:12:54.293
|
2011-04-08T12:21:25.737
|
2011-04-08T12:21:25.737
| 669,044 | 486,578 |
[
"html",
"css",
"dojo"
] |
5,593,052 | 1 | 5,593,233 | null | 0 | 142 |
I'm working on App with coreData and i get an error that i can't understand: In a custom init whether i define NSFetchedResultController with "self.controller = new_controller" all works correctly, if i define only "controller = new_controller" (without self), error "The NSManagedObject has been invalidated" occur after 2 loops for the situation described in this image:

Application parts interested in this error is here described:
- . Where
sections describe Month (like April
2011) and the unique Row for any
section present data (that are sum
from transactions happened during the
month).- , this table presents
detail for every weeks for selected month. Here section title has format "week beginning - week end", and the unique row for the section is a sum of transactions for the week.- A is passed via a custom init method (check the code)- every data for these tables are managed with
.
Here the code for selection on first Table (MonthListVC)
```
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
id <NSFetchedResultsSectionInfo> sectionInfo = [[self.controller sections] objectAtIndex:indexPath.section];
// get the first object for this section and get its date.
NSDate *datepoint = [[[sectionInfo objects]objectAtIndex:0] date];
//Create next Controller and push it into Navigation
WeeksTVC *weeksTVC = (WeeksTVC*)[[WeeksTVC alloc] initWithContext:self.context datepoint:datepoint withTitle: [sectionInfo name] ];
[self.navigationController pushViewController:weeksTVC animated:YES];
[weeksTVC release];
}
```
And here the code for WeeksTVC custom init method, where i define "self.controller = ..." and where i get the problem whether i write only "controller = ...".
"controller" is a synthesized property.
```
-(WeeksTVC *)initWithContext:(NSManagedObjectContext *)n_context datepoint:(NSDate*)n_datePoint withTitle:(NSString*) stringTitle{
self = [self init];
if(self !=nil){
self.title = [NSString stringWithFormat:@"History (%@)",stringTitle];
//Back button setup
UIBarButtonItem *barButton = [[UIBarButtonItem alloc] init];
barButton.title = @"Back";
self.navigationItem.backBarButtonItem = barButton;
//datePoint = n_datePoint;
self.context = n_context;
//Get Begin and End week information for this datePoint
NSDate *startDay = [[CommonHelper weekInfoFromData:[CommonHelper firstDayOfMonthForDate:n_datePoint]] objectForKey:@"begin"];
NSDate *endDay = [[CommonHelper weekInfoFromData:[CommonHelper lastDayOfMonthForDate:n_datePoint]] objectForKey:@"end"];
//Manage Request
NSFetchRequest *request = [[NSFetchRequest alloc]init];
request.entity = [NSEntityDescription entityForName:@"Transactions" inManagedObjectContext:self.context];
request.predicate = [NSPredicate predicateWithFormat:@"(date >= %@) && (date <= %@)",startDay,endDay];
NSSortDescriptor *sort = [NSSortDescriptor sortDescriptorWithKey:@"date" ascending:NO];
NSArray *sortDescs = [NSArray arrayWithObjects:sort,nil];
request.sortDescriptors = sortDescs;
"HERE THE PROBLEM WITH SELF***********************************************"
//Manage NSResultFetchedController
self.controller = [[NSFetchedResultsController alloc] initWithFetchRequest:request managedObjectContext:self.context sectionNameKeyPath:@"byWeek" cacheName:nil];
self.controller.delegate = self;
NSError *error = nil;
//Fetch
[self.controller performFetch:&error];
"END OF PROBLEM***********************************************************"
[request release];
[barButton release];
}
return self;
}
```
I report also dealloc method for WeeksTVC, i found that if i don't release context and controller in this method... no error occur also if i write in init method "controller = " and not "self.controller = "
```
- (void)dealloc {
//[self.datePoint release];
[self.controller release];
[self.context release];
[super dealloc];
}
```
Why self.controller and controller are so different in this case ???
In init method i ever write ivar without self -.-'
|
Accessing property without self.propertyname cause errors
|
CC BY-SA 3.0
| null |
2011-04-08T09:20:40.113
|
2011-04-08T09:37:10.900
| null | null | 499,990 |
[
"objective-c",
"ios"
] |
5,593,286 | 1 | 5,593,597 | null | 0 | 501 |
I need a Dashcode widget to display basic HTML like
```
<img src="http://i.stack.imgur.com/AiQJ6.png"><i><b> 5 bronze badges</b></i></img>
```
Result: 
It should be something like a text label, but modifiable by JS code.
|
Dashcode widget for displaying HTML
|
CC BY-SA 3.0
| null |
2011-04-08T09:42:31.197
|
2012-01-24T17:09:49.113
|
2012-01-24T17:09:49.113
| 225,037 | 587,532 |
[
"javascript",
"html",
"widget",
"dashcode"
] |
5,593,372 | 1 | 5,621,895 | null | 2 | 17,649 |
I have a combobox, and a button, that makes runs a query with the values it gets from combobox, but it does not seem to get the right value.

I tried using
```
[Forms]![Kooli otsing]![Combobox]
```
or
```
[Forms]![Kooli otsing]![Combobox].[Text]
```
the query did not work, it seems like it does not get the value from combobox. because it worked with normal TextBox.
I ADDED EXPLAINING PICTURE!!!!!

ADDED PICTURE OF VBA EDITOR

ADDED PICTURE OF ERROR AND NO COMMENT AUTOCOMPLETE


|
Access combobox value
|
CC BY-SA 3.0
| null |
2011-04-08T09:52:29.420
|
2014-08-10T20:55:12.230
|
2012-03-20T15:01:39.783
| 3,043 | 625,189 |
[
"ms-access",
"vba"
] |
5,593,340 | 1 | 5,593,424 | null | 2 | 6,818 |
I'm having a JSON file which is populated to a listview.First, I'm wondering how to make my list view is clickable and lead to another activity.
The second, I wanna make the list view dynamic. That means, I only need one Activity for the click action on the list I have. And the source of the content (picture,title,description) which is populated to the Activity comes from a JSON file on the web.
For example, I have 13 projects on the list, whenever I click to one of them it goes to ONE activity containing different picture,title,and description depends on the item I click.
I need somebody to improve the codes I provide below.
```
public class Projects {
public String title;
public String keyword;
public String description;
public String smallImageUrl;
public String bigImageUrl;
public int cost;
@Override
public String toString()
{
return "Title: "+title+ " Keyword: "+keyword+ " Image: "+smallImageUrl;
}
}
```
```
Public class ProjectsAdapter extends ArrayAdapter<Projects> {
int resource;
String response;
Context context;
//Initialize adapter
public ProjectsAdapter(Context context, int resource, List<Projects> items) {
super(context, resource, items);
this.resource=resource;
}
@Override
public View getView(int position, View convertView, ViewGroup parent)
{
LinearLayout projectView;
//Get the current alert object
Projects pro = getItem(position);
//Inflate the view
if(convertView==null)
{
projectView = new LinearLayout(getContext());
String inflater = Context.LAYOUT_INFLATER_SERVICE;
LayoutInflater vi;
vi = (LayoutInflater)getContext().getSystemService(inflater);
vi.inflate(resource, projectView, true);
}
else
{
projectView = (LinearLayout) convertView;
}
TextView Title =(TextView)projectView.findViewById(R.id.title);
try {
ImageView i = (ImageView)projectView.findViewById(R.id.image);
Bitmap bitmap = BitmapFactory.decodeStream((InputStream)new URL(pro.smallImageUrl).getContent());
i.setImageBitmap(bitmap);
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
//Assign the appropriate data from our alert object above
//Image.setImageDrawable(pro.smallImageUrl);
Title.setText(pro.title);
return projectView;
}
}
```
```
public class Main extends Activity {
/** Called when the activity is first created. */
//ListView that will hold our items references back to main.xml
ListView lstTest;
//Array Adapter that will hold our ArrayList and display the items on the ListView
ProjectsAdapter arrayAdapter;
//List that will host our items and allow us to modify that array adapter
ArrayList<Projects> prjcts=null;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
//Initialize ListView
lstTest= (ListView)findViewById(R.id.lstText);
//Initialize our ArrayList
prjcts = new ArrayList<Projects>();
//Initialize our array adapter notice how it references the listitems.xml layout
arrayAdapter = new ProjectsAdapter(Main.this, R.layout.listitems,prjcts);
//Set the above adapter as the adapter of choice for our list
lstTest.setAdapter(arrayAdapter);
//Instantiate the Web Service Class with he URL of the web service not that you must pass
WebService webService = new WebService("http://pre.spendino.de/test/android/projects.json");
//Pass the parameters if needed , if not then pass dummy one as follows
Map<String, String> params = new HashMap<String, String>();
params.put("var", "");
//Get JSON response from server the "" are where the method name would normally go if needed example
// webService.webGet("getMoreAllerts", params);
String response = webService.webGet("", params);
try
{
//Parse Response into our object
Type collectionType = new TypeToken<ArrayList<Projects>>(){}.getType();
//JSON expects an list so can't use our ArrayList from the lstart
List<Projects> lst= new Gson().fromJson(response, collectionType);
//Now that we have that list lets add it to the ArrayList which will hold our items.
for(Projects l : lst)
{
prjcts.add(l);
}
//Since we've modified the arrayList we now need to notify the adapter that
//its data has changed so that it updates the UI
arrayAdapter.notifyDataSetChanged();
}
catch(Exception e)
{
Log.d("Error: ", e.getMessage());
}
}
}
```
(I don't think we need to edit this one)
```
public class WebService{
DefaultHttpClient httpClient;
HttpContext localContext;
private String ret;
HttpResponse response1 = null;
HttpPost httpPost = null;
HttpGet httpGet = null;
String webServiceUrl;
//The serviceName should be the name of the Service you are going to be using.
public WebService(String serviceName){
HttpParams myParams = new BasicHttpParams();
HttpConnectionParams.setConnectionTimeout(myParams, 10000);
HttpConnectionParams.setSoTimeout(myParams, 10000);
httpClient = new DefaultHttpClient(myParams);
localContext = new BasicHttpContext();
webServiceUrl = serviceName;
}
//Use this method to do a HttpPost\WebInvoke on a Web Service
public String webInvoke(String methodName, Map<String, Object> params) {
JSONObject jsonObject = new JSONObject();
for (Map.Entry<String, Object> param : params.entrySet()){
try {
jsonObject.put(param.getKey(), param.getValue());
}
catch (JSONException e) {
Log.e("Groshie", "JSONException : "+e);
}
}
return webInvoke(methodName, jsonObject.toString(), "application/json");
}
private String webInvoke(String methodName, String data, String contentType) {
ret = null;
httpClient.getParams().setParameter(ClientPNames.COOKIE_POLICY, CookiePolicy.RFC_2109);
httpPost = new HttpPost(webServiceUrl + methodName);
response1 = null;
StringEntity tmp = null;
//httpPost.setHeader("User-Agent", "SET YOUR USER AGENT STRING HERE");
httpPost.setHeader("Accept",
"text/html,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5");
if (contentType != null) {
httpPost.setHeader("Content-Type", contentType);
} else {
httpPost.setHeader("Content-Type", "application/x-www-form-urlencoded");
}
try {
tmp = new StringEntity(data,"UTF-8");
} catch (UnsupportedEncodingException e) {
Log.e("Groshie", "HttpUtils : UnsupportedEncodingException : "+e);
}
httpPost.setEntity(tmp);
Log.d("Groshie", webServiceUrl + "?" + data);
try {
response1 = httpClient.execute(httpPost,localContext);
if (response1 != null) {
ret = EntityUtils.toString(response1.getEntity());
}
} catch (Exception e) {
Log.e("Groshie", "HttpUtils: " + e);
}
return ret;
}
//Use this method to do a HttpGet/WebGet on the web service
public String webGet(String methodName, Map<String, String> params) {
String getUrl = webServiceUrl + methodName;
int i = 0;
for (Map.Entry<String, String> param : params.entrySet())
{
if(i == 0){
getUrl += "?";
}
else{
getUrl += "&";
}
try {
getUrl += param.getKey() + "=" + URLEncoder.encode(param.getValue(),"UTF-8");
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
i++;
}
httpGet = new HttpGet(getUrl);
Log.e("WebGetURL: ",getUrl);
try {
response1 = httpClient.execute(httpGet);
} catch (Exception e) {
Log.e("Groshie:", e.getMessage());
}
// we assume that the response body contains the error message
try {
ret = EntityUtils.toString(response1.getEntity());
} catch (IOException e) {
Log.e("Groshie:", e.getMessage());
}
return ret;
}
public static JSONObject Object(Object o){
try {
return new JSONObject(new Gson().toJson(o));
} catch (JSONException e) {
e.printStackTrace();
}
return null;
}
public InputStream getHttpStream(String urlString) throws IOException {
InputStream in = null;
int response = -1;
URL url = new URL(urlString);
URLConnection conn = url.openConnection();
if (!(conn instanceof HttpURLConnection))
throw new IOException("Not an HTTP connection");
try{
HttpURLConnection httpConn = (HttpURLConnection) conn;
httpConn.setAllowUserInteraction(false);
httpConn.setInstanceFollowRedirects(true);
httpConn.setRequestMethod("GET");
httpConn.connect();
response = httpConn.getResponseCode();
if (response == HttpURLConnection.HTTP_OK) {
in = httpConn.getInputStream();
}
} catch (Exception e) {
throw new IOException("Error connecting");
} // end try-catch
return in;
}
public void clearCookies() {
httpClient.getCookieStore().clear();
}
public void abort() {
try {
if (httpClient != null) {
System.out.println("Abort.");
httpPost.abort();
}
} catch (Exception e) {
System.out.println("Your App Name Here" + e);
}
}
}
```
and here's the JSON file:
```
[{
"title": "CARE Deutschland-Luxemburg e.V.",
"keyword": "CARE",
"description": "<p><b>Das CARE-Komplett-Paket für Menschen in Not</b",
"smallImageUrl": "http://cdn.spendino.de/web/img/projects/home/1284113658.jpg",
"bigImageUrl":"http://cdn.spendino.de/web/img/projects/small/1284113658.jpg",
"cost": "5"
},
{
"title": "Brot für die Welt",
"keyword": "BROT",
"description": "<p>„Brot für die Welt“ unterstützt unter der Maßgabe 'Helfen, wo die Not am größten ist' ausgewählte Projekte weltweit.",
"smallImageUrl": "http://cdn.spendino.de/web/img/projects/home/1267454286.jpg",
"bigImageUrl":"http://cdn.spendino.de/web/img/projects/small/1267454286.jpg",
"cost": "5"
},
{
"title": "Deutsche AIDS-Stiftung",
"keyword": "HIV",
"description": "<p>Die Deutsche AIDS-Stiftung unterstützt mit ihren finanziellen Mitteln seit mehr als 20 Jahren Betroffene, die an HIV und AIDS erkrankt sind.",
"smallImageUrl": "http://cdn.spendino.de/web/img/projects/home/1258365722.jpg",
"bigImageUrl":"http://cdn.spendino.de/web/img/projects/small/1258365722.jpg",
"cost": "5"
}]
```
Screenshot of the list view:

If something is not clear, please let me know.
Thank you very much
|
Android: Make list view clickable and dynamic with JSON
|
CC BY-SA 3.0
| 0 |
2011-04-08T09:49:38.987
|
2011-10-08T06:31:36.527
|
2011-04-08T10:12:26.637
| 243,709 | 690,672 |
[
"android"
] |
5,593,674 | 1 | 5,627,196 | null | 2 | 587 |
I am having trouble ajaxifying our new Seaside-App. The objective of the App is to show contract-data in a cascading view (in concept like a tree but visually just components inside components): on the top level the names of contracts, a click on them reveals the so-called "sets" these contracts contain, a click on those reveals the so-called "parts" they contain and so on.

In the draft-version we made we just load all the information onto the client and then use:
```
renderContentOn: html
....
html div
onClick: (html scriptaculous effect id: tmpid; toggleAppear);
onClick: (html scriptaculous request callback: [visible:=self visible not]);
with: ...
```
to successfully blend-in and blend-out the sub-components of the various levels.
Loading all the information onto the client was for the draft-version only; for the next version we want to dynamically load only those branches the user wants to expand. We know how to do this according to the Seaside-Book, and doing the following we get the client to update correctly:
```
onClick: (html jQuery ajax script: [:s|
s << (s jQuery: tmpid) append: ...
```
However: we are having trouble keeping the client-state and server-state correct: We want to keep state of parts of the tree (not-loaded/expanded/collapsed for every node in the tree) even when the user uses the html-form-inputs (see graphic) to change contents of the tree. We also want to keep the state if the connection is briefly not available (otherwise the whole state and field-editing of the user is lost and a 404 is shown, back-button will result in inconsistent session, worst case scenario). The situation is further complicated because we want to allow this behavior for multiple users; of course with the semantic that every user has different tree-state (not-loaded/expanded/collapsed for every node in the tree) but consistent entries in the data-fields.
Do you have a template or minimal example with which one can have this kind of updating of the server-session?
|
Help in ajaxifying Seaside-App (need template or minimal example)
|
CC BY-SA 3.0
| null |
2011-04-08T10:16:48.967
|
2011-04-11T20:31:20.143
| null | null | 618,598 |
[
"ajax",
"smalltalk",
"seaside"
] |
5,593,889 | 1 | 5,594,003 | null | 0 | 1,444 |
I've got a simple XML document:
```
<?xml version="1.0" encoding="utf-8" ?>
<languages default="en">
<language code="en" name="English" />
<language code="de" name="Deutsch" />
<language code="es" name="Espanol" />
<language code="fr" name="Français" />
</languages>
```
whose `language` nodes I've declared as the `ItemsSource` for a ComboBox in C#:
```
userLanguageComboBox.ItemsSource = languagesXml.Descendants("language");
```
The ComboBox displays is defined as such in XAML:
```
<ComboBox Name="userLanguageComboxBox" DisplayMemberPath="@name" />
```
The problem is, that the ComboBox generates four empty entries, it doesn't seem to find the attribute (If I leave out the `DisplayMemberPath` property, the four `language` nodes show up as text):

How can I fix this?
(I'm using .NET 4.0.)
|
How do I get an XML-attribute to display in an WPF ComboBox?
|
CC BY-SA 3.0
| null |
2011-04-08T10:38:23.350
|
2011-04-08T12:33:01.910
|
2011-04-08T11:42:59.293
| 6,260 | 6,260 |
[
"c#",
"wpf",
"xml",
"xaml",
".net-4.0"
] |
5,594,221 | 1 | 8,484,416 | null | 0 | 2,961 |
I am creating a Windows Forms Application using Visual Studio 2010.
I populate data to a DataGridView from an excel file using OleDbDataAdapter method.
Here is my code
```
dataGridView1.DataSource = null;
dataGridView1.Update();
var connectionString =
string.Format("Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties=\"Excel 12.0 Xml;HDR=No;IMEX=1\";", fileName);
var adapter = new OleDbDataAdapter("SELECT * FROM [Sheet1$]", connectionString);
var ds = new DataSet();
DataTable t = new DataTable();
adapter.Fill(t);
dataGridView1.DataSource = t;
```
Now Problem is if some cells are merged in the excel file output get bit different.
Here is the image for better understanding.

So how can I fix this problem ?
I think if I can identify the merge cells then I can fix this. But I don't have a clear idea at the moment.
Is there a better way to represent excel data in grid view as it is in the excel file ?
Any answer would be help. Please share any suggestions.
Thanks
Yohan
|
Excel to Grid view issues using OleDbDataAdapter
|
CC BY-SA 3.0
| 0 |
2011-04-08T11:10:42.797
|
2011-12-13T07:05:07.597
| null | null | 441,628 |
[
"c#",
"visual-studio-2010",
"excel",
"datagridview",
"oledbdataadapter"
] |
5,594,447 | 1 | null | null | 3 | 7,520 |
I made a simple test project containing only one UIWebView on a UIView filled the window. When the UIWebView's width is the same as UIView, everything works well. When the UIWebView's width is less than the container's width, horizontal scrollbar appears irregularly. The webpage I load is a local html file. The width is not set so it should fit the browser/UIWebView's width.
Please help. Thanks.

|
Webpage in UIWebView doesn't autoresize correctly when UIWebView's width is less than the window's width
|
CC BY-SA 3.0
| 0 |
2011-04-08T11:35:53.533
|
2015-03-23T14:08:57.327
| null | null | 181,697 |
[
"iphone",
"cocoa-touch",
"ipad"
] |
5,594,845 | 1 | 5,754,462 | null | 1 | 1,870 |
I am using RadScheduler timeline view.
Please find an attached telerik demo screenshot. Is it possible to show a resource title in timeline view?
 
Thanks,
Anders
|
RadScheduler - Timeline view resource title
|
CC BY-SA 3.0
| null |
2011-04-08T12:11:00.580
|
2011-04-22T10:19:52.610
| null | null | 93,676 |
[
"asp.net",
"telerik",
"radscheduler"
] |
5,594,980 | 1 | null | null | 13 | 8,495 |
I send emails to my users which have the same subject but contain different content aside from the header and footer. The header contains a logo, a "Part x of n" message, and an `<hr>` and is never hidden. The footer contains an `<hr>`, the same "Part x of n" text and some functional links (Next, Pause, Tweet) that I don't want hidden.
I tried enclosing these in a `<div id=timestamp>`. I also tried adding `&ts=timestamp` to the links. The links are images, so then I created a symbolic link called image2.png pointing to image1.png and alternated these images. None of these worked.
Is there a simple solution that I haven't thought of yet?
Here is some html:
```
names are really separated by, rather than just a comma.</p>
<p>This function does not do any checking for problems. We assume,
in this case, that the input is always correct.</p>
</div>
</div>
<div>
<p>All that remains now is putting the pieces together.</div></div></div></div></span>
<hr>(Part 19 of about 74)<br>
<a href='http://www.mywebapp.com/index.php?action=next'>
<img border=0 src='http://www.mywebapp.com/images/next.png' alt='Get next text'</a>
<a href='http://www.mywebapp.com/index.php?action=pause&listid=252&itemid=2100'>
<img border=0 src='http://www.mywebapp.com/images/pause.png' alt='Pause this text'></a>
<a href='http://twitter.com/home?status=tweetGoesHere'><img border=0 src='http://www.mywebapp.com/images/twitter-a.png' alt='Tweet this'/></a><br>
Original page: <a href='http://eloquentjavascript.net/print.html'>here</a><br>
```
And here's a screenshot:

|
Is there a trick to prevent Gmail's "quoted text" from hiding my email footer?
|
CC BY-SA 3.0
| 0 |
2011-04-08T12:23:33.563
|
2020-02-26T17:22:56.850
|
2011-04-08T15:27:03.850
| 500,428 | 500,428 |
[
"html",
"gmail",
"hidden"
] |
5,595,048 | 1 | 5,595,387 | null | 4 | 5,864 |
I'm having a JSON file which is populated to a listview.
I wanna make the list view dynamic. That means, I only need one Activity for the click action on the list I have. And the source of the content (picture,title,description) which is populated to the Activity comes from a JSON file on the web.
For example, I have 13 projects on the list, whenever I click one of them it goes to ONE activity containing different picture,title,and description depends on the item I click.
I need somebody to improve the codes I provide below.
```
public class Projects {
public String title;
public String keyword;
public String description;
public String smallImageUrl;
public String bigImageUrl;
public int cost;
@Override
public String toString()
{
return "Title: "+title+ " Keyword: "+keyword+ " Image: "+smallImageUrl;
}
}
```
```
Public class ProjectsAdapter extends ArrayAdapter<Projects> {
int resource;
String response;
Context context;
//Initialize adapter
public ProjectsAdapter(Context context, int resource, List<Projects> items) {
super(context, resource, items);
this.resource=resource;
}
@Override
public View getView(int position, View convertView, ViewGroup parent)
{
LinearLayout projectView;
//Get the current alert object
Projects pro = getItem(position);
//Inflate the view
if(convertView==null)
{
projectView = new LinearLayout(getContext());
String inflater = Context.LAYOUT_INFLATER_SERVICE;
LayoutInflater vi;
vi = (LayoutInflater)getContext().getSystemService(inflater);
vi.inflate(resource, projectView, true);
}
else
{
projectView = (LinearLayout) convertView;
}
TextView Title =(TextView)projectView.findViewById(R.id.title);
try {
ImageView i = (ImageView)projectView.findViewById(R.id.image);
Bitmap bitmap = BitmapFactory.decodeStream((InputStream)new URL(pro.smallImageUrl).getContent());
i.setImageBitmap(bitmap);
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
//Assign the appropriate data from our alert object above
//Image.setImageDrawable(pro.smallImageUrl);
Title.setText(pro.title);
return projectView;
}
}
```
```
public class Main extends Activity {
/** Called when the activity is first created. */
//ListView that will hold our items references back to main.xml
ListView lstTest;
//Array Adapter that will hold our ArrayList and display the items on the ListView
ProjectsAdapter arrayAdapter;
//List that will host our items and allow us to modify that array adapter
ArrayList<Projects> prjcts=null;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
//Initialize ListView
lstTest= (ListView)findViewById(R.id.lstText);
//Initialize our ArrayList
prjcts = new ArrayList<Projects>();
//Initialize our array adapter notice how it references the listitems.xml layout
arrayAdapter = new ProjectsAdapter(Main.this, R.layout.listitems,prjcts);
//Set the above adapter as the adapter of choice for our list
lstTest.setAdapter(arrayAdapter);
//Instantiate the Web Service Class with he URL of the web service not that you must pass
WebService webService = new WebService("http://pre.spendino.de/test/android/projects.json");
//Pass the parameters if needed , if not then pass dummy one as follows
Map<String, String> params = new HashMap<String, String>();
params.put("var", "");
//Get JSON response from server the "" are where the method name would normally go if needed example
// webService.webGet("getMoreAllerts", params);
String response = webService.webGet("", params);
try
{
//Parse Response into our object
Type collectionType = new TypeToken<ArrayList<Projects>>(){}.getType();
//JSON expects an list so can't use our ArrayList from the lstart
List<Projects> lst= new Gson().fromJson(response, collectionType);
//Now that we have that list lets add it to the ArrayList which will hold our items.
for(Projects l : lst)
{
prjcts.add(l);
}
//Since we've modified the arrayList we now need to notify the adapter that
//its data has changed so that it updates the UI
arrayAdapter.notifyDataSetChanged();
}
catch(Exception e)
{
Log.d("Error: ", e.getMessage());
}
lstTest.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
@SuppressWarnings("unchecked")
Projects p = (Projects ) lstTest.getItemAtPosition(position);
//Do your logic and open up a new Activity.
Intent care = new Intent(Main.this, Organization.class);
startActivity(care);
}
});
}
}
```
(I don't think we need to edit this one)
```
public class WebService{
DefaultHttpClient httpClient;
HttpContext localContext;
private String ret;
HttpResponse response1 = null;
HttpPost httpPost = null;
HttpGet httpGet = null;
String webServiceUrl;
//The serviceName should be the name of the Service you are going to be using.
public WebService(String serviceName){
HttpParams myParams = new BasicHttpParams();
HttpConnectionParams.setConnectionTimeout(myParams, 10000);
HttpConnectionParams.setSoTimeout(myParams, 10000);
httpClient = new DefaultHttpClient(myParams);
localContext = new BasicHttpContext();
webServiceUrl = serviceName;
}
//Use this method to do a HttpPost\WebInvoke on a Web Service
public String webInvoke(String methodName, Map<String, Object> params) {
JSONObject jsonObject = new JSONObject();
for (Map.Entry<String, Object> param : params.entrySet()){
try {
jsonObject.put(param.getKey(), param.getValue());
}
catch (JSONException e) {
Log.e("Groshie", "JSONException : "+e);
}
}
return webInvoke(methodName, jsonObject.toString(), "application/json");
}
private String webInvoke(String methodName, String data, String contentType) {
ret = null;
httpClient.getParams().setParameter(ClientPNames.COOKIE_POLICY, CookiePolicy.RFC_2109);
httpPost = new HttpPost(webServiceUrl + methodName);
response1 = null;
StringEntity tmp = null;
//httpPost.setHeader("User-Agent", "SET YOUR USER AGENT STRING HERE");
httpPost.setHeader("Accept",
"text/html,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5");
if (contentType != null) {
httpPost.setHeader("Content-Type", contentType);
} else {
httpPost.setHeader("Content-Type", "application/x-www-form-urlencoded");
}
try {
tmp = new StringEntity(data,"UTF-8");
} catch (UnsupportedEncodingException e) {
Log.e("Groshie", "HttpUtils : UnsupportedEncodingException : "+e);
}
httpPost.setEntity(tmp);
Log.d("Groshie", webServiceUrl + "?" + data);
try {
response1 = httpClient.execute(httpPost,localContext);
if (response1 != null) {
ret = EntityUtils.toString(response1.getEntity());
}
} catch (Exception e) {
Log.e("Groshie", "HttpUtils: " + e);
}
return ret;
}
//Use this method to do a HttpGet/WebGet on the web service
public String webGet(String methodName, Map<String, String> params) {
String getUrl = webServiceUrl + methodName;
int i = 0;
for (Map.Entry<String, String> param : params.entrySet())
{
if(i == 0){
getUrl += "?";
}
else{
getUrl += "&";
}
try {
getUrl += param.getKey() + "=" + URLEncoder.encode(param.getValue(),"UTF-8");
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
i++;
}
httpGet = new HttpGet(getUrl);
Log.e("WebGetURL: ",getUrl);
try {
response1 = httpClient.execute(httpGet);
} catch (Exception e) {
Log.e("Groshie:", e.getMessage());
}
// we assume that the response body contains the error message
try {
ret = EntityUtils.toString(response1.getEntity());
} catch (IOException e) {
Log.e("Groshie:", e.getMessage());
}
return ret;
}
public static JSONObject Object(Object o){
try {
return new JSONObject(new Gson().toJson(o));
} catch (JSONException e) {
e.printStackTrace();
}
return null;
}
public InputStream getHttpStream(String urlString) throws IOException {
InputStream in = null;
int response = -1;
URL url = new URL(urlString);
URLConnection conn = url.openConnection();
if (!(conn instanceof HttpURLConnection))
throw new IOException("Not an HTTP connection");
try{
HttpURLConnection httpConn = (HttpURLConnection) conn;
httpConn.setAllowUserInteraction(false);
httpConn.setInstanceFollowRedirects(true);
httpConn.setRequestMethod("GET");
httpConn.connect();
response = httpConn.getResponseCode();
if (response == HttpURLConnection.HTTP_OK) {
in = httpConn.getInputStream();
}
} catch (Exception e) {
throw new IOException("Error connecting");
} // end try-catch
return in;
}
public void clearCookies() {
httpClient.getCookieStore().clear();
}
public void abort() {
try {
if (httpClient != null) {
System.out.println("Abort.");
httpPost.abort();
}
} catch (Exception e) {
System.out.println("Your App Name Here" + e);
}
}
}
```
What I wanna show in Organization.java is this .xml file:
```
<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:orientation="vertical">
<ImageView
android:id="@+id/project_image"
android:layout_marginTop="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"/>
<TextView
android:id="@+id/title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Default Title"
android:textSize="18sp"
android:textStyle="bold"
android:textColor="#78b257"/>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_marginTop="15dp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<Button
android:id="@+id/btn_forward"
android:layout_marginLeft="5dp"
android:layout_gravity="left"
android:text="Weitersagen"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginTop="15dp"/>
<Button
android:id="@+id/btn_sms_spend"
android:layout_marginTop="15dp"
android:layout_marginRight="5dp"
android:text="Per SMS spenden"
android:layout_gravity="right"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
</LinearLayout>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_white"
android:orientation="vertical">
<TextView
android:id="@+id/description"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginLeft="5dp"
android:gravity="left"
android:text="default description"
android:textSize="18sp"
android:textColor="#000000"/>
</LinearLayout>
</ScrollView>
</LinearLayout>
```
and here's the JSON file:
```
[{
"title": "CARE Deutschland-Luxemburg e.V.",
"keyword": "CARE",
"description": "<p><b>Das CARE-Komplett-Paket für Menschen in Not</b",
"smallImageUrl": "http://cdn.spendino.de/web/img/projects/home/1284113658.jpg",
"bigImageUrl":"http://cdn.spendino.de/web/img/projects/small/1284113658.jpg",
"cost": "5"
},
{
"title": "Brot für die Welt",
"keyword": "BROT",
"description": "<p>„Brot für die Welt“ unterstützt unter der Maßgabe 'Helfen, wo die Not am größten ist' ausgewählte Projekte weltweit.",
"smallImageUrl": "http://cdn.spendino.de/web/img/projects/home/1267454286.jpg",
"bigImageUrl":"http://cdn.spendino.de/web/img/projects/small/1267454286.jpg",
"cost": "5"
},
{
"title": "Deutsche AIDS-Stiftung",
"keyword": "HIV",
"description": "<p>Die Deutsche AIDS-Stiftung unterstützt mit ihren finanziellen Mitteln seit mehr als 20 Jahren Betroffene, die an HIV und AIDS erkrankt sind.",
"smallImageUrl": "http://cdn.spendino.de/web/img/projects/home/1258365722.jpg",
"bigImageUrl":"http://cdn.spendino.de/web/img/projects/small/1258365722.jpg",
"cost": "5"
}]
```
Screenshot of the list view:

If these are the steps I gotta do, then I'm having trouble with number 4 & 5:
1. Have the JSON
2. construct a suitable data structure (an Array, ArrayList, whatever you like) to hold crucial data about your list view
3. Use this data structure as the source for your list view
4. when the user clicks on any row, try to find out the position of the row in the list view, and on that position in your source data structure, look for the data needed.
5. create any activity which handles these data generally
6. open that activity with the data of the row which user clicked in step 4
7. Consume this data in your new activity
:
```
public class ConstantData extends ArrayList<Projects>{
private static final long serialVersionUID = 9100099012485622682L;
public static Object projectsList;
public ConstantData(){
}
public ConstantData(Parcel in){
}
@SuppressWarnings("unchecked")
public static final Parcelable.Creator CREATOR = new Parcelable.Creator(){
public ConstantData createFromParcel (Parcel in){
return new ConstantData(in);
}
public Object[] newArray(int arg0){
return null;
}
};
private void readFromParcel(Parcel in){
this.clear();
int size = in.readInt();
for (int i = 0; i < size; i++){
Projects p = new Projects();
p.setTitle(in.readString());
p.setKeyword(in.readString());
p.setSmallImageUrl(in.readString());
p.setBigImageUrl(in.readString());
p.setCost(in.readInt());
}
}
public int describeContents() {
return 0;
}
public void writeToParcel (Parcel dest, int flags){
int size = this.size();
dest.writeInt(size);
for (int i = 0; i < size; i++){
Projects p = this.get(i);
dest.writeString(p.getTitle());
dest.writeString(p.getKeyword());
dest.writeString(p.getDescription());
dest.writeString(p.getSmallImageUrl());
dest.writeString(p.getBigImageUrl());
dest.writeInt(p.getCost());
}
}
}
```
If something is not clear, please let me know.
Thank you very much
|
Android: Making a dynamic listview
|
CC BY-SA 3.0
| 0 |
2011-04-08T12:29:52.903
|
2013-05-27T09:40:51.357
|
2011-04-13T09:12:32.267
| 690,672 | 690,672 |
[
"android",
"listview",
"dynamic"
] |
5,595,243 | 1 | null | null | 4 | 3,622 |
I am using WPF datagrid from codeplex. I am using DatagridTemplateColumn and I have written datatemplates to display contents in each column.
Now I have to display some help message to a user when the any control in datagrid is focussed.
For this I thought of using adorner layer. I used ComboBox loaded event and accessed the adrorner layer of it. I then added my own adorner layer with some thing to be displayed there similar to tooltip. Below is the code.
```
TextBox txtBox = (TextBox)comboBox.Template.FindName("PART_EditableTextBox", comboBox);
if (txtBox == null)
return;
txtBox.ToolTip = comboBox.ToolTip;
AdornerLayer myAdornerLayer = AdornerLayer.GetAdornerLayer(txtBox);
Binding bind = new Binding("IsKeyboardFocused");
bind.Converter = new KeyToVisibilityConverter();
bind.Source = txtBox;
bind.Mode = BindingMode.OneWay;
PEAdornerControl adorner = new PEAdornerControl(txtBox);
adorner.SetBinding(PEAdornerControl.VisibilityProperty, bind);
```
PEAdorner layer is this ::
```
public class PEAdornerControl : Adorner
{
Rect rect;
// base class constructor.
public PEAdornerControl(UIElement adornedElement)
: base(adornedElement)
{ }
protected override void OnRender(DrawingContext drawingContext)
{
.....
}
}
```
Now the problem is as follows. I am attaching screenshot of how it is looking in datagrid. If the datagrid has more than 4 rows, things are fine.Below is the screenshot

If the datagrid has less number of row, this adorner goes inside datagrid and is not visible to user. The screenshot is below

Please help me !!!
|
In WPF, how to display AdornerLayer on top of DataGrid
|
CC BY-SA 3.0
| 0 |
2011-04-08T12:47:30.493
|
2016-01-31T23:15:32.457
| null | null | 443,568 |
[
"wpf",
"datagrid",
"z-order",
"adornerlayer"
] |
5,595,361 | 1 | null | null | 4 | 683 |
For homework, I have to implement a variety of hash functions in C++ or Java. I'm comfortable working with Java, but haven't used its hash functionality.
I want a hash structure that links colliding keys. Like this:

Is [LinkedHashMap](http://download.oracle.com/javase/1.4.2/docs/api/java/util/LinkedHashMap.html) the correct choice here? Is it [HashMap](http://download.oracle.com/javase/1.4.2/docs/api/java/util/HashMap.html)? Either? Why?
|
Which of Java's hash structures supports 'linear chaining'?
|
CC BY-SA 3.0
| 0 |
2011-04-08T12:57:34.453
|
2012-12-16T16:00:19.640
|
2012-12-16T16:00:19.640
| 1,288 | 45,963 |
[
"java",
"hash",
"hashtable"
] |
5,595,548 | 1 | null | null | 1 | 1,359 |
I am trying to use facebook publish API link this as given here [http://developers.facebook.com/docs/reference/api/post/](http://developers.facebook.com/docs/reference/api/post/)
```
NSDictionary *privacyDict = [[[NSDictionary alloc] initWithObjectsAndKeys:@"SELF",@"value",nil] autorelease];
SBJSON *jsonWriter = [[SBJSON new] autorelease];
NSString *privacyJSONStr = [jsonWriter stringWithObject:privacyDict];
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"Test test", @"message",
privacyJSONStr, @"privacy",
@"http://www.facebook.com/", @"link",
@"This name check where it will show", @"name",
@"Caption for the link", @"caption",
@"Longer description of the link", @"description",
nil];
[facebookObj requestWithMethodName:@"facebook.Stream.publish" andParams:params andHttpMethod:@"POST" andDelegate:self];
```
It posted successfully, but not like that as I expected
there is no caption, name, description , link etc
it shown as

This type of result I can get by this parameter
```
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"Test test", @"message",
privacyJSONStr, @"privacy",
nil];
```
What is the mistake, and How we can publish all the parameter
|
facebook publish POST API on iphone : Not publishing properly
|
CC BY-SA 3.0
| null |
2011-04-08T13:12:19.450
|
2011-07-04T07:18:45.330
| null | null | 488,506 |
[
"cocoa-touch",
"facebook",
"ios4",
"facebook-graph-api"
] |
5,595,566 | 1 | 5,595,628 | null | 0 | 849 |
For this implementation, should I be using a MotionEvent or DragEvent for moving the ball in the meter? 
|
MotionEvent or DragEvent? For this implementation Android
|
CC BY-SA 3.0
| null |
2011-04-08T13:14:10.680
|
2011-04-08T13:22:45.240
|
2011-04-08T13:17:39.793
| 399,037 | 448,005 |
[
"graphics",
"android"
] |
5,595,532 | 1 | null | null | 1 | 2,368 |
I am trying to render an image at the appropriate size inside a `QVBoxLayout`, but I am unable to retrieve the correct size. The layout contains a `QLabel`, which is displayed at a good size within the designer view (see image). The goal is to display an image at the maximal available size.

Here are my attempts to get the size (all failed):
```
VideoResourceWidget::VideoResourceWidget(VideoResource* resource, QWidget *parent) :
QWidget(parent),
ui(new Ui::VideoResourceForm),
m_videoResource(resource)
{
ui->setupUi(this);
// INFO: -> size = (670,463) // this seems to be too small
m_videoSize = this->geometry().size();
// first attempt -> size = (0,0)
m_videoSize = this->geometry().size();
m_videoSize.setHeight(m_videoSize.height() - ui->controllerLayout->geometry().height());
// second attempt -> size = (100,30) way too small
m_videoSize = ui->videoLayout->itemAt(ui->videoLayout->indexOf(ui->frameLabel))->geometry().size();
ui->videoLayout->activate(); // hint from another question
// forth attempt -> size = (145,428) better but not still too small
m_videoSize = ui->videoLayout->itemAt(ui->videoLayout->indexOf(ui->frameLabel))->geometry().size();
// third attempt -> size = (670,434) there is still a lot more room
m_videoSize = this->geometry().size();
m_videoSize.setHeight(m_videoSize.height() - ui->controllerLayout->geometry().height());
ui->videoLayout->setSpacing(1);
ui->frameLabel->setMargin(0);
ui->videoLayout->activate(); // hint from another question
// fifth attempt -> size = (145,428) same as before
m_videoSize = ui->videoLayout->itemAt(ui->videoLayout->indexOf(ui->frameLabel))->geometry().size();
// sixth attempt -> size = (670,434) same as before
m_videoSize = this->geometry().size();
m_videoSize.setHeight(m_videoSize.height() - ui->controllerLayout->geometry().height());
QImage frame = m_videoResource->firstFrame();
ui->frameLabel->setPixmap(QPixmap::fromImage(frame).scaled(m_videoSize, Qt::KeepAspectRatio, Qt::SmoothTransformation));
connect(ui->nextFrameButton, SIGNAL(clicked()), this, SLOT(nextFrame()));
}
```
This is the GUI after displaying the `VideoResourceWidget` for the first time.

While the end result does not have to be pretty, I would love to use the available space effectively.
I updated the screen shots to reflect my latest attempts.
minimal example:
mainwindow.ui
```
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>771</width>
<height>580</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralWidget">
<layout class="QVBoxLayout" name="verticalLayout" stretch="1,0">
<item>
<layout class="QHBoxLayout" name="displayLayout" stretch="0,0,0">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="frameLabel">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="controllerLayout" stretch="1,0">
<item>
<widget class="QScrollBar" name="horizontalScrollBar">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="nextButton">
<property name="text">
<string>PushButton</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>771</width>
<height>25</height>
</rect>
</property>
</widget>
<widget class="QToolBar" name="mainToolBar">
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
</widget>
<widget class="QStatusBar" name="statusBar"/>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>
<connections/>
</ui>
```
mainwindow.h
```
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
public slots:
void next();
private:
Ui::MainWindow *ui;
QSize m_imageSize;
QImage m_image;
};
#endif // MAINWINDOW_H
```
mainwindow.cpp
```
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
this->layout()->activate();
connect(ui->nextButton, SIGNAL(clicked()), this, SLOT(next()));
// Goal: display the image centered using the maximally available space
m_image = QImage("/tmp/lena.jpg");
m_imageSize = ui->frameLabel->size();
ui->frameLabel->setPixmap(QPixmap::fromImage(m_image).scaled(m_imageSize, Qt::KeepAspectRatio, Qt::SmoothTransformation));
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::next()
{
// just redraw
m_imageSize = ui->frameLabel->size();
ui->frameLabel->setPixmap(QPixmap::fromImage(m_image).scaled(m_imageSize, Qt::KeepAspectRatio, Qt::SmoothTransformation));
}
```
|
Get the size of a layout cell of QVBoxLayout in Qt4
|
CC BY-SA 3.0
| 0 |
2011-04-08T13:10:45.990
|
2014-02-04T11:23:19.537
|
2011-04-18T08:08:12.730
| 461,295 | 461,295 |
[
"c++",
"qt4"
] |
5,595,611 | 1 | null | null | 0 | 156 |
I have this website: [http://www.deguaraconfectionery.com/](http://www.deguaraconfectionery.com/) and if you scroll to the right you can see there is some extra space on the right. Not sure why this happened.
The image attached shows how the site looks when scrolled to the right. The site looks great on default view, but am hating this extra space on the right.

|
Width is Stretching out more than it should
|
CC BY-SA 3.0
| null |
2011-04-08T13:18:19.280
|
2011-04-08T13:28:04.943
|
2011-04-08T13:25:20.303
| 658,809 | 658,809 |
[
"html",
"css"
] |
5,595,791 | 1 | 5,596,260 | null | 3 | 2,594 |
Whenever the following code is run in Chrome and FF (not tested in other browsers), the `"text"` goes as such , as in the image.
The script is supposed to lift the `"text"` 4px above on `mouseover` and return it back on `mouseout`
But instead when the mouse is brought in the motion as below, each time it lifts 4px above to its last position.
```
$(document).ready(function(){
$('#n #c a').hover(function(){
$('span',this).stop(true,true).animate({top:'-=4px'},200);
},function(){
$('span',this).stop(true,true).animate({top:'+=4px'},400);
});
});
```

NOTE : In above image the text is just one, others are shown for understanding purpose.
You have to be quick to catch the same effect.
|
jQuery animate relative position (on hover) bug,
|
CC BY-SA 3.0
| null |
2011-04-08T13:31:21.157
|
2011-04-08T15:39:25.170
|
2011-04-08T15:39:25.170
| 433,587 | 433,587 |
[
"javascript",
"jquery",
"hover"
] |
5,595,806 | 1 | 5,595,883 | null | 0 | 348 |
```
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if ([[data objectForKey:@"rows"] count] == indexPath.row) {
UIActionSheet *actionsheet = [[UIActionSheet alloc] initWithTitle:@"Kies wat u wilt toevoegen" delegate:self cancelButtonTitle:@"Annuleren" destructiveButtonTitle:nil otherButtonTitles:@"Veld", @"Afbeelding", @"Locatie",nil];
[actionsheet showInView:self.view];
[actionsheet release];
}
}
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex != 3) {
self.temp = buttonIndex;
UIAlertView *myAlert = [[UIAlertView alloc] initWithTitle:@"Nieuw element" message:@"Kies een naam voor het toe te voegen element" delegate:self cancelButtonTitle:@"Annuleren" otherButtonTitles:@"Ok", nil];
[myAlert addTextFieldWithValue:nil label:@"Naam voor element"];
[[myAlert textField] setTextAlignment:UITextAlignmentCenter];
[[myAlert textField] becomeFirstResponder];
[myAlert show];
[myAlert release];
}
}
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
if (buttonIndex == 1) {
int actionSheetButtonIndex = self.temp;
self.temp = nil;
//Add row
NSString *typed = [[alertView textField] text];
if (actionSheetButtonIndex == 0 || actionSheetButtonIndex == 2) { //If field or location
NSMutableArray *arr = [data objectForKey:@"rows"];
if (arr == nil) {
arr = [NSMutableArray array];
}
NSMutableDictionary *row = [NSMutableDictionary dictionary];
[row setValue:typed forKey:@"name"];
[row setValue:@"" forKey:@"value"];
[arr addObject:row];
[data setObject:arr forKey:@"rows"];
[self updateUserDefaults];
}
}
}
```
I have this code, but the app crashes as it reaches the didDismissWithButtonIndex part. I figured out it doesn't crash when I comment the [arr addObject:row]; part of the code, but I can't figure out what's wrong with it.
Console says Abort trap. That's not very useful either, I think.
EDIT: I've been trying some things for a while, with no result. I have the following code right now:
```
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if ([[data objectForKey:@"rows"] count] == indexPath.row) {
UIActionSheet *actionsheet = [[UIActionSheet alloc] initWithTitle:@"Kies wat u wilt toevoegen" delegate:self cancelButtonTitle:@"Annuleren" destructiveButtonTitle:nil otherButtonTitles:@"Veld", @"Afbeelding", @"Locatie",nil];
[actionsheet showInView:self.view];
[actionsheet release];
}
}
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex != 3) {
self.temp = buttonIndex;
UIAlertView *myAlert = [[UIAlertView alloc] initWithTitle:@"Nieuw element" message:@"Kies een naam voor het toe te voegen element" delegate:self cancelButtonTitle:@"Annuleren" otherButtonTitles:@"Ok", nil];
[myAlert addTextFieldWithValue:nil label:@"Naam voor element"];
[[myAlert textField] setTextAlignment:UITextAlignmentCenter];
[[myAlert textField] becomeFirstResponder];
[myAlert show];
[myAlert release];
}
}
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
if (buttonIndex == 1) {
int actionSheetButtonIndex = self.temp;
self.temp = 0;
//Add row
NSString *typed = [[alertView textField] text];
if (actionSheetButtonIndex == 0 || actionSheetButtonIndex == 2) { //If field or location
NSMutableArray *oldarr = [[[data objectForKey:@"rows"] mutableCopy] autorelease];
NSMutableArray *arr = [NSMutableArray array];
for (int i = 0; i < [oldarr count]; i++) {
[arr addObject:[oldarr objectAtIndex:i]];
}
NSMutableDictionary *row = [NSMutableDictionary dictionary];
[row setObject:typed forKey:@"name"];
[row setObject:@"" forKey:@"value"];
//[arr addObject:row];
NSMutableDictionary *dataCopy = data;
[dataCopy setObject:arr forKey:@"rows"];
self.data = dataCopy;
[self updateUserDefaults];
}
}
}
```
The header file is:
```
#import <UIKit/UIKit.h>
@interface InfoViewController : UITableViewController <UIAlertViewDelegate, UIActionSheetDelegate> {
UIView *images;
NSMutableDictionary *data;
int temp;
}
@property (nonatomic, retain) UIView *images;
@property (nonatomic, retain) NSMutableDictionary *data;
@property (nonatomic) int temp;
@end
```
And here's the updateUserDefaults method:
```
- (void)updateUserDefaults {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSMutableDictionary *tempdict = [defaults objectForKey:@"data"];
[tempdict setObject:self.data forKey:@"rows"];
[defaults setObject:tempdict forKey:@"data"];
}
```
Now the console gives me some more output:

[You can download the crash log mentioned by the console here](http://www.tomline.nl/t/crashlog.crash)
I really hope you can help me out!
|
Crash at [arr addObject:row]; (iPhone development)
|
CC BY-SA 3.0
| null |
2011-04-08T13:32:07.193
|
2011-04-08T16:36:06.743
|
2011-04-08T16:01:52.040
| 376,919 | 376,919 |
[
"iphone",
"objective-c",
"cocoa-touch"
] |
5,596,034 | 1 | 5,656,057 | null | 5 | 2,005 |
I would like to have some input on how a professional development setup with the following requirements might look like.
- - - - - - - -
I gave some specific technology to not be too abstract and b/c I also would be interested in concrete suggestions for plug-ins etc.
---
There are several questions coming to my mind in that setup.
1) So every developer will work on
personal branch.
2) This branch is checked out in a working copy.
Now ... this working copy is edited locally on the PC with the dev's IDE and executed/tested on the server.
What would be in that case the best/usual way to do that? I mean - how do you get your edited code on the server without causing too much overhead?
Would the dev have the code on his local disk at all? Or would it be better to have the IDE write on the remote virtual server through a tunnel or via a specific protocol?
3) Every day a dev will commit his work into his personal branch which resides in a central repository.
Is there a best practice on where the repository is supposed to be located? A seperate server?
4) Then after a dev finished his task either s/he or the team-leader merges the new code into the respective main-branch or trunk.
---
The most confusing part is about what I wrote between 2) and 3). Because so far I only worked with a local server. For example a VM with a server running a code which is located in a shared folder so I will be able to edit it directly. I'm not sure how to bridge the gap efficiently when the server is now actually remote. Efficiently means not having to upload manually via FTP for example.
Also external sources or book recommendations are welcome.
---
## edit
My question/s is/are aiming at a quasi-standard / best-practice. I think this is pretty much a standard development scenario so there must be a 'usual' solution.
---
## edit 2
Okay ... so lets try with a picture:

V is the virtual test-server for one or more developers D. C and C' are the two code-versions. They should be kept as identical as possible.
Two solutions come to my mind:
1 : Edit C, then upload it to C', then execute C', then commit C.
2 : No C existant. Just C' which is edited through some tunnel technology and executed and committed.
My guts tell me both solutions are semi-optimal. So what would be "professional" / most efficient / fastest / most convenient / most friction-less / least error-prone / best practice / industry standard?
Any questions?
|
Multi-Developer-Setup with SVN-VC and remote test-servers for each developer. Best practices?
|
CC BY-SA 3.0
| 0 |
2011-04-08T13:47:25.787
|
2017-08-08T14:42:30.193
|
2017-08-08T14:42:30.193
| 1,000,551 | 562,440 |
[
"php",
"svn",
"branch",
"collaboration",
"branching-strategy"
] |
5,596,284 | 1 | 5,599,732 | null | 11 | 5,090 |
I have been reading theory about HOG descriptors for object(human) detection. But I have some questions about the implementation, which might sound like an insignificant detail.
Regarding the window that contains the blocks; should the window be moved over the image pixel by pixel where the windows overlap at each step, as illustrated here: 
or should the window be moved without causing any overlapping, as here: 
The illustrations that I have seen so far used the second approach. But, considering the detection window being size of 64x128, it is highly probable that by sliding the window over the image one cannot cover the whole image. In case of image being size of 64x255, then the last 127 pixel will not be check for object. So, first approach seems more reasonable, however, more time and cpu consuming.
Any ideas?
Thank you in advance.
EDIT: I try to stick to the original paper of Dalal and Triggs. One paper that implemented the algorithm and uses the second approach can be found here: [http://www.cs.bilkent.edu.tr/~cansin/projects/cs554-vision/pedestrian-detection/pedestrian-detection-paper.pdf](http://www.cs.bilkent.edu.tr/~cansin/projects/cs554-vision/pedestrian-detection/pedestrian-detection-paper.pdf)
|
Histogram of Oriented Gradients
|
CC BY-SA 3.0
| 0 |
2011-04-08T14:07:10.353
|
2011-04-09T10:34:14.683
|
2011-04-08T18:43:40.240
| 142,600 | 142,600 |
[
"image-processing",
"computer-vision",
"object-detection"
] |
5,596,588 | 1 | 5,599,037 | null | 2 | 5,270 |
My tree has 2 levels of nodes - it's a style tree.
My problem is, that I would like to have every contact checked, in all the "Contact Categories". Here is a screenshot of my contact list as it looks now (And yes, I have permission to post it)

As you see, is checked in the Category , but not in . What I am trying to achieve, is to have a contact have the same in every category.
Example: I check Todd Hirsch in the Test Category - Todd Hirsch is automatically checked in All Contacts (And every other category). If I check Todd Hirsch in the All Contacts, he will also get checked in Test Category. If I Uncheck Todd Hirsch in All Contacts, he will also get unchecked in Test Category.
I tried doing it through the VirtualStringtree's OnChecking events, by looping thru the whole tree for each node in the tree, however when the contact list is big (2000 +), it is very slow, and when there's like 5000+, it might even crash my program
What do you suggest?
Here is the code that I use to make sure that a contact is only checked once. (That is not what I now, but it's what I am using right now.)
```
////////////////////////////////////////////////////////////////////////////////
/// HasDuplicateChecked
////////////////////////////////////////////////////////////////////////////////
Function HasDuplicateChecked(Node: PVirtualNode): PVirtualNode;
Var
ParentNode, ChildNode: PVirtualNode;
I, J: Integer;
Begin
// IHCW
Result := Nil;
// Get the first node of the tree..
ParentNode := VT.GetFirst;
// Loop thru the parent nodes.
for I := 0 to VT.RootNodeCount - 1 do
begin
// Get the first child node.
ChildNode := ParentNode.FirstChild;
// Loop thru the children..
for J := 0 to ParentNode.ChildCount - 1 do
begin
// If the ChildNode is checked...
if NodeIsChecked(ChildNode) then
// And it is NOT the passed node..
if ChildNode <> Node then
// but the data matches..
if GetData(ChildNode).SkypeID = GetData(Node).SkypeID then
begin
// Then pass the Childnode as a result, and EXIT!
Result := ChildNode;
Exit;
end;
// Next child..
ChildNode := ChildNode.NextSibling;
end;
// Next parent...
ParentNode := ParentNode.NextSibling;
end;
End;
////////////////////////////////////////////////////////////////////////////////
/// vtSkypeChecking
////////////////////////////////////////////////////////////////////////////////
procedure TSkypeListEventHandler.vtSkypeChecking(Sender: TBaseVirtualTree;
Node: PVirtualNode; var NewState: TCheckState; var Allowed: Boolean);
Var
Level: Integer;
I: Integer;
Child: PVirtualNode;
begin
// Allow the checking..
Allowed := True;
// Get the Level..
Level := Sender.GetNodeLevel(Node);
// If the level is 0 (Category Level)
if Level = 0 then
begin
// And if the Node's Childcount is more than 0
if Node.ChildCount > 0 then
Begin
// Get the first child..
Child := Node.FirstChild;
// Loop thru the children..
for I := 0 to Node.ChildCount - 1 do
begin
// Set the checkstate, and go next..
Child.CheckState := NewState;
Child := Child.NextSibling;
end;
End;
end;
// If the level is 1 (User Level)
if Level = 1 then
begin
// and if the Node's parent is not Nil..
if Node.Parent <> nil then
begin
// aaand, if the new state is Unchecked...
if (NewState = csUncheckedNormal) or (NewState = csUncheckedPressed) then
begin
// .. and if the node checkstate is checked..
if NodeIsChecked(Node) then
Begin
// Set the PARENT node's checkstate to Unchecked!
Node.Parent.CheckState := csUncheckedNormal;
End;
end;
// BUT, if there is a DUPLICATE of the node, screw the above, and
// forbid the checking!
if HasDuplicateChecked(Node) <> nil then
Allowed := False;
end;
end;
// Uncheck all the duplicates.
UncheckDuplicates;
// Refresh the Tree
Sender.Refresh;
end;
```
|
How can I keep the check state of multiple Virtual Tree View nodes in sync?
|
CC BY-SA 3.0
| 0 |
2011-04-08T14:28:39.517
|
2013-07-04T09:19:39.797
|
2011-04-08T16:19:45.637
| 33,732 | 561,545 |
[
"delphi",
"checkbox",
"duplicates",
"virtualtreeview"
] |
5,596,671 | 1 | 5,597,071 | null | 0 | 1,980 |
I got a very simple `UITableViewCell` subclass. `MyTableViewCell.h`:
```
#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
@interface MyTableViewCell : UITableViewCell {
CALayer *backgroundLayer;
}
@end
```
`MyTableViewCell.m`:
```
#import "MyTableViewCell.h"
#import <QuartzCore/QuartzCore.h>
@implementation MyTableViewCell
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
backgroundLayer = [[CALayer alloc] init];
[backgroundLayer setBackgroundColor:[[UIColor yellowColor] CGColor]];
[[self layer] addSublayer:backgroundLayer];
}
return self;
}
- (void)layoutSublayersOfLayer:(CALayer *)layer {
[backgroundLayer setFrame:[layer frame]];
[super layoutSublayersOfLayer:layer];
}
- (void)dealloc {
[backgroundLayer release];
[super dealloc];
}
@end
```
Bizarrely, here's the result:.
Can someone explain this?! Why doesn't the layer paint in all cells but only every second cell?
EDIT: Here's my `tableView:cellForRowAtIndexPath:` method:
```
static NSString *reuseIdentifier = @"cellReuseIdentifier";
MyTableViewCell *cell = (MyTableViewCell *)[aTableView dequeueReusableCellWithIdentifier:reuseIdentifier];
if (cell == nil)
cell = [[[MyTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier] autorelease];
return cell;
```
|
UITableView and CALayer confusion
|
CC BY-SA 3.0
| null |
2011-04-08T14:35:03.320
|
2011-11-25T16:22:34.220
|
2011-04-08T15:05:08.470
| 282,635 | 282,635 |
[
"iphone",
"objective-c",
"uitableview",
"calayer"
] |
5,596,794 | 1 | null | null | 0 | 271 |
please how can I customize tabwidget to get a flat styled one with no dividers just like this one

|
android flat tabwidget
|
CC BY-SA 3.0
| null |
2011-04-08T14:45:17.380
|
2011-04-08T15:17:35.823
| null | null | 552,264 |
[
"android",
"android-tabhost",
"tabwidget"
] |
5,597,192 | 1 | null | null | 0 | 1,851 |

I want to select a button("Exit") on the ToolStrip after pressing a button ("ButtonFocus To Exit") outside the toolstrip.
I used on ButtonFocusToExit.Click but which seems like its selecting the button ("Exit") but when i pressed enter it never execute the code in .
So the button is still not active. Can anyone have fix to it?
|
Selecting button in Winform ToolStrip
|
CC BY-SA 3.0
| null |
2011-04-08T15:19:24.713
|
2011-04-08T18:20:50.773
| null | null | 186,433 |
[
"vb.net",
"winforms",
"visual-studio-2010"
] |
5,597,189 | 1 | 5,597,541 | null | 0 | 235 |
I'm getting a little confused about when I should use a NIB file and when I should use code.
Here's my problem :
I have a navigation based application with a RootController and its NIB file.
The RootController's NIB file contains a TableView.
When I click on a cell I initialize a new connection with a request to load content.
When the connection has finished loading I create a new postViewController (custom) from a NIB file and I push it on the navigationController viewController stack like that :
```
PostViewController *postViewController = [[PostViewController alloc] initWithNibName:@"PostViewController" bundle:[NSBundle mainBundle]];
[postViewController.webView setDelegate:self];
postViewController.postContent = [[postsData objectForKey:@"post"] objectForKey:@"content"];
[self.navigationController pushViewController:postViewController animated:YES];
[PostViewController release];
```
Then, as you can see I try to set the rootViewController as the delegate for the webView in order to be able to intercept a click on a link and push a new ViewController on the stack. I need that new view to have the navigation bar with the back button.
Problem : looks like the setDelegate isn't working because the webView:shouldStartLoadWithRequest:navigationType never gets called !
I guess I should set the delegate in the NIB file but I have no idea how. The NIB file from PostViewController doesn't know about the RootViewController...
Here are screenshots of the NIB files :



If you need more detail just ask me.
Thanks a lot...for helping me not banging my head for another day :)
|
iPhone : nib file + code = mix up
|
CC BY-SA 3.0
| null |
2011-04-08T15:19:17.963
|
2011-04-11T11:23:08.157
|
2011-04-11T11:23:08.157
| 683,978 | 683,978 |
[
"iphone",
"nib",
"uiwebviewdelegate"
] |
5,597,212 | 1 | 5,597,282 | null | 3 | 23,605 |
Background: I have a winform application written in VB.NET that uses a WebService to send out different invitations to users based on the marketing company they select to take different interviews. The winform app is pulling string values from a variety of textboxes, listboxes, and dropdownlists to create some XML and push it to a web service called AcompServiceClient
Questions:
- - -
I was thinking:
- - -
Here's a screenshot of the WinForm App:

Here's a screenshot of the Project Files:

Here's my code on Acomp_Invitation_Form.vb:
```
Imports TestClient.aCompService
Imports System.Text
Public Class Form1
Private proxy As New AcompServiceClient
Private Sub stuff()
Dim splitContractingBundle() As String
splitContractingBundle = Split(cb2.SelectedItem, "|")
Dim splitMarketingCompany() As String
splitMarketingCompany = Split(cb3.SelectedItem, "|")
Dim strDate As String = System.DateTime.Now.ToString
Dim strOpData As String = String.Format("{0}~{1}~{2}~{3}~{4}~{5}~{6}~{7}~{8}~{9}~{10}",
Trim(splitMarketingCompany(0)), txtFirstName.Text, "", txtLastName.Text,
txtEmail.Text, txtEmail.Text, "1", strDate,
"Pending", "1/1/1900", Trim(splitContractingBundle(0)))
Dim int1 As Boolean = proxy.AddContractOpportunity(strOpData, "test", "test")
txtEmail.Text = ""
txtFirstName.Text = ""
txtLastName.Text = ""
lbCarriers.Items.Clear()
cb2.Items.Clear()
cb3.Items.Clear()
cb2.SelectedItem = ""
cb3.SelectedText = ""
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'TODO Add code to validate that all selections that are reaquired are met.
'ccemail and the additional message are not required
Dim firstname As String = txtFirstName.Text
Dim lastname As String = txtLastName.Text
Dim ccEmail As String = txtccEmail.Text
Dim sb As New StringBuilder
sb.AppendLine("<?xml version=""1.0"" encoding=""utf-8""?>")
sb.AppendLine("<root>")
sb.AppendLine("<MarketingCompany>")
sb.AppendLine("<MarketingCompanyName>")
''Get Marketing Company Short Name
Dim splitMC As String() = Split(cb3.SelectedItem, "|")
Dim MCShort As String = Trim(splitMC(0))
sb.AppendLine(String.Format("<MCNAme>{0}</MCNAme>", MCShort))
'sb.AppendLine(String.Format("<MCNAme>{0}</MCNAme>", My.Settings.MarketingCompanyShortName))
sb.AppendLine(String.Format("<ccEmail>{0}</ccEmail>", txtccEmail.Text))
sb.AppendLine(String.Format("<emailMessage>{0}</emailMessage>", txtMessage.Text))
sb.AppendLine(String.Format("<MarketerName>{0}</MarketerName>", txtMarketerName.Text))
sb.AppendLine("<agent>")
sb.AppendLine(String.Format("<FirstName>{0}</FirstName>", txtFirstName.Text))
sb.AppendLine(String.Format("<LastName>{0}</LastName>", txtLastName.Text))
sb.AppendLine(String.Format("<Email>{0}</Email>", txtEmail.Text))
sb.AppendLine("<CRMGuid>123456</CRMGuid>")
Dim spltBundles() As String
For Each item In cb2.SelectedItems
If Trim(item) <> "" Then
spltBundles = Split(item, "|")
sb.AppendLine("<ContractingOpportunity>")
sb.AppendLine(String.Format("<Carrier>{0}</Carrier>", Trim(spltBundles(0))))
sb.AppendLine(String.Format("<ContractingOpportunityName>{0}</ContractingOpportunityName>", Trim(spltBundles(1))))
sb.AppendLine("</ContractingOpportunity>")
End If
Next
sb.AppendLine("</agent>")
sb.AppendLine("</MarketingCompanyName>")
sb.AppendLine(" </MarketingCompany>")
sb.AppendLine(" </root>")
Dim xmlStr = sb.ToString
Dim int1 As Boolean = proxy.AddContractOpportunity(xmlStr.ToString, "test", "test")
MsgBox("Made It")
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
GetCarriers()
GetMarketingCompanies()
End Sub
Private Sub GetCarriers()
Try
Dim ac1 As Array
ac1 = proxy.GetCarrierNames("test", "test")
For Each item In ac1
lbCarriers.Items.Add(String.Format("{0} | {1} | {2}", item.CarrierID, item.CarrierNameLong, item.CarrierNameShort))
Next
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Private Sub GetMarketingCompanies()
Try
Dim ac1 As Array
ac1 = proxy.GetMarketingCompanyNames("test", "test")
For Each item In ac1
cb3.Items.Add(String.Format("{0} | {1}", item.MarketingCompanyShort, item.MarketingCompanyName))
Next
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Private Sub lbCarriers_LostFocus(sender As Object, e As System.EventArgs) Handles lbCarriers.LostFocus
Dim splt() As String
Dim ac1 As Array
cb2.Items.Clear()
For Each item In lbCarriers.SelectedItems
splt = Split(item, "|")
ac1 = proxy.GetContractingBundles("test", "test", Trim(splt(0)))
For Each Pitem In ac1
cb2.Items.Add(Trim(splt(2)) & " | " & Pitem.FormBundleName)
Next
Next
End Sub
End Class
```
|
VB.NET - Easiest way to Export / Convert WinForm App to Web ASP.NET App
|
CC BY-SA 3.0
| null |
2011-04-08T15:21:26.600
|
2011-04-13T12:49:46.550
|
2011-04-13T12:49:46.550
| 606,805 | 606,805 |
[
"asp.net",
"vb.net",
"winforms-to-web"
] |
5,597,562 | 1 | 5,597,965 | null | 0 | 243 |
I'm trying to use LINQ to XML to create an Excel spreadsheet. I created a template spreadsheet, exported it to XML, pasted the XML into my code and then began to edit it. When I try to create a set of XElements using LINQ, I get these errors:

The first squiggle under `<Cell>` says "attribute specifier is not a complete statement"
The second under ss says "'>' expected"
The third under Type says "'Type' is a type and cannot be used in an expression"
Ignore the error under "Lot 1..." I will be putting an expression hole there.
The squiggle under `</Cell>` says "Identifier expected"
I have all of the Import statements that I should need for this code.
Any suggestions why these errors arise?
|
Attribute specifier error in LINQ to XML / Excel / XDocument code
|
CC BY-SA 3.0
| null |
2011-04-08T15:46:35.713
|
2011-04-08T16:19:08.040
| null | null | 456,820 |
[
".net",
"vb.net",
"excel",
"linq-to-xml"
] |
5,597,566 | 1 | 5,597,944 | null | 11 | 878 |
Suppose I write a black-box functions, which evaluates an expensive complex valued function numerically, and then returns real and imaginary part.
```
fun[x_?InexactNumberQ] := Module[{f = Sin[x]}, {Re[f], Im[f]}]
```
Then I can use it in Plot as usual, but Plot does not recognize that the function returns a pair, and colors both curves the same color. How does one tell Mathematica that the function specified always returns a vector of a fixed length ? Or how does one style this plot ?

Given attempts attempted at answering the problem, I think that avoiding double reevalution is only possible if styling is performed as a post-processing of the graphics obtained. Most likely the following is not robust, but it seems to work for my example:
```
gr = Plot[fun[x + I], {x, -1, 1}, ImageSize -> 250];
k = 1;
{gr, gr /. {el_Line :> {ColorData[1][k++], el}}}
```

|
Telling Plot to style vector-valued black-box functions in Mathematica
|
CC BY-SA 3.0
| 0 |
2011-04-08T15:46:45.137
|
2015-01-28T18:32:21.197
|
2011-04-09T14:23:26.513
| 594,376 | 594,376 |
[
"wolfram-mathematica"
] |
5,597,645 | 1 | null | null | 0 | 688 |
I wanted to put together a few screen shots for an app to use in a "walkthrough". I have finally got the Android Debug bridge to work and can bring up the screen capture feature.
What i am wondering is this.
Is it possible to capture a screen press in the screen shot? For example in the picture below you can see the screen option " Home Button Launch " is highlighted, I would like to accomplish this same thing, as I press the buttons, ex : Menu>WallPaper> and so on.

|
Capture Key Press screen shot using ADB HTC EVO
|
CC BY-SA 3.0
| null |
2011-04-08T15:53:26.533
|
2012-06-11T10:34:00.520
|
2012-06-11T10:34:00.520
| 151,019 | 698,976 |
[
"android",
"debugging",
"screenshot"
] |
5,597,777 | 1 | 5,597,970 | null | 5 | 1,753 |
I am working on a custom control for WPF and Silverlight. This control has a collection property of a complex type that is abstract, like such:
```
public Collection<MyBase> Configuration
{
get { return (Collection<MyBase>)GetValue(ConfigurationProperty); }
set { SetValue(ConfigurationProperty, value); }
}
// Using a DependencyProperty as the backing store for Configuration This enables animation, styling, binding, etc...
public static readonly DependencyProperty ConfigurationProperty =
DependencyProperty.Register("Configuration", typeof(Collection<MyBase>), typeof(MyControl), new PropertyMetadata(new ObservableCollection<MyBase>()));
```
My problem is that I can't add new items to this property in Visual Studio 2010's designer because it doesnt know any derived types of MyBase.
Is there any way to register these types with the designer? The editor works fine with existing items, and can remove and modify them. An image to illustrate:

|
Visual Studio 2010 design time collection editor
|
CC BY-SA 3.0
| 0 |
2011-04-08T16:04:02.637
|
2011-04-08T16:19:21.577
| null | null | 668,272 |
[
"c#",
".net",
"visual-studio-2010",
"design-time"
] |
5,597,888 | 1 | 5,600,851 | null | 1 | 7,415 |
I'm using this input
```
<input src="img/buttons1.png" name="submit" class="submit1" type="image" value="See Today's Date Deal" tabindex="502" />
```
and here it's the css
```
.submit1 {
display: block;
width: 250px;
height: 28px;
background: url(img/buttons1.png) no-repeat 0 0;
padding-top: 12px;
text-align: center;
font-size: 17px !important;
color:#fff;
border:0;
outline:none;
}
```
In Firefox looks great but in Chrome, Safari and Internet Explorer it is 
I'd like to remove border and show text.
Any suggestion would be great! Thanks
|
Input CSS showing border in Chrome, Safari and Internet Explorer and no text
|
CC BY-SA 3.0
| null |
2011-04-08T16:12:09.117
|
2011-12-01T16:24:35.873
|
2011-11-26T05:46:10.273
| 234,976 | 699,000 |
[
"css",
"image",
"button",
"input",
"border"
] |
5,597,940 | 1 | 5,598,841 | null | 3 | 994 |
I am using Google Chrome for my testing because in the future the comet page will be loaded in google chrome embedded.
After about 12 hours, i guess the comet file gets too big and chrome gets the official:
How do i prevent chrome from as it seems crashing after the page has been up for that long?
Do i have to refresh the iframe?
What i tried is using the comet scripts every 2 minutes i do `$('script').remove()`, so i guess that removes them from the DOM, but the file is still getting bigger...
Can anyone help? ^_^
i will provide as much code as needed if asked. (js, or php)
|
How do i prevent chrome from getting a 'Aw snap!' with Comet?
|
CC BY-SA 3.0
| null |
2011-04-08T16:17:18.800
|
2011-04-08T17:46:35.653
| null | null | 561,731 |
[
"php",
"javascript",
"jquery",
"google-chrome",
"comet"
] |
5,598,133 | 1 | 5,611,841 | null | 1 | 4,133 |
I am using drop down menu's on a website they work perfectly except for IE.
I have spent the last two hours trying to figure this out but i just cant seem to work out what the issue is.
I am using superfish for the menu's and once you mouse off the link the menu stays on screen for about 2-3 seconds and it's slightly out of position.
I tried css fixes on the ul but it only applied it to the jquery drop down not the instance that remains.
These images illustrate what is happening;


Here is the css / html for the menu;
# Markup
```
<div class="main-menu">
<div class="menu-header">
<ul id="menu-main" class="menu sf-js-enabled">
<li id="menu-item-40" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-40">
<a class="sf-with-ul" href="http://wp.ashtonklein.com/ashton-klein/">
Ashton Klein
<span class="sf-sub-indicator"> »</span>
</a>
<ul class="sub-menu" style="visibility: hidden; display: none;">
<li id="menu-item-49" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-49">
<a class="sf-with-ul" href="http://wp.ashtonklein.com/ashton-klein/about/">
About
<span class="sf-sub-indicator"> »</span>
</a>
<ul class="sub-menu" style="visibility: hidden; display: none;">
<li id="menu-item-48" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48">
<a href="http://wp.ashtonklein.com/ashton-klein/about/who-we-are/">Who we are</a>
</li>
<li id="menu-item-47" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-47">
<a href="http://wp.ashtonklein.com/ashton-klein/about/our-vision/">Our Vision</a>
</li>
<li id="menu-item-46" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-46">
<a href="http://wp.ashtonklein.com/ashton-klein/about/our-commitment/">Our Commitment</a>
</li>
</ul>
</li>
<li id="menu-item-45" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-45">
<a class="sf-with-ul" href="http://wp.ashtonklein.com/ashton-klein/opportunities/">
Opportunities
<span class="sf-sub-indicator"> »</span>
</a>
<ul class="sub-menu" style="display: none; visibility: hidden;">
<li id="menu-item-44" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-44">
<a href="http://wp.ashtonklein.com/ashton-klein/opportunities/careers/">Careers</a>
</li>
<li id="menu-item-43" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-43">
<a href="http://wp.ashtonklein.com/ashton-klein/opportunities/franchising/">Franchising</a>
</li>
<li id="menu-item-42" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-42">
<a href="http://wp.ashtonklein.com/ashton-klein/opportunities/marketing-opportunities/">Marketing</a>
</li>
</ul>
</li>
<li id="menu-item-41" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-41">
<a href="http://wp.ashtonklein.com/ashton-klein/newsroom/">Newsroom</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
```
# CSS
```
#header .webmenu .main-menu ul
{
width:100%;
height:40px;
}
#header .webmenu .main-menu ul li
{
float:left;
line-height:30px;
font-family: 'Philosopher', arial, serif;
font-size:18px;
height:30px;
margin:5px 15px 5px 0;
padding:0 10px;
-moz-border-radius:4px;
-webkit-border-radius:4px;
border-radius: 4px;
position: relative;
z-index: 20px;
display:block;
}
#header .webmenu .main-menu ul li.current-menu-item, #header .webmenu .main-menu ul li.current-menu-parent, #header .webmenu .main-menu ul li.current-page-ancestor
{
background:url('../images/menu_current.png') repeat-x;
}
#header .webmenu .main-menu ul li a
{
color:#FFF;
text-decoration:none;
display:block;
outline:none;
}
#header .webmenu .main-menu ul li:hover
{
background:url('../images/menu_current.png') repeat-x;
}
#header .webmenu .main-menu ul li span.sf-sub-indicator
{
display:block;
float:right;
width:6px;
height:4px;
background:url('../images/menu_arrow.png') no-repeat right;
margin-left:10px;
margin-top:13px;
text-indent:-9999px;
}
#header .webmenu .main-menu ul li ul.sub-menu
{
position:absolute;
display:none;
/* corners */
border-radius:0 4px 4px;
-moz-border-radius:0 4px 4px;
-webkit-border-radius:0 4px 4px;
background:#007E63;
padding:5px;
height:auto;
width:200px;
}
#header .webmenu .main-menu ul li:hover ul.sub-menu
{
display:inherit;
left:0px;
top:28px;
}
#header .webmenu .main-menu ul li ul li
{
display:block;
float:none;
background:none;
margin-right:0;
padding:0 10px;
margin:0 0 3px;
}
#header .webmenu .main-menu ul li ul li:hover
{
background:#333333;
}
#header .webmenu .main-menu ul li ul li a, #header .webmenu .main-menu ul li ul li a:hover
{
color:#FFF;
}
#header .webmenu .main-menu ul li ul li.current-menu-item, #header .webmenu .main-menu ul li ul li.current-menu-parent
{
background:#333333;
}
#header .webmenu .main-menu ul li ul li span.sf-sub-indicator
{
background:url('../images/menu_arrow_sub.png'); background-repeat:no-repeat;
float:right;
margin-left:10px;
width:16px;
height:16px;
margin-top:8px;
text-indent:-9999px;
}
#header .webmenu .main-menu ul li ul.sub-menu li ul.sub-menu
{
position:absolute;
left:-999em;
/* corners */
border-radius:4px;
-moz-border-radius:4px;
-webkit-border-radius:4px;
background:#007E63;
padding:5px;
height:auto;
width:200px;
}
#header .webmenu .main-menu ul li ul.sub-menu li:hover ul.sub-menu
{
left:200px;
top:0;
}
```
# jQuery
```
$('ul.menu').superfish({
delay: 1000, // one second delay on mouseout
animation: {opacity:'show',height:'show'}, // fade-in and slide-down animation
speed: 'slow', // faster animation speed
autoArrows: true, // disable generation of arrow mark-up
dropShadows: false // disable drop shadows
});
```
I appreciate any help you can provide !
[http://www.stylishmedia.co.uk/ak/](http://www.stylishmedia.co.uk/ak/)
here is the link to a test version
|
Superfish Drop Down Menu's IE
|
CC BY-SA 3.0
| 0 |
2011-04-08T16:34:53.653
|
2011-04-10T13:01:45.843
|
2011-04-10T13:01:45.843
| 669,044 | 654,362 |
[
"jquery",
"css",
"internet-explorer",
"superfish"
] |
5,598,388 | 1 | 5,643,580 | null | 3 | 3,147 |
How do I make my WCF client authenticate using the ACS to my internally hosted WCF service? The issue revolves around setting a custom Realm (which I can't figure out how to set.)
My ACS is configured similar to [the ACS Samples](http://acs.codeplex.com/wikipage?title=WCF%20Certificate%20Authentication&referringTitle=Samples) however the "Realm" is defined as shown below.
---

---
```
EndpointAddress serviceEndpointAddress = new EndpointAddress( new Uri( "http://localhost:7000/Service/Default.aspx"),
EndpointIdentity.CreateDnsIdentity( GetServiceCertificateSubjectName() ),
new AddressHeaderCollection() );
ChannelFactory<IStringService> stringServiceFactory = new ChannelFactory<IStringService>(Bindings.CreateServiceBinding("https://agent7.accesscontrol.appfabriclabs.com/v2/wstrust/13/certificate"), serviceEndpointAddress );
// Set the service credentials.
stringServiceFactory.Credentials.ServiceCertificate.Authentication.CertificateValidationMode = X509CertificateValidationMode.None;
stringServiceFactory.Credentials.ServiceCertificate.DefaultCertificate = GetServiceCertificate();
// Set the client credentials.
stringServiceFactory.Credentials.ClientCertificate.Certificate = GetClientCertificateWithPrivateKey();
```
```
string acsCertificateEndpoint = String.Format( "https://{0}.{1}/v2/wstrust/13/certificate", AccessControlNamespace, AccessControlHostName );
ServiceHost rpHost = new ServiceHost( typeof( StringService ) );
rpHost.Credentials.ServiceCertificate.Certificate = GetServiceCertificateWithPrivateKey();
rpHost.AddServiceEndpoint( typeof( IStringService ),
Bindings.CreateServiceBinding( acsCertificateEndpoint ),
"http://localhost:7000/Service/Default.aspx"
);
//
// This must be called after all WCF settings are set on the service host so the
// Windows Identity Foundation token handlers can pick up the relevant settings.
//
ServiceConfiguration serviceConfiguration = new ServiceConfiguration();
serviceConfiguration.CertificateValidationMode = X509CertificateValidationMode.None;
// Accept ACS signing certificate as Issuer.
serviceConfiguration.IssuerNameRegistry = new X509IssuerNameRegistry( GetAcsSigningCertificate().SubjectName.Name );
// Add the SAML 2.0 token handler.
serviceConfiguration.SecurityTokenHandlers.AddOrReplace( new Saml2SecurityTokenHandler() );
// Add the address of this service to the allowed audiences.
serviceConfiguration.SecurityTokenHandlers.Configuration.AudienceRestriction.AllowedAudienceUris.Add( new Uri( "urn:federation:customer:222:agent:11") );
FederatedServiceCredentials.ConfigureServiceHost( rpHost, serviceConfiguration );
return rpHost;
```
... where `urn:federation:customer:222:agent:11` is the Relying party ID
... and `http://localhost:7000/Service/Default.aspx` is the location I want the above WCF / WIF client to bind to once the ACS authentication is made.
How do I edit the code above so that the client and server will both operate against a certain port (localhost:700) and also with a realm of urn:federation:customer:222:agent:11
I think I have the server code correct; however how do I set `AudienceRestriction` on the client?
|
How do I configure WCF to use a custom Realm in URN format with Azure ACS?
|
CC BY-SA 3.0
| 0 |
2011-04-08T17:01:18.200
|
2013-06-19T18:43:25.257
|
2011-04-13T19:39:58.353
| 77,501 | 328,397 |
[
"wcf",
"azure",
"wif",
"federated-identity",
"acs"
] |
5,598,953 | 1 | 5,599,301 | null | 10 | 9,894 |
if i have 2 divs (z index is not assigned), one layered over the over, can i use the reference to the top div to find which div is below it?
as far as the DOM structure goes, these two divs would be siblings. but visually they are stacked on one another.
here's an example:
```
<body>
<div id="box1" style="background:#e0e0e0;height:100px;width:100px;"></div>
<div id="box2" style="background:#000000;height:100px;width:100px;margin-top:-50px;"></div>
</body>
```
which results in this:

so i'm trying to figure out, when having the black div, box2, a way to return box1 in jquery (using selectors), because box1 is beneath box2, using jquery.
|
find elements that are stacked under (visually) an element in jquery
|
CC BY-SA 3.0
| 0 |
2011-04-08T17:58:14.293
|
2022-01-05T06:18:13.167
|
2011-04-08T18:11:38.250
| 211,983 | 211,983 |
[
"jquery"
] |
5,599,095 | 1 | 5,615,899 | null | 2 | 2,555 |
I have an image of licence plate and the numbers is marked with black squares.
what I want is to get all the coordinates of the squares, and with it to cut them from the plate.
for example this is the original image:

and this is after marking the numbers:

any help will be greatly appreciated.
|
finding x and y coordinates of black Squares - Matlab
|
CC BY-SA 3.0
| null |
2011-04-08T18:10:48.610
|
2011-04-11T01:13:46.177
| null | null | 556,011 |
[
"matlab",
"image-processing"
] |
5,599,343 | 1 | 5,629,571 | null | 18 | 37,556 |
The position of the text on the search submit button on [my blog](http://eligrey.com/blog/) is very low in Firefox 4, but not Chrome 10 or IE9. I've tried almost everything, and nothing works except lowering the font size of the text, which isn't an optimal solution as the text will be too small.
## Screenshots
Firefox 4 on Windows 7:

Google Chrome 10.0.648.204 on Windows 7:

The relevant HTML:
```
<form method="get" class="searchform" action="http://eligrey.com/blog">
<input type="search" placeholder="search" name="s" />
<input type="submit" value="🔍" title="Search" />
</form>
```
The relevant CSS rule (from [http://eligrey.com/blog/wp-content/themes/eligrey.com/style.css](http://eligrey.com/blog/wp-content/themes/eligrey.com/style.css)):
```
.searchform input[type="submit"] {
font-family: "rfhb-lpmg";
color: #ccc;
font-size: 3em;
background-color: #959595;
text-align: center;
border: 1px solid #888;
height: 34px;
width: 42px;
line-height: 34px;
-webkit-border-bottom-right-radius: 4px;
-webkit-border-top-right-radius: 4px;
-moz-border-radius-bottomright: 4px;
-moz-border-radius-topright: 4px;
border-bottom-right-radius: 4px;
border-top-right-radius: 4px;
-webkit-background-clip: padding-box;
-moz-background-clip: padding-box;
background-clip: padding-box;
-webkit-transition-property: border, background-color, box-shadow;
-webkit-transition-duration: 0.2s;
-moz-transition-property: border, background-color, box-shadow;
-moz-transition-duration: 0.2s;
}
```
rfhb-lpmg is just a custom font I made which implements U+2767 rotated floral heart bullet and U+1F50E right-pointing magnifying glass with simplistic glyphs.
|
Position of text in a submit button
|
CC BY-SA 3.0
| 0 |
2011-04-08T18:32:29.710
|
2013-02-26T12:32:11.130
|
2012-02-14T22:54:23.467
| 78,436 | 78,436 |
[
"html",
"css"
] |
5,599,580 | 1 | 5,599,730 | null | 0 | 85 |
Wondering if anyone knows how to implement the grey circles with a number indicating how many emails are in your various inboxes in iPhone mail?
Is there an existing API to use these in tableView cells? If so what is it called?
I'm considering subclassing UIView to make something similar but if it's already out there I'll use what's available.
Thanks.

|
How to make indicators like in iPhone mail that tell you how many email are in your individual inbox?
|
CC BY-SA 3.0
| null |
2011-04-08T18:56:28.523
|
2011-04-08T19:10:12.623
| null | null | 519,493 |
[
"ios",
"email",
"uitableview"
] |
5,600,028 | 1 | 5,600,134 | null | 1 | 4,018 |

above are the part of my database diagram where i am getting problem!
select columns from 3 table with the help of referencing from 1 outside table base_table and 3 table .
But Sql displaying a error
```
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >
```
How to resolve this! Is there is any better way of doing this.
I am new to sql and this is the part of my school project
One more thing the base_id from base_table i i will pass through the procedure in C#
The following are the code which giving the error.
|
How to get single result in from sql select query! SQL
|
CC BY-SA 3.0
| null |
2011-04-08T19:41:29.233
|
2011-04-08T20:04:06.963
| null | null | 1,373,033 |
[
"sql",
"sql-server",
"subquery"
] |
5,600,097 | 1 | 5,600,275 | null | 0 | 316 |
Is there any possible way to control a Dialog in Android from remote server? Let say I have an application and there I created an If Statement. For example: When the number 2 is not equal the number in my remote server, the Dialog should pop out in my application. Is there any simple way to accomplish this? Please guide me, thanks in advance!

|
Dialog controlled by remote server in Android?
|
CC BY-SA 3.0
| null |
2011-04-08T19:48:54.423
|
2011-04-08T20:32:07.350
|
2011-04-08T20:32:07.350
| 1,594,493 | 1,594,493 |
[
"android",
"dialog"
] |
5,600,330 | 1 | null | null | 0 | 573 |
I am stuck in a problem working on Flex datagrid, in an AIR application.
How can I access a specific row in datagrid in Flex. Please note that i am not talking about the selectedItem or any particular record of dataProvider of datagrid.
What exactly I want to do is I am showing some files data (name, description etc.) on a datagrid, and the data of these files comes from an array which is the dataProvider of the datagrid.
Now when these files are being uploaded one by one to the server (using a webservice), I want to show a ProgressBar on, say, "Progress" column in the datagrid. How can I access this column for a particular row in datagrid i.e. current file being uploaded.
Please refer to image to better understand my query.
Please guide me.
Thanks
|
flex/AIR datagrid access particular row
|
CC BY-SA 3.0
| null |
2011-04-08T20:16:10.217
|
2011-04-09T20:28:39.147
| null | null | 212,692 |
[
"apache-flex",
"datagrid"
] |
5,600,646 | 1 | null | null | -1 | 5,686 |
>
[height of the dropdown box display](https://stackoverflow.com/questions/5600982/height-of-the-dropdown-box-display)
hi
how can I adjust the height of the list in the dropdown because I have too many values loaded in the drop down box. For example, it only show 10 entries, and with scrollbars to see remaining. does anyone know how to do that?
---
this not what I want

---

I want this ,which only display 5 option and with scrollbars to see remaining
|
adjust the height of the list in dropdown box
|
CC BY-SA 3.0
| null |
2011-04-08T20:51:07.253
|
2011-04-08T21:41:53.663
|
2017-05-23T10:30:23.117
| -1 | 684,871 |
[
"javascript",
"jquery",
"html"
] |
5,600,867 | 1 | 5,600,932 | null | 2 | 128 |
QUERY:
```
drop table #foot
create table #foot (
id int primary key not null,
name varchar(50) not null
)
go
drop table #note
create table #note (
id int primary key not null,
note varchar(MAX) not null,
foot_id int not null references #foot(id)
)
go
insert into #foot values
(1, 'Joe'), (2, 'Mike'), (3, 'Rob')
go
insert into #note (id, note, foot_id) values (1, 'Joe note 1', 1)
go
insert into #note (id, note, foot_id) values(2, 'Joe note 2', 1)
go
insert into #note (id, note, foot_id) values(3, 'Mike note 1', 2)
go
select F.name, N.note, N.id
from #foot F left outer join #note N on N.foot_id=F.id
```
RESULT:

QUESTION:
How can I create a view/query resulting in one row for each master record (#foot) along with fields from the most recently inserted detail (#note), if any?
GOAL:

(NOTE: the way I would tell which one is most recent is the id which would be higher for newer records)
|
How to show fields from most recently added detail in a view?
|
CC BY-SA 3.0
| null |
2011-04-08T21:16:35.123
|
2011-04-08T21:31:16.523
| null | null | 398,546 |
[
"sql",
"tsql",
"sql-server-2008-r2"
] |
5,600,982 | 1 | null | null | 1 | 723 |
>
[adjust the height of the list in dropdown box](https://stackoverflow.com/questions/5600646/adjust-the-height-of-the-list-in-dropdown-box)
hi
how can I adjust the height of the list in the dropdown because I have too many values loaded in the drop down box. For example, it only show 10 entries, and with scrollbars to see remaining. does anyone know how to do that? you may more clear to see my attached picture.
---

this is what I want. it only show 5 entries, and with scrollbars to see remaining.
|
height of the dropdown box display
|
CC BY-SA 3.0
| null |
2011-04-08T21:31:17.590
|
2011-04-08T23:56:54.563
|
2017-05-23T12:01:09.963
| -1 | 684,871 |
[
"javascript",
"jquery",
"html"
] |
5,601,151 | 1 | 5,601,194 | null | 2 | 1,461 |
```
'app name' specifies a minimum os of version 4.3, which is too high to be installed on the iPhone
```
This is the error I am receiving when I attempt to deploy my application to my iPhone, which is on the latest version, 4.2. I have searched everywhere in an attempt to find a solution to this issue, and everything simply says to change the build to target the previous OS. However...

...I do not see 4.2 as an availible option. 4.2 is the highest version I can update my iPhone to, and 4.3 is the lowest version of the SDK I have.
How can I fix this?
|
'app name' specifies a minimum os of version 4.3, which is too high to be installed on the iPhone. 4.2 isn't an option
|
CC BY-SA 3.0
| null |
2011-04-08T21:52:30.987
|
2011-04-08T22:06:03.050
|
2011-04-08T21:58:33.983
| 225,239 | 225,239 |
[
"xcode",
"ios"
] |
5,601,308 | 1 | 5,601,348 | null | 3 | 4,953 |
I'm working on creating a simple 3D rendering engine in Java. I've messed about and found a few different ways of doing perspective projection, but the only one I got partly working had weird stretching effects the further away from the centre of the screen the object was moved, making it look very unrealistic. Basically, I want a method (however simple or complicated it needs to be) that takes a 3D point to be projected and the 3D point and rotation (possibly?) of the 'camera' as arguments, and returns the position on the screen that that point should drawn at. I don't care how long/short/simple/complicated this method is. I just want it to generate the same kind of perspective you see in a modern 3D first person shooters or any other game, and I know I may have to use matrix multiplication for this. I don't really want to use OpenGL or any other libraries because I'd quite like to do this as a learning exercise and roll my own, if it's possible.
Any help would be appreciated quite a lot :)
Thanks, again
- James
To show what I mean by the 'stretching effects' here are some screen shots of a demo I've put together. Here a cube (40x40x10) centered at the coords (-20,-20,-5) is drawn with the only projection method I've got working at all (code below). The three screens show the camera at (0, 0, 50) in the first screenshot then moved in the X dimension to show the effect in the other two.



Projection code I'm using:
```
public static Point projectPointC(Vector3 point, Vector3 camera) {
Vector3 a = point;
Vector3 c = camera;
Point b = new Point();
b.x = (int) Math.round((a.x * c.z - c.x * a.z) / (c.z - a.z));
b.y = (int) Math.round((a.y * c.z - c.y * a.z) / (c.z - a.z));
return b;
}
```
|
Perspective 3D Projection in Java
|
CC BY-SA 3.0
| null |
2011-04-08T22:11:52.137
|
2011-04-10T15:54:08.643
|
2011-04-10T15:54:08.643
| 690,007 | 690,007 |
[
"java",
"3d",
"matrix",
"projection",
"perspective"
] |
5,601,570 | 1 | 5,601,982 | null | 8 | 1,402 |
for a project in OpenCV I would like to as good as possible with of course minimal noise.
For this I would like to use an algorithm.
I already have a running program but didn't find a way today to get fair enough results.
I already have the following (grayscale) images given:
```
IplImage* grayScale;
IplImage* lastFrame;
IplImage* secondLastFrame;
IplImage* thirdLastFrame;
```
So far I have tried to substract current frames image and the last frame with `cvSub();` or with `cvAbsDiff();` to get the moving parts.
But unfortunately I still get a lot of noise there (i.e. due to slightly moving trees when it's windy) and if the object that moves is quite big and has a homogenic color (let's say a person in a white or black shirt), the substraction only detects the changes in the image on the left and right side of the person, not on the body itself, so one object is sometimes detected as two objects...
```
cvAbsDiff(this->lastFrame,grayScale,output);
cvThreshold(output,output,10,250, CV_THRESH_BINARY);
cvErode(output,output, NULL, 2);
cvDilate(output,output, NULL, 2);
```
To get rid of this noise I tried eroding and dilating the images with `cvErode()` and `cvDilate()` but this is quite slow and if the moving objects on the screen are small the erosion deletes quite a bit to much of the object so after delating I don't always get a good result or splitted up objects.
After this I do a `cvFindContours()` to get contours, check on size and if it fits draw a rectangle around the moving objects. But results are poor because often an object is split into several rectangles due to the bad segmentation.
A friend now told me I might try using more than two following frames for the substraction since this might already reduce the noise... but I don't really know what he meant by that and how I should add/substract the frames to get an image that is almost noise free and shows big enough object blobs.
Can anybody help me with that? How can I use more than one frames to get an image that has as minimum noise as possible but with big enough blobs for the moving objects? I would be thankful for any tipps...
I have uploaded a current video right here: [http://temp.tinytall.de/](http://temp.tinytall.de/) Maybe somebody wants to try it there...
This is a frame from it: The left image shows my results from cvFindContours() and the right one is the segmented image on which I then try to find the contours...

So one large objects it works fine if they are moving fast enough... i.e. the bicycle.. but on walking people it doesn't always get a good result though... Any ideas?
|
Optimizing algorithm for segmentation through image substraction
|
CC BY-SA 3.0
| null |
2011-04-08T22:52:36.053
|
2013-01-15T01:08:09.033
|
2013-01-15T01:08:09.033
| 422,353 | 475,944 |
[
"image",
"image-processing",
"opencv",
"computer-vision",
"image-segmentation"
] |
5,601,605 | 1 | 5,601,691 | null | 1 | 384 |
I have a C++/CLI library that I'd like to target the .NET 3.5 SP1 Client Profile, but the client profile does not appear in the list of available frameworks. Is it possible to do this?

|
C++/CLI: is it possible to target the .NET 3.5 Client Profile using Visual Studio 2008?
|
CC BY-SA 3.0
| null |
2011-04-08T22:59:24.997
|
2012-03-22T02:30:34.363
|
2012-01-10T19:17:26.147
| 50,776 | 64,290 |
[
".net",
".net-3.5",
"c++-cli",
".net-client-profile"
] |
5,601,806 | 1 | 5,601,941 | null | 10 | 23,990 |
I am trying to use an Icon in my WPF application, and some images for other things, but I keep getting errors from the Designer View saying stuff like "path-x is not a valid resource or cannot be found." - where "path-x" is the path of whatever image I am trying to use.
If it were looking in the right place, I bet it'd find it ;)
BUT, then, it decided to not give me that error anymore. So, I went ahead and clicked Run (F5), to see my new Icon in the title bar. Only to be confronted with this beast:
> "System.Windows.Markup.XamlParseException
occurred Message='Provide value on
'System.Windows.Baml2006.TypeConverterMarkupExtension'
threw an exception.' Line number '5'
and line position '50'.
Source=PresentationFramework
LineNumber=5 LinePosition=50
StackTrace:
at System.Windows.Markup.XamlReader.RewrapException(Exception
e, IXamlLineInfo lineInfo, Uri
baseUri)
at System.Windows.Markup.WpfXamlLoader.Load(XamlReader
xamlReader, IXamlObjectWriterFactory
writerFactory, Boolean
skipJournaledProperties, Object
rootObject, XamlObjectWriterSettings
settings, Uri baseUri)
at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader
xamlReader, Boolean
skipJournaledProperties, Object
rootObject, XamlAccessLevel
accessLevel, Uri baseUri)
at System.Windows.Markup.XamlReader.LoadBaml(Stream
stream, ParserContext parserContext,
Object parent, Boolean closeStream)
at System.Windows.Application.LoadComponent(Object
component, Uri resourceLocator)
at One_Stop_Management.MainWindow.InitializeComponent()
in c:\Users\Jason\Documents\Visual
Studio 2010\Projects\One Stop
Management\One Stop
Management\MainWindow.xaml:line 1
at One_Stop_Management.MainWindow..ctor()
in C:\Users\Jason\Documents\Visual
Studio 2010\Projects\One Stop
Management\One Stop
Management\MainWindow.xaml.cs:line 25
InnerException: System.IO.IOException
Message=Cannot locate resource 'images/favicon.ico'.
Source=PresentationFramework
StackTrace:
at MS.Internal.AppModel.ResourcePart.GetStreamCore(FileMode
mode, FileAccess access)
at System.IO.Packaging.PackagePart.GetStream(FileMode
mode, FileAccess access)
at System.IO.Packaging.PackWebResponse.CachedResponse.GetResponseStream()
at System.IO.Packaging.PackWebResponse.GetResponseStream()
at System.IO.Packaging.PackWebResponse.get_ContentType()
at System.Windows.Media.Imaging.BitmapDecoder.SetupDecoderFromUriOrStream(Uri
uri, Stream stream, BitmapCacheOption
cacheOption, Guid& clsId, Boolean&
isOriginalWritable, Stream& uriStream,
UnmanagedMemoryStream&
unmanagedMemoryStream, SafeFileHandle&
safeFilehandle)
at System.Windows.Media.Imaging.BitmapDecoder.CreateFromUriOrStream(Uri
baseUri, Uri uri, Stream stream,
BitmapCreateOptions createOptions,
BitmapCacheOption cacheOption,
RequestCachePolicy uriCachePolicy,
Boolean insertInDecoderCache)
at System.Windows.Media.Imaging.BitmapFrame.CreateFromUriOrStream(Uri
baseUri, Uri uri, Stream stream,
BitmapCreateOptions createOptions,
BitmapCacheOption cacheOption,
RequestCachePolicy uriCachePolicy)
at System.Windows.Media.ImageSourceConverter.ConvertFrom(ITypeDescriptorContext
context, CultureInfo culture, Object
value)
at System.Windows.Baml2006.TypeConverterMarkupExtension.ProvideValue(IServiceProvider
serviceProvider)
at MS.Internal.Xaml.Runtime.ClrObjectRuntime.CallProvideValue(MarkupExtension
me, IServiceProvider serviceProvider)
InnerException: "

Why is this thing giving me attitude? I'm just trying to insert an image...
# Updates
Here is the XAML that was produced for the icon when I tried to add the Icon using the Properties Pane:
```
<Fluent:RibbonWindow x:Class="One_Stop_Management.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Fluent="clr-namespace:Fluent;assembly=Fluent"
Title="One Stop Management" Height="727" Width="1208" Icon="Resources\favicon.ico">
```
# Latest Update

I can't even add an icon using the properties pane, below is the error it gives me.
|
Using Images and Icons in WPF
|
CC BY-SA 3.0
| 0 |
2011-04-08T23:37:00.180
|
2014-06-16T10:31:23.347
|
2011-04-09T00:20:22.793
| 696,091 | 696,091 |
[
"c#",
".net",
"wpf",
"image",
"icons"
] |
5,601,950 | 1 | 5,791,452 | null | 143 | 77,671 |
I struggled finding a how-to which provides a stable solution for using Qt with Visual Studio 2010, so after collecting all the bits of information and some trial and error, I would like to write my solution into a guide.
## The problem, or why is it not possible to use prebuilt binaries?
It seems that using binaries built for Visual Studio 2008 might work in some special cases, but I found them not to work. In my case they compiled OK, but they produce runtime errors, like this:

or when started from Visual Studio 2010:

: I found a blog post analysing why does it work for some people, while it does not for others. In one word, it depends on whether you have Visual Studio 2008 installed on the same machine, or not.
[http://blog.paulnettleship.com/2010/11/11/troubleshooting-visual-studio-2010-and-qt-4-7-integration/](http://blog.paulnettleship.com/2010/11/11/troubleshooting-visual-studio-2010-and-qt-4-7-integration/)
> The most important thing (that I stupidly didn’t realize) was the fact that you CANNOT use the Visual Studio 2008 compiled libraries and dll’s (available on the Qt webpage) if you don’t have Visual Studio 2008 installed. The reason is because the Qt SDK you download is a debug build which is dependant on the VC9.0 DebugCRT, meaning it needs the Visual C++ 2008 Debug Runtime installed, which is NOT available as a redistributable installer. The only way to install the DebugCRT is to install the entirety of Visual Studio 2008.
|
How to build Qt for Visual Studio 2010
|
CC BY-SA 3.0
| 0 |
2011-04-09T00:05:12.620
|
2017-01-13T23:12:09.460
|
2011-04-26T13:53:24.323
| 518,169 | 518,169 |
[
"c++",
"visual-studio",
"visual-studio-2010",
"qt",
"build"
] |
5,602,090 | 1 | null | null | 3 | 747 |
I realize that I really need to rewrite my programs data structure (not now, but soon, as the deadline is monday), as I am currently using VST (VirtualStringTree) to store my data.
What I would like to achieve, is a Contact List structure. The Rootnodes are the Categories, and the children are the Contacts. There is a total of 2 levels.
The thing is though, that I need a contact to display in more than 1 category, but they need to be synchronized. Particularly the .
Currently, to maintain sync, I loop thru my whole tree to find nodes that have the same ID as the one that was just changed. But doing so is very slow when there is a huge ammount of nodes.
So, I thought: Would it be possible to display of the Contact Object, in multiple
Note: Honestly I am not 100% familiar with the terminology - what I mean by Instance, is one Object (or Record), so I will not have to look thru my entire tree to find Contact Objects with the same ID.
Here is an example:

As you see, Todd Hirsch appears in Test Category, and in All Contacts. But behind the scenes, those are 2 , so when I change a property on one of the node's (Like CheckState), or something in the node's Data Record/Class, the 2 nodes are not synchronized. And currently the only way I can synchronize them, is to loop thru my tree, find all the nodes that house that same contact, and apply the changes to them and their data.
To summarize: What I am looking for, is a way to use one object/record, and display it in several Categories in my tree - and whenever one node gets checked, so will every other node that houses the same Contact object.
Do I make any sense here?
|
Is it possible to display one object multiple times in a VirtualStringTree?
|
CC BY-SA 3.0
| 0 |
2011-04-09T00:39:36.547
|
2011-04-09T10:53:59.547
| null | null | 561,545 |
[
"delphi",
"data-structures",
"synchronization",
"nodes",
"virtualtreeview"
] |
5,602,079 | 1 | 5,602,924 | null | 3 | 3,518 |
I'm relatively new to Vim and have been using it without issues so far. I'd either launch MacVim from my dock or using `mvim` from the command line. This worked great so far, but just now I've run into an issue. For no apparent reason, launching MacVim from the command line started to create a MacVim window that had all the colors screwed up. When I'd launch it from the dock, everything is fine.

The colorscheme is the same between both editors (solarized), so I'm really puzzled as to what the issue is. My MacVim is installed using Homebrew, and it looks like the executable is the same for the dock and the command line. I've even tried launching `/Applications/MacVim.app/Contents/MacOS/MacVim` directly, it also opens up white. I'm using Janus, and I've tried nuking my .vim and recreating it with the rake script, but no change.
Any help greatly appreciated, thank you in advance.
My `.vimrc`/`.gvimrc` files are pretty large, but they're the basic values that come with Janus. My `.vimrc.local`/`.gvimrc.local` are the same and look like this,
```
syntax enable
set background=dark
colorscheme solarized
map f gg=G
```
I've also found that this doesn't seem to be a problem with other themes like ir_black (which Janus defaults to).
This seems to be a [known issue](https://github.com/altercation/vim-colors-solarized/issues/#issue/9) with at least a few other people experiencing it. Will post a solution when one is found.
|
MacVim color issues when launching from command line
|
CC BY-SA 3.0
| null |
2011-04-09T00:35:33.093
|
2011-04-09T04:41:56.603
|
2011-04-09T01:03:41.883
| 238,292 | 238,292 |
[
"vim",
"macvim"
] |
5,602,150 | 1 | 5,602,269 | null | 0 | 123 |
what ever I try it always ends up so the second checkbox in a row doesn't show, and I don't know how to put admob wedget on the bottom of the screen
This is what I'm aiming for, thanks ahead of time:

|
How to make this Layout
|
CC BY-SA 3.0
| null |
2011-04-09T00:53:21.923
|
2011-04-09T01:21:57.540
| null | null | 531,928 |
[
"android",
"xml",
"layout",
"android-layout"
] |
5,602,350 | 1 | 5,603,578 | null | 4 | 3,019 |
I'm customizing the UI for one of my apps, and the idea is that a text area is initially bordered gray when out of focus, and when it comes into focus, the border becomes bright white. My app uses a dark theme, and for a single-lined `NSTextField`, this works great.
I'm running into problems with a subclassed `NSTextView`, however. In order to alter the border properly, I ended up having to actually subclass the parent `NSScrollView`, but am still seeing strange behavior. I the red box to fill the entire scroll view, as this would allow me to stroke (instead of filling, which is just for testing) the path, producing a nice border. Instead, the red box seems to be only filling to the internal child view.
The following code snippet, which is for the `NSScrollView` subclass:
```
- (void)drawRect:(NSRect)dirtyRect {
[super drawRect:dirtyRect];
NSRect borderRect = self.bounds;
borderRect.origin.y += 1;
borderRect.size.width -= 1;
borderRect.size.height -= 4;
BOOL inFocus = ([[self window] firstResponder] == self);
if (!inFocus) {
inFocus = [self anySubviewHasFocus:self];
}
if (inFocus) {
[[NSColor colorWithDeviceRed:.8 green:.2 blue:0 alpha:1] set];
} else {
[[NSColor colorWithDeviceRed:.1 green:.8 blue:0 alpha:1] set];
}
[NSGraphicsContext saveGraphicsState];
[[NSGraphicsContext currentContext] setShouldAntialias:NO];
[NSBezierPath fillRect:borderRect];
[NSGraphicsContext restoreGraphicsState];
NSLog(@"My bounds: %@", NSStringFromRect(borderRect));
NSLog(@"Super (%@) bounds: %@", [self superview], NSStringFromRect(borderRect));
}
```
Produces the screenshot as seen below. Also, see the output in the log, which that the entire view should be filled. This is the only output that is ever shown, regardless of the size of the text inside. Entering carriage returns increases the height of the box, but does not produce different output. (And I would like the box to fill the entire bounds.)
```
2011-04-08 21:30:29.789 MyApp[6515:903] My bounds: {{0, 1}, {196, 87}}
2011-04-08 21:30:29.789 MyApp[6515:903] Super (<EditTaskView: 0x3a0b150>) bounds: {{0, 1}, {196, 87}}
```

Thanks to for his answer. See below for the proper behavior when not focused, and when focused.


|
Subclassing NSScrollView drawRect: Method
|
CC BY-SA 3.0
| 0 |
2011-04-09T01:40:55.110
|
2011-04-09T13:17:11.470
|
2011-04-09T13:17:11.470
| 88,111 | 88,111 |
[
"objective-c",
"cocoa",
"xcode",
"drawing",
"nsview"
] |
5,602,476 | 1 | 5,602,508 | null | 0 | 3,009 |
Here are the tables:

I need to retrieve a collection of Student objects, so I can access their names, last names, etc.
I'm kind of stuck so any help is very welcome, I'm always trying to learn and apply new things to make them stick. :)
So far, I've tried this:
```
private void cmbGradeParalelo_SelectedIndexChanged(object sender, EventArgs e)
{
int gradeParaleloId = Convert.ToInt32(cmbGradeParalelo.SelectedValue);
using (StudentRepository studentRepo = new StudentRepository())
{
studentRepo.FindAllStudents().Where(s => s.GradeStudents
}
}
```
`.GradeStudents` is an `EntityCollection<GradeStudent>` so I I can query the data using Linq, but I don't know how. I've never done something like this. :)
Thank you for your time!
|
Using Entity Framework how can I retrieve a collection from a table?
|
CC BY-SA 3.0
| null |
2011-04-09T02:18:01.797
|
2011-04-12T22:17:21.243
| null | null | null |
[
"c#",
"linq",
"entity-framework"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.