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,775,105 | 1 | 5,775,172 | null | 9 | 3,804 |
I'm trying to draw multiple triangle strips with only one call to `glDrawElements` and my research on the matter tells me I need to use degenerate triangles. Maybe my understanding on the subject is wrong but I thought this should allow me to "jump" from a strip to another.
My whole code for this can be found on [this recent question I posted](https://stackoverflow.com/questions/5773803/hard-time-understanding-indices-with-gldrawelements), take a look there if you think it's relevant.
I'm basically trying to draw 2 quads(for simplification purposes) with 4 triangles of course, but separated from each other. For that I use indices like this:
```
unsigned int indices[] = { 0, 256, 1, 257, 257, 2, 2, 258, 3, 259 };
```
The first vertex of the first strip starts at 0 and the first vertex of the second strip starts at 256. This is the end result of this indices:

Is this correct or am I right in thinking that line "connecting" the 2 quads shouldn't be there at all?
|
Problem with degenerate triangles and GL_TRIANGLE_STRIP
|
CC BY-SA 3.0
| 0 |
2011-04-25T04:13:41.527
|
2011-04-25T04:31:47.373
|
2017-05-23T12:02:05.063
| -1 | 40,480 |
[
"opengl",
"vertex-buffer",
"gl-triangle-strip"
] |
5,775,747 | 1 | 5,775,818 | null | 5 | 2,925 |
Not sure, but I think this may be a bug?
Here is my model:
```
class Property(models.Model):
Name = models.CharField(max_length=40)
Description = models.TextField(default="Description Not Available")
Address = models.CharField(max_length=60, default="Not Available")
Address2 = models.CharField(max_length=60,null=True)
City = models.CharField(max_length=60, null=True)
State = usa_model.USStateField(null=True)
Code = usa_model.USPostalCodeField(null=True)
Phone = usa_model.PhoneNumberField(null=True)
```

Am I missing something?
-Kerry
|
Postal Code model field shows up as State list in Admin
|
CC BY-SA 3.0
| 0 |
2011-04-25T06:11:40.403
|
2011-04-25T06:22:43.193
| null | null | 704,547 |
[
"django",
"postal-code",
"django-contrib"
] |
5,775,796 | 1 | 5,775,838 | null | 0 | 3,861 |

Hi ,
I am keep getting the same error again and again.
I hv icon.png in my resource folder,.
I tried delelting it and copying it again.
PLz guide me, how can i resolve this issue.
|
icon Specified in the info.plist error
|
CC BY-SA 3.0
| null |
2011-04-25T06:19:08.837
|
2011-04-25T06:25:54.893
| null | null | 1,497,488 |
[
"iphone"
] |
5,776,090 | 1 | null | null | 6 | 50,411 |
How can I create a pdf document with tables, which looks like this.

|
Create Pdf Documents using IText#
|
CC BY-SA 4.0
| 0 |
2011-04-25T07:06:08.940
|
2021-02-12T06:49:16.210
|
2018-10-05T14:10:36.443
| 4,420,967 | 455,773 |
[
"c#",
"itext"
] |
5,776,174 | 1 | null | null | 0 | 1,280 |
I have a combobox of customer and that customer can be in more than 1 categories so i used a listbox which contains check-boxes of all the categories...
On the selection change of the customer, the categories in which a particular customer is, should be checked and all the other categories should remain unchecked..
here is my .dbml file

Here is my xaml code of listbox...
```
<ListBox Height="113.88" Margin="399.342,125.543,424.66,0" Name="lst_category" VerticalAlignment="Top" SelectedValuePath="CategoryID">
<ListBox.ItemTemplate>
<HierarchicalDataTemplate>
<CheckBox Content="{Binding CategoryName}"/>
</HierarchicalDataTemplate></ListBox.ItemTemplate>
</ListBox>
```
I think i should use relative source in the binding in Ischecked property of checkbox...
But i dont know how to use it please help me out...
If there is some other solution to this than do let me know..
Thanks in advance...
|
Binding Ischecked of a checkbox in wpf listbox on selectionchanged of the combobox
|
CC BY-SA 3.0
| 0 |
2011-04-25T07:19:18.090
|
2011-04-25T09:10:27.053
|
2011-04-25T07:52:42.027
| 406,427 | 406,427 |
[
"c#",
"wpf",
"binding",
"checkbox"
] |
5,776,158 | 1 | null | null | 14 | 3,857 |
What is the most efficient or elegant method for matching brackets in a string such as:
```
"f @ g[h[[i[[j[2], k[[1, m[[1, n[2]]]]]]]]]] // z"
```
for the purpose of identifying and replacing `[[ Part ]]` brackets with the single character forms?
I want to get:

With everything else intact, such as the prefix `@` and postfix `//` forms intact
---
An explanation of Mathematica syntax for those unfamiliar:
Functions use single square brackets for arguments: `func[1, 2, 3]`
Part indexing is done with double square brackets: `list[[6]]` or with single-character Unicode double brackets: `list〚6〛`
My intent is to identify the matching `[[ ]]` form in a string of ASCII text, and replace it with the Unicode characters `〚 〛`
|
Matching brackets in a string
|
CC BY-SA 3.0
| 0 |
2011-04-25T07:17:36.097
|
2016-08-10T00:19:14.190
|
2011-04-25T20:46:49.670
| 618,728 | 618,728 |
[
"parsing",
"string",
"wolfram-mathematica"
] |
5,776,367 | 1 | 5,776,719 | null | 22 | 75,362 |
All,
I have a page which is suppose to take up only the available screen space in the browser.
I have a 'top bar' and a 'bottom bar', both of which are fixed positioned at the top and bottom of the page. I want to have a div which will consume (take up) the remaining of the space inbetween the two bars mentioned above.

Its crucial that the middle div is not overlapped by the top and bottom bars. Is this at all possible with CSS or do I need to make use of js.
Also, if I do go with js, considering the browser loads up the CSS first before the js code, how is the above work out using js for centre positioning?
Many thanks,
|
CSS - Making a div consume all available space
|
CC BY-SA 3.0
| 0 |
2011-04-25T07:50:32.510
|
2011-09-14T14:54:04.600
| null | null | 434,697 |
[
"css",
"html",
"css-position"
] |
5,776,499 | 1 | null | null | 0 | 648 |
I am trying to implement the Single-Sign-On (SSO) example given on [http://developers.facebook.com/docs/guides/mobile/#android](http://developers.facebook.com/docs/guides/mobile/#android). I have followed all the steps as mentioned in the example.
But when the application runs on the emulator a dialog box with facebook title only comes and then disappears.

I have tried to implement this [solution](http://myunixworld.blogspot.com/2010/11/android-facebook-sdk-issue-fix-for.html?showComment=1294381258058_AIe9_BGDXca377UlwHOlEr_p3SJo12zdJuK42VkyQyYl2Gqsfx9VfB3w5QY1uqNULDAG_frHqG1hhcgBM1zRquKKCw9_dUIT9Zi38PWDCUdDYqSExi6CNZlNfp4TS4132UXnfwoLaNZ7uF7Tw-kvVMMGzG0QWdZiqE484x-7MLu9lvTNgtRbyNfcPdnh8mEWl7COb_xARXlkG0JcrylLGxt0X2xG62H_8QEwdxmbWA0-Dy1UkB5dmArXYRACe2iIibXU6vy6p-1kR2NcSHRpb0UiPujnTI92m_0KKIEZmB6WeQ5zVrJy9FL8saBsFv_bFoZ8Aq2nM9QyhgqYBIwnjamjTsB85YyPgrw0gMNnaBf7bA_STnhZA0PVUziGp3ghwvamKBoiEnh6oCGlptQAXwLKK1IDQS44V6_ZWim7vtuDSXu5Qj-SOHNuWdU7ttqwAhlwWIPAYIIlrXjHX7fSnUHv98ZOjSVFne93h8lnHhwpTjLMB7Wc-SI#c5442685186348999639) but nothing seems to work.
Please help me on this
Thanks,
Pankaj Khurana
|
Strange Issue with Facebook Android Example
|
CC BY-SA 3.0
| null |
2011-04-25T08:11:18.780
|
2011-09-28T22:44:00.637
|
2011-04-25T09:11:13.580
| 146,192 | 146,192 |
[
"android",
"facebook"
] |
5,776,567 | 1 | 7,695,273 | null | 178 | 206,190 |
I'm having troubles with my meta tags with Open Graph. It seems as though Facebook is caching old values of my meta tags. Old values for Attributes `og:title` and `og:url` are still used, even though I have changed them already.
I ran Lint on [a page in my site](http://pinq.dk/tilbud/landsdaekkende/lissy/), and this appeared:

Notice that there are two values for `og:title` and `og:url`, and the last one prevailed. However, that I used for this site. I am now currently using these meta tags (you can verify if you view the source of the HTML):
```
<meta property="og:title" content="Smart og rummelig pusletaske fra Petit Amour med god plads til alt – værdi 1.099 kr – køb nu kun 599 kr "/>
<meta property="og:description" content="Pinq.dk - Det gode liv for det halve"/>
<meta property="og:type" content="product"/>
<meta property="og:url" content="http://pinq.dk/tilbud/landsdaekkende/lissy/"/>
<meta property="og:image" content="http://pinq.dk/wp-content/themes/pinq/images/logo-top.png"/>
<meta property="og:site_name" content="Pinq" />
<meta property="fb:app_id" content="161840830532004" />
```
Why is Facebook caching `og:title` and `og:url`? Is anyone experiencing the same issue?
|
Facebook Open Graph not clearing cache
|
CC BY-SA 3.0
| 0 |
2011-04-25T08:23:07.770
|
2022-12-23T01:48:20.167
|
2013-07-01T21:40:26.077
| 1,399,979 | 95,552 |
[
"facebook",
"facebook-opengraph"
] |
5,776,683 | 1 | 5,776,987 | null | 1 | 1,762 |
Here is a screenshot of my `JFrame`. This will be the main window to my application.

So the problem is that all the buttons are inline with each other, whereas I want them to be one under the other i.e. `Add Contact` under `Show Contacts`.
So how can I do that?
Here is my code for the `JFrame`.
```
public class CRUDFrame extends JFrame {
public CRUDFrame(){
super("AppCRUD");
setLayout(new FlowLayout());
JButton button1, button2, button3, button4;
button1 = new JButton(" Show Contacts ");
button2 = new JButton(" Add Contact ");
button3 = new JButton(" Update Number in a Contact ");
button4 = new JButton(" Delete a Contact ");
add(button1);
add(button2);
add(button3);
add(button4);
}
}
`
```
|
Problem with the layouts in making a JAVA GUI
|
CC BY-SA 3.0
| null |
2011-04-25T08:38:41.570
|
2011-04-25T10:23:56.200
|
2011-04-25T10:23:56.200
| 418,556 | 690,851 |
[
"java",
"swing",
"user-interface"
] |
5,776,680 | 1 | null | null | 3 | 2,352 |
Is there a way I can set my scrollview not to clip its contents? (Which is a `NSTextView`)
I have a subclass of NSScrollView and want its content to be clipped to its bounds.
I have tried overriding:
```
- (BOOL) wantsDefaultClipping{
return NO;
}
```
in `MyScrollView` and in `MytextView` without any effect.
In the iOS I would simply would do: `myuitextView.clipsToBounds=NO;` how can I do this in Cocoa?
This is an example of what I want to achieve but in the mac
The scrollview is white, the scroller will never go outside its bounds but the text does since I did `myuitextView.clipsToBounds=NO`
[See picture here](https://i.stack.imgur.com/rwp8n.png)
I wouldn't mind clip my view like @Josh suggested. But the real behaviour I would like to have can be explained with this picture:

Do you see the word *****EDIT***** that has being cut in the very first line?
I want the text not to be cut this way, rather I want it to completely appear and I will put a semitransparent image so it looks like it fades off when it's outside the frame.
Q: Why don't I simply put a semitransparent NSImageView on it so it looks like what I want?
A: Because 1.Scroller will be faded as well. Even if I correctly place the semitransparent NSImageView so the scroller looks fine, the cursor/caret will be able to go underneath the semitransparent NSImageView again it does not look good.
I would like to be able to control the area is clipped by NSClipView. I think that would solve my problem. Is there any alternative I have? maybe I can control the caret position or scrolling position through NSTextView so caret will never go near the top/bottom frame limits? or any work-around?
Any advice is appreciated.
|
NSScrollView with unclipped content view?
|
CC BY-SA 3.0
| 0 |
2011-04-25T08:37:39.623
|
2016-04-05T19:56:37.837
|
2011-04-29T07:57:08.387
| 149,008 | 149,008 |
[
"iphone",
"objective-c",
"cocoa",
"macos"
] |
5,776,697 | 1 | 5,777,888 | null | 0 | 1,222 |
I'm using andengine to create a physic simulation via box2d.
The bodies are created through PhysicsFactory using Sprites.
My idea is to procedurally position these sprites, following this pattern:
basically one central sprites which represent my world coordinates center, and a series of cloned sprites that are created by rotating the base sprite around myWorld center (the "X" inside the circle).
I've tried to use opengl way inside andengine (translate, rotate, back-translate)
```
super(stamiRadious, 0, image); //stamiDoadious is te distance from radix (world center) and "petal" attach point
this.setRotationCenter(0, 0);
this.setRotation((float) Math.toDegrees(angleRad));
this.setPosition(this.getX()+radixX, this.getY()+radixY);
```
but i failed: results are not right (wrong final position, and wrong box2d body property as if the sprite is much larger than the image)
I belive part of the problem relies on my interpretation on `setRotation` and `setRotationCenter`, and in general on my understanding of andengine coordinates system + box2d cordinates system.
Any thoughts/links to doc/explanation?
|
Coordinate system and sprite transformation
|
CC BY-SA 3.0
| null |
2011-04-25T08:42:00.030
|
2011-12-07T15:45:50.747
|
2011-04-25T11:38:15.277
| 21,234 | 330,927 |
[
"graphics",
"box2d",
"coordinate-systems",
"andengine"
] |
5,776,749 | 1 | null | null | 0 | 551 |
I have an image below but it's not transparent background, actually the background color is white. How to make it a transparent background? Thanks!

|
how to create transparent background image from existing image?
|
CC BY-SA 3.0
| null |
2011-04-25T08:50:22.390
|
2011-04-25T09:33:04.713
| null | null | 404,264 |
[
"css",
"image"
] |
5,777,047 | 1 | 5,777,256 | null | 0 | 51 |
I have 3 tables in my mysql DB to query.

- (fields: id,userid,raterid,rate,eventid) containing all of the rates(rate) that have been assigned to users(userid), participating to specific events(eventid), by other users(raterid)- (fields:id,userid,eventid) containing all of the users(userid) participating to each event(eventid)- (fields:id,name,lastname)containing all the user relative data
I need to query those three tables to retrieve an event-specific rank for the users' rates.
Ex. John,Erik and Mark participated to 'eventid=31'.
John received 1 rate from Mark, and 2 from Erik.
Mark received 1 rate from Erik.
Nobody has rated Erik though.
I need to retrieve for each user name,lastname and the sum of the rates received for eventid=31
I tried with this:
```
SELECT events_participants.userid,users.name,users.lastname,
(SELECT SUM(rate)FROM users_rates WHERE users_rates.eventid=31 AND users_rates.userid=events_participants.userid)AS rate
FROM(( events_participants INNER JOIN users ON events_participants.userid=users.id)
LEFT OUTER JOIN users_rates ON events_participants.userid=users_rates.userid )
WHERE events_participants.eventid=31
```
But I receive:
```
userid | name | lastname | rate
1 | luca | silvestro | 1
3 | claudio | buricchi | 6
3 | claudio | buricchi | 6
```
What's the right query?
Thanks
Luca
|
Mysql queries issue
|
CC BY-SA 3.0
| null |
2011-04-25T09:33:34.303
|
2011-04-27T14:38:23.850
| null | null | 505,762 |
[
"mysql",
"sum"
] |
5,777,103 | 1 | 5,781,325 | null | 1 | 232 |
I'm trying to create my own language service in Visual Studio 2008 SP1, but when I run the program (which starts the Visual Studio Experimental Hive) and try to open a source file, I get this error:

Any ideas how to fix it? (I already tried uninstalling and reinstalling VS, it didn't work. :( )
---
# Update
It turns out this was due to a poor uninstallation of Spec#. I cleaned it up, but now the issue is that my language service doesn't actually highlight anything... I imagined this to be the cause, but seeing as how I still get the error and how it was irrelevant, I don't know what the problem is.
I'm using the default lexer/parser files with the default tokens, so I'd imagine there would be sort of highlighting for my file types, but there isn't... any thoughts?

|
Visual Studio 2008: Why Doesn't my Language Service Add-In Work? ("Sorry, parsing could not recover")
|
CC BY-SA 3.0
| null |
2011-04-25T09:42:13.600
|
2011-04-25T17:53:19.957
|
2020-06-20T09:12:55.060
| -1 | 541,686 |
[
"visual-studio-2008",
"visual-studio-2008-sp1",
"languageservice"
] |
5,777,274 | 1 | 5,777,378 | null | 0 | 462 |
[Here is the demo](http://jsfiddle.net/salman/rx3NU/), and here is the sprite:

I want to use the arrow in a markup, like this:
```
<div class="tooltip">
The tooltip
<span class="arrow"></span>
</div>
```
Setting:
```
background-image: url(foobar.gif);
background-position: 0 -40px;
background-repeat: none;
```
does not seem to work (as expected). Any workaround?
|
Using background-position with background-repeat for a CSS sprite
|
CC BY-SA 3.0
| null |
2011-04-25T10:04:11.317
|
2011-04-25T12:40:22.057
|
2011-04-25T10:14:14.060
| 87,015 | 87,015 |
[
"css",
"css-sprites",
"sprite"
] |
5,777,408 | 1 | 5,789,404 | null | 0 | 455 |
I have added to my document appendices like that
```
\renewcommand{\appendixpagename}{Załączniki}
\renewcommand{\appendixtocname}{Załączniki}
\appendix
\clearpage
\addappheadtotoc
%\addcontentsline{toc}{chapter}{Załączniki}
\appendixpage
\input{app1//app1.tex}
```
and it works with one exception. In table of contents it occurs twice:

How to remove the second one?
|
problem with appendices and toc
|
CC BY-SA 3.0
| null |
2011-04-25T10:19:54.287
|
2011-04-26T11:08:26.013
| null | null | 453,396 |
[
"pdflatex"
] |
5,777,576 | 1 | 5,779,698 | null | 31 | 30,001 |
Is there a function for drawing a caption box underneath a figure/graph using matplotlib? I have searched google and haven't found any such function.

something like what is shown in the image would be great.
|
Is there a way of drawing a caption box in matplotlib
|
CC BY-SA 3.0
| 0 |
2011-04-25T10:43:41.613
|
2019-04-14T17:39:09.133
|
2016-07-26T09:16:37.760
| 2,666,859 | 299,000 |
[
"python",
"matplotlib"
] |
5,777,709 | 1 | 5,777,839 | null | 0 | 184 |
In my application
1. When app. launch it's display loading screen.
2. After loading screen have another screen that contain 4 button.
3. If I select any button that after next screen (3 screen contain tabbar controller).
So now I want to pop (or back to second) screen, but due to the tabbar controller on 3rd screen I can't go to back on second screen that the problem I faced now.
When I select communicator it goes to AMG home. Now I want to back to communicator.


|
iPhone tabbar navigation goes to the wrong screen
|
CC BY-SA 4.0
| null |
2011-04-25T11:00:34.907
|
2018-05-24T21:13:58.083
|
2018-05-21T17:30:03.183
| 472,495 | 670,669 |
[
"iphone"
] |
5,777,749 | 1 | 5,777,808 | null | 25 | 87,745 |
I am placing an application bar on the top of the screen and it looks as the following figure:

Now i want to set a text over the image, so that the image looks as follows:

How to set a text over an image? Thanks in advance
|
how to set a text over an imageView?
|
CC BY-SA 3.0
| 0 |
2011-04-25T11:09:14.107
|
2017-01-15T15:03:34.023
|
2015-09-10T15:16:11.280
| 5,260,679 | 596,364 |
[
"android",
"android-layout",
"android-imageview",
"textview"
] |
5,777,917 | 1 | 5,808,564 | null | 13 | 3,103 |
I'd like the shadow applied correctly after rotation. This is my code:
```
myButton.transform = CGAffineTransformMakeRotation(M_PI / 180.0 * 90.0);
myButton.layer.shadowOffset = CGSizeMake(12.0, 12.0);
myButton.layer.shadowRadius = 2.0;
myButton.layer.shadowOpacity = 0.8;
myButton.layer.shadowColor = [UIColor blackColor].CGColor;
```
Without rotation the shadow looks fine:

But after rorating it by 90° the shadow is rotated as well:

Is there anything I can do about it without overriding the drawRect method and do low level drawing? Or maybe some method which corrects the shadowOffset with a given rotation angle? It's easy to correct the offset by hand for 90° so this is no option ;)
It should look like this:

Thanks in advance!
```
float angleInRadians = M_PI / 180.0 * -35.0;
myButton.transform = CGAffineTransformMakeRotation(angleInRadians);
myButton.layer.shadowOffset = [self correctedShadowOffsetForRotatedViewWithAngle:(angleInRadians)
andInitialShadowOffset:CGSizeMake(12.0, 12.0)];
myButton.layer.shadowRadius = 2.0;
myButton.layer.shadowOpacity = 0.8;
myButton.layer.shadowColor = [UIColor blackColor].CGColor;
```
This results in:

instead of

|
How can I draw a rotated UIView with a shadow but without the shadow being rotated as well
|
CC BY-SA 3.0
| 0 |
2011-04-25T11:32:55.797
|
2012-12-04T20:43:49.883
|
2011-04-27T18:35:41.090
| 296,387 | 296,387 |
[
"iphone",
"objective-c",
"ios",
"uiview",
"shadow"
] |
5,778,042 | 1 | 5,778,106 | null | 1 | 824 |
I am looking at the Prism Stocktrader RI and I can see that the InTransition Storyboard is played using code. I tried the following xaml:
But it gives the following error on InitializeComponent (i.e. a XamlParseException):

any idea why?
|
Begin a storyboard on loaded event in silverlight
|
CC BY-SA 3.0
| null |
2011-04-25T11:51:16.623
|
2011-04-25T13:36:03.467
| null | null | 390,330 |
[
"silverlight",
"prism"
] |
5,778,298 | 1 | 5,779,914 | null | 2 | 1,341 |
I am new to android and try to construct this layout using TableLayout.
I am not able to set columns for the second row to be column span = 2.

|
Android Complex Table Layout
|
CC BY-SA 3.0
| null |
2011-04-25T12:26:08.067
|
2016-11-15T20:35:51.747
|
2016-11-15T20:35:51.747
| 4,370,109 | 155,196 |
[
"android",
"android-layout",
"android-tablelayout"
] |
5,778,436 | 1 | 5,785,477 | null | 45 | 2,430 |
It has been quite some time now that RWH came out (). I was eager to get my copy after following the incremental writing of the book online (which is, I think, one of the best ways to write a book.) What a rewarding read in the midst of all the rather academic papers a haskell student usually encounters!
It was a sturdy companion on quite some trips and I refer back to it regularly.
Still, my copy started to look and even though most of the content is still valid, there has been an abundance of new topics in the haskell world that would be worth covering in a similar fashion.

Considering the impact RWH had (and still has,) I sincerely hope that there will be a sequel some day :)
Some of the topics for a sequel that would immediately come to my mind:
- - - - - - - -
What are the topics that the haskell community needs a RWH-style explanation for?
---
- - -
- - - - - - -
- - - - - - -
- - - - - - - - - - - -
|
What haskell topics need to be addressed in a Real-World-Haskell style?
|
CC BY-SA 3.0
| 0 |
2011-04-25T12:44:35.127
|
2011-05-05T12:17:21.237
|
2011-04-26T07:35:37.073
| 139,990 | 139,990 |
[
"haskell"
] |
5,778,465 | 1 | 6,095,317 | null | -1 | 8,827 |
How do I print the contents of a panel in vb.net, VS-2010 Winform.
I tried the code provided [here](http://www.vbforums.com/showthread.php?t=559556) but for some reason its not working.
I am trying to print the Form inside the panel

|
How to print the Contents of a Panel
|
CC BY-SA 3.0
| 0 |
2011-04-25T12:47:50.680
|
2020-03-02T16:16:03.623
| null | null | 722,000 |
[
"vb.net",
"winforms",
"printing"
] |
5,778,558 | 1 | 5,781,628 | null | 2 | 11,473 |
I run into problem with login screen in netbeans rcp.
server side : glassfish v 3.1 , ejb and HessianServlet with basic auth in web.xml
client side : netebeans rcp 7.0 and server side Api.
on the server used custom realm and client provides UserName and Password after splash screen, in custom login panel runing on top of DialogDescriptor
login panel code:
```
public class Installer extends ModuleInstall {
...
@Override
public void restored() {
DialogDescriptor loginDialog = new DialogDescriptor(panel, "Login Dialog");
loginDialog.setModal(true);
loginDialog.setClosingOptions(new Object[]{});
loginDialog.setOptions(new Object[]{});
loginDialog.setButtonListener(al);
loginDialog.addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
if (NotifyDescriptor.CLOSED_OPTION.equals(evt.getNewValue())) {
LifecycleManager.getDefault().exit();
}
}
});
DialogDisplayer.getDefault().notifyLater(loginDialog);
...
}
```
this login panel simply invokes one secured method on server side and if exception do not happend and
returned String[] contains user Name and Surname, then login screen disposes and rcp shown to client.
in login panel :
```
HessianProxyFactory proxy= new HessianProxyFactory();
proxy.setUser(user);
proxy.setPassword(password);
LoginObject loginObject = xxx.create(LoginObject .class, "<a href="http://localhost:port/trali/vali">http://localhost:port/trali/vali");
String[] value=loginObject .isAppUser("login name");
if(value==null){
//message login failed
}else {
//dispose login screen and show main app
}
```
everything is OK till client provides correct user name and password, but if login faild on
server Netbeans RCP pop ups Authentication Requires Dialog like in web browser
basic auth dialog.

thanks in advance!
|
Authentication Required Dialog
|
CC BY-SA 3.0
| null |
2011-04-25T13:00:02.027
|
2016-12-31T20:40:27.643
|
2014-07-27T10:07:14.303
| 568,635 | 427,679 |
[
"netbeans",
"rcp"
] |
5,778,628 | 1 | null | null | 4 | 3,352 |
I have the following question:
Using only binary relationships, construct an entity relationship diagram for the following description. Include entity labels, primary key fields, relationship labels, and the multiplicities on relationships.
"A company runs several car repair and service garages, each having its own unique number (gargNo). When a car owner contacts a garage, their details are recorded and they are assigned an ownerNo. Their car is also registered with that garage and is assigned a reference number (carNo). An owner may own one or more cars, but a car can only be registered with one garage. When a car is booked into a garage, a service plan is drawn up for it. The service plan may be unique for a particular car (eg, cure squeaking windscreen wipers) or it may be one used for many cars (eg, a standard 60000 mile service). Any service plan can consist of one or more operations (change the oil, dismantle the wiper motor, etc). Each type of operation on a service plan has a unique number (operationNo).
This is my answer:

For all Database veterans, does this look ok to you?
Also any other comments feedback would be appreciated...
NOT HOMEWORK
EDIT - Why do people keep editing posts but making no changes?
|
ER Modelling Question
|
CC BY-SA 3.0
| 0 |
2011-04-25T13:07:54.857
|
2011-04-27T11:18:23.607
|
2011-04-25T22:51:51.447
| 559,142 | 559,142 |
[
"database-design",
"entity-relationship",
"conceptual-model"
] |
5,778,719 | 1 | 5,778,733 | null | 4 | 6,649 |
I've read that a HashSet in .net4 will ignore all the duplicates. So what I do is:
```
HashSet<medbaseid> medbaseidlist = new HashSet<medbaseid>();
for (int i = 2; i <= rowCount; i++)
{
medbaseid medbaseid = new medbaseid() {
mainClass = xlRange.Cells[i, 1].Value2.ToString(),
genName = xlRange.Cells[i, 2].Value2.ToString(),
speciality = xlRange.Cells[i, 3].Value2.ToString(),
med_type_id = getId(xlRange.Cells[i, 4].Value2.ToString(),
id = i-1
)
};
medbaseidlist.Add(medbaseid);
}
```
`medbaseid` can have the same values as the previous object.
But if I check the hashset later in the end, there are duplicate items. 
the equals and gethashcode method i added but didn't help. I also added an id to the class. So 2 objects can have the same content but different id :
```
public override bool Equals(object obj)
{
medbaseid medb = (medbaseid)obj;
return ((medb.id == this.id) && (medb.genName == this.genName) && (medb.mainClass == this.mainClass) && (medb.med_type_id == this.med_type_id) && (medb.speciality == this.speciality)) ? true : false;
}
public override int GetHashCode()
{
return id;
}
```
So my question now is: What am I doing wrong, or is this not the right way to use a `HashSet`? Thanks in advance for any help.
|
HashSet (.NET4) isn't ignoring duplicates in c#
|
CC BY-SA 3.0
| null |
2011-04-25T13:18:46.633
|
2011-04-25T13:49:45.130
|
2011-04-25T13:49:45.130
| 329,829 | 329,829 |
[
"c#",
".net-4.0",
"duplicates",
"hashset"
] |
5,778,832 | 1 | null | null | 1 | 196 |
I have a centered container layout with a right fixed nav div. To make the fixed nav stay in place when viewport resizes it's set up in some nested divs. Problem is the nav div ends up infront of the content. I can change the z-index order but I want both content and nav to be accesible as in being able to "mark" text for example. Any ideas on this? Below is link to code and and an image showing the layout structure
[http://jsbin.com/aliru5/3/edit](http://jsbin.com/aliru5/3/edit)

|
Centered content with right fixed nav causes z-index problem
|
CC BY-SA 3.0
| null |
2011-04-25T13:33:52.827
|
2011-04-25T13:42:00.310
|
2011-04-25T13:41:20.123
| 185,076 | 185,076 |
[
"css",
"z-index",
"center",
"fixed"
] |
5,779,197 | 1 | null | null | 0 | 256 |
How to find the lowest superordinate of two concepts in an efficient way?
The lowest superordinate of two concepts in a taxonomy means the most specific common ancestor of the two concepts. For example, in the following picture of a taxonomy, how find the most common ancestor of sense 1 and sense 2?

BTW, I found this question in Roberto Navigli's survey of word sense disambiguation. He didn't mention how to compute the superordinate.
|
lowest superordinate of two concepts in a taxonomy
|
CC BY-SA 3.0
| null |
2011-04-25T14:11:14.453
|
2011-04-25T18:18:58.757
| null | null | 636,467 |
[
"algorithm",
"taxonomy"
] |
5,779,290 | 1 | 5,809,492 | null | 16 | 1,199 |
Still working on my planner/calendar application. I'm nearly done, I got some of the harder parts working but I'm stuck at one more difficult part. I want to show my events in a grid according to their start time.
It doesn't show in this picture, but pretend there's a column with hours (8am - 11pm or so) at the left of the 25th. If an event starts at.. say, 1pm, I would like it to show somewhere in the middle of the page. If an event starts at 8:30 am, it should show between 8am and 9am.

I guess I do this with tables, but I was wondering if there's another way. Is this doable with plain html/css, perhaps some Javascript? Any suggestions on what the best way would be to achieve this? If I use a table, I'm still not sure what would be the best way to do this. A cell for every thirty minutes? I have access to the start and end time of each event from my view. An event array (in this example, the 25th) looks like this:
```
Array
[1] => Array
(
[title] => Ethiek
[description] => Ethiek: Opdracht 1
[time_start] => 11:30:00
[time_end] => 12:00:00
)
[2] => Array
(
[title] => Project Management
[description] => Test: Project Management
[time_start] => 15:00:00
[time_end] => 16:00:00
)
[event_count] => 2
```
I appreciate any advice you can give me. Thanks a lot!
EDIT: Started a bounty on this because I'm still stuck and I would appreciate some feedback.
I've been breaking my head over this and I honestly can't figure out the best way to do this. First of all, I think the reason I'm stuck is the way I read out my events from the db/array. This is the code I have to display the events as seen in my screenshot, don't mind my complex arrays:
```
foreach($details[0] as $key => $detail)
{
echo "<div class='grid'>";
$header = "<p class='detail_header'>";
$header .= ucfirst($dates[0][$key]['name']) . ", " . $key . " " . $init['curr_month_name'];
$header .= "<img src='" . base_url() . "assets/images/create_event.png' alt='Plan iets'></p>";
echo $header;
for($i = 1; $i <= $details[0][$key]['event_count']; $i++)
{
echo "<div class='event " . $details[0][$key][$i]['type'] . "'>";
echo "<p class='event_title'>" . $details[0][$key][$i]['title'] . "</p>";
echo $details[0][$key][$i]['description'];
echo "</div>";
}
echo "</div>";
}
```
It's a bit of a mess, not to mention that I have the same code another time to fix some exceptions. But more importantly.. I feel like those loops don't allow me to make a lot of modifications to it. I tried adding two divs for AM and PM so I could split up the events in before-noon and afternoon blocks, and then just display the time on the event (to avoid having to work with a thousand blocks of 15 minutes). But yeah.. That didn't work out since it would put a couple of 'PM' divs if there is more than one event in the afternoon.
I'm tempted to just leave it like it is for now and just display the start/end time in the event divs.. until I figure out a better way to read them from the array and display them.
Any help/suggestions appreciated. Thanks.
|
Formatting events according to start time
|
CC BY-SA 3.0
| 0 |
2011-04-25T14:22:56.407
|
2011-05-03T13:12:33.140
|
2011-05-03T13:12:33.140
| 613,721 | 613,721 |
[
"php",
"jquery",
"html",
"css",
"calendar"
] |
5,779,431 | 1 | null | null | 1 | 188 |
First of all, is there an "official" name for menu items like Edit and Zoom in the Chrome browser?

Is there an existing Swing implementation?
On the surface it could be another "I can do it in a weekend" thing, but getting the button to look good for all LAFs would be difficult as always, since the default button is obviuosly too "boxy" for these "inline" buttons (and the "spinner lite" for Zoom). And getting text/accelerator alignment correct could be next to impossible.
|
Is there a Java/Swing implementation of "compound menu item" as in Chrome?
|
CC BY-SA 3.0
| 0 |
2011-04-25T14:36:39.600
|
2011-11-12T16:53:50.030
|
2011-04-25T19:01:43.027
| 513,838 | 62,479 |
[
"java",
"swing",
"button",
"menu"
] |
5,779,598 | 1 | 5,779,674 | null | 2 | 228 |
Good day
I am trying to query the names of employees who work on every project.
My code is as follows:
```
SELECT CONCAT (fname,' ', minit,'. ' , lname) AS NAME
FROM employee a, works_on b, project c
WHERE pno IN (Select pnumber //WHAT COULD I SUBSTITUTE W/ IN
FROM projet)
AND a.ssn = b.essn
AND b.pno = c.pnumber
```
The problem with IN is that it is that the values inside are like evaluated as 'OR'... what is the equivalent of IN that makes the value of my subquery evaluated like 'AND'
Thank you in advance.
EDIT:
As reqeusted..

|
MYSQL IN substitute
|
CC BY-SA 3.0
| 0 |
2011-04-25T14:52:48.860
|
2011-04-25T15:46:22.867
|
2011-04-25T15:03:52.987
| 525,965 | 525,965 |
[
"mysql"
] |
5,779,593 | 1 | null | null | 5 | 6,360 |
I've reached another impasse I can't seem to resolve on my own. I really hope someone can help me out.
I've been trying to create a nice little bloom effect using GLSL, which worked quite well. When I tried including something moving into my scene I noticed that I forgot to clear my FBOs before rendering into them.
Without clearing it worked for never changing scenes because I was always using the same texture. With the glClear(); command it still works, but for the very first frame only, all I get after that is a black screen. So I guess my issue is that I can't get my FBOs to continuously be updated every frame.
I feel like I'm either missing something very obvious or doing something horribly wrong.
I'd be thankful for any suggestions you might have.
Here's what I get for the first frame:

(using openFrameworks)
setup:
```
void testApp::setup(){
ofSetVerticalSync(true);
ofDisableSetupScreen();
width = ofGetWidth();
height = ofGetHeight();
//complie/link/generate ShaderObjects ....
horizontalBlurFrag.load("/opt/openframeworks/apps/examples/FBO_basic_shader_new_continued_v4_2/bin/data/fragment_shader_horizontal.glsl", GL_FRAGMENT_SHADER);
verticalBlurFrag.load("/opt/openframeworks/apps/examples/FBO_basic_shader_new_continued_v4_2/bin/data/fragment_shader_vertical.glsl", GL_FRAGMENT_SHADER);
BlurVertex.load("/opt/openframeworks/apps/examples/FBO_basic_shader_new_continued_v4_2/bin/data/horizontal_blur.glsl", GL_VERTEX_SHADER);
blendTextures.load("/opt/openframeworks/apps/examples/FBO_basic_shader_new_continued_v4_2/bin/data/blend_shader.glsl", GL_FRAGMENT_SHADER);
fboOriginal.initialize(width, height);
fboH800.initialize(width, height);
fboV800.initialize(width, height);
fboH400.initialize(width, height);
fboV400.initialize(width, height);}
```
draw:
```
void testApp::draw(){
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
//set orthographic projection
glOrtho( -1, 1, -1, 1, 1.0, 40.0 );
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
glViewport( 0, 0, width, height);
glDisable(GL_TEXTURE_2D);
fboOriginal.bind();
glClearColor(0.0, 0.0, 0.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushAttrib(GL_VIEWPORT_BIT);
glViewport(0, 0, width, height);
glPushMatrix();
glScalef(0.1f, 0.1f, 1.0f);
//generating values between 0 and 2
float x = 2 * (sin(time)+1.000001)/2;
//drawSOlidRect(xPos, yPos, width, height, red, green, blue);
drawSolidRect(-8.0f, 8.0f, x, x, 0.4f, 0.4f, 1.0f);
drawSolidRect(-5.0f, 8.0f, x, x, 0.4f, 1.0f, 0.4f);
drawSolidRect(-2.0f, 8.0f, x, x, 0.4f, 1.0f, 1.0f);
drawSolidRect( 1.0f, 8.0f, x, x, 1.0f, 0.4f, 0.4f);
drawSolidRect( 4.0f, 8.0f, x, x, 1.0f, 0.4f, 1.0f);
drawSolidRect( 7.0f, 8.0f, x, x, 1.0f, 1.0f, 0.4f);
glPopMatrix();
glPopAttrib();
fboOriginal.unbind();
glEnable(GL_TEXTURE_2D);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, fboOriginal.fboTexture);
BlurVertex.enable();
horizontalBlurFrag.enable();
glUniform1i(glGetUniformLocation(horizontalBlurFrag.program, "RTScene"), 0);
glDisable(GL_TEXTURE_2D);
fboH800.bind();
glClearColor(0.0, 0.0, 0.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushAttrib(GL_VIEWPORT_BIT);
glViewport(0, 0, width, height);
glPushMatrix();
glBegin(GL_QUADS);
glColor3f(1.0f, 1.0f, 1.0f);
glTexCoord2f(0.0f, 1.0f);
glVertex3f(-1.0, 1.0, -1.0);
glTexCoord2f(1.0f, 1.0f);
glVertex3f(1.0, 1.0, -1.0);
glTexCoord2f(1.0f, 0.0f);
glVertex3f(1.0, -1.0, -1.0);
glTexCoord2f(0.0f, 0.0f);
glVertex3f(-1.0, -1.0, -1.0);
glEnd();
glPopMatrix();
glPopAttrib();
glDisable(GL_TEXTURE_2D);
fboH800.unbind();
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, fboH800.fboTexture);
BlurVertex.enable();
verticalBlurFrag.enable();
glUniform1i(glGetUniformLocation(verticalBlurFrag.program, "RTBlurH"), 0);
glDisable(GL_TEXTURE_2D);
fboV800.bind();
glClearColor(0.0, 0.0, 0.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushAttrib(GL_VIEWPORT_BIT);
glViewport(0, 0, width, height);
glPushMatrix();
glBegin(GL_QUADS);
glColor3f(1.0f, 1.0f, 1.0f);
glTexCoord2f(0.0f, 1.0f);
glVertex3f(-1.0, 1.0, -1.0);
glTexCoord2f(1.0f, 1.0f);
glVertex3f(1.0, 1.0, -1.0);
glTexCoord2f(1.0f, 0.0f);
glVertex3f(1.0, -1.0, -1.0);
glTexCoord2f(0.0f, 0.0f);
glVertex3f(-1.0, -1.0, -1.0);
glEnd();
glPopMatrix();
glPopAttrib();
fboV800.unbind();
glEnable(GL_TEXTURE_2D);
glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_2D, fboV800.fboTexture);
BlurVertex.enable();
horizontalBlurFrag.enable();
glUniform1i(glGetUniformLocation(horizontalBlurFrag.program, "RTScene"), 1);
glDisable(GL_TEXTURE_2D);
fboH400.bind();
glClearColor(0.0, 0.0, 0.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushAttrib(GL_VIEWPORT_BIT);
glPushMatrix();
glViewport(0, 0, width/4, height/4); //crude downscale
glBegin(GL_QUADS);
glColor3f(1.0f, 1.0f, 1.0f);
glTexCoord2f(0.0f, 1.0f);
glVertex3f(-1.0, 1.0, -1.0);
glTexCoord2f(1.0f, 1.0f);
glVertex3f(1.0, 1.0, -1.0);
glTexCoord2f(1.0f, 0.0f);
glVertex3f(1.0, -1.0, -1.0);
glTexCoord2f(0.0f, 0.0f);
glVertex3f(-1.0, -1.0, -1.0);
glEnd();
glPopMatrix();
glPopAttrib();
glDisable(GL_TEXTURE_2D);
fboH400.unbind();
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, fboH400.fboTexture);
BlurVertex.enable();
verticalBlurFrag.enable();
glUniform1i(glGetUniformLocation(verticalBlurFrag.program, "RTBlurH"), 1);
glDisable(GL_TEXTURE_2D);
fboV400.bind();
glClearColor(0.0, 0.0, 0.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushAttrib(GL_VIEWPORT_BIT);
glPushMatrix();
glViewport(0, 0, width*4, height*4); //crude downscale
glBegin(GL_QUADS);
glColor3f(1.0f, 1.0f, 1.0f);
glTexCoord2f(0.0f, 1.0f);
glVertex3f(-1.0, 1.0, -1.0);
glTexCoord2f(1.0f, 1.0f);
glVertex3f(1.0, 1.0, -1.0);
glTexCoord2f(1.0f, 0.0f);
glVertex3f(1.0, -1.0, -1.0);
glTexCoord2f(0.0f, 0.0f);
glVertex3f(-1.0, -1.0, -1.0);
glEnd();
glPopMatrix();
glPopAttrib();
glDisable(GL_TEXTURE_2D);
fboV400.unbind();
glBindTexture(GL_TEXTURE_2D, 0);
glEnable(GL_TEXTURE_2D);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, fboV800.fboTexture);
glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_2D, fboV400.fboTexture);
BlurVertex.enable();
blendTextures.enable();
glUniform1i(glGetUniformLocation(blendTextures.program, "originalSizeTex"), 0);
glUniform1i(glGetUniformLocation(blendTextures.program, "downscaledTex"), 1);
glDisable(GL_TEXTURE_2D);
glBegin(GL_QUADS);
glColor3f(1.0f, 1.0f, 1.0f);
glMultiTexCoord2fARB(GL_TEXTURE0, 0.0f, 1.0f);
glVertex3f(-1.0, 1.0, -1.0);
glMultiTexCoord2fARB(GL_TEXTURE0, 1.0f, 1.0f);
glVertex3f(1.0, 1.0, -1.0);
glMultiTexCoord2fARB(GL_TEXTURE0, 1.0f, 0.0f);
glVertex3f(1.0, -1.0, -1.0);
glMultiTexCoord2fARB(GL_TEXTURE0, 0.0f, 0.0f);
glVertex3f(-1.0, -1.0, -1.0);
glEnd();
glDisable(GL_TEXTURE_2D);}
```
FBO:
```
class FrameBufferObject{
public:
//handles
GLuint fbo, fboTexture, fboDepthbuffer;
public:
void initialize(GLuint width, GLuint height){
// generate namespace for the frame buffer, colorbuffer and depthbuffer
glGenFramebuffersEXT(1, &fbo);
glGenTextures(1, &fboTexture);
glGenRenderbuffersEXT(1, &fboDepthbuffer);
//switch to our fbo so we can bind stuff to it
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo);
//create the colorbuffer texture and attach it to the frame buffer
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, fboTexture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glGenerateMipmapEXT(GL_TEXTURE_2D);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, fboTexture, 0);
// create a render buffer as our depthbuffer and attach it
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, fboDepthbuffer);
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT24,width, height);
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, fboDepthbuffer);
// Go back to regular frame buffer rendering
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glDisable(GL_TEXTURE_2D);
}
void bind(){
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo);
}
void unbind(){
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
}
void clear(){
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
}};
```
The alpha value one the glClearColor at least seems to be part of my issue.
I tried messing around with it and what i got is this:
(with up- and downscaling quads as you'd expect)

Somehow i seem to be losing all color somewhere along the way.
Oddly enough i got the best result having (0, 0, 0, 0) for 4 of my FBOs and (0, 0, 0, 1) for one of them. Setting (0, 0, 0, 0) for all FBOs just yields a greyish picture (which i assume is the default window without anything in it).
Here's my "blending-together-shader":
```
uniform sampler2D originalSizeTex;
uniform sampler2D downscaledTex;
varying vec2 vTexCoord;
void main(void){
vec4 colorOriginal = vec4(0.0, 0.0, 0.0, 0.0);
vec4 colorDownscale = vec4(0.0, 0.0, 0.0, 0.0);
colorOriginal = texture2D(originalSizeTex, vTexCoord.xy);
colorDownscale = texture2D(downscaledTex, vTexCoord.xy);
gl_FragColor = vec4(colorOriginal + colorDownscale);
}
```
Any guesses?
|
openGL / GLSL: bloom/blur, rendering to FBO
|
CC BY-SA 3.0
| 0 |
2011-04-25T14:52:35.147
|
2011-04-25T18:02:28.247
|
2011-04-25T18:02:28.247
| 721,549 | 721,549 |
[
"c++",
"opengl",
"shader",
"blur",
"fbo"
] |
5,779,769 | 1 | null | null | 0 | 1,726 |
I have a very simple data model that consists of 2 objects — a `Section` and an `Item`. Each `Section` has a to-many child relationship to other `Section` objects as well as a to-one parent relationship with another `Section` object. Every section has a to-many relationship to `Item` objects.

Structure aside, some `Section` objects have no `Item` objects, and others (at the bottom of the hierarchy) have no `Section` child objects.
I want to create a tableview that will use `Section` objects to create the section headers, and then display the `Item` objects as tableViewCells that are a part of that `Section`. I also want table headers to appear if the `Section` has no `Items`, because seeing the hierarchy is important.
Given a random `Section` object, how would I go about fetching and displaying this data? Do I need to create a nested loop that flattens the data in an array, or is there some awesome way to leverage predicates and `NSFetchedResultsController`?
|
CoreData model with nested object relationships as a datasource?
|
CC BY-SA 3.0
| null |
2011-04-25T15:07:41.383
|
2011-04-27T15:29:19.253
| null | null | 219,915 |
[
"iphone",
"ios",
"ipad",
"core-data"
] |
5,779,747 | 1 | 5,779,858 | null | 0 | 3,941 |
I have developed a very simple app that uses a custom adapter for a ListView.
Each row has two TextViews:
```
<?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:orientation="vertical">
<TextView android:id="@+id/text1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView android:id="@+id/text2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:visibility="gone" />
</LinearLayout>
```
The first TextView is named "text1", and the second "text2".
As you see, .
Also, the list has a header that only contains an EditText widget:
```
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<EditText android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</LinearLayout>
```
Each row is represented by a very simple object named "Item" that has 2 properties (text1 and text2), and its getters/setters. Also, it has a "hasText2" method that just checks if the object has the text2 property value's length > 0:
```
public class Item {
private String text1;
private String text2;
public String getText1() {
return text1;
}
public void setText1(String text1) {
this.text1 = text1;
}
public boolean hasText2() {
return text2.length() > 0;
}
public String getText2() {
return text2;
}
public void setText2(String text2) {
this.text2 = text2;
}
}
```
Okay, I'll initialize the list with just 2 items in my main app file:
```
Item item1 = new Item();
item1.setText1("Item 1");
item1.setText2("optional 1");
Item item2 = new Item();
item2.setText1("Item 2");
item2.setText2("");
getListView().addHeaderView(getLayoutInflater().inflate(R.layout.list_header, null), false, false);
m_items = new ArrayList<Item>();
m_adapter = new CustomListAdapter(this, R.layout.list_row, m_items);
setListAdapter(m_adapter);
m_items.add(item1);
m_items.add(item2);
m_adapter.notifyDataSetChanged();
```
This is the getView method of my custom adapter (that extends ArrayAdapter):
```
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null) {
LayoutInflater vi = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = vi.inflate(R.layout.list_row, null);
}
// get the two text widgets of this row layout
TextView text1 = (TextView) convertView.findViewById(R.id.text1);
TextView text2 = (TextView) convertView.findViewById(R.id.text2);
// get the Item object of this row
Item list_item = items.get(position);
// we set the text1 property of this Item to the text1 widget
text1.setText(list_item.getText1());
// if this Item has a text2 (value length > 0), then set it to the text2 widget and make it visible
if (list_item.hasText2()) {
text2.setText(list_item.getText2());
text2.setVisibility(0);
}
return convertView;
}
```
So, what I want is to .
And this is the result after running the app:

That's good, it works just as I expected!! :)
But what if I tap the EditText of the list header? (so I force to update the list):

What happened here? That's impossible. The second row has no text2 defined, and Android just has taken the text2 from the first row! Why??
The only reason I could imagine is that I cannot use rows with different visibility... but then, why Android let me do it when I just run the app? It seems to fail only when the keyboard appears (list update).
|
Different "visibility" values in each row in a ListView
|
CC BY-SA 3.0
| null |
2011-04-25T15:05:49.227
|
2011-04-25T15:15:32.620
| null | null | 267,705 |
[
"android"
] |
5,780,124 | 1 | 5,780,178 | null | 2 | 381 |
Apple's non-standard language extension, "blocks" (like closures) isn't supported by the parser in Netbeans 7.
I'm a bit unsure as to why this is, since I thought the parser just relied on the compiler.
Is it possible to get Netbeans to recognize the block syntax in any way?
Xcode 4:

Netbeans 7:

|
Netbeans 7 and C/C++ blocks
|
CC BY-SA 3.0
| null |
2011-04-25T15:45:59.000
|
2012-01-18T14:03:29.920
|
2011-04-25T15:51:44.323
| 202,538 | 202,538 |
[
"c++",
"c",
"macos",
"block"
] |
5,780,272 | 1 | null | null | 4 | 680 |
I have the following problem:
I have an abstract class, lets call it , that contains some code I'd like to reuse (for example: a standard service binder, common menu items, common initialization code, etc. etc.). Normally I would just use it to subclass my concrete activities and be done with it.
However, I occasionally need to use another supertype, such as a or a .
## So the question is: how do I avoid duplicating that support code within an Activity, if I have to use another base class?
I have thought up of a solution based on the decorator pattern, like this one:

.
However, I see a problem with this approach:
What to do with protected methods (like )? Should I introduce an additional "bridge" class that makes them public for the purpose of the decorator, similarly to the way presented below (starting to look a bit byzantine...)?

Any other way?
I hope I made myself relatively clear. Thanks in advance for any feedback!
PS. Using static utility classes is not a good solution in my opinion, since it introduces a possibility of hard-to-identify programming bugs.
|
What is the optimal way to share code between Activities with different base classes?
|
CC BY-SA 3.0
| null |
2011-04-25T16:00:36.640
|
2013-07-26T12:03:38.420
|
2013-07-26T12:03:38.420
| 724,361 | 724,361 |
[
"java",
"android"
] |
5,780,362 | 1 | 5,780,387 | null | 1 | 260 |
Right now I have a standard UITableView that is empty by default and the user can add cells to it.
I noticed this app starts with no cells and is empty (like you cant see lines) but my standard view always has the lines like standard table view.
I thought it may be a grouped table style but the edges are not curved like the grouped style is.
Does anyone have any ideas?

|
How Can I Recreate This UITableView Look?
|
CC BY-SA 3.0
| 0 |
2011-04-25T16:11:48.273
|
2011-04-25T17:19:26.237
| null | null | null |
[
"iphone",
"objective-c",
"cocoa-touch"
] |
5,780,663 | 1 | 5,781,480 | null | 5 | 1,188 |
I'm working on a new game, and am trying to detect whether or not the player (on a slope) is colliding with a given mesh based off of their coordinates relative to the coordinates of the slope. I'm using this function, which doesn't seem to be working (the slope seems too small or something)
```
//Slopes
float slopeY = max.Y-min.Y;
float slopeZ = max.Z-min.Z;
float slopeX = max.X-min.X;
float angle = (float)Math.Atan(slopeZ/slopeY);
//Console.WriteLine(OpenTK.Math.Functions.RadiansToDegrees((float)Math.Atan(slopeZ/slopeY)).ToString()+" degrees incline");
slopeY = slopeY/slopeZ;
float slopeZX = slopeY/slopeX;
//End slopes
float surfaceposX = max.X-coord.X;
float surfaceposY = max.Y-coord.Y;
float surfaceposZ = min.Z-coord.Z;
min-=sval;
max+=sval;
//Surface coords
//End surface coords
//Y SHOULD = mx+b, where M = slope and X = surfacepos, and B = surfaceposZ
if(coord.X<max.X& coord.X>min.X&coord.Y>min.Y&coord.Y<max.Y&coord.Z>min.Z&coord.Z<max.Z) {
if(slopeY !=0) {
Console.WriteLine("Slope = "+slopeY.ToString()+"SlopeZX="+slopeZX.ToString()+" surfaceposZ="+surfaceposZ.ToString());
Console.WriteLine(surfaceposY-(surfaceposY*slopeY));
//System.Threading.Thread.Sleep(40000);
if(surfaceposY-(surfaceposZ*slopeY)<3 || surfaceposY-(surfaceposX*slopeZX)<3) {
return true;
} else {
return false;
}
} else {
return true;
}
} else {
return false;
}
```
Any suggestions?
Sample output:
59.86697
6.225558 2761.331
68.3019 degrees incline
59.86698,46.12445
59.86698
6.225558 2761.332
0 degrees incline


EDIT: Partially fixed the problem. Slope detection works, but now I can walk through walls???
```
//Slopes
float slopeY = max.Y-min.Y;
float slopeZ = max.Z-min.Z;
float slopeX = max.X-min.X;
float angle = (float)Math.Atan(slopeZ/slopeY);
//Console.WriteLine(OpenTK.Math.Functions.RadiansToDegrees((float)Math.Atan(slopeZ/slopeY)).ToString()+" degrees incline");
slopeY = slopeY/slopeZ;
float slopey = slopeY+1/slopeZ;
float slopeZX = slopeY/slopeX;
//End slopes
float surfaceposX = min.X-coord.X;
float surfaceposY = max.Y-coord.Y;
float surfaceposZ = min.Z-coord.Z;
min-=sval;
max+=sval;
//Surface coords
//End surface coords
//Y SHOULD = mx+b, where M = slope and X = surfacepos, and B = surfaceposZ
if(coord.X<max.X& coord.X>min.X&coord.Y>min.Y&coord.Y<max.Y&coord.Z>min.Z&coord.Z<max.Z) {
if(slopeY !=0) {
Console.WriteLine("Slope = "+slopeY.ToString()+"SlopeZX="+slopeZX.ToString()+" surfaceposZ="+surfaceposZ.ToString());
Console.WriteLine(surfaceposY-(surfaceposY*slopeY));
//System.Threading.Thread.Sleep(40000);
surfaceposZ = Math.Abs(surfaceposZ);
if(surfaceposY>(surfaceposZ*slopeY) & surfaceposY-2<(surfaceposZ*slopeY) || surfaceposY>(surfaceposX*slopeZX) & surfaceposY-2<(surfaceposX*slopeZX)) {
return true;
} else {
return false;
}
} else {
return true;
}
} else {
return false;
}
```
|
Collision checking on slopes
|
CC BY-SA 3.0
| 0 |
2011-04-25T16:46:16.180
|
2011-04-25T21:10:13.680
|
2011-04-25T18:48:36.840
| 435,224 | 435,224 |
[
"c#",
"collision-detection",
"opentk"
] |
5,780,785 | 1 | 5,790,345 | null | 0 | 3,324 |
I am printing excel like this:
```
header("Content-Type: application/vnd.ms-excel; charset=utf-8");
header("Content-type: application/x-msexcel; charset=utf-8");
header("Content-Disposition: attachment; filename=".str_replace(' ', '_', $title).".xls");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
```
The content is plain html. The problem, when I download this, I get an initial confirmation box written
`The file you are trying to open 'File_name.xls', is in a different format than specified by the file extension. Verified that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?`
When I do 'yes', I get this. Bit strange, any input here friends please ?

|
html to excel problem!
|
CC BY-SA 3.0
| 0 |
2011-04-25T16:59:37.023
|
2017-04-05T03:40:02.977
| null | null | 613,018 |
[
"excel",
"export-to-excel"
] |
5,780,802 | 1 | 5,797,545 | null | 0 | 957 |
I have chosen advanced mode in tiny mce.
But in my view I see this:

Which is not the advanced theme of tiny mce.
I have looked in the html for the page and found this with firebug:
```
<link rel="stylesheet" _mce_href="http://localhost:3000/javascripts/tiny_mce/themes/simple/skins/default/content.css?1303749502" href="http://localhost:3000/javascripts/tiny_mce/themes/simple/skins/default/content.css?1303749502">
Failed to load source for: http://localhost:3000/javascripts/tiny_mce/themes/simple/skins/default/content.css?1303749502
```
I have followed this guide to install tiny mce:
[https://github.com/kete/tiny_mce](https://github.com/kete/tiny_mce)
Why does it failed to load the source?
Do I need to add something to my route file?
|
Rails 3 Tinymce css style error: Failed to load source
|
CC BY-SA 3.0
| null |
2011-04-25T17:02:20.723
|
2011-04-26T23:13:08.280
| null | null | 557,527 |
[
"ruby-on-rails",
"ruby",
"ruby-on-rails-3",
"tinymce"
] |
5,781,109 | 1 | 5,781,169 | null | 3 | 79,749 |
I am designing a website. I want my website to be 980px width. I can easily do it on my laptop by setting the `right` and `left` fields of CSS Box as 15%. But my concern is that, when my website is opened on another PC with no widescreen, that 15% will create a distortion. I want to keep my website at 980px whatever be the screen size may be. Please help!
As you can see in the image attached. The boxes are 15% distance from sides. If screen will be shorter for a pc, then these boxes will overlap.
|
How to keep website width fixed (irrespective of screen size)
|
CC BY-SA 3.0
| 0 |
2011-04-25T17:30:37.377
|
2018-07-24T18:32:10.350
|
2011-12-25T01:17:36.173
| 106,224 | 722,531 |
[
"html",
"css"
] |
5,781,396 | 1 | 7,431,773 | null | 0 | 231 |
Is it possible to change the answer to this once the region has been created?

|
Change msg classes displaying form region (VS2010, Outlook Addin)
|
CC BY-SA 3.0
| null |
2011-04-25T18:00:24.080
|
2011-09-15T13:38:21.117
| null | null | 455,616 |
[
"c#",
"visual-studio",
"outlook-addin"
] |
5,781,573 | 1 | 5,782,578 | null | 1 | 263 |
How can I center a transparent `<div>` element and have the surrounding area be white?
How my page looks now:

How I want it to look:
 (Orange outline is for illustrative purposes only and would not exist on page.)
|
vertically and horizontally centered transparent div with all surrounding area solid white
|
CC BY-SA 3.0
| 0 |
2011-04-25T18:17:34.507
|
2011-04-25T19:53:30.040
| null | null | 552,067 |
[
"css",
"html",
"center"
] |
5,781,651 | 1 | 5,783,259 | null | 4 | 615 |
I've been developing a `Vb.Net` app lately, and I'm trying to make it as lightweight as possible (ie make the binaries as small as possible).
I've done all the trivial stuff, but while browsing the binary with `ILDasm`, I noticed that it has a `My namespace`, with a lot of methods, although I don't use any of these in my program. It seems that there are default `Get/Set` methods for every form, and other methods.
Is there a way to get rid of those?
Or, can you show me a use case for the methods bundled by default in the binary?
: Here's a minimal example:
```
Module Test
Sub Main()
End Sub
End Module
```
The output is:

|
Getting rid of the `My` namespace
|
CC BY-SA 3.0
| 0 |
2011-04-25T18:25:14.333
|
2013-11-27T10:01:09.490
|
2011-04-25T20:53:05.673
| 695,591 | 695,591 |
[
"vb.net",
"binary",
"compilation"
] |
5,781,689 | 1 | 5,782,037 | null | 1 | 954 |
I know it's a fat chance I'll find an answer here, but since devexpress support is a little slow I thought I'd give it a try.
Basically I'm using DevExpress 2011.1.2 beta, it's been working wonders, I love it. But I had a small issue with it recently...
I inserted an expressbar on the Delphi form and used the images from cxImageList, however, I noticed that the icons on the bar buttons were showing black and white, but when I had my mouse over, it displayed the true colors. I did not modify anything, and
Here's an image to better illustrate my problem: 
I know the solution must be simple, however I couldn't find anything related.
Thank you.
: After modifying the button's property AutoGreyScale to false the color returned, but dull and lifeless, and when mouse is over it, more colorful. 
ImageOptions of my Bar: 
|
DevExpress Bar Buttons showing black and white and color when hovered?
|
CC BY-SA 3.0
| null |
2011-04-25T18:28:33.363
|
2011-04-25T19:16:28.440
|
2011-04-25T19:16:28.440
| 712,312 | 712,312 |
[
"delphi",
"devexpress"
] |
5,781,709 | 1 | 17,499,229 | null | 13 | 1,352 |
The .NET [UserControl](http://msdn.microsoft.com/en-us/library/system.windows.forms.usercontrol.aspx) (which descends from [ScrollableControl](http://msdn.microsoft.com/en-us/library/system.windows.forms.scrollablecontrol.aspx)) has to ability to display horizontal and vertical scrollbars.
The caller can set the visibility, and range, of these horizontal and vertical scrollbars:
```
UserControl.AutoScroll = true;
UserControl.AutoScrollMinSize = new Size(1000, 4000); //1000x4000 scroll area
```
> The `UserControl` (i.e. `ScrollableControl`) uses the Windows standard mechanism of specifying `WS_HSCROLL` and `WS_VSCROLL` window styles to make scrollbars appear. That is: they do not create separate Windows or .NET scroll controls, positioning them at the right/bottom of the window. Windows has a standard mechanism for displaying one, or both, scrollbars.
If the user scrolls the control, the `UserControl` is sent a `WM_HSCROLL` or `WM_VSCROLL` message. In response to these messages i want the ScrollableControl to invalidate the client area, which is what would happen in native Win32:
```
switch (uMsg)
{
case WM_VSCROLL:
...
GetScrollInfo(...);
...
SetScrollInfo(...);
...
InvalidateRect(g_hWnd,
null, //erase entire client area
true, //background needs erasing too (trigger WM_ERASEBKGND));
break;
}
```
i need the entire client area invalidated. The problem is that (i.e. `ScrollableControl`) [calls](http://msdn.microsoft.com/en-us/library/system.windows.forms.scrollablecontrol.setdisplayrectlocation.aspx) the [ScrollWindow](http://msdn.microsoft.com/en-us/library/bb787591%28v=vs.85%29.aspx) API function:
```
protected void SetDisplayRectLocation(int x, int y)
{
...
if ((nXAmount != 0) || ((nYAmount != 0) && base.IsHandleCreated))
{
...
SafeNativeMethods.ScrollWindowEx(new HandleRef(this, base.Handle), nXAmount, nYAmount, null, ref rectClip, NativeMethods.NullHandleRef, ref prcUpdate, 7);
}
...
}
```
Rather than triggering an InvalidateRect on the entire client rectangle, ScrollableControl tries to "" the existing content in the client area. For example, the user scrolls , the current client content is pushed by `ScrollWindowEx`, and then only the newly uncovered area is invalidated, triggering a `WM_PAINT`:

In the above diagram, the checkerboard area is the content that is and will have to be painted during the next WM_PAINT.
In my case this is no good; the top of my control contains a "header" (e.g. listview column headers). Scrolling this content further down is incorrect:

and it causes visual corruption.
i want the ScrollableControl to use `ScrollWindowEx`, but instead just invalidate the entire client area.
i tried overriding `OnScroll` protected method:
```
protected override void OnScroll(ScrollEventArgs se)
{
base.OnScroll(se);
this.Invalidate();
}
```
But it causes an double-draw.
> i could use double-buffering to mask the problem, but that's not a real solution - - -
i considered using a `Control` instead of `UserControl` (i.e. before `ScrollableControl` in the inheritance chain) and manually add a HScroll or VScroll .NET control - but that's not desirable either:
- -
Since i can see, and posted, the code internal to `ScrollableControl` i know there is no property to disable use of `ScrollWindow`, but is there a property to disable the use of `ScrollWindow`?
---
## Update:
i tried overriding the offending method, and using reflector to steal all the code:
```
protected override void SetDisplayRectLocation(int x, int y)
{
...
Rectangle displayRect = this.displayRect;
...
this.displayRect.X = x;
this.displayRect.Y = y;
if ((nXAmount != 0) || ((nYAmount != 0) && base.IsHandleCreated))
{
...
SafeNativeMethods.ScrollWindowEx(new HandleRef(this, base.Handle), nXAmount, nYAmount, null, ref rectClip, NativeMethods.NullHandleRef, ref prcUpdate, 7);
}
...
}
```
The problem is that [SetDisplayRectLocation](http://msdn.microsoft.com/en-us/library/system.windows.forms.scrollablecontrol.setdisplayrectlocation.aspx) reads and writes to a private member variable (`displayRect`). Unless Microsoft changes C# to allow descendants access to private members: i cannot do that.
---
## Update Two
i realized that copy-pasting the implementation of `ScrollableControl`, fixing the one means i will also have to copy-n-paste the entire inheritance chain down to `UserControl`
```
...
ScrollableControl2 : Control, IArrangedElement, IComponent, IDisposable
ContainerControl2 : ScrollableControl2, IContainerControl
UserControl2 : ContainerControl2
```
i'd really prefer to work object-oriented design, rather than against it.
|
How to stop a UserControl (nee ScrollableControl) from calling ScrollWindow?
|
CC BY-SA 3.0
| 0 |
2011-04-25T18:31:10.840
|
2015-08-01T21:28:59.867
|
2011-04-27T19:47:18.623
| 12,597 | 12,597 |
[
".net",
"scroll",
"scrollable"
] |
5,781,845 | 1 | null | null | 3 | 2,324 |
I'm getting a byte array representing a TIFF file from my server, converting it into an XImage, and then adding it to a new pdf document. The image in question is 1280x800 (it was a screenshot) and is being stretched out and lengthened to fit the height and width of a standard pdf page. How do I fix this?

|
abcPDF is malforming my image after adding it to a pdf
|
CC BY-SA 3.0
| null |
2011-04-25T18:45:39.287
|
2013-12-17T09:32:04.153
|
2011-11-28T02:44:29.743
| 234,976 | 724,189 |
[
"c#",
"pdf",
"abcpdf"
] |
5,781,870 | 1 | 5,781,912 | null | 7 | 995 |
Context: I am prototyping in prep for (maybe) converting my WinForms app to WPF.
I make very simple tree view event handler for which the code is:
```
var treeViewItem = (TreeViewItem)e.NewValue;
var treeViewItemTag = treeViewItem.Tag;
if (treeViewItemTag == "ViewForAMs")
{
ObjectQuery<AccountManagerView> oq = entities.AccountManagerViews;
var q =
from c in oq
select c;
dataGrid1.ItemsSource = q.ToList();
}
```
and the XAML is:
```
<Window x:Class="AccountingWpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525" Loaded="Window_Loaded">
<DockPanel>
<TreeView Name="treeView1" ItemsSource="{Binding Folders}"
SelectedItemChanged="treeView1_SelectedItemChanged">
<TreeViewItem Header="Account Manager View" Tag="ViewForAMs"/>
</TreeView>
<DataGrid AutoGenerateColumns="True" Name="dataGrid1" />
</DockPanel>
</Window>
```
When I ran it, I fully expected to see my data grid get populated but the == comparison failed on the second line of code above.
The debugger shows this:
QUESTION: why were there no compile or runtime errors? (same question another way: what is actually being compared such that the == operator outputs FALSE?)

|
what's the underlying reason this == comparison fails? (surprising result for me)
|
CC BY-SA 3.0
| null |
2011-04-25T18:48:51.377
|
2011-04-25T18:59:04.883
|
2011-04-25T18:51:19.260
| 50,776 | 398,546 |
[
"c#",
"expression",
"typing"
] |
5,781,991 | 1 | 5,782,572 | null | 2 | 4,469 |
I'm trying to use a third-party external DLL (from usbmicro) within MATLAB, but it keeps crashing MATLAB. This is from the documentation indicating the syntax of the function call from within a C program:
```
int USBm_About( char *about );
```
I tried this MATLAB script (yes it's very kludgy, I'm a MATLAB noob):
```
>> loadlibrary('USBm.dll','USBmAPI.h')
>> libfunctions('USBm')
>> s='sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss';
>> st=strcat(s,s,s,s);
>> vp = libpointer('voidPtr',[int8(st) 0]);
>> result=calllib('USBm','USBm_About',vp)
```
and this one:
```
>> loadlibrary('USBm.dll','USBmAPI.h')
>> libfunctions('USBm')
>> s='sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss';
>> st=strcat(s,s,s,s);
>> vp=libpointer('cstring',st);
>> result=calllib('USBm','USBm_About',vp)
```
In both cases, the `calllib()` call causes MATLAB to crash with a segmentation fault.
The version of MATLAB is 7.10; the OS is Windows Vista.
---
### Update:
Here's a screenshot of libfunctionsview USBm:

Here's the header file:
```
#ifndef FILE_USBmAPI_h
#define FILE_USBmAPI_h
// Prototypes for this DLL.
// These are the API functions available to the .dll user.
// Discovery routine
extern "C" __declspec(dllexport) int USBm_FindDevices(void);
// Return info about devices
extern "C" __declspec(dllexport) int USBm_NumberOfDevices(void);
extern "C" __declspec(dllexport) int USBm_DeviceValid(unsigned char);
extern "C" __declspec(dllexport) int USBm_DeviceVID(unsigned char);
extern "C" __declspec(dllexport) int USBm_DevicePID(unsigned char);
extern "C" __declspec(dllexport) int USBm_DeviceDID(unsigned char);
extern "C" __declspec(dllexport) int USBm_DeviceFirmwareVer(unsigned char);
extern "C" __declspec(dllexport) int USBm_DeviceMfr(unsigned char, char *);
extern "C" __declspec(dllexport) int USBm_DeviceProd(unsigned char, char *);
extern "C" __declspec(dllexport) int USBm_DeviceSer(unsigned char, char *);
// General USBmicro U4xx device access
extern "C" __declspec(dllexport) int USBm_ReadDevice(unsigned char, unsigned char *);
extern "C" __declspec(dllexport) int USBm_SetReadTimeout(unsigned int);
extern "C" __declspec(dllexport) int USBm_WriteDevice(unsigned char, unsigned char *);
extern "C" __declspec(dllexport) int USBm_CloseDevice(unsigned char);
// DLL string info access
extern "C" __declspec(dllexport) int USBm_RecentError(char *);
extern "C" __declspec(dllexport) int USBm_ClearRecentError(void);
extern "C" __declspec(dllexport) int USBm_DebugString(char *);
extern "C" __declspec(dllexport) int USBm_Copyright(char *);
extern "C" __declspec(dllexport) int USBm_About(char *);
extern "C" __declspec(dllexport) int USBm_Version(char *);
// General U4x1 device functions
// -----------------------------
// Port initialization
extern "C" __declspec(dllexport) int USBm_InitPorts(unsigned char);
extern "C" __declspec(dllexport) int USBm_InitPortsU401(unsigned char);
extern "C" __declspec(dllexport) int USBm_InitPortsU421(unsigned char);
extern "C" __declspec(dllexport) int USBm_InitPortsU451(unsigned char);
// Port/bit reading and writing
extern "C" __declspec(dllexport) int USBm_WriteA(unsigned char, unsigned char);
extern "C" __declspec(dllexport) int USBm_WriteB(unsigned char, unsigned char);
extern "C" __declspec(dllexport) int USBm_WriteABit(unsigned char, unsigned char, unsigned char);
extern "C" __declspec(dllexport) int USBm_WriteBBit(unsigned char, unsigned char, unsigned char);
extern "C" __declspec(dllexport) int USBm_ReadA(unsigned char, unsigned char *);
extern "C" __declspec(dllexport) int USBm_ReadB(unsigned char, unsigned char *);
extern "C" __declspec(dllexport) int USBm_SetBit(unsigned char, unsigned char);
extern "C" __declspec(dllexport) int USBm_ResetBit(unsigned char, unsigned char);
// Port direction
extern "C" __declspec(dllexport) int USBm_DirectionA(unsigned char, unsigned char, unsigned char);
extern "C" __declspec(dllexport) int USBm_DirectionAOut(unsigned char);
extern "C" __declspec(dllexport) int USBm_DirectionAIn(unsigned char);
extern "C" __declspec(dllexport) int USBm_DirectionAInPullup(unsigned char);
extern "C" __declspec(dllexport) int USBm_DirectionB(unsigned char, unsigned char, unsigned char);
extern "C" __declspec(dllexport) int USBm_DirectionBOut(unsigned char);
extern "C" __declspec(dllexport) int USBm_DirectionBIn(unsigned char);
extern "C" __declspec(dllexport) int USBm_DirectionBInPullup(unsigned char);
// Strobbing a byte of data
extern "C" __declspec(dllexport) int USBm_StrobeWrite(unsigned char, unsigned char, unsigned char, unsigned char);
extern "C" __declspec(dllexport) int USBm_StrobeRead(unsigned char, unsigned char *, unsigned char, unsigned char);
extern "C" __declspec(dllexport) int USBm_StrobeWrite2(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char);
extern "C" __declspec(dllexport) int USBm_StrobeRead2(unsigned char, unsigned char *, unsigned char, unsigned char, unsigned char, unsigned char);
extern "C" __declspec(dllexport) int USBm_StrobeWrites(unsigned char, unsigned char *, unsigned char *);
extern "C" __declspec(dllexport) int USBm_StrobeReads(unsigned char, unsigned char *, unsigned char *);
// Reading pin-change latches
extern "C" __declspec(dllexport) int USBm_ReadLatches(unsigned char, unsigned char *);
// LCD routines
extern "C" __declspec(dllexport) int USBm_InitLCD(unsigned char, unsigned char, unsigned char);
extern "C" __declspec(dllexport) int USBm_LCDCmd(unsigned char, unsigned char);
extern "C" __declspec(dllexport) int USBm_LCDData(unsigned char, unsigned char);
// SPI routines
extern "C" __declspec(dllexport) int USBm_InitSPI(unsigned char, unsigned char);
extern "C" __declspec(dllexport) int USBm_SPIMaster(unsigned char, unsigned char *, unsigned char *);
extern "C" __declspec(dllexport) int USBm_SPISlaveWrite(unsigned char, unsigned char, unsigned char *);
extern "C" __declspec(dllexport) int USBm_SPISlaveRead(unsigned char, unsigned char *, unsigned char *);
// 2-wire routines
extern "C" __declspec(dllexport) int USBm_Wire2Control(unsigned char, unsigned char *);
extern "C" __declspec(dllexport) int USBm_Wire2Data(unsigned char, unsigned char *);
// Stepper routine
extern "C" __declspec(dllexport) int USBm_Stepper(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char);
// 1-wire routines
extern "C" __declspec(dllexport) int USBm_Reset1Wire(unsigned char, unsigned char *);
extern "C" __declspec(dllexport) int USBm_Write1Wire(unsigned char, unsigned char);
extern "C" __declspec(dllexport) int USBm_Read1Wire(unsigned char, unsigned char *);
extern "C" __declspec(dllexport) int USBm_Write1WireBit(unsigned char, unsigned char);
extern "C" __declspec(dllexport) int USBm_Read1WireBit(unsigned char, unsigned char *);
#endif // multiple inclusion prevention
// End of file
//---------------------------------------------------------------------------
```
---
### Update:
I tried changing this line:
```
extern "C" __declspec(dllexport) int USBm_About(char *);
```
to this:
```
extern "C" __declspec(dllimport) int USBm_About(char *);
```
in the header file, and then restarting MATLAB. I ran my code again and MATLAB still crashes.
|
Attempt to call dll function from matlab causing crash
|
CC BY-SA 3.0
| null |
2011-04-25T18:59:19.810
|
2013-12-16T21:59:14.397
|
2011-10-19T03:35:45.747
| 97,160 | 549,226 |
[
"c",
"matlab",
"dll",
"shared-libraries",
"loadlibrary"
] |
5,782,062 | 1 | 5,782,474 | null | 0 | 11,446 |
Here is an example which should clear things up for the last post.

hireDate & carReg are the primary keys. Are there extra functional dependencies (FDs) other than the ones I have identified
below? Modifications also welcome:
```
fd1 carReg -> make, model, outletNo, outletLoc
fd2 custNo -> custName
fd3 outletNo -> outletLoc
fd4 model -> make (only if we assume a model name is unique to a make)
fd5 carReg, hireDate -> make, model, custNo, custName, outletNo, outletLoc
```
I'm not sure if the above are correct and I am sure there are more.
---
Based on [Mike Sherrill Cat Recall's answer](https://stackoverflow.com/questions/5782062/identifying-functional-dependencies-ii/5782474#5782474)... My question is this: How is custName -> custNo a valid FD? For the above relation, sure, a customer name maps onto exactly one customer number, but by intuition, we know more than one J SMith could be added to the table. If this is the case, this FD is void as it forms a 1..* relationship. Can we really say that custName -> custNo knowing this fact? Do we merely base FDs on the sample data? Or do we take into account the possible values that can be added?
|
Identifying Functional Dependencies II
|
CC BY-SA 4.0
| 0 |
2011-04-25T19:05:57.207
|
2022-10-21T13:17:44.143
|
2022-10-21T13:17:44.143
| 63,550 | 559,142 |
[
"database",
"database-design",
"relational-database",
"functional-dependencies"
] |
5,782,431 | 1 | 5,784,765 | null | 2 | 498 |
I'm attempting to display a column separator for a table in IE8. I'm using CSS which works great in Chrome and Firefox but in IE8 the corner of the table cells with the black column separator appear differently. You can view the differences in the the below images. The first image is from IE8 which is showing the results that I do not want and the second image is from Chrome which shows how I want the table to appear.


The source is below, you can also edit it at [http://jsbin.com/obava4/2/edit](http://jsbin.com/obava4/2/edit):
```
table.testresults
{
border-collapse:collapse;
}
table.testresults td {
padding: 3px;
border-style:solid;
border-width: 4px;
border-color:lightgray;
font-size: 8pt;
font-family: Arial;
font-weight:400;
}
table.testresults *.borderleft {
border-left-color: black;
border-left-style: solid;
border-left-width: 5px;
}
table.testresults th {
font-size: 0.7em;
font-family: Arial;
padding: 3px;
spacing:0px;
border-bottom-color: lightgray;
border-style:solid;
border-width: 4px;
border-color:lightgray;
}
</style>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
</head>
<body>
<table class="testresults">
<col id="col1"><col id="col2"><col id="col3">
<tr class="currenv">
<th class="corrcorrenv borderleft" align="left" colspan="1">CORR of COR</th>
<th class="correnv borderleft" align="left" colspan="1">CORR</th>
</tr>
<tr class="currenv">
<th width="50px" class="resultheader borderleft" align="left">Result</th>
<th class="nowrap">Age </th>
</tr>
<tr>
<td class="borderleft" TestResultsID="">Pased</td>
<td>row.ARAge</td>
</tr>
</table>
</body>
</html>
</body>
</html>
```
|
IE8 Cell Corner Border
|
CC BY-SA 3.0
| null |
2011-04-25T19:41:56.873
|
2017-05-15T07:53:56.573
|
2017-05-15T07:53:56.573
| 4,370,109 | 3,165 |
[
"css",
"internet-explorer",
"internet-explorer-8",
"html-table",
"border"
] |
5,782,642 | 1 | 5,782,906 | null | 3 | 2,495 |
Hy!
I'd like to get some informations from an audio file (title, artist, etc.) in C# (wpf). The MediaElement doesn't provides this option, so I used this code (read bytes directly):
```
public string[] GetAudioFileInfo(string path)
{
path = Uri.UnescapeDataString(path);
byte[] b = new byte[128];
string[] infos = new string[5]; //Title; Singer; Album; Year; Comm;
bool isSet = false;
//Read bytes
try
{
FileStream fs = new FileStream(path, FileMode.Open);
fs.Seek(-128, SeekOrigin.End);
fs.Read(b, 0, 128);
//Set flag
String sFlag = System.Text.Encoding.Default.GetString(b, 0, 3);
if (sFlag.CompareTo("TAG") == 0) isSet = true;
if (isSet)
{
infos[0] = System.Text.Encoding.Default.GetString(b, 3, 30); //Title
infos[1] = System.Text.Encoding.Default.GetString(b, 33, 30); //Singer
infos[2] = System.Text.Encoding.Default.GetString(b, 63, 30); //Album
infos[3] = System.Text.Encoding.Default.GetString(b, 93, 4); //Year
infos[4] = System.Text.Encoding.Default.GetString(b, 97, 30); //Comm
}
fs.Close();
fs.Dispose();
}
catch (IOException ex)
{
MessageBox.Show(ex.Message);
}
return infos;
}
```
The problem with this code, that sometimes it doesn't gives the full title or represents only little cubes. (If I open the media in MeidaPlayer, than I can see the full title)
I'm not sure the parameters of the GetString(byte[],int,int), maybe I make mistakes there.
In my prgram: 
In media player: 
|
WPF C#, Get informations from audio file
|
CC BY-SA 3.0
| 0 |
2011-04-25T20:02:34.270
|
2011-04-25T20:30:56.633
| null | null | 574,647 |
[
"c#",
"wpf",
"audio",
"file-io",
"encoding"
] |
5,782,794 | 1 | 5,783,197 | null | 5 | 3,818 |
I am getting this warning when I switch views (which are just different themes) in my app. Any ideas, suggestions on why the app is not loading?
2011-04-25 16:14:20.211 MyApp [4121:40b] ADBannerView: WARNING A banner view (0x631bb30) has an ad but may be obscured. This message is only printed once per banner view.

It appears that when the view switches, the other view is just in the background, any ideas on how to do this.
** Note there is an excellent example on Apple's developer site, called iADSuite
|
iAd Banner Question
|
CC BY-SA 3.0
| null |
2011-04-25T20:17:48.557
|
2012-03-10T10:51:53.413
|
2011-04-25T22:27:02.313
| 597,775 | 597,775 |
[
"iphone",
"objective-c",
"ios4",
"iphone-sdk-3.0"
] |
5,782,835 | 1 | 5,783,247 | null | 10 | 8,332 |
I have contenteditable div with text on it. In firefox, there is some kind of grammar correction which underlines the text with red marking. How can I turn it off?

How do I turn off the red markings in FireFox?
```
<div contenteditable ='true'>Why do you underline me?</div>
```
JSFiddle:
[http://jsfiddle.net/26JkW/](http://jsfiddle.net/26JkW/)
|
Turn off grammar correction in a contenteditable div in FireFox
|
CC BY-SA 3.0
| null |
2011-04-25T20:22:36.267
|
2017-05-04T20:45:55.397
|
2011-04-25T21:09:51.527
| 449,132 | 449,132 |
[
"javascript",
"html",
"firefox",
"text",
"contenteditable"
] |
5,782,837 | 1 | 5,783,358 | null | 4 | 10,040 |
I have a Java background so have limited knowledge when it comes to C# and C++. Basically I am trying to "read" text from another application which is displayed on screen...

To be specific, I want to read the dealer chat message from Pokerstars... on the fly...
What is the best way to read this text into a Java program on the fly? Ive head about API hooking, is this the only way and how would I do this in Java?
Thanks
Phil
|
Read on-screen text from external app. API Hooking?
|
CC BY-SA 3.0
| 0 |
2011-04-25T20:22:42.860
|
2012-11-27T22:08:46.220
| null | null | 653,331 |
[
"c#",
"java",
"c++",
"api-hook",
"event-hooking"
] |
5,782,922 | 1 | 5,783,272 | null | 2 | 12,410 |
Hello everyone please help me out regarding menu in android . i want to make this gallery as grid menu for my application . please guide me how i can put the name under the images and if iclick on the particular image new activity should open and at last clicking on the menu button bring me back to main screen
here is the image

Here is the code
```
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;
public class DisplayViewsExample extends Activity
{
//---the images to display---
Integer[] imageIDs = {
R.drawable.pic1,
R.drawable.pic2,
R.drawable.pic3,
R.drawable.pic4,
R.drawable.pic5,
R.drawable.pic6,
R.drawable.pic7
};
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.displayview);
GridView gridView = (GridView) findViewById(R.id.gridview);
gridView.setAdapter(new ImageAdapter(this));
gridView.setOnItemClickListener(new OnItemClickListener()
{
public void onItemClick(AdapterView parent,
View v, int position, long id)
{
Toast.makeText(getBaseContext(),
"pic" + (position + 1) + " selected",
Toast.LENGTH_SHORT).show();
}
});
}
public class ImageAdapter extends BaseAdapter
{
private Context context;
public ImageAdapter(Context c)
{
context = c;
}
//---returns the number of images---
public int getCount() {
return imageIDs.length;
}
//---returns the ID of an item---
public Object getItem(int position) {
return position;
}
public long getItemId(int position) {
return position;
}
//---returns an ImageView view---
public View getView(int position, View convertView, ViewGroup parent)
{
ImageView imageView;
if (convertView == null) {
imageView = new ImageView(context);
imageView.setLayoutParams(new GridView.LayoutParams(85, 85));
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
imageView.setPadding(5, 5, 5, 5);
} else {
imageView = (ImageView) convertView;
}
imageView.setImageResource(imageIDs[position]);
return imageView;
}
}
}
```
here is the xml
```
<?xml version="1.0" encoding="utf-8"?>
<GridView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gridview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:numColumns="auto_fit"
android:verticalSpacing="10dp"
android:horizontalSpacing="10dp"
android:columnWidth="90dp"
android:stretchMode="columnWidth"
android:gravity="center"
/>
```
|
android gallery into grid style menu
|
CC BY-SA 3.0
| 0 |
2011-04-25T20:32:04.587
|
2011-04-25T21:05:48.407
| null | null | 592,344 |
[
"android"
] |
5,782,939 | 1 | 5,783,097 | null | 4 | 3,885 |
I am starting to build "drill-down" select elements (select elements that filter their options based on previous options you have selected.

Being that I have never done this before, I am looking for a "best-practice" approach to this common situation. Could you point me to a tutorial, or provide some example code to how I should approach this?
# Solution
I originally thought of hiding and showing options, but it turns out that approach is not cross-browser compatible. The easiest, cross-browser method I have come across is creating a copy of the original select options and replacing the options once the user has made a selection. I wrote a little jQuery plugin that makes it a bit more reusable.
```
<select id="first">
<option value="1">Fruits</option>
<option value="2">Vegetables</option>
</select>
<select id="second">
<option> -- Select -- </option>
<!-- class is in the format of "parentId_parentValue" -->
<option class="first_1" value="1">Apple</option>
<option class="first_1" value="2">Orange</option>
<option class="first_1" value="3">Banana</option>
<option class="first_2" value="4">Carrot</option>
<option class="first_2" value="5">Broccoli</option>
<option class="first_2" value="6">Spinach</option>
</select>
<script type="text/javascript">
$.fn.drilldown = function(child) {
var $parent = this;
var parentId = $parent.attr('id');
var $child = $(child);
var childId = $child.attr('id');
var optionIdentifier = '.' + parentId + '_';
var selectedChildOption = $child.val();
var $childCopy = $('<select id='+parentId+childId+' />');
$childCopy.html($child.find('option')).hide().appendTo('body');
var refreshOptions = function(){
var selectedParentValue = $parent.val();
$child.html($childCopy.find(optionIdentifier+selectedParentValue).clone());
$child.prepend('<option value="0" selected="selected"> -- Select -- </option>');
};
refreshOptions();
$child.val(selectedChildOption);
$parent.change(function(){
refreshOptions();
$child.trigger('change').focus();
});
};
$(document).ready(function(){
$('#first').drilldown('#second');
});
</script>
```
Here is a [jsFiddle](http://jsfiddle.net/misbehavens/Ra3Bb/) to show that it works.
|
Drill-down select options using JavaScript
|
CC BY-SA 3.0
| 0 |
2011-04-25T20:33:30.597
|
2011-05-10T20:34:25.467
|
2020-06-20T09:12:55.060
| -1 | 48,523 |
[
"javascript",
"html"
] |
5,783,184 | 1 | 5,783,264 | null | 2 | 532 |
As this question is sure to reveal, I'm relatively new to database design. Please pardon my lack of understanding.
I want to store values like the following (example from Google calendar) in a database:

What's the best way to do this? Would this be one database field or several?
If the former, does this disobey normalization rules?
Thanks!
|
How to store one or many checkbox values in a database?
|
CC BY-SA 3.0
| 0 |
2011-04-25T20:57:30.977
|
2011-04-26T01:52:41.747
| null | null | 456,584 |
[
"database",
"database-design"
] |
5,783,551 | 1 | 5,797,873 | null | 1 | 501 |
How do I remove the disabled features in Tinymce editor. I dont want them to appear.

|
Tinymce how to remove displayed features in editor?
|
CC BY-SA 3.0
| null |
2011-04-25T21:34:28.583
|
2011-04-26T23:59:57.007
| null | null | 557,527 |
[
"tinymce"
] |
5,783,995 | 1 | 5,784,311 | null | 0 | 689 |
Currently have : `LOAD DATA LOCAL INFILE '/Users/RkG/Desktop/Microblogs.csv' INTO TABLE blogs`

This is an example of the data im trying to import.


The last image is a result of the query I ran and the second image is a screenshot of the table structure, why isn't it importing the 'created on', 'location', and 'Text' ???
By trying the method given below I'm giving this output: How do I fix this date format??

```
3,5/18/2011 13:26,42.22717 93.33772,this convention filled with technology could be better don't plan on leaving anytime soon
3,5/10/2011 9:22,42.18881 93.35642,4 orang top scorer skrg 3 di antara nya pake adidas F50 adizero Lightest fastest deadliest.
3,5/14/2011 9:22,42.22479 93.35922,Nike 'gana' el Mundial al patrocinador oficial Adidas // y eso que sus figuras fueron un fracaso rotundo...
3,5/6/2011 9:22,42.2469 93.32527,Positiiff mau nabung beli kaos adidas aslii muller .. * basii bgt baru nabung skrg ya hahaha
```
|
Import into Mysql Via .CSV File
|
CC BY-SA 3.0
| null |
2011-04-25T22:31:39.823
|
2013-01-15T10:01:29.547
|
2011-04-26T23:54:36.840
| 700,070 | 700,070 |
[
"mysql",
"csv",
"load-data-infile"
] |
5,784,051 | 1 | 5,805,120 | null | 15 | 49,742 |
I am binding a DataTable to GridView. It does not adjust to height and width of the DataTable. How can I the strech the width of the grid that i shows all the columns and height shrink if the rows are few.

|
DataGridView , Adjusting width and height to DataTable
|
CC BY-SA 3.0
| 0 |
2011-04-25T22:38:50.683
|
2022-03-01T03:52:19.223
|
2011-04-25T23:14:07.547
| 389,288 | 389,288 |
[
"c#",
".net",
"ado.net",
"datagridview"
] |
5,784,136 | 1 | 5,784,326 | null | 0 | 1,437 |
I have a slide viewer I am making.
I have all the css working perfect, and the sprites working perfect.
Issue I have is, I have a Play and a Pause icon.
They are grey normal state, and pink on hover. But when they are clicked I want them to be pink.
The issue I have is this:
When page loads, the image slider auto plays, so I would like the PLAY button automatically PINK.
Then if user clicks PAUSE button I would like the PAUSE button made PINK, and the PLAY button GRAYED !
And then vice versa, for when user clicks PLAY, this button would turn PINK and pause button GRAYED
I am not sure how to do this as regular css I am sure cannot accomplish this on its own.
css:
```
div.play { width: 12px; height: 17px; background: url(../images/icons/slider-controls.png) no-repeat 0 -181px; }
div.pause { width: 18px; height: 16px; background: url(../images/icons/slider-controls.png) no-repeat 0 -121px; }
div.play:hover { width: 12px; height: 17px; background: url(../images/icons/slider-controls.png) no-repeat 0 -204px; }
div.pause:hover { width: 18px; height: 16px; background: url(../images/icons/slider-controls.png) no-repeat 0 -143px; }
```
html:
```
<a href="javascript:;"><div class="pause left" id="my-start-stop"></div></a>
<a href="javascript:;"><div class="play left" id="my-stop-start"></div></a>
```
js: ( for the controls )
```
$('#my-start-stop').click(function() {
slider.stopShow();
return false;
});
$('#my-stop-start').click(function() {
slider.startShow();
return false;
});
```
Image Sprite is:

|
making sprite image play/pause icon highlighted
|
CC BY-SA 3.0
| null |
2011-04-25T22:48:03.287
|
2011-04-25T23:18:58.527
| null | null | 501,173 |
[
"jquery",
"css"
] |
5,784,184 | 1 | 5,784,220 | null | 0 | 2,396 |
I'm having a problem trying to count the number of user records according to the user's id, however I'm using a subquery to join 2 tables that one has a count parameter but I get an error saying `duplicate column name 'user_id`.
The query:
```
$sql = "SELECT loc.location_id,
COUNT(loc.location_id) AS total_records
FROM locations loc
LEFT JOIN
(
SELECT usr.*,
loc.*
FROM
(
members usr
INNER JOIN locations loc
)
WHERE usr.user_id = " . $user_id . "
AND usr.account_disabled = 0
ORDER BY loc.submit_date DESC
) usr ON (loc.user_id = usr.user_id)";
```
All I need it is to return the user's info and the `total_records` count done by the `COUNT` function.
Cheers.
This is what I get returned for this SQL:
```
SELECT loc.location_id,
loc.street_name,
loc.city,
loc.state,
loc.county,
loc.country,
usr.user_id,
usr.username,
COUNT(loc.location_id) AS total_records
FROM locations loc
INNER JOIN members usr ON (loc.user_id = usr.user_id)
WHERE loc.user_id = $user_id
AND usr.account_disabled = 0
GROUP BY loc.location_id
```

