PostId
int64 4
11.8M
| PostCreationDate
stringlengths 19
19
| OwnerUserId
int64 1
1.57M
| OwnerCreationDate
stringlengths 10
19
| ReputationAtPostCreation
int64 -55
461k
| OwnerUndeletedAnswerCountAtPostTime
int64 0
21.5k
| Title
stringlengths 3
250
| BodyMarkdown
stringlengths 5
30k
⌀ | Tag1
stringlengths 1
25
⌀ | Tag2
stringlengths 1
25
⌀ | Tag3
stringlengths 1
25
⌀ | Tag4
stringlengths 1
25
⌀ | Tag5
stringlengths 1
25
⌀ | PostClosedDate
stringlengths 19
19
⌀ | OpenStatus
stringclasses 5
values | unified_texts
stringlengths 32
30.1k
| OpenStatus_id
int64 0
4
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11,471,350 | 07/13/2012 13:20:55 | 1,137,043 | 01/08/2012 12:21:06 | 1,038 | 58 | Application does not close on 64bit windows when started as runnable jar | I have an application that I developed/tested under *32bit Win* (*XP* and *Win7*) and eclipse (indigo). I deploy the application using File->Export->Runnable Jar (with "package required libraries into generated JAR"). From there I wrap it into an executable.
I recently noticed that my application can not be closed (by neither the "top right X" nor <kbd>alt</kbd>+<kbd>F4</kbd>) in *64bit Win7* (*32bit Win* works fine). I started playing arround in *64bit Win7* and found out, that when started from eclipse, I can close the application. After I exported it into a runnable jar, I can not close it. Every other part of my application works fine (also under *64bit Win7*).
I have a shutdown hook running like this:
// initialize JFrame frame;
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
closeApplication();
}
});
frame.setVisible(true);
public void closeApplication() {
while (ConnectionManager.isConnected())
try {
ThreadManager.addMeasRequestPriority(eMeasRequest.DISCONNECT);
Thread.sleep(100);
} catch (InterruptedException e) {}
ConfigurationManager.saveToXML(new File("ressources/settings/startup.xml"));
System.exit(0);
}
I noticed that the GUI is disconnecting, but nothing more (but this means, that `closeApplication()` is entered). The problem is that I don't have the `System.out` when I am not running it in eclipse, so I can not see if there is any exception or what is going on. Do you have an idea how I could find the problem (or already know the problem)?
Possible candidates:
- System.exit(0) has a different behaviour under *64bit* **(why would that be and is there an alternative?)**
- I can not create/write to the given file `startup.xml` **(how can I check that?)**
- A tiny dwarf inside my *64bit Win7* laptop short circuits some stuff on the motherboard with his iron hammer and thus prevents the application from closing **(how could I remove him?)**
- other
**I would appreciate it if you could either tell me, whats going on here or how you would proceed to find out more.**
| java | eclipse | 64bit | executable-jar | null | null | open | Application does not close on 64bit windows when started as runnable jar
===
I have an application that I developed/tested under *32bit Win* (*XP* and *Win7*) and eclipse (indigo). I deploy the application using File->Export->Runnable Jar (with "package required libraries into generated JAR"). From there I wrap it into an executable.
I recently noticed that my application can not be closed (by neither the "top right X" nor <kbd>alt</kbd>+<kbd>F4</kbd>) in *64bit Win7* (*32bit Win* works fine). I started playing arround in *64bit Win7* and found out, that when started from eclipse, I can close the application. After I exported it into a runnable jar, I can not close it. Every other part of my application works fine (also under *64bit Win7*).
I have a shutdown hook running like this:
// initialize JFrame frame;
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
closeApplication();
}
});
frame.setVisible(true);
public void closeApplication() {
while (ConnectionManager.isConnected())
try {
ThreadManager.addMeasRequestPriority(eMeasRequest.DISCONNECT);
Thread.sleep(100);
} catch (InterruptedException e) {}
ConfigurationManager.saveToXML(new File("ressources/settings/startup.xml"));
System.exit(0);
}
I noticed that the GUI is disconnecting, but nothing more (but this means, that `closeApplication()` is entered). The problem is that I don't have the `System.out` when I am not running it in eclipse, so I can not see if there is any exception or what is going on. Do you have an idea how I could find the problem (or already know the problem)?
Possible candidates:
- System.exit(0) has a different behaviour under *64bit* **(why would that be and is there an alternative?)**
- I can not create/write to the given file `startup.xml` **(how can I check that?)**
- A tiny dwarf inside my *64bit Win7* laptop short circuits some stuff on the motherboard with his iron hammer and thus prevents the application from closing **(how could I remove him?)**
- other
**I would appreciate it if you could either tell me, whats going on here or how you would proceed to find out more.**
| 0 |
11,471,359 | 07/13/2012 13:21:10 | 1,109,819 | 12/21/2011 12:17:39 | 3 | 0 | Naming files when uploading to Amazon S3 | I am trying to upload files to Amazon S3, nothing special. I have managed to do the actual upload, and the file uploads successfully. The only issue that's left is that I cannot change the name of the file in S3. It seems that by default, the name of the file is being set the same as the secret key. It could be that I am sending the secret key as a parameter where I should send the name of the file instead. However, I tried changing the parameters around and errors prop up.
Below please find the code I am using:
Bucket bucket = client.createBucket("testBucket", Region.EU_Ireland);
List<PartETag> partTags = new ArrayList<>();
InitiateMultipartUploadRequest request = new InitiateMultipartUploadRequest(
bucket.getName(), secretAmazonKey);
InitiateMultipartUploadResult result = client
.initiateMultipartUpload(request);
File file = new File(filePath);
long contentLength = file.length();
long partSize = 8 * 1024 * 1024;
try {
// Uploading the file, part by part.
long filePosition = 0;
for (int i = 1; filePosition < contentLength; i++) {
// Last part can be less than 8 MB therefore the partSize needs
// to be adjusted accordingly
partSize = Math.min(partSize, (contentLength - filePosition));
// Creating the request for a part upload
UploadPartRequest uploadRequest = new UploadPartRequest()
.withBucketName(bucket.getName()).withKey(secretAmazonKey)
.withUploadId(result.getUploadId()).withPartNumber(i)
.withFileOffset(filePosition).withFile(file)
.withPartSize(partSize);
// Upload part and add response to the result list.
partTags.add(client.uploadPart(uploadRequest).getPartETag());
filePosition += partSize;
}
}
catch (Exception e) {
client.abortMultipartUpload(new AbortMultipartUploadRequest(bucket
.getName(), secretAmazonKey, result.getUploadId()));
}
CompleteMultipartUploadRequest compRequest = new CompleteMultipartUploadRequest(
bucket.getName(), secretAmazonKey, result.getUploadId(), partTags);
client.completeMultipartUpload(compRequest);
Any help is much appreciated.
Thanks a lot :) | java | amazon-s3 | null | null | null | null | open | Naming files when uploading to Amazon S3
===
I am trying to upload files to Amazon S3, nothing special. I have managed to do the actual upload, and the file uploads successfully. The only issue that's left is that I cannot change the name of the file in S3. It seems that by default, the name of the file is being set the same as the secret key. It could be that I am sending the secret key as a parameter where I should send the name of the file instead. However, I tried changing the parameters around and errors prop up.
Below please find the code I am using:
Bucket bucket = client.createBucket("testBucket", Region.EU_Ireland);
List<PartETag> partTags = new ArrayList<>();
InitiateMultipartUploadRequest request = new InitiateMultipartUploadRequest(
bucket.getName(), secretAmazonKey);
InitiateMultipartUploadResult result = client
.initiateMultipartUpload(request);
File file = new File(filePath);
long contentLength = file.length();
long partSize = 8 * 1024 * 1024;
try {
// Uploading the file, part by part.
long filePosition = 0;
for (int i = 1; filePosition < contentLength; i++) {
// Last part can be less than 8 MB therefore the partSize needs
// to be adjusted accordingly
partSize = Math.min(partSize, (contentLength - filePosition));
// Creating the request for a part upload
UploadPartRequest uploadRequest = new UploadPartRequest()
.withBucketName(bucket.getName()).withKey(secretAmazonKey)
.withUploadId(result.getUploadId()).withPartNumber(i)
.withFileOffset(filePosition).withFile(file)
.withPartSize(partSize);
// Upload part and add response to the result list.
partTags.add(client.uploadPart(uploadRequest).getPartETag());
filePosition += partSize;
}
}
catch (Exception e) {
client.abortMultipartUpload(new AbortMultipartUploadRequest(bucket
.getName(), secretAmazonKey, result.getUploadId()));
}
CompleteMultipartUploadRequest compRequest = new CompleteMultipartUploadRequest(
bucket.getName(), secretAmazonKey, result.getUploadId(), partTags);
client.completeMultipartUpload(compRequest);
Any help is much appreciated.
Thanks a lot :) | 0 |
11,471,360 | 07/13/2012 13:21:12 | 1,517,815 | 07/11/2012 12:50:09 | 1 | 0 | does contain and does not contain in same if | For some reason i cannot get this if statement to work
if (htmlCode.Contains("Sign out") && !htmlCode.Contains("bye bye"))
{
do stuff...
}
is there any way to get contains and does not contain to work in same if statement? | c# | null | null | null | null | null | open | does contain and does not contain in same if
===
For some reason i cannot get this if statement to work
if (htmlCode.Contains("Sign out") && !htmlCode.Contains("bye bye"))
{
do stuff...
}
is there any way to get contains and does not contain to work in same if statement? | 0 |
11,471,362 | 07/13/2012 13:21:24 | 579,843 | 01/18/2011 11:31:07 | 590 | 11 | When do UIAppearance proxy rules get applied to new view controller? | I'm wandering when exactly do UIAppearance rules get applied to some new view controller?
I've made some global rules and I call them in my app delegate. That way all UIButtons look that same. But now I want to modify just appearance of one UIButton. I've tried putting the code to remove it's background inside `- (void)viewDidLoad` but it's not working - UIAppearance rules aren't applied yes. In one ViewController I put modification code inside `- (void)viewWillLayoutSubviews` and it worked perfectly, but now in another ViewController it doesn't work (code is the same).
Where is it safe to override UIAppearance rules? | ios | uiappearance | null | null | null | null | open | When do UIAppearance proxy rules get applied to new view controller?
===
I'm wandering when exactly do UIAppearance rules get applied to some new view controller?
I've made some global rules and I call them in my app delegate. That way all UIButtons look that same. But now I want to modify just appearance of one UIButton. I've tried putting the code to remove it's background inside `- (void)viewDidLoad` but it's not working - UIAppearance rules aren't applied yes. In one ViewController I put modification code inside `- (void)viewWillLayoutSubviews` and it worked perfectly, but now in another ViewController it doesn't work (code is the same).
Where is it safe to override UIAppearance rules? | 0 |
11,471,363 | 07/13/2012 13:21:33 | 1,149,950 | 01/15/2012 01:14:08 | 1 | 0 | javax.security.Subject lost when calling through JSTL | First off, my apologies if this has been tackled already; I've tried searching but the 'Subject' keyword kept retrieving a lot of unrelated issues regarding e-mail subjects!
Consider this MVC scenario which I am having in my Spring MVC web-app:
The Model (NOTE: used only for rendering purposes)
public class Model {
... //any other attribute declarations
public String getCardNumber() {
// ... assuming we retrieved subject
final String cardNumber =
Subject.doAsPrivileged(subject, new PrivilegedAction<String>() {
public String run() { ... }
}, null);
return cardNumber;
}
... //any other getters and setters here
}
The Controller (I will not add it to as I don't think it is relevant to this issue and thus be more confusing - let me know if it is required!)
And the view, which is a standard JSP using JSTL to access the model
...
<c:out value="${model.cardNumber}" />
...
Observations
------------
1. calling getCardNumber from the controller works fine - the subject is found and the logic retrieves the sensitive information without problems
2. calling cardNumber from the JSTL c:out *does* call getCardNumber, however the Subject is not there! Of course, a null subject is useless at this stage.
Is there a way I could 'extend' the subject to JSTL, given that this execution is happening on the server side?
Many thanks in advance and sorry once again if this has been answered before. | spring-mvc | jstl | null | null | null | null | open | javax.security.Subject lost when calling through JSTL
===
First off, my apologies if this has been tackled already; I've tried searching but the 'Subject' keyword kept retrieving a lot of unrelated issues regarding e-mail subjects!
Consider this MVC scenario which I am having in my Spring MVC web-app:
The Model (NOTE: used only for rendering purposes)
public class Model {
... //any other attribute declarations
public String getCardNumber() {
// ... assuming we retrieved subject
final String cardNumber =
Subject.doAsPrivileged(subject, new PrivilegedAction<String>() {
public String run() { ... }
}, null);
return cardNumber;
}
... //any other getters and setters here
}
The Controller (I will not add it to as I don't think it is relevant to this issue and thus be more confusing - let me know if it is required!)
And the view, which is a standard JSP using JSTL to access the model
...
<c:out value="${model.cardNumber}" />
...
Observations
------------
1. calling getCardNumber from the controller works fine - the subject is found and the logic retrieves the sensitive information without problems
2. calling cardNumber from the JSTL c:out *does* call getCardNumber, however the Subject is not there! Of course, a null subject is useless at this stage.
Is there a way I could 'extend' the subject to JSTL, given that this execution is happening on the server side?
Many thanks in advance and sorry once again if this has been answered before. | 0 |
11,471,364 | 07/13/2012 13:21:36 | 1,293,829 | 03/26/2012 19:15:29 | 13 | 0 | SSRS group header shows on all but last page | I have had some trouble getting group headers to show on each page, but the steps to achieve this are well documented on here and elsewhere online, but I have a new problem.
I have a group header that appears on each page except for the last one.
My report is set like this-
<group on IDs>
<group on description>
<group on desc_num>
<static>
<static>
<static>
<group on other>
<static> -- this is my header causing trouble
<group on other_num>
<static>
in my dataset query, i have something like this:
Select 'Description', ROWNUM desc_num, x,y,z, null null etc...
UNION
Select null null null null etc... 'Other', ROWNUM other_num, a, b, c
In my report, i use the group by description to group together all from the first part of the query, and then i group by desc_num so that i can do a keep together so my static rows stay together. I do the same for other.
Each ID can have many descriptions each containing multiple groups of details. They can also have many "others" containing multiple groups of details. The description and other groups can contain several pages worth of data.
For my heading for the other group, I have the advanced properties set to True, After, True for KeepTogether, KeepWithGroup, and RepeatOnNewPage which allows it to show on each page of the other groups.
This works perfectly, except that the other header will not appear on the last page. For one specific id, there are 3.5 pages of "description" group, followed immediately (no page break) by 6 pages of "other" group. The word "Other" shows appropriately at the beginning of the other group halfway down page 4 and at the top of each following page except for on page 10, which only contains a half page.
This header has similar result when there are less pages, it always does not show on the last full page of "Other" group members.
If anyone has any ideas or advice for this, i would greatly appreciate it. | reporting-services | ssrs-2008 | ssrs-grouping | null | null | null | open | SSRS group header shows on all but last page
===
I have had some trouble getting group headers to show on each page, but the steps to achieve this are well documented on here and elsewhere online, but I have a new problem.
I have a group header that appears on each page except for the last one.
My report is set like this-
<group on IDs>
<group on description>
<group on desc_num>
<static>
<static>
<static>
<group on other>
<static> -- this is my header causing trouble
<group on other_num>
<static>
in my dataset query, i have something like this:
Select 'Description', ROWNUM desc_num, x,y,z, null null etc...
UNION
Select null null null null etc... 'Other', ROWNUM other_num, a, b, c
In my report, i use the group by description to group together all from the first part of the query, and then i group by desc_num so that i can do a keep together so my static rows stay together. I do the same for other.
Each ID can have many descriptions each containing multiple groups of details. They can also have many "others" containing multiple groups of details. The description and other groups can contain several pages worth of data.
For my heading for the other group, I have the advanced properties set to True, After, True for KeepTogether, KeepWithGroup, and RepeatOnNewPage which allows it to show on each page of the other groups.
This works perfectly, except that the other header will not appear on the last page. For one specific id, there are 3.5 pages of "description" group, followed immediately (no page break) by 6 pages of "other" group. The word "Other" shows appropriately at the beginning of the other group halfway down page 4 and at the top of each following page except for on page 10, which only contains a half page.
This header has similar result when there are less pages, it always does not show on the last full page of "Other" group members.
If anyone has any ideas or advice for this, i would greatly appreciate it. | 0 |
11,692,913 | 07/27/2012 17:41:43 | 628,303 | 02/22/2011 12:35:58 | 11 | 1 | Can routes.draw() be called twice in the same Rails app? How do RouteSet::append() and prepend() affect the drawn routes? | I'm digging deeper into RouteSet (the class assigned to Application.routes) in Rails 3.2. This class doesn't appear to be documented, probably since most people follow the normal convention of sending a block to draw(). What happens if you call draw() twice in the same app? Do the previous routes get overwritten? The latter routes appended?
Though not documented, it seems append() and prepend() can be used to add more blocks of route definitions (after or before, respectively) the original drawn routes. Is this correct? Would this also mean append() is effectively a synonym for draw? (looking at the source I see this isn't true, but I'm looking for a more practical understanding of these methods)
| ruby-on-rails-3 | null | null | null | null | null | open | Can routes.draw() be called twice in the same Rails app? How do RouteSet::append() and prepend() affect the drawn routes?
===
I'm digging deeper into RouteSet (the class assigned to Application.routes) in Rails 3.2. This class doesn't appear to be documented, probably since most people follow the normal convention of sending a block to draw(). What happens if you call draw() twice in the same app? Do the previous routes get overwritten? The latter routes appended?
Though not documented, it seems append() and prepend() can be used to add more blocks of route definitions (after or before, respectively) the original drawn routes. Is this correct? Would this also mean append() is effectively a synonym for draw? (looking at the source I see this isn't true, but I'm looking for a more practical understanding of these methods)
| 0 |
11,692,916 | 07/27/2012 17:41:50 | 1,219,322 | 02/19/2012 14:38:11 | 82 | 9 | TFS and SSIS - Automatic checkout issue | Is there a way to ignore the xml changed in a dtsx file when it checks out automatically (opens, executes), even if there have not been any changes to package behaviour? | xml | tfs | ssis | dtsx | null | null | open | TFS and SSIS - Automatic checkout issue
===
Is there a way to ignore the xml changed in a dtsx file when it checks out automatically (opens, executes), even if there have not been any changes to package behaviour? | 0 |
11,692,917 | 07/27/2012 17:41:55 | 95,024 | 04/23/2009 15:07:33 | 288 | 4 | ORM with built-in audit trail | I am designing an ASP.NET MVC web app with a database backend that requires a full audit trail for regulatory purposes.
I've implemented audit trails in the past but it feels like I would be safer using an ORM tool with built-in features for this. It looks like NHibernate would be one way to go - could you recommend other options? | c# | asp.net-mvc | orm | audit-trail | null | 07/27/2012 18:31:44 | not constructive | ORM with built-in audit trail
===
I am designing an ASP.NET MVC web app with a database backend that requires a full audit trail for regulatory purposes.
I've implemented audit trails in the past but it feels like I would be safer using an ORM tool with built-in features for this. It looks like NHibernate would be one way to go - could you recommend other options? | 4 |
11,691,897 | 07/27/2012 16:28:38 | 629,530 | 02/23/2011 04:26:40 | 170 | 1 | Consequences of not using --reintegrate when svn merge back to trunk | I'm new to subversion. Over the last month I had done some changes and merged them to trunk. Everything seemed fine - my changes got propagated as expected. But today I was re-reading about merging and saw [this](http://svnbook.red-bean.com/en/1.7/svn-book.html#svn.branchemerge.basicmerging.reintegrate), saying the following when merging your changes back to trunk:
> Now, use svn merge with the --reintegrate option to replicate your branch changes back into the trunk.
and a few paragraphs later:
> Notice our use of the --reintegrate option this time around. The option is critical for reintegrating changes from a branch back into its original line of development—don't forget it!
I guess I hadn't read things carefully enough the first time around.
So, it seems I made a mistake with my previous merges back to trunk because I hadn't used the --reintegrate option. What are the consequences of this? Is there something I need to fix?
In case it's useful, my work flow had looked like this:
1. Copy from trunk to create a personal branch.
1. Check out the personal branch.
1. Changes and commits.
1. Get a working copy of trunk.
1. Merge my branch to the working copy of trunk (again, without --reintegrate).
1. Commit the merge.
1. Delete my branch. | svn | null | null | null | null | null | open | Consequences of not using --reintegrate when svn merge back to trunk
===
I'm new to subversion. Over the last month I had done some changes and merged them to trunk. Everything seemed fine - my changes got propagated as expected. But today I was re-reading about merging and saw [this](http://svnbook.red-bean.com/en/1.7/svn-book.html#svn.branchemerge.basicmerging.reintegrate), saying the following when merging your changes back to trunk:
> Now, use svn merge with the --reintegrate option to replicate your branch changes back into the trunk.
and a few paragraphs later:
> Notice our use of the --reintegrate option this time around. The option is critical for reintegrating changes from a branch back into its original line of development—don't forget it!
I guess I hadn't read things carefully enough the first time around.
So, it seems I made a mistake with my previous merges back to trunk because I hadn't used the --reintegrate option. What are the consequences of this? Is there something I need to fix?
In case it's useful, my work flow had looked like this:
1. Copy from trunk to create a personal branch.
1. Check out the personal branch.
1. Changes and commits.
1. Get a working copy of trunk.
1. Merge my branch to the working copy of trunk (again, without --reintegrate).
1. Commit the merge.
1. Delete my branch. | 0 |
11,691,898 | 07/27/2012 16:28:41 | 1,558,198 | 07/27/2012 16:16:10 | 1 | 0 | Calling a second image URL to realize image change function on mouseover in Magento | **Aim:** to realize the product image auto change on mouseover action in the category grid view in **Magento**.
I'll apologize first that I am no coder, so please bear with me for my silly questions.
I figured the following code with realize the image change function:
<a href="TARGET URL GOES HERE"><img src="URL OF FIRST IMAGE GOES HERE" onmouseover="this.src='URL OF SECOND IMAGE GOES HERE'" onmouseout="this.src='URL OF FIRST IMAGE GOES HERE'" /></a>
However, I will need to determine whether there is a second image for the product first, then if there is, I will need to call out the URL of the second image for the function to work.
I guess it requires a piece of php code to do that.
I'd appreciate the help from anyone with the question.
Best Regards
Liang | php | css | magento | mouseover | null | null | open | Calling a second image URL to realize image change function on mouseover in Magento
===
**Aim:** to realize the product image auto change on mouseover action in the category grid view in **Magento**.
I'll apologize first that I am no coder, so please bear with me for my silly questions.
I figured the following code with realize the image change function:
<a href="TARGET URL GOES HERE"><img src="URL OF FIRST IMAGE GOES HERE" onmouseover="this.src='URL OF SECOND IMAGE GOES HERE'" onmouseout="this.src='URL OF FIRST IMAGE GOES HERE'" /></a>
However, I will need to determine whether there is a second image for the product first, then if there is, I will need to call out the URL of the second image for the function to work.
I guess it requires a piece of php code to do that.
I'd appreciate the help from anyone with the question.
Best Regards
Liang | 0 |
11,692,921 | 07/27/2012 17:42:09 | 1,552,442 | 07/25/2012 17:45:08 | 1 | 0 | Android Menu to CustomDailog - app forcecloses itself | This is the code i have used for the menu item selection:
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.menu_settings:
showDialog(1);
return true;
default:
return super.onOptionsItemSelected(item);
}
}
There is only one option in the menu, and i have designed a customDialog using the following code:
protected Dialog onCreateDialog(int id) {
Context mContext = getApplicationContext();
Dialog dialog = new Dialog(mContext);
dialog.setContentView(R.layout.custom_dialog);
dialog.setTitle("About Us");
TextView text = (TextView) dialog.findViewById(R.id.text);
text.setText("App Created By: Prateek Garg ([email protected])");
ImageView image = (ImageView) dialog.findViewById(R.id.image);
image.setImageResource(R.drawable.logo_resumes);
return dialog;
}
}
The problem is that whenever i press the menu item "About Us", the app force-closes itself.
I am unable to rectify whatever error there is, but i am hoping you guys can.
Thanks in advance.
PS. I have created the menuInflator() in onCreateOptionsMenu() .
Cheers
| android | android-menu | customdialog | null | null | null | open | Android Menu to CustomDailog - app forcecloses itself
===
This is the code i have used for the menu item selection:
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.menu_settings:
showDialog(1);
return true;
default:
return super.onOptionsItemSelected(item);
}
}
There is only one option in the menu, and i have designed a customDialog using the following code:
protected Dialog onCreateDialog(int id) {
Context mContext = getApplicationContext();
Dialog dialog = new Dialog(mContext);
dialog.setContentView(R.layout.custom_dialog);
dialog.setTitle("About Us");
TextView text = (TextView) dialog.findViewById(R.id.text);
text.setText("App Created By: Prateek Garg ([email protected])");
ImageView image = (ImageView) dialog.findViewById(R.id.image);
image.setImageResource(R.drawable.logo_resumes);
return dialog;
}
}
The problem is that whenever i press the menu item "About Us", the app force-closes itself.
I am unable to rectify whatever error there is, but i am hoping you guys can.
Thanks in advance.
PS. I have created the menuInflator() in onCreateOptionsMenu() .
Cheers
| 0 |
11,692,923 | 07/27/2012 17:42:15 | 928,177 | 09/05/2011 02:58:14 | 62 | 1 | Any way to know if Device booted from a fastboot? | Ever since HTC started using Fastboot settings, apps depending on
> **android.intent.action.BOOT_COMPLETED**
struggle to boot along with the device boot on HTC devices. I have a similar application which depends on the above intent action. But since HTC does its power off and power on differently by using fastboot(other term used - Hibernation) my App never get to work normally.
I tried using [ACTION_USER_PRESENT][1] and [ACTION_SCREEN_ON][2], but it seemed to be more of hack than a fix for my problem.
Do any of you came across same kind of problem and found a better way to deal with it? Please help.
SKU
[1]: http://developer.android.com/reference/android/content/Intent.html#ACTION_USER_PRESENT
[2]: http://developer.android.com/reference/android/content/Intent.html#ACTION_SCREEN_ON | android | android-intent | null | null | null | null | open | Any way to know if Device booted from a fastboot?
===
Ever since HTC started using Fastboot settings, apps depending on
> **android.intent.action.BOOT_COMPLETED**
struggle to boot along with the device boot on HTC devices. I have a similar application which depends on the above intent action. But since HTC does its power off and power on differently by using fastboot(other term used - Hibernation) my App never get to work normally.
I tried using [ACTION_USER_PRESENT][1] and [ACTION_SCREEN_ON][2], but it seemed to be more of hack than a fix for my problem.
Do any of you came across same kind of problem and found a better way to deal with it? Please help.
SKU
[1]: http://developer.android.com/reference/android/content/Intent.html#ACTION_USER_PRESENT
[2]: http://developer.android.com/reference/android/content/Intent.html#ACTION_SCREEN_ON | 0 |
11,692,601 | 07/27/2012 17:20:19 | 1,558,284 | 07/27/2012 16:55:38 | 1 | 0 | Redirect page through ajax call | I am sending form with fields email and password through ajax request.if they do not match i am getting response 'username and password is not correct' in Div id.If name and password match page should be redirect to another page.But i am getting whole page in same div id.I want if password and name match than page redirect to another page and if password and name not match than it give the response in same id. | ajax | null | null | null | null | null | open | Redirect page through ajax call
===
I am sending form with fields email and password through ajax request.if they do not match i am getting response 'username and password is not correct' in Div id.If name and password match page should be redirect to another page.But i am getting whole page in same div id.I want if password and name match than page redirect to another page and if password and name not match than it give the response in same id. | 0 |
11,692,928 | 07/27/2012 17:42:30 | 86,191 | 04/02/2009 13:21:01 | 2,359 | 133 | Command to delete all files and folders in a folder using ncftp | I have a folder on a remote server that I need cleared. I need all files and folders in this folder deleted. I cannot delete and recreate the parent folder because I don't want to mess up the permissions.
For example:
Remote folder is Development/
That folder contains several files and several folders.
I want to run a command to completely empty the Development/ folder and leave me a fresh empty version. | ftp | null | null | null | null | null | open | Command to delete all files and folders in a folder using ncftp
===
I have a folder on a remote server that I need cleared. I need all files and folders in this folder deleted. I cannot delete and recreate the parent folder because I don't want to mess up the permissions.
For example:
Remote folder is Development/
That folder contains several files and several folders.
I want to run a command to completely empty the Development/ folder and leave me a fresh empty version. | 0 |
11,692,589 | 07/27/2012 17:19:36 | 1,558,178 | 07/27/2012 16:07:08 | 1 | 0 | .Net RouteTable for images not triggering | I have setup a routing table in the global.asax file for images that have been moved to the database. When I use the url such that EmpImages/[numeric id] as a basic format, it works fine if I use the url that does that same ~/EmpImages/42, but we have hundreds of hardcoded links that are ~/EmpImages/42.png. When I try to use the EmpImages/[numeric id].png, the handler is never called.
I have looked at several samples that show the .ext, but they are using page routes instead of handlers. With the code below, can you tell me what I'm missing?
This part works:
RouteTable.Routes.Add(new Route("EmpImages/{id}/{size}", new EmployeeImageRouteHandler()));
RouteTable.Routes.Add(new Route("EmpImages/{id}", new EmployeeImageRouteHandler()));
When using the URL:
~/EmpImages/42
~/EmpImages/42/256
But when I try:
RouteTable.Routes.Add(new Route("EmpImages/{id}/{size}.png", new EmployeeImageRouteHandler()));
RouteTable.Routes.Add(new Route("EmpImages/{id}.png", new EmployeeImageRouteHandler()));
When using the URL:
~/EmpImages/42.png
~/EmpImages/42/256.png
It fails. The handler is never called.
What simple thing am I missing? | c# | .net | dynamic | null | null | null | open | .Net RouteTable for images not triggering
===
I have setup a routing table in the global.asax file for images that have been moved to the database. When I use the url such that EmpImages/[numeric id] as a basic format, it works fine if I use the url that does that same ~/EmpImages/42, but we have hundreds of hardcoded links that are ~/EmpImages/42.png. When I try to use the EmpImages/[numeric id].png, the handler is never called.
I have looked at several samples that show the .ext, but they are using page routes instead of handlers. With the code below, can you tell me what I'm missing?
This part works:
RouteTable.Routes.Add(new Route("EmpImages/{id}/{size}", new EmployeeImageRouteHandler()));
RouteTable.Routes.Add(new Route("EmpImages/{id}", new EmployeeImageRouteHandler()));
When using the URL:
~/EmpImages/42
~/EmpImages/42/256
But when I try:
RouteTable.Routes.Add(new Route("EmpImages/{id}/{size}.png", new EmployeeImageRouteHandler()));
RouteTable.Routes.Add(new Route("EmpImages/{id}.png", new EmployeeImageRouteHandler()));
When using the URL:
~/EmpImages/42.png
~/EmpImages/42/256.png
It fails. The handler is never called.
What simple thing am I missing? | 0 |
11,692,591 | 07/27/2012 17:19:40 | 997,633 | 10/16/2011 08:30:47 | 92 | 0 | TextField words are cut AS3 | I'm having a problem with TextField component cutting the words at the very end of every line, even though the wordWrap property is set to true.
example:
This is a test te
xt, this is a tes
t text. This is a
test text.
How to fix this? thanks
EDIT:
I have a textFormat applied with parameter .size=20. | actionscript-3 | flash | textfield | cut | words | null | open | TextField words are cut AS3
===
I'm having a problem with TextField component cutting the words at the very end of every line, even though the wordWrap property is set to true.
example:
This is a test te
xt, this is a tes
t text. This is a
test text.
How to fix this? thanks
EDIT:
I have a textFormat applied with parameter .size=20. | 0 |
11,692,935 | 07/27/2012 17:42:40 | 91,612 | 04/16/2009 12:52:08 | 3,104 | 138 | I'm not able to get font-face working | I'm not able to get `font-face` working (That's why I usually use Google fonts). But a customer has their own font that I must use.
I'm testing and compairing against this site (Main menu): http://www.cphvision.dk/
Here is my fiddle: http://jsfiddle.net/5jMN3/1/
Why am I not able to get this work? The font on the other website is working just fine.
Here's my CSS:
@font-face{
font-family:'testFont';
src:url('http://www.cphvision.dk/sites/all/themes/vision/webfonts/21B1BE_0_0.eot');
src:url('http://www.cphvision.dk/sites/all/themes/vision/webfonts/21B1BE_0_0.ttf'), format('truetype');
}
ul li a {
font-family:'testFont', sans-serif;
font-weight:normal;
}
I've also tested on my local server. Not working there either.
I have previously tested using font-face on downloaded fonts from Google. No success.
What am I doing wrong?
| html | css3 | font-face | null | null | null | open | I'm not able to get font-face working
===
I'm not able to get `font-face` working (That's why I usually use Google fonts). But a customer has their own font that I must use.
I'm testing and compairing against this site (Main menu): http://www.cphvision.dk/
Here is my fiddle: http://jsfiddle.net/5jMN3/1/
Why am I not able to get this work? The font on the other website is working just fine.
Here's my CSS:
@font-face{
font-family:'testFont';
src:url('http://www.cphvision.dk/sites/all/themes/vision/webfonts/21B1BE_0_0.eot');
src:url('http://www.cphvision.dk/sites/all/themes/vision/webfonts/21B1BE_0_0.ttf'), format('truetype');
}
ul li a {
font-family:'testFont', sans-serif;
font-weight:normal;
}
I've also tested on my local server. Not working there either.
I have previously tested using font-face on downloaded fonts from Google. No success.
What am I doing wrong?
| 0 |
11,280,148 | 07/01/2012 06:55:56 | 1,437,128 | 06/05/2012 10:38:13 | 18 | 4 | drag and drop: NSView thinks source is an image that it isn't | I have two views.
1. One view has a grid of NSImageViews with images.
2. The other view has a grid of potential places to place the dragged image.
I think I have dragging working. If I click and drag an image from view 1, it works fine, but when I try to place it, the path of the source image is for an image on my desktop that isn't even part of my project. The result of the below code is that carriedData = nil, but I did some testing with NSLog and saw that it is sending the path for an image outside the project that is no my desktop.
Here is some of the D&D protocol methods I have implemented. myDragState is just en enumeration I use for highlighting the grid space that the drag is currently hovering over.
in Init...
[self registerForDraggedTypes:[NSImage imagePasteboardTypes]];
myDragState = dragStateNone;
Then the protocol methods
- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
{
if ((NSDragOperationGeneric & [sender draggingSourceOperationMask]) == NSDragOperationGeneric)
{
myDragState = dragStateOver;
[self setNeedsDisplay];
return NSDragOperationGeneric;
}
else
{
return NSDragOperationNone;
}
}
- (void)draggingExited:(id <NSDraggingInfo>)sender
{
//turn off focus ring
myDragState = dragStateExited;
[self setNeedsDisplay];
}
- (void)draggingEnded:(id <NSDraggingInfo>)sender { }
- (BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender
{
return YES;
}
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
{
NSPasteboard *paste = [sender draggingPasteboard];
//gets the dragging-specific pasteboard from the sender
NSArray *types = [NSArray arrayWithObjects:NSTIFFPboardType, nil];
//a list of types that we can accept
NSString *desiredType = [paste availableTypeFromArray:types];
NSData *carriedData = [paste dataForType:desiredType];
if (nil == carriedData)
{
//the operation failed for some reason
NSRunAlertPanel(@"Paste Error", @"Sorry, but the past operation failed", nil, nil, nil);
myDragState = dragStateNone;
[self setNeedsDisplay];
return NO;
}
else
{
//the pasteboard was able to give us some meaningful data
if ([desiredType isEqualToString:NSTIFFPboardType])
{
NSLog(@"TIFF");
//we have TIFF bitmap data in the NSData object
NSImage *newImage = [[NSImage alloc] initWithData:carriedData];
[self setImage:newImage];
myDragState = dragStateSet;
}
else
{
//this can't happen
//NSAssert(NO, @"This can't happen");
NSLog(@"Other type");
myDragState = dragStateNone;
[self setNeedsDisplay];
return NO;
}
}
//redraw us with the new image
return YES;
}
- (void)concludeDragOperation:(id <NSDraggingInfo>)sender
{
//re-draw the view with our new data
[self setNeedsDisplay:YES];
}
- (void)drawRect:(NSRect)dirtyRect
{
// Drawing code here.
NSRect ourBounds = [self bounds];
if (myDragState == dragStateSet)
{
NSImage *image = [self image];
[super drawRect:dirtyRect];
[image compositeToPoint:(ourBounds.origin) operation:NSCompositeSourceOver];
}
else if (myDragState == dragStateOver)
{
[[NSColor colorWithDeviceRed:1.0f green:1.0f blue:1.0f alpha:0.4f] set];
[NSBezierPath fillRect:ourBounds];
}
else {
//draw nothing
}
}
| osx | drag-and-drop | nsimage | nsimageview | null | null | open | drag and drop: NSView thinks source is an image that it isn't
===
I have two views.
1. One view has a grid of NSImageViews with images.
2. The other view has a grid of potential places to place the dragged image.
I think I have dragging working. If I click and drag an image from view 1, it works fine, but when I try to place it, the path of the source image is for an image on my desktop that isn't even part of my project. The result of the below code is that carriedData = nil, but I did some testing with NSLog and saw that it is sending the path for an image outside the project that is no my desktop.
Here is some of the D&D protocol methods I have implemented. myDragState is just en enumeration I use for highlighting the grid space that the drag is currently hovering over.
in Init...
[self registerForDraggedTypes:[NSImage imagePasteboardTypes]];
myDragState = dragStateNone;
Then the protocol methods
- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
{
if ((NSDragOperationGeneric & [sender draggingSourceOperationMask]) == NSDragOperationGeneric)
{
myDragState = dragStateOver;
[self setNeedsDisplay];
return NSDragOperationGeneric;
}
else
{
return NSDragOperationNone;
}
}
- (void)draggingExited:(id <NSDraggingInfo>)sender
{
//turn off focus ring
myDragState = dragStateExited;
[self setNeedsDisplay];
}
- (void)draggingEnded:(id <NSDraggingInfo>)sender { }
- (BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender
{
return YES;
}
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
{
NSPasteboard *paste = [sender draggingPasteboard];
//gets the dragging-specific pasteboard from the sender
NSArray *types = [NSArray arrayWithObjects:NSTIFFPboardType, nil];
//a list of types that we can accept
NSString *desiredType = [paste availableTypeFromArray:types];
NSData *carriedData = [paste dataForType:desiredType];
if (nil == carriedData)
{
//the operation failed for some reason
NSRunAlertPanel(@"Paste Error", @"Sorry, but the past operation failed", nil, nil, nil);
myDragState = dragStateNone;
[self setNeedsDisplay];
return NO;
}
else
{
//the pasteboard was able to give us some meaningful data
if ([desiredType isEqualToString:NSTIFFPboardType])
{
NSLog(@"TIFF");
//we have TIFF bitmap data in the NSData object
NSImage *newImage = [[NSImage alloc] initWithData:carriedData];
[self setImage:newImage];
myDragState = dragStateSet;
}
else
{
//this can't happen
//NSAssert(NO, @"This can't happen");
NSLog(@"Other type");
myDragState = dragStateNone;
[self setNeedsDisplay];
return NO;
}
}
//redraw us with the new image
return YES;
}
- (void)concludeDragOperation:(id <NSDraggingInfo>)sender
{
//re-draw the view with our new data
[self setNeedsDisplay:YES];
}
- (void)drawRect:(NSRect)dirtyRect
{
// Drawing code here.
NSRect ourBounds = [self bounds];
if (myDragState == dragStateSet)
{
NSImage *image = [self image];
[super drawRect:dirtyRect];
[image compositeToPoint:(ourBounds.origin) operation:NSCompositeSourceOver];
}
else if (myDragState == dragStateOver)
{
[[NSColor colorWithDeviceRed:1.0f green:1.0f blue:1.0f alpha:0.4f] set];
[NSBezierPath fillRect:ourBounds];
}
else {
//draw nothing
}
}
| 0 |
11,280,134 | 07/01/2012 06:53:44 | 1,493,944 | 07/01/2012 06:41:01 | 1 | 0 | Having Trouble with Entity Framework. Adding a new row | Having Trouble with Entity Framework. I have been adding a new row to Iktato table but is not work.
CREATE TABLE [Iktato] (
[TIPACT] nvarchar(3),
[NRINREG] int NOT NULL identity(1,1),
[DATAINREG] datetime,
[NRACT] nvarchar(10),
[DATAACT] datetime,
[CODARHIVA] nvarchar(20),
[NRFILE] int,
[NRANEXE] int,
[EMITENT] nvarchar(50),
[TERMEN] datetime,
[RESP1] nvarchar(50),
[RESP2] nvarchar(50),
[RESP3] nvarchar(50),
[RESP4] nvarchar(50),
[DESCRIERE] ntext,
[PRIORITATE] nvarchar(13),
[STATUT] nvarchar(20),
[FILENAME] nvarchar(128),
PRIMARY KEY (NRINREG)
)
GO
CREATE TABLE [rasp] (
[TIPACT] nvarchar(3),
[NRINREG] int NOT NULL,
[DATAINREG] datetime,
[NRACT] nvarchar(10),
[DATAACT] datetime,
[CODARHIVA] nvarchar(20),
[NRFILE] int,
[NRANEXE] int,
[EMITENT] nvarchar(50),
[TERMEN] datetime,
[RESP1] nvarchar(50),
[RESP2] nvarchar(50),
[RESP3] nvarchar(50),
[RESP4] nvarchar(50),
[DESCRIERE] ntext,
[PRIORITATE] nvarchar(13),
[STATUT] nvarchar(20),
[FILENAME] nvarchar(128),
[ROW_ID] int NOT NULL IDENTITY,
PRIMARY KEY (ROW_ID)
)
GO
ALTER TABLE rasp
ADD CONSTRAINT fk_Iktato
FOREIGN KEY (NRINREG)
REFERENCES Iktato (NRINREG) ON DELETE CASCADE
GO
It`s a sequence of my program:
private RegistruEntities entities;
private Iktato proba;
proba = new Iktato { NRINREG = 5 };
entities.AttachTo("Iktatoes", proba);
entities.SaveChanges();
I want to insert a row with registration number 5 which will be saved in the database Iktato.
Save it not work.
Please help ! | entity-framework | null | null | null | null | null | open | Having Trouble with Entity Framework. Adding a new row
===
Having Trouble with Entity Framework. I have been adding a new row to Iktato table but is not work.
CREATE TABLE [Iktato] (
[TIPACT] nvarchar(3),
[NRINREG] int NOT NULL identity(1,1),
[DATAINREG] datetime,
[NRACT] nvarchar(10),
[DATAACT] datetime,
[CODARHIVA] nvarchar(20),
[NRFILE] int,
[NRANEXE] int,
[EMITENT] nvarchar(50),
[TERMEN] datetime,
[RESP1] nvarchar(50),
[RESP2] nvarchar(50),
[RESP3] nvarchar(50),
[RESP4] nvarchar(50),
[DESCRIERE] ntext,
[PRIORITATE] nvarchar(13),
[STATUT] nvarchar(20),
[FILENAME] nvarchar(128),
PRIMARY KEY (NRINREG)
)
GO
CREATE TABLE [rasp] (
[TIPACT] nvarchar(3),
[NRINREG] int NOT NULL,
[DATAINREG] datetime,
[NRACT] nvarchar(10),
[DATAACT] datetime,
[CODARHIVA] nvarchar(20),
[NRFILE] int,
[NRANEXE] int,
[EMITENT] nvarchar(50),
[TERMEN] datetime,
[RESP1] nvarchar(50),
[RESP2] nvarchar(50),
[RESP3] nvarchar(50),
[RESP4] nvarchar(50),
[DESCRIERE] ntext,
[PRIORITATE] nvarchar(13),
[STATUT] nvarchar(20),
[FILENAME] nvarchar(128),
[ROW_ID] int NOT NULL IDENTITY,
PRIMARY KEY (ROW_ID)
)
GO
ALTER TABLE rasp
ADD CONSTRAINT fk_Iktato
FOREIGN KEY (NRINREG)
REFERENCES Iktato (NRINREG) ON DELETE CASCADE
GO
It`s a sequence of my program:
private RegistruEntities entities;
private Iktato proba;
proba = new Iktato { NRINREG = 5 };
entities.AttachTo("Iktatoes", proba);
entities.SaveChanges();
I want to insert a row with registration number 5 which will be saved in the database Iktato.
Save it not work.
Please help ! | 0 |
11,280,149 | 07/01/2012 06:55:57 | 1,300,444 | 03/29/2012 09:52:44 | 46 | 4 | How to add column with buttons to dojo grid | I have a dojo grid with a json datastore (mysql resultset converted into json format). Currently my grid show 4 columns as shown below in the figure:
![enter image description here][1]
[1]: http://i.stack.imgur.com/avP3x.jpg
What I want is to have another column named 'Action'. The rows under this 'Action' column should contain buttons or images(edit icon, delete icon) with hyperlinks such as edit.php?id=1 for edit, or delete.php?id=1 for delete.
Here is my dojo grid code:
<span dojoType="dojo.data.ItemFileReadStore" data-dojo-id="studentsStore" url="http://localhost/newsmis/public/studentManagement/student/fetchdata/data/1"></span>
<table dojoType="dojox.grid.DataGrid" id="studentsGrid" data-dojo-id="studentsGrid" columnReordering="true" sortFields="['idstudents','first_name','middle_name','last_name']" store="studentsStore" clientSort="true" selectionMode="single" rowHeight="25" noDataMessage="<span class='dojoxGridNoData'>No students found</span>">
<thead>
<tr>
<th field="idstudents" width="20%">Student ID</th>
<th field="first_name" width="20%">First Name</th>
<th field="middle_name" width="20%">Middle Name</th>
<th field="last_name" width="40%">Last Name</th>
</tr>
</thead>
</table>
My json data format is
{"identifier":"idstudents","items":[{"idstudents":"11","first_name":"Pradip","middle_name":"Maan","last_name":"Chitrakar"}]}
How can i do it? Please suggest me some ideas | json | dojo | dojox.grid.datagrid | dojo.data | null | null | open | How to add column with buttons to dojo grid
===
I have a dojo grid with a json datastore (mysql resultset converted into json format). Currently my grid show 4 columns as shown below in the figure:
![enter image description here][1]
[1]: http://i.stack.imgur.com/avP3x.jpg
What I want is to have another column named 'Action'. The rows under this 'Action' column should contain buttons or images(edit icon, delete icon) with hyperlinks such as edit.php?id=1 for edit, or delete.php?id=1 for delete.
Here is my dojo grid code:
<span dojoType="dojo.data.ItemFileReadStore" data-dojo-id="studentsStore" url="http://localhost/newsmis/public/studentManagement/student/fetchdata/data/1"></span>
<table dojoType="dojox.grid.DataGrid" id="studentsGrid" data-dojo-id="studentsGrid" columnReordering="true" sortFields="['idstudents','first_name','middle_name','last_name']" store="studentsStore" clientSort="true" selectionMode="single" rowHeight="25" noDataMessage="<span class='dojoxGridNoData'>No students found</span>">
<thead>
<tr>
<th field="idstudents" width="20%">Student ID</th>
<th field="first_name" width="20%">First Name</th>
<th field="middle_name" width="20%">Middle Name</th>
<th field="last_name" width="40%">Last Name</th>
</tr>
</thead>
</table>
My json data format is
{"identifier":"idstudents","items":[{"idstudents":"11","first_name":"Pradip","middle_name":"Maan","last_name":"Chitrakar"}]}
How can i do it? Please suggest me some ideas | 0 |
11,280,151 | 07/01/2012 06:56:10 | 1,488,098 | 06/28/2012 09:34:13 | 3 | 0 | Receiving 1 row from joined (1 to many) postgresql | I have this problem:<br/>
<ul>
<li>I have 2 major tables (apartments, tenants) that have a connection of 1 to many (1 apartment, many tenants).</li>
<li>I'm trying to pull all my building apartments, but with one of his tenants.</li>
<li>The preffered tenant is the one who have ot=2 (there are 2 possible values: 1 or 2).
</ul>
<div>
I tried to use subqueries but in postgresql it doesn't let you return more than 1 column.<br/>
I don't know how to solve it. Here is my latest code:</div>
SELECT a.apartment_id, a.apartment_num, a.floor, at.app_type_desc_he, tn.otype_desc_he, tn.e_name
FROM
public.apartments a INNER JOIN public.apartment_types at ON
at.app_type_id = a.apartment_type INNER JOIN
(select t.apartment_id, t.building_id, ot.otype_id, ot.otype_desc_he, e.e_name
from public.tenants t INNER JOIN public.ownership_types ot ON
ot.otype_id = t.ownership_type INNER JOIN entities e ON
t.entity_id = e.entity_id
) tn ON
a.apartment_id = tn.apartment_id AND tn.building_id = a.building_id
WHERE
a.building_id = 4 AND tn.building_id=4
ORDER BY
a.apartment_num ASC,
tn.otype_id DESC
Thanx in advance
| sql | postgresql | one-to-many | postgresql-9.1 | null | null | open | Receiving 1 row from joined (1 to many) postgresql
===
I have this problem:<br/>
<ul>
<li>I have 2 major tables (apartments, tenants) that have a connection of 1 to many (1 apartment, many tenants).</li>
<li>I'm trying to pull all my building apartments, but with one of his tenants.</li>
<li>The preffered tenant is the one who have ot=2 (there are 2 possible values: 1 or 2).
</ul>
<div>
I tried to use subqueries but in postgresql it doesn't let you return more than 1 column.<br/>
I don't know how to solve it. Here is my latest code:</div>
SELECT a.apartment_id, a.apartment_num, a.floor, at.app_type_desc_he, tn.otype_desc_he, tn.e_name
FROM
public.apartments a INNER JOIN public.apartment_types at ON
at.app_type_id = a.apartment_type INNER JOIN
(select t.apartment_id, t.building_id, ot.otype_id, ot.otype_desc_he, e.e_name
from public.tenants t INNER JOIN public.ownership_types ot ON
ot.otype_id = t.ownership_type INNER JOIN entities e ON
t.entity_id = e.entity_id
) tn ON
a.apartment_id = tn.apartment_id AND tn.building_id = a.building_id
WHERE
a.building_id = 4 AND tn.building_id=4
ORDER BY
a.apartment_num ASC,
tn.otype_id DESC
Thanx in advance
| 0 |
11,280,152 | 07/01/2012 06:56:13 | 65,387 | 02/12/2009 03:01:00 | 21,890 | 627 | How to write this statement more compactly without a ++ operator? | Here's what I want to write:
groups[m][n] = groups[m - 1][n] or ++gid
Here's what I have to write:
g = groups[m - 1][n]
if g:
groups[m,n] = g
else:
gid += 1
groups[m][n] = gid
Is there no more compact way of writing that in Python simply because it lacks a `++` operator? | python | null | null | null | null | null | open | How to write this statement more compactly without a ++ operator?
===
Here's what I want to write:
groups[m][n] = groups[m - 1][n] or ++gid
Here's what I have to write:
g = groups[m - 1][n]
if g:
groups[m,n] = g
else:
gid += 1
groups[m][n] = gid
Is there no more compact way of writing that in Python simply because it lacks a `++` operator? | 0 |
11,280,168 | 07/01/2012 06:59:54 | 461,201 | 09/29/2010 00:01:45 | 38 | 4 | document list api create failed | The request below fails and I am not able to figure out why, any insights?
var atom = ["<?xml version='1.0' encoding='UTF-8'?>",
'<entry xmlns="http://www.w3.org/2005/Atom" xmlns:docs="http://schemas.google.com/docs/2007">',
'<category scheme="http://schemas.google.com/g/2005#kind"',
' term="http://schemas.google.com/docs/2007#document"/>',
'<title>', titleDoc, '</title>',
'</entry>'].join('');
xhr.open('POST', URI , true);
xhr.setRequestHeader('Content-type', 'application/atom+xml');
//xhr.setRequestHeader('GData-Version', '3.0');
xhr.setRequestHeader('X-Upload-Content-Length', '0');
xhr.setRequestHeader('Authorization', 'OAuth ' + google.getAccessToken());
xhr.send(atom);
This is the request/response packet from the servers
Request URL:https://docs.google.com/feeds/upload/create-session/default/private/full
Request Method:POST
Status Code:400 Bad Request
Request Payload
<?xml version='1.0' encoding='UTF-8'?><entry xmlns="http://www.w3.org/2005/Atom" xmlns:docs="http://schemas.google.com/docs/2007"><category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/docs/2007#document"/><title>test</title></entry>
Response Headersview source
cache-control:no-cache, no-store, must-revalidate
content-length:19
content-type:text/html; charset=UTF-8
date:Sun, 01 Jul 2012 06:46:21 GMT
expires:Fri, 01 Jan 1990 00:00:00 GMT
pragma:no-cache
server:HTTP Upload Server Built on Jun 14 2012 02:12:09 (1339665129)
status:400 Bad Request
version:HTTP/1.1 | google-docs-api | null | null | null | null | null | open | document list api create failed
===
The request below fails and I am not able to figure out why, any insights?
var atom = ["<?xml version='1.0' encoding='UTF-8'?>",
'<entry xmlns="http://www.w3.org/2005/Atom" xmlns:docs="http://schemas.google.com/docs/2007">',
'<category scheme="http://schemas.google.com/g/2005#kind"',
' term="http://schemas.google.com/docs/2007#document"/>',
'<title>', titleDoc, '</title>',
'</entry>'].join('');
xhr.open('POST', URI , true);
xhr.setRequestHeader('Content-type', 'application/atom+xml');
//xhr.setRequestHeader('GData-Version', '3.0');
xhr.setRequestHeader('X-Upload-Content-Length', '0');
xhr.setRequestHeader('Authorization', 'OAuth ' + google.getAccessToken());
xhr.send(atom);
This is the request/response packet from the servers
Request URL:https://docs.google.com/feeds/upload/create-session/default/private/full
Request Method:POST
Status Code:400 Bad Request
Request Payload
<?xml version='1.0' encoding='UTF-8'?><entry xmlns="http://www.w3.org/2005/Atom" xmlns:docs="http://schemas.google.com/docs/2007"><category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/docs/2007#document"/><title>test</title></entry>
Response Headersview source
cache-control:no-cache, no-store, must-revalidate
content-length:19
content-type:text/html; charset=UTF-8
date:Sun, 01 Jul 2012 06:46:21 GMT
expires:Fri, 01 Jan 1990 00:00:00 GMT
pragma:no-cache
server:HTTP Upload Server Built on Jun 14 2012 02:12:09 (1339665129)
status:400 Bad Request
version:HTTP/1.1 | 0 |
11,327,174 | 07/04/2012 10:22:37 | 1,056,620 | 11/20/2011 17:37:33 | 143 | 15 | is there any way to manage the waiting time of mysql | whenever we are firing a insert query, for that point of instant that particular table is locked for a span of time. That time can be some micro seconds or some seconds depending upon the row need to be inserted in database.
I am developing an application for a university which have more than a lac of users.
I am taking care of it because last some days i am googleing it and i got the staticstics as follow
10 simple read query = 1 simple write query
The main problem is `notification`, whenever a teacher put some updates, i am notifying the student and only those student will get notification who are interested. So it may happen that one update may have 10000+ notification and this will definitely take 3-5 seconds `(waiting time)`. So all reads will be in the queue.
So is there any way to get down the waiting time? | mysql | time-wait | null | null | null | null | open | is there any way to manage the waiting time of mysql
===
whenever we are firing a insert query, for that point of instant that particular table is locked for a span of time. That time can be some micro seconds or some seconds depending upon the row need to be inserted in database.
I am developing an application for a university which have more than a lac of users.
I am taking care of it because last some days i am googleing it and i got the staticstics as follow
10 simple read query = 1 simple write query
The main problem is `notification`, whenever a teacher put some updates, i am notifying the student and only those student will get notification who are interested. So it may happen that one update may have 10000+ notification and this will definitely take 3-5 seconds `(waiting time)`. So all reads will be in the queue.
So is there any way to get down the waiting time? | 0 |
11,327,177 | 07/04/2012 10:22:50 | 1,301,205 | 03/29/2012 15:33:05 | 6 | 0 | SoundCloud dont understand Terms of Use | Can you explain paragraph described in SoundCloud API Terms of Use Acceptable Use?
http://developers.soundcloud.com/policies#commercial | api | soundcloud | terms-of-use | null | null | null | open | SoundCloud dont understand Terms of Use
===
Can you explain paragraph described in SoundCloud API Terms of Use Acceptable Use?
http://developers.soundcloud.com/policies#commercial | 0 |
11,327,178 | 07/04/2012 10:22:51 | 1,302,274 | 03/30/2012 02:48:26 | 496 | 40 | NSMutableArray index Difficulty | When deleting `iCarousel` view, like this:
`[carousel removeItemAtIndex:index animated:YES];`
How to maintain/Retain the deleted views/index even going to different `viewController`?.
Because in my experience of it, it returns its view back,
Or putting the deleted index in an array? is this possible?
Already have tried adding the array to the `app delegate`, but still no luck.
Haven't tried `singleton` yet. But is there other way, Thanks for the help. | iphone | ios | xcode | null | null | null | open | NSMutableArray index Difficulty
===
When deleting `iCarousel` view, like this:
`[carousel removeItemAtIndex:index animated:YES];`
How to maintain/Retain the deleted views/index even going to different `viewController`?.
Because in my experience of it, it returns its view back,
Or putting the deleted index in an array? is this possible?
Already have tried adding the array to the `app delegate`, but still no luck.
Haven't tried `singleton` yet. But is there other way, Thanks for the help. | 0 |
11,327,182 | 07/04/2012 10:23:04 | 458,603 | 09/26/2010 08:22:32 | 462 | 13 | iOS: Assignment to iVar in Block (ARC) | I have a readonly property ```isFinished``` in my interface file:
typedef void (^MyFinishedBlock)(BOOL success, NSError *e);
@interface TMSyncBase : NSObject {
BOOL isFinished_;
}
@property (nonatomic, readonly) BOOL isFinished;
and I want to set it to ```YES``` in a block at some point later, without creating a retain cycle to ```self```:
- (void)doSomethingWithFinishedBlock:(TMSyncFinishedBlock)theFinishedBlock {
__weak MyClass *weakSelf = self;
MyFinishedBlock finishedBlockWrapper = ^(BOOL success, NSError *e) {
[weakSelf willChangeValueForKey:@"isFinished"];
weakSelf -> isFinished_ = YES;
[weakSelf didChangeValueForKey:@"isFinished"];
theFinishedBlock(success, e);
};
self.finishedBlock = finishedBlockWrapper; // finishedBlock is a class ext. property
}
I'm unsure that this is the right way to do it (I hope I'm not embarrassing myself here ^^). Will this code leak, or break, or is it fine? Perhaps there is an easier way I have overlooked? | ios | objective-c-blocks | arc | null | null | null | open | iOS: Assignment to iVar in Block (ARC)
===
I have a readonly property ```isFinished``` in my interface file:
typedef void (^MyFinishedBlock)(BOOL success, NSError *e);
@interface TMSyncBase : NSObject {
BOOL isFinished_;
}
@property (nonatomic, readonly) BOOL isFinished;
and I want to set it to ```YES``` in a block at some point later, without creating a retain cycle to ```self```:
- (void)doSomethingWithFinishedBlock:(TMSyncFinishedBlock)theFinishedBlock {
__weak MyClass *weakSelf = self;
MyFinishedBlock finishedBlockWrapper = ^(BOOL success, NSError *e) {
[weakSelf willChangeValueForKey:@"isFinished"];
weakSelf -> isFinished_ = YES;
[weakSelf didChangeValueForKey:@"isFinished"];
theFinishedBlock(success, e);
};
self.finishedBlock = finishedBlockWrapper; // finishedBlock is a class ext. property
}
I'm unsure that this is the right way to do it (I hope I'm not embarrassing myself here ^^). Will this code leak, or break, or is it fine? Perhaps there is an easier way I have overlooked? | 0 |
11,327,185 | 07/04/2012 10:23:12 | 1,043,299 | 11/12/2011 16:06:16 | 21 | 0 | Building MonoGame Framework for Mac OS | I'm getting ready to port a game, and it's my first time. I'm running Windows 7 and have the latest version of MonoGame from github as well as MonoDevelop 3.0.3.2.
When I try to load the MonoGame.Framework.MacOS solution in MonoDevelop, it fails to load and gives me this error:
Could not load project 'MonoGame\MonoGame.Framework\MonoGame.Framework.MacOS.csproj' with unknown item type '{948B3504-5B70-4649-8FE4-BDE1FB46EC69};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}'
Something similar happens when I try to open the iOS solution. I was able to build the Windows, Linux, and Android solutions successfully, however.
Please advise! | mono | monodevelop | monogame | null | null | null | open | Building MonoGame Framework for Mac OS
===
I'm getting ready to port a game, and it's my first time. I'm running Windows 7 and have the latest version of MonoGame from github as well as MonoDevelop 3.0.3.2.
When I try to load the MonoGame.Framework.MacOS solution in MonoDevelop, it fails to load and gives me this error:
Could not load project 'MonoGame\MonoGame.Framework\MonoGame.Framework.MacOS.csproj' with unknown item type '{948B3504-5B70-4649-8FE4-BDE1FB46EC69};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}'
Something similar happens when I try to open the iOS solution. I was able to build the Windows, Linux, and Android solutions successfully, however.
Please advise! | 0 |
11,327,187 | 07/04/2012 10:23:16 | 1,208,733 | 02/14/2012 09:33:18 | 30 | 0 | Android CM9/AOKP ThemeChooser Eclipse Sample? Where can I find it? | I want to make a CM9/AOKP ThemeChooser Theme but I don't know how to start to create it.
Is there a working Ecplipse Project?
Where can I find it?
Many Thanks... | android | themes | cyanogenmod | null | null | null | open | Android CM9/AOKP ThemeChooser Eclipse Sample? Where can I find it?
===
I want to make a CM9/AOKP ThemeChooser Theme but I don't know how to start to create it.
Is there a working Ecplipse Project?
Where can I find it?
Many Thanks... | 0 |
11,327,149 | 07/04/2012 10:21:33 | 1,501,227 | 07/04/2012 10:01:40 | 1 | 0 | How to cancel save an entity when stay in prePersist function | I have one problem: in a process, I want to cancel saving an entity in prePersit function:
/**
* @ORM\PrePersist
*/
public function setTranslationsValue2()
{
if((null===$this->getContent())or($this->getContent()==''))
{
//wanna stop saving this item???
return false;
}
}
At above function, I don't want to save this entity any more, and don't want to stop my process (the process still save another s)
| symfony-2.0 | null | null | null | null | null | open | How to cancel save an entity when stay in prePersist function
===
I have one problem: in a process, I want to cancel saving an entity in prePersit function:
/**
* @ORM\PrePersist
*/
public function setTranslationsValue2()
{
if((null===$this->getContent())or($this->getContent()==''))
{
//wanna stop saving this item???
return false;
}
}
At above function, I don't want to save this entity any more, and don't want to stop my process (the process still save another s)
| 0 |
11,327,151 | 07/04/2012 10:21:47 | 1,496,936 | 07/02/2012 19:02:52 | 8 | 1 | Creating list of Online users using SESSION without database? | I want to maintain a list of online users for my website WITHOUT database solution (so as to reduce the load).
Is it possible to achieve this with sessions?
| php | php5 | null | null | null | null | open | Creating list of Online users using SESSION without database?
===
I want to maintain a list of online users for my website WITHOUT database solution (so as to reduce the load).
Is it possible to achieve this with sessions?
| 0 |
11,327,189 | 07/04/2012 10:23:20 | 950,854 | 09/18/2011 02:54:53 | 92 | 3 | Trying to Reduce WebApp's Bandwidth Consumption | For a PhoneGap webapp (Android + iOS) I would like to use some kind of mechanism to establish a persistent connection as I have to make very small but very frequent server (PHP) requests and the bandwidth consumed by the headers becomes an issue. I've read a lot about possible solutions but they are either too advanced for my level (amateur) or very unstable/experimental.
What is the easiest way to get rid of the headers' overhead? I'm also open to commercial solutions. | php | mobile | phonegap | null | null | null | open | Trying to Reduce WebApp's Bandwidth Consumption
===
For a PhoneGap webapp (Android + iOS) I would like to use some kind of mechanism to establish a persistent connection as I have to make very small but very frequent server (PHP) requests and the bandwidth consumed by the headers becomes an issue. I've read a lot about possible solutions but they are either too advanced for my level (amateur) or very unstable/experimental.
What is the easiest way to get rid of the headers' overhead? I'm also open to commercial solutions. | 0 |
11,327,196 | 07/04/2012 10:24:05 | 425,680 | 08/19/2010 19:49:09 | 8,090 | 452 | nodejs / express: How to POST to an external form with data? | How do I do a POST to an external public form on another site using nodejs and expressjs after constructing a string with the data I want to POST to the form?
I can't find a straightforward example or documentation for this, only keep finding how to handle and parse POST-ing to a form within your own app. | node.js | post | websocket | express | null | null | open | nodejs / express: How to POST to an external form with data?
===
How do I do a POST to an external public form on another site using nodejs and expressjs after constructing a string with the data I want to POST to the form?
I can't find a straightforward example or documentation for this, only keep finding how to handle and parse POST-ing to a form within your own app. | 0 |
11,327,198 | 07/04/2012 10:24:10 | 1,351,096 | 04/23/2012 10:42:07 | 1 | 1 | Need direction: .setObject vs .setString and saving column info to database from GUI | My code has much repetition so i will just shorthand those parts. I do not know what is the problem with my code as no errors are reported.. just nothing happens.
I am using Netbeans GUI, jdbc and MS SQL. My connection is solid with
preparedstatment = pst
connection = conn
etc.
My aim here is to save text and columns into a single resultset table in SQL.
The code is activated by private void in an action:
private void INSERT1saveCustomers() {
int index=1;
int count = jTable1.getRowCount();
for(int i=0;i<count;i++){
SET0 = new Object[1][count];
SET0[0][i] = txtTestiNIMI1.getText(); }
This is repeated for all objects named SET. It is followed by defining SAVE in a similar fashion
SAVE = new Object[1][count];
SAVE[0][i] = jTable1.getModel().getValueAt(i,0);
Which i then lead into my two SQL queries
String sqla1 = "INSERT INTO MIT(MTY_KOD,MTY_TYY,MTY_ALU,MTY_PARA1,MTY_PARA2,MTY_TOL,MTY_KAN) values(?,?,?,?,?,?,?)";
try{
pst = conn.prepareStatement(sqla1);
pst.setObject(1, SET0);
pst.setObject(2, SET2);
pst.setObject(3, SET1);
pst.setObject(4, SAVE);
pst.setObject(5, SAVE3);
pst.setObject(6, SAVE5);
pst.setObject(7, SET3);
rs = pst.executeQuery();
}
catch(Exception e){}
String sqlb1 = "INSERT INTO TEST(TET_KOD,TET_LUK,TET_ARE,TET_YRE,TET_PVF,TET_TEMP,TET_HUM,TET_DATE, TET_VIR, TET_ERR) values(?,?,?,?,?,?,?,?,?,?)";
try{
pst = conn.prepareStatement(sqlb1);
pst.setObject(1, SET0);
pst.setObject(2, SAVE4);
pst.setObject(3, SAVE6);
pst.setObject(4, SAVE7);
pst.setObject(5, SET4);
pst.setObject(6, SET5);
pst.setObject(7, SET6);
pst.setObject(8, SET2);
pst.setObject(9, SAVE8);
pst.setObject(10, SET7);
rs = pst.executeQuery();
}
catch(Exception e){}
}
No errors are reported... And yes i know that Exception e is there currently but it twas not always so :P
the information just never saves. I have also tried using pst.setString(x,SET.toString()) with the same issue so, I do not know from where to adress the issue. Any help would be appreciated... thank you! | java | sql | string | object | jdbc | null | open | Need direction: .setObject vs .setString and saving column info to database from GUI
===
My code has much repetition so i will just shorthand those parts. I do not know what is the problem with my code as no errors are reported.. just nothing happens.
I am using Netbeans GUI, jdbc and MS SQL. My connection is solid with
preparedstatment = pst
connection = conn
etc.
My aim here is to save text and columns into a single resultset table in SQL.
The code is activated by private void in an action:
private void INSERT1saveCustomers() {
int index=1;
int count = jTable1.getRowCount();
for(int i=0;i<count;i++){
SET0 = new Object[1][count];
SET0[0][i] = txtTestiNIMI1.getText(); }
This is repeated for all objects named SET. It is followed by defining SAVE in a similar fashion
SAVE = new Object[1][count];
SAVE[0][i] = jTable1.getModel().getValueAt(i,0);
Which i then lead into my two SQL queries
String sqla1 = "INSERT INTO MIT(MTY_KOD,MTY_TYY,MTY_ALU,MTY_PARA1,MTY_PARA2,MTY_TOL,MTY_KAN) values(?,?,?,?,?,?,?)";
try{
pst = conn.prepareStatement(sqla1);
pst.setObject(1, SET0);
pst.setObject(2, SET2);
pst.setObject(3, SET1);
pst.setObject(4, SAVE);
pst.setObject(5, SAVE3);
pst.setObject(6, SAVE5);
pst.setObject(7, SET3);
rs = pst.executeQuery();
}
catch(Exception e){}
String sqlb1 = "INSERT INTO TEST(TET_KOD,TET_LUK,TET_ARE,TET_YRE,TET_PVF,TET_TEMP,TET_HUM,TET_DATE, TET_VIR, TET_ERR) values(?,?,?,?,?,?,?,?,?,?)";
try{
pst = conn.prepareStatement(sqlb1);
pst.setObject(1, SET0);
pst.setObject(2, SAVE4);
pst.setObject(3, SAVE6);
pst.setObject(4, SAVE7);
pst.setObject(5, SET4);
pst.setObject(6, SET5);
pst.setObject(7, SET6);
pst.setObject(8, SET2);
pst.setObject(9, SAVE8);
pst.setObject(10, SET7);
rs = pst.executeQuery();
}
catch(Exception e){}
}
No errors are reported... And yes i know that Exception e is there currently but it twas not always so :P
the information just never saves. I have also tried using pst.setString(x,SET.toString()) with the same issue so, I do not know from where to adress the issue. Any help would be appreciated... thank you! | 0 |
11,261,888 | 06/29/2012 12:35:51 | 1,478,568 | 06/24/2012 19:40:51 | 1 | 0 | Java application - calculator answer | I am a begginer, i'm trying to build a calculator.
I have a problem.
I write the answer like this:
ans += Double.parseDouble(etResult.getText().toString());
outTest.setText("The answer is " + ans);
this is in an OnClickListenter.
the problem is that i have to communicate with the double ans, which i defined in the beggining of my project, if i want to communicate with the double i need him to be final, but if he is final i cant change him in the OnClickListener.
can anyone help me and tell me how can i do this? thanks. | java | application | null | null | null | null | open | Java application - calculator answer
===
I am a begginer, i'm trying to build a calculator.
I have a problem.
I write the answer like this:
ans += Double.parseDouble(etResult.getText().toString());
outTest.setText("The answer is " + ans);
this is in an OnClickListenter.
the problem is that i have to communicate with the double ans, which i defined in the beggining of my project, if i want to communicate with the double i need him to be final, but if he is final i cant change him in the OnClickListener.
can anyone help me and tell me how can i do this? thanks. | 0 |
11,261,889 | 06/29/2012 12:35:58 | 1,491,026 | 06/29/2012 11:19:02 | 1 | 0 | Can i add all indexing in single table if my tables are in many to many relationship? | Example:-I have 3 tables product, branch & employee.Those are in Many to many relationship.So can i add all primary keys of those in new table as a foreign key for referencing?Instead of creating 3 different tables.means combination of product_branch, product_employee & branch_employee. | java | mysql | database | java-ee | mysqldump | null | open | Can i add all indexing in single table if my tables are in many to many relationship?
===
Example:-I have 3 tables product, branch & employee.Those are in Many to many relationship.So can i add all primary keys of those in new table as a foreign key for referencing?Instead of creating 3 different tables.means combination of product_branch, product_employee & branch_employee. | 0 |
11,261,890 | 06/29/2012 12:36:00 | 1,099,226 | 12/15/2011 06:04:11 | 19 | 0 | How to set/change input value on other div click? | How to set/change input value on other div click? Input type is hidden.
It is possible?
| javascript | jquery | null | null | null | null | open | How to set/change input value on other div click?
===
How to set/change input value on other div click? Input type is hidden.
It is possible?
| 0 |
11,261,891 | 06/29/2012 12:36:02 | 1,161,520 | 01/20/2012 21:34:23 | 28 | 0 | ActionController::RoutingError uninitialized constant within autocomplete field (rails) | Here are my routes:
match '/goods_ins/autocomplete/autocomplete_supplier_suppliername', :controller => 'goods_ins'
match '/goods_ins/autocomplete/autocomplete_partcode_partcode', :controller => 'goods_ins'
get 'autocomplete_partcode_partcode', :controller => 'goods_ins'
get 'autocomplete_supplier_suppliername', :controller => 'goods_ins'
and this is my auto complete field:
<div class="field">
<%= f.label "Supplier Name" %><br />
<%=f.autocomplete_field :suppliername, :autocomplete => autocomplete_supplier_suppliername_path %>
</div>
when i type something in to the field, i get this error in terminal:
ActionController::RoutingError (uninitialized constant GoodsIns):
| ruby-on-rails | autocomplete | routing | null | null | null | open | ActionController::RoutingError uninitialized constant within autocomplete field (rails)
===
Here are my routes:
match '/goods_ins/autocomplete/autocomplete_supplier_suppliername', :controller => 'goods_ins'
match '/goods_ins/autocomplete/autocomplete_partcode_partcode', :controller => 'goods_ins'
get 'autocomplete_partcode_partcode', :controller => 'goods_ins'
get 'autocomplete_supplier_suppliername', :controller => 'goods_ins'
and this is my auto complete field:
<div class="field">
<%= f.label "Supplier Name" %><br />
<%=f.autocomplete_field :suppliername, :autocomplete => autocomplete_supplier_suppliername_path %>
</div>
when i type something in to the field, i get this error in terminal:
ActionController::RoutingError (uninitialized constant GoodsIns):
| 0 |
11,261,895 | 06/29/2012 12:36:07 | 1,298,483 | 03/28/2012 14:46:50 | 43 | 0 | Single Ruby Gem that parses BOTH xlsx and xls Excel files? | I'm a bit frustrated with the gems out there. It seems like each one does one thing well but not others.
roo parses both xlsx and xls however it doesn't seem to read certain fields correctly and isn't working in each case I need it to.
spreadsheet gem doesn't parse xlsx
rubyXL doesn't parse xls files
Any other suggestions?
Thanks | ruby-on-rails | excel | null | null | null | null | open | Single Ruby Gem that parses BOTH xlsx and xls Excel files?
===
I'm a bit frustrated with the gems out there. It seems like each one does one thing well but not others.
roo parses both xlsx and xls however it doesn't seem to read certain fields correctly and isn't working in each case I need it to.
spreadsheet gem doesn't parse xlsx
rubyXL doesn't parse xls files
Any other suggestions?
Thanks | 0 |
11,261,900 | 06/29/2012 12:36:29 | 103,089 | 05/07/2009 18:48:55 | 2,626 | 50 | throw 404 error when route is not satisfied | using the default route
routes.MapRoute(
"Admin", // Route name
"Admin/{action}", // URL with parameters
new { controller = "Admin", action = "Index" } // Parameter defaults
);
lots of routes (approx. 90%) for our application are working, so that's fine.
Now when the user enters `/logon/strangeroute`, MVC offcourse throws an error because i don't have the `strangeroute` action in my `logoncontroller`.
Using the catch all exception handler in the `global.asax.cs`, i can't find to get the difference between routing errors (i call this a routing error) and another error (thrown in the rest of the code).
I would like to discriminate betweek the types of errors because when the route gives an error it most of the time is a 404 error, and i want to redirect the user to the 404 page and not to the normal, generic, error page.
One soultion would be to create all the routes for all the pages and dismiss the existing default route and implement a catch-all route but i'd prefer not to create a separate route for every url.
Is there another way of doing this?
| asp.net-mvc | asp.net-mvc-3 | null | null | null | null | open | throw 404 error when route is not satisfied
===
using the default route
routes.MapRoute(
"Admin", // Route name
"Admin/{action}", // URL with parameters
new { controller = "Admin", action = "Index" } // Parameter defaults
);
lots of routes (approx. 90%) for our application are working, so that's fine.
Now when the user enters `/logon/strangeroute`, MVC offcourse throws an error because i don't have the `strangeroute` action in my `logoncontroller`.
Using the catch all exception handler in the `global.asax.cs`, i can't find to get the difference between routing errors (i call this a routing error) and another error (thrown in the rest of the code).
I would like to discriminate betweek the types of errors because when the route gives an error it most of the time is a 404 error, and i want to redirect the user to the 404 page and not to the normal, generic, error page.
One soultion would be to create all the routes for all the pages and dismiss the existing default route and implement a catch-all route but i'd prefer not to create a separate route for every url.
Is there another way of doing this?
| 0 |
11,261,903 | 06/29/2012 12:36:39 | 935,394 | 09/08/2011 17:24:56 | 182 | 4 | The pros and cons of a mobile web app vs a ios native app | I'm trying to compile a list of the pros and cons of a mobile web app vs a native app.
I find that native apps are a lot smoother when it comes to animations. I've also found that moving from page to page on a native app is a lot faster because most of the UI is on the device so the amount downloaded is a lot smaller.
The path app has some beautiful animations and the UX is very nice. I'm not sure this app would be as good if it wasn't a native one.
I havn't come across any really nice mobile web apps. There are some good frameworks out there. I have used jQuery mobile and while it seems good, I think it still has some work to be done to get it really useful.
So my question is:
**What do you think the main pros/cons of a mobile web app are compared to a native ios app?** | ios | html5 | web-applications | mobile | null | 06/30/2012 05:54:06 | not constructive | The pros and cons of a mobile web app vs a ios native app
===
I'm trying to compile a list of the pros and cons of a mobile web app vs a native app.
I find that native apps are a lot smoother when it comes to animations. I've also found that moving from page to page on a native app is a lot faster because most of the UI is on the device so the amount downloaded is a lot smaller.
The path app has some beautiful animations and the UX is very nice. I'm not sure this app would be as good if it wasn't a native one.
I havn't come across any really nice mobile web apps. There are some good frameworks out there. I have used jQuery mobile and while it seems good, I think it still has some work to be done to get it really useful.
So my question is:
**What do you think the main pros/cons of a mobile web app are compared to a native ios app?** | 4 |
11,261,904 | 06/29/2012 12:36:39 | 860,109 | 07/24/2011 09:42:23 | 60 | 0 | Android: TextView Ellipsize (...) not working | I want to have a single lined TextView to show up 3 dots at the end when the text is longer than the TextView. I don't know why - but i don't get it.
I already wrapped my head around similar stackoverflow questions - but i ended up with no solution. Maybe someone has some useful hints.
<LinearLayout android:layout_height="wrap_content" android:layout_width="fill_parent"
android:orientation="vertical">
<TextView android:textStyle="bold" android:text="Full Name" android:layout_height="wrap_content" android:textSize="16sp"
android:layout_width="wrap_content" android:id="@+id/lName"
android:layout_gravity="center_vertical" android:maxLines="1" android:ellipsize="end"/>
</LinearLayout>
The linear Layout above is nested into 2 other Linear Layouts. Maybe this is important to know. I already tried the attribute "singleLine" too, but some say this is deprecated and it doesnt work anyway. | android | android-layout | android-linearlayout | android-textview | null | null | open | Android: TextView Ellipsize (...) not working
===
I want to have a single lined TextView to show up 3 dots at the end when the text is longer than the TextView. I don't know why - but i don't get it.
I already wrapped my head around similar stackoverflow questions - but i ended up with no solution. Maybe someone has some useful hints.
<LinearLayout android:layout_height="wrap_content" android:layout_width="fill_parent"
android:orientation="vertical">
<TextView android:textStyle="bold" android:text="Full Name" android:layout_height="wrap_content" android:textSize="16sp"
android:layout_width="wrap_content" android:id="@+id/lName"
android:layout_gravity="center_vertical" android:maxLines="1" android:ellipsize="end"/>
</LinearLayout>
The linear Layout above is nested into 2 other Linear Layouts. Maybe this is important to know. I already tried the attribute "singleLine" too, but some say this is deprecated and it doesnt work anyway. | 0 |
11,261,875 | 06/29/2012 12:35:14 | 1,480,009 | 06/25/2012 12:45:47 | 1 | 0 | Android and neuroph nullpointer exception | I'm trying to make image recognition using neuroph on android but it gives me nullpointer exception even though it was working. I'm using two classes one for the neural network and onr for fetching the image automatically from the sdcard.
The network class
public class NeuNet {
Activity activity;
private NeuralNetwork nnet;
private ImageRecognitionPlugin imageRecognition;
public NeuNet(Activity activity){
this.activity = activity;
loadData();
}
private void loadData() {
//showDialog(LOADING_DATA_DIALOG);
// load neural network in separate thread with stack size = 32000
new Thread(null, loadDataRunnable, "dataLoader", 128000).start();
}
private Runnable loadDataRunnable = new Runnable() {
public void run() {
// open neural network
Resources res = activity.getResources();
InputStream is = res.openRawResource(R.raw.numbers_net);
// load neural network
nnet = NeuralNetwork.load(is);
imageRecognition = (ImageRecognitionPlugin) nnet
.getPlugin(ImageRecognitionPlugin.class);
// dismiss loading dialog
//dismissDialog(LOADING_DATA_DIALOG);
}
};
public String recognize(Image image) {
//showDialog(RECOGNIZING_IMAGE_DIALOG);
// recognize image
HashMap<String, Double> output = imageRecognition.recognizeImage(image);
//dismissDialog(RECOGNIZING_IMAGE_DIALOG);
return getAnswer(output);
}
private String getAnswer(HashMap<String, Double> output) {
double highest = 0;
String answer = "";
for (Map.Entry<String, Double> entry : output.entrySet()) {
if (entry.getValue() > highest) {
highest = entry.getValue();
answer = entry.getKey();
}
}
return answer;
}
}
and the main class as follow
public class NeurophActivity extends Activity implements OnTouchListener {
private final int SELECT_PHOTO = 1;
private final int LOADING_DATA_DIALOG = 2;
private final int RECOGNIZING_IMAGE_DIALOG = 3;
private NeuNet nnet;
private TextView txtAnswer;
private LinearLayout screen;
private Bitmap bitmap;
private Image image;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
nnet = new NeuNet(this);
txtAnswer = (TextView) findViewById(R.id.txtAnswer);
screen = (LinearLayout) findViewById(R.id.screen);
screen.setOnTouchListener(this);
// loadData();
}
public void myPath() {
File f = new File(Environment.getExternalStorageDirectory().toString());
Log.d("p", f.toString());
// System.exit(0);
String path = f.toString() + "/pic/6.jpg";
// System.out.println(f);
Log.d("ppppp", path);
image = ImageFactory.getImage(path);
Log.d("ddddd", path);
txtAnswer.setText("This is a " + nnet.recognize(image));
}
@Override
public boolean onTouch(View v, MotionEvent event) {
myPath();
} | android | neural-network | null | null | null | null | open | Android and neuroph nullpointer exception
===
I'm trying to make image recognition using neuroph on android but it gives me nullpointer exception even though it was working. I'm using two classes one for the neural network and onr for fetching the image automatically from the sdcard.
The network class
public class NeuNet {
Activity activity;
private NeuralNetwork nnet;
private ImageRecognitionPlugin imageRecognition;
public NeuNet(Activity activity){
this.activity = activity;
loadData();
}
private void loadData() {
//showDialog(LOADING_DATA_DIALOG);
// load neural network in separate thread with stack size = 32000
new Thread(null, loadDataRunnable, "dataLoader", 128000).start();
}
private Runnable loadDataRunnable = new Runnable() {
public void run() {
// open neural network
Resources res = activity.getResources();
InputStream is = res.openRawResource(R.raw.numbers_net);
// load neural network
nnet = NeuralNetwork.load(is);
imageRecognition = (ImageRecognitionPlugin) nnet
.getPlugin(ImageRecognitionPlugin.class);
// dismiss loading dialog
//dismissDialog(LOADING_DATA_DIALOG);
}
};
public String recognize(Image image) {
//showDialog(RECOGNIZING_IMAGE_DIALOG);
// recognize image
HashMap<String, Double> output = imageRecognition.recognizeImage(image);
//dismissDialog(RECOGNIZING_IMAGE_DIALOG);
return getAnswer(output);
}
private String getAnswer(HashMap<String, Double> output) {
double highest = 0;
String answer = "";
for (Map.Entry<String, Double> entry : output.entrySet()) {
if (entry.getValue() > highest) {
highest = entry.getValue();
answer = entry.getKey();
}
}
return answer;
}
}
and the main class as follow
public class NeurophActivity extends Activity implements OnTouchListener {
private final int SELECT_PHOTO = 1;
private final int LOADING_DATA_DIALOG = 2;
private final int RECOGNIZING_IMAGE_DIALOG = 3;
private NeuNet nnet;
private TextView txtAnswer;
private LinearLayout screen;
private Bitmap bitmap;
private Image image;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
nnet = new NeuNet(this);
txtAnswer = (TextView) findViewById(R.id.txtAnswer);
screen = (LinearLayout) findViewById(R.id.screen);
screen.setOnTouchListener(this);
// loadData();
}
public void myPath() {
File f = new File(Environment.getExternalStorageDirectory().toString());
Log.d("p", f.toString());
// System.exit(0);
String path = f.toString() + "/pic/6.jpg";
// System.out.println(f);
Log.d("ppppp", path);
image = ImageFactory.getImage(path);
Log.d("ddddd", path);
txtAnswer.setText("This is a " + nnet.recognize(image));
}
@Override
public boolean onTouch(View v, MotionEvent event) {
myPath();
} | 0 |
11,261,909 | 06/29/2012 12:37:00 | 1,129,840 | 01/04/2012 11:43:08 | 2 | 3 | affliate window csv to drupal node via batch api | i have an affliate window CSV which has nearly 1 lac rows, i want to save this as nodes, and i tried with batch API.
but still i am getting php timeout error ..please help
function MODULE_aw_batch(){
$operations = array();
$csv = file_directory_path().'/aw/datafeed_134642.csv';
$file = fopen($csv, 'r');
while (($data = fgetcsv($file)) !== FALSE) {
$operations[] = array('MODULE_aw_op', array($data));
}
$batch = array(
'title' => t('Generating feeds'), // Title to display while running.
'operations' => $operations,
'finished' => 'MODULE_aw_finished', // Last function to call.
'init_message' => t('Importing...it may take 4-5 hours'),
'progress_message' => t('Processed @current out of @total.'),
'error_message' => t('Import feeds has encountered an error.'),
);
batch_set($batch);
batch_process('admin/content/node/overview');
} | drupal | drupal-batch | null | null | null | null | open | affliate window csv to drupal node via batch api
===
i have an affliate window CSV which has nearly 1 lac rows, i want to save this as nodes, and i tried with batch API.
but still i am getting php timeout error ..please help
function MODULE_aw_batch(){
$operations = array();
$csv = file_directory_path().'/aw/datafeed_134642.csv';
$file = fopen($csv, 'r');
while (($data = fgetcsv($file)) !== FALSE) {
$operations[] = array('MODULE_aw_op', array($data));
}
$batch = array(
'title' => t('Generating feeds'), // Title to display while running.
'operations' => $operations,
'finished' => 'MODULE_aw_finished', // Last function to call.
'init_message' => t('Importing...it may take 4-5 hours'),
'progress_message' => t('Processed @current out of @total.'),
'error_message' => t('Import feeds has encountered an error.'),
);
batch_set($batch);
batch_process('admin/content/node/overview');
} | 0 |
11,261,914 | 06/29/2012 12:37:17 | 1,489,766 | 06/28/2012 21:10:30 | 1 | 0 | How can I bypass Grails exception handling, in order to use Spring Oauth2? | I am trying to port an Oauth2 client based on Oauth for Spring Security from plain Java/Spring to Grails, and have run into a problem. The crux of the issue appears to be the fact that the design of the Spring Oauth client implementation relies on the assumption that an exception thrown from the Oauth2RestTemplate will be caught in a catch block of the OAuth2ClientContextFilter, thus allowing the filter to issue a redirect response (to send an authorization request to the oath provider).
This works fine in plain Java/Spring but in Grails, the GrailsDispatcherServlet is configured to handle all exceptions via HandlerExceptionResolvers. Thus the exception thrown in the Oauth2RestTemplate (invoked inside a Grails controller) is caught by the GrailsExceptionResolver and is never seen by the OAuth2ClientContextFilter, thus defeating the desired redirect behavior.
All discussions I have found of customizing Grails exception handling all seem to assume that the purpose of the customization is to map the exception to an HTTP error code or to a error page view. But is there some way to tell Grails to simply allow a particular exception to flow through unhandled, so that it can be caught by the servlet filter? Or is it possible to insert a custom HandlerExceptionResolver that re-throws the exception rather than returning a ModelAndView (as is the standard expectation for a HandlerExceptionResolver)? Or is there some other better way to get the Oauth for Spring Security client working inside Grails? | spring | grails | spring-security | oauth-2.0 | null | null | open | How can I bypass Grails exception handling, in order to use Spring Oauth2?
===
I am trying to port an Oauth2 client based on Oauth for Spring Security from plain Java/Spring to Grails, and have run into a problem. The crux of the issue appears to be the fact that the design of the Spring Oauth client implementation relies on the assumption that an exception thrown from the Oauth2RestTemplate will be caught in a catch block of the OAuth2ClientContextFilter, thus allowing the filter to issue a redirect response (to send an authorization request to the oath provider).
This works fine in plain Java/Spring but in Grails, the GrailsDispatcherServlet is configured to handle all exceptions via HandlerExceptionResolvers. Thus the exception thrown in the Oauth2RestTemplate (invoked inside a Grails controller) is caught by the GrailsExceptionResolver and is never seen by the OAuth2ClientContextFilter, thus defeating the desired redirect behavior.
All discussions I have found of customizing Grails exception handling all seem to assume that the purpose of the customization is to map the exception to an HTTP error code or to a error page view. But is there some way to tell Grails to simply allow a particular exception to flow through unhandled, so that it can be caught by the servlet filter? Or is it possible to insert a custom HandlerExceptionResolver that re-throws the exception rather than returning a ModelAndView (as is the standard expectation for a HandlerExceptionResolver)? Or is there some other better way to get the Oauth for Spring Security client working inside Grails? | 0 |
11,261,917 | 06/29/2012 12:37:25 | 613,782 | 02/11/2011 23:45:00 | 53 | 10 | Are there performance guides for iOS and Android browsers? | As a web developer I also have to take the Android and iOS web browsers into account. The rendering engines of these browsers and the lack of power and memory brings a lot of complications.
So I was wondering, is there a comprehensive guide on performance tuning (HTML/CSS/Javascript) for these browsers? | javascript | android | html | ios | css3 | null | open | Are there performance guides for iOS and Android browsers?
===
As a web developer I also have to take the Android and iOS web browsers into account. The rendering engines of these browsers and the lack of power and memory brings a lot of complications.
So I was wondering, is there a comprehensive guide on performance tuning (HTML/CSS/Javascript) for these browsers? | 0 |
11,261,918 | 06/29/2012 12:37:36 | 1,014,462 | 10/26/2011 11:46:32 | 1 | 0 | uploading files from client side using jquery ajax using .net | I have a requirement of uploading files from client side using jquery ajax function to different server location instead of sending it to my application web server, this is to avoid anonymous/virus upload to application webserver.
I have searched many sites, but all samples are done in php not in .net 2.0.
Much appreciate if any of you could give me a lead or solution for the same.
Many Thanks
Ananda | .net | jquery-ajax | client-side | null | null | null | open | uploading files from client side using jquery ajax using .net
===
I have a requirement of uploading files from client side using jquery ajax function to different server location instead of sending it to my application web server, this is to avoid anonymous/virus upload to application webserver.
I have searched many sites, but all samples are done in php not in .net 2.0.
Much appreciate if any of you could give me a lead or solution for the same.
Many Thanks
Ananda | 0 |
11,713,284 | 07/29/2012 21:53:11 | 577,277 | 01/16/2011 04:52:14 | 411 | 5 | Need to create thumbnail from user submitted url like reddit/facebook | I am pretty new to Django so I am creating a project to learn more about how it works. Right now I have a model that contains a URL field. I want to automatically generate a thumbnail from this url field by taking an appropriate image from the webite like facebook or reddit does. I'm guessing that I should store this image in an image field. What would be a good way to select an ideal image from the website and how can I accomplish this? | python | django | image | null | null | null | open | Need to create thumbnail from user submitted url like reddit/facebook
===
I am pretty new to Django so I am creating a project to learn more about how it works. Right now I have a model that contains a URL field. I want to automatically generate a thumbnail from this url field by taking an appropriate image from the webite like facebook or reddit does. I'm guessing that I should store this image in an image field. What would be a good way to select an ideal image from the website and how can I accomplish this? | 0 |
11,713,277 | 07/29/2012 21:52:34 | 899,386 | 08/17/2011 20:09:13 | 13 | 1 | Graphics processing in general | I am quite familiar with the .Net framework and graphics processing is quite essential for my implementations. It is easy to import a bitmap and manipulate it like negating it or changing contrast etc. It can be done pixel by pixel, which is how I do it but it really takes a long time on higher resolution images. And then there is matrix methods, where you enter translation and rotation data into the matrix, apply the transformation and somehow the image is magically processed instantly.
I want to know how I can write my own matrix methods, I don't want to use built-in functions. I am familiar with the workings of matrix mechanics( as an engineering student I had 8 math subjects in two years ) and I have an idea of how it's applied to graphics processing; but I still can't see how an image is processed so quickly by graphics software such as Photoshop and even MS-Paint, it can surely not be pixel by pixel operations.
Can anyone advise me on the basic methodology in achieving such efficiency in processing images?
Regards
Charl | .net | graphics | null | null | null | null | open | Graphics processing in general
===
I am quite familiar with the .Net framework and graphics processing is quite essential for my implementations. It is easy to import a bitmap and manipulate it like negating it or changing contrast etc. It can be done pixel by pixel, which is how I do it but it really takes a long time on higher resolution images. And then there is matrix methods, where you enter translation and rotation data into the matrix, apply the transformation and somehow the image is magically processed instantly.
I want to know how I can write my own matrix methods, I don't want to use built-in functions. I am familiar with the workings of matrix mechanics( as an engineering student I had 8 math subjects in two years ) and I have an idea of how it's applied to graphics processing; but I still can't see how an image is processed so quickly by graphics software such as Photoshop and even MS-Paint, it can surely not be pixel by pixel operations.
Can anyone advise me on the basic methodology in achieving such efficiency in processing images?
Regards
Charl | 0 |
11,713,291 | 07/29/2012 21:54:25 | 512,225 | 11/18/2010 14:19:57 | 390 | 39 | python: how to acces attributes of functions | I'm trying to acces attributes of member functions, but I cannot understand why I can access only through the __dict __
class A(object):
def fA(self):
print A.fA.x
fA.x = 2
A.fA.__dict__['x'] = 3
#A.fa.x #AttributeError: 'instancemethod' object has no attribute 'x'
A.fA.x = 4
Why I do get an AttributeError if I try to access 'directly'? | python | lookup | member-functions | null | null | null | open | python: how to acces attributes of functions
===
I'm trying to acces attributes of member functions, but I cannot understand why I can access only through the __dict __
class A(object):
def fA(self):
print A.fA.x
fA.x = 2
A.fA.__dict__['x'] = 3
#A.fa.x #AttributeError: 'instancemethod' object has no attribute 'x'
A.fA.x = 4
Why I do get an AttributeError if I try to access 'directly'? | 0 |
11,713,295 | 07/29/2012 21:54:51 | 165,694 | 08/30/2009 19:53:00 | 721 | 7 | Populating a listview control in asp.net | I have a code block that returns a list of employee object.
The resultset contains more than one employee record. One of the elements, is EmployeeID.
I need to populate listview (lstDepartment) with only the EmployeeID. How can I do that?
lstDepartment.DataSource = oCorp.GetEmployeeList(emp);
lstDepartment.DataBind()
| c# | asp.net | listview | null | null | null | open | Populating a listview control in asp.net
===
I have a code block that returns a list of employee object.
The resultset contains more than one employee record. One of the elements, is EmployeeID.
I need to populate listview (lstDepartment) with only the EmployeeID. How can I do that?
lstDepartment.DataSource = oCorp.GetEmployeeList(emp);
lstDepartment.DataBind()
| 0 |
11,713,270 | 07/29/2012 21:52:06 | 1,510,255 | 07/08/2012 16:15:52 | 58 | 2 | Eclipse is not recognizing my Android tablet | I think I have done everything right but I cannot get Eclipse to recognize my plugged in running Samsung Tab-2. Below is what I have done. What have I done wrong?
1) I have instelled USB drivers and can move files from the tablet to the Windows XP computer.
2) I have enabled USB debugging on the phone
3) I have been debugging on a virtual device then sending the apd files over email to my tablet and phone. That works fine. Obviously, I have enabled that on the phone.
4) I set up Eclipse to always ask what device to debug on.
5) I plugged the tablet into the USB slot and it is recognized by Windows.
6) I read the instructions [Here][1]
7) I click debug and am faced with a blank list of devices under "Choosing a running Android Device". My tablet does not show up.
8) I find myself at wit's end (adventure reference).
9) I ask for help on Stackoverflow.
[1]: http://developer.android.com/tools/device.html | android | eclipse | null | null | null | null | open | Eclipse is not recognizing my Android tablet
===
I think I have done everything right but I cannot get Eclipse to recognize my plugged in running Samsung Tab-2. Below is what I have done. What have I done wrong?
1) I have instelled USB drivers and can move files from the tablet to the Windows XP computer.
2) I have enabled USB debugging on the phone
3) I have been debugging on a virtual device then sending the apd files over email to my tablet and phone. That works fine. Obviously, I have enabled that on the phone.
4) I set up Eclipse to always ask what device to debug on.
5) I plugged the tablet into the USB slot and it is recognized by Windows.
6) I read the instructions [Here][1]
7) I click debug and am faced with a blank list of devices under "Choosing a running Android Device". My tablet does not show up.
8) I find myself at wit's end (adventure reference).
9) I ask for help on Stackoverflow.
[1]: http://developer.android.com/tools/device.html | 0 |
11,541,217 | 07/18/2012 12:20:17 | 1,529,766 | 07/16/2012 18:39:43 | 1 | 0 | .class expected - beginner help please | I am trying to write some code to print out a square made up of '*'s. The problem is that I get an error saying '.class expected' after the variable 'int stars'. I'm not sure what this means.
class Main
{
public static void main( String args[] )
{
int sqaure = 5;
int line = 1;
while ( line <= sqaure )
int stars = 1;
while ( stars <= square )
{
System.out.print( "*" );
stars = stars + 1;
}
System.out.println();
line = line + 1;
}
} | java | null | null | null | null | null | open | .class expected - beginner help please
===
I am trying to write some code to print out a square made up of '*'s. The problem is that I get an error saying '.class expected' after the variable 'int stars'. I'm not sure what this means.
class Main
{
public static void main( String args[] )
{
int sqaure = 5;
int line = 1;
while ( line <= sqaure )
int stars = 1;
while ( stars <= square )
{
System.out.print( "*" );
stars = stars + 1;
}
System.out.println();
line = line + 1;
}
} | 0 |
11,541,224 | 07/18/2012 12:20:38 | 1,526,819 | 07/15/2012 11:45:22 | 1 | 0 | better solution than bumblebee? | i am using ubuntu 12.04 LTS kernel 3.2.x
i was having overheating issues with the nvidia graphics card.
I installed the bumblebee project for a temporary solution. As a result i have to manually turn on the graphics support using optirun.
sudo add-apt-repository ppa:bumblebee/stable
sudo apt-get update
sudo apt-get install bumblebee bumblebee-nvidia
Is there a tweak to avoid heating and be able to use the graphics card like we do in windows? | linux-kernel | ubuntu-12.04 | overheating | null | null | null | open | better solution than bumblebee?
===
i am using ubuntu 12.04 LTS kernel 3.2.x
i was having overheating issues with the nvidia graphics card.
I installed the bumblebee project for a temporary solution. As a result i have to manually turn on the graphics support using optirun.
sudo add-apt-repository ppa:bumblebee/stable
sudo apt-get update
sudo apt-get install bumblebee bumblebee-nvidia
Is there a tweak to avoid heating and be able to use the graphics card like we do in windows? | 0 |
11,541,226 | 07/18/2012 12:20:39 | 420,540 | 08/14/2010 18:13:20 | 190 | 3 | Runtime conditional typedef in C | I know there is a C++ version of this question, however I'm using standard typedefs not templates.
I've written a program that works with 16-bit wav files. It does this by loading each sample into a short. The program then performs arithmetic on the short.
I'm now modifying the program so it can with with both 16- and 32-bit wavs. I was hoping to do a conditional typedef, i.e. using short for 16-bit and int for 32-bit. But then I realised that the compiler probably would not compile the code if it did not know what the type of a variable is beforehand.
So I tried to test out the following code:
#include <stdio.h>
int
main()
{
int i;
scanf("%i", &i);
typedef short test;
if(i == 1)
typedef short sample;
else
typedef int sample;
return 0;
}
And got got the following compiler errors:
dt.c: In function ‘main’:
dt.c:12:5: error: expected expression before ‘typedef’
dt.c:14:5: error: expected expression before ‘typedef’
Does this mean that runtime conditional typedefs in C are not possible?
[Open-ended question:] If not, how would you guys handle something like this?
| c | types | typedef | null | null | null | open | Runtime conditional typedef in C
===
I know there is a C++ version of this question, however I'm using standard typedefs not templates.
I've written a program that works with 16-bit wav files. It does this by loading each sample into a short. The program then performs arithmetic on the short.
I'm now modifying the program so it can with with both 16- and 32-bit wavs. I was hoping to do a conditional typedef, i.e. using short for 16-bit and int for 32-bit. But then I realised that the compiler probably would not compile the code if it did not know what the type of a variable is beforehand.
So I tried to test out the following code:
#include <stdio.h>
int
main()
{
int i;
scanf("%i", &i);
typedef short test;
if(i == 1)
typedef short sample;
else
typedef int sample;
return 0;
}
And got got the following compiler errors:
dt.c: In function ‘main’:
dt.c:12:5: error: expected expression before ‘typedef’
dt.c:14:5: error: expected expression before ‘typedef’
Does this mean that runtime conditional typedefs in C are not possible?
[Open-ended question:] If not, how would you guys handle something like this?
| 0 |
11,541,230 | 07/18/2012 12:21:19 | 1,532,912 | 07/17/2012 20:17:33 | 1 | 0 | TortoiseSVN plugin help "Failed to start issue tracker COM provider %plugin%" | I have a fully working plugin for tortoiseSVN(x86). It does everything I would like but I cannot get it to work on x64 machines. It properly installs, registers, appears when you click the button...but when you hit commit this is what I get this output:
Action Path
Command Commit
Modified C:\Test2\README.txt
Sending content C:\Test2\README.txt
Completed At revision: 17
Error Failed to start the issue tracker COM provider 'SCRFixerPlugIn'.
Error Invalid pointer
Error Object reference not set to an instance of an object.
I can find no specific references to these errors. Again it works very well on 32 bit...but I just can't get it to work with no errors on 64bit.
Thank you for any help!
David
| plugins | tortoisesvn | null | null | null | null | open | TortoiseSVN plugin help "Failed to start issue tracker COM provider %plugin%"
===
I have a fully working plugin for tortoiseSVN(x86). It does everything I would like but I cannot get it to work on x64 machines. It properly installs, registers, appears when you click the button...but when you hit commit this is what I get this output:
Action Path
Command Commit
Modified C:\Test2\README.txt
Sending content C:\Test2\README.txt
Completed At revision: 17
Error Failed to start the issue tracker COM provider 'SCRFixerPlugIn'.
Error Invalid pointer
Error Object reference not set to an instance of an object.
I can find no specific references to these errors. Again it works very well on 32 bit...but I just can't get it to work with no errors on 64bit.
Thank you for any help!
David
| 0 |
11,541,236 | 07/18/2012 12:21:40 | 1,523,173 | 07/13/2012 09:38:59 | 1 | 0 | send UI controls entered data values to C++ function | Anyone help me how to send UI controls entered data values to C++ function
like in C#,
in C#:
-----------------------------------
SaveData(txtUsername.value,txtAge.value){
}
HOW WE CAN SEND DATA WHICH IS ENTERED FROM UI TO C++ FUNCTION
THANKING YOU, | c++ | sqlite | null | null | null | null | open | send UI controls entered data values to C++ function
===
Anyone help me how to send UI controls entered data values to C++ function
like in C#,
in C#:
-----------------------------------
SaveData(txtUsername.value,txtAge.value){
}
HOW WE CAN SEND DATA WHICH IS ENTERED FROM UI TO C++ FUNCTION
THANKING YOU, | 0 |
11,541,239 | 07/18/2012 12:21:46 | 761,095 | 05/19/2011 13:01:12 | 165 | 17 | How to allow to steal locks only to a specific Active Directory domain group with VisualSVN Server? | Development team that uses [Subversion's locking feature][1] and VisualSVN Server with Active Directory authentication ([Integrated Windows Authentication][2] or [Basic Authentication][3]) may need to restrict anyone except administrators to [steal locks][4].
Such task can be achieved with a [pre-lock hook][5]. However since the authentication relies on Active Directory users and groups, writing such a script can be a bit tricky.
Also there may be other cases when certain AD users' actions must be processed by a hook script differently based on their AD domain groups membership.
Is there any sample that show how to check AD domain group membership with a Subversion hook?
[1]: http://www.visualsvn.com/support/svnbook/advanced/locking/
[2]: http://en.wikipedia.org/wiki/Integrated_windows_authentication
[3]: http://en.wikipedia.org/wiki/Basic_access_authentication
[4]: http://www.visualsvn.com/support/svnbook/advanced/locking/#svn.advanced.locking.break-steal
[5]: http://www.visualsvn.com/support/svnbook/ref/reposhooks/pre-lock/ | svn | powershell | active-directory | hook | visualsvn-server | null | open | How to allow to steal locks only to a specific Active Directory domain group with VisualSVN Server?
===
Development team that uses [Subversion's locking feature][1] and VisualSVN Server with Active Directory authentication ([Integrated Windows Authentication][2] or [Basic Authentication][3]) may need to restrict anyone except administrators to [steal locks][4].
Such task can be achieved with a [pre-lock hook][5]. However since the authentication relies on Active Directory users and groups, writing such a script can be a bit tricky.
Also there may be other cases when certain AD users' actions must be processed by a hook script differently based on their AD domain groups membership.
Is there any sample that show how to check AD domain group membership with a Subversion hook?
[1]: http://www.visualsvn.com/support/svnbook/advanced/locking/
[2]: http://en.wikipedia.org/wiki/Integrated_windows_authentication
[3]: http://en.wikipedia.org/wiki/Basic_access_authentication
[4]: http://www.visualsvn.com/support/svnbook/advanced/locking/#svn.advanced.locking.break-steal
[5]: http://www.visualsvn.com/support/svnbook/ref/reposhooks/pre-lock/ | 0 |
11,541,248 | 07/18/2012 12:22:12 | 186,192 | 10/08/2009 07:42:41 | 123 | 0 | .NET Action with nested Action questions | I have next snippet:
public Action<Action<bool>> GetAction()
{
return m => MyMethod(123, "string", m);
}
private void MyMethod(int someInteger, string someString, Action<bool> boolAction)
{
// some work with int and string was done
boolAction(true);
}
Could you please explain me why this work? I see that `Action<Action<bool>>` need some void method with **only one** parameter of `Action<bool>`. So what is wrong here with two first arguments?
Also it's not clear for me why we pass `m` into. How this lambda could be called in the `boolAction(true)`. What will happen there?
Any advice on this will be helpfull. | .net | lambda | null | null | null | null | open | .NET Action with nested Action questions
===
I have next snippet:
public Action<Action<bool>> GetAction()
{
return m => MyMethod(123, "string", m);
}
private void MyMethod(int someInteger, string someString, Action<bool> boolAction)
{
// some work with int and string was done
boolAction(true);
}
Could you please explain me why this work? I see that `Action<Action<bool>>` need some void method with **only one** parameter of `Action<bool>`. So what is wrong here with two first arguments?
Also it's not clear for me why we pass `m` into. How this lambda could be called in the `boolAction(true)`. What will happen there?
Any advice on this will be helpfull. | 0 |
11,541,251 | 07/18/2012 12:22:31 | 167,033 | 09/02/2009 05:54:03 | 113 | 8 | Hide all activity and projects from reporter except his own issues | How can I hide all the activity and projects from a reporter in redmine.
say I added one of client to add bugs and ticket to his project, but when clients login into system he is able to see all other projects as well as calendar and other internal documents which I don't want him to see.
Is it possible for a reporter can see only issues related his own project. Not the Gantt, calendar and Activity. | project-management | redmine | null | null | null | null | open | Hide all activity and projects from reporter except his own issues
===
How can I hide all the activity and projects from a reporter in redmine.
say I added one of client to add bugs and ticket to his project, but when clients login into system he is able to see all other projects as well as calendar and other internal documents which I don't want him to see.
Is it possible for a reporter can see only issues related his own project. Not the Gantt, calendar and Activity. | 0 |
11,297,895 | 07/02/2012 16:49:48 | 739,323 | 05/05/2011 06:36:08 | 241 | 33 | Convert d.getDay() to mon, tue | I am getting d.getDay but its giving me like 0 for Sunday, Is there any direct way to get Sunday instead of 0. I have searched but couldn't find any. I dont want to do like comparing 0 then creating string with "Sun" and so on.....
Thanks | java | android | date | null | null | null | open | Convert d.getDay() to mon, tue
===
I am getting d.getDay but its giving me like 0 for Sunday, Is there any direct way to get Sunday instead of 0. I have searched but couldn't find any. I dont want to do like comparing 0 then creating string with "Sun" and so on.....
Thanks | 0 |
11,297,409 | 07/02/2012 16:15:30 | 1,382,779 | 05/08/2012 17:52:19 | 315 | 21 | Chunked file copy (via FTP) has missing bytes? | So, I'm writing a chunked file transfer script that is intended to copy files--small and large--to a remote server. It almost works fantastically (and did with a 26 byte file I tested, haha) but when I start to do larger files, I notice it isn't quite working. For example, I uploaded a 96,489,231 byte file, but the final file was 95,504,152 bytes. I tested it with a 928,670,754 byte file, and the copied file only had 927,902,792 bytes.
Has anyone else ever experienced this? I'm guessing `feof()` may be doing something wonky, but I have no idea how to replace it, or test that. I commented the code, for your convenience. :)
<?php
// FTP credentials
$server = CENSORED;
$username = CENSORED;
$password = CENSORED;
// Destination file (where the copied file should go)
$destination = "ftp://$username:$password@$server/ftp/final.avi";
// The file on my server that we're copying (in chunks) to $destination.
$read = 'gah.avi';
// If the file we're trying to copy exists...
if (file_exists($read))
{
// Set a chunk size
$chunk_size = 2048;
// For reading through the file we want to copy to the FTP server.
$read_handle = fopen($read, 'r');
// For appending to the destination file.
$destination_handle = fopen($destination, 'a');
echo '<span style="font-size:20px;">';
echo 'Uploading......';
// Loop through $read until we reach the end of the file.
while (!feof($read_handle))
{
// So Rackspace doesn't think nothing's happening.
echo PHP_EOL;
// Read a chunk of the file we're copying.
$chunk = fread($read_handle, $chunk_size);
// Write the chunk to the destination file.
fwrite($destination_handle, $chunk);
}
echo 'Done!';
echo '</span>';
}
fclose($read_handle);
?> | php | ftp | eof | chunked | null | null | open | Chunked file copy (via FTP) has missing bytes?
===
So, I'm writing a chunked file transfer script that is intended to copy files--small and large--to a remote server. It almost works fantastically (and did with a 26 byte file I tested, haha) but when I start to do larger files, I notice it isn't quite working. For example, I uploaded a 96,489,231 byte file, but the final file was 95,504,152 bytes. I tested it with a 928,670,754 byte file, and the copied file only had 927,902,792 bytes.
Has anyone else ever experienced this? I'm guessing `feof()` may be doing something wonky, but I have no idea how to replace it, or test that. I commented the code, for your convenience. :)
<?php
// FTP credentials
$server = CENSORED;
$username = CENSORED;
$password = CENSORED;
// Destination file (where the copied file should go)
$destination = "ftp://$username:$password@$server/ftp/final.avi";
// The file on my server that we're copying (in chunks) to $destination.
$read = 'gah.avi';
// If the file we're trying to copy exists...
if (file_exists($read))
{
// Set a chunk size
$chunk_size = 2048;
// For reading through the file we want to copy to the FTP server.
$read_handle = fopen($read, 'r');
// For appending to the destination file.
$destination_handle = fopen($destination, 'a');
echo '<span style="font-size:20px;">';
echo 'Uploading......';
// Loop through $read until we reach the end of the file.
while (!feof($read_handle))
{
// So Rackspace doesn't think nothing's happening.
echo PHP_EOL;
// Read a chunk of the file we're copying.
$chunk = fread($read_handle, $chunk_size);
// Write the chunk to the destination file.
fwrite($destination_handle, $chunk);
}
echo 'Done!';
echo '</span>';
}
fclose($read_handle);
?> | 0 |
11,297,862 | 07/02/2012 16:47:56 | 539,529 | 12/12/2010 12:31:20 | 207 | 9 | Is there anyway to create a link via a webview that opens a part of your application? | For example: The facebook app is basically just a webview using html5, so how does it link to things like the default message editor when you try to write something on someone's wall? I know part of the app is probably using Three20. So are they just linking to that part of the app using their app url? (fb://profile/122605446 for example). | iphone | ios | three20 | null | null | null | open | Is there anyway to create a link via a webview that opens a part of your application?
===
For example: The facebook app is basically just a webview using html5, so how does it link to things like the default message editor when you try to write something on someone's wall? I know part of the app is probably using Three20. So are they just linking to that part of the app using their app url? (fb://profile/122605446 for example). | 0 |
11,297,864 | 07/02/2012 16:47:59 | 710,994 | 04/16/2011 08:55:29 | 70 | 3 | movie or slideshow creator with Javascript | I'm looking for an open source JS tool that enables the user to create an animation on a set of slides and play this animation as a movie with specific time frames. | javascript | animation | css3 | open-source | null | null | open | movie or slideshow creator with Javascript
===
I'm looking for an open source JS tool that enables the user to create an animation on a set of slides and play this animation as a movie with specific time frames. | 0 |
11,297,898 | 07/02/2012 16:50:03 | 1,496,631 | 07/02/2012 16:32:33 | 1 | 0 | 'index.swf' embedded in 'index.html' showing same website twice in one page. HTML Title tag/attribute also showing the value 'undefined' | I have an issue with my current website. Upon hosting this Online, the .SWF shows at the top of the page, roughly covering 1/4 and also again at the bottom, covering 3/4. If I zoom in and out, the bottom half of the page slightly covers the top, but the top is still showing. It is asif the .SWF has been embedded twice.. here is my code;
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="author" content="Kush Kouture" />
<meta name="keywords" content="Kush Kouture" />
<meta name="description" content="Kush Kouture" />
<title>Kush Kouture</title>
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript" src="swfaddress.js"></script>
<script type="text/javascript" src="swffit.js"></script>
<script type="text/javascript">
var flashvars = {};
flashvars.url_config = "xml/configuration_site.xml";
flashvars.initServices = true;
var params = {};
params.allowfullscreen = true;
params.allowScriptAccess = "always";
var attributes = {};
attributes.id = 'flashObject';
attributes.bgcolor = '#000000';
swfobject.embedSWF("flash/index.swf", "Alternative", "100%", "100%", "11.0.0", false, flashvars, params, attributes);
</script>
<style type="text/css">
/* hide from ie on mac \*/
html {
height: 100%;
overflow: hidden;
}
#flashcontent {
height: 100%;
}
/* end hide */
body {
height: 100%;
margin: 0;
padding: 0;
background-color: #ffffff;
}
p {
font-size: 10px;
font-family: Verdana;
line-height:17px;
color:#ffffff;
}
.style1 {
font-size: 11px;
font-family: Verdana;
color:#ffffff;
text-transform:uppercase;
}
</style>
</head>
<body>
<div id="flashContent>
<object id="flashObject" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=11,0,0,0" width="100%" height="100%">
<param name="movie" value="flash/index.swf" />
<param name="wmode" value="transparent" />
<param name="width" value="100%" />
<param name="height" value="100%" />
<param name="scale" value="noscale" />
<object type="application/x-shockwave-flash" data="flash/index.swf" align="" scale="noscale" wmode="transparent" width="100%" height="100%">
</object>
</object>
</div>
<div id="Alternative">
<p style="color:#999999"> Kush Kouture | You require the latest version of Adobe Flash Player in order to view this site. Please use the button below to download the latest version.</p>
<p><a href="http://get.adobe.com/flashplayer/"><img src="flash.jpg" alt="Get Adobe Flash player" /></a></p>
</div>
</body>
</html>
--------------------------------
I have also noticed that the Page Title is showing correct, but with the value 'underfined' next to it..
eg. should be 'Home Page', showing 'Homepageundefined'
I really appreciate any help that can be givien in regards to the above issues and can also be contacted on [email protected] | javascript | html | css | embedded | null | null | open | 'index.swf' embedded in 'index.html' showing same website twice in one page. HTML Title tag/attribute also showing the value 'undefined'
===
I have an issue with my current website. Upon hosting this Online, the .SWF shows at the top of the page, roughly covering 1/4 and also again at the bottom, covering 3/4. If I zoom in and out, the bottom half of the page slightly covers the top, but the top is still showing. It is asif the .SWF has been embedded twice.. here is my code;
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="author" content="Kush Kouture" />
<meta name="keywords" content="Kush Kouture" />
<meta name="description" content="Kush Kouture" />
<title>Kush Kouture</title>
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript" src="swfaddress.js"></script>
<script type="text/javascript" src="swffit.js"></script>
<script type="text/javascript">
var flashvars = {};
flashvars.url_config = "xml/configuration_site.xml";
flashvars.initServices = true;
var params = {};
params.allowfullscreen = true;
params.allowScriptAccess = "always";
var attributes = {};
attributes.id = 'flashObject';
attributes.bgcolor = '#000000';
swfobject.embedSWF("flash/index.swf", "Alternative", "100%", "100%", "11.0.0", false, flashvars, params, attributes);
</script>
<style type="text/css">
/* hide from ie on mac \*/
html {
height: 100%;
overflow: hidden;
}
#flashcontent {
height: 100%;
}
/* end hide */
body {
height: 100%;
margin: 0;
padding: 0;
background-color: #ffffff;
}
p {
font-size: 10px;
font-family: Verdana;
line-height:17px;
color:#ffffff;
}
.style1 {
font-size: 11px;
font-family: Verdana;
color:#ffffff;
text-transform:uppercase;
}
</style>
</head>
<body>
<div id="flashContent>
<object id="flashObject" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=11,0,0,0" width="100%" height="100%">
<param name="movie" value="flash/index.swf" />
<param name="wmode" value="transparent" />
<param name="width" value="100%" />
<param name="height" value="100%" />
<param name="scale" value="noscale" />
<object type="application/x-shockwave-flash" data="flash/index.swf" align="" scale="noscale" wmode="transparent" width="100%" height="100%">
</object>
</object>
</div>
<div id="Alternative">
<p style="color:#999999"> Kush Kouture | You require the latest version of Adobe Flash Player in order to view this site. Please use the button below to download the latest version.</p>
<p><a href="http://get.adobe.com/flashplayer/"><img src="flash.jpg" alt="Get Adobe Flash player" /></a></p>
</div>
</body>
</html>
--------------------------------
I have also noticed that the Page Title is showing correct, but with the value 'underfined' next to it..
eg. should be 'Home Page', showing 'Homepageundefined'
I really appreciate any help that can be givien in regards to the above issues and can also be contacted on [email protected] | 0 |
11,297,899 | 07/02/2012 16:50:03 | 90,291 | 04/13/2009 16:11:16 | 417 | 15 | Keyboard handling in a winforms app | I'm building a WinForms app which looks roughly like this:
![enter image description here][1]
[1]: http://i.stack.imgur.com/HSjzP.jpg
There is a single Form, with a menu, toolbar, status bar, a navigation tree, a custom drawing canvas (which is a UserControl that accepts keyboard input and draws text and also renders a caret) and a Find panel which allows the user to search for text.
I'm having difficulty with getting these behaviors to work:
1) The accelerators on the Find Panel (e.g. 'c' for Match case and 'w' for Whole words) prevent those characters from being entered into the canvas, even when the canvas has focus.
2) Pressing ESC when the focus is anywhere but the canvas should return the focus to the canvas. In particular, this should work when the Find textbox has focus. Can this be done by hooking the keyboard at a single point rather than for each possible focused control? | winforms | events | keyboard | focus | null | null | open | Keyboard handling in a winforms app
===
I'm building a WinForms app which looks roughly like this:
![enter image description here][1]
[1]: http://i.stack.imgur.com/HSjzP.jpg
There is a single Form, with a menu, toolbar, status bar, a navigation tree, a custom drawing canvas (which is a UserControl that accepts keyboard input and draws text and also renders a caret) and a Find panel which allows the user to search for text.
I'm having difficulty with getting these behaviors to work:
1) The accelerators on the Find Panel (e.g. 'c' for Match case and 'w' for Whole words) prevent those characters from being entered into the canvas, even when the canvas has focus.
2) Pressing ESC when the focus is anywhere but the canvas should return the focus to the canvas. In particular, this should work when the Find textbox has focus. Can this be done by hooking the keyboard at a single point rather than for each possible focused control? | 0 |
11,297,868 | 07/02/2012 16:48:26 | 1,496,114 | 07/02/2012 13:00:58 | 1 | 0 | Sublime Text (v 2.0) - how do I stop auto indentation on new lines after brackets? | I'm trying to make the jump from Notepad++ to Sublime Text 2. However one issue is stopping me from doing so:
When working in CSS, JavaScript or PHP - whenever I type a bracket and press [ENTER], an extra indentation is added. E.g. below show's you where the caret ends up if I type a bracket and press enter:
{
|
I need the caret to appear at the same horizontal point as the bracket, like so:
{
|
I've tried messing with the indentation settings to no avail. Here are my current User Settings:
{
"auto_indent": true,
"auto_match_enabled": false,
"bold_folder_labels": true,
"color_scheme": "Packages/Color Scheme - Default/Twilight.tmTheme",
"detect_indentation": false,
"font_face": "Courier New",
"font_size": 10,
"highlight_modified_tabs": true,
"ignored_packages":
[
"Vintage"
],
"indent_to_bracket": false,
"line_padding_bottom": 1,
"line_padding_top": 1,
"smart_indent": false,
"trim_automatic_white_space": false
}
I've also tried playing with the files in Packages/JavaScript to no avail.
Would really appreciate a solution as I really want to start using this editor!
Thanks.
| indentation | sublimetext2 | autoindent | null | null | null | open | Sublime Text (v 2.0) - how do I stop auto indentation on new lines after brackets?
===
I'm trying to make the jump from Notepad++ to Sublime Text 2. However one issue is stopping me from doing so:
When working in CSS, JavaScript or PHP - whenever I type a bracket and press [ENTER], an extra indentation is added. E.g. below show's you where the caret ends up if I type a bracket and press enter:
{
|
I need the caret to appear at the same horizontal point as the bracket, like so:
{
|
I've tried messing with the indentation settings to no avail. Here are my current User Settings:
{
"auto_indent": true,
"auto_match_enabled": false,
"bold_folder_labels": true,
"color_scheme": "Packages/Color Scheme - Default/Twilight.tmTheme",
"detect_indentation": false,
"font_face": "Courier New",
"font_size": 10,
"highlight_modified_tabs": true,
"ignored_packages":
[
"Vintage"
],
"indent_to_bracket": false,
"line_padding_bottom": 1,
"line_padding_top": 1,
"smart_indent": false,
"trim_automatic_white_space": false
}
I've also tried playing with the files in Packages/JavaScript to no avail.
Would really appreciate a solution as I really want to start using this editor!
Thanks.
| 0 |
11,226,263 | 06/27/2012 12:31:23 | 1,485,472 | 06/27/2012 11:28:17 | 1 | 0 | Cakephp Js helper | I am working with Js helper to help me replace the contents of a "div" in my index.ctp with contents of another file changeto.ctp .
This application has a few check boxes with corresponding images. When I select a checkbox, the setting is stored in the database and the corresponding image is to be displayed. Similarly when unchecked, it is to be removed from the database and the image should disappear.
I am using the Js helper for this :
my changeto.ctp is subset of my index.ctp and has access to same variables and loads without any problems (except that any click/change events are just not responded to. The names of the Ids of the checkboxes are exactly same).
My index file contains the following Js code at the bottom of all Html:
$this->Js->get($change_checkbox1 )->event('click',
$this->Js->request(array(
'controller'=>'testing',
'action'=>'changeto'
), array(
'update'=>'#changeDiv',
'async' => true,
'method' => 'post',
'dataExpression'=>true,
'data'=> $this->Js->serializeForm(array(
'isForm' => false,
'inline' => true
))
))
);
This is generating the following Jquery/javascript
$(document).ready(function () {$("#ck0_1_8").bind("click", function (event) {$.ajax({async:true, data:$("#ck0_1_8").closest("form").serialize(), dataType:"html", success:function (data, textStatus) {$("#changeDiv").html(data);}, type:"post", url:"\/mytest-site\/options\/testing"});
return false;});
}
My controller has a function called
changeto()
{
$this->layout = 'ajax';
}
the first time I click on this the checkbox this works without any problem. However any subsequent clicks don't work. The javascript is not even being called.
My questions are :
Any ideas ?
Will it help if I somehow ask cakephp to use on() / live() insead of bind() .If yes how ?
Thanks!!
| cakephp | null | null | null | null | null | open | Cakephp Js helper
===
I am working with Js helper to help me replace the contents of a "div" in my index.ctp with contents of another file changeto.ctp .
This application has a few check boxes with corresponding images. When I select a checkbox, the setting is stored in the database and the corresponding image is to be displayed. Similarly when unchecked, it is to be removed from the database and the image should disappear.
I am using the Js helper for this :
my changeto.ctp is subset of my index.ctp and has access to same variables and loads without any problems (except that any click/change events are just not responded to. The names of the Ids of the checkboxes are exactly same).
My index file contains the following Js code at the bottom of all Html:
$this->Js->get($change_checkbox1 )->event('click',
$this->Js->request(array(
'controller'=>'testing',
'action'=>'changeto'
), array(
'update'=>'#changeDiv',
'async' => true,
'method' => 'post',
'dataExpression'=>true,
'data'=> $this->Js->serializeForm(array(
'isForm' => false,
'inline' => true
))
))
);
This is generating the following Jquery/javascript
$(document).ready(function () {$("#ck0_1_8").bind("click", function (event) {$.ajax({async:true, data:$("#ck0_1_8").closest("form").serialize(), dataType:"html", success:function (data, textStatus) {$("#changeDiv").html(data);}, type:"post", url:"\/mytest-site\/options\/testing"});
return false;});
}
My controller has a function called
changeto()
{
$this->layout = 'ajax';
}
the first time I click on this the checkbox this works without any problem. However any subsequent clicks don't work. The javascript is not even being called.
My questions are :
Any ideas ?
Will it help if I somehow ask cakephp to use on() / live() insead of bind() .If yes how ?
Thanks!!
| 0 |
11,226,271 | 06/27/2012 12:31:37 | 479,330 | 10/18/2010 13:14:50 | 449 | 17 | AOP with Ninject Interception, Castle DynamicProxy and WPF window: Can't find XAML resource in DynamicProxy of window | In our real world application we defined an attribute that is used to enable logging in methods or classes (the usual AOP use case). When we apply this attribute to an WPF window class, objects of this class can't be created by Ninject. Here is a minimal example to reproduce the issue:
**dummy interceptor for logging:**
public class MyInterceptor: IInterceptor
{
public void Intercept(IInvocation invocation)
{
Console.WriteLine("Calling {0} at {1}", invocation.Request.Method.Name, DateTime.Now);
invocation.Proceed();
}
}
**the corresponding attribute:**
public class MyAttribute: InterceptAttribute
{
public override IInterceptor CreateInterceptor(IProxyRequest request)
{
return new MyInterceptor();
}
}
**the window class (completely empty, only the automatically generated empty grid is inside):**
[My]
public partial class MainWindow: Window
{
public MainWindow()
{
InitializeComponent();
}
}
**and finally the app startup code where the object is requested:**
public partial class App: Application
{
private void Application_Startup(object sender, StartupEventArgs e)
{
var kernel = new StandardKernel(new NinjectSettings() { LoadExtensions = false }, new DynamicProxyModule());
var window = kernel.Get<MainWindow>();
window.ShowDialog();
}
}
When requesting the window via `kernel.Get<MainWindow>();` an TargetInvocationException is thrown with an inner exception telling me that `Castle.Proxies.MainWindowProxy` doesn't have a resource specified by URI `"/NinjectInterceptionWPF;component/mainwindow.xaml"` where `NinjectInterceptionWPF` is our assembly's short name.
When we look at the automatically created `InitializeComponent` of `MainWindow` we can see that an URI is created to address the XAML code, which seems to be missing for the proxy:
System.Uri resourceLocater = new System.Uri("/NinjectInterceptionWPF;component/mainwindow.xaml", System.UriKind.Relative);
#line 1 "..\..\..\MainWindow.xaml"
System.Windows.Application.LoadComponent(this, resourceLocater);
I already played around a bit and tried to use an absolute URI but `LoadComponent` only accept relative ones.
Some searching shows that a lot of people use Ninject Interception and DynmaicProxy for WPF binding (INotifyPropertyChanged) so I think in General it should be possible to build a proxy of a WPF window.
But how? | wpf | ninject | aop | null | null | null | open | AOP with Ninject Interception, Castle DynamicProxy and WPF window: Can't find XAML resource in DynamicProxy of window
===
In our real world application we defined an attribute that is used to enable logging in methods or classes (the usual AOP use case). When we apply this attribute to an WPF window class, objects of this class can't be created by Ninject. Here is a minimal example to reproduce the issue:
**dummy interceptor for logging:**
public class MyInterceptor: IInterceptor
{
public void Intercept(IInvocation invocation)
{
Console.WriteLine("Calling {0} at {1}", invocation.Request.Method.Name, DateTime.Now);
invocation.Proceed();
}
}
**the corresponding attribute:**
public class MyAttribute: InterceptAttribute
{
public override IInterceptor CreateInterceptor(IProxyRequest request)
{
return new MyInterceptor();
}
}
**the window class (completely empty, only the automatically generated empty grid is inside):**
[My]
public partial class MainWindow: Window
{
public MainWindow()
{
InitializeComponent();
}
}
**and finally the app startup code where the object is requested:**
public partial class App: Application
{
private void Application_Startup(object sender, StartupEventArgs e)
{
var kernel = new StandardKernel(new NinjectSettings() { LoadExtensions = false }, new DynamicProxyModule());
var window = kernel.Get<MainWindow>();
window.ShowDialog();
}
}
When requesting the window via `kernel.Get<MainWindow>();` an TargetInvocationException is thrown with an inner exception telling me that `Castle.Proxies.MainWindowProxy` doesn't have a resource specified by URI `"/NinjectInterceptionWPF;component/mainwindow.xaml"` where `NinjectInterceptionWPF` is our assembly's short name.
When we look at the automatically created `InitializeComponent` of `MainWindow` we can see that an URI is created to address the XAML code, which seems to be missing for the proxy:
System.Uri resourceLocater = new System.Uri("/NinjectInterceptionWPF;component/mainwindow.xaml", System.UriKind.Relative);
#line 1 "..\..\..\MainWindow.xaml"
System.Windows.Application.LoadComponent(this, resourceLocater);
I already played around a bit and tried to use an absolute URI but `LoadComponent` only accept relative ones.
Some searching shows that a lot of people use Ninject Interception and DynmaicProxy for WPF binding (INotifyPropertyChanged) so I think in General it should be possible to build a proxy of a WPF window.
But how? | 0 |
11,226,276 | 06/27/2012 12:31:57 | 1,049,642 | 11/16/2011 12:26:36 | 6 | 0 | htmlfile unknown runtime error in IE8 | I am running my asp.net application in IE 8,
I got this error "htmlfile:unknown runtime error" on every button click on form(in other browsers its working fine)
the code where it is occured is-
e.innerHTML="var __chd__ = {'aid':11079,'chaid':'www_objectify_ca'};
(function() { var c =document.createElement('script');
c.type = 'text/javascript'; c.async = true;c.src = ( 'https:' == document.location.protocol ? 'https://z': 'http://p') + '.chango.com/static/c.js'; var s = document.getElementsByTagName('script')[0];s.parentNode.insertBefore(c, s);})();"
I have used devexpres controls for functioning and javascript for popup window.
thanks,
| asp.net | internet-explorer | devexpress | null | null | null | open | htmlfile unknown runtime error in IE8
===
I am running my asp.net application in IE 8,
I got this error "htmlfile:unknown runtime error" on every button click on form(in other browsers its working fine)
the code where it is occured is-
e.innerHTML="var __chd__ = {'aid':11079,'chaid':'www_objectify_ca'};
(function() { var c =document.createElement('script');
c.type = 'text/javascript'; c.async = true;c.src = ( 'https:' == document.location.protocol ? 'https://z': 'http://p') + '.chango.com/static/c.js'; var s = document.getElementsByTagName('script')[0];s.parentNode.insertBefore(c, s);})();"
I have used devexpres controls for functioning and javascript for popup window.
thanks,
| 0 |
11,226,283 | 06/27/2012 12:32:19 | 1,426,282 | 05/30/2012 14:33:23 | 1 | 1 | JavaScript DOM not being read in html table | I have a chart that reads data from < table id="chartData">
Chart reading from table code:
$('#chartData td').each( function() {
currentCell++;
if ( currentCell % 2 != 0 ) {
currentRow++;
chartData[currentRow] = [];
chartData[currentRow]['label'] = $(this).text();
} else {
var value = parseFloat($(this).text());
totalValue += value;
value = value.toFixed(2);
chartData[currentRow]['value'] = value;
}
// Store the slice index in this cell, and attach a click handler to it
$(this).data( 'slice', currentRow );
$(this).click( handleTableClick );
I append a number to an ID
var f_page = ["TheHouseofMarley"];
retrieveData(f_page[0]);
function retrieveData(teamName) {
var baseURL = 'http://graph.facebook.com/';
$.getJSON(baseURL+teamName+"&callback=?", function(data) {
$('#FBlikes').append(data.likes)
});
};
and this works, it gives 8407
The problem is when I insert this number into < table id="chartData"> it is not read by the chart!
<table id="chartData">
<tr style="color: #0DA068">
<td>Number of Likes </td><td><span id='FBlikes'></span> </td> //Not Read!
</tr>
<tr style="color: #194E9C">
<td>MegaWidget</td><td>20000</td> //This is Read by the Chart!
</tr>
</table>
In short: Javascript output is not being read from HTML table.
Could anyone point me in some direction? I'm really new at code.
Thank you! | javascript | html | table | dom | null | null | open | JavaScript DOM not being read in html table
===
I have a chart that reads data from < table id="chartData">
Chart reading from table code:
$('#chartData td').each( function() {
currentCell++;
if ( currentCell % 2 != 0 ) {
currentRow++;
chartData[currentRow] = [];
chartData[currentRow]['label'] = $(this).text();
} else {
var value = parseFloat($(this).text());
totalValue += value;
value = value.toFixed(2);
chartData[currentRow]['value'] = value;
}
// Store the slice index in this cell, and attach a click handler to it
$(this).data( 'slice', currentRow );
$(this).click( handleTableClick );
I append a number to an ID
var f_page = ["TheHouseofMarley"];
retrieveData(f_page[0]);
function retrieveData(teamName) {
var baseURL = 'http://graph.facebook.com/';
$.getJSON(baseURL+teamName+"&callback=?", function(data) {
$('#FBlikes').append(data.likes)
});
};
and this works, it gives 8407
The problem is when I insert this number into < table id="chartData"> it is not read by the chart!
<table id="chartData">
<tr style="color: #0DA068">
<td>Number of Likes </td><td><span id='FBlikes'></span> </td> //Not Read!
</tr>
<tr style="color: #194E9C">
<td>MegaWidget</td><td>20000</td> //This is Read by the Chart!
</tr>
</table>
In short: Javascript output is not being read from HTML table.
Could anyone point me in some direction? I'm really new at code.
Thank you! | 0 |
11,224,421 | 06/27/2012 10:43:30 | 1,362,850 | 04/28/2012 12:21:41 | 7 | 1 | How to upload images/files and save to sql server using jquery in asp.net and vice versa | I need help in uploading an image in jquery then afterwards sending it to server-side for its insertion to sql server and retrieving image from sql server then appending it to a div. Is there a way to do this from client-side to server-side and vice versa? I've read so many articles, but most of them are pure server-side. Can anyone give me an example? Any help will be fully appreciated. | jquery | asp.net | image | upload | null | null | open | How to upload images/files and save to sql server using jquery in asp.net and vice versa
===
I need help in uploading an image in jquery then afterwards sending it to server-side for its insertion to sql server and retrieving image from sql server then appending it to a div. Is there a way to do this from client-side to server-side and vice versa? I've read so many articles, but most of them are pure server-side. Can anyone give me an example? Any help will be fully appreciated. | 0 |
11,226,290 | 06/27/2012 12:32:42 | 1,485,130 | 06/27/2012 09:22:10 | 1 | 0 | Assign input form to a variable | I have this input form which goes like this:
<input type="checkbox" name="vehicle" value="Bike" />
I want to print it inside this variable:
$return .= '<div class="flink">'.$checkbox.'</div>';
or can i assign it to any other variable?
How can i do it? I tried putting :
$checkbox.= '<input type="checkbox" name="vehicle" value="Bike" />';
| php | null | null | null | null | null | open | Assign input form to a variable
===
I have this input form which goes like this:
<input type="checkbox" name="vehicle" value="Bike" />
I want to print it inside this variable:
$return .= '<div class="flink">'.$checkbox.'</div>';
or can i assign it to any other variable?
How can i do it? I tried putting :
$checkbox.= '<input type="checkbox" name="vehicle" value="Bike" />';
| 0 |
11,400,990 | 07/09/2012 18:32:59 | 172,277 | 09/11/2009 21:14:31 | 963 | 54 | Is there any XSS threat while having JSON encoded in the URL? | In order to have an URL friendly application I'm storing it's context has a JSON in URL, which gives something like :
http://mysite.dev/myapppage/target#?context={%22attr1%22%3A{%22target_id-0%22%3A{%22value%22%3A%223%22%2C%22label%22%3A%22Hello%22}}}
Which encode a basic context :
{
"attr1":
{
"target_id-0":
{
"value": "3",
"label": "Hello"
}
}
}
I'm serializing my object with :
JSON.stringify(context)
I'm deserializing it with :
var hashParamsElements = window.location.toString().split('?');
hashParamsElements.shift(); // we just skip the first part of the url
var hashParams = $.deparam(hashParamsElements.join('?'));
var contextString = hashParams.context;
var context = JSON.parse(contextString);
The context is only stored to read variables, there's no evaluated code in it. Can someone tell me whether or not it's XSS safe ?
If there's a threat : how can I avoid it ? | json | xss | urlencode | null | null | null | open | Is there any XSS threat while having JSON encoded in the URL?
===
In order to have an URL friendly application I'm storing it's context has a JSON in URL, which gives something like :
http://mysite.dev/myapppage/target#?context={%22attr1%22%3A{%22target_id-0%22%3A{%22value%22%3A%223%22%2C%22label%22%3A%22Hello%22}}}
Which encode a basic context :
{
"attr1":
{
"target_id-0":
{
"value": "3",
"label": "Hello"
}
}
}
I'm serializing my object with :
JSON.stringify(context)
I'm deserializing it with :
var hashParamsElements = window.location.toString().split('?');
hashParamsElements.shift(); // we just skip the first part of the url
var hashParams = $.deparam(hashParamsElements.join('?'));
var contextString = hashParams.context;
var context = JSON.parse(contextString);
The context is only stored to read variables, there's no evaluated code in it. Can someone tell me whether or not it's XSS safe ?
If there's a threat : how can I avoid it ? | 0 |
11,400,998 | 07/09/2012 18:34:19 | 543,700 | 12/15/2010 17:40:52 | 105 | 9 | Compile Time Hashing C++0x | Using GCC 4.4 (generally the max available for Android and IOS) is there a way to do compile time hashing of strings.
We have a resource manager that maps string keys to resources. While the lookup is fast the hashing and string creation is slow. Something like:
ResourcesManager::get<Texture>("someKey");
Spends a lot of time allocating the string "someKey" and then hashing it.
I'm wondering if there is a trick I can use to hash it at compile time. | c++ | compiler | hash | null | null | null | open | Compile Time Hashing C++0x
===
Using GCC 4.4 (generally the max available for Android and IOS) is there a way to do compile time hashing of strings.
We have a resource manager that maps string keys to resources. While the lookup is fast the hashing and string creation is slow. Something like:
ResourcesManager::get<Texture>("someKey");
Spends a lot of time allocating the string "someKey" and then hashing it.
I'm wondering if there is a trick I can use to hash it at compile time. | 0 |
11,400,999 | 07/09/2012 18:34:27 | 385,433 | 07/07/2010 10:27:39 | 9,454 | 206 | Inconsistent DATETIME/FLOAT conversion with CONVERT when user language not English | I have some trouble with SQL Server 2005 and SQL Server 2008 when working with values which have a different representation in German than in English. Server and OS are running as German versions.
SET LANGUAGE deutsch;
SELECT
CONVERT(datetime, '31. Dezember 1999') as a,
CONVERT(nvarchar, CONVERT(datetime, '31. Dezember 1999')) as b,
CONVERT(float,'3.14159') as p,
CONVERT(nvarchar, CONVERT(float,'3.14159')) as q;
the output in the management console is this:
a=1999-12-31 00:00:00.000
b=Dez 31 1999 12:00AM
c=3,14159
d=3.14159
dateformat=dmy
This is inconsistent. In (a) the *German* representation of Dec-31-1999 is correctly parsed and displayed (and only German works..). Converting the same date explicitly with CONVERT returns a string which mixes an *English* date format with a *German* abbreviated month name (it says "Dez 31" not "Dec 31" if you look closely).
But p is converted from a string in *English* notation (decimal point) into a float, yet displayed in *German* notation (using a decimal comma), while explicit conversion to nvarchar yields the number in *English* notation again. OTOH CONVERT() does not accept input in German notation for conversion to float.
So, I have a CONVERT function:
1. which accepts strings for conversion to datetime in *German* notation only.
2. but accepts strings for conversion to float in *English* only.
3. and converts datetime values to nvarchar mixing both *German and English*.
4. converts float values to *English*.
But what I need is a function in SQL Server 2005, 2008 which converts text from the current user language to values of the supported types (datetime, floats...) and converts these values back into a text representation with respect to the current user language.
What is this function?
| sql | sql-server-2008 | sql-server-2005 | localization | conversion | null | open | Inconsistent DATETIME/FLOAT conversion with CONVERT when user language not English
===
I have some trouble with SQL Server 2005 and SQL Server 2008 when working with values which have a different representation in German than in English. Server and OS are running as German versions.
SET LANGUAGE deutsch;
SELECT
CONVERT(datetime, '31. Dezember 1999') as a,
CONVERT(nvarchar, CONVERT(datetime, '31. Dezember 1999')) as b,
CONVERT(float,'3.14159') as p,
CONVERT(nvarchar, CONVERT(float,'3.14159')) as q;
the output in the management console is this:
a=1999-12-31 00:00:00.000
b=Dez 31 1999 12:00AM
c=3,14159
d=3.14159
dateformat=dmy
This is inconsistent. In (a) the *German* representation of Dec-31-1999 is correctly parsed and displayed (and only German works..). Converting the same date explicitly with CONVERT returns a string which mixes an *English* date format with a *German* abbreviated month name (it says "Dez 31" not "Dec 31" if you look closely).
But p is converted from a string in *English* notation (decimal point) into a float, yet displayed in *German* notation (using a decimal comma), while explicit conversion to nvarchar yields the number in *English* notation again. OTOH CONVERT() does not accept input in German notation for conversion to float.
So, I have a CONVERT function:
1. which accepts strings for conversion to datetime in *German* notation only.
2. but accepts strings for conversion to float in *English* only.
3. and converts datetime values to nvarchar mixing both *German and English*.
4. converts float values to *English*.
But what I need is a function in SQL Server 2005, 2008 which converts text from the current user language to values of the supported types (datetime, floats...) and converts these values back into a text representation with respect to the current user language.
What is this function?
| 0 |
11,399,936 | 07/09/2012 17:18:24 | 1,431,601 | 06/01/2012 20:51:29 | 1 | 0 | How to run Processing sketch in Xcode? | As part of a student thesis project, my group and I are making, among other things, an app that displays data visualization that will be done in Processing. We were wondering what's the best way to do this?
We were initially thinking of converting the Processing file (.pde) into a video and just playing it in the app but I've heard that converting it into a .dvg is better and I've also heard you can just run the .pde in Xcode.
Does anybody have advice on what's the best way to do this and how?
Thanks so much! | xcode | ios5 | processing | null | null | null | open | How to run Processing sketch in Xcode?
===
As part of a student thesis project, my group and I are making, among other things, an app that displays data visualization that will be done in Processing. We were wondering what's the best way to do this?
We were initially thinking of converting the Processing file (.pde) into a video and just playing it in the app but I've heard that converting it into a .dvg is better and I've also heard you can just run the .pde in Xcode.
Does anybody have advice on what's the best way to do this and how?
Thanks so much! | 0 |
11,401,002 | 07/09/2012 18:34:52 | 1,512,823 | 07/09/2012 18:30:43 | 1 | 0 | C# overwrite Existing Cookie in CookieContainer? | I request a page with HTTPWebRequest and using this code i add cookie
> agent.cookieJar.Add(new Uri("http://www.website.com"),
> new Cookie("brbr", "harta&brbra&=-"));
I ended up with 2 the same cookies with different values in each of them. because the request has javascript cookies sent back What function should I use to overwrite/update "brbr" cookie When I need to?
Thanks | c# | cookies | null | null | null | null | open | C# overwrite Existing Cookie in CookieContainer?
===
I request a page with HTTPWebRequest and using this code i add cookie
> agent.cookieJar.Add(new Uri("http://www.website.com"),
> new Cookie("brbr", "harta&brbra&=-"));
I ended up with 2 the same cookies with different values in each of them. because the request has javascript cookies sent back What function should I use to overwrite/update "brbr" cookie When I need to?
Thanks | 0 |
11,399,086 | 07/09/2012 16:16:51 | 991,583 | 10/12/2011 13:51:13 | 8 | 0 | Get option set and lookup field values from FetchXml in CRM 2011 | I'm attempting to use fetchxml to obtain values from another record to create a new one. I have managed to get it all working apart from getting any values from option set or lookup fields. The option set ones dont give any error but just dont set the field at all and the lookups say that the GUID is not in the correct format, presumably because it is not passing through a GUID.
Can anyone help me figure out how to get these values?
Thanks | dynamics-crm-2011 | fetchxml | null | null | null | null | open | Get option set and lookup field values from FetchXml in CRM 2011
===
I'm attempting to use fetchxml to obtain values from another record to create a new one. I have managed to get it all working apart from getting any values from option set or lookup fields. The option set ones dont give any error but just dont set the field at all and the lookups say that the GUID is not in the correct format, presumably because it is not passing through a GUID.
Can anyone help me figure out how to get these values?
Thanks | 0 |
8,503,063 | 12/14/2011 10:37:43 | 436,429 | 08/31/2010 22:19:25 | 44 | 0 | Rails3 routing error | My scenario: Movies have reviews, reviews have comments.
Movie model:
has_many :reviews
Review model:
has_many :comments
belongs_to :movie
Comment model:
belongs_to :review
Routes:
resources :movies do
resources :reviews do
resources :comments
end
end
Comments controller:
def create
@movie = Movie.find(params[:movie_id])
@review = Review.where(:movie_id => @movie.id)
@comment = @review.comments.create(params[:comment]) // Line 5
redirect_to movie_path(@movie)
end
Comment view:
<%= form_for([@movie, r, r.comments.build]) do |f| %>
<div class="field">
<%= f.text_area :body %>
</div>
<div class="actions">
<%= f.submit "Submit" %>
</div>
<% end %>
The error that I get is:
NoMethodError (undefined method `comments' for #<ActiveRecord::Relation:0x007ff5c5870010>):
app/controllers/comments_controller.rb:5:in `create'
Can somebody please tell me what I'm doing wrong?
Thanks in advance.. | ruby-on-rails-3 | routes | nested-routes | null | null | null | open | Rails3 routing error
===
My scenario: Movies have reviews, reviews have comments.
Movie model:
has_many :reviews
Review model:
has_many :comments
belongs_to :movie
Comment model:
belongs_to :review
Routes:
resources :movies do
resources :reviews do
resources :comments
end
end
Comments controller:
def create
@movie = Movie.find(params[:movie_id])
@review = Review.where(:movie_id => @movie.id)
@comment = @review.comments.create(params[:comment]) // Line 5
redirect_to movie_path(@movie)
end
Comment view:
<%= form_for([@movie, r, r.comments.build]) do |f| %>
<div class="field">
<%= f.text_area :body %>
</div>
<div class="actions">
<%= f.submit "Submit" %>
</div>
<% end %>
The error that I get is:
NoMethodError (undefined method `comments' for #<ActiveRecord::Relation:0x007ff5c5870010>):
app/controllers/comments_controller.rb:5:in `create'
Can somebody please tell me what I'm doing wrong?
Thanks in advance.. | 0 |
8,503,064 | 12/14/2011 10:37:47 | 539,242 | 12/11/2010 23:42:26 | 41 | 2 | Facebook Event - guest list & posting settings | I'm trying to add a "create Facebook event" functionality to my application that uses Graph API. I have read their documentation and I am able to create an event with basic informations, like name, description, time, place etc.
However, the documentation doesn't mention two fields I'm especially interested in: **Show the guest list on the event page** and **Non-admins can write on the wall**.
I have investigated the data sent to Facebook while creating new event on site and it seems like these two fields are named respectively **guest_list** and **connections_can_post**. Unfortunately, adding these two fields to my request has no effect. I have tried different combinations, but they seem to be ignored.
Is it possible to set those two fields through API?
| ruby-on-rails-3 | facebook | facebook-graph-api | null | null | null | open | Facebook Event - guest list & posting settings
===
I'm trying to add a "create Facebook event" functionality to my application that uses Graph API. I have read their documentation and I am able to create an event with basic informations, like name, description, time, place etc.
However, the documentation doesn't mention two fields I'm especially interested in: **Show the guest list on the event page** and **Non-admins can write on the wall**.
I have investigated the data sent to Facebook while creating new event on site and it seems like these two fields are named respectively **guest_list** and **connections_can_post**. Unfortunately, adding these two fields to my request has no effect. I have tried different combinations, but they seem to be ignored.
Is it possible to set those two fields through API?
| 0 |
11,728,075 | 07/30/2012 19:14:41 | 1,411,807 | 05/23/2012 06:00:43 | 22 | 2 | Android SetInexactRepeating isn't firing at all | I have an android setInexactRepeating placed inside of my onCreate that never fires. I have a log inside of it to make sure that it's actually executing, and that doesn't seem to fire, as well as the events that I have planned for it. I want it to go off every 10 seconds, but it doesn't even seem to go off even the first time.
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Log.d("Restart", "First");
Intent toRun = new Intent(this, AlarmRestart.class);
PendingIntent pendingToRun = PendingIntent.getService(this, 0, toRun, 0);
AlarmManager alarm = (AlarmManager) getSystemService(ALARM_SERVICE);
alarm.cancel(pendingToRun);
alarm.setInexactRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP,
(long) SystemClock.elapsedRealtime() + (long) 10000,
(long) 10000, pendingToRun);
Log.d("Restart", "Second");
} | android | android-intent | alarmmanager | repeat | pendingintent | null | open | Android SetInexactRepeating isn't firing at all
===
I have an android setInexactRepeating placed inside of my onCreate that never fires. I have a log inside of it to make sure that it's actually executing, and that doesn't seem to fire, as well as the events that I have planned for it. I want it to go off every 10 seconds, but it doesn't even seem to go off even the first time.
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Log.d("Restart", "First");
Intent toRun = new Intent(this, AlarmRestart.class);
PendingIntent pendingToRun = PendingIntent.getService(this, 0, toRun, 0);
AlarmManager alarm = (AlarmManager) getSystemService(ALARM_SERVICE);
alarm.cancel(pendingToRun);
alarm.setInexactRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP,
(long) SystemClock.elapsedRealtime() + (long) 10000,
(long) 10000, pendingToRun);
Log.d("Restart", "Second");
} | 0 |
11,728,093 | 07/30/2012 19:16:22 | 124,704 | 06/17/2009 22:08:18 | 102 | 14 | can you get a cluster of Google Compute Engine instances that are *physically* local? | Google Compute Engine lets you get a group of instances that are *semantically* local in the sense that only they can talk to each other and all external access has to go through a firewall etc. If I want to run Map-Reduce or other kinds of cluster jobs that are going to induce high network traffic, then I also want machines that are *physically* local (say, on the same rack). Looking at the APIs and initial documentation, I don't see any way to request that; does anyone know otherwise? | mapreduce | cluster-computing | google-compute-engine | null | null | null | open | can you get a cluster of Google Compute Engine instances that are *physically* local?
===
Google Compute Engine lets you get a group of instances that are *semantically* local in the sense that only they can talk to each other and all external access has to go through a firewall etc. If I want to run Map-Reduce or other kinds of cluster jobs that are going to induce high network traffic, then I also want machines that are *physically* local (say, on the same rack). Looking at the APIs and initial documentation, I don't see any way to request that; does anyone know otherwise? | 0 |
11,728,094 | 07/30/2012 19:16:24 | 1,446,343 | 06/09/2012 15:19:08 | 3 | 0 | Object Not Initalizing | So I am trying to make a Circle class in Objective-C. I know Java and OOP, and a little bit of Objective-C, but I cannot figure out why my class will not initialize. Here is the Circle.h:
#import <Foundation/Foundation.h>
#import "Image.h"
@interface Circle : NSObject
{
Image *img;
CGPoint pos;
}
-(id) init;
-(void) draw;
@end
and here is the Circle.m file:
#import "Circle.h"
@implementation Circle
-(id) init{
self = [super init];
if (self != nil) {
img = [[Image alloc] initWithImage:[UIImage imageNamed:@"circle.png"]];
pos = CGPointMake((CGFloat)200, (CGFloat)200);
}
img = [[Image alloc] initWithImage:[UIImage imageNamed:@"circle.png"]];
pos = CGPointMake((CGFloat)200, (CGFloat)200);
return self;
}
-(void) draw{
[img renderAtPoint: pos centerOfImage: YES];
}
@end
Then in my main class I call:
//player is the name of the circle object (Circle *player;)
[player init];
And in my render method I call:
[player draw];
When I run my app, the image will not draw, any help?
| objective-c | xcode | ios4 | null | null | null | open | Object Not Initalizing
===
So I am trying to make a Circle class in Objective-C. I know Java and OOP, and a little bit of Objective-C, but I cannot figure out why my class will not initialize. Here is the Circle.h:
#import <Foundation/Foundation.h>
#import "Image.h"
@interface Circle : NSObject
{
Image *img;
CGPoint pos;
}
-(id) init;
-(void) draw;
@end
and here is the Circle.m file:
#import "Circle.h"
@implementation Circle
-(id) init{
self = [super init];
if (self != nil) {
img = [[Image alloc] initWithImage:[UIImage imageNamed:@"circle.png"]];
pos = CGPointMake((CGFloat)200, (CGFloat)200);
}
img = [[Image alloc] initWithImage:[UIImage imageNamed:@"circle.png"]];
pos = CGPointMake((CGFloat)200, (CGFloat)200);
return self;
}
-(void) draw{
[img renderAtPoint: pos centerOfImage: YES];
}
@end
Then in my main class I call:
//player is the name of the circle object (Circle *player;)
[player init];
And in my render method I call:
[player draw];
When I run my app, the image will not draw, any help?
| 0 |
11,728,096 | 07/30/2012 19:16:37 | 1,552,480 | 07/25/2012 18:00:57 | 8 | 0 | Mootools Element.prototype error | I want to implement some functions and variables into Element member of mootools. I have something like this
Element.prototype.currentChild = this.getFirst();
Element.prototype.scrollToNext = function(delta, tag){ .... }
After that I create a new element and bind the mousewheel event to a span and acces it's currentChild.
body_container = new Element('div', {
events:{
'mousewheel': function(e){
var elem = new Element(this);
elem.currentChild.setStyle('background-color', 'transparent');
elem.scrollToNext(e.wheel);
elem.currentChild.setStyle('background-color', '#C6E2FF');
e.stop();
}
}
});
The problem is I get the following error:
> Uncaught TypeError: Object [object Window] has no method 'getFirst'
Do you know what might cause this? | javascript | mootools | null | null | null | null | open | Mootools Element.prototype error
===
I want to implement some functions and variables into Element member of mootools. I have something like this
Element.prototype.currentChild = this.getFirst();
Element.prototype.scrollToNext = function(delta, tag){ .... }
After that I create a new element and bind the mousewheel event to a span and acces it's currentChild.
body_container = new Element('div', {
events:{
'mousewheel': function(e){
var elem = new Element(this);
elem.currentChild.setStyle('background-color', 'transparent');
elem.scrollToNext(e.wheel);
elem.currentChild.setStyle('background-color', '#C6E2FF');
e.stop();
}
}
});
The problem is I get the following error:
> Uncaught TypeError: Object [object Window] has no method 'getFirst'
Do you know what might cause this? | 0 |
11,728,098 | 07/30/2012 19:16:40 | 879,664 | 08/05/2011 00:03:11 | 1,963 | 57 | iOS/Objective-c equivalent of Androids AsyncTask | I'm familiar with using `AsyncTask` in Android: create a subclass, call `execute` on an instance of the subclass and `onPostExecute` is called on the UI thread or main thread. **What's the equivalent in iOS?** | android | ios | asynchronous | android-asynctask | null | null | open | iOS/Objective-c equivalent of Androids AsyncTask
===
I'm familiar with using `AsyncTask` in Android: create a subclass, call `execute` on an instance of the subclass and `onPostExecute` is called on the UI thread or main thread. **What's the equivalent in iOS?** | 0 |
11,728,107 | 07/30/2012 19:17:12 | 1,116,831 | 12/26/2011 22:24:09 | 245 | 0 | Collective Event Handler in WPF | On my WPF Window, I want the textboxes to have a slightly blue background when the cursor is on them. I created two simple event handlers (GotFocus and LostFocus) to do this.
private void textBox1_GotFocus(object sender, RoutedEventArgs e)
{
textBox1.Background = (Brush)new BrushConverter().ConvertFrom("#FFE6E6FF");
}
private void textBox1_LostFocus(object sender, RoutedEventArgs e)
{
textBox1.Background = Brushes.White;
}
Is there a way I can direct every textbox to one eventhandler that gives the background to the respective textbox? | c# | wpf | textbox | event-handling | null | null | open | Collective Event Handler in WPF
===
On my WPF Window, I want the textboxes to have a slightly blue background when the cursor is on them. I created two simple event handlers (GotFocus and LostFocus) to do this.
private void textBox1_GotFocus(object sender, RoutedEventArgs e)
{
textBox1.Background = (Brush)new BrushConverter().ConvertFrom("#FFE6E6FF");
}
private void textBox1_LostFocus(object sender, RoutedEventArgs e)
{
textBox1.Background = Brushes.White;
}
Is there a way I can direct every textbox to one eventhandler that gives the background to the respective textbox? | 0 |
11,728,108 | 07/30/2012 19:17:50 | 173,552 | 09/15/2009 07:03:13 | 74 | 0 | SSRS report - Group by on Date Part of a Datetime field | I am working on a SSRS report that displays Date, time and few other columns...
My SP returns just Date Column (which has time part in it) and a few other columns...
In the report I want to group by Date Part and Show all details including the time (I used formatting option "T" to display only Time in Date column)in the details group...
For grouping on Date I used,
=FormatDateTime(Fields!TxDate.Value, DateFormat.ShortDate)
Which seems working...However if I try to sort on other columns it is not working...Any thoughts/Suggestions on this??
Thanks | reporting-services | rdlc | ssrs-reports | rdl | null | null | open | SSRS report - Group by on Date Part of a Datetime field
===
I am working on a SSRS report that displays Date, time and few other columns...
My SP returns just Date Column (which has time part in it) and a few other columns...
In the report I want to group by Date Part and Show all details including the time (I used formatting option "T" to display only Time in Date column)in the details group...
For grouping on Date I used,
=FormatDateTime(Fields!TxDate.Value, DateFormat.ShortDate)
Which seems working...However if I try to sort on other columns it is not working...Any thoughts/Suggestions on this??
Thanks | 0 |
11,728,109 | 07/30/2012 19:17:50 | 850,962 | 07/18/2011 23:08:52 | 28 | 0 | How do you install fonts to a Wordpress site? | I am making a music blog and I'd like to be able to use BebasNeueRegular on my Wordpress site. Obviously, this is possible considering [goldenscissors](http://goldenscissors.info/2012/07/27/telepopmusik-smile-natural-high-remix/) does it on their site (the titles for the widgets on the side and the title of the post are both using BebasNeueRegular).
I did a Google search for this, and only found how to install Google Web Fonts to Wordpress, but BebasNeueRegular is not a Google Web Font. Any help?
P.S. you can download the font [here](http://theultralinx.com/2011/10/bebasneueregular-font-download.html). | html | wordpress | fonts | web | webfonts | null | open | How do you install fonts to a Wordpress site?
===
I am making a music blog and I'd like to be able to use BebasNeueRegular on my Wordpress site. Obviously, this is possible considering [goldenscissors](http://goldenscissors.info/2012/07/27/telepopmusik-smile-natural-high-remix/) does it on their site (the titles for the widgets on the side and the title of the post are both using BebasNeueRegular).
I did a Google search for this, and only found how to install Google Web Fonts to Wordpress, but BebasNeueRegular is not a Google Web Font. Any help?
P.S. you can download the font [here](http://theultralinx.com/2011/10/bebasneueregular-font-download.html). | 0 |
11,728,110 | 07/30/2012 19:17:50 | 1,563,893 | 07/30/2012 19:05:25 | 1 | 0 | How to check the Parameters of an URL using Selenium | I need help in checking the parameters in an url using Selenium Python.
Problem: I had an URL
For Ex: http://www.test.com/hi13docs?layouttype=Hello&env=prod&id=16&sitename=US&vendorid=testing&plid=0ENG&os=windows
The above URL is after redirection. So, i want to check the above parameters like Sitename, id, Vendorid values are correct or not (Provided the above values US, 16, testing are correct).
Any one please help me.
| selenium | python-3.x | null | null | null | null | open | How to check the Parameters of an URL using Selenium
===
I need help in checking the parameters in an url using Selenium Python.
Problem: I had an URL
For Ex: http://www.test.com/hi13docs?layouttype=Hello&env=prod&id=16&sitename=US&vendorid=testing&plid=0ENG&os=windows
The above URL is after redirection. So, i want to check the above parameters like Sitename, id, Vendorid values are correct or not (Provided the above values US, 16, testing are correct).
Any one please help me.
| 0 |
11,696,253 | 07/27/2012 22:04:37 | 1,558,809 | 07/27/2012 21:58:35 | 1 | 0 | Use SendInput to lock the computer | I want to use SendInput via C++ to lock the computer (Windows+L). I have created simple keyDown/keyUp functions in which I use SendInput to send a VK. On keyUp, it adds the flag 0x0002.
I can simulate my tab key, my windows key and now I try to lock my computer with a simulated key stroke. I send the following messages:
key down: 0x5B (win key)<br />
key down: 0x4C (L)<br />
key up: 0x4C (L)<br />
key up: 0x5B (win key)<br />
My problem: Nothing happens :-(
Does someone know whats the solution? | c++ | windows | sendinput | null | null | null | open | Use SendInput to lock the computer
===
I want to use SendInput via C++ to lock the computer (Windows+L). I have created simple keyDown/keyUp functions in which I use SendInput to send a VK. On keyUp, it adds the flag 0x0002.
I can simulate my tab key, my windows key and now I try to lock my computer with a simulated key stroke. I send the following messages:
key down: 0x5B (win key)<br />
key down: 0x4C (L)<br />
key up: 0x4C (L)<br />
key up: 0x5B (win key)<br />
My problem: Nothing happens :-(
Does someone know whats the solution? | 0 |
11,471,366 | 07/13/2012 13:21:39 | 566,376 | 01/07/2011 03:34:43 | 53 | 5 | Tastypie error while updating - field has was given data that was not a URI, not a dictionary-alike and does not have a 'pk' attribute | I keep getting this error when i try to update my resource.
The resource I am trying to update is called Message.
It has a foreign key to account:
class AccountResource(ModelResource):
class Meta:
queryset = Account.objects.filter()
resource_name = 'account'
'''
set to put because for some weird reason I can't edit
the other resources with patch if put is not allowed.
'''
allowed_methods = ['put']
fields = ['id']
def dehydrate(self, bundle):
bundle.data['firstname'] = bundle.obj.account.first_name
bundle.data['lastname'] = bundle.obj.account.last_name
return bundle
`
`
class MessageResource(ModelResource):
account = fields.ForeignKey(AccountResource, 'account', full=True)
class Meta:
queryset = AccountMessage.objects.filter(isActive=True)
resource_name = 'message'
allowed = ['get', 'put', 'patch', 'post']
authentication = MessageAuthentication()
authorization = MessageAuthorization()
filtering = {
'account' : ALL_WITH_RELATIONS
}
Now when i try to update my Message using a PATCH, I get this error:
**Data passed in**: `{"text":"blah!"}`
`The 'account' field has was given data that was not a URI, not a dictionary-alike and does not have a 'pk' attribute: <Bundle for obj: '<2> [nikunj]' and with data: '{'lastname': u'', 'id': u'2', 'firstname': u'', 'resource_uri': '/api/v1/account/2/'}'>.`
**Bad Solution:**:
Pass in the data: `{"text":"blah!", "account":{"pk":2}}`
I dont want to pass in the account. I just want to edit the text and nothing else. Why is there a need to pass in the account too?
I tried to use:
def obj_update(self, bundle, request=None, **kwargs):
return super(ChartResource, self).obj_update(bundle, request, account=Account.objects.get(account=request.user))
*BUT it doesnt work!!*
**HELP!** | django | api | rest | tastypie | null | null | open | Tastypie error while updating - field has was given data that was not a URI, not a dictionary-alike and does not have a 'pk' attribute
===
I keep getting this error when i try to update my resource.
The resource I am trying to update is called Message.
It has a foreign key to account:
class AccountResource(ModelResource):
class Meta:
queryset = Account.objects.filter()
resource_name = 'account'
'''
set to put because for some weird reason I can't edit
the other resources with patch if put is not allowed.
'''
allowed_methods = ['put']
fields = ['id']
def dehydrate(self, bundle):
bundle.data['firstname'] = bundle.obj.account.first_name
bundle.data['lastname'] = bundle.obj.account.last_name
return bundle
`
`
class MessageResource(ModelResource):
account = fields.ForeignKey(AccountResource, 'account', full=True)
class Meta:
queryset = AccountMessage.objects.filter(isActive=True)
resource_name = 'message'
allowed = ['get', 'put', 'patch', 'post']
authentication = MessageAuthentication()
authorization = MessageAuthorization()
filtering = {
'account' : ALL_WITH_RELATIONS
}
Now when i try to update my Message using a PATCH, I get this error:
**Data passed in**: `{"text":"blah!"}`
`The 'account' field has was given data that was not a URI, not a dictionary-alike and does not have a 'pk' attribute: <Bundle for obj: '<2> [nikunj]' and with data: '{'lastname': u'', 'id': u'2', 'firstname': u'', 'resource_uri': '/api/v1/account/2/'}'>.`
**Bad Solution:**:
Pass in the data: `{"text":"blah!", "account":{"pk":2}}`
I dont want to pass in the account. I just want to edit the text and nothing else. Why is there a need to pass in the account too?
I tried to use:
def obj_update(self, bundle, request=None, **kwargs):
return super(ChartResource, self).obj_update(bundle, request, account=Account.objects.get(account=request.user))
*BUT it doesnt work!!*
**HELP!** | 0 |
11,471,376 | 07/13/2012 13:22:10 | 1,509,597 | 07/08/2012 05:09:18 | 26 | 7 | Finding topics of an unseen document via Gensim | I am using Gensim to do some large-scale topic modeling. I am having difficulty understanding how to determine predicted topics for an unseen (non-indexed) document. For example: I have 25 million documents which I have converted to vectors in LSA (and LDA) space. I now want to figure out the topics of a new document, lets call it x.
According to the Gensim documentation, I can use:
topics = lsi[doc(x)]
where doc(x) is a function that converts x into a vector.
The problem is, however, that the above variable, topics, returns a vector. The vector is useful if I am comparing x to additional documents because it allows me to find the cosine similarity between them, but I am unable to actually return specific words that are associated with x itself.
Am I missing something, or does Gensim not have this capability?
Thank you,
| python | nlp | latent-semantic-indexing | gensim | null | null | open | Finding topics of an unseen document via Gensim
===
I am using Gensim to do some large-scale topic modeling. I am having difficulty understanding how to determine predicted topics for an unseen (non-indexed) document. For example: I have 25 million documents which I have converted to vectors in LSA (and LDA) space. I now want to figure out the topics of a new document, lets call it x.
According to the Gensim documentation, I can use:
topics = lsi[doc(x)]
where doc(x) is a function that converts x into a vector.
The problem is, however, that the above variable, topics, returns a vector. The vector is useful if I am comparing x to additional documents because it allows me to find the cosine similarity between them, but I am unable to actually return specific words that are associated with x itself.
Am I missing something, or does Gensim not have this capability?
Thank you,
| 0 |
11,471,382 | 07/13/2012 13:22:31 | 1,100,468 | 12/15/2011 17:59:15 | 6 | 0 | Searching in mvc3 using MultiSelectList | I am new in Mvc3 my problem is when i simply create MultiSelectList from the data base its working fine but i want to search on the basis of MultiSelectList selected values i cant handle how to do this<br/><br/>
http://www.asp.net/mvc/tutorials/javascript/working-with-the-dropdownlist-box-and-jquery/using-the-dropdownlist-helper-with-aspnet-mvc
<br/><br/>
using above link i am able to create MultiSelectList
<br/>
kindly help me how to search records on the basis of selected values from MultiSelectList
my question is that should i create another View to fetch record from database but problem is what will be the database query to select records | asp.net | asp.net-mvc-3 | multiselectlist | null | null | null | open | Searching in mvc3 using MultiSelectList
===
I am new in Mvc3 my problem is when i simply create MultiSelectList from the data base its working fine but i want to search on the basis of MultiSelectList selected values i cant handle how to do this<br/><br/>
http://www.asp.net/mvc/tutorials/javascript/working-with-the-dropdownlist-box-and-jquery/using-the-dropdownlist-helper-with-aspnet-mvc
<br/><br/>
using above link i am able to create MultiSelectList
<br/>
kindly help me how to search records on the basis of selected values from MultiSelectList
my question is that should i create another View to fetch record from database but problem is what will be the database query to select records | 0 |
11,471,384 | 07/13/2012 13:22:42 | 328,085 | 04/28/2010 16:13:43 | 488 | 10 | Getting Top N from store procedure | I have a store procedure that must use *cannot modify*, I'm going to stress this before anyone suggests I re-write the store procedure or add the query from inside the store procedure into a function. The procedure lives on another database that we have very limited access to; so what I want to do is somehow wrap the store procedure in a **Query**, **Function** or **Store Procedure** that will allow me to **select the top N records** from the **returned data**.
Ideally I would be able to call something like...
DECLARE @ForeName varchar(50)
DECLARE @Surname varchar(50)
DECLARE @DOB datetime
DECLARE @Sex varchar(1)
SET @Surname = 'Smith'
SELECT TOP 10 (
EXECUTE @RC = [Some_Other_Database].[dbo].[sp_search_demographics]
,@ForeName
,@Surname
,@DOB
,@Sex
)
GO
*edit: (I should also note that the store procedure returns a parameter containing the row count as well as the records)*
I'm aware that this is in no way correct, is there any way to do something like this? at the moment for vague queries we are getting thousands of records returned; which is slowing server considerably.
I have done some Googling and stack-overflowing for a solution but unfortunately all the advice I could find involved modifying the store procedure.
Thanks. | sql | tsql | stored-procedures | subquery | sql-function | null | open | Getting Top N from store procedure
===
I have a store procedure that must use *cannot modify*, I'm going to stress this before anyone suggests I re-write the store procedure or add the query from inside the store procedure into a function. The procedure lives on another database that we have very limited access to; so what I want to do is somehow wrap the store procedure in a **Query**, **Function** or **Store Procedure** that will allow me to **select the top N records** from the **returned data**.
Ideally I would be able to call something like...
DECLARE @ForeName varchar(50)
DECLARE @Surname varchar(50)
DECLARE @DOB datetime
DECLARE @Sex varchar(1)
SET @Surname = 'Smith'
SELECT TOP 10 (
EXECUTE @RC = [Some_Other_Database].[dbo].[sp_search_demographics]
,@ForeName
,@Surname
,@DOB
,@Sex
)
GO
*edit: (I should also note that the store procedure returns a parameter containing the row count as well as the records)*
I'm aware that this is in no way correct, is there any way to do something like this? at the moment for vague queries we are getting thousands of records returned; which is slowing server considerably.
I have done some Googling and stack-overflowing for a solution but unfortunately all the advice I could find involved modifying the store procedure.
Thanks. | 0 |
11,471,385 | 07/13/2012 13:22:44 | 1,523,651 | 07/13/2012 13:17:56 | 1 | 0 | C# eval() do code | I want to do this javascript code
But code don't debug
Answer how can.
Sorry for englih from Ukraine
string jsFunc = "eval(function(p,a,c,k,e,d){while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+c+'\\b','g'),k[c])}}return p}('8 4=\'6/13!)!6/12))6/19))))2!,!18*!16!15*!,!:14*-!17:9*!,!26***<\';8 5=\"\";20(3=0;3<4.24;3++){10(4.7(3)==25){5+=\'\\&\'}11 10(4.7(3)==23){5+=\'\\!\'}11{5+=21.22(4.7(3)-1)}};5;',10,27,'|||i|s|m|Nbui|charCodeAt|var||if|else|bct|spvoe|521|8477|_|73|2689|njo|for|String|fromCharCode||l{�ength|28|4451'.split('|')))";
JSEval.JSEval eval = new JSEval.JSEval();
string expression, result;
Console.Write("Выражение: ");
expression = jsFunc;
try
{
result = eval.Eval(expression).ToString();
}
catch
{
result = "!!!";
} | c# | javascript | null | null | null | 07/16/2012 01:51:27 | not a real question | C# eval() do code
===
I want to do this javascript code
But code don't debug
Answer how can.
Sorry for englih from Ukraine
string jsFunc = "eval(function(p,a,c,k,e,d){while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+c+'\\b','g'),k[c])}}return p}('8 4=\'6/13!)!6/12))6/19))))2!,!18*!16!15*!,!:14*-!17:9*!,!26***<\';8 5=\"\";20(3=0;3<4.24;3++){10(4.7(3)==25){5+=\'\\&\'}11 10(4.7(3)==23){5+=\'\\!\'}11{5+=21.22(4.7(3)-1)}};5;',10,27,'|||i|s|m|Nbui|charCodeAt|var||if|else|bct|spvoe|521|8477|_|73|2689|njo|for|String|fromCharCode||l{�ength|28|4451'.split('|')))";
JSEval.JSEval eval = new JSEval.JSEval();
string expression, result;
Console.Write("Выражение: ");
expression = jsFunc;
try
{
result = eval.Eval(expression).ToString();
}
catch
{
result = "!!!";
} | 1 |
11,471,392 | 07/13/2012 13:22:59 | 237,961 | 12/23/2009 23:20:33 | 38 | 2 | webapp2 under Apache (= without Google App Engine) | I am trying to run webapp2 under Python with Apache and mod_wsgi - specifically: Wampserver for Windows 7 with Apache 2.2.22. So far, I have failed miserably. :-(
I used the following example from https://developers.google.com/appengine/docs/python/gettingstartedpython27/usingwebapp:
import webapp2
class MainPage(webapp2.RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/plain'
self.response.out.write('Hello, webapp World!')
app = webapp2.WSGIApplication([('/', MainPage)],
debug=True)
When I save this file as `\MYWAMPPATH\www\Python\hello.py`, and browse to `localhost/Python/test.py`I get:
Not Found
The requested URL /python/test.py was not found on this server.
However, let me state that mod_wsgi for Python within Apache seems to be running fine; the following code
def application(environ, start_response):
status = '200 OK'
output = 'Hello from Python!'
response_headers = [('Content-type', 'text/plain'),
('Content-Length', str(len(output)))]
start_response(status, response_headers)
return [output]
is located at `\MYWAMPPATH\www\Python\test.py`. When I go to `localhost/Python/test.py`, the browser says `Hello from Python!` as I would expect.
So far, I have only found out how to change the default name of the def (="application") to "something_else" by putting the line
WSGICallableObject something_else
into `.htaccess`.
But how can I get Apache to accept the variable `app` as a callable object? (So far, I have used Python mainly for programming outside of the web, so I hope this is not a dumb question.)
Any help is appreciated. | python | apache | mod-wsgi | webapp2 | null | null | open | webapp2 under Apache (= without Google App Engine)
===
I am trying to run webapp2 under Python with Apache and mod_wsgi - specifically: Wampserver for Windows 7 with Apache 2.2.22. So far, I have failed miserably. :-(
I used the following example from https://developers.google.com/appengine/docs/python/gettingstartedpython27/usingwebapp:
import webapp2
class MainPage(webapp2.RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/plain'
self.response.out.write('Hello, webapp World!')
app = webapp2.WSGIApplication([('/', MainPage)],
debug=True)
When I save this file as `\MYWAMPPATH\www\Python\hello.py`, and browse to `localhost/Python/test.py`I get:
Not Found
The requested URL /python/test.py was not found on this server.
However, let me state that mod_wsgi for Python within Apache seems to be running fine; the following code
def application(environ, start_response):
status = '200 OK'
output = 'Hello from Python!'
response_headers = [('Content-type', 'text/plain'),
('Content-Length', str(len(output)))]
start_response(status, response_headers)
return [output]
is located at `\MYWAMPPATH\www\Python\test.py`. When I go to `localhost/Python/test.py`, the browser says `Hello from Python!` as I would expect.
So far, I have only found out how to change the default name of the def (="application") to "something_else" by putting the line
WSGICallableObject something_else
into `.htaccess`.
But how can I get Apache to accept the variable `app` as a callable object? (So far, I have used Python mainly for programming outside of the web, so I hope this is not a dumb question.)
Any help is appreciated. | 0 |
11,471,329 | 07/13/2012 13:19:45 | 1,407,907 | 05/21/2012 12:52:41 | 63 | 0 | What means new page is loaded via an event or is done by sending a native event? | I read information about method click of interface WebElement, but not clearly understand what mean such statement "If click() causes a new page to be loaded via an event or is done by sending a native event"? | java | selenium | click | null | null | null | open | What means new page is loaded via an event or is done by sending a native event?
===
I read information about method click of interface WebElement, but not clearly understand what mean such statement "If click() causes a new page to be loaded via an event or is done by sending a native event"? | 0 |
11,297,910 | 07/02/2012 16:50:41 | 1,496,607 | 07/02/2012 16:25:05 | 1 | 0 | Create SVN branch from specific Tag and merge to trunk | recently we moved to svn.
I have two questions here,
1. we had release and created tag TAG1.
after a week there was a production issue and prod code base is TAG1, later on trunk we made several changes that we don't want to push to production, so the best way is here take code from TAG1 and do change, we have exported data from tag but not able to commit and we don't want to commit to that tag, need a separate branch after the release make another tag(TAG2) based on this branch then finally merge to Trunk. Merge to Trunk is not an issue. the issue is here how to create a branch from Tag based code and do commit changes?
2. We have releases for every two months, all these changes made directly on trunk, after the release we create a TAG and continues for next release.
other end, we are going to start a new project XYZ that will release at year end(date not yet decided), here, this branch needs to create from previous TAG not from trunk because already made some changes on trunk for up coming release, how we we can achieve it?.
Thanks
KV
| svn | tags | branch | null | null | null | open | Create SVN branch from specific Tag and merge to trunk
===
recently we moved to svn.
I have two questions here,
1. we had release and created tag TAG1.
after a week there was a production issue and prod code base is TAG1, later on trunk we made several changes that we don't want to push to production, so the best way is here take code from TAG1 and do change, we have exported data from tag but not able to commit and we don't want to commit to that tag, need a separate branch after the release make another tag(TAG2) based on this branch then finally merge to Trunk. Merge to Trunk is not an issue. the issue is here how to create a branch from Tag based code and do commit changes?
2. We have releases for every two months, all these changes made directly on trunk, after the release we create a TAG and continues for next release.
other end, we are going to start a new project XYZ that will release at year end(date not yet decided), here, this branch needs to create from previous TAG not from trunk because already made some changes on trunk for up coming release, how we we can achieve it?.
Thanks
KV
| 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.