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,298,149 | 07/02/2012 17:12:04 | 1,259,411 | 03/09/2012 13:38:58 | 40 | 0 | what's this syntax? | I would like to create DB.
I have a script file .sql like this :
CREATE TABLE [AlleleFreqBySsPop]
(
[subsnp_id] [int] NOT NULL ,
[pop_id] [int] NOT NULL ,
[allele_id] [int] NOT NULL ,
[source] [varchar](2) NOT NULL ,
[cnt] [real] NULL ,
[freq] [real] NULL ,
[last_updated_time] [datetime] NOT NULL
)
GO
It seems to be different from mysql or postgresql.
What type of languige is this? How can I use it?
| mysql | sql | null | null | null | null | open | what's this syntax?
===
I would like to create DB.
I have a script file .sql like this :
CREATE TABLE [AlleleFreqBySsPop]
(
[subsnp_id] [int] NOT NULL ,
[pop_id] [int] NOT NULL ,
[allele_id] [int] NOT NULL ,
[source] [varchar](2) NOT NULL ,
[cnt] [real] NULL ,
[freq] [real] NULL ,
[last_updated_time] [datetime] NOT NULL
)
GO
It seems to be different from mysql or postgresql.
What type of languige is this? How can I use it?
| 0 |
11,298,150 | 07/02/2012 17:12:05 | 781,521 | 06/02/2011 16:47:55 | 29 | 0 | unable to receive push message for production apns | I can receive push message using development cert, however when I change to use the production cert, no message can be received, and there is no error occurred.
The apns address I used is: ssl://gateway.push.apple.com:2195
And I test it as ad-hoc deployment
As my app is not yet uploaded to app store, so may I know if this will affect the app to receive push message?
Thanks~ | ios | notifications | push | apns | null | null | open | unable to receive push message for production apns
===
I can receive push message using development cert, however when I change to use the production cert, no message can be received, and there is no error occurred.
The apns address I used is: ssl://gateway.push.apple.com:2195
And I test it as ad-hoc deployment
As my app is not yet uploaded to app store, so may I know if this will affect the app to receive push message?
Thanks~ | 0 |
11,298,155 | 07/02/2012 17:12:34 | 1,496,596 | 07/02/2012 16:19:53 | 1 | 0 | jQuery Mobile + GWT error on loading page | I am working on a small GWT jQuery Mobile project and have problems with starting dynamically created JQM page. Here's an example of what I mean.
my index.html has a start-screen page
<div data-role="page" class="type-interior" id="start-screen">
<div id="start-content" data-role="content" style="padding: 10px;"></div>
<div id="start-footer" data-role="footer" data-position="fixed" data-tap-toggle="false" style="height: 40px"></div>
</div>
I am creating "start-screen" contents dynamically.
function initStartScreen() {
buildStartScreen();
$("#start-screen").live('pageshow', function(event, ui){
//stuffs
});
$.mobile.changePage($("#start-screen"), { transition: "pop", reverse: false} );
}
//a function called from buildStartScreen()
function buildQuestionnaireSelector() {
var contentId = START_SCREEN_ID_PREFIX + CONTENT_ID;
var qnnaireSelectContainerId = START_SCREEN_ID_PREFIX + QNNAIRE_SELECT_CONTAINER_ID;
$('#' + contentId).append('<div id=' + qnnaireSelectContainerId + ' data-role="fieldcontain" style="margin: 10px;"></div>');
//add content to qnnaireSelectContainerId
$('#' + qnnaireSelectContainerId).trigger('create');
}
Now the problem is when i call the page under GWT development mode
> localhost:80/myproject/index.html?gwt.codesvr=127.0.0.1:9997
. It shows me a "onModuleLoad() threw an exception" message on firefox.
Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError): e[0] is undefined at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:248) at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136) at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561) at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:289) at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107) 9 more
If i call the same page with
> localhost:80/myproject/index.html?gwt.codesvr=127.0.0.1:9997#start-screen
, it loads up correctly.
Now I have been looking up on this problem for sometime and realized that it has something to do with .trigger('create') call. Since I tried removing the line which loaded up the start page correctly for the first time but on refresh or returning from another page, jQM CSS would not load up correctly.
I hope I have made my problem clear and thanks for every help pointing out the mistake I am doing here.
| css | mobile | triggers | loading | null | null | open | jQuery Mobile + GWT error on loading page
===
I am working on a small GWT jQuery Mobile project and have problems with starting dynamically created JQM page. Here's an example of what I mean.
my index.html has a start-screen page
<div data-role="page" class="type-interior" id="start-screen">
<div id="start-content" data-role="content" style="padding: 10px;"></div>
<div id="start-footer" data-role="footer" data-position="fixed" data-tap-toggle="false" style="height: 40px"></div>
</div>
I am creating "start-screen" contents dynamically.
function initStartScreen() {
buildStartScreen();
$("#start-screen").live('pageshow', function(event, ui){
//stuffs
});
$.mobile.changePage($("#start-screen"), { transition: "pop", reverse: false} );
}
//a function called from buildStartScreen()
function buildQuestionnaireSelector() {
var contentId = START_SCREEN_ID_PREFIX + CONTENT_ID;
var qnnaireSelectContainerId = START_SCREEN_ID_PREFIX + QNNAIRE_SELECT_CONTAINER_ID;
$('#' + contentId).append('<div id=' + qnnaireSelectContainerId + ' data-role="fieldcontain" style="margin: 10px;"></div>');
//add content to qnnaireSelectContainerId
$('#' + qnnaireSelectContainerId).trigger('create');
}
Now the problem is when i call the page under GWT development mode
> localhost:80/myproject/index.html?gwt.codesvr=127.0.0.1:9997
. It shows me a "onModuleLoad() threw an exception" message on firefox.
Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError): e[0] is undefined at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:248) at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136) at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561) at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:289) at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107) 9 more
If i call the same page with
> localhost:80/myproject/index.html?gwt.codesvr=127.0.0.1:9997#start-screen
, it loads up correctly.
Now I have been looking up on this problem for sometime and realized that it has something to do with .trigger('create') call. Since I tried removing the line which loaded up the start page correctly for the first time but on refresh or returning from another page, jQM CSS would not load up correctly.
I hope I have made my problem clear and thanks for every help pointing out the mistake I am doing here.
| 0 |
11,410,269 | 07/10/2012 09:23:06 | 67,015 | 02/16/2009 15:58:55 | 894 | 18 | Overwrite attribute 'value' with own attribute for a custom component | In my current project we have the requirement in writing code in the clients native language. For plain Java we can sometimes argument that in certain cases we have to use english syntax, e.g Bean-Convention for Reflection, but when it comes to the tag-libraries we have to have attributes in the clients native language.
Since for most of my custom components (NOT composite-components) I already have the attribute 'value' which does a lot of boilerplate-code it would be nice to just overwrite the tag-attribute with another name, but internally use all the provided functionality.
Is this somehow possible?
The other reason for this is, that I am struggling a lot in getting ValueExpressions to work properly for my replacement-attribute. | jsf-2.0 | null | null | null | null | null | open | Overwrite attribute 'value' with own attribute for a custom component
===
In my current project we have the requirement in writing code in the clients native language. For plain Java we can sometimes argument that in certain cases we have to use english syntax, e.g Bean-Convention for Reflection, but when it comes to the tag-libraries we have to have attributes in the clients native language.
Since for most of my custom components (NOT composite-components) I already have the attribute 'value' which does a lot of boilerplate-code it would be nice to just overwrite the tag-attribute with another name, but internally use all the provided functionality.
Is this somehow possible?
The other reason for this is, that I am struggling a lot in getting ValueExpressions to work properly for my replacement-attribute. | 0 |
11,410,287 | 07/10/2012 09:24:32 | 1,002,972 | 10/19/2011 10:52:29 | 526 | 12 | How to pass decoded message to next handler? | The first `ChannelHandler` of my pipeline is a class that inherits from `SimpleChannelUpstreamHandler`. I've overrided the `messageReceived()` method that now decodes the incoming message (a SIP request) using JAIN SIP. The next `ChannelHandler` I have is a validator for the SIP request. But, in this handler I want to work with the POJO, not with the `ChannelBuffer`.
How to pass the decoded POJO to the next handler?
Thanks | java | netty | null | null | null | null | open | How to pass decoded message to next handler?
===
The first `ChannelHandler` of my pipeline is a class that inherits from `SimpleChannelUpstreamHandler`. I've overrided the `messageReceived()` method that now decodes the incoming message (a SIP request) using JAIN SIP. The next `ChannelHandler` I have is a validator for the SIP request. But, in this handler I want to work with the POJO, not with the `ChannelBuffer`.
How to pass the decoded POJO to the next handler?
Thanks | 0 |
11,410,289 | 07/10/2012 09:24:38 | 733,566 | 05/01/2011 19:02:16 | 59 | 1 | How to find if the Installatoion was per user or per machine installation | I have installed my software on the system in per machine (ALL USER) installation mode.
During the maintenance Install, I want to know whether the software was Installed per user or per machine? How can I do that?
Is there any installscript function or property which can tell me if previous installation was per user or per machine installation? | installscript | installshield-2011 | null | null | null | null | open | How to find if the Installatoion was per user or per machine installation
===
I have installed my software on the system in per machine (ALL USER) installation mode.
During the maintenance Install, I want to know whether the software was Installed per user or per machine? How can I do that?
Is there any installscript function or property which can tell me if previous installation was per user or per machine installation? | 0 |
11,410,290 | 07/10/2012 09:24:42 | 465,651 | 10/04/2010 09:16:59 | 355 | 10 | Can you create a file in two locations | I have a simple interface, using a database poll that creates a text file based on a simple orchestration.
the file is output to an FTP folder and is picked up by our client. now every so often we have a client that claims a file was not send or data was incomplete in the file, but since they have removed the output file from FTP we have no copy of this file.
i thought about creating two send ports in the orchestration so i can create a file to the FTP and an archive folder. problem with that is that the file name is DELSUP%datetime%.txt, so this will result in my backup file having a slightly different name. is there a way to make a send port create a backup-file? | biztalk | biztalk-2010 | null | null | null | null | open | Can you create a file in two locations
===
I have a simple interface, using a database poll that creates a text file based on a simple orchestration.
the file is output to an FTP folder and is picked up by our client. now every so often we have a client that claims a file was not send or data was incomplete in the file, but since they have removed the output file from FTP we have no copy of this file.
i thought about creating two send ports in the orchestration so i can create a file to the FTP and an archive folder. problem with that is that the file name is DELSUP%datetime%.txt, so this will result in my backup file having a slightly different name. is there a way to make a send port create a backup-file? | 0 |
11,410,292 | 07/10/2012 09:24:48 | 325,016 | 04/24/2010 17:25:09 | 743 | 12 | OpenGl read and write to the same texture | I have a RGBA16F texture with depth, normal.x, normal.y on it. I want to read r, g, b and write to a on the texture. I will hit every pixel exactly once.
Would there be a performance problem if I read and write to the same texture in this case? | c++ | opengl | null | null | null | null | open | OpenGl read and write to the same texture
===
I have a RGBA16F texture with depth, normal.x, normal.y on it. I want to read r, g, b and write to a on the texture. I will hit every pixel exactly once.
Would there be a performance problem if I read and write to the same texture in this case? | 0 |
11,410,293 | 07/10/2012 09:24:49 | 1,514,293 | 07/10/2012 09:13:55 | 1 | 0 | Kill all IE processesthat have been running for more than 5 mins with powershell | not any good at powershell but require the below any help would be appreciated, it will be run using powershell v1.0
I would like to kill all Internet Explorer processes that have been running more than 5 mins. This has to be a command in one line. | powershell | process | internet | explorer | kill | null | open | Kill all IE processesthat have been running for more than 5 mins with powershell
===
not any good at powershell but require the below any help would be appreciated, it will be run using powershell v1.0
I would like to kill all Internet Explorer processes that have been running more than 5 mins. This has to be a command in one line. | 0 |
11,410,294 | 07/10/2012 09:24:59 | 788,030 | 06/07/2011 18:25:22 | 11 | 2 | sampling a parallele program with visual studio profiler | What happens if I profile a parallel program with the visual studio profiler?
As far as I understand: the sampling interrupts the cpu on a regular basis and collects the call stack. Based on this samples the inclusive and exclusive samples for the program functions are computed.
But what happens if multiple processors are working concurrently? Do I get samples for each processor currently working on the program? This would mean that the total number of samples of a parallel program actually can be higher than the number of samples of the sequential version of the program - even though the execution time might be less... is this correct? | visual-studio-2010 | parallel-processing | sampling | null | null | null | open | sampling a parallele program with visual studio profiler
===
What happens if I profile a parallel program with the visual studio profiler?
As far as I understand: the sampling interrupts the cpu on a regular basis and collects the call stack. Based on this samples the inclusive and exclusive samples for the program functions are computed.
But what happens if multiple processors are working concurrently? Do I get samples for each processor currently working on the program? This would mean that the total number of samples of a parallel program actually can be higher than the number of samples of the sequential version of the program - even though the execution time might be less... is this correct? | 0 |
11,410,296 | 07/10/2012 09:25:01 | 1,220,743 | 02/20/2012 10:11:42 | 14 | 2 | Create serial port device file | <p>I need to develop a test program, which sends and recieves data from terminal to the serial port.<br>
In order to do that I want to create virtual device file and work with it. I did that by using command:</p>
>mknod -m 666 ttyS32 c 4, 500
<p>The device file was successfully created, however I can't write data to it. Both programmatical and terminal ways give the following error:</p>
>No such device or address
<p>In C I used standard file I/O functions, and in terminal I used the 'echo' command. Do you have any ideas how to write data to serial port device file?</p>
| c | linux | serial-port | rs485 | null | null | open | Create serial port device file
===
<p>I need to develop a test program, which sends and recieves data from terminal to the serial port.<br>
In order to do that I want to create virtual device file and work with it. I did that by using command:</p>
>mknod -m 666 ttyS32 c 4, 500
<p>The device file was successfully created, however I can't write data to it. Both programmatical and terminal ways give the following error:</p>
>No such device or address
<p>In C I used standard file I/O functions, and in terminal I used the 'echo' command. Do you have any ideas how to write data to serial port device file?</p>
| 0 |
11,386,936 | 07/08/2012 21:38:33 | 1,510,126 | 08/11/2010 14:18:40 | 1 | 0 | Imagick's exportImagePixels returning incorrect values |
I'm using ImageMagick, via PHP to get an PNG's pixel data, but it's returning some iffy values.
Some values are negative, along with the alpha values not all being 0 despite the image not using transparency.
This is the image I used: http://d.woollyh.at/cMVW
And the output of the following code: http://d.woollyh.at/t6dL
$image = new Imagick("img.png");
$values = $image->exportImagePixels(0, 0, 16, 16, "RGBA", Imagick::PIXEL_CHAR);
$pixels = array_chunk($values, 4); // 2D dimensional array, for each pixel
print_r($pixels);
I'm completely confused to why this is happening, any guidance would be appreciated. Sorry if I've made a glaring mistake. Thanks! | php | imagemagick | null | null | null | null | open | Imagick's exportImagePixels returning incorrect values
===
I'm using ImageMagick, via PHP to get an PNG's pixel data, but it's returning some iffy values.
Some values are negative, along with the alpha values not all being 0 despite the image not using transparency.
This is the image I used: http://d.woollyh.at/cMVW
And the output of the following code: http://d.woollyh.at/t6dL
$image = new Imagick("img.png");
$values = $image->exportImagePixels(0, 0, 16, 16, "RGBA", Imagick::PIXEL_CHAR);
$pixels = array_chunk($values, 4); // 2D dimensional array, for each pixel
print_r($pixels);
I'm completely confused to why this is happening, any guidance would be appreciated. Sorry if I've made a glaring mistake. Thanks! | 0 |
11,386,938 | 07/08/2012 21:39:00 | 466,383 | 10/05/2010 02:29:44 | 71 | 15 | Upgrading to SimplePie 1.3, documentation leaves something to be desired, plus busted my news aggregator | I clicked the big download button and uploaded /library and autoloader.php but that was insufficient in switching over to the new codebase. I had previously renamed my old installation, simplepie.old from simplepie.inc but with no simplepie.inc file, my aggregator wouldn't run.
I reread the documentation and switched to using the one file version of the library which I renamed simplepie.inc
This allows my aggregator to run, but my feed of feeds is now blank... My news aggregator was based off of the News Blocks 2 demo.
[Miniature Painting News Aggregator][1]
[1]: http://news.muschamp.ca
My other uses of SimplePie seem to be functioning after the renaming, but I'm unsure what the autoloader.php is supposed to do. The documentation still references simplepie.inc
require_once('../simplepie.inc');
The portion of my news aggregator that is busted is my feed of feeds, I'll have to see what methods I'm calling that either no longer exist or have been renamed. But the upgrade/documentation leaves something to be desired. How am I supposed to use the autoloader.php? Or am I just best using the one file version since that is what all the existing code expects?
| php | simplepie | null | null | null | null | open | Upgrading to SimplePie 1.3, documentation leaves something to be desired, plus busted my news aggregator
===
I clicked the big download button and uploaded /library and autoloader.php but that was insufficient in switching over to the new codebase. I had previously renamed my old installation, simplepie.old from simplepie.inc but with no simplepie.inc file, my aggregator wouldn't run.
I reread the documentation and switched to using the one file version of the library which I renamed simplepie.inc
This allows my aggregator to run, but my feed of feeds is now blank... My news aggregator was based off of the News Blocks 2 demo.
[Miniature Painting News Aggregator][1]
[1]: http://news.muschamp.ca
My other uses of SimplePie seem to be functioning after the renaming, but I'm unsure what the autoloader.php is supposed to do. The documentation still references simplepie.inc
require_once('../simplepie.inc');
The portion of my news aggregator that is busted is my feed of feeds, I'll have to see what methods I'm calling that either no longer exist or have been renamed. But the upgrade/documentation leaves something to be desired. How am I supposed to use the autoloader.php? Or am I just best using the one file version since that is what all the existing code expects?
| 0 |
11,386,933 | 07/08/2012 21:38:19 | 584,360 | 01/21/2011 11:15:51 | 13 | 1 | How to do the Ajax calls for multiple sets of contents? | Any advice on how to do the Ajax calls and stuff to pull in content for a set of components like those boxes on www.jwt.com home page at a time when you scroll down please? I am using jQuery Ajax.
Another related thread that I have posted can be found at:
http://stackoverflow.com/questions/11379208/how-do-they-populate-the-boxes-on-this-website
Thanks | javascript | jquery | ajax | null | null | null | open | How to do the Ajax calls for multiple sets of contents?
===
Any advice on how to do the Ajax calls and stuff to pull in content for a set of components like those boxes on www.jwt.com home page at a time when you scroll down please? I am using jQuery Ajax.
Another related thread that I have posted can be found at:
http://stackoverflow.com/questions/11379208/how-do-they-populate-the-boxes-on-this-website
Thanks | 0 |
11,386,941 | 07/08/2012 21:39:35 | 1,461,577 | 06/17/2012 08:21:34 | 1 | 0 | CakePHP: How can I route user logins to their account? | I need to be be pointed to the right direction. I am writing a simple application where a user can log in and see their task list. I want the app secure. I can only get as far as authenticating a user to access the entire site. Obviously that's not what I want. I want them to access ONLY their own accounts. Is there a good site to read about this? I'm learning v2.x . Thanks | cakephp | authentication | user | user-accounts | null | null | open | CakePHP: How can I route user logins to their account?
===
I need to be be pointed to the right direction. I am writing a simple application where a user can log in and see their task list. I want the app secure. I can only get as far as authenticating a user to access the entire site. Obviously that's not what I want. I want them to access ONLY their own accounts. Is there a good site to read about this? I'm learning v2.x . Thanks | 0 |
11,386,946 | 07/08/2012 21:40:04 | 1,494,506 | 07/01/2012 16:38:48 | 6 | 0 | What's the difference between sizoef and alignof? | What's the difference between sizoef and alignof?
#include <iostream>
#define SIZEOF_ALIGNOF(T) std::cout<< sizeof(T) << '/' << alignof(T) << std::endl
int main(int, char**)
{
SIZEOF_ALIGNOF(unsigned char);
SIZEOF_ALIGNOF(char);
SIZEOF_ALIGNOF(unsigned short int);
SIZEOF_ALIGNOF(short int);
SIZEOF_ALIGNOF(unsigned int);
SIZEOF_ALIGNOF(int);
SIZEOF_ALIGNOF(float);
SIZEOF_ALIGNOF(unsigned long int);
SIZEOF_ALIGNOF(long int);
SIZEOF_ALIGNOF(unsigned long long int);
SIZEOF_ALIGNOF(long long int);
SIZEOF_ALIGNOF(double);
}
will output
1/1
1/1
2/2
2/2
4/4
4/4
4/4
4/4
4/4
8/8
8/8
8/8
I think I don't get what the alignment is...? | c++ | c++11 | sizeof | alignof | null | null | open | What's the difference between sizoef and alignof?
===
What's the difference between sizoef and alignof?
#include <iostream>
#define SIZEOF_ALIGNOF(T) std::cout<< sizeof(T) << '/' << alignof(T) << std::endl
int main(int, char**)
{
SIZEOF_ALIGNOF(unsigned char);
SIZEOF_ALIGNOF(char);
SIZEOF_ALIGNOF(unsigned short int);
SIZEOF_ALIGNOF(short int);
SIZEOF_ALIGNOF(unsigned int);
SIZEOF_ALIGNOF(int);
SIZEOF_ALIGNOF(float);
SIZEOF_ALIGNOF(unsigned long int);
SIZEOF_ALIGNOF(long int);
SIZEOF_ALIGNOF(unsigned long long int);
SIZEOF_ALIGNOF(long long int);
SIZEOF_ALIGNOF(double);
}
will output
1/1
1/1
2/2
2/2
4/4
4/4
4/4
4/4
4/4
8/8
8/8
8/8
I think I don't get what the alignment is...? | 0 |
11,386,948 | 07/08/2012 21:41:11 | 1,104,956 | 12/18/2011 21:49:51 | 1 | 0 | BCE0019: 'position' is not a member of 'Object'. | Thats Unity3D js script error, on pc it work fine, but if I try to switch platform to android...
var RelativeWaypointPosition : Vector3 = transform.InverseTransformPoint( Vector3(
waypoints[currentWaypoint].position.x,
transform.position.y,
waypoints[currentWaypoint].position.z ) );
| javascript | unity3d | null | null | null | null | open | BCE0019: 'position' is not a member of 'Object'.
===
Thats Unity3D js script error, on pc it work fine, but if I try to switch platform to android...
var RelativeWaypointPosition : Vector3 = transform.InverseTransformPoint( Vector3(
waypoints[currentWaypoint].position.x,
transform.position.y,
waypoints[currentWaypoint].position.z ) );
| 0 |
11,386,949 | 07/08/2012 21:41:24 | 844,331 | 07/14/2011 10:25:30 | 363 | 12 | mobile application with membership design | I have made an json api for a database which has some products, and some users who can add and search for these products. So a user have a login/pass, with these credentials I can do POST api calls.
I now want to make an iPhone / android app, and I'm wondering how to handle these post requests : first time I'll ask the user credentials, then I'll be able to do one POST request. But where do I store these credentials ? on the mobile ? should it be persisted then at the next application start, the login will still be there ?
Any helpful link is welcomed. | android | iphone | cocoa | mobile | null | null | open | mobile application with membership design
===
I have made an json api for a database which has some products, and some users who can add and search for these products. So a user have a login/pass, with these credentials I can do POST api calls.
I now want to make an iPhone / android app, and I'm wondering how to handle these post requests : first time I'll ask the user credentials, then I'll be able to do one POST request. But where do I store these credentials ? on the mobile ? should it be persisted then at the next application start, the login will still be there ?
Any helpful link is welcomed. | 0 |
11,386,954 | 07/08/2012 21:42:35 | 310,370 | 04/06/2010 20:22:21 | 1,435 | 8 | How to assign variable to buttons in a loop to use those variables on click - ASP.net | For example at the loop below i want to assign buttons custom variable in order to determine which button clicked on click event with jquery
Here the code :
<% for (int i = 0; i < dsProjeler.Tables[0].Rows.Count; i++)
{
lblProjeName.Text = string.Format("<a target=\"_blank\" href=\""
+ dsProjeler.Tables[0].Rows[i]["link"].ToString() + "\">{0}</a>",
dsProjeler.Tables[0].Rows[i]["baslik"].ToString());
%>
<tr>
<td>
<asp:Literal ID="lblProjeName" runat="server"></asp:Literal>
</td>
<td>
<asp:Button CssClass="sinifKatil" runat="server" Text="Katılmak İstiyorum" OnClick="btnKatil_Click" />
<asp:Button CssClass="sinifAyril" runat="server" Text="Ayrılmak İstiyorum" OnClick="btnAyril_Click" />
</td>
</tr>
<% } %>
So the real question is assigning custom variables to `<asp:Button` objects in the loop for in order to use those variables at on click event. The variables that can be read.
ASP.net 4.0, C# 4.0, HTML, javascript, Jquery | c# | asp.net | loops | button | variable-assignment | null | open | How to assign variable to buttons in a loop to use those variables on click - ASP.net
===
For example at the loop below i want to assign buttons custom variable in order to determine which button clicked on click event with jquery
Here the code :
<% for (int i = 0; i < dsProjeler.Tables[0].Rows.Count; i++)
{
lblProjeName.Text = string.Format("<a target=\"_blank\" href=\""
+ dsProjeler.Tables[0].Rows[i]["link"].ToString() + "\">{0}</a>",
dsProjeler.Tables[0].Rows[i]["baslik"].ToString());
%>
<tr>
<td>
<asp:Literal ID="lblProjeName" runat="server"></asp:Literal>
</td>
<td>
<asp:Button CssClass="sinifKatil" runat="server" Text="Katılmak İstiyorum" OnClick="btnKatil_Click" />
<asp:Button CssClass="sinifAyril" runat="server" Text="Ayrılmak İstiyorum" OnClick="btnAyril_Click" />
</td>
</tr>
<% } %>
So the real question is assigning custom variables to `<asp:Button` objects in the loop for in order to use those variables at on click event. The variables that can be read.
ASP.net 4.0, C# 4.0, HTML, javascript, Jquery | 0 |
11,541,412 | 07/18/2012 12:31:01 | 1,394,068 | 05/14/2012 15:09:40 | 4 | 0 | Word Press Canvas Theme top level navigation - How to add a pop up link? | I am working with the Canvas Theme in WP and would like to have one of the main navigation links to pop up in a new, smaller window using JS:
javascript:launchWS('http://link');
Could anyone let me know where i can add this code? It's easy enough in a static web site, but in this dynamically created environment I am not even sure this is possible | wordpress | hyperlink | popup | null | null | null | open | Word Press Canvas Theme top level navigation - How to add a pop up link?
===
I am working with the Canvas Theme in WP and would like to have one of the main navigation links to pop up in a new, smaller window using JS:
javascript:launchWS('http://link');
Could anyone let me know where i can add this code? It's easy enough in a static web site, but in this dynamically created environment I am not even sure this is possible | 0 |
11,541,415 | 07/18/2012 12:31:08 | 1,534,779 | 07/18/2012 12:27:28 | 1 | 0 | getting the following error message in JAva | I am getting the following error message in java Exception in thread
"main" java.lang.StringIndexOutOfBoundsException: String index out of range: 0
Here is my code , all help is appreciated
public static void main (String[] args)
{
double gissade = 70;
int Input;
java.util.Scanner in = new java.util.Scanner (System.in);
char spelaIgen='j';
//char input2;
int antal=1;
while (spelaIgen == 'j')
{
System.out.print("gissa ett number?");
Input=in.nextInt();
if(Input<gissade)
{
System.out.println("du har gissat för lågt försök igen");
antal++;
}
else if(Input>gissade)
{
System.out.println("du har gissat för högt försök igen");
antal++;
}
if (Input==gissade)
{
System.out.println("du har gissat rätt");
System.out.println( "efter "+antal+" försök");
}
System.out.println("vill du försöka igen? j/n");
char input2 = in.nextLine().charAt(0);
//String s1=in.nextLine();
//char c1=s1.charAt(0);
//if (input=='n');
//System.exit(0);
}
}
} | java | introduction | null | null | null | null | open | getting the following error message in JAva
===
I am getting the following error message in java Exception in thread
"main" java.lang.StringIndexOutOfBoundsException: String index out of range: 0
Here is my code , all help is appreciated
public static void main (String[] args)
{
double gissade = 70;
int Input;
java.util.Scanner in = new java.util.Scanner (System.in);
char spelaIgen='j';
//char input2;
int antal=1;
while (spelaIgen == 'j')
{
System.out.print("gissa ett number?");
Input=in.nextInt();
if(Input<gissade)
{
System.out.println("du har gissat för lågt försök igen");
antal++;
}
else if(Input>gissade)
{
System.out.println("du har gissat för högt försök igen");
antal++;
}
if (Input==gissade)
{
System.out.println("du har gissat rätt");
System.out.println( "efter "+antal+" försök");
}
System.out.println("vill du försöka igen? j/n");
char input2 = in.nextLine().charAt(0);
//String s1=in.nextLine();
//char c1=s1.charAt(0);
//if (input=='n');
//System.exit(0);
}
}
} | 0 |
11,541,417 | 07/18/2012 12:31:12 | 1,030,982 | 11/05/2011 10:49:04 | 22 | 1 | adding a reference project in xcode | I am not able to use the header files of the sibling project in main project of workspace,
I have added the header search paths, library search paths in the build settings but i get this error
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_karyaBI", referenced from:
objc-class-ref in ViewController.o
"_OBJC_CLASS_$_DynamicsReportMaster", referenced from:
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
pls help!!! | xcode | workspace | null | null | null | null | open | adding a reference project in xcode
===
I am not able to use the header files of the sibling project in main project of workspace,
I have added the header search paths, library search paths in the build settings but i get this error
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_karyaBI", referenced from:
objc-class-ref in ViewController.o
"_OBJC_CLASS_$_DynamicsReportMaster", referenced from:
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
pls help!!! | 0 |
11,541,419 | 07/18/2012 12:31:17 | 590,335 | 01/26/2011 09:03:02 | 610 | 37 | ODP Array Binding - How to avoid rollback when some rows fail | I'm using ODP with Array Binding to perform bulk inserts.
In this scenario some rows may already exist in the DB.
When such a scenario occurs, the whole command is rolled back. In addition an exception is thrown with the details of the failed rows.
Is it possible to run the command without performing rollback for all rows in this case?
| oracle | odp | null | null | null | null | open | ODP Array Binding - How to avoid rollback when some rows fail
===
I'm using ODP with Array Binding to perform bulk inserts.
In this scenario some rows may already exist in the DB.
When such a scenario occurs, the whole command is rolled back. In addition an exception is thrown with the details of the failed rows.
Is it possible to run the command without performing rollback for all rows in this case?
| 0 |
11,541,423 | 07/18/2012 12:31:27 | 116,388 | 06/03/2009 06:25:33 | 3,133 | 161 | How delimit blocks in GZIP file? | I am writing for learning purpose a C program that uncompress GZIP files.
According to the GZIP "[spec][1]"
> A gzip file consists of a series of "members" (compressed data sets).
> The format of each member is specified in the following section. The
> members simply appear one after another in the file, with no
> additional information before, between, or after them.
and one member is made of a header (maybe with optional fields depending on some flags value), some compressed blocks (using deflate algorithm) and finally a CRC32 and the size of the original uncompressed file.
I have two questions:
1. How delimit members ? In practice is there really many members in one gzip file ?? Because it seems that one member correspond to one file (file name header for example)
2. How delimit the last block from the trailer (CRC + SIZE) ?
[1]: http://www.gzip.org/zlib/rfc-gzip.html | c | gzip | null | null | null | null | open | How delimit blocks in GZIP file?
===
I am writing for learning purpose a C program that uncompress GZIP files.
According to the GZIP "[spec][1]"
> A gzip file consists of a series of "members" (compressed data sets).
> The format of each member is specified in the following section. The
> members simply appear one after another in the file, with no
> additional information before, between, or after them.
and one member is made of a header (maybe with optional fields depending on some flags value), some compressed blocks (using deflate algorithm) and finally a CRC32 and the size of the original uncompressed file.
I have two questions:
1. How delimit members ? In practice is there really many members in one gzip file ?? Because it seems that one member correspond to one file (file name header for example)
2. How delimit the last block from the trailer (CRC + SIZE) ?
[1]: http://www.gzip.org/zlib/rfc-gzip.html | 0 |
11,541,424 | 07/18/2012 12:31:35 | 296,635 | 03/18/2010 15:08:29 | 410 | 1 | Same code different result | I have this line:
v_TERMINATIONDAY DATE := mkttimepac.GETGMTDATE(to_date('20/02/2012 00:00:00','DD/MM/YYYY HH24:MI:SS'),0);
i do this:
dbms_output.put_line(v_TERMINATIONDAY);
the result is **19/02/12** and not **20/02/2012**
Thx. | date | oracle10g | null | null | null | null | open | Same code different result
===
I have this line:
v_TERMINATIONDAY DATE := mkttimepac.GETGMTDATE(to_date('20/02/2012 00:00:00','DD/MM/YYYY HH24:MI:SS'),0);
i do this:
dbms_output.put_line(v_TERMINATIONDAY);
the result is **19/02/12** and not **20/02/2012**
Thx. | 0 |
11,541,425 | 07/18/2012 12:31:36 | 640,722 | 03/02/2011 07:15:46 | 66 | 8 | C++ parse input | I am in need of some assistance.
I need to parse a C++ stdin input witch looks something like this:
**N M (pairs)**
0 0
2 1 (0,1)
2 0
5 8 (0,1) (1,3) (2,3) (0,2) (0,1) (2,3) (2,4) (2,4)
If N > 0 && M > 0 pairs will follow. It is a single line input so i have no idea how to do it.
I have some solution. But something tells me it's not the best one.
void input(){
int a[100][2];
int n,m;
char ch;
cin >> n >> m;
for ( int i = 0; i < m; i++) {
cin >> ch >> a[i][0]>> ch>> a[i][1]>>ch;
}
cout << n << " " << m << " \n";
for ( int i=0; i < m; i++ ) {
cout << "(" << a[i][0] << " ," << a[i][1] << ")";
}
}
My question is what is the best / more correct way to do this ?
Cheers,
Ex | c++ | c | null | null | null | null | open | C++ parse input
===
I am in need of some assistance.
I need to parse a C++ stdin input witch looks something like this:
**N M (pairs)**
0 0
2 1 (0,1)
2 0
5 8 (0,1) (1,3) (2,3) (0,2) (0,1) (2,3) (2,4) (2,4)
If N > 0 && M > 0 pairs will follow. It is a single line input so i have no idea how to do it.
I have some solution. But something tells me it's not the best one.
void input(){
int a[100][2];
int n,m;
char ch;
cin >> n >> m;
for ( int i = 0; i < m; i++) {
cin >> ch >> a[i][0]>> ch>> a[i][1]>>ch;
}
cout << n << " " << m << " \n";
for ( int i=0; i < m; i++ ) {
cout << "(" << a[i][0] << " ," << a[i][1] << ")";
}
}
My question is what is the best / more correct way to do this ?
Cheers,
Ex | 0 |
11,541,373 | 07/18/2012 12:29:20 | 1,534,741 | 07/18/2012 12:15:36 | 1 | 0 | Python regular exressions engine and parenthesis in pattern. | I'm looking for some guidence. I'm writing a driver to handle a specific type of prompt from a terminal that I ssh into.
The code in the driver is looking for a particular pattern received from the device to know when to send additional commands or exit, etc.
The code in the driver takes the pattern as a regular expression. I've tried numerous different combinations of patterns for the regex to handle this prompt '(Cisco Controller) >', but to no avail. I've tried to escape the parenthesis '\(Cisco Controller\)\s*>', I've tried with raw string
r'\(Cisco Controller\)\s*>', and I've tried multiple other combinations, but I usually end up with the error "Unbalanced Parenthesis" or "Bogus escape character". Any thoughts on why I can't get the regex engine to accept this pattern?
I would appreciate any advice.
Thanks, | python-2.7 | null | null | null | null | null | open | Python regular exressions engine and parenthesis in pattern.
===
I'm looking for some guidence. I'm writing a driver to handle a specific type of prompt from a terminal that I ssh into.
The code in the driver is looking for a particular pattern received from the device to know when to send additional commands or exit, etc.
The code in the driver takes the pattern as a regular expression. I've tried numerous different combinations of patterns for the regex to handle this prompt '(Cisco Controller) >', but to no avail. I've tried to escape the parenthesis '\(Cisco Controller\)\s*>', I've tried with raw string
r'\(Cisco Controller\)\s*>', and I've tried multiple other combinations, but I usually end up with the error "Unbalanced Parenthesis" or "Bogus escape character". Any thoughts on why I can't get the regex engine to accept this pattern?
I would appreciate any advice.
Thanks, | 0 |
11,541,428 | 07/18/2012 12:31:48 | 662,996 | 03/16/2011 17:31:48 | 11 | 1 | Using CPAN with a proxy failing after o conf init /proxy/ | I have a Linux box in a corporate environment in which web access is gated through a proxy which requires authentication.
During a first run of cpan it auto configures everything that it normally does:
>Autoconfigured everything but 'urllist'.
>Please call 'o conf init urllist' to configure your CPAN server(s) now!
>commit: wrote '/usr/lib/perl5/5.10.0/CPAN/Config.pm'
Knowing that I have a proxy to navigate, and having read the docs and several pages on the web about proxy and cpan I:
> cpan[1]> o conf init /proxy/
>
> If you're accessing the net via proxies, you can specify them in the
> CPAN configuration or via environment variables. The variable in the
> $CPAN::Config takes precedence.
>
> <ftp_proxy> Your ftp_proxy? []
>
> <http_proxy> Your http_proxy? [] 10.12.8.9:3128
>
> <no_proxy> Your no_proxy? []
>
> If your proxy is an authenticating proxy, you can store your username
> permanently. If you do not want that, just press RETURN. You will then
> be asked for your username in every future session.
>
> Your proxy user id? [] my_net_id
>
> Your password for the authenticating proxy can also be stored
> permanently on disk. If this violates your security policy, just press
> RETURN. You will then be asked for the password in every future
> session.
>
> CPAN: Term::ReadKey loaded ok (v2.30)
> Your proxy password? <RETURN>
> Please remember to call 'o conf commit' to make the config permanent!
>
> cpan[2]> o conf commit
> commit: wrote '/usr/lib/perl5/5.10.0/CPAN/Config.pm'
All should be good now, right?
So I wish,
> cpan[3]> i /Some::Module/
> CPAN: Storable loaded ok (v2.18)
>
> I would like to connect to one of the following sites to get
> 'authors/01mailrc.txt.gz':
>
> http://www.perl.org/CPAN/ ftp://ftp.perl.org/pub/CPAN/
>
> Is it OK to try to connect to the Internet? [yes] LWP not available
>
> Trying with "/usr/bin/curl -L -f -s -S --netrc-optional" to get
> http://www.perl.org/CPAN/authors/01mailrc.txt.gz curl: (22) The requested URL returned error: 407
>
> System call "/usr/bin/curl -L -f -s -S --netrc-optional
> "http://www.perl.org/CPAN/authors/01mailrc.txt.gz" >
> /root/.cpan/sources/authors/01mailrc.txt.tmp29726"
> returned status 22 (wstat 5632) Warning: expected file [/root/.cpan/sources/authors/01mailrc.txt.gz.tmp29726] doesn't exist
>
> Trying with "/usr/bin/wget -O
> /root/.cpan/sources/authors/01mailrc.txt.tmp29726" to get
> http://www.perl.org/CPAN/authors/01mailrc.txt.gz
> --2012-07-17 15:57:38-- http://www.perl.org/CPAN/authors/01mailrc.txt.gz Connecting to
> 10.12.8.9:3128... connected. Proxy request sent, awaiting response... 301 Moved Permanently Location:
> http://www.cpan.org/authors/01mailrc.txt.gz [following]
> --2012-07-17 15:57:38-- http://www.cpan.org/authors/01mailrc.txt.gz Connecting to 10.12.8.9:3128... connected. Proxy request sent,
> awaiting response... 407 Proxy Authentication Required
> 2012-07-17 15:57:38 ERROR 407: Proxy Authentication Required.
So where's the password prompt?
What am I missing to configure cpan to access the internet through the corporate proxy with authentication?
| perl | configuration | proxy | cpan | null | null | open | Using CPAN with a proxy failing after o conf init /proxy/
===
I have a Linux box in a corporate environment in which web access is gated through a proxy which requires authentication.
During a first run of cpan it auto configures everything that it normally does:
>Autoconfigured everything but 'urllist'.
>Please call 'o conf init urllist' to configure your CPAN server(s) now!
>commit: wrote '/usr/lib/perl5/5.10.0/CPAN/Config.pm'
Knowing that I have a proxy to navigate, and having read the docs and several pages on the web about proxy and cpan I:
> cpan[1]> o conf init /proxy/
>
> If you're accessing the net via proxies, you can specify them in the
> CPAN configuration or via environment variables. The variable in the
> $CPAN::Config takes precedence.
>
> <ftp_proxy> Your ftp_proxy? []
>
> <http_proxy> Your http_proxy? [] 10.12.8.9:3128
>
> <no_proxy> Your no_proxy? []
>
> If your proxy is an authenticating proxy, you can store your username
> permanently. If you do not want that, just press RETURN. You will then
> be asked for your username in every future session.
>
> Your proxy user id? [] my_net_id
>
> Your password for the authenticating proxy can also be stored
> permanently on disk. If this violates your security policy, just press
> RETURN. You will then be asked for the password in every future
> session.
>
> CPAN: Term::ReadKey loaded ok (v2.30)
> Your proxy password? <RETURN>
> Please remember to call 'o conf commit' to make the config permanent!
>
> cpan[2]> o conf commit
> commit: wrote '/usr/lib/perl5/5.10.0/CPAN/Config.pm'
All should be good now, right?
So I wish,
> cpan[3]> i /Some::Module/
> CPAN: Storable loaded ok (v2.18)
>
> I would like to connect to one of the following sites to get
> 'authors/01mailrc.txt.gz':
>
> http://www.perl.org/CPAN/ ftp://ftp.perl.org/pub/CPAN/
>
> Is it OK to try to connect to the Internet? [yes] LWP not available
>
> Trying with "/usr/bin/curl -L -f -s -S --netrc-optional" to get
> http://www.perl.org/CPAN/authors/01mailrc.txt.gz curl: (22) The requested URL returned error: 407
>
> System call "/usr/bin/curl -L -f -s -S --netrc-optional
> "http://www.perl.org/CPAN/authors/01mailrc.txt.gz" >
> /root/.cpan/sources/authors/01mailrc.txt.tmp29726"
> returned status 22 (wstat 5632) Warning: expected file [/root/.cpan/sources/authors/01mailrc.txt.gz.tmp29726] doesn't exist
>
> Trying with "/usr/bin/wget -O
> /root/.cpan/sources/authors/01mailrc.txt.tmp29726" to get
> http://www.perl.org/CPAN/authors/01mailrc.txt.gz
> --2012-07-17 15:57:38-- http://www.perl.org/CPAN/authors/01mailrc.txt.gz Connecting to
> 10.12.8.9:3128... connected. Proxy request sent, awaiting response... 301 Moved Permanently Location:
> http://www.cpan.org/authors/01mailrc.txt.gz [following]
> --2012-07-17 15:57:38-- http://www.cpan.org/authors/01mailrc.txt.gz Connecting to 10.12.8.9:3128... connected. Proxy request sent,
> awaiting response... 407 Proxy Authentication Required
> 2012-07-17 15:57:38 ERROR 407: Proxy Authentication Required.
So where's the password prompt?
What am I missing to configure cpan to access the internet through the corporate proxy with authentication?
| 0 |
11,280,297 | 07/01/2012 07:33:29 | 1,481,978 | 06/26/2012 07:32:13 | 1 | 0 | javascript if-else loop not getting to else | I'm working through a tutorial right now on form validation, and I would like assistance on why this function always returns the `if` condition.
<html>
<head>
</head>
<body>
<form id="form" action="#" method="post">
<fieldset>
<p>
First Name:
<input type="text" id="txt" />
</p>
<p> <input type="submit" value="submit" onclick="validate()" /> </p>
</fieldset>
</form>
<script type="text/javascript">
function validate()
{
var userName = document.getElementById("txt").value;
if (userName.length == 0)
{
alert("FINISH THAT UP");
return false;
}
else
{
alert("thanks, " + UserName);
}
}
</script>
</body>
</html> | javascript | if-statement | null | null | null | null | open | javascript if-else loop not getting to else
===
I'm working through a tutorial right now on form validation, and I would like assistance on why this function always returns the `if` condition.
<html>
<head>
</head>
<body>
<form id="form" action="#" method="post">
<fieldset>
<p>
First Name:
<input type="text" id="txt" />
</p>
<p> <input type="submit" value="submit" onclick="validate()" /> </p>
</fieldset>
</form>
<script type="text/javascript">
function validate()
{
var userName = document.getElementById("txt").value;
if (userName.length == 0)
{
alert("FINISH THAT UP");
return false;
}
else
{
alert("thanks, " + UserName);
}
}
</script>
</body>
</html> | 0 |
11,280,298 | 07/01/2012 07:33:54 | 466,318 | 10/04/2010 23:32:42 | 390 | 2 | Detect wich row has the greatest value in MYSQL | I have a table like this
id | a | b | c | status
---+---+---+---+--------
1 | 3 |12 |6 | b
2 | 5 |8 |56 | c
3 | 99|7 |23 | a
I would like to detect wich column has the greatest value (1,2 or 3) and then record the "status" of that row highest value (I used a,b,c just for the example)
How could I do this?
Thanks! | mysql | null | null | null | null | null | open | Detect wich row has the greatest value in MYSQL
===
I have a table like this
id | a | b | c | status
---+---+---+---+--------
1 | 3 |12 |6 | b
2 | 5 |8 |56 | c
3 | 99|7 |23 | a
I would like to detect wich column has the greatest value (1,2 or 3) and then record the "status" of that row highest value (I used a,b,c just for the example)
How could I do this?
Thanks! | 0 |
11,280,313 | 07/01/2012 07:36:28 | 1,256,785 | 03/08/2012 10:35:22 | 37 | 2 | ios speech to text and text to speech framework? | I am new to iOS 5.0,
I want to develop an application that will convert **text to speech**,and **recognize human speech and convert into text**,
i want to convert human speech to text because i want to test it with the another text.
Is there any framework that will help to build my application. | objective-c | ios | ios5 | core-audio | null | 07/02/2012 09:22:22 | not constructive | ios speech to text and text to speech framework?
===
I am new to iOS 5.0,
I want to develop an application that will convert **text to speech**,and **recognize human speech and convert into text**,
i want to convert human speech to text because i want to test it with the another text.
Is there any framework that will help to build my application. | 4 |
11,280,314 | 07/01/2012 07:36:34 | 1,111,275 | 12/22/2011 07:55:44 | 71 | 0 | So Google actually dont support Schema.org at the moment? | A rich snippet example from Schema.org http://www.schema.org/AggregateRating:
<html>
<div itemscope itemtype="http://schema.org/Product">
<img itemprop="image" src="dell-30in-lcd.jpg" />
<span itemprop="name">Dell UltraSharp 30" LCD Monitor</span>
<div itemprop="aggregateRating"
itemscope itemtype="http://schema.org/AggregateRating">
<span itemprop="ratingValue">87</span>
out of <span itemprop="bestRating">100</span>
based on <span itemprop="ratingCount">24</span> user ratings
</div>
</div>
</html>
But http://www.google.com/webmasters/tools/richsnippets wont show a preview.
So, The following words from http://support.google.com/webmasters/bin/answer.py?hl=en&answer=146645 are just lies?
> New! schema.org lets you mark up a much wider range of item types on
> your pages, using a vocabulary that Google, Microsoft, and Yahoo! can
> all understand. Find out more. (Google still supports your existing
> rich snippets markup, though.)
| html | google | seo | schema | serp | null | open | So Google actually dont support Schema.org at the moment?
===
A rich snippet example from Schema.org http://www.schema.org/AggregateRating:
<html>
<div itemscope itemtype="http://schema.org/Product">
<img itemprop="image" src="dell-30in-lcd.jpg" />
<span itemprop="name">Dell UltraSharp 30" LCD Monitor</span>
<div itemprop="aggregateRating"
itemscope itemtype="http://schema.org/AggregateRating">
<span itemprop="ratingValue">87</span>
out of <span itemprop="bestRating">100</span>
based on <span itemprop="ratingCount">24</span> user ratings
</div>
</div>
</html>
But http://www.google.com/webmasters/tools/richsnippets wont show a preview.
So, The following words from http://support.google.com/webmasters/bin/answer.py?hl=en&answer=146645 are just lies?
> New! schema.org lets you mark up a much wider range of item types on
> your pages, using a vocabulary that Google, Microsoft, and Yahoo! can
> all understand. Find out more. (Google still supports your existing
> rich snippets markup, though.)
| 0 |
11,280,292 | 07/01/2012 07:32:55 | 1,459,031 | 06/15/2012 14:57:57 | 15 | 0 | string method replace is not working properly | I am using `replace` method of string,
var text = this ex is not working.;
text = text.replace(" ", "+");
alert(text);
and got alert :
this+ex is not working.
Whats the problem here? | javascript | jquery | null | null | null | null | open | string method replace is not working properly
===
I am using `replace` method of string,
var text = this ex is not working.;
text = text.replace(" ", "+");
alert(text);
and got alert :
this+ex is not working.
Whats the problem here? | 0 |
11,280,322 | 07/01/2012 07:38:37 | 1,360,434 | 04/27/2012 06:41:35 | 3 | 0 | convert wf4 xamlized <Assign> into c# | I’m unable to re-write the distilled piece of XAML below in C#.
<Activity
xmlns:swm="clr-namespace:System.Web.Mvc;assembly=System.Web.Mvc"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
>
<x:Members>
<x:Property
Name="ViewData"
Type="InArgument(swm:ViewDataDictionary)" />
</x:Members>
<Assign>
<Assign.To>
<OutArgument x:TypeArguments="x:Object">[ViewData("Foo")]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:Object">["funky foo string"]</InArgument>
</Assign.Value>
</Assign>
</Activity>
Can anybody shed light on this?
| xaml | workflow-foundation-4 | null | null | null | null | open | convert wf4 xamlized <Assign> into c#
===
I’m unable to re-write the distilled piece of XAML below in C#.
<Activity
xmlns:swm="clr-namespace:System.Web.Mvc;assembly=System.Web.Mvc"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
>
<x:Members>
<x:Property
Name="ViewData"
Type="InArgument(swm:ViewDataDictionary)" />
</x:Members>
<Assign>
<Assign.To>
<OutArgument x:TypeArguments="x:Object">[ViewData("Foo")]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:Object">["funky foo string"]</InArgument>
</Assign.Value>
</Assign>
</Activity>
Can anybody shed light on this?
| 0 |
11,280,323 | 07/01/2012 07:38:43 | 1,493,972 | 07/01/2012 07:15:57 | 1 | 0 | I built a matlab code into a Java project, and now I am getting an error while running the java line of code that calls that matlab function | My matlab code does image processing, and I made matlab function which has 2 images as inputs. I wrote a separate java class to perform the imread function of matlab, i.e., to read the jpg images into 3D array (its an RGB image).
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import QRcode_java.*;
import com.mathworks.toolbox.javabuilder.*;
public class Driver {
public static void main(String[] args) {
// TODO Auto-generated method stub
encoder_class x=null; //encoder_class is the class built from the
//matlab function
Object[] barcode2=null; //output of matlab function
barcode_image_class barcode; //class to imread the jpg image input
barcode= new barcode_image_class();
original_photo_class original_photo;
//class to imread another image input
original_photo= new original_photo_class();
try {
x= new encoder_class();
barcode2=x.encoder_function(barcode, original_photo);
//**ERROR!** /*encoder_function is the matlab function written by me. this line gives an //error as the following:
//"The method encoder_function(List, List) in the type encoder_class
//is not applicable for the arguments (barcode_image_class, original_photo_class)"*/
} catch (MWException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
Could you please tell me how to fix this error? Is it a problem with my java code, or the import of the matlab code? I am very new to Java, so I can't figure out the problem. Thanks! | java | matlab | image-processing | null | null | null | open | I built a matlab code into a Java project, and now I am getting an error while running the java line of code that calls that matlab function
===
My matlab code does image processing, and I made matlab function which has 2 images as inputs. I wrote a separate java class to perform the imread function of matlab, i.e., to read the jpg images into 3D array (its an RGB image).
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import QRcode_java.*;
import com.mathworks.toolbox.javabuilder.*;
public class Driver {
public static void main(String[] args) {
// TODO Auto-generated method stub
encoder_class x=null; //encoder_class is the class built from the
//matlab function
Object[] barcode2=null; //output of matlab function
barcode_image_class barcode; //class to imread the jpg image input
barcode= new barcode_image_class();
original_photo_class original_photo;
//class to imread another image input
original_photo= new original_photo_class();
try {
x= new encoder_class();
barcode2=x.encoder_function(barcode, original_photo);
//**ERROR!** /*encoder_function is the matlab function written by me. this line gives an //error as the following:
//"The method encoder_function(List, List) in the type encoder_class
//is not applicable for the arguments (barcode_image_class, original_photo_class)"*/
} catch (MWException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
Could you please tell me how to fix this error? Is it a problem with my java code, or the import of the matlab code? I am very new to Java, so I can't figure out the problem. Thanks! | 0 |
11,627,830 | 07/24/2012 09:22:46 | 958,941 | 09/22/2011 10:58:24 | 152 | 1 | Creating Bitmap Image from xaml control using WritableBitmapEx | How I can create bitmap image from xaml control using WritableBitmapEx. In my winRT application I need to create a snapshot of my window for implementing Pin to Tile(pinning secondary tile). I found WritableBitmap.render() is missing in winRT. How can I achieve this functionality by using WritableBitmapEx. | windows-8 | winrt | null | null | null | null | open | Creating Bitmap Image from xaml control using WritableBitmapEx
===
How I can create bitmap image from xaml control using WritableBitmapEx. In my winRT application I need to create a snapshot of my window for implementing Pin to Tile(pinning secondary tile). I found WritableBitmap.render() is missing in winRT. How can I achieve this functionality by using WritableBitmapEx. | 0 |
11,627,773 | 07/24/2012 09:19:26 | 1,088,754 | 12/08/2011 23:15:08 | 93 | 0 | Back propagation Error Function | I have a quick question regarding back propagation. I am looking at the following:
http://www4.rgu.ac.uk/files/chapter3%20-%20bp.pdf
In this paper it says calculate the error the neuron error as:
Error = **Output(i) * (1 - Output(i)) *** (Target(i) - Output(i))
I have put the part of the equation that I don't understand in bold. In the paper, it says that the **Output(i) * (1 - Output(i))** term is needed because of the sigmoid function - but I still don't understand why this would be nessecary ? What would be wrong with using ...
Error = abs(Output(i) - Target(i))
... as the error function regardless of the neuron activation/transfer function ?
Many thanks | artificial-intelligence | neural-network | backpropagation | null | null | null | open | Back propagation Error Function
===
I have a quick question regarding back propagation. I am looking at the following:
http://www4.rgu.ac.uk/files/chapter3%20-%20bp.pdf
In this paper it says calculate the error the neuron error as:
Error = **Output(i) * (1 - Output(i)) *** (Target(i) - Output(i))
I have put the part of the equation that I don't understand in bold. In the paper, it says that the **Output(i) * (1 - Output(i))** term is needed because of the sigmoid function - but I still don't understand why this would be nessecary ? What would be wrong with using ...
Error = abs(Output(i) - Target(i))
... as the error function regardless of the neuron activation/transfer function ?
Many thanks | 0 |
11,627,774 | 07/24/2012 09:19:26 | 1,235,527 | 02/27/2012 12:04:18 | 328 | 12 | Handle selectedchange event in user control from aspx page? | I have a filterControl on Main.aspx page , and this filterControl has another control called filterList.
I want to handle for listbox in filterlist control from main.aspx.
how can do it ?
![enter image description here][1]
[1]: http://i.stack.imgur.com/9jarK.png
need your helps. | asp.net | usercontrols | null | null | null | null | open | Handle selectedchange event in user control from aspx page?
===
I have a filterControl on Main.aspx page , and this filterControl has another control called filterList.
I want to handle for listbox in filterlist control from main.aspx.
how can do it ?
![enter image description here][1]
[1]: http://i.stack.imgur.com/9jarK.png
need your helps. | 0 |
11,626,781 | 07/24/2012 08:14:47 | 898,862 | 08/17/2011 14:38:42 | 34 | 0 | ASP MVC3 Razor TelerikGrid in TabStrip results in losing TabStrip when changing page | Problem probably lies with Telerik, but I've tried everything I've found and nothing works. Thing is: I have page:
@model List<serwisCurrendaModels.aplikacja_UtrzymanieKlient>
@{
ViewBag.Title = "Raport utrzymań";
}
<h2>@ViewBag.Message</h2>
@ViewBag.Sad
@{Html.Telerik().TabStrip().Name("UtrzymaniaTab")
.Items(strips =>
{
strips.Add()
.Text("Zakupione")
.LoadContentFrom("_BoughtReport", "Raport");
strips.Add()
.Text("Niezakupione")
.LoadContentFrom("_NonBoughtReport", "Raport");
})
.SelectedIndex(0)
.Render();
}
As you can see there's Telerik TabStrip used there, each renders different partial. These partials contain Grids. I'll only paste code for 1 partial, because they're very similar from markup side.
@model List<serwisCurrendaModels.aplikacja_UtrzymanieKlient>
<script type="text/javascript">
function onDataBound() {
var grid = $(this).data('tGrid');
var $exportLink = $('#exportLink');
var href = $exportLink.attr('href');
href = href.replace(/page=([^&]*)/, 'page=' + grid.currentPage);
href = href.replace(/pageSize=([^&]*)/, 'pageSize=' + grid.pageSize);
href = href.replace(/orderBy=([^&]*)/, 'orderBy=' + (grid.orderBy || '~'));
href = href.replace(/filter=(.*)/, 'filter=' + (grid.filterBy || '~'));
$exportLink.attr('href', href);
}
</script>
@Html.ActionLink("Eksport do Excela", "Export", new { page = 1, orderBy = "~", filter = "~" }, new { id = "exportLink" })
@*telerik*@
<div style="padding-bottom:5px; padding-top:5px;">
Data wygaśnięcia utrzymania:
@Html.Telerik().DatePicker().Name("dataWygasnieciaOd").ShowButton(true)
@Html.Telerik().DatePicker().Name("dataWygasnieciaDo").ShowButton(true)
<div class="t-button t-upload-button" onclick="filtruj()">
<span>Filtruj</span> <input id="filtruj" name="filtruj" type="button" autocomplete="off" />
</div>
<div class="t-button t-upload-button" onclick="wyczyscFiltr()">
<span>Wyczyść daty</span> <input id="czysc" name="czysc" type="button" autocomplete="off" />
</div>
</div>
<div>
@{Html.Telerik().Grid(Model).Name("Grid")
.Filterable()
.DataKeys(keys => keys.Add(p => p.nazwa))
/*.ToolBar(commands => commands
.Custom()
.HtmlAttributes(new { id = "export" })
.Text("Eksport do Excela")
.Action("Export", "RaportController", new { page = 1, orderBy = "~", filter = "~" }))*/
.Columns(columns =>
{
columns.Bound(o => o.nazwa);
columns.Bound(o => o.dataWygasnieciaUtrzymania).Format("{0:d}").Width(60).Filterable(false);
columns.Bound(o => o.nazwaAplikacji);
columns.Bound(o => o.emailKlienta);
})
.Scrollable(scrolling => scrolling.Enabled(false))
.Filterable(filtering => filtering.Enabled(true))
.Sortable(sorting => sorting.Enabled(true))
.Localizable("pl-PL")
//.DataBinding(dataBinding => dataBinding.Server().Select("Index", "Raport"))
//dodany event
.ClientEvents(events => events.OnLoad("onDataBound"))
.Pageable(paging => paging.Enabled(true).PageSize(50))
.RowAction(row =>
{
row.HtmlAttributes["class"] = "hoverAction";
})
.Footer(true)
.Render();
}
</div>
View has a Layout page, which works most of times, except for situations when you page something. It may be any grid in the application, when changing its page I get blank page filled with grid that has no formatting (like excel table).
Everything's alright with JavaScript stuff, I don't get any errors. I've tried:
@{
Layout = Request.IsAjaxRequest() ? null : "~/Views/Shared/Layout.cshtml";
}
But only thing it changes is that after changing page grid has basic layout, but without TabStrip. | asp.net-mvc | razor | pagination | telerik-grid | asp-mvc | null | open | ASP MVC3 Razor TelerikGrid in TabStrip results in losing TabStrip when changing page
===
Problem probably lies with Telerik, but I've tried everything I've found and nothing works. Thing is: I have page:
@model List<serwisCurrendaModels.aplikacja_UtrzymanieKlient>
@{
ViewBag.Title = "Raport utrzymań";
}
<h2>@ViewBag.Message</h2>
@ViewBag.Sad
@{Html.Telerik().TabStrip().Name("UtrzymaniaTab")
.Items(strips =>
{
strips.Add()
.Text("Zakupione")
.LoadContentFrom("_BoughtReport", "Raport");
strips.Add()
.Text("Niezakupione")
.LoadContentFrom("_NonBoughtReport", "Raport");
})
.SelectedIndex(0)
.Render();
}
As you can see there's Telerik TabStrip used there, each renders different partial. These partials contain Grids. I'll only paste code for 1 partial, because they're very similar from markup side.
@model List<serwisCurrendaModels.aplikacja_UtrzymanieKlient>
<script type="text/javascript">
function onDataBound() {
var grid = $(this).data('tGrid');
var $exportLink = $('#exportLink');
var href = $exportLink.attr('href');
href = href.replace(/page=([^&]*)/, 'page=' + grid.currentPage);
href = href.replace(/pageSize=([^&]*)/, 'pageSize=' + grid.pageSize);
href = href.replace(/orderBy=([^&]*)/, 'orderBy=' + (grid.orderBy || '~'));
href = href.replace(/filter=(.*)/, 'filter=' + (grid.filterBy || '~'));
$exportLink.attr('href', href);
}
</script>
@Html.ActionLink("Eksport do Excela", "Export", new { page = 1, orderBy = "~", filter = "~" }, new { id = "exportLink" })
@*telerik*@
<div style="padding-bottom:5px; padding-top:5px;">
Data wygaśnięcia utrzymania:
@Html.Telerik().DatePicker().Name("dataWygasnieciaOd").ShowButton(true)
@Html.Telerik().DatePicker().Name("dataWygasnieciaDo").ShowButton(true)
<div class="t-button t-upload-button" onclick="filtruj()">
<span>Filtruj</span> <input id="filtruj" name="filtruj" type="button" autocomplete="off" />
</div>
<div class="t-button t-upload-button" onclick="wyczyscFiltr()">
<span>Wyczyść daty</span> <input id="czysc" name="czysc" type="button" autocomplete="off" />
</div>
</div>
<div>
@{Html.Telerik().Grid(Model).Name("Grid")
.Filterable()
.DataKeys(keys => keys.Add(p => p.nazwa))
/*.ToolBar(commands => commands
.Custom()
.HtmlAttributes(new { id = "export" })
.Text("Eksport do Excela")
.Action("Export", "RaportController", new { page = 1, orderBy = "~", filter = "~" }))*/
.Columns(columns =>
{
columns.Bound(o => o.nazwa);
columns.Bound(o => o.dataWygasnieciaUtrzymania).Format("{0:d}").Width(60).Filterable(false);
columns.Bound(o => o.nazwaAplikacji);
columns.Bound(o => o.emailKlienta);
})
.Scrollable(scrolling => scrolling.Enabled(false))
.Filterable(filtering => filtering.Enabled(true))
.Sortable(sorting => sorting.Enabled(true))
.Localizable("pl-PL")
//.DataBinding(dataBinding => dataBinding.Server().Select("Index", "Raport"))
//dodany event
.ClientEvents(events => events.OnLoad("onDataBound"))
.Pageable(paging => paging.Enabled(true).PageSize(50))
.RowAction(row =>
{
row.HtmlAttributes["class"] = "hoverAction";
})
.Footer(true)
.Render();
}
</div>
View has a Layout page, which works most of times, except for situations when you page something. It may be any grid in the application, when changing its page I get blank page filled with grid that has no formatting (like excel table).
Everything's alright with JavaScript stuff, I don't get any errors. I've tried:
@{
Layout = Request.IsAjaxRequest() ? null : "~/Views/Shared/Layout.cshtml";
}
But only thing it changes is that after changing page grid has basic layout, but without TabStrip. | 0 |
11,627,552 | 07/24/2012 09:05:14 | 1,448,267 | 06/11/2012 06:23:08 | 22 | 3 | How should I send syslog via Syslog4j through a proxy? | I have following code to generate syslog to a server:
public class SyslogMessageGenerator {
private InetAddress address;
private int port;
private SyslogIF syslogClient;
public SyslogMessageGenerator(String host, int port, PROTOCALTYPE pType) {
this.address = null;
try {
this.address = InetAddress.getByName(host);
} catch (UnknownHostException e) {
e.printStackTrace();
}
this.port = port;
this.syslogClient = Syslog.getInstance(pType.toString());
this.syslogClient.getConfig().setHost(this.address.getHostAddress());
this.syslogClient.getConfig().setPort(port);
}
public void syslog(String messageToSend) {
syslogClient.log(Syslog.FACILITY_LOCAL1, messageToSend);
String hostName = address.getHostName();
String ip = address.getHostAddress();
System.out.println("Send log to " + hostName + "(" + ip + "):" + port);
System.out.println("messageToSend: " + messageToSend);
}
public void shutdown() {
syslogClient.shutdown();
}
public static void main(String[] args) {
String host = args[0];
int port = new Integer(args[1]).intValue();
PROTOCALTYPE pType = PROTOCALTYPE.TCP;
SyslogMessageGenerator sm = new SyslogMessageGenerator(host, port, pType);
for (int i = 0; i < 10; i ++) {
String message = "LogNum: " + i + ", This is a log for test";
sm.syslog(message);
try {
Thread.sleep(1000);
} catch (Exception e) {
e.printStackTrace();
}
}
sm.shutdown();
}
}
It worked well. However, I switch to an intranet, and accessing outside requires going through proxy. How should I add proxy to the above code? | java | proxy | syslog | null | null | null | open | How should I send syslog via Syslog4j through a proxy?
===
I have following code to generate syslog to a server:
public class SyslogMessageGenerator {
private InetAddress address;
private int port;
private SyslogIF syslogClient;
public SyslogMessageGenerator(String host, int port, PROTOCALTYPE pType) {
this.address = null;
try {
this.address = InetAddress.getByName(host);
} catch (UnknownHostException e) {
e.printStackTrace();
}
this.port = port;
this.syslogClient = Syslog.getInstance(pType.toString());
this.syslogClient.getConfig().setHost(this.address.getHostAddress());
this.syslogClient.getConfig().setPort(port);
}
public void syslog(String messageToSend) {
syslogClient.log(Syslog.FACILITY_LOCAL1, messageToSend);
String hostName = address.getHostName();
String ip = address.getHostAddress();
System.out.println("Send log to " + hostName + "(" + ip + "):" + port);
System.out.println("messageToSend: " + messageToSend);
}
public void shutdown() {
syslogClient.shutdown();
}
public static void main(String[] args) {
String host = args[0];
int port = new Integer(args[1]).intValue();
PROTOCALTYPE pType = PROTOCALTYPE.TCP;
SyslogMessageGenerator sm = new SyslogMessageGenerator(host, port, pType);
for (int i = 0; i < 10; i ++) {
String message = "LogNum: " + i + ", This is a log for test";
sm.syslog(message);
try {
Thread.sleep(1000);
} catch (Exception e) {
e.printStackTrace();
}
}
sm.shutdown();
}
}
It worked well. However, I switch to an intranet, and accessing outside requires going through proxy. How should I add proxy to the above code? | 0 |
11,627,853 | 07/24/2012 09:24:11 | 391,460 | 07/14/2010 10:43:45 | 109 | 2 | Cocos2d wave action similar to CCJump | I need to create a wave effect combined with the CCMove action. The CCJump action is very close to what I need but of course without the jumping so its smooth moving up and down until the sprite gets to its end x and y position. Below is the calculation for the CCJump action. Can anyone help me to adapt this code to remove the jumping and allow a smooth flow. Any pointers would be greatly appreciated.
-(void) update: (ccTime) t
{
// parabolic jump (since v0.8.2)
ccTime frac = fmodf( t * waves_, 1.0f );
ccTime y = height_ * 4 * frac * (1 - frac);
y += delta_.y * t;
ccTime x = delta_.x * t;
[target_ setPosition: ccp( startPosition_.x + x, startPosition_.y + y )];
}
| cocos2d | ccaction | null | null | null | null | open | Cocos2d wave action similar to CCJump
===
I need to create a wave effect combined with the CCMove action. The CCJump action is very close to what I need but of course without the jumping so its smooth moving up and down until the sprite gets to its end x and y position. Below is the calculation for the CCJump action. Can anyone help me to adapt this code to remove the jumping and allow a smooth flow. Any pointers would be greatly appreciated.
-(void) update: (ccTime) t
{
// parabolic jump (since v0.8.2)
ccTime frac = fmodf( t * waves_, 1.0f );
ccTime y = height_ * 4 * frac * (1 - frac);
y += delta_.y * t;
ccTime x = delta_.x * t;
[target_ setPosition: ccp( startPosition_.x + x, startPosition_.y + y )];
}
| 0 |
11,627,854 | 07/24/2012 09:24:15 | 1,502,136 | 07/04/2012 17:00:52 | 34 | 0 | C++ - CString not sure what value to set for dumping html source | I am trying to do the following
Firstly I dump a HTML source of a page about 1000-2000 lines of code.
Next is i want to do this
ifstream myfile;
myfile.open("file.txt");
while(!myfile.eof())
{
getline(myfile,sline);
sdata = sdata + sline;
}
However I don't want to use string for my case, how do i use cstring to hold , sdata in this case is a string sdata, but i wanna hold the content using cstring, is there a way for me to initialize and use cstring instead. its a non functional requirement for my mini project.
Thanks | c++ | null | null | null | null | null | open | C++ - CString not sure what value to set for dumping html source
===
I am trying to do the following
Firstly I dump a HTML source of a page about 1000-2000 lines of code.
Next is i want to do this
ifstream myfile;
myfile.open("file.txt");
while(!myfile.eof())
{
getline(myfile,sline);
sdata = sdata + sline;
}
However I don't want to use string for my case, how do i use cstring to hold , sdata in this case is a string sdata, but i wanna hold the content using cstring, is there a way for me to initialize and use cstring instead. its a non functional requirement for my mini project.
Thanks | 0 |
11,349,359 | 07/05/2012 17:22:35 | 1,267,123 | 03/13/2012 17:27:15 | 11 | 4 | Maven flex project using source directory from seperate module with new artifactId | Finding it difficult to express myself easily around this issue so thought best to start with a context section:
Context:
I have a Flex based application (a rather complex system) that can be compiled using "conditional compilation" into various use cases eg:
Compilation One = portalProjectUserOne
Compilation two = portalProjectUserTwo
Whether using conditional compilation is a sound idea is a completly different argument and therefore lets assume one is forced down this road, I then however decide to create a project for each of my desired compilations:
portalProjectUserOne
-branches
-tags
-trunk
-src
-pom
portalProjectUserTwo
-branches
-tags
-trunk
-src
-{NEEDS TO USE PROJECT ONES SOURCE}
As I do not want to break the ever rigid laws of programming and not duplicate anything I need a way of accessing the source of project ONE and using the source to do a CUSTOM compilation.
Things I have tried:
1. I tried using relative paths (../../portalProjectUserOne/trunk/src/etc...) with successful compilation but when it came time to release a final product to the nexus repo it had a few issues with reaching out the project structure, that and it felt a bit dirty really.
2. I attempted to use the "maven-dependency-plugin" to try and copy the sources from the first project, maybe this a pure lack of understanding on my part but I can not get my head around how you generate your classes in one project and access them from another.
This is my first question on stackoverflow and if I have been far to broad please let me know and I shall update with more extensive examples if required.
Thanks for listening/reading/being a coder.
| maven | flexmojos | flex-mojos | null | null | null | open | Maven flex project using source directory from seperate module with new artifactId
===
Finding it difficult to express myself easily around this issue so thought best to start with a context section:
Context:
I have a Flex based application (a rather complex system) that can be compiled using "conditional compilation" into various use cases eg:
Compilation One = portalProjectUserOne
Compilation two = portalProjectUserTwo
Whether using conditional compilation is a sound idea is a completly different argument and therefore lets assume one is forced down this road, I then however decide to create a project for each of my desired compilations:
portalProjectUserOne
-branches
-tags
-trunk
-src
-pom
portalProjectUserTwo
-branches
-tags
-trunk
-src
-{NEEDS TO USE PROJECT ONES SOURCE}
As I do not want to break the ever rigid laws of programming and not duplicate anything I need a way of accessing the source of project ONE and using the source to do a CUSTOM compilation.
Things I have tried:
1. I tried using relative paths (../../portalProjectUserOne/trunk/src/etc...) with successful compilation but when it came time to release a final product to the nexus repo it had a few issues with reaching out the project structure, that and it felt a bit dirty really.
2. I attempted to use the "maven-dependency-plugin" to try and copy the sources from the first project, maybe this a pure lack of understanding on my part but I can not get my head around how you generate your classes in one project and access them from another.
This is my first question on stackoverflow and if I have been far to broad please let me know and I shall update with more extensive examples if required.
Thanks for listening/reading/being a coder.
| 0 |
11,349,455 | 07/05/2012 17:28:39 | 1,378,388 | 05/06/2012 17:56:30 | 590 | 13 | adding textViews programatically doesn't print anything | i have three lists with the same number of elements in each other, i want to put first element of all lists in a tablerow, then second element of all lists in another tablerow,
the lists are :
competitoinsIDs = new LinkedList<String>();
marks = new LinkedList<String>();
numOfQuestions = new LinkedList<String>();
so i use this function:
private void addTextViews() {
// TODO Auto-generated method stub
TableLayout tbl=(TableLayout) findViewById(R.id.tlMarksTable);
for(int ctr=0;ctr<marks.size();ctr++)
{
//Creating new tablerows and textviews
TableRow row=new TableRow(this);
TextView txt1=new TextView(this);
TextView txt2=new TextView(this);
TextView txt3=new TextView(this);
//setting the text
txt1.setText(competitoinsIDs.get(ctr));
txt2.setText(marks.get(ctr));
txt3.setText(numOfQuestions.get(ctr));
//the textviews have to be added to the row created
row.addView(txt1);
row.addView(txt2);
row.addView(txt3);
tbl.addView(row);
}
}
and this is the layout xml
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TableLayout
android:id="@+id/tlMarksTable"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TableRow
android:id="@+id/tableRow1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="5dip"
android:weightSum="2" >
<TextView
android:id="@+id/tvMarksCompetitionID"
android:layout_weight="1"
android:text="Competition"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/tvMarksMarks"
android:layout_weight="1"
android:text="Marks"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/tvMarksQuestionsNum"
android:layout_weight="1"
android:text="Questions"
android:textAppearance="?android:attr/textAppearanceMedium" />
</TableRow>
</TableLayout>
</FrameLayout>
what am i doing wrong please ? | android | null | null | null | null | null | open | adding textViews programatically doesn't print anything
===
i have three lists with the same number of elements in each other, i want to put first element of all lists in a tablerow, then second element of all lists in another tablerow,
the lists are :
competitoinsIDs = new LinkedList<String>();
marks = new LinkedList<String>();
numOfQuestions = new LinkedList<String>();
so i use this function:
private void addTextViews() {
// TODO Auto-generated method stub
TableLayout tbl=(TableLayout) findViewById(R.id.tlMarksTable);
for(int ctr=0;ctr<marks.size();ctr++)
{
//Creating new tablerows and textviews
TableRow row=new TableRow(this);
TextView txt1=new TextView(this);
TextView txt2=new TextView(this);
TextView txt3=new TextView(this);
//setting the text
txt1.setText(competitoinsIDs.get(ctr));
txt2.setText(marks.get(ctr));
txt3.setText(numOfQuestions.get(ctr));
//the textviews have to be added to the row created
row.addView(txt1);
row.addView(txt2);
row.addView(txt3);
tbl.addView(row);
}
}
and this is the layout xml
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TableLayout
android:id="@+id/tlMarksTable"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TableRow
android:id="@+id/tableRow1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="5dip"
android:weightSum="2" >
<TextView
android:id="@+id/tvMarksCompetitionID"
android:layout_weight="1"
android:text="Competition"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/tvMarksMarks"
android:layout_weight="1"
android:text="Marks"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/tvMarksQuestionsNum"
android:layout_weight="1"
android:text="Questions"
android:textAppearance="?android:attr/textAppearanceMedium" />
</TableRow>
</TableLayout>
</FrameLayout>
what am i doing wrong please ? | 0 |
11,349,459 | 07/05/2012 17:29:06 | 760,583 | 05/19/2011 07:51:06 | 98 | 0 | Get word from long tap in a word of UITextView | Now I already detect long tap in UITextView
- (void)viewDidLoad
{
[super viewDidLoad];
UILongPressGestureRecognizer *LongPressgesture = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPressFrom:)];
[[self textview] addGestureRecognizer:LongPressgesture];
longPressGestureRecognizer.delegate = self;
}
- (void) handleLongPressFrom: (UISwipeGestureRecognizer *)recognizer
{
CGPoint location = [recognizer locationInView:self.view];
NSLog(@"Tap Gesture Coordinates: %.2f %.2f", location.x, location.y);
}
Now, How should I do to get content of word which got long press, and get a rect of that word to prepare to show the PopOver? | objective-c | ios | uigesturerecognizer | uipopovercontroller | null | null | open | Get word from long tap in a word of UITextView
===
Now I already detect long tap in UITextView
- (void)viewDidLoad
{
[super viewDidLoad];
UILongPressGestureRecognizer *LongPressgesture = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPressFrom:)];
[[self textview] addGestureRecognizer:LongPressgesture];
longPressGestureRecognizer.delegate = self;
}
- (void) handleLongPressFrom: (UISwipeGestureRecognizer *)recognizer
{
CGPoint location = [recognizer locationInView:self.view];
NSLog(@"Tap Gesture Coordinates: %.2f %.2f", location.x, location.y);
}
Now, How should I do to get content of word which got long press, and get a rect of that word to prepare to show the PopOver? | 0 |
11,349,129 | 07/05/2012 17:05:46 | 865,998 | 07/27/2011 17:43:55 | 45 | 8 | Fire javascript function when ctrl+p is pressed | I need to destroy a jQueryUI tabs when somebody tries to print the page.
I can't hide it with CSS as I need the data from these tabs.
Can anyone help/point me in the right direction with this?
Perhaps there are other ways of achieving the same results? | javascript | jquery | jquery-ui | null | null | null | open | Fire javascript function when ctrl+p is pressed
===
I need to destroy a jQueryUI tabs when somebody tries to print the page.
I can't hide it with CSS as I need the data from these tabs.
Can anyone help/point me in the right direction with this?
Perhaps there are other ways of achieving the same results? | 0 |
11,349,463 | 07/05/2012 17:29:24 | 849,137 | 07/17/2011 23:08:19 | 1,382 | 52 | Is my code indent style a put off? | When I write code, I don't really have much of an "indent style". I dont like one line being at the middle of the page and the other at the beginning. So I keep each line in the same position.
So, instead of this:
if(blah==blah){
doseomthing();
}
elseif(blah!=blah){
doSoethingElse();
andAnother();
}
I do this:
if(blah==blah){
doseomthing();
}// end of if - blah == blah
elseif(blah!=blah){
doSoethingElse();
andAnother();
}//end of elseif - blah != blah
Note how I comment after each curly braces to explain what it's there for...
Do you guys think this style is bad practice? Should I change my ways?
(I want to apply for a job soon, so I don't want to show off examples of bad practice, which is why I'm asking xD)
Thanks | coding-style | indentation | good-design | indent | null | 07/09/2012 18:19:17 | not constructive | Is my code indent style a put off?
===
When I write code, I don't really have much of an "indent style". I dont like one line being at the middle of the page and the other at the beginning. So I keep each line in the same position.
So, instead of this:
if(blah==blah){
doseomthing();
}
elseif(blah!=blah){
doSoethingElse();
andAnother();
}
I do this:
if(blah==blah){
doseomthing();
}// end of if - blah == blah
elseif(blah!=blah){
doSoethingElse();
andAnother();
}//end of elseif - blah != blah
Note how I comment after each curly braces to explain what it's there for...
Do you guys think this style is bad practice? Should I change my ways?
(I want to apply for a job soon, so I don't want to show off examples of bad practice, which is why I'm asking xD)
Thanks | 4 |
11,349,464 | 07/05/2012 17:29:24 | 979,614 | 10/05/2011 03:10:24 | 106 | 11 | Mobile page redirect issue | I'm trying to redirect this page [Page][1] to a Jquery mobile website that I'm currently working on but it doesn't redirect. I have the lines of code below in the header area, yet it didn't work. Any idea on what the problem could be?
[1]: http://siteripe.com
<script type="text/javascript">
<!--
if (screen.width <= 699) {
document.location = "mobile.html";
}
//-->
</script> | javascript | redirect | mobile | jquery-mobile | null | null | open | Mobile page redirect issue
===
I'm trying to redirect this page [Page][1] to a Jquery mobile website that I'm currently working on but it doesn't redirect. I have the lines of code below in the header area, yet it didn't work. Any idea on what the problem could be?
[1]: http://siteripe.com
<script type="text/javascript">
<!--
if (screen.width <= 699) {
document.location = "mobile.html";
}
//-->
</script> | 0 |
11,349,466 | 07/05/2012 17:29:35 | 198,274 | 10/28/2009 16:41:47 | 114 | 10 | Approach to perform unit and integration tests from Scratch for untested code | The basic question is "*How should one start with writing unit and integration testing for a untested project? Especially considering the fact that the person is not familiar with the code and has not done integration testing before.*"
Consider the scenario where unit tests and integration tests have to be written for a project. The project uses Java/J2EE technology does not have any tests written at all.
The dilemma that I face is since I have not written the code, I don't want to refactor the code immediately to write tests. I also have to select a testing framework. I am thinking of using Mockito and Powermock.
I also have to estimate code coverage for the tests. And then perform integration testing. I will have to research on integration testing tools and select one. I have not done any integration testing or estimated acceptable level of code coverage for a project before.
Since I am working independently, if there are some strategies, tips, suggestions on what should I start with and tools that one can recommend, I will appreciate it. | java | unit-testing | testing | junit | integration-testing | null | open | Approach to perform unit and integration tests from Scratch for untested code
===
The basic question is "*How should one start with writing unit and integration testing for a untested project? Especially considering the fact that the person is not familiar with the code and has not done integration testing before.*"
Consider the scenario where unit tests and integration tests have to be written for a project. The project uses Java/J2EE technology does not have any tests written at all.
The dilemma that I face is since I have not written the code, I don't want to refactor the code immediately to write tests. I also have to select a testing framework. I am thinking of using Mockito and Powermock.
I also have to estimate code coverage for the tests. And then perform integration testing. I will have to research on integration testing tools and select one. I have not done any integration testing or estimated acceptable level of code coverage for a project before.
Since I am working independently, if there are some strategies, tips, suggestions on what should I start with and tools that one can recommend, I will appreciate it. | 0 |
11,349,467 | 07/05/2012 17:29:35 | 654,616 | 03/11/2011 02:03:58 | 8 | 0 | Validate a collection of models against each other in MVC3 | I have a variable length list of person models that I use @Html.EditorFor to generate a form for.
public class Person
{
public string First { get; set; }
public string Last { get; set; }
}
What would be the best way to validate that no person objects have the same first and last name? | asp.net-mvc-3 | null | null | null | null | null | open | Validate a collection of models against each other in MVC3
===
I have a variable length list of person models that I use @Html.EditorFor to generate a form for.
public class Person
{
public string First { get; set; }
public string Last { get; set; }
}
What would be the best way to validate that no person objects have the same first and last name? | 0 |
11,349,476 | 07/05/2012 17:30:21 | 15,369 | 09/17/2008 08:43:27 | 9,385 | 401 | How can I periodically run a python script to import data into a DJango app? | I have a script which scans an email inbox for specific emails. That part's working well and I'm able to acquire the data I'm interested in. I'd now like to take that data and add it to a DJango app which will be used to display the information.
I can run the script on a CRON job to periodically grab new information, but how do I then get that data into the DJango app?
The DJango server is running on a linux box under Apache / FastCGI if that makes a difference. | python | django | data-importer | null | null | null | open | How can I periodically run a python script to import data into a DJango app?
===
I have a script which scans an email inbox for specific emails. That part's working well and I'm able to acquire the data I'm interested in. I'd now like to take that data and add it to a DJango app which will be used to display the information.
I can run the script on a CRON job to periodically grab new information, but how do I then get that data into the DJango app?
The DJango server is running on a linux box under Apache / FastCGI if that makes a difference. | 0 |
11,349,485 | 07/05/2012 17:31:22 | 745,835 | 05/09/2011 21:16:58 | 659 | 3 | Java EE How do you use an EntityManager with Mongo? | I"m trying to create a Java EE project using a mongo database. I am unable to find any good working examples.How do you correctly set up JPA for the project? | mongodb | java-ee-6 | entitymanager | null | null | null | open | Java EE How do you use an EntityManager with Mongo?
===
I"m trying to create a Java EE project using a mongo database. I am unable to find any good working examples.How do you correctly set up JPA for the project? | 0 |
11,226,597 | 06/27/2012 12:48:51 | 157,926 | 08/17/2009 18:21:49 | 37 | 2 | Html.DropDownFor Binding Issue in IE8 Related to CSS | All,
I'm having this strange issue in IE8 regarding binding model data to an Html.DropDownListFor element with a CSS width attribute applied.
I have a parent dropdown list that when changed causes a data look up, and then the model with the new data is supposed to bind to a child dropdown list.
In IE8, if I try and add a CSS width attribute in either the Html.DropListFor element or via Javascript attribute, the dropdownlist won't bind to the new data in the model.
If I have now width attribute, it works fine even in IE8.
Code:
***********************
`enter code here`@Html.DropDownListFor(model => model.EnrollmentToBatchDataContract.Spl, new SelectList(Model.SPLs, "Text", "Value"), "-- Please choose an SPL --", new {id="ddlSPL", name="ddlSPL"})
JS function:
`enter code here`function updateSPL(data) {
$('#ddlSPL >option').remove();
$('#ddlSPL').append($('<option></option>').html(""));
for (var x = 0; x < data.SPLs.length; x++) {
$('#ddlSPL').append($('<option value="' + data.SPLs[x].Value + '"> ' + data.SPLs[x].Text + '</option>').html(data.SPLs[x].Text));
}
};
End Code
***********************
I know that the model is being updated and passed into the JS function. I tested that the expected values are in the data object.
Also this works correctly in Chrome and FF.
Thanks,
Derek | jquery | css | asp.net-mvc | razor | html.dropdownlistfor | null | open | Html.DropDownFor Binding Issue in IE8 Related to CSS
===
All,
I'm having this strange issue in IE8 regarding binding model data to an Html.DropDownListFor element with a CSS width attribute applied.
I have a parent dropdown list that when changed causes a data look up, and then the model with the new data is supposed to bind to a child dropdown list.
In IE8, if I try and add a CSS width attribute in either the Html.DropListFor element or via Javascript attribute, the dropdownlist won't bind to the new data in the model.
If I have now width attribute, it works fine even in IE8.
Code:
***********************
`enter code here`@Html.DropDownListFor(model => model.EnrollmentToBatchDataContract.Spl, new SelectList(Model.SPLs, "Text", "Value"), "-- Please choose an SPL --", new {id="ddlSPL", name="ddlSPL"})
JS function:
`enter code here`function updateSPL(data) {
$('#ddlSPL >option').remove();
$('#ddlSPL').append($('<option></option>').html(""));
for (var x = 0; x < data.SPLs.length; x++) {
$('#ddlSPL').append($('<option value="' + data.SPLs[x].Value + '"> ' + data.SPLs[x].Text + '</option>').html(data.SPLs[x].Text));
}
};
End Code
***********************
I know that the model is being updated and passed into the JS function. I tested that the expected values are in the data object.
Also this works correctly in Chrome and FF.
Thanks,
Derek | 0 |
11,226,599 | 06/27/2012 12:48:51 | 1,485,579 | 06/27/2012 12:10:23 | 1 | 0 | Datatables Dropdown cum checkbox filter | I need to take one column and create checkboxes with all available values in that column... And then to be able to filter with those checkboxes?Is that possible??? | jquery | datatable | null | null | null | null | open | Datatables Dropdown cum checkbox filter
===
I need to take one column and create checkboxes with all available values in that column... And then to be able to filter with those checkboxes?Is that possible??? | 0 |
11,226,601 | 06/27/2012 12:48:53 | 713,179 | 04/05/2011 10:09:17 | 1,008 | 1 | Pointer storage in C | Pointer contains the memory location of another variable.Is pointer variable is stored in the Stack memory or an heap memory?
Please help me understand . | c | null | null | null | null | null | open | Pointer storage in C
===
Pointer contains the memory location of another variable.Is pointer variable is stored in the Stack memory or an heap memory?
Please help me understand . | 0 |
11,226,602 | 06/27/2012 12:49:07 | 1,391,330 | 05/12/2012 17:17:38 | 24 | 3 | Django form doesn't get processed | When I click the button and the form is valid it just refreshes the page. I checked the POST data it is correct. What can be the problem?
I have a different contact form with the same setup, and it works.
The forms.py file:
class ContactFormDebate(forms.Form):
subject = forms.CharField(max_length=100)
debate_title = forms.CharField(max_length=100)
debate_description = forms.CharField()
debate_scope = forms.CharField(max_length=200)
sender = forms.EmailField()
cc_myself = forms.BooleanField(required=False)
views.py:
def contactDebate(request):
if request.method == 'POST': # If the form has been submitted...
form = ContactFormDebate(request.POST) # A form bound to the POST data
if form.is_valid():
subject = form.cleaned_data['subject']
debate_title = form.cleaed_data['debate_title']
debate_description = form.cleaned.data['debate_description']
sender = form.cleaned_data['sender']
cc_myself = form.cleaned_data['cc_myself']
recipients = ['[email protected]']
if cc_myself:
recipients.append(sender)
from django.core.mail import send_mail
message = debate_title.append(debate_descripton)
send_mail(subject, message, sender, recipients)
return HttpResponseRedirect('/thanks/') # Redirect after POST
else:
form = ContactFormDebate() # An unbound form
return render(request, 'newdebate.html', {
'form': form,
})
template:
<h2 class="page-heading"><span>ПОДНЕСИ НОВА ДЕБАТА</span></h2>
<form action="." method="post">{% csrf_token %}
{{ form.non_field_errors }}
<div class="fieldWrapper">
{{ form.subject.errors }}
<label for="id_subject">Наслов на пораката:</label>
{{ form.subject }}
</div>
<div class="fieldWrapper">
{{ form.debate_title.errors }}
<label for="id_debate_title">Наслов на дебатата:</label>
{{ form.debate_title }}
</div>
<div class="fieldWrapper">
{{ form.debate_description.errors }}
<label for="id_debate_description">Опис на дебатата:</label>
{{ form.debate_description }}
</div>
<div class="fieldWrapper">
{{ form.sender.errors }}
<label for="id_sender">Email адреса:</label>
{{ form.sender }}
</div>
<div class="fieldWrapper">
{{ form.cc_myself.errors }}
{{ form.cc_myself }}
<label for="id_cc_myself" id="myself">Сакам да ми пристигне копија од пораката</label>
</div>
<p>
<div style="clear: both;"></div>
<input type="submit" value="Испрати" class="btn1 btn-primary1" /></p>
</form>
| django | forms | post | contact | null | null | open | Django form doesn't get processed
===
When I click the button and the form is valid it just refreshes the page. I checked the POST data it is correct. What can be the problem?
I have a different contact form with the same setup, and it works.
The forms.py file:
class ContactFormDebate(forms.Form):
subject = forms.CharField(max_length=100)
debate_title = forms.CharField(max_length=100)
debate_description = forms.CharField()
debate_scope = forms.CharField(max_length=200)
sender = forms.EmailField()
cc_myself = forms.BooleanField(required=False)
views.py:
def contactDebate(request):
if request.method == 'POST': # If the form has been submitted...
form = ContactFormDebate(request.POST) # A form bound to the POST data
if form.is_valid():
subject = form.cleaned_data['subject']
debate_title = form.cleaed_data['debate_title']
debate_description = form.cleaned.data['debate_description']
sender = form.cleaned_data['sender']
cc_myself = form.cleaned_data['cc_myself']
recipients = ['[email protected]']
if cc_myself:
recipients.append(sender)
from django.core.mail import send_mail
message = debate_title.append(debate_descripton)
send_mail(subject, message, sender, recipients)
return HttpResponseRedirect('/thanks/') # Redirect after POST
else:
form = ContactFormDebate() # An unbound form
return render(request, 'newdebate.html', {
'form': form,
})
template:
<h2 class="page-heading"><span>ПОДНЕСИ НОВА ДЕБАТА</span></h2>
<form action="." method="post">{% csrf_token %}
{{ form.non_field_errors }}
<div class="fieldWrapper">
{{ form.subject.errors }}
<label for="id_subject">Наслов на пораката:</label>
{{ form.subject }}
</div>
<div class="fieldWrapper">
{{ form.debate_title.errors }}
<label for="id_debate_title">Наслов на дебатата:</label>
{{ form.debate_title }}
</div>
<div class="fieldWrapper">
{{ form.debate_description.errors }}
<label for="id_debate_description">Опис на дебатата:</label>
{{ form.debate_description }}
</div>
<div class="fieldWrapper">
{{ form.sender.errors }}
<label for="id_sender">Email адреса:</label>
{{ form.sender }}
</div>
<div class="fieldWrapper">
{{ form.cc_myself.errors }}
{{ form.cc_myself }}
<label for="id_cc_myself" id="myself">Сакам да ми пристигне копија од пораката</label>
</div>
<p>
<div style="clear: both;"></div>
<input type="submit" value="Испрати" class="btn1 btn-primary1" /></p>
</form>
| 0 |
11,226,603 | 06/27/2012 12:49:11 | 571,099 | 01/11/2011 10:15:47 | 93 | 1 | create an excel file for users to download using apache poi, jsp | I'm able to create an excel file using apache poi. however, i want users to be able to download this as a "true" excel file. the effect i want to achieve would be to have a popup box allowing the user to download the file. this is similar to using
<%@ page contentType="application/vnd.ms-excel" pageEncoding="ISO-8859-1"%> <%response.setHeader("Content-Disposition", "attachment;filename=myfile.xls"); %>
with one critical exception: i must allow the user to download a proper excel file. i read somewhere the above code simply says to the client that the server is sending an excel file | jsp | servlets | apache-poi | null | null | null | open | create an excel file for users to download using apache poi, jsp
===
I'm able to create an excel file using apache poi. however, i want users to be able to download this as a "true" excel file. the effect i want to achieve would be to have a popup box allowing the user to download the file. this is similar to using
<%@ page contentType="application/vnd.ms-excel" pageEncoding="ISO-8859-1"%> <%response.setHeader("Content-Disposition", "attachment;filename=myfile.xls"); %>
with one critical exception: i must allow the user to download a proper excel file. i read somewhere the above code simply says to the client that the server is sending an excel file | 0 |
11,226,604 | 06/27/2012 12:49:13 | 1,474,068 | 06/22/2012 07:00:05 | 13 | 0 | Read ATA Status and Error registers in real time | I need to check in real time the status and error registers of a SATA hard disk before sending an ata command to the disk.
How can I achieve this using visual basic.net??
Thanks | vb.net | vb.net-2010 | null | null | null | null | open | Read ATA Status and Error registers in real time
===
I need to check in real time the status and error registers of a SATA hard disk before sending an ata command to the disk.
How can I achieve this using visual basic.net??
Thanks | 0 |
11,226,608 | 06/27/2012 12:49:32 | 1,478,466 | 06/24/2012 18:09:45 | 7 | 0 | Event changed on combobox with datagrid (wpf) | sample combobox (xaml):
<ComboBox Height="23" Name="status" IsReadOnly="True" ItemsSource="{Binding}" Width="120" SelectedItem="test">
</ComboBox>
how i can starting event click (etc...) or changed, on my combobox? | c# | wpf | null | null | null | null | open | Event changed on combobox with datagrid (wpf)
===
sample combobox (xaml):
<ComboBox Height="23" Name="status" IsReadOnly="True" ItemsSource="{Binding}" Width="120" SelectedItem="test">
</ComboBox>
how i can starting event click (etc...) or changed, on my combobox? | 0 |
11,226,617 | 06/27/2012 12:50:09 | 542,019 | 12/14/2010 13:47:19 | 469 | 43 | xcode 10.7 - How to bind view cells | I'm following Aaron Hillegrass's book (trying), and am at the point trying to bind some view cells. I am getting the results in the screen shot below.
The cells on the right side are at least editable. The title cell is not.
I'd appreciate any advice on what I'm doing wrong.
Thanks
![enter image description here][1]
[1]: http://i.stack.imgur.com/KJ3za.png | xcode | osx-lion | null | null | null | null | open | xcode 10.7 - How to bind view cells
===
I'm following Aaron Hillegrass's book (trying), and am at the point trying to bind some view cells. I am getting the results in the screen shot below.
The cells on the right side are at least editable. The title cell is not.
I'd appreciate any advice on what I'm doing wrong.
Thanks
![enter image description here][1]
[1]: http://i.stack.imgur.com/KJ3za.png | 0 |
11,226,621 | 06/27/2012 12:50:19 | 195,115 | 10/23/2009 06:47:37 | 133 | 8 | Mercurial share extension doesn't work with nested subrepos | I can't get mercurial **share** extension to work with nested repos.
With a test repository setup as below:
- SubrepoTest/
- nested/
and the share extension enabled. Trying to share repo gives this error:
<pre><code>
hg share --debug --traceback SubrepoTest Copy
updating working directory
resolving manifests
overwrite: False, partial: False
ancestor: 000000000000, local: 000000000000+, remote: 9d3080714601
.hgsub: remote created -> g
.hgsubstate: remote created -> g
New Text Document.txt: remote created -> g
calling hook preupdate.auto_update_hooks: <function check_and_update_hooks at 0x00E3F430>
calling hook preupdate.auto_rhapsody: <function check_rhapsody at 0x00E3F5F0>
Rhapsody not running.
updating: .hgsub 1/3 files (33.33%)
getting .hgsub
updating: .hgsubstate 2/3 files (66.67%)
getting .hgsubstate
subrepo merge 000000000000+ 9d3080714601 000000000000+
subrepo nested: remote added, get nested:6a97f6c97cf7b1fd1bd82cb528a7494980e17d62:hg
Traceback (most recent call last):
File "mercurial\dispatch.pyo", line 87, in _runcatch
File "mercurial\dispatch.pyo", line 696, in _dispatch
File "mercurial\dispatch.pyo", line 472, in runcommand
File "mercurial\extensions.pyo", line 184, in wrap
File "hgext\color.pyo", line 362, in colorcmd
File "mercurial\dispatch.pyo", line 786, in _runcommand
File "mercurial\dispatch.pyo", line 757, in checkargs
File "mercurial\dispatch.pyo", line 693, in <lambda>
File "mercurial\util.pyo", line 463, in check
File "hgext\share.pyo", line 29, in share
File "mercurial\hg.pyo", line 175, in share
File "mercurial\hg.pyo", line 416, in update
File "mercurial\merge.pyo", line 596, in update
File "mercurial\merge.pyo", line 391, in applyupdates
File "mercurial\subrepo.pyo", line 183, in submerge
File "mercurial\subrepo.pyo", line 512, in get
File "mercurial\subrepo.pyo", line 494, in _get
File "mercurial\subrepo.pyo", line 247, in _abssource
Abort: default path for subrepository nested not found
abort: default path for subrepository nested not found
</code></pre>
I'm using Mercurial Distributed SCM (version 2.2.2) from TortoiseHG for Windows.
How do I solve this problem?
| mercurial | mercurial-subrepos | mercurial-extension | null | null | null | open | Mercurial share extension doesn't work with nested subrepos
===
I can't get mercurial **share** extension to work with nested repos.
With a test repository setup as below:
- SubrepoTest/
- nested/
and the share extension enabled. Trying to share repo gives this error:
<pre><code>
hg share --debug --traceback SubrepoTest Copy
updating working directory
resolving manifests
overwrite: False, partial: False
ancestor: 000000000000, local: 000000000000+, remote: 9d3080714601
.hgsub: remote created -> g
.hgsubstate: remote created -> g
New Text Document.txt: remote created -> g
calling hook preupdate.auto_update_hooks: <function check_and_update_hooks at 0x00E3F430>
calling hook preupdate.auto_rhapsody: <function check_rhapsody at 0x00E3F5F0>
Rhapsody not running.
updating: .hgsub 1/3 files (33.33%)
getting .hgsub
updating: .hgsubstate 2/3 files (66.67%)
getting .hgsubstate
subrepo merge 000000000000+ 9d3080714601 000000000000+
subrepo nested: remote added, get nested:6a97f6c97cf7b1fd1bd82cb528a7494980e17d62:hg
Traceback (most recent call last):
File "mercurial\dispatch.pyo", line 87, in _runcatch
File "mercurial\dispatch.pyo", line 696, in _dispatch
File "mercurial\dispatch.pyo", line 472, in runcommand
File "mercurial\extensions.pyo", line 184, in wrap
File "hgext\color.pyo", line 362, in colorcmd
File "mercurial\dispatch.pyo", line 786, in _runcommand
File "mercurial\dispatch.pyo", line 757, in checkargs
File "mercurial\dispatch.pyo", line 693, in <lambda>
File "mercurial\util.pyo", line 463, in check
File "hgext\share.pyo", line 29, in share
File "mercurial\hg.pyo", line 175, in share
File "mercurial\hg.pyo", line 416, in update
File "mercurial\merge.pyo", line 596, in update
File "mercurial\merge.pyo", line 391, in applyupdates
File "mercurial\subrepo.pyo", line 183, in submerge
File "mercurial\subrepo.pyo", line 512, in get
File "mercurial\subrepo.pyo", line 494, in _get
File "mercurial\subrepo.pyo", line 247, in _abssource
Abort: default path for subrepository nested not found
abort: default path for subrepository nested not found
</code></pre>
I'm using Mercurial Distributed SCM (version 2.2.2) from TortoiseHG for Windows.
How do I solve this problem?
| 0 |
11,650,343 | 07/25/2012 13:02:27 | 1,551,611 | 07/25/2012 12:36:56 | 1 | 0 | how can i use servlet in jsp page? | <body>
<form action="testServlet.java">
<TABLE border="0" align="center">
<TR height="40">
<TD width="40"><a href="Hoda/testServlet?direction=b"><img
src=<%=request.getAttribute("imgSrc")%> width="40" height="40" /></a></TD>
</form>
</body>
SERVLET:
@WebServlet("/testServlet")
public class testServlet extends HttpServlet {
String imgSrc = "red.png";
protected void service(HttpServletRequest reques,HttpServletResponse response) throws ServletException, IOException {
String str = request.getParameter("direction");
if (str.startsWith("b")) {
imgSrc = "black.png";
}
request.setAttribute("imgSrc", imgSrc);
}
}
in my JSP page, I created a cell whose image source I want to get from servlet. I put the link tag to ask servlet for imgSrc, but it does not work . Please show me how to change the imgSrc in JSP page using servlet. I want the JSP to merely show the result, not a dispatch to another page.
here is my code :
| jsp | null | null | null | null | null | open | how can i use servlet in jsp page?
===
<body>
<form action="testServlet.java">
<TABLE border="0" align="center">
<TR height="40">
<TD width="40"><a href="Hoda/testServlet?direction=b"><img
src=<%=request.getAttribute("imgSrc")%> width="40" height="40" /></a></TD>
</form>
</body>
SERVLET:
@WebServlet("/testServlet")
public class testServlet extends HttpServlet {
String imgSrc = "red.png";
protected void service(HttpServletRequest reques,HttpServletResponse response) throws ServletException, IOException {
String str = request.getParameter("direction");
if (str.startsWith("b")) {
imgSrc = "black.png";
}
request.setAttribute("imgSrc", imgSrc);
}
}
in my JSP page, I created a cell whose image source I want to get from servlet. I put the link tag to ask servlet for imgSrc, but it does not work . Please show me how to change the imgSrc in JSP page using servlet. I want the JSP to merely show the result, not a dispatch to another page.
here is my code :
| 0 |
11,650,346 | 07/25/2012 13:02:40 | 958,580 | 09/22/2011 07:59:23 | 78 | 11 | Python : Split a list of length n into a table or further lists, by type, retaining order | Essentially I have a list of items each with a different type such as
['a',1,'b',2,3,'c']
or
[{"A":1},1,{"B":2},{"C":3},"a"]
and I would like to split these into two seperate lists, retaining the original order
[[ 'a', none, 'b', none, none, 'c'],
[none, 1, none, 2, 3, none]]
or
[[{"A":1}, none, {"B":2},{"C":3}, none],
[none, 1, none, none, none],
[none, none, none, none, "a"]]
What I have :
def TypeSplit(In)
Types = [dict(),str(),num()]
return [[item for item in sources if type(item) == type(itype)] for itype in types]
Though this doesn't fill in none.
The reason I'm doing this is that I will be given a list with different types of info and need to flesh it out with other values that compliment the original list.
Is there a better way to do this ?
| python | list | null | null | null | null | open | Python : Split a list of length n into a table or further lists, by type, retaining order
===
Essentially I have a list of items each with a different type such as
['a',1,'b',2,3,'c']
or
[{"A":1},1,{"B":2},{"C":3},"a"]
and I would like to split these into two seperate lists, retaining the original order
[[ 'a', none, 'b', none, none, 'c'],
[none, 1, none, 2, 3, none]]
or
[[{"A":1}, none, {"B":2},{"C":3}, none],
[none, 1, none, none, none],
[none, none, none, none, "a"]]
What I have :
def TypeSplit(In)
Types = [dict(),str(),num()]
return [[item for item in sources if type(item) == type(itype)] for itype in types]
Though this doesn't fill in none.
The reason I'm doing this is that I will be given a list with different types of info and need to flesh it out with other values that compliment the original list.
Is there a better way to do this ?
| 0 |
11,650,272 | 07/25/2012 12:58:57 | 1,515,143 | 07/10/2012 14:45:25 | 34 | 3 | Ruby on Rails: Show results on page, after search | I am basically extending a question that has been asked. [Link][1]. The answer given should work for me however, instead of
def index
@search = params[:search]
@profiles = Profile.search(@search)
end
My code has many search params:
def search
@search = params[:client], params[:industry], params[:role], params[:tech], params[:business_div], params[:project_owner], params[:exception_pm], params[:status], params[:start_date], params[:end_date], params[:keywords]
@project_search = Project.search(@search)
@project = Project.new(params[:project])
respond_to do |format|
format.html # search.html.erb
format.json { render :json => @project }
end
end
Hopefully it's an easy fix.
Thanks
[1]: http://stackoverflow.com/questions/1353203/display-search-query-in-results-of-basic-search-in-rails | ruby-on-rails | ruby | search | params | null | null | open | Ruby on Rails: Show results on page, after search
===
I am basically extending a question that has been asked. [Link][1]. The answer given should work for me however, instead of
def index
@search = params[:search]
@profiles = Profile.search(@search)
end
My code has many search params:
def search
@search = params[:client], params[:industry], params[:role], params[:tech], params[:business_div], params[:project_owner], params[:exception_pm], params[:status], params[:start_date], params[:end_date], params[:keywords]
@project_search = Project.search(@search)
@project = Project.new(params[:project])
respond_to do |format|
format.html # search.html.erb
format.json { render :json => @project }
end
end
Hopefully it's an easy fix.
Thanks
[1]: http://stackoverflow.com/questions/1353203/display-search-query-in-results-of-basic-search-in-rails | 0 |
11,650,275 | 07/25/2012 12:59:02 | 1,427,659 | 05/31/2012 06:31:40 | 18 | 0 | how to create the listfiled in blackberry as like in the image | ![enter image description here][1]
[1]: http://i.stack.imgur.com/GJ9C9.png
i have used liststyle button filed class which is available in the advanecd ui examples. so that class is taking taking string as paraetre. if i have given the string like techv and time and message using tabs("\t") . the alignment is changing if any text length is changing.
so how to fix the alignment. how to creat the custome list filed which looks like same as in the image. | blackberry | null | null | null | null | 07/26/2012 13:34:00 | not a real question | how to create the listfiled in blackberry as like in the image
===
![enter image description here][1]
[1]: http://i.stack.imgur.com/GJ9C9.png
i have used liststyle button filed class which is available in the advanecd ui examples. so that class is taking taking string as paraetre. if i have given the string like techv and time and message using tabs("\t") . the alignment is changing if any text length is changing.
so how to fix the alignment. how to creat the custome list filed which looks like same as in the image. | 1 |
11,650,276 | 07/25/2012 12:59:04 | 1,147,315 | 01/13/2012 09:06:45 | 8 | 0 | App Crash, no idea why | I trying to figure out why my App crashes sometimes on costumers devices. It doesnt matter if the device is jailbreaked or not. My App is from the AppStore. The other crashlogs are nearly the same although their crashed threads are different.
Hardware Model: iPhone3,1
Process: [the APP] [296]
Path: /var/mobile/Applications/06DF5BC5-F9C2-49EE-B2D5-5979C09B51A2/[the APP].app/[the APP]
Identifier: [the APP]
Version: 3.3.0
Code Type: ARM
Parent Process: launchd [1]
Date/Time: 2012-07-22 15:15:18 +0000
OS Version: iPhone OS 5.1.1 (9B206)
Report Version: 104
Exception Type: SIGSEGV
Exception Codes: SEGV_ACCERR at 0xbbadbeef
Crashed Thread: 7
Thread 0:
0 libsystem_kernel.dylib 0x35c39004 mach_msg_trap + 20
1 CoreFoundation 0x353673f3 __CFRunLoopServiceMachPort + 127
2 CoreFoundation 0x353660f1 __CFRunLoopRun + 825
3 CoreFoundation 0x352e94a5 CFRunLoopRunSpecific + 301
4 CoreFoundation 0x352e936d CFRunLoopRunInMode + 105
5 GraphicsServices 0x36f85439 GSEventRunModal + 137
6 UIKit 0x32df5cd5 UIApplicationMain + 1081
7 [the APP] 0x0000b549 main (main.m:20)
Thread 1:
0 libsystem_kernel.dylib 0x35c393a8 kevent + 24
1 libdispatch.dylib 0x3422cbc9 _dispatch_mgr_wakeup + 1
Thread 2:
0 libsystem_kernel.dylib 0x35c490d8 __psynch_mutexwait + 24
1 WebCore 0x311454ef _ZL17_WebTryThreadLockb + 215
2 WebCore 0x311a4173 _ZL19SendDelegateMessageP12NSInvocation + 707
3 WebKit 0x3507ad87 -[_WebSafeForwarder forwardInvocation:] + 119
4 CoreFoundation 0x35395a83 ___forwarding___ + 667
5 CoreFoundation 0x352f0650 _CF_forwarding_prep_0 + 48
6 WebKit 0x350816a1 WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction(void (WebCore::PolicyChecker::*)(WebCore::PolicyAction), WebCore::NavigationAction const&, WebCore::ResourceRequest const&, WTF::PassRefPtr) + 221
7 WebCore 0x3120b8b9 WebCore::PolicyChecker::checkNavigationPolicy(WebCore::ResourceRequest const&, WebCore::DocumentLoader*, WTF::PassRefPtr, void (*)(void*, WebCore::ResourceRequest const&, WTF::PassRefPtr, bool), void*) + 873
8 WebCore 0x3120ae4d WebCore::FrameLoader::loadWithDocumentLoader(WebCore::DocumentLoader*, WebCore::FrameLoadType, WTF::PassRefPtr) + 913
9 WebCore 0x312092b9 WebCore::FrameLoader::load(WebCore::DocumentLoader*) + 169
10 WebCore 0x312091e5 WebCore::FrameLoader::load(WebCore::ResourceRequest const&, WebCore::SubstituteData const&, bool) + 241
11 WebKit 0x350b3f5f -[WebFrame _loadData:MIMEType:textEncodingName:baseURL:unreachableURL:] + 1119
12 WebKit 0x350b3797 -[WebFrame _loadHTMLString:baseURL:unreachableURL:] + 79
13 WebKit 0x350b37bb -[WebFrame loadHTMLString:baseURL:] + 31
14 WebCore 0x311950b5 HandleRunSource + 365
15 CoreFoundation 0x35367ad3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
16 CoreFoundation 0x35367335 __CFRunLoopDoSources0 + 365
17 CoreFoundation 0x35366045 __CFRunLoopRun + 653
18 CoreFoundation 0x352e94a5 CFRunLoopRunSpecific + 301
19 CoreFoundation 0x352e936d CFRunLoopRunInMode + 105
20 WebCore 0x311e8ca3 _ZL12RunWebThreadPv + 403
21 libsystem_c.dylib 0x32756735 _pthread_start + 321
Thread 3:
0 libsystem_kernel.dylib 0x35c39004 mach_msg_trap + 20
1 CoreFoundation 0x353673f3 __CFRunLoopServiceMachPort + 127
2 CoreFoundation 0x3536612b __CFRunLoopRun + 883
3 CoreFoundation 0x352e94a5 CFRunLoopRunSpecific + 301
4 CoreFoundation 0x352e936d CFRunLoopRunInMode + 105
5 Foundation 0x34e22bb9 +[NSURLConnection(Loader) _resourceLoadLoop:] + 309
6 Foundation 0x34e22a81 -[NSThread main] + 73
7 Foundation 0x34eb6591 __NSThread__main__ + 1049
8 libsystem_c.dylib 0x32756735 _pthread_start + 321
Thread 4:
0 libsystem_kernel.dylib 0x35c49570 __select + 20
1 libsystem_c.dylib 0x32756735 _pthread_start + 321
Thread 5:
0 libsystem_kernel.dylib 0x35c39004 mach_msg_trap + 20
1 CoreFoundation 0x353673f3 __CFRunLoopServiceMachPort + 127
2 CoreFoundation 0x3536612b __CFRunLoopRun + 883
3 CoreFoundation 0x352e94a5 CFRunLoopRunSpecific + 301
4 CoreFoundation 0x352e936d CFRunLoopRunInMode + 105
5 YouTube 0x33e336c9 -[YTImageLoader(Internal) _startLoader] + 245
6 Foundation 0x34e22a81 -[NSThread main] + 73
7 Foundation 0x34eb6591 __NSThread__main__ + 1049
8 libsystem_c.dylib 0x32756735 _pthread_start + 321
Thread 6:
0 libsystem_kernel.dylib 0x35c49cd4 __workq_kernreturn + 8
Thread 7 Crashed:
0 WebCore 0x311454e2 _ZL17_WebTryThreadLockb + 202
1 WebCore 0x3114540f WebThreadLock + 55
2 UIKit 0x32e5537b -[UIWebTiledView layoutSubviews] + 43
3 UIKit 0x32e5534b -[UIWebDocumentView layoutSubviews] + 127
4 UIKit 0x32dcaf37 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 183
5 CoreFoundation 0x352f21fb -[NSObject performSelector:withObject:] + 43
6 QuartzCore 0x321c2aa5 -[CALayer layoutSublayers] + 217
7 QuartzCore 0x321c26bd CA::Layer::layout_if_needed(CA::Transaction*) + 217
8 QuartzCore 0x321c6843 CA::Context::commit_transaction(CA::Transaction*) + 227
9 QuartzCore 0x321c657f CA::Transaction::commit() + 315
10 QuartzCore 0x3220dd01 CA::Transaction::release_thread(void*) + 37
11 libsystem_c.dylib 0x327490ff _pthread_tsd_cleanup + 171
12 libsystem_c.dylib 0x32748d7b _pthread_exit + 123
13 libsystem_c.dylib 0x3275a0f3 pthread_exit + 31
14 Foundation 0x34e3237b +[NSThread exit] + 11
15 Foundation 0x34eb65af __NSThread__main__ + 1079
16 libsystem_c.dylib 0x32756735 _pthread_start + 321
Thread 8:
0 libsystem_kernel.dylib 0x35c49cd4 __workq_kernreturn + 8
Thread 9:
0 libsystem_kernel.dylib 0x35c49cd4 __workq_kernreturn + 8
Thread 10:
0 libsystem_kernel.dylib 0x35c49cd4 __workq_kernreturn + 8
Thread 11:
0 libsystem_kernel.dylib 0x35c49cd4 __workq_kernreturn + 8
Thread 7 crashed with ARM Thread State:
r0: 0xffffffff r1: 0x00001100 r2: 0x2ffc850c r3: 0x00000000
r4: 0xbbadbeef r5: 0x00000000 r6: 0x0054b000 r7: 0x2ffc8b4c
r8: 0x0ca32800 r9: 0x3399fc2c r10: 0x2ffc8be4 r11: 0x2ffc8ebc
ip: 0x3ee8e270 sp: 0x2ffc8b40 lr: 0x35790fef pc: 0x32c7f4e2
cpsr: 0x60000030
Binary Images:
[cut cause of char limit]
I have no idea what happend, anyone an idea?
| iphone | application | crash | crash-reports | null | null | open | App Crash, no idea why
===
I trying to figure out why my App crashes sometimes on costumers devices. It doesnt matter if the device is jailbreaked or not. My App is from the AppStore. The other crashlogs are nearly the same although their crashed threads are different.
Hardware Model: iPhone3,1
Process: [the APP] [296]
Path: /var/mobile/Applications/06DF5BC5-F9C2-49EE-B2D5-5979C09B51A2/[the APP].app/[the APP]
Identifier: [the APP]
Version: 3.3.0
Code Type: ARM
Parent Process: launchd [1]
Date/Time: 2012-07-22 15:15:18 +0000
OS Version: iPhone OS 5.1.1 (9B206)
Report Version: 104
Exception Type: SIGSEGV
Exception Codes: SEGV_ACCERR at 0xbbadbeef
Crashed Thread: 7
Thread 0:
0 libsystem_kernel.dylib 0x35c39004 mach_msg_trap + 20
1 CoreFoundation 0x353673f3 __CFRunLoopServiceMachPort + 127
2 CoreFoundation 0x353660f1 __CFRunLoopRun + 825
3 CoreFoundation 0x352e94a5 CFRunLoopRunSpecific + 301
4 CoreFoundation 0x352e936d CFRunLoopRunInMode + 105
5 GraphicsServices 0x36f85439 GSEventRunModal + 137
6 UIKit 0x32df5cd5 UIApplicationMain + 1081
7 [the APP] 0x0000b549 main (main.m:20)
Thread 1:
0 libsystem_kernel.dylib 0x35c393a8 kevent + 24
1 libdispatch.dylib 0x3422cbc9 _dispatch_mgr_wakeup + 1
Thread 2:
0 libsystem_kernel.dylib 0x35c490d8 __psynch_mutexwait + 24
1 WebCore 0x311454ef _ZL17_WebTryThreadLockb + 215
2 WebCore 0x311a4173 _ZL19SendDelegateMessageP12NSInvocation + 707
3 WebKit 0x3507ad87 -[_WebSafeForwarder forwardInvocation:] + 119
4 CoreFoundation 0x35395a83 ___forwarding___ + 667
5 CoreFoundation 0x352f0650 _CF_forwarding_prep_0 + 48
6 WebKit 0x350816a1 WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction(void (WebCore::PolicyChecker::*)(WebCore::PolicyAction), WebCore::NavigationAction const&, WebCore::ResourceRequest const&, WTF::PassRefPtr) + 221
7 WebCore 0x3120b8b9 WebCore::PolicyChecker::checkNavigationPolicy(WebCore::ResourceRequest const&, WebCore::DocumentLoader*, WTF::PassRefPtr, void (*)(void*, WebCore::ResourceRequest const&, WTF::PassRefPtr, bool), void*) + 873
8 WebCore 0x3120ae4d WebCore::FrameLoader::loadWithDocumentLoader(WebCore::DocumentLoader*, WebCore::FrameLoadType, WTF::PassRefPtr) + 913
9 WebCore 0x312092b9 WebCore::FrameLoader::load(WebCore::DocumentLoader*) + 169
10 WebCore 0x312091e5 WebCore::FrameLoader::load(WebCore::ResourceRequest const&, WebCore::SubstituteData const&, bool) + 241
11 WebKit 0x350b3f5f -[WebFrame _loadData:MIMEType:textEncodingName:baseURL:unreachableURL:] + 1119
12 WebKit 0x350b3797 -[WebFrame _loadHTMLString:baseURL:unreachableURL:] + 79
13 WebKit 0x350b37bb -[WebFrame loadHTMLString:baseURL:] + 31
14 WebCore 0x311950b5 HandleRunSource + 365
15 CoreFoundation 0x35367ad3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
16 CoreFoundation 0x35367335 __CFRunLoopDoSources0 + 365
17 CoreFoundation 0x35366045 __CFRunLoopRun + 653
18 CoreFoundation 0x352e94a5 CFRunLoopRunSpecific + 301
19 CoreFoundation 0x352e936d CFRunLoopRunInMode + 105
20 WebCore 0x311e8ca3 _ZL12RunWebThreadPv + 403
21 libsystem_c.dylib 0x32756735 _pthread_start + 321
Thread 3:
0 libsystem_kernel.dylib 0x35c39004 mach_msg_trap + 20
1 CoreFoundation 0x353673f3 __CFRunLoopServiceMachPort + 127
2 CoreFoundation 0x3536612b __CFRunLoopRun + 883
3 CoreFoundation 0x352e94a5 CFRunLoopRunSpecific + 301
4 CoreFoundation 0x352e936d CFRunLoopRunInMode + 105
5 Foundation 0x34e22bb9 +[NSURLConnection(Loader) _resourceLoadLoop:] + 309
6 Foundation 0x34e22a81 -[NSThread main] + 73
7 Foundation 0x34eb6591 __NSThread__main__ + 1049
8 libsystem_c.dylib 0x32756735 _pthread_start + 321
Thread 4:
0 libsystem_kernel.dylib 0x35c49570 __select + 20
1 libsystem_c.dylib 0x32756735 _pthread_start + 321
Thread 5:
0 libsystem_kernel.dylib 0x35c39004 mach_msg_trap + 20
1 CoreFoundation 0x353673f3 __CFRunLoopServiceMachPort + 127
2 CoreFoundation 0x3536612b __CFRunLoopRun + 883
3 CoreFoundation 0x352e94a5 CFRunLoopRunSpecific + 301
4 CoreFoundation 0x352e936d CFRunLoopRunInMode + 105
5 YouTube 0x33e336c9 -[YTImageLoader(Internal) _startLoader] + 245
6 Foundation 0x34e22a81 -[NSThread main] + 73
7 Foundation 0x34eb6591 __NSThread__main__ + 1049
8 libsystem_c.dylib 0x32756735 _pthread_start + 321
Thread 6:
0 libsystem_kernel.dylib 0x35c49cd4 __workq_kernreturn + 8
Thread 7 Crashed:
0 WebCore 0x311454e2 _ZL17_WebTryThreadLockb + 202
1 WebCore 0x3114540f WebThreadLock + 55
2 UIKit 0x32e5537b -[UIWebTiledView layoutSubviews] + 43
3 UIKit 0x32e5534b -[UIWebDocumentView layoutSubviews] + 127
4 UIKit 0x32dcaf37 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 183
5 CoreFoundation 0x352f21fb -[NSObject performSelector:withObject:] + 43
6 QuartzCore 0x321c2aa5 -[CALayer layoutSublayers] + 217
7 QuartzCore 0x321c26bd CA::Layer::layout_if_needed(CA::Transaction*) + 217
8 QuartzCore 0x321c6843 CA::Context::commit_transaction(CA::Transaction*) + 227
9 QuartzCore 0x321c657f CA::Transaction::commit() + 315
10 QuartzCore 0x3220dd01 CA::Transaction::release_thread(void*) + 37
11 libsystem_c.dylib 0x327490ff _pthread_tsd_cleanup + 171
12 libsystem_c.dylib 0x32748d7b _pthread_exit + 123
13 libsystem_c.dylib 0x3275a0f3 pthread_exit + 31
14 Foundation 0x34e3237b +[NSThread exit] + 11
15 Foundation 0x34eb65af __NSThread__main__ + 1079
16 libsystem_c.dylib 0x32756735 _pthread_start + 321
Thread 8:
0 libsystem_kernel.dylib 0x35c49cd4 __workq_kernreturn + 8
Thread 9:
0 libsystem_kernel.dylib 0x35c49cd4 __workq_kernreturn + 8
Thread 10:
0 libsystem_kernel.dylib 0x35c49cd4 __workq_kernreturn + 8
Thread 11:
0 libsystem_kernel.dylib 0x35c49cd4 __workq_kernreturn + 8
Thread 7 crashed with ARM Thread State:
r0: 0xffffffff r1: 0x00001100 r2: 0x2ffc850c r3: 0x00000000
r4: 0xbbadbeef r5: 0x00000000 r6: 0x0054b000 r7: 0x2ffc8b4c
r8: 0x0ca32800 r9: 0x3399fc2c r10: 0x2ffc8be4 r11: 0x2ffc8ebc
ip: 0x3ee8e270 sp: 0x2ffc8b40 lr: 0x35790fef pc: 0x32c7f4e2
cpsr: 0x60000030
Binary Images:
[cut cause of char limit]
I have no idea what happend, anyone an idea?
| 0 |
11,650,353 | 07/25/2012 13:03:16 | 1,523,534 | 07/13/2012 12:31:34 | 25 | 0 | Getting text to speech activity to work at the same time as an onclick go to a new xml | I am working on an app and I want the app to use text to speech to tell the user what button they have just pressed. I am having problems getting my button to work properly with the two conflicting activities. I am able to make it work either doing only text to speech or only when pressing it goes to a different page, but I can't get it to do both at the same time. Currently it sends the user to the new menu without playing the text to speech but I am finally getting an error from my LogCat so I figured it is fixable. I have included my LogCat and the java. I have commented above and below where the problem code is.
07-25 12:52:35.031: E/ActivityThread(328): Activity com.example.com.proto1.menu has leaked ServiceConnection android.speech.tts.TextToSpeech$1@4051eb10 that was originally bound here
07-25 12:52:35.031: E/ActivityThread(328): android.app.ServiceConnectionLeaked: Activity com.example.com.proto1.menu has leaked ServiceConnection android.speech.tts.TextToSpeech$1@4051eb10 that was originally bound here
07-25 12:52:35.031: E/ActivityThread(328): at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:938)
07-25 12:52:35.031: E/ActivityThread(328): at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:833)
07-25 12:52:35.031: E/ActivityThread(328): at android.app.ContextImpl.bindService(ContextImpl.java:867)
07-25 12:52:35.031: E/ActivityThread(328): at android.content.ContextWrapper.bindService(ContextWrapper.java:347)
07-25 12:52:35.031: E/ActivityThread(328): at android.speech.tts.TextToSpeech.initTts(TextToSpeech.java:467)
07-25 12:52:35.031: E/ActivityThread(328): at android.speech.tts.TextToSpeech.<init>(TextToSpeech.java:433)
07-25 12:52:35.031: E/ActivityThread(328): at com.example.com.proto1.menu.onActivityResult(menu.java:122)
07-25 12:52:35.031: E/ActivityThread(328): at android.app.Activity.dispatchActivityResult(Activity.java:3908)
07-25 12:52:35.031: E/ActivityThread(328): at android.app.ActivityThread.deliverResults(ActivityThread.java:2528)
07-25 12:52:35.031: E/ActivityThread(328): at android.app.ActivityThread.handleSendResult(ActivityThread.java:2574)
07-25 12:52:35.031: E/ActivityThread(328): at android.app.ActivityThread.access$2000(ActivityThread.java:117)
07-25 12:52:35.031: E/ActivityThread(328): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:961)
07-25 12:52:35.031: E/ActivityThread(328): at android.os.Handler.dispatchMessage(Handler.java:99)
07-25 12:52:35.031: E/ActivityThread(328): at android.os.Looper.loop(Looper.java:123)
07-25 12:52:35.031: E/ActivityThread(328): at android.app.ActivityThread.main(ActivityThread.java:3683)
07-25 12:52:35.031: E/ActivityThread(328): at java.lang.reflect.Method.invokeNative(Native Method)
07-25 12:52:35.031: E/ActivityThread(328): at java.lang.reflect.Method.invoke(Method.java:507)
07-25 12:52:35.031: E/ActivityThread(328): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
07-25 12:52:35.031: E/ActivityThread(328): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
07-25 12:52:35.031: E/ActivityThread(328): at dalvik.system.NativeStart.main(Native Method)
import android.app.Activity;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.speech.RecognizerIntent;
import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.Toast;
import android.speech.tts.TextToSpeech;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
@SuppressWarnings("unused")
public class menu extends Activity implements TextToSpeech.OnInitListener,
OnClickListener {
TextToSpeech mTts;
Button speakButton;
// TTS object
public TextToSpeech myTTS;
// status check code
public int MY_DATA_CHECK_CODE = 0;
@Override
protected void onCreate(Bundle aboutmenu) {
// TODO Auto-generated method stub
super.onCreate(aboutmenu);
setContentView(R.layout.mainx);
SpeakingAndroid speak = new SpeakingAndroid();
// get a reference to the button element listed in the XML layout
speakButton = (Button) findViewById(R.id.btn_speak);
// listen for clicks
speakButton.setOnClickListener(this);
// check for TTS data
Intent checkTTSIntent = new Intent();
checkTTSIntent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);
startActivityForResult(checkTTSIntent, MY_DATA_CHECK_CODE);
// Setting up the button references
Button info = (Button) findViewById(R.id.aboutbutton);
Button voice = (Button) findViewById(R.id.voicebutton);
info.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
startActivity(new Intent("android.intent.action.INFOSCREEN"));
}
});
voice.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
try {
} catch (Exception e) {
}
}
});
// This is the start of the problem area
starteyephone();
{
speakButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
Intent voiceIntent = new Intent(
"android.intent.action.RECOGNITIONMENU");
startActivity(voiceIntent);
}
});
}
}
private void starteyephone() {
// TODO Auto-generated method stub
}
// respond to button clicks
public void onClick(View v) {
// get the text entered
speakButton = (Button) findViewById(R.id.btn_speak);
String words = speakButton.getText().toString();
speakWords(words);
}
//this is the end of the problem area
// speak the user text
public void speakWords(String speech) {
// speak straight away
myTTS.speak(speech, TextToSpeech.QUEUE_FLUSH, null);
}
// act on result of TTS data check
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == MY_DATA_CHECK_CODE) {
if (resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_PASS) {
// the user has the necessary data - create the TTS
myTTS = new TextToSpeech(this, this);
} else {
// no data - install it now
Intent installTTSIntent = new Intent();
installTTSIntent
.setAction(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);
startActivity(installTTSIntent);
}
}
}
// setup TTS
public void onInit(int initStatus) {
// check for successful instantiation
if (initStatus == TextToSpeech.SUCCESS) {
if (myTTS.isLanguageAvailable(Locale.US) == TextToSpeech.LANG_AVAILABLE)
myTTS.setLanguage(Locale.US);
} else if (initStatus == TextToSpeech.ERROR) {
Toast.makeText(this, "Sorry! Text To Speech failed...",
Toast.LENGTH_LONG).show();
}
}
}
| java | android | android-activity | null | null | null | open | Getting text to speech activity to work at the same time as an onclick go to a new xml
===
I am working on an app and I want the app to use text to speech to tell the user what button they have just pressed. I am having problems getting my button to work properly with the two conflicting activities. I am able to make it work either doing only text to speech or only when pressing it goes to a different page, but I can't get it to do both at the same time. Currently it sends the user to the new menu without playing the text to speech but I am finally getting an error from my LogCat so I figured it is fixable. I have included my LogCat and the java. I have commented above and below where the problem code is.
07-25 12:52:35.031: E/ActivityThread(328): Activity com.example.com.proto1.menu has leaked ServiceConnection android.speech.tts.TextToSpeech$1@4051eb10 that was originally bound here
07-25 12:52:35.031: E/ActivityThread(328): android.app.ServiceConnectionLeaked: Activity com.example.com.proto1.menu has leaked ServiceConnection android.speech.tts.TextToSpeech$1@4051eb10 that was originally bound here
07-25 12:52:35.031: E/ActivityThread(328): at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:938)
07-25 12:52:35.031: E/ActivityThread(328): at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:833)
07-25 12:52:35.031: E/ActivityThread(328): at android.app.ContextImpl.bindService(ContextImpl.java:867)
07-25 12:52:35.031: E/ActivityThread(328): at android.content.ContextWrapper.bindService(ContextWrapper.java:347)
07-25 12:52:35.031: E/ActivityThread(328): at android.speech.tts.TextToSpeech.initTts(TextToSpeech.java:467)
07-25 12:52:35.031: E/ActivityThread(328): at android.speech.tts.TextToSpeech.<init>(TextToSpeech.java:433)
07-25 12:52:35.031: E/ActivityThread(328): at com.example.com.proto1.menu.onActivityResult(menu.java:122)
07-25 12:52:35.031: E/ActivityThread(328): at android.app.Activity.dispatchActivityResult(Activity.java:3908)
07-25 12:52:35.031: E/ActivityThread(328): at android.app.ActivityThread.deliverResults(ActivityThread.java:2528)
07-25 12:52:35.031: E/ActivityThread(328): at android.app.ActivityThread.handleSendResult(ActivityThread.java:2574)
07-25 12:52:35.031: E/ActivityThread(328): at android.app.ActivityThread.access$2000(ActivityThread.java:117)
07-25 12:52:35.031: E/ActivityThread(328): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:961)
07-25 12:52:35.031: E/ActivityThread(328): at android.os.Handler.dispatchMessage(Handler.java:99)
07-25 12:52:35.031: E/ActivityThread(328): at android.os.Looper.loop(Looper.java:123)
07-25 12:52:35.031: E/ActivityThread(328): at android.app.ActivityThread.main(ActivityThread.java:3683)
07-25 12:52:35.031: E/ActivityThread(328): at java.lang.reflect.Method.invokeNative(Native Method)
07-25 12:52:35.031: E/ActivityThread(328): at java.lang.reflect.Method.invoke(Method.java:507)
07-25 12:52:35.031: E/ActivityThread(328): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
07-25 12:52:35.031: E/ActivityThread(328): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
07-25 12:52:35.031: E/ActivityThread(328): at dalvik.system.NativeStart.main(Native Method)
import android.app.Activity;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.speech.RecognizerIntent;
import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.Toast;
import android.speech.tts.TextToSpeech;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
@SuppressWarnings("unused")
public class menu extends Activity implements TextToSpeech.OnInitListener,
OnClickListener {
TextToSpeech mTts;
Button speakButton;
// TTS object
public TextToSpeech myTTS;
// status check code
public int MY_DATA_CHECK_CODE = 0;
@Override
protected void onCreate(Bundle aboutmenu) {
// TODO Auto-generated method stub
super.onCreate(aboutmenu);
setContentView(R.layout.mainx);
SpeakingAndroid speak = new SpeakingAndroid();
// get a reference to the button element listed in the XML layout
speakButton = (Button) findViewById(R.id.btn_speak);
// listen for clicks
speakButton.setOnClickListener(this);
// check for TTS data
Intent checkTTSIntent = new Intent();
checkTTSIntent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);
startActivityForResult(checkTTSIntent, MY_DATA_CHECK_CODE);
// Setting up the button references
Button info = (Button) findViewById(R.id.aboutbutton);
Button voice = (Button) findViewById(R.id.voicebutton);
info.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
startActivity(new Intent("android.intent.action.INFOSCREEN"));
}
});
voice.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
try {
} catch (Exception e) {
}
}
});
// This is the start of the problem area
starteyephone();
{
speakButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
Intent voiceIntent = new Intent(
"android.intent.action.RECOGNITIONMENU");
startActivity(voiceIntent);
}
});
}
}
private void starteyephone() {
// TODO Auto-generated method stub
}
// respond to button clicks
public void onClick(View v) {
// get the text entered
speakButton = (Button) findViewById(R.id.btn_speak);
String words = speakButton.getText().toString();
speakWords(words);
}
//this is the end of the problem area
// speak the user text
public void speakWords(String speech) {
// speak straight away
myTTS.speak(speech, TextToSpeech.QUEUE_FLUSH, null);
}
// act on result of TTS data check
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == MY_DATA_CHECK_CODE) {
if (resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_PASS) {
// the user has the necessary data - create the TTS
myTTS = new TextToSpeech(this, this);
} else {
// no data - install it now
Intent installTTSIntent = new Intent();
installTTSIntent
.setAction(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);
startActivity(installTTSIntent);
}
}
}
// setup TTS
public void onInit(int initStatus) {
// check for successful instantiation
if (initStatus == TextToSpeech.SUCCESS) {
if (myTTS.isLanguageAvailable(Locale.US) == TextToSpeech.LANG_AVAILABLE)
myTTS.setLanguage(Locale.US);
} else if (initStatus == TextToSpeech.ERROR) {
Toast.makeText(this, "Sorry! Text To Speech failed...",
Toast.LENGTH_LONG).show();
}
}
}
| 0 |
11,650,354 | 07/25/2012 13:03:29 | 328,146 | 04/28/2010 17:29:31 | 435 | 9 | Preparing a regular expression for javascript | I have made this regular expression which does exactly what I want when I test it in e.g. RegExr:
^https?:\/\/(www\.)?(test\.yahoo\.com|sub\.yahoo\.com)?(?!([a-z0-9]+\.)?(localhost|yahoo\.com))(.*)?
However when I test it in javascript it says that the expression is invalid. After hours of debugging I found out that this expression works in javascript:
^https?:\/\/(www\.)?(test\.yahoo\.com|sub\.yahoo\.com)?(?![a-z0-9]+\.)?(localhost|yahoo\.com)(.*)?
However this doesn't do what I want (again testing in RegExr).
Why cannot I use the first expression in javascript? And how do I fix it? | javascript | regex | null | null | null | null | open | Preparing a regular expression for javascript
===
I have made this regular expression which does exactly what I want when I test it in e.g. RegExr:
^https?:\/\/(www\.)?(test\.yahoo\.com|sub\.yahoo\.com)?(?!([a-z0-9]+\.)?(localhost|yahoo\.com))(.*)?
However when I test it in javascript it says that the expression is invalid. After hours of debugging I found out that this expression works in javascript:
^https?:\/\/(www\.)?(test\.yahoo\.com|sub\.yahoo\.com)?(?![a-z0-9]+\.)?(localhost|yahoo\.com)(.*)?
However this doesn't do what I want (again testing in RegExr).
Why cannot I use the first expression in javascript? And how do I fix it? | 0 |
11,650,355 | 07/25/2012 13:03:31 | 995,689 | 10/14/2011 15:35:09 | 86 | 0 | mysql foreign key relationship | I am creating a database using mysql - latest version, and phpmyadmin. I have 3 tables, operator_name, operator_main_address and operator_satellites. All the tables are Innodb.
I need to create a relationship so that an entry in the operator_name table can find a)the main address and b)the address details for any satellites as stored in the operator_satellites.
| mysql | phpmyadmin | foreign-keys | null | null | null | open | mysql foreign key relationship
===
I am creating a database using mysql - latest version, and phpmyadmin. I have 3 tables, operator_name, operator_main_address and operator_satellites. All the tables are Innodb.
I need to create a relationship so that an entry in the operator_name table can find a)the main address and b)the address details for any satellites as stored in the operator_satellites.
| 0 |
11,650,339 | 07/25/2012 13:02:17 | 696,028 | 04/07/2011 04:00:28 | 1 | 0 | Find perpendicular line and its intersection to a rectangle | I have three points A, B & C and a rectangle as shown below. I want to know the x,y coordinate where a line from A would intersect the rectangle given that it must also be perpendicular to a line from BC. I know how to find the point on BC that the line would intercept but I can't seem to figure out how to extend a line from there to find the point it would intercept the rectangle.
[Illustration][1]
Here is the code I'm using to find the BC intercept.
double k = ((By - Cy) * (Ax - Cx) - (Bx - Cx) * (Ay - Cy)) / ((By - Cy) * (By - Cy) + (Bx - Cx) * (Bx - Cx));
double Dx = Ax - k * (By - Cy);
double Dy = Ay + k * (Bx - Cx);
How can I extend Dx and Dy out to intercept the rectangle?
[1]: http://imgur.com/vkHSs | c# | math | null | null | null | null | open | Find perpendicular line and its intersection to a rectangle
===
I have three points A, B & C and a rectangle as shown below. I want to know the x,y coordinate where a line from A would intersect the rectangle given that it must also be perpendicular to a line from BC. I know how to find the point on BC that the line would intercept but I can't seem to figure out how to extend a line from there to find the point it would intercept the rectangle.
[Illustration][1]
Here is the code I'm using to find the BC intercept.
double k = ((By - Cy) * (Ax - Cx) - (Bx - Cx) * (Ay - Cy)) / ((By - Cy) * (By - Cy) + (Bx - Cx) * (Bx - Cx));
double Dx = Ax - k * (By - Cy);
double Dy = Ay + k * (Bx - Cx);
How can I extend Dx and Dy out to intercept the rectangle?
[1]: http://imgur.com/vkHSs | 0 |
11,650,361 | 07/25/2012 13:03:52 | 1,407,132 | 05/21/2012 05:47:36 | 12 | 0 | How to set parameters for a Named Query | Hi I have a Named Query @NamedQuery(name = "StudyplanCategory.findByStatusAndLimit", query = "SELECT s FROM StudyplanCategory s WHERE s.status =:status LIMIT s.start=:start,s.end=end")
I want to set the limit like this:
@NamedQuery(name = "StudyplanCategory.findByStatusAndLimit", query = "SELECT s FROM StudyplanCategory s WHERE s.status =:status LIMIT s.start=:start,s.end=end")
But this is showing error at the start up of the Server.
I am using the below code to in the DAO class:
Query query = entityManager.createNamedQuery("StudyplanCategory.findByStatusAndLimit");
int end=(start*pageNumber);
query.setParameter("status", status);
query.setParameter("start", start);
query.setParameter("end", end);
return (List<StudyplanCategory>) query.getResultList();
Start and End Parameters needs to be set. Please Help.
| hibernate | jpa | jsf-2.0 | primefaces | null | null | open | How to set parameters for a Named Query
===
Hi I have a Named Query @NamedQuery(name = "StudyplanCategory.findByStatusAndLimit", query = "SELECT s FROM StudyplanCategory s WHERE s.status =:status LIMIT s.start=:start,s.end=end")
I want to set the limit like this:
@NamedQuery(name = "StudyplanCategory.findByStatusAndLimit", query = "SELECT s FROM StudyplanCategory s WHERE s.status =:status LIMIT s.start=:start,s.end=end")
But this is showing error at the start up of the Server.
I am using the below code to in the DAO class:
Query query = entityManager.createNamedQuery("StudyplanCategory.findByStatusAndLimit");
int end=(start*pageNumber);
query.setParameter("status", status);
query.setParameter("start", start);
query.setParameter("end", end);
return (List<StudyplanCategory>) query.getResultList();
Start and End Parameters needs to be set. Please Help.
| 0 |
11,642,267 | 07/25/2012 03:29:22 | 128,860 | 06/25/2009 14:05:08 | 377 | 0 | How to you style a asp.net mvc button two different ways using span? | I have button like so:
<button type="submit" name="button1" value="1" style="text-decoration: none; cursor: pointer; font-size: 20px;">Line 1 <br /><span class="blue">line 2</span></button>
and my css:
.blue { color: blue;}
But its not applying the second css style, any ideas, is this possible? | asp.net | asp.net-mvc-3 | css3 | null | null | null | open | How to you style a asp.net mvc button two different ways using span?
===
I have button like so:
<button type="submit" name="button1" value="1" style="text-decoration: none; cursor: pointer; font-size: 20px;">Line 1 <br /><span class="blue">line 2</span></button>
and my css:
.blue { color: blue;}
But its not applying the second css style, any ideas, is this possible? | 0 |
11,327,385 | 07/04/2012 10:36:30 | 53,300 | 01/09/2009 11:44:24 | 1,395 | 100 | Advice needed in debugging JAXB / JBOSS behaviour | I am using Spring WebServiceTemplate.marshallSendAndReceive() to communicate with a Web Service.
If I run my code outside of an application server, it works correctly. If I run it _inside_ my Application Server ( JBOSS EPP ) the marshalling produces markedly different results.
The expected XML looks something like
<root>
<element1/>
</root>
When I run in the AppServer I get something like
<root/>
That is, my child element is not created and attached to my root element.
I'm assuming that this is related to JAXB, but when I debug the code, my JAXBContext appears to come from the same jar file both in the app server and outside it.
Are there any other dependencies I need to be aware of and can influence?
Thanks
Dave | java | spring | jboss | jaxb | null | null | open | Advice needed in debugging JAXB / JBOSS behaviour
===
I am using Spring WebServiceTemplate.marshallSendAndReceive() to communicate with a Web Service.
If I run my code outside of an application server, it works correctly. If I run it _inside_ my Application Server ( JBOSS EPP ) the marshalling produces markedly different results.
The expected XML looks something like
<root>
<element1/>
</root>
When I run in the AppServer I get something like
<root/>
That is, my child element is not created and attached to my root element.
I'm assuming that this is related to JAXB, but when I debug the code, my JAXBContext appears to come from the same jar file both in the app server and outside it.
Are there any other dependencies I need to be aware of and can influence?
Thanks
Dave | 0 |
11,327,386 | 07/04/2012 10:36:32 | 396,187 | 07/19/2010 20:16:05 | 5 | 2 | App distribution through website ...? | I have seen that few web sites , give an ipa and that ipa install to any iPhone device .. how it is possible Is there any way that my ipa could install to any iPhone device . without app store ? | iphone | xcode | ipad | apple | null | null | open | App distribution through website ...?
===
I have seen that few web sites , give an ipa and that ipa install to any iPhone device .. how it is possible Is there any way that my ipa could install to any iPhone device . without app store ? | 0 |
11,327,363 | 07/04/2012 10:35:13 | 1,501,070 | 07/04/2012 09:05:26 | 1 | 0 | Customizing Call screen to override the default one in android? | I have created Broadcast receiver
<receiver android:name=".IncomingBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.PHONE_STATE"></action>
</intent-filter>
</receiver>
declared it in manifest file and On receive of the broadcast receiver i have called an activity to display in front of the default call screen.
But The default call screen pushs my activity backwards. Is there any option to make activity foreground by replacing default call screen .
One more question , in Contacts of android an gif image can be assigned as an contact icon to a contact. But on Receiving the call, the Gif image won't get played. It is still.
Do you know the reason? | android | android-intent | android-contacts | null | null | null | open | Customizing Call screen to override the default one in android?
===
I have created Broadcast receiver
<receiver android:name=".IncomingBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.PHONE_STATE"></action>
</intent-filter>
</receiver>
declared it in manifest file and On receive of the broadcast receiver i have called an activity to display in front of the default call screen.
But The default call screen pushs my activity backwards. Is there any option to make activity foreground by replacing default call screen .
One more question , in Contacts of android an gif image can be assigned as an contact icon to a contact. But on Receiving the call, the Gif image won't get played. It is still.
Do you know the reason? | 0 |
11,327,390 | 07/04/2012 10:36:55 | 1,439,143 | 06/06/2012 07:43:38 | 8 | 4 | The perfect way to validate and test Rails 3 associations (using RSpec/Remarkable)? | I'm still pretty new to testing in Rails 3, and I use RSpec and Remarkable. I read through a lot of posts and some books already, but I'm still kind of stuck in uncertainty when to use the association's name, when its ID.
class Project < ActiveRecord::Base
has_many :tasks
end
class Task < ActiveRecord::Base
belongs_to :project
end
Because of good practice, I want to protect my attributes from mass assignments:
class Task < ActiveRecord::Base
attr_accessible :project # Or is it :project_id??
belongs_to :project
end
First of all, I want to make sure that a project **never** exists without a valid task:
class Task < ActiveRecord::Base
validates :project, :presence => true # Which one is the...
validates :project_id, :presence => true # ...right way to go??
end
I also want to make sure that the assigned project or project ID is always valid:
class Task < ActiveRecord::Base
validates :project, :associated => true # Again, which one is...
validates :project_id, :associated => true # ...the right way to go?
end
...and do I need the validation on :presence when I use :associated??
Thanks a lot for clarifying, it seems that after hours of reading and trying to test stuff using RSpec/Shoulda/Remarkable I don't see the forest because of all the trees anymore... | ruby-on-rails | validation | null | null | null | null | open | The perfect way to validate and test Rails 3 associations (using RSpec/Remarkable)?
===
I'm still pretty new to testing in Rails 3, and I use RSpec and Remarkable. I read through a lot of posts and some books already, but I'm still kind of stuck in uncertainty when to use the association's name, when its ID.
class Project < ActiveRecord::Base
has_many :tasks
end
class Task < ActiveRecord::Base
belongs_to :project
end
Because of good practice, I want to protect my attributes from mass assignments:
class Task < ActiveRecord::Base
attr_accessible :project # Or is it :project_id??
belongs_to :project
end
First of all, I want to make sure that a project **never** exists without a valid task:
class Task < ActiveRecord::Base
validates :project, :presence => true # Which one is the...
validates :project_id, :presence => true # ...right way to go??
end
I also want to make sure that the assigned project or project ID is always valid:
class Task < ActiveRecord::Base
validates :project, :associated => true # Again, which one is...
validates :project_id, :associated => true # ...the right way to go?
end
...and do I need the validation on :presence when I use :associated??
Thanks a lot for clarifying, it seems that after hours of reading and trying to test stuff using RSpec/Shoulda/Remarkable I don't see the forest because of all the trees anymore... | 0 |
11,327,391 | 07/04/2012 10:36:55 | 1,501,183 | 07/04/2012 09:47:32 | 1 | 0 | Glassfish-3.1.2 - Can I inject EntityManger into a stateless bean | I came across this blog below, concerning Servlets and injecting EJBs into them.
The author is writing from a standards point-of-view.
http://tamanmohamed.blogspot.ie/2012/03/jpa-why-we-need-to-specifies-type-level.html
http://tamanmohamed.blogspot.ie/2012/03/jpa-thread-safety-when-injecting.html
"injecting EJB 3 stateful beans into servlet instance fields is not thread-safe. Along the same line, injecting EntityManager with @PersistenceContext into servlet instance variables is not thread-safe, either. EntityManager is just not designed to be thread-safe."
Anyhow, I am starting to get worried about the code I'm writing with a colleague in the
Glassfish-3.1.2 implementation. See below.
I thought it was similar to code I've seen in Duke tutoring tutorial so it should be o.k.
(where FaceServlets call a stateless Request bean with @PersistnceContext EntityManager.)
However I guess I'm assuming the container-managed EntityManager is capable of coping
with lots of concurrent calls of a stateless bean called by many instances of servlets.
Is this a correct assumption for Glassfish-3.1.2 with an Oracle database ? It seems to work fine so far, but maybe it won't under heavy loads.
thanks in advance for any insights. Sorry I'm such a newby to this.
Fiona
Servlet
{
@EJB
private StatelessbeanBlah
:
}
@Stateless
StatelessBeanBlah
{
@PersistenceContext(unitname = "...")
private EntityManager em;
| concurrency | glassfish | stateless | null | null | null | open | Glassfish-3.1.2 - Can I inject EntityManger into a stateless bean
===
I came across this blog below, concerning Servlets and injecting EJBs into them.
The author is writing from a standards point-of-view.
http://tamanmohamed.blogspot.ie/2012/03/jpa-why-we-need-to-specifies-type-level.html
http://tamanmohamed.blogspot.ie/2012/03/jpa-thread-safety-when-injecting.html
"injecting EJB 3 stateful beans into servlet instance fields is not thread-safe. Along the same line, injecting EntityManager with @PersistenceContext into servlet instance variables is not thread-safe, either. EntityManager is just not designed to be thread-safe."
Anyhow, I am starting to get worried about the code I'm writing with a colleague in the
Glassfish-3.1.2 implementation. See below.
I thought it was similar to code I've seen in Duke tutoring tutorial so it should be o.k.
(where FaceServlets call a stateless Request bean with @PersistnceContext EntityManager.)
However I guess I'm assuming the container-managed EntityManager is capable of coping
with lots of concurrent calls of a stateless bean called by many instances of servlets.
Is this a correct assumption for Glassfish-3.1.2 with an Oracle database ? It seems to work fine so far, but maybe it won't under heavy loads.
thanks in advance for any insights. Sorry I'm such a newby to this.
Fiona
Servlet
{
@EJB
private StatelessbeanBlah
:
}
@Stateless
StatelessBeanBlah
{
@PersistenceContext(unitname = "...")
private EntityManager em;
| 0 |
11,327,395 | 07/04/2012 10:37:11 | 1,501,234 | 07/04/2012 10:03:44 | 1 | 0 | What is a Google App Engine instance? | I am trying to estimate the monthly costs for having GAE for in-app store and I do not really understand what is an instance and what can I do within one instance.
Can I just have one instance with multiple threads to deal with multiple clients? And as I have 28 hours of free instance per app per day (http://cloud.google.com/pricing/), does it mean that I would not pay for my server app running all the time? | google-app-engine | null | null | null | null | null | open | What is a Google App Engine instance?
===
I am trying to estimate the monthly costs for having GAE for in-app store and I do not really understand what is an instance and what can I do within one instance.
Can I just have one instance with multiple threads to deal with multiple clients? And as I have 28 hours of free instance per app per day (http://cloud.google.com/pricing/), does it mean that I would not pay for my server app running all the time? | 0 |
11,327,354 | 07/04/2012 10:35:02 | 105,223 | 05/12/2009 08:19:25 | 550 | 18 | YUI2 ColorPicker default value issue | I'm using the YUI2 [colour picker][1] on a project that I'm working on in order to provide colour scheme changing functionality. I'm setting the default rgb value of each colour picker to the current rgb value of an element of the colour scheme.
The rgb value that the picker holds is fine, however the Hue Slider and Picker Slider are not updating to reflect this. Whenever the colour picker appears the hue and picker are set to 0 and ffffff respectively.
I've searched through the documentation and tried a few likely methods that might update the hue/picker slider appropriately, with no luck.
Any advice would be greatly appreciated
[1]: http://developer.yahoo.com/yui/colorpicker/ | javascript | yui | color-picker | null | null | null | open | YUI2 ColorPicker default value issue
===
I'm using the YUI2 [colour picker][1] on a project that I'm working on in order to provide colour scheme changing functionality. I'm setting the default rgb value of each colour picker to the current rgb value of an element of the colour scheme.
The rgb value that the picker holds is fine, however the Hue Slider and Picker Slider are not updating to reflect this. Whenever the colour picker appears the hue and picker are set to 0 and ffffff respectively.
I've searched through the documentation and tried a few likely methods that might update the hue/picker slider appropriately, with no luck.
Any advice would be greatly appreciated
[1]: http://developer.yahoo.com/yui/colorpicker/ | 0 |
11,327,355 | 07/04/2012 10:35:07 | 1,363,169 | 04/28/2012 17:12:21 | 13 | 0 | how do I import an excel data into an existing mysql table with php | I am working on a project, where the users can create a new contact group as well as be able to update existing ones with excel data.
creating a new contact group is not the problem, but inserting the content of the document into the database has been a major problem for me.
or which format can be imported easily into the database with php.
any advice, suggestion or direction will be appreciated. | php | mysql | null | null | null | null | open | how do I import an excel data into an existing mysql table with php
===
I am working on a project, where the users can create a new contact group as well as be able to update existing ones with excel data.
creating a new contact group is not the problem, but inserting the content of the document into the database has been a major problem for me.
or which format can be imported easily into the database with php.
any advice, suggestion or direction will be appreciated. | 0 |
11,327,357 | 07/04/2012 10:35:11 | 512,663 | 11/18/2010 19:54:43 | 29 | 0 | How can I have ratings and user engagements? | [My Facebook app][1] has these status:
- App Detail Page Status: Live
- App Center Listing Status: Unlisted.
About the App Center Listing Status:
> it does not have enough high ratings and user engagement to be listed
> in the App Center.
If I visit the [app Web Preview][2], I see 3 installs, but I don't see a start rating or similar. My question is: **How can I get user ratings?**
Thanks in advance! :)
[1]: https://www.facebook.com/appcenter/234297550006822
[2]: https://www.facebook.com/appcenter/234297550006822
[3]: https://www.facebook.com/appcenter/finderous?fb_source=appcenter | facebook | center | null | null | null | null | open | How can I have ratings and user engagements?
===
[My Facebook app][1] has these status:
- App Detail Page Status: Live
- App Center Listing Status: Unlisted.
About the App Center Listing Status:
> it does not have enough high ratings and user engagement to be listed
> in the App Center.
If I visit the [app Web Preview][2], I see 3 installs, but I don't see a start rating or similar. My question is: **How can I get user ratings?**
Thanks in advance! :)
[1]: https://www.facebook.com/appcenter/234297550006822
[2]: https://www.facebook.com/appcenter/234297550006822
[3]: https://www.facebook.com/appcenter/finderous?fb_source=appcenter | 0 |
11,327,397 | 07/04/2012 10:37:17 | 357,355 | 06/03/2010 10:32:25 | 361 | 30 | Concating String Array with semicolons | It is a patter that quite often occurs in one part of our Framework.
Given an Array of Strings, we have to concat all of them, seperated by Semicolons.
I´d like to know in which ellegant way it can be done.
I`ve seen some variations across our codebase, and always, when i have to to this, i have to rethink again.
My current patter is this:
String[] values = new String[] {"a","b","c","d"};
String concat = String.Empty;
foreach(String s in values)
{
if(String.IsEmptyOrNullString(s) == false)
concat + = ", ";
concat += s;
}
What negs me is the if statement, i could insert the first item before the loop and start with an for loop, starting at index 1, but this doesn´t increase the readability.
What are your suggestions? | c# | design-patterns | null | null | null | null | open | Concating String Array with semicolons
===
It is a patter that quite often occurs in one part of our Framework.
Given an Array of Strings, we have to concat all of them, seperated by Semicolons.
I´d like to know in which ellegant way it can be done.
I`ve seen some variations across our codebase, and always, when i have to to this, i have to rethink again.
My current patter is this:
String[] values = new String[] {"a","b","c","d"};
String concat = String.Empty;
foreach(String s in values)
{
if(String.IsEmptyOrNullString(s) == false)
concat + = ", ";
concat += s;
}
What negs me is the if statement, i could insert the first item before the loop and start with an for loop, starting at index 1, but this doesn´t increase the readability.
What are your suggestions? | 0 |
11,327,384 | 07/04/2012 10:36:29 | 1,500,976 | 07/04/2012 08:34:29 | 1 | 0 | Stored procedure -- Query | Declare @mydatetime datetime
Select @mydatetime = getdate()
SELECT d.ID, d.DeviceID, d.EmployeeID, e1.firstname,e1.lastname,
d.dnno,d.FromDate, d.ToDate, d.ProjectID, d.TypeID ,d.active, d.statusdate, d.siteindex
from
PEmployee e1
INNER JOIN
(SELECT d1.ID, d1.DeviceID, d1.EmployeeID, d2.dnno,d1.FromDate, d1.ToDate,
d1.ProjectID, d1.TypeID, d2.active, d2.statusdate, d2.siteindex
FROM
PDEmployee d1,PMEmployee d2
where
d1.deviceid=d2.id
and d1.fromdate <=@mydatetime
and d1.Todate>=@mydatetime) as d
on d.EmployeeID = e1
I need to modify above stored procedure.
IN present output dnno also column displaying.
I need to match with this dnno column with new table dnno column and to display another x column from newtable.
While matching The existed dnno column with new table dnno column (so many records is there in newtable with that existed dnno column). I want top1 record only(that record is having x column also ) I want to display that x column with main output.
For ex:
the above output In row dnno values is 132444
select x,DnNo from newtable where DnNo = '132444'(Iam getting multiple records)
I need to display top 1 x column value.
my required output is :
col1, col2,col3,....,dnno,x
| sql | sql-server | null | null | null | null | open | Stored procedure -- Query
===
Declare @mydatetime datetime
Select @mydatetime = getdate()
SELECT d.ID, d.DeviceID, d.EmployeeID, e1.firstname,e1.lastname,
d.dnno,d.FromDate, d.ToDate, d.ProjectID, d.TypeID ,d.active, d.statusdate, d.siteindex
from
PEmployee e1
INNER JOIN
(SELECT d1.ID, d1.DeviceID, d1.EmployeeID, d2.dnno,d1.FromDate, d1.ToDate,
d1.ProjectID, d1.TypeID, d2.active, d2.statusdate, d2.siteindex
FROM
PDEmployee d1,PMEmployee d2
where
d1.deviceid=d2.id
and d1.fromdate <=@mydatetime
and d1.Todate>=@mydatetime) as d
on d.EmployeeID = e1
I need to modify above stored procedure.
IN present output dnno also column displaying.
I need to match with this dnno column with new table dnno column and to display another x column from newtable.
While matching The existed dnno column with new table dnno column (so many records is there in newtable with that existed dnno column). I want top1 record only(that record is having x column also ) I want to display that x column with main output.
For ex:
the above output In row dnno values is 132444
select x,DnNo from newtable where DnNo = '132444'(Iam getting multiple records)
I need to display top 1 x column value.
my required output is :
col1, col2,col3,....,dnno,x
| 0 |
11,364,813 | 07/06/2012 15:06:03 | 1,084,911 | 12/07/2011 04:54:39 | 1 | 0 | Hiding System.out.println until admin logs in | So I am a beginner to the Java world, I know some syntax and can make simple programs but that is about it. So I have an assignment which is 90% complete. Its a bookstore with the options Register - Sign in - View Books - View Purchase History. I have completed these but the one I am stuck on is the administrative capabilites.
What was asked of us was if someone signs in using the admin username then 2 more options in the menu should become visible. So as it stands it would be pretty much like this.
1. Register
2. Sign In
3. View Books
4. View History
5. Quit
In my Sign in method after the user enters in the username I figure do a
If(username!="admin")
"Continue as a normal user"
else
display original menu with the 2 new menus like so
1. Register
2. Sign Out
3. View Books
4. View History
5. Manager Users
6. Manage books
7. End
So my problem is how to hide these 2 options or display them when an admin signs in.
Now I do not want anyone to do this for me, but any type of guidence would be great.
Thanks in advance.
Brandon | java | netbeans | null | null | null | null | open | Hiding System.out.println until admin logs in
===
So I am a beginner to the Java world, I know some syntax and can make simple programs but that is about it. So I have an assignment which is 90% complete. Its a bookstore with the options Register - Sign in - View Books - View Purchase History. I have completed these but the one I am stuck on is the administrative capabilites.
What was asked of us was if someone signs in using the admin username then 2 more options in the menu should become visible. So as it stands it would be pretty much like this.
1. Register
2. Sign In
3. View Books
4. View History
5. Quit
In my Sign in method after the user enters in the username I figure do a
If(username!="admin")
"Continue as a normal user"
else
display original menu with the 2 new menus like so
1. Register
2. Sign Out
3. View Books
4. View History
5. Manager Users
6. Manage books
7. End
So my problem is how to hide these 2 options or display them when an admin signs in.
Now I do not want anyone to do this for me, but any type of guidence would be great.
Thanks in advance.
Brandon | 0 |
11,372,755 | 07/07/2012 06:12:34 | 82,985 | 03/26/2009 07:47:23 | 901 | 9 | Adobe AIR - Unable to build a valid certificate chain for the signer | I purchased a p12 certificate but am having difficulty using it. I always get the following error when trying to sign my app:
*Error creating AIR file: Unable to build a valid certificate chain for the signer.*
![screenshot][1]
**This is not an issue when I sign the app with a self-signed certificate.**
I'm trying to sign a .air file for the desktop. I'm on Mac OSX. Is there anything I must do before using the p12 file?
I have previously (2 years back) purchased a p12 key from the same provider and that one did not have any issue. That key has expired now though.
[1]: http://i.stack.imgur.com/OpONC.png | flex | air | certificate | certificates | null | null | open | Adobe AIR - Unable to build a valid certificate chain for the signer
===
I purchased a p12 certificate but am having difficulty using it. I always get the following error when trying to sign my app:
*Error creating AIR file: Unable to build a valid certificate chain for the signer.*
![screenshot][1]
**This is not an issue when I sign the app with a self-signed certificate.**
I'm trying to sign a .air file for the desktop. I'm on Mac OSX. Is there anything I must do before using the p12 file?
I have previously (2 years back) purchased a p12 key from the same provider and that one did not have any issue. That key has expired now though.
[1]: http://i.stack.imgur.com/OpONC.png | 0 |
11,372,756 | 07/07/2012 06:12:48 | 1,074,179 | 11/30/2011 20:17:05 | 482 | 6 | Is there a way to read skype chat history using API | I need to write a webpart (in sharepoint 2010) which will be able to read skype chat history. To achieve this goal I have to use skype API. Is it possible? | c# | api | sharepoint | sharepoint2010 | skype | null | open | Is there a way to read skype chat history using API
===
I need to write a webpart (in sharepoint 2010) which will be able to read skype chat history. To achieve this goal I have to use skype API. Is it possible? | 0 |
11,372,757 | 07/07/2012 06:13:34 | 219,111 | 11/26/2009 04:26:29 | 146 | 3 | How to hide the keyboard that pops up in RubyMotion? | How does one hide the virtual keyboard that pops up in a text field?
The button that hides it does not seem to appear and in my case, the next screen that loads (which does not have a text field) will still have the keyboard in the loaded position.
Thanks! | rubymotion | null | null | null | null | null | open | How to hide the keyboard that pops up in RubyMotion?
===
How does one hide the virtual keyboard that pops up in a text field?
The button that hides it does not seem to appear and in my case, the next screen that loads (which does not have a text field) will still have the keyboard in the loaded position.
Thanks! | 0 |
11,372,808 | 07/07/2012 06:24:02 | 1,508,344 | 07/07/2012 06:17:35 | 1 | 0 | C# Priority List | I'm having trouble finding the right C# data structure. I'm looking for a PriorityList<int priority, T item>. It needs to have the following:
- Only one item a given priority
- Must remain sorted at all times
- Ability to add an item to the end of the list -- prorityList.Add(item)
- Ability to insert an item at a given priority -- priorityList.Add(3, item)
- Ability to access any element using the priority -- priorityList[3]
- Ability to remove an item at a given priority -- priorityList.RemoveAt(3)
- When an item is added or removed, the rest of the list must shift up or down appropriately -- for example, if the third item is removed, the fourth item becomes the third item, the fifth item becomes the fourth item, etc.
C#'s SortedList looked promising, but it can't handle inserting at a priority that already exists or removing an element at a given priority (having the list shift appropriately in both cases). | c# | data-structures | null | null | null | null | open | C# Priority List
===
I'm having trouble finding the right C# data structure. I'm looking for a PriorityList<int priority, T item>. It needs to have the following:
- Only one item a given priority
- Must remain sorted at all times
- Ability to add an item to the end of the list -- prorityList.Add(item)
- Ability to insert an item at a given priority -- priorityList.Add(3, item)
- Ability to access any element using the priority -- priorityList[3]
- Ability to remove an item at a given priority -- priorityList.RemoveAt(3)
- When an item is added or removed, the rest of the list must shift up or down appropriately -- for example, if the third item is removed, the fourth item becomes the third item, the fifth item becomes the fourth item, etc.
C#'s SortedList looked promising, but it can't handle inserting at a priority that already exists or removing an element at a given priority (having the list shift appropriately in both cases). | 0 |
11,372,800 | 07/07/2012 06:21:39 | 1,379,620 | 05/07/2012 11:24:33 | 86 | 26 | Warning: file_get_contents(image.jpg) [function.file-get-contents]: failed to open stream: No such file or directory in php | 1.Here i am trying to send my jpg image file as attachment to mail using php mail()
function.
2.My mail attachment is sending fine with word document(.doc as attachment).But,throws
errorwhen i try to send .jpg as attachment.The code i used:
<?php
/*If there is no error, send the email*/
if(isset($_POST['submit-button-name'])) {
$uname=$_POST['uname'];
$to = $_POST['mailid'];
$mobileno=$_POST['mobile'];
$location=$_POST['location'];
$from = "Urname <[email protected]>";
$subject = $_POST['uname']." testing";
$separator = md5(time());
/* carriage return type (we use a PHP end of line constant)*/
$eol = PHP_EOL;
/*attachment name*/
$filename = "image.jpg";
$attachment = @chunk_split(base64_encode(file_get_contents('image.jpg')));
/*main header*/
$headers = "From: ".$from.$eol;
$headers .= "MIME-Version: 1.0".$eol;
$headers .= "Content-Type: multipart/mixed; boundary=\"".$separator."\"";
/*no more headers after this, we start the body!*/
$body = "--".$separator.$eol;
$body .= "Content-Transfer-Encoding: 7bit".$eol.$eol;
$body .= "Check out the attachment.".$eol;
/*message*/
$body .= "--".$separator.$eol;
$body .= "Content-Type: text/html; charset=\"iso-8859-1\"".$eol;
$body .= "Content-Transfer-Encoding: 8bit".$eol.$eol;
$body .= $message.$eol;
/*attachment*/
$body .= "--".$separator.$eol;
$body .= "Content-Type: image/jpg; name=\"".$filename."\"".$eol;
$body .= "Content-Transfer-Encoding: base64".$eol;
$body .= "Content-Disposition: attachment; file=\"".$filename."\"".$eol.$eol;
$body .= $attachment.$eol;
$body .= "--".$separator."--";
/*send message*/
if (mail($to, $subject, $body, $headers)) {
$mail_sent=true;
echo "<font color='white'>Mail sent</font>";
$frm="[email protected]";
$subj="Acknowledgement mail for Brochure form";
$msg = $_POST['username'] . ",\n\nThank you for your recent enquiry.";
$body = "Name: ".$_POST['uname'] ."\n\nEmail: ".$_POST['mailid'] ."\n\nMobile:
".$_POST['mobile'] ."\n\nLocation: ".$_POST['location'];
$headers = 'From: '.'[email protected]';
mail($frm,$subj,$body,$headers);
} else {
$mail_sent=false;
}
if($mail_sent == true)
{
/*to clear the post values*/
$uname="";
$to="";
$mobileno="";
$location="";
}
else{
echo "Error,Mail not sent";
}
}
?>
3.Error being raised as:
Warning: file_get_contents(image.jpg) [function.file-get-contents]: failed to
open stream: No such file or directory in footer.php on line 48
4.I used to receive mail with the body content("Check out the attachment") and having
attachment as image.jpg with 0k(no image is opened).
5.please help.thanks in advance.Its urgent. | php | wordpress | email-attachments | null | null | null | open | Warning: file_get_contents(image.jpg) [function.file-get-contents]: failed to open stream: No such file or directory in php
===
1.Here i am trying to send my jpg image file as attachment to mail using php mail()
function.
2.My mail attachment is sending fine with word document(.doc as attachment).But,throws
errorwhen i try to send .jpg as attachment.The code i used:
<?php
/*If there is no error, send the email*/
if(isset($_POST['submit-button-name'])) {
$uname=$_POST['uname'];
$to = $_POST['mailid'];
$mobileno=$_POST['mobile'];
$location=$_POST['location'];
$from = "Urname <[email protected]>";
$subject = $_POST['uname']." testing";
$separator = md5(time());
/* carriage return type (we use a PHP end of line constant)*/
$eol = PHP_EOL;
/*attachment name*/
$filename = "image.jpg";
$attachment = @chunk_split(base64_encode(file_get_contents('image.jpg')));
/*main header*/
$headers = "From: ".$from.$eol;
$headers .= "MIME-Version: 1.0".$eol;
$headers .= "Content-Type: multipart/mixed; boundary=\"".$separator."\"";
/*no more headers after this, we start the body!*/
$body = "--".$separator.$eol;
$body .= "Content-Transfer-Encoding: 7bit".$eol.$eol;
$body .= "Check out the attachment.".$eol;
/*message*/
$body .= "--".$separator.$eol;
$body .= "Content-Type: text/html; charset=\"iso-8859-1\"".$eol;
$body .= "Content-Transfer-Encoding: 8bit".$eol.$eol;
$body .= $message.$eol;
/*attachment*/
$body .= "--".$separator.$eol;
$body .= "Content-Type: image/jpg; name=\"".$filename."\"".$eol;
$body .= "Content-Transfer-Encoding: base64".$eol;
$body .= "Content-Disposition: attachment; file=\"".$filename."\"".$eol.$eol;
$body .= $attachment.$eol;
$body .= "--".$separator."--";
/*send message*/
if (mail($to, $subject, $body, $headers)) {
$mail_sent=true;
echo "<font color='white'>Mail sent</font>";
$frm="[email protected]";
$subj="Acknowledgement mail for Brochure form";
$msg = $_POST['username'] . ",\n\nThank you for your recent enquiry.";
$body = "Name: ".$_POST['uname'] ."\n\nEmail: ".$_POST['mailid'] ."\n\nMobile:
".$_POST['mobile'] ."\n\nLocation: ".$_POST['location'];
$headers = 'From: '.'[email protected]';
mail($frm,$subj,$body,$headers);
} else {
$mail_sent=false;
}
if($mail_sent == true)
{
/*to clear the post values*/
$uname="";
$to="";
$mobileno="";
$location="";
}
else{
echo "Error,Mail not sent";
}
}
?>
3.Error being raised as:
Warning: file_get_contents(image.jpg) [function.file-get-contents]: failed to
open stream: No such file or directory in footer.php on line 48
4.I used to receive mail with the body content("Check out the attachment") and having
attachment as image.jpg with 0k(no image is opened).
5.please help.thanks in advance.Its urgent. | 0 |
11,262,160 | 06/29/2012 12:53:14 | 666,576 | 03/18/2011 19:08:32 | 498 | 2 | AS3 browseForOpen opens last used folder | var f:File = File.applicationStorageDirectory.resolvePath('myFolder');
f.browseForOpen("foo");
running that code once will open the file opening dialog in the proper folder. But if i browse to another folder and select a file from there, and then later run the same code again, the file browsing dialog that opens will open in the folder from where i selected the last file, instead of 'myFolder'.
What's the reason for this and how to prevent this? (the browseForOpen dialog should always open in 'myFolder') | actionscript-3 | air | filesystems | null | null | null | open | AS3 browseForOpen opens last used folder
===
var f:File = File.applicationStorageDirectory.resolvePath('myFolder');
f.browseForOpen("foo");
running that code once will open the file opening dialog in the proper folder. But if i browse to another folder and select a file from there, and then later run the same code again, the file browsing dialog that opens will open in the folder from where i selected the last file, instead of 'myFolder'.
What's the reason for this and how to prevent this? (the browseForOpen dialog should always open in 'myFolder') | 0 |
11,262,162 | 06/29/2012 12:53:33 | 1,451,543 | 06/12/2012 14:53:56 | 35 | 1 | How to access facebook error object from response | How to get the reason for the error when user cant log in with facebook ?
$data = response;
if(!empty($data['error'])){
echo $data['error'];
// yes there is a error
}
$data['error'] prints array , how to access the reason for the error
| php | facebook | error-message | null | null | null | open | How to access facebook error object from response
===
How to get the reason for the error when user cant log in with facebook ?
$data = response;
if(!empty($data['error'])){
echo $data['error'];
// yes there is a error
}
$data['error'] prints array , how to access the reason for the error
| 0 |
11,227,814 | 06/27/2012 13:52:00 | 1,479,475 | 06/25/2012 09:04:22 | 3 | 0 | How create a folder in c++ in a more efficient way? | In my C++ project I have porvided with an option to take a backup of the files that are created to store the rocords, which takes the backup of files in a user given path by creating a folder in that Directory, The code for the same is as follows:
void backup()
{
char a[40],c[40],b[40];
product p1;
clrscr();
ifstream fp1("products.dat", ios::binary);
ifstream fp2("purchase.dat",ios::binary);
ifstream fp3("sales.dat",ios::binary);
if(fp1==NULL || fp2==NULL || fp3==NULL)
{
cout<<"\n\tError-No or Incomplete Database...";
}
else
{
cout<<d_line;
cout<<"\t\t\t Database backup";
cout<<"\n\t\t\t -------- ------";
cout<<line;
cout<<"\n\tEnter the Directory in which you want to create backup:";
gets(a);
strcpy(b,a);
strcpy(c,a);
strcat(a,"/backup_b");
strcat(b,"/backup_b");
strcat(c,"/backup_b");
mkdir(a);
strcat(a,"/products.dat");
strcat(b,"/purchase.dat");
strcat(c,"/sales.dat");
ofstream fp1_t(a, ios::binary | ios::trunc);
ofstream fp2_t(b, ios::binary | ios::trunc);
ofstream fp3_t(c, ios::binary | ios::trunc);
if(fp1_t==NULL || fp2_t==NULL ||fp3_t==NULL)
{
cout<<"\n\n\tError During creating backup...\n";
}
else
{
while(!fp1.eof())
{
fp1.read((char *) &p1,sizeof(struct product));
if(fp1.fail())
{
break;
}
else
{
fp1_t.write((char *) &p1,sizeof(struct product));
}
}
while(!fp2.eof())
{
fp2.read((char *) &p1,sizeof(struct product));
if(fp2.fail())
{
break;
}
else
{
fp2_t.write((char *) &p1,sizeof(struct product));
}
}
while(!fp3.eof())
{
fp3.read((char *) &p1,sizeof(struct product));
if(fp3.fail())
{
break;
}
else
{
fp3_t.write((char *) &p1,sizeof(struct product));
}
}
fp1_t.close();
fp2_t.close();
fp3_t.close();
}
fp1.close();
fp2.close();
fp3.close();
cout<<line;
cout<<"\n\tBackup Created Successfully...";
}
cout<<line<<conti;
getch();
}
**I want to know, is there a more efficient way to create a folder in C++?** | c++ | folder | null | null | null | null | open | How create a folder in c++ in a more efficient way?
===
In my C++ project I have porvided with an option to take a backup of the files that are created to store the rocords, which takes the backup of files in a user given path by creating a folder in that Directory, The code for the same is as follows:
void backup()
{
char a[40],c[40],b[40];
product p1;
clrscr();
ifstream fp1("products.dat", ios::binary);
ifstream fp2("purchase.dat",ios::binary);
ifstream fp3("sales.dat",ios::binary);
if(fp1==NULL || fp2==NULL || fp3==NULL)
{
cout<<"\n\tError-No or Incomplete Database...";
}
else
{
cout<<d_line;
cout<<"\t\t\t Database backup";
cout<<"\n\t\t\t -------- ------";
cout<<line;
cout<<"\n\tEnter the Directory in which you want to create backup:";
gets(a);
strcpy(b,a);
strcpy(c,a);
strcat(a,"/backup_b");
strcat(b,"/backup_b");
strcat(c,"/backup_b");
mkdir(a);
strcat(a,"/products.dat");
strcat(b,"/purchase.dat");
strcat(c,"/sales.dat");
ofstream fp1_t(a, ios::binary | ios::trunc);
ofstream fp2_t(b, ios::binary | ios::trunc);
ofstream fp3_t(c, ios::binary | ios::trunc);
if(fp1_t==NULL || fp2_t==NULL ||fp3_t==NULL)
{
cout<<"\n\n\tError During creating backup...\n";
}
else
{
while(!fp1.eof())
{
fp1.read((char *) &p1,sizeof(struct product));
if(fp1.fail())
{
break;
}
else
{
fp1_t.write((char *) &p1,sizeof(struct product));
}
}
while(!fp2.eof())
{
fp2.read((char *) &p1,sizeof(struct product));
if(fp2.fail())
{
break;
}
else
{
fp2_t.write((char *) &p1,sizeof(struct product));
}
}
while(!fp3.eof())
{
fp3.read((char *) &p1,sizeof(struct product));
if(fp3.fail())
{
break;
}
else
{
fp3_t.write((char *) &p1,sizeof(struct product));
}
}
fp1_t.close();
fp2_t.close();
fp3_t.close();
}
fp1.close();
fp2.close();
fp3.close();
cout<<line;
cout<<"\n\tBackup Created Successfully...";
}
cout<<line<<conti;
getch();
}
**I want to know, is there a more efficient way to create a folder in C++?** | 0 |
11,227,815 | 06/27/2012 13:52:00 | 855,643 | 07/21/2011 09:55:09 | 1,288 | 94 | What is the difference between 0..size and 0...size in Ruby? | I'm reading some ruby code, and see 0..size and 0...size are used in similar situations.
Are there any difference, or they are just identical? | ruby | null | null | null | null | null | open | What is the difference between 0..size and 0...size in Ruby?
===
I'm reading some ruby code, and see 0..size and 0...size are used in similar situations.
Are there any difference, or they are just identical? | 0 |
11,430,151 | 07/11/2012 10:01:02 | 1,430,712 | 06/01/2012 12:43:46 | 50 | 1 | Set image inside x,y image | Its possible to set any image inside other image in the pixel coordenates what i want?
First image is a big image, and the second image is a sign of a user.
I think witch canvas this is posible but i am not sure.
Anyone have a example of this? | android | image | canvas | imageview | null | null | open | Set image inside x,y image
===
Its possible to set any image inside other image in the pixel coordenates what i want?
First image is a big image, and the second image is a sign of a user.
I think witch canvas this is posible but i am not sure.
Anyone have a example of this? | 0 |
11,430,167 | 07/11/2012 10:01:58 | 1,500,623 | 07/04/2012 05:47:03 | 8 | 0 | JSF clear input fields | I was searching for a simple way of clearing input fields' values and found this article:
https://cwiki.apache.org/confluence/display/MYFACES/Clear+Input+Components
It says:
"Find the parent component of the problem inputs, and call
parentComponent.getChildren().clear();
During the render phase, new instances of these child components will then be created, while other components will not be affected."
But it doesn't work for me, when I try to remove all child components from the form,
those components just disappear from the page. Besides, how does this correspond with this article:
http://docs.oracle.com/javaee/6/tutorial/doc/bnaqq.html#bnaqx
where it says, that child components are added to component tree during the Render Response phase only for the initial request, but not for postback requests? Can anyone please clarify this? | jsf | facelets | null | null | null | null | open | JSF clear input fields
===
I was searching for a simple way of clearing input fields' values and found this article:
https://cwiki.apache.org/confluence/display/MYFACES/Clear+Input+Components
It says:
"Find the parent component of the problem inputs, and call
parentComponent.getChildren().clear();
During the render phase, new instances of these child components will then be created, while other components will not be affected."
But it doesn't work for me, when I try to remove all child components from the form,
those components just disappear from the page. Besides, how does this correspond with this article:
http://docs.oracle.com/javaee/6/tutorial/doc/bnaqq.html#bnaqx
where it says, that child components are added to component tree during the Render Response phase only for the initial request, but not for postback requests? Can anyone please clarify this? | 0 |
11,429,934 | 07/11/2012 09:49:08 | 631,978 | 02/24/2011 08:54:42 | 6 | 0 | drop down does not focuses the selected value when expanded | I have created a drop down menu in prime faces 3. When i expand the drop down then it focuses on the first value / option. Consider the case when selected value is 2nd last in the list and is selected through scroll. Now if you want to change it and you click on the drop down then the first item of the list is focused and you will have to scroll the entire list again. Whereas simple HTML drop down list does not perform this.
my code is as follows:
<p:selectOneMenu id="currency" value="#{createPayment.defaultCurrency}" widgetVar="currency">
<f:selectItems value="#{createPayment.currenciesList}"/>
</p:selectOneMenu>
Regards,
Asad | jsf-2.0 | primefaces | null | null | null | null | open | drop down does not focuses the selected value when expanded
===
I have created a drop down menu in prime faces 3. When i expand the drop down then it focuses on the first value / option. Consider the case when selected value is 2nd last in the list and is selected through scroll. Now if you want to change it and you click on the drop down then the first item of the list is focused and you will have to scroll the entire list again. Whereas simple HTML drop down list does not perform this.
my code is as follows:
<p:selectOneMenu id="currency" value="#{createPayment.defaultCurrency}" widgetVar="currency">
<f:selectItems value="#{createPayment.currenciesList}"/>
</p:selectOneMenu>
Regards,
Asad | 0 |
11,429,936 | 07/11/2012 09:49:15 | 1,183,108 | 02/01/2012 15:58:55 | 10 | 1 | How to transform XML / JSON file into documents in Lotus Notes? | I have a big XML file with data of a lot companies and I like to convert this XML file to documents in my notes database. I want 1 document for each company. What would be the most easy way to do this? I downloaded a tool called Oxygen to read the data and I was able to create a JSON file of the XML file. I thougt maybe it is easier with JSON, but I'm not sure what to do next. | xml | json | xpages | null | null | null | open | How to transform XML / JSON file into documents in Lotus Notes?
===
I have a big XML file with data of a lot companies and I like to convert this XML file to documents in my notes database. I want 1 document for each company. What would be the most easy way to do this? I downloaded a tool called Oxygen to read the data and I was able to create a JSON file of the XML file. I thougt maybe it is easier with JSON, but I'm not sure what to do next. | 0 |
11,430,173 | 07/11/2012 10:02:10 | 1,469,740 | 06/20/2012 15:28:17 | 26 | 0 | How to SELECT data and execute function just once for each grouped selected value | I have a table:
ORG | PONumber | Code | Price
I want to SELECT all data from this table, and calculate sum of code prices for each PONumber like:
SELECT
tt1.ORG as 'Organization',
tt1.PONumber as 'PO Number',
tt1.Code as 'Code',
tt1.Price as 'Price',
'SumPrice' = FUNC001(tt1.PONumber)
FROM My_table as tt1
In this procedure I'm using function FUNC001(tt1.PONumber):
ALTER FUNCTION [dbo].[FUNC001] (@ponumber VARCHAR(MAX))
RETURNS DECIMAL AS BEGIN
DECLARE @p1 DECIMAL ;
SET @p1 = 0.0 ;
SELECT @p1 = @p1 + tt1.Price
FROM My_table as tt1
WHERE tt1.[PO number] = @ponumber
RETURN ROUND(@p1,2,1)
END
The problem is: Due my SELECT query execution this function return sum of prices each time for the same PONumbers and it takes a lot of time. Is there a way to execute this function just once for each PONumber in query and apply return value for same PONumbers? Can I use some @parameter, and check: if PONumber changed -> execute function, else select previous value? | mysql | sql | ado.net | null | null | null | open | How to SELECT data and execute function just once for each grouped selected value
===
I have a table:
ORG | PONumber | Code | Price
I want to SELECT all data from this table, and calculate sum of code prices for each PONumber like:
SELECT
tt1.ORG as 'Organization',
tt1.PONumber as 'PO Number',
tt1.Code as 'Code',
tt1.Price as 'Price',
'SumPrice' = FUNC001(tt1.PONumber)
FROM My_table as tt1
In this procedure I'm using function FUNC001(tt1.PONumber):
ALTER FUNCTION [dbo].[FUNC001] (@ponumber VARCHAR(MAX))
RETURNS DECIMAL AS BEGIN
DECLARE @p1 DECIMAL ;
SET @p1 = 0.0 ;
SELECT @p1 = @p1 + tt1.Price
FROM My_table as tt1
WHERE tt1.[PO number] = @ponumber
RETURN ROUND(@p1,2,1)
END
The problem is: Due my SELECT query execution this function return sum of prices each time for the same PONumbers and it takes a lot of time. Is there a way to execute this function just once for each PONumber in query and apply return value for same PONumbers? Can I use some @parameter, and check: if PONumber changed -> execute function, else select previous value? | 0 |
11,430,181 | 07/11/2012 10:02:31 | 853,573 | 07/20/2011 08:54:15 | 13 | 2 | How to use protobuf-net with classes shared through ASP.NET Web Reference while avoiding code duplication? | I have a server-client application in which I can modify both codebases. The client communicates with the server through numerous web services and I share some of the classes defined on the server side through Web Reference system. On the wire the data is sent using XML (SOAP). Also, I save some of the data on the disk using `XmlSerializer`.
Due to rising performance issues, I want to migrate to a more sophisticated serializer with my eyes on Protocol Buffers and protobuf-net. I currently use protobuf-net v2 (r480, .NET 3.5)
The problem I seem to have is that classes shared through Web Reference system do not retain custom class/member attributes like `ProtoContract` and `ProtoMember`.
(But the serializer system does **not** throw the usual `System.InvalidOperationException: Type is not expected, and no contract can be inferred`, leaving me with an empty stream. Is it because the class generated on the client side is marked as `partial`?)
Example, server side:
[ProtoContract]
public class CommentStruct
{
[ProtoMember(1)] public int id;
[ProtoMember(2)] public DateTime time;
[ProtoMember(3)] public string comment;
[ProtoMember(4)] public int session;
}
Client side (generated code):
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://example.org")]
public partial class CommentStruct {
private int idField;
private System.DateTime timeField;
private string commentField;
private int sessionField;
/// <remarks/>
public int id {
get {
return this.idField;
}
set {
this.idField = value;
}
}
[...]
I managed to get around this issue using `ProtoPartialMember` in an extra class file on the client side:
[ProtoContract,
ProtoPartialMember(1, "id"),
ProtoPartialMember(2, "time"),
ProtoPartialMember(3, "comment"),
ProtoPartialMember(4, "session")]
public partial class CommentStruct
{
}
The main concern here is: can I do this in a different way to avoid code duplication?
The other is: will I miss out on some of the protobuf-net goodies like inheritance support?
I have found some information about protobuf-net Visual Studio add-in. But as Marc Gravell has decribed it as an 'afterthought', I am reluctant to use it. Moreover, some of my co-developers are using VS Express editions that do not support add-ins. | c# | asp.net | .net | protocol-buffers | protobuf-net | null | open | How to use protobuf-net with classes shared through ASP.NET Web Reference while avoiding code duplication?
===
I have a server-client application in which I can modify both codebases. The client communicates with the server through numerous web services and I share some of the classes defined on the server side through Web Reference system. On the wire the data is sent using XML (SOAP). Also, I save some of the data on the disk using `XmlSerializer`.
Due to rising performance issues, I want to migrate to a more sophisticated serializer with my eyes on Protocol Buffers and protobuf-net. I currently use protobuf-net v2 (r480, .NET 3.5)
The problem I seem to have is that classes shared through Web Reference system do not retain custom class/member attributes like `ProtoContract` and `ProtoMember`.
(But the serializer system does **not** throw the usual `System.InvalidOperationException: Type is not expected, and no contract can be inferred`, leaving me with an empty stream. Is it because the class generated on the client side is marked as `partial`?)
Example, server side:
[ProtoContract]
public class CommentStruct
{
[ProtoMember(1)] public int id;
[ProtoMember(2)] public DateTime time;
[ProtoMember(3)] public string comment;
[ProtoMember(4)] public int session;
}
Client side (generated code):
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://example.org")]
public partial class CommentStruct {
private int idField;
private System.DateTime timeField;
private string commentField;
private int sessionField;
/// <remarks/>
public int id {
get {
return this.idField;
}
set {
this.idField = value;
}
}
[...]
I managed to get around this issue using `ProtoPartialMember` in an extra class file on the client side:
[ProtoContract,
ProtoPartialMember(1, "id"),
ProtoPartialMember(2, "time"),
ProtoPartialMember(3, "comment"),
ProtoPartialMember(4, "session")]
public partial class CommentStruct
{
}
The main concern here is: can I do this in a different way to avoid code duplication?
The other is: will I miss out on some of the protobuf-net goodies like inheritance support?
I have found some information about protobuf-net Visual Studio add-in. But as Marc Gravell has decribed it as an 'afterthought', I am reluctant to use it. Moreover, some of my co-developers are using VS Express editions that do not support add-ins. | 0 |
11,430,182 | 07/11/2012 10:02:31 | 1,517,221 | 07/11/2012 09:00:59 | 1 | 0 | Android: see images of IP Camera with webview on Android 2.2 | I'm trying to make an application for Android which I have a ip camera, and I want to do a live view of what the camera captures.
I use a program called Motion, which captures photos. Jpg and then from the browser, eg Firefox, entering "http://ip:port" may be a live view of what the camera is capturing.
For android I wrote this code:
public class WebviewpfcActivity extends Activity {
public WebView wv;
Uri uri;
ContentValues values;
Bitmap bitmap;
Canvas mCanvas;
public void onCreate(Bundle icicle){
super.onCreate(icicle);
Bundle extras=getIntent().getExtras();
setContentView(R.layout.main);
wv=(WebView) findViewById(R.id.webview);
wv.getSettings().setJavaScriptEnabled(true);
wv.getSettings().setPluginsEnabled(true);
wv.loadUrl("http://myIP:myPort");
}
public boolean onKeyUp(int keyCode , KeyEvent event){
if ( keyCode == KeyEvent .KEYCODE_DPAD_LEFT) {
wv.zoomIn();
return super . onKeyUp( keyCode , event ) ;
}
if ( keyCode == KeyEvent .KEYCODE_DPAD_RIGHT) {
wv. zoomOut ( ) ;
return super . onKeyUp( keyCode , event ) ;
}
if ( keyCode == KeyEvent .KEYCODE_DPAD_UP) {
return super . onKeyUp( keyCode , event ) ;
}
if ( keyCode == KeyEvent .KEYCODE_BACK) {
WebviewpfcActivity.this.finish ( );
return true ;
}
return false;
}
}
It does not work, the screen goes blank, not what you'll be doing it wrong because using a program called "tinycam Monitor" introducing the same IP and same port if it looks the picture!.
Please help, thank you very much. | android | null | null | null | null | null | open | Android: see images of IP Camera with webview on Android 2.2
===
I'm trying to make an application for Android which I have a ip camera, and I want to do a live view of what the camera captures.
I use a program called Motion, which captures photos. Jpg and then from the browser, eg Firefox, entering "http://ip:port" may be a live view of what the camera is capturing.
For android I wrote this code:
public class WebviewpfcActivity extends Activity {
public WebView wv;
Uri uri;
ContentValues values;
Bitmap bitmap;
Canvas mCanvas;
public void onCreate(Bundle icicle){
super.onCreate(icicle);
Bundle extras=getIntent().getExtras();
setContentView(R.layout.main);
wv=(WebView) findViewById(R.id.webview);
wv.getSettings().setJavaScriptEnabled(true);
wv.getSettings().setPluginsEnabled(true);
wv.loadUrl("http://myIP:myPort");
}
public boolean onKeyUp(int keyCode , KeyEvent event){
if ( keyCode == KeyEvent .KEYCODE_DPAD_LEFT) {
wv.zoomIn();
return super . onKeyUp( keyCode , event ) ;
}
if ( keyCode == KeyEvent .KEYCODE_DPAD_RIGHT) {
wv. zoomOut ( ) ;
return super . onKeyUp( keyCode , event ) ;
}
if ( keyCode == KeyEvent .KEYCODE_DPAD_UP) {
return super . onKeyUp( keyCode , event ) ;
}
if ( keyCode == KeyEvent .KEYCODE_BACK) {
WebviewpfcActivity.this.finish ( );
return true ;
}
return false;
}
}
It does not work, the screen goes blank, not what you'll be doing it wrong because using a program called "tinycam Monitor" introducing the same IP and same port if it looks the picture!.
Please help, thank you very much. | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.