|
Duplicate column name 'user_id' problem
|
CC BY-SA 3.0
| null |
2011-04-25T22:53:41.400
|
2011-04-27T16:23:50.680
|
2011-04-27T16:23:50.680
| 264,795 | 264,795 |
[
"mysql",
"count",
"left-join"
] |
5,784,436 | 1 | 5,784,492 | null | 0 | 802 |
I have a small database that requires multiple table queries to retrieve data. I have written nested foreach loops to get this done but was wondering if it is too demanding on memory or there is a more efficient way to do this. I have seen some linq code to join tables together and it looks promising, but for now the foreach was easier to understand. Should I seek out linq code to replace the nested foreach loops. Thank you
```
student is this so sid is this.getId
enrolls - sid(k) -term(k) -year(k) -crn(k)
sections -term(k) -year(k) -crn(k) -cprefix -cno
courses -cprefix(k) -cno(k) -chours
// count up enrolled course hours
decimal enrolledHours = 0;
foreach (enroll e in ent.enrolls)
{
if (e.sid.ToString() == this.get_Id && e.term.ToString() == term &&
e.year.ToString() == year) // find enrolls for student
{
foreach (section s in ent.sections) // search for cno for crn
{
if (s.crn == e.crn && s.term == e.term && s.year == e.year)
{
foreach (cours c in ent.courses) // match section and course
{
if (c.cprefix == s.cprefix && c.cno == s.cno)
{
enrolledHours += (decimal)c.chours;
break;
}
}
}
}
}
}
```

