PostId int64 13 11.8M | PostCreationDate stringlengths 19 19 | OwnerUserId int64 3 1.57M | OwnerCreationDate stringlengths 10 19 | ReputationAtPostCreation int64 -33 210k | OwnerUndeletedAnswerCountAtPostTime int64 0 5.77k | Title stringlengths 10 250 | BodyMarkdown stringlengths 12 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 47 30.1k | OpenStatus_id int64 0 4 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
10,796,078 | 05/29/2012 09:03:52 | 822,861 | 06/30/2011 10:47:23 | 1 | 0 | how to check touch point is content on the edges of an curve path in ios? | I am working with an app which is drawing curve between two boxes. Once its drawn that I want to change shape of curve using starting, ending and other point(touch point) if that is on the edge on curve.
So how can i check that touch point is on the edge of my curve path or not? | iphone | ios | core-graphics | null | null | null | open | how to check touch point is content on the edges of an curve path in ios?
===
I am working with an app which is drawing curve between two boxes. Once its drawn that I want to change shape of curve using starting, ending and other point(touch point) if that is on the edge on curve.
So how can i check that touch point is on the edge of my curve path or not? | 0 |
6,518,057 | 06/29/2011 08:58:21 | 820,596 | 06/29/2011 07:32:15 | 1 | 0 | C code equivalence | Is the following C code
int b = 5;
int s = 0;
while (s<=b){
s++;
}
equivalent to this java bytecode?
LoadInt(5)
Load(Int,b)
LoadInt(0)
Load(Int,S)
A: LoadInt(1)
Add(Int)
Jumplf(Le,Int,A)
B:
I do need help ...
Any help will be highly appreciated...
| c | null | null | null | null | 06/29/2011 09:42:21 | too localized | C code equivalence
===
Is the following C code
int b = 5;
int s = 0;
while (s<=b){
s++;
}
equivalent to this java bytecode?
LoadInt(5)
Load(Int,b)
LoadInt(0)
Load(Int,S)
A: LoadInt(1)
Add(Int)
Jumplf(Le,Int,A)
B:
I do need help ...
Any help will be highly appreciated...
| 3 |
8,056,033 | 11/08/2011 19:33:07 | 606,660 | 02/07/2011 15:25:49 | 390 | 15 | Why does 'the internet' still fail at printing apostrophes? | It is almost 2012, and I still stumble onto sites that fail to produce a proper apostrophe. Years ago, when I was just a kid and I was learning HTML 4.0 (brand new at the time) I asked this same question. It was more excusable then, the internet was new and dynamic content even newer. That was over a decade ago and the problem persist!
Here is an example I ran into today: http://www.metacritic.com/user/Darth_Spud
>
Call of Duty: Modern Warfare 3
Average User Score: 2.8
4
Ultimately does this franchise deserve its top place in the gaming industry? Nope, and here’s why. Top review sites are clearly paid by Activision from IGN, Gamespot to Metacritic. With a budget that Activition has at its disposal it’s plain to see that this game gets it’s place not through rightful hard work, originality and innovation but by corporate back hander’s and dodgy industry licensing deals.
Does anyone have some insight as to what process of creating and displaying content allows for this error to be injected?
Tangent: Part of me wonders if this is related to the phenomena where multiple forum sights show up in a google search, each with their own style and demographic, all containing the exact same thread. | apostrophe | null | null | null | null | 11/08/2011 19:34:55 | not constructive | Why does 'the internet' still fail at printing apostrophes?
===
It is almost 2012, and I still stumble onto sites that fail to produce a proper apostrophe. Years ago, when I was just a kid and I was learning HTML 4.0 (brand new at the time) I asked this same question. It was more excusable then, the internet was new and dynamic content even newer. That was over a decade ago and the problem persist!
Here is an example I ran into today: http://www.metacritic.com/user/Darth_Spud
>
Call of Duty: Modern Warfare 3
Average User Score: 2.8
4
Ultimately does this franchise deserve its top place in the gaming industry? Nope, and here’s why. Top review sites are clearly paid by Activision from IGN, Gamespot to Metacritic. With a budget that Activition has at its disposal it’s plain to see that this game gets it’s place not through rightful hard work, originality and innovation but by corporate back hander’s and dodgy industry licensing deals.
Does anyone have some insight as to what process of creating and displaying content allows for this error to be injected?
Tangent: Part of me wonders if this is related to the phenomena where multiple forum sights show up in a google search, each with their own style and demographic, all containing the exact same thread. | 4 |
10,521,893 | 05/09/2012 18:23:09 | 1,053,820 | 11/18/2011 12:51:11 | 38 | 0 | Search and download .torrent files within PHP script | Hi I am starting a bit of a project in order to learn PHP. I am creating a bit of a site which is just hosted on my computer. At the minute it is just a display of music and movies on my media centre pc. It is searchable and I wondered if it was possible to have an option to do the following:
If you search for an album or movie which returns no results, you are presented with the option to search for a torrent and download it to the computer and launch it in to my torrent client. I want to do this all from my site and no use external sites and tools, I know it is possible to add torrents with utorrent web application but this is not what I want. I want the php to return a list of applicable torrents and then you can pick the one to download.
Do you think this is possible?
Thanks | php | html | null | null | null | 05/10/2012 21:15:45 | not a real question | Search and download .torrent files within PHP script
===
Hi I am starting a bit of a project in order to learn PHP. I am creating a bit of a site which is just hosted on my computer. At the minute it is just a display of music and movies on my media centre pc. It is searchable and I wondered if it was possible to have an option to do the following:
If you search for an album or movie which returns no results, you are presented with the option to search for a torrent and download it to the computer and launch it in to my torrent client. I want to do this all from my site and no use external sites and tools, I know it is possible to add torrents with utorrent web application but this is not what I want. I want the php to return a list of applicable torrents and then you can pick the one to download.
Do you think this is possible?
Thanks | 1 |
5,830,882 | 04/29/2011 10:27:27 | 698,119 | 04/08/2011 06:43:28 | 21 | 0 | Why javascript block parallel downloading? | Can anyone please tell me why javascript block parallel downloading?
Thanks | javascript | performance | null | null | null | 04/29/2011 11:07:27 | not a real question | Why javascript block parallel downloading?
===
Can anyone please tell me why javascript block parallel downloading?
Thanks | 1 |
2,385,947 | 03/05/2010 10:19:45 | 37,196 | 11/13/2008 00:40:16 | 650 | 6 | Best way to typecast deserialised JSON | I think I've established that in as3corelib JSON.decode I have no choice but to deserialise to a plain old flex object.
var data:Object = JSON.decode(json);
If I then want to get the data contained in the object into another type I can't use type casting. I have to instantiate a new instance and add the properties manually.
var data:Object = JSON.decode(json);
var model:Model = new Model();
model.name = data.name;
model.notes = data.notes;
A pain and a bit ugly, but I'm guessing this is the price to be paid for going from untyped json to a flex type. My first question is whether my assumption is correct and there is no prettier way to create my model instance with the data contained within the json?
My second question, if so then before I write my own method to do this, is there anything inside the flex api that will take the data object and mixin it's values to my model instance?
Cheers,
Chris
| flex | actionscript-3 | null | null | null | null | open | Best way to typecast deserialised JSON
===
I think I've established that in as3corelib JSON.decode I have no choice but to deserialise to a plain old flex object.
var data:Object = JSON.decode(json);
If I then want to get the data contained in the object into another type I can't use type casting. I have to instantiate a new instance and add the properties manually.
var data:Object = JSON.decode(json);
var model:Model = new Model();
model.name = data.name;
model.notes = data.notes;
A pain and a bit ugly, but I'm guessing this is the price to be paid for going from untyped json to a flex type. My first question is whether my assumption is correct and there is no prettier way to create my model instance with the data contained within the json?
My second question, if so then before I write my own method to do this, is there anything inside the flex api that will take the data object and mixin it's values to my model instance?
Cheers,
Chris
| 0 |
5,160,112 | 03/01/2011 20:44:07 | 640,088 | 03/01/2011 20:44:07 | 1 | 0 | Can someone help me with this SQL error, essentially u1 and u2 are pulling the same value | SELECT VIRSA_AE_ROLE_MAP.MAIN_SYSTEM, VIRSA_AE_ROLE_MAP.MAIN_ROLE, U1.ROLEPROFDISPNAME, VIRSA_AE_ROLE_MAP.DEPENDANT_SYSTEM, VIRSA_AE_ROLE_MAP.DEPENDANT_ROLE, U2.ROLEPROFDISPNAME
FROM (VIRSA_AE_ROLE_MAP
INNER JOIN VIRSA_AE_ROLDTLS U1 ON VIRSA_AE_ROLE_MAP.MAIN_ROLE = U1.ROLEPROFNAME)
LEFT JOIN VIRSA_AE_ROLDTLS U2 ON VIRSA_AE_ROLE_MAP.DEPENDANT_ROLE = U2.ROLEPROFNAME ; | mysql | null | null | null | null | null | open | Can someone help me with this SQL error, essentially u1 and u2 are pulling the same value
===
SELECT VIRSA_AE_ROLE_MAP.MAIN_SYSTEM, VIRSA_AE_ROLE_MAP.MAIN_ROLE, U1.ROLEPROFDISPNAME, VIRSA_AE_ROLE_MAP.DEPENDANT_SYSTEM, VIRSA_AE_ROLE_MAP.DEPENDANT_ROLE, U2.ROLEPROFDISPNAME
FROM (VIRSA_AE_ROLE_MAP
INNER JOIN VIRSA_AE_ROLDTLS U1 ON VIRSA_AE_ROLE_MAP.MAIN_ROLE = U1.ROLEPROFNAME)
LEFT JOIN VIRSA_AE_ROLDTLS U2 ON VIRSA_AE_ROLE_MAP.DEPENDANT_ROLE = U2.ROLEPROFNAME ; | 0 |
6,426,447 | 06/21/2011 13:54:11 | 746,709 | 05/10/2011 11:12:26 | 6 | 0 | How to properly run a Symfony task in the background from an action? | $path=sfConfig::get('sf_app_module_dir')."/module/actions/MultiTheading.php";
foreach($arr as $id)
{
if($id)
passthru ("php -q $path $id $pid &");
}
when when i running action script is running sequenctly despite "&".
Please help
| symfony | symfony-1.4 | null | null | null | null | open | How to properly run a Symfony task in the background from an action?
===
$path=sfConfig::get('sf_app_module_dir')."/module/actions/MultiTheading.php";
foreach($arr as $id)
{
if($id)
passthru ("php -q $path $id $pid &");
}
when when i running action script is running sequenctly despite "&".
Please help
| 0 |
7,771,893 | 10/14/2011 18:23:17 | 635,356 | 02/26/2011 09:05:01 | 169 | 2 | how to acess on controls inside of stackpanel in windows phone7? | i design page bellow code.
<ScrollViewer VerticalScrollBarVisibility="Visible" Grid.Row="1" x:Name="svProduct">
<StackPanel>
<ItemsControl x:Name="lstSearchResult" ItemsSource="{Binding Path=PIProductList}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Width="480" Style="{Binding CellStyle}" Orientation="Horizontal" VerticalAlignment="Center" Height="50" >
<TextBlock Foreground="Black" FontSize="20" Width="320" FontFamily="Tahoma" Margin="10,0,0,0" Text="{Binding Title}" VerticalAlignment="Center" TextWrapping="Wrap"></TextBlock>
<Button Name="btnBookmark" Click="btnBookmark_Click" Tag="{Binding}" Background="Transparent">
<Button.Content>
<Image Source="/Images/bookmarks_red.png" Width="33" Height="30" VerticalAlignment="Top" Margin="-15"></Image>
</Button.Content>
</Button>
<Button BorderThickness="0" x:Name="btnSubmit" Click="btnSubmit_Click" Background="Transparent" Tag="{Binding}" >
<Button.Content>
<Image Name="ram" Source="/Images/blue_arrow.png" Width="40" Height="40" VerticalAlignment="Top" Margin="-15"></Image>
</Button.Content>
</Button>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</ScrollViewer>
i want to access for btnBookmark visuble false .
can't access btnBookmark.Visibility=Visibility.collapsed
how to do this?
please help to me........... | c# | windows-phone-7 | null | null | null | null | open | how to acess on controls inside of stackpanel in windows phone7?
===
i design page bellow code.
<ScrollViewer VerticalScrollBarVisibility="Visible" Grid.Row="1" x:Name="svProduct">
<StackPanel>
<ItemsControl x:Name="lstSearchResult" ItemsSource="{Binding Path=PIProductList}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Width="480" Style="{Binding CellStyle}" Orientation="Horizontal" VerticalAlignment="Center" Height="50" >
<TextBlock Foreground="Black" FontSize="20" Width="320" FontFamily="Tahoma" Margin="10,0,0,0" Text="{Binding Title}" VerticalAlignment="Center" TextWrapping="Wrap"></TextBlock>
<Button Name="btnBookmark" Click="btnBookmark_Click" Tag="{Binding}" Background="Transparent">
<Button.Content>
<Image Source="/Images/bookmarks_red.png" Width="33" Height="30" VerticalAlignment="Top" Margin="-15"></Image>
</Button.Content>
</Button>
<Button BorderThickness="0" x:Name="btnSubmit" Click="btnSubmit_Click" Background="Transparent" Tag="{Binding}" >
<Button.Content>
<Image Name="ram" Source="/Images/blue_arrow.png" Width="40" Height="40" VerticalAlignment="Top" Margin="-15"></Image>
</Button.Content>
</Button>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</ScrollViewer>
i want to access for btnBookmark visuble false .
can't access btnBookmark.Visibility=Visibility.collapsed
how to do this?
please help to me........... | 0 |
8,929,774 | 01/19/2012 16:38:53 | 1,049,284 | 11/16/2011 09:05:23 | 30 | 3 | Maven or Ant + Ivy | I am about to start a Java project(Android One) and was wondering what would be the best Project Management Approach? Maven or Ant + Ivy
What are the strengths and weaknesses of each? I have taken a look online and like mavens simplicity, but am told that it is hard to do custom things with it when my project needs them.
I have used Ant in the past, but never with a dependency management tool like Ivy
Also, I will be using Eclipse, so ease of integration would also be a factor | android | eclipse | maven | ant | ivy | 01/19/2012 23:49:01 | not constructive | Maven or Ant + Ivy
===
I am about to start a Java project(Android One) and was wondering what would be the best Project Management Approach? Maven or Ant + Ivy
What are the strengths and weaknesses of each? I have taken a look online and like mavens simplicity, but am told that it is hard to do custom things with it when my project needs them.
I have used Ant in the past, but never with a dependency management tool like Ivy
Also, I will be using Eclipse, so ease of integration would also be a factor | 4 |
3,915,692 | 10/12/2010 14:23:27 | 118,610 | 06/06/2009 17:59:56 | 27 | 0 | Jira as Test Case Management Tool | I have reviewed several test case management solutions available for Jira such as:
- http://www.testandtry.com/2009/07/01/test-case-management-in-jira-1/
- http://confluence.atlassian.com/display/CONFEVAL/Customise+JIRA+For+Test+Case+Management
I was wondering if it is possible to expand this test case management solution even more.
I am looking for a Jira solution to have:
- Requirements
- Test Cases (which go under Requirements)
- Test Reports (which go under Test Cases)
The links posted above only ignore the "Requirements" part and focus only on Test Cases and Test Reports. Every Test Case Management tool I have used before has these features like HP QualityCenter.
Is it possible to achieve this in Jira?
TIA | jira | testcase | atlassian | null | null | null | open | Jira as Test Case Management Tool
===
I have reviewed several test case management solutions available for Jira such as:
- http://www.testandtry.com/2009/07/01/test-case-management-in-jira-1/
- http://confluence.atlassian.com/display/CONFEVAL/Customise+JIRA+For+Test+Case+Management
I was wondering if it is possible to expand this test case management solution even more.
I am looking for a Jira solution to have:
- Requirements
- Test Cases (which go under Requirements)
- Test Reports (which go under Test Cases)
The links posted above only ignore the "Requirements" part and focus only on Test Cases and Test Reports. Every Test Case Management tool I have used before has these features like HP QualityCenter.
Is it possible to achieve this in Jira?
TIA | 0 |
5,402,763 | 03/23/2011 08:54:22 | 668,536 | 03/20/2011 20:13:49 | 6 | 0 | How to insert a block of html into a java servlet | Newb question...
I'm messing around with some java source in eclipse for an existing appengine site. I want to get one of the existing pages to show a google earth plugin applet.
I have this little snippet that works in an html file but I cant figure out how to get the servlet to put this into the html that it generates.
I am not really a coder so I need some pretty consice instructions on how to get java to make this work.
Thanks!
<script src="http://www.gmodules.com/ig/ifr?url=http://code.google.com/apis/kml/embed/tourgadget.xml&up_kml_url=https%3A%2F%2Fwebfiles.colorado.edu%2Fwww%2FLSF%2520DB%2520Placemarks5.kmz&up_tour_index=1&up_tour_autoplay=1&up_show_navcontrols=1&up_show_buildings=1&up_show_terrain=1&up_show_roads=0&up_show_borders=1&up_sphere=earth&synd=open&w=700&h=600&title=Embedded+Tour+Player&border=http%3A%2F%2Fwww.gmodules.com%2Fig%2Fimages%2F&output=js"></script>
| java | html | eclipse | plugins | earth | null | open | How to insert a block of html into a java servlet
===
Newb question...
I'm messing around with some java source in eclipse for an existing appengine site. I want to get one of the existing pages to show a google earth plugin applet.
I have this little snippet that works in an html file but I cant figure out how to get the servlet to put this into the html that it generates.
I am not really a coder so I need some pretty consice instructions on how to get java to make this work.
Thanks!
<script src="http://www.gmodules.com/ig/ifr?url=http://code.google.com/apis/kml/embed/tourgadget.xml&up_kml_url=https%3A%2F%2Fwebfiles.colorado.edu%2Fwww%2FLSF%2520DB%2520Placemarks5.kmz&up_tour_index=1&up_tour_autoplay=1&up_show_navcontrols=1&up_show_buildings=1&up_show_terrain=1&up_show_roads=0&up_show_borders=1&up_sphere=earth&synd=open&w=700&h=600&title=Embedded+Tour+Player&border=http%3A%2F%2Fwww.gmodules.com%2Fig%2Fimages%2F&output=js"></script>
| 0 |
4,503,109 | 12/21/2010 19:27:01 | 532,515 | 12/06/2010 15:49:52 | 21 | 3 | Drag and drop within a text | Is it possible to drop html element into a text at mouse pointer position, using JQuery?
I've been implementing song editor (yet another...) with drag-and-drop guitar chord positioning. I would click a chord, drag it and drop *between lyrics letters*. Lyrics are contentEditable div.
My quick solution was surrounding each letter with a `<span class="letter">` tag and make entire song (letters + chords) sortable. Sortable has `cancel` attribute for `span.letter`, so you cannot move letters :-). But it implies maintaining this text structure while editing lyrics and seems not to be so efficient.
Can I achieve this in a more simple way, particularily without surrounding each letter with a tag? | javascript | jquery | jquery-ui | null | null | null | open | Drag and drop within a text
===
Is it possible to drop html element into a text at mouse pointer position, using JQuery?
I've been implementing song editor (yet another...) with drag-and-drop guitar chord positioning. I would click a chord, drag it and drop *between lyrics letters*. Lyrics are contentEditable div.
My quick solution was surrounding each letter with a `<span class="letter">` tag and make entire song (letters + chords) sortable. Sortable has `cancel` attribute for `span.letter`, so you cannot move letters :-). But it implies maintaining this text structure while editing lyrics and seems not to be so efficient.
Can I achieve this in a more simple way, particularily without surrounding each letter with a tag? | 0 |
10,339,490 | 04/26/2012 18:43:23 | 450,602 | 09/17/2010 12:53:58 | 617 | 3 | Ruby on Rails - Is there a way tp generate scaffolod script from database tables? | I already have the database tables and I need to create the rails script
rails generate scaffold ...
Is there a way or a tool ?
Thanks. | ruby-on-rails | rubymine | null | null | null | null | open | Ruby on Rails - Is there a way tp generate scaffolod script from database tables?
===
I already have the database tables and I need to create the rails script
rails generate scaffold ...
Is there a way or a tool ?
Thanks. | 0 |
4,845,628 | 01/30/2011 21:23:57 | 596,083 | 01/30/2011 21:11:27 | 1 | 0 | How to contribute to apache ? | I am an intermediate Java learner .I want to contribute to Apache Development,I saw there is a list of Apache Projects(like Hadoop,Derby etc),I have developed certain queries which I would like to get answered :-1)what all Apache projects use Java ?
2) which apache project will be easier to start with for a beginner ?
Thanks in advance . | apache | open-source | hadoop | null | null | null | open | How to contribute to apache ?
===
I am an intermediate Java learner .I want to contribute to Apache Development,I saw there is a list of Apache Projects(like Hadoop,Derby etc),I have developed certain queries which I would like to get answered :-1)what all Apache projects use Java ?
2) which apache project will be easier to start with for a beginner ?
Thanks in advance . | 0 |
6,534,216 | 06/30/2011 11:46:52 | 790,937 | 06/09/2011 12:53:53 | 2 | 0 | Does SAPI 5.1 had good accuracy? | I had a doubt that does SAPI has good accuracy in voice recognition? when i try to read numbers from one to ten , the accuracy is not even 3%. i had a doubt that whether i did wrong or the SAPI itself is unstable in terms of accuracy? I shocked that the engine is not able to recognize 1 to 10 numbers perfectly. I fed up with its accuracy, do we have any other open source for C# for voice recognition
Regards
Bhuvan | c# | sapi | null | null | null | null | open | Does SAPI 5.1 had good accuracy?
===
I had a doubt that does SAPI has good accuracy in voice recognition? when i try to read numbers from one to ten , the accuracy is not even 3%. i had a doubt that whether i did wrong or the SAPI itself is unstable in terms of accuracy? I shocked that the engine is not able to recognize 1 to 10 numbers perfectly. I fed up with its accuracy, do we have any other open source for C# for voice recognition
Regards
Bhuvan | 0 |
3,382,859 | 08/01/2010 16:51:36 | 406,863 | 07/30/2010 15:17:48 | 3 | 0 | Solving a recreational square packing problem | I was asked to find a 11x11-grid containing the digits such that one can read the squares of 1,...,100. Here read means that you fix the starting grid and direction (8 possibilities) and if you can find for example digits 1,0,0,0,0,4 consecutively, you have found the squares of 1, 2, 10 and 20. I made a program which uses best-first search to find a solution but it is too slow. Does anyone knows a better algorithm to solve the problem?
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <vector>
#include <algorithm>
using namespace std;
int val[21][21];//number which is present on position
int vnum[21][21];//number of times the position is used - useful if you want to backtrack
//5 unit borders
int mx[4]={-1,0,1,0};//movement arrays
int my[4]={0,-1,0,1};
int check(int x,int y,int v,int m)//check if you can place number - if you can, return number of overlaps
{
int c=1;
while(v)//extract digits one by one
{
if(vnum[x][y] && (v%10)!=val[x][y])
return 0;
if(vnum[x][y])
c++;
v/=10;
x+=mx[m];
y+=my[m];
}
return c;
}
void apply(int x,int y,int v,int m)//place number - no sanity checks
{
while(v)//extract digits one by one
{
val[x][y]=v%10;
vnum[x][y]++;
v/=10;
x+=mx[m];
y+=my[m];
}
}
void deapply(int x,int y,int v,int m)//remove number - no sanity checks
{
while(v)
{
vnum[x][y]--;
v/=10;
x+=mx[m];
y+=my[m];
}
}
int best=100;
void recur(int num)//go down a semi-random path
{
if(num<best)
{
best=num;
if(best)
printf("FAILED AT %d\n",best);
else
printf("SUCCESS\n");
for(int x=5;x<16;x++) // 16 and 16
{
for(int y=5;y<16;y++)
{
if(vnum[x][y]==0)
putchar('.');
else
putchar(val[x][y]+'0');
}
putchar('\n');
}
fflush(stdout);
}
if(num==0)
return;
int s=num*num,t;
vector<int> poss;
for(int x=5;x<16;x++)
for(int y=5;y<16;y++)
for(int m=0;m<4;m++)
if(t=check(x,y,s,m))
poss.push_back((x)|(y<<8)|(m<<16)|(t<<24));//compress four numbers into an int
if(poss.size()==0)
return;
sort(poss.begin(),poss.end());//essentially sorting by t
t=poss.size()-1;
while(t>=0 && (poss[t]>>24)==(poss.back()>>24))
t--;
t++;
//t is now equal to the smallest index which has the maximal overlap
t=poss[rand()%(poss.size()-t)+t];//select random index>=t
apply(t%256,(t>>8)%256,s,(t>>16)%256);//extract random number
recur(num-1);//continue down path
}
int main()
{
srand((unsigned)time(0));//seed
while(true)
{
for(int i=0;i<21;i++)//reset board
{
memset(val[i],-1,21*sizeof(int));
memset(vnum[i],-1,21*sizeof(int));
}
for(int i=5;i<16;i++)
{
memset(val[i]+5,0,11*sizeof(int));
memset(vnum[i]+5,0,11*sizeof(int));
}
recur(100);
}
} | algorithm | null | null | null | null | null | open | Solving a recreational square packing problem
===
I was asked to find a 11x11-grid containing the digits such that one can read the squares of 1,...,100. Here read means that you fix the starting grid and direction (8 possibilities) and if you can find for example digits 1,0,0,0,0,4 consecutively, you have found the squares of 1, 2, 10 and 20. I made a program which uses best-first search to find a solution but it is too slow. Does anyone knows a better algorithm to solve the problem?
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <vector>
#include <algorithm>
using namespace std;
int val[21][21];//number which is present on position
int vnum[21][21];//number of times the position is used - useful if you want to backtrack
//5 unit borders
int mx[4]={-1,0,1,0};//movement arrays
int my[4]={0,-1,0,1};
int check(int x,int y,int v,int m)//check if you can place number - if you can, return number of overlaps
{
int c=1;
while(v)//extract digits one by one
{
if(vnum[x][y] && (v%10)!=val[x][y])
return 0;
if(vnum[x][y])
c++;
v/=10;
x+=mx[m];
y+=my[m];
}
return c;
}
void apply(int x,int y,int v,int m)//place number - no sanity checks
{
while(v)//extract digits one by one
{
val[x][y]=v%10;
vnum[x][y]++;
v/=10;
x+=mx[m];
y+=my[m];
}
}
void deapply(int x,int y,int v,int m)//remove number - no sanity checks
{
while(v)
{
vnum[x][y]--;
v/=10;
x+=mx[m];
y+=my[m];
}
}
int best=100;
void recur(int num)//go down a semi-random path
{
if(num<best)
{
best=num;
if(best)
printf("FAILED AT %d\n",best);
else
printf("SUCCESS\n");
for(int x=5;x<16;x++) // 16 and 16
{
for(int y=5;y<16;y++)
{
if(vnum[x][y]==0)
putchar('.');
else
putchar(val[x][y]+'0');
}
putchar('\n');
}
fflush(stdout);
}
if(num==0)
return;
int s=num*num,t;
vector<int> poss;
for(int x=5;x<16;x++)
for(int y=5;y<16;y++)
for(int m=0;m<4;m++)
if(t=check(x,y,s,m))
poss.push_back((x)|(y<<8)|(m<<16)|(t<<24));//compress four numbers into an int
if(poss.size()==0)
return;
sort(poss.begin(),poss.end());//essentially sorting by t
t=poss.size()-1;
while(t>=0 && (poss[t]>>24)==(poss.back()>>24))
t--;
t++;
//t is now equal to the smallest index which has the maximal overlap
t=poss[rand()%(poss.size()-t)+t];//select random index>=t
apply(t%256,(t>>8)%256,s,(t>>16)%256);//extract random number
recur(num-1);//continue down path
}
int main()
{
srand((unsigned)time(0));//seed
while(true)
{
for(int i=0;i<21;i++)//reset board
{
memset(val[i],-1,21*sizeof(int));
memset(vnum[i],-1,21*sizeof(int));
}
for(int i=5;i<16;i++)
{
memset(val[i]+5,0,11*sizeof(int));
memset(vnum[i]+5,0,11*sizeof(int));
}
recur(100);
}
} | 0 |
7,085,059 | 08/16/2011 21:09:44 | 897,524 | 08/16/2011 21:09:44 | 1 | 0 | IPad app launch timeout | I'm developing an IPad application that use a prefeatched database with a synchronisation feature of course, when the app start, it checks for the existence of its database on Document directory, if database doesn't exists the application copy its database from ressource file to document directory.
when I start testing the application with a smaller database (< 300 MB) the application start correctly, but when I test it with the real database (5 GB) the application is stopped due to timeout
can anyone have an idea of how to increase the launch timeout for the application? is there another approch to do database copy without having to deal with this problem?
Thank's in advance
Regards | ipad | application | timeout | launch | null | null | open | IPad app launch timeout
===
I'm developing an IPad application that use a prefeatched database with a synchronisation feature of course, when the app start, it checks for the existence of its database on Document directory, if database doesn't exists the application copy its database from ressource file to document directory.
when I start testing the application with a smaller database (< 300 MB) the application start correctly, but when I test it with the real database (5 GB) the application is stopped due to timeout
can anyone have an idea of how to increase the launch timeout for the application? is there another approch to do database copy without having to deal with this problem?
Thank's in advance
Regards | 0 |
1,133,994 | 07/15/2009 20:53:14 | 25,640 | 10/06/2008 21:49:57 | 275 | 22 | When to add "..." to the end of buttons? | I've noticed that many Microsoft applications will name some buttons with "..." at the end. These buttons always seem to open up a new dialog. There are some buttons, however, that don't have "...", but do open up new dialog.
For example, in Windows XP, when I open a folder's "Properties" dialog from Windows Explorer, there is an "Advanced..." button under the "General" tab. This button, as expected, opens a new dialog. There is also an "Advanced" button under the "Security" tab. This button also opens a new dialog, but this button doesn't end with "...".
To me, this seems inconsistent, but maybe I'm misinterpreting the meaning. Is there any written guidance for using "..." on buttons? | windows | user-interface | user-experience | button | null | null | open | When to add "..." to the end of buttons?
===
I've noticed that many Microsoft applications will name some buttons with "..." at the end. These buttons always seem to open up a new dialog. There are some buttons, however, that don't have "...", but do open up new dialog.
For example, in Windows XP, when I open a folder's "Properties" dialog from Windows Explorer, there is an "Advanced..." button under the "General" tab. This button, as expected, opens a new dialog. There is also an "Advanced" button under the "Security" tab. This button also opens a new dialog, but this button doesn't end with "...".
To me, this seems inconsistent, but maybe I'm misinterpreting the meaning. Is there any written guidance for using "..." on buttons? | 0 |
11,690,956 | 07/27/2012 15:27:57 | 970,696 | 09/29/2011 08:23:44 | 681 | 0 | Is functional spec a "design document"? | So I have been a bit lost in the terms, so first of all I present you what I have learned so far:
System requirements specification - what users want, what the system should do
Functional requirement - how the things, which users want, will actually work in the application
Also I would say that the latter is a design document. Is that right or is there another document in addition to these? | testing | documentation | null | null | null | 07/27/2012 15:39:01 | off topic | Is functional spec a "design document"?
===
So I have been a bit lost in the terms, so first of all I present you what I have learned so far:
System requirements specification - what users want, what the system should do
Functional requirement - how the things, which users want, will actually work in the application
Also I would say that the latter is a design document. Is that right or is there another document in addition to these? | 2 |
8,147,655 | 11/16/2011 06:33:54 | 714,805 | 04/19/2011 08:30:40 | 3 | 1 | MySQL Stored Routine Nested Cursor Issue | I need to loop through every record in first cursor "age_cur" and check the v_age value is in between of the from_value and to_value of second cursor "def_cur" and update the table with the matching display_value. When I run this it only update only one record. Which is the first record. Could any one tell me the issue.
Following is my code
CREATE PROCEDURE `dw`.`age_bucket_loader` ()
BEGIN
DECLARE v_person_key int;
DECLARE v_age int;
DECLARE v_age_bucket varchar(20);
DECLARE v_from_value int;
DECLARE v_to_value int;
DECLARE v_notfound BOOL default FALSE;
DECLARE age_cur CURSOR FOR SELECT a.person_key,age
FROM `person_dim` a where a.person_id in (1,3,39,40,44,46,52,55);
DECLARE def_cur CURSOR FOR SELECT b.display_value,b.from_value,b.to_value
FROM `bucket_def` b where b.derivation_column='age';
DECLARE continue handler for not found set v_notfound := TRUE;
OPEN age_cur;
OPEN def_cur;
age_cur_loop:LOOP
FETCH age_cur into v_person_key,v_age;
def_cur_loop:Loop
FETCH def_cur into v_age_bucket,v_from_value,v_to_value;
if v_age >= v_from_value and v_age <= v_to_value then
Update `person_dim` set age_bucket=v_age_bucket where person_key=v_person_key and person_id in (1,3,39,40,44,46,52,55);
end if;
-- if v_notfound then
-- leave age_cur_loop;
-- end if;
END LOOP def_cur_loop;
END LOOP age_cur_loop;
CLOSE def_cur;
CLOSE age_cur;
END;
Thanks in Advance
Pathum | mysql | stored-procedures | nested | cursors | null | null | open | MySQL Stored Routine Nested Cursor Issue
===
I need to loop through every record in first cursor "age_cur" and check the v_age value is in between of the from_value and to_value of second cursor "def_cur" and update the table with the matching display_value. When I run this it only update only one record. Which is the first record. Could any one tell me the issue.
Following is my code
CREATE PROCEDURE `dw`.`age_bucket_loader` ()
BEGIN
DECLARE v_person_key int;
DECLARE v_age int;
DECLARE v_age_bucket varchar(20);
DECLARE v_from_value int;
DECLARE v_to_value int;
DECLARE v_notfound BOOL default FALSE;
DECLARE age_cur CURSOR FOR SELECT a.person_key,age
FROM `person_dim` a where a.person_id in (1,3,39,40,44,46,52,55);
DECLARE def_cur CURSOR FOR SELECT b.display_value,b.from_value,b.to_value
FROM `bucket_def` b where b.derivation_column='age';
DECLARE continue handler for not found set v_notfound := TRUE;
OPEN age_cur;
OPEN def_cur;
age_cur_loop:LOOP
FETCH age_cur into v_person_key,v_age;
def_cur_loop:Loop
FETCH def_cur into v_age_bucket,v_from_value,v_to_value;
if v_age >= v_from_value and v_age <= v_to_value then
Update `person_dim` set age_bucket=v_age_bucket where person_key=v_person_key and person_id in (1,3,39,40,44,46,52,55);
end if;
-- if v_notfound then
-- leave age_cur_loop;
-- end if;
END LOOP def_cur_loop;
END LOOP age_cur_loop;
CLOSE def_cur;
CLOSE age_cur;
END;
Thanks in Advance
Pathum | 0 |
4,600,461 | 01/05/2011 03:01:13 | 561,395 | 01/03/2011 15:06:36 | 8 | 0 | How do I make it cross dissolve between 2 views when rotating to portrait? | I have a separate landscape view of a clock i've made and I want this to cross dissolve in when the phone is rotated to landscape, and then cross dissolve back when it returns to portrait, but when I've tried this in different ways, i've been having problems.
Suggestions on how I can do this? | iphone | objective-c | xcode | screen-rotation | null | null | open | How do I make it cross dissolve between 2 views when rotating to portrait?
===
I have a separate landscape view of a clock i've made and I want this to cross dissolve in when the phone is rotated to landscape, and then cross dissolve back when it returns to portrait, but when I've tried this in different ways, i've been having problems.
Suggestions on how I can do this? | 0 |
8,570,600 | 12/20/2011 03:55:16 | 1,107,066 | 12/20/2011 03:05:47 | 1 | 0 | java code in jsp | `<%
String add=request.getParameter("ads");
String e=request.getParameter("em");
String m=request.getParameter("mb");
int i=Integer.parseInt(m);
String sd=request.getParameter("idlist");
int is=Integer.parseInt(sd);
PreparedStatement pstat=null ;
String sq="INSERT into std_cont_info(id,address,email,con_number) VALUES (?,?,?,?)";
pstat=conn.prepareStatement(sq);
pstat.setInt(1, is);
pstat.setString(2,add );
pstat.setString(3, e);
pstat.setInt(4, i);
%>`
| jsp | null | null | null | null | 12/20/2011 17:04:17 | not a real question | java code in jsp
===
`<%
String add=request.getParameter("ads");
String e=request.getParameter("em");
String m=request.getParameter("mb");
int i=Integer.parseInt(m);
String sd=request.getParameter("idlist");
int is=Integer.parseInt(sd);
PreparedStatement pstat=null ;
String sq="INSERT into std_cont_info(id,address,email,con_number) VALUES (?,?,?,?)";
pstat=conn.prepareStatement(sq);
pstat.setInt(1, is);
pstat.setString(2,add );
pstat.setString(3, e);
pstat.setInt(4, i);
%>`
| 1 |
8,110,713 | 11/13/2011 09:27:20 | 215,929 | 11/21/2009 02:25:45 | 451 | 2 | Unfamiliar notation found in a computer science book | I'm reading through this computer science book and throughout the book I see a number of things written like so:
![example 1][1]
and then there's this:
![example 2][2]
and then this:![example 3][3]
What kind of notation is the "Boolean Expression" in example 1 written in? I've never seen anything like it before and I'm tempted to assume that whoever wrote and/or scanned this book in fell asleep at the keyboard, and assuming that it's even valid, what about the 3rd example? I'm pretty sure that's not C++ or VB.NET they're showing there.
[1]: http://i.stack.imgur.com/PYVnH.jpg
[2]: http://i.stack.imgur.com/7YJ0D.jpg
[3]: http://i.stack.imgur.com/ylvyR.jpg | boolean-expression | null | null | null | null | 11/14/2011 02:58:49 | off topic | Unfamiliar notation found in a computer science book
===
I'm reading through this computer science book and throughout the book I see a number of things written like so:
![example 1][1]
and then there's this:
![example 2][2]
and then this:![example 3][3]
What kind of notation is the "Boolean Expression" in example 1 written in? I've never seen anything like it before and I'm tempted to assume that whoever wrote and/or scanned this book in fell asleep at the keyboard, and assuming that it's even valid, what about the 3rd example? I'm pretty sure that's not C++ or VB.NET they're showing there.
[1]: http://i.stack.imgur.com/PYVnH.jpg
[2]: http://i.stack.imgur.com/7YJ0D.jpg
[3]: http://i.stack.imgur.com/ylvyR.jpg | 2 |
7,503,076 | 09/21/2011 16:11:52 | 802,147 | 06/16/2011 19:13:54 | 10 | 0 | Excel Filter with Macro | I want to write one macro it should work like Excel filter.After getting all the data using this filter i want to paste in to the new worksheet.
I know this is more verbose,but i dont have any knowledge how to do this.
Please help me with some code.
Regards,
Raju | vba | null | null | null | null | null | open | Excel Filter with Macro
===
I want to write one macro it should work like Excel filter.After getting all the data using this filter i want to paste in to the new worksheet.
I know this is more verbose,but i dont have any knowledge how to do this.
Please help me with some code.
Regards,
Raju | 0 |
8,198,577 | 11/20/2011 00:48:20 | 753,603 | 05/14/2011 12:33:29 | 2,054 | 72 | Got stuck while designing inheritance, Which one is correct? | Trying to write a trivial application, But I have stuck into one of the inheritance problem,
Which one of these is correct?
A).
![enter image description here][1]
**OR**
B).
![enter image description here][2]
Thanks for any input given.
[1]: http://i.stack.imgur.com/OZGKe.png
[2]: http://i.stack.imgur.com/BEAbk.png | java | design | inheritance | coding-style | null | 11/20/2011 04:07:37 | not a real question | Got stuck while designing inheritance, Which one is correct?
===
Trying to write a trivial application, But I have stuck into one of the inheritance problem,
Which one of these is correct?
A).
![enter image description here][1]
**OR**
B).
![enter image description here][2]
Thanks for any input given.
[1]: http://i.stack.imgur.com/OZGKe.png
[2]: http://i.stack.imgur.com/BEAbk.png | 1 |
11,426,473 | 07/11/2012 06:04:53 | 1,315,833 | 04/05/2012 16:50:42 | 80 | 0 | how LAN switch determines target computer in networks | How switch in data link layer determines which computer to send?
Router uses routing table.What does switch use?
| networking | null | null | null | null | 07/11/2012 21:55:08 | off topic | how LAN switch determines target computer in networks
===
How switch in data link layer determines which computer to send?
Router uses routing table.What does switch use?
| 2 |
10,060,589 | 04/08/2012 05:19:56 | 939,182 | 09/11/2011 13:12:11 | 90 | 0 | Why does the read() in FileInputStream return an integer? | [This][1] page shows says that it is so that the method can return -1 when it wants to indicate that there are no more bytes to be read.
But a byte ranges from -128 to 127, right? And wouldn't it make more sense for the return type of read() to be byte since it returns a byte?
Thank you for your time.
[1]: http://docs.oracle.com/javase/tutorial/essential/io/bytestreams.html | java | byte | fileinputstream | null | null | null | open | Why does the read() in FileInputStream return an integer?
===
[This][1] page shows says that it is so that the method can return -1 when it wants to indicate that there are no more bytes to be read.
But a byte ranges from -128 to 127, right? And wouldn't it make more sense for the return type of read() to be byte since it returns a byte?
Thank you for your time.
[1]: http://docs.oracle.com/javase/tutorial/essential/io/bytestreams.html | 0 |
4,150,012 | 11/10/2010 23:10:46 | 141,579 | 07/20/2009 18:41:00 | 286 | 7 | How to draw something (line, circle etc.) on a Gtk# Window ? | i'm using Mono and C#. I would like to create a "graphical" application.
In Winforms and .NET i can use System.Drawing.
What can i use with GTK# ?
And, how is the performance of Gtk under Windows ?
Thanks
| gtk# | null | null | null | null | null | open | How to draw something (line, circle etc.) on a Gtk# Window ?
===
i'm using Mono and C#. I would like to create a "graphical" application.
In Winforms and .NET i can use System.Drawing.
What can i use with GTK# ?
And, how is the performance of Gtk under Windows ?
Thanks
| 0 |
4,460,410 | 12/16/2010 11:43:29 | 1,012,739 | 06/09/2009 13:26:19 | 236 | 22 | WCF service type aliases | I wonder if it's possible to define some kind of type aliases (e.g. as in [Spring.NET][1]) to have shorter thus less error-prone configs, so instead of this:
<service behaviorConfiguration="ListenerBehavior" name="Corporation.Solution.Project.Namespace.GenericClass`1[[OtherCorp.Framework.Long.Class.Name, OtherCorp.Framework.Another.Long.Class.Name, Version=3.0.0.39, Culture=neutral, PublicKeyToken=null]]">
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:9485/Listener" />
</baseAddresses>
</host>
</service>
I would have something like this:
<service behaviorConfiguration="ListenerBehavior" name="ServiceTypeAlias">
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:9485/Listener" />
</baseAddresses>
</host>
</service>
Thanks.
[1]: http://www.springframework.net/ | c# | .net | wcf | null | null | null | open | WCF service type aliases
===
I wonder if it's possible to define some kind of type aliases (e.g. as in [Spring.NET][1]) to have shorter thus less error-prone configs, so instead of this:
<service behaviorConfiguration="ListenerBehavior" name="Corporation.Solution.Project.Namespace.GenericClass`1[[OtherCorp.Framework.Long.Class.Name, OtherCorp.Framework.Another.Long.Class.Name, Version=3.0.0.39, Culture=neutral, PublicKeyToken=null]]">
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:9485/Listener" />
</baseAddresses>
</host>
</service>
I would have something like this:
<service behaviorConfiguration="ListenerBehavior" name="ServiceTypeAlias">
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:9485/Listener" />
</baseAddresses>
</host>
</service>
Thanks.
[1]: http://www.springframework.net/ | 0 |
6,041,432 | 05/18/2011 07:46:24 | 388,916 | 07/11/2010 15:17:29 | 1,024 | 33 | Is there an equivalent for PHP PDO in Python? | My favorite element of PHP is the PDO object. Is there a library or built in module for Python that can rival it? | php | python | pdo | null | null | null | open | Is there an equivalent for PHP PDO in Python?
===
My favorite element of PHP is the PDO object. Is there a library or built in module for Python that can rival it? | 0 |
1,189,071 | 07/27/2009 16:08:26 | 98,514 | 04/30/2009 12:31:20 | 108 | 13 | Basics in Flex and ActionScript | I have a class with a method name, and now i have a Flex MXML... how would i call the id of the component in my ActionScript class...
| flex | and | java | null | null | null | open | Basics in Flex and ActionScript
===
I have a class with a method name, and now i have a Flex MXML... how would i call the id of the component in my ActionScript class...
| 0 |
6,743,320 | 07/19/2011 06:56:15 | 851,413 | 07/19/2011 06:56:15 | 1 | 0 | Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. | hi im getting an error 'Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding'. im alredy changed the connect timeout = 60000 and in database my procedure is executes in 43sec. so plz give me some perfect solution
thank u | timeout | expired | null | null | null | 07/19/2011 10:33:24 | not a real question | Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
===
hi im getting an error 'Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding'. im alredy changed the connect timeout = 60000 and in database my procedure is executes in 43sec. so plz give me some perfect solution
thank u | 1 |
2,042,885 | 01/11/2010 15:47:27 | 17,343 | 09/18/2008 07:18:53 | 1,705 | 88 | Add comma-separated value of grouped rows to existing query | I've got a view for reports, that looks something like this:
SELECT
a.id,
a.value1,
a.value2,
b.value1,
/* (+50 more such columns)*/
FROM a
JOIN b ON (b.id = a.b_id)
JOIN c ON (c.id = b.c_id)
LEFT JOIN d ON (d.id = b.d_id)
LEFT JOIN e ON (e.id = d.e_id)
/* (+10 more inner/left joins) */
It joins quite a view tables and returns lots of columns, but indexes are in place and performance is fine.
Now I want to add another column to the result, showing
* comma-separated values
* ordered by value
* from table y
* outer joined via intersection table x
* if `a.value3 IS NULL`, else take `a.value3`
To comma-separate the grouped values I use [Tom Kyte's stragg][1], could use [`COLLECT`][2] later.
Pseudo-code for the SELECT would look like that:
SELECT xx.id, COALESCE( a.value3, stragg( xx.val ) ) value3
FROM (
SELECT x.id, y.val
FROM x
WHERE x.a_id = a.id
JOIN y ON ( y.id = x.y_id )
ORDER BY y.val ASC
) xx
GROUP BY xx.id
There are at least three ways to do that:
1. I can put the second query into a PL/SQL function<br>This adds more SQL-PL/SQL context switching and an additional query for each row, but concatenates only when necessary.
1. I can `LEFT JOIN` the query for value3 as sub-query<br>This will do the concatenation for every row, also if `a.value3` is not null.
1. I can group the whole query by all the values except for `value3`.<br> This would make the query much harder to read and maintain.
What is the best way to do it? Any tips?
[1]: http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2196162600402
[2]: http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2196162600402#18313422264397
| oracle | 10g | sql | group | comma-separated | null | open | Add comma-separated value of grouped rows to existing query
===
I've got a view for reports, that looks something like this:
SELECT
a.id,
a.value1,
a.value2,
b.value1,
/* (+50 more such columns)*/
FROM a
JOIN b ON (b.id = a.b_id)
JOIN c ON (c.id = b.c_id)
LEFT JOIN d ON (d.id = b.d_id)
LEFT JOIN e ON (e.id = d.e_id)
/* (+10 more inner/left joins) */
It joins quite a view tables and returns lots of columns, but indexes are in place and performance is fine.
Now I want to add another column to the result, showing
* comma-separated values
* ordered by value
* from table y
* outer joined via intersection table x
* if `a.value3 IS NULL`, else take `a.value3`
To comma-separate the grouped values I use [Tom Kyte's stragg][1], could use [`COLLECT`][2] later.
Pseudo-code for the SELECT would look like that:
SELECT xx.id, COALESCE( a.value3, stragg( xx.val ) ) value3
FROM (
SELECT x.id, y.val
FROM x
WHERE x.a_id = a.id
JOIN y ON ( y.id = x.y_id )
ORDER BY y.val ASC
) xx
GROUP BY xx.id
There are at least three ways to do that:
1. I can put the second query into a PL/SQL function<br>This adds more SQL-PL/SQL context switching and an additional query for each row, but concatenates only when necessary.
1. I can `LEFT JOIN` the query for value3 as sub-query<br>This will do the concatenation for every row, also if `a.value3` is not null.
1. I can group the whole query by all the values except for `value3`.<br> This would make the query much harder to read and maintain.
What is the best way to do it? Any tips?
[1]: http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2196162600402
[2]: http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2196162600402#18313422264397
| 0 |
5,164,059 | 03/02/2011 06:14:41 | 636,740 | 02/27/2011 18:58:42 | 66 | 0 | Why is .NET separate from the Windows operating system? | Since .NET is so important to Windows, and Microsoft delivers both .NET and Windows, why doesn't Microsoft simply make .NET part of Windows? | c# | .net | asp.net | ado.net | vb | 03/02/2011 06:19:14 | not a real question | Why is .NET separate from the Windows operating system?
===
Since .NET is so important to Windows, and Microsoft delivers both .NET and Windows, why doesn't Microsoft simply make .NET part of Windows? | 1 |
11,705,357 | 07/28/2012 23:03:56 | 998,635 | 10/17/2011 06:30:05 | 561 | 8 | How to listen muliple TCP streams continously by stream_get_contents()? | By Default `stream_get_contents` waits and listen for 60 seconds.
if i have multiple streams and want to listen all of them continuously.
Inside foreach if i am listening one stream, i can't listen other ones.
What is the solution to listen and capture stream output for all streams continuously?
while(true){
//$streamArray is an array of streams obtained by stream_socket_client("tcp://..);
foreach($streamArray as $stream){
fputs($stream,$command);
stream_get_contents($stream); // and update file/DB
}
}
Note: For every stream i have already done `stream_set_blocking( $stream , true );` | php | sockets | stream | network-programming | streaming | null | open | How to listen muliple TCP streams continously by stream_get_contents()?
===
By Default `stream_get_contents` waits and listen for 60 seconds.
if i have multiple streams and want to listen all of them continuously.
Inside foreach if i am listening one stream, i can't listen other ones.
What is the solution to listen and capture stream output for all streams continuously?
while(true){
//$streamArray is an array of streams obtained by stream_socket_client("tcp://..);
foreach($streamArray as $stream){
fputs($stream,$command);
stream_get_contents($stream); // and update file/DB
}
}
Note: For every stream i have already done `stream_set_blocking( $stream , true );` | 0 |
1,620,135 | 10/25/2009 05:58:36 | 96,087 | 04/26/2009 00:19:04 | 163 | 2 | How to use money to become a better programmer? | I want to be improving as a programmer. I take time outside of work or university to achieve that goal. Time alloted for that goal is limited though because I want to do other important things too. Naturally, I want to know how to make this time more effective.
How can I use money at the problem of becoming a better programmer?
Buying and reading books so far is not effective because there's too much of a gap between reading books and actually writing code. There's improvement, but not much.
Watching screencasts and talks takes too long. Period.
Working on pet projects seems most effective, except big portion of time is spent writing code I already know how to write, and when I encounter something I don't know how to do, it takes long to achieve the right solution. (kinda) Plus there's no way to know if what I wrote is actually a good way to do it.
What other ways are there? Is it common to seek a programming teacher? Just like paying piano teachers and martial arts trainers.
What's the best way to use money to help solve this problem?
| teaching | training-courses | training | null | null | 09/21/2011 01:41:16 | off topic | How to use money to become a better programmer?
===
I want to be improving as a programmer. I take time outside of work or university to achieve that goal. Time alloted for that goal is limited though because I want to do other important things too. Naturally, I want to know how to make this time more effective.
How can I use money at the problem of becoming a better programmer?
Buying and reading books so far is not effective because there's too much of a gap between reading books and actually writing code. There's improvement, but not much.
Watching screencasts and talks takes too long. Period.
Working on pet projects seems most effective, except big portion of time is spent writing code I already know how to write, and when I encounter something I don't know how to do, it takes long to achieve the right solution. (kinda) Plus there's no way to know if what I wrote is actually a good way to do it.
What other ways are there? Is it common to seek a programming teacher? Just like paying piano teachers and martial arts trainers.
What's the best way to use money to help solve this problem?
| 2 |
10,723,412 | 05/23/2012 15:41:18 | 1,413,034 | 05/23/2012 15:33:24 | 1 | 0 | need to create array which prints maximum+location after taking 5 inputs | ` `import java.util.Scanner;
public class Arraymaxloc{
public static void main(String args[]){
Scanner s=new Scanner(System.in);
int[]a=new int[5];
int c=1;
while(c<a.length)
{
c= s.nextInt();
}
int max=a[0];
int loc=-1;
while(c<a.length)
{
if
(a[c]>max==true)
{ max=a[c];
loc=c;
c++;
}
else
{
c++;
}
System.out.println("max found at"+loc);
}
}
}
| arrays | null | null | null | null | 05/25/2012 06:51:27 | not a real question | need to create array which prints maximum+location after taking 5 inputs
===
` `import java.util.Scanner;
public class Arraymaxloc{
public static void main(String args[]){
Scanner s=new Scanner(System.in);
int[]a=new int[5];
int c=1;
while(c<a.length)
{
c= s.nextInt();
}
int max=a[0];
int loc=-1;
while(c<a.length)
{
if
(a[c]>max==true)
{ max=a[c];
loc=c;
c++;
}
else
{
c++;
}
System.out.println("max found at"+loc);
}
}
}
| 1 |
5,323,808 | 03/16/2011 10:16:39 | 662,262 | 03/16/2011 10:13:22 | 1 | 0 | about android first program | i want little bit idea about android program | android | null | null | null | null | 03/16/2011 10:42:08 | not a real question | about android first program
===
i want little bit idea about android program | 1 |
3,849,390 | 10/03/2010 10:29:47 | 184,600 | 10/05/2009 20:48:02 | 3,932 | 165 | How to cache HAML files in /tmp directory? | I'm having an issue with HAML where it is attempting to write to a read-only filesystem (on a Heroku-deployed app).
I can only write to `/tmp` and `/log`. How can I configure HAML to write files to the `/tmp` directory?
Thanks! | ruby-on-rails | ruby-on-rails-3 | heroku | haml | null | null | open | How to cache HAML files in /tmp directory?
===
I'm having an issue with HAML where it is attempting to write to a read-only filesystem (on a Heroku-deployed app).
I can only write to `/tmp` and `/log`. How can I configure HAML to write files to the `/tmp` directory?
Thanks! | 0 |
5,434,825 | 03/25/2011 15:48:54 | 621,865 | 02/17/2011 17:57:49 | 1 | 8 | Android NFC Dev Guide - known bug | Regarding to the [Android Dev Guide - NFC][1] I found a few mistakes in the development guide. I want to share my experience, so it is possible to develop an NFC-App.
After a month of search and many emails, phonecalls I reallized that nobody brought nfc to work under android 2.3.3 (beside one guy who keeps the secret).
Please feel free to add your solutions and errors from the Dev. Guide.
[1]: http://developer.android.com/guide/topics/nfc/index.html
` <meta-data android:name="android.nfc.action.TECH_DISCOVERED"
android:resource="@xml/nfc_tech_filter.xml" />
`
Error: No resource found that matches the given name at 'resource' with value @xml/nfc_tech_filter.xml
Solution: remove .xml
` <meta-data android:name="android.nfc.action.TECH_DISCOVERED"
android:resource="@xml/nfc_tech_filter" />
`
| android | nfc | null | null | null | 03/26/2011 10:35:37 | not a real question | Android NFC Dev Guide - known bug
===
Regarding to the [Android Dev Guide - NFC][1] I found a few mistakes in the development guide. I want to share my experience, so it is possible to develop an NFC-App.
After a month of search and many emails, phonecalls I reallized that nobody brought nfc to work under android 2.3.3 (beside one guy who keeps the secret).
Please feel free to add your solutions and errors from the Dev. Guide.
[1]: http://developer.android.com/guide/topics/nfc/index.html
` <meta-data android:name="android.nfc.action.TECH_DISCOVERED"
android:resource="@xml/nfc_tech_filter.xml" />
`
Error: No resource found that matches the given name at 'resource' with value @xml/nfc_tech_filter.xml
Solution: remove .xml
` <meta-data android:name="android.nfc.action.TECH_DISCOVERED"
android:resource="@xml/nfc_tech_filter" />
`
| 1 |
11,269,944 | 06/29/2012 22:54:41 | 1,492,287 | 06/29/2012 22:52:32 | 1 | 0 | Getting error when running this code to play a sound | I have this code set for an click listener on a list. I'm not sure whether I'm releasing incorrectly or what's going on, but randomly when playing a sound, the app crashes.
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
//Toast.makeText(getApplicationContext(),((TextView) view).getText(), Toast.LENGTH_SHORT).show();
try{
if(mp != null){
mp.reset();
}
mp = MediaPlayer.create(getApplicationContext(), soundItems[position]);
isRel = false;
if (mp != null) {
mp.start();
}
mp.setOnCompletionListener(new OnCompletionListener() {
@Override
public void onCompletion(MediaPlayer mp) {
// TODO Auto-generated method stub
mp.release();
isRel = true;
}
});
}catch (Exception e){
Log.d("error",e.getMessage());
}
}
| android | crash | mediaplayer | release | null | null | open | Getting error when running this code to play a sound
===
I have this code set for an click listener on a list. I'm not sure whether I'm releasing incorrectly or what's going on, but randomly when playing a sound, the app crashes.
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
//Toast.makeText(getApplicationContext(),((TextView) view).getText(), Toast.LENGTH_SHORT).show();
try{
if(mp != null){
mp.reset();
}
mp = MediaPlayer.create(getApplicationContext(), soundItems[position]);
isRel = false;
if (mp != null) {
mp.start();
}
mp.setOnCompletionListener(new OnCompletionListener() {
@Override
public void onCompletion(MediaPlayer mp) {
// TODO Auto-generated method stub
mp.release();
isRel = true;
}
});
}catch (Exception e){
Log.d("error",e.getMessage());
}
}
| 0 |
10,169,614 | 04/16/2012 06:30:22 | 554,217 | 12/26/2010 09:29:16 | 993 | 2 | jquery change display doesnt work | I want a div to become visible, when a "button" is pressed.
Here is the html that represents the button:
<span id='dl' class='btn' data-app-id=''>DOWNLOAD<br/>FREE</span></div>
Here is the html of the div in its initial stage before the button is pressed.
<div class='box' id='dlbox' style='display:none'>
<div class='title'><span class='text'>Confirm install</span><span id='x1' class='x'></span></div>
<p>Click to install </p>
<p><?php echo "<span style='font-weight:bold'>$app->appName</span>"; ?></p>
<p>
</div>
The jquery is this:
$("#dl").live("click", function(){
$("#dlblank").toggle();
$("#dlbox").toggle();});
The css of the div when "toggled":
.box {
position: absolute;
background: #4d0404;
opacity: none;
z-index: 9001;
-webkit-box-shadow: 0 5px 7px black;
text-align: center;
color: white;
top: 50px;
}
| jquery | html | css | null | null | null | open | jquery change display doesnt work
===
I want a div to become visible, when a "button" is pressed.
Here is the html that represents the button:
<span id='dl' class='btn' data-app-id=''>DOWNLOAD<br/>FREE</span></div>
Here is the html of the div in its initial stage before the button is pressed.
<div class='box' id='dlbox' style='display:none'>
<div class='title'><span class='text'>Confirm install</span><span id='x1' class='x'></span></div>
<p>Click to install </p>
<p><?php echo "<span style='font-weight:bold'>$app->appName</span>"; ?></p>
<p>
</div>
The jquery is this:
$("#dl").live("click", function(){
$("#dlblank").toggle();
$("#dlbox").toggle();});
The css of the div when "toggled":
.box {
position: absolute;
background: #4d0404;
opacity: none;
z-index: 9001;
-webkit-box-shadow: 0 5px 7px black;
text-align: center;
color: white;
top: 50px;
}
| 0 |
4,416,785 | 12/11/2010 12:52:27 | 376,298 | 06/25/2010 13:16:44 | 44 | 0 | iPhone sdk. Problem with base class derived from UITableViewController | I my app I have 2 similar controllers - ReceivedFilesController and SentFilesController - derived from UITableViewController. When DRYing the code I wish to extract all the common functionality into a base class FilesController that inherits UITableViewController.
The problem is that the build process fails with error "FilesController class is not found" when I try to to inherit it in Received/SentFilesController class (the header file is imported)
Should I use there some mixin mechanism? If so, how can I add instance variables to the mixin class definition? Also, how can I architect an hierarchy of mixins for the UITableViewController class: for example, I want to have MyBaseController class derived from UITableViewController class, FilesController class to be derived from MyBaseController class, and Received/SentFilesController classes to be derived from FilesController.
Help will be appreciated! | iphone | objective-c | null | null | null | null | open | iPhone sdk. Problem with base class derived from UITableViewController
===
I my app I have 2 similar controllers - ReceivedFilesController and SentFilesController - derived from UITableViewController. When DRYing the code I wish to extract all the common functionality into a base class FilesController that inherits UITableViewController.
The problem is that the build process fails with error "FilesController class is not found" when I try to to inherit it in Received/SentFilesController class (the header file is imported)
Should I use there some mixin mechanism? If so, how can I add instance variables to the mixin class definition? Also, how can I architect an hierarchy of mixins for the UITableViewController class: for example, I want to have MyBaseController class derived from UITableViewController class, FilesController class to be derived from MyBaseController class, and Received/SentFilesController classes to be derived from FilesController.
Help will be appreciated! | 0 |
3,571,912 | 08/26/2010 03:48:08 | 121,466 | 06/11/2009 16:41:15 | 237 | 3 | jqGrid save state with local json data | I need to persist the sort, filter and pagination state of a jqGrid that is loading the full data set from the server initially via JSON and then running locally from then on. I've tried jQGridState but was unable to get it to save anything but nulls (apparently I'm not alone). I've also tried the solution from http://stackoverflow.com/questions/3015203/ but was unable to get it to even create the cookie.
Has anyone worked through either of these solutions with local data or made something work another way?
thanks in advance... | jqgrid | null | null | null | null | null | open | jqGrid save state with local json data
===
I need to persist the sort, filter and pagination state of a jqGrid that is loading the full data set from the server initially via JSON and then running locally from then on. I've tried jQGridState but was unable to get it to save anything but nulls (apparently I'm not alone). I've also tried the solution from http://stackoverflow.com/questions/3015203/ but was unable to get it to even create the cookie.
Has anyone worked through either of these solutions with local data or made something work another way?
thanks in advance... | 0 |
6,645,177 | 07/11/2011 02:20:04 | 549,432 | 12/21/2010 03:00:58 | 16 | 1 | Java method returning List and a integer | I have a method which reads a file and returns the contents of the text file in a list of String array. Find the implementation of the method and how I read it below.Now I want to have the number of lines in the file as well. I can get it as shown below in the comment - Can you pls let me know how can I pass the integer variable as well from the method and read the integer as well below - i.e read file shpoudl return List consisting of string arrays and an int as well -Thanks
public List<String[]> readFile() {
final List<String[]> userList = new ArrayList<String[]>();
BufferedReader bufferedreader = null;
try {
final String FileName="abs.txt"
bufferedreader = new BufferedReader(new FileReader(FileName));
String line = null;
while ((line = bufferedreader.readLine()) != null) {
// Add Variable ++ to get number of lines
final String[] values = line.split(",");
userList.add(values);
}
}
catch (FileNotFoundException ex) {
logError(ex.getMessage());
}
catch (IOException ex) {
logError(ex.getMessage());
}
finally {
try {
if (bufferedreader != null)
{
bufferedreader.close();}
}
catch (IOException ex) {
logError(ex.getMessage());
}
}
return userList;
}
This is how I read it
list<String[]> usersArray1 = new ArrayList<String[]>();
usersArray1=complianceTracker.readFile(); | java | null | null | null | null | null | open | Java method returning List and a integer
===
I have a method which reads a file and returns the contents of the text file in a list of String array. Find the implementation of the method and how I read it below.Now I want to have the number of lines in the file as well. I can get it as shown below in the comment - Can you pls let me know how can I pass the integer variable as well from the method and read the integer as well below - i.e read file shpoudl return List consisting of string arrays and an int as well -Thanks
public List<String[]> readFile() {
final List<String[]> userList = new ArrayList<String[]>();
BufferedReader bufferedreader = null;
try {
final String FileName="abs.txt"
bufferedreader = new BufferedReader(new FileReader(FileName));
String line = null;
while ((line = bufferedreader.readLine()) != null) {
// Add Variable ++ to get number of lines
final String[] values = line.split(",");
userList.add(values);
}
}
catch (FileNotFoundException ex) {
logError(ex.getMessage());
}
catch (IOException ex) {
logError(ex.getMessage());
}
finally {
try {
if (bufferedreader != null)
{
bufferedreader.close();}
}
catch (IOException ex) {
logError(ex.getMessage());
}
}
return userList;
}
This is how I read it
list<String[]> usersArray1 = new ArrayList<String[]>();
usersArray1=complianceTracker.readFile(); | 0 |
7,259,794 | 08/31/2011 15:54:13 | 38,581 | 11/18/2008 13:52:31 | 72 | 0 | How can i get class methods to work as callbacks with python ctypes? | I have an C api that i'm interfacing with the python ctypes package. Everything works well, except this little tidbit.
To register functions as callbacks to some notifications, i call this function :
void RegisterNotifyCallback( int loginId, int extraFlags, void *(*callbackFunc)(Notification *))
so in python my code looks like :
CALLBACK = ctypes.CFUNCTYPE(None, ctypes.POINTER(Notification))
func = CALLBACK(myPythonCallback)
myLib.RegisterNofityCallback(45454, 0, func)
If the value of myPythonCallback is a FunctionType (i.e. not a class method), it works fine and calls the callback function with the correct parameters. If it's a MethodType, it still calls the method but then blows up with a segfault once the method is finished.
Is there an easy away around this ? Or can someone offer me an explanation as to why this is happening ?
Many thanks,
Al.
| python | ctypes | null | null | null | null | open | How can i get class methods to work as callbacks with python ctypes?
===
I have an C api that i'm interfacing with the python ctypes package. Everything works well, except this little tidbit.
To register functions as callbacks to some notifications, i call this function :
void RegisterNotifyCallback( int loginId, int extraFlags, void *(*callbackFunc)(Notification *))
so in python my code looks like :
CALLBACK = ctypes.CFUNCTYPE(None, ctypes.POINTER(Notification))
func = CALLBACK(myPythonCallback)
myLib.RegisterNofityCallback(45454, 0, func)
If the value of myPythonCallback is a FunctionType (i.e. not a class method), it works fine and calls the callback function with the correct parameters. If it's a MethodType, it still calls the method but then blows up with a segfault once the method is finished.
Is there an easy away around this ? Or can someone offer me an explanation as to why this is happening ?
Many thanks,
Al.
| 0 |
335,727 | 12/02/2008 22:41:31 | 1,455 | 08/15/2008 17:03:04 | 101 | 11 | Measuring trust for users of a service. | Lets say you have a service that dispenses some sort of media. This media can be damaged. It is only possible for the users to know if the media is damaged after they use the service and receive the media. So to make your users happy, you want to be able to have the users turn the media back in for a refund. However malicious users will obviously try to game this system by asking for refund on perfectly good media.
The question of how to decide whether or not to trust a given user has been on my mind for some time. How should users build trust? How should trust be spent?
I imagine there must be some academic research on how to construct 'trust' values for known users and so on. Anyone have links to papers or some sort of research? I would even be happy to read random thoughts on the problem but I am more interested in actual papers.
| business | null | null | null | null | 05/06/2012 23:19:56 | not constructive | Measuring trust for users of a service.
===
Lets say you have a service that dispenses some sort of media. This media can be damaged. It is only possible for the users to know if the media is damaged after they use the service and receive the media. So to make your users happy, you want to be able to have the users turn the media back in for a refund. However malicious users will obviously try to game this system by asking for refund on perfectly good media.
The question of how to decide whether or not to trust a given user has been on my mind for some time. How should users build trust? How should trust be spent?
I imagine there must be some academic research on how to construct 'trust' values for known users and so on. Anyone have links to papers or some sort of research? I would even be happy to read random thoughts on the problem but I am more interested in actual papers.
| 4 |
3,708,366 | 09/14/2010 11:23:20 | 174,129 | 09/16/2009 06:00:16 | 1,125 | 73 | Converting an image to text | I want to be able to save an image as text in a xml file and I can't manage to find a efficient way to do it !
So far I tried :
QByteArray ImageAsByteArray;
QBuffer ImageBuffer(&ImageAsByteArray);
ImageBuffer.open(QIODevice::WriteOnly);
rImage.save(&ImageBuffer, "PNG");
return QString(ImageAsByteArray.toBase64());
Despite the fact it's working, the result is a file that is huge ! I tried adding some QCompress in there but without much success... Actually the QCompress doesn't seem to compress anything...
I think I'm doing it the wrong way, but could someone enlight my path please ? | qt | text | qimage | qstring | qpixmap | null | open | Converting an image to text
===
I want to be able to save an image as text in a xml file and I can't manage to find a efficient way to do it !
So far I tried :
QByteArray ImageAsByteArray;
QBuffer ImageBuffer(&ImageAsByteArray);
ImageBuffer.open(QIODevice::WriteOnly);
rImage.save(&ImageBuffer, "PNG");
return QString(ImageAsByteArray.toBase64());
Despite the fact it's working, the result is a file that is huge ! I tried adding some QCompress in there but without much success... Actually the QCompress doesn't seem to compress anything...
I think I'm doing it the wrong way, but could someone enlight my path please ? | 0 |
5,504,392 | 03/31/2011 18:13:32 | 361,833 | 06/08/2010 21:45:32 | 199 | 5 | Examples of Pretty, but Complex Web UIs | I'm looking for examples of great UI within a complex web-based application (complex defined as an application with numerous navigation points, tons of options, tons of features, and maybe some customizability). | user-interface | null | null | null | null | 04/01/2011 21:00:48 | off topic | Examples of Pretty, but Complex Web UIs
===
I'm looking for examples of great UI within a complex web-based application (complex defined as an application with numerous navigation points, tons of options, tons of features, and maybe some customizability). | 2 |
5,990,983 | 05/13/2011 11:06:28 | 652,460 | 03/09/2011 21:42:19 | 42 | 0 | Genetic programming from a specification language? | I'm searching for papers which describe how to make a fitness function in genetic programming use a specification language such as z notation in order to evolve a program which matches the specification. Does anyone know of any relevant research or implementations? | specification | genetic-programming | null | null | null | 05/13/2011 11:26:21 | not a real question | Genetic programming from a specification language?
===
I'm searching for papers which describe how to make a fitness function in genetic programming use a specification language such as z notation in order to evolve a program which matches the specification. Does anyone know of any relevant research or implementations? | 1 |
10,029,978 | 04/05/2012 13:55:34 | 1,186,817 | 02/03/2012 05:53:50 | 17 | 11 | Good tutorial on I/O in Java | Can anybody please provide a link of a website(preferred),book which teaches Java I/O concepts at a very basic level and step by step dives into it. | java | io | null | null | null | 04/16/2012 15:47:10 | not constructive | Good tutorial on I/O in Java
===
Can anybody please provide a link of a website(preferred),book which teaches Java I/O concepts at a very basic level and step by step dives into it. | 4 |
11,693,924 | 07/27/2012 18:49:53 | 1,558,502 | 07/27/2012 18:43:39 | 1 | 0 | T-sql sly query. I must wrote query in once line | There are two tables that were created by scripts below; you are tasked to write the SQL query that displays a list of students who have the maximum average score. Please, provide two solutions with the following limitations
a) You can use neither subqueries nor cursors nor additional tables
b) You can use neither subqueries nor cursors nor additional tables nor GROUP BY clause
create table Students
(
ID int identity(1,1) primary key not null,
StudentName varchar(200) not null,
);
create table StudentMarks
(
ID int identity (1,1) primary key not null,
Student_ID int not null references Students (ID),
Mark int not null check (mark between 1 and 5)
);
insert into Students
(StudentName)
values
('Ivanov'),
('Petrov'),
('Sydorov'),
('Semenov');
insert into StudentMarks
(Student_ID,Mark)
values
(1,3), (1,4), (1,3), (1,5),
(2,3), (2,4), (2,3), (2,5),
(3,3), (3,3), (3,5), (3,3) | tsql | null | null | null | null | 07/27/2012 18:53:35 | not a real question | T-sql sly query. I must wrote query in once line
===
There are two tables that were created by scripts below; you are tasked to write the SQL query that displays a list of students who have the maximum average score. Please, provide two solutions with the following limitations
a) You can use neither subqueries nor cursors nor additional tables
b) You can use neither subqueries nor cursors nor additional tables nor GROUP BY clause
create table Students
(
ID int identity(1,1) primary key not null,
StudentName varchar(200) not null,
);
create table StudentMarks
(
ID int identity (1,1) primary key not null,
Student_ID int not null references Students (ID),
Mark int not null check (mark between 1 and 5)
);
insert into Students
(StudentName)
values
('Ivanov'),
('Petrov'),
('Sydorov'),
('Semenov');
insert into StudentMarks
(Student_ID,Mark)
values
(1,3), (1,4), (1,3), (1,5),
(2,3), (2,4), (2,3), (2,5),
(3,3), (3,3), (3,5), (3,3) | 1 |
11,285,098 | 07/01/2012 19:43:42 | 650,806 | 03/09/2011 02:26:41 | 28 | 0 | how can i draw a flow chart like this? | This will help me a lot. Anyone knows what tool is used to draw a chart like below?
Thanks in advance.
 | charts | null | null | null | null | 07/01/2012 19:53:02 | not a real question | how can i draw a flow chart like this?
