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,638,534 | 1 | null | null | 6 | 1,953 |
I have used Haar classifier with OpenCV before succesfully. Unfortunately it seems to work only on square objects and fixed angles (i.e. faces). However I need to find "long" (rectangular) objects which have different angles (see sample input image).
Is there a way to train Haar classifier to find such objects? All I can find are tutorials for face recognition. Any other alternative approches?

|
OpenCV - Haar classifier for long objects with different angles
|
CC BY-SA 3.0
| 0 |
2011-04-12T16:26:05.923
|
2014-02-14T21:14:05.307
| null | null | 177,421 |
[
"image-processing",
"opencv",
"pattern-matching",
"classification",
"image-recognition"
] |
5,639,591 | 1 | 5,639,756 | null | 3 | 4,803 |
I want to download a file (e.g. [http://rapidpich.ir/d/555864](http://rapidpich.ir/d/555864)) programmatically using php. However, when I attempt to follow the link in my web browser, I'm asked for a username and password.
How can I provide these credentials in PHP and retrieve the file?

|
Downloading file programmatically with HTTP authentication
|
CC BY-SA 3.0
| null |
2011-04-12T18:00:19.543
|
2012-12-20T10:21:10.723
|
2012-12-20T10:21:10.723
| 367,456 | 704,606 |
[
"php",
"http",
"basic-authentication"
] |
5,639,614 | 1 | 5,641,679 | null | 1 | 1,830 |
## Environment
- - - - -
## Goal
I have a three form application and an external class (Program.cs) that has the application entry point, `Main()`. The main form loads first and then, from within `MainForm_Load(...)`, instantiates/shows a new form kind of like a splash screen. I want all three forms to be maximized. All three forms have the following properties set:
- `this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;`- `this.WindowState = System.Windows.Forms.FormWindowState.Maximized;`- `this.ControlBox = false;`
## Problem
The "splash screen" form shows up full screen without any issue. I then dispose of it and show the main screen (first to load and the param for `Application.Run();`. From the main screen, once a list box SelectedIndexChanged event is detected, a third form is shown (leaving the main form behind said third form). That third form shows the task bar the top portion of my form: 
Upon closing this form, the main form now has the task bar overlayed as well.
## Code
Friend paste links. Let me know if I should just post the code here. WorkOrderView is over a thousand lines so I figured this would be easier.
- ["Main" Form (WorkOrders.cs)](http://friendpaste.com/5Sp743sEUGC5Lex512uOUg)- ["Third" Form (WorkOrderView.cs)](http://friendpaste.com/5NJWfIvVRerXJj8zBbz2iN)
## Unrelated Suggestions
I am quite a green programmer and I especially lack experience in this environment. So, if you have any suggestions/criticisms on the way I'm doing some things, don't hesitate to hit me with them. Probably best to just comment on the post instead of posting an answer for those types of replies.
## Thanks!
|
Start Bar Shows Up Over Maximized Form (Pocket PC 2003)
|
CC BY-SA 3.0
| null |
2011-04-12T18:02:35.703
|
2011-04-14T21:06:08.307
|
2011-04-12T20:37:03.263
| 662,565 | 662,565 |
[
"c#",
"winforms",
"compact-framework",
".net-1.1",
"pocketpc"
] |
5,639,806 | 1 | 5,640,118 | null | 2 | 2,161 |
I'm studying simple physics for 2d games and I would like a help with a simulation I'm trying to do.
I have a bar that will fall over a fixed ball in the ground, xaml below:
```
<Canvas Background="CornflowerBlue">
<Rectangle Name="bar" Width="200" Height="20" Fill="Cornsilk" Canvas.Left="250" Canvas.Top="50" />
<Ellipse Name="ball" Height="50" Width="50" Fill="PaleGreen" Canvas.Left="380" Canvas.Top="250" />
</Canvas>
```

I have all the calculations done to simulate the bar falling due to gravity but what I really need help with is, once the bar hits the ball, it's gonna have one side in the ground and the other side over the ball, which could be pretty much represented with the xaml:
```
<Canvas Background="CornflowerBlue">
<Rectangle Name="bar" Width="200" Height="20" Fill="Cornsilk" Canvas.Left="250" Canvas.Top="246.675" RenderTransformOrigin="0.5,0.5" >
<Rectangle.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="-18.897"/>
<TranslateTransform/>
</TransformGroup>
</Rectangle.RenderTransform>
</Rectangle>
<Ellipse Name="ball" Height="50" Width="50" Fill="PaleGreen" Canvas.Left="380" Canvas.Top="250" />
</Canvas>
```

And I don't know how to make the left side of the bar hit the ground while the left side will be over the ball in phisics terms.
I know there are awesome physics engine available like Farseen but I just want to understand how it would work in this case.
I know how to get the bar's Y based on time, so I keep checking it until it colides with the ball, but then what after that?
Thanks!
|
Help with physics simulation in WPF
|
CC BY-SA 3.0
| 0 |
2011-04-12T18:20:05.820
|
2011-04-12T18:49:52.757
| null | null | 17,648 |
[
"c#",
"wpf",
"physics",
"game-physics"
] |
5,640,413 | 1 | null | null | 7 | 246 |
When i use the camera.takePicture, this is what i get, ONLY from the HTC G2 and Thunderbolt, it works fine on every other phone i've tried(EVO, Nexus One, Samsung Galaxy S, Droid, Droid X, etc....) anybody got any ideas? i can tell it's what i'm taking a picture of, it's just coming back all scrambled???

|
image coming out scrambled from camera on Thunderbolt & G2?
|
CC BY-SA 3.0
| 0 |
2011-04-12T19:19:57.787
|
2013-01-09T00:47:20.610
| null | null | 518,970 |
[
"android"
] |
5,640,452 | 1 | 5,640,512 | null | 3 | 10,393 |
What's the best(fastest) way to do this?

This generates what I believe is the correct answer, but obviously at N = 10e6 it is painfully slow. I think I need to keep the Xi values so I can correctly calculate the standard deviation, but are there any techniques to make this run faster?
```
def randomInterval(a,b):
r = ((b-a)*float(random.random(1)) + a)
return r
N = 10e6
Sum = 0
x = []
for sample in range(0,int(N)):
n = randomInterval(-5.,5.)
while n == 5.0:
n = randomInterval(-5.,5.) # since X is [-5,5)
Sum += n
x = np.append(x, n)
A = Sum/N
for sample in range(0,int(N)):
summation = (x[sample] - A)**2.0
standard_deviation = np.sqrt((1./N)*summation)
```
|
Methods for quickly calculating standard deviation of large number set in Numpy
|
CC BY-SA 3.0
| 0 |
2011-04-12T19:23:25.313
|
2011-04-12T19:55:22.897
| null | null | 308,962 |
[
"python",
"statistics",
"numpy",
"numerical-methods"
] |
5,640,483 | 1 | 5,642,964 | null | 2 | 585 |
I have two tables with a many to one relationship which represent and within an auction system. Each lot can have zero or more bids associated with it. Each bid is associated with exactly one lot.
My table structure (with irrelevant fields removed) looks something like this:

For one type of auction the winning bid is the .
E.g. if there are four bids for a given lot: [1, 1, 2, 4] the lowest unique bid is 2 ( 1).
So far I have been able to construct a query which will find the lowest unique bid for a single specific lot (assuming the lot ID is `123`):
```
SELECT id, value FROM bid
WHERE lot = 123
AND amount = (
SELECT value FROM bid
WHERE lot = 123
GROUP BY value HAVING COUNT(*) = 1
ORDER BY value
)
```
This works as I would expect (although I'm not sure it's the most graceful approach).
I would now like to construct a query which will get the lowest unique bids for lots at once. Essentially I want to perform a `JOIN` on the two tables where one column is the result of something similar to the above query. I'm at a loss as to how to use the same approach for finding the lowest unique bid in a `JOIN` though.
Am I on the wrong track with this approach to finding the lowest unique bid? Is there another way I can achieve the same result?
Can anyone help me expand this query into a `JOIN`?
Is this even possible in SQL or will I have to do it in my application proper?
Thanks in advance.
(I am using SQLite 3.5.9 as found in Android 2.1)
|
Using SQL(ite) how do I find the lowest unique child for each parent in a one to many relationship during a JOIN?
|
CC BY-SA 3.0
| null |
2011-04-12T19:25:51.207
|
2011-04-14T13:43:11.030
|
2011-04-12T19:53:59.100
| 153,304 | 153,304 |
[
"sql",
"sqlite",
"join"
] |
5,640,735 | 1 | 5,640,856 | null | 0 | 228 |
My last question was going this path before, but I think this warrants a new question because I want to to go for this path now (instead of attempting to do what I was trying to do in my other question).
What I want to do is to have "Invisible" values in NSUserDefaults. I don't care about Apple's guidelines because my app is aimed at Jailbroken phones. This is what I have so far:
The root.plist in settings.bundle looks like this (so far, because I want to add a password field later):

first_launch is a value that I don't want the user to modify directly. As it's name may imply, it's value will be "false" once the user launches the app once and goes through my small configuration wizard.
Like you can see in the plist, first_launch has TRUE/YES as it's initial value, yet this code:
```
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSLog(@"%d", [defaults boolForKey:@"first_launch"]);
```
ALWAYS show me it's 0. What can I do to have "invisible" values in my settings bundle? I don't want the user to modify first_launch for obvious reasons, and I always want to add a password field that will only be accessible from the app itself.
|
Is There A Way To Make "Invisible" User Defaults?
|
CC BY-SA 3.0
| null |
2011-04-12T19:48:20.803
|
2011-04-12T21:57:13.697
|
2011-04-12T21:57:13.697
| 457,406 | 648,767 |
[
"ios4"
] |
5,640,823 | 1 | 5,640,910 | null | 160 | 162,778 |
What does the red exclamation point icon in Eclipse mean? There are lots of different search results on the Internet about "red exclamation point icons" and "red exclamation mark decorators" and "red bang icons," no doubt because lots of plugins and programming-related tools use red exclamation point icons. So, to be clear, this is the one I mean:

It appears as a decorator on projects in the Package Explorer view.
In my case, the icon went away when a missing build path variable was filled in. I'm using MyEclipse 9.0, but I don't think this is MyEclipse-specific. Other people on the Internet have reported that it has to do with other issues, including Subclipse, the `.svn` folder and moving files between working copies.
|
What does the red exclamation point icon in Eclipse mean?
|
CC BY-SA 3.0
| 0 |
2011-04-12T19:54:29.367
|
2021-05-13T07:39:37.127
| null | null | 122,607 |
[
"eclipse",
"svn",
"icons"
] |
5,640,827 | 1 | 5,656,560 | null | 0 | 742 |
On a page I have a an iFrame and a swf, I've been trying to use ExternalInterface to pass values from the swf to the iFrame, anyone ever tried this and had any luck? I won't be able to post any code until tomorrow, will update then if needed.
Thanks in adavnce.
Here is a visualization of what I need to accomplish, perhaps if it can't be done the way I said someone will have a suggestion of another way to accomplish this.

|
ExternalInterface passing values from swf to an iFrame on the same page
|
CC BY-SA 3.0
| null |
2011-04-12T19:54:37.880
|
2011-04-13T22:43:32.963
|
2011-04-13T14:13:07.167
| 560,128 | 560,128 |
[
"javascript",
"actionscript-3",
"iframe",
"externalinterface",
"scorm1.2"
] |
5,641,015 | 1 | 13,381,673 | null | 3 | 1,089 |
I've become accustomed to the WPF designer, I'm wondering if it's possible to align a form in the center of the designer, rather than top-left.

|
Center-Align Form in Windows Form Designer
|
CC BY-SA 3.0
| null |
2011-04-12T20:10:06.057
|
2012-11-14T15:20:40.910
| null | null | 84,873 |
[
"winforms",
"visual-studio-2010"
] |
5,641,060 | 1 | null | null | 1 | 118 |
I'm using Alfred on mac. It's some kind of launcher that helps opening applications and documents faster.
I've been wondering how they did their custom controls. I don't know if they subclassed an NSView or NSTextField. Here is a screenshot. 
Thanks in advance!
|
What should I subclass to get custom controls?
|
CC BY-SA 3.0
| null |
2011-04-12T20:13:30.393
|
2011-04-12T20:53:43.127
|
2020-06-20T09:12:55.060
| -1 | null |
[
"cocoa",
"user-interface",
"subclassing"
] |
5,641,127 | 1 | 5,641,548 | null | 1 | 15,987 |
I know, this topic has been opened 1000 times, but I didn't find a suitable solution (or a solution I could understand).
I have a simple page (wordpress) with a fixed nav menu on the left, scrollable content in center and a fixed footer (always visible).
I have 2 problems I have tried to solve in every way:
1) the wrapper (100% height) wraps ok until you scroll the page, but does not extend after the scroll (see attached image, page is scrolled to bottom).
2) the content at the bottom is under the footer, I couldn't find a way to apply a -30 padding to make readable the final part of the content ( I think this relates to the problem no.1).
Here is the CSS (also used a reset.css based on YUI reset):
```
/* LAYOUT */
.aligncenter { display:block; margin:0 auto }
.alignleft { float:left }
.alignright { float:right }
.wp-caption { border:1px solid #666; text-align:center; background:#ccc; padding:10px; margin:10px }
br.clear { clear:both; display:block; height:1px; margin:-1px 0 0 0 }
/* GENERAL LAYOUT */
html, body{
margin : 0;
padding : 0;
height : 100%;
border : none;
}
#wrapper{
min-height: 100%;
width: 100%;
background: red;
overflow: hidden;
}
#container{
width: 960px;
margin-left: 40px;
padding-bottom: 30px
}
#navigation{
position: fixed;
overflow:hidden;
width: 200px;
}
#content{
position: absolute;
overflow: auto;
width: 420px;
margin-left: 220px;
}
li > a {
display: block;
}
a {outline: none;}
/* NAVIGATION */
h1.logo {
height: 155px;
}
#navigation ul{
margin:0;
padding:0;
text-align: right;
}
#navigation ul li{
height:28px;
display: inline-block;
color:#000;
padding: 0 0 0 0;
overflow:hidden;
line-height: 28px;
margin-bottom: 7px;
}
#navigation li a{
padding: 0 28px 0 0;
}
.nav-blog{
width:190px;
border-left-color: #d1bbe8;
border-left-width: 10px;
border-left-style: solid;
background-color: #edece6;
}
.nav-eventi{
width:190px;
border-left-color: #aa87a0;
border-left-width: 10px;
border-left-style: solid;
background-color: #edece6;
}
.nav-bio{
width:190px;
border-left-color: #e2b893;
border-left-width: 10px;
border-left-style: solid;
background-color: #edece6;
}
.nav-discography{
width:190px;
border-left-color: #365f68;
border-left-width: 10px;
border-left-style: solid;
background-color: #edece6;
}
.nav-photos{
width:190px;
border-left-color: #545768;
border-left-width: 10px;
border-left-style: solid;
background-color: #edece6;
}
.nav-videos{
width:190px;
border-left-color: #4b5668;
border-left-width: 10px;
border-left-style: solid;
background-color: #edece6;
}
.nav-contact{
width:190px;
border-left-color: #686055;
border-left-width: 10px;
border-left-style: solid;
background-color: #edece6;
}
/* ----------Active links----------- */
.home .nav-blog
{
width: 150px;
}
/* POST */
#ilpost{
width: 420px;
margin: 0 0 18px 0;
}
.spaziovuoto{
height: 155px;
}
.type-blog{
border-top-color: #d1bbe8;
border-top-style: solid;
border-top-width: 12px;
}
#tempo{
height: 32px;
background: url('../images/flatback.png');
}
.iltitolo{
background-color: #edece6;
}
.ilcontenuto{
background-color: #edece6;
}
/* PLAYER */
#player{
clear: both;
width: 100%;
position: fixed;
bottom: 0px;
height: 30px;
background: #000;
color:#fff;
}
```
And the HTML:
(head omitted)
```
<body class="home blog">
<div id="wrapper">
<div id="container">
<div id="navigation">
<h1 class="logo">Logo</h1>
<ul>
<li class="nav-blog "><a href="/">blog</li>
<li class="nav-eventi sel"><a href="/">eventi</a></li>
<li class="nav-bio sel"><a href="/">bio</a></li>
<li class="nav-discography sel"><a href="/">discography</a></li>
<li class="nav-photos sel"><a href="/">photos</a></li>
<li class="nav-videos sel"><a href="/">videos</a></li>
<li class="nav-contact sel"><a href="/">contact</a></li>
</ul>
</div><!-- .navigation -->
<script type="text/javascript">
jQuery(function($){
$.supersized({
//Background image
transition_speed : 50,
slides : [ { image : 'http://localhost/xxxxxxxx/wp-content/themes/xxxxxxxxxx/images/sfondotest1080.jpg' } ]
});
});
</script>
<div id="content">
<div class="spaziovuoto"></div>
<!-- LOOOOOOOOOOOP -->
<div id="ilpost" class="type-blog">
<div id="tempo">
Uncategorized // 10 April, 2011</div><!-- .tempo -->
<div class="ilcontenuto">
<p class="iltitolo">test post 4</p>
<p><!-- p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica} -->Morbi euismod magna ac lorem rutrum elementum. Donec viverra auctor lobortis. Pellentesque eu est a nulla placerat dignissim. Morbi a enim in magna semper bibendum. Etiam scelerisque, nunc ac egestas consequat, odio nibh euismod nulla, eget auctor orci nibh vel nisi. Aliquam erat volutpat. Mauris vel neque sit amet nunc gravida congue.</p>
<p> </p>
</div>
</div><!-- .ilpost -->
<div id="ilpost" class="type-blog">
<div id="tempo">
Uncategorized // 10 April, 2011</div><!-- .tempo -->
<div class="ilcontenuto">
<p class="iltitolo">test post 3</p>
<p><!-- p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica} -->Morbi euismod magna ac lorem rutrum elementum. Donec viverra auctor lobortis. Pellentesque eu est a nulla placerat dignissim. Morbi a enim in magna semper bibendum. Etiam scelerisque, nunc ac egestas consequat, odio nibh euismod nulla, eget auctor orci nibh vel nisi. Aliquam erat volutpat. Mauris vel neque sit amet nunc gravida congue.</p>
<p> </p>
</div>
</div><!-- .ilpost -->
<div id="ilpost" class="type-blog">
<div id="tempo">
Uncategorized // 10 April, 2011</div><!-- .tempo -->
<div class="ilcontenuto">
<p class="iltitolo">test post 2</p>
<p><!-- p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica} --> <!-- p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica} -->Morbi euismod magna ac lorem rutrum elementum. Donec viverra auctor lobortis. Pellentesque eu est a nulla placerat dignissim. Morbi a enim in magna semper bibendum. Etiam scelerisque, nunc ac egestas consequat, odio nibh euismod nulla, eget auctor orci nibh vel nisi. Aliquam erat volutpat. Mauris vel neque sit amet nunc gravida congue.</p>
<p> </p>
</div>
</div><!-- .ilpost -->
<div id="ilpost" class="type-blog">
<div id="tempo">
Uncategorized // 10 April, 2011</div><!-- .tempo -->
<div class="ilcontenuto">
<p class="iltitolo">Hello world!</p>
<p>Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!</p>
</div>
</div><!-- .ilpost -->
</div><!-- .content -->
<ul class="xoxo">
</ul>
</div> <!-- container -->
</div> <!-- E wrapper-->
<div id="player">Player</div>
</body>
</html>
```
Just in case, I attached an image with an explanation.

Thanks for your help!
|
Wrapper 100% height, fixed footer and fixed menu
|
CC BY-SA 3.0
| 0 |
2011-04-12T20:17:53.720
|
2011-04-12T20:57:04.123
| null | null | 355,613 |
[
"css",
"height",
"wrapper",
"footer",
"fixed"
] |
5,641,282 | 1 | 5,641,572 | null | 0 | 570 |
I have a strange problem. Sometimes it happens, sometimes it doesn't.
I have an array of GLfloat with 8 items. When EAGLView draw it, it shows the two lines of the array, but also an additional line.

```
+ (Class)layerClass {
return [CAEAGLLayer class];
}
- (id)initWithCoder:(NSCoder*)coder {
if ((self = [super initWithCoder:coder])) {
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 {
int numero=malloc_size(puntosPintar)/sizeof(GLfloat);
[EAGLContext setCurrentContext:context];
glBindFramebufferOES(GL_FRAMEBUFFER_OES, viewFramebuffer);
glViewport(0, 0, backingWidth, backingHeight);
glClear(GL_COLOR_BUFFER_BIT);
glVertexPointer(2, GL_FLOAT, 0, puntosPintar);
glEnableClientState(GL_VERTEX_ARRAY);
glColor4f(1,1,1,1);
glDrawArrays(GL_LINES, 0, numero);
glBindRenderbufferOES(GL_RENDERBUFFER_OES, viewRenderbuffer);
[context presentRenderbuffer:GL_RENDERBUFFER_OES];
free(puntosPintar);
}
- (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;
}
- (void)destroyFramebuffer {
glDeleteFramebuffersOES(1, &viewFramebuffer);
viewFramebuffer = 0;
glDeleteRenderbuffersOES(1, &viewRenderbuffer);
viewRenderbuffer = 0;
if(depthRenderbuffer) {
glDeleteRenderbuffersOES(1, &depthRenderbuffer);
depthRenderbuffer = 0;
}
}
- (void)dealloc {
if ([EAGLContext currentContext] == context) {
[EAGLContext setCurrentContext:nil];
}
[context release];
[super dealloc];
}
@end
```
```
puntosPintar=(GLfloat*)malloc(sizeof(GLfloat)*8);
puntosPintar[0] = -0.25f;
puntosPintar[1] = -1.49f;
puntosPintar[2] = -0.1f;
puntosPintar[3] = 0.0f;
puntosPintar[4] = 0.25f;
puntosPintar[5] = -1.49f;
puntosPintar[6] = 0.1f;
puntosPintar[7] = 0.0f;
```
|
OpenGl ES iPhone, strange line
|
CC BY-SA 3.0
| null |
2011-04-12T20:30:03.080
|
2011-04-12T20:59:53.170
| null | null | 552,314 |
[
"iphone",
"objective-c",
"opengl-es",
"line"
] |
5,641,536 | 1 | 5,667,677 | null | 4 | 9,478 |
(EDIT) The same code (with no need for impersonation!) runs successfully from a Windows 7 client, but NOT from a Windows 2008 R2 client! Here's the code in question. (Original message follows code below.)
```
var entry = new DirectoryEntry("IIS://" + tbHost.Text + "/W3SVC", tbUsername.Text, tbPassword.Password);
foreach (DirectoryEntry site in entry.Children)
{
Console.Write("Site {0}\n", site.Name);
foreach (PropertyValueCollection prop in site.Properties)
Console.Write("{0}={1}\n", prop.PropertyName, prop.Value);
}
```
I read [here](http://www.ureader.com/msg/163387.aspx) that, for the IIS provider, you can't pass credentials when creating the [DirectoryEntry](http://msdn.microsoft.com/en-us/library/system.directoryservices.directoryentry.aspx) object. You have to do [impersonation](http://www.codeproject.com/KB/cs/cpimpersonation1.aspx). So I tried the following code, but I still get a COMException with a text of "Unknown error (0x80005000)" when I try to read a property, just as I did when I previously tried to pass username and password for the `DirectoryEntry` constructor. Here's the rundown:
- [LogonUser()](http://msdn.microsoft.com/en-us/library/aa378184%28v=vs.85%29.aspx)`LOGON32_LOGON_NEW_CREDENTIALS``LOGON32_LOGON_INTERACTIVE`- `hosts`- [Metabase Explorer](http://support.microsoft.com/kb/840671)
.
```
const int LOGON32_LOGON_INTERACTIVE = 2;
const int LOGON32_LOGON_NETWORK = 3;
const int LOGON32_LOGON_NEW_CREDENTIALS = 9;
const int LOGON32_PROVIDER_DEFAULT = 0;
const int LOGON32_PROVIDER_WINNT50 = 3;
const int LOGON32_PROVIDER_WINNT40 = 2;
const int LOGON32_PROVIDER_WINNT35 = 1;
[DllImport("advapi32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
public static extern int LogonUser(String lpszUserName, string lpszDomain, string lpszPassword, int dwLogonType, int dwLogonProvider, ref IntPtr phToken);
[DllImport("kernel32.dll", CharSet = CharSet.Auto)]
public extern static bool CloseHandle(IntPtr handle);
[DllImport("kernel32.dll")]
extern static int GetLastError();
(...)
IntPtr myToken = IntPtr.Zero;
if (LogonUser(tbUsername.Text, tbHost.Text, tbPassword.Password, LOGON32_LOGON_NEW_CREDENTIALS, LOGON32_PROVIDER_DEFAULT, ref myToken) == 0)
{
int causingError = GetLastError();
throw new System.ComponentModel.Win32Exception(causingError);
}
WindowsImpersonationContext myMission = WindowsIdentity.Impersonate(myToken);
string mbUri = "IIS://" + tbHost.Text + "/MimeMap";
DirectoryEntry myDirEntry = new DirectoryEntry(mbUri);
Console.Write("{0}\n", myDirEntry.Properties["KeyType"]);
myDirEntry.Close();
myMission.Undo();
if (myToken != IntPtr.Zero)
CloseHandle(myToken);
```

|
"Unknown error (0x80005000)" trying to read remote IIS 6 Metabase with DirectoryEntry and Impersonation (C#)
|
CC BY-SA 3.0
| null |
2011-04-12T20:56:14.560
|
2013-10-22T18:21:09.843
|
2011-04-13T18:27:52.363
| 110,800 | 110,800 |
[
".net",
"iis-6",
"impersonation",
"directoryservices",
"metabase"
] |
5,641,527 | 1 | null | null | 0 | 178 |
I'm writing a browser-based (Javascript and jQuery) linguistic analysis tool that extracts text from HTML and then extracts linguistic units such as sentences, words, and so on.
To import text, a PHP backend spiders a given URL and sanitizes the resulting HTML. Then that HTML is inserted into a `div#container` in the interface, something like this:

I have run into some difficulties when the source HTML page is very long. Reading and inserting such a page into the interface's `DOM` doesn't seem to cause problems (though it takes a while).
But running a word frequency algorithm over the spidered content is very slow if the page is long. If the page is approaches 100K words, say, it will pretty much bring things to a grinding halt.
So, I see a few options:
1. Change the PHP spider so that it will truncate the source document or subdivide it into multiple documents
2. Change the word frequency algorithm so that it's less exact, and samples the word distribution rather than recording it completely
3. Try out this new-fangled Web Worker thing to see if I can distribute the calculation across multiple background processes.
It would appear to me that (3) is just the word of thing that Web Workers is designed to do. I'm imagining splitting the spidered content into chunks, and then assigning one Web Worker to each chunk. The word frequency profile of each chunk can be returned from the Web Worker, and then summed up and rendered to the chart.
Before I attempt this, I was hoping I could get a sanity check from other folks here who may have worked with Web Workers before. For one thing, I'm wondering if splitting up the contents of `div#container` efficiently will be an issue -- I suppose it would involve some sort of traversal through the DOM tree under `div#container`.
|
Could WebWorkers be used to calculate word frequencies on a very long page?
|
CC BY-SA 3.0
| null |
2011-04-12T20:55:20.517
|
2011-04-12T21:20:28.460
| null | null | null |
[
"javascript",
"frequency",
"web-worker"
] |
5,641,704 | 1 | null | null | 3 | 1,184 |
I have created a C# project on my home computer with Windows 7, VS 2008 and using .net framework 2.0. My app is using "Irklang" sound library. Using InnoSetup 5 i have created setup for my app. Setup includes all needed files, it installs them well but when i install my app on some other computer i got some confusing errors. First one looks like this:

When i create install script flaging "irklang.dll" with "regserver" (to be registered during setup), i got this error during installation of my program: "Unable to register DLL/OCX: RegSrv32 failed with exit code 0x4". Message got standard "Abort, Ignore, Retry" buttons, but, as always, "Retry" won't fix it.
What should i do? How to fix this error which shouldn't even bother average programmer?
This is my Inno setup instalation file:
```
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
[CustomMessages]
dotnetmissing=This setup requires the .NET Framework v2.0. Please download and install the .NET Framework v.2 and run this setup again. Do you want to download the framework now?
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{10087152-8A1D-4C0B-9BFC-E463C2F8E3C0}
AppName=Kucni rad
AppVersion=1.5
;AppVerName=Kucni rad 1.5
DefaultDirName={pf}\Kucni rad
DefaultGroupName=Kucni rad
OutputDir=C:\Users\Boza\Desktop
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Code]
function InitializeSetup(): Boolean;
var
ErrorCode: Integer;
NetFrameWorkInstalled : Boolean;
Result1 : Boolean;
begin
NetFrameWorkInstalled := RegKeyExists(HKLM,'SOFTWARE\Microsoft\.NETFramework\policy\v2.0');
if NetFrameWorkInstalled =true then
begin
Result := true;
end;
if NetFrameWorkInstalled = false then
begin
NetFrameWorkInstalled := RegKeyExists(HKLM,'SOFTWARE\Microsoft\.NETFramework\policy\v2.0');
if NetFrameWorkInstalled =true then
begin
Result := true;
end;
if NetFrameWorkInstalled =false then
begin
//Result1 := (ExpandConstant('{cm:dotnetmissing}'), mbConfirmation, MB_YESNO) = idYes;
Result1 := MsgBox(ExpandConstant('{cm:dotnetmissing}'),
mbConfirmation, MB_YESNO) = idYes;
if Result1 =false then
begin
Result:=false;
end
else
begin
Result:=false;
ShellExec('open',
'http://download.microsoft.com/download/5/6/7/567758a3-759e-473e-bf8f-52154438565a/dotnetfx.exe',
'','',SW_SHOWNORMAL,ewNoWait,ErrorCode);
end;
end;
end;
end;
[Dirs]
Name: "{app}\Sounds"
[Files]
Source: "C:\Users\Boza\Desktop\Novi kucnirad\kucnirad\bin\Debug\kucnirad.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\Boza\Desktop\Novi kucnirad\kucnirad\bin\Debug\Sounds\*"; DestDir: "{app}\Sounds"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "C:\Users\Boza\Desktop\Novi kucnirad\kucnirad\bin\Debug\ikpMP3.dll"; DestDir: "{app}"; Flags: ignoreversion regserver
Source: "C:\Users\Boza\Desktop\Novi kucnirad\kucnirad\bin\Debug\irrKlang.NET2.0.dll"; DestDir: "{app}"; Flags: ignoreversion regserver
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{group}\Kucni rad"; Filename: "{app}\kucnirad.exe"
Name: "{group}\{cm:UninstallProgram,Kucni rad}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\Kucni rad"; Filename: "{app}\kucnirad.exe"; Tasks: desktopicon
[Run]
Filename: "{app}\kucnirad.exe"; Description: "{cm:LaunchProgram,Kucni rad}"; Flags: nowait postinstall skipifsilent
```
EDIT:
I GOT IT! IT'S NOT PROBLEM WITH MY APP, IT'S PROBLEM WITH DOWNLOADED DLL ITSELF! It seems that IrrKlang.dll version 1.3 (the newest version, i used) is causeing the problems! Version 1.1 is working just fine!
|
C# application and assembly hell!
|
CC BY-SA 3.0
| null |
2011-04-12T21:12:41.980
|
2011-04-13T00:17:22.217
|
2011-04-12T22:42:06.083
| 676,699 | 676,699 |
[
"c#",
"dll",
"installation"
] |
5,641,769 | 1 | null | null | 10 | 3,512 |

So I have a arbitary line (See an example shown in fig 1) made up of n points
I want to draw an outline around this line (see fig 2) so I need to calculate the points of the surrounding polygon.
I started by performing a dilation on the line but this wont work - see figure 3
Any suggestions on how to do this?
I suspect calculating the normal of each line segment for use in translating the new line below and a new line above its current position and then extending each new line to infinity and defining the points as the intersections?
|
How to draw an outline around any line
|
CC BY-SA 3.0
| 0 |
2011-04-12T21:19:08.543
|
2018-07-10T10:13:11.827
|
2011-04-12T21:48:40.697
| 46,616 | 46,616 |
[
"math",
"vector",
"geometry",
"outline"
] |
5,641,791 | 1 | null | null | 4 | 346 |
Okay guys, I think I have done everything I can except one important thing: Shape Extraction. I already do this fairly in a fairly simple way, but there are some cases where it really messes up. The way I do this is:
- - - - - - - - - - - -
I repeat this process until the main point list becomes empty. This means we extracted all the shapes.
Now I do a combine shapes several times. This makes it so if I have |, ---, and | next to each other, it will combine to create a rectangle. Do you understand what I mean? Lets say I have a circle, the above extracting code will sometimes say half of the circle is one shape, and the other half is another shape. So when I combine the shapes, it becomes one circle.
Sigh, I cannot post pictures too and I cannot upload this anywhere but an uploading site. This has some issues. Take a look at the following:

The picture on the left is the starting picture, and the one on the right is the outline points. Now I click the determine shape button. It determines the shape of the most dominant shape in the picture (the shape object that contains the most points in its outline).

Now, it correctly says this is a quadrilateral but for the wrong reasons. Due to my combine shapes (which needed to be done in order to even get a rectangle shape otherwise it will be a small line for one shape and another small line as another shape), it added the outline of the fingers to the testing.
So the entire single shape (the black outline to the right in the second picture) is tested. Not just the "rectangle" part, but everything in that picture is tested. Can you guys think of any way to clean this thing up and extract JUST the rectangle portion instead of having the fingers included? I was thinking of some variation of A* for this, but in a case like this picture, it does not create a loop. So what do I do once A* visits every single point (since it cannot return to the starting point). What do I do then?
Can anybody help me try to get this figured out please?
|
How to tell if the most obvious object in a picture is a shape?
|
CC BY-SA 3.0
| 0 |
2011-04-12T21:21:33.103
|
2013-09-10T17:37:36.257
|
2013-09-10T17:37:36.257
| 881,229 | 704,909 |
[
"image-processing",
"feature-extraction",
"shape-recognition"
] |
5,641,913 | 1 | 6,122,676 | null | 1 | 8,220 |
I have a weird problem going on with defining two separate custom XML button definitions. I created a test project solely to replicate the error, so I'll be adding the full code and screenshots of the problem. Basically, I'd like to use 9-patch images to define custom XML button configurations that can be reused.
I've defined two XML files:
z_btn_xml_glossy_blue_lightblue.xml:
```
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_focused="true"
android:drawable="@drawable/z_btn_glossy_lightblue" >
<corners
android:radius="3dp" />
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp" />
</item>
<item
android:state_pressed="true"
android:drawable="@drawable/z_btn_glossy_lightblue" >
<corners
android:radius="3dp" />
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp" />
</item>
<item
android:drawable="@drawable/z_btn_glossy_blue" >
<corners
android:radius="3dp" />
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp" />
</item>
</selector>
```
z_btn_xml_glossy_black_white.xml:
```
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_focused="true"
android:drawable="@drawable/z_btn_glossy_white" >
<corners
android:radius="3dp" />
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp" />
</item>
<item
android:state_pressed="true"
android:drawable="@drawable/z_btn_glossy_white" >
<corners
android:radius="3dp" />
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp" />
</item>
<item
android:drawable="@drawable/z_btn_glossy_black" >
<corners
android:radius="3dp" />
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp" />
</item>
</selector>
```
As you can see, both of these files are essentially the exact same, but using different drawables. My main.xml layout file is:
```
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="5dip"
android:paddingRight="5dip"
android:paddingTop="0dip"
android:paddingBottom="3dip" >
<Button
android:id="@+id/BTNHostWaitingStartGame"
android:background="@drawable/z_btn_xml_glossy_blue_lightblue"
android:textColor="#FFFFFF"
android:textSize="18sp"
android:layout_marginRight="2dip"
android:layout_width="wrap_content"
android:layout_height="45dip"
android:layout_weight="1.0"
android:text="Start Game" />
<Button
android:id="@+id/BTNHostWaitingCancelGame"
android:background="@drawable/z_btn_xml_glossy_black_white"
android:textColor="#FFFFFF"
android:textSize="18sp"
android:layout_marginLeft="2dip"
android:layout_width="wrap_content"
android:layout_height="45dip"
android:layout_weight="1.0"
android:text="Cancel Game" />
</LinearLayout>
```
Pretty simplistic, it just creates two buttons. I won't post the test activity file because all it does is set the layout to R.layout.main.
Here is a screenshot of the Graphical Layout within Eclipse, which looks like what I want the buttons to look like:

However, on the emulator, it looks like the following:

As you can see, the second button is not being styled. Can anyone shed light on why this is? It is the same on devices as well. Is there some limitation here that I'm just not aware of or not seeing?
Thanks for the help!
|
Android Custom Button XML: Can't Use Two Different XML Drawable Files? [Screenshots Included]
|
CC BY-SA 3.0
| 0 |
2011-04-12T21:35:43.450
|
2011-05-25T10:04:03.870
| null | null | 255,394 |
[
"android",
"xml",
"android-layout",
"drawable",
"android-xml"
] |
5,641,938 | 1 | 5,642,015 | null | 16 | 31,575 |
I'm reviewing this database and creating the foreign keys, believe me they did not exist. I'm using SSMS to visually let me know what foreign keys are missing and also create them. Is there any configuration to let the diagram designer show if a specific column is already part of a foreign key? That would help me identify missing FKs faster.
This is how it's showed currently:

This is what I'm looking for (or something like that):

I just need some visual indicator (like I've seen in other tools) that shows me if a column is part of a FK.
|
How to make Database Diagram visually show Foreign Keys in Management Studio?
|
CC BY-SA 3.0
| 0 |
2011-04-12T21:38:40.420
|
2015-03-30T14:18:51.560
|
2011-08-04T16:53:19.457
| 570,191 | 570,191 |
[
"sql-server",
"sql-server-2008",
"ssms"
] |
5,641,997 | 1 | 5,642,982 | null | 228 | 138,590 |
Is it necessary to write `<html>`, `<head>` and `<body>` tags?
For example, I can make such a page:
```
<!DOCTYPE html>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Page Title</title>
<link rel="stylesheet" type="text/css" href="css/reset.css">
<script src="js/head_script.js"></script><!-- this script will be in head //-->
<div>Some html</div> <!-- here body starts //-->
<script src="js/body_script.js"></script>
```
And [Firebug](https://en.wikipedia.org/wiki/Firebug_%28software%29) correctly separates head and body:

The [W3C validator](https://en.wikipedia.org/wiki/W3C_Markup_Validation_Service) says it's valid.
But I rarely see this practice on the web.
Is there a reason to write these tags?
|
Is it necessary to write HEAD, BODY and HTML tags?
|
CC BY-SA 4.0
| 0 |
2011-04-12T21:46:03.740
|
2022-03-16T16:51:00.633
|
2022-03-16T16:18:32.307
| 63,550 | 547,242 |
[
"html",
"tags"
] |
5,642,119 | 1 | 7,221,275 | null | 2 | 2,150 |
I've got a pretty weird issue and can't find a solution. These two pictures show my problem:


In the first picture you can see, that there is no fading edge. If I move the bottom gallery a little bit further, the upper small gallery switches its position (I implemented this behaviour) and now there is a fading edge on both galleries.
The issue comes from the small gallery. But I don't understand why it is affecting the fading edge of the bigger gallery. The same effect appears on the right sight.
Both galleries are nested in a linear layout, which is nested again in a linear layout. I never touch the values for the fading edge.
Does somebody have an idea how to fix the issue?
|
Android fading edge disappears
|
CC BY-SA 4.0
| null |
2011-04-12T21:58:23.943
|
2019-04-14T15:45:45.810
|
2019-04-14T15:45:45.810
| 2,756,409 | 704,945 |
[
"android",
"image",
"gallery",
"fading"
] |
5,642,126 | 1 | 5,642,289 | null | 0 | 728 |
To do an image like this:

It has to support a score from 0.0 to 10.0, and the solid color is painted accordingly -- for 1.0, it is 36 degree, for 9.0, it is 360 x 0.9 = 324 degree.
Is there a good way to do it just using HTML / CSS / SVG / Javascript? The requirement is that it needs to work on IE 7 and up, FF, Chrome, and Safari.
---
I was thinking of using a solid loop (1 image), plus 20 images with alpha transparencies to cover up the solid loop, so that a granularity of 0.5 (such as 4.0, 4.5, 5.0) are all covered, but the downside is that there are 21 images total (can put into a sprite, but still quite large).
|
What is good CSS / HTML / SVG / Javascript to do a loop image for score 0 to 10? (need to work on IE 7 and other common browsers)
|
CC BY-SA 3.0
| null |
2011-04-12T21:59:44.357
|
2011-04-12T22:17:39.260
|
2011-04-12T22:10:54.320
| 325,418 | 325,418 |
[
"javascript",
"html",
"css",
"svg"
] |
5,642,404 | 1 | 5,643,069 | null | 2 | 7,209 |
Here's my issue I have a login and want to line up the EditText fields. See the mockup picture attached .
I have tried a few ways and cannot figure out how to make the fields lineup.
I really hate layouts in Android I spend more time just messing with things to line up right. Wish they would just scrap it and use something more intuitive, as its more like using tables in HTML. So in advance thanks for your help and cheers!
|
Android Create aligned fields Layout
|
CC BY-SA 3.0
| 0 |
2011-04-12T22:32:33.907
|
2012-02-06T15:11:13.417
|
2012-02-06T15:11:13.417
| 346,309 | 346,309 |
[
"android",
"layout",
"alignment",
"android-edittext"
] |
5,642,647 | 1 | 5,642,666 | null | 3 | 1,078 |

I know how to use \t and \n to make the source look pretty. However, as you can see something mysterious is happening to my first anchor tag aka the first think I'm echoing. I'm in chrome if that matters.
```
for ( $counter = 0; $counter <= sizeof($projectImages)-1; $counter += 1) {
echo '<a href="#">'."\n";
echo '<img class="sidebar-image" src="#">'."\n";
echo '</a>'."\n";
}
```
|
Why does first php echo indent(tab)?
|
CC BY-SA 3.0
| null |
2011-04-12T23:05:29.920
|
2011-04-12T23:08:37.193
| null | null | 340,688 |
[
"php",
"html",
"regex"
] |
5,643,490 | 1 | 5,643,622 | null | 0 | 446 |
In my python shell with white background it looks like this:

As you can see, when there is an error, it's white text on white background. In order to see them, I have to highlight the text. I haven't got any luck finding out what face controls those colors. Anyone has any idea?
Thanks
|
Emacs ipython shell error message foreground color setting
|
CC BY-SA 3.0
| null |
2011-04-13T01:30:31.840
|
2011-04-13T01:58:23.940
| null | null | 649,157 |
[
"python",
"emacs",
"foreground"
] |
5,643,528 | 1 | 5,644,549 | null | 0 | 899 |
I followed this [css-tricks](http://css-tricks.com/snippets/css/sticky-footer/) how-to, to implement a sticky footer. I was successful but noticed that the (min)-height:100% has an negative effect on when I try to apply a margin-left of right to my primaryContent div.
At a certain height it causes a block of whitespace to show up. The only work-around I've found so far is to use padding instead of margin.
The height that this happens can be seen in my screenshot below. And I also notice if I remove the "background:inherit" line from #primaryContent div that the background of the container div stops at the same height that the margin white space problem occurs.
Any type of help is appreciated, links to the source code are:
[default.css](http://pastebin.com/xVXbPQQH)
[index.html](http://pastebin.com/LV32Qp9X)
[reset.css](http://pastebin.com/TqSTezZU)
Screenshot:

|
height:100% margin white space/block problem
|
CC BY-SA 3.0
| null |
2011-04-13T01:38:03.223
|
2011-04-13T05:15:58.893
| null | null | 386,631 |
[
"css",
"xhtml"
] |
5,643,592 | 1 | null | null | 2 | 5,577 |
I am using a PNG file as CSS Sprites, and the color profile is making the PNG colors look different on Firefox and on Chrome (on a Macbook Pro)
What is the best color profile to use before saving this PhotoShop file (.psd) as a PNG file? (or best to remove it completely and how?)
---
Details:
This is the Edit -> Color Settings in PhotoShop CS5:

What should they be set to before saving the file as PNG? (or can change it when saving?)
Also, it is really strange that on Chrome, if I look at the file at
[http://foobar:9000/images/sprites.png](http://foobar:9000/images/sprites.png)
or
[http://localhost:3000/images/sprites.png](http://localhost:3000/images/sprites.png)
the color orange looks dark.
but if I view the same image on
[http://foobar.mycompany.com:9000/images/sprites.png](http://foobar.mycompany.com:9000/images/sprites.png)
or
[http://hello.mycompany.com:8080/images/sprites.png](http://hello.mycompany.com:8080/images/sprites.png) (using ssh tunnel into my localhost)
now the color orange is bright. They point to the exact same file and even if I download them and do a diff, they are binary equal. Anybody knows why?
|
What is the best color profile to use for a PNG file for CSS Sprites?
|
CC BY-SA 3.0
| 0 |
2011-04-13T01:50:29.883
|
2020-05-18T18:45:32.387
|
2011-04-13T01:55:48.490
| 325,418 | 325,418 |
[
"css",
"png",
"photoshop",
"color-profile"
] |
5,643,887 | 1 | null | null | 2 | 7,897 |
One of my coworkers set me up with a provisioning profile through our corporate profile. I have read through several tutorials and none of them corresponded to the steps he actually took to get it set up. In the end my device was listed under the devices section of the organizer with a green circle next to it (I am guessing that's good?) but when I try to run the application on my device I get the error I mentioned in the subject of this post. I should mention my device is jailbroken running iOS 4.2.6. Is the "jailbrokenness" of my device an issue?
This is like day one with Xcode and it is pretty overwhelming coming from the Linux command line and Emacs. I don't expect a complete walk through from any of you. But if you can point me to a nice long tutorial showing me how to set this up with the latest version of Xcode I would appreciate it.

|
Xcode cannot run using the selected device No provisioned iOS devices are available
|
CC BY-SA 3.0
| null |
2011-04-13T02:56:14.160
|
2014-09-24T07:28:05.077
|
2014-09-24T07:28:05.077
| 1,753,005 | 705,183 |
[
"xcode",
"profile",
"provisioning",
"jailbreak"
] |
5,643,973 | 1 | 5,644,049 | null | 2 | 6,185 |
I'm trying to get the value of my div into Javascript. It's a Drupal website and I want to convert currencies and displaying them in a javascript popup.
So far I have this:
```
<?php
print "<script type='text/javascript'>";
$rate=currency_api_convert("HKD", "CNY");
print "exchangerate = ".$rate["value"].";";
print "var $displaycur = getElementById('record-price');";
print "$displaycur;";
print "</script>";
?>
```
And all I get in my browers is:
```
<script type="text/javascript">
exchangerate = 0.8406;var = getElementById('record-price');;
</script>
```
Although I know the reason why it's displayed like this, I still don't know how to get the ID of the div in a proper variable.
Any ideas? Should I use innerHTML?
A part of the source files:
```
<?php
// $Id: page.tpl.php,v 1.18.2.1 2009/04/30 00:13:31 goba Exp $
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language ?>" lang="<?php print $language->language ?>" dir="<?php print $language->dir ?>">
<head>
<?php print $head ?>
<title><?php print $head_title ?></title>
<?php print $styles ?>
<?php print $scripts ?>
<?php
// lets get the exchange rate from HKD to RMB, with the help of yahoo finance api and the currency api module
// we pass the value to javascript, the tooltip will handle the rest
print "<script type='text/javascript'>";
$rate=currency_api_convert("HKD", "CNY");
print "exchangerate = ".$rate["value"].";";
print "</script>";
?>
<script type="text/javascript">
function showCurrency() {
alert('$rate');
}
</script>
<!--[if lte IE 7]>
<?php print phptemplate_get_ie_styles(); ?>
<![endif]-->
<!--[if IE 6]>
<style type="text/css">
.fg-menu-ipod .fg-menu li { width: 95%; }
.fg-menu-ipod .ui-widget-content { border:0; }
.views-field-field-performer-value { margin-left:-150px;}
.views-field-field-instruments-value { margin-left:-150px;}
.coda-nav{display:block; position:absolute; width:400px;height:20px;top:260px;right:100px;z-index:125421;} </style>
<![endif]-->
</head>
<body<?php print phptemplate_body_class($left, $right); ?>>
```
And the :
```
print '<div id="part1-right-line3">';
print '<div id="record-price">';
print uc_currency_format($node->sell_price);
print '</div>';
print '</div>';
print '<div id="part1-right-line4">';
print '<div id="add-to-cart">';
print drupal_get_form('uc_product_add_to_cart_form_'. $node->nid, $node);
print '</div>';
print '</div>';
print '</div>';
```
And here is the output:

Please tell me if you need more, cause there is :)
Thanks in advance
|
Get div value by id - Javascript
|
CC BY-SA 3.0
| 0 |
2011-04-13T03:11:28.190
|
2011-04-13T04:35:27.067
|
2011-04-13T04:32:45.497
| 452,421 | 452,421 |
[
"php",
"javascript",
"drupal",
"html"
] |
5,644,326 | 1 | 5,644,446 | null | 18 | 5,064 |
Here is a screenshot.

What's the name and its shortcut key of the 3rd button in `View` group? (2nd button is + + , and first is + )
|
What's the shortcut for "Hide or show the Utilities" pane in Xcode4?
|
CC BY-SA 3.0
| 0 |
2011-04-13T04:16:43.347
|
2015-09-15T04:46:21.387
|
2013-02-11T09:07:36.633
| 656,600 | 246,776 |
[
"keyboard-shortcuts",
"xcode4"
] |
5,644,673 | 1 | 5,646,297 | null | 0 | 7,834 |
I have an input form, nested within a div, defined like this:
```
<div class="login-input">
<input type="text" name="userId">
</div>
```
I've added a button below, and inside the click event for that button, I have code like this:
```
click: function(){
var user = document.getElementsByName(inputTitle)[0].value;
var myRequest = new Request({
url: '/Context/servletName',
method: 'post',
data: {'user': user},
onRequest: function(){
$('container').setStyle('cursor', 'progress');
},
onSuccess: function(responseText){
$('container').setStyle('cursor', 'auto');
window.location = responseText;
},
onFailure: function(){
$('container').setStyle('cursor', 'auto');
}
});
myRequest.send();
}
```
This works fine in all of the browsers I've tested so far (Chrome, FF, Safari) but in IE8, the following line of code is causing problems:
```
var user = document.getElementsByName(inputTitle)[0].value;
```
I verified in IE dev tools that inputTitle has a value of "userId". The problem is that
```
document.getElementsByName(inputTitle)[0];
```
Is undefined.
I also did a little bit of playing around. Adding this to watch returns what looks like a valid object:
```
// Returns valid object
document.getElementsByName(inputTitle);
// Returns null
document.getElementsByName(inputTitle).item(0);
document.getElementsByName(inputTitle).value;
```
As always, thanks in advance...
EDIT: Proof I'm not crazy....



|
Getting undefined when trying to get form value in IE8
|
CC BY-SA 3.0
| null |
2011-04-13T05:09:13.433
|
2011-04-14T02:25:11.127
|
2011-04-14T02:25:11.127
| 513,828 | 513,828 |
[
"javascript",
"internet-explorer",
"forms",
"mootools"
] |
5,644,670 | 1 | null | null | 0 | 558 |
This question is in continuation of "[why D3DXCreateCylinder is not creating a cylinder?](https://stackoverflow.com/questions/5583646/why-d3dxcreatecylinder-is-not-creating-a-cylinder)". I m able to draw the cylinder but it is only drawing it as .
The code is as follows
```
void draw_Cylinder(void){
D3DXMATRIX rot_matrix;
D3DXMATRIX trans_matrix;
D3DXMATRIX world_matrix;
static float rot_triangle=0.0f;
static float rot_triangle2=0.0f;
D3DXMatrixRotationY(&rot_matrix,rot_triangle); //Rotate the cylinder
D3DXMatrixRotationX(&rot_matrix,rot_triangle2); //Rotate the cylinder
D3DXMatrixTranslation(&trans_matrix,2.0f,0,20.0f); //Shift it 2 units to the left
D3DXMatrixMultiply(&world_matrix,&rot_matrix,&trans_matrix);
D3DMATERIAL9 material;// = new D3DMATERIAL9();
ZeroMemory( &material, sizeof(D3DMATERIAL9) );
// Set the RGBA for diffuse reflection.
material.Diffuse.r = 0.5f;
material.Diffuse.g = 0.0f;
material.Diffuse.b = 0.5f;
material.Diffuse.a = 1.0f;
// Set the RGBA for ambient reflection.
material.Ambient.r = 0.5f;
material.Ambient.g = 0.0f;
material.Ambient.b = 0.5f;
material.Ambient.a = 1.0f;
// Set the color and sharpness of specular highlights.
material.Specular.r = 1.0f;
material.Specular.g = 1.0f;
material.Specular.b = 1.0f;
material.Specular.a = 1.0f;
material.Power = 2.0f;
// Set the RGBA for emissive color.
material.Emissive.r = 0.0f;
material.Emissive.g = 0.0f;
material.Emissive.b = 0.0f;
material.Emissive.a = 0.0f;
g_d3d_device->SetMaterial(&material);
g_d3d_device->SetTexture(0,NULL);
g_d3d_device->SetTransform(D3DTS_WORLD,&world_matrix);
m_ppMeshCylinder->DrawSubset(0);
////Render from our Vertex Buffer
//g_d3d_device->DrawPrimitive(D3DPT_TRIANGLELIST, //PrimitiveType
// 0, //StartVertex
// g_pyramid_count); //PrimitiveCount
rot_triangle+=0.0007f;
if(rot_triangle > D3DX_PI*2)
{
rot_triangle-=D3DX_PI*2;
}
rot_triangle2+=0.0007f;
if(rot_triangle2 > D3DX_PI*2)
{
rot_triangle2-=D3DX_PI*2;
}
}
```
or download the project.
I have attracted my codes here "[project code](https://sites.google.com/site/dedicated2robotics/notaspartofthesite/3d_objects.zip?attredirects=0&d=1)"
I want to draw it having 3D shades what generally any 3D mesh has if rendered by default.
I am not nicely aware of materials. Or is it the problem with graphics card (I just thought :D ).
In addition where can I get information and samples abt `SetRenderState`
|
why D3DXCreateCylinder made mesh coloring/material is not working?
|
CC BY-SA 3.0
| 0 |
2011-04-13T05:08:41.570
|
2011-04-18T08:51:17.143
|
2020-06-20T09:12:55.060
| -1 | 110,426 |
[
"c++",
"directx-9"
] |
5,645,038 | 1 | 5,651,195 | null | 1 | 2,810 |
I had an old instalation of MySQL but it wasn't working very well.. so i googled how to completley remove it and found this:
[http://tomkeur.net/39/how-to-remove-mysql-completely-mac-os-x-leopard.html](http://tomkeur.net/39/how-to-remove-mysql-completely-mac-os-x-leopard.html)
and then did:
```
sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
```
And now i'm getting this on a new install:
i also ran this commands:
```
sudo rm /var/db/dslocal/nodes/Default/groups/_mysql.plist
sudo rm /var/db/dslocal/nodes/Default/users/_mysql.plist
sudo rm /var/db/receipts/com.mysql.mysql.bom
sudo rm /var/db/receipts/com.mysql.mysql..plist
```
any help on this?
Many Thanks,
Mr. Nizzle.
UPDATE
Installer Error Log Says:
```
Apr 13 00:18:31 nizzlesmymac installd[3203]: PackageKit: Install Failed: PKG: post-flight scripts for "com.mysql.mysql"\nError Domain=PKInstallErrorDomain Code=112 UserInfo=0x101e45ac0 "An error occurred while running scripts from the package “mysql-5.5.11-osx10.6-x86_64.pkg”." {\n NSFilePath = "./postflight";\n NSLocalizedDescription = "An error occurred while running scripts from the package \U201cmysql-5.5.11-osx10.6-x86_64.pkg\U201d.";\n NSURL = "file://localhost/Volumes/mysql-5.5.11-osx10.6-x86_64/mysql-5.5.11-osx10.6-x86_64.pkg";\n PKInstallPackageIdentifier = "com.mysql.mysql";\n}
```
UPDATE
this is the full Installation Error Log:
```
Apr 13 08:26:50 NizzlesMyMac Installer[181]: @(#)PROGRAM:Installer PROJECT:Installer-430.1
Apr 13 08:26:50 NizzlesMyMac Installer[181]: Hardware: MacBookPro8,1 @ 2.30 GHz (x 4), 4096 MB RAM
Apr 13 08:26:50 NizzlesMyMac Installer[181]: Running OS Build: Mac OS X 10.6.7 (10J3250)
Apr 13 08:26:50 NizzlesMyMac Installer[181]: Env: PATH=/usr/bin:/bin:/usr/sbin:/sbin
Apr 13 08:26:50 NizzlesMyMac Installer[181]: Env: TMPDIR=/var/folders/Pu/Pu2sD3XgEiuSw9qDGflH8++++TI/-Tmp-/
Apr 13 08:26:50 NizzlesMyMac Installer[181]: Env: SHELL=/bin/bash
Apr 13 08:26:50 NizzlesMyMac Installer[181]: Env: HOME=/Users/rguillen
Apr 13 08:26:50 NizzlesMyMac Installer[181]: Env: USER=rguillen
Apr 13 08:26:50 NizzlesMyMac Installer[181]: Env: LOGNAME=rguillen
Apr 13 08:26:50 NizzlesMyMac Installer[181]: Env: DISPLAY=/tmp/launch-4vyaek/org.x:0
Apr 13 08:26:50 NizzlesMyMac Installer[181]: Env: SSH_AUTH_SOCK=/tmp/launch-K54BQh/Listeners
Apr 13 08:26:50 NizzlesMyMac Installer[181]: Env: Apple_PubSub_Socket_Render=/tmp/launch-mwoG2K/Render
Apr 13 08:26:50 NizzlesMyMac Installer[181]: Env: COMMAND_MODE=unix2003
Apr 13 08:26:50 NizzlesMyMac Installer[181]: Env: __CF_USER_TEXT_ENCODING=0x1F5:0:0
Apr 13 08:26:50 NizzlesMyMac Installer[181]: MySQL 5.5.11-community for Mac OS X Installation Log
Apr 13 08:26:50 NizzlesMyMac Installer[181]: Opened from: /Volumes/mysql-5.5.11-osx10.6-x86_64/mysql-5.5.11-osx10.6-x86_64.pkg
Apr 13 08:26:50 NizzlesMyMac Installer[181]: fileURLForURL = x-disc://mysql-5.5.11-osx10.6-x86_64/mysql-5.5.11-osx10.6-x86_64.pkg
Apr 13 08:26:50 NizzlesMyMac Installer[181]: fileURLForURL = file://localhost/Volumes/mysql-5.5.11-osx10.6-x86_64/mysql-5.5.11-osx10.6-x86_64.pkg
Apr 13 08:27:07 NizzlesMyMac runner[188]: Administrator authorization granted.
Apr 13 08:27:07 NizzlesMyMac Installer[181]: ================================================================================
Apr 13 08:27:07 NizzlesMyMac Installer[181]: User picked Standard Install
Apr 13 08:27:07 NizzlesMyMac Installer[181]: Choices selected for installation:
Apr 13 08:27:07 NizzlesMyMac Installer[181]: Install: "MySQL 5.5.11-community for Mac OS X"
Apr 13 08:27:07 NizzlesMyMac Installer[181]: mysql-5.5.11-osx10.6-x86_64.pkg : com.mysql.mysql : 5.5.11.1.0
Apr 13 08:27:07 NizzlesMyMac Installer[181]: ================================================================================
Apr 13 08:27:07 NizzlesMyMac Installer[181]: It took 0.00 seconds to summarize the package selections.
Apr 13 08:27:07 NizzlesMyMac Installer[181]: -[IFPKGDerivedDocument sortedPackageLocations]: result = (\n "file://localhost"\n)
Apr 13 08:27:07 NizzlesMyMac Installer[181]: -[IFDInstallController(Private) _buildInstallPlan]: location = file://localhost
Apr 13 08:27:07 NizzlesMyMac Installer[181]: -[IFDInstallController(Private) _buildInstallPlan]: file://localhost/Volumes/mysql-5.5.11-osx10.6-x86_64/mysql-5.5.11-osx10.6-x86_64.pkg
Apr 13 08:27:07 NizzlesMyMac Installer[181]: Will use PK session
Apr 13 08:27:07 NizzlesMyMac Installer[181]: Starting installation:
Apr 13 08:27:07 NizzlesMyMac Installer[181]: Configuring volume "Macintosh HD"
Apr 13 08:27:07 NizzlesMyMac Installer[181]: Preparing disk for local booted install.
Apr 13 08:27:07 NizzlesMyMac Installer[181]: Free space on "Macintosh HD": 263.32 GB (263317995520 bytes).
Apr 13 08:27:07 NizzlesMyMac Installer[181]: Create temporary directory "/var/folders/Pu/Pu2sD3XgEiuSw9qDGflH8++++TI/-Tmp-//Install.181cTqWGQ"
Apr 13 08:27:07 NizzlesMyMac Installer[181]: IFPKInstallElement (1 packages)
Apr 13 08:27:07 NizzlesMyMac installd[191]: PackageKit: ----- Begin install -----
Apr 13 08:27:07 NizzlesMyMac installd[191]: PackageKit: request=PKInstallRequest <1 packages, destination=/>
Apr 13 08:27:07 NizzlesMyMac installd[191]: PackageKit: packages=(\n "PKJaguarPackage <file://localhost/Volumes/mysql-5.5.11-osx10.6-x86_64/mysql-5.5.11-osx10.6-x86_64.pkg>"\n)
Apr 13 08:27:07 NizzlesMyMac installd[191]: PackageKit: Extracting file://localhost/Volumes/mysql-5.5.11-osx10.6-x86_64/mysql-5.5.11-osx10.6-x86_64.pkg (destination=/var/folders/zz/zzzivhrRnAmviuee+++++++++++/Cleanup At Startup/PKInstallSandbox-tmp/Root/usr/local, uid=0)
Apr 13 08:27:22 NizzlesMyMac installd[191]: PackageKit: Executing script "./preflight" in /Volumes/mysql-5.5.11-osx10.6-x86_64/mysql-5.5.11-osx10.6-x86_64.pkg/Contents/Resources
Apr 13 08:27:22 NizzlesMyMac installd[191]: PackageKit: Shoving /var/folders/zz/zzzivhrRnAmviuee+++++++++++/Cleanup At Startup/PKInstallSandbox-tmp/Root (1 items) to /
Apr 13 08:27:24 NizzlesMyMac installd[191]: PackageKit: Executing script "./postflight" in /Volumes/mysql-5.5.11-osx10.6-x86_64/mysql-5.5.11-osx10.6-x86_64.pkg/Contents/Resources
Apr 13 08:27:24 NizzlesMyMac installd[191]: ./postflight: chown: mysql: Invalid argument
Apr 13 08:27:25 NizzlesMyMac installd[191]: PackageKit: Install Failed: PKG: post-flight scripts for "com.mysql.mysql"\nError Domain=PKInstallErrorDomain Code=112 UserInfo=0x100407570 "An error occurred while running scripts from the package “mysql-5.5.11-osx10.6-x86_64.pkg”." {\n NSFilePath = "./postflight";\n NSLocalizedDescription = "An error occurred while running scripts from the package \U201cmysql-5.5.11-osx10.6-x86_64.pkg\U201d.";\n NSURL = "file://localhost/Volumes/mysql-5.5.11-osx10.6-x86_64/mysql-5.5.11-osx10.6-x86_64.pkg";\n PKInstallPackageIdentifier = "com.mysql.mysql";\n}
Apr 13 08:27:25 NizzlesMyMac Installer[181]: install:didFailWithError:Error Domain=PKInstallErrorDomain Code=112 UserInfo=0x117116b40 "An error occurred while running scripts from the package “mysql-5.5.11-osx10.6-x86_64.pkg”."
Apr 13 08:27:25 NizzlesMyMac Installer[181]: Install failed: The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.
Apr 13 08:27:26 NizzlesMyMac Installer[181]: IFDInstallController 6F03890 state = 7
Apr 13 08:27:26 NizzlesMyMac Installer[181]: Displaying 'Install Failed' UI.
Apr 13 08:27:26 NizzlesMyMac Installer[181]: 'Install Failed' UI displayed message:'The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.'.
```
For pretty colors see here instead: [http://pastie.org/1791314](http://pastie.org/1791314)
|
MySQL - The Installation Failed on Snow Leopard
|
CC BY-SA 3.0
| null |
2011-04-13T06:00:40.720
|
2011-09-01T12:47:09.937
|
2011-09-01T12:47:09.937
| 650,492 | 295,228 |
[
"mysql",
"osx-snow-leopard"
] |
5,645,274 | 1 | 5,648,419 | null | 43 | 40,039 |
I am developing an application in WPF using C#. I am putting Images in a WrapPanel and showing inside a Grid with one more Border and using images in Buttons also. Problem is my Image control loosing its quality. I am not able to post my image here so I am simply describing here.
I used `SnapsToDevicePixels="True"` for the images but still it looks blurry.
Updated:
Here I shared the Image below:

|
Image in WPF getting Blurry
|
CC BY-SA 3.0
| 0 |
2011-04-13T06:31:42.303
|
2017-01-27T11:55:02.633
|
2011-04-13T06:49:42.937
| null | null |
[
"c#",
"wpf",
"image",
"xaml",
"image-processing"
] |
5,645,529 | 1 | 5,646,373 | null | 0 | 151 |

here problem is that when i pressed first row Plus button it change value of second Qty.
i need to change particular Qty change as per row select.
i also given viewWithtag on textfield but can't work properly.
thanks in advance.
|
iphone UITextField changes in a UITableView with a UIButton
|
CC BY-SA 3.0
| null |
2011-04-13T06:59:07.990
|
2011-04-13T09:45:26.153
| null | null | 670,669 |
[
"iphone"
] |
5,645,628 | 1 | 5,729,959 | null | 1 | 1,305 |

Hello guys, just want you to ask something about my code... I have 5 records n my database with the UserID of `A02-0005`... I want to get it all using and display into TextBoxes respectively... My problem is I get only a single set of record and when I click the NextButton of DataControl, nothing happens. At the design time, I'd set the DatabaseName, RecourdSource, and RecordSetType of my DataControl... Where then the problem possibly occurs? I am using VB6... Thanks in advance.
|
VB6 Using DataControl
|
CC BY-SA 3.0
| null |
2011-04-13T07:09:17.180
|
2011-04-20T12:07:20.623
| null | null | 661,719 |
[
"vb6"
] |
5,645,874 | 1 | 5,649,311 | null | 1 | 1,277 |
I was trying the example from this link: [Adobe Flex 4 * Creating column groups](http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7bf3.html)
The data is
```
import mx.collections.ArrayCollection;
[Bindable]
private var dpHierarchy:ArrayCollection = new ArrayCollection([
{Region:"Southwest", Territory:"Arizona",
Territory_Rep:"Barbara Jennings",
Revenues:{Actual:38865, Estimate:40000}},
{Region:"Southwest", Territory:"Arizona",
Territory_Rep:"Dana Binn",
Revenues:{Actual:29885, Estimate:30000}},
{Region:"Southwest", Territory:"Central California",
Territory_Rep:"Joe Smith",
Revenues:{Actual:29134, Estimate:30000}},
{Region:"Southwest", Territory:"Nevada",
Territory_Rep:"Bethany Pittman",
Revenues:{Actual:52888, Estimate:45000}},
{Region:"Southwest", Territory:"Northern California",
Territory_Rep:"Lauren Ipsum",
Revenues:{Actual:38805, Estimate:40000}},
{Region:"Southwest", Territory:"Northern California",
Territory_Rep:"T.R. Smith",
Revenues:{Actual:55498, Estimate:40000}},
{Region:"Southwest", Territory:"Southern California",
Territory_Rep:"Alice Treu",
Revenues:{Actual:44985, Estimate:45000}},
{Region:"Southwest", Territory:"Southern California",
Territory_Rep:"Jane Grove",
Revenues:{Actual:44913, Estimate:45000}}
]);
<?xml version="1.0"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:s="library://ns.adobe.com/flex/spark">
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
// Import the data used by the AdvancedDataGrid control.
include "SimpleFlatData.as";
]]>
</fx:Script>
<mx:AdvancedDataGrid id="myADG"
dataProvider="{dpFlat}"
width="100%" height="100%">
<mx:groupedColumns>
<mx:AdvancedDataGridColumn dataField="Region"/>
<mx:AdvancedDataGridColumn dataField="Territory"/>
<mx:AdvancedDataGridColumn dataField="Territory_Rep"
headerText="Territory Rep"/>
<mx:AdvancedDataGridColumnGroup headerText="Revenues">
<mx:AdvancedDataGridColumn dataField="Actual"/>
<mx:AdvancedDataGridColumn dataField="Estimate"/>
</mx:AdvancedDataGridColumnGroup>
</mx:groupedColumns>
</mx:AdvancedDataGrid>
</s:Application>
```
Here, we have to define the `AdvancedDataGridColumnGroup` to get define the grouped columns.
I was trying if AdvancedDataGrid can automatically detect the columns based on the JSON data. I tried with the following code:
```
<mx:AdvancedDataGrid id="inboxDg"
designViewDataType="flat"
editable="true"
dataProvider="{dpHierarchy}"
width="100%" height="100%">
</mx:AdvancedDataGrid>
```
Using this code, AdvancedDataGrid automatically detects the column names and the data. But it fails to create nested columns for `Revenues`. Ideally it should create 2 sub-columns for it as `Actual` and `Estimate`, but it created only one column and the shows data as `[object Object]`

Is there any way to make AdvancedDataGrid to create the nested columns automatically?
|
Can AdvancedDataGrid automatically detect AdvancedDataGridColumnGroup
|
CC BY-SA 3.0
| 0 |
2011-04-13T07:35:25.400
|
2011-04-13T12:37:20.363
|
2011-04-13T08:34:44.350
| 236,014 | 236,014 |
[
"apache-flex",
"flex4",
"advanceddatagrid"
] |
5,645,963 | 1 | 5,646,094 | null | 0 | 89 |
My test.html:
```
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css" href="test.css" />
<title>test</title>
</head>
<body>
<div id="header">header</div>
<div id="container">
<h1>content</h1>
<p>test</p>
<p class="last">...</p>
</div>
<div id="sidebar">
<h1>sidebar</h1>
<ul>
<li>link one</li>
<li>link two</li>
</ul>
</div>
<div id="footer">footer</div>
</body>
</html>
```
my test.css:
```
@CHARSET "ISO-8859-1";
#header {
background: #d7dabd;
}
#container {
width: 100%;
float: right;
margin-left: -200px;
}
#sidebar {
width: 200px;
float: left;
}
#footer {
background: #d7dabd;
clear: both;
}
```
The final effect is:

I expect #sidebar on the left and #container on the right of the page. but they are mixed in the left
|
Why my CSS effect is like this? (not what I want)
|
CC BY-SA 3.0
| null |
2011-04-13T07:45:17.510
|
2012-08-13T14:14:29.663
|
2020-06-20T09:12:55.060
| -1 | 475,850 |
[
"html",
"css"
] |
5,646,076 | 1 | 5,646,164 | null | 2 | 2,617 |
I just began my adventure with java. I have written an application with a panel and three buttons. But I have a problem. I want to add selection this buttons using the mouse. I mean like we have in Windows on the Desktop. I press the left mouse button and with the movement of the mouse the area selection is growing. And I have a question. Is there a specific interface in this or do I have it manualy, call the appropriate methods for event listeners and there draw transparent rectangle? Here is a picture:

I make a some progress, but i have another problem. Everything is ok but when I paint rectangle, button is repainting. I want to this button don't disapear when i paint rectangle. This is code:
```
import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.EventQueue;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.geom.Rectangle2D;
import java.util.Vector;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class zaznacz extends JPanel implements MouseListener, MouseMotionListener
{
Rectangle newLine=null;
public zaznacz()
{
addMouseListener(this);
addMouseMotionListener(this);
}
static class Rectangle {
int x1,y1,x2,y2;
Rectangle(int _x1, int _y1,int _x2, int _y2){
x1=_x1;y1=_y1;x2=_x2;y2=_y2;
}
void paint(Graphics g)
{
g.drawRect(x1, y1, x2, y2);
}
}
public void mouseClicked(MouseEvent e) {
}
@Override
public void mouseEntered(MouseEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void mouseExited(MouseEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void mousePressed(MouseEvent e) {
startPoint=e.getPoint();
setOpaque(true);
Graphics2D g2 = (Graphics2D)getGraphics();
Rectangle2D prostokat = new Rectangle2D.Double();
prostokat.setFrameFromDiagonal(e.getPoint().x, e.getPoint().y,startPoint.x, startPoint.y);
g2.setComposite(AlphaComposite.getInstance(rule, alpha));
g2.draw(prostokat);
g2.setColor(Color.BLUE);
g2.fill(prostokat);
}
@Override
public void mouseReleased(MouseEvent e)
{
repaint();
}
Point startPoint;
@Override
public void mouseDragged(MouseEvent e) {
setOpaque(true);
Graphics2D g2 = (Graphics2D)getGraphics();
Rectangle2D prostokat = new Rectangle2D.Double();
prostokat.setFrameFromDiagonal(e.getPoint().x, e.getPoint().y,startPoint.x, startPoint.y);
g2.setComposite(AlphaComposite.getInstance(rule, alpha));
g2.draw(prostokat);
g2.setColor(Color.BLUE);
g2.fill(prostokat);
paintComponent(g2);
}
@Override
public void mouseMoved(MouseEvent e) {
}
int rule = AlphaComposite.SRC_OVER;
float alpha = 0.85F;
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable()
{
public void run()
{
zaznacz rys = new zaznacz();
JFrame frame = new JFrame();
JButton Button = new JButton("1");
JPanel panel = new JPanel();
panel.add(Button);
rys.add(panel);
frame.setSize(400,300);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
panel.setOpaque(false);
frame.add(rys);
}
});
}
}
```
Somebody can help me?
|
Java select items
|
CC BY-SA 3.0
| 0 |
2011-04-13T07:56:04.123
|
2011-05-07T17:09:09.163
|
2011-05-07T17:09:09.163
| -1 | 705,544 |
[
"java",
"swing",
"awt"
] |
5,646,522 | 1 | 5,648,136 | null | 3 | 2,818 |
Any [Raphael JS](http://raphaeljs.com/) guru (or any genius who doesn't know Raphael JS) knows how to simply draw this?

the solid yellow color is 4.2 / 10 of part of the circle.
|
Any RaphaelJS Guru knows how to draw this image?
|
CC BY-SA 3.0
| 0 |
2011-04-13T08:38:49.733
|
2012-05-10T08:58:00.430
|
2011-04-13T09:11:03.460
| 325,418 | 325,418 |
[
"raphael"
] |
5,646,598 | 1 | 5,646,831 | null | 25 | 16,212 |
We are using TeamCity 6.0 to build VS C# solutions each commit.
Once the build is complete, a different test TC project runs. So that developers can add/remove/edit VS unit test projects, how can I make TeamCity use the the sln file or search for test dll's?
I don't want to have to edit the build each time a new test project is added to the VS solution.
`**\*Test*.dll` Doesn't appear to work, it only get s the first Test (which is currently failing)

|
How can I run all NUnit Tests in Team City?
|
CC BY-SA 3.0
| 0 |
2011-04-13T08:47:31.180
|
2014-06-09T22:23:41.880
|
2014-06-09T22:23:41.880
| 634,576 | 2,377,931 |
[
"continuous-integration",
"nunit",
"teamcity"
] |
5,646,632 | 1 | 5,647,306 | null | 0 | 2,049 |
In my project I created 30 small UIImageView where inside I put a different background. This is my group of UIImageView without background

and this is the group of UIImageView with different background:

I put these group of UImageView inside a UITableViewCell and I use them to define a timeline, but it's not important.
I declared in .h these UIImageView but now I must insert theme in an NSArray, or NSMutableArray? Because in my code (depending on the case) I must set different background for each UIImageView. How can I organize them in my code?
|
IOS: fill a NSArray with UIImageView
|
CC BY-SA 3.0
| null |
2011-04-13T08:50:26.747
|
2011-04-13T17:56:55.483
| null | null | 630,412 |
[
"objective-c",
"xcode",
"ios",
"uiimageview"
] |
5,646,944 | 1 | 5,647,029 | null | 100 | 119,792 |
I already know how to set the opacity of the background image but I need to set the opacity of my shape object.
In my Android app, I have it like this:

and I want to make this black area a bit transparent, like here, for example I can see circles though this "Welcome..." :

Here is my shape code:
```
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/shape_my"">
<stroke android:width="4dp" android:color="#636161" />
<padding android:left="20dp"
android:top="20dp"
android:right="20dp"
android:bottom="20dp" />
<corners android:radius="24dp" />
</shape>
```
How can I do that?
|
How to set shape's opacity?
|
CC BY-SA 3.0
| 0 |
2011-04-13T09:17:14.537
|
2022-05-13T09:59:29.143
|
2011-04-13T09:46:08.407
| 418,183 | 655,275 |
[
"android",
"graphics"
] |
5,647,039 | 1 | 5,647,097 | null | 0 | 994 |
I have been messing around with eclipse and i got this view, that i can't now remove.

any ideas?
it seems that it shows me the path in the editor area, but i don't want it to do it.
|
remove a view from eclipse
|
CC BY-SA 3.0
| null |
2011-04-13T09:25:48.410
|
2012-08-12T13:23:38.280
|
2012-08-12T13:23:38.280
| 569,101 | 705,692 |
[
"eclipse"
] |
5,647,265 | 1 | null | null | 3 | 1,986 |
I'm not going to post any code for this question because it would require way too much context, but I shall explain conceptually what I'm doing.
I'm building a simple ray tracer that uses affine transformations. What I mean is that I'm intersecting all rays from camera coordinates with generic shapes. The shapes all have associated affine transformations, and the rays are first multiplied by the inverses of these transformations before intersecting with scene objects.
So for example, say I wanted a sphere of radius 3 positioned at (10,10,10). I create the sphere and give it a transformation matrix representing this transformation.
I create a ray in camera coordinates. I multiply the ray by the inverse of the sphere's transformation matrix and intersect it with the generic sphere (r=1 at (0,0,0)). I take the distance along this generic ray at the intersection point and using it I find the generic normal and the point along the and save these into a Transformation object (along with the distance (t) and the actual transformation).
When it comes time to figure out the colour of this intersection point I take the transformation's and multiply it by the to find the normal. The point of intersection is just the point along the original non-transformed ray if I use the value from the intersection of the inverse transformed ray.
The problem is, when I do things this way the transformations have weird effects. The main effect is that transformations seem to drag lights from the scene along with them. If I build a bunch of images and apply a slightly larger rotation to the sphere with each frame, it seems to drag the lights in the scene around with it. Here's an example

I honestly cannot figure out what I'm doing wrong here, but I'm tearing my hair out. I can't think of any good reason whatsoever for this to be happening. Any help would be hugely appreciated.
|
Help me solve this bug with my ray tracer
|
CC BY-SA 3.0
| 0 |
2011-04-13T09:46:54.257
|
2011-04-18T19:16:41.413
| null | null | 13,877 |
[
"graphics",
"geometry",
"raytracing",
"matrix-multiplication"
] |
5,647,289 | 1 | 5,647,573 | null | 11 | 10,575 |
I am currently working on a Qt project for my school. For this project I need to list an unknown number of elements in a window without resizing its content.
I've used some `VBoxLayout` in the past, but it isn't what I am searching at all. This widget resizes its content depending on the number of elements it contains. What I would like is to add as much widgets as I need into the "scrolling widget", which will stack next to each other automatically and won't resize.
I tried using `QScrollArea` but I wasn't able to make elements stack on each others.
Here is a small drawing explaining my problem:

|
Which Qt Widget to scroll through widgets?
|
CC BY-SA 3.0
| 0 |
2011-04-13T09:49:52.350
|
2015-08-28T14:27:47.177
|
2015-08-28T14:26:13.610
| 1,536,976 | 437,113 |
[
"c++",
"qt",
"scroll"
] |
5,647,333 | 1 | 5,647,398 | null | 0 | 1,924 |
I am using Rad Grid and Rad Date Picker.Everything is working fine on development server.but when i hosted it on live server, Rad Grid filter image and rad date picker image is not displaying...
thank you very much
|
RadGrid Filter and RadDataPicker images are not displaying on Live Server asp.net
|
CC BY-SA 3.0
| null |
2011-04-13T09:54:26.023
|
2013-03-05T16:36:38.993
|
2011-04-14T11:00:13.733
| 273,290 | 273,290 |
[
"asp.net",
"telerik"
] |
5,647,322 | 1 | 6,983,719 | null | 9 | 5,096 |
This my friends, is a going to be long one...
I am getting some quite bizarre behaviour when I try to render text in a layered window.
The strange thing is that for some combinations of font/font-style/font-size, GDI+ changes the rendering method. For Tahoma-Bold fonts sizes 8.49 and 16.49 (Pixel-Units) inclusive "fail". For other fonts and styles I get "fails" at different sizes.

The two key parameters to play with are on line 23:
```
Color g_oTextColor( 255, 240, 0, 0 ); // Simply change Color to ( 254, 240, 0, 0 ) [to add slight transparency] and everything will work!
#define USE_LAYERED_WINDOW // or just comment this line out [to use a regular window], and everything will work!
```
---
When using layered windows and full opacity the fonts draw a transparent "hole" in the background. However if I add a slight transparency to the text colour (alpha-channel = 254) the fonts become opaque. Or if I use regular (non-layered) windows the fonts render opaque.
But even without the layered/transparency problems it is clear that something strange is happening here. The fonts size 8.49 - 16.48 get rendered pixel perfect, the other fonts have slight blurry quality, especially the small ones. So it seems that the system takes a different approach to rendering these medium sizes. I have tried all sorts of settings for `SetTextRenderingHint()` and `SetTextContrast()` but none looked crisp for fonts of size 8. I have tried Tahoma & Arial only...
---
I wanted to use pure GDI+ for the off-screen drawing but I could not get it work by simply creating `Bitmap` & `Graphics` objects. I still had to use old GDI stuff to create a DC and to select the HBitmap into it. How can I do it all in GDI+?
I also tried to draw the fonts in good-old GDI but there I got some even more bizarre effects: In a layered window the text became transparent but in an way. (So a red text would look fine if the window behind was dark but if the window behind it was whit the text disappeared completely!) Furthermore if I filled my own window with a semi-transparent square, then that behave as expected. (A red square would turn dark red if the window behind it was black, and the square would turn light red over a white window). And I can observe both these behaviours simultaneously in one layered window. And as a highly undesired bonus the drawn text lost it's hit-test and became un-clickable?
And if you have read this far, thanks for enduring, and thanks for any answers!
```
// Create as a console application project
// + Unicode charset
// + Precompiled headers off
// + make sure to add linker input: gdiplus.lib
#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.
#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows.
#endif
// Standard and GDI+ stuffstuff
#include <stdio.h>
#include <tchar.h>
#include <windows.h>
#include <iostream>
#include <cassert>
#include <Gdiplus.h>
using namespace Gdiplus;
GdiplusStartupInput g_oGdiPlusStartupInput;
ULONG_PTR g_pGdiPlusToken = NULL;
// #*#*#*#*#*#*#*#*# LINES TO CHANGE ---------->---------->---------->
Color g_oTextColor( 255, 240, 0, 0 ); // Simply change Color to ( 254, 240, 0, 0 ) [to add slight transparency] and everything will work!
#define USE_LAYERED_WINDOW // or just comment this line out [to use a regular window], and everything will work!
// Forward declarations
void RegWndClass();
LRESULT CALLBACK WndProc( HWND hWnd, UINT uiMsg, WPARAM wParam, LPARAM lParam );
void CreateWindows();
void Draw();
void MsgLoop();
// Other Globals
ATOM g_iWndClass = 0;
HWND g_hWndGdiPlus = NULL;
HWND g_hWndGdi = NULL;
const wchar_t* g_pWndClass = L"TST";
int g_iWidth = 200;
int g_iHeight = 200;
// Main entry-point
int _tmain( int argc, _TCHAR* argv[] )
{
GdiplusStartup( &g_pGdiPlusToken, &g_oGdiPlusStartupInput, NULL );
RegWndClass();
CreateWindows();
Draw();
MsgLoop();
::UnregisterClass( g_pWndClass, NULL );
::Sleep( 500 );
GdiplusShutdown( g_pGdiPlusToken );
return 0;
} // _tmain
void CreateWindows()
{
#ifdef USE_LAYERED_WINDOW
// The key trick is to create a window with style WS_EX_LAYERED, but WITHOUT any subsequent calls to SetLayeredWindowAttributes()
// This gives us a magic window that must be updated with UpdateLayeredWindow() ( and it does NOT recieve any WM_PAINT messages )
// as brilliantly described in: http://alexkr.com/source-code/50/layered-windows-and-updatelayeredwindow/
g_hWndGdiPlus = ::CreateWindowEx( WS_EX_LAYERED, g_pWndClass, L"", WS_POPUP | WS_VISIBLE, 1000, 200, g_iWidth, g_iHeight, NULL, NULL, NULL, NULL );
#else
g_hWndGdiPlus = ::CreateWindowEx( 0, g_pWndClass, L"", WS_OVERLAPPEDWINDOW | WS_POPUP | WS_VISIBLE, 1000, 200, g_iWidth, g_iHeight, NULL, NULL, NULL, NULL );
#endif
//g_hWndGdi = ::CreateWindowEx( WS_EX_LAYERED, g_pWndClass, L"", WS_POPUP | WS_VISIBLE, 720, 500, 200, 200, NULL, NULL, NULL, NULL );
} // CreateWindows
void Draw()
{
// Init GDI+ surface
HDC hOff = ::CreateCompatibleDC( NULL );
Bitmap oDaBigOne( g_iWidth, g_iHeight, PixelFormat32bppARGB );
HBITMAP hBMit = NULL;
Color oCol( 0, 0, 0, 0 );
oDaBigOne.GetHBITMAP( oCol, &hBMit );
HGDIOBJ hSave = ::SelectObject( hOff, hBMit );
#ifdef USE_LAYERED_WINDOW
Graphics oGraph( hOff );
#else
Graphics oGraph( g_hWndGdiPlus );
#endif
oGraph.Clear( Color( 255, 55, 155, 255 ) );
// Draw text
oGraph.SetTextRenderingHint( TextRenderingHintAntiAliasGridFit );
oGraph.SetTextContrast( 0xffffffff );
oGraph.SetCompositingMode( CompositingModeSourceOver );
oGraph.SetCompositingQuality( CompositingQualityHighQuality );
oGraph.SetPixelOffsetMode( PixelOffsetModeHighQuality );
const FontFamily oFamily( L"Tahoma", NULL );
#if 1 // Use bold
Font oF600( &oFamily, 6.00, FontStyle::FontStyleBold, Unit::UnitPixel );
Font oF800( &oFamily, 8.00, FontStyle::FontStyleBold, Unit::UnitPixel );
Font oF848( &oFamily, 8.48, FontStyle::FontStyleBold, Unit::UnitPixel );
Font oF849( &oFamily, 8.49, FontStyle::FontStyleBold, Unit::UnitPixel );
Font oF1200( &oFamily, 12.00, FontStyle::FontStyleBold, Unit::UnitPixel );
Font oF1500( &oFamily, 15.00, FontStyle::FontStyleBold, Unit::UnitPixel );
Font oF1648( &oFamily, 16.48, FontStyle::FontStyleBold, Unit::UnitPixel );
Font oF1649( &oFamily, 16.49, FontStyle::FontStyleBold, Unit::UnitPixel );
#else // Use regular
Font oF600( &oFamily, 6.00, FontStyle::FontStyleRegular, Unit::UnitPixel );
Font oF800( &oFamily, 8.00, FontStyle::FontStyleRegular, Unit::UnitPixel );
Font oF848( &oFamily, 8.48, FontStyle::FontStyleRegular, Unit::UnitPixel );
Font oF849( &oFamily, 8.49, FontStyle::FontStyleRegular, Unit::UnitPixel );
Font oF1200( &oFamily, 12.00, FontStyle::FontStyleRegular, Unit::UnitPixel );
Font oF1500( &oFamily, 15.00, FontStyle::FontStyleRegular, Unit::UnitPixel );
Font oF1648( &oFamily, 16.48, FontStyle::FontStyleRegular, Unit::UnitPixel );
Font oF1649( &oFamily, 16.49, FontStyle::FontStyleRegular, Unit::UnitPixel );
#endif
assert( oF600.GetLastStatus() == Ok ); // Make sure font is OK
SolidBrush oBrush( g_oTextColor );
double dy = 1.0;
oGraph.DrawString( L"Size 6.00", -1, &oF600, PointF( 30.0, dy += 18.0 ), &oBrush );
oGraph.DrawString( L"Size 8.00", -1, &oF800, PointF( 30.0, dy += 18.0 ), &oBrush );
oGraph.DrawString( L"Size 8.48", -1, &oF848, PointF( 30.0, dy += 18.0 ), &oBrush );
oGraph.DrawString( L"Size 8.49", -1, &oF849, PointF( 30.0, dy += 18.0 ), &oBrush );
oGraph.DrawString( L"Size 12.00", -1, &oF1200, PointF( 30.0, dy += 18.0 ), &oBrush );
oGraph.DrawString( L"Size 15.00", -1, &oF1500, PointF( 30.0, dy += 18.0 ), &oBrush );
oGraph.DrawString( L"Size 16.48", -1, &oF1648, PointF( 30.0, dy += 18.0 ), &oBrush );
oGraph.DrawString( L"Size 16.49", -1, &oF1649, PointF( 30.0, dy += 18.0 ), &oBrush );
#ifndef USE_LAYERED_WINDOW
return;
#endif
// Do da layered window magic stuff
BLENDFUNCTION oBF = { 0 };
oBF.BlendOp = AC_SRC_OVER;
oBF.BlendFlags = 0;
oBF.SourceConstantAlpha = 255;
oBF.AlphaFormat = AC_SRC_ALPHA;
SIZE oSize = { 0 };
oSize.cx = g_iWidth;
oSize.cy = g_iHeight;
POINT oPTZero = { 0 };
RECT oRect = { 0 };
::GetWindowRect( g_hWndGdiPlus, &oRect );
POINT oPTWnd = { 0 };
oPTWnd.x = oRect.left;
oPTWnd.y = oRect.top;
//HDC hDC = oGraph.GetHDC();
BOOL bOK = ::UpdateLayeredWindow( g_hWndGdiPlus,
NULL, //HDC hdcDst,
&oPTWnd, // POINT &oPtNull,
&oSize, // SIZE *psize,
hOff, // HDC hdcSrc,
&oPTZero, // POINT *pptSrc,
RGB(255,255,255), // COLORREF crKey,
&oBF, // BLENDFUNCTION *pblend,
ULW_ALPHA // DWORD dwFlags
);
} // Draw
void MsgLoop()
{
::SetTimer( g_hWndGdiPlus, 0, 19999, NULL ); // Self-destruct timer
MSG msg = { 0 };
while ( ::GetMessage( &msg, NULL, 0, 0 ) )
{
::TranslateMessage(&msg);
::DispatchMessage(&msg);
}
} // MsgLoop
void RegWndClass()
{
WNDCLASSEX wcex = { 0 };
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
wcex.lpfnWndProc = WndProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 8; // 8 bytes, to allow for 64-bit architecture
wcex.hInstance = NULL; // CHECK
wcex.hIcon = NULL;
wcex.hCursor = ::LoadCursor(NULL, IDC_ARROW);
wcex.hbrBackground = (HBRUSH)NULL_BRUSH; // CHECK
wcex.lpszMenuName = NULL;
wcex.lpszClassName = g_pWndClass;
wcex.hIconSm = NULL;
g_iWndClass = ::RegisterClassEx(&wcex);
} // RegWndClass
LRESULT CALLBACK WndProc( HWND hWnd, UINT uiMsg, WPARAM wParam, LPARAM lParam )
{
switch( uiMsg )
{
case WM_TIMER:
{
std::wstring s;
std::wcout << L"Let´s quit" ;
::PostQuitMessage( 0 );
return 0;
}
case WM_PAINT:
Draw();
break;
default:
{
return DefWindowProc( hWnd, uiMsg, wParam, lParam );
}
}
return DefWindowProc( hWnd, uiMsg, wParam, lParam );
} // WndProc
```
[Rodrogo´s](https://stackoverflow.com/users/865874/rodrigo)
All edits are marked with //#MOD
```
// Create as a console application project
// + Unicode charset
// + Precompiled headers off
// + make sure to add linker input: gdiplus.lib
#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.
#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows.
#endif
// Standard stuff
#include <stdio.h>
#include <tchar.h>
#include <windows.h>
#include <iostream>
#include <cassert>
// GDI+ stuff
#include <Gdiplus.h>
using namespace Gdiplus;
GdiplusStartupInput g_oGdiPlusStartupInput;
ULONG_PTR g_pGdiPlusToken = NULL;
// #*#*#*#*#*#*#*#*# LINES TO CHANGE ---------->---------->---------->
Color g_oTextColor( 255, 240, 0, 0 ); // Simply change Color to ( 254, 240, 0, 0 ) [to add slight transparency] and everything will work!
#define USE_LAYERED_WINDOW // or just omment this line [to use a regular window], and everything will work!
// Forward declarations
void RegWndClass();
LRESULT CALLBACK WndProc( HWND hWnd, UINT uiMsg, WPARAM wParam, LPARAM lParam );
void CreateWindows();
void Draw();
void MsgLoop();
// Other Globals
ATOM g_iWndClass = 0;
HWND g_hWndGdiPlus = NULL;
HWND g_hWndGdi = NULL;
const wchar_t* g_pWndClass = L"TST";
int g_iWidth = 200;
int g_iHeight = 200;
// Main entry-point
int _tmain( int argc, _TCHAR* argv[] )
{
GdiplusStartup( &g_pGdiPlusToken, &g_oGdiPlusStartupInput, NULL );
RegWndClass();
CreateWindows();
Draw();
MsgLoop();
::UnregisterClass( g_pWndClass, NULL );
::Sleep( 500 );
GdiplusShutdown( g_pGdiPlusToken );
return 0;
} // _tmain
void CreateWindows()
{
#ifdef USE_LAYERED_WINDOW
// The key trick is to create a window with style WS_EX_LAYERED, but WITHOUT any subsequent calls to SetLayeredWindowAttributes()
// This gives us a magic window that must be updated with UpdateLayeredWindow() ( and it does NOT recieve any WM_PAINT messages )
// as brilliantly described in: http://alexkr.com/source-code/50/layered-windows-and-updatelayeredwindow/
g_hWndGdiPlus = ::CreateWindowEx( WS_EX_LAYERED, g_pWndClass, L"", WS_POPUP | WS_VISIBLE, 1000, 200, g_iWidth, g_iHeight, NULL, NULL, NULL, NULL );
#else
g_hWndGdiPlus = ::CreateWindowEx( 0, g_pWndClass, L"", WS_OVERLAPPEDWINDOW | WS_POPUP | WS_VISIBLE, 1000, 200, g_iWidth, g_iHeight, NULL, NULL, NULL, NULL );
#endif
//g_hWndGdi = ::CreateWindowEx( WS_EX_LAYERED, g_pWndClass, L"", WS_POPUP | WS_VISIBLE, 720, 500, 200, 200, NULL, NULL, NULL, NULL );
} // CreateWindows
void Draw()
{
// Init GDI+ surface
HDC hOff = ::CreateCompatibleDC( NULL );
Bitmap oDaBigOne( g_iWidth, g_iHeight, PixelFormat32bppARGB );
HBITMAP hBMit = NULL;
Color oCol( 0, 0, 0, 0 );
// oDaBigOne.GetHBITMAP( oCol, &hBMit ); //#MOD
// HGDIOBJ hSave = ::SelectObject( hOff, hBMit ); //#MOD
{ // Limit oGraph scope //#MOD
#ifdef USE_LAYERED_WINDOW
//Graphics oGraph( hOff ); //#MOD
Graphics oGraph( &oDaBigOne ); //#MOD
#else
Graphics oGraph( g_hWndGdiPlus );
#endif
oGraph.Clear( Color( 255, 55, 155, 255 ) );
// Draw text
oGraph.SetTextRenderingHint( TextRenderingHintAntiAliasGridFit );
oGraph.SetCompositingMode( CompositingModeSourceOver );
oGraph.SetCompositingQuality( CompositingQualityHighQuality );
oGraph.SetPixelOffsetMode( PixelOffsetModeHighQuality );
const FontFamily oFamily( L"Tahoma", NULL );
#if 1 // Use bold
Font oF600( &oFamily, 6.00, FontStyle::FontStyleBold, Unit::UnitPixel );
Font oF848( &oFamily, 8.48, FontStyle::FontStyleBold, Unit::UnitPixel );
Font oF849( &oFamily, 8.49, FontStyle::FontStyleBold, Unit::UnitPixel );
Font oF1200( &oFamily, 12.00, FontStyle::FontStyleBold, Unit::UnitPixel );
Font oF1500( &oFamily, 15.00, FontStyle::FontStyleBold, Unit::UnitPixel );
Font oF1648( &oFamily, 16.48, FontStyle::FontStyleBold, Unit::UnitPixel );
Font oF1649( &oFamily, 16.49, FontStyle::FontStyleBold, Unit::UnitPixel );
#else // Use regular
Font oF600( &oFamily, 6.00, FontStyle::FontStyleRegular, Unit::UnitPixel );
Font oF848( &oFamily, 8.48, FontStyle::FontStyleRegular, Unit::UnitPixel );
Font oF849( &oFamily, 8.49, FontStyle::FontStyleRegular, Unit::UnitPixel );
Font oF1200( &oFamily, 12.00, FontStyle::FontStyleRegular, Unit::UnitPixel );
Font oF1500( &oFamily, 15.00, FontStyle::FontStyleRegular, Unit::UnitPixel );
Font oF1648( &oFamily, 16.48, FontStyle::FontStyleRegular, Unit::UnitPixel );
Font oF1649( &oFamily, 16.49, FontStyle::FontStyleRegular, Unit::UnitPixel );
#endif
assert( oF600.GetLastStatus() == Ok ); // Make sure font is OK
SolidBrush oBrush( g_oTextColor );
double dy = 10.0;
oGraph.DrawString( L"Size 6.00", -1, &oF600, PointF( 30.0, dy += 18.0 ), &oBrush );
oGraph.DrawString( L"Size 8.48", -1, &oF848, PointF( 30.0, dy += 18.0 ), &oBrush );
oGraph.DrawString( L"Size 8.49", -1, &oF849, PointF( 30.0, dy += 18.0 ), &oBrush );
oGraph.DrawString( L"Size 12.00", -1, &oF1200, PointF( 30.0, dy += 18.0 ), &oBrush );
oGraph.DrawString( L"Size 15.00", -1, &oF1500, PointF( 30.0, dy += 18.0 ), &oBrush );
oGraph.DrawString( L"Size 16.48", -1, &oF1648, PointF( 30.0, dy += 18.0 ), &oBrush );
oGraph.DrawString( L"Size 16.49", -1, &oF1649, PointF( 30.0, dy += 18.0 ), &oBrush );
#ifndef USE_LAYERED_WINDOW
return;
#endif
} // Limit oGraph scope //#MOD
// Do da layered window magic stuff
BLENDFUNCTION oBF = { 0 };
oBF.BlendOp = AC_SRC_OVER;
oBF.BlendFlags = 0;
oBF.SourceConstantAlpha = 255;
oBF.AlphaFormat = AC_SRC_ALPHA;
SIZE oSize = { 0 };
oSize.cx = g_iWidth;
oSize.cy = g_iHeight;
POINT oPTZero = { 0 };
RECT oRect = { 0 };
::GetWindowRect( g_hWndGdiPlus, &oRect );
POINT oPTWnd = { 0 };
oPTWnd.x = oRect.left;
oPTWnd.y = oRect.top;
oDaBigOne.GetHBITMAP( oCol, &hBMit ); //#MOD
HGDIOBJ hSave = ::SelectObject( hOff, hBMit ); //#MOD
//HDC hDC = oGraph.GetHDC();
BOOL bOK = ::UpdateLayeredWindow( g_hWndGdiPlus,
NULL, //HDC hdcDst,
&oPTWnd, // POINT &oPtNull,
&oSize, // SIZE *psize,
hOff, // HDC hdcSrc,
&oPTZero, // POINT *pptSrc,
RGB(255,255,255), // COLORREF crKey,
&oBF, // BLENDFUNCTION *pblend,
ULW_ALPHA // DWORD dwFlags
);
} // Draw
void MsgLoop()
{
::SetTimer( g_hWndGdiPlus, 0, 19999, NULL ); // Self-destruct timer
MSG msg = { 0 };
while ( ::GetMessage( &msg, NULL, 0, 0 ) )
{
::TranslateMessage(&msg);
::DispatchMessage(&msg);
}
} // MsgLoop
void RegWndClass()
{
WNDCLASSEX wcex = { 0 };
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
wcex.lpfnWndProc = WndProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 8; // 8 bytes, to allow for 64-bit architecture
wcex.hInstance = NULL; // CHECK
wcex.hIcon = NULL;
wcex.hCursor = ::LoadCursor(NULL, IDC_ARROW);
wcex.hbrBackground = (HBRUSH)NULL_BRUSH; // CHECK
wcex.lpszMenuName = NULL;
wcex.lpszClassName = g_pWndClass;
wcex.hIconSm = NULL;
g_iWndClass = ::RegisterClassEx(&wcex);
} // RegWndClass
LRESULT CALLBACK WndProc( HWND hWnd, UINT uiMsg, WPARAM wParam, LPARAM lParam )
{
switch( uiMsg )
{
case WM_TIMER:
{
std::wstring s;
std::wcout << L"Let´s quit" ;
::PostQuitMessage( 0 );
return 0;
}
case WM_PAINT:
Draw();
break;
default:
{
return DefWindowProc( hWnd, uiMsg, wParam, lParam );
}
}
return DefWindowProc( hWnd, uiMsg, wParam, lParam );
} // WndProc
```
|
GDI+ Font Rendering, especially in layered windows
|
CC BY-SA 3.0
| 0 |
2011-04-13T09:53:16.547
|
2011-10-26T18:33:37.637
|
2017-05-23T11:48:22.880
| -1 | 38,656 |
[
"c++",
"fonts",
"gdi+",
"rendering"
] |
5,647,498 | 1 | null | null | 0 | 1,109 |
I using for autocomplete textbox.
I getting all the location record on keypress event.
keypress event I passed the text value of the location textbox.
for eq. I writing text "" then it get all records starting with "Lo" every time I get new suggestion from SQL database.
My problem is that. I seen two, three or more list box as suggestion under the textbox..
I write `.unautocomplete()` method for remove previous suggestion list in each keypress event.
How to fix previous unautocomplte list from textbox..
In my autocomplete I see autocomplete suggestion list shown more than one suggestion list..
how to fix this..
Below I wrote my code.
<asp:TextBox runat="server" class="location" ID="txtLocation" >
</asp:TextBox>
```
<script>
$('#<%= txtLocation.ClientID %>').onkeypress(function () {
if ($('#<%= txtLocation.ClientID %>').val().length >= 1) {
GetCitiesLikeList($('#<%= txtLocation.ClientID %>').val());
}
});
function GetCitiesLikeList(objcity) {
if (objcity != null && objcity != "") {
$.ajax({
type: "POST",
url: "http://www.myweburl.com/webservices.asmx/GetCitiesLikeList",
data: "{ City : '" + objcity + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
if (msg.d != null && msg.d != "") {
cities = msg.d.split(",");
$(".location").autocomplete(cities, {
matchContains: true,
minChars: 0
});
}
else
$(".location").unautocomplete();
},
error: function(xhr, ajaxOptions, thrownError) {return false;}
});
}
else
$(".location").unautocomplete();
}
</script>
```
look into this image what is problem is going in my autocompleter suggestion list.

Give me solution for this.
|
How to fix autocomplete on textbox in jQuery?
|
CC BY-SA 4.0
| null |
2011-04-13T10:09:25.743
|
2021-03-28T19:04:58.950
|
2021-03-28T19:04:58.950
| 4,370,109 | 568,085 |
[
"jquery",
"jquery-ui",
"autocomplete",
"jquery-ui-autocomplete",
"jquery-events"
] |
5,647,921 | 1 | 5,652,333 | null | 1 | 1,274 |
When I pass a string with special characters to my view, The special characters are shown as a question mark, eg:
```
$data['make'] = 'Quels pneus Dunlop avez-vous acheté ?';
$this->load->view("form", $data);
```
---
This looks as follows in my view:

When I type the characters directly into the HTML page they show fine. how can I fix this issue?
```
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
```
|
using codeigniter - why do european characters not show properly?
|
CC BY-SA 3.0
| null |
2011-04-13T10:49:39.807
|
2015-02-22T20:06:50.587
|
2011-04-13T10:57:31.127
| 220,519 | 220,519 |
[
"php",
"codeigniter",
"character-encoding"
] |
5,647,942 | 1 | 5,647,970 | null | 0 | 1,353 |
i am not able to set the height of the Div of this theme to 156px;
Its inheriting css property from some place else and making it 118px

Please the following website in Chrome and firefox you will see the difference
[http://jssamch.com/](http://jssamch.com/)
|
Css Height problem in Chrome
|
CC BY-SA 3.0
| null |
2011-04-13T10:51:30.890
|
2011-04-13T10:53:50.980
| null | null | 155,196 |
[
"css",
"properties",
"height"
] |
5,648,367 | 1 | 5,648,408 | null | 0 | 3,722 |
I am new to C#. I need to develop the following screen. I need to call the child form before the parent form is called. After the username and password are checked and valid I want to shift focus to the parent screen.
Thanks in advance.

|
How do I create a login screen?
|
CC BY-SA 3.0
| null |
2011-04-13T11:23:42.393
|
2011-04-13T11:39:01.177
|
2011-04-13T11:39:01.177
| 176,541 | 366,916 |
[
"c#",
"winforms",
"authentication"
] |
5,648,491 | 1 | 5,650,930 | null | 0 | 113 |
I am trying to have a UI component stuck to my cells in a UITableView and scrolling with them...
It seems weird but a picture permits to understand the main point:

Before Scrolling

During Scroll
I am trying to do the same effect but with other UI components (another UIVIew).
Do you have some hints to do this ?
- -
Thanks a lot for your help !
|
How to have an UI component scrolling with my UITableView
|
CC BY-SA 3.0
| null |
2011-04-13T11:33:23.517
|
2011-04-13T14:30:49.627
| null | null | 595,223 |
[
"cocoa-touch",
"uitableview",
"customization",
"uisearchbar"
] |
5,648,554 | 1 | 5,648,627 | null | 0 | 187 |
Today I installed Microsoft Visual web developer express on my system through Microsoft Web platform installer,and it installed successfully.
Now,the problem is that,I don't see any template available in File->New Website section.

Thanks in advance!
|
Where is my visual web developer template?
|
CC BY-SA 3.0
| null |
2011-04-13T11:39:59.993
|
2011-04-14T01:44:50.907
| null | null | 449,897 |
[
"visual-studio"
] |
5,648,604 | 1 | 13,123,932 | null | 0 | 532 |
I have a app that has a activity that can be started from the start
menu and a activity that is started by a broadcast receiver.

Now on boot , if the receiver is called , the "event viewer" activity is
started...after backing out of this activity user returns to previous
screen (could be homescreen or whatever user was doing) .. this is how it
should be.
But if i start the "main" activity from the main launcher, and press
the home button to go back to the home screen..the problem begins.
Now if the receiver is called the "event viewer" activity is shown.
if the user backs out of the "event viewer" activity (or i call finish() ) it will show the "main" activity(still running in background) instead of the previous thing the user was doing (like home screen).
This is not how i want it..because it causes users after dismissing a
calendar event (the purpose of my app) to return to eg the settings
from the main app..
If i call finish() in onpause , it works ok...but that is not the way
it should work.
Any clues?
Hope the problem is clear , since english isn't my first language i
found it hard to explain the problem :-)
Thanks..
|
Returning to previous screen after receiver activity
|
CC BY-SA 3.0
| null |
2011-04-13T11:43:05.767
|
2012-10-29T14:47:01.807
|
2011-04-22T22:29:28.837
| 368,598 | 368,598 |
[
"android"
] |
5,648,672 | 1 | 5,651,061 | null | 1 | 703 |
I've a sample workflow application, which only have to display an activity an show on which step we are.
The problem is that when I load my activity like this:
```
TestWorkflow workflow = new TestWorkflow();
_workflowApplication= new WorkflowApplication(workflow );
_workflowDesigner = new WorkflowDesigner();
_workflowDesigner.Load(workflow );
uxGridWorkflowHoster.Children.Add(_workflowDesigner.View);
```
I'm getting only the root element "sequence" in my box. how to change that?
I get that on visual studio

And in my app, I see only that:

Thank you!
|
Show an activity into the designer?
|
CC BY-SA 3.0
| null |
2011-04-13T11:47:57.203
|
2011-04-14T13:35:46.447
|
2011-04-13T12:12:32.530
| 397,830 | 397,830 |
[
".net",
"workflow",
"workflow-foundation",
"workflow-foundation-4"
] |
5,648,738 | 1 | 5,649,154 | null | 0 | 424 |
I've used JQuery UI Selectable with a table, when I use multi selection with Ctrl I have the following problem:

How could I prevent the orginal selection in HTML in the table with keeping JQuery functionality?
I've already tried using `user-select: none;` for the table but it hasn't worked!
Any help!
|
How to prevent selection in a table
|
CC BY-SA 3.0
| null |
2011-04-13T11:52:50.003
|
2011-04-13T12:25:14.487
| null | null | 322,355 |
[
"jquery",
"css",
"selection"
] |
5,648,705 | 1 | 5,652,367 | null | 0 | 728 |
Here is my page. I need to insert whole code here.
```
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script src="js/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#tabs ul li:first a').addClass("active");
$('#forms').find('form').hide().fadeIn(1500);
$("#tabs ul li").click(function() {
$("#tabs ul li").removeClass("active");
$(this).addClass("active");
$("#forms form").hide();
var activeTab = $(this).find("a").attr("href");
$(activeTab).fadeIn();
return false;
});
});
</script>
<style type="text/css">
* { margin:0; padding:0; }
body { background:#27476B; }
.clear { clear:both; }
#wrapper { width:510px; height:331px; overflow:hidden; padding:10px; }
#tabs ul { padding-left:15px; list-style:none; }
#tabs ul li { display:block; float:left; text-align:center; }
#tabs ul li a { padding:3px 20px 2px 20px; color:#fff; text-decoration:none; border-top:1px solid #ccc; border-left:1px solid #ccc; border-right:1px solid #ccc; }
#tabs ul li a:hover { background:#AEBAC1; }
#tabs ul li a.active, #tabs ul li.active a:hover { background:#AEBAC1; color:#333; }
#forms form { background:#AEBAC1; border:2px solid #333; padding-left:5px; }
.twocol { display:block; float:left; width:250px; margin-bottom:10px; }
.twocol label { margin-top:.33em; display:block; width:240px;}
.twocol select, .twocol input[type="text"] { background:#456A87; color:#fff; display:block; width:240px; font-size:16px; }
.twocol span { padding:0 8px 0 5px; }
.search { width:500px; text-align:center; margin-bottom:5px; }
</style>
</head>
<body>
<div id="wrapper">
<div id="tabs">
<ul>
<li><a href="#properties">Properties</a></li>
<li><a href="#developments">Developments</a></li>
<li><a href="#agents">Agents</a></li>
</ul>
</div>
<div class="clear"></div>
<div id="forms">
<!--
Search Form for Properties
-->
<form id="properties" name="properties" method="post" action="">
<div class="twocol">
<label for="city">City:</label>
<select name="city" size="1">
<option>-</option><option>asdfadf</option><option>-</option>
</select>
<label for="bedrooms">Bedroom:</label>
<select name="bedrooms" size="1">
<option>-</option>
</select>
<label for="minprice">Minimum Price:</label>
<select name="minprice" size="1">
<option>-</option>
</select>
<label for="minarea">Minimum Area:</label>
<select name="minarea" size="1">
<option>-</option>
</select>
<label for="propertytype">Property Type:</label>
<select name="propertytype" size="1">
<option>-</option>
</select>
</div>
<div class="twocol">
<label for="location">Location:</label>
<select name="location" size="1">
<option>-</option>
</select>
<label for="addedwithin">Added Within:</label>
<select name="addedwithin" size="1">
<option>-</option>
</select>
<label for="maxprice">Maximum Price:</label>
<select name="maxprice" size="1">
<option>-</option>
</select>
<label for="maxarea">Maximum Area:</label>
<select name="maxarea" size="1">
<option>-</option>
</select>
<label for="searchfor">Search For:</label>
<input name="searchfor" type="radio" value="sale" /><span>Sale</span>
<input name="searchfor" type="radio" value="purchase" /><span>Purchase</span>
<input name="searchfor" type="radio" value="rental" /><span>Rental</span>
</div>
<hr class="clear" /><br />
<div class="search">
<input type="submit" value="Search" />
</div>
</form>
<!--
Search Form for Developments
-->
<form id="developments" name="developments" method="post" action="">
<div class="twocol">
<label for="city">City:</label>
<select name="city" size="1">
<option>-</option><option>asdfadf</option><option>-</option>
</select>
</div>
<div class="twocol">
<label for="developmentname">Development name:</label>
<input type="text" name="developementname" />
</div>
<hr class="clear" /><br />
<div class="search">
<input type="submit" value="Search" />
</div>
</form>
</div>
</div>
</body>
</html>
```
Here is the perfect view (on Firefox)

Following problems are identified by me, Please let me know if there are some others too.
1. IE8 and Chrome are showing some extra height (which is displaying a little part of 2nd form)
2. IE6 not showing the width specified in CSS.
3. In IE6, initially tabs div is touching with the forms div. But on mouse over it adds some extra spacing.
How can it be solved.
|
form not showing up properly in chrome and IE6
|
CC BY-SA 3.0
| null |
2011-04-13T11:49:40.453
|
2013-08-30T19:13:36.457
|
2011-04-14T20:21:52.037
| 120,753 | 356,188 |
[
"css",
"internet-explorer-6"
] |
5,648,922 | 1 | null | null | 0 | 927 |
I am trying to change a Flex mobile application using MXML to describe views, to one which uses AS3 to create the views. I changed:
```
<?xml version="1.0" encoding="utf-8"?>
<s:MobileApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" firstView="view.LoginView">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
</s:MobileApplication>`
```
```
package {
import spark.components.MobileApplication;
import view.LoginView;
[SWF(height="600", width="1024", frameRate="30", backgroundColor="#FFFFFF")]
public class Assessments extends MobileApplication{
public function Assessments(){
super();
super.firstView = view.LoginView;
}
}
}
```
However, now I am getting the error:
```
TypeError: Error #1007: Instantiation attempted on a non-constructor.
at mx.preloaders::Preloader/initialize()[E:\dev\hero_private_beta\frameworks\projects\framework\src\mx\preloaders\Preloader.as:258]
at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::initialize()[E:\dev\hero_private_beta\frameworks\projects\framework\src\mx\managers\SystemManager.as:1977]
at mx.managers::SystemManager/initHandler()[E:\dev\hero_private_beta\frameworks\projects\framework\src\mx\managers\SystemManager.as:2479]
```
I believe it may be something to do with the Namespaces not being set in the .as version? Any ideas?
---
```
package view
{
import flash.display.Sprite;
import flash.events.MouseEvent;
import net.airpoint.northgate.ui.components.AirpointNumericTextField;
import qnx.events.QNXApplicationEvent;
import qnx.system.QNXApplication;
import spark.components.Button;
import spark.components.Form;
import spark.components.FormHeading;
import spark.components.FormItem;
import spark.components.Label;
import spark.components.TextInput;
import spark.components.View;
public class LoginView extends View
{
private var form:Form;
private var usernameLabel:Label;
private var usernameField:AirpointNumericTextField;
private var passwordLabel:Label;
private var passwordField:TextInput;
private var submit:Button;
// public var menu:AirpointAppMenu;
public function LoginView()
{
// menu = new AirpointAppMenu();
// QNXApplication.qnxApplication.addEventListener(QNXApplicationEvent.SWIPE_DOWN, showAppMenu);
initializeUI();
}
public function showAppMenu(event:QNXApplicationEvent):void{
// menu.show();
}
public function initializeUI():void{
form = new Form();
this.submit = new Button();
this.submit.label = "Login...";
form.defaultButton = this.submit;
// Heading
var fh:FormHeading = new FormHeading();
fh.label = "Login";
form.addElement(fh);
// Username
this.usernameField = new AirpointNumericTextField();
var f1:FormItem = new FormItem();
f1.label = "Username";
f1.addElement(this.usernameField);
// Password
this.passwordField = new TextInput();
this.passwordField.displayAsPassword =true;
var f2:FormItem = new FormItem();
f2.label = "Password";
f2.addElement(this.passwordField);
form.addElement(f1);
form.addElement(f2);
form.addElement(this.submit);
this.addElement(form);
}
}
}
```

---
```
package {
import mx.events.FlexEvent;
import mx.styles.CSSStyleDeclaration;
import spark.components.Group;
import spark.components.MobileApplication;
import views.AssessmentsAppHome;
[SWF(height="600", width="1024", frameRate="30", backgroundColor="#000")]
public class AssessmentsApp extends MobileApplication{
public function AssessmentsApp(){
super();
this.addEventListener(FlexEvent.APPLICATION_COMPLETE, onAppComplete);
}
private function onAppComplete(e:FlexEvent):void
{
this.removeEventListener(FlexEvent.APPLICATION_COMPLETE, onAppComplete);
firstView = views.AssessmentsAppHome;
}
}
}
```
```
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" title="Home">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:VGroup>
<s:TextInput text="awdwdawd"/>
</s:VGroup>
</s:View>
```
```
// Create a new instance of the display class and attach it to the stage
if (showDisplay)
{
displayClass = new displayClassName();
// Listen for when the displayClass no longer needs to be on the stage
displayClass.addEventListener(Event.COMPLETE, displayClassCompleteHandler);
```
|
Change project from MXML to AS error
|
CC BY-SA 3.0
| null |
2011-04-13T12:08:08.547
|
2011-04-13T14:47:05.143
|
2011-04-13T14:47:05.143
| 653,331 | 653,331 |
[
"apache-flex",
"actionscript",
"air",
"blackberry-playbook"
] |
5,649,153 | 1 | 5,649,182 | null | 0 | 347 |
I am not able to attach the databases in sql express edition with service pack 4.it is showing error .It was working fine till few hours back.
I am logged in as windows authentication.My os is windows 7.
i have attached the screen shoot of error
Thanks in advance.
|
Uable to attach database in sql express
|
CC BY-SA 3.0
| null |
2011-04-13T12:25:10.187
|
2011-04-13T13:01:46.027
|
2011-04-13T13:01:46.027
| 579,474 | 579,474 |
[
"c#",
"sql-server",
"visual-studio",
"sql-server-2005"
] |
5,649,211 | 1 | null | null | 0 | 803 |
I was on flickr and I saw this function whereby you can scroll photos (thumbnail) without loading the page. It's probably using jQuery or json but does anyone know whats the proper name for this kind of function or is there any available libraries?
I've uploaded a screenshot..

|
php and jquery image selector
|
CC BY-SA 3.0
| null |
2011-04-13T12:29:25.343
|
2011-04-13T12:44:07.873
|
2011-04-13T12:37:01.850
| 468,793 | 291,779 |
[
"php",
"javascript",
"jquery"
] |
5,649,600 | 1 | 5,649,762 | null | 6 | 1,487 |
I have successfullly created a histogram using a date field.
```
hist(df.sat$created_at, breaks="hours", freq=T, xlab="Time",
main="Sat Volume")
```
My issue is that when I attempt to fill in the bars using `col="red"` both the bars and both the x/y axes change to red, when I only want the bars. What is the best way way only fill in the bars?

Here are some data:
```
> dput(df.sat$created_at[sample(c(1:9000), 50)])
structure(list(sec = c(41, 3, 13, 11, 49, 55, 19, 21, 6, 15,
54, 45, 45, 39, 50, 27, 35, 25, 22, 35, 42, 31, 45, 29, 1, 3,
8, 47, 38, 2, 13, 29, 34, 42, 15, 19, 3, 39, 41, 12, 34, 50,
15, 27, 0, 29, 47, 26, 21, 5), min = c(46L, 38L, 4L, 35L, 26L,
56L, 9L, 52L, 51L, 15L, 49L, 3L, 41L, 59L, 30L, 30L, 30L, 53L,
25L, 51L, 23L, 38L, 30L, 3L, 43L, 33L, 36L, 52L, 0L, 21L, 27L,
22L, 51L, 31L, 0L, 37L, 3L, 2L, 12L, 3L, 45L, 13L, 59L, 10L,
11L, 7L, 41L, 21L, 5L, 20L), hour = c(14L, 16L, 18L, 15L, 15L,
16L, 16L, 18L, 18L, 13L, 18L, 16L, 14L, 13L, 16L, 15L, 18L, 17L,
18L, 18L, 16L, 17L, 17L, 19L, 15L, 18L, 17L, 18L, 19L, 17L, 16L,
17L, 18L, 20L, 18L, 15L, 14L, 14L, 18L, 18L, 19L, 19L, 16L, 15L,
17L, 17L, 15L, 17L, 17L, 17L), mday = c(9L, 9L, 9L, 9L, 9L, 9L,
9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L,
9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L,
9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L), mon = c(3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,
3L), year = c(111L, 111L, 111L, 111L, 111L, 111L, 111L, 111L,
111L, 111L, 111L, 111L, 111L, 111L, 111L, 111L, 111L, 111L, 111L,
111L, 111L, 111L, 111L, 111L, 111L, 111L, 111L, 111L, 111L, 111L,
111L, 111L, 111L, 111L, 111L, 111L, 111L, 111L, 111L, 111L, 111L,
111L, 111L, 111L, 111L, 111L, 111L, 111L, 111L, 111L), wday = c(6L,
6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L,
6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L,
6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L,
6L), yday = c(98L, 98L, 98L, 98L, 98L, 98L, 98L, 98L, 98L, 98L,
98L, 98L, 98L, 98L, 98L, 98L, 98L, 98L, 98L, 98L, 98L, 98L, 98L,
98L, 98L, 98L, 98L, 98L, 98L, 98L, 98L, 98L, 98L, 98L, 98L, 98L,
98L, 98L, 98L, 98L, 98L, 98L, 98L, 98L, 98L, 98L, 98L, 98L, 98L,
98L), isdst = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L)), .Names = c("sec", "min", "hour", "mday",
"mon", "year", "wday", "yday", "isdst"), class = c("POSIXlt",
"POSIXt"), tzone = c("America/New_York", "EST", "EDT"))
```
|
Axis Color of Date Histogram in R
|
CC BY-SA 3.0
| 0 |
2011-04-13T12:55:59.747
|
2011-04-13T14:06:45.467
|
2011-04-13T13:16:06.380
| 155,406 | 155,406 |
[
"r",
"histogram"
] |
5,649,826 | 1 | 5,649,858 | null | 0 | 59 |
We got a website (happened before too) that when viewed on IE8 on 2 PC don't show as supposed, but when tested on 2 other PC using same Windows, same IE version show correctly...
I did a quick draw (pardon Ms-Paint for the bad compression/gradient), the first part (pink with red border) is the background as I see it on every browser on 4 different PC, the second part is what I see on those 2 PC. The white box (with black border) is a div which is over the pink one, but this DIV has no background, it should not "cut/hide" the other background.
So there is my question, what could cause this in general? And why those 2 PC have problem specific to them, is that possible that IE Rendering Tool have been corrupted/bugged in some sort.

|
Bugged Internet Explorer
|
CC BY-SA 3.0
| null |
2011-04-13T12:36:45.643
|
2011-04-13T13:14:07.787
| null | null | 355,519 |
[
"html",
"css"
] |
5,649,937 | 1 | 5,649,984 | null | 1 | 335 |

My table name is `Skor`.. `Skor` means "point", `sure` means "time" --- Max Point Min Time (Multiple Order)
I want to order this table. But skor(MAX) value and sure(MIN) value and userID must be only one as you see there is 6 userID ( 2 ) I want the only max value
I want something like this
```
userID skor sure
2 90 50
3 90 60
```
How can I do that?
|
Sql Server Multiple Order?
|
CC BY-SA 3.0
| null |
2011-04-13T13:19:42.517
|
2011-04-13T13:56:06.097
|
2011-04-13T13:38:17.010
| 13,302 | 701,855 |
[
"sql-server"
] |
5,649,999 | 1 | 5,661,920 | null | 2 | 275 |
I have a table in which in one of the column I would be specifying the type of entity.The entity could only be of three types - caption , image or comment , hence I want to ensure that the table column should only accept one of these three strings . Is there a way to put this constraint in ms sql server 2008 ?
Edit :- Have added the db diagram to get tips on improving the design.
Design :-
1)A story board has a number of slides, each slide can have one or more captions or images.
2)Each storyboard can have one or more author , and zero or more reviewers.
3) Each of the objects image,slide and caption(probably more objects will come later like audio etc) can have comments on them . These comments can be given by authors or reviewers.
For storing comments I have created a comment table.
4)It is necessary to remember the order of slides and order of images in a slide , for which I am using slide and image number fields.
5)Since comment can be given on any object , I needed to have a Global ID for each of the object,since they their reference will be stored in a comment table.For maintaing a global id all the fields ending with name GID are uniqueidentifiers generated using Default: NEWID().
Please suggest improvements for this db design.

|
is there a way to enforce a set of values for a column of a database table?
|
CC BY-SA 3.0
| null |
2011-04-13T13:24:29.757
|
2011-04-14T10:34:30.180
|
2011-04-14T08:19:04.437
| 125,571 | 125,571 |
[
"sql",
"sql-server",
"database-design"
] |
5,649,979 | 1 | 5,650,039 | null | 1 | 379 |
>
[get values from text field to webservice](https://stackoverflow.com/questions/5581432/get-values-from-text-field-to-webservice)
i have posted similar question before but i didn't get appropriate help! i am repeating. i am uploading parameters from my textField to web service .Everything is going well but i am not able to retreive the values in webservice. plz plz help!! here is my code:
in gdb:
webservice:
|
unable to get parameter in webservice
|
CC BY-SA 3.0
| null |
2011-04-13T13:23:16.623
|
2011-04-13T13:27:14.360
|
2017-05-23T12:19:48.617
| -1 | 10,441,561 |
[
"iphone",
"objective-c"
] |
5,650,224 | 1 | 5,679,031 | null | 1 | 6,695 |
I've strange Nivo Slider loading problem, the left side of the image shows how my slider looks just after entering the website (and this is WRONG) and right - after a while.
The question is why my images are loaded before containing div (with loading animation) and are shown one below another? Of course the main container has position set to relative and every container img is absolutely positioned at top: 0 and left: 0. Any ideas? Tried to put that on jsfiddle, but I believe Nivo isn't supported.

|
Nivo slider loading problem
|
CC BY-SA 3.0
| null |
2011-04-13T13:39:40.107
|
2013-01-26T09:44:57.083
| null | null | 683,068 |
[
"javascript",
"slider",
"nivo-slider"
] |
5,650,320 | 1 | 5,650,401 | null | 4 | 4,899 |
I am new to iphone programming. I am learning uitableview at the moment. I need to create an app that has buttons above table view (but not in the navigation bar) like in this app (recent, support, ...):

How is this achieved here, are buttons part of table's header? Is it possible to call a function to redraw tableview with new data after someone presses button above tableview. How is it done?
Thank you.
|
How to place buttons above UITableView (and not in navigation bar)?
|
CC BY-SA 3.0
| null |
2011-04-13T13:45:38.143
|
2011-04-13T16:00:25.950
| null | null | 324,417 |
[
"iphone",
"uitableview",
"button"
] |
5,650,467 | 1 | 5,651,444 | null | 0 | 317 |
Here is the context of my problem. First there is a thread that gets started:
```
-(void)run_thread: (NSObject* )file_path_NSObject
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *local_recordFilePath_NSString = (NSString *)file_path_NSObject;
NSLog(@"run thread : path %@ ", local_recordFilePath_NSString);
printf("Running Thread...\n");
runAllAudioRoutines(local_recordFilePath_NSString);
// more code....
```
Everything above prints correctly to the console. Then there is the method that gets called:
```
void runAllAudioRoutines(NSString *file)
{
NSLog(@"running All Audio Routines method...\n");
NSString *truncatedFilePath = [file stringByReplacingOccurrencesOfString:@"LoopExtended.wav"
withString:@"recordedFile.wav"];
NSLog(@"FILE for !!!! --> %@",truncatedFilePath);
const char *location = [truncatedFilePath UTF8String];
const char *write_location = [file UTF8String];
int *vocal_data = read_wav(location, &size_vocal);
// more code....
```
The strange thing is that of the NSLogs print . Nothing. Nada. Zip. And then the app crashes when it tries to pass the location to the read wav method (presumably because there is something wrong with the string).
This all started to happen when I switched from using NSTemporaryDirectory to NSBundle, but I'm not sure if that has anything to do with it. Any advice?
I've taken a Joetjah's suggestion and started using instead:
```
[self runAllAudioRoutines:local_recordFilePath_NSString];
-(void)runAllAudioRoutines:(NSString*) file
```
and now I get this:
Second run with 2nd suggestion from Joetjah
|
Problems passing NSString as argument in iPhone app
|
CC BY-SA 3.0
| 0 |
2011-04-13T13:56:58.113
|
2011-04-13T15:27:13.297
|
2011-04-13T15:09:52.833
| 385,559 | 385,559 |
[
"iphone",
"objective-c",
"cocoa-touch",
"nsstring",
"nsbundle"
] |
5,650,617 | 1 | 5,651,325 | null | 0 | 140 |
Hi,
can we find the coordinates of a UI element say UItextfield which is masked after rotation, if yes how is it possible?
Thanx in advance

|
how to find the coordinates of an autoresizemasked object after rotation
|
CC BY-SA 3.0
| null |
2011-04-13T14:07:40.877
|
2011-04-14T05:30:02.810
|
2011-04-14T05:30:02.810
| 195,504 | 195,504 |
[
"iphone",
"ipad",
"uiview"
] |
5,650,684 | 1 | 5,652,556 | null | 4 | 200 |
Given the picture below:

The position of A and B is known, the rest of the picture is just raw pixel data (only red and white pixels). What algorithm can I use to erase the part to the right of AB?
|
How to erase an area delimited by a line segment and a block of colors?
|
CC BY-SA 3.0
| 0 |
2011-04-13T14:13:15.657
|
2011-04-13T17:11:42.123
| null | null | 561,309 |
[
"algorithm",
"graphics",
"line",
"pixel"
] |
5,650,760 | 1 | 8,941,645 | null | 4 | 12,441 |
I am trying to display a GridView in a Dialog. Despite all my efforts, the GridView width grows to the entire screen, instead of wrapping to the columns. The layout and an image depicting the issue are below (I set a background color for the GridView to illustrate the issue).
```
<?xml version="1.0" encoding="utf-8"?>
<GridView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/colorgridview"
android:background="#FF00CCBB"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:numColumns="4"
android:verticalSpacing="5dp"
android:horizontalSpacing="5dp"
android:columnWidth="70dp"
android:stretchMode="none"
/>
```

|
Android: GridView width not wrapping to content?
|
CC BY-SA 3.0
| 0 |
2011-04-13T14:19:51.600
|
2022-08-06T21:19:56.530
| null | null | 426,493 |
[
"android"
] |
5,651,122 | 1 | 5,653,580 | null | 2 | 882 |
I am having an issue when I try to use .
I have created my model classes and I am also using the new ASP.NET MVC Tools Update MVcScaffolding out for the box feature when creating a new controller. this tooling feature also creates my DbContext class.
as it is explaind here :
[http://www.hanselman.com/blog/Mix11WebPlatformAndToolsKeynoteDemoScript.aspx](http://www.hanselman.com/blog/Mix11WebPlatformAndToolsKeynoteDemoScript.aspx)
Everything is fine. But, when I add the and try to compile, I am getting the following error;

My machine is windows vista, 32bit and I am using VS 2010 pro if it matters.
|
the command exited with code 4 with EntityFramework.SqlServerCompact nuget packge
|
CC BY-SA 3.0
| null |
2011-04-13T14:45:32.890
|
2011-04-13T18:06:12.993
| null | null | 463,785 |
[
"asp.net-mvc",
"visual-studio",
"asp.net-mvc-3",
"code-first",
"xcopy"
] |
5,651,208 | 1 | 5,651,517 | null | 1 | 143 |

I will have the input as the left hand side 11 digits and the output should be preceeding to that or can any one tell how can i get that ouput byu taking those inputs as byte array
|
Can any one tell what type of conversion is this
|
CC BY-SA 3.0
| 0 |
2011-04-13T14:51:36.267
|
2011-04-14T07:45:52.667
|
2011-04-13T15:11:09.463
| 552,236 | 552,236 |
[
"c#",
".net-2.0"
] |
5,651,275 | 1 | null | null | 2 | 856 |

I think this is a very smart control, does winForms have such a thing?
|
Need Help Locating Winforms-compatible Custom Tooltip Control
|
CC BY-SA 3.0
| null |
2011-04-13T14:55:52.093
|
2011-04-13T15:19:06.110
|
2011-04-13T15:01:21.410
| null | 508,284 |
[
"c#",
"winforms"
] |
5,651,279 | 1 | 5,651,940 | null | 0 | 2,639 |
I am getting some strange wrapping behavior in Chrome with jquery tools tabs:

When the browser is larger, they all just appear in one row.
The CSS for the tabs is:
```
/* root element for tabs */
ul.tabs {
margin:0 !important;
padding:0;
height:30px;
border-bottom:1px solid #666;
}
/* single tab */
ul.tabs li {
float:left;
padding:0;
margin:0;
list-style-type:none;
}
/* link inside the tab. uses a background image */
ul.tabs a {
float:left;
font-size:13px;
display:block;
padding:5px 30px;
text-decoration:none;
border:1px solid #666;
border-bottom:0px;
height:18px;
background-color:#efefef;
color:#777;
margin-right:2px;
position:relative;
top:1px;
outline:0;
-moz-border-radius:4px 4px 0 0;
}
ul.tabs a:hover {
background-color:#F7F7F7;
color:#333;
}
/* selected tab */
ul.tabs a.current {
background-color:#ddd;
border-bottom:1px solid #ddd;
color:#000;
cursor:default;
}
/* tab pane */
.panes div {
display:none;
border:1px solid #666;
border-width:0 1px 1px 1px;
min-height:150px;
padding:15px 20px;
background-color:#ddd;
}
```
The Over all structure of this page is:

Anyone have any suggestions on how I mix fix or work around this?
|
Tab Wrapping Behavior with CSS and jquery.tools tabs
|
CC BY-SA 3.0
| null |
2011-04-13T14:56:09.057
|
2011-04-13T15:42:56.260
| null | null | 107,156 |
[
"jquery",
"css",
"jquery-tabs"
] |
5,651,294 | 1 | 5,651,494 | null | 0 | 707 |
What way can you recommend? Perhaps, there is some control for this purpose.
I'm trying to generate input data for learning neural network for recognation black-white images. I have the table 3x3, clicking on cells the background color is changed. Black means "1", white - "0". And for selected combination it's need to set the output value.

So, in that case I receive 0,0,1,1,0,0,0,0,1 and output - 1
This List I generate using Javascript and send to codebehind by means of hidden field.
I must show these combinations on page with the ability to delete them
|
How to display the data of type List<List<int>> on page?
|
CC BY-SA 3.0
| null |
2011-04-13T14:57:03.220
|
2011-04-13T17:10:23.637
|
2011-04-13T16:59:49.770
| 648,137 | 648,137 |
[
"asp.net"
] |
5,651,370 | 1 | 6,088,332 | null | 2 | 418 |
I am looking to integrate label printing into my application. Does anybody know where I can obtain the data required to build up my own database of label data, such as label width, height, diameter, vertical pitch, gutters etc? Just like Microsoft Office Word.
I contacted one supplier (Avery) direct and they told me that they do not provide such information. However there are plenty of software applications out there that have this data built into their systems. I have also looked at the Microsoft Access Database that powers Words label printing (C:\Program Files (x86)\Microsoft Office\Office14\ACCWIZ\ACWZUSR12.ACCDU). However the data provided does not seem to tally with the label manufacturers data.
Any help on this one would be much appreciated.
UPDATE - Screenshot of Avery Label L7160 record in Access Database

Screenshot of L7160 label in word

|
How to obtain label data for c# application
|
CC BY-SA 3.0
| 0 |
2011-04-13T15:02:36.963
|
2011-05-22T13:52:30.933
|
2011-04-13T16:02:47.073
| 109,288 | 109,288 |
[
"c#"
] |
5,651,549 | 1 | 5,654,168 | null | 0 | 511 |
I am trying to place a new phtml block at a specific place within another phtml page and I am not getting the results I expected - any advice would be much appreciated.
Specifically, I created a new childHtml block for the cart page in my module's xml layout file:
```
<layout version="0.1.0">
<checkout_cart_index>
<reference name="head">
<action method="addJs"><script>varien/product.js</script></action>
<action method="addItem"><type>js_css</type><name>calendar/calendar-win2k-1.css</name><params/><!--<if/><condition>can_load_calendar_js</condition>--></action>
<action method="addItem"><type>js</type><name>calendar/calendar.js</name><!--<params/><if/><condition>can_load_calendar_js</condition>--></action>
<action method="addItem"><type>js</type><name>calendar/calendar-setup.js</name><!--<params/><if/><condition>can_load_calendar_js</condition>--></action>
</reference>
<reference name="content">
<block type="delivery/frontend_checkout_cart_delivery" name="delivery.container" as="delivery" template="unleaded/delivery/checkout/cart/shipping/delivery.phtml"/>
<block type="core/html_calendar" name="delivery_html_calendar" as="delivery_html_calendar" template="page/js/calendar.phtml"/>
</reference>
</checkout_cart_index>
</layout>
```
Next I made a call to `$this->getChildHtml('delivery')` in my modified `checkout/cart/shipping.phtml` template where I wanted it placed:
```
....
<?php foreach ($_shippingRateGroups as $code => $_rates): ?>
....
<?php foreach ($_rates as $_rate): ?>
....
<li>
<?php if ($_rate->getCode() == 'delivery'): ?>
<?php echo $this->getChildHtml('delivery'); ?>
<?php endif; ?>
</li>
....
<?php endforeach; ?>
....
<?php endforeach; ?>
....
```
What I wanted / expected was to see my block output where I inserted it, but instead it is being output at the very bottom of the page (see screenshot). I am almost certain my mistake is an xml / layout based mistake, but I don't know what?

|
Exact Placement of childHtml Block (unexpected result)
|
CC BY-SA 3.0
| 0 |
2011-04-13T15:15:07.017
|
2011-04-13T19:00:26.140
|
2011-04-13T18:15:50.003
| 597,373 | 597,373 |
[
"magento"
] |
5,651,725 | 1 | 5,652,645 | null | 5 | 7,567 |
I record a daily 2 minutes radio broadcast from Internet. There's always the same starting and ending jingle. Since the radio broadcast exact time may vary from more or less 6 minutes I have to record around 15 minutes of radio.
I wish to identify the exact time where those jingles are in the 15 minutes record, so I can extract the portion of audio I want.
I already started a C# application where I decode an MP3 to PCM data and convert the PCM data to a spectrogram based on [http://www.codeproject.com/KB/audio-video/SoundCatcher.aspx](http://www.codeproject.com/KB/audio-video/SoundCatcher.aspx)
I tried to use a Cross Correlation algorithm on the PCM data but the algorithm is very slow around 6 minutes with a step of 10ms and is some occasion it fail to find the jingle start time.
Any ideas of algorithms to compare two spectrogram for match? Or a better way to find that jingle start time?
Thanks,
First, thank for all the anwsers most of them were relevent and or interresting ideas.
I tried to implement the Shazam algorithm proposed by fonzo. But failed to detect the peaks in the spectrogram. Here's three spectrograms of the starting jingle from three different records. I tried AForge.NET with the blob filter (but it failed to identify peaks), to blur the image and check for difference in height, the Laplace convolution, slope analysis, to detect the series of vertical bars (but there was too many false positive)...
In the mean while, I tried the Hough algorithm proposed by Dave Aaron Smith. Where I calculate the RMS of each columns. Yes yes each columns, it's a O(N*M) but M << N (Notice a column is around 8k of sample). So in the overall it's not that bad, still the algorithm take about 3 minutes, but has never fail.
I could go with that solution, but if possible, I would prefer the Shazam cause it's O(N) and probably much faster (and cooler also). So does any of you have an idea of an algorithm to always detect the same points in those spectrograms (doesn't have to be peaks), thanks to add a comment.



Finally, I went with the algorithm explained above, I tried to implement the Shazam algorithm, but failed to find proper peaks in the spectrogram, the identified points where not constant from one sound file to another. In theory, the Shazam algorithm is the solution for that kind of problem. The Hough algorithm proposed by Dave Aaron Smith was more stable and effective. I split around 400 files, and only 20 of them fail to split properly. Disk space when from 8GB to 1GB.
Thanks, for your help.
|
Compare two spectogram to find the offset where they match algorithm
|
CC BY-SA 3.0
| 0 |
2011-04-13T15:26:18.603
|
2011-05-26T15:10:58.067
|
2011-05-26T15:10:58.067
| 706,923 | 706,923 |
[
"c#",
"algorithm",
"audio",
"comparison",
"spectrogram"
] |
5,651,742 | 1 | null | null | 1 | 1,570 |
I'm building an iPhone application and in one of my problems, I am trying to resize sub views. First, I have a Table View that when each data is tapped, it opens a new view. But the problem is that images and text in that opened view (which contains a Navigation Controller) is not aligned properly. They are all misplaced and my guesses is that on that view, it's only showing 3/4 of the top, not the whole view (which most of my images at the bottom are only showing half of the image). My goal is to fit every image and text to fit into my view that contains a Navigation Controller at the top of my view. So after researching, I can change the size and position in Interface Builder, but for some reason they are blank which I can't edit:

In addition, I tried this code in my viewDidLoad:
```
// DetailViewController.m
- (void)viewDidLoad {
[super viewDidLoad];
self.view.autoresizesSubviews = YES;
self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
}
```
So far none of these are even resizing my view to fit with my navigation controller, so I hope someone has a better idea how to resize and fit my view with Navigation Controller, thanks
|
How to resize sub views in Navigation Controller in Interface Builder
|
CC BY-SA 3.0
| null |
2011-04-13T15:28:25.527
|
2011-04-18T14:58:20.323
|
2011-04-18T14:58:20.323
| 616,482 | 616,482 |
[
"objective-c",
"xcode",
"view",
"interface-builder",
"resize"
] |
5,651,767 | 1 | 5,651,836 | null | 0 | 393 |
how to draw a small blue square on the overview of my icon for my mouse like this


|
Draw small blue square when over my icon
|
CC BY-SA 3.0
| null |
2011-04-13T15:30:33.950
|
2011-04-13T15:58:13.423
| null | null | 296,635 |
[
"javascript",
"html",
"css",
"hover"
] |
5,651,875 | 1 | 5,652,176 | null | 0 | 244 |
I have a webpage which has a textbox section in it. I want it to be similar like this image:

But not that much complicated regarding code files goes. Want the user to edit some characters put some Bold/Underline/Italic fonts into it. Some smileys that all.
Any help?
|
What to embed for a Richview Textbox with some formatting?
|
CC BY-SA 3.0
| null |
2011-04-13T15:37:45.010
|
2011-04-13T16:02:09.830
| null | null | 529,995 |
[
"c#",
"asp.net",
"richtextbox"
] |
5,651,880 | 1 | null | null | 2 | 202 |
I am trying to create an UI just like the attached image!

How do we create these types of UI? Is it a `ListView`? And how do we get the arrow button on the right hand side? How should I start with such kind of layouts?
|
How to create an UI similar to the attached image?
|
CC BY-SA 3.0
| 0 |
2011-04-13T15:38:24.713
|
2011-04-13T16:20:24.583
|
2011-04-13T16:20:24.583
| 418,183 | 672,473 |
[
"android",
"layout"
] |
5,651,948 | 1 | null | null | 2 | 3,100 |
I am using Facebook C# SDK in my ASP.net application.
I have an iFrame application whose iFrame Size set to Showscrollbars.

The application was working fine till yesterday, but today the iFrame is not stretching to its width (From the documentation Facebook's iFrame width is 760px [Link here](http://developers.facebook.com/docs/guides/canvas/)). The page in my application's width is set to 95%. So I think its not a width problem in my application.
.
I have to use Showscrollbars option for my application.
Did facebook Changed any settings for the iFrame Apps? Help please.
Looks like facebook broke something or they are trying to get rid of scrollbar options. I have to change my application to use AutoResize Option. I made the following changes to my asp.net application and it is working fine except one issue (see at the bottom of the question)
```
<head runat="server">
<title></title>
<script type="text/javascript">
window.fbAsyncInit = function () {
FB.Canvas.setAutoResize();
};
</script>
</head>
<body>
<div id="fb-root"></div>
<script src="//connect.facebook.net/en_US/all.js"></script>
<script>
FB.init({
appId: '12345678', //replace with your facebook appid
cookie: true,
status: true,
xfbml: true
});
</script>
</body>
```
iFrame stretches vertically when the content increases. That's cool but the
is [Read Here on StackOverflow](https://stackoverflow.com/questions/3024525/facebook-javascript-sdk-fb-canvas-setautoresize-iframe-not-working). I am working on it. If any one figures it out please let me know.
|
Facebook Canvas Application iFrame Size Showscrollbars Issue
|
CC BY-SA 3.0
| 0 |
2011-04-13T15:43:40.830
|
2011-05-12T14:52:25.783
|
2017-05-23T12:01:09.963
| -1 | 542,240 |
[
"facebook",
"iframe",
"facebook-graph-api",
"facebook-c#-sdk",
"facebook-iframe"
] |
5,652,431 | 1 | null | null | 0 | 430 |
I'm developing a Windows Phone app.
I have a user control with the following XAML code:
```
<UserControl x:Class="XXXXXXX.Views.SignIn.FacebookControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
d:DesignHeight="768" d:DesignWidth="480">
<Grid x:Name="LayoutRoot" Background="{StaticResource PhoneChromeBrush}">
<!--ContentPanel. Colocar aquí el contenido adicional-->
<Grid x:Name="ContentPanel" Margin="12,0,12,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock
Grid.Row="1"
Height="30"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Visibility="Visible"
Margin="10"
Name="LoadingText"
Text="{Binding Path=AppResources.BrowserNavigating, Source={StaticResource LocalizedStrings}}"/>
<phone:WebBrowser
Grid.Row="0"
Name="FacebookLoginBrowser"
IsScriptEnabled="True"
Height="607"
VerticalAlignment="Top"
HorizontalAlignment="Stretch"
Margin="0,10"
Navigated="FacebookLoginBrowser_Navigated"
Loaded="FacebookLoginBrowser_Loaded"
Navigating="FacebookLoginBrowser_Navigating"/>
</Grid>
</Grid>
</UserControl>
```
I'm a get this:

`WebBrowser` has a left margin, bigger than its right margin.
And this is how I'm embedding my user control:
```
facebookControl = new FacebookControl();
facebookControl.SetValue(Grid.RowSpanProperty, 2);
facebookControl.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
facebookControl.VerticalAlignment = System.Windows.VerticalAlignment.Top;
facebookControl.Margin = new Thickness(0);
facebookControl.Height = 768;
facebookControl.Width = 480;
ContentPanel.Children.Add(facebookControl);
```
And this is the definition for ContentPanel:
```
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
...
```
How can I fix this?
|
WebBrowser strange behaviour with margins
|
CC BY-SA 3.0
| null |
2011-04-13T16:24:11.100
|
2011-04-13T18:41:18.290
|
2011-04-13T17:52:27.753
| 68,571 | 68,571 |
[
"layout",
"windows-phone-7",
"webbrowser-control",
"margin"
] |
5,652,604 | 1 | 5,652,687 | null | 0 | 1,523 |
I have a login mechanism consisting of a JSF page + managed bean + EJB, it works fine but the only bug is that i don't see the error message when the password is entered wrong. Any ideas?
When the password is entered wrong this is what i get in the browser:

I can avoid this if i don't throw a ValidationException at the catch in the EJB(See EJB code below) but then i don't see any validation message in the form at all when the password is entered wrong.
This is the code for the form at the page:
```
<h:form>
<p:panel>
<h:outputText value="*Em@il:" />
<h:inputText id="email" value="#{securityController.email}" binding="#{emailComponent}"/>
<br/>
<h:outputText value="*Lozinka: " />
<h:inputSecret id="password" value="#{securityController.password}" validator="#{securityController.validate}">
<f:attribute name="emailComponent" value="#{emailComponent}" />
</h:inputSecret>
<br/>
<span style="color: red;"><h:message for="password"
showDetail="true" /></span>
<br/>
<h:commandButton value="Login" action="#{securityController.logIn()}"/>
</p:panel>
</h:form>
```
This is the code for the managedBean:
```
@ManagedBean
@RequestScoped
public class SecurityController {
@EJB
private IAuthentificationEJB authentificationEJB;
private String email;
private String password;
private String notificationValue;
public String logIn() {
if (authentificationEJB.saveUserState(email, password)) {
notificationValue = "Dobro dosli";
return "main.xhtml";
} else {
return "";
}
}
public void validate(FacesContext context, UIComponent component,
Object value) throws ValidatorException {
UIInput emailComponent = (UIInput) component.getAttributes().get(
"emailComponent");
String email = "";
String password = "";
email = (String) emailComponent.getValue();
password = (String) value;
String emailInput = email;
String emailPatternText = "^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";
Pattern emailPattern = null;
Matcher emailMatcher = null;
emailPattern = Pattern.compile(emailPatternText);
emailMatcher = emailPattern.matcher(emailInput);
String passwordInput = password;
String alphanumericPattern = "^[a-zA-Z0-9]+$";
Pattern passwordPattern = null;
Matcher passwordMatcher = null;
passwordPattern = Pattern.compile(alphanumericPattern);
passwordMatcher = passwordPattern.matcher(passwordInput);
if (!emailMatcher.matches() && !passwordMatcher.matches()) {
if (authentificationEJB.checkCredentials(emailInput, passwordInput) == false) {
FacesMessage msg = new FacesMessage(
"Pogresan email ili lozinka");
throw new ValidatorException(msg);
}
}
if(emailInput == null || passwordInput == null) {
FacesMessage msg = new FacesMessage("Pogresan email ili lozinka");
throw new ValidatorException(msg);
}
if (passwordInput.length() <= 0 || emailInput.length() <= 0) {
FacesMessage msg = new FacesMessage("Pogresan email ili lozinka");
throw new ValidatorException(msg);
}
}
public String getEmail() {
return email;
}
public String getPassword() {
return password;
}
public void setEmail(String email) {
this.email = email;
}
public void setPassword(String password) {
this.password = password;
}
public String getNotificationValue() {
return notificationValue;
}
public void setNotificationValue(String notificationValue) {
this.notificationValue = notificationValue;
}
}
```
This is the code for the EJB
```
@Stateful(name = "ejbs/AuthentificationEJB")
public class AuthentificationEJB implements IAuthentificationEJB {
@PersistenceContext
private EntityManager em;
// Login
public boolean saveUserState(String email, String password) {
// 1-Send query to database to see if that user exist
Query query = em
.createQuery("SELECT r FROM Role r WHERE r.email=:emailparam AND r.password=:passwordparam");
query.setParameter("emailparam", email);
query.setParameter("passwordparam", password);
// 2-If the query returns the user(Role) object, store it somewhere in
// the session
try {
Role role = (Role) query.getSingleResult();
if (role != null && role.getEmail().equals(email)
&& role.getPassword().equals(password)) {
FacesContext.getCurrentInstance().getExternalContext()
.getSessionMap().put("userRole", role);
// 3-return true if the user state was saved
System.out.println(role.getEmail() + role.getPassword());
return true;
}
} catch (Exception e) {
FacesMessage msg = new FacesMessage("Pogresan email ili lozinka");
throw new ValidatorException(msg);
}
// 4-return false otherwise
return false;
}
// Logout
public void releaseUserState() {
// 1-Check if there is something saved in the session(or wherever the
// state is saved)
if (!FacesContext.getCurrentInstance().getExternalContext()
.getSessionMap().isEmpty()) {
FacesContext.getCurrentInstance().release();
}
// 2-If 1 then flush it
}
// Check if user is logged in
public boolean checkAuthentificationStatus() {
// 1-Check if there is something saved in the session(This means the
// user is logged in)
if ((FacesContext.getCurrentInstance().getExternalContext()
.getSessionMap().get("userRole") != null)) {
// 2-If there is not a user already loged, then return false
return true;
}
return false;
}
@Override
public boolean checkCredentials(String email, String password) {
Query checkEmailExists = em
.createQuery("SELECT COUNT(r.email) FROM Role r WHERE r.email=:emailparam AND r.password=:passwordparam");
checkEmailExists.setParameter("emailparam", email);
checkEmailExists.setParameter("passwordparam", password);
long matchCounter = 0;
matchCounter = (Long) checkEmailExists.getSingleResult();
if (matchCounter > 0) {
return true;
}
return false;
}
}
```
Here in the EJB i think i make a mistake if i throw the ValidationException in the catch block, because i think displaying error messages at the front end should be a task for the managed bean. I dont understand why the form does not display the error as it does when the fields are empty when the password is wrong(When the email is wrong it displays correctly the validation message).
Changed the saveUserState() method at the EJB to:
```
// Login
public boolean saveUserState(String email, String password) {
// 1-Send query to database to see if that user exist
Query query = em
.createQuery("SELECT r FROM Role r WHERE r.email=:emailparam AND r.password=:passwordparam");
query.setParameter("emailparam", email);
query.setParameter("passwordparam", password);
// 2-If the query returns the user(Role) object, store it somewhere in
// the session
List<Object> tmpList = query.getResultList();
if (tmpList.isEmpty() == false) {
Role role = (Role) tmpList.get(0);
if (role != null && role.getEmail().equals(email)
&& role.getPassword().equals(password)) {
FacesContext.getCurrentInstance().getExternalContext()
.getSessionMap().put("userRole", role);
// 3-return true if the user state was saved
System.out.println(role.getEmail() + role.getPassword());
return true;
}
}
// 4-return false otherwise
return false;
}
```
The check credentials method:
```
public boolean checkCredentials(String email, String password) {
Query checkEmailExists = em
.createQuery("SELECT COUNT(r) FROM Role r WHERE r.email=:emailparam AND r.password=:passwordparam");
checkEmailExists.setParameter("emailparam", email);
checkEmailExists.setParameter("passwordparam", password);
int matchCounter = 0;
matchCounter = checkEmailExists.getResultList().size();
if (matchCounter == 1) {
return true;
}
return false;
}
```
|
Login form doesn't display validation message when password is wrong
|
CC BY-SA 3.0
| null |
2011-04-13T16:37:18.000
|
2011-04-13T17:43:26.380
|
2011-04-13T17:43:26.380
| 614,141 | 614,141 |
[
"java",
"jsf",
"jakarta-ee",
"jsf-2",
"java-ee-6"
] |
5,652,684 | 1 | 5,653,676 | null | 0 | 2,849 |
Please refer to this image, so I can explain the issue better.
I have Master/Detail form (Bill of Materials in this case), which stores data in 2 database tables.
The top of the form (Product,Quantity) is stored in the Master table, and with the inserted id(as FK), the Details table is populated with as many components and quantity entered below.
But, until the final SAVE(submit) is pressed, I'm storing the component ID (value from the dropdown) and the quantity (from the input field) into JavaScript object within array:
```
var products = [];
$("#add").click(function(){
var prodname_fk = $("select").val();
var prodname = $("select option:selected").text();
var quantity = $("#quantity").val();
//Checks if the product or quantity has not been selected
if (quantity == '' || prodname_fk == '')
{
alert("Please select product and quantity!");
return false;
}
//Pushes the Objects(products [id,quantity,prodname,uom]) into the Array
products.push({id:prodname_fk,prodname:prodname,quantity:quantity});
//Test Purpose CONSOLE output
var i = 0;
$.each(products, function(){
console.log(products[i].id + " --> " + products[i].prodname + " --> " + products[i].quantity);
i++;
});
//Emptys the product and quantity
$("select").val("");
$("#quantity").val("");
});
```
I also get the product name (text from the dropbox) for displaying purposes in the table below.
So, my question is:
- How can I output the Component and Quantity in the table where it says "No Records!", after each ADD is pressed? (ADD does not submit or refresh the page)- How can I add "delete" function in the same table for each object from the array?- How can I check if a component exists already in the array, and just add up the quantity?
This is my form:

Thank you very much in advance!
p.s. I'm trying to achieve something like this: [How to store temporary data at the client-side and then send it to the server](https://stackoverflow.com/questions/4329860/how-to-store-temporary-data-at-the-client-side-and-then-send-it-to-the-server)
|
Display temporary data client-side within table
|
CC BY-SA 3.0
| null |
2011-04-13T16:43:56.940
|
2019-05-13T10:02:37.953
|
2017-05-23T10:32:35.693
| -1 | 641,048 |
[
"php",
"javascript",
"jquery",
"ajax",
"codeigniter"
] |
5,652,845 | 1 | 5,652,886 | null | 2 | 219 |
There is Address Cards view when we click on Contacts in Microsoft Outlook. I want to use this same feature in my application. I am using swing. But didnt get whether the view is a bunch of JTables created at run time or some cells of JTable are highlighted that way? Need your suggestions to create view like this.
I have attached an example image available on the net.

|
Want to use the feature of Address card view of Microsoft Outlook in Java
|
CC BY-SA 3.0
| null |
2011-04-13T16:57:06.627
|
2011-04-14T22:26:01.873
|
2020-06-20T09:12:55.060
| -1 | 646,023 |
[
"java",
"swing",
"outlook",
"jtable"
] |
5,652,915 | 1 | 5,652,979 | null | 0 | 1,876 |
I have this curious question. I was looking at XML files and so I did this twitter search:
[http://search.twitter.com/search.atom?q=basketball](http://search.twitter.com/search.atom?q=basketball)
The output for Chrome looks like this:

The output for Firefox looks like this:

Then, the output for Safari looks like this:

My question is, what is going on? How can I get the browser to display it in different forms. In other words, if I want to output the `<?xml ...`, how can I do that?
|
Chrome, Safari, Firefox outputs XML differently
|
CC BY-SA 3.0
| null |
2011-04-13T17:05:50.160
|
2011-04-13T17:21:58.570
|
2011-04-13T17:07:38.187
| 119,549 | 384,964 |
[
"xml",
"firefox",
"google-chrome",
"safari"
] |
5,653,087 | 1 | 5,653,394 | null | 1 | 3,040 |
I'm running my iPhone app on the simulator to record my voice. It saves the recording to a .wav file, but I don't know where that is on my machine. Any help?
---
Please keep in mind that I'm trying to 'simulate' the experience on a device. So my use of directories is crucial. See my output to the console:

---
This is really strange. I just tried to record my voice with the Speak Here example project ('out of the box') and it worked (played back my voice and everything). Yet when I use the finder to try to locate the file... no deals! This is really bizarre. Any ideas?
|
Where does the iPhone simulator keep it's tmp/ files?
|
CC BY-SA 3.0
| null |
2011-04-13T17:21:30.373
|
2015-03-12T01:05:18.817
|
2011-04-14T09:19:00.720
| 385,559 | 385,559 |
[
"iphone",
"objective-c",
"cocoa-touch",
"ios-simulator"
] |
5,653,607 | 1 | 5,653,642 | null | 2 | 873 |
I am trying to find a solution for the next problem with help of Java. I have a graph, this is a good example of how it could look:

There is its notation:
[{ = {C = 0.7}, {D = 0.3}},
{ = {out = 0.2}, {F = 0.8}},
{ = {C = 0.1}, {F = 0.2}, {G = 0.3}, {E = 0.4}},
{ = {A = 0.4},{B = 0.6}},
{ = {G = 0.3},{out = 0.7}},
{ = {B = 0.2}{out = 0.8}},
...
- is a start node (S = 1), - is a way out of the graph.
I want to trace the graph and know how much percentage each node has.
In instance, = 0.4*S (S = 1), = 0.7A + 0.1D , = 0.3A + 0.7B
I thought it is possible to do it with recursion(DFS for directed graphs, in particular Tarjan's alg.), but while there are cycles I do not think it helps. Another solution is to solve a system of linear equations.
I do not know what is better that would work, and maybe there are some solutions exist for this kind of tasks.
This example is just an example, but I should consider that I have like appr. 2000 nodes (and who know how many cycles).
How would you do it?
|
how to solve the graph with cycles
|
CC BY-SA 3.0
| 0 |
2011-04-13T18:08:43.480
|
2011-04-13T19:42:53.440
| null | null | 568,287 |
[
"java",
"algorithm",
"graph"
] |
5,653,640 | 1 | 5,653,705 | null | 1 | 1,586 |
I am trying to understand why my login form does not display the validation message that says when the password is entered wrong. In all the other cases it works correctly(Just case 4 doesnt work):
Case 1 works with no problem(No input given):

Case 2 works with no problem(Only input given for email):

Case 3 works with no problem(Only input given for password):

(Both inputs given wrong)

It is the case 4 that doesn't work correctly here is the source code:
The form at the JSF page:
```
<h:form>
<p:panel>
<h:outputText value="*Em@il:" />
<h:inputText id="email" value="#{securityController.email}" binding="#{emailComponent}"/>
<br/>
<h:outputText value="*Lozinka: " />
<h:inputSecret id="password" value="#{securityController.password}" validator="#{securityController.validate}">
<f:attribute name="emailComponent" value="#{emailComponent}" />
</h:inputSecret>
<br/>
<span style="color: red;"><h:message for="password"
showDetail="true" /></span>
<br/>
<h:commandButton value="Login" action="#{securityController.logIn()}"/>
</p:panel>
</h:form>
```
The managed bean that gets the values from the input fields
```
@ManagedBean
@RequestScoped
public class SecurityController {
@EJB
private IAuthentificationEJB authentificationEJB;
private String email;
private String password;
private String notificationValue;
public String logIn() {
if (authentificationEJB.saveUserState(email, password)) {
notificationValue = "Dobro dosli";
return "main.xhtml";
} else {
return "";
}
}
public void validate(FacesContext context, UIComponent component,
Object value) throws ValidatorException {
UIInput emailComponent = (UIInput) component.getAttributes().get(
"emailComponent");
String email = "";
String password = "";
email = (String) emailComponent.getValue();
password = (String) value;
String emailInput = email;
String emailPatternText = "^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";
Pattern emailPattern = null;
Matcher emailMatcher = null;
emailPattern = Pattern.compile(emailPatternText);
emailMatcher = emailPattern.matcher(emailInput);
String passwordInput = password;
String alphanumericPattern = "^[a-zA-Z0-9]+$";
Pattern passwordPattern = null;
Matcher passwordMatcher = null;
passwordPattern = Pattern.compile(alphanumericPattern);
passwordMatcher = passwordPattern.matcher(passwordInput);
if (!emailMatcher.matches() && !passwordMatcher.matches()) {
if (authentificationEJB.checkCredentials(emailInput, passwordInput) == false) {
FacesMessage msg = new FacesMessage(
"Pogresan email ili lozinka");
throw new ValidatorException(msg);
}
}
if(emailInput == null || passwordInput == null) {
FacesMessage msg = new FacesMessage("Pogresan email ili lozinka");
throw new ValidatorException(msg);
}
if (passwordInput.length() <= 0 || emailInput.length() <= 0) {
FacesMessage msg = new FacesMessage("Pogresan email ili lozinka");
throw new ValidatorException(msg);
}
}
public String getEmail() {
return email;
}
public String getPassword() {
return password;
}
public void setEmail(String email) {
this.email = email;
}
public void setPassword(String password) {
this.password = password;
}
public String getNotificationValue() {
return notificationValue;
}
public void setNotificationValue(String notificationValue) {
this.notificationValue = notificationValue;
}
}
```
The EJB that accesses the DB and checks the credentials:
```
package ejbs;
import java.util.List;
import javax.ejb.Stateful;
import javax.faces.context.FacesContext;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import ejbinterfaces.IAuthentificationEJB;
import entities.Role;
@Stateful(name = "ejbs/AuthentificationEJB")
public class AuthentificationEJB implements IAuthentificationEJB {
@PersistenceContext
private EntityManager em;
// Login
public boolean saveUserState(String email, String password) {
// 1-Send query to database to see if that user exist
Query query = em
.createQuery("SELECT r FROM Role r WHERE r.email=:emailparam AND r.password=:passwordparam");
query.setParameter("emailparam", email);
query.setParameter("passwordparam", password);
// 2-If the query returns the user(Role) object, store it somewhere in
// the session
List<Object> tmpList = query.getResultList();
if (tmpList.isEmpty() == false) {
Role role = (Role) tmpList.get(0);
if (role != null && role.getEmail().equals(email)
&& role.getPassword().equals(password)) {
FacesContext.getCurrentInstance().getExternalContext()
.getSessionMap().put("userRole", role);
// 3-return true if the user state was saved
System.out.println(role.getEmail() + role.getPassword());
return true;
}
}
// 4-return false otherwise
return false;
}
// Logout
public void releaseUserState() {
// 1-Check if there is something saved in the session(or wherever the
// state is saved)
if (!FacesContext.getCurrentInstance().getExternalContext()
.getSessionMap().isEmpty()) {
// 2-If 1 then flush it
FacesContext.getCurrentInstance().release();
}
}
// Check if user is logged in
public boolean checkAuthentificationStatus() {
// 1-Check if there is something saved in the session(This means the
// user is logged in)
if ((FacesContext.getCurrentInstance().getExternalContext()
.getSessionMap().get("userRole") != null)) {
// 2-If there is not a user already loged, then return false
return true;
}
return false;
}
@Override
public boolean checkCredentials(String email, String password) {
Query checkEmailExists = em
.createQuery("SELECT COUNT(r) FROM Role r WHERE r.email=:emailparam AND r.password=:passwordparam");
checkEmailExists.setParameter("emailparam", email);
checkEmailExists.setParameter("passwordparam", password);
int matchCounter = 0;
matchCounter = checkEmailExists.getResultList().size();
if (matchCounter == 1) {
return true;
}
return false;
}
}
```
|
Validation message not being displayed in login form when the user enters wrong password
|
CC BY-SA 3.0
| null |
2011-04-13T18:11:40.687
|
2011-04-13T18:18:00.997
| null | null | 614,141 |
[
"java",
"jsf",
"jakarta-ee",
"jsf-2",
"java-ee-6"
] |
5,653,771 | 1 | 5,655,441 | null | 0 | 2,139 |
I am using the three20 library (not sure if this is the cause) and am getting a leak when going back and forth between two views of a navigation controller.

More details of one of the leaks:

The only think I can think of is that I show the toolbar when it pushes the second view onto the stack:
```
/**
* View is going to appear
*
* @version $Revision: 0.1
*/
- (void) viewWillAppear:(BOOL)animated {
[self.navigationController setToolbarHidden:NO animated:animated];
[super viewWillAppear:animated];
}//end
/**
* View will disappear
*
* @version $Revision: 0.1
*/
- (void) viewWillDisappear:(BOOL)animated {
[self.navigationController setToolbarHidden:YES animated:animated];
[super viewWillDisappear:animated];
}//end
```
For the life of me, I cannot figure out where this is coming from. The extended detail stack trace is not showing any of my classes.
Where could this be coming from?
|
UIDeviceRGBColor leak - how to fix?
|
CC BY-SA 3.0
| null |
2011-04-13T18:25:06.460
|
2011-04-13T20:49:25.887
|
2011-04-13T19:27:59.227
| 144,695 | 144,695 |
[
"iphone",
"ios",
"memory-leaks",
"three20",
"instruments"
] |
5,653,966 | 1 | 5,654,023 | null | 0 | 96 |
I'm a beginner to PHP/mySql. I'm writing a CMS and still in the early stage.
I wrote a code to take the information from the mySql table and but it into a HTML table. The problem is , before applying a certain IF statement, the whole data in the mySql table is shown, which is what I want... But after applying that IF statement part of my data simply disappears! (the first raw to be specific) .. So here's my code that will be efficient for you to diagnose my issue .. If you needed additional pieces just tell me.
First of all, here's my HTML table BEFORE applying IF statement:

And here's AFTER :

Here's my code WITHOUT IF statement:
```
<?php
function make_table() {
$myResult = get_ind_info_fam();
$ind_field_count = mysql_num_fields($myResult) -1;
// Table to show ALL individuals info.
echo "<table>" ;
// Table Headers:
for ($i = 2 ; $i <= $ind_field_count ; $i++) {
$field_name = mysql_field_name($myResult, $i);
$field_name = ucwords($field_name);
if ($i ==2) {
$field_name = "Individual Name";
}
echo "<th>{$field_name}</th>";
}
// Table Data :
while ($myData = mysql_fetch_array($myResult)){
echo "<tr>";
for ($i = 2 ; $i <= $ind_field_count ; $i++) {
echo "<td>{$myData[$i]}</td>";
}
echo "</tr>";
}
echo "</table>" ;
}
?>
```
And the Code WITH the IF statement :
```
<?php
function make_table() {
$myResult = get_ind_info_fam();
// Checking if a correct $_GET["fam"] is entered
// (not out of range) so an empty table won't be shown :
if (isset($myResult)) {
if($myData = mysql_fetch_array($myResult)) {
$ind_field_count = mysql_num_fields($myResult) -1;
// Table to show ALL individuals info.
echo "<table>" ;
// Table Headers:
for ($i = 2 ; $i <= $ind_field_count ; $i++) {
$field_name = mysql_field_name($myResult, $i);
$field_name = ucwords($field_name);
if ($i ==2) {
$field_name = "Individual Name";
}
echo "<th>{$field_name}</th>";
}
// Table Data :
while ($myData = mysql_fetch_array($myResult)){
echo "<tr>";
for ($i = 2 ; $i <= $ind_field_count ; $i++) {
echo "<td>{$myData[$i]}</td>";
}
echo "</tr>";
}
echo "</table>" ;
}
}
}
?>
```
And this is my `get_ind_info_fam()` function:
```
function get_ind_info_fam()
{
//****Family name is clicked*****
//This function gets Family ID from addresse bar
//and extract individual info according to that ID by $_GET variable
//
//NOTE : this function is used in the article to show content of
// selected family name.
if(is_numeric($_GET["fam"])) {
$query ="SELECT * FROM individual
WHERE g_id={$_GET["fam"]}";
$result = mysql_query($query);
return $result ;
}
}
```
I don't really know what exactly to tell you to get the full picture but if there is any thing that isn't clear enough let me know.
|
How do I fix this weird PHP/MySQL issue caused by if statement?
|
CC BY-SA 3.0
| null |
2011-04-13T18:42:24.033
|
2017-08-12T16:07:46.967
|
2017-08-12T16:07:46.967
| 4,370,109 | 195,582 |
[
"php",
"html",
"mysql",
"if-statement",
"html-table"
] |
5,654,358 | 1 | null | null | 4 | 2,472 |
Let's say I want to create a web and web socket-based chat service. And let's also say that I want multiple, discrete chat rooms.
I need this to scale, so, I'm thinking to use XMPP so that I can transparently use multiple servers. Is the architecture shown in the diagram what I would need?

And, would I even need NodeJS?
|
Architecture for XMPP-based chat service using web sockets
|
CC BY-SA 3.0
| 0 |
2011-04-13T19:15:32.107
|
2011-04-13T20:12:38.173
|
2011-04-13T19:49:59.610
| 83,897 | 83,897 |
[
"sockets",
"node.js",
"websocket"
] |
5,654,445 | 1 | 5,707,417 | null | 4 | 647 |
I had an existing site that was using the date.js library and it stopped working after I implemented a Extjs Border Layout ( [http://dev.sencha.com/deploy/dev/examples/layout-browser/layout-browser.html](http://dev.sencha.com/deploy/dev/examples/layout-browser/layout-browser.html) ) into my site.
So the line in question is this one:
```
var weeknum = (dates[y][m][d]).getWeek();
```
Firebug tells me that dates[y][m][d].getWeek is not a function.
Now from my understanding, Extjs extends the javascript date object which is the probable cause for this issue. I tried changing the line of code above to use the Extjs getWeekOfYear() but I still get the same error.
Any ideas on how I can keep my existing getWeek() code and still be able to use Extjs?
Thanks!
EDIT:
Did a
```
console.log((dates[y][m][d]));
```

Edit2:

|
Date.js getWeek() stopped working after implementing Extjs
|
CC BY-SA 3.0
| 0 |
2011-04-13T19:23:03.387
|
2011-04-18T18:47:26.497
|
2011-04-13T23:45:09.800
| 387,285 | 387,285 |
[
"javascript",
"date",
"extjs"
] |
5,654,600 | 1 | 5,654,649 | null | 1 | 721 |
i have the following function in jQuery and javascript that creates a form element:
```
createEmail: function(title){
var $emailForm = $('<form>',{action: 'sendEmail.php', id: 'emailForm'});
var $table = $('<table>');
$emailForm.append($table);
var $tr = $('<tr>');
$tr.append($('<td>',{text: 'Email From:'}));
$tr.append($('<td>',{html: '<input type="text" value="" name="from"/>'}));
$table.append($tr);
$tr = $('<tr>');
$tr.append($('<td>',{text: 'Email To:'}));
$tr.append($('<td>',{html: '<input type="text" value="" name="to"/>'}));
$table.append($tr);
$tr = $('<tr>');
$tr.append($('<td>',{text: 'Message Body:'}));
$tr.append($('<textArea>',{name: 'msg', cols: 50, rows: 10,
text: 'Attached is the ' +title+ ' license key file.\nPlease place the file in the same directory as the "check_license.php" file for ' +title+ ' '}));
$table.append($tr);
$tr.append('<input type="hidden" value="'+title+'" name="title"/>');
var $div = $('<div>').append($emailForm).dialog({
title: 'Email ' + title + ' File',
width: 600,
modal: true,
buttons: {
cancel: function(){
$(this).dialog('close');
},
send: function(){
$.post($emailForm.attr('action'), $emailForm.serialize(),function(data){
alert(data);
$div.dialog('close');
})
}
},
beforeClose: function(){
$(this).remove();
}
});
$div.dialog('widget').css('margin','0 auto');
}
```
For some reason in IE the text area is not showing up and the dialog looks like this when you click on it:
but in chrome and FF it looks normal:

why is this happening? the text area still gets submitted to my php as if it has something in it (and when i use dev tools in IE8 it says there is content in it)
So why in IE does it not display an editable textarea?
Thanks....
|
textarea not displaying IE but is getting submitted
|
CC BY-SA 3.0
| null |
2011-04-13T19:35:20.147
|
2011-04-13T19:39:06.777
| null | null | 561,731 |
[
"php",
"javascript",
"jquery",
"forms",
"textarea"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.