|
VS2010 SQL C# Entities: Accessing multiple tables to get single data? Foreach or Linq?
|
CC BY-SA 3.0
| null |
2011-04-25T23:38:58.147
|
2011-04-25T23:57:32.623
|
2011-04-25T23:50:39.750
| 47,550 | 313,574 |
[
"c#",
"entity-framework",
"linq-to-entities",
"performance",
"foreach"
] |
5,784,797 | 1 | 5,788,522 | null | 1 | 1,657 |
I'm trying to get the [jQuery Tokeninput plugin](http://loopj.com/jquery-tokeninput/) to work with my mvc application but there seems to be a problem somewhere ,,
## My Code :
```
<input type="text" id="MajorsIds" name="MajorsIds" />
<script type="text/javascript">
$(document).ready(function () {
$("#MajorsIds").tokenInput("/AjaxAPI/Major/GetMajors"
, {
prePopulate: [
{ "id": 501, "name": "Test 1" },
{ "id": 502, "name": "Test 2" },
{ "id": 503, "name": "Test 3" }
]
});
});
</script>
```
```
public ActionResult GetMajors(string q)
{
var majors = _majorService.GetAllMajors()
.Where(m=> m.Department.ToLower().Contains(q.ToLower()))
.Select(m => new {id = m.Id, name = m.Department});
return Json(majors,"text/html",JsonRequestBehavior.AllowGet);
}
```
When I type "a" for example in the search input a request is sent to the server and the data is retrieved however the retrieved data is not displayed ,,, instead the "searching ..." message is frozen.

