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,847,671 | 1 | 5,847,779 | null | 0 | 1,130 |
I was recently making a very simple application that just printed matrix-effect out to the console. So I made it in a very easy to use function `void drawLine(int startX, int startY, int lineLength,int speed);`. The problem now is that it only prints one line at a time. Of course I need to make this application multi-threaded, but I found myself struggling because I've never done this in C++, only in C# and in C# it is very easy to do compared to C++.
I did some research and tried to create 3 threads with `CreateThread` and then launching them with `WaitForMultipleObjects`. But output is very weird and doesn't seem correct. And it also leads me to next problem even if this would work correctly. Imagine that I want to launch 15+ lines on my console, does that mean that I need to create 15 different threads?
Note that this is not something important, it's just something I just created because I was bored and also because I want to learn threading with C++. I can, of course use boost libraries, but I want to create example for myself w/o using it.
Here is a screenshot with 1 thread only just to make it more clear:

|
C++ multi-threading question
|
CC BY-SA 3.0
| 0 |
2011-05-01T09:49:15.237
|
2011-05-01T10:56:50.120
| null | null | 440,611 |
[
"c++",
"multithreading"
] |
5,847,765 | 1 | 5,847,782 | null | 13 | 6,333 |
When renaming a variable in Visual Studio (I use 2010), it shows a little mark that when clicked, leads to a drop-down that offers to rename all the dependant references.

What I want to do, is spare getting the mouse and click it in order to show the drop-down.
I was wondering if there is a way to access it via the keyboard.
|
Keyboard shortcut for code refactor (var rename) in Visual Studio
|
CC BY-SA 3.0
| 0 |
2011-05-01T10:08:30.333
|
2011-12-08T07:04:52.063
|
2011-12-08T07:04:52.063
| 220,993 | 75,500 |
[
"visual-studio",
"ide",
"refactoring",
"keyboard-shortcuts",
"shortcut"
] |
5,847,803 | 1 | null | null | 11 | 2,367 |
I am trying to make a simple artificial neural network work with the backpropagation algorithm. I have created an ANN and I believe I have implemented the BP algorithm correctly, but I may of course be wrong.
Right now, I am trying to train the network by giving it two random numbers (a, b) between 0 and 0.5, and having it add them. Then, of course, each time the output the network gives is compared to the theoretical answer of a + b (which will always be achievable by the sigmoid function).
Strangely, the output always converges to a number between 0 and 1 (as it must, because of the sigmoid function), but the random numbers I'm putting in seem to have no effect on it.
Edit: Sorry, it appears it doesn't converge. Here is an image of the output:

The weights are randomly distributed between -1 and 1, but I have also tried between 0 and 1.
I also tried giving it two constant numbers (0.35,0.9) and trying to train it to spit out 0.5. This works and converges very fast to 0.5. I have also trained it to spit out 0.5 if I give it any two random numbers between 0 and 1, and this also works.
If instead, my target is:
```
vector<double> target;
target.push_back(.5);
```
Then it converges very quickly, even with random inputs:

I have tried a couple different networks, since I made it very easy to add layers to my network. The standard one I am using is one with two inputs, one layer of 2 neurons, and a second layer of only one neuron (the output neuron). However, I have also tried adding a few layers, and adding neurons to them. It doesn't seem to change anything. My learning rate is equal to 1.0, though I tried it equal to 0.5 and it wasn't much different.
Does anyone have any idea of anything I could try?
Is this even something an ANN is capable of? I can't imagine it wouldn't be, since they can be trained to do such complicated things.
Any advice? Thanks!
Here is where I train it:
```
//Initialize it. This will be one with 2 layers, the first having 2 Neurons and the second (output layer) having 1.
vector<int> networkSize;
networkSize.push_back(2);
networkSize.push_back(1);
NeuralNetwork myNet(networkSize,2);
for(int i = 0; i<5000; i++){
double a = randSmallNum();
double b = randSmallNum();
cout << "\n\n\nInputs: " << a << ", " << b << " with expected target: " << a + b;
vector<double> myInput;
myInput.push_back(a);
myInput.push_back(b);
vector<double> target;
target.push_back(a + b);
cout << endl << "Iteration " << i;
vector<double> output = myNet.backPropagate(myInput,target);
cout << "Output gotten: " << output[0];
resultPlot << i << "\t" << abs(output[0] - target[0]) << endl;
}
```
Edit: I set up my network and have been following from this guide: [A pdf](http://www.rgu.ac.uk/files/chapter3%20-%20bp.pdf). I implemented "Worked example 3.1" and got the same exact results they did, so I think my implementation is correct, at least as far as theirs is.
|
Problem with simple artificial neural network -- adding
|
CC BY-SA 3.0
| 0 |
2011-05-01T10:15:55.800
|
2014-02-09T03:39:30.883
|
2011-05-01T17:34:48.013
| null | null |
[
"c++",
"neural-network"
] |
5,847,894 | 1 | 5,848,574 | null | 0 | 213 |
I want to validate a field to be able to accept values only between 1 and 100. It works fine, but when i write a something that is not an integer is don't see the custom message i expect.
This is the field:
```
<h:inputText id="discountPercentage" value="#{newOfferSupportController.discountPercentage}" validator="#{newOfferSupportController.validateDiscountPercentage}"/>
<span style="color: red;"><h:message for="discountPercentage"
showDetail="true" /></span>
```
This is the validator method:
```
public void validateDiscountPercentage(FacesContext context,
UIComponent validate, Object value) {
FacesMessage msg = new FacesMessage("");
String inputFromField = "" + value.toString();
String simpleTextPatternText = "^([1-9]|[1-9]\\d|100)$";
Pattern textPattern = null;
Matcher productValueMatcher = null;
textPattern = Pattern.compile(simpleTextPatternText);
productValueMatcher = textPattern.matcher(inputFromField);
if (!productValueMatcher.matches()) {
msg = new FacesMessage("Only values between 1 and 100 allowed");
throw new ValidatorException(msg);
}
for (int i = 0; i < inputFromField.length(); i++) {
// If we find a non-digit character throw Exception
if (!Character.isDigit(inputFromField.charAt(i))) {
msg = new FacesMessage("Only numbers allowed");
throw new ValidatorException(msg);
}
}
}
```
This is the error i message i see when i ester something that is not a number:

Why i don't see the message: Only numbers allowed?
|
Custom validation error don't work as expected
|
CC BY-SA 3.0
| null |
2011-05-01T10:46:18.923
|
2011-05-01T13:30:59.503
|
2020-06-20T09:12:55.060
| -1 | 614,141 |
[
"java",
"validation",
"jsf",
"jsf-2"
] |
5,847,928 | 1 | 5,856,600 | null | -1 | 506 |
I'm usuing iText to generate a PDF file with java.
I want to add a paragraph or some text in each page.
I'm use HTMl tags to format text.
This an example what I'm trying to create.

And this my code that I use :
```
public pdfing() {
try {
com.itextpdf.text.Document document = new com.itextpdf.text.Document(PageSize.A4);
PdfWriter pdfWriter = PdfWriter.getInstance(document, new FileOutputStream("fdf.pdf"));
document.open();
HTMLWorker htmlWorker = new HTMLWorker(document);
htmlWorker.parse(new StringReader("text text ..... " +
"<h1 style = \"color:#00ff00;\">aaaaa</h1>"));
document.close();
} catch(DocumentException e) {
e.printStackTrace();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
```
I tried document.addPage() but I seem that doesn't exist.
How can I do???
|
Add paragraphe in each page - PDF in Java with itext
|
CC BY-SA 3.0
| null |
2011-05-01T10:55:56.657
|
2011-05-02T11:30:33.877
| null | null | 604,156 |
[
"java",
"pdf",
"itext"
] |
5,848,001 | 1 | null | null | 0 | 162 |
I'm trying to do as the picture shows here:

This is my code:
```
import java.util.Scanner;
public class IcsProject
{
public static void main(String [] args)
{
Scanner keyboard= new Scanner (System.in);
int menuNum,ID,semNum,semCode,semCourses;
do{
System.out.println("Please Enter your Choice from the menu:");
System.out.println("1. Enter Student Sanscript");
System.out.println("2. Display Transcript Summary");
System.out.println("3. Read Student Franscript from a File");
System.out.println("4. Write Transcript Summary to a File");
System.out.println("5. Exit");
menuNum = keyboard.nextInt();
if (menuNum == 2 || menuNum == 3 || menuNum == 4)
System.out.println("Not working");
} while (menuNum > 1 && menuNum < 5);
//// Option 1: Enter student transcript
if (menuNum == 1)
System.out.println("Please enter your student's FIRST and LAST name:");
String stuName = keyboard.nextLine();
System.out.println("Please enter the ID number for " + stuName);
ID = keyboard.nextInt();
System.out.println("Please enter the number of semesters");
semNum = keyboard.nextInt();
for(int i=1 ; i < semNum ; i++)
{System.out.println("Please enter semester code for semester n# " + semNum);
semCode = keyboard.nextInt();
System.out.println("Please enter the number of courses taken in " + semCode );
semCourses = keyboard.nextInt();}
System.out.println("Enter course code, credit hours, and letter grade ")
///I stopped here
}
```
- - - `keyboard.nextLine();`
|
inputs and loops
|
CC BY-SA 3.0
| null |
2011-05-01T11:10:55.730
|
2011-05-01T13:06:47.763
|
2011-05-01T11:21:46.077
| 464,988 | 571,484 |
[
"java",
"java.util.scanner"
] |
5,848,169 | 1 | null | null | 4 | 2,715 |
We are going to use ( thin client ) with Windows XP ( Embedded ) with .

- -
Both screens has it's own browser window opened (may be child window)
Our goal is to achieve mouse and touchscreen work with two browser windows independently.
Now we can read both mouse and touchscreen using `raw inputs` ( see links below ) and can determine which device generating events.
Our idea is to intercept `raw_input` events from touchscreen in `ActiveX` component and send it to JS, and cancel propagating events, so touchscreen events won't disturb primary mouse.
Question : , could some one point or share info about how to achieve this ( MSDN or smth ) since we don't have much experience in writing drivers.
|
Handle multiple mouses
|
CC BY-SA 3.0
| null |
2011-05-01T11:52:39.397
|
2022-10-18T15:48:27.233
|
2011-05-02T19:21:59.507
| 734,975 | 734,975 |
[
"windows",
"winapi",
"mouse"
] |
5,848,250 | 1 | 5,848,465 | null | 3 | 1,379 |
Consider these two use cases.
Say a store gives out store credit for customers. Store credit come from refunds, discounts, overpaying amounts etc...
1. The customer decides how and when to use this credit. E.g. Say customer A have $50 dollars in store credit and he decides to use $25 for invoice A and $25 for invoice B... or decides to have the store credit sitting there against his account for future purchases.
2. The customer and store must also have a way to look up the total of store credit.
I currently have tables:
- - - -
Invoice table will have other associations like invoice lines, receipt, receipt lines etc...
Is this the best way to do this? My concern is primarily regarding ease of reporting and transaction mechanics.
Alternatively I'm considering just saving all credit entry and used credit inside the transaction table.

|
Used store credit in SQL database design
|
CC BY-SA 3.0
| 0 |
2011-05-01T12:10:23.440
|
2011-05-01T14:50:38.400
|
2011-05-01T14:50:38.400
| 342,965 | 342,965 |
[
"database",
"database-design"
] |
5,848,372 | 1 | 5,848,632 | null | 0 | 2,630 |
I'm trying to apply a routine to a database using MYSQL workbench but I'm having a few problems.
In the first image below, you see the mysql I'm using. This mysql has worked for someone else (i.e. the author of the book I'm following), but when I enter it, there's three error warnings (the Xs in the red boxes).
The other two images below show what happens after I hit apply the first time(showing me the SQL to be applied on the database), and then the second time (producing the error message)
Can anyone see how to fix this problem?
Note, the code that's being entered is a formula to calculate distance between two points, but, as said, it's worked for the author of the book I'm using (Larry Ullman's PHP 5)



|
MySQL Workbench error messages
|
CC BY-SA 3.0
| null |
2011-05-01T12:35:41.573
|
2011-05-01T13:23:41.880
| null | null | 577,455 |
[
"mysql",
"mysql-workbench"
] |
5,848,712 | 1 | 5,848,961 | null | 0 | 757 |
i have a little problem with xcode4.
i get issues in my projects with this type of code:
```
- (id)init {
if (self = [super init]) {
}
return self;
}
```

i know i could fix it with something like:
```
- (id)init {
if ((self = [super init])) {
}
return self;
}
```
or
```
- (id)init {
self = [self init];
if (self) {
}
return self;
}
```
but the problem is, that i use a massive amount of external libraries in a special project and i don't want to edit this files, push an update to github or something else.
so is there a option to deactivate this type of notification/issue posting in xcode?
|
Ignore Issue-Type in Xcode 4
|
CC BY-SA 3.0
| null |
2011-05-01T13:38:20.493
|
2014-03-14T15:04:46.730
| null | null | 253,288 |
[
"objective-c",
"xcode",
"xcode4",
"issue-tracking"
] |
5,848,835 | 1 | null | null | 0 | 553 |
I am starting with openglES (on android).
I have in my app a wall of pictures. I have already made a simple tiled wall where I can browse with translations and zooms, and implemented a simple picking system.
Now I would like to give this wall a curved effect like we can see often (like in safari, see my images)
Do you think i can do it by applying simples (naive..) Y-rotations and Z-translations on each tile?
My first exemple seems to do that wheras my second looks more complicated.
Can you give me some ideas or a solution if you already did it for one of your project??
Exemple 1 : motorola xoom

Exemple 2 : safari top sites