===
This will help me a lot. Anyone knows what tool is used to draw a chart like below?
Thanks in advance.
 | 1 |
4,474,513 | 12/17/2010 20:28:34 | 386,167 | 07/06/2010 16:49:25 | 174 | 7 | Complex business logic in repository | I have a method in a repository with a very complex business logic. I just read that there should be no business logic in a repository.
Removing the business logic from this method will require me to distribute the logic among two other repositories (because it involves two other entities).
Then my question is -what pattern should I use to implement this complex logic? It will need to consume these three repositories, but I cannot place it in a controller because I need to reuse it. Thank you for your help. | asp.net-mvc | null | null | null | null | null | open | Complex business logic in repository
===
I have a method in a repository with a very complex business logic. I just read that there should be no business logic in a repository.
Removing the business logic from this method will require me to distribute the logic among two other repositories (because it involves two other entities).
Then my question is -what pattern should I use to implement this complex logic? It will need to consume these three repositories, but I cannot place it in a controller because I need to reuse it. Thank you for your help. | 0 |
8,924,943 | 01/19/2012 11:02:34 | 1,153,517 | 01/17/2012 09:06:55 | 1 | 0 | How i can get the detailes of media file in android using java code | i had created a one media player application in that i want to find the details of songs in list view such as artist name, year,length,genre etc.
plzz send me reply ..thnx | android | null | null | null | null | 01/19/2012 12:59:02 | not a real question | How i can get the detailes of media file in android using java code
===
i had created a one media player application in that i want to find the details of songs in list view such as artist name, year,length,genre etc.
plzz send me reply ..thnx | 1 |
9,550,848 | 03/03/2012 23:39:08 | 1,227,983 | 02/23/2012 09:42:59 | 1 | 0 | Getting text from custom ListView | As the title says really.. I have a list view with 3 text view's in it, see below.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:padding="20dp" >
<TextView
android:id="@+id/text1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:textColor="#000"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:id="@+id/text2"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:textSize="12sp"
android:textStyle="bold" />
<TextView
android:id="@+id/text3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textStyle="italic"
android:typeface="sans" />
</LinearLayout>
This is how I call it.
public void displayResultList(ArrayList<HashMap<String, String>> results2) {
// TODO Auto-generated method stub
lv = (ListView) findViewById(android.R.id.list);
SimpleAdapter adapter = new SimpleAdapter(this, results2,
R.layout.custom_row_view,
new String[] { "Ear", "Breed", "Sex" }, new int[] { R.id.text1,
R.id.text2, R.id.text3 });
lv.setAdapter(adapter);
}
and this is how I try to retrieve the text, but this doesn't work..
protected void onListItemClick(ListView l, View v, int position, long id) {
// TODO Auto-generated method stub
super.onListItemClick(l, v, position, id);
String item = (String) ((TextView) v).getText();
Toast toast3 = Toast.makeText(this, "items = " + item,
Toast.LENGTH_SHORT);
toast3.show();
// Intent mainIntent3 = new Intent(this,CowDetailsActivity.class);
// mainIntent3.putExtra("cow", item.substring(10, 16));
// startActivity(mainIntent3);
}
Can anybody tell me how I can get the first line of text?
Thanks in advance
| java | android | null | null | null | null | open | Getting text from custom ListView
===
As the title says really.. I have a list view with 3 text view's in it, see below.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:padding="20dp" >
<TextView
android:id="@+id/text1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:textColor="#000"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:id="@+id/text2"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:textSize="12sp"
android:textStyle="bold" />
<TextView
android:id="@+id/text3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textStyle="italic"
android:typeface="sans" />
</LinearLayout>
This is how I call it.
public void displayResultList(ArrayList<HashMap<String, String>> results2) {
// TODO Auto-generated method stub
lv = (ListView) findViewById(android.R.id.list);
SimpleAdapter adapter = new SimpleAdapter(this, results2,
R.layout.custom_row_view,
new String[] { "Ear", "Breed", "Sex" }, new int[] { R.id.text1,
R.id.text2, R.id.text3 });
lv.setAdapter(adapter);
}
and this is how I try to retrieve the text, but this doesn't work..
protected void onListItemClick(ListView l, View v, int position, long id) {
// TODO Auto-generated method stub
super.onListItemClick(l, v, position, id);
String item = (String) ((TextView) v).getText();
Toast toast3 = Toast.makeText(this, "items = " + item,
Toast.LENGTH_SHORT);
toast3.show();
// Intent mainIntent3 = new Intent(this,CowDetailsActivity.class);
// mainIntent3.putExtra("cow", item.substring(10, 16));
// startActivity(mainIntent3);
}
Can anybody tell me how I can get the first line of text?
Thanks in advance
| 0 |
8,880,256 | 01/16/2012 12:48:38 | 1,026,966 | 11/03/2011 04:33:24 | 26 | 0 | how to create a custom tab in my facebook page after recently changes made in facebook | how to create a custom tab in my facebook page. I was able to create it earlier but due to recently chanages made by face book I am not able to create it.
Earlier if I was creating new tab and adding any url then it was loading the url in iframe and showing contents of the page. Please refer this url for new changes.
https://developers.facebook.com/blog/post/611
It is very urgent. Can any one please tell me how to add app to a page and after going to that app it should show the content of specified url. | facebook | null | null | null | null | 01/17/2012 18:07:44 | off topic | how to create a custom tab in my facebook page after recently changes made in facebook
===
how to create a custom tab in my facebook page. I was able to create it earlier but due to recently chanages made by face book I am not able to create it.
Earlier if I was creating new tab and adding any url then it was loading the url in iframe and showing contents of the page. Please refer this url for new changes.
https://developers.facebook.com/blog/post/611
It is very urgent. Can any one please tell me how to add app to a page and after going to that app it should show the content of specified url. | 2 |
5,702,163 | 04/18/2011 11:28:33 | 663,456 | 03/16/2011 23:52:28 | 631 | 31 | GOTO considered harmless | The `goto` statement has been examined at great length in several SO discussions (see <a href="http://stackoverflow.com/questions/46586/goto-still-considered-harmful">this</a> and <a href="http://stackoverflow.com/questions/24451/goto-usage">that</a>), and I certainly don't want to revive those heated debates.
Instead, I'd like to concentrate on a single use case of `goto`s and discuss its value and possible alternatives.
Consider the following code snippet, which is common in (at least my own) FSMs:
while (state = next_state()) {
switch (state) {
case foo:
/* handle foo, and finally: */
if (error) goto cleanup;
break;
case bar:
/* handle bar, and finally: */
if (error) goto cleanup;
break;
/* ...other cases... */
}
}
return ok;
cleanup:
/* do some cleanup, i.e. free() local heap requests, adjust global state, and then: */
return error;
Swapping out the cleanup stuff in a separate function just in order to save the `goto`s seems awkward. On the other hand, we've been raised to condemn the use of `goto`s wherever possible.
My question: is my code example considered good style?
<br />
If not, are there feasible alternatives available?
Please adhere to the specific usage of `goto` described above. I don't want to delve into yet another discussion about the general use of `goto`.
| c | coding-style | goto | null | null | null | open | GOTO considered harmless
===
The `goto` statement has been examined at great length in several SO discussions (see <a href="http://stackoverflow.com/questions/46586/goto-still-considered-harmful">this</a> and <a href="http://stackoverflow.com/questions/24451/goto-usage">that</a>), and I certainly don't want to revive those heated debates.
Instead, I'd like to concentrate on a single use case of `goto`s and discuss its value and possible alternatives.
Consider the following code snippet, which is common in (at least my own) FSMs:
while (state = next_state()) {
switch (state) {
case foo:
/* handle foo, and finally: */
if (error) goto cleanup;
break;
case bar:
/* handle bar, and finally: */
if (error) goto cleanup;
break;
/* ...other cases... */
}
}
return ok;
cleanup:
/* do some cleanup, i.e. free() local heap requests, adjust global state, and then: */
return error;
Swapping out the cleanup stuff in a separate function just in order to save the `goto`s seems awkward. On the other hand, we've been raised to condemn the use of `goto`s wherever possible.
My question: is my code example considered good style?
<br />
If not, are there feasible alternatives available?
Please adhere to the specific usage of `goto` described above. I don't want to delve into yet another discussion about the general use of `goto`.
| 0 |
8,801,098 | 01/10/2012 09:37:57 | 1,021,509 | 10/31/2011 06:52:42 | 1 | 1 | Reduction of Error In php functions | I have a fairly unique case where the php.
4000000-200000 = 3.8E +6 I take data '4000000 'in database
but it is very strange why the reduction was 3.8E +6 How can I make a 3800000
Please help of you all | php | function | null | null | null | 01/12/2012 09:43:24 | not a real question | Reduction of Error In php functions
===
I have a fairly unique case where the php.
4000000-200000 = 3.8E +6 I take data '4000000 'in database
but it is very strange why the reduction was 3.8E +6 How can I make a 3800000
Please help of you all | 1 |
9,925,016 | 03/29/2012 12:09:57 | 1,300,701 | 03/29/2012 12:04:25 | 1 | 0 | I want to validate email depending on the domain they enter. Am checking for last domain as .com | I want to validate an email validation of type 'abc@xyz.com.com'
Should show an error message if they enter invalid domain name.
Would be very grateful for your help. | php | javascript | validation | email | null | 03/30/2012 18:57:44 | not a real question | I want to validate email depending on the domain they enter. Am checking for last domain as .com
===
I want to validate an email validation of type 'abc@xyz.com.com'
Should show an error message if they enter invalid domain name.
Would be very grateful for your help. | 1 |
11,464,925 | 07/13/2012 05:58:02 | 1,178,038 | 01/30/2012 12:24:20 | 384 | 25 | HOW TO PARSE A CSV FILE? | I am getting CSV file from this link can some one tell who to parse that file
http://www.myappdemo.com/contacts/contacts.csv
Thanks in advance. | iphone | objective-c | csv | null | null | 07/13/2012 06:16:28 | not a real question | HOW TO PARSE A CSV FILE?
===
I am getting CSV file from this link can some one tell who to parse that file
http://www.myappdemo.com/contacts/contacts.csv
Thanks in advance. | 1 |
3,845,040 | 10/02/2010 08:59:34 | 398,621 | 07/22/2010 01:24:37 | 1 | 0 | How to calculate that no sub range overlap each other and all sub range covers whole range in java? | I have a range in java implemented as a class which is divided into sub-ranges. The implementation is roughly as follows:
public class Range
{
static public class Key implements Comparable<Key>
{
public int start;
public int end;
...
}
Key range;
SortedMap<Key, Range> subRange;
}
I want to make a function that makes sure that no subrange overlaps each other and the combined range of the subrange covers total range completely. Start and end of each range may be equal.
Example of a valid object:
Range: start 1, end 10
subrange 1: start 1, end 2
subrange 2: start 3, end 9
subrange 3: start 10, end 10
What would be the best way to implement this? | java | algorithm | range | null | null | null | open | How to calculate that no sub range overlap each other and all sub range covers whole range in java?
===
I have a range in java implemented as a class which is divided into sub-ranges. The implementation is roughly as follows:
public class Range
{
static public class Key implements Comparable<Key>
{
public int start;
public int end;
...
}
Key range;
SortedMap<Key, Range> subRange;
}
I want to make a function that makes sure that no subrange overlaps each other and the combined range of the subrange covers total range completely. Start and end of each range may be equal.
Example of a valid object:
Range: start 1, end 10
subrange 1: start 1, end 2
subrange 2: start 3, end 9
subrange 3: start 10, end 10
What would be the best way to implement this? | 0 |
1,196,405 | 07/28/2009 20:03:37 | 141,346 | 07/20/2009 11:42:32 | 115 | 8 | how to keep yourself from perfectionism when coding | In personal projects I often find myself tinkering over code and keep rewriting it because there's always something that can be improved. I'm looking for ways to tell myself 'ok the code is not perfect but I need to move forward now'. How do you motivate yourself to go forward and take the imperfect code as is? | self-improvement | productivity | null | null | null | 03/02/2012 17:27:51 | not constructive | how to keep yourself from perfectionism when coding
===
In personal projects I often find myself tinkering over code and keep rewriting it because there's always something that can be improved. I'm looking for ways to tell myself 'ok the code is not perfect but I need to move forward now'. How do you motivate yourself to go forward and take the imperfect code as is? | 4 |
10,583,922 | 05/14/2012 13:05:28 | 1,275,456 | 03/17/2012 07:34:05 | 1 | 0 | how to make sortable drop down menu using ajax php & mysql in dreamweaver | Hello there i am building a software download site, i want to know how to make page content sortable using drop down menu with fading effect in Dreamweaver. i want to do it like CNET has done. please see the link
[CNET-Download.com- antivirus page][1]
[1]: http://download.cnet.com/windows/antivirus-software/?tag=rb_content;main
Please See: i am not perfect at ajax, php & mysql, if i can do it through dreamweaver that will be cool.
Is there any jquery plugin that can use to do it. | php | mysql | html | ajax | dreamweaver | 05/15/2012 14:48:45 | not a real question | how to make sortable drop down menu using ajax php & mysql in dreamweaver
===
Hello there i am building a software download site, i want to know how to make page content sortable using drop down menu with fading effect in Dreamweaver. i want to do it like CNET has done. please see the link
[CNET-Download.com- antivirus page][1]
[1]: http://download.cnet.com/windows/antivirus-software/?tag=rb_content;main
Please See: i am not perfect at ajax, php & mysql, if i can do it through dreamweaver that will be cool.
Is there any jquery plugin that can use to do it. | 1 |
3,694,554 | 09/12/2010 10:56:07 | 217,515 | 11/24/2009 03:07:13 | 30 | 2 | letter of demand or let it go - aged care software | I'm not sure if this is the place to ask for advice, but here goes.
About 2.5 years ago I wrote an application for an aged care group in collaboration with the clinical director of an aged care residence. He told me that the board of directors have no interest in the software I wrote, and that we could go into a partnership to sell it to other aged care places. I though this was a good idea - I had the technical ability and he had the right contacts in the aged care industry. There was something in an email from him to this effect which I still have as evidence. It is worth noting that I own the copyright to the software.
About 18 months after it was in use, it won one an award which was presented by the Minister for Ageing and it got some media coverage. It was shortly after this that the board changed their minds and decided that they were interested in the software. They have also decided to redevelop the software with another company.
Anyway, the end result has been they wanted me to sign a contract to assign all IP over to them. However, the contract implies that further development will use the IP I developed, and I understand I could use this as evidence.
My thoughts are to send a letter requesting a settlement amount with the evidence attached - if they pay they in return will own the software and the reputation of winning the award and there will be no conflicts in the future.
Any thoughts or experience would be greatly appreciated. | letter | demand | null | null | null | 09/13/2010 01:10:41 | off topic | letter of demand or let it go - aged care software
===
I'm not sure if this is the place to ask for advice, but here goes.
About 2.5 years ago I wrote an application for an aged care group in collaboration with the clinical director of an aged care residence. He told me that the board of directors have no interest in the software I wrote, and that we could go into a partnership to sell it to other aged care places. I though this was a good idea - I had the technical ability and he had the right contacts in the aged care industry. There was something in an email from him to this effect which I still have as evidence. It is worth noting that I own the copyright to the software.
About 18 months after it was in use, it won one an award which was presented by the Minister for Ageing and it got some media coverage. It was shortly after this that the board changed their minds and decided that they were interested in the software. They have also decided to redevelop the software with another company.
Anyway, the end result has been they wanted me to sign a contract to assign all IP over to them. However, the contract implies that further development will use the IP I developed, and I understand I could use this as evidence.
My thoughts are to send a letter requesting a settlement amount with the evidence attached - if they pay they in return will own the software and the reputation of winning the award and there will be no conflicts in the future.
Any thoughts or experience would be greatly appreciated. | 2 |
7,972,321 | 11/01/2011 20:14:03 | 425,911 | 08/20/2010 01:17:32 | 64 | 1 | rails generator won't work inside my spree application. | I am trying to integrate spree into a fresh install of a rails application. I am following along with the [getting started guide][1] on spree's website. I am at the step that tells me to call the generate command to create my Spree site. when doing this i get an error:
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/ext/module.rb:36:in `c
onst_missing': uninitialized constant Devise::IndifferentHash (NameError)
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/spree_auth-0.40.0/lib/spree_aut
h.rb:17:in `activate'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.1.1.rc2/lib/act
ive_support/callbacks.rb:413:in `_run_prepare_callbacks'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.1.1.rc2/lib/act
ive_support/callbacks.rb:81:in `run_callbacks'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/actionpack-3.1.1.rc2/lib/action
_dispatch/middleware/reloader.rb:46:in `prepare!'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/ap
plication/finisher.rb:41:in `block in <module:Finisher>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/in
itializable.rb:29:in `instance_exec'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/in
itializable.rb:29:in `run'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/in
itializable.rb:54:in `block in run_initializers'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/in
itializable.rb:53:in `each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/in
itializable.rb:53:in `run_initializers'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/ap
plication.rb:96:in `initialize!'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/ra
iltie/configurable.rb:30:in `method_missing'
from C:/Users/Edu/workspace/my_store/config/environment.rb:5:in `<top (r
equired)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/ap
plication.rb:83:in `require_environment!'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/co
mmands.rb:22:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I also get the same error if just simply run `rails g` or `rails generate` to see what generate tools i have available.
here is my gemfile for reference:
source 'http://rubygems.org'
gem 'rails', '3.1.1.rc2'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
gem 'spree'
gem 'rake', '0.9.2.2'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.1.0'
gem 'coffee-rails', '~> 3.1.0'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'
group :test do
# Pretty printed test output
gem 'turn', :require => false
end
[1]: http://guides.spreecommerce.com/getting_started.html | ruby-on-rails-3 | generator | spree | null | null | null | open | rails generator won't work inside my spree application.
===
I am trying to integrate spree into a fresh install of a rails application. I am following along with the [getting started guide][1] on spree's website. I am at the step that tells me to call the generate command to create my Spree site. when doing this i get an error:
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/ext/module.rb:36:in `c
onst_missing': uninitialized constant Devise::IndifferentHash (NameError)
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/spree_auth-0.40.0/lib/spree_aut
h.rb:17:in `activate'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.1.1.rc2/lib/act
ive_support/callbacks.rb:413:in `_run_prepare_callbacks'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.1.1.rc2/lib/act
ive_support/callbacks.rb:81:in `run_callbacks'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/actionpack-3.1.1.rc2/lib/action
_dispatch/middleware/reloader.rb:46:in `prepare!'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/ap
plication/finisher.rb:41:in `block in <module:Finisher>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/in
itializable.rb:29:in `instance_exec'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/in
itializable.rb:29:in `run'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/in
itializable.rb:54:in `block in run_initializers'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/in
itializable.rb:53:in `each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/in
itializable.rb:53:in `run_initializers'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/ap
plication.rb:96:in `initialize!'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/ra
iltie/configurable.rb:30:in `method_missing'
from C:/Users/Edu/workspace/my_store/config/environment.rb:5:in `<top (r
equired)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/ap
plication.rb:83:in `require_environment!'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/co
mmands.rb:22:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I also get the same error if just simply run `rails g` or `rails generate` to see what generate tools i have available.
here is my gemfile for reference:
source 'http://rubygems.org'
gem 'rails', '3.1.1.rc2'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
gem 'spree'
gem 'rake', '0.9.2.2'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.1.0'
gem 'coffee-rails', '~> 3.1.0'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'
group :test do
# Pretty printed test output
gem 'turn', :require => false
end
[1]: http://guides.spreecommerce.com/getting_started.html | 0 |
6,119,273 | 05/25/2011 03:38:16 | 767,829 | 05/24/2011 13:43:34 | 5 | 0 | touchesMoved <-- I can only see the y point | Why can I only see the "y" component of nowPoint changing, ["x" component is always "0"] ??
- (void) touchesMoved: (NSSet *) touches withEvent: (UIEvent *) event {
[super touchesMoved:touches withEvent:event];
CGPoint nowPoint = [[touches anyObject] locationInView:self.view];
CGPoint prevPoint = [[touches anyObject] previousLocationInView:self.view];
NSLog(@"x %d, y %d", nowPoint.x, nowPoint.y);
}
Thank you | iphone | touchesmoved | null | null | null | null | open | touchesMoved <-- I can only see the y point
===
Why can I only see the "y" component of nowPoint changing, ["x" component is always "0"] ??
- (void) touchesMoved: (NSSet *) touches withEvent: (UIEvent *) event {
[super touchesMoved:touches withEvent:event];
CGPoint nowPoint = [[touches anyObject] locationInView:self.view];
CGPoint prevPoint = [[touches anyObject] previousLocationInView:self.view];
NSLog(@"x %d, y %d", nowPoint.x, nowPoint.y);
}
Thank you | 0 |
7,860,722 | 10/22/2011 15:59:49 | 1,008,575 | 10/22/2011 13:19:18 | 1 | 0 | Display elements of a <ul> in two columns | Someone please help me to change current function to display elements in two columns,
function nextCode(flag)
{
var code = codes[flag];
$('.headers').html(''+code[0]+'');
var sum;for(var j=1;j<=code.length;j++)
{
sum+="<li>"+code[j]+"</li>";
}
sum="<ul>"+sum+"</ul>";
$('.options').html(''+sum+'');
}
This is generating a list in single column, But i want to display them in two columns..
Please help me on this. | javascript | jquery | null | null | null | null | open | Display elements of a <ul> in two columns
===
Someone please help me to change current function to display elements in two columns,
function nextCode(flag)
{
var code = codes[flag];
$('.headers').html(''+code[0]+'');
var sum;for(var j=1;j<=code.length;j++)
{
sum+="<li>"+code[j]+"</li>";
}
sum="<ul>"+sum+"</ul>";
$('.options').html(''+sum+'');
}
This is generating a list in single column, But i want to display them in two columns..
Please help me on this. | 0 |
10,841,837 | 05/31/2012 21:55:44 | 1,138,538 | 01/09/2012 11:20:48 | 139 | 0 | The meaning of export command in ubunto | I'm new in ubunto and I want to know what does **export** mean .Could you please tell mewhat this command do here?
export PATH=$PATH:/usr/src/hive/build/dist/bin/ | ubuntu | null | null | null | null | 06/01/2012 01:38:40 | off topic | The meaning of export command in ubunto
===
I'm new in ubunto and I want to know what does **export** mean .Could you please tell mewhat this command do here?
export PATH=$PATH:/usr/src/hive/build/dist/bin/ | 2 |
11,467,526 | 07/13/2012 09:15:25 | 1,434,388 | 06/04/2012 04:32:09 | 13 | 2 | android how to make menu icon side by side with title | how to make the menu icon display at beside of the title like below the action bar picture?
[action bar][1]
this is my program picture, is it possible to do it? please help~thanks
[my program][2]
sorry i am new user, can not upload the picture.
[1]: http://i.stack.imgur.com/vn3KA.png
[2]: http://i.stack.imgur.com/IKORM.png | android | menu | null | null | null | null | open | android how to make menu icon side by side with title
===
how to make the menu icon display at beside of the title like below the action bar picture?
[action bar][1]
this is my program picture, is it possible to do it? please help~thanks
[my program][2]
sorry i am new user, can not upload the picture.
[1]: http://i.stack.imgur.com/vn3KA.png
[2]: http://i.stack.imgur.com/IKORM.png | 0 |
8,931,064 | 01/19/2012 18:07:18 | 452,027 | 09/19/2010 16:48:06 | 135 | 0 | Tracking source position of AST nodes in a compiler (ocaml) | I'm writing a compiler in ocaml, using ocamllex/yacc. Things are going well, but I've a design problem. For each AST node I create, it'd be good to have information about line/character position of that node in the source code. That would be useful for providing error messages to the user later.
Now, I can add some kind of meta type to my nodes:
type node = Node1 of ... * meta | Node2 of ... * meta
but that seems redundant. Later, when I'm done with verifying the AST, I'll have to write
match n with
| NodeX(..., _) -> ...
in every `match` which is a waste of space.
What's the best way to solve this?
| compiler | ocaml | yacc | lex | ast | null | open | Tracking source position of AST nodes in a compiler (ocaml)
===
I'm writing a compiler in ocaml, using ocamllex/yacc. Things are going well, but I've a design problem. For each AST node I create, it'd be good to have information about line/character position of that node in the source code. That would be useful for providing error messages to the user later.
Now, I can add some kind of meta type to my nodes:
type node = Node1 of ... * meta | Node2 of ... * meta
but that seems redundant. Later, when I'm done with verifying the AST, I'll have to write
match n with
| NodeX(..., _) -> ...
in every `match` which is a waste of space.
What's the best way to solve this?
| 0 |
431,469 | 01/10/2009 18:14:33 | 25,418 | 10/06/2008 08:14:37 | 508 | 40 | How expensive is to dereference a pointer in C++? | how is it expensive to perform the dereference operation on a pointer in C++? I can imagine that the memory transfer is somehow proportional to the object size, but I want to know how much the mere dereference operation is expensive.
Thank you. | c++ | dereference | pointer | cost | null | null | open | How expensive is to dereference a pointer in C++?
===
how is it expensive to perform the dereference operation on a pointer in C++? I can imagine that the memory transfer is somehow proportional to the object size, but I want to know how much the mere dereference operation is expensive.
Thank you. | 0 |
8,001,514 | 11/03/2011 20:35:24 | 1,028,511 | 11/03/2011 20:31:36 | 1 | 0 | How to make an android app which determines location and finds nearest | I am creating an app for android which will be used by gym members. I need to find a tutorial or any other material which may help me to give the user an option to "find nearest gym". This will determine the location of the user and display their closest gym options to their location.
Thanks in advance! | android | application | null | null | null | null | open | How to make an android app which determines location and finds nearest
===
I am creating an app for android which will be used by gym members. I need to find a tutorial or any other material which may help me to give the user an option to "find nearest gym". This will determine the location of the user and display their closest gym options to their location.
Thanks in advance! | 0 |
9,076,555 | 01/31/2012 08:33:36 | 412,207 | 08/05/2010 17:04:29 | 134 | 0 | Read CSV, calculate and output to csv file | I'm trying to write to read values from csv file and do some calculations. CSV is looks like this -
id,calldate,src,destination,duration
33083,2011-12-19 05:17:57+06:30,98590149,1876,258
33084,2011-12-19 05:22:28+06:30,98590149,1876,69
33085,2011-12-19 05:23:45+06:30,98590149,1876,151
For the calculation, i just need to multiply the duration by 30 and append the result to the end of the particular row.
The input csv file can be quite large so I need to write efficient code with LINQ & C#
Please advice. | c# | asp.net | linq | null | null | 01/31/2012 09:43:42 | not a real question | Read CSV, calculate and output to csv file
===
I'm trying to write to read values from csv file and do some calculations. CSV is looks like this -
id,calldate,src,destination,duration
33083,2011-12-19 05:17:57+06:30,98590149,1876,258
33084,2011-12-19 05:22:28+06:30,98590149,1876,69
33085,2011-12-19 05:23:45+06:30,98590149,1876,151
For the calculation, i just need to multiply the duration by 30 and append the result to the end of the particular row.
The input csv file can be quite large so I need to write efficient code with LINQ & C#
Please advice. | 1 |
1,182,584 | 07/25/2009 17:35:18 | 45,843 | 12/12/2008 21:03:08 | 101 | 5 | Secure random number generation in PHP | Use case: the "I forgot my password" button. We can't find the user's original password because it's stored in hashed form, so the only thing to do is generate a new random password and e-mail it to him. This requires cryptographically unpredictable random numbers, for which mt_rand is not good enough, and in general we can't assume a hosting service will provide access to the operating system to install a cryptographic random number module etc. so I'm looking for a way to generate secure random numbers in PHP itself.
The solution I've come up with so far involves storing an initial seed, then for each call,
result = seed
seed = sha512(seed . mt_rand())
This is based on the security of the sha512 hash function (the mt_rand call is just to make life a little more difficult for an adversary who obtains a copy of the database).
Am I missing something, or are there better known solutions? | php | security | random | hash | null | null | open | Secure random number generation in PHP
===
Use case: the "I forgot my password" button. We can't find the user's original password because it's stored in hashed form, so the only thing to do is generate a new random password and e-mail it to him. This requires cryptographically unpredictable random numbers, for which mt_rand is not good enough, and in general we can't assume a hosting service will provide access to the operating system to install a cryptographic random number module etc. so I'm looking for a way to generate secure random numbers in PHP itself.
The solution I've come up with so far involves storing an initial seed, then for each call,
result = seed
seed = sha512(seed . mt_rand())
This is based on the security of the sha512 hash function (the mt_rand call is just to make life a little more difficult for an adversary who obtains a copy of the database).
Am I missing something, or are there better known solutions? | 0 |
5,431,182 | 03/25/2011 10:25:04 | 676,526 | 03/25/2011 10:25:04 | 1 | 0 | lip synchronization | Hello i am working on a project of lip synchronization..i am able to write a code for extraction of parametrs of input voice through a microphone...
i want to create an artificial face and to sync the lip movement with my real time input...
need it quite urgently...
thanks in advance
Akshay Joshi
| synchronization | null | null | null | null | 03/26/2011 00:00:56 | not a real question | lip synchronization
===
Hello i am working on a project of lip synchronization..i am able to write a code for extraction of parametrs of input voice through a microphone...
i want to create an artificial face and to sync the lip movement with my real time input...
need it quite urgently...
thanks in advance
Akshay Joshi
| 1 |
8,639,051 | 12/26/2011 20:55:20 | 1,116,723 | 12/26/2011 20:07:46 | 1 | 0 | iOS 5 newbie - need help in developing a iPhone app | I'm developing a first iPhone app for iOS 4.x/5.0 and have some confusions on how to comply with the recommended Apple guidelines. I have also attached code snippet.
Here is the scenario:
When the app loads, I want to show the following functionalities in the bottom of the screen: Test, Settings. My first question is do I have to go with a UISegmentedControl or UITabBar? The trickiest part is I don't want the first "Test" tab/button to be selected automatically. I want the user to select the tab/button. Until that happens, I want a timer that runs showing some text. I tried to use a UITabBar and when the app loads, the first "Test" tab is selected and the associated ViewController is shown by default. I circumvented this by pushing a "root view controller" in the "didFinishLaunchingWithOptions" method in the AppDelegate.m. This works and when I click on the "Scores" tab, it pops the "root view controller" and pushes the "test view controller". But if I select the "Settings" tab immediately after the app loads and click on the "Test" tab, the view controller for the "Test" tab is not loading at all, but the "main view controller" is still displayed. I also have a UINavigationController in place on the "Test" tab and I hide it in the "viewDidAppear" event. I also want to eliminate the animation (pushing back) when I click on the "Test" tab.
My confusions are:
1. Can I replace the UINavigationController with some other control to let the user click on a "Start/Stop" button (displayed on the top) when in the "test view controller"?.
2. Is there a click event on the tabs in the UITabBar for each of the tabs?
The following is the code snippet:
AppDelegate.m
=============
#import "NavTabTestAppDelegate.h"
#import "RootViewController.h"
#import "FirstViewController.h"
#import "SecondViewController.h"
@implementation NavTabTestAppDelegate
@synthesize window = _window;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
RootViewController *rootViewController = [[RootViewController alloc ] initWithNibName:@"RootViewController" bundle: nil];
[rootViewController.view setBackgroundColor:[UIColor blueColor]];
// [rootViewController setTitle:@"RootViewController"];
FirstViewController *firstViewController = [[FirstViewController alloc ] initWithNibName:@"FirstViewController" bundle: nil];
[firstViewController.view setBackgroundColor:[UIColor yellowColor]];
[firstViewController setTitle:@"FirstViewController"];
SecondViewController *secondViewController = [[SecondViewController alloc ] initWithNibName:@"SecondViewController" bundle: nil];
[secondViewController.view setBackgroundColor:[UIColor redColor]];
[secondViewController setTitle:@"SecondViewController"];
//create the navigation controller and use NavRootController as its root
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:firstViewController];
//create an array of views that will be passed to our tabbar
NSArray *viewsArray = [NSArray arrayWithObjects:nav, secondViewController, nil];
//Now create our tab bar controller
UITabBarController *tabbarController = [[UITabBarController alloc] init];
//then tell the tabbarcontroller to use our array of views
[tabbarController setViewControllers:viewsArray];
[nav pushViewController:rootViewController animated:NO];
//nav.view.hidden = YES;
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
//then the last step is to add the our tabbarcontroller as subview of the window
self.window.rootViewController = tabbarController;
return YES;
}
RootViewController.m (added the following code)
===============================================
- (void) viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:YES animated:animated];
// NSLog(@"Inside RootViewController.m viewWillAppear %@", animated);
}
- (void) viewWillDisappear:(BOOL)animated{
// NSLog(@"Inside RootViewController.m viewWillDisappear %@", "Done");
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:NO animated:NO];
}
FirstViewController.m (added the following code to prevent the animation but didn't work)
=========================================================================================
- (void) viewWillAppear:(BOOL)animated {
[super viewWillAppear:NO];
[self.navigationController setNavigationBarHidden:NO animated:NO];
// NSLog(@"Inside FirstViewController.m viewWillAppear %@", animated);
}
- (void) viewWillDisappear:(BOOL)animated{
// NSLog(@"Inside FirstViewController.m viewWillDisappear %@", "Done");
[super viewWillAppear:NO];
[self.navigationController setNavigationBarHidden:NO animated:NO];
}
NSLogs throws exception when I click on a tab (BAD_ACCESS). Couldn't figure out why.
I come from a Windows developer background and I apologize for the long post. Please help.
Thanks. | iphone | ios | ios5 | xcode4.2 | null | 12/27/2011 17:08:38 | not a real question | iOS 5 newbie - need help in developing a iPhone app
===
I'm developing a first iPhone app for iOS 4.x/5.0 and have some confusions on how to comply with the recommended Apple guidelines. I have also attached code snippet.
Here is the scenario:
When the app loads, I want to show the following functionalities in the bottom of the screen: Test, Settings. My first question is do I have to go with a UISegmentedControl or UITabBar? The trickiest part is I don't want the first "Test" tab/button to be selected automatically. I want the user to select the tab/button. Until that happens, I want a timer that runs showing some text. I tried to use a UITabBar and when the app loads, the first "Test" tab is selected and the associated ViewController is shown by default. I circumvented this by pushing a "root view controller" in the "didFinishLaunchingWithOptions" method in the AppDelegate.m. This works and when I click on the "Scores" tab, it pops the "root view controller" and pushes the "test view controller". But if I select the "Settings" tab immediately after the app loads and click on the "Test" tab, the view controller for the "Test" tab is not loading at all, but the "main view controller" is still displayed. I also have a UINavigationController in place on the "Test" tab and I hide it in the "viewDidAppear" event. I also want to eliminate the animation (pushing back) when I click on the "Test" tab.
My confusions are:
1. Can I replace the UINavigationController with some other control to let the user click on a "Start/Stop" button (displayed on the top) when in the "test view controller"?.
2. Is there a click event on the tabs in the UITabBar for each of the tabs?
The following is the code snippet:
AppDelegate.m
=============
#import "NavTabTestAppDelegate.h"
#import "RootViewController.h"
#import "FirstViewController.h"
#import "SecondViewController.h"
@implementation NavTabTestAppDelegate
@synthesize window = _window;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
RootViewController *rootViewController = [[RootViewController alloc ] initWithNibName:@"RootViewController" bundle: nil];
[rootViewController.view setBackgroundColor:[UIColor blueColor]];
// [rootViewController setTitle:@"RootViewController"];
FirstViewController *firstViewController = [[FirstViewController alloc ] initWithNibName:@"FirstViewController" bundle: nil];
[firstViewController.view setBackgroundColor:[UIColor yellowColor]];
[firstViewController setTitle:@"FirstViewController"];
SecondViewController *secondViewController = [[SecondViewController alloc ] initWithNibName:@"SecondViewController" bundle: nil];
[secondViewController.view setBackgroundColor:[UIColor redColor]];
[secondViewController setTitle:@"SecondViewController"];
//create the navigation controller and use NavRootController as its root
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:firstViewController];
//create an array of views that will be passed to our tabbar
NSArray *viewsArray = [NSArray arrayWithObjects:nav, secondViewController, nil];
//Now create our tab bar controller
UITabBarController *tabbarController = [[UITabBarController alloc] init];
//then tell the tabbarcontroller to use our array of views
[tabbarController setViewControllers:viewsArray];
[nav pushViewController:rootViewController animated:NO];
//nav.view.hidden = YES;
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
//then the last step is to add the our tabbarcontroller as subview of the window
self.window.rootViewController = tabbarController;
return YES;
}
RootViewController.m (added the following code)
===============================================
- (void) viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:YES animated:animated];
// NSLog(@"Inside RootViewController.m viewWillAppear %@", animated);
}
- (void) viewWillDisappear:(BOOL)animated{
// NSLog(@"Inside RootViewController.m viewWillDisappear %@", "Done");
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:NO animated:NO];
}
FirstViewController.m (added the following code to prevent the animation but didn't work)
=========================================================================================
- (void) viewWillAppear:(BOOL)animated {
[super viewWillAppear:NO];
[self.navigationController setNavigationBarHidden:NO animated:NO];
// NSLog(@"Inside FirstViewController.m viewWillAppear %@", animated);
}
- (void) viewWillDisappear:(BOOL)animated{
// NSLog(@"Inside FirstViewController.m viewWillDisappear %@", "Done");
[super viewWillAppear:NO];
[self.navigationController setNavigationBarHidden:NO animated:NO];
}
NSLogs throws exception when I click on a tab (BAD_ACCESS). Couldn't figure out why.
I come from a Windows developer background and I apologize for the long post. Please help.
Thanks. | 1 |
1,426,935 | 09/15/2009 12:39:15 | 155,332 | 08/12/2009 19:06:05 | 90 | 5 | Which one of the java spring books to start? | I am currently dealing with java spring framework and i have two good books to start but i dont know which one to go first? I have beginner knowladge about spring by the way.
1. [Spring in Action][1]
2. [Spring Recipies][2]
[1]: http://www.amazon.com/Spring-Action-Craig-Walls/dp/1933988134/ref=sr_1_2?ie=UTF8&s=books&qid=1253018028&sr=1-2
[2]: http://www.amazon.com/Spring-Recipes-Problem-Solution-Approach-Professionals/dp/1590599799/ref=sr_1_1?ie=UTF8&s=books&qid=1253018028&sr=1-1 | spring | java | frameworks | books | null | 07/09/2012 17:58:00 | not constructive | Which one of the java spring books to start?
===
I am currently dealing with java spring framework and i have two good books to start but i dont know which one to go first? I have beginner knowladge about spring by the way.
1. [Spring in Action][1]
2. [Spring Recipies][2]
[1]: http://www.amazon.com/Spring-Action-Craig-Walls/dp/1933988134/ref=sr_1_2?ie=UTF8&s=books&qid=1253018028&sr=1-2
[2]: http://www.amazon.com/Spring-Recipes-Problem-Solution-Approach-Professionals/dp/1590599799/ref=sr_1_1?ie=UTF8&s=books&qid=1253018028&sr=1-1 | 4 |
11,524,073 | 07/17/2012 13:57:33 | 79,020 | 03/17/2009 13:57:21 | 33 | 3 | How does TSQL store the information in Job Schedule Properties? | I know there is SELECT * FROM msdb..sysjobschedules, but that just shows the next time a job is scheduled to run. I want to know how this is all determined and stored. So where does it store the value for Recurs every Monday checkbox? | sql | tsql | job-scheduling | null | null | 07/17/2012 14:05:34 | off topic | How does TSQL store the information in Job Schedule Properties?
===
I know there is SELECT * FROM msdb..sysjobschedules, but that just shows the next time a job is scheduled to run. I want to know how this is all determined and stored. So where does it store the value for Recurs every Monday checkbox? | 2 |
3,580,532 | 08/27/2010 00:26:23 | 160,511 | 08/21/2009 03:27:54 | 300 | 3 | R: read contents of text file as a query? | Using R, I just want to read the contents of a file into a variable like:
query <- read_file_contents('biglongquery.sql')
As to avoid putting, well, big long queries in the R script itself. I do _not_ want to read in data like CSV (e.g. `read.tables`), etc- just the raw text. | r | null | null | null | null | null | open | R: read contents of text file as a query?
===
Using R, I just want to read the contents of a file into a variable like:
query <- read_file_contents('biglongquery.sql')
As to avoid putting, well, big long queries in the R script itself. I do _not_ want to read in data like CSV (e.g. `read.tables`), etc- just the raw text. | 0 |
10,051,792 | 04/07/2012 04:36:49 | 1,131,227 | 01/05/2012 02:21:52 | 11 | 0 | Is rails routing failure caused by url rewriting? | I'm trying to get a basic 2.3.5 application working with apache2.
In the apache2 config I've used an Alias to map the URL to the right place:
> Alias /release /usr/local/rails/release/public
and in the .htaccess file there's an appropriate rewrite rule
> RewriteBase /release
I can see the default public/index.html, but when I remove this and set up a route for the root in routes.rb I get:
> No route matches "/release/" with {:method=>:get}
As an experiment I set up an explicit route for "/release/" and this worked - but I assume this isn't a fix because it will screw up the other URLs in the application.
Can anyone suggest how to tell whether the problem is in the routing or in the URL rewriting? I've tried turning on logging in the rewrite engine, but it didn't help. | ruby-on-rails | url-rewriting | apache2 | rails-routing | null | null | open | Is rails routing failure caused by url rewriting?
===
I'm trying to get a basic 2.3.5 application working with apache2.
In the apache2 config I've used an Alias to map the URL to the right place:
> Alias /release /usr/local/rails/release/public
and in the .htaccess file there's an appropriate rewrite rule
> RewriteBase /release
I can see the default public/index.html, but when I remove this and set up a route for the root in routes.rb I get:
> No route matches "/release/" with {:method=>:get}
As an experiment I set up an explicit route for "/release/" and this worked - but I assume this isn't a fix because it will screw up the other URLs in the application.
Can anyone suggest how to tell whether the problem is in the routing or in the URL rewriting? I've tried turning on logging in the rewrite engine, but it didn't help. | 0 |
5,292,349 | 03/13/2011 21:00:48 | 264,419 | 02/02/2010 14:40:53 | 1,428 | 74 | this is very likely to create a memory leak tomcat | I configured tomcat to work with a different external open source.
However, after the tomcat is running for a few minutes I get:
SEVERE: The web application [/MyProject] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@1b3f02f]) and a value of type [org.apache.axis.MessageContext] (value [org.apache.axis.MessageContext@5dbd4e]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
What could cause it?
Where do I have to look? could it be datapooling on tomcat?
And what does it mean Threads in tomcat? | tomcat | null | null | null | null | null | open | this is very likely to create a memory leak tomcat
===
I configured tomcat to work with a different external open source.
However, after the tomcat is running for a few minutes I get:
SEVERE: The web application [/MyProject] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@1b3f02f]) and a value of type [org.apache.axis.MessageContext] (value [org.apache.axis.MessageContext@5dbd4e]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
What could cause it?
Where do I have to look? could it be datapooling on tomcat?
And what does it mean Threads in tomcat? | 0 |
10,405,398 | 05/01/2012 22:42:04 | 1,289,282 | 03/23/2012 22:39:14 | 103 | 0 | php - session, check for admin | I have everything working on my login except for the admin user.
When I try to navigate to my admin.php I get "Must be logged in" even if I am already logged in as an admin.
When I click the admin link, I first go to checkAdmin.php which is the code below.
<?php
if($_SESSION['userEmail'] != 'admin@hotmail.com') {
echo "<center><font face='Verdana' size='2' color=red>Must be logged in</font> <br><a href=index.php>Login Here</a></center>";
exit;
}
?>
Am I doing something wrong on this?
Thanks. | php | null | null | null | null | null | open | php - session, check for admin
===
I have everything working on my login except for the admin user.
When I try to navigate to my admin.php I get "Must be logged in" even if I am already logged in as an admin.
When I click the admin link, I first go to checkAdmin.php which is the code below.
<?php
if($_SESSION['userEmail'] != 'admin@hotmail.com') {
echo "<center><font face='Verdana' size='2' color=red>Must be logged in</font> <br><a href=index.php>Login Here</a></center>";
exit;
}
?>
Am I doing something wrong on this?
Thanks. | 0 |
11,437,235 | 07/11/2012 16:32:36 | 1,301,411 | 03/29/2012 16:57:58 | 34 | 1 | Big error with wrong \' and \" of code's surrounding | I'm creating a interactive map of china and I need to use it in several pages, so I created a variable in php which contains the code but there are a lot of ' and " which cuts the code's surrounding, I already have this problem with the US map without adding \ for each ', can you help me or tell me what I have to do to solve this ? here's the code :
$zhmap = '<map name="FPMap0" id="FPMap0">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 香港特別行政區 (Hong Kong) </B></center>', FGCOLOR, '#FFCCFF');" onmouseout="nd();" shape="poly" coords="557, 561, 560, 561, 563, 560, 565, 560, 565, 567, 560, 568, 556, 568, 554, 566, 555, 562, 556, 562">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 海南省 </B></center>', FGCOLOR, '#CCFFFF');" onmouseout="nd();" shape="poly" coords="492, 643, 488, 641, 481, 641, 475, 633, 473, 625, 485, 616, 485, 612, 507, 607, 512, 608, 513, 615, 506, 624, 506, 630, 492, 642">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 台湾 </B></center>', FGCOLOR, '#FFFFFF');" onmouseout="nd();" shape="poly" coords="662, 499, 656, 504, 650, 513, 648, 523, 645, 533, 647, 541, 652, 547, 657, 552, 658, 558, 663, 559, 661, 551, 664, 544, 668, 537, 667, 526, 667, 509, 669, 502, 668, 500, 663, 500">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 河南省 </B></center>', FGCOLOR, '#FFFFCC');" onmouseout="nd();" shape="poly" coords="526, 334, 526, 345, 517, 353, 509, 354, 485, 366, 495, 384, 508, 399, 525, 399, 532, 401, 558, 411, 565, 402, 563, 394, 550, 389, 554, 383, 555, 376, 558, 368, 565, 371, 571, 367, 555, 358, 544, 351, 556, 336, 548, 334">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> Shanxi </B></center>', FGCOLOR, '#FFCCCC');" onmouseout="nd();" shape="poly" coords="484, 370, 483, 369, 487, 353, 483, 345, 483, 337, 483, 329, 485, 325, 485, 316, 482, 311, 486, 303, 489, 288, 497, 283, 501, 275, 504, 272, 508, 273, 511, 269, 516, 270, 522, 266, 523, 262, 531, 282, 520, 300, 528, 314, 523, 330, 526, 336, 525, 348, 509, 354, 484, 371">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> Ningxia Hui </B></center>', FGCOLOR, '#FFCCFF');" onmouseout="nd();" shape="poly" coords="406, 324, 421, 313, 421, 304, 429, 293, 432, 292, 435, 299, 430, 310, 438, 311, 443, 316, 441, 328, 435, 327, 431, 341, 437, 346, 432, 353, 429, 359, 423, 354, 417, 351, 417, 343, 414, 334, 408, 328">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> Liaoning </B></center>', FGCOLOR, '#FFFFCC');" onmouseout="nd();" shape="poly" coords="585, 223, 583, 228, 587, 241, 582, 249, 590, 254, 596, 261, 608, 247, 616, 244, 624, 250, 615, 266, 620, 270, 616, 280, 639, 256, 648, 255, 665, 236, 664, 230, 656, 216, 647, 201, 633, 198, 629, 208, 621, 212, 595, 233">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 山东省 </B></center>', FGCOLOR, '#FFCCCC');" onmouseout="nd();" shape="poly" coords="549, 325, 554, 316, 566, 303, 575, 297, 587, 295, 591, 307, 597, 311, 607, 305, 615, 298, 624, 300, 637, 298, 637, 305, 631, 306, 617, 320, 610, 323, 602, 341, 597, 344, 594, 350, 593, 355, 586, 352, 580, 355, 570, 350, 565, 356, 555, 357, 547, 352, 556, 335, 552, 334">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 江西省 </B></center>', FGCOLOR, '#FFCCCC');" onmouseout="nd();" shape="poly" coords="543, 455, 547, 448, 551, 447, 565, 436, 568, 438, 579, 431, 579, 437, 581, 440, 587, 436, 588, 433, 596, 437, 602, 437, 600, 443, 609, 455, 599, 464, 595, 463, 592, 467, 591, 475, 585, 482, 584, 493, 581, 501, 579, 511, 579, 519, 577, 523, 573, 520, 559, 527, 556, 523, 561, 515, 558, 510, 552, 515, 549, 508, 553, 503, 548, 496, 547, 491, 545, 484, 540, 480, 549, 465, 543, 458">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> Sichuan </B></center>', FGCOLOR, '#FFCCFF');" onmouseout="nd();" shape="poly" coords="311, 400, 319, 410, 328, 423, 325, 428, 329, 434, 330, 468, 333, 475, 341, 470, 346, 473, 344, 477, 353, 481, 368, 510, 377, 507, 383, 508, 387, 501, 384, 493, 393, 482, 393, 477, 399, 474, 398, 468, 405, 470, 406, 478, 410, 481, 417, 477, 421, 481, 434, 481, 432, 476, 425, 472, 430, 466, 434, 469, 430, 463, 424, 460, 419, 454, 426, 447, 424, 440, 427, 436, 435, 440, 442, 438, 447, 440, 451, 432, 452, 423, 462, 414, 459, 409, 458, 407, 450, 405, 440, 399, 431, 402, 423, 398, 417, 403, 408, 401, 404, 395, 403, 392, 399, 394, 388, 383, 388, 378, 375, 382, 378, 388, 376, 395, 369, 396, 363, 392, 354, 403, 342, 393, 337, 395, 331, 391, 314, 391, 311, 399">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 甘肃 </B></center>', FGCOLOR, '#CCFFCC');" onmouseout="nd();" shape="poly" coords="304, 234, 300, 245, 291, 246, 265, 262, 267, 286, 280, 291, 287, 292, 296, 298, 307, 294, 323, 293, 337, 301, 345, 299, 355, 310, 364, 317, 369, 315, 379, 331, 386, 345, 380, 355, 376, 362, 370, 373, 368, 377, 359, 372, 359, 379, 367, 380, 372, 385, 375, 378, 385, 375, 399, 392, 402, 389, 409, 401, 417, 402, 426, 394, 423, 388, 432, 386, 431, 379, 434, 374, 432, 370, 432, 363, 440, 363, 449, 362, 449, 357, 458, 357, 461, 350, 456, 346, 459, 339, 441, 330, 432, 339, 437, 347, 433, 351, 429, 358, 419, 352, 413, 334, 405, 325, 396, 321, 393, 309, 398, 306, 400, 298, 393, 291, 383, 295, 374, 300, 364, 299, 354, 289, 345, 284, 346, 279, 352, 274, 350, 268, 337, 266, 327, 272, 318, 259, 316, 246, 315, 238, 304, 233">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 广西壮族自治区 </B></center>', FGCOLOR, '#FFFFCC');" onmouseout="nd();" shape="poly" coords="409, 533, 409, 536, 414, 537, 421, 542, 433, 543, 434, 549, 425, 558, 429, 562, 440, 562, 445, 564, 444, 575, 452, 581, 460, 583, 468, 585, 473, 580, 482, 585, 490, 583, 496, 575, 500, 575, 500, 571, 505, 568, 504, 566, 515, 554, 514, 547, 520, 538, 523, 530, 521, 526, 515, 526, 512, 522, 510, 520, 507, 523, 507, 519, 511, 516, 510, 509, 510, 508, 508, 506, 507, 500, 501, 502, 494, 508, 490, 504, 487, 509, 482, 507, 469, 519, 466, 517, 459, 524, 449, 518, 438, 527, 435, 528, 431, 533, 419, 528, 410, 537">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 内蒙古自治区 (Өвөр Монгол) </B></center>', FGCOLOR, '#CCFFFF');" onmouseout="nd();" shape="poly" coords="534, 107, 530, 134, 524, 136, 527, 144, 531, 144, 538, 141, 544, 142, 546, 143, 553, 135, 562, 137, 577, 151, 576, 155, 565, 155, 555, 160, 548, 165, 539, 169, 537, 178, 528, 183, 522, 184, 508, 197, 499, 196, 494, 194, 490, 194, 483, 206, 492, 216, 476, 231, 461, 241, 443, 243, 437, 242, 425, 246, 408, 257, 403, 256, 401, 253, 389, 252, 374, 247, 368, 242, 350, 239, 329, 240, 315, 238, 317, 259, 327, 271, 334, 267, 350, 269, 353, 274, 347, 280, 346, 286, 354, 291, 363, 300, 373, 301, 388, 291, 396, 292, 400, 299, 399, 306, 394, 312, 397, 322, 406, 322, 419, 314, 420, 301, 430, 292, 433, 292, 436, 301, 432, 310, 437, 311, 443, 315, 448, 317, 455, 319, 468, 304, 477, 289, 481, 290, 485, 285, 489, 287, 493, 283, 497, 283, 501, 274, 503, 271, 508, 272, 511, 269, 516, 269, 521, 265, 519, 258, 520, 248, 525, 239, 530, 239, 534, 247, 545, 240, 550, 238, 554, 235, 554, 228, 562, 226, 570, 235, 575, 243, 584, 243, 584, 234, 581, 228, 586, 225, 594, 232, 600, 226, 610, 219, 618, 213, 626, 211, 633, 201, 628, 199, 629, 193, 621, 184, 614, 189, 609, 181">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 内蒙古自治区 (Өвөр Монгол) </B></center>', FGCOLOR, '#CCFFFF');" onmouseout="nd();" shape="poly" coords="607, 174, 609, 171, 600, 163, 601, 159, 607, 159, 612, 161, 612, 153, 613, 148, 618, 144, 612, 144, 604, 138, 605, 130, 619, 112, 623, 117, 625, 101, 627, 95, 625, 84, 629, 74, 631, 67, 619, 58, 612, 65, 603, 68, 596, 67, 592, 59, 592, 52, 585, 51, 582, 54, 575, 51, 579, 42, 575, 38, 566, 42, 561, 50, 565, 52, 571, 57, 568, 65, 563, 78, 558, 93, 561, 97, 549, 109, 540, 108, 532, 104, 532, 110, 531, 116">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 福建省 </B></center>', FGCOLOR, '#FFFFCC');" onmouseout="nd();" shape="poly" coords="600, 538, 597, 526, 591, 520, 589, 522, 586, 518, 580, 518, 581, 503, 584, 499, 586, 491, 585, 484, 592, 478, 592, 469, 596, 465, 599, 466, 609, 456, 612, 458, 615, 462, 618, 469, 622, 469, 627, 465, 631, 470, 635, 468, 640, 469, 637, 475, 634, 481, 629, 480, 632, 484, 632, 490, 632, 491, 633, 501, 628, 502, 626, 508, 622, 510, 620, 516, 612, 519, 614, 526, 601, 538">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 安徽省 </B></center>', FGCOLOR, '#CCCCFF');" onmouseout="nd();" shape="poly" coords="573, 436, 566, 422, 568, 418, 558, 413, 565, 404, 563, 394, 560, 396, 551, 390, 555, 383, 558, 371, 564, 374, 570, 370, 569, 363, 561, 359, 567, 358, 577, 365, 581, 365, 586, 370, 592, 370, 589, 376, 595, 384, 598, 384, 603, 381, 606, 383, 604, 386, 600, 387, 600, 393, 598, 396, 605, 403, 605, 407, 617, 409, 618, 414, 613, 419, 617, 420, 609, 422, 609, 430, 603, 438, 595, 438, 589, 434, 584, 435, 580, 431, 574, 437">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 上海 </B></center>', FGCOLOR, '#FFCCFF');" onmouseout="nd();" shape="poly" coords="648, 397, 642, 397, 637, 407, 643, 411, 649, 409, 654, 404, 651, 400, 644, 399">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> Yunnan </B></center>', FGCOLOR, '#CCFFCC');" onmouseout="nd();" shape="poly" coords="357, 582, 350, 590, 342, 589, 339, 578, 328, 577, 332, 561, 324, 560, 320, 548, 324, 544, 319, 542, 311, 542, 307, 545, 305, 544, 306, 538, 303, 535, 323, 506, 322, 492, 322, 488, 315, 481, 316, 475, 322, 474, 322, 463, 328, 458, 330, 472, 332, 477, 342, 470, 344, 474, 342, 480, 351, 481, 367, 510, 378, 508, 384, 509, 388, 503, 385, 493, 393, 483, 393, 478, 396, 476, 400, 474, 399, 471, 404, 471, 407, 479, 410, 482, 417, 479, 419, 485, 418, 488, 408, 490, 404, 488, 400, 489, 397, 492, 397, 498, 398, 503, 401, 504, 404, 502, 408, 502, 410, 506, 405, 516, 413, 525, 409, 538, 416, 541, 422, 545, 433, 547, 433, 553, 424, 559, 419, 559, 413, 565, 407, 570, 403, 566, 401, 572, 397, 568, 395, 570, 392, 568, 388, 574, 380, 568, 373, 574, 364, 576, 367, 585, 368, 592, 364, 596, 357, 587">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 广东省 </B></center>', FGCOLOR, '#CCCCFF');" onmouseout="nd();" shape="poly" coords="541, 574, 540, 570, 541, 561, 546, 568, 552, 559, 557, 558, 550, 563, 557, 559, 566, 555, 546, 565, 550, 563, 563, 557, 569, 555, 574, 554, 579, 556, 580, 552, 583, 556, 589, 550, 593, 551, 593, 547, 600, 539, 598, 529, 592, 523, 588, 524, 586, 521, 579, 520, 577, 524, 573, 522, 558, 530, 556, 525, 560, 516, 558, 513, 552, 517, 549, 513, 546, 516, 544, 517, 539, 514, 535, 518, 535, 523, 530, 520, 525, 521, 521, 528, 522, 530, 522, 535, 514, 550, 515, 558, 505, 569, 500, 575, 495, 580, 493, 588, 491, 592, 492, 601, 496, 607, 502, 603, 502, 600, 500, 594, 503, 591, 510, 583, 515, 582, 519, 582, 523, 578, 532, 576, 538, 575">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> Xinjiang Uyghur </B></center>', FGCOLOR, '#FFCCCC');" onmouseout="nd();" shape="poly" coords="305, 236, 299, 227, 291, 209, 270, 196, 251, 193, 239, 186, 240, 181, 244, 176, 244, 161, 240, 151, 240, 146, 230, 139, 226, 141, 221, 136, 219, 131, 216, 129, 215, 122, 216, 119, 205, 118, 199, 126, 190, 128, 187, 134, 187, 146, 181, 149, 177, 153, 157, 142, 144, 166, 145, 170, 143, 176, 135, 171, 125, 173, 113, 173, 119, 176, 117, 196, 117, 203, 107, 209, 106, 219, 97, 221, 87, 224, 78, 229, 71, 230, 63, 227, 51, 237, 46, 233, 43, 229, 41, 231, 37, 228, 32, 232, 23, 232, 22, 240, 15, 244, 15, 248, 16, 254, 21, 256, 27, 262">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> Xinjiang Uyghur </B></center>', FGCOLOR, '#FFCCCC');" onmouseout="nd();" shape="poly" coords="25, 266, 25, 275, 26, 279, 24, 281, 16, 281, 15, 283, 24, 286, 31, 295, 31, 301, 29, 304, 44, 318, 51, 319, 54, 321, 54, 330, 61, 339, 69, 339, 71, 341, 76, 335, 76, 331, 86, 326, 94, 328, 101, 332, 110, 325, 120, 328, 129, 334, 147, 332, 155, 333, 167, 327, 183, 324, 191, 326, 204, 333, 214, 332, 227, 332, 224, 324, 230, 319, 221, 308, 220, 296, 268, 288, 266, 261, 285, 250, 300, 245, 303, 238, 302, 237, 304, 235, 26, 262">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> Xizang </B><BR> (Tibet) </center>', FGCOLOR, '#CCFFFF');" onmouseout="nd();" shape="poly" coords="308, 402, 297, 418, 282, 415, 270, 402, 253, 401, 245, 397, 238, 398, 232, 393, 216, 388, 202, 363, 204, 359, 206, 356, 211, 339, 197, 331, 184, 325, 176, 329, 165, 327, 153, 337, 146, 333, 139, 337, 129, 338, 117, 328, 111, 326, 102, 335, 86, 326, 78, 333, 75, 338, 68, 347, 60, 343, 57, 354, 63, 360, 65, 360, 63, 369, 54, 371, 52, 367, 47, 369, 51, 376, 50, 380, 49, 384, 50, 388, 52, 387, 72, 409, 76, 413, 76, 416, 84, 411, 106, 432, 109, 439, 113, 435, 117, 439, 115, 442, 124, 449, 126, 449, 128, 454, 133, 455, 144, 464, 150, 462, 157, 467, 162, 468, 167, 469, 178, 467, 181, 469, 179, 474, 178, 476, 191, 467, 200, 466, 206, 471, 212, 472, 216, 472, 221, 473, 221, 476, 231, 477, 243, 466, 247, 464, 252, 464, 263, 457, 275, 461, 286, 455, 291, 459, 287, 464, 294, 465, 290, 471, 301, 474, 305, 474, 308, 470, 315, 475, 320, 475, 322, 466, 328, 460, 329, 437, 326, 427, 328, 425, 320, 415, 316, 408, 310, 403">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 黑龙江省 </B></center>', FGCOLOR, '#CCFFCC');" onmouseout="nd();" shape="poly" coords="731, 86, 715, 100, 701, 108, 698, 110, 693, 105, 694, 100, 687, 94, 674, 88, 662, 86, 656, 88, 648, 80, 645, 73, 631, 50, 618, 34, 612, 33, 608, 39, 596, 30, 577, 39, 580, 44, 575, 52, 580, 56, 586, 52, 591, 53, 594, 66, 599, 68, 608, 69, 614, 66, 621, 60, 631, 71, 628, 78, 626, 85, 628, 97, 623, 108, 624, 121, 620, 115, 606, 132, 605, 139, 614, 144, 618, 143, 619, 144, 613, 155, 617, 151, 624, 150, 627, 154, 632, 162, 641, 162, 647, 159, 651, 164, 658, 162, 666, 164, 665, 168, 673, 169, 678, 178, 682, 175, 678, 168, 681, 166, 685, 172, 688, 178, 693, 182, 696, 177, 704, 171, 707, 171, 713, 176, 719, 177, 717, 167, 710, 156, 715, 152, 720, 145, 724, 146, 734, 144, 734, 128, 736, 123, 734, 105, 740, 98, 734, 89">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> Jilin </B></center>', FGCOLOR, '#CCCCFF');" onmouseout="nd();" shape="poly" coords="695, 217, 690, 212, 701, 207, 703, 202, 708, 198, 708, 189, 712, 189, 715, 192, 721, 185, 720, 180, 716, 180, 706, 174, 701, 177, 694, 185, 688, 179, 683, 170, 681, 169, 683, 176, 679, 182, 674, 173, 667, 170, 665, 166, 658, 165, 652, 167, 649, 161, 644, 165, 634, 165, 626, 154, 617, 155, 613, 164, 610, 162, 602, 162, 604, 165, 609, 174, 610, 183, 614, 187, 616, 189, 623, 186, 629, 195, 631, 201, 638, 199, 642, 204, 649, 204, 653, 212, 659, 219, 662, 227, 666, 232, 667, 236, 675, 227, 674, 224, 678, 219, 682, 223, 693, 221">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 北京 </B></center>', FGCOLOR, '#FFCCFF');" onmouseout="nd();" shape="poly" coords="564, 257, 558, 257, 554, 253, 550, 256, 550, 262, 547, 267, 541, 273, 540, 276, 552, 279, 553, 279, 559, 276, 560, 274, 557, 271, 563, 269, 565, 266, 565, 260">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 天津 </B></center>', FGCOLOR, '#CCCCFF');" onmouseout="nd();" shape="poly" coords="571, 291, 567, 291, 563, 290, 560, 290, 559, 287, 561, 285, 560, 281, 558, 279, 559, 274, 563, 277, 564, 275, 565, 271, 565, 266, 569, 267, 569, 270, 568, 272, 570, 275, 574, 278, 575, 282, 573, 284, 573, 293">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> Shaanxi </B></center>', FGCOLOR, '#CCCCFF');" onmouseout="nd();" shape="poly" coords="454, 321, 444, 318, 441, 328, 460, 342, 458, 349, 461, 354, 457, 360, 449, 360, 438, 363, 432, 365, 432, 373, 435, 371, 435, 376, 433, 382, 433, 388, 425, 391, 426, 396, 424, 399, 431, 405, 440, 402, 453, 410, 460, 408, 469, 413, 476, 416, 477, 410, 474, 401, 485, 400, 477, 395, 475, 390, 492, 392, 496, 389, 496, 387, 482, 371, 485, 355, 483, 348, 483, 332, 482, 327, 485, 323, 485, 317, 482, 311, 487, 304, 489, 289, 486, 287, 480, 293, 477, 293, 470, 304">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 湖北省 </B></center>', FGCOLOR, '#FFCCFF');" onmouseout="nd();" shape="poly" coords="464, 437, 464, 445, 474, 456, 477, 450, 484, 443, 488, 446, 493, 445, 494, 442, 492, 438, 508, 440, 518, 446, 528, 441, 527, 446, 536, 439, 541, 450, 565, 435, 570, 438, 572, 435, 566, 421, 567, 418, 552, 409, 543, 406, 537, 405, 526, 400, 510, 400, 498, 390, 491, 392, 480, 392, 485, 396, 484, 398, 476, 401, 478, 408, 486, 421, 485, 428, 475, 433, 465, 439">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 河北省 </B></center>', FGCOLOR, '#CCFFCC');" onmouseout="nd();" shape="poly" coords="554, 231, 554, 238, 548, 242, 540, 247, 534, 249, 531, 245, 530, 241, 525, 242, 520, 258, 527, 269, 531, 284, 521, 301, 529, 313, 523, 330, 534, 336, 549, 336, 547, 329, 552, 323, 557, 311, 566, 306, 573, 303, 574, 297, 567, 292, 559, 292, 559, 281, 552, 281, 543, 280, 540, 275, 548, 265, 553, 254, 558, 258, 565, 260, 565, 269, 559, 276, 561, 278, 563, 275, 566, 266, 569, 267, 575, 279, 577, 283, 582, 283, 589, 277, 588, 272, 597, 264, 591, 258, 583, 253, 585, 246, 576, 247, 562, 228, 555, 232">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 贵州省 </B></center>', FGCOLOR, '#CCCCFF');" onmouseout="nd();" shape="poly" coords="419, 482, 419, 490, 414, 491, 408, 492, 404, 490, 397, 494, 399, 502, 403, 502, 408, 502, 410, 505, 409, 511, 405, 518, 413, 527, 409, 535, 420, 528, 430, 534, 431, 530, 449, 519, 458, 524, 466, 518, 469, 521, 480, 508, 480, 503, 479, 495, 481, 494, 480, 491, 475, 490, 472, 493, 471, 490, 477, 485, 478, 483, 478, 479, 476, 470, 472, 474, 464, 467, 460, 462, 457, 464, 452, 460, 451, 460, 449, 465, 444, 465, 440, 469, 434, 471, 431, 468, 427, 471, 432, 476, 434, 482, 419, 483">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 浙江省 </B></center>', FGCOLOR, '#CCFFCC');" onmouseout="nd();" shape="poly" coords="637, 407, 635, 407, 632, 410, 625, 410, 622, 407, 618, 407, 619, 416, 614, 424, 610, 424, 610, 431, 601, 441, 601, 444, 609, 455, 614, 457, 617, 466, 618, 469, 623, 468, 627, 464, 631, 469, 636, 467, 639, 468, 643, 468, 644, 464, 643, 458, 646, 456, 654, 445, 654, 441, 661, 436, 661, 434, 658, 431, 658, 428, 659, 423, 661, 421, 661, 418, 658, 416, 652, 415, 647, 414, 640, 420, 635, 421, 635, 419, 641, 413, 639, 411">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 重庆 </B></center>', FGCOLOR, '#FFFFCC');" onmouseout="nd();" shape="poly" coords="447, 442, 443, 439, 436, 441, 429, 436, 425, 441, 428, 447, 421, 454, 428, 458, 433, 463, 435, 468, 441, 467, 442, 462, 446, 461, 449, 464, 450, 455, 457, 458, 460, 456, 463, 458, 471, 471, 476, 466, 475, 457, 464, 446, 464, 439, 463, 436, 467, 433, 476, 432, 481, 427, 485, 426, 486, 419, 479, 411, 476, 418, 467, 412, 462, 409, 464, 413, 459, 418, 454, 422, 452, 434, 448, 444">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 江苏省 </B></center>', FGCOLOR, '#CCFFFF');" onmouseout="nd();" shape="poly" coords="619, 405, 628, 408, 637, 406, 638, 401, 645, 392, 638, 390, 646, 390, 638, 381, 630, 380, 628, 371, 616, 354, 608, 350, 605, 348, 602, 343, 594, 354, 583, 355, 571, 353, 569, 357, 585, 365, 591, 369, 592, 378, 598, 384, 606, 378, 607, 383, 600, 393, 604, 398, 608, 406">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 湖南省 </B></center>', FGCOLOR, '#CCFFFF');" onmouseout="nd();" shape="poly" coords="521, 525, 525, 519, 536, 519, 539, 511, 552, 512, 552, 503, 550, 486, 542, 478, 548, 466, 546, 449, 536, 440, 531, 443, 527, 443, 519, 446, 509, 440, 497, 441, 493, 446, 486, 443, 476, 455, 478, 467, 479, 482, 474, 491, 478, 491, 482, 505, 483, 507, 488, 507, 491, 503, 494, 506, 505, 500, 509, 507, 510, 515, 512, 518, 512, 521">
</map>
<img src="img/china.png" onclick="this.blur();" alt="Map of China" width="754" height="659" border="0" usemap="#FPMap0" class="imgBase" oncontextmenu="this.blur(); return false;">
<script type="text/javascript">
<!--
var ol_bgcolor='#666666';
var ol_textsize=2;
var ol_wrap = 1;
var ol_border = 2;
//-->
</script>
<script type="text/javascript" src="chinamap.js"></script>';
Thanks so much! | php | html | html5 | php5 | map | 07/16/2012 02:40:27 | too localized | Big error with wrong \' and \" of code's surrounding
===
I'm creating a interactive map of china and I need to use it in several pages, so I created a variable in php which contains the code but there are a lot of ' and " which cuts the code's surrounding, I already have this problem with the US map without adding \ for each ', can you help me or tell me what I have to do to solve this ? here's the code :
$zhmap = '<map name="FPMap0" id="FPMap0">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 香港特別行政區 (Hong Kong) </B></center>', FGCOLOR, '#FFCCFF');" onmouseout="nd();" shape="poly" coords="557, 561, 560, 561, 563, 560, 565, 560, 565, 567, 560, 568, 556, 568, 554, 566, 555, 562, 556, 562">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 海南省 </B></center>', FGCOLOR, '#CCFFFF');" onmouseout="nd();" shape="poly" coords="492, 643, 488, 641, 481, 641, 475, 633, 473, 625, 485, 616, 485, 612, 507, 607, 512, 608, 513, 615, 506, 624, 506, 630, 492, 642">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 台湾 </B></center>', FGCOLOR, '#FFFFFF');" onmouseout="nd();" shape="poly" coords="662, 499, 656, 504, 650, 513, 648, 523, 645, 533, 647, 541, 652, 547, 657, 552, 658, 558, 663, 559, 661, 551, 664, 544, 668, 537, 667, 526, 667, 509, 669, 502, 668, 500, 663, 500">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 河南省 </B></center>', FGCOLOR, '#FFFFCC');" onmouseout="nd();" shape="poly" coords="526, 334, 526, 345, 517, 353, 509, 354, 485, 366, 495, 384, 508, 399, 525, 399, 532, 401, 558, 411, 565, 402, 563, 394, 550, 389, 554, 383, 555, 376, 558, 368, 565, 371, 571, 367, 555, 358, 544, 351, 556, 336, 548, 334">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> Shanxi </B></center>', FGCOLOR, '#FFCCCC');" onmouseout="nd();" shape="poly" coords="484, 370, 483, 369, 487, 353, 483, 345, 483, 337, 483, 329, 485, 325, 485, 316, 482, 311, 486, 303, 489, 288, 497, 283, 501, 275, 504, 272, 508, 273, 511, 269, 516, 270, 522, 266, 523, 262, 531, 282, 520, 300, 528, 314, 523, 330, 526, 336, 525, 348, 509, 354, 484, 371">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> Ningxia Hui </B></center>', FGCOLOR, '#FFCCFF');" onmouseout="nd();" shape="poly" coords="406, 324, 421, 313, 421, 304, 429, 293, 432, 292, 435, 299, 430, 310, 438, 311, 443, 316, 441, 328, 435, 327, 431, 341, 437, 346, 432, 353, 429, 359, 423, 354, 417, 351, 417, 343, 414, 334, 408, 328">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> Liaoning </B></center>', FGCOLOR, '#FFFFCC');" onmouseout="nd();" shape="poly" coords="585, 223, 583, 228, 587, 241, 582, 249, 590, 254, 596, 261, 608, 247, 616, 244, 624, 250, 615, 266, 620, 270, 616, 280, 639, 256, 648, 255, 665, 236, 664, 230, 656, 216, 647, 201, 633, 198, 629, 208, 621, 212, 595, 233">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 山东省 </B></center>', FGCOLOR, '#FFCCCC');" onmouseout="nd();" shape="poly" coords="549, 325, 554, 316, 566, 303, 575, 297, 587, 295, 591, 307, 597, 311, 607, 305, 615, 298, 624, 300, 637, 298, 637, 305, 631, 306, 617, 320, 610, 323, 602, 341, 597, 344, 594, 350, 593, 355, 586, 352, 580, 355, 570, 350, 565, 356, 555, 357, 547, 352, 556, 335, 552, 334">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 江西省 </B></center>', FGCOLOR, '#FFCCCC');" onmouseout="nd();" shape="poly" coords="543, 455, 547, 448, 551, 447, 565, 436, 568, 438, 579, 431, 579, 437, 581, 440, 587, 436, 588, 433, 596, 437, 602, 437, 600, 443, 609, 455, 599, 464, 595, 463, 592, 467, 591, 475, 585, 482, 584, 493, 581, 501, 579, 511, 579, 519, 577, 523, 573, 520, 559, 527, 556, 523, 561, 515, 558, 510, 552, 515, 549, 508, 553, 503, 548, 496, 547, 491, 545, 484, 540, 480, 549, 465, 543, 458">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> Sichuan </B></center>', FGCOLOR, '#FFCCFF');" onmouseout="nd();" shape="poly" coords="311, 400, 319, 410, 328, 423, 325, 428, 329, 434, 330, 468, 333, 475, 341, 470, 346, 473, 344, 477, 353, 481, 368, 510, 377, 507, 383, 508, 387, 501, 384, 493, 393, 482, 393, 477, 399, 474, 398, 468, 405, 470, 406, 478, 410, 481, 417, 477, 421, 481, 434, 481, 432, 476, 425, 472, 430, 466, 434, 469, 430, 463, 424, 460, 419, 454, 426, 447, 424, 440, 427, 436, 435, 440, 442, 438, 447, 440, 451, 432, 452, 423, 462, 414, 459, 409, 458, 407, 450, 405, 440, 399, 431, 402, 423, 398, 417, 403, 408, 401, 404, 395, 403, 392, 399, 394, 388, 383, 388, 378, 375, 382, 378, 388, 376, 395, 369, 396, 363, 392, 354, 403, 342, 393, 337, 395, 331, 391, 314, 391, 311, 399">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 甘肃 </B></center>', FGCOLOR, '#CCFFCC');" onmouseout="nd();" shape="poly" coords="304, 234, 300, 245, 291, 246, 265, 262, 267, 286, 280, 291, 287, 292, 296, 298, 307, 294, 323, 293, 337, 301, 345, 299, 355, 310, 364, 317, 369, 315, 379, 331, 386, 345, 380, 355, 376, 362, 370, 373, 368, 377, 359, 372, 359, 379, 367, 380, 372, 385, 375, 378, 385, 375, 399, 392, 402, 389, 409, 401, 417, 402, 426, 394, 423, 388, 432, 386, 431, 379, 434, 374, 432, 370, 432, 363, 440, 363, 449, 362, 449, 357, 458, 357, 461, 350, 456, 346, 459, 339, 441, 330, 432, 339, 437, 347, 433, 351, 429, 358, 419, 352, 413, 334, 405, 325, 396, 321, 393, 309, 398, 306, 400, 298, 393, 291, 383, 295, 374, 300, 364, 299, 354, 289, 345, 284, 346, 279, 352, 274, 350, 268, 337, 266, 327, 272, 318, 259, 316, 246, 315, 238, 304, 233">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 广西壮族自治区 </B></center>', FGCOLOR, '#FFFFCC');" onmouseout="nd();" shape="poly" coords="409, 533, 409, 536, 414, 537, 421, 542, 433, 543, 434, 549, 425, 558, 429, 562, 440, 562, 445, 564, 444, 575, 452, 581, 460, 583, 468, 585, 473, 580, 482, 585, 490, 583, 496, 575, 500, 575, 500, 571, 505, 568, 504, 566, 515, 554, 514, 547, 520, 538, 523, 530, 521, 526, 515, 526, 512, 522, 510, 520, 507, 523, 507, 519, 511, 516, 510, 509, 510, 508, 508, 506, 507, 500, 501, 502, 494, 508, 490, 504, 487, 509, 482, 507, 469, 519, 466, 517, 459, 524, 449, 518, 438, 527, 435, 528, 431, 533, 419, 528, 410, 537">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 内蒙古自治区 (Өвөр Монгол) </B></center>', FGCOLOR, '#CCFFFF');" onmouseout="nd();" shape="poly" coords="534, 107, 530, 134, 524, 136, 527, 144, 531, 144, 538, 141, 544, 142, 546, 143, 553, 135, 562, 137, 577, 151, 576, 155, 565, 155, 555, 160, 548, 165, 539, 169, 537, 178, 528, 183, 522, 184, 508, 197, 499, 196, 494, 194, 490, 194, 483, 206, 492, 216, 476, 231, 461, 241, 443, 243, 437, 242, 425, 246, 408, 257, 403, 256, 401, 253, 389, 252, 374, 247, 368, 242, 350, 239, 329, 240, 315, 238, 317, 259, 327, 271, 334, 267, 350, 269, 353, 274, 347, 280, 346, 286, 354, 291, 363, 300, 373, 301, 388, 291, 396, 292, 400, 299, 399, 306, 394, 312, 397, 322, 406, 322, 419, 314, 420, 301, 430, 292, 433, 292, 436, 301, 432, 310, 437, 311, 443, 315, 448, 317, 455, 319, 468, 304, 477, 289, 481, 290, 485, 285, 489, 287, 493, 283, 497, 283, 501, 274, 503, 271, 508, 272, 511, 269, 516, 269, 521, 265, 519, 258, 520, 248, 525, 239, 530, 239, 534, 247, 545, 240, 550, 238, 554, 235, 554, 228, 562, 226, 570, 235, 575, 243, 584, 243, 584, 234, 581, 228, 586, 225, 594, 232, 600, 226, 610, 219, 618, 213, 626, 211, 633, 201, 628, 199, 629, 193, 621, 184, 614, 189, 609, 181">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 内蒙古自治区 (Өвөр Монгол) </B></center>', FGCOLOR, '#CCFFFF');" onmouseout="nd();" shape="poly" coords="607, 174, 609, 171, 600, 163, 601, 159, 607, 159, 612, 161, 612, 153, 613, 148, 618, 144, 612, 144, 604, 138, 605, 130, 619, 112, 623, 117, 625, 101, 627, 95, 625, 84, 629, 74, 631, 67, 619, 58, 612, 65, 603, 68, 596, 67, 592, 59, 592, 52, 585, 51, 582, 54, 575, 51, 579, 42, 575, 38, 566, 42, 561, 50, 565, 52, 571, 57, 568, 65, 563, 78, 558, 93, 561, 97, 549, 109, 540, 108, 532, 104, 532, 110, 531, 116">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 福建省 </B></center>', FGCOLOR, '#FFFFCC');" onmouseout="nd();" shape="poly" coords="600, 538, 597, 526, 591, 520, 589, 522, 586, 518, 580, 518, 581, 503, 584, 499, 586, 491, 585, 484, 592, 478, 592, 469, 596, 465, 599, 466, 609, 456, 612, 458, 615, 462, 618, 469, 622, 469, 627, 465, 631, 470, 635, 468, 640, 469, 637, 475, 634, 481, 629, 480, 632, 484, 632, 490, 632, 491, 633, 501, 628, 502, 626, 508, 622, 510, 620, 516, 612, 519, 614, 526, 601, 538">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 安徽省 </B></center>', FGCOLOR, '#CCCCFF');" onmouseout="nd();" shape="poly" coords="573, 436, 566, 422, 568, 418, 558, 413, 565, 404, 563, 394, 560, 396, 551, 390, 555, 383, 558, 371, 564, 374, 570, 370, 569, 363, 561, 359, 567, 358, 577, 365, 581, 365, 586, 370, 592, 370, 589, 376, 595, 384, 598, 384, 603, 381, 606, 383, 604, 386, 600, 387, 600, 393, 598, 396, 605, 403, 605, 407, 617, 409, 618, 414, 613, 419, 617, 420, 609, 422, 609, 430, 603, 438, 595, 438, 589, 434, 584, 435, 580, 431, 574, 437">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 上海 </B></center>', FGCOLOR, '#FFCCFF');" onmouseout="nd();" shape="poly" coords="648, 397, 642, 397, 637, 407, 643, 411, 649, 409, 654, 404, 651, 400, 644, 399">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> Yunnan </B></center>', FGCOLOR, '#CCFFCC');" onmouseout="nd();" shape="poly" coords="357, 582, 350, 590, 342, 589, 339, 578, 328, 577, 332, 561, 324, 560, 320, 548, 324, 544, 319, 542, 311, 542, 307, 545, 305, 544, 306, 538, 303, 535, 323, 506, 322, 492, 322, 488, 315, 481, 316, 475, 322, 474, 322, 463, 328, 458, 330, 472, 332, 477, 342, 470, 344, 474, 342, 480, 351, 481, 367, 510, 378, 508, 384, 509, 388, 503, 385, 493, 393, 483, 393, 478, 396, 476, 400, 474, 399, 471, 404, 471, 407, 479, 410, 482, 417, 479, 419, 485, 418, 488, 408, 490, 404, 488, 400, 489, 397, 492, 397, 498, 398, 503, 401, 504, 404, 502, 408, 502, 410, 506, 405, 516, 413, 525, 409, 538, 416, 541, 422, 545, 433, 547, 433, 553, 424, 559, 419, 559, 413, 565, 407, 570, 403, 566, 401, 572, 397, 568, 395, 570, 392, 568, 388, 574, 380, 568, 373, 574, 364, 576, 367, 585, 368, 592, 364, 596, 357, 587">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 广东省 </B></center>', FGCOLOR, '#CCCCFF');" onmouseout="nd();" shape="poly" coords="541, 574, 540, 570, 541, 561, 546, 568, 552, 559, 557, 558, 550, 563, 557, 559, 566, 555, 546, 565, 550, 563, 563, 557, 569, 555, 574, 554, 579, 556, 580, 552, 583, 556, 589, 550, 593, 551, 593, 547, 600, 539, 598, 529, 592, 523, 588, 524, 586, 521, 579, 520, 577, 524, 573, 522, 558, 530, 556, 525, 560, 516, 558, 513, 552, 517, 549, 513, 546, 516, 544, 517, 539, 514, 535, 518, 535, 523, 530, 520, 525, 521, 521, 528, 522, 530, 522, 535, 514, 550, 515, 558, 505, 569, 500, 575, 495, 580, 493, 588, 491, 592, 492, 601, 496, 607, 502, 603, 502, 600, 500, 594, 503, 591, 510, 583, 515, 582, 519, 582, 523, 578, 532, 576, 538, 575">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> Xinjiang Uyghur </B></center>', FGCOLOR, '#FFCCCC');" onmouseout="nd();" shape="poly" coords="305, 236, 299, 227, 291, 209, 270, 196, 251, 193, 239, 186, 240, 181, 244, 176, 244, 161, 240, 151, 240, 146, 230, 139, 226, 141, 221, 136, 219, 131, 216, 129, 215, 122, 216, 119, 205, 118, 199, 126, 190, 128, 187, 134, 187, 146, 181, 149, 177, 153, 157, 142, 144, 166, 145, 170, 143, 176, 135, 171, 125, 173, 113, 173, 119, 176, 117, 196, 117, 203, 107, 209, 106, 219, 97, 221, 87, 224, 78, 229, 71, 230, 63, 227, 51, 237, 46, 233, 43, 229, 41, 231, 37, 228, 32, 232, 23, 232, 22, 240, 15, 244, 15, 248, 16, 254, 21, 256, 27, 262">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> Xinjiang Uyghur </B></center>', FGCOLOR, '#FFCCCC');" onmouseout="nd();" shape="poly" coords="25, 266, 25, 275, 26, 279, 24, 281, 16, 281, 15, 283, 24, 286, 31, 295, 31, 301, 29, 304, 44, 318, 51, 319, 54, 321, 54, 330, 61, 339, 69, 339, 71, 341, 76, 335, 76, 331, 86, 326, 94, 328, 101, 332, 110, 325, 120, 328, 129, 334, 147, 332, 155, 333, 167, 327, 183, 324, 191, 326, 204, 333, 214, 332, 227, 332, 224, 324, 230, 319, 221, 308, 220, 296, 268, 288, 266, 261, 285, 250, 300, 245, 303, 238, 302, 237, 304, 235, 26, 262">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> Xizang </B><BR> (Tibet) </center>', FGCOLOR, '#CCFFFF');" onmouseout="nd();" shape="poly" coords="308, 402, 297, 418, 282, 415, 270, 402, 253, 401, 245, 397, 238, 398, 232, 393, 216, 388, 202, 363, 204, 359, 206, 356, 211, 339, 197, 331, 184, 325, 176, 329, 165, 327, 153, 337, 146, 333, 139, 337, 129, 338, 117, 328, 111, 326, 102, 335, 86, 326, 78, 333, 75, 338, 68, 347, 60, 343, 57, 354, 63, 360, 65, 360, 63, 369, 54, 371, 52, 367, 47, 369, 51, 376, 50, 380, 49, 384, 50, 388, 52, 387, 72, 409, 76, 413, 76, 416, 84, 411, 106, 432, 109, 439, 113, 435, 117, 439, 115, 442, 124, 449, 126, 449, 128, 454, 133, 455, 144, 464, 150, 462, 157, 467, 162, 468, 167, 469, 178, 467, 181, 469, 179, 474, 178, 476, 191, 467, 200, 466, 206, 471, 212, 472, 216, 472, 221, 473, 221, 476, 231, 477, 243, 466, 247, 464, 252, 464, 263, 457, 275, 461, 286, 455, 291, 459, 287, 464, 294, 465, 290, 471, 301, 474, 305, 474, 308, 470, 315, 475, 320, 475, 322, 466, 328, 460, 329, 437, 326, 427, 328, 425, 320, 415, 316, 408, 310, 403">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 黑龙江省 </B></center>', FGCOLOR, '#CCFFCC');" onmouseout="nd();" shape="poly" coords="731, 86, 715, 100, 701, 108, 698, 110, 693, 105, 694, 100, 687, 94, 674, 88, 662, 86, 656, 88, 648, 80, 645, 73, 631, 50, 618, 34, 612, 33, 608, 39, 596, 30, 577, 39, 580, 44, 575, 52, 580, 56, 586, 52, 591, 53, 594, 66, 599, 68, 608, 69, 614, 66, 621, 60, 631, 71, 628, 78, 626, 85, 628, 97, 623, 108, 624, 121, 620, 115, 606, 132, 605, 139, 614, 144, 618, 143, 619, 144, 613, 155, 617, 151, 624, 150, 627, 154, 632, 162, 641, 162, 647, 159, 651, 164, 658, 162, 666, 164, 665, 168, 673, 169, 678, 178, 682, 175, 678, 168, 681, 166, 685, 172, 688, 178, 693, 182, 696, 177, 704, 171, 707, 171, 713, 176, 719, 177, 717, 167, 710, 156, 715, 152, 720, 145, 724, 146, 734, 144, 734, 128, 736, 123, 734, 105, 740, 98, 734, 89">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> Jilin </B></center>', FGCOLOR, '#CCCCFF');" onmouseout="nd();" shape="poly" coords="695, 217, 690, 212, 701, 207, 703, 202, 708, 198, 708, 189, 712, 189, 715, 192, 721, 185, 720, 180, 716, 180, 706, 174, 701, 177, 694, 185, 688, 179, 683, 170, 681, 169, 683, 176, 679, 182, 674, 173, 667, 170, 665, 166, 658, 165, 652, 167, 649, 161, 644, 165, 634, 165, 626, 154, 617, 155, 613, 164, 610, 162, 602, 162, 604, 165, 609, 174, 610, 183, 614, 187, 616, 189, 623, 186, 629, 195, 631, 201, 638, 199, 642, 204, 649, 204, 653, 212, 659, 219, 662, 227, 666, 232, 667, 236, 675, 227, 674, 224, 678, 219, 682, 223, 693, 221">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 北京 </B></center>', FGCOLOR, '#FFCCFF');" onmouseout="nd();" shape="poly" coords="564, 257, 558, 257, 554, 253, 550, 256, 550, 262, 547, 267, 541, 273, 540, 276, 552, 279, 553, 279, 559, 276, 560, 274, 557, 271, 563, 269, 565, 266, 565, 260">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 天津 </B></center>', FGCOLOR, '#CCCCFF');" onmouseout="nd();" shape="poly" coords="571, 291, 567, 291, 563, 290, 560, 290, 559, 287, 561, 285, 560, 281, 558, 279, 559, 274, 563, 277, 564, 275, 565, 271, 565, 266, 569, 267, 569, 270, 568, 272, 570, 275, 574, 278, 575, 282, 573, 284, 573, 293">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> Shaanxi </B></center>', FGCOLOR, '#CCCCFF');" onmouseout="nd();" shape="poly" coords="454, 321, 444, 318, 441, 328, 460, 342, 458, 349, 461, 354, 457, 360, 449, 360, 438, 363, 432, 365, 432, 373, 435, 371, 435, 376, 433, 382, 433, 388, 425, 391, 426, 396, 424, 399, 431, 405, 440, 402, 453, 410, 460, 408, 469, 413, 476, 416, 477, 410, 474, 401, 485, 400, 477, 395, 475, 390, 492, 392, 496, 389, 496, 387, 482, 371, 485, 355, 483, 348, 483, 332, 482, 327, 485, 323, 485, 317, 482, 311, 487, 304, 489, 289, 486, 287, 480, 293, 477, 293, 470, 304">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 湖北省 </B></center>', FGCOLOR, '#FFCCFF');" onmouseout="nd();" shape="poly" coords="464, 437, 464, 445, 474, 456, 477, 450, 484, 443, 488, 446, 493, 445, 494, 442, 492, 438, 508, 440, 518, 446, 528, 441, 527, 446, 536, 439, 541, 450, 565, 435, 570, 438, 572, 435, 566, 421, 567, 418, 552, 409, 543, 406, 537, 405, 526, 400, 510, 400, 498, 390, 491, 392, 480, 392, 485, 396, 484, 398, 476, 401, 478, 408, 486, 421, 485, 428, 475, 433, 465, 439">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 河北省 </B></center>', FGCOLOR, '#CCFFCC');" onmouseout="nd();" shape="poly" coords="554, 231, 554, 238, 548, 242, 540, 247, 534, 249, 531, 245, 530, 241, 525, 242, 520, 258, 527, 269, 531, 284, 521, 301, 529, 313, 523, 330, 534, 336, 549, 336, 547, 329, 552, 323, 557, 311, 566, 306, 573, 303, 574, 297, 567, 292, 559, 292, 559, 281, 552, 281, 543, 280, 540, 275, 548, 265, 553, 254, 558, 258, 565, 260, 565, 269, 559, 276, 561, 278, 563, 275, 566, 266, 569, 267, 575, 279, 577, 283, 582, 283, 589, 277, 588, 272, 597, 264, 591, 258, 583, 253, 585, 246, 576, 247, 562, 228, 555, 232">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 贵州省 </B></center>', FGCOLOR, '#CCCCFF');" onmouseout="nd();" shape="poly" coords="419, 482, 419, 490, 414, 491, 408, 492, 404, 490, 397, 494, 399, 502, 403, 502, 408, 502, 410, 505, 409, 511, 405, 518, 413, 527, 409, 535, 420, 528, 430, 534, 431, 530, 449, 519, 458, 524, 466, 518, 469, 521, 480, 508, 480, 503, 479, 495, 481, 494, 480, 491, 475, 490, 472, 493, 471, 490, 477, 485, 478, 483, 478, 479, 476, 470, 472, 474, 464, 467, 460, 462, 457, 464, 452, 460, 451, 460, 449, 465, 444, 465, 440, 469, 434, 471, 431, 468, 427, 471, 432, 476, 434, 482, 419, 483">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 浙江省 </B></center>', FGCOLOR, '#CCFFCC');" onmouseout="nd();" shape="poly" coords="637, 407, 635, 407, 632, 410, 625, 410, 622, 407, 618, 407, 619, 416, 614, 424, 610, 424, 610, 431, 601, 441, 601, 444, 609, 455, 614, 457, 617, 466, 618, 469, 623, 468, 627, 464, 631, 469, 636, 467, 639, 468, 643, 468, 644, 464, 643, 458, 646, 456, 654, 445, 654, 441, 661, 436, 661, 434, 658, 431, 658, 428, 659, 423, 661, 421, 661, 418, 658, 416, 652, 415, 647, 414, 640, 420, 635, 421, 635, 419, 641, 413, 639, 411">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 重庆 </B></center>', FGCOLOR, '#FFFFCC');" onmouseout="nd();" shape="poly" coords="447, 442, 443, 439, 436, 441, 429, 436, 425, 441, 428, 447, 421, 454, 428, 458, 433, 463, 435, 468, 441, 467, 442, 462, 446, 461, 449, 464, 450, 455, 457, 458, 460, 456, 463, 458, 471, 471, 476, 466, 475, 457, 464, 446, 464, 439, 463, 436, 467, 433, 476, 432, 481, 427, 485, 426, 486, 419, 479, 411, 476, 418, 467, 412, 462, 409, 464, 413, 459, 418, 454, 422, 452, 434, 448, 444">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 江苏省 </B></center>', FGCOLOR, '#CCFFFF');" onmouseout="nd();" shape="poly" coords="619, 405, 628, 408, 637, 406, 638, 401, 645, 392, 638, 390, 646, 390, 638, 381, 630, 380, 628, 371, 616, 354, 608, 350, 605, 348, 602, 343, 594, 354, 583, 355, 571, 353, 569, 357, 585, 365, 591, 369, 592, 378, 598, 384, 606, 378, 607, 383, 600, 393, 604, 398, 608, 406">
<area href="javascript:void(0);" onmouseover="return overlib('<center><B> 湖南省 </B></center>', FGCOLOR, '#CCFFFF');" onmouseout="nd();" shape="poly" coords="521, 525, 525, 519, 536, 519, 539, 511, 552, 512, 552, 503, 550, 486, 542, 478, 548, 466, 546, 449, 536, 440, 531, 443, 527, 443, 519, 446, 509, 440, 497, 441, 493, 446, 486, 443, 476, 455, 478, 467, 479, 482, 474, 491, 478, 491, 482, 505, 483, 507, 488, 507, 491, 503, 494, 506, 505, 500, 509, 507, 510, 515, 512, 518, 512, 521">
</map>
<img src="img/china.png" onclick="this.blur();" alt="Map of China" width="754" height="659" border="0" usemap="#FPMap0" class="imgBase" oncontextmenu="this.blur(); return false;">
<script type="text/javascript">
<!--
var ol_bgcolor='#666666';
var ol_textsize=2;
var ol_wrap = 1;
var ol_border = 2;
//-->
</script>
<script type="text/javascript" src="chinamap.js"></script>';
Thanks so much! | 3 |
5,303,489 | 03/14/2011 19:33:47 | 116,875 | 06/03/2009 20:13:22 | 344 | 9 | Eurekalog for Java | I'm looking for a tool like EurekaLog for Delphi, but that works in Java.
What is the best option?
| java | delphi | error-handling | null | null | null | open | Eurekalog for Java
===
I'm looking for a tool like EurekaLog for Delphi, but that works in Java.
What is the best option?
| 0 |
9,125,882 | 02/03/2012 08:45:57 | 1,157,690 | 01/19/2012 04:53:11 | 9 | 0 | setting up the datetime picker | im really new to web development,in my web i need to have datetime picker and im trying to use http://trentrichardson.com/examples/timepicker/ s datetime picker, Unfortunately i was unable to make it work.
this is my javascript
<script>
$(function() {
$( "#datepicker" ).datetimepicker();
});
</script>
can any one help me, how to set up this datetime picker..
| jquery | null | null | null | null | null | open | setting up the datetime picker
===
im really new to web development,in my web i need to have datetime picker and im trying to use http://trentrichardson.com/examples/timepicker/ s datetime picker, Unfortunately i was unable to make it work.
this is my javascript
<script>
$(function() {
$( "#datepicker" ).datetimepicker();
});
</script>
can any one help me, how to set up this datetime picker..
| 0 |
8,550,110 | 12/18/2011 06:02:06 | 355,981 | 06/02/2010 01:13:16 | 303 | 9 | Ordering JSON rendered by Rails controller | I have a Rails 3.1 controller that renders a user's contacts, including associated email objects and message objects. If I am only rendering the contacts, I can do the following:
<pre>
@contacts = @current_user.contacts.order('last_name asc', :include => [:emails, :messages])
render json: @contacts, :include => [:emails, :messages]
</pre>
As you can see, I want to sort the contacts by last name rather than the default id. I am now needing to render the user object with other associated objects as well. So I have tried the following, but of course the contacts are not in the appropriate order:
<pre>
render :status => 200, :json => {
:user => @current_user.as_json(
:include => {
:foos => {
:except => :user_id
},
:contacts => {
:except => :user_id,
:include => [:emails,:messages]
},
:bars => {
:except => :user_id
}
}
)
}
</pre>
I didn't see any help in the [as_json documentation](http://api.rubyonrails.org/classes/ActiveModel/Serializers/JSON.html#method-i-as_json), and I haven't been able to find the right syntax by trial and error. | json | ruby-on-rails-3.1 | associations | render | nested-attributes | null | open | Ordering JSON rendered by Rails controller
===
I have a Rails 3.1 controller that renders a user's contacts, including associated email objects and message objects. If I am only rendering the contacts, I can do the following:
<pre>
@contacts = @current_user.contacts.order('last_name asc', :include => [:emails, :messages])
render json: @contacts, :include => [:emails, :messages]
</pre>
As you can see, I want to sort the contacts by last name rather than the default id. I am now needing to render the user object with other associated objects as well. So I have tried the following, but of course the contacts are not in the appropriate order:
<pre>
render :status => 200, :json => {
:user => @current_user.as_json(
:include => {
:foos => {
:except => :user_id
},
:contacts => {
:except => :user_id,
:include => [:emails,:messages]
},
:bars => {
:except => :user_id
}
}
)
}
</pre>
I didn't see any help in the [as_json documentation](http://api.rubyonrails.org/classes/ActiveModel/Serializers/JSON.html#method-i-as_json), and I haven't been able to find the right syntax by trial and error. | 0 |
2,248,714 | 02/12/2010 00:02:31 | 151,438 | 08/06/2009 00:02:40 | 363 | 6 | Clarification on Masking Bits | I have a quick question about masking bits. If I want to turn two 8 bit streams on, do I
use the `AND` logic against the two:
10101010
AND 01101001
________
00101000
or do I actually change one of the bits in the stream to turn the bits on? I guess my question is when I'm turning on (using `AND`) or turning off (using `OR`) do I actually change any of the bits, or just comparing the two using the `AND/OR` logic? | homework | binary | null | null | null | null | open | Clarification on Masking Bits
===
I have a quick question about masking bits. If I want to turn two 8 bit streams on, do I
use the `AND` logic against the two:
10101010
AND 01101001
________
00101000
or do I actually change one of the bits in the stream to turn the bits on? I guess my question is when I'm turning on (using `AND`) or turning off (using `OR`) do I actually change any of the bits, or just comparing the two using the `AND/OR` logic? | 0 |
7,700,879 | 10/09/2011 01:34:10 | 636,207 | 02/27/2011 05:59:53 | 1 | 0 | Android spinner view | Iam new to android development..
I had a doubt that while using spinner view, we are including an attribute as **android:drawSelectorOnTop="true"** . Can anyone explain me the reason for use of this attribute
<Spinner android:id="@+id/spinner"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawSelectorOnTop="true"
/> | android-widget | null | null | null | null | null | open | Android spinner view
===
Iam new to android development..
I had a doubt that while using spinner view, we are including an attribute as **android:drawSelectorOnTop="true"** . Can anyone explain me the reason for use of this attribute
<Spinner android:id="@+id/spinner"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawSelectorOnTop="true"
/> | 0 |
3,269,005 | 07/16/2010 21:32:34 | 44,330 | 12/08/2008 16:01:37 | 16,169 | 654 | Java: SortedSet "cursor"-style iterator | I need to iterate both forwards and backwards in a sorted set. If I use [NavigableSet][1], I get a strictly-forward iterator and a strictly-backward iterator (`iterator()` and `descendingIterator()`) but none that can move forward and backward.
What's the time complexity of `NavigableSet.lower()` and `higher()` ? I can use those instead, but am reluctant to do so if they are inefficient.
[1]: http://download.oracle.com/docs/cd/E17409_01/javase/6/docs/api/java/util/NavigableSet.html | java | iterator | set | null | null | null | open | Java: SortedSet "cursor"-style iterator
===
I need to iterate both forwards and backwards in a sorted set. If I use [NavigableSet][1], I get a strictly-forward iterator and a strictly-backward iterator (`iterator()` and `descendingIterator()`) but none that can move forward and backward.
What's the time complexity of `NavigableSet.lower()` and `higher()` ? I can use those instead, but am reluctant to do so if they are inefficient.
[1]: http://download.oracle.com/docs/cd/E17409_01/javase/6/docs/api/java/util/NavigableSet.html | 0 |
998,572 | 06/15/2009 21:48:35 | 123,351 | 06/15/2009 20:53:08 | 1 | 0 | Is this regular expression interview question a fair question for a Senior Programmer position? |
> Which of the following regular
> expressions cannot be transformed into
> one using just the base operators of
> `|` and `*` (Kleene star) and grouping
> `( () ) *`
/adt[ui]t+\S?/
/b[^e]ac?h+\s\s\sBALL/i
/he{5}[Ly]+o\bwo[^r]L(?!d)/
/ab?c+(de{1,3})/
One of our developers came up with this question as a potential job interview question but, to be honest, I don't know the answer myself (never really understood regular expressions).
Would this be a fair question to administer for a Senior Programmer position?
| regex | interview-questions | null | null | null | 12/01/2011 18:52:19 | not constructive | Is this regular expression interview question a fair question for a Senior Programmer position?
===
> Which of the following regular
> expressions cannot be transformed into
> one using just the base operators of
> `|` and `*` (Kleene star) and grouping
> `( () ) *`
/adt[ui]t+\S?/
/b[^e]ac?h+\s\s\sBALL/i
/he{5}[Ly]+o\bwo[^r]L(?!d)/
/ab?c+(de{1,3})/
One of our developers came up with this question as a potential job interview question but, to be honest, I don't know the answer myself (never really understood regular expressions).
Would this be a fair question to administer for a Senior Programmer position?
| 4 |
6,070,451 | 05/20/2011 10:14:56 | 762,543 | 05/20/2011 10:14:56 | 1 | 0 | timer lock properties as read only for lock function | my function like this i will be run this function using threading.timer ,when one thread inside the locked myLockHolder then another thread can not enter into the this lock ,when the first release this lock then enter another & the number of thread will wait for execution i want only one inside the lock & only one wait to the lock thread pool & another thread dispose the working.
<pre>
TimerCallback call = new TimerCallback(reconnect);
TimeSpan dueTime = new TimeSpan(0, 0, 0, 0, 2000);
TimeSpan interval = new TimeSpan(0, 0, 0, 0, 2000);
timer1 = new System.Threading.Timer(call, _opcServer, dueTime, interval);
public void reconnect(object server)
{
try
{
lock (myLockHolder)
{
int i;
int groupcnt1 = 0, cntgroup1 = 0;
DataSet dsgroup1, ds2;
DataTable grpdt1;
_opcServer2 = (OpcServer[])server;
while (g < _opcServer2.Length)
{
SrvStatus status;
i = _opcServer2[g].GetStatus(out status);
if (HRESULTS.Failed(i))
{
int j = _opcServer[g].Connect(_opcServer2[g].HostInfo.HostName, _opcServer2[g].ServerName);
int id1 = opcconn.getserverID(_opcServer2[g].ServerName, _opcServer2[g].HostInfo.HostName);
dsgroup1 = grpclass.getgroupinfo(id1);
if (dsgroup1.Tables[0].Rows.Count != 0 && dsgroup1 != null)
{
grpdt1 = new DataTable();
grpdt1 = dsgroup1.Tables[0].Copy();
foreach (DataRow Row in grpdt1.Rows)
{
if (groupcnt1 < 128)
{
if (cntgroup1 < grpdt1.Rows.Count)
{
ds2 = param.getparameter1(Convert.ToInt32(Row["groupID"]));
int timerstart = (Convert.ToInt32(Row["groupID"])) - 1;
if (ds2.Tables[0].Rows.Count != 0)
{
OPCthread(Row, timerstart, g);
}
groupcnt1++;
cntgroup1++;
}
}
}
}
}
cntgroup1 = 0;
g++;
}
if (g == _opcServer2.Length)
{
g = 0;
}
}
}
}
</pre> | c# | .net | null | null | null | null | open | timer lock properties as read only for lock function
===
my function like this i will be run this function using threading.timer ,when one thread inside the locked myLockHolder then another thread can not enter into the this lock ,when the first release this lock then enter another & the number of thread will wait for execution i want only one inside the lock & only one wait to the lock thread pool & another thread dispose the working.
<pre>
TimerCallback call = new TimerCallback(reconnect);
TimeSpan dueTime = new TimeSpan(0, 0, 0, 0, 2000);
TimeSpan interval = new TimeSpan(0, 0, 0, 0, 2000);
timer1 = new System.Threading.Timer(call, _opcServer, dueTime, interval);
public void reconnect(object server)
{
try
{
lock (myLockHolder)
{
int i;
int groupcnt1 = 0, cntgroup1 = 0;
DataSet dsgroup1, ds2;
DataTable grpdt1;
_opcServer2 = (OpcServer[])server;
while (g < _opcServer2.Length)
{
SrvStatus status;
i = _opcServer2[g].GetStatus(out status);
if (HRESULTS.Failed(i))
{
int j = _opcServer[g].Connect(_opcServer2[g].HostInfo.HostName, _opcServer2[g].ServerName);
int id1 = opcconn.getserverID(_opcServer2[g].ServerName, _opcServer2[g].HostInfo.HostName);
dsgroup1 = grpclass.getgroupinfo(id1);
if (dsgroup1.Tables[0].Rows.Count != 0 && dsgroup1 != null)
{
grpdt1 = new DataTable();
grpdt1 = dsgroup1.Tables[0].Copy();
foreach (DataRow Row in grpdt1.Rows)
{
if (groupcnt1 < 128)
{
if (cntgroup1 < grpdt1.Rows.Count)
{
ds2 = param.getparameter1(Convert.ToInt32(Row["groupID"]));
int timerstart = (Convert.ToInt32(Row["groupID"])) - 1;
if (ds2.Tables[0].Rows.Count != 0)
{
OPCthread(Row, timerstart, g);
}
groupcnt1++;
cntgroup1++;
}
}
}
}
}
cntgroup1 = 0;
g++;
}
if (g == _opcServer2.Length)
{
g = 0;
}
}
}
}
</pre> | 0 |
4,841,075 | 01/30/2011 04:03:04 | 585,278 | 01/22/2011 01:51:41 | 11 | 0 | gaeunit, /test link appears to be broken | I am trying to use geaunit in my gae project. As is recommended, I have put the gaeunit.py file in my project root directory, added the required lines to app.yaml, and placed a test directory in the project root directory. But when I go to http://localhost:8080/test I get an "Oops! This link appears to be broken" page.
app.yaml
- url: /test.*
login: admin
script: gaeunit.py
/myproject
/app.yaml
/gaeunit.py
/test
What am I doing wrong?
| python | unit-testing | google-app-engine | gaeunit | null | 02/02/2011 13:19:56 | too localized | gaeunit, /test link appears to be broken
===
I am trying to use geaunit in my gae project. As is recommended, I have put the gaeunit.py file in my project root directory, added the required lines to app.yaml, and placed a test directory in the project root directory. But when I go to http://localhost:8080/test I get an "Oops! This link appears to be broken" page.
app.yaml
- url: /test.*
login: admin
script: gaeunit.py
/myproject
/app.yaml
/gaeunit.py
/test
What am I doing wrong?
| 3 |
11,234,972 | 06/27/2012 21:20:12 | 1,486,920 | 06/27/2012 21:09:30 | 1 | 0 | how to convert text to xml | I'm trying convert an String to XML format, but I don't have any experience using do doing that.
Here's a String i'm going to convert:
FBC
Testing
Test :WBC
Result :0
Flag :-
Units :x10E3/µl
Expected_Range :4.0 - 10.5
Testing
Test :LYMPHS
Result :0
Flag :-
Units : %
Expected_Range :14 - 46
Testing
Test :NEUTROPHILS
Result :0
Flag :-
Units : %
Expected_Range :40 - 74
| xml | string | convert | null | null | 06/28/2012 19:01:16 | not a real question | how to convert text to xml
===
I'm trying convert an String to XML format, but I don't have any experience using do doing that.
Here's a String i'm going to convert:
FBC
Testing
Test :WBC
Result :0
Flag :-
Units :x10E3/µl
Expected_Range :4.0 - 10.5
Testing
Test :LYMPHS
Result :0
Flag :-
Units : %
Expected_Range :14 - 46
Testing
Test :NEUTROPHILS
Result :0
Flag :-
Units : %
Expected_Range :40 - 74
| 1 |
6,835,980 | 07/26/2011 20:11:39 | 858,656 | 07/22/2011 20:51:43 | 1 | 0 | Android: converting String to int | I'm simply trying to convert a string that is generated from a barcode scanner to an int so that I can manipulate it by taking getting the remainder to generate a set number of integers. So far I have tried:
int myNum = 0;
try {
myNum = Integer.parseInt(myString.getText().toString());
} catch(NumberFormatException nfe) {
}
and
Integer.valueOf(mystr);
and
int value = Integer.parseInt(string);
The first one gives me the error :The method getText() is undefined for the type String
while the last two don't have any compile errors but the app crashes immediately when those are called. I thought it had to do with my barcode scanning intent method but I put it into the OnCreate and still got the error.
| android | string | int | null | null | null | open | Android: converting String to int
===
I'm simply trying to convert a string that is generated from a barcode scanner to an int so that I can manipulate it by taking getting the remainder to generate a set number of integers. So far I have tried:
int myNum = 0;
try {
myNum = Integer.parseInt(myString.getText().toString());
} catch(NumberFormatException nfe) {
}
and
Integer.valueOf(mystr);
and
int value = Integer.parseInt(string);
The first one gives me the error :The method getText() is undefined for the type String
while the last two don't have any compile errors but the app crashes immediately when those are called. I thought it had to do with my barcode scanning intent method but I put it into the OnCreate and still got the error.
| 0 |
8,937,967 | 01/20/2012 07:14:48 | 1,160,107 | 01/20/2012 06:57:09 | 1 | 0 | I want to start a shopping cart, what should i do first? | I know basic html, css and javascript and want to start my own shopping cart. Can someone help me whats the next step? What CMS is best to use? | javascript | html | content-management-system | shopping-cart | shopping | 01/20/2012 09:28:53 | not a real question | I want to start a shopping cart, what should i do first?
===
I know basic html, css and javascript and want to start my own shopping cart. Can someone help me whats the next step? What CMS is best to use? | 1 |
3,767,739 | 09/22/2010 09:04:56 | 437,917 | 09/02/2010 11:56:57 | 5 | 2 | Problem with getXMLHTTP() | I have the following code:
<script type="text/javascript" language="javascript">
<!--
function getXMLHTTP() { //fuction to return the xml http object
var xmlhttp=false;
try{
xmlhttp=new XMLHttpRequest();
}
catch(e) {
try{
xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e){
try{
req = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e1){
xmlhttp=false;
}
}
}
return xmlhttp;
}
function wait1()
{
document.getElementById('comment').innerHTML="Please wait...";
}
function getComment(strURL) {
var req = getXMLHTTP();
if (req) {
req.onreadystatechange = function() {
if (req.readyState == 4) {
// only if "OK"
if (req.status == 200) {
document.getElementById('comment').innerHTML=req.responseText;
} else {
alert("There was a problem while using XMLHTTP:\n" + req.statusText);
}
}
}
req.open("GET", "comment_form.php", true);
req.send(null);
}
}
//-->
</script>
<div id="comment">
<form action="javascript:get(document.getElementById('comment'));wait1()" method="post" enctype="multipart/form-data" >
<input type="submit" name="Submit" value="Post Your Comment" />
</form>
</div>
I think that I used the same in past running smoothly, but now it doesn't seem to be working. I think something is messed up there, but not able to figure out.
I would be thankful if I get the solution.
| javascript | ajax | null | null | null | null | open | Problem with getXMLHTTP()
===
I have the following code:
<script type="text/javascript" language="javascript">
<!--
function getXMLHTTP() { //fuction to return the xml http object
var xmlhttp=false;
try{
xmlhttp=new XMLHttpRequest();
}
catch(e) {
try{
xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e){
try{
req = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e1){
xmlhttp=false;
}
}
}
return xmlhttp;
}
function wait1()
{
document.getElementById('comment').innerHTML="Please wait...";
}
function getComment(strURL) {
var req = getXMLHTTP();
if (req) {
req.onreadystatechange = function() {
if (req.readyState == 4) {
// only if "OK"
if (req.status == 200) {
document.getElementById('comment').innerHTML=req.responseText;
} else {
alert("There was a problem while using XMLHTTP:\n" + req.statusText);
}
}
}
req.open("GET", "comment_form.php", true);
req.send(null);
}
}
//-->
</script>
<div id="comment">
<form action="javascript:get(document.getElementById('comment'));wait1()" method="post" enctype="multipart/form-data" >
<input type="submit" name="Submit" value="Post Your Comment" />
</form>
</div>
I think that I used the same in past running smoothly, but now it doesn't seem to be working. I think something is messed up there, but not able to figure out.
I would be thankful if I get the solution.
| 0 |
5,549,879 | 04/05/2011 09:35:36 | 593,905 | 01/03/2011 13:35:43 | 19 | 1 | Conversion HTML/PHP Website to Flash | I am developed a PHP MYSQL HTML CSS website and I want to enlist it in a competition but they require the website design to be in Flash Can anyone point some learning materials?
Thanks! | php | flash | null | null | null | 04/06/2011 00:38:48 | not a real question | Conversion HTML/PHP Website to Flash
===
I am developed a PHP MYSQL HTML CSS website and I want to enlist it in a competition but they require the website design to be in Flash Can anyone point some learning materials?
Thanks! | 1 |
11,064,542 | 06/16/2012 15:03:11 | 1,192,253 | 02/06/2012 12:16:55 | 1 | 0 | Good JDBC pattern | What is the good practice for database operation in Java application? Do you construct the DML syntax in the Java code and send the statements to DB engine for execution, or you just collect the parameters and then make a call to stored procedure with the parameters via java code? or neither because that's just not how to do it? can anyone give an example of a full database utility classes to do database operations in Java app? also what about the transaction manager? My assignment is to make database operation that is modular in Java. Thanks | java | design-patterns | jdbc | null | null | 06/16/2012 15:35:39 | not a real question | Good JDBC pattern
===
What is the good practice for database operation in Java application? Do you construct the DML syntax in the Java code and send the statements to DB engine for execution, or you just collect the parameters and then make a call to stored procedure with the parameters via java code? or neither because that's just not how to do it? can anyone give an example of a full database utility classes to do database operations in Java app? also what about the transaction manager? My assignment is to make database operation that is modular in Java. Thanks | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.