```
HTTP/1.1 200 OK
Server: ASP.NET Development Server/10.0.0.0
Date: Tue, 26 Apr 2011 00:18:48 GMT
X-AspNet-Version: 4.0.30319
X-AspNetMvc-Version: 3.0
Cache-Control: private
Content-Type: text/html; charset=utf-8
Content-Length: 24
Connection: Close
```
```
GET /AjaxAPI/Major/GetMajors?q=a HTTP/1.1
Host: localhost:5000
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0) Gecko/20100101 Firefox/4.0
Accept: */*
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
X-Requested-With: XMLHttpRequest
Referer: http://localhost:5000/Home/GettingStarted
```
the returned json in the page output is :
```
[{"id":1,"name":"ACCT"},{"id":3,"name":"AE"},{"id":4,"name":"ARC"}, {"id":5,"name":"ARE"},{"id":20,"name":"MATH"},{"id":21,"name":"STAT"}]
```
I really don't know what's the problem ,,, or how to fix it ,,, my json response is valid and the results should be displayed but for some reason it's not working ,,,
---
When I tried the provided demo which calls an external link in my server it worked just fine ,,, however some additional parameters are being sent in the request with the demo code.
## Demo Code :
```
<input type="text" id="demo-input" name="blah" />
<script type="text/javascript">
$(document).ready(function() {
$("#demo-input").tokenInput("http://shell.loopj.com/tokeninput/tvshows.php");
});
</script>
```
Response Headers
```
HTTP/1.1 200 OK
Server: nginx/0.6.32
Date: Mon, 25 Apr 2011 22:53:34 GMT
Content-Type: text/html
X-Powered-By: PHP/5.3.3-1ubuntu9.1
Via: 1.1 cache4.ruh
Age: 0
Transfer-Encoding: chunked
Proxy-Connection: Keep-Alive
Connection: Keep-Alive
Content-Encoding: gzip
```
```
GET http://shell.loopj.com/tokeninput/tvshows.php?callback=jQuery151008570635266447713_1303770077700&q=a&_=1303771352965 HTTP/1.1
Host: shell.loopj.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0) Gecko/20100101 Firefox/4.0
Accept: */*
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Proxy-Connection: keep-alive
Cookie: __utma=71995406.317557806.1303476969.1303642425.1303757215.5; __utmz=71995406.1303476969.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utmc=71995406
```
if I directly display the content of the link [http://shell.loopj.com/tokeninput/tvshows.php](http://shell.loopj.com/tokeninput/tvshows.php) ,,, I get the flowing result :
```
[{"id":"978","name":"cha$e"},{"id":"1530","name":"The Life and Times of Tim"},{"id":"1210","name":"Kenny vs. Spenny"},{"id":"1393","name":"Sex and the City"},{"id":"1394","name":"Shark"},{"id":"1395","name":"Shaun the Sheep"},{"id":"1398","name":"Side Order of Life"},{"id":"1397","name":"Shear Genius"},{"id":"1396","name":"Seinfeld"},{"id":"1399","name":"Sinchronicity"}]
```
However ,,, using firebug the shown response is a little different :
```
jQuery151008570635266447713_1303770077699([{"id":"978","name":"cha$e"},{"id":"1530","name":"The Life and Times of Tim"},{"id":"1706","name":"The Peter Serafinowicz Show"},{"id":"1389","name":"Sea Patrol"},{"id":"1390","name":"Secrets of a Small Town"},{"id":"1211","name":"Kitchen Nightmares"},{"id":"1212","name":"L.A.P.D.: Lekanopedio Attikis Police Department"},{"id":"1214","name":"Lab Rats (2008)"},{"id":"1215","name":"La Femme Nikita"},{"id":"1216","name":"L.A. Ink"}])
```
notice that the response includes the extra "callback" and "_" parameters that was provided in the request ,,,
I really don't know where those came from but something strange is happening
---
can anyone please help me find the solution to this problem ?
Note : I tried to do it using POST but still it didn't work.
Also I tried to use the complete url : [http://localhost:500/AjaxAPI/Major/GetMajors](http://localhost:500/AjaxAPI/Major/GetMajors) instead of just /AjaxAPI/Major/GetMajors ,,, same thing.
|
problems getting the jquery tokeniput plugin to work with asp.net mvc 3
|
CC BY-SA 3.0
| 0 |
2011-04-26T00:46:41.503
|
2011-04-26T09:39:35.017
|
2011-04-26T01:34:38.903
| 385,172 | 385,172 |
[
"javascript",
"json",
"asp.net-mvc-3",
"jquery-plugins",
"tokenize"
] |
5,785,086 | 1 | 5,785,344 | null | 4 | 5,567 |
In Window Form ListView, I add columns dynamically, but I got an extra column. How to remove it? Which property can it be set?
Please check my attached screenshot below

I added totally 5 columns. After "Approval Name" column, it's an extra one.
|
How to remove extra Column in List View
|
CC BY-SA 3.0
| 0 |
2011-04-26T01:51:19.750
|
2011-08-22T19:58:01.183
|
2011-04-26T02:37:03.110
| 305,732 | 305,732 |
[
"vb.net",
"listview",
"visual-studio-2005",
"window"
] |
5,785,151 | 1 | 5,879,164 | null | 0 | 457 |
According to [this question from 2008](https://stackoverflow.com/questions/205431/rounded-corners-on-uiimage#205643), using quartz masks can cause crashes! Is that still the case?
Basically, what I want to do is to draw dice of different colors on a fixed background, using one png for each die shape (there are a lot of them), and somehow add the colors in code.
EDIT: to clarify, for example I want to use one png file to make all of the following:

Basically, I want to multiply the red, green, and blue components of my image by three independent constants, while leaving the alpha unchanged.
|
quartz masks in iOS -- do they still cause crashes?
|
CC BY-SA 3.0
| 0 |
2011-04-26T02:01:35.810
|
2013-08-07T13:51:32.603
|
2017-05-23T12:13:29.270
| -1 | 246,568 |
[
"iphone",
"ios",
"quartz-graphics",
"mask",
"masking"
] |
5,785,205 | 1 | 5,785,216 | null | 1 | 1,249 |
I want to combine two forms as in the image i have attached.I am able to do the two forms (login form and application form seperately)right now I am not able to make application form to appear in the background of the login form.this is my screen i what.there is any command specific to make the two form combine as in the screen.Please help me.Thanks in advance
|
c#-combining two forms
|
CC BY-SA 3.0
| 0 |
2011-04-26T02:11:41.167
|
2011-04-26T02:47:36.493
| null | null | 366,916 |
[
"c#"
] |
5,785,280 | 1 | 6,039,628 | null | 2 | 605 |
Using MVC3 I am trying to come up with method of checking the database to see if a user is allowed access to a folder. The administrator has individual control over each user's permission to courses, so I cannot control this from web.config.
The screenshot below provides an example of what I am trying to accomplish: is an example of one of many folders that only certain users will be allowed access to. My thinking is that I could use a CourseController action like `OpenCourse(int id)` to check against the db if a user has access to a course, and if so then "allow access" to the entire course folder and open the file contained within it. The user's permission to each file within folder would probably need to persist for the user's session.

Is it even possible to do something like this from within the MVC View folder, or should the folder sit somewhere else?
|
Dynamic user permission to secure folders in MVC3
|
CC BY-SA 3.0
| null |
2011-04-26T02:25:30.000
|
2011-05-18T03:44:46.503
|
2011-04-27T04:11:33.090
| 285,714 | 285,714 |
[
"asp.net-mvc-3",
"c#-4.0"
] |
5,785,349 | 1 | 5,785,491 | null | 0 | 466 |
This works: `@Html.ValidationMessage("Name")`
Is it possible to get strongly typed helper working?: `@Html.ValidationMessageFor(model => model.EventInVM.Name)`

ViewModel:
```
public class EventViewModel
{
public Event EventInVM { get; set; }
public IList<Series> ListOfSeries { get; set; }
}
```
Controller:
```
[HttpPost]
public ActionResult Create(EventViewModel eventViewModel)
{
if (!ModelState.IsValid)
{
SetupDropDownsStronglyTyped(eventViewModel);
return View(eventViewModel);
}
uow.Add(eventViewModel.EventInVM);
uow.SaveChanges();
return RedirectToAction("Index");
}
```
View
```
<h2>Create</h2>
@using (Html.BeginForm()) {
@Html.ValidationSummary(false)
<fieldset>
<legend>Event</legend>
@Html.Partial("_CreateOrEdit", Model)
<p>
<input type="submit" value="Create" />
</p>
</fieldset>
}
```
Partial
```
@model dave.Controllers.EventViewModel
<div class="editor-label">
@Html.LabelFor(model => model.EventInVM.Name)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.EventInVM.Name)
@Html.ValidationMessageFor(model => model.EventInVM.Name)
</div>
```
|
Is it possible to have a strongly typed validation message in a ViewModel?
|
CC BY-SA 3.0
| 0 |
2011-04-26T02:41:20.720
|
2011-04-30T04:46:47.080
|
2011-04-30T04:46:47.080
| 26,086 | 26,086 |
[
"asp.net-mvc-3"
] |
5,785,413 | 1 | null | null | 0 | 1,212 |
I want to add navigation bar at the top side of my web site like in new twitter design.
How can I add it? (please see example below...)

|
How to create transparent navigation bar like in new twitter?
|
CC BY-SA 3.0
| 0 |
2011-04-25T19:35:31.403
|
2011-04-26T02:54:25.670
| null | null | 733,243 |
[
"navigation"
] |
5,785,443 | 1 | null | null | 0 | 616 |
The javascript function I am using seems to not respond or I have incorrect syntax somewhere. The Parse_URL function I use is from [http://phpjs.org/functions/parse_url:485](http://phpjs.org/functions/parse_url:485).
What I want to be able to do is; from the currently open tab ; take the URL, parse it and then pass that url along to a script on another server( in a new tab)
I managed to get it to open a new tab..
but every method i try to parse the URL comes up short..
Here is my current code:
```
CheckWhois = {
1: function () {
//parse this URI
function parse_url (str, component) {
// http://kevin.vanzonneveld.net
// + original by: Steven Levithan (http://blog.stevenlevithan.com)
// + reimplemented by: Brett Zamir (http://brett-zamir.me)
// + input by: Lorenzo Pisani
// + input by: Tony
// + improved by: Brett Zamir (http://brett-zamir.me)
// % note: Based on http://stevenlevithan.com/demo/parseuri/js/assets/parseuri.js
// % note: blog post at http://blog.stevenlevithan.com/archives/parseuri
// % note: demo at http://stevenlevithan.com/demo/parseuri/js/assets/parseuri.js
// % note: Does not replace invalid characters with '_' as in PHP, nor does it return false with
// % note: a seriously malformed URL.
// % note: Besides function name, is essentially the same as parseUri as well as our allowing
// % note: an extra slash after the scheme/protocol (to allow file:/// as in PHP)
// * example 1: parse_url('http://username:password@hostname/path?arg=value#anchor');
// * returns 1: {scheme: 'http', host: 'hostname', user: 'username', pass: 'password', path: '/path', query: 'arg=value', fragment: 'anchor'}
var key = ['source', 'scheme', 'authority', 'userInfo', 'user', 'pass', 'host', 'port',
'relative', 'path', 'directory', 'file', 'query', 'fragment'],
ini = (this.php_js && this.php_js.ini) || {},
mode = (ini['phpjs.parse_url.mode'] &&
ini['phpjs.parse_url.mode'].local_value) || 'php',
parser = {
php: /^(?:([^:\/?#]+):)?(?:\/\/()(?:(?:()(?:([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?()(?:(()(?:(?:[^?#\/]*\/)*)()(?:[^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,
strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,
loose: /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/\/?)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/ // Added one optional slash to post-scheme to catch file:/// (should restrict this)
};
var m = parser[mode].exec(str),
uri = {},
i = 14;
while (i--) {
if (m[i]) {
uri[key[i]] = m[i];
}
}
if (component) {
return uri[component.replace('PHP_URL_', '').toLowerCase()];
}
if (mode !== 'php') {
var name = (ini['phpjs.parse_url.queryKey'] &&
ini['phpjs.parse_url.queryKey'].local_value) || 'queryKey';
parser = /(?:^|&)([^&=]*)=?([^&]*)/g;
uri[name] = {};
uri[key[12]].replace(parser, function ($0, $1, $2) {
if ($1) {uri[name][$1] = $2;}
});
}
delete uri.source;
return uri;
}
var URI = currentBrowser.currentURI.spec;
//unsure if this will work
var tab = document.getElementById("content").addTab("tools.whois.com.au/whois/?domain=" . parse_url("test.com", 'host'));
document.getElementById("content").selectedTab = tab;
document.getElementById("urlbar").focus();
},
}
```
I am not used to javascript and this is definitely a Noob Question :)
Any help would be greatly appreciated :)
|
XUL open new tab with parsed URI from currently open tab
|
CC BY-SA 3.0
| null |
2011-04-26T03:00:14.670
|
2011-05-07T17:16:12.113
| null | null | 724,666 |
[
"javascript",
"parsing",
"url",
"xul"
] |
5,785,465 | 1 | 5,785,743 | null | 0 | 666 |
I have a menu and when the user hovers the menu, the submenu appears. Only, the submenu disappears when you're not hovering the text.
Let me try to make it clear using images.
 leads to this

 leads to this

And to make it even more complicate, it only happens in Safari en Chrome (the webkit engine I guess) and it doesn't do this all the time :)
I'm guessing it's a css problem, but anyone know where to look?
(Oh, and it's a Drupal website, so I don't know it this plays along...)
This is how the HTML looks like:

|
Hover problem on Drupal menu
|
CC BY-SA 3.0
| 0 |
2011-04-26T03:05:32.500
|
2011-04-26T06:40:56.933
|
2011-04-26T06:40:56.933
| 452,421 | 452,421 |
[
"html",
"css",
"drupal",
"menu"
] |
5,785,468 | 1 | 5,908,158 | null | 1 | 950 |
In Photoshop there is a tool that lets you adjust the levels of an image. I'd like to be able to do the same thing. I've seen examples online that show the levels but they are for each individual color channel (red, green, blue or alpha or CMYK) but not a combined view like in Photoshop Input Levels (see below).
Also, as a bonus is there a way to find the best shadow and highlight input level settings, basically the settings the Auto level button determines?

I think I'm closer but I'm not sure. Here is the method I pieced together. The first image is my results and the second is Photoshop results both analyzing the Google logo:
Ok I think I got it. The code is below. It's mostly working all the time, mostly.
Additional credits:
[https://pixelero.wordpress.com/2008/06/19/flash-10-bitmapdatahistogram/#comment-448](https://pixelero.wordpress.com/2008/06/19/flash-10-bitmapdatahistogram/#comment-448)
My results:

Photoshops results:

Levels method:
```
/**
* Get a histogram of the grayscale levels
* */
private function drawGrayscaleHistogram(bitmapImage:BitmapImage, sprite:Sprite):BitmapData {
var grayScale:Array = [0.3086, 0.3086, 0.3086, 0, 0, 0.3086, 0.3086, 0.3086, 0, 0, 0.3086, 0.3086, 0.3086, 0, 0, 0, 0, 0, 1, 0];
var color:Array = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
var filter:ColorMatrixFilter = new ColorMatrixFilter(grayScale);
var histogram:Vector.<Vector.<Number>>;
var graphWidth:int = sprite.width;
var graphHeight:int = sprite.height;
var g:Graphics = sprite.graphics;
var vector:Vector.<Number>;
var bitmapData:BitmapData;
var maxValue:int;
var value:int;
var i:int;
// clone the bitmap
bitmapData = bitmapImage.bitmapData.clone();
// convert it to gray scale
bitmapData.applyFilter(bitmapImage.bitmapData, bitmapImage.bitmapData.rect, new Point(), filter);
// get histogram
histogram = bitmapData.histogram();
// since it's grayscale the red green and blue are all the same
vector = histogram[0];
// get the max value for drawing the graph
for (var s:* in vector) {
if (vector[s]>maxValue) {
maxValue = vector[s];
}
}
//trace(maxValue);
//maxValue = 300;
// create white background
g.clear();
g.beginFill(0xFFFFFF, 1.0);
g.drawRect(0, 0, graphWidth, graphHeight);
// draw each line
for each (value in vector) {
g.lineStyle(1, 0);
g.moveTo(i, graphHeight);
g.lineTo(i++, Math.max(0.0, graphHeight-value * graphHeight/maxValue));
}
// assign it to bitmap data
// so we can resize easily if we want
bitmapData = new BitmapData(graphWidth, graphHeight, true, 0x00000000);
bitmapData.draw(sprite);
return bitmapData;
}
```
Usage:
levelsBitmapImage.source = drawGrayscaleHistogram(selectedPicture, sprite1);
<s:BitmapImage id="selectedPicture" width="100%" height="100%"
scaleMode="letterbox"/>
<mx:UIComponent id="sprite1"/>
<s:BitmapImage id="thresholdGraph" width="100%" height="45"/>
|
How to get and display the levels on color or bw bitmap image
|
CC BY-SA 3.0
| 0 |
2011-04-26T03:06:10.273
|
2011-05-06T07:30:59.633
|
2011-05-06T06:52:32.593
| 441,016 | 441,016 |
[
"flash",
"actionscript-3",
"flex4"
] |
5,785,578 | 1 | 5,785,638 | null | 1 | 311 |
When hovering an image, users can see some additional information about the image. Before it was transparent, but now I don't want it make it transparent. So I deleted the `opacity` line in my css. But then the block got a whole new look...


```
#uicarousel-news-preview-block-1 .ui-carousel-item .views-field-title,
#uicarousel-news-preview-block-2 .ui-carousel-item .views-field-title {
height:35px;
margin-top:-46px;
background-color:green;
padding-left : 30px;
padding-right : 30px;
opacity : 0.6;
/*IE opacity*/
filter:alpha(opacity=60);
color: white;
display: none;
}
```
Is there something wrong with the CSS, or what do I have to do to make sure there is no opacity and the `div`is still in front of the image?
This is the HTML. It's a Drupal website and the green bar is the `views-field-title`

|
Opacity problem
|
CC BY-SA 3.0
| null |
2011-04-26T03:26:59.840
|
2011-04-26T03:38:56.380
|
2011-04-26T03:38:11.713
| 452,421 | 452,421 |
[
"css",
"transparency",
"opacity"
] |
5,785,628 | 1 | null | null | 0 | 717 |
I am getting an error when I use SimpleDateFormatter.parse() function. I am making user enter the date and time through DatePicker and TimePicker respectively and I am collecting the information from both the pickers and trying to create a Date object do that I could compare it to another date object (System Date).
But when I am trying to parse the date to form a date format I am getting the error.

The chunk of code causing the error is
```
btn.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
int day = dpicker.getDayOfMonth();
int month = dpicker.getMonth() + 1;
if (month < 10)
{
monthS = "0" + month;
}
else
{
monthS = String.valueOf(month);
}
int year = dpicker.getYear();
int minutes = tpicker.getCurrentMinute();
int hours = tpicker.getCurrentHour();
if (hours < 10)
{
hoursS = "0" + hours;
}
else
{
hoursS = String.valueOf(hours);
}
date = year + "-" + monthS + "-" + day + " " + hoursS + ":" + minutes ;
tview.setText("Date and Time are" + date) ;
}
});
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:MM");
try {
newDate = sdf.parse(date);
} catch (java.text.ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
tview2.setText(newDate.toString());
```
I would appreciate any help on this error.
Thanks,
Sid
|
Simple Date Formatter parse function error
|
CC BY-SA 3.0
| null |
2011-04-26T03:36:51.120
|
2011-04-26T04:06:26.527
| null | null | 2,288,136 |
[
"android",
"simpledateformat"
] |
5,786,221 | 1 | 5,786,232 | null | 2 | 2,645 |
What are NULL values ?

Sometimes when I try to assign a query to variable, I get error saying Type-Cast-Error.
```
txtMiddleName.Text = Reader.GetString(2)
```
How can I put it that if the value of the Middle is nothing then
`txtMiddleName.Text = ""`
(I already read the other post "Handling NULL Values in SQLite but couldn't figure out much")
Working on VS 2010 (VB.net)
:
This is the error Message I get

(Line 364 is the above mentioned code)
|
What are NULL values and how can I handle them in SQLite
|
CC BY-SA 3.0
| 0 |
2011-04-26T05:12:54.317
|
2012-10-20T06:14:39.890
|
2011-04-26T05:25:13.703
| 722,000 | 722,000 |
[
"vb.net",
"winforms",
"sqlite",
"null"
] |
5,786,312 | 1 | null | null | 3 | 892 |
When I try to use the GWT dev mode plugin for ie 8 on Windows Vista I continually see the prompt to install the plugin. 
After running the plugin I still always see this page. Does anybody know of how to troubleshoot something like this?
|
Troublshooting guide for GWT plugin
|
CC BY-SA 3.0
| null |
2011-04-26T05:27:25.820
|
2012-09-21T15:49:11.270
| null | null | 97,901 |
[
"gwt",
"dev-mode"
] |
5,786,420 | 1 | 5,786,710 | null | 1 | 1,855 |
I am quite new to ggplot2, so forgive me if this post is too stupid.
I used the following code to plot the data, but I am not able to get the style that I need for publication.
In the output, I need:
1. a legend. In my data case, there is nothing after opts(legend.position="top") I have no idea why. And I also would like to split the legend into 3 columns like columns=3 in auto.key of lattice
2. Colorize the bars using grey system (eg, fill=c("white","grey20","grey70"))according to factor pl, but it seems that I cannot change the style with scale_colour_manual
3. turn around the labels on the x-axis into horizontal.
4. maybe a y-axis? But,do you think it is necessary?
BTW, I have no idea how to prepare a figure for publication, so, any suggestion is very welcome!
```
library(ggplot2)
wt<-gl(3,4,108,labels=c("W30","W60","W90"))
pl<-gl(3,12,108,labels=c("P0","P1","P2"))
gp<-gl(3,36,108,labels=c("A","B","C"))
dat<-cbind(A=runif(108),B=runif(108,min=1,max=10),C=runif(108,min=100,max=200),D=runif(108,min=1000,max=1500))
dat.df<-data.frame(wt,pl,gp,dat)
dat.m<-melt(dat.df)
ggplot(dat.m,aes(x=wt,y=value,group=pl,facet=gp,fill=pl))+
stat_summary(fun.y=mean,geom="bar",size=2,position="dodge")+
stat_summary(fun.ymin=function(x)(mean(x)-sd(x)/sqrt(length(x))),geom="errorbar",
fun.ymax=function(x)(mean(x)+sd(x)/sqrt(length(x))),position="dodge")+
facet_grid(variable~facet,scale="free_y")+ opts(legend.position="top")+
scale_colour_manual(values = c("red", "blue", "green"))
```

|
Custom ggplot output (colour, appearence, etc)
|
CC BY-SA 3.0
| 0 |
2011-04-26T05:43:59.397
|
2011-04-26T07:15:57.790
|
2011-04-26T07:15:57.790
| 548,334 | 548,334 |
[
"r",
"colors",
"ggplot2",
"legend"
] |
5,786,504 | 1 | 5,786,578 | null | 6 | 9,210 |
I want to dock the button always to the bottom of screen. I am have changed the android:gravity="bottom" to bottom.
I am confused with android:gravity and layout gravity.Well , my question is how can i dock the buttons to the bottom ?
```
<Spinner android:id="@+id/alphabets" android:layout_height="wrap_content"
android:layout_width="match_parent">
</Spinner>
<TextView android:layout_width="wrap_content" android:text="TextView"
android:layout_height="wrap_content" android:id="@+id/textView1"
android:editable="false" android:textSize="50sp" android:gravity="center_horizontal"
android:layout_gravity="center_horizontal">
</TextView>
<RelativeLayout android:id="@+id/relativeLayout1"
android:layout_height="wrap_content" android:gravity="bottom"
android:layout_width="fill_parent" android:layout_gravity="fill">
<ImageButton android:layout_width="wrap_content"
android:id="@+id/imageButton1"
android:src="@drawable/arrow_button_left"
android:layout_height="wrap_content" />
<ImageButton android:layout_width="wrap_content"
android:id="@+id/imageButton2"
android:src="@drawable/arrow_button_right"
android:layout_height="wrap_content"
android:layout_alignParentRight="true" />
</RelativeLayout>
</LinearLayout>
```

|
How to dock the relative layout to the botton of the screen
|
CC BY-SA 3.0
| null |
2011-04-26T05:55:12.353
|
2012-04-02T16:21:34.283
| null | null | 389,288 |
[
"android",
"android-widget"
] |
5,786,602 | 1 | 5,786,692 | null | 1 | 15,390 |
I wanted to ask whether there's a control like a big grid calendar that we can use to manage all the appointments. Like in our cell phone we have calendar and we can save reminders, birthdays, etc. I'm looking for same thing but for the desktop & its size should be at least 600x400. 
When the users clicks an individual date the details should be shown.
Is there any control like that available?
|
C# Calendar Grid (Appointment Control)
|
CC BY-SA 3.0
| 0 |
2011-04-26T06:06:51.803
|
2013-06-24T20:16:43.437
|
2013-06-24T20:16:43.437
| 634,824 | 466,594 |
[
"c#",
"winforms",
"calendar",
"controls"
] |
5,786,573 | 1 | 5,788,748 | null | 8 | 745 |
I'm writing a Python program to generate the Luna Free State flag from the famous Heinlein novel [The Moon is a Harsh Mistress](http://en.wikipedia.org/wiki/The_Moon_Is_a_Harsh_Mistress), as a personal project. I've been cribbing heraldry rules and matching mathematical formulas off the web, but something is clearly wrong in my `bendsinister` routine, since the assertion fails when uncommented. The area of the bend sinister should be 1/3 the total area of the flag, and it isn't. The only really dodgy thing I've done is to guess at the formula for the height of the trapezoid, but I guess the errors could be anywhere. I've trimmed out most of the code, leaving only what's necessary to show the problem. Hopefully someone less mathematically-challenged can spot the error!
```
#!/usr/bin/python
'generate bend sinister according to rules of heraldry'
import sys, os, random, math, Image, ImageDraw
FLAG = Image.new('RGB', (900, 600), 'black')
CANVAS = ImageDraw.Draw(FLAG)
DEBUGGING = True
def bendsinister(image = FLAG, draw = CANVAS):
'''a bend sinister covers 1/3 of the field, sinister chief to dexter base
(some sources on the web say 1/5 of the field, but we'll use 1/3)
the "field" in this case being the area of the flag, so we need to
find a trapezoid which is 1/6 the total area (width * height).
we need to return only the width of the diagonal, which is double
the height of the calculated trapezoid
'''
x, y = image.size
b = math.sqrt((x ** 2) + (y ** 2))
A = float(x * y)
debug('%d * %d = %d' % (x, y, A))
H = triangle_height(A / 2, b) # height of triangular half of flag
width = trapezoid_height(b, H, A / 6) * 2
if command == 'bendsinister':
show_bendsinister(x, y, width, image, draw)
return width
def show_bendsinister(x, y, width, image = FLAG, draw = CANVAS):
'for debugging formula'
dexter_base, sinister_chief = (0, y), (x, 0)
draw.line((dexter_base, sinister_chief), 'blue', int(width))
image.show()
debug(image.getcolors(2)) # should be twice as many black pixels as blue
def triangle_height(a, b):
'a=bh/2'
h = float(a) / (float(b) / 2)
debug('triangle height: %.2f' % h)
return h
def trapezoid_height(b, H, a):
'''calculate trapezoid height (h) given the area (a) of the trapezoid and
base b, the longer base, when it is known that the trapezoid is a section
of a triangle of height H, such that the top, t, equals b when h=0 and
t=0 when h=H. h is therefore inversely proportional to t with the formula
t=(1-(h/H))*b, found simply by looking for what fit the two extremes.
the area of a trapezoid is simply the height times the average length of
the two bases, b and t, i.e.: a=h*((b+t)/2). the formula reduces
then to (2*a)/b=(2*h)+(h**2)/H, which is the quadratic equation
(1/H)*(h**2)+(2*h)-((2*a)/b)=0; solve for h using the quadratic formula
'''
try:
h = (-2 + math.sqrt(4 - 4 * (1.0 / H) * -((2 * a) / b))) / (2 * (1.0 / H))
debug('trapezoid height with plus: %.2f' % h)
except: # must be imaginary, so try minus instead
h = (-2 - math.sqrt(4 - 4 * (1.0 / H) * -((2 * a) / b))) / (2 * (1.0 / H))
debug('trapezoid height with minus: %.2f' % h)
t = (1 - (float(h) / H)) * b
debug('t=%d, a=%d, check=%d' % (t, round(a), round(h * ((b + t) / 2))))
#assert round(a) == round(h * ((b + t) / 2))
return h
def debug(message):
if DEBUGGING:
print >>sys.stderr, message
if __name__ == '__main__':
command = os.path.splitext(os.path.basename(sys.argv[0]))[0]
print eval(command)(*sys.argv[1:]) or ''
```
Here is the debugging output, showing I'm far off from the 1/3 area:
Here is an image of the output, with some added lines:

The red line divides the two triangles, either can be used for the calculation of the trapezoid. I'm using the one starting at the top left. The green line is the height of that triangle, the variable H in the program.
---
For the finished script and flag (using the correction supplied by Michael Anderson), see [http://unternet.net/tanstaafl/](http://unternet.net/tanstaafl/). Thanks all for the help!
|
bad math or bad programming, maybe both?
|
CC BY-SA 3.0
| 0 |
2011-04-26T06:03:28.367
|
2012-11-09T14:28:01.443
|
2012-11-09T14:28:01.443
| 100,297 | 493,161 |
[
"python",
"geometry",
"python-imaging-library"
] |
5,786,769 | 1 | 5,788,218 | null | 1 | 6,379 |
I have implemented GalleryView. I want to display a border image on selected image from Gallery.
```
Gallery ga = (Gallery)findViewById(R.id.Gallery01);
ga.setAdapter(new ImageAdapter(this));//, android.R.layout.simple_list_item_1, items));
imageView = (ImageView)findViewById(R.id.ImageView01);
ga.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapter, View view, int location,
long arg3) {
imageView.setImageResource(items.get(location));
final ImageView iv = (ImageView) adapter.getSelectedView();
iv.setBackgroundResource(R.drawable.large_button_sel_liner);
}
});
```
And my Adapter class
```
class ImageAdapter1 extends ArrayAdapter<Integer> {
private Context ctx;
private List<Integer> items;
public ImageAdapter1(Context context, int textViewResourceId,
List<Integer> objects) {
super(context, textViewResourceId, objects);
items = objects;
ctx = context;
}
@Override
public int getCount() {
return items.size();
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
final ImageView iv = new ImageView(ctx);
iv.setImageResource(items.get(position));
iv.setScaleType(ImageView.ScaleType.FIT_XY);
iv.setLayoutParams(new Gallery.LayoutParams(150,120));
return iv;
}
}!
```
It is totally mashed up.

|
Android Custom Gallery View, Set Own Border
|
CC BY-SA 3.0
| 0 |
2011-04-26T06:26:36.430
|
2011-10-30T13:13:54.380
|
2011-04-26T09:03:44.807
| 385,343 | 385,343 |
[
"android",
"set",
"gallery",
"border"
] |
5,787,088 | 1 | 5,787,647 | null | 0 | 10,139 |
I wanna launch the Contacts application from my application Activity. I am not able to understand how to do it.
```
Button contact = (Button) findViewById(R.id.contact);
contact.setOnClickListener(new View.OnClickListener() {
public void onClick(View arg0) {
Intent i4 = new Intent();
i4.setAction(Intent.ACTION_VIEW);
i4.addCategory(Intent.CATEGORY_DEFAULT);
i4.setType("vnd.android.cursor.dir/phone");
startActivity(i4);
}
});
```
Error:
> 
|
Android Launching Contacts Application
|
CC BY-SA 3.0
| 0 |
2011-04-26T07:08:38.547
|
2015-06-05T10:59:28.737
|
2015-01-22T04:53:01.780
| 996,493 | 155,196 |
[
"android",
"android-intent",
"contactscontract"
] |
5,787,248 | 1 | null | null | 0 | 314 |
I am trying to run the stream example given on [https://github.com/facebook/facebook-android-sdk](https://github.com/facebook/facebook-android-sdk). It successfully loads on the emulator. It shows Welcome to stream message along with fconnect button.

But when i click on fconnect button it goes to the home screen. Nothing happens.
What is the reason for such strange behavior i am unable to understand?
Please help me on this
Thanks,
Pankaj
|
Stream Example not working
|
CC BY-SA 3.0
| null |
2011-04-26T07:26:44.713
|
2011-06-21T21:52:33.203
| null | null | 146,192 |
[
"android",
"facebook"
] |
5,787,449 | 1 | 5,787,575 | null | 9 | 2,278 |
I created a button, and a have a little problem: When the my app launches, the button is selected. How do I disable this selection?
Example:

|
How do I stop my NSbutton from being selected when the app starts by default?
|
CC BY-SA 3.0
| 0 |
2011-04-26T07:50:34.650
|
2018-09-19T06:35:08.280
|
2016-08-22T21:20:52.123
| 453,435 | 724,134 |
[
"cocoa",
"macos",
"nsbutton"
] |
5,788,115 | 1 | 5,795,633 | null | 0 | 1,761 |
I have already OLE Embedded object Excel Chart. And, when I create this object, i have some problem in project, when I'm resizing window. Using Spy++ I see two process: Excel 7 and Excel 9. Excel 9 contain "trash" in right part, and when I resizing window I can see undefined behaviour.
On the following picture you can see a border, which I want to hide.

How I can hide this border, if I known handle of window?
|
Hide border of window, if i know a handle of this window
|
CC BY-SA 3.0
| null |
2011-04-26T08:58:43.540
|
2011-04-26T19:47:46.360
|
2011-04-26T19:24:21.523
| 168,986 | 490,908 |
[
"c++",
"winapi",
"com",
"ole"
] |
5,788,287 | 1 | 5,788,707 | null | 2 | 5,863 |
I have ItemType that implements everything one would need for Validation with the help of IDataErrorInfo interface:
```
#region IDataErrorInfo implementation
//WPF doesn't need this one
public string Error
{ get { return null; } }
public string this[string propertyName]
{
get { return GetValidationError(propertyName); }
}
#endregion
#region Validation
public bool IsValid
{
get
{
foreach (string property in ValidatedProperties)
{
if (GetValidationError(property) != null)
{
return false;
}
}
return true;
}
}
static readonly string[] ValidatedProperties =
{
"Name"
};
private string GetValidationError(string propertyName)
{
if (Array.IndexOf(ValidatedProperties, propertyName) < 0)
return null;
string error = null;
switch (propertyName)
{
case "Name":
error = ValidateName();
break;
default:
Debug.Fail("Unexpected property being validated on Customer: " + propertyName);
break;
}
return error;
}
string ValidateName()
{
if (!IsStringMissing(Name))
{
return "Name can not be empty!";
}
return null;
}
static bool IsStringMissing(string value)
{
return string.IsNullOrEmpty(value) ||
value.Trim() == String.Empty;
}
#endregion
```
ItemType is wrapped with ItemViewModel. On the ItemViewModel I have a command for when a user clicks the Save Button:
```
public ICommand SaveItemType
{
get
{
if (saveItemType == null)
{
saveItemType = new RelayCommand(() => Save());
}
return saveItemType;
}
}
```
Then, in the DetailsView, I have the following xaml code:
```
<TextBlock Text="Name:" />
<TextBox Grid.Column="1" Name="NameTextBox" Text="{Binding Name, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}"
Validation.ErrorTemplate="{x:Null}" />
<ContentPresenter Grid.Row="13" Grid.Column="2"
Content="{Binding ElementName=NameTextBox, Path=(Validation.Errors).CurrentItem}" />
```
the following architecture going on (it is not clear, but the form is actually an independent xaml file (User Control), where the datacontext of the grid in the form is set to the ObservableCollection):
```
<Grid DataContext="{Binding Items}">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
```

The problem that I am having is that error messages are not showing up. When I breakpoint and check if it validates correctly and if I have any error messages, then I do have them. But somehow the error message does not arrive in the xaml.
What is the missing piece of the puzzle?
Right, so, what it was was the following:
I implemented IDataErrorInfo on my model, but not on the ViewModel that wraps the model. What I had to do was as well was implement the IDataErrorInfo interface on the ViewModel, and get it from the model.
ViewModel Implementation of IDataErrorInfo:
```
{ get { return (ItemType as IDataErrorInfo).Error; } }
public string this[string propertyName]
{
get
{
return (ItemType as IDataErrorInfo)[propertyName];
}
}
```
|
IDataErrorInfo - not seeing any error message even though one gets picked up
|
CC BY-SA 3.0
| 0 |
2011-04-26T09:15:17.933
|
2013-12-09T22:54:44.047
|
2011-04-26T10:41:01.207
| 712,383 | 712,383 |
[
"wpf",
"mvvm",
"binding"
] |
5,788,319 | 1 | null | null | 1 | 1,077 |
I'm very new to the web development.
### Things that I have setup
```
* the Apache server
* DB on Eclipse
* one index.html file with Javascript
* one servlet
```
### Objectives
```
* get a credential information
* send via method of 'Javascript -> servlet' to find out user exist.
* from the Javascript method need to receive DB existence.
```
### Problem
```
* I used 'AJAX', looks to me all same as one of Javascript method that does do for asynchronous with HTML and server.
* from the index.html page, if I press wrong information (id, password) then yes it prompts the message.
```

-

- -
### doPost in Servlet
```
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
String name = request.getParameter("user_id");
String password = request.getParameter("passwd");
// search for query user existence
try
{
// TODO session, cookies
sharedConnection = dataSource.getConnection();
Statement stmt = sharedConnection.createStatement();
String str = "select * from customers where email ='" + name + "' and password='" + password + "' ";
ResultSet rs = stmt.executeQuery(str);
HttpSession session = request.getSession();
// not found
if (!rs.next())
{
PrintWriter out = response.getWriter();
out.println("<h3>credentials invalid</h3>");
}
// exist
else
{
String first_name = rs.getString("first_name");
String last_name = rs.getString("last_name");
session.setMaxInactiveInterval(1800); //set timeout to 30min
session.setAttribute("loggedin", true);
session.setAttribute("name", (first_name+ ", " + last_name));
response.sendRedirect("/MovieDB/main.html");
}
}
catch(SQLException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
```
### HTML with AJAX Script
```
<script type="text/javascript">
function loadXMLDoc()
{
var xmlhttp;
var user_id = document.getElementById('user_id').value;
var passwd = document.getElementById('passwd').value;
<!-- newer browser -->
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
}
<!-- IE 5, 6 -->
else
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4)
{
if (xmlhttp.status==200)
document.getElementById("state_msg").innerHTML=xmlhttp.responseText;
}
}
<!-- access servlet with parameters -->
xmlhttp.open("POST", ("LoginServlet?user_id=" + user_id +"&passwd=" + passwd) , true);
xmlhttp.send();
<!-- If Servlet don't detour main.html then we must assume error -->
var err = document.getElementById("state_msg");
err.style.display = "block";
}
</script>
<title>MovieDB : WebAuth</title>
</head>
<body>
<h1>FabFlix WebAuth</h1>
<!-- label user id -->
<div id=input_info>
<label for="user_id">User :</label>
</div>
<!-- user id -->
<input type="text" id="user_id" name="user_id" />
<p></p>
<!-- password label -->
<div id=input_info>
<label for="passwd">Password :</label>
</div>
<!-- password -->
<input type="password" id="passwd" name="passwd" />
<!-- submit button -->
<p></p>
<div id="button_position" align="center">
<button type="button" onclick="loadXMLDoc()">Login</button>
</div>
<div id="state_msg" style="display:none"></div>
</body>
```
|
Manipulate Login progress from Servlet -> JavaScript
|
CC BY-SA 3.0
| null |
2011-04-26T09:18:38.833
|
2011-04-26T10:06:31.250
| null | null | 319,381 |
[
"java",
"ajax",
"servlets"
] |
5,788,582 | 1 | 5,789,178 | null | 0 | 323 |
hi people i had drawn a piechart using coreplots in my application,now i need to split a piechart into different pieces/objects and need to drag those objects.How to achieve this functionality.Thanks in Adv
|
how to drag a wedge from pie chart which is developed using coreplot in iphone
|
CC BY-SA 3.0
| null |
2011-04-26T09:46:13.180
|
2011-04-26T10:46:36.630
| null | null | 520,998 |
[
"iphone",
"ipad",
"core-plot",
"pie-chart"
] |
5,788,586 | 1 | 5,789,071 | null | 8 | 109,749 |
I have two tables. Task and Categories.


TaskID is not a primary key as there are duplicate values.When there are multiple contacts are selected for a specific task,taskid and other details will be duplicated.I wrote the query:
```
SELECT Priority, Subject, Status, DueDate, Completed, Category
FROM Task, Categories
WHERE Categories.CategoryID=Task.CategoryID;
```

Now as multiple contacts are selected for that task,for the taskid=T4, there are two records(highlighted with gray). I have tried using distinct in ms access 2003 but its not working. I want to display distinct records. (Here there's no requirement to show taskid) If I write :
```
select priority, distinct(subject), .......
```
and remaining same as mentioned in above query then its giving me an error. I have tried distinctrow also.But didnt get success. How to get distinct values in ms access?
|
how to use distinct in ms access
|
CC BY-SA 3.0
| 0 |
2011-04-26T09:46:25.690
|
2014-04-23T06:43:54.280
|
2011-04-26T10:02:13.667
| 646,023 | 646,023 |
[
"sql",
"ms-access",
"distinct",
"ms-access-2003"
] |
5,788,842 | 1 | 5,789,951 | null | 12 | 3,429 |
I am using `RegionPlot3D` in Mathematica to visualise some inequalities. As the inequalities are homogeneous in the coordinates they are uniquely determined by their intersection with the unit sphere. This gives some two-dimensional regions which I would like to plot. My question is
If requested I would be more than happy to provide some Mathematica code; although I believe that the answer should be independent on the details of the regions I'm trying to plot.
Thanks in advance!
: In case anyone is interested, I have recently finished a paper in which I used Sasha's answer below in order to make some plots. The paper is [Symmetric M-theory backgrounds](http://arxiv.org/abs/1112.4967) and was arXived last week. It contains plots such as this one:

Thanks again!
|
Mathematica RegionPlot on the surface of the unit sphere?
|
CC BY-SA 3.0
| 0 |
2011-04-26T10:12:08.367
|
2012-06-29T03:43:19.873
|
2011-12-28T07:44:30.883
| 403,757 | 403,757 |
[
"wolfram-mathematica",
"plot"
] |
5,789,014 | 1 | 5,789,381 | null | 0 | 3,802 |
I want a Button DropDown just like facebook Dropdown Button... using javascript, Jquery ...
Is there any demo or reference website for this ...?
Like below:


|
How to create a Button Dropdown ... like facebook
|
CC BY-SA 3.0
| null |
2011-04-26T10:30:09.433
|
2011-08-27T17:28:10.867
| null | null | 659,952 |
[
"facebook",
"button",
"drop-down-menu"
] |
5,789,232 | 1 | 5,789,270 | null | 7 | 4,254 |
Everything seemed so plain and simple until I had to actually program it.
I uploaded an image to explain it better.
- I have a circle and I know - - -
I want to be able, when I rotate the gray circle image, with 10 degrees, to calculate red buttons new coordinates (x1y1, x2y2).
This shouldn't be hard to achieve for someone who knows math, but I didn't manage to find a suitable solution. I've also searched around here and couldn't find a working solution. Any help is greatly appreciated.
Thank you

The working solution, as Felice stated below is:
-first take care of rotation angle, on each redraw simply increment it
```
angle = angle+mainRotationAngle;
float x = (float) (center.X + Math.cos(angle*Math.PI / 180F) * radius
float y = (float) (center.Y + Math.sin(angle*Math.PI / 180F) * radius
button.setX(x);
button.setY(y);
```
|
Find point on Circle on Android
|
CC BY-SA 3.0
| 0 |
2011-04-26T10:51:47.717
|
2011-04-26T12:38:25.593
|
2011-04-26T12:38:25.593
| 379,865 | 379,865 |
[
"android",
"graphics",
"geometry",
"point"
] |
5,789,239 | 1 | null | null | 57 | 21,689 |
I'm trying to find the best way to calculate the biggest (in area) rectangle which can be contained inside a rotated rectangle.
Some pictures should help (I hope) in visualizing what I mean:



The width and height of the input rectangle is given and so is the angle to rotate it. The output rectangle is not rotated or skewed.
I'm going down the longwinded route which I'm not even sure if it will handle the corner cases (no pun intended). I'm certain there is an elegant solution to this. Any tips?
: The output rectangle points don't necessarily have to touch the input rectangles edges. (Thanks to Mr E)
|
Calculate largest inscribed rectangle in a rotated rectangle
|
CC BY-SA 4.0
| 0 |
2011-04-26T10:52:28.480
|
2022-04-01T22:34:14.820
|
2022-04-01T22:34:14.820
| 2,602,877 | 300,204 |
[
"algorithm",
"math",
"language-agnostic",
"geometry"
] |
5,789,415 | 1 | 6,177,984 | null | 2 | 127 |
i got this error when i publish website in remote location , its accrues while using pages
which contain
- autocomplete user control
- export report to pdf , show report in report viewer

|
What is this error refer to , and how to fix it?
|
CC BY-SA 3.0
| null |
2011-04-26T11:09:18.633
|
2011-05-30T15:12:14.217
| null | null | 342,511 |
[
"asp.net",
"xml",
"publishing"
] |
5,789,504 | 1 | null | null | 4 | 2,559 |
I was using (standard) for PHP Development for some times before I read some posts about built-in Apache/PHP on . I decided to shift to those I am provided with but seems to have many problems.
The first thing is when I was using MAMP, I upgraded PEAR from 1.9.0 to 1.9.1 (to install PHPUnit later) with reference from [this post](https://serverfault.com/questions/184741/upgrading-pear-from-1-9-0-to-1-9-1-fails). It worked well for me with the `phpunit` command. I also have Xcode4 but removed it few weeks ago (I mention this because I don't know what could be the cause for all my troubles).
Then, when I try to use default Apache and PHP on Snow Leopard, I realise that there're likely two versions of PHP on my Mac.
The first one is 5.3.3 when I try to revoke `php -i` command:
```
PHP 5.3.3 (cli) (built: Aug 22 2010 19:41:55)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans
```
The second one is 5.3.4, that actually shows up when I ran a file with `phpinfo()` or invoke this `php-config --version` command. Please see the screenshot below:

=========================================================================
Another problem for me is installing using . What you can see from `php -i` command above is a pre-compiled xdebug.so from Komodo (I read [this post](http://www.newmediacampaigns.com/page/install-pear-phpunit-xdebug-on-macosx-snow-leopard)), not what was installed by PECL as each time I try to install xdebug, these errors appear:
```
ngocminh@MBP[447]:~$ cd /usr/local/pear/bin/
ngocminh@MBP[448]:bin$ sudo ./pecl install xdebug
downloading xdebug-2.1.1.tgz ...
Starting to download xdebug-2.1.1.tgz (303,198 bytes)
..............................................................done: 303,198 bytes
66 source files, building
running: phpize
grep: /usr/include/php/main/php.h: No such file or directory
grep: /usr/include/php/Zend/zend_modules.h: No such file or directory
grep: /usr/include/php/Zend/zend_extensions.h: No such file or directory
Configuring for:
PHP Api Version:
Zend Module Api No:
Zend Extension Api No:
Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.
ERROR: `phpize' failed
```
Have no idea about these mess after a whole day surfing the Internet for them. Please help me figure it out. Please do not hesitate asking me for more details if you want. Thank you!!!
`which php`
```
ngocminh@MBP[449]:bin$ which php
/usr/bin/php
```
|
Two versions of PHP on Mac OS Snow Leopard & Installing xdebug using PECL
|
CC BY-SA 3.0
| 0 |
2011-04-26T11:17:08.837
|
2011-05-03T00:21:42.733
|
2017-04-13T12:13:41.637
| -1 | 514,015 |
[
"php",
"osx-snow-leopard",
"xdebug",
"mamp",
"pecl"
] |
5,789,525 | 1 | 5,813,320 | null | 3 | 925 |
Ok, my case is like this.
First off, the thing I doing is taking the contact name via the address book, and display the name, the name might contain english, non-english (chinese, japanese or etc.), symbol and so on. The problem I facing now is the non-english character do not group according to the group, which let said suppose the 'X' is fall under group 'G', but it display in the next group. Like below, that chinese word should fall under group 'G'.

I have saw one condition in the code is when it is not within the A - Z, it will group them in the '#' group. The code is not written by me, I currently doing a bug fixing thingy. Then this index thing is fully customize by hand, so ...
Is there any way to know whether the character is symbol, or a non-english character?! Or is there a way we can get the contact from the address book by group???
Below code is the part that check the character where it suppose to group.
```
name = [name stringByTrimmingCharactersInSet:[NSCharacterSet punctuationCharacterSet]];
selectCharacter = [[name uppercaseString] characterAtIndex:0];
if( (selectCharacter > 'Z') || (selectCharacter < 'A')){
selectCharacter = '#';
}
if( currentCharacter != selectCharacter ){
// Store Old
if( currentCharacter > 0 ){
NSMutableArray * data = [allPeopleSectionIndex lastObject];
[data insertObject:[NSNumber numberWithInt:currentCount] atIndex:2];
}
// Setup for New
currentCharacter = selectCharacter;
currentCount = 1;
currentCharacterIndex ++;
// 0: char, 1: section start, 2: count
NSMutableArray * data = [[NSMutableArray alloc] initWithObjects:
[NSString stringWithFormat:@"%c", currentCharacter],
[NSNumber numberWithInt:i],
[NSNumber numberWithInt:0],
nil];
[allPeopleSectionIndex addObject:data];
[data release];
} else {
currentCount++;
}
```
|
Get non-english Character as english character
|
CC BY-SA 3.0
| 0 |
2011-04-26T11:18:46.903
|
2014-01-03T06:29:28.217
|
2014-01-03T06:29:28.217
| 1,359,437 | 383,307 |
[
"iphone",
"uitableview",
"sorting",
"localization"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.