|
openglES - give a curved effect to a wall of pictures
|
CC BY-SA 3.0
| null |
2011-05-01T13:59:09.133
|
2013-09-27T08:15:29.297
|
2011-05-01T17:59:05.767
| 44,729 | 99,276 |
[
"android",
"opengl-es",
"3d"
] |
5,848,974 | 1 | 5,849,204 | null | 2 | 5,611 |
Hi can anyone tell me their thoughts on this sequence diagram, if it is correct or whatever needs changing.
Thankyou, your feedback would certainly help a lot.
Full Size Image: [http://i.stack.imgur.com/ktPsY.jpg](https://i.stack.imgur.com/ktPsY.jpg)

|
UML Sequence Diagram feedback
|
CC BY-SA 3.0
| 0 |
2011-05-01T14:26:23.020
|
2014-12-02T20:22:28.603
| null | null | 251,671 |
[
"uml",
"modeling",
"sequence-diagram"
] |
5,848,987 | 1 | 5,851,792 | null | 1 | 202 |
This is what I see when using the debugger:

Why can't I see the actual values? (I assume it's a setting, but I haven't a clue what it would be).
|
Debugger: unable to see values of my variables
|
CC BY-SA 3.0
| null |
2011-05-01T14:30:06.663
|
2011-05-01T22:08:54.117
|
2011-05-01T18:20:29.990
| 603,977 | 1,231,786 |
[
"objective-c",
"debugging",
"xcode4"
] |
5,849,145 | 1 | 5,849,234 | null | 2 | 1,164 |
By having into consideration the following scheme:

We need to make sure that, if an association gets deleted, all the dogs that belong to that association, should also be deleted.
However, it makes sense to, while doing this, keep the relation that actually exists between Association and Dog tables, because, each association can have several Dogs, however, one Dog belong to only one Association. So I believe the foreign key configuration is correct.
I believe I should apply Cascade somewhere, but I'm not seeing where. :(
Please advice
|
HOW TO: When record on table A gets deleted all records on table B, that are associated with table A, should ALSO be deleted?
|
CC BY-SA 3.0
| 0 |
2011-05-01T15:01:06.297
|
2011-05-01T15:35:16.747
|
2011-05-01T15:07:41.603
| 378,170 | 378,170 |
[
"mysql",
"mysql-workbench",
"table-relationships"
] |
5,849,438 | 1 | 5,851,518 | null | 20 | 35,310 |
Google has the effects - once it was a Pac-man game, today is apparently the 160th anniversary of the first World Fair, and Google's logo has an image of it. They turn the mouse into a magnifying glass that can sweep over the picture (the gold ring).

I'm wondering how they do that. It's obviously Javascript, and I looked at the page source, but it's not especially readable (no surprise).
|
How to simulate magnifying glass on Web-page image (Javascript)?
|
CC BY-SA 3.0
| 0 |
2011-05-01T15:46:48.193
|
2015-02-13T13:45:57.290
|
2011-05-02T11:22:00.887
| 78,409 | 78,409 |
[
"javascript",
"html",
"google-doodle"
] |
5,849,667 | 1 | 5,849,818 | null | 14 | 26,013 |
I would like to have something clarified with regards to the following A* Search example:

The sections highlighted with the red ellipses are the areas that I do not understand; it appears that `{S,B} f=2+6=8` has been taken/moved/copied from `Expand S` (above) and used in `Expand A`. It also appears that `{S,A,X} f=(1+4)+5=10` has been taken/moved/copied from `Expand A` and used in `Expand B`.
Could somebody kindly explain why this happens? I am able to read the graph perfectly well and do not have any trouble interpreting it - it is merely the fact that I do not know the aforementioned paths/routes have been duplicated elsewhere.
Thank you.
|
A* Search Algorithm
|
CC BY-SA 3.0
| 0 |
2011-05-01T16:24:45.430
|
2017-10-12T16:26:29.273
|
2012-05-30T14:48:15.493
| 636,987 | 636,987 |
[
"algorithm",
"a-star"
] |
5,849,797 | 1 | 5,849,916 | null | 4 | 5,511 |
I'm trying to bind a collection of `Videogame` objects to my ListBox and I'm getting this error despite following the [MSDN](http://msdn.microsoft.com/en-us/library/system.windows.controls.itemscontrol.itemssource%28v=vs.95%29.aspx) example.

```
<Grid>
<Grid.Resources>
//Error is fired here.
<src:Videogames x:Key="videogames" />
```
Here is my Videogame class:
```
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;
namespace UpcomingGames
{
public class Videogame
{
public string Name { get; set; }
public string ReleaseDate { get; set; }
public string Synopsis { get; set; }
public string Developer { get; set; }
}
public class Videogames : ObservableCollection<Videogame>
{
public Videogames()
{
Add(new Videogame {
Name = "Fire Emblem",
ReleaseDate = "20/4/2011",
Developer = "Rockstar Games",
Synopsis = @"Lorem ipsum dolor...",
});
Add(new Videogame {
Name = "Fire Emblem",
ReleaseDate = "20/4/2011",
Developer = "Rockstar Games",
Synopsis = @"Lorem ipsum dolor...",
});
Add(new Videogame{
Name = "Fire Emblem",
ReleaseDate = "20/4/2011",
Developer = "Rockstar Games",
Synopsis = @"Lorem ipsum dolor...",
});
}
}
}
```
What might I be doing wrong and what can I do to solve this?
I haven't manually added any namespaces because the MSDN article didn't show me that. Is this something I need to do? Anyways, here's the current state of the XAML.
```
<Window x:Class="UpcomingGames.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="286" Width="199">
```
|
The type src:Videogames was not found. Verify that you are not missing an assembly reference
|
CC BY-SA 3.0
| 0 |
2011-05-01T16:45:58.097
|
2011-05-01T17:23:07.717
|
2011-05-01T16:57:23.443
| 50,776 | 699,978 |
[
"wpf",
"xaml",
"binding",
"listbox",
"datatemplate"
] |
5,849,944 | 1 | null | null | 0 | 138 |
I have created a CSS drop down menu at [http://elankeeran.com/test/dropdown.html](http://elankeeran.com/test/dropdown.html), but I am facing an on hover issue. Home tab is working fine. And I want to remove the width for `<ul id="menu" style="width:35px;">` any idea how to remove the width.
The "left Home" top border is missing as shown in the image below:

How would I be able to fix this?
|
CSS drop down menu issue
|
CC BY-SA 3.0
| null |
2011-05-01T17:08:16.757
|
2011-05-01T17:24:51.390
|
2011-05-01T17:15:12.947
| 464,257 | 433,904 |
[
"html",
"css"
] |
5,849,971 | 1 | 5,850,056 | null | 3 | 1,711 |
I know that the Weibull distribution exhibits subexponential heavy-tailed behavior when the shape parameter is < 1. I need to demonstrate this using the limit definition of a heavy tailed distribution:

for all 
How do I incorporate the cumulative distribution function (CDF) or any other equation characteristic of the Weibull distribution to prove that this limit holds?
|
Heavy tail distribution - Weibull
|
CC BY-SA 3.0
| 0 |
2011-05-01T17:11:57.600
|
2014-01-19T15:47:53.580
|
2014-01-19T15:47:53.580
| 2,144,085 | 510,226 |
[
"statistics",
"probability",
"cdf",
"weibull"
] |
5,850,309 | 1 | 5,850,339 | null | 1 | 282 |
this is quite hard to explain out of context but i am going to try because its driving me nuts.
i am trying to write a binary file to represent the program and bank state of a vst audio plugin, based on the vst 2.4 spec - a program is the parameter values for one sound and a bank is a collection of programs (in my case 32). My program saving/loading code works fine on windows and mac. My bank saving code works fine on mac - I can save the state from my plugin, and open it via a vst-host's recall mechanisms. The files i create on mac are loadable by mac hosts and windows hosts, showing that this is saving the "correct" vst bank file format. On windows however, I get extra bytes in the vst bank file and it won't load via the host mechanism. I assume this is because on windows there is some padding. It doesn't seem to happen in the vst program files, which are smaller. I have tried #pragma pack(push, 1) in many different places to no avail. Can anyone suggest what I might do to fix this or what might be the cause?
thanks
mac hex good:

win hex bad:

Here is the code. The vst fxb file format wants big endian data hence the byte swap stuff. More info here: [http://forum.cockos.com/showthread.php?t=78573](http://forum.cockos.com/showthread.php?t=78573)
```
bool IPlugBase::SaveBankAsFXB(const char* defaultFileName)
{
if (mGraphics)
{
WDL_String fileName(defaultFileName, strlen(defaultFileName));
mGraphics->PromptForFile(&fileName, IGraphics::kFileSave, "", "fxb");
if (fileName.GetLength())
{
FILE* fp = fopen(fileName.Get(), "w");
VstInt32 chunkMagic = WDL_bswap_if_le('CcnK');
VstInt32 byteSize = 0;
VstInt32 fxbMagic;
VstInt32 fxbVersion = WDL_bswap_if_le(kFXBVersionNum);
VstInt32 pluginID = WDL_bswap_if_le(GetUniqueID());
VstInt32 pluginVersion = WDL_bswap_if_le(GetEffectVersion(true));
VstInt32 numPgms = WDL_bswap_if_le(NPresets());
VstInt32 currentPgm = WDL_bswap_if_le(GetCurrentPresetIdx());
char future[124];
memset(future, 0, 124);
unsigned int bnkHeaderSize = 80;
unsigned int pgmHeaderSize = 84;
unsigned int pgmSize;
unsigned int bnkSize; // total size in bytes
unsigned int bytePos = 0;
unsigned char *bnk;
if (DoesStateChunks())
{
//TODO
}
else
{
pgmSize = NParams() * 4;
bnkSize = bnkHeaderSize + (NPresets() * (pgmHeaderSize + pgmSize));
bnk = new unsigned char[bnkSize];
fxbMagic = WDL_bswap_if_le('FxBk');
// fxb header
memcpy(bnk + bytePos, &chunkMagic, 4);
bytePos += 4;
memcpy(bnk + bytePos, &byteSize, 4);
bytePos += 4;
memcpy(bnk + bytePos, &fxbMagic, 4);
bytePos += 4;
memcpy(bnk + bytePos, &fxbVersion, 4);
bytePos += 4;
memcpy(bnk + bytePos, &pluginID, 4);
bytePos += 4;
memcpy(bnk + bytePos, &pluginVersion, 4);
bytePos += 4;
memcpy(bnk + bytePos, &numPgms, 4);
bytePos += 4;
memcpy(bnk + bytePos, ¤tPgm, 4);
bytePos += 4;
memcpy(bnk + bytePos, &future, 124);
bytePos += 124;
VstInt32 fxpMagic = WDL_bswap_if_le('FxCk');
VstInt32 fxpVersion = WDL_bswap_if_le(kFXPVersionNum);
VstInt32 numParams = WDL_bswap_if_le(NParams());
for (int p = 0; p < NPresets(); p++)
{
IPreset* pPreset = mPresets.Get(p);
char prgName[28];
memset(prgName, 0, 28);
strcpy(prgName, pPreset->mName);
//fxp header
memcpy(bnk + bytePos, &chunkMagic, 4);
bytePos += 4;
memcpy(bnk + bytePos, &byteSize, 4);
bytePos += 4;
memcpy(bnk + bytePos, &fxpMagic, 4);
bytePos += 4;
memcpy(bnk + bytePos, &fxpVersion, 4);
bytePos += 4;
memcpy(bnk + bytePos, &pluginID, 4);
bytePos += 4;
memcpy(bnk + bytePos, &pluginVersion, 4);
bytePos += 4;
memcpy(bnk + bytePos, &numParams, 4);
bytePos += 4;
memcpy(bnk + bytePos, &prgName, 28);
bytePos += 28;
//fxp data
for (int i = 0; i< NParams(); i++)
{
double v;
pPreset->mChunk.Get(&v, i * sizeof(double));
WDL_EndianFloat v32;
v32.f = (float) mParams.Get(i)->GetNormalized(v);
unsigned int swapped = WDL_bswap_if_le(v32.int32);
memcpy(bnk + bytePos, &swapped, 4);
bytePos += 4;
}
}
}
fwrite(bnk, bnkSize, 1, fp);
fclose(fp);
return true;
}
return false;
}
return false;
}
```
|
how to force 1 byte padding when writing a binary file on windows - works on mac, not on win
|
CC BY-SA 3.0
| null |
2011-05-01T18:08:18.773
|
2011-05-01T18:14:37.540
| null | null | 674,745 |
[
"binary",
"endianness",
"vst"
] |
5,850,439 | 1 | null | null | 0 | 388 |
I recently moved a php / html based site from one server (windows / apache) to another (ubuntu / apache). Now the font's are rendering the common fonts differently.
I had the server admin install the ms core fonts and it is still appearing incorrectly. Internet Explorer seems to be fine, but Chrome / Firefox are not.
Could really use a new direction to work in on this one. Thanks in advance.

|
What would cause a font to render differently when files are hosted on a Ubuntu server, then when they are on a Windows server?
|
CC BY-SA 3.0
| null |
2011-05-01T18:31:11.970
|
2013-06-03T14:06:57.100
|
2011-05-01T18:35:31.680
| 635,608 | 621,586 |
[
"windows",
"linux",
"google-chrome",
"ubuntu",
"fonts"
] |
5,850,530 | 1 | 5,853,251 | null | 0 | 3,154 |
[Thanks for the answers. This comes for you [http://www.youtube.com/watch?v=Vo0Cazxj_yc](http://www.youtube.com/watch?v=Vo0Cazxj_yc) ]
This might and should be a very easy question, but i could not find a solution.
I have a java applet, and i want a vertical scrollbar so that i can load thousands of buttons into the applet and use the scrollbar to see buttons down on the applet.
Buttons are used to select items. if button is pressed, the item is selected.
When i load buttons, all of them are shown on one screen, squeezed together to fit the screen in width and height (~1000px,~1000px). Below code is a portion of my program. Please comment.
```
JFrame frame = new JFrame();
NameClassifier nameClassifier = new NameClassifier();
JScrollPane scrollPane = new JScrollPane(nameClassifier);
scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
frame.add(scrollPane);
frame.getContentPane().add(nameClassifier);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);
System.out.println("exiting");
```
|
Java applet scrollbar
|
CC BY-SA 3.0
| null |
2011-05-01T18:48:31.433
|
2011-05-02T08:45:56.593
|
2011-05-02T08:45:56.593
| 564,925 | 564,925 |
[
"java",
"applet"
] |
5,850,695 | 1 | 5,851,155 | null | 6 | 1,027 |
When I use RenderTransform property and scale up a RichTextBox I get magnified text which is pixelized (square text edges).
How I can prevent this?

EDIT:
I have TextOptions.TextFormattingMode="Display" - when I remove this option everything is fine!
|
How to prevent text to pixelize when I use RenderTransform?
|
CC BY-SA 3.0
| null |
2011-05-01T19:17:18.440
|
2016-05-19T21:21:59.067
|
2011-05-03T07:00:14.813
| 82,507 | 82,507 |
[
"c#",
"wpf",
"graphics",
"richtextbox",
"rendertransform"
] |
5,850,828 | 1 | null | null | 0 | 84 |
I recently attempted to code a GUI in a DLL using .rc files, but unfortunately have ran into
a few problems. Here is a screenshot of the GUI:

As you can see, the text "Main Window Found? No" has been duplicated (which I did not do),
also the box has also been duplicated (which I also did not do.)
This is the code I use to generate the Dialog:
```
DWORD WINAPI MainWin (HMODULE hMod)
{
DialogBox (hMod, MAKEINTRESOURCE (IDD_DIALOG1), NULL, (DLGPROC)EventHandler);
ExitThread (0);
return 0;
}
BOOL CALLBACK EventHandler (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_INITDIALOG:
ControlHwnd = hDlg;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDC_CHECKBOX1:
Test = !Test;
CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)&TestFunc,NULL,0,NULL);
Beep (500,500);
break;
}
break;
}
return 0;
}
```
|
where are these duplicated GUI elements coming from?
|
CC BY-SA 3.0
| null |
2011-05-01T19:38:45.500
|
2011-05-01T21:43:44.750
|
2011-05-01T19:51:50.680
| 484,293 | 733,597 |
[
"c",
"winapi"
] |
5,851,266 | 1 | 5,851,552 | null | 10 | 12,581 |
Anywho, I am looking to implement a Region Growing for use in a rudimentary Drawbot.
Here is an article on region growing: [http://en.wikipedia.org/wiki/Region_growing](http://en.wikipedia.org/wiki/Region_growing)
The way I envision it, the image the draw is based upon will meet the following criteria:
- The image will be at most 3x3 inches in size at an arbitrary Color Depth- The image will be a black continuous shape on a white background- The shape can be located anywhere on the background.
I've considered the following solutions to this problem. While some work to an extent, each has some considerable flaws in either their performance or feasibility (at least they don't seem feasible to me). Furthermore, because this is a Drawbot, this needs to be done with a single continuous line. This doesn't mean however that I can't backtrack, it only eliminates the possibility of multiple starting points (seeds).
# Considered Approaches:
## Random Walk:
Solving this problem with a random walk was my first instinct. A random walk program accomplishing this would, I imagine, look something like this:
pseudo python...
```
Cells To Visit = Number of Black Cells
Cells Visited = 0
MarkColor = red
While Cells Visited < Cells To Visit:
if currentcell is black:
Mark Current Cell As Visited #change pixel to red
Cells Visited +=1
neighbors = Get_Adjacent_Cells() #returns cells either black or red
next cell = random.choose(neighbors)
currentCell = next cell
```
While I suppose this is feasible, it seems to me to be highly ineffective and doesn't guarantee good results, but in the interest of actually getting something done I may end up trying this... Is my logic in the pseudocode even vaguely correct?
## Sweeping Pattern:
This method to me seemed to be the most trivial to implement. My idea here is that I could choose a starting point at one extreme of the shape (e.g. the lowest most left point). From there it would draw to the right, moving only on the x axis until it hit a white pixel. From here it would move up one pixel on the y axis, and then move left on the x axis until it reached a white pixel. If the pixel directly above it happend to be white, backtrack on the x axis until it finds a black pixel above it.
This method upon further inspection has some major short comings.
When faced with a shape such as this:

The result will look like this:

And even if I were to tell it to start sweeping down after awhile, the middle leg would still be overlooked.
## 4/8 Connected Neighborhood:
[http://en.wikipedia.org/wiki/8-connected_neighborhood](http://en.wikipedia.org/wiki/8-connected_neighborhood)
This method appears to me to be the most powerful and effective, but at this point I can't figure it out fully, nor can I think of how I would implement it without potentially leaving some overlooked areas
At every cell I would look at the neighboring black cells, devise some method for ranking which one I should visit first, visit all of them, and repeat the process until all cells are covered.
The problems I could see here is first of all dealing with the data structure necessary to accomplish this, and also merely figuring out the logic behind it.
---
Those are the best solutions I've been able to think of.
## Edit:
I also looked into maze generating and solving algorithms, but wasn't sure how to implement that here. My understanding of the maze solving algorithms is that they rely on the passages of the maze to be of equal width. I could of course be wrong about that.
|
Region Growing Algorithm
|
CC BY-SA 3.0
| 0 |
2011-05-01T20:43:02.953
|
2011-05-02T22:50:15.137
|
2020-06-20T09:12:55.060
| -1 | 536,017 |
[
"python",
"algorithm",
"image",
"image-processing",
"flood-fill"
] |
5,851,371 | 1 | 5,922,888 | null | 1 | 285 |
It is really simple question. How can i delete StatusPanel[Jpanel] or MenuBar on Netbeans?

|
Deleting StatusPanel[Jpanel] or MenuBar at Netbeans
|
CC BY-SA 3.0
| 0 |
2011-05-01T20:59:04.160
|
2015-07-23T18:53:46.053
|
2015-07-23T18:53:46.053
| 4,370,109 | 732,412 |
[
"netbeans",
"jpanel",
"menubar"
] |
5,851,611 | 1 | 5,851,827 | null | 8 | 11,376 |
Git is essential to my workflow. I run MSYS Git on Windows XP on my quad core machine with 3GB of RAM, and normally it is responsive and zippy.
Suddenly an issue has cropped up whereby it takes >30 seconds to run any command from the Git Bash command prompt, including `ls` or `cd`. Interestingly, from the bash prompt it looks likes `ls` runs fairly quickly, I can then see the output from `ls`, but it then takes ~30 seconds for the prompt to return. If I switch to the windows command prompt (by running `cmd` from the start menu) git related commands also take forever, even just to run. For example `git status` can take close to a minute before anything happens. Sometimes the processes simply don't finish.
Note that I have "MSYS Git" installed as well as regular "MSYS" for things like `MinGW` and `make`.
I believe the problem is related to `sh.exe` located in `C:\Program Files\Git\bin`. When I run `ls` from the bash prompt, or when I invoke `git` from the windows prompt, task manager shows up to four instances of `sh.exe` processes that come and go.
Here I am waiting for `ls` to return and you can see the task manager has `git.exe` running and four instances of `sh.exe`:

If I `ctrl-c` in the middle of an `ls` I sometimes get errors that include:
```
sh.exe": fork: Resource temporarily unavailable
0 [main] sh.exe" 1624 proc_subproc: Couldn't duplicate my handle<0x6FC> fo
r pid 6052, Win32 error 5
sh.exe": fork: Resource temporarily unavailable
```
Or for `git status`:
$ git status
```
sh.exe": fork: Resource temporarily unavailable
sh.exe": fork: Resource temporarily unavailable
sh.exe": fork: Resource temporarily unavailable
sh.exe": fork: Resource temporarily unavailable
```
Things I have tried:
- - - -
I'd very much like to not wipe my box and reinstall Windows, but I will if I can't get this fixed. I can no longer code if it takes me >30 s to run `git status` or `cd.`
|
Git sh.exe process forking issue on windows XP, slow?
|
CC BY-SA 3.0
| 0 |
2011-05-01T21:42:10.407
|
2014-11-13T23:40:25.080
| null | null | 200,688 |
[
"git",
"bash",
"shell",
"windows-xp",
"msysgit"
] |
5,851,700 | 1 | 5,893,650 | null | 15 | 4,297 |
I am working on a simple drawing application, and i need an algorithm to make flood fills.
The user workflow will look like this (similar to Flash CS, just more simpler):
1. the user draws straight lines on the workspace. These are treated as vectors, and can be selected and moved after they are drawn.
2. user selects the fill tool, and clicks on the drawing area. If the area is surrounded by lines in every direction a fill is applied to the area.
if the lines are moved after the fill is applied, the area of fill is changed accordingly.
Anyone has a nice idea, how to implement such algorithm? The main task is basically to determine the line segments surrounding a point. (and storing this information somehow, incase the lines are moved)
EDIT: an explanation image: (there can be other lines of course in the canvas, that do not matter for the fill algorithm)

EDIT2: a more difficult situation:

EDIT3: I have found a way to fill polygons with holes [http://alienryderflex.com/polygon_fill/](http://alienryderflex.com/polygon_fill/) , now the main question is, how do i find my polygons?
|
Vector graphics flood fill algorithms?
|
CC BY-SA 3.0
| 0 |
2011-05-01T21:52:57.030
|
2011-05-05T06:48:15.103
|
2011-05-05T00:59:40.490
| 319,473 | 319,473 |
[
"actionscript-3",
"language-agnostic",
"geometry",
"vector-graphics",
"flood-fill"
] |
5,851,922 | 1 | 5,852,334 | null | 2 | 699 |
I have the following XAML code:
```
<sdk:DataGrid AutoGenerateColumns="False" Height="200" HorizontalAlignment="Left" ItemsSource="{Binding ElementName=ticketDomainDataSource, Path=Data}" Margin="8,43,0,0" Name="ticketDataGrid" RowDetailsVisibilityMode="VisibleWhenSelected" VerticalAlignment="Top" Width="795">
<sdk:DataGrid.Columns>
<sdk:DataGridTextColumn x:Name="ticketNameColumn" Binding="{Binding Path=ticketName}" Header="Ticket Name" Width="SizeToHeader" />
<sdk:DataGridTextColumn x:Name="ticketDescColumn" Binding="{Binding Path=ticketDesc}" Header="Ticket Desc" Width="SizeToHeader" />
<sdk:DataGridTextColumn x:Name="ticketNumberColumn" Binding="{Binding Path=ticketNumber}" Header="Ticket Number" Width="SizeToHeader" />
<sdk:DataGridTextColumn x:Name="ticketTypeIdColumn" Binding="{Binding Path=ticketTypeId}" Header="Ticket Type Id" Width="SizeToHeader" />
<sdk:DataGridTextColumn x:Name="seatIdColumn" Binding="{Binding Path=seatId}" Header="Seat Id" Width="SizeToHeader" />
<sdk:DataGridTextColumn x:Name="showIdColumn" Binding="{Binding Path=showId}" Header="Show Id" Width="SizeToHeader" />
</sdk:DataGrid.Columns>
</sdk:DataGrid>
```
The code has certain headers like, seatId and showId, I would like for them to show the actual name of the seat and show, but how would I query this, I am using domain services and contexts in my Silverlight application.
If you need more info please let me know.
Thanks.
EDIT:
Query used for binding:
```
EntityQuery<Web.Ticket> query =
from t in _ticketContext.GetTicketsQuery()
where t.bookingId == data.bookingId
select t;
LoadOperation<Web.Ticket> loadOp = _ticketContext.Load(query);
tk.ticketDataGrid.ItemsSource = loadOp.Entities;
```
EDIT:
Data Model:

EDIT:
Query code from domain service:
```
public IQueryable<Ticket> GetTickets()
{
return this.ObjectContext.Tickets.Include("Seat");
}
```
|
Help modify datagrid with database data XAML
|
CC BY-SA 3.0
| null |
2011-05-01T22:34:55.167
|
2011-05-02T17:31:00.750
|
2011-05-02T00:30:17.970
| 251,671 | 251,671 |
[
"c#",
"silverlight",
"wcf",
"xaml",
"datagrid"
] |
5,852,099 | 1 | null | null | 1 | 3,081 |
I'm building a scrabble-like game in C# where I have a collection of "letters" (PictureBox controls), and need to drag/drop them onto the playing board (TableLayoutPanel displaying a grid of PictureBox controls).
I initially tried to use the DoDragDrop() method on the letter PictureBox inside the MouseDown event handler, but couldn't get the control to do anything once I started dragging. I referenced this [code project](http://www.codeproject.com/KB/cs/DragDropImage.aspx).
After exhausting that, I'm trying to "manually" move the PictureBox using MouseDown, MouseMove, and MouseUp event handlers:
```
private void letter1PictureBox_MouseDown(object sender, MouseEventArgs e)
{
if (sender is PictureBox && e.Button == MouseButtons.Left)
{
isDragging = true;
dragOffsetX = e.X;
dragOffsetY = e.Y;
}
}
private void letter1PictureBox_MouseMove(object sender, MouseEventArgs e)
{
if (isDragging)
{
PictureBox letter = (PictureBox)sender;
letter.BringToFront();
letter.Top += (e.Y - dragOffsetY);
letter.Left += (e.X - dragOffsetX);
}
}
```
My problem is that, when trying to drag the PictureBox onto my TableLayoutPanel (or anywhere outside of the GroupBox it's contained in), the PictureBox disappears behind the control/panel.

I would've thought the BringToFront() call would've prevented this, no?
Help is much appreciated.
|
C# - Drag and Dropping PictureBox onto a TableLayoutPanel
|
CC BY-SA 3.0
| 0 |
2011-05-01T23:12:13.960
|
2011-10-21T09:18:42.250
|
2011-10-21T09:18:42.250
| 183,600 | 667,011 |
[
"c#",
"winforms",
"drag-and-drop",
"picturebox"
] |
5,852,129 | 1 | 5,852,171 | null | 1 | 672 |
I'd like to ask a question in order determining size for average filter. How to determine proper size of average filter using matlab if variance(square of std deviation) = 0.00006 ?
I need to find proper size of average filter to reduce Gaussian noise, I already got the related lecture but I have no idea how to apply it in matlab. This is the related equation that I know:

Really thanks in advance.
|
how to determine proper size of average filter in matlab?
|
CC BY-SA 3.0
| null |
2011-05-01T23:19:45.463
|
2011-05-01T23:28:18.087
|
2011-05-01T23:25:40.287
| 231,007 | 231,007 |
[
"matlab",
"image-processing"
] |
5,852,144 | 1 | null | null | 1 | 1,153 |
While working on a Windows Phone 7 Application on Visual studio, I am getting this error when I open the XAML designer :
> System.TypeLoadException Cannot find
type System.Security.Cryptography.Aes
in module mscorlib.dll.
Here is a screenshot

I tried deleting various parts of the content, but still have the same error, any thoughts on this?
Thank you.
|
Error while loading xaml page on Visual Studio 2010
|
CC BY-SA 3.0
| null |
2011-05-01T23:21:41.160
|
2014-01-06T14:12:39.197
| null | null | 66,681 |
[
"visual-studio-2010",
"xaml",
"windows-phone-7"
] |
5,852,408 | 1 | 5,951,584 | null | 1 | 178 |
I am new to Prism.
1. Imagin a scenario where you want to develop a multi-region application, but there should are many types of screens and I want those regions to be in one screen only, whereas, for instance in the HomePage which is the application map (like in QuickBooks, see image bellow), there should be no regions, and the whole layout should be different.
2. Also I want that the application should be available for registered users only; unregistered users are automatically forwarded to the LoginView, and they're not supposed to see the regions etc.
How are these two aspects achieved?

|
Multi-shell application?
|
CC BY-SA 3.0
| null |
2011-05-02T00:17:32.943
|
2011-05-10T14:26:05.130
|
2011-05-05T22:10:11.960
| 75,500 | 75,500 |
[
"silverlight",
"silverlight-4.0",
"mvvm",
"prism-4",
"region-management"
] |
5,852,453 | 1 | null | null | 7 | 41,058 |
Does anyone know how can I center a title to the center in asp:GridView?
Example:

and my code as below:
```
<table border="0" width="500">
<tr>
<td width="450px" align="center">
<asp:GridView ID="grid" runat="server" AutoGenerateColumns="False"
DataSourceID="dsTest" DataKeyNames="id"
CellPadding="6" GridLines="None" AllowPaging="True" PageSize="20" AllowSorting="True" Width="450px">
<Columns>
<asp:TemplateField HeaderText=" Address" SortExpression="suburb, street">
<ItemTemplate>
<a style='cursor:pointer' href='#'>
<%# Eval("unit_number") %> <%# Eval("level_number") %> <%# Eval("street_number") %> <%# Eval("street") %>
<%# Eval("suburb") %> <%# Eval("postcode") %></a>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</td>
</tr>
</table>
```
Does anyone know how can I make the 'Address' to the center instead? I have tried to set a text-align:"center" in css for GridView, but it's doesn't seem working for me
Also... if I like to more all display address to the left, does anyone know how can I do it?
|
how to make heading title into the center in asp:GridView
|
CC BY-SA 3.0
| 0 |
2011-05-02T00:31:53.287
|
2019-11-25T23:42:19.073
|
2011-05-02T00:37:48.680
| 52,745 | 52,745 |
[
"c#",
".net"
] |
5,852,935 | 1 | 5,852,970 | null | 3 | 5,444 |
I know this is a basic question but I'm blanking out when it comes to this... I was able to change the background color via the xib UI, but when I run the program it doesn't change the color and reverts back to the default color. Do I need to do something else besides change the color in the right hand side column?

Output:

|
Change background color of xib file?
|
CC BY-SA 3.0
| null |
2011-05-02T02:12:10.270
|
2011-05-02T02:18:04.113
|
2011-05-02T02:16:06.667
| null | 382,906 |
[
"objective-c",
"ios",
"background",
"xib"
] |
5,852,945 | 1 | 5,853,149 | null | 1 | 233 |
I have this schema:
```
Hotel (**hotelNo**, hotelName, city)
Room (**roomNo, hotelNo**, type, price)
Booking (**hotelNo, guestNo, dateFrom**, dateTo, roomNo)
Guest (**guestNo**, guestName, guestAddress)
** denotes primary keys
```
I have to complete this query:
-
I have this query, which isn't quite correct:
```
SELECT r.hotelno, type, count(*)
FROM Hotel h, room r
WHERE h.hotelNo = r.hotelno
GROUP BY r.hotelNo, type;
```
This is what it outputs:

What am I doing wrong?
|
SQL query assistance
|
CC BY-SA 3.0
| null |
2011-05-02T02:13:30.107
|
2011-05-02T03:04:19.917
|
2011-05-02T02:43:42.867
| 15,168 | 604,114 |
[
"sql"
] |
5,853,009 | 1 | 5,867,804 | null | -1 | 11,535 |
I have trouble automating a simple JSF login page that takes 4 inputs (client code, system code, user and password) and takes to the administration page. The below test is behaving differently with each of the drivers and all of them are unsuccessful. I have looked at the html code from the browser (view source) and I see all the input type elements are present with proper id's.
## UPDATE
I was able to make the code work correctly with Firefox with the below change (submitting the form by explicitly clicking on the button rather than submitting he form). But other drivers are showing the same erroneous behavior as described.
```
driver.findElement(By.className("af_commandButton")).click();
```
---
Code
```
import junit.framework.Assert;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class LoginPage
{
public static void main(final String[] args)
{
// WebDriver driver = new InternetExplorerDriver();
// WebDriver driver = new HtmlUnitDriver();
WebDriver driver = new ChromeDriver();
// WebDriver driver = new FirefoxDriver();
try
{
driver.get("http://domain:port/coco/webapp/login/login.faces");
driver.findElement(By.id("clientCode")).sendKeys("coco");
driver.findElement(By.id("systemCode")).sendKeys("consumer");
driver.findElement(By.id("userId")).sendKeys("ffadmin");
driver.findElement(By.id("password")).sendKeys("password1");
driver.findElement(By.id("LoginloginForm")).submit();
// driver.findElement(By.id("login")).click();
Assert.assertTrue(driver.getPageSource().contains("Administration"));
}
catch (Exception e)
{
e.printStackTrace();
}
finally
{
driver.quit();
}
}
}
```
Incorrectly filling in the information as shown below

```
org.openqa.selenium.NoSuchElementException: Unable to find element with id == clientCode (WARNING: The server did not pr
ovide any stacktrace information)
System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.6.0_24'
Driver info: driver.version: RemoteWebDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:131)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:105)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:409)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:192)
at org.openqa.selenium.remote.RemoteWebDriver.findElementById(RemoteWebDriver.java:209)
at org.openqa.selenium.By$1.findElement(By.java:66)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:184)
at LoginPage.main(LoginPage.java:22)
```
Fills in the information properly as shown below but nothing happens when the form is submitted with the posted code and I get the shown exception

```
Exception in thread "main" junit.framework.AssertionFailedError: null
at junit.framework.Assert.fail(Assert.java:47)
at junit.framework.Assert.assertTrue(Assert.java:20)
at junit.framework.Assert.assertTrue(Assert.java:27)
at LoginPage.main(LoginPage.java:30)
```
```
org.openqa.selenium.WebDriverException: Cannot locate element used to submit form
System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.6.0_24'
Driver info: driver.version: unknown
at org.openqa.selenium.htmlunit.HtmlUnitWebElement.submitForm(HtmlUnitWebElement.java:155)
at org.openqa.selenium.htmlunit.HtmlUnitWebElement.submit(HtmlUnitWebElement.java:108)
at LoginPage.main(LoginPage.java:27)
```
```
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html dir="ltr" lang="en-US">
<head>
<meta name="generator" content=
"HTML Tidy for Windows (vers 14 February 2006), see www.w3.org">
<meta name="generator" content="Apache Trinidad">
<link rel="stylesheet" charset="UTF-8" type="text/css" href=
"/coco/webapp/adf/styles/cache/interconnect-zcl0st-en-ltr-webkit.css">
<script type="text/javascript">
var _AdfWindowOpenError='A popup window blocker has been detected in your browser. Popup blockers interfere with the operation of this application. Please disable your popup blocker or allow popups from this site.';
</script>
<script type="text/javascript" src=
"/coco/webapp/adf/jsLibs/Common1_0_8.js">
</script>
<script type="text/javascript">
_defaultTZ()
</script>
<link rel="stylesheet" href="../skins/interconnect/trinidad-components.css"
type="text/css">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" src="../Assets/jquery-1.3.2.min.js" type=
"text/javascript">
</script>
<script language="JavaScript" src="../Assets/vsFunctions.js" type=
"text/javascript">
</script>
<script language="JavaScript" src="../Assets/ic-script.js" type=
"text/javascript">
</script>
<script language="JavaScript" src="../Assets/timezone.js" type=
"text/javascript">
</script><!--[if lte IE 6]>
<link rel="stylesheet" type="text/css" href="../Assets/ie6fixes.css" />
<script language="JavaScript" src="../Assets/ie6-script.js"></script>
<![endif]--><!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="../Assets/ie7fixes.css" />
<script language="JavaScript" src="../Assets/ie7-script.js"></script>
<![endif]-->
<script type="text/javascript" language="JavaScript">
function disableButton(inputButton)
{
inputButton.disabled=true;
}
</script>
<title></title>
</head><!-- this is a placehold for application version-->
<body onload=
"return _chain('_checkLoad()','readTimeZoneOffset()',this,event)" onunload=
"_checkUnload(event)">
<a name="top" id="top"></a><noscript>This page uses JavaScript and requires
a JavaScript enabled browser.Your browser is not JavaScript
enabled.</noscript>
<div class="main-header">
<div id="header:header-branding" class="header-branding">
<div id="header:clientbrand" class="client-brand">
<img id="header:client-image" name="header:client-image" src=
"/coco/webapp/skins/interconnect/client-logo.gif">
</div>
</div>
<form id="header:_id5" name="header:_id5" style="margin:0px" method=
"post" onkeypress="return _submitOnEnter(event,'header:_id5');" action=
"/coco/webapp/login/login.faces">
<div id="header:basebar" class="basebar">
<div id="header:finish-right-bar" class="finish-right-bar">
<ul class="navbar navBarHelp"></ul>
</div>
</div><input type="hidden" name=
"org.apache.myfaces.trinidad.faces.FORM" value="header:_id5"><span id=
"tr_header:_id5_Postscript"><input type="hidden" name=
"org.apache.myfaces.trinidad.faces.STATE" value=
"!24835796"><script type="text/javascript">
function _header__id5Validator(f,s){return true;}
</script></span><script type="text/javascript">
_submitFormCheck();
</script>
</form>
<div class="rule"></div>
</div>
<div class="main-menu">
<div class="rule"></div>
</div>
<div id="content" class="compact content split-lines">
<div class="content">
<div class="locale">
<form id="localeChanger" name="localeChanger" class="spacingDisplay"
style="margin:0px" method="post" onkeypress=
"return _submitOnEnter(event,'localeChanger');" action=
"/coco/webapp/login/login.faces">
<div class="locale-links">
<a href="#" onclick=
"submitForm('localeChanger',1,{source:'changeLocale_en'});return false;"
id="changeLocale_en" title="English version" name=
"changeLocale_en"><img id="flagUSA" src=
"/coco/webapp/Images/upgrade/flag_english.jpg" alt=
"English version" border="0" name="flagUSA"></a><a href="#"
onclick=
"submitForm('localeChanger',1,{source:'changeLocale_es'});return false;"
id="changeLocale_es" title="Spanish version" name=
"changeLocale_es"><img id="flagSPAIN" src=
"/coco/webapp/Images/upgrade/flag_spanish.jpg" alt=
"Spanish version" border="0" name="flagSPAIN"></a><a href="#"
onclick=
"submitForm('localeChanger',1,{source:'changeLocale_fr'});return false;"
id="changeLocale_fr" title="French version" name=
"changeLocale_fr"><img id="flagFRANCE" src=
"/coco/webapp/Images/upgrade/flag_french.jpg" alt=
"French version" border="0" name="flagFRANCE"></a><a href="#"
onclick=
"submitForm('localeChanger',1,{source:'changeLocale_pt'});return false;"
id="changeLocale_pt" title="Portuguese version" name=
"changeLocale_pt"><img id="flagBRASIL" src=
"/coco/webapp/Images/upgrade/flag_portuguese.jpg" alt=
"Portuguese version" border="0" name="flagBRASIL"></a>
</div><input type="hidden" name=
"org.apache.myfaces.trinidad.faces.FORM" value=
"localeChanger"><span id="tr_localeChanger_Postscript"><input type=
"hidden" name="org.apache.myfaces.trinidad.faces.STATE" value=
"!24835796"><script type="text/javascript">
function _localeChangerValidator(f,s){return true;}
</script></span><script type="text/javascript">
_submitFormCheck();
</script>
</form>
</div>
<form id="LoginloginForm" name="LoginloginForm" class="spacingDisplay"
style="margin:0px" method="post" onkeypress=
"return _submitOnEnter(event,'LoginloginForm','login');" action=
"/coco/webapp/login/login.faces">
<h1 class="pageTitle">
User Authentication
</h1>
<div class="wizard">
<div class="section">
<div class="content">
<div class="input">
<div class="field">
<span class="label"><label for="clientCode">Client
Code</label></span>
<div class="content">
<script type="text/javascript">
var _locale='en-US';var _tLocale='en-US';
</script><script type="text/javascript" src=
"/coco/webapp/adf/jsLibs/resources/LocaleElements_en_US1_0_8.js?loc=en_US">
</script><span class="af_inputText p_AFRequired"><input id="clientCode"
name="clientCode" class="af_inputText_content" size="30"
maxlength="20" type="text"></span>
</div>
</div>
<div class="field">
<span class="label"><label for="systemCode">System
Code</label></span>
<div class="content">
<span class="af_inputText p_AFRequired"><input id=
"systemCode" name="systemCode" class=
"af_inputText_content" size="30" maxlength="20" type=
"text"></span>
</div>
</div>
<div class="field">
<span class="label"><label for="userId">User
Id</label></span>
<div class="content">
<span class="af_inputText p_AFRequired"><input id=
"userId" name="userId" class="af_inputText_content" size=
"30" maxlength="20" type="text"></span>
</div>
</div>
<div class="field">
<span class="label"><label for=
"password">Password</label></span>
<div class="content">
<span class="af_inputText p_AFRequired"><input id=
"password" name="password" onkeydown=
"return _clearPassword(this, event);" class=
"af_inputText_content" size="30" maxlength="20" type=
"password"></span>
</div>
</div>
</div><img class="wizard-graphic" src=
"../Images/upgrade/safe_box.jpg">
<div class="section">
<button id="login" name="login" type="button" onclick=
"submitForm('LoginloginForm',1,{source:'login'});return false;"
class="action af_commandButton">Log In</button><button id=
"forgotPassword" name="forgotPassword" type="button" class=
"action af_goButton" onclick=
"document.location='../forgotpassword/ForgotPassword.faces'">Password
Help</button>
</div>
</div>
</div>
</div>
<div class="legalNoticeLogin">
<div class="section">
<div class="content">
<div id="legalCopy" class="copy">
<div class="xcopy af_outputDocument">
<p class="af_outputDocument_paragraph">
<b>IMPORTANT - READ CAREFULLY</b>
</p>
<p class="af_outputDocument_paragraph">
The private Web site you are about to enter
</p>
</div>
</div>
</div>
</div>
</div><input type="hidden" name=
"org.apache.myfaces.trinidad.faces.FORM" value=
"LoginloginForm"><span id="tr_LoginloginForm_Postscript"><input type=
"hidden" name="org.apache.myfaces.trinidad.faces.STATE" value=
"!24835796"><script type="text/javascript">
function _LoginloginFormValidator(f,s){return true;}
</script></span><script type="text/javascript">
_submitFormCheck();
</script>
</form>
</div>
</div>
</body>
</html>
```
|
What is wrong with the below selenuim 2/webdriver test?
|
CC BY-SA 3.0
| null |
2011-05-02T02:27:01.293
|
2012-04-27T10:14:03.407
|
2011-05-02T17:28:28.080
| 127,320 | 127,320 |
[
"java",
"testing",
"selenium",
"webdriver",
"selenium-webdriver"
] |
5,853,132 | 1 | null | null | 2 | 710 |
Here are some examples of (from Wikipedia):


I've tried to find any information, papers or library code that do something like this. Does anyone know about this algorithm or where can I find some information about this? Something close to this algorithm would be nice.
|
Advanced image color algorithm
|
CC BY-SA 3.0
| 0 |
2011-05-02T02:58:13.593
|
2014-08-19T17:33:38.987
|
2017-02-08T14:32:06.550
| -1 | 713,383 |
[
"image",
"algorithm",
"image-processing"
] |
5,853,164 | 1 | 5,853,199 | null | 1 | 1,516 |
I am looking to plot a graph that depicts a clock signal. The following is what I am looking forward to plot.
I have say four objects. Object one is either in state 1 or state 0 for a particular length of time. I also have to mention (some where on the top of the clock signal) how long is the zero period and how long is the 1 period.
I have to do the above procedure for rest of the three objects one over the other so that I can compare those clock signal type graphs. I have attached an image I want something on the lines of this image. Where out2 out1 etc are my objects and I mention the length of each 0 or 1 state above each graph. I do not want those clock and reset signals.
Can some one tell me what type of graph should I user from matplotlib library for this type of representation? how to plot each signal one over the other?

|
python matplotlib clock signal type graph help:
|
CC BY-SA 3.0
| null |
2011-05-02T03:08:51.370
|
2016-07-26T09:15:28.770
|
2016-07-26T09:15:28.770
| 2,666,859 | 690,682 |
[
"python",
"matplotlib"
] |
5,853,375 | 1 | 5,853,480 | null | 0 | 93 |
Take a look at my fiddle here:
[http://jsfiddle.net/DmcEB/46/](http://jsfiddle.net/DmcEB/46/)
As you can see, it's a little wonky. I want it to look a little more like this:

Any help would be much appreciated.
``
|
Tree-like Connectors in Table
|
CC BY-SA 3.0
| null |
2011-05-02T04:06:36.287
|
2017-03-09T15:48:55.967
|
2017-03-09T15:48:55.967
| 4,370,109 | 251,257 |
[
"css",
"ruby-on-rails",
"tree",
"tabular"
] |
5,853,504 | 1 | 5,857,053 | null | 2 | 3,695 |
Please can you help me with the following questions?
1. How do I rotate (about the Z axis) a camera position around a Vector3 as pivot?
2. How do I rotate (about the Z axis) a quad object positioned in front of that camera and make sure that the quad always faces the camera around the same Vector3 pivot?
The picture to explain it is below:

Please kindly answer, thank you
|
XNA 3D Camera & Billboard Camera Facing Rotation
|
CC BY-SA 3.0
| null |
2011-05-02T04:38:22.407
|
2012-09-17T02:43:01.900
|
2012-01-18T18:35:18.613
| 499,449 | 733,916 |
[
"xna"
] |
5,853,543 | 1 | 5,853,613 | null | 7 | 21,860 |
I want to delete all rows older than 5 days, in my table.
My table have a createdOn column of type date can u suggest me the query.
I m using mySql database
now i wrote folloiwng query
```
SELECT * from `user_games` where created_on >= DATE_SUB(created_on, INTERVAL 5 DAY)
```
to see the user_games which are five days old
but always i m getting same result even when i run query for Invterval 1 Day or Interval 5 day

while today curdate is 2011-5-2
|
Deleting all rows older than 5 days
|
CC BY-SA 3.0
| 0 |
2011-05-02T04:49:56.140
|
2017-04-25T07:38:06.183
|
2011-05-02T05:03:29.330
| 395,661 | 395,661 |
[
"php",
"mysql",
"sql"
] |
5,853,538 | 1 | null | null | 4 | 1,782 |
I am trying to upload a file using this code:
```
<form id="form1" action="convert" enctype="multipart/form-data" method="post">
<input type="file" name="file"/>
<div><input id="submit_button" type="submit" value="Upload"/></div>
</form>
class Convert(RequestHandler):
@login_required
def post(self):
session = Session(writer="cookie", session_expire_time = 3600, set_cookie_expires = True)
if session['id']:
file = self.request.POST['file']
if file and file.type and file.value:
```
but I keep on getting this error:
```
if file and file.type and file.value:
File "C:\Python25\lib\cgi.py", line 633, in __len__
return len(self.keys())
File "C:\Python25\lib\cgi.py", line 609, in keys
raise TypeError, "not indexable"
```
funny thing is, this used to work! what is wrong here? note, I am using webapp2.

also [this](http://docs.python.org/library/cgi.html) page says: The FieldStorage instance can be indexed like a Python dictionary. It allows membership testing with the in operator, and also supports the standard dictionary method keys() and the built-in function len()
full stacktrace:
```
Traceback (most recent call last):
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 3858, in _HandleRequest
self._Dispatch(dispatcher, self.rfile, outfile, env_dict)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 3792, in _Dispatch
base_env_dict=env_dict)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 580, in Dispatch
base_env_dict=base_env_dict)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 2918, in Dispatch
self._module_dict)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 2822, in ExecuteCGI
reset_modules = exec_script(handler_path, cgi_path, hook)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 2704, in ExecuteOrImportScript
script_module.main()
File "C:\myproject\main.py", line 16, in main
run_wsgi_app(application)
File "C:\Program Files\Google\google_appengine\google\appengine\ext\webapp\util.py", line 98, in run_wsgi_app
run_bare_wsgi_app(add_wsgi_middleware(application))
File "C:\Program Files\Google\google_appengine\google\appengine\ext\webapp\util.py", line 116, in run_bare_wsgi_app
result = application(env, _start_response)
File "C:\myproject\webapp2\__init__.py", line 1053, in __call__
return self.wsgi_app(environ, start_response)
File "C:\myproject\webapp2\__init__.py", line 1098, in wsgi_app
self.handle_exception(request, response, e)
File "C:\myproject\webapp2\__init__.py", line 1092, in wsgi_app
self.router.dispatch(self, request, response, match)
File "C:\myproject\webapp2\__init__.py", line 949, in dispatch
handler.handle_exception(e, app.debug)
File "C:\myproject\webapp2\__init__.py", line 942, in dispatch
getattr(handler, method)(*args)
File "C:\myproject\py\decorators.py", line 15, in decorated
return _login_required (self) or func(self, *args, **kwargs)
File "C:\myproject\py\document.py", line 42, in post
if file and file.type and file.value:
File "C:\Python25\lib\cgi.py", line 633, in __len__
return len(self.keys())
File "C:\Python25\lib\cgi.py", line 609, in keys
raise TypeError, "not indexable"
TypeError: not indexable
```
the way i fixed it is to rip out `if file:` and instead check if self.request.POST has key 'file' using python has_key method
|
getting TypeError, "not indexable" upon execution of if self.request.POST['file'] inside post method of webapp2.RequestHandler
|
CC BY-SA 3.0
| 0 |
2011-05-02T04:48:05.827
|
2014-02-23T08:41:48.287
|
2011-07-22T07:29:59.553
| 125,967 | 147,530 |
[
"google-app-engine",
"webapp2"
] |
5,853,592 | 1 | 5,864,078 | null | 0 | 300 |
Okay, I'm trying to replicate the shortcuts which get placed on the homescreen when creating a contact shortcut, example shown:

I've got a working QuickContactBadge, which when clicked shows the QuickContact toolbar. However, I have two things I'm having trouble with.
One is the picture. I tried using the code from [this question](https://stackoverflow.com/questions/2610786/contacts-quey-with-name-and-picture-uri) (I altered it by adding a parameter to pass in the contact ID). I then assign the image to my QuickContactBadge as so:
```
bdg.setImageURI(getPhotoUri(cid));
```
It definitely gets pictures, but it is getting TOTALLY the wrong picture. As illustrated here:

As you can see, the image it returned for Domino's is clearly NOT the Domino's logo.
I'm getting my contact ID to pass to the function from this code:
```
public static String[] ContactsProjection = new String[] {
Contacts._ID,
Contacts.LOOKUP_KEY,
Contacts.DISPLAY_NAME
};
public static Cursor getContacts() {
ContentResolver cr = CoreLib.ContentResolver();
Cursor contacts = cr.query(
ContactsContract.Data.CONTENT_URI,
ContactsProjection,
null, null,
Contacts.TIMES_CONTACTED + " DESC"
);
return contacts;
}
```
Which I believe should be returning me the proper ID for each record. Yes?
Next how do I get exactly the thumbnail shrunk or cropped as the shortcut shows it?
I was a little disappointed to see that the QuickContactBadge doesn't actually replicate the whole look and feel of the QuickContact shortcut, ... but just acts as in invocation target for the QuickContact card. Is there any built in way to easily replicate the contact shortcut in it's entirety, invocation, image, text and all, without needing to reproduce the whole thing from scratch?
|
Trying to replicate android homescreen Contact shortcuts, with issues
|
CC BY-SA 3.0
| null |
2011-05-02T05:00:18.600
|
2011-05-03T01:12:33.590
|
2017-05-23T11:47:43.680
| -1 | 80,209 |
[
"android",
"layout",
"android-layout",
"quickcontact"
] |
5,853,669 | 1 | null | null | 0 | 208 |
Consider I have a `<div style="margin-top:50px">` and I need to places items in it relatively. There are some elements above `<div>`. For example, I have a `<input type="text" />` and a button. I need to place this at the bottom of the `<div>` with text input being on left side aligned to parent and and button aligned to right of the parent. The input text must fill the width to button. I dont want to hardcode the `px` or `em`.
How do I achieve this ?
Edit: This is how it must look like.

Now I dont want to specify the length of text input. What I want is the button to be rendered to the right bottom of div and text input must set its width accordingly so as to fill space.
|
How to place items relatively in HTML?
|
CC BY-SA 3.0
| null |
2011-05-02T05:17:31.130
|
2011-05-07T07:39:07.543
|
2011-05-02T08:55:16.467
| 368,084 | 368,084 |
[
"html",
"css"
] |
5,853,792 | 1 | 5,862,767 | null | 1 | 995 |
I have some labels in my app like this...

What i need to do is, when clicking on a label, just I'm showing label name in the bottom of the screen. It works fine while clicking on each cell separately. But i want to show the changes even the user click on a particular label and move his finger on another label. That is, once he pressed on screen, where ever his finger moves, i want to trace those places and want to show the changes. How can i do this? Please explain briefly.
Thanks in Advance
|
How to support touch move across various objects?
|
CC BY-SA 3.0
| null |
2011-05-02T05:40:50.327
|
2011-05-03T07:06:14.107
|
2011-05-02T21:38:01.003
| 214,350 | null |
[
"ios",
"touchesmoved"
] |
5,854,053 | 1 | null | null | 1 | 1,963 |
I'm working on an assembly program using the emu8086. The program uses the built-in robot device to emulate a virtual robot on a simulated 6x9 map. The map will contain unknown amounts of walls and lamps(lit/unlit) in which the robot is to traverse through the map and located all the unlit lamps and light them. The robot itself, can only take data from adjacent squares in which the robot is facing, and also can rotate in only 90 degree turns.
The project suggests that the upper-left hand corner will be the origin of the coordinate system (0,0).

I understand how to interface the robot with my code to move and examine data, however, I'm not sure of how to efficiently travel through and check for all lamps on the entire map, without falling into an infinite loop or dead end.
I've read about using several search algorithm such as the breadth-first and depth-first search algorithms, but I am unsure of how to implement such concepts in assembly (as most of the example/psuedocode is written in c++/c#/etc).
I'm not asking for any specific coding, but insight on how to implement those search functions. Since the problem mentions an origin for a coordinate system, I made a 2d array in which to take values for objects at certain coordinates. Not sure how important the array is for the problem, but any help would be appreciated.
|
Issue with robot exploration in Assembly (emu8086)
|
CC BY-SA 3.0
| 0 |
2011-05-02T06:23:05.253
|
2013-04-14T11:10:22.700
|
2011-11-27T02:47:37.143
| 234,976 | 733,993 |
[
"assembly",
"robot",
"x86-16"
] |
5,854,263 | 1 | 5,854,736 | null | 0 | 3,566 |
I am using JSF 1.2 framework. Right now i am trying to implement a file upload process in which the number of files to be uploaded is controlled by the end user. Please find the below snapshot and code snippet for reference.

```
<a4j:commandLink action="#{importWSDLBean.xsdLoopIncrementAction}" reRender="WSDLPanelGrid">
<h:graphicImage value="/images/plus_icon.gif" />
</a4j:commandLink>
<a4j:commandLink action="#{importWSDLBean.xsdLoopDecrementAction}" reRender="WSDLPanelGrid">
<h:graphicImage value="/images/minus_icon.gif" />
</a4j:commandLink>
<h:panelGrid id="WSDLPanelGrid">
<c:forEach items="#{importWSDLBean.acscDataList}" var="inputFUpload">
<t:inputFileUpload id="#{inputFUpload.id}" value="#{inputFUpload.value}" />
</c:forEach>
</h:panelGrid>
```
```
public String xsdLoopIncrementAction() {
if (acscDataList == null) {
acscDataList = new ACSCDataList(new ArrayList());
HtmlInputFileUpload htmlUpload = new HtmlInputFileUpload();
htmlUpload.setId("upload" + (acscDataList.size() + 1));
acscDataList.add(htmlUpload);
} else {
HtmlInputFileUpload htmlUpload = new HtmlInputFileUpload();
htmlUpload.setId("upload" + (acscDataList.size() + 1));
acscDataList.add(htmlUpload);
}
return "success";
}
public String xsdLoopDecrementAction() {
if (acscDataList != null) {
if (acscDataList.size() > 0) {
acscDataList.remove(acscDataList.size() - 1);
}
}
return "success";
}
```
This implementation resets the file upload values whenever i increment or decrement the no. of file upload fields. Also when i submit the form i cant able to get the UploadedFile object (File Upload prerequisite such as Form type and Web.xml configuration is also included).
Can anyone help me out?
|
Multiple File Uploads - JSF
|
CC BY-SA 3.0
| null |
2011-05-02T06:51:20.063
|
2013-01-24T08:15:06.580
|
2020-06-20T09:12:55.060
| -1 | 596,465 |
[
"java",
"jsf",
"file-upload",
"jsf-1.2"
] |
5,854,360 | 1 | 6,502,103 | null | 2 | 956 |

My development env: Windows 7, TortoiseHg, ASP.NET 4.0/MVC3
Test branch: code on test server
Prod branch: code on production server
This is my current branching model. The reason to branch out every task (feature) is because some features go to live slower. So in above graph, task 1 finished earlier (changeset #5), and merge into test branch for testing. However, due to bug or modification of original request, changesets #10, #12 have been made. While task 2 has finished testing #8 and pushed to live #9 already.
My problem is every time when modifying task branch (like #10, #12), I have to do another merge to test branch (#11, #13), this makes the graph very messy.
Is there any way to solve this issue? Or any better branching model?
|
Mercurial Branching Model for task features
|
CC BY-SA 3.0
| 0 |
2011-05-02T07:03:41.350
|
2011-06-28T05:46:06.537
| null | null | 248,430 |
[
"mercurial",
"branch"
] |
5,854,498 | 1 | 5,854,688 | null | 0 | 13,272 |
How to make a form always stay on top of another form.
Also both form's enabled property must be true
I don't wanna make use of topmost property.
Edit 1 :
Another similar question in C# says you can use [Form.Owner Property](http://msdn.microsoft.com/en-us/library/system.windows.forms.form.owner.aspx) to do the trick , how to make use of this property ?
Edit 2 : The Owner Property works fine untill I try to open it the second time.
This is the error message I get

|
How to make a form always stay on top of another form
|
CC BY-SA 3.0
| 0 |
2011-05-02T07:22:27.197
|
2011-05-02T23:25:08.100
|
2011-05-02T23:25:08.100
| 722,000 | 722,000 |
[
"vb.net",
"winforms"
] |
5,854,592 | 1 | 7,547,774 | null | 4 | 2,755 |
when I'm trying to deploy to an IIS7 website using Web Deploy, one of the options is to Mark as an IIS Application on destination.
What does this mean when have it ticked on or off?

|
What is the Visual Studio's Web Deploy "Mark as an IIS Application on destination" mean?
|
CC BY-SA 3.0
| 0 |
2011-05-02T07:36:33.113
|
2011-09-25T18:50:00.677
| null | null | 30,674 |
[
"visual-studio-2010",
"iis-7",
"web-deployment",
"webdeploy"
] |
5,854,721 | 1 | 5,868,572 | null | 2 | 8,377 |
I have this problem. I got a heatmap, (but i suppose this applies to every plot) but I need to mirror my y-axis.
I got here some example code:
```
library(gstat)
x <- seq(1,50,length=50)
y <- seq(1,50,length=50)
z <- rnorm(1000)
df <- data.frame(x=x,y=y,z=z)
image(df,col=heat.colors(256))
```
This will generate the following heatmap

But I need the y-axis mirrored. Starting with 0 on the top and 50 on the bottom. Does anybody has a clue as to what I must do to change this?

|
R: mirror y-axis from a plot
|
CC BY-SA 3.0
| 0 |
2011-05-02T07:52:02.777
|
2011-05-03T11:11:10.423
| null | null | 717,132 |
[
"r",
"mirror",
"heatmap",
"axes"
] |
5,854,818 | 1 | 5,855,123 | null | 12 | 32,180 |
At this line of code i am getting the error as i mentioned
I declared MSMQ_NAME as string as follows
```
private const string MSMQ_NAME = ".\\private$\\ASPNETService";
private void DoSomeMSMQStuff()
{
using (MessageQueue queue = new MessageQueue(MSMQ_NAME))
{
queue.Send(DateTime.Now); //Exception raises
queue.Close();
}
}
```


|
Message Queue Exception : Queue does not exist or you do not have sufficient permissions to perform the operation
|
CC BY-SA 3.0
| 0 |
2011-05-02T08:04:36.750
|
2017-10-06T11:30:49.897
|
2011-05-02T08:55:33.200
| 388,388 | 388,388 |
[
"c#",
"asp.net",
"mysql",
"message-queue"
] |
5,855,165 | 1 | 6,146,846 | null | 1 | 2,268 |
We are working on Objective C application for desktop Mac.
We use WebView component to display HTML pages.
When the page is loaded from the local file system, Flash movies are not displayed on the page.
As it turned out the problem is not exactly about Flash.
Most WebView plugins are missing.

When the page is loaded from the Internet, Flash is displayed properly and there are many plugins available.

The problem does not occur on my Mac, but it happens to 30% of our customers.
It is reproduced on MacBook (not MacBook air), Mac OS version is 10.5.8.
Guys, please help us, I have no idea how to tackle this.
This is the only obstacle preventing us from the product release.
Why WebView plugins are not available when a local page is loaded?
What can be the source of the problem - Safari configuration, Mac security settings, some software installed?
How can I reproduce the problem on my Mac?
This is our WebView initialization code for local page loading.
```
IBOutlet WebView* webView;
...
[[webView preferences] setPlugInsEnabled:YES];
WebFrame *mainFrame = [webView mainFrame];
NSString* path = [NSString stringWithFormat:@"%@/page.html",[[NSBundle mainBundle] resourcePath]];
NSURL* url = [NSURL fileURLWithPath:path];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[mainFrame loadRequest:request];
```
Have you noticed any flaws?
UPDATE 1
[Test application](http://yowindow.com/perm/WebView.zip)
[Source code](http://yowindow.com/perm/WebView_src.zip)
UPDATE 2
Minimal test, I have left only the code necessary to open the local page.
No diagnostic window displayed.
[Test application, simple](http://yowindow.com/perm/WebView_simple.zip)
Full source code for Application Delegate of the simple test
```
#import "WebViewAppDelegate.h"
#import <WebKit/WebView.h>
#import <WebKit/WebFrame.h>
@implementation WebViewAppDelegate
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
[[webView preferences] setPlugInsEnabled:YES];
WebFrame *mainFrame = [webView mainFrame];
NSString* path = [NSString stringWithFormat:@"%@/page.html",[[NSBundle mainBundle] resourcePath]];
NSURL* url = [NSURL fileURLWithPath:path];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[mainFrame loadRequest:request];
}
@end
```
|
Mac OS/WebView: Why Flash and other plugins are not available when a local page is loaded?
|
CC BY-SA 3.0
| null |
2011-05-02T08:47:27.577
|
2011-05-27T01:18:18.360
|
2011-05-26T15:00:40.300
| 139,412 | 139,412 |
[
"flash",
"macos",
"webview"
] |
5,855,163 | 1 | 5,855,239 | null | 2 | 696 |
Ok, so I'm working on speeding up the time it takes to load my server. Mainly pre-loading the user accounts from the database, and adding them to a list of player objects with 13 variables apiece.
I had decided that the first step was to see which parts of the system were taking the longest, so I setup DateTime variables to count the number of milliseconds each piece of code took to execute.
We have about 40k accounts in the database, and they all load almost instantly into a list of strings that we then extrapolate into their variables, It's not the most efficient way to do things, but it's decent, as far as speed goes, and it both works and is error free.
anyway, it takes about 4 minutes to extrapolate the 40k accounts into their sub-sequent objects, setting the variables and adding the object to the list of preloaded data.
I added DateTime variables around each variable setting, and then ascertained the execution time, there was only one problem, all the numbers were 0, I presumed that I screwed up my code somewhere, so i tested it in a few different places, and it worked.
So, now I'm a little stumped, trying to figure out where all the time and CPU cycles are going.
```
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
```
I'm testing the initial object creation, 13 variables, the adding of the object to the list, then I output the overall time. It's not meant to be accurate, just to help me understand where I need to change things, I was a little upset at 40k lines of 0's
Is there something I'm missing? as far as i can tell, it shouldn't take more then 30 seconds (plus whatever the loop itself costs) to load this data.
Is DateTime just that inaccurate? or did I mess up somewhere, or...
I would appreciate any insight you may have into this.
Thank you for your time:
P.S. Just in case you want to see the whole code, this is it:
```
int pcounti = 0;
current.Text = "Pre-Loading Players."; bar.Value = 35;
List<string[]> p1 = SDB.get("Select * from players");
if (p1 != null)
{
int dbplayercount = p1.Count;
//REMOVE ME
List<string> tolog = new List<string>();
foreach (string[] s in p1)
{
// Check if this user already has a PDB
try
{
PDB temppdb = PDB.find(s[1].Trim().ToLower());
if (temppdb != null)
{
Console.WriteLine("Deleting");
SDB.donow("DELETE FROM players WHERE username = '" + s[1] + "' AND UID != " + temppdb.UID);
}
}
catch (Exception e)
{
Console.WriteLine("Error:");
Console.WriteLine(e.Message);
Console.WriteLine(e.StackTrace);
}
// Generate PDB
try
{
//We need the database to be all lowercase :D
if (HasCapitals(s[1])) SDB.donow("UPDATE players SET username = '" + s[1].ToLower() + "' WHERE username = '" + s[1] + "'");
DateTime one = DateTime.Now.ToUniversalTime();
PDB pdb = new PDB();
DateTime two = DateTime.Now.ToUniversalTime();
pdb.UID = Convert.ToInt64(s[0]);
DateTime three = DateTime.Now.ToUniversalTime();
pdb.username = s[1].Trim().ToLower();
DateTime four = DateTime.Now.ToUniversalTime();
pdb.password = s[3];
DateTime five = DateTime.Now.ToUniversalTime();
pdb.group = Byte.Parse(s[4]);
DateTime six = DateTime.Now.ToUniversalTime();
pdb.ip = s[10];
DateTime seven = DateTime.Now.ToUniversalTime();
pdb.color = s[11];
DateTime eight = DateTime.Now.ToUniversalTime();
try
{
pdb.warn = Convert.ToInt32(s[14]);
}
catch
{
pdb.warn = 0;
}
DateTime nine = DateTime.Now.ToUniversalTime();
try
{
pdb.money = Convert.ToInt32(s[15]);
}
catch
{
pdb.money = 0;
}
DateTime ten = DateTime.Now.ToUniversalTime();
foreach (string st in s[16].Split(','))
{
if (String.IsNullOrEmpty(st)) continue;
pdb.Allowed.Add(st);
}
DateTime eleven = DateTime.Now.ToUniversalTime();
foreach (string st in s[17].Split(','))
{
if (String.IsNullOrEmpty(st)) continue;
pdb.Denied.Add(st);
}
DateTime twelve = DateTime.Now.ToUniversalTime();
pdb.Title = s[18];
DateTime thirteen = DateTime.Now.ToUniversalTime();
foreach (string st in s[19].Split(','))
{
if (String.IsNullOrEmpty(st)) continue;
pdb.Titles.Add(st);
}
DateTime fourteen = DateTime.Now.ToUniversalTime();
PDB.DB.Add(pdb);
DateTime fifteen = DateTime.Now.ToUniversalTime();
int one1 = ((two - one).Milliseconds);
int two1 = ((three - two).Milliseconds);
int three1 = ((four - three).Milliseconds);
int four1 = ((five - four).Milliseconds);
int five1 = ((six - five).Milliseconds);
int six1 = ((seven - six).Milliseconds);
int seven1 = ((eight - seven).Milliseconds);
int eight1 = ((nine - eight).Milliseconds);
int nine1 = ((ten - nine).Milliseconds);
int ten1 = ((eleven - ten).Milliseconds);
int eleven1 = ((twelve - eleven).Milliseconds);
int twelve1 = ((thirteen - twelve).Milliseconds);
int thirteen1 = ((fourteen - thirteen).Milliseconds);
int fourteen1 = ((fifteen - fourteen).Milliseconds);
int fifteen1 = ((fifteen - one).Milliseconds);
string sta = one1 + " " + two1 + " " + three1 + " " + four1 + " " + five1 + " " + six1 + " " + seven1 + " " + eight1 + " " + nine1 + " " + ten1 + " " + eleven1 + " " + twelve1 + " " + thirteen1 + " " + fourteen1 + " " + fifteen1;
tolog.Add(sta);
pcounti++;
}
catch (Exception e)
{
Console.WriteLine("Error:");
Console.WriteLine(e.Message);
Console.WriteLine(e.StackTrace);
continue;
}
// write to file
StreamWriter sw = new StreamWriter(File.Create("test.txt"));
foreach (string st in tolog)
{
sw.WriteLine(st);
}
sw.Flush();
sw.Close();
}
}
```
Also, note, After writing most of this, I looked over it one last time, to make sure I didn't miss anything stupid, and realized i had not checked the first few lines of each loop, I added them to the checks and came out with the same thing.
Also, as a second note, it took 4 minutes "before" I added the performance checking, it doesn't take a lot longer now.
changing Milliseconds to TotalMilliseconds made a differance, but only in showing the results as doubles, rather then int's, resulting in a test output like this:
```
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0.9765 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0.9765 0 0 0 0 0 0 0 0 0 0 0 0.9765
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0.9766 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
```
The first number isn't added into the total at the end.
also, I should mention that every now and then there's a 1 mixed in with the 0's (there was the first time as well) but i'm still as stumped as I was before, time to profile.
The results of the profiling, note that all the time counters and the progress bar update at the end are not permanent, and were not there in the original course of events that led me to trying to do this in the first place. (ie 4-5 mins load time)

|
C# slow loading from database and extrapolating into objects
|
CC BY-SA 3.0
| null |
2011-05-02T08:47:13.640
|
2011-05-02T09:49:53.440
|
2011-05-02T09:49:53.440
| 606,625 | 606,625 |
[
"c#",
".net",
"object"
] |
5,855,194 | 1 | 5,990,468 | null | 3 | 5,481 |
I'm write a custom Drawable, a text over a bitmap:
```
@Override
public void draw(Canvas canvas) {
canvas.drawBitmap(badge, matrix, null);
canvas.drawText(count, size / 2, size / 2 + (text_size) / 2 , p);
}
```
When I use my drawable in an imageView, it's fine.

But if I use this with a textview (compound drawable) it's alignement is wrong.

I tried both setCompoundDrawablesWithIntrinsicBounds and setCompoundDrawables
Same results, what did I miss ?
Thanks.
|
Android Custom Drawable bounds
|
CC BY-SA 3.0
| null |
2011-05-02T08:50:56.217
|
2011-06-01T06:35:00.677
| null | null | 404,289 |
[
"android",
"drawable"
] |
5,855,548 | 1 | 5,856,260 | null | 0 | 1,482 |
I getting top 20 record from SQL Table
There is a column State in My MS SQL Table there are some numeric data,
In my case I skipped numeric records from C# function after I am getting duplicate results of City and Country,
for example 'Los Angeles','Venezuela' coming duplicates if I skipped state numeric data
using SQL scripts
also I want to get top records from the Country 'United states' in Descending order
I wrote query as below:-
```
Declare @sCity varchar(100),
SELECT Top 20 City,State,Country
FROM
[dbo].[Locations]
WHERE
City like @sCity+'%'
ORDER BY
[dbo].[AllWorldLocations].Country DESC,
[dbo].[AllWorldLocations].STATE ASC,
[dbo].[AllWorldLocations].City ASC
```
my table is like that

I want to get records descending order by country
```
Los Angeles California United States
Los Angeles Texas United States
Los Angeles Subdivision Texas United States
```
|
How to search duplicate records and order by columns from MSSQL Table without primary key?
|
CC BY-SA 3.0
| null |
2011-05-02T09:33:40.450
|
2011-05-02T15:02:13.580
|
2011-05-02T09:50:45.017
| 568,085 | 568,085 |
[
"sql",
"sql-server",
"sql-scripts"
] |
5,855,745 | 1 | 5,857,385 | null | -4 | 107 |
I want to add a button and associate menu to it , I mean like the screen shot in the following link be appear containing uipicker
I want to implement as attached uipicker as in the following screenshot: 
Original Image: [http://www.zshare.net/image/8968507074a9e0c0/](http://www.zshare.net/image/8968507074a9e0c0/)
any suggession please
|
How to implement that
|
CC BY-SA 3.0
| null |
2011-05-02T09:55:28.540
|
2011-05-02T12:55:05.343
|
2011-05-02T10:09:00.047
| 256,728 | 712,104 |
[
"iphone",
"cocoa-touch",
"ipad"
] |
5,855,821 | 1 | 5,856,270 | null | 0 | 1,303 |
Whew, that was a big one.

Right, so I have two points, on the boundary of the rectangle and also on the two lines, which are cast from the origin. The arrangement of P1/P2 is arbitrary, for the sake of simplicity.
My question is,
The implementation: I want to create a field-of-vision effect in a game that I am creating. The origin is the player, who can be anywhere on the current viewport (The rectangle). The lines' directions are offset from the direction that the player is facing. I intend to trace all positions on the green area from the origin, checking for obstructions.
|
Looping through the boundary of a rectangle between two points on the rectangle?
|
CC BY-SA 3.0
| null |
2011-05-02T10:03:15.520
|
2011-05-02T13:07:56.433
| null | null | 356,778 |
[
"c#",
"loops",
"line",
"intersection"
] |
5,855,837 | 1 | 5,857,703 | null | 0 | 2,595 |
I'm getting the following errors:
`javax.servlet.ServletException: Error instantiating servlet class auth.Login`
and
`java.lang.NoClassDefFoundError: javax/persistence/Persistence`
How do I ensure my project's configuration is properly setup?
To me, this look correct.

|
Getting ServletException and NoClassDefFoundError during webapp startup
|
CC BY-SA 3.0
| null |
2011-05-02T10:04:22.760
|
2011-05-02T13:32:25.847
|
2011-05-02T13:26:32.237
| 157,882 | 515,772 |
[
"java",
"jsp",
"servlets",
"jpa"
] |
5,855,988 | 1 | 5,856,430 | null | 0 | 1,577 |
I encounter a memory leak problem on the orientation change of my Activity. With the android tools and the Memory Analysis Perspective ([http://ttlnews.blogspot.com/2010/01/attacking-memory-problems-on-android.html](http://ttlnews.blogspot.com/2010/01/attacking-memory-problems-on-android.html)) I finally found the following problem:
During orientation change I save the data I need into an Inner class as you can see in the folowing code:
```
public class TestOrientation extends Activity {
private ActivityData mData;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.mylayout);
...
mData = (ActivityData) getLastNonConfigurationInstance();
...
}
@Override
public Object onRetainNonConfigurationInstance() {
return new ActivityData(dataToSave1, dataToSave2);
}
private class ActivityData {
public int mDataToSave1;
public String mDataToSave2;
public ActivityData(int dataToSave1, String dataToSave2) {
mDataToSave1 = dataToSave1;
mDataToSave2 = dataToSave2;
}
}
}
```
In the memory Memory Analysis Perspective I can see that the attribute mData keeps a reference to the activity Context so it's never deallocated. After a few orientation change I have a recursive reference:

To solve it I've declared the ActivityData in a separate file, but if somebody can explain me why I encounter this problem I would be great!
|
Memory leak during orientation change with inner class
|
CC BY-SA 3.0
| null |
2011-05-02T10:20:15.430
|
2011-05-02T11:13:55.293
| null | null | 384,483 |
[
"android"
] |
5,856,484 | 1 | 5,857,833 | null | 2 | 3,890 |
I am using the following code to convert contents in Editor(Ajax control) to pdf,
```
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.IO;
using iTextSharp.text.html.simpleparser;
using iTextSharp.text;
using iTextSharp.text.pdf;
using iTextSharp.text.html;
/// <summary>
/// Summary description for pdfgeneration
/// </summary>
public class pdfgeneration
{
public pdfgeneration()
{
//
// TODO: Add constructor logic here
//
}
public void pdfgenerator(String name1, AjaxControlToolkit.HTMLEditor.Editor Editor1)
{
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ContentType = "application/pdf";
// Create PDF document
Document pdfDocument = new Document(PageSize.A4, 70, 55, 40, 25);
PdfWriter wri = PdfWriter.GetInstance(pdfDocument, new FileStream("e://" +name1 + ".pdf", FileMode.Create));
PdfWriter.GetInstance(pdfDocument, HttpContext.Current.Response.OutputStream);
pdfDocument.Open();
string htmlText = Editor1.Content;
System.Collections.Generic.List<IElement> htmlarraylist = HTMLWorker.ParseToList(new StringReader(htmlText), null);
for (int k = 0; k < htmlarraylist.Count; k++)
{
pdfDocument.Add((IElement)htmlarraylist[k]);
}
pdfDocument.Close();
HttpContext.Current.Response.End();
}
}
```
I am initially hard coding the following HTML text in the Editor(Ajax control),
```
String editorcontent = "<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>" +
"<br/>" + "<P align='center'><b>" + courtname + "</b></P>"
+ "<br/><P align='center'>(Before" + jname + "," + desname + ")"
+ "<br/>" + "<P align='right'><b><u>" + DropDownList1.SelectedItem + " no. " + TextBox1.Text + "/" + TextBox2.Text + "</u></b> </P>"
+ "<br />"
**//this table is the problem//** + "<table><tr><td width='750px'><p align='left'>" + petitioner + "</p>" + "</td><td>" + "<p align='right'>" + "..Applicant" + "</p>" + "</td></tr>" + "<tr><td><p align='center'>" + "V/s" + "</p>" + "</td><td></td>" + "</tr>" + "<tr><td width='75px'><p align='left'>" + respondent + "</p>" + "</td><td>" + "<p align='right'>" + "..Respondent" + "</p>" + "</td></tr></table>"
+ "<br/><P align='center'><b><u>ORDER</u></b>";
Editor1.Content = editorcontent;
```
If i remove the following `table` from the above code than the pdf is generated successfully. but once i include that `table` in my HTMl code i get the following Error

How to resolve my problem.
|
Error converting HTML text to a pdf file using itextsharp in asp.net
|
CC BY-SA 3.0
| null |
2011-05-02T11:18:36.590
|
2018-01-22T14:49:50.347
|
2020-06-20T09:12:55.060
| -1 | 243,680 |
[
"asp.net",
"itext",
"pdf-generation",
"html-to-pdf"
] |
5,856,629 | 1 | 5,857,244 | null | 0 | 197 |
Hi I have created one gallery project. but I wish to created folders view gallery..I dont know how to create that kind of gallery...please post some sample full coding...
This is my current gallery view..

Expecting gallery image:

please help me......
|
how to change gallery view?
|
CC BY-SA 3.0
| null |
2011-05-02T11:33:15.613
|
2011-05-02T12:42:34.843
| null | null | 703,538 |
[
"java",
"android",
"gallery"
] |
5,856,677 | 1 | null | null | -1 | 6,973 |
I'm in the middle of trying to do the above but fail. referring to the image below, i need to insert five empty rows below the 4th row (john lee) and another five empty rows below 7th row (bryan key) and another five below 9th row (casey carton) and so on, i got 30+ groups of different name to do. wondering how to write vba for this? thanks.

|
Excel-VBA Insert five empty rows below each group of name
|
CC BY-SA 3.0
| null |
2011-05-02T11:39:14.700
|
2011-05-02T12:14:29.860
|
2018-07-09T19:34:03.733
| -1 | 716,377 |
[
"excel",
"vba"
] |
5,856,793 | 1 | null | null | 0 | 1,859 |
We're using SimpleCaptcha [http://simplecaptcha.sourceforge.net/](http://simplecaptcha.sourceforge.net/) to creating a captcha in our registration form (running on Tomcat)
We create the captcha using:
```
Captcha captcha = new Captcha.Builder(300, 57).build();
```
and the captcha is displayed as follows:

But when I add more options to the captcha such as `Captcha captcha = new Captcha.Builder(300, 57).addNoise().build();`, it's still displayed in the same way without the noise. I tried more options but still get the same results.
Does anyone know why this is happening please?
Thanks,
Kurt
|
Customizing SimpleCaptcha
|
CC BY-SA 3.0
| null |
2011-05-02T11:52:27.533
|
2014-11-16T13:49:56.833
|
2014-11-16T13:49:56.833
| 573,032 | 287,282 |
[
"captcha",
"simplecaptcha"
] |
5,856,802 | 1 | 5,856,803 | null | 0 | 1,239 |
Have setup a Wordpress site (V3.1.2) and have installed Download Monitor plugin to give me a [downloads gallery](http://www.dekho.com.au/download-gallery/).
The issue is that I get these blue bullet points next to download items in the left column:

It has its own CSS file, but from using Chrome Developer tools, it appears that it is picking up these bullet points from my Boldy theme:
```
#content #colLeft ul li, #content #colLeft ol li {
padding: 5px 0 5px 25px;
background: url(images/bullet_list.png) 0 8px no-repeat;
```
I am new to CSS and I am sure this is a noob question.
How can I create a rule to remove bullet points from this download gallery, whilst preserving the fact that in blog posts (like [this](http://www.dekho.com.au/crystal-reports-performance/)), I can still make use of bullet points?
|
Remove Bullet Points from a Wordpress plugin
|
CC BY-SA 3.0
| 0 |
2011-05-02T09:40:10.603
|
2011-05-03T07:27:04.723
| null | null | 269,099 |
[
"css",
"wordpress"
] |
5,856,823 | 1 | 5,911,549 | null | 12 | 10,255 |
i need to draw the following image 
The Gray part is what i want to draw over another image what is the Code i need to use using CGContext methods, i tried using the CGContextAddArc but failed because when i fill the stroke the center hollow is also filled with the grey texture.
Any help appreciated.
Info : I have the Complete Blue Image , i need to add the Semi Circle above the blue image
Thanks
|
Drawing Hollow circle in iPhone
|
CC BY-SA 3.0
| 0 |
2011-05-02T11:54:50.177
|
2019-01-19T10:51:52.900
| null | null | 264,271 |
[
"iphone",
"cgcontext",
"geometry"
] |
5,856,791 | 1 | 5,865,861 | null | 1 | 361 |
I have created a list in JQuery mobile asp.net webform application. Below is my code
```
<ul data-role="listview" data-theme="g">
<% foreach (string item in CustomerOrder())
{ %>
<li><a href="#"><% item.ToString();%></a></li>
<% } %>
</ul>
```
Where CustomerOrde is the public function on server side with List return type. I have placed breakpoint on this list and I can see it is being iterated and item is showing values, as expected.
But web page is showing empty list

Where I am wrong?
```
<ul data-role="listview" data-theme="g">
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
</ul>
```
|
Empty list in jquery mobile
|
CC BY-SA 3.0
| null |
2011-05-02T11:52:15.523
|
2011-05-04T11:31:54.610
|
2011-05-04T11:31:54.610
| 173,077 | 609,582 |
[
"asp.net",
"list"
] |
5,856,866 | 1 | null | null | 0 | 473 |
I need to create a Blackberry User interface which looks like the given image, where is an image,

I tried a lot to design this UI but could not succeed.
Can anybody help me to design this UI?
Thanks in Advance!
|
Ui design and development in blackberry
|
CC BY-SA 3.0
| 0 |
2011-05-02T12:00:00.093
|
2011-05-03T13:14:30.323
|
2011-05-02T12:52:08.130
| 1,288 | 685,290 |
[
"blackberry",
"user-interface",
"java-me"
] |
5,856,989 | 1 | 8,600,519 | null | 3 | 8,497 |
I am looking for a jQuery plugin that will visualize some objects(events) according to their dates an example of what I am looking for is:

I have tried and I am looking for other options.
Thanks alot
|
Looking for a good event timeline jQuery plugin
|
CC BY-SA 3.0
| null |
2011-05-02T12:13:35.013
|
2014-05-08T23:22:52.353
| null | null | 552,301 |
[
"javascript",
"jquery",
"jquery-plugins"
] |
5,857,124 | 1 | 5,857,168 | null | 0 | 754 |
I want texts with more than one line to wrap around like a single block of text, like for "Source" & "DEC" fields below, without using tables.

I guess I should be able to use inline-block to get this to work, but am not been successful.
Below is the simple html I'm working with:
```
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head id="head">
<title></title>
<style type="text/css">
.tt { color: #7777cc; width:85px; }
.cc { display: inline-block; }
</style>
</head>
<body>
<div class="g1">
<div class="expandable">
<span class="tt">Source </span><span class="cc">Neutron energy was varied by changing the
emission angle to the deuteron beam. The activities of the "2"3"7U and "2"3"1Th
residual nuclei were measured by a Ge(Li) and a HP Ge gamma-spectrometer, respectively.</span>
</div>
</div>
</body>
</html>
```
|
inline-block css
|
CC BY-SA 3.0
| null |
2011-05-02T12:28:02.007
|
2011-05-02T12:44:02.223
| null | null | 549,772 |
[
"html",
"css"
] |
5,857,163 | 1 | 5,857,323 | null | 2 | 2,605 |
I wonder how I accomplish the following in the `System.Windows.Forms.StatusStrip`

|
Coloring text in StatusStrip in WinForms
|
CC BY-SA 3.0
| null |
2011-05-02T12:33:13.957
|
2011-05-02T15:47:31.280
| null | null | 198,145 |
[
"c#",
"winforms",
"statusstrip"
] |
5,857,289 | 1 | null | null | 17 | 1,394 |
When it comes to Chinese characters, I am unable to get the Front End of Mathematica to use the fonts of my choice. How can I get it to use the fonts I need?
Here I provide two screenshots to show the problem, one from Word (top), the other from Mathematica on WinXP, both displaying the same string. Note that Mathematica uses several different fonts (I guess it uses font substitution when the font it tries to use first doesn't contain a glyph---however the font I specified contains all glyphs I need!). Here I use the font Microsoft YaHei, which comes with Win7, but is [downloadable](http://www.microsoft.com/downloads/en/details.aspx?FamilyID=b15774c0-5b42-48b4-8ba8-9293fdc72099) for XP too.
Here's some test code:
```
str = "肖诮陗俏削帩消峭捎绡莦弰悄焇琑逍㲖㲵䏴哨娋宵屑綃梢痟睄筲艄萷销䇌䘯趙揱旓硝稍踃輎矟䌃箾蛸誚榍蕱銷鞘潲碿糏霄䴛韒髾鮹鞩魈颵"
Style[str, Large, FontFamily -> "SimSun"]
```
(SimSun comes with XP and contain all these characters too, although not sure if in all versions.)
I am on Windows XP (with [East Asian language support enabled](http://www.pinyinjoe.com/pinyin/ea_setup.htm)), I wonder if the results are different on other OSs.


---
It appears that the behaviour depends on the particular OS and the fonts installed, and unfortunately there seems to be no way to make the fonts uniform (even if there exists a single font containing all the glyphs).
|
Getting the Mathematica front end to obey the FontFamily option
|
CC BY-SA 3.0
| 0 |
2011-05-02T12:47:56.913
|
2012-09-23T03:12:27.473
|
2011-11-18T10:32:09.347
| 695,132 | 695,132 |
[
"fonts",
"wolfram-mathematica",
"mathematica-frontend"
] |
5,857,611 | 1 | 5,857,644 | null | 0 | 1,297 |
I have some code to display a like button and this shows but with a random white box that i dont really want. Works in all other browsers
```
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml"><body>
<iframe src="http://www.facebook.com/plugins/like.php?href=<SITE URL>"
scrolling="no" frameborder="0"
style="border:none; width:450px; height:80px"><iframe>
</body>
</html>
```

|
like button internet explorer white box appearing
|
CC BY-SA 3.0
| null |
2011-05-02T13:15:49.703
|
2012-08-13T13:19:17.957
| null | null | 601,915 |
[
"facebook",
"internet-explorer",
"iframe",
"facebook-like"
] |
5,857,791 | 1 | 5,858,037 | null | 0 | 3,196 |
>
[Seat guests based on prioritized parameters](https://stackoverflow.com/questions/5461227/seat-guests-based-on-prioritized-parameters)
I've been struggling for a while now with this problem. I just can't wrap my head around it. Would be very grateful if someone that's smarter or has more algorithmic and/or mathematical insight could explain to me how I should proceed.
The client is arranging sits at events, varying from restaurants to large arenas. The goal of my client's software is to provide the guests with an SMS/e-mail/paper ticket that says where the guest should be seated when arriving at the event. The seating (which guest should sit where) must be manually controlled, some tables are "VIP" etc. I'm working on an algorithm that can help the user by letting him determine some parameters, such as which company a guest belongs to and which language the guest can speak. Today, the seating process is made by hand at large whiteboards (one section at a time if the event is 1k+ guests).
My job is to automate this a bit, not entirely but "good-enough". I've built an application that can visually present the tables, chairs (seats) and guests. However, the most important functionality is still missing; to be able to distribute the guests to the existing tables and seats, based on the parameters that the user chooses.
The parameters are an arbitary number of data on each guest, such as: "39 years, Male, Redwine Corp, CTO, English & Italian". The user takes these (all guests have the same data fields) and sorts them in order of importance. Each parameter must also be set to "next to" or "apart from". So for example, the user can control that guests that are speaking the same language should sit next to each other, but those working at the same company should be seated apart from each other.
Given this, the function definition I'm about to implement would be something like this: `function getGuestSeatings(tables, seats, guests, parameters)` and return an array of which guests should be seated at which seats. The parameters `tables`, `seats` and `guests` contains your choice of information, but most important is probably the of chairs. That combined with information on what table the chair connected to, should be enough to calculate a "good-enough" guest sit configuration. Of course, the `parameters` variable contains information on the parameter's priority and if it's a "seat-next-to"- or a "seat-apart-from"-parameter.
The question I'm asking is: What algorithm can be used to provide a solution, and how do I implement it? A mathematical answer might do no good, so to be on the safe side I suggest code (JS/C/C#) or psuedo code.
I'll give you some more info that may or may not fill any gaps to a solution (I'll complement with your comment feedback here):
- - - -
Here is a mockup that gives you an idea behind the software: 
|
Implementing an algorithm for distributing guests at table seats
|
CC BY-SA 3.0
| 0 |
2011-05-02T13:33:34.757
|
2012-08-30T18:53:01.780
|
2017-05-23T12:30:36.930
| -1 | 419,352 |
[
"algorithm",
"math",
"optimization"
] |
5,858,063 | 1 | 5,866,633 | null | 7 | 3,641 |
Is there files search in Aptana like in NetBeans ++?

|
Aptana files search
|
CC BY-SA 3.0
| null |
2011-05-02T13:58:43.187
|
2017-11-28T20:28:02.170
|
2015-07-29T12:03:24.250
| 2,901,002 | 485,676 |
[
"netbeans",
"aptana"
] |
5,858,129 | 1 | null | null | 11 | 3,104 |
### The code
I've got an MVC project with a partial page that looks somewhat like this:
```
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>
<div class="tab-window <%= Model.TargetClass %> <%= Model.TargetTab == Model.SelectedTab ? "selected" : "" %>"
data-window-url="/SomeUrl/Partial/<%= Model.TargetTab %>/"
<%= Model.TargetTab == Model.SelectedTab ? "data-content-loaded=\"true\"" : "" %>>
<% if (Model.TargetTab == Model.SelectedTab) {
Html.RenderPartial(Model.TargetTab as string, Model.Model as object);
} %>
</div>
```
What it does is open another partial (the one named in `Model.TargetTab`) with `Model.Model` if it's the currently visible tab, otherwise just renders an empty div (which is loaded with jQuery when needed).
It's called like this:
```
<% Html.RenderPartial("TabWindowContainer", new { TargetTab = "MyTabName", TargetClass = "my-tab-class", SelectedTab = Model.Tab, Model = Model }); %>
```
Then I changed the value that goes into the `Model`, and it stopped working. I changed it back, and it's still not working. To be clear, hg status currently doesn't show any of these files.
### The exception
When you try to open `Model` in the Quickwatch window you see it has all the properties setup with correct values

But when you try to view any property, you get the same exception as before

Update: It work; the model is coming from another view in the same assembly, not from the controller.
|
RuntimeBinderException with dynamic anonymous objects in MVC
|
CC BY-SA 3.0
| 0 |
2011-05-02T14:04:39.950
|
2012-07-13T08:42:51.157
| null | null | 9,536 |
[
"c#",
"asp.net-mvc-3",
"dynamic"
] |
5,858,827 | 1 | 5,859,139 | null | 12 | 116,004 |
I have an quite big CSv File I want to have in Google Maps or just on a map. These are just coordinates but I have 600.000 of them..
Do you have any Idea how I can do this?
I've added an screenshot from XTabulator below:

|
Importing CSV File to Google Maps
|
CC BY-SA 3.0
| 0 |
2011-05-02T15:08:02.137
|
2017-02-01T10:41:21.433
|
2011-05-02T15:10:03.697
| 401,390 | 578,260 |
[
"csv",
"maps",
"coordinates",
"kml"
] |
5,858,855 | 1 | 5,863,803 | null | 2 | 185 |
I'm using the Google Maps Javascript API and I have LatLng coordinates that are dynamically generated. The problem is, sometimes I get coordinates and a zoom level that creates a map view that's 'off the chart' and this confuses users into thinking their map is not working. Is there a set of coordinates I should restrict values to in order to avoid this?
Example:
```
map = new google.maps.Map(document.getElementById("map"), {
center: new google.maps.LatLng(-89.16090481395844, 59.24382269379974),
zoom: 13,
mapTypeId: 'roadmap',
scaleControl: true,
navigationControlOptions: { style: google.maps.NavigationControlStyle.ZOOM_PAN }
});
```

Users don't know what's happening unless they zoom out:

|
Google Maps Javascript API accidentally displaying view 'off the map'
|
CC BY-SA 3.0
| null |
2011-05-02T15:10:39.410
|
2014-03-18T19:44:26.983
|
2014-03-18T19:44:26.983
| 881,229 | 480,807 |
[
"google-maps-api-3",
"coordinates",
"latitude-longitude"
] |
5,858,982 | 1 | null | null | 1 | 581 |
I've to develop an web-based E-Reader for Newspapers. I looked around the Internet for good tutorials, but didn't really found what I was looking for. I already scaled down my (and everyone else's) expectations to have an good entry point to start from:
All I want (at first) is an image viewer showing all images/news pages as thumbs and the selected page in a big view. Navigation should be possible via thumbs and next/prev buttons.
Do give an idea I attached a sketch below.

Best thing I found was Apple's HTML5-Sample ["Photo Gallery"](http://developer.apple.com/library/safari/#samplecode/CSSEffectsPhotoGallery/Introduction/Intro.html), which unfortunately only works with webkit browsers.
Any ideas for good sample code/tutorials to start from?
|
How to start with HTML5 (or at least "browser based") E-Reader
|
CC BY-SA 3.0
| null |
2011-05-02T15:24:10.577
|
2011-05-02T23:44:38.310
| null | null | 2,660,952 |
[
"javascript",
"css",
"html"
] |
5,859,065 | 1 | 5,861,975 | null | 0 | 434 |
I create a new service of notification for a webRole
I defined the service in web.config
```
<system.serviceModel><services>
<!-- Notification Service Definition -->
<service behaviorConfiguration="NotificationServiceBehaviors" name="Paw.Services.NotificationService">
<endpoint binding="basicHttpBinding" contract="Paw.Services.INotificationService" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="NotificationServiceBehaviors">
<serviceMetadata httpGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors></system.serviceModel>
```
But when i try to debug and start a new instance of a webrole, the service deploys in ASP.net Server not in Compute Emulator.
I don't know why it is acting like this and the web.config isn't used at all in starting the new instance.

|
Debugging problem for a Role instance with Azure Compute Emulator,Server Error in '/' Application
|
CC BY-SA 3.0
| null |
2011-05-02T15:31:19.917
|
2011-05-04T14:06:44.650
|
2011-05-04T14:06:44.650
| 601,788 | 601,788 |
[
"visual-studio-2010",
"azure",
"azure-web-roles",
"webrole"
] |
5,859,381 | 1 | 6,300,002 | null | 9 | 3,616 |
Perhaps "flow chart" or "process chart" isn't even the correct terminology for what I'm looking for, but it's the best analog I can come up with. Basically, I'm trying to find a library or class that allows for the dynamic creation (in code) of connected cells/UIViews within a given space. In code, you could add/delete ordered cells from the view and it will arrange accordingly. Normally, if the superview size permits (i.e. iPad), it would arrange these connected cells horizontally. If it's space constrained (iPhone), it would arrange as many cells as possible on one line horizontally, then continue the rest of the cells horizontally below ... akin to a graphical "word wrap".
Granted, I doubt there's a magical library that does all of this, but if the SO community can point me to some better terminology and/or some potential candidates to fork, I would be incredibly appreciative.
I've looked at [AQGridView](https://github.com/AlanQuatermain/AQGridView) and it is such a vast library, I believe it's overkill with a compiled size of +700 Kb. [SSCollectionView](https://github.com/samsoffes/sstoolkit) is really close, but you have to manually center cells and it doesn't yet support variable cell height/width.
To give you a better sense of what I'm imagining, here's a pic:

|
Simple, but dynamically generated flow chart or process chart view for iOS
|
CC BY-SA 3.0
| 0 |
2011-05-02T16:02:14.730
|
2014-03-25T21:14:55.490
| null | null | 136,582 |
[
"objective-c",
"cocoa-touch",
"ios",
"charts",
"flowchart"
] |
5,859,459 | 1 | 5,859,521 | null | 15 | 27,722 |
A killer problem I've had in excel UIs since as long as I can remember, is with listbox scrolling.
When you have more elements in a listbox that can be displayed, a scoll bar will appear. In certain conditions, however, scrolling the bar all the way to the bottom of the list and releasing it, will "jump" the bar a notch upwards, and you won't be able to see the last item in the list. This is illustrated here:

There are many forum posts presenting this issue, and the solution has always been "Set the integral height property to false, and then set it to true again." What this does is slightly resize the listbox so that it the height is rounded to the height of a single row, and then no items are left hidden.
```
With lstbox
.IntegralHeight = False
.Height = myHeight
.IntegralHeight = True
End With
```
There are certain cases, however, where this does not work. If you are:
1. Programatically setting the height of your listbox
2. NOT using simple listbox selection (fmMultiSelectSingle)
Then simply setting integral height to false and then true after or between changes to height will make an adjustment to the height of your listbox, but when you go to scroll down, the problem will remain - the last item cannot be seen.
The key to this frustrating question is that while everyone else on the internet is confirming that the 'integralHeight' solution works for them, these very special cases are frustrated wondering why it doesn't work for them. So how do they get their fix?
|
How to fix an Excel listbox that can't scroll the last element into view
|
CC BY-SA 3.0
| 0 |
2011-05-02T16:10:49.630
|
2021-08-12T09:30:05.857
|
2011-05-02T16:19:00.483
| 529,618 | 529,618 |
[
"excel",
"vba",
"user-interface",
"listbox"
] |
5,859,562 | 1 | 5,886,793 | null | 0 | 120 |
I'm doing a site (asp.net mvc2) that should work in IE6 as well.
On a page I inject a control as partial view.
```
<div id="LocationContainer">
<% Html.RenderPartial("../Shared/EditTemplates/ContactInfoTemplate",
new ContextAwareViewModel<ContactInfoViewModel>()
{
ProcessStep = ProcessStep.Configure,
Model = Model.ContactPerson
}); %>
</div>
```
It contains following snippet of code:
```
<div style="margin-bottom: 10px;">
<%= Html.CheckBox(Model.Model.ContactType + ".IsDTBranch",
Model.Model.PersonViewModel.IsTDBranch,
new { @class = "tdBranchChkBox"}) %>
<%= Html.Resource("Resources, ThisIsTDBranchLabel") %>
</div>
```
That gives in the end this html:
```
<div style="margin-bottom: 10px;">
<input class="tdBranchChkBox" id="EventContact_IsDTBranch"
name="EventContact.IsDTBranch" type="checkbox" value="true" />
Il s'agit d'une succursale de la TD
</div>
```
After all of this IE6 doesn't render text. But text is there and appears when I start to select area where it should be.



Does anybody know how it can be cured?
Thanks.
|
Text is not visible in IE6
|
CC BY-SA 3.0
| null |
2011-05-02T16:20:31.560
|
2011-12-30T17:04:30.200
| null | null | 323,128 |
[
"asp.net-mvc-2",
"internet-explorer-6"
] |
5,859,737 | 1 | 5,859,856 | null | 2 | 2,312 |
Hey, I have a ListView that I want to be displayed into an AlertDialog, I have 2 problems:
1. The text is displayed in the left side, I want it to be in the center
2. To choose an item, you have to select exactly the text of the row.. How to make it possible to select the item even if selecting outside the text in the same row?
You can see in the picture that the orange highlight is on the text itself only rather than the whole row..:

Code:
LinearLayout layout = new LinearLayout(mContext);
```
ListView lv = new ListView(mContext);
lv.setAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, BooksOptions));
Builder alert;
alert = new AlertDialog.Builder(this);
layout.addView(lv);
alert.setView(layout);
```
|
Customize ListView in AlertDialog
|
CC BY-SA 3.0
| null |
2011-05-02T16:33:09.940
|
2011-05-02T16:44:29.767
| null | null | 668,082 |
[
"android",
"listview"
] |
5,859,751 | 1 | 5,860,940 | null | 1 | 696 |
I have following setup for tiny MCE. As you can see in image it shows a third row of buttons . I dont know where it comes from ! There is no setting in my javascript code for a third row still it shows that there.

```
tinyMCE.init({
mode : "textareas",
theme : "advanced",
plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,nonbreaking,xhtmlxtras,template,advlist,fullpage",
theme_advanced_buttons1 : "formatselect,fontselect,fontsizeselect,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,|,outdent,indent,|,forecolor,backcolor",
theme_advanced_buttons2 : "mybutton,|,link,unlink,|,hr,removeformat,pastetext,pasteword,cleanup,|,undo,redo,|,code",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "none",
theme_advanced_resizing : true,
convert_urls : false,
fullpage_default_doctype: "",
content_css : "css/content.css",
cleanup : false,
template_external_list_url : "lists/template_list.js",
external_link_list_url : "lists/link_list.js",
external_image_list_url : "lists/image_list.js",
media_external_list_url : "lists/media_list.js",
});
```
|
TinyMCE Configuration
|
CC BY-SA 3.0
| null |
2011-05-02T16:34:14.717
|
2011-05-02T18:34:08.257
| null | null | 608,576 |
[
"tinymce",
"django-tinymce"
] |
5,859,777 | 1 | 7,305,712 | null | 4 | 3,011 |
I have a question in MySQL workbench.
How can I make a relation 1 to 0..1 represented visually?
I only found this symbol:

|
EER in MySQL workbench
|
CC BY-SA 3.0
| 0 |
2011-05-02T16:36:57.823
|
2017-07-23T06:55:04.920
|
2017-07-23T06:55:04.920
| 5,210,517 | 455,318 |
[
"mysql",
"mysql-workbench",
"eer-model"
] |
5,860,086 | 1 | 5,860,338 | null | 0 | 951 |
I have some code to upload and download a sound recording from android. The problem i am having is that it appears an extra blank line is appearing in the binary. When this is removed the file plays i would like to know how to stop this line appearing. Below is my upload and download code as well as a print screen of the blank line
Upload code
```
mysql_select_db ($database);
// Make sure the user actually
// selected and uploaded a file
if (isset($_FILES['image']) && $_FILES['image']['size'] > 0) {
$size = $_FILES['image']['size'];
$type = $_FILES['image']['type'];
// Temporary file name stored on the server
$tmpName = $_FILES['image']['tmp_name'];
// Read the file
$fp = fopen($tmpName, 'r');
$data = fread($fp, filesize($tmpName));
fclose($fp);
$data = trim(addslashes($data));
// Create the query and insert
// into our database.
$query = "INSERT INTO media";
$query .= "(file, file_size, file_type) VALUES ('$data','$size','$type')";
$results = mysql_query($query, $link);
$mediaid = mysql_insert_id();
$gender = $_POST['gender'];
$cat_id = $_POST['cat'];
$name = $_POST['name'];
$lat = $_POST['lat'];
$lon = $_POST['lon'];
$user = $_POST['user'];
$query="INSERT INTO instance (name, gender, cat_id, lon, lat, user_id) VALUES ('$name', '$gender', '$cat_id', '$lon', '$lat', '$user')";
$result=mysql_query($query);
$instanceid = mysql_insert_id();
$query4 = "INSERT INTO media_link";
$query4 .="(media_id, instance_id) Values ('$mediaid','$instanceid')";
$results4 = mysql_query($query4, $link);
}
// Close our MySQL Link
mysql_close($link);
?>
```
download code
```
$test2 = @mysql_query("select * from media where media_id = '$media'");
$result2 = mysql_fetch_array($test2);
header('Content-Type: audio/AMR');
header('Content-Disposition: attachment; filename="ifound.amr"');
print $result2['file'];
exit;
?>
```
Blank line that is appearing

|
Mysql blob field has first line of space and therefore wont play file
|
CC BY-SA 3.0
| 0 |
2011-05-02T17:08:33.280
|
2011-12-20T09:46:21.937
| null | null | 601,915 |
[
"php",
"mysql"
] |
5,860,092 | 1 | 5,860,413 | null | 0 | 224 |
I have a grid splitter that works good. On the left side of the splitter i am trying to have a table with a bunch of images that when the splitter is is moved to the right the images stretch. Which this works fine. However, when the splitter is moved to the left i want the images to move into eachother and when they get there i want the splitter to move over them to make them dissapear. What it does now is the images just squish together until they dissapear. I built a table. I will include some table code and some pics of the behavior i wnat and what its doing. I am trying to replicate the googles kitchen sink example.
I am trying keep this post small
```
<Grid Background="#FFF8F5F5" ShowGridLines="true" FlowDirection="RightToLeft">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="104*" />
<RowDefinition Height="91*" />
<RowDefinition Height="14*" />
<RowDefinition Height="104*" />
<RowDefinition Height="104*" />
</Grid.RowDefinitions>
<Image Grid.Column="1" Margin="53,3,41,0" Source="google.png" Stretch="Fill" />
<Image Grid.Row="3" Margin="59,4.4,50,0" Source="google.png" Stretch="Fill" />
</Grid>
```
Here is what i want it to do when move the splitter to the left

and to the right

but this is what it is doing when i move the splitter to the left..

As you can see the images are just scrunching together. Can i do this with tables or do i need a different layout?
|
grid splitter with a table
|
CC BY-SA 3.0
| null |
2011-05-02T17:09:03.393
|
2011-05-02T17:37:45.033
|
2011-05-02T17:34:14.360
| null | null |
[
"wpf"
] |
5,860,170 | 1 | 5,860,417 | null | 4 | 1,184 |
When submitting a Windows Phone 7 app, you need to include the following icons:
- - -
Once listed on the market, the Large PC icon is displayed in the Marketplace on both the phone and PC - different style icons were used for each. What are these other icons used for?
Here is an image to clarify what we are seeing:

|
Marketplace App Icon Usage
|
CC BY-SA 3.0
| 0 |
2011-05-02T17:17:02.383
|
2011-05-03T08:25:47.883
|
2011-05-02T17:53:27.610
| 101,318 | 101,318 |
[
"windows-phone-7",
"icons"
] |
5,860,341 | 1 | null | null | 3 | 13,393 |
Since google chrome updated to 11.0.696.60 some days ago, it cuts off the bottom of popup pages ... the status bar is displayed OUTSIDE the window at the bottom. Here is an example how it happens on the Facebook share popup, like shown in the screenshot:

On the left window the share and skip button disappear totally. The page seems to be larger than the window but resizing the windows does not uncover them. When you hover over a link, the status bar appears outside the chrome window ... strange! Maximizing the window or going into fullscreen mode shows the bottom. I detect this behavior on different popup pages on different systems ...
Is this a setting thing or a bug?!?
Since I code something with this fb share function (fb jsSDK)
|
Google Chrome page bottom cut off
|
CC BY-SA 3.0
| null |
2011-05-02T17:31:10.210
|
2022-12-22T00:03:00.283
|
2016-10-21T04:56:04.137
| 832,230 | 668,550 |
[
"facebook",
"google-chrome",
"popup"
] |
5,860,379 | 1 | 5,860,568 | null | 7 | 13,052 |
I have a WCF web service that to work fine. Somewhere down the line it stopped and I cant tell why. The code and the interface never changed nor did the web.config (at least not in relation to the web services section). I have a class:
```
[DataContract]
public class QuizServiceArgs
{
[DataMember(IsRequired = true, Order = 1)]
public int Category1 { get; set; }
[DataMember(IsRequired = true, Order = 2)]
public int Category2 { get; set; }
[DataMember(IsRequired = true, Order = 3)]
public int Category3 { get; set; }
[DataMember(IsRequired = true, Order = 4)]
public int Category4 { get; set; }
}
```
And the service interface is simple:
```
public interface IQuizService
{
[OperationContract]
[WebInvoke(Method = "POST",
BodyStyle = WebMessageBodyStyle.WrappedRequest,
ResponseFormat = WebMessageFormat.Json)]
ServiceResult Save(QuizServiceArgs answers, string strvalue, int intvalue);
}
```
The second two params `strvalue` and `intvalue` were added only for troubleshooting to see if those were getting deserialized -- and they are. When I hit the service, I get an error saying that I'm missing the `Category1` parameter from the request but as you can see this Fiddler screenshot, the values are there.

# UPDATE
I never actually got my original question answered which sucks, but Sixto suggested that I switch my serialization to JSON. JSON was the original design but got nixed when I was having trouble with it. After I successfully switched back to JSON, everything was serializing and deserializing properly. Now I am just waiting for this to break for no explanation so I can switch back to XML....
|
Null values for object properties de-serialized by WCF
|
CC BY-SA 3.0
| null |
2011-05-02T17:34:01.020
|
2015-11-18T08:59:41.393
|
2020-06-20T09:12:55.060
| -1 | 86,421 |
[
"c#",
"wcf",
"web-services",
"serialization",
"deserialization"
] |
5,860,388 | 1 | 5,860,835 | null | 1 | 10,945 |
Does a unique constraint include a not null constraint?
I have a case that one attribute `cellPhone` can be `NULL` but cannot be repeated, so I give it 2 constraints: "not null" and "unique", in a case of updating the record, if user didn't enter a value I put 0 in the field, so it makes this exception:
```
SEVERE: java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (TEST1.OSQS_PARENTS_CELLPHONE_UK) violated
```
What should I do in the `UPDATE` case?
here's the definition of table ddl
```
CREATE TABLE "TEST1"."OSQS_PARENTS"
( "PARENT_NO" NUMBER(38,0),
"PARENT_NAME" VARCHAR2(4000 BYTE),
"PARENT_ID" NUMBER(38,0),
"PARENT_EMAIL" VARCHAR2(30 BYTE),
"PARENT_CELLPHONE" NUMBER(38,0)
)
```
and here's an image of the constraints

and here is the update statement
```
Parent aParent; //is an object I pass through a function
String SQlUpdate = "UPDATE OSQS_PARENTS P SET P.PARENT_ID=?,P.PARENT_EMAIL=?,P.PARENT_CELLPHONE=?"
+ " where P.PARENT_NO=?";
PreparedStatement pstmt = null;
try {
pstmt = con.prepareStatement(SQlUpdate);
pstmt.setLong(1, aParent.getId());
pstmt.setString(2, aParent.getEmail());
pstmt.setLong(3, aParent.getCellPhoneNo());
pstmt.setLong(4, parentNo);
pstmt.executeUpdate();
}
```
|
Oracle null and unique constraint
|
CC BY-SA 3.0
| null |
2011-05-02T17:34:50.893
|
2011-05-02T18:26:45.703
|
2011-05-02T18:26:45.703
| 2,067,571 | 2,067,571 |
[
"database",
"oracle",
"constraints"
] |
5,860,431 | 1 | 5,860,538 | null | 2 | 541 |
I've created an android application that produces an image as output. This image has pixel errors that are unavoidable. Images are held in an integer array with a size of the image's length*width. The pixels are in ARGB8888 color configuration. I've been searching for a method to both find and approximate what the correct value of the pixel should be based off the surrounding pixels. Here is an example output that needs to be color corrected.

|
Single Pixel Color Correction
|
CC BY-SA 3.0
| 0 |
2011-05-02T17:39:59.693
|
2011-05-02T17:50:55.777
| null | null | 603,746 |
[
"android",
"graphics",
"colors",
"bitmap"
] |
5,860,522 | 1 | 5,860,862 | null | 0 | 858 |
I think this is a bug, and if so im going to report it, but even if it is a bug i need a way to fix this. I'd really like to not have to use an image but here's the problem:
[http://jsbin.com/alame5](http://jsbin.com/alame5)
(and Windows)


Works the same on IE8 and IE9 as above
Now,

|
Firefox 4 Windows only "bug" with :after/:before CSS selectors?
|
CC BY-SA 3.0
| null |
2011-05-02T17:49:49.343
|
2011-05-02T18:26:28.287
|
2011-05-02T17:55:26.273
| 464,744 | 144,833 |
[
"windows",
"firefox",
"css"
] |
5,860,634 | 1 | 5,871,412 | null | 1 | 902 |
I am having a bit of a frustrating Monday morning. I started working in my Xcode project and decided to test a minor change I had made to the code, on my iPad 2.
The code compiles fine, but every time it gets to the "installing" stage, I get the spinning beach ball and then my memory gets eaten up until I get the Internal Error message pop-up.
Here's a screenshot:

I am completely stumped as to why I am now getting this. Here is the Console log:
```
5/2/11 11:29:52 AM Xcode[1251] [MT] Uncaught Exception:
Attempt to allocate 6715168 bytes for CFString failed
Backtrace:
0 0x000000010012d796 __exceptionPreprocess (in CoreFoundation)
1 0x0000000102d5f0f3 objc_exception_throw (in libobjc.A.dylib)
2 0x000000010042767d _NSSearchForNameInPath (in Foundation)
3 0x000000010007f391 _CFRuntimeCreateInstance (in CoreFoundation)
4 0x000000010008156f __CFStringCreateImmutableFunnel3 (in CoreFoundation)
5 0x00000001000849fb CFStringCreateCopy (in CoreFoundation)
6 0x000000010030ecff -[NSCFString copyWithZone:] (in Foundation)
7 0x0000000130c31168 __55-[DTDKRemoteDeviceConsoleController initWithDeviceRef:]_block_invoke_0 (in DTDeviceKit)
8 0x0000000130c31671 __55-[DTDKRemoteDeviceConsoleController initWithDeviceRef:]_block_invoke_048 (in DTDeviceKit)
9 0x0000000102b40284 _dispatch_call_block_and_release (in libSystem.B.dylib)
10 0x0000000102b1edf2 _dispatch_queue_drain (in libSystem.B.dylib)
11 0x0000000102b1f69f _dispatch_queue_serial_drain_till_empty (in libSystem.B.dylib)
12 0x0000000102b5243c _dispatch_main_queue_callback_4CF (in libSystem.B.dylib)
13 0x00000001000c90c8 __CFRunLoopRun (in CoreFoundation)
14 0x00000001000c7dbf CFRunLoopRunSpecific (in CoreFoundation)
15 0x00000001044537ee RunCurrentEventLoopInMode (in HIToolbox)
16 0x00000001044535f3 ReceiveNextEventCommon (in HIToolbox)
17 0x00000001044534ac BlockUntilNextEventMatchingListInMode (in HIToolbox)
18 0x000000010074de64 _DPSNextEvent (in AppKit)
19 0x000000010074d7a9 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] (in AppKit)
20 0x000000010071348b -[NSApplication run] (in AppKit)
21 0x000000010070c1a8 NSApplicationMain (in AppKit)
22 0x0000000100001694
23 0x0000000000000002
```
I would really appreciate any help on this.
|
Xcode Internal Error - Uncaught Exception - Attempt to allocate *** bytes for CFString Failed
|
CC BY-SA 3.0
| null |
2011-05-02T18:00:49.527
|
2011-05-03T14:54:14.830
| null | null | 329,900 |
[
"xcode",
"ipad",
"ios4"
] |
5,860,713 | 1 | 5,872,689 | null | 1 | 1,655 |

Why is this happening in the gnome-terminal? I think it supports utf8, printing unicode shouldn't be a problem.
Also, I have these in the .bashrc
```
LANG="en_US.utf8"
LANGUAGE="en_US.utf8"
LC_ALL="en_US.utf8"
export LANG
export LANGUAGE
export LC_ALL
```


Python 2.7.1, IPython 0.10.1, Disto: Ubuntu 11.04
|
iPython: unicode in gnome-terminal (linux)
|
CC BY-SA 3.0
| 0 |
2011-05-02T18:09:24.663
|
2011-05-03T16:40:23.383
|
2011-05-02T18:31:59.803
| 349,448 | 349,448 |
[
"python",
"linux",
"unicode",
"ipython"
] |
5,860,710 | 1 | 5,860,782 | null | 0 | 3,717 |
I'm in the middle of coding a website and im trying to do something which i'm not sure is possible. I have a layout which I like, but I want to allow to divs to resize to fit the browser. At the minute the layout is like this:

Now I want to keep the header section the same height and width always, the same with the extra and footer div. But I want the navigation (it needs renaming) and content divs to automatically adjust so that the browser window is always filled (ideally with 10px border at top and bottom but not necessary).
The whole page (obviously excluding background) is held inside a container at the moment. but this is a fixed height. This is the CSS I have
```
html,body{
margin:0;
padding:0;
}
body{
background-image:url(images/bg2.jpg);
}
a{
text-decoration: none;
}
#container{
text-align:left;
width:1000px;
height:648px;
margin: 0 auto;
border-radius:30px;
padding-top:10px;
padding-left:10px;
padding-right:10px;
padding-bottom:10px;
}
#header{
float:left;
height:123px;
width:1000px;
background-color:#FFFFFF;
border-top-right-radius:30px;
border-top-left-radius:30px;
text-align:center;
}
#links{
float:left;
height:43px;
width:714px;
background-color:#FFFFFF;
text-align:center;
padding-left:286px;
}
.link span{
list-style: none;
border: 6px solid #1c2f45;
font-size: 13px;
height: 25px;
text-align: center;
border-radius: 1em 4em 1em 4em;
float: left;
margin-left: 5px;
padding-top:5px;
width:90px;
}
.linkcurrentpage span{
list-style: none;
border: 6px solid #1c2f45;
background-color: #1c2f45;
font-size: 13px;
color: #FFFFFF;
height: 25px;
text-align: center;
border-radius: 1em 4em 1em 4em;
float: left;
margin-left: 5px;
padding-top:5px;
width:90px;
}
#content{
position:relative;
float:right;
height:420px;
width:737px;
background-color:#FFFFFF;
overflow:auto;
}
#galleryselector {
float: left;
text-align: center;
}
#navigation{
float:left;
width:263px;
height:420px;
}
#extra{
background:#FFFFFF;
float:right;
height:70px;
width:1000px;
}
#footer{
background:#FFFFFF;
float:right;
height:40px;
width:1000px;
margin: 0 auto;
padding-bottom:5px;
text-align: center;
border-bottom-left-radius:40px;
border-bottom-right-radius:40px;
}
#footer p{
margin: 0 auto;
}
```
Can anybody advise on how I may achieve this? I'm not too concerned with having a scrollbar on the content div, I just ideally don't want one on the right hand side of the page for the whole screen.
P.S I am not after website critique, the website isn't for me its for a relative who wants a site designed for her and wants the background that I have put (I know its a bit garish)
Ok so thanks to Hristo I have the layout just as I want it now minus one tiny detail), The screenshot below shows how the page now, The niggle I have is the navigation buttons at the top (simply just span tags with borders applied)...I want them aligned centrally to the div, the only way I found before was to apply a fixed amount of padding to the div but I dont know if that will work again...I shall upload a screenshot (apologies for the blue border around one of the h1 tags, had F12 developer tools running) and also my css for the links section as it stands now.
```
#links{
float:left;
height:43px;
width:100%;
background-color:#FFFFFF;
text-align:center;
}
.link span{
list-style: none;
border: 6px solid #1c2f45;
font-size: 13px;
height: 25px;
text-align: center;
border-radius: 1em 4em 1em 4em;
float: left;
margin-left: 5px;
padding-top:5px;
width:90px;
}
.linkcurrentpage span{
list-style: none;
border: 6px solid #1c2f45;
background-color: #1c2f45;
font-size: 13px;
color: #FFFFFF;
height: 25px;
text-align: center;
border-radius: 1em 4em 1em 4em;
float: left;
margin-left: 5px;
padding-top:5px;
width:90px;
}
```

|
Website 2 divs to auto adjust height
|
CC BY-SA 3.0
| 0 |
2011-05-02T18:08:57.770
|
2011-05-04T02:36:49.267
|
2011-05-04T02:36:49.267
| 196,921 | 539,787 |
[
"css",
"html"
] |
5,861,251 | 1 | 5,861,286 | null | 2 | 2,254 |
I am a .NET developer and I wanted to work on mobile development though Java. For this I have download eclipse, SDK, Android SDK, ADT plugin and Phone Gap as mentioned in this URL.
[http://www.phonegap.com/start/#android](http://www.phonegap.com/start/#android)
For me everything went successful. But when I am trying to create new project I am getting below Screen:

My Questions:
1. Why I am not getting any build target? Am I missing something?
2. What is Package Name ?
3. What is create Activity?
I apologize if you find my questions very small or useless but as a beginner these are very important for me
Android SDK Installation
When doing Window > Android SDk and AVD Manager
|
No build target while creating new project
|
CC BY-SA 3.0
| null |
2011-05-02T19:02:09.750
|
2011-05-02T19:20:12.743
|
2011-05-02T19:17:04.013
| 609,582 | 609,582 |
[
"android",
"eclipse",
"adt",
"android-2.2-froyo"
] |
5,861,277 | 1 | 5,861,309 | null | 4 | 14,761 |
I have an input field on my html page where the user can enter Unicode text, for example i enter : ыва ыва ыва ыва ыва ыв
When the form is posted, i check the value posted and it is posted as : ыва ыва ыва ыва
The content type of the page is set as :Content-Type: text/html; charset=utf-8
When i display the posted value on the webpage, it shows as ыва ыва ыва ыва instead of ыва ыва ыва ыва ыва ыв.
How can i fix this to display properly? Do i need to do convert the encoding ? I believe c# strings by default are utf8, and my html page charset is also set as utf-8 - so not sure what's going on.
Here's my ASP Page :
```
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="utf8.aspx.cs" Inherits="enterprise10._garbage.utf8"
ValidateRequest="false" Theme="" EnableTheming="false" ResponseEncoding="utf-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
</head>
<body>
<form action="" method="post" runat="server">
<asp:TextBox ID="UserInputText" runat="server"></asp:TextBox>
<br />
<asp:Label ID="UserInputLabel" runat="server" Text="Label"></asp:Label>
<br />
<input type="submit" />
<hr />
<b> Sample Text displays correctly on the page : </b><br />
ыва ыва ыва ыва ыва ыв
</form>
</body>
</html>
```
```
protected void Page_Load(object sender, EventArgs e)
{
UserInputLabel.Text = UserInputText.Text;
}
```


|
Unicode Text in ASP.NET
|
CC BY-SA 3.0
| 0 |
2011-05-02T19:04:25.883
|
2011-05-02T19:31:55.950
|
2011-05-02T19:17:56.953
| 181,579 | 181,579 |
[
"c#",
"asp.net"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.