PostId
int64
4
11.8M
PostCreationDate
stringlengths
19
19
OwnerUserId
int64
1
1.57M
OwnerCreationDate
stringlengths
10
19
ReputationAtPostCreation
int64
-55
461k
OwnerUndeletedAnswerCountAtPostTime
int64
0
21.5k
Title
stringlengths
3
250
BodyMarkdown
stringlengths
5
30k
βŒ€
Tag1
stringlengths
1
25
βŒ€
Tag2
stringlengths
1
25
βŒ€
Tag3
stringlengths
1
25
βŒ€
Tag4
stringlengths
1
25
βŒ€
Tag5
stringlengths
1
25
βŒ€
PostClosedDate
stringlengths
19
19
βŒ€
OpenStatus
stringclasses
5 values
unified_texts
stringlengths
32
30.1k
OpenStatus_id
int64
0
4
11,297,844
07/02/2012 16:46:20
880,752
08/05/2011 14:26:03
1
0
Debug.startMethodTracing WebView won't load
Whenever I try and profile my app either by using Debug.startMethodTracing(...) or by just using DDMS, if I navigate to an Activity that has an embedded WebView I get the error: The webpage at http://... might be temporarily down or it may have moved permanently to a new web address. If I turn off profiling, the web page loads correctly. The method profiling also works as expected on all of my other Activities that don't contain a WebView. LogCat reports the error as being: The connection to the server was unsuccessful.
android
profiling
android-webview
null
null
null
open
Debug.startMethodTracing WebView won't load === Whenever I try and profile my app either by using Debug.startMethodTracing(...) or by just using DDMS, if I navigate to an Activity that has an embedded WebView I get the error: The webpage at http://... might be temporarily down or it may have moved permanently to a new web address. If I turn off profiling, the web page loads correctly. The method profiling also works as expected on all of my other Activities that don't contain a WebView. LogCat reports the error as being: The connection to the server was unsuccessful.
0
11,297,800
07/02/2012 16:43:31
1,486,353
06/27/2012 16:39:04
1
0
Formatted Pdf word to html
I need to convert formatted pdf and word document to html. This conversion is for show the document into web browsers. Into web browser you can also select text. I don't know if it is better to do at backend side (with Java for example) or with maybe php, or there is a jquery/javascript plugin? My target is to show these documents in a web browser like iPaper. Thanks for the help
java
php
html
pdf
ms-word
null
open
Formatted Pdf word to html === I need to convert formatted pdf and word document to html. This conversion is for show the document into web browsers. Into web browser you can also select text. I don't know if it is better to do at backend side (with Java for example) or with maybe php, or there is a jquery/javascript plugin? My target is to show these documents in a web browser like iPaper. Thanks for the help
0
11,297,849
07/02/2012 16:46:47
1,496,638
07/02/2012 16:36:16
1
0
Very basic inheritance: error: expected class-name before β€˜{’ token
I'm trying to learn c++ and I've stumbled upon a error while trying to figuring out inheritance. Compiling: daughter.cpp In file included from /home/jonas/kodning/testing/daughter.cpp:1: /home/jonas/kodning/testing/daughter.h:6: error: expected class-name before β€˜{’ token Process terminated with status 1 (0 minutes, 0 seconds) 1 errors, 0 warnings My files: main.cpp: #include "mother.h" #include "daughter.h" #include <iostream> using namespace std; int main() { cout << "Hello world!" << endl; mother mom; mom.saywhat(); return 0; } mother.cpp: #include "mother.h" #include "daughter.h" #include <iostream> using namespace std; mother::mother() { //ctor } void mother::saywhat() { cout << "WHAAAAAAT" << endl; } mother.h: #ifndef MOTHER_H #define MOTHER_H class mother { public: mother(); void saywhat(); protected: private: }; #endif // MOTHER_H daughter.cpp: #ifndef DAUGHTER_H #define DAUGHTER_H class daughter: public mother { public: daughter(); protected: private: }; #endif // DAUGHTER_H and daughter.cpp: #include "daughter.h" #include "mother.h" #include <iostream> using namespace std; daughter::daughter() { //ctor } What I want to do is to let daughter inherit everything public from the mother class (=saywhat()). What am I doing wrong?
c++
inheritance
null
null
null
null
open
Very basic inheritance: error: expected class-name before β€˜{’ token === I'm trying to learn c++ and I've stumbled upon a error while trying to figuring out inheritance. Compiling: daughter.cpp In file included from /home/jonas/kodning/testing/daughter.cpp:1: /home/jonas/kodning/testing/daughter.h:6: error: expected class-name before β€˜{’ token Process terminated with status 1 (0 minutes, 0 seconds) 1 errors, 0 warnings My files: main.cpp: #include "mother.h" #include "daughter.h" #include <iostream> using namespace std; int main() { cout << "Hello world!" << endl; mother mom; mom.saywhat(); return 0; } mother.cpp: #include "mother.h" #include "daughter.h" #include <iostream> using namespace std; mother::mother() { //ctor } void mother::saywhat() { cout << "WHAAAAAAT" << endl; } mother.h: #ifndef MOTHER_H #define MOTHER_H class mother { public: mother(); void saywhat(); protected: private: }; #endif // MOTHER_H daughter.cpp: #ifndef DAUGHTER_H #define DAUGHTER_H class daughter: public mother { public: daughter(); protected: private: }; #endif // DAUGHTER_H and daughter.cpp: #include "daughter.h" #include "mother.h" #include <iostream> using namespace std; daughter::daughter() { //ctor } What I want to do is to let daughter inherit everything public from the mother class (=saywhat()). What am I doing wrong?
0
11,297,850
07/02/2012 16:46:54
912,597
08/25/2011 16:38:02
165
0
Get-Url + ID and Password
I am using PowerShell and PsUrl to download some csv files from different websites. However, I need to specify a username and a password to download a csv file for a specific website. Do you know how to write the PsUrl command to do this? My code: function Download-Feed ($extension) { # Download $filename = $feedQueueLocation + $date + "-" + $feedName + "." + $extension Write-Host "Downloading: $feedUrl" Write-Host " To: $filename" Get-Url $feedUrl -ToFile $filename return $filename } Thanks
powershell
null
null
null
null
null
open
Get-Url + ID and Password === I am using PowerShell and PsUrl to download some csv files from different websites. However, I need to specify a username and a password to download a csv file for a specific website. Do you know how to write the PsUrl command to do this? My code: function Download-Feed ($extension) { # Download $filename = $feedQueueLocation + $date + "-" + $feedName + "." + $extension Write-Host "Downloading: $feedUrl" Write-Host " To: $filename" Get-Url $feedUrl -ToFile $filename return $filename } Thanks
0
11,297,858
07/02/2012 16:47:34
1,472,818
06/21/2012 17:07:23
8
0
Show more fields with a button on ASP
I'm doing website where the employee can write his resume, i have a section of Past Jobs, and i want to display the fields where the employee can write this info (company, position, etc), but, i want to show just one of those sections, if the employee wants to add more old jobs he will click on the add more and then shows 2 or 3 more fields for those past jobs, currently i have 3 of those sections declared like this: <asp:Label ID="Label6" runat="server" Text="Empresa" Style="z-index: 1; left: 10px; top: 165px; position: absolute"></asp:Label> <asp:TextBox ID="TextBox3" runat="server" Style="z-index: 1; left: 80px; top: 165px; position: absolute" Width="200px"></asp:TextBox> <asp:Label ID="Label7" runat="server" Text="Fecha" Style="z-index: 1; left: 10px; top: 195px; position: absolute"></asp:Label> <asp:DropDownList ID="DropDownList1" runat="server" Style="z-index: 1; left: 80px; top: 195px; position: absolute"> <asp:ListItem>Enero</asp:ListItem> <asp:ListItem>Febrero</asp:ListItem> <asp:ListItem>Marzo</asp:ListItem> <asp:ListItem>Abril</asp:ListItem> <asp:ListItem>Mayo</asp:ListItem> <asp:ListItem>Junio</asp:ListItem> <asp:ListItem>Julio</asp:ListItem> <asp:ListItem>Agosto</asp:ListItem> <asp:ListItem>Septiembre</asp:ListItem> <asp:ListItem>Octubre</asp:ListItem> <asp:ListItem>Noviembre</asp:ListItem> <asp:ListItem>Diciembre</asp:ListItem> </asp:DropDownList> <asp:DropDownList ID="DropDownList2" runat="server" Style="z-index: 1; left: 172px; top: 195px; position: absolute" OnSelectedIndexChanged="DropDownList2_SelectedIndexChanged"> </asp:DropDownList> <asp:Label ID="Label8" runat="server" Text="a" Style="z-index: 1; left: 235px; top: 195px; position: absolute"></asp:Label> <asp:DropDownList ID="DropDownList3" runat="server" Style="z-index: 1; left: 250px; top: 195px; position: absolute"> <asp:ListItem>Enero</asp:ListItem> <asp:ListItem>Febrero</asp:ListItem> <asp:ListItem>Marzo</asp:ListItem> <asp:ListItem>Abril</asp:ListItem> <asp:ListItem>Mayo</asp:ListItem> <asp:ListItem>Junio</asp:ListItem> <asp:ListItem>Julio</asp:ListItem> <asp:ListItem>Agosto</asp:ListItem> <asp:ListItem>Septiembre</asp:ListItem> <asp:ListItem>Octubre</asp:ListItem> <asp:ListItem>Noviembre</asp:ListItem> <asp:ListItem>Diciembre</asp:ListItem> </asp:DropDownList> <asp:DropDownList ID="DropDownList4" runat="server" Style="z-index: 1; left: 342px; top: 195px; position: absolute" OnSelectedIndexChanged="DropDownList4_SelectedIndexChanged"> </asp:DropDownList> <asp:Label ID="Label9" runat="server" Text="Puesto:" Style="z-index: 1; left: 10px; top: 225px; position: absolute"></asp:Label> <asp:TextBox ID="TextBox4" runat="server" Style="z-index: 1; left: 80px; top: 225px; position: absolute" Width="200px"></asp:TextBox> <asp:Label ID="Label10" runat="server" Text="Funciones:" Style="z-index: 1; left: 10px; top: 255px; position: absolute"></asp:Label> <asp:TextBox ID="TextBox5" runat="server" Rows="5" TextMode="MultiLine" Style="z-index: 1; left: 80px; top: 255px; position: absolute" Width="200"></asp:TextBox> So, i just want to hidden the other 2 and just show them when i click on the button Add More, i'm a really newbie on ASP, and no idea how to do it, and how this can influence the other labels and textboxes i have since everyone has a a position with left and top, if they will be needed to move or what will hapen to them. I hope i'm explaining my problem and you can help me :D
asp.net
visual-studio-2010
visual-studio
button
null
null
open
Show more fields with a button on ASP === I'm doing website where the employee can write his resume, i have a section of Past Jobs, and i want to display the fields where the employee can write this info (company, position, etc), but, i want to show just one of those sections, if the employee wants to add more old jobs he will click on the add more and then shows 2 or 3 more fields for those past jobs, currently i have 3 of those sections declared like this: <asp:Label ID="Label6" runat="server" Text="Empresa" Style="z-index: 1; left: 10px; top: 165px; position: absolute"></asp:Label> <asp:TextBox ID="TextBox3" runat="server" Style="z-index: 1; left: 80px; top: 165px; position: absolute" Width="200px"></asp:TextBox> <asp:Label ID="Label7" runat="server" Text="Fecha" Style="z-index: 1; left: 10px; top: 195px; position: absolute"></asp:Label> <asp:DropDownList ID="DropDownList1" runat="server" Style="z-index: 1; left: 80px; top: 195px; position: absolute"> <asp:ListItem>Enero</asp:ListItem> <asp:ListItem>Febrero</asp:ListItem> <asp:ListItem>Marzo</asp:ListItem> <asp:ListItem>Abril</asp:ListItem> <asp:ListItem>Mayo</asp:ListItem> <asp:ListItem>Junio</asp:ListItem> <asp:ListItem>Julio</asp:ListItem> <asp:ListItem>Agosto</asp:ListItem> <asp:ListItem>Septiembre</asp:ListItem> <asp:ListItem>Octubre</asp:ListItem> <asp:ListItem>Noviembre</asp:ListItem> <asp:ListItem>Diciembre</asp:ListItem> </asp:DropDownList> <asp:DropDownList ID="DropDownList2" runat="server" Style="z-index: 1; left: 172px; top: 195px; position: absolute" OnSelectedIndexChanged="DropDownList2_SelectedIndexChanged"> </asp:DropDownList> <asp:Label ID="Label8" runat="server" Text="a" Style="z-index: 1; left: 235px; top: 195px; position: absolute"></asp:Label> <asp:DropDownList ID="DropDownList3" runat="server" Style="z-index: 1; left: 250px; top: 195px; position: absolute"> <asp:ListItem>Enero</asp:ListItem> <asp:ListItem>Febrero</asp:ListItem> <asp:ListItem>Marzo</asp:ListItem> <asp:ListItem>Abril</asp:ListItem> <asp:ListItem>Mayo</asp:ListItem> <asp:ListItem>Junio</asp:ListItem> <asp:ListItem>Julio</asp:ListItem> <asp:ListItem>Agosto</asp:ListItem> <asp:ListItem>Septiembre</asp:ListItem> <asp:ListItem>Octubre</asp:ListItem> <asp:ListItem>Noviembre</asp:ListItem> <asp:ListItem>Diciembre</asp:ListItem> </asp:DropDownList> <asp:DropDownList ID="DropDownList4" runat="server" Style="z-index: 1; left: 342px; top: 195px; position: absolute" OnSelectedIndexChanged="DropDownList4_SelectedIndexChanged"> </asp:DropDownList> <asp:Label ID="Label9" runat="server" Text="Puesto:" Style="z-index: 1; left: 10px; top: 225px; position: absolute"></asp:Label> <asp:TextBox ID="TextBox4" runat="server" Style="z-index: 1; left: 80px; top: 225px; position: absolute" Width="200px"></asp:TextBox> <asp:Label ID="Label10" runat="server" Text="Funciones:" Style="z-index: 1; left: 10px; top: 255px; position: absolute"></asp:Label> <asp:TextBox ID="TextBox5" runat="server" Rows="5" TextMode="MultiLine" Style="z-index: 1; left: 80px; top: 255px; position: absolute" Width="200"></asp:TextBox> So, i just want to hidden the other 2 and just show them when i click on the button Add More, i'm a really newbie on ASP, and no idea how to do it, and how this can influence the other labels and textboxes i have since everyone has a a position with left and top, if they will be needed to move or what will hapen to them. I hope i'm explaining my problem and you can help me :D
0
11,297,725
07/02/2012 16:38:30
720,628
04/22/2011 14:09:24
107
0
MySQL select multiple fields using vertical data
I have a MySQL database where the table was set up to store the data in a vertical fashion: Userid -- Field -- Data 186 30 New York 186 31 Phone 186 32 Delta 187 30 Los Angeles 187 31 Website 187 32 US Air I am able to select columns if they are already horizontal but want to be able to organize the output so it looks like this: Userid -- Data30 -- Data31 -- Data32 186 New York Phone Delta 187 Los Angeles Website US Air How do I say "Select DATA30 to show for this column but only if FIELD equals 30"?
mysql
null
null
null
null
null
open
MySQL select multiple fields using vertical data === I have a MySQL database where the table was set up to store the data in a vertical fashion: Userid -- Field -- Data 186 30 New York 186 31 Phone 186 32 Delta 187 30 Los Angeles 187 31 Website 187 32 US Air I am able to select columns if they are already horizontal but want to be able to organize the output so it looks like this: Userid -- Data30 -- Data31 -- Data32 186 New York Phone Delta 187 Los Angeles Website US Air How do I say "Select DATA30 to show for this column but only if FIELD equals 30"?
0
11,297,860
07/02/2012 16:47:50
473,555
10/12/2010 16:20:41
30
1
Matlab the same matrix operation returning different results
i am having a little problem with mathlab, i do think it has to do with matlab precision, but i would really like to solve this. I have three matrixes, one called f with 296X3118, other called mapping.mean with 1x3118 and the last called mapping.M with 3118X100.<br> The result of the following operations should be one, but it isn't. The resulting matrixes f_s_1 and f_s_2 have values that only differ in the range of 10^-12. Does any one know why, or how to fix this? f_s_1 = ((f(1:296,:)-repmat(mapping.mean,296,1))*mapping.M)'; f_s_2 = ((f(1:295,:)-repmat(mapping.mean,295,1))*mapping.M)'; isequal(f_s_1(:,1:295),f_s_2) ans = 0 Thanks in advance, SwatchPuppy
matlab
arbitrary-precision
null
null
null
null
open
Matlab the same matrix operation returning different results === i am having a little problem with mathlab, i do think it has to do with matlab precision, but i would really like to solve this. I have three matrixes, one called f with 296X3118, other called mapping.mean with 1x3118 and the last called mapping.M with 3118X100.<br> The result of the following operations should be one, but it isn't. The resulting matrixes f_s_1 and f_s_2 have values that only differ in the range of 10^-12. Does any one know why, or how to fix this? f_s_1 = ((f(1:296,:)-repmat(mapping.mean,296,1))*mapping.M)'; f_s_2 = ((f(1:295,:)-repmat(mapping.mean,295,1))*mapping.M)'; isequal(f_s_1(:,1:295),f_s_2) ans = 0 Thanks in advance, SwatchPuppy
0
11,400,973
07/09/2012 18:31:20
985,482
10/08/2011 15:19:54
302
5
Javascript JSON syntax
HI I am trying to create a JSON file in witch I wana store some data fore different files.The problem is I can't figure out what is the corect syntax.Here is what I have so far: var object = { "id-1" :[ { "type":"Corporate Website", "tech":"HTML" ,"CSS" , "Javascript/jQuery" } ], "id-2" :[ ] } I seem to be getting an error at "tech".If that is not corect how can I enumarate multiple elements?I am sorry for the noob question I have been using javascript for a short period of time and I am still very confused with the language.
javascript
null
null
null
null
null
open
Javascript JSON syntax === HI I am trying to create a JSON file in witch I wana store some data fore different files.The problem is I can't figure out what is the corect syntax.Here is what I have so far: var object = { "id-1" :[ { "type":"Corporate Website", "tech":"HTML" ,"CSS" , "Javascript/jQuery" } ], "id-2" :[ ] } I seem to be getting an error at "tech".If that is not corect how can I enumarate multiple elements?I am sorry for the noob question I have been using javascript for a short period of time and I am still very confused with the language.
0
11,400,976
07/09/2012 18:32:00
1,267,466
03/13/2012 20:31:19
6
0
How To Store data from the user in my variables by Immediate presses from the keyboard in C++ and C#(without pressing enter)
I don't know if this might be an-already answered question, if i wanna make a touch-typing program, It should be made key-sensitive, I mean, everytime I press a key, it gets compared with the text that I'm writing. now I can't just do something like: cin >> something; or Console.ReadLine(something); these won't work till I press enter which is i don't want.. how can I make the input work the way i want to in C++ && C# ? ThanX in Advance :)
c#
c++
input
null
null
null
open
How To Store data from the user in my variables by Immediate presses from the keyboard in C++ and C#(without pressing enter) === I don't know if this might be an-already answered question, if i wanna make a touch-typing program, It should be made key-sensitive, I mean, everytime I press a key, it gets compared with the text that I'm writing. now I can't just do something like: cin >> something; or Console.ReadLine(something); these won't work till I press enter which is i don't want.. how can I make the input work the way i want to in C++ && C# ? ThanX in Advance :)
0
11,400,731
07/09/2012 18:14:54
1,512,691
07/09/2012 17:25:03
1
0
Removing linker dependencies
I'm working on a c++ app on linux using g++. My app links in a shared library that exposes a simple API I need. This library internally references a large number of additional shared libs. I've had to find each and every one and add them to my Makefile to get them linked in. I assume my app has to link to any of the libs the primary lib depends on. Is the only way around this linking requirement, having the primary lib compile in the static libs of all its dependencies? Does this apply to using the plug-in model via dlopen/dlsym? ty
c++
c
linux
linker
g++
null
open
Removing linker dependencies === I'm working on a c++ app on linux using g++. My app links in a shared library that exposes a simple API I need. This library internally references a large number of additional shared libs. I've had to find each and every one and add them to my Makefile to get them linked in. I assume my app has to link to any of the libs the primary lib depends on. Is the only way around this linking requirement, having the primary lib compile in the static libs of all its dependencies? Does this apply to using the plug-in model via dlopen/dlsym? ty
0
11,400,576
07/09/2012 18:05:48
1,502,630
07/04/2012 23:22:16
1
0
Remove a type of strings from text?
I have similar rows, i want delete the first **...** rows, *not the unique row like* `http://www.filefactory.com/file/a181d18/n/...nimal_2010_.rar`.<br><br> I consider **similar rows** until the second arrives on `...` I want delete the second **similar row**. How can I do? http://rapidshare.com/files/152133956/2005_-_Candlemass.part1.rar (not delete) http://rapidshare.com/files/152133956/2005...emass.part1.rar --> similar (delete) http://www.filefactory.com/file/a181d18/n/...nimal_2010_.rar -->unique (not delete) http://www.shragle.com/files/9baa908b/Bvdub-The_First_Day-%2528HN031%2529-2012.rar(not delete) http://www.shragle.com/files/9baa908b/Bvdu...1%2529-2012.rar --> similar (delete) i 'm using **sed** and **notepad++** on windows
sed
notepad
null
null
null
null
open
Remove a type of strings from text? === I have similar rows, i want delete the first **...** rows, *not the unique row like* `http://www.filefactory.com/file/a181d18/n/...nimal_2010_.rar`.<br><br> I consider **similar rows** until the second arrives on `...` I want delete the second **similar row**. How can I do? http://rapidshare.com/files/152133956/2005_-_Candlemass.part1.rar (not delete) http://rapidshare.com/files/152133956/2005...emass.part1.rar --> similar (delete) http://www.filefactory.com/file/a181d18/n/...nimal_2010_.rar -->unique (not delete) http://www.shragle.com/files/9baa908b/Bvdub-The_First_Day-%2528HN031%2529-2012.rar(not delete) http://www.shragle.com/files/9baa908b/Bvdu...1%2529-2012.rar --> similar (delete) i 'm using **sed** and **notepad++** on windows
0
11,400,579
07/09/2012 18:05:56
1,464,677
06/18/2012 19:45:33
6
0
pyplot zooming in
So I am trying to plot some data from FITS files and I wanted to know if anyone knows how to focus on certain regions of a plot's axis? Here is some example code: import pyfits` from matplotlib import pyplot as plt from matplotlib import pylab from pylab import * #Assuming I have my data in the current directory a = pyfits.getdata('fits1.fits') x = a['data1'] # Lets assume data1 is the column: [0, 1, 1.3, 1.5, 2, 4, 8] y = a['data2'] # And data2 is the column: [0, 0.5, 1, 1.5, 2, 2.5, 3] plt.plot(x,y) How could I only plot the region from [1.3 to 4] in the x-axis? Any help is MUCH appreciated! :)
matplotlib
zoom
null
null
null
null
open
pyplot zooming in === So I am trying to plot some data from FITS files and I wanted to know if anyone knows how to focus on certain regions of a plot's axis? Here is some example code: import pyfits` from matplotlib import pyplot as plt from matplotlib import pylab from pylab import * #Assuming I have my data in the current directory a = pyfits.getdata('fits1.fits') x = a['data1'] # Lets assume data1 is the column: [0, 1, 1.3, 1.5, 2, 4, 8] y = a['data2'] # And data2 is the column: [0, 0.5, 1, 1.5, 2, 2.5, 3] plt.plot(x,y) How could I only plot the region from [1.3 to 4] in the x-axis? Any help is MUCH appreciated! :)
0
11,400,960
07/09/2012 18:30:14
64,238
02/09/2009 16:44:06
2,363
104
Android dex a JAR file which includes extra non .java files
I have a JAR library which includes some non source code files in a couple different `/src` packages (JSON files in this case) When I add that JAR as a dependency on one of my Android projects and build the apk file, those JSON files are not in the apk or the classes.dex (I ran `dex2jar` and saw that the files are missing) How can I tell `dex` to also include those json files in the output?
android
build
jar
dex
null
null
open
Android dex a JAR file which includes extra non .java files === I have a JAR library which includes some non source code files in a couple different `/src` packages (JSON files in this case) When I add that JAR as a dependency on one of my Android projects and build the apk file, those JSON files are not in the apk or the classes.dex (I ran `dex2jar` and saw that the files are missing) How can I tell `dex` to also include those json files in the output?
0
11,400,980
07/09/2012 18:32:25
842,512
07/13/2011 10:47:49
240
2
How to detect groups of circles with openCV?
I have a picture like that below. I would like to find groups of circles (their positions) in the image. In the following example there should be three groups. The background is white or will be whitish color. (In the source image there will not be such rectangulars. I have just painted to show how groups should be like) Is it possible to find it? ![Circles do detect][1] [1]: http://i.stack.imgur.com/VaKEy.jpg
image-processing
opencv
object-recognition
null
null
null
open
How to detect groups of circles with openCV? === I have a picture like that below. I would like to find groups of circles (their positions) in the image. In the following example there should be three groups. The background is white or will be whitish color. (In the source image there will not be such rectangulars. I have just painted to show how groups should be like) Is it possible to find it? ![Circles do detect][1] [1]: http://i.stack.imgur.com/VaKEy.jpg
0
11,400,989
07/09/2012 18:32:59
435,394
08/30/2010 22:09:19
320
10
Character encoding problems with tomcat
I'm having trouble with character encoding for a web application. There is a pop up that queryes the database with user input (search a person by name). The problem is that accented characters are being transformed into weird letters like `Γ³ => ó`. This is a pretty standard problem but I can't figure out what is going on. **What have I done?** Mainly, follow <a href="http://tech.top21.de/techblog/20100421-solving-problems-with-request-parameter-encoding.html;jsessionid=DAC7E8A568ED4EF9EB181BCDC785B010">this</a>. - Setting at the first filter on my tomcat `(request&response).setCharacterEncoding("UTF-8");` - Setting every `web.xml`, `server.xml` the character encodign parameter `<?xml version='1.0' encoding='utf-8'?>`. - Changing URIEncoding to UTF-8 in the connectors. Using firebug, I already see that content-type is set to `text/html; utf-8` on the get posts (which are mainly the ones with problems) - Change meta types and @page on the jsp's to UTF-8. But I still have the same problems, although some have been solved, for example, some accented letters sent from the server to the client, are displaying correctly. I have apache2.2 and tomcat 6 installed. I don't know what else to do nor what relevant information should I post here (if you need something please tell me)... Thanks in advance.
http
tomcat
character-encoding
null
null
null
open
Character encoding problems with tomcat === I'm having trouble with character encoding for a web application. There is a pop up that queryes the database with user input (search a person by name). The problem is that accented characters are being transformed into weird letters like `Γ³ => ó`. This is a pretty standard problem but I can't figure out what is going on. **What have I done?** Mainly, follow <a href="http://tech.top21.de/techblog/20100421-solving-problems-with-request-parameter-encoding.html;jsessionid=DAC7E8A568ED4EF9EB181BCDC785B010">this</a>. - Setting at the first filter on my tomcat `(request&response).setCharacterEncoding("UTF-8");` - Setting every `web.xml`, `server.xml` the character encodign parameter `<?xml version='1.0' encoding='utf-8'?>`. - Changing URIEncoding to UTF-8 in the connectors. Using firebug, I already see that content-type is set to `text/html; utf-8` on the get posts (which are mainly the ones with problems) - Change meta types and @page on the jsp's to UTF-8. But I still have the same problems, although some have been solved, for example, some accented letters sent from the server to the client, are displaying correctly. I have apache2.2 and tomcat 6 installed. I don't know what else to do nor what relevant information should I post here (if you need something please tell me)... Thanks in advance.
0
11,650,188
07/25/2012 12:54:14
1,374,857
05/04/2012 11:44:23
17
2
django and ajax returned data
I'm trying to implement a quite easy ajax call but since its my first one, something goes wrong and I can't find why. After a users choice from a dropdown list I want another field of the form to be completed after the corresponding query. Here is my code: jquery:`<script type="text/javascript"> $(document).ready(function() { $('#id_veh_id1').bind('click', function () { var val1 =$("#id_veh_id1").val(); $.get(""+val1+"/", function(data) { result=data.veh_length; document.getElementById('id_vlength').value=result; }); }); }); </script> ` with url: ` url(r'^(?P<user_id>\d+)/main_Webrequests/(?P<veh_id>\d+)/$', 'auth.views.test', name='test')` and view: `def test(request, veh_id, user_id): message = {"veh_length": ""} if request.is_ajax(): vehicle1 = Vehicles.objects.get(id = veh_id) veh_length=vehicle1.vlength message['veh_length'] = vehicle1.vlength else: message = "yoohoo" json = simplejson.dumps(message) return HttpResponse(json, mimetype='application/json')` When I try it with veh_id instead of veh_length everything seems to work fine but maybe I didn't understand sth well with the whole thing.
jquery
ajax
django
null
null
null
open
django and ajax returned data === I'm trying to implement a quite easy ajax call but since its my first one, something goes wrong and I can't find why. After a users choice from a dropdown list I want another field of the form to be completed after the corresponding query. Here is my code: jquery:`<script type="text/javascript"> $(document).ready(function() { $('#id_veh_id1').bind('click', function () { var val1 =$("#id_veh_id1").val(); $.get(""+val1+"/", function(data) { result=data.veh_length; document.getElementById('id_vlength').value=result; }); }); }); </script> ` with url: ` url(r'^(?P<user_id>\d+)/main_Webrequests/(?P<veh_id>\d+)/$', 'auth.views.test', name='test')` and view: `def test(request, veh_id, user_id): message = {"veh_length": ""} if request.is_ajax(): vehicle1 = Vehicles.objects.get(id = veh_id) veh_length=vehicle1.vlength message['veh_length'] = vehicle1.vlength else: message = "yoohoo" json = simplejson.dumps(message) return HttpResponse(json, mimetype='application/json')` When I try it with veh_id instead of veh_length everything seems to work fine but maybe I didn't understand sth well with the whole thing.
0
11,650,189
07/25/2012 12:54:14
807,325
02/21/2011 17:08:44
1,211
16
Why I can not get any results from the Database. My query seems correct and checked through phpMyAdmin
Database start end 2012-07-21 15:40:00 2012-07-28 21:00:00 2012-07-23 20:00:00 2012-07-27 13:00:00 this is what I run through phpMyAdmin and returned me the correct rows SELECT * FROM `events` WHERE "2012-07-25 15:40" BETWEEN START AND END But on my php code, that I posted just below I can not get any results. (all the data submitted by the form are posted 100% ). What am I missing? $question= 'SELECT * FROM events WHERE '; $hasTime = false; if(!empty($time)) { // @note better validation here $hasTime = true; $question .= 'WHERE time=:time BETWEEN start AND end'; } $hasCity = false; if(!empty($city)) { // @note better validation here $hasCity = true; $question .= 'AND city=:city '; } $hasType = false; if(!empty($type)) { // @note better validation here $hasType = true; $question .= 'AND type=:type'; } $query = $db->prepare($question); if($hasTime) $query->bindValue(":time", $time, PDO::PARAM_INT); if($hasCity) $query->bindValue(":city", $city, PDO::PARAM_INT); if($hasType) $query->bindValue(":type", $type, PDO::PARAM_INT); $query->execute();
php
mysql
null
null
null
null
open
Why I can not get any results from the Database. My query seems correct and checked through phpMyAdmin === Database start end 2012-07-21 15:40:00 2012-07-28 21:00:00 2012-07-23 20:00:00 2012-07-27 13:00:00 this is what I run through phpMyAdmin and returned me the correct rows SELECT * FROM `events` WHERE "2012-07-25 15:40" BETWEEN START AND END But on my php code, that I posted just below I can not get any results. (all the data submitted by the form are posted 100% ). What am I missing? $question= 'SELECT * FROM events WHERE '; $hasTime = false; if(!empty($time)) { // @note better validation here $hasTime = true; $question .= 'WHERE time=:time BETWEEN start AND end'; } $hasCity = false; if(!empty($city)) { // @note better validation here $hasCity = true; $question .= 'AND city=:city '; } $hasType = false; if(!empty($type)) { // @note better validation here $hasType = true; $question .= 'AND type=:type'; } $query = $db->prepare($question); if($hasTime) $query->bindValue(":time", $time, PDO::PARAM_INT); if($hasCity) $query->bindValue(":city", $city, PDO::PARAM_INT); if($hasType) $query->bindValue(":type", $type, PDO::PARAM_INT); $query->execute();
0
11,650,144
07/25/2012 12:51:40
978,622
10/04/2011 14:10:46
60
3
Creating a dynamic user interface?
I'm primarily a backend developer, but I'm being put into front-end design. I'm building just one panel(form) in an application. I'll have to dynamically add/remove other items from the form based on what the user chooses for previous parameters. For example, there will be a customer dropdown at the top of the panel. I need to be able to configure which other dropdown menus will display once the user makes a selection. I will have a minimum of 90 different configurations. Each configuration will have somewhere around 50 parameters. What is the best way to handle this situation in C#? Someone at my company suggested using a new form for each configuration, on SO I've seen people say to use user controls, and somewhere else said to dynamically put the controls in a list and generate content that way. Some of these suggestions seemed counter-intuitive... Can someone suggest a "proper" way to do this? To put this in perspective, I've only ever built one form before, and it was very simple. (This is a desktop application using .net 4.0)
c#
user-interface
null
null
null
07/27/2012 02:05:48
not constructive
Creating a dynamic user interface? === I'm primarily a backend developer, but I'm being put into front-end design. I'm building just one panel(form) in an application. I'll have to dynamically add/remove other items from the form based on what the user chooses for previous parameters. For example, there will be a customer dropdown at the top of the panel. I need to be able to configure which other dropdown menus will display once the user makes a selection. I will have a minimum of 90 different configurations. Each configuration will have somewhere around 50 parameters. What is the best way to handle this situation in C#? Someone at my company suggested using a new form for each configuration, on SO I've seen people say to use user controls, and somewhere else said to dynamically put the controls in a list and generate content that way. Some of these suggestions seemed counter-intuitive... Can someone suggest a "proper" way to do this? To put this in perspective, I've only ever built one form before, and it was very simple. (This is a desktop application using .net 4.0)
4
11,650,195
07/25/2012 12:54:40
1,166,931
01/24/2012 12:03:03
75
0
android search contact list baed on phone number
I have the following code: public String getContactDisplayNameByNumber(String number) { Uri uri = Uri.withAppendedPath(ContactsContract.PhoneLookup.CONTENT_FILTER_URI, Uri.encode(number)); String name = "?"; ContentResolver contentResolver = getContentResolver(); Cursor contactLookup = contentResolver.query(uri, new String[] {BaseColumns._ID, ContactsContract.PhoneLookup.DISPLAY_NAME }, null, null, null); try { if (contactLookup != null && contactLookup.getCount() > 0) { contactLookup.moveToNext(); name = contactLookup.getString(contactLookup.getColumnIndex(ContactsContract.Data.DISPLAY_NAME)); //String contactId = contactLookup.getString(contactLookup.getColumnIndex(BaseColumns._ID)); } } finally { if (contactLookup != null) { contactLookup.close(); } } Toast.makeText(this, name, Toast.LENGTH_LONG).show(); return name; } I would like to ask if it's possible to search a contact list based on just 4 numbers from the phone number. I want to display all the contacts that have the 4 characters displayed in their phone number. How to do this?
android
android-contacts
null
null
null
null
open
android search contact list baed on phone number === I have the following code: public String getContactDisplayNameByNumber(String number) { Uri uri = Uri.withAppendedPath(ContactsContract.PhoneLookup.CONTENT_FILTER_URI, Uri.encode(number)); String name = "?"; ContentResolver contentResolver = getContentResolver(); Cursor contactLookup = contentResolver.query(uri, new String[] {BaseColumns._ID, ContactsContract.PhoneLookup.DISPLAY_NAME }, null, null, null); try { if (contactLookup != null && contactLookup.getCount() > 0) { contactLookup.moveToNext(); name = contactLookup.getString(contactLookup.getColumnIndex(ContactsContract.Data.DISPLAY_NAME)); //String contactId = contactLookup.getString(contactLookup.getColumnIndex(BaseColumns._ID)); } } finally { if (contactLookup != null) { contactLookup.close(); } } Toast.makeText(this, name, Toast.LENGTH_LONG).show(); return name; } I would like to ask if it's possible to search a contact list based on just 4 numbers from the phone number. I want to display all the contacts that have the 4 characters displayed in their phone number. How to do this?
0
11,650,197
07/25/2012 12:54:48
1,361,577
04/27/2012 16:21:28
1
0
Threading issue..inner class..field
I'm having a threading issue.. I'm doing a lookup using an inner class..I've been reading up on how to do this properly and everything points at using a field..in my case " boolean verify". Basically if the object is there. I declare the field true and return the value. The problem is, during performance testing the same method in the same object is being called in several threads at the same time and the effects have been funny. (I'm guessing because of the pause() (which waits 10ms)) So in thread A..the objects there so it declares the field true..waits 10ms.. in thread B..the objects not there but because of the wait and that the same field is being accessed it returns a true anyway. I'm in trouble here :( Does anyone know of a better way to do this? boolean verify; public boolean lookupAndVerify(String id) throws InterruptedException { final String key = id; PastryIdFactory localFactory = new rice.pastry.commonapi.PastryIdFactory(env); final Id lookupKey = localFactory.buildId(key); Past p = (Past) apps.get(env.getRandomSource().nextInt(apps.size())); p.lookup(lookupKey, new Continuation<PastContent, Exception>() { public void receiveResult(PastContent result) { P2PPKIContent content = (P2PPKIContent) result; if(content !=null){ verify = true; } } public void receiveException(Exception result) { System.out.println("Error looking up " + lookupKey); } }); pause(); return verify; }
thread-safety
field
inner-classes
performance-testing
null
null
open
Threading issue..inner class..field === I'm having a threading issue.. I'm doing a lookup using an inner class..I've been reading up on how to do this properly and everything points at using a field..in my case " boolean verify". Basically if the object is there. I declare the field true and return the value. The problem is, during performance testing the same method in the same object is being called in several threads at the same time and the effects have been funny. (I'm guessing because of the pause() (which waits 10ms)) So in thread A..the objects there so it declares the field true..waits 10ms.. in thread B..the objects not there but because of the wait and that the same field is being accessed it returns a true anyway. I'm in trouble here :( Does anyone know of a better way to do this? boolean verify; public boolean lookupAndVerify(String id) throws InterruptedException { final String key = id; PastryIdFactory localFactory = new rice.pastry.commonapi.PastryIdFactory(env); final Id lookupKey = localFactory.buildId(key); Past p = (Past) apps.get(env.getRandomSource().nextInt(apps.size())); p.lookup(lookupKey, new Continuation<PastContent, Exception>() { public void receiveResult(PastContent result) { P2PPKIContent content = (P2PPKIContent) result; if(content !=null){ verify = true; } } public void receiveException(Exception result) { System.out.println("Error looking up " + lookupKey); } }); pause(); return verify; }
0
11,650,198
07/25/2012 12:54:51
1,426,067
05/30/2012 12:57:08
15
0
Liferay Portlet and Geotools
does anyone knows how do I use geotools in portlets? I downloaded geotools and set up the libraries but still doesnt work. An example would be great. Thank you
liferay
geotools
null
null
null
07/25/2012 14:53:26
not a real question
Liferay Portlet and Geotools === does anyone knows how do I use geotools in portlets? I downloaded geotools and set up the libraries but still doesnt work. An example would be great. Thank you
1
11,650,200
07/25/2012 12:55:01
249,933
01/13/2010 15:35:45
22,364
939
iOS delegate naming conventions - should, will, did
I am looking into naming conventions for iOS controls delegates. I am familiar with the [should, will, did pattern for delegate methods][1]. I can see this naming convention used extensively by the Apple APIs. My question is, are there any delegates supplied by apple that have should, will, did methods for a single action? e.g. for row selection: shouldSelectRow willSelectRow didSelectRow I have not found a delegate that defines all three. My feeling is that 'will' methods are often used in place of should, i.e. they can return a value in order to cancel the action. Are there any counter-examples? [1]: http://mattgemmell.com/2012/05/24/api-design/
objective-c
ios
cocoa-touch
null
null
null
open
iOS delegate naming conventions - should, will, did === I am looking into naming conventions for iOS controls delegates. I am familiar with the [should, will, did pattern for delegate methods][1]. I can see this naming convention used extensively by the Apple APIs. My question is, are there any delegates supplied by apple that have should, will, did methods for a single action? e.g. for row selection: shouldSelectRow willSelectRow didSelectRow I have not found a delegate that defines all three. My feeling is that 'will' methods are often used in place of should, i.e. they can return a value in order to cancel the action. Are there any counter-examples? [1]: http://mattgemmell.com/2012/05/24/api-design/
0
11,650,202
07/25/2012 12:55:03
1,551,650
07/25/2012 12:50:30
1
0
Accessing Google spreadsheet data in an android app
i need to access Google spreadsheet data in my android app.I did find the gdata plugin and a couple of examples but i am not able to run it.So please give me the steps so as how to do it.Is there any working android app for this.And do i need to obtain api key to use the gdata api? Awaiting your answers.
android
null
null
null
null
07/25/2012 13:50:59
not a real question
Accessing Google spreadsheet data in an android app === i need to access Google spreadsheet data in my android app.I did find the gdata plugin and a couple of examples but i am not able to run it.So please give me the steps so as how to do it.Is there any working android app for this.And do i need to obtain api key to use the gdata api? Awaiting your answers.
1
11,650,211
07/25/2012 12:55:38
516,883
11/23/2010 02:03:39
429
16
auto scrolling on mobile device
I have written an application in html5 (jquerymobile). I am trying to create a tutorial page where the user clicks on a link and it scrolls to the proper area (not to a different page). I am not sure how this is done, thanks for any help.
jquery
css
html5
null
null
null
open
auto scrolling on mobile device === I have written an application in html5 (jquerymobile). I am trying to create a tutorial page where the user clicks on a link and it scrolls to the proper area (not to a different page). I am not sure how this is done, thanks for any help.
0
11,410,047
07/10/2012 09:08:28
701,254
04/10/2011 21:15:12
319
0
How to reposition a div
How can the button "Vote" be aligned with "View Results" as shown in this screenshot: ![enter image description here][1] In this fiddle they are appearing beneath each other : http://jsfiddle.net/5YLNT/2/ [1]: http://i.stack.imgur.com/9tp5g.png I think I need to hide the css class : '.pds-links' and then re-display it at new position somehow ? Code behind fiddle : .pds-question-top { font-size:10pt !important; padding-top:1px !important; padding-bottom:1px !important; margin-top:1px !important; margin-bottom:1px !important; } .pds-pd-link { display:none !important; } .pds-box { width:220px !important; } .pds-input-label { width:85% !important; } .PDS_Poll { margin-bottom:15px; } .pds-answer-span { color:#00f; } .pds-vote { background-color:#424242; } .pds-answer-text { color:#00f; padding-top:1px !important; padding-bottom:1px !important; margin-top:1px !important; margin-bottom:1px !important; } .pds-answer-feedback { padding-top:1px !important; padding-bottom:1px !important; margin-top:1px !important; margin-bottom:1px !important; } .pds-votebutton-outer { text-align:center; } .pds-answer-group { padding-top:1px !important; padding-bottom:1px !important; margin-top:1px !important; margin-bottom:1px !important; height:auto; overflow:hidden; } .pds-input-label,.pds-answer-input { float:left; } .pds-view-results,.pds-links { color:#FFF !important; padding-top:1px !important; padding-bottom:1px !important; margin-top:1px !important; margin-bottom:1px !important; } .pds-comments,.pds-return-poll { color:#FFF !important; } <script type="text/javascript" charset="utf-8" src="http://static.polldaddy.com/p/6352993.js"></script> <noscript><a href="http://polldaddy.com/poll/6352993/">This is very long test question to test how polldaddy handles questions that exceed that normal length............ yes a very long question indeed..............</a></noscript> $(document).ready(function() { });
javascript
jquery
css
null
null
null
open
How to reposition a div === How can the button "Vote" be aligned with "View Results" as shown in this screenshot: ![enter image description here][1] In this fiddle they are appearing beneath each other : http://jsfiddle.net/5YLNT/2/ [1]: http://i.stack.imgur.com/9tp5g.png I think I need to hide the css class : '.pds-links' and then re-display it at new position somehow ? Code behind fiddle : .pds-question-top { font-size:10pt !important; padding-top:1px !important; padding-bottom:1px !important; margin-top:1px !important; margin-bottom:1px !important; } .pds-pd-link { display:none !important; } .pds-box { width:220px !important; } .pds-input-label { width:85% !important; } .PDS_Poll { margin-bottom:15px; } .pds-answer-span { color:#00f; } .pds-vote { background-color:#424242; } .pds-answer-text { color:#00f; padding-top:1px !important; padding-bottom:1px !important; margin-top:1px !important; margin-bottom:1px !important; } .pds-answer-feedback { padding-top:1px !important; padding-bottom:1px !important; margin-top:1px !important; margin-bottom:1px !important; } .pds-votebutton-outer { text-align:center; } .pds-answer-group { padding-top:1px !important; padding-bottom:1px !important; margin-top:1px !important; margin-bottom:1px !important; height:auto; overflow:hidden; } .pds-input-label,.pds-answer-input { float:left; } .pds-view-results,.pds-links { color:#FFF !important; padding-top:1px !important; padding-bottom:1px !important; margin-top:1px !important; margin-bottom:1px !important; } .pds-comments,.pds-return-poll { color:#FFF !important; } <script type="text/javascript" charset="utf-8" src="http://static.polldaddy.com/p/6352993.js"></script> <noscript><a href="http://polldaddy.com/poll/6352993/">This is very long test question to test how polldaddy handles questions that exceed that normal length............ yes a very long question indeed..............</a></noscript> $(document).ready(function() { });
0
11,410,128
07/10/2012 09:13:33
783,487
06/03/2011 23:29:44
21
4
Play! 2.0 database overwrite on application start. (MYSQL)
Every time I run my Play! application, I am told my database needs an evolution. This overwrites the information I currently have in the db, What could I be doing wrong?
java
mysql
scala
playframework
null
null
open
Play! 2.0 database overwrite on application start. (MYSQL) === Every time I run my Play! application, I am told my database needs an evolution. This overwrites the information I currently have in the db, What could I be doing wrong?
0
11,410,133
07/10/2012 09:13:43
81,892
03/24/2009 09:02:21
2,279
139
Approaching this case with ABDPDF
We have ABCPDF 8 available to work with for this case. We need to rebuild an existing PDF with markup and texts in it with text that comes from a CMS. What we basicly want to do is use an existing PDF and replace blocks of text and images with the ones our content editors specify in Sitecore. I have been looking at the documentation of ABCPDF but it's kind of overwelming at this point, cause it's the first time I'm trying to do anything with dynamically building a PDF. I found that it's possible to read text from an existing PDF document using the .GetText(""); method. This Method will accept 4 parameters and I've tried the SVG one (returns xml). When I load the xml in an XmlDocument I find that alot of textblocks which I assumed to be one block of text is split up in different parts. For example: <text xml:space="preserve" x="215.4312" y="48.9478" font-size="9" font-family="Arial-BoldMT" fill="rgb(237, 106, 0)" textLength="94.032" transform="translate(215.4312, 48.9478) translate(-215.4312, -48.9478)">wijkverpleegkundige?</text> <text xml:space="preserve" x="215.4312" y="61.9438" font-size="9" font-family="ArialMT" textLength="5.652" transform="translate(215.4312, 61.9438) translate(-215.4312, -61.9438)">&#8226;&#9;</text> <text xml:space="preserve" x="223.9362" y="61.9438" font-size="9" font-family="ArialMT" textLength="49.509" transform="translate(223.9362, 61.9438) translate(-223.9362, -61.9438)">Lichamelijke</text> <text xml:space="preserve" x="273.4452" y="61.9438" font-size="9" font-family="ArialMT" textLength="2.502" transform="translate(273.4452, 61.9438) translate(-273.4452, -61.9438)">&#9;</text> <text xml:space="preserve" x="275.9472" y="61.9438" font-size="9" font-family="ArialMT" textLength="32.013" transform="translate(275.9472, 61.9438) translate(-275.9472, -61.9438)">controle</text> <text xml:space="preserve" x="307.9602" y="61.9438" font-size="9" font-family="ArialMT" textLength="2.502" transform="translate(307.9602, 61.9438) translate(-307.9602, -61.9438)">&#9;</text> <text xml:space="preserve" x="310.4622" y="61.9438" font-size="9" font-family="ArialMT" textLength="10.008" transform="translate(310.4622, 61.9438) translate(-310.4622, -61.9438)">op</text> <text xml:space="preserve" x="320.4702" y="61.9438" font-size="9" font-family="ArialMT" textLength="2.502" transform="translate(320.4702, 61.9438) translate(-320.4702, -61.9438)">&#9;</text> <text xml:space="preserve" x="322.9722" y="61.9438" font-size="9" font-family="ArialMT" textLength="42.021" transform="translate(322.9722, 61.9438) translate(-322.9722, -61.9438)">bloeddruk,</text> <text xml:space="preserve" x="364.9932" y="61.9438" font-size="9" font-family="ArialMT" textLength="2.502" transform="translate(364.9932, 61.9438) translate(-364.9932, -61.9438)">&#9;</text> <text xml:space="preserve" x="223.9362" y="74.9398" font-size="9" font-family="ArialMT" transform="translate(223.9362, 74.9398) translate(-223.9362, -74.9398)" ><tspan textLength="46.017"> My first idea was to get all blocks of text and just replace them with my own text that comes from the CMS, but this doesn't seem to be the way to go. I'm now completely lost and don't know how to approach this issue. Is there any way to get the following XML to be accessible in objects in ABCPDF or am I doing things wrong? What will be the best approach on making this happen?
sitecore
abcpdf
null
null
null
null
open
Approaching this case with ABDPDF === We have ABCPDF 8 available to work with for this case. We need to rebuild an existing PDF with markup and texts in it with text that comes from a CMS. What we basicly want to do is use an existing PDF and replace blocks of text and images with the ones our content editors specify in Sitecore. I have been looking at the documentation of ABCPDF but it's kind of overwelming at this point, cause it's the first time I'm trying to do anything with dynamically building a PDF. I found that it's possible to read text from an existing PDF document using the .GetText(""); method. This Method will accept 4 parameters and I've tried the SVG one (returns xml). When I load the xml in an XmlDocument I find that alot of textblocks which I assumed to be one block of text is split up in different parts. For example: <text xml:space="preserve" x="215.4312" y="48.9478" font-size="9" font-family="Arial-BoldMT" fill="rgb(237, 106, 0)" textLength="94.032" transform="translate(215.4312, 48.9478) translate(-215.4312, -48.9478)">wijkverpleegkundige?</text> <text xml:space="preserve" x="215.4312" y="61.9438" font-size="9" font-family="ArialMT" textLength="5.652" transform="translate(215.4312, 61.9438) translate(-215.4312, -61.9438)">&#8226;&#9;</text> <text xml:space="preserve" x="223.9362" y="61.9438" font-size="9" font-family="ArialMT" textLength="49.509" transform="translate(223.9362, 61.9438) translate(-223.9362, -61.9438)">Lichamelijke</text> <text xml:space="preserve" x="273.4452" y="61.9438" font-size="9" font-family="ArialMT" textLength="2.502" transform="translate(273.4452, 61.9438) translate(-273.4452, -61.9438)">&#9;</text> <text xml:space="preserve" x="275.9472" y="61.9438" font-size="9" font-family="ArialMT" textLength="32.013" transform="translate(275.9472, 61.9438) translate(-275.9472, -61.9438)">controle</text> <text xml:space="preserve" x="307.9602" y="61.9438" font-size="9" font-family="ArialMT" textLength="2.502" transform="translate(307.9602, 61.9438) translate(-307.9602, -61.9438)">&#9;</text> <text xml:space="preserve" x="310.4622" y="61.9438" font-size="9" font-family="ArialMT" textLength="10.008" transform="translate(310.4622, 61.9438) translate(-310.4622, -61.9438)">op</text> <text xml:space="preserve" x="320.4702" y="61.9438" font-size="9" font-family="ArialMT" textLength="2.502" transform="translate(320.4702, 61.9438) translate(-320.4702, -61.9438)">&#9;</text> <text xml:space="preserve" x="322.9722" y="61.9438" font-size="9" font-family="ArialMT" textLength="42.021" transform="translate(322.9722, 61.9438) translate(-322.9722, -61.9438)">bloeddruk,</text> <text xml:space="preserve" x="364.9932" y="61.9438" font-size="9" font-family="ArialMT" textLength="2.502" transform="translate(364.9932, 61.9438) translate(-364.9932, -61.9438)">&#9;</text> <text xml:space="preserve" x="223.9362" y="74.9398" font-size="9" font-family="ArialMT" transform="translate(223.9362, 74.9398) translate(-223.9362, -74.9398)" ><tspan textLength="46.017"> My first idea was to get all blocks of text and just replace them with my own text that comes from the CMS, but this doesn't seem to be the way to go. I'm now completely lost and don't know how to approach this issue. Is there any way to get the following XML to be accessible in objects in ABCPDF or am I doing things wrong? What will be the best approach on making this happen?
0
11,410,136
07/10/2012 09:13:54
1,493,850
07/01/2012 04:18:25
64
1
error in implementing static files in django
my settings.py file:- STATIC_ROOT = '/home/pooja/Desktop/static/' # URL prefix for static files. STATIC_URL = '/static/' # Additional locations of static files STATICFILES_DIRS = ( '/home/pooja/Desktop/mysite/search/static', ) my urls.py file:- from django.conf.urls import patterns, include, url from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^search/$','search.views.front_page'), url(r'^admin/', include(admin.site.urls)), ) urlpatterns += staticfiles_urlpatterns() I have created an app using django which seraches the keywords in 10 xml documents and then return their frequency count displayed as graphical representation and list of filenames and their respective counts.Now the list has filenames hyperlinked, I want to display them on the django server when user clicks them , for that I have used static files provision in django. Hyperlinking has been done in this manner: <ul> {% for l in list1 %} <li><a href="{{STATIC_URL}}static/{{l.file_name}}">{{l.file_name}}</a{{l.frequency_count</li> {% endfor %} </ul> Now when I run my app on the server, everything is running fine but as soon as I click on the filename, it gives me this error : Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order: ^search/$ ^admin/ ^static\/(?P<path>.*)$ The current URL, search/static/books.xml, didn't match any of these. I don't know why this error is coming, because I have followed the steps required to achieve this. I have posted my urls.py file and it is showing error in that only. I'm new to django , so Please help
python
django
linux
ubuntu-10.04
null
null
open
error in implementing static files in django === my settings.py file:- STATIC_ROOT = '/home/pooja/Desktop/static/' # URL prefix for static files. STATIC_URL = '/static/' # Additional locations of static files STATICFILES_DIRS = ( '/home/pooja/Desktop/mysite/search/static', ) my urls.py file:- from django.conf.urls import patterns, include, url from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^search/$','search.views.front_page'), url(r'^admin/', include(admin.site.urls)), ) urlpatterns += staticfiles_urlpatterns() I have created an app using django which seraches the keywords in 10 xml documents and then return their frequency count displayed as graphical representation and list of filenames and their respective counts.Now the list has filenames hyperlinked, I want to display them on the django server when user clicks them , for that I have used static files provision in django. Hyperlinking has been done in this manner: <ul> {% for l in list1 %} <li><a href="{{STATIC_URL}}static/{{l.file_name}}">{{l.file_name}}</a{{l.frequency_count</li> {% endfor %} </ul> Now when I run my app on the server, everything is running fine but as soon as I click on the filename, it gives me this error : Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order: ^search/$ ^admin/ ^static\/(?P<path>.*)$ The current URL, search/static/books.xml, didn't match any of these. I don't know why this error is coming, because I have followed the steps required to achieve this. I have posted my urls.py file and it is showing error in that only. I'm new to django , so Please help
0
11,410,139
07/10/2012 09:14:03
1,451,543
06/12/2012 14:53:56
36
2
foreach not getting all values from array
I have an array with 15 elements. When i use `count($array);` it shows 15 ! But when i use $i = 0; foreach($array as $value){ $n = $i++; echo $n; } it count to 9, not to 15
php
arrays
foreach
null
null
null
open
foreach not getting all values from array === I have an array with 15 elements. When i use `count($array);` it shows 15 ! But when i use $i = 0; foreach($array as $value){ $n = $i++; echo $n; } it count to 9, not to 15
0
11,410,145
07/10/2012 09:14:40
985,813
10/08/2011 21:07:28
11
0
what is the best opensource CMS for mobile?
My project consists of developing a mobile cms to manage content on a smartphone(android,ios) <br> The content contains the design of the application using a template (pictures,videos,layouts ..) <br> To generate this content , i want to use jquery mobile based on HTML5 . <br> i have two choices : 1. create a custom cms based on symfony2 2. use an opensource cms thank you in advance
content-management-system
null
null
null
null
null
open
what is the best opensource CMS for mobile? === My project consists of developing a mobile cms to manage content on a smartphone(android,ios) <br> The content contains the design of the application using a template (pictures,videos,layouts ..) <br> To generate this content , i want to use jquery mobile based on HTML5 . <br> i have two choices : 1. create a custom cms based on symfony2 2. use an opensource cms thank you in advance
0
11,410,093
07/10/2012 09:11:19
567,059
01/07/2011 15:16:14
442
11
Reorder items in an RSS feed
I have 2 websites, and I wish to show some posts from one on the other using an RSS feed. Trouble is, the default seems to be order by publish date, where as I need them ordered by title. I'm using Wordpress, which uses SimplePie (which I believe is pretty common?). Is there a way to reorder these items before I display them? Thanks. /** * $feed = the RSS feed to display (set via CMS option) * $num_posts = the number of posts to display from the feed (set via CMS option) */ $max_items = 0; if($feed !== '') : $rss = fetch_feed($feed); if(!is_wp_error($rss)) : $max_items = $rss->get_item_quantity($num_posts); $rss_items = $rss->get_items(0, $max_items); endif; endif;
php
order
simplepie
null
null
null
open
Reorder items in an RSS feed === I have 2 websites, and I wish to show some posts from one on the other using an RSS feed. Trouble is, the default seems to be order by publish date, where as I need them ordered by title. I'm using Wordpress, which uses SimplePie (which I believe is pretty common?). Is there a way to reorder these items before I display them? Thanks. /** * $feed = the RSS feed to display (set via CMS option) * $num_posts = the number of posts to display from the feed (set via CMS option) */ $max_items = 0; if($feed !== '') : $rss = fetch_feed($feed); if(!is_wp_error($rss)) : $max_items = $rss->get_item_quantity($num_posts); $rss_items = $rss->get_items(0, $max_items); endif; endif;
0
11,410,095
07/10/2012 09:11:26
1,498,347
07/03/2012 09:34:41
1
0
Modification on OSAP application
I'm developing an Email application on Android I downloaded the default email application from [this link][1] which is an OSAP. I've changed the name of the package and did some modification to the source code is this enough to install the project as new project on a device? because when compile it on linux using make command it produces many errors!!! [1]: https://android.googlesource.com/platform/packages/apps/Email
android
open-source
modify
null
null
null
open
Modification on OSAP application === I'm developing an Email application on Android I downloaded the default email application from [this link][1] which is an OSAP. I've changed the name of the package and did some modification to the source code is this enough to install the project as new project on a device? because when compile it on linux using make command it produces many errors!!! [1]: https://android.googlesource.com/platform/packages/apps/Email
0
11,372,684
07/07/2012 05:56:12
1,396,823
05/15/2012 17:22:54
28
1
AutoCompletetextView issue with Nexus (Maybe is 4.0.X)
My issue is that I have a big, enormous list for the AutoComplete. Example: 1. Store A 2. Store B 3. Store C 4. Store D 5. Store F 6. Store H 7. Store I Ass you can see they all use Store and when I start typing store I see the (...) in the phone, where I can see the other stores, but if I chose one inside that (...) it will be added to the AutoComplete and not handle by the OnItemClick. Is there anyway to solve this? Thanks in advice Example Pics ![enter image description here][1] Here is the Store Search ![enter image description here][2] Here I clicked Store B and you can see the Toast that it was handle by OnItemClick ![enter image description here][3] Here you can see the (...) extra stores.![enter image description here][4] and finally you can see that it was added to the AutoCompleteTextView instead of handled by the OnItemClick [1]: http://i.stack.imgur.com/0w4uK.png [2]: http://i.stack.imgur.com/HXCwD.png [3]: http://i.stack.imgur.com/liyOm.png [4]: http://i.stack.imgur.com/pDwh9.png
java
android
ics
autocompletetextview
null
null
open
AutoCompletetextView issue with Nexus (Maybe is 4.0.X) === My issue is that I have a big, enormous list for the AutoComplete. Example: 1. Store A 2. Store B 3. Store C 4. Store D 5. Store F 6. Store H 7. Store I Ass you can see they all use Store and when I start typing store I see the (...) in the phone, where I can see the other stores, but if I chose one inside that (...) it will be added to the AutoComplete and not handle by the OnItemClick. Is there anyway to solve this? Thanks in advice Example Pics ![enter image description here][1] Here is the Store Search ![enter image description here][2] Here I clicked Store B and you can see the Toast that it was handle by OnItemClick ![enter image description here][3] Here you can see the (...) extra stores.![enter image description here][4] and finally you can see that it was added to the AutoCompleteTextView instead of handled by the OnItemClick [1]: http://i.stack.imgur.com/0w4uK.png [2]: http://i.stack.imgur.com/HXCwD.png [3]: http://i.stack.imgur.com/liyOm.png [4]: http://i.stack.imgur.com/pDwh9.png
0
11,372,688
07/07/2012 05:57:05
1,056,509
11/20/2011 15:52:40
11
6
Datapoint style in Silverlight Chart Series(ColumnSeries/BarSeries/LineSeries)
I have a very wierd issue with style of Silverlight Charting controls. When I create a DataPointStyle for anyseries It ignore the existing default color combination. It starts showing me same(orange) color for everything even I haven't set anything in the background of DataPointStyle. What I want is to create some custom tooltip and leave the background as it is. But its not working for me. Any suggestion is much appreciated. http://www.exploresilverlight.com Cheers! Vinod
silverlight
charts
silverlight-toolkit
null
null
null
open
Datapoint style in Silverlight Chart Series(ColumnSeries/BarSeries/LineSeries) === I have a very wierd issue with style of Silverlight Charting controls. When I create a DataPointStyle for anyseries It ignore the existing default color combination. It starts showing me same(orange) color for everything even I haven't set anything in the background of DataPointStyle. What I want is to create some custom tooltip and leave the background as it is. But its not working for me. Any suggestion is much appreciated. http://www.exploresilverlight.com Cheers! Vinod
0
11,372,689
07/07/2012 05:57:15
1,490,290
06/29/2012 04:58:32
1
0
JavaScript libraries that connects two Raphael objects in flowchart connectors style?
I am searching for a js lib that works on Raphael object. Means that conects multiple Raphael objects in flowchart connectors style. I works with jsplumb but is dosent work with Raphael object. So plz me know if anyone know about such js lib. Thanks in advance
raphael
null
null
null
null
null
open
JavaScript libraries that connects two Raphael objects in flowchart connectors style? === I am searching for a js lib that works on Raphael object. Means that conects multiple Raphael objects in flowchart connectors style. I works with jsplumb but is dosent work with Raphael object. So plz me know if anyone know about such js lib. Thanks in advance
0
11,372,693
07/07/2012 05:58:42
1,498,096
07/03/2012 07:59:12
2
1
How to have multiple pages on an iOS game
I am relatively new to Objective C, but not with programming in which I have experience with both C and Python. I was wondering that if I were to have a simple game and settings section on my app, how to navigate through it. And could I incorporate some of C into my app, to make it faster and more in my opinion "reliable?"
iphone
python
objective-c
ios
c
null
open
How to have multiple pages on an iOS game === I am relatively new to Objective C, but not with programming in which I have experience with both C and Python. I was wondering that if I were to have a simple game and settings section on my app, how to navigate through it. And could I incorporate some of C into my app, to make it faster and more in my opinion "reliable?"
0
11,226,206
06/27/2012 12:28:32
1,485,602
06/27/2012 12:18:10
1
0
error in running a java script from xsl file
Please help me with the problem I am facing. I have an xsl file which has a javascript function. I am getting an error in calling the javascript function, and I cant understand what's wrong. Please help. Its urgent. Thanks in advance. Here is the javascript - <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt"> <xsl:import href="page_layout.xsl"/> <xsl:output method="html" indent="yes"/> <msxsl:script language="JScript"> <![CDATA[ funntion EnableSubmit() { alert ("Hello there"); } ]]> </msxsl:script> Here is the form which calls the function - < form action="NewUserNavigation" method="post" name="NewUserNavigationForm"> < input name="eventName" type="hidden" value="NewUserNavigationEvent"/> < div class="sansIcon"> < input type="checkbox" name="chk" onClick="EnableSubmit()">I accept< /input> < /div> < div class="buttonBarPage"> < input name="Submit" class="primary" type="submit" value="Continue"/> < /div> < /form> Both the form and the javascript is a part of the same .xml file
javascript
xslt
null
null
null
null
open
error in running a java script from xsl file === Please help me with the problem I am facing. I have an xsl file which has a javascript function. I am getting an error in calling the javascript function, and I cant understand what's wrong. Please help. Its urgent. Thanks in advance. Here is the javascript - <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt"> <xsl:import href="page_layout.xsl"/> <xsl:output method="html" indent="yes"/> <msxsl:script language="JScript"> <![CDATA[ funntion EnableSubmit() { alert ("Hello there"); } ]]> </msxsl:script> Here is the form which calls the function - < form action="NewUserNavigation" method="post" name="NewUserNavigationForm"> < input name="eventName" type="hidden" value="NewUserNavigationEvent"/> < div class="sansIcon"> < input type="checkbox" name="chk" onClick="EnableSubmit()">I accept< /input> < /div> < div class="buttonBarPage"> < input name="Submit" class="primary" type="submit" value="Continue"/> < /div> < /form> Both the form and the javascript is a part of the same .xml file
0
11,226,222
06/27/2012 12:29:14
1,167,332
01/24/2012 15:20:40
2
0
Posted parameters always empty from view to controller in MVC4
I have got a problem to get back a parameter from my view to my controller with MVC4. This is my model's classes (sorry for all this code, I wanted to post an image at first but I'm too newbie to be allowed to to that): public class Form { public Form() { this.Rows = new List<Row>(); } public List<Row> Rows { get; set; } } public abstract class Row { protected Row() { this.Label = string.Empty; this.Type = string.Empty; } public string Label { get; set; } public string Type { get; set; } } public class SimpleRow : Row { public SimpleRow() { this.Value = string.Empty; } public string Value { get; set; } } public class CheckRow : Row { public CheckRow() { this.CheckedItems = new List<CheckedItem>(); this.Id = 0; } public List<CheckedItem> CheckedItems { get; set; } public int Id { get; set; } } public class CheckRow : Row { public CheckRow() { this.CheckedItems = new List<CheckedItem>(); this.Id = 0; } public List<CheckedItem> CheckedItems { get; set; } public int Id { get; set; } } I managed to build my view from an input xml file which is the serialization of my model. But my problem is, when I change some value in my view and push the save button, i get back an empty parameter in my controller function. The controller : public class FormController : Controller { // GET: /Form/ #region Public Methods and Operators [Authorize] public ActionResult Index(HttpPostedFileBase file) { this.ViewBag.Title = "Formulaire Collaborateur"; if (file != null && file.ContentLength > 0) { return this.View(SerialisationHelper.DeserializeFromStream<Form>(file.InputStream)); } return this.View(); } [HttpPost] [Authorize] public ActionResult EmailForm(Form updatedForm) { Form f = updatedForm; // Empty instance of Form return this.View("Index"); } #endregion } And my view : @model Form @{ ViewBag.Title = "Index"; } @using (Html.BeginForm("EmailForm", "Form", FormMethod.Post, new { enctype = "multipart/form-data" })) { <fieldset> @foreach (var row in Model.Rows) { @Html.Partial("Row", row) } <p> <input type="submit" value="Save" /> </p> </fieldset> <br /> } This view calls the other view associated to my model classes. If you need more code I will post it. And, please, excuse my english, I'm not a native speaker. Florent
c#
.net
razor
asp.net-mvc-4
null
null
open
Posted parameters always empty from view to controller in MVC4 === I have got a problem to get back a parameter from my view to my controller with MVC4. This is my model's classes (sorry for all this code, I wanted to post an image at first but I'm too newbie to be allowed to to that): public class Form { public Form() { this.Rows = new List<Row>(); } public List<Row> Rows { get; set; } } public abstract class Row { protected Row() { this.Label = string.Empty; this.Type = string.Empty; } public string Label { get; set; } public string Type { get; set; } } public class SimpleRow : Row { public SimpleRow() { this.Value = string.Empty; } public string Value { get; set; } } public class CheckRow : Row { public CheckRow() { this.CheckedItems = new List<CheckedItem>(); this.Id = 0; } public List<CheckedItem> CheckedItems { get; set; } public int Id { get; set; } } public class CheckRow : Row { public CheckRow() { this.CheckedItems = new List<CheckedItem>(); this.Id = 0; } public List<CheckedItem> CheckedItems { get; set; } public int Id { get; set; } } I managed to build my view from an input xml file which is the serialization of my model. But my problem is, when I change some value in my view and push the save button, i get back an empty parameter in my controller function. The controller : public class FormController : Controller { // GET: /Form/ #region Public Methods and Operators [Authorize] public ActionResult Index(HttpPostedFileBase file) { this.ViewBag.Title = "Formulaire Collaborateur"; if (file != null && file.ContentLength > 0) { return this.View(SerialisationHelper.DeserializeFromStream<Form>(file.InputStream)); } return this.View(); } [HttpPost] [Authorize] public ActionResult EmailForm(Form updatedForm) { Form f = updatedForm; // Empty instance of Form return this.View("Index"); } #endregion } And my view : @model Form @{ ViewBag.Title = "Index"; } @using (Html.BeginForm("EmailForm", "Form", FormMethod.Post, new { enctype = "multipart/form-data" })) { <fieldset> @foreach (var row in Model.Rows) { @Html.Partial("Row", row) } <p> <input type="submit" value="Save" /> </p> </fieldset> <br /> } This view calls the other view associated to my model classes. If you need more code I will post it. And, please, excuse my english, I'm not a native speaker. Florent
0
11,214,078
06/26/2012 18:51:10
1,043,071
11/12/2011 11:45:36
460
3
Thread Virtual Memory state
As we all know in case of multiple threads each thread maintains it's separate stack and register state. do they also maintain separate virtual memory state or it can be shared ? I don't think there should be any problem in sharing virtual memory state between processes.
multithreading
operating-system
virtual-memory
null
null
null
open
Thread Virtual Memory state === As we all know in case of multiple threads each thread maintains it's separate stack and register state. do they also maintain separate virtual memory state or it can be shared ? I don't think there should be any problem in sharing virtual memory state between processes.
0
11,226,226
06/27/2012 12:29:26
601,603
02/03/2011 13:52:49
239
11
Capitalize first letter of sentence in CKeditor
I wish to capitalize the first letter of a sentence, on-the-fly, as the user types the text in a CKEditor content instance. The strategy consists in catching each keystroke and try to replace it when necessary, that is for instance, when the inserted character follows a dot and a space. I'm fine with catching the event, but can't find a way to parse characters surrounding the caret position: <!-- language: lang-js --> var instance = CKEDITOR.instances.htmlarea instance.document.getBody().on('keyup', function(event) { console.log(event); // Would like to parse here from the event object... event.data.preventDefault(); }); Any help would be much appreciated including a strategy alternative.
ckeditor
fckeditor
null
null
null
null
open
Capitalize first letter of sentence in CKeditor === I wish to capitalize the first letter of a sentence, on-the-fly, as the user types the text in a CKEditor content instance. The strategy consists in catching each keystroke and try to replace it when necessary, that is for instance, when the inserted character follows a dot and a space. I'm fine with catching the event, but can't find a way to parse characters surrounding the caret position: <!-- language: lang-js --> var instance = CKEDITOR.instances.htmlarea instance.document.getBody().on('keyup', function(event) { console.log(event); // Would like to parse here from the event object... event.data.preventDefault(); }); Any help would be much appreciated including a strategy alternative.
0
11,226,229
06/27/2012 12:29:44
1,360,400
01/16/2011 23:23:54
75
1
Google maps API geocode - additional parameter
I have var marker = geo.geocode({address: adr}, geoc); where function geoc(results, status) {... I want to set additional parameter to the function **geoc** but I do not know how to call **geoc** with three parameters. How to do it, please help, I'am noob in JS :D
javascript
google-maps-api-3
null
null
null
null
open
Google maps API geocode - additional parameter === I have var marker = geo.geocode({address: adr}, geoc); where function geoc(results, status) {... I want to set additional parameter to the function **geoc** but I do not know how to call **geoc** with three parameters. How to do it, please help, I'am noob in JS :D
0
11,226,238
06/27/2012 12:30:09
1,485,617
06/27/2012 12:23:48
1
0
How to change the color of a view with a button click in android?
I created a greeting cards application and In my android application i have to change the background color of the view( which is the background of the card) when a button is clicked. When i click the button labeled red the view should change it's color to red. and so on. Can someone help me with this? This is a sample code i found, but it doesn't work. public void myClickHandler(View view) { switch (view.getId()) { case R.id.btn1: layout= (FrameLayout) findViewById(R.id.laidout); layout.setBackgroundColor(Color.RED); break; }
android
view
buttonclick
null
null
null
open
How to change the color of a view with a button click in android? === I created a greeting cards application and In my android application i have to change the background color of the view( which is the background of the card) when a button is clicked. When i click the button labeled red the view should change it's color to red. and so on. Can someone help me with this? This is a sample code i found, but it doesn't work. public void myClickHandler(View view) { switch (view.getId()) { case R.id.btn1: layout= (FrameLayout) findViewById(R.id.laidout); layout.setBackgroundColor(Color.RED); break; }
0
11,226,239
06/27/2012 12:30:10
572,412
01/12/2011 08:36:48
76
0
How to do error handling when using Future.flow - CPS Continuation Passing Style
I am trying to implement error handling in below function. My problem is that I need to unwrap Future[Either[Exception,MyValue]] and test for "Right" every time I what to use the MyValue as a param. The strategy is to let the Future.flow fail if any of the f1 to f4 fails. One solution is to pass the Either[Exception,MyValue] as a param to the funcReturnFutureEitherX() like funcReturnFutureEither3(f2()) but this just propagate the error handling downwards instead of handling it in the main program MyFlowFunc(). How do I implement error handling in the below function and keep it running none blocking ? def MyFlowFunc():Future[(MyValue,MyValue,MyValue,MyValue)] = val v = Future.flow { // fail flow if below functions fails with a Either.Left() val f1 = funcReturnFutureEither1() val f2 = funcReturnFutureEither2(f1()) val f3 = funcReturnFutureEither3(f2()) val f4 = funcReturnFutureEither4(f1()) val res = (f1(),f2(),f3(),f4()) } } def funcReturnEitherX(val:MyValue):Future[Either[Exception,MyValue]]
scala
akka
null
null
null
null
open
How to do error handling when using Future.flow - CPS Continuation Passing Style === I am trying to implement error handling in below function. My problem is that I need to unwrap Future[Either[Exception,MyValue]] and test for "Right" every time I what to use the MyValue as a param. The strategy is to let the Future.flow fail if any of the f1 to f4 fails. One solution is to pass the Either[Exception,MyValue] as a param to the funcReturnFutureEitherX() like funcReturnFutureEither3(f2()) but this just propagate the error handling downwards instead of handling it in the main program MyFlowFunc(). How do I implement error handling in the below function and keep it running none blocking ? def MyFlowFunc():Future[(MyValue,MyValue,MyValue,MyValue)] = val v = Future.flow { // fail flow if below functions fails with a Either.Left() val f1 = funcReturnFutureEither1() val f2 = funcReturnFutureEither2(f1()) val f3 = funcReturnFutureEither3(f2()) val f4 = funcReturnFutureEither4(f1()) val res = (f1(),f2(),f3(),f4()) } } def funcReturnEitherX(val:MyValue):Future[Either[Exception,MyValue]]
0
11,386,739
07/08/2012 21:11:25
1,341,708
04/18/2012 14:53:57
90
1
Powershell GUI: Adding multiple instances of .tooltipseperator to menu
So, I'm having a problem whereby for some reason I can only add one instance of a .tooltipseperator to a drop down menu. E.g. I have to create a new .tooltipseperator if I want to add another to a different menu list. I have this: $seperator = new-object System.Windows.Forms.Toolstripseparator $seperator1 = new-object System.Windows.Forms.Toolstripseparator which correlates to this: [Void]$packages_menu_bar.DropDownItems.Add($seperator1) [Void]$packages_menu_bar.DropDownItems.Add($Remove_from_AD) [Void]$process.DropDownItems.Add($Kill_process) [Void]$process.DropDownItems.Add($seperator) My question is this: how can I add the same instance on a .tooltipseperator to different menu items? Some sort of array? Thanks
.net
arrays
powershell
null
null
null
open
Powershell GUI: Adding multiple instances of .tooltipseperator to menu === So, I'm having a problem whereby for some reason I can only add one instance of a .tooltipseperator to a drop down menu. E.g. I have to create a new .tooltipseperator if I want to add another to a different menu list. I have this: $seperator = new-object System.Windows.Forms.Toolstripseparator $seperator1 = new-object System.Windows.Forms.Toolstripseparator which correlates to this: [Void]$packages_menu_bar.DropDownItems.Add($seperator1) [Void]$packages_menu_bar.DropDownItems.Add($Remove_from_AD) [Void]$process.DropDownItems.Add($Kill_process) [Void]$process.DropDownItems.Add($seperator) My question is this: how can I add the same instance on a .tooltipseperator to different menu items? Some sort of array? Thanks
0
11,386,744
07/08/2012 21:12:27
1,479,431
06/25/2012 08:48:23
16
0
extracting multiple tags from xml using PHP
Here is my address.xml <?xml version="1.0" ?> <!--Sample XML document --> <AddressBook> <Addressentry> <firstName>jack</firstName> <lastName>S</lastName> <Address>2899,Ray Road</Address> <Email>[email protected]</Email> </Addressentry> <Addressentry> <firstName>Sid</firstName> <lastName>K</lastName> <Address>238,Baseline Road,TX</Address> <Email>[email protected]</Email> <Email>[email protected]</Email> </Addressentry> <Addressentry> <firstName>Satya</firstName> <lastName>Yar</lastName> <Address>6,Rural Road,Tempe,AZ</Address> <Email>[email protected]</Email> <Email>[email protected]</Email> <Email>[email protected]</Email> </Addressentry> </AddressBook> I am trying to load all the entries using PHP code as below. Each addressentry can have one or more <Email> tags. Right now from the code below I am able to extract only one <Email> tag. My question is how do I extract all <Email> tags associated with particular Addressentry. that is I want to print all emails on the same line. <?php $theData = simplexml_load_File("address.xml"); foreach($theData->Addressentry as $theAddress) { $theFirstName = $theAddress->firstName; $theLastName = $theAddress->lastName; $theAdd = $theAddress->Address; echo "<p>".$theFirstName." ".$theLastName."<br/> ".$theAdd."<br/> ".$theAddress->Email."<br/> </p>"; unset($theFirstName); unset($theLastName); unset($theAdd); unset($theEmail); } ?> Any help would be appreciated
php
xml
null
null
null
null
open
extracting multiple tags from xml using PHP === Here is my address.xml <?xml version="1.0" ?> <!--Sample XML document --> <AddressBook> <Addressentry> <firstName>jack</firstName> <lastName>S</lastName> <Address>2899,Ray Road</Address> <Email>[email protected]</Email> </Addressentry> <Addressentry> <firstName>Sid</firstName> <lastName>K</lastName> <Address>238,Baseline Road,TX</Address> <Email>[email protected]</Email> <Email>[email protected]</Email> </Addressentry> <Addressentry> <firstName>Satya</firstName> <lastName>Yar</lastName> <Address>6,Rural Road,Tempe,AZ</Address> <Email>[email protected]</Email> <Email>[email protected]</Email> <Email>[email protected]</Email> </Addressentry> </AddressBook> I am trying to load all the entries using PHP code as below. Each addressentry can have one or more <Email> tags. Right now from the code below I am able to extract only one <Email> tag. My question is how do I extract all <Email> tags associated with particular Addressentry. that is I want to print all emails on the same line. <?php $theData = simplexml_load_File("address.xml"); foreach($theData->Addressentry as $theAddress) { $theFirstName = $theAddress->firstName; $theLastName = $theAddress->lastName; $theAdd = $theAddress->Address; echo "<p>".$theFirstName." ".$theLastName."<br/> ".$theAdd."<br/> ".$theAddress->Email."<br/> </p>"; unset($theFirstName); unset($theLastName); unset($theAdd); unset($theEmail); } ?> Any help would be appreciated
0
11,386,745
07/08/2012 21:12:30
1,494,241
07/01/2012 12:27:14
8
0
Is it possible to embed a flash player in a table and retain the table properties
I'd like to embed a music (flash) player in a table with clickable images but the embed code seems to throw the table properties off - it extends the width of the table. Is it possible to embed the player on the same row as the image whilst still retaining the table width? Here's what I've been using: <table width="620" border="0" cellspacing="0" cellpadding="0"> <tr> <td> <div align="left"><object height="18" width="100%"> <param name="movie" value="https://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Fplaylists%2F1253725&amp;auto_play=false&amp;player_type=tiny&amp;font=Georgia&amp;color=9a6600&show_playcount=false&default_width=375&default_height=40&show_user=false"></param> <param name="allowscriptaccess" value="always"></param> <param name="wmode" value="transparent"></param><embed wmode="transparent" allowscriptaccess="always" height="18" src="https://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Fplaylists%2F1253725&amp;auto_play=false&amp;player_type=tiny&amp;font=Georgia&amp;color=9a6600&show_playcount=false&default_width=375&default_height=40&show_user=false" type="application/x-shockwave-flash" width="100%"></embed> </object> </td> <td> <div align="right"><img src="http://dl.dropbox.com/u/31856944/Virb/splash_freedownload-2.png" border="0" width="245" height="42" usemap="#Map" /></div> </td> </tr> <tr> <td> <div align="right"><img src="http://dl.dropbox.com/u/31856944/Virb/splash_share-2.png" border="0" width="620" height="31" usemap="#Map2" /></div> </td> </tr> </table>
flash
table
embed
null
null
null
open
Is it possible to embed a flash player in a table and retain the table properties === I'd like to embed a music (flash) player in a table with clickable images but the embed code seems to throw the table properties off - it extends the width of the table. Is it possible to embed the player on the same row as the image whilst still retaining the table width? Here's what I've been using: <table width="620" border="0" cellspacing="0" cellpadding="0"> <tr> <td> <div align="left"><object height="18" width="100%"> <param name="movie" value="https://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Fplaylists%2F1253725&amp;auto_play=false&amp;player_type=tiny&amp;font=Georgia&amp;color=9a6600&show_playcount=false&default_width=375&default_height=40&show_user=false"></param> <param name="allowscriptaccess" value="always"></param> <param name="wmode" value="transparent"></param><embed wmode="transparent" allowscriptaccess="always" height="18" src="https://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Fplaylists%2F1253725&amp;auto_play=false&amp;player_type=tiny&amp;font=Georgia&amp;color=9a6600&show_playcount=false&default_width=375&default_height=40&show_user=false" type="application/x-shockwave-flash" width="100%"></embed> </object> </td> <td> <div align="right"><img src="http://dl.dropbox.com/u/31856944/Virb/splash_freedownload-2.png" border="0" width="245" height="42" usemap="#Map" /></div> </td> </tr> <tr> <td> <div align="right"><img src="http://dl.dropbox.com/u/31856944/Virb/splash_share-2.png" border="0" width="620" height="31" usemap="#Map2" /></div> </td> </tr> </table>
0
11,386,747
07/08/2012 21:12:45
969,617
09/28/2011 17:25:15
727
11
python input UnicodeDecodeError:
python 3.x >>> a = input() hope >>> a 'hope' >>> b = input() hΓ₯pe >>> b 'hΓ₯pe' >>> c = input() start typing hΓ₯... delete using backspace... and change to hope Traceback (most recent call last): File "<stdin>", line 1, in <module> UnicodeDecodeError: 'utf8' codec can't decode byte 0xc3 in position 1: invalid continuation byte >>> The situation is not terrible, I am working around it, but find it strange that when deleting, the bytes get messed up. Has anyone else experienced this? the terminal history shows that it thought that I entered `h?ope` any ideas? in the script that is using this, I do import `readline` to give command line history.
python
unicode
input
null
null
null
open
python input UnicodeDecodeError: === python 3.x >>> a = input() hope >>> a 'hope' >>> b = input() hΓ₯pe >>> b 'hΓ₯pe' >>> c = input() start typing hΓ₯... delete using backspace... and change to hope Traceback (most recent call last): File "<stdin>", line 1, in <module> UnicodeDecodeError: 'utf8' codec can't decode byte 0xc3 in position 1: invalid continuation byte >>> The situation is not terrible, I am working around it, but find it strange that when deleting, the bytes get messed up. Has anyone else experienced this? the terminal history shows that it thought that I entered `h?ope` any ideas? in the script that is using this, I do import `readline` to give command line history.
0
11,386,737
07/08/2012 21:11:05
1,349,213
04/22/2012 06:50:07
47
0
How to resize controls at runtime in java
Is there a way to resize a control, a JTextfield for example, at runtime in java? I want my textfield to have the resize cursors (just like when you point your cursor on the corner of a window) and will be able to resize on runtime. Ive read on the internet that vb6 and C# have those capabilities, is there anything for java? A sample code or a link to a good tutorial will be very much appreciated. Thank you.
java
swing
resize
runtime
null
null
open
How to resize controls at runtime in java === Is there a way to resize a control, a JTextfield for example, at runtime in java? I want my textfield to have the resize cursors (just like when you point your cursor on the corner of a window) and will be able to resize on runtime. Ive read on the internet that vb6 and C# have those capabilities, is there anything for java? A sample code or a link to a good tutorial will be very much appreciated. Thank you.
0
11,386,749
07/08/2012 21:13:13
1,333,988
04/15/2012 01:25:03
5
0
PHP the SELECT FROM WHERE col IN no working using array
I'm trying to pull some data from MySQL using an Array that was fetch from a first query. Everything's fine all the way to the implode after that, it's been a headache for me. Can someone help me? <?php $var = 'somedata'; include("config/conect.php"); $zip="SELECT * FROM table WHERE firstcol LIKE '%$var%' ORDER BY seconcol"; $results = $connetction->query($zip); while ($row = $results->fetch_array()){ $mycode[]=$row['zip']; } array_pop($mycode); $mycode = implode(', ',$mycode); //print_r ($mycode); echo '<br /><br /><br />'; $usr="SELECT * FROM reg_temp WHERE zip IN('".join("','", $mycode)."')"; $results = $asies->query($usr); while ($row = $results-> fetch_arra()) { $name = $row['name']; echo $name; } ?>
php
mysql
null
null
null
null
open
PHP the SELECT FROM WHERE col IN no working using array === I'm trying to pull some data from MySQL using an Array that was fetch from a first query. Everything's fine all the way to the implode after that, it's been a headache for me. Can someone help me? <?php $var = 'somedata'; include("config/conect.php"); $zip="SELECT * FROM table WHERE firstcol LIKE '%$var%' ORDER BY seconcol"; $results = $connetction->query($zip); while ($row = $results->fetch_array()){ $mycode[]=$row['zip']; } array_pop($mycode); $mycode = implode(', ',$mycode); //print_r ($mycode); echo '<br /><br /><br />'; $usr="SELECT * FROM reg_temp WHERE zip IN('".join("','", $mycode)."')"; $results = $asies->query($usr); while ($row = $results-> fetch_arra()) { $name = $row['name']; echo $name; } ?>
0
11,386,751
07/08/2012 21:13:21
1,475,322
06/22/2012 15:51:24
22
0
Django - Add rows to MySQL database
So I already have a database setup with a few columns and a few rows already inserted in. I'm trying to create a view that you would just input information into a form and press Submit, then a row would be added to the MySQL database with the information you just typed in. I believe you can do this with admin, but I would like to try without admin and I'm not sure if this is possible? I've been using the MySQL commandline to add rows as of now..
mysql
django
django-views
null
null
null
open
Django - Add rows to MySQL database === So I already have a database setup with a few columns and a few rows already inserted in. I'm trying to create a view that you would just input information into a form and press Submit, then a row would be added to the MySQL database with the information you just typed in. I believe you can do this with admin, but I would like to try without admin and I'm not sure if this is possible? I've been using the MySQL commandline to add rows as of now..
0
11,386,753
07/08/2012 21:13:33
942,534
09/13/2011 12:29:54
819
40
Accessing controls on views of NSCollectionView
I'm using an `NSCollectionView` to display various objects. The whole things works rather well, except for one annoying thing. I cannot figure out how to access the various controls on the view used to represent each object in the collection. Here's the setup: - I have dragged an `NSCollectionView` into my view in IB. - I made a custom subclass of `NSCollectionViewItem`. Mapped my class in IB. - I made a custom subclass of `NSBox` to act as the view for each object in the collection. Also mapped this class in IB and connected it to the `view` property of my `NSCollectionViewItem` subclass. - I made all the bindings in IB to display the correct information for each object. The view: ![enter image description here][1] The resulting collection view: ![enter image description here][2] Reasoning that that my subclass of `NSCollectionViewItem` is basically a controller for each view in the collection, I made referencing outlets of the various controls in the view in my controller subclass: @interface SourceCollectionViewItem : NSCollectionViewItem @property (weak) IBOutlet NSTextField *nameTextField; @property (weak) IBOutlet NSTextField *typeTextField; @property (weak) IBOutlet RSLabelView *labelView; @property (weak) IBOutlet NSButton *viewButton; @end When I inspect any instance of `SourceCollectionViewItem` in the debugger, all the properties show up as nil despite the fact that I can actually see them on my screen and that everything is displayed as it should be. My setup was inspired by Apple's sample app [IconCollection][3]. I am obviously missing something. What? [1]: http://i.stack.imgur.com/7yXDV.png [2]: http://i.stack.imgur.com/SqDOc.png [3]: http://developer.apple.com/library/mac/#samplecode/IconCollection/Introduction/Intro.html
cocoa
nscollectionview
null
null
null
null
open
Accessing controls on views of NSCollectionView === I'm using an `NSCollectionView` to display various objects. The whole things works rather well, except for one annoying thing. I cannot figure out how to access the various controls on the view used to represent each object in the collection. Here's the setup: - I have dragged an `NSCollectionView` into my view in IB. - I made a custom subclass of `NSCollectionViewItem`. Mapped my class in IB. - I made a custom subclass of `NSBox` to act as the view for each object in the collection. Also mapped this class in IB and connected it to the `view` property of my `NSCollectionViewItem` subclass. - I made all the bindings in IB to display the correct information for each object. The view: ![enter image description here][1] The resulting collection view: ![enter image description here][2] Reasoning that that my subclass of `NSCollectionViewItem` is basically a controller for each view in the collection, I made referencing outlets of the various controls in the view in my controller subclass: @interface SourceCollectionViewItem : NSCollectionViewItem @property (weak) IBOutlet NSTextField *nameTextField; @property (weak) IBOutlet NSTextField *typeTextField; @property (weak) IBOutlet RSLabelView *labelView; @property (weak) IBOutlet NSButton *viewButton; @end When I inspect any instance of `SourceCollectionViewItem` in the debugger, all the properties show up as nil despite the fact that I can actually see them on my screen and that everything is displayed as it should be. My setup was inspired by Apple's sample app [IconCollection][3]. I am obviously missing something. What? [1]: http://i.stack.imgur.com/7yXDV.png [2]: http://i.stack.imgur.com/SqDOc.png [3]: http://developer.apple.com/library/mac/#samplecode/IconCollection/Introduction/Intro.html
0
11,386,759
07/08/2012 21:15:05
394,241
07/16/2010 19:22:54
524
8
Core Data: In XCode how can I set my attribute to be unique?
I'm using setting up my Data Model for Core Data and I'm trying to find out how I can set up an attribute to be unique. I want it so that if another object is about the be saved then it wont allow it if this attribute is the same value as another. How can I do this? Thanks!
xcode
core-data
attributes
unique
null
null
open
Core Data: In XCode how can I set my attribute to be unique? === I'm using setting up my Data Model for Core Data and I'm trying to find out how I can set up an attribute to be unique. I want it so that if another object is about the be saved then it wont allow it if this attribute is the same value as another. How can I do this? Thanks!
0
11,386,760
07/08/2012 21:15:19
1,294,303
03/27/2012 00:19:40
1
0
Java Generic Exception
I am dealing with JaudioTagger API to manipulate MP3 files, I have to repeat the following exceptions over and over again... I was thinking of having a generic exception handler where I could forward each exception maybe with a flag number and the generic method would be deal with it by having different switch cases maybe ? Is it possible ? I would really appreciate if someone could give the method signature or a way to call it } catch (CannotReadException ex) { Logger.getLogger(MainPanel.class.getName()).log(Level.SEVERE, null, ex); } catch (ReadOnlyFileException ex) { Logger.getLogger(MainPanel.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { Logger.getLogger(MainPanel.class.getName()).log(Level.SEVERE, null, ex); } catch (InvalidAudioFrameException ex) { Logger.getLogger(MainPanel.class.getName()).log(Level.SEVERE, null, ex); } catch (TagException ex) { Logger.getLogger(MainPanel.class.getName()).log(Level.SEVERE, null, ex); }
generics
exception
null
null
null
null
open
Java Generic Exception === I am dealing with JaudioTagger API to manipulate MP3 files, I have to repeat the following exceptions over and over again... I was thinking of having a generic exception handler where I could forward each exception maybe with a flag number and the generic method would be deal with it by having different switch cases maybe ? Is it possible ? I would really appreciate if someone could give the method signature or a way to call it } catch (CannotReadException ex) { Logger.getLogger(MainPanel.class.getName()).log(Level.SEVERE, null, ex); } catch (ReadOnlyFileException ex) { Logger.getLogger(MainPanel.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { Logger.getLogger(MainPanel.class.getName()).log(Level.SEVERE, null, ex); } catch (InvalidAudioFrameException ex) { Logger.getLogger(MainPanel.class.getName()).log(Level.SEVERE, null, ex); } catch (TagException ex) { Logger.getLogger(MainPanel.class.getName()).log(Level.SEVERE, null, ex); }
0
11,261,744
06/29/2012 12:25:34
912,861
08/25/2011 19:36:38
71
0
column name as argument for printing particular column from dataframe
I'm having a dataframe as like below. I need to extract AveElapsed or Runtime from the dataframe based on the region >avg_data region SN value AveElapsed Runtime beta 1 32 1372 943.668 alpha 2 44 1408 966.495 beta 3 55 1384 951.091 beta 4 60 1390 954.929 atp 5 22 1442 924.381 I need to take "AveElapsed" column or "Runtime" column based on the argument. Below command is working fine. But how I can >avg_data[avg_data$region =="beta", "AveElapsed"] [1] 1372 1408 1384 1390 1442 But when I use function newfun(z, h) { avg_data[avg_data$region == z, h] } When I call this function newfun(beta, AveElapsed) I'm getting error like this.. Please advise. Error in "[.data.frame"(avg_data, avg_data$region == z, h) : object "beta" not found
r
null
null
null
null
null
open
column name as argument for printing particular column from dataframe === I'm having a dataframe as like below. I need to extract AveElapsed or Runtime from the dataframe based on the region >avg_data region SN value AveElapsed Runtime beta 1 32 1372 943.668 alpha 2 44 1408 966.495 beta 3 55 1384 951.091 beta 4 60 1390 954.929 atp 5 22 1442 924.381 I need to take "AveElapsed" column or "Runtime" column based on the argument. Below command is working fine. But how I can >avg_data[avg_data$region =="beta", "AveElapsed"] [1] 1372 1408 1384 1390 1442 But when I use function newfun(z, h) { avg_data[avg_data$region == z, h] } When I call this function newfun(beta, AveElapsed) I'm getting error like this.. Please advise. Error in "[.data.frame"(avg_data, avg_data$region == z, h) : object "beta" not found
0
11,261,864
06/29/2012 12:34:45
468,968
10/07/2010 10:45:37
509
9
Daily DataBase Manintanence using SQL Server2008 using Stored Procedur
i have created DataBase Maintanence Plan using [wizard][1] though that link for SQL Server2005 i have created Maintenance Plan for SQL Server2008 and it works fine. now i required to complete the same task using Stored Procedure for my Desktop application. i have tried [this stored procedure][2] for that but it doesn't works for me. below is the code snippet i have tried. // sp_add_maintenance_plan [ @plan_name = ] 'plan_name' , //@plan_id = 'plan_id' OUTPUT String planid = ""; string maintenancePlan = "MyMaintenance"; string SQLstr = "DECLARE @plan_id as Varchar(50)"; SQLstr += " EXEC sp_add_maintenance_plan "; SQLstr += " @plan_name='" + maintenancePlan + "',"; SQLstr += " @plan_id= @plan_id OUTPUT"; SQLstr += " SELECT @plan_id"; SqlConnection cnn = new SqlConnection(MSDBconnStr); SqlCommand cmd = new SqlCommand(SQLstr, cnn); cnn.Open(); planid = (string)cmd.ExecuteScalar(); cnn.Close(); // sp_add_maintenance_plan_db [ @plan_id = ] 'plan_id' , //[ @db_name = ] 'database_name' string maintenancePlanDataBase = "MyDataBase"; string SQLstr1 = " EXEC sp_add_maintenance_plan_db "; SQLstr1 += " @plan_id='" + planid + "',"; SQLstr1 += " @db_name='" + maintenancePlanDataBase + "'"; SqlConnection cnn1 = new SqlConnection(MSDBconnStr); SqlCommand cmd1 = new SqlCommand(SQLstr1, cnn1); cnn1.Open(); cmd1.ExecuteNonQuery(); cnn1.Close(); [1]: http://cherupally.blogspot.in/2009/04/schedule-daily-backup-for-sql-server_27.html [2]: http://msdn.microsoft.com/en-us/library/ms190341%28v=sql.90%29.aspx
c#
.net
sql-server-2008
maintenance
maintenance-plan
06/30/2012 03:02:20
off topic
Daily DataBase Manintanence using SQL Server2008 using Stored Procedur === i have created DataBase Maintanence Plan using [wizard][1] though that link for SQL Server2005 i have created Maintenance Plan for SQL Server2008 and it works fine. now i required to complete the same task using Stored Procedure for my Desktop application. i have tried [this stored procedure][2] for that but it doesn't works for me. below is the code snippet i have tried. // sp_add_maintenance_plan [ @plan_name = ] 'plan_name' , //@plan_id = 'plan_id' OUTPUT String planid = ""; string maintenancePlan = "MyMaintenance"; string SQLstr = "DECLARE @plan_id as Varchar(50)"; SQLstr += " EXEC sp_add_maintenance_plan "; SQLstr += " @plan_name='" + maintenancePlan + "',"; SQLstr += " @plan_id= @plan_id OUTPUT"; SQLstr += " SELECT @plan_id"; SqlConnection cnn = new SqlConnection(MSDBconnStr); SqlCommand cmd = new SqlCommand(SQLstr, cnn); cnn.Open(); planid = (string)cmd.ExecuteScalar(); cnn.Close(); // sp_add_maintenance_plan_db [ @plan_id = ] 'plan_id' , //[ @db_name = ] 'database_name' string maintenancePlanDataBase = "MyDataBase"; string SQLstr1 = " EXEC sp_add_maintenance_plan_db "; SQLstr1 += " @plan_id='" + planid + "',"; SQLstr1 += " @db_name='" + maintenancePlanDataBase + "'"; SqlConnection cnn1 = new SqlConnection(MSDBconnStr); SqlCommand cmd1 = new SqlCommand(SQLstr1, cnn1); cnn1.Open(); cmd1.ExecuteNonQuery(); cnn1.Close(); [1]: http://cherupally.blogspot.in/2009/04/schedule-daily-backup-for-sql-server_27.html [2]: http://msdn.microsoft.com/en-us/library/ms190341%28v=sql.90%29.aspx
2
11,261,852
06/29/2012 12:33:40
1,419,538
05/26/2012 22:05:15
68
0
Edit my textfile to only show highest value?
I use the following coding which edits my text file based on the value in column being smaller than the value in a textbox. Dim intValue As Integer Dim intMaxValue As Integer = Integer.Parse(textbox1.Text) Dim strSourceFile As String = IO.Path.Combine("G:\test.txt") Dim OutPutFile As String = IO.Path.Combine("G:\test2.txt") Dim strLines() As String = IO.File.ReadAllLines(strSourceFile) Dim strFiltered As New System.Text.StringBuilder Dim strTemp() As String For Each strLine In strLines If strLine.Trim.Length <> 0 Then strTemp = strLine.Split(" "c) If Trim(strTemp(0)) = "USER" AndAlso Trim(strTemp(2)) = "1" Then strLine = strTemp(8).Trim & " " & strTemp(16).Trim If Integer.TryParse(strLine.Split(" "c)(1), intValue) Then If intValue <= intMaxValue Then strFiltered.Append(strLine & Environment.NewLine) End If End If End If End If Next IO.File.WriteAllText(OutPutFile, strFiltered.ToString) Now the above coding works perfectly, the output looks like the following:- String1 100 String1 256 String1 500 String2 100 String2 256 String3 876 String3 345 String3 643 String3 102 String4 100 String4 084 String5 492 String5 178 String6 873 String6 156 String6 786 What I was hoping for was to add additional coding so i only want the String with the highest number showing so the above would look like String1 500 String2 256 String3 876 String4 100 String5 492 String6 873 Would it be possible to add the final bit of coding?
.net
vb.net
vb.net-2010
null
null
null
open
Edit my textfile to only show highest value? === I use the following coding which edits my text file based on the value in column being smaller than the value in a textbox. Dim intValue As Integer Dim intMaxValue As Integer = Integer.Parse(textbox1.Text) Dim strSourceFile As String = IO.Path.Combine("G:\test.txt") Dim OutPutFile As String = IO.Path.Combine("G:\test2.txt") Dim strLines() As String = IO.File.ReadAllLines(strSourceFile) Dim strFiltered As New System.Text.StringBuilder Dim strTemp() As String For Each strLine In strLines If strLine.Trim.Length <> 0 Then strTemp = strLine.Split(" "c) If Trim(strTemp(0)) = "USER" AndAlso Trim(strTemp(2)) = "1" Then strLine = strTemp(8).Trim & " " & strTemp(16).Trim If Integer.TryParse(strLine.Split(" "c)(1), intValue) Then If intValue <= intMaxValue Then strFiltered.Append(strLine & Environment.NewLine) End If End If End If End If Next IO.File.WriteAllText(OutPutFile, strFiltered.ToString) Now the above coding works perfectly, the output looks like the following:- String1 100 String1 256 String1 500 String2 100 String2 256 String3 876 String3 345 String3 643 String3 102 String4 100 String4 084 String5 492 String5 178 String6 873 String6 156 String6 786 What I was hoping for was to add additional coding so i only want the String with the highest number showing so the above would look like String1 500 String2 256 String3 876 String4 100 String5 492 String6 873 Would it be possible to add the final bit of coding?
0
11,261,865
06/29/2012 12:34:49
1,055,295
11/19/2011 12:46:35
459
17
Declaring the main method synchronised
I saw a Java example that had a main method labeled as synchronized, calling another, also synchronized method. The effect is that, basically, the other method only runs on the separate thread only after the main method has returned. What practical functionality would such a construct have? public class SynchronisedMain { public static synchronized void main(String[] args) throws InterruptedException { new Thread(new Runnable() { @Override public void run() { thingy(); } }).start(); System.out.println("Kickstarted thingy thread."); TimeUnit.MILLISECONDS.sleep(1000); } public static synchronized void thingy() { System.out.println("Thingy!"); } }
java
concurrency
null
null
null
null
open
Declaring the main method synchronised === I saw a Java example that had a main method labeled as synchronized, calling another, also synchronized method. The effect is that, basically, the other method only runs on the separate thread only after the main method has returned. What practical functionality would such a construct have? public class SynchronisedMain { public static synchronized void main(String[] args) throws InterruptedException { new Thread(new Runnable() { @Override public void run() { thingy(); } }).start(); System.out.println("Kickstarted thingy thread."); TimeUnit.MILLISECONDS.sleep(1000); } public static synchronized void thingy() { System.out.println("Thingy!"); } }
0
11,261,873
06/29/2012 12:35:11
689,853
04/03/2011 13:57:35
1,106
65
Synchronized block issue?
Hi i have a class with multiple methods in which i require synchronized block in all of the methods like this:- public class Test2 { private Object mutex=new Object(); private OtherClass obj=new OtherClass(); public void method1(){ //do some stuff synchronized (mutex) { obj.//some method //do some stuff } //do other stuff } public void method2(){ //do some stuff synchronized (mutex) { obj.//some method //do some stuff } //do other stuff } public void method3(){ //do some stuff synchronized (mutex) { obj.//some method //do some stuff } //do other stuff } public void method4(){ //do some stuff synchronized (mutex) { obj.//some method //do some stuff } //do other stuff } } as you can see i am using mutex to synchronize the blocks, so what happens if method1 is being used, the other method2 synchronized block waits until the flow comes out of the synchronized block of method1. I dont want this to happen, so what should i do? i know that as i am using mutex for all the methods, so it locks the method2 synchronized block. i want to know what should i do to remove this? should i create member variables for each method to use, or there is another way around this?
java
multithreading
synchronization
null
null
null
open
Synchronized block issue? === Hi i have a class with multiple methods in which i require synchronized block in all of the methods like this:- public class Test2 { private Object mutex=new Object(); private OtherClass obj=new OtherClass(); public void method1(){ //do some stuff synchronized (mutex) { obj.//some method //do some stuff } //do other stuff } public void method2(){ //do some stuff synchronized (mutex) { obj.//some method //do some stuff } //do other stuff } public void method3(){ //do some stuff synchronized (mutex) { obj.//some method //do some stuff } //do other stuff } public void method4(){ //do some stuff synchronized (mutex) { obj.//some method //do some stuff } //do other stuff } } as you can see i am using mutex to synchronize the blocks, so what happens if method1 is being used, the other method2 synchronized block waits until the flow comes out of the synchronized block of method1. I dont want this to happen, so what should i do? i know that as i am using mutex for all the methods, so it locks the method2 synchronized block. i want to know what should i do to remove this? should i create member variables for each method to use, or there is another way around this?
0
11,261,878
06/29/2012 12:35:19
998,465
10/17/2011 03:24:16
8
1
escape special character in progid:DXImageTransform.Microsoft.AlphaImageLoader
I've found very strange action in filter: progid:DXImageTransform.Microsoft.AlphaImageLoader <style> .some{ width: 16px; height: 16px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="C:/Users/usr7/Desktop/(x86)/close.png", sizingMethod='scale'); } </style> <div class='some'> hello </div> If AlphaImageLoader' src has brace character that is ( ) , It don't work at ie8 and ie9. Is there any method to escape brace characters?
css
internet-explorer
null
null
null
null
open
escape special character in progid:DXImageTransform.Microsoft.AlphaImageLoader === I've found very strange action in filter: progid:DXImageTransform.Microsoft.AlphaImageLoader <style> .some{ width: 16px; height: 16px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="C:/Users/usr7/Desktop/(x86)/close.png", sizingMethod='scale'); } </style> <div class='some'> hello </div> If AlphaImageLoader' src has brace character that is ( ) , It don't work at ie8 and ie9. Is there any method to escape brace characters?
0
11,261,880
06/29/2012 12:35:35
578,743
01/17/2011 16:00:55
251
19
Universal Ad-Hoc version does install on ipad, but not on iphone
I have encountered a weird problem, when i built my last ad-hoc version for our customer. The app is a universal app. Deployment Target is ios 4.3. The ad-hoc installs perfectly on the customers ipad, but not on his iphone. I tested it with our iphones and we have the same problem. Ad hoc installs on ipad, but not on iphone. - All devices are listed in the provisioning profile. - The provisioning profile is valid and also are the certificates valid. - Entitlements are deactivated. Has anyone any idea why this could be?
iphone
objective-c
ios
ipad
adhoc
null
open
Universal Ad-Hoc version does install on ipad, but not on iphone === I have encountered a weird problem, when i built my last ad-hoc version for our customer. The app is a universal app. Deployment Target is ios 4.3. The ad-hoc installs perfectly on the customers ipad, but not on his iphone. I tested it with our iphones and we have the same problem. Ad hoc installs on ipad, but not on iphone. - All devices are listed in the provisioning profile. - The provisioning profile is valid and also are the certificates valid. - Entitlements are deactivated. Has anyone any idea why this could be?
0
11,261,883
06/29/2012 12:35:40
1,404,790
05/19/2012 07:40:07
25
0
How to get wordpres post featured image url
I am using a this function to get the featured images <a href="#" rel="prettyPhoto"> <?php the_post_thumbnail('thumbnail'); ?> </a> now i want to get the full featured image on click on anchor tag for which i need a featured image url in <a href="here" rel="prettyPhoto"> please help
php
wordpress
post
null
null
null
open
How to get wordpres post featured image url === I am using a this function to get the featured images <a href="#" rel="prettyPhoto"> <?php the_post_thumbnail('thumbnail'); ?> </a> now i want to get the full featured image on click on anchor tag for which i need a featured image url in <a href="here" rel="prettyPhoto"> please help
0
11,261,884
06/29/2012 12:35:41
1,489,352
06/28/2012 17:32:08
1
0
Change Image.Source in C#
I'd like to change the source of an Image-Object which I have declared in the XAML-Code, during the Runtime. So that I can load a Picture from my local resources into this Image-Object. I hope someone is able to help me. The name of the Image-Object is "imgWappen", the name of te picture is "Bayer_Leverkusen.png". Sorry for my bad English. Creeps
c#
null
null
null
null
06/29/2012 13:27:59
too localized
Change Image.Source in C# === I'd like to change the source of an Image-Object which I have declared in the XAML-Code, during the Runtime. So that I can load a Picture from my local resources into this Image-Object. I hope someone is able to help me. The name of the Image-Object is "imgWappen", the name of te picture is "Bayer_Leverkusen.png". Sorry for my bad English. Creeps
3
11,261,885
06/29/2012 12:35:49
1,394,455
05/14/2012 18:47:10
308
19
Permissions to view Entries in MySQL Database Front-End
I've got a PHP/HTML/Javascript driven front-end for a MySQL database which archives different files/papers for our office (kind of an electronic index for physical paperwork). The users want to be able to have permissions on each of these entries; for instance HR complaints need to be indexed, but should not be viewable by all users of the database. The user heirarchy is two-tier. Each user is a member of one OR MORE distribution lists (similar to an Email list). When a file is indexed, the user choses the permissions for others: for instance he/she can select the following for a sample HR complaint: List | Permission ````````````````````````````````` HR Dept | Read/Write Board Members | Read John Smith | Read/Write Mary Smith | Read and should be invisible to anybody else. Now I've tried several things to implement this, the most recent being a relations table which relates the following: User 1->Many DistributionList // Assoc the user to some lists Permission 1->Many DistributionList //Indicates level of permission that the list has Permission 1->Many User //Indicates level of permission for each user However the permission table contains a row for each file for each permission, which, given a few thousand files and ~50-60 lists/users, means a few hundred thousand entries. Since this index will not be flushed often (maybe flush files older than 50 years) that number could skyrocket. Not to mention that the queries are somewhat complicated, and take a decent amount of time (~1 second for the SQL request) for only a couple hundred files. Is there a more efficient way to create this sort of User based stuff? Is it possible instead to make users in SQL itself with these permissions and let the connection handle these things? **tl;dr: What is the best way to put read/write/invisible permissions on entries in MySQL using PHP, Javascript, HTML and PHPMyAdmin?**
php
mysql
permissions
user
null
null
open
Permissions to view Entries in MySQL Database Front-End === I've got a PHP/HTML/Javascript driven front-end for a MySQL database which archives different files/papers for our office (kind of an electronic index for physical paperwork). The users want to be able to have permissions on each of these entries; for instance HR complaints need to be indexed, but should not be viewable by all users of the database. The user heirarchy is two-tier. Each user is a member of one OR MORE distribution lists (similar to an Email list). When a file is indexed, the user choses the permissions for others: for instance he/she can select the following for a sample HR complaint: List | Permission ````````````````````````````````` HR Dept | Read/Write Board Members | Read John Smith | Read/Write Mary Smith | Read and should be invisible to anybody else. Now I've tried several things to implement this, the most recent being a relations table which relates the following: User 1->Many DistributionList // Assoc the user to some lists Permission 1->Many DistributionList //Indicates level of permission that the list has Permission 1->Many User //Indicates level of permission for each user However the permission table contains a row for each file for each permission, which, given a few thousand files and ~50-60 lists/users, means a few hundred thousand entries. Since this index will not be flushed often (maybe flush files older than 50 years) that number could skyrocket. Not to mention that the queries are somewhat complicated, and take a decent amount of time (~1 second for the SQL request) for only a couple hundred files. Is there a more efficient way to create this sort of User based stuff? Is it possible instead to make users in SQL itself with these permissions and let the connection handle these things? **tl;dr: What is the best way to put read/write/invisible permissions on entries in MySQL using PHP, Javascript, HTML and PHPMyAdmin?**
0
11,571,406
07/20/2012 00:52:22
1,534,898
07/18/2012 13:20:18
3
0
edit multiple contacts thunderbird
I am trying to edit multiple contacts in Thunderbird. Is there any way to edit multiple contacts at once in thunderbird? For example, i want to add the Organisation name for 10 address book entries at once. Cheers.
thunderbird
null
null
null
null
null
open
edit multiple contacts thunderbird === I am trying to edit multiple contacts in Thunderbird. Is there any way to edit multiple contacts at once in thunderbird? For example, i want to add the Organisation name for 10 address book entries at once. Cheers.
0
11,571,440
07/20/2012 00:56:37
823,873
06/30/2011 21:26:55
64
0
How do I get the route scope from the view?
I have something like this set up in my config/routes.rb: scope "/admin" do resources :users end I understand that from /admin/users, params[:controller] would be "users" My question is, is there something like the above that would give me "admin" when in a controller under the "/admin" scope? Thanks in advance!
ruby-on-rails
ruby-on-rails-3
routing
null
null
null
open
How do I get the route scope from the view? === I have something like this set up in my config/routes.rb: scope "/admin" do resources :users end I understand that from /admin/users, params[:controller] would be "users" My question is, is there something like the above that would give me "admin" when in a controller under the "/admin" scope? Thanks in advance!
0
11,571,441
07/20/2012 00:56:41
1,462,604
06/18/2012 02:25:22
1,397
88
Is there a better way to write the following VB6 snippet?
I work at $COMPANY and I'm helping maintain $LEGACY_APPLICATION. It's written in visual basic 6. I was faced with doing an unpleasantly elaborate nested if statement due to the lack of VB6's ability to perform short circuit evaluations in if statements (which would simplify this a lot). I've tried AndAlso, but to no avail. Must be a feature added after VB6. Some genius on SO somewhere pointed out that you can trick a select case statement into working like a short-circuiting if statement if you have the patience, so I tried that, and here's what I came up with: Select Case (True) ' pretend this is an if-else statement Case (item Is Nothing): Exit Sub ' we got a non-element Case ((item Is Not Nothing) And (lastSelected Is Nothing)): Set lastSelected = item ' we got our first good element Case (item = lastSelected): Exit Sub ' we already had what we got Case (Not item = lastSelected): Set lastSelected = item ' we got something new End Select It's definitely a little unusual, and I had to make use of my fantastic whiteboard (which, by the way, is pretty much the most useful programming resource besides a computer) to make sure I had mapped all of the statements correctly. Here's what's going on there: I have an expensive operation which I would like to avoid repeating if possible. lastSelected is a persistent reference to the value most recently passed to this calculation. item is the parameter that was just received from the GUI. If there has never been a call to the program before, lastSelected starts out as Nothing. item can be Nothing too. Additionally, if both lastSelected and item are the same something, skip the calculation. If I were writing this in C++, I would write: if (item == NULL || lastSelected == NULL || item->operator==(*lastSelected)) return; else lastSelected = item; However, I'm not. Question -- How can I rewrite this to look better and make more sense? Upvotes will be awarded to answers that say either "YES and here's why: X, Y, Z" or "NO, and here's why not: X, Y, Z".
vb6
styles
short-circuiting
select-case
null
null
open
Is there a better way to write the following VB6 snippet? === I work at $COMPANY and I'm helping maintain $LEGACY_APPLICATION. It's written in visual basic 6. I was faced with doing an unpleasantly elaborate nested if statement due to the lack of VB6's ability to perform short circuit evaluations in if statements (which would simplify this a lot). I've tried AndAlso, but to no avail. Must be a feature added after VB6. Some genius on SO somewhere pointed out that you can trick a select case statement into working like a short-circuiting if statement if you have the patience, so I tried that, and here's what I came up with: Select Case (True) ' pretend this is an if-else statement Case (item Is Nothing): Exit Sub ' we got a non-element Case ((item Is Not Nothing) And (lastSelected Is Nothing)): Set lastSelected = item ' we got our first good element Case (item = lastSelected): Exit Sub ' we already had what we got Case (Not item = lastSelected): Set lastSelected = item ' we got something new End Select It's definitely a little unusual, and I had to make use of my fantastic whiteboard (which, by the way, is pretty much the most useful programming resource besides a computer) to make sure I had mapped all of the statements correctly. Here's what's going on there: I have an expensive operation which I would like to avoid repeating if possible. lastSelected is a persistent reference to the value most recently passed to this calculation. item is the parameter that was just received from the GUI. If there has never been a call to the program before, lastSelected starts out as Nothing. item can be Nothing too. Additionally, if both lastSelected and item are the same something, skip the calculation. If I were writing this in C++, I would write: if (item == NULL || lastSelected == NULL || item->operator==(*lastSelected)) return; else lastSelected = item; However, I'm not. Question -- How can I rewrite this to look better and make more sense? Upvotes will be awarded to answers that say either "YES and here's why: X, Y, Z" or "NO, and here's why not: X, Y, Z".
0
11,571,442
07/20/2012 00:56:45
1,196,041
02/08/2012 00:45:46
36
1
Mac default screen size command
Ok so I don't know if this is the right place to ask this question, & in fact it's probably not, but you know how when you first get a mac, all of the windows are the exact same size, & centered on the screen? Is there a way to get back to that size with like a terminal command or something?
osx
null
null
null
null
07/22/2012 17:18:50
off topic
Mac default screen size command === Ok so I don't know if this is the right place to ask this question, & in fact it's probably not, but you know how when you first get a mac, all of the windows are the exact same size, & centered on the screen? Is there a way to get back to that size with like a terminal command or something?
2
11,571,443
07/20/2012 00:56:49
1,527,617
07/16/2012 00:10:29
3
0
Unable to run javascript onClick in HTML?
I am trying to send the user input received through a text box and then send that input to a javascript, which is an another file (myfile.js). For some reason the html part is not working. Here is the code: myfile.js: var TRange=null; function findString (str) { if (parseInt(navigator.appVersion)<4) return; var strFound; if (window.find) { // CODE FOR BROWSERS THAT SUPPORT window.find strFound=self.find(str); if (!strFound) { strFound=self.find(str,0,1); while (self.find(str,0,1)) continue; } } else if (navigator.appName.indexOf("Microsoft")!=-1) { // EXPLORER-SPECIFIC CODE if (TRange!=null) { TRange.collapse(false); strFound=TRange.findText(str); if (strFound) TRange.select(); } if (TRange==null || strFound==0) { TRange=self.document.body.createTextRange(); strFound=TRange.findText(str); if (strFound) TRange.select(); } } else if (navigator.appName=="Opera") { alert ("Opera browsers not supported, sorry...") return; } if (!strFound) alert ("String '"+str+"' not found!") return; } search.html <!DOCTYPE html> <HTML> <HEAD> </head> <title>Search</title> <body> <script src="myfile.js" type="text/javascript"></script> <form name="input"> Search for: <input type="text" id ="keytex" name="keytext" onClick='if(document.getElementById("keytex").value!=\'\') findString(document.getElementById("keytex").value); return(false);'> </form> <p> You can search this text. Search the text again</p> </body> </html>
javascript
html
css
null
null
null
open
Unable to run javascript onClick in HTML? === I am trying to send the user input received through a text box and then send that input to a javascript, which is an another file (myfile.js). For some reason the html part is not working. Here is the code: myfile.js: var TRange=null; function findString (str) { if (parseInt(navigator.appVersion)<4) return; var strFound; if (window.find) { // CODE FOR BROWSERS THAT SUPPORT window.find strFound=self.find(str); if (!strFound) { strFound=self.find(str,0,1); while (self.find(str,0,1)) continue; } } else if (navigator.appName.indexOf("Microsoft")!=-1) { // EXPLORER-SPECIFIC CODE if (TRange!=null) { TRange.collapse(false); strFound=TRange.findText(str); if (strFound) TRange.select(); } if (TRange==null || strFound==0) { TRange=self.document.body.createTextRange(); strFound=TRange.findText(str); if (strFound) TRange.select(); } } else if (navigator.appName=="Opera") { alert ("Opera browsers not supported, sorry...") return; } if (!strFound) alert ("String '"+str+"' not found!") return; } search.html <!DOCTYPE html> <HTML> <HEAD> </head> <title>Search</title> <body> <script src="myfile.js" type="text/javascript"></script> <form name="input"> Search for: <input type="text" id ="keytex" name="keytext" onClick='if(document.getElementById("keytex").value!=\'\') findString(document.getElementById("keytex").value); return(false);'> </form> <p> You can search this text. Search the text again</p> </body> </html>
0
11,571,445
07/20/2012 00:56:57
1,539,435
07/20/2012 00:32:24
1
0
Android datepicker dialog
How can I disable the day on a datepicker dialog for android? Meant only the month and year is visible. Currently using android 2.2
android
dialog
datepicker
null
null
null
open
Android datepicker dialog === How can I disable the day on a datepicker dialog for android? Meant only the month and year is visible. Currently using android 2.2
0
11,557,554
07/19/2012 09:12:46
665,562
03/18/2011 05:29:39
120
12
postback url not working live but does in test
I've got a search page which shows a gridview. Items in the gridview are hyperlinks which create url string back to the same page - index.aspx I've got index.asp checking for the presence of query string and deals with it just fine. The problem i've got is when the user wants to enter a new search which is a form-submit. However the post back still includes the previous url query string - so that part of my code handles the request not the search. Looking around I discovered PostBackURL: <asp:Button ID="btn_Search" runat="server" Text="Search" Cssclass="form_btn" OnClick="btn_Search_Click" PostBackUrl="index.aspx" />&nbsp; In testing this did the trick. Form is submitted to index.aspx not to say index.aspx?Var1=1&Var2=2 When I publish to the live site however, this doesn't work. I still get posted back with the url string. The code outputted by asp for both the button and the javascript code are identical. I'm fairly new to asp but i'm puzzled that the behaviour is different when running debug in VS2010 and running live on a webserver.
c#
asp.net
postbackurl
null
null
null
open
postback url not working live but does in test === I've got a search page which shows a gridview. Items in the gridview are hyperlinks which create url string back to the same page - index.aspx I've got index.asp checking for the presence of query string and deals with it just fine. The problem i've got is when the user wants to enter a new search which is a form-submit. However the post back still includes the previous url query string - so that part of my code handles the request not the search. Looking around I discovered PostBackURL: <asp:Button ID="btn_Search" runat="server" Text="Search" Cssclass="form_btn" OnClick="btn_Search_Click" PostBackUrl="index.aspx" />&nbsp; In testing this did the trick. Form is submitted to index.aspx not to say index.aspx?Var1=1&Var2=2 When I publish to the live site however, this doesn't work. I still get posted back with the url string. The code outputted by asp for both the button and the javascript code are identical. I'm fairly new to asp but i'm puzzled that the behaviour is different when running debug in VS2010 and running live on a webserver.
0
11,557,555
07/19/2012 09:12:50
1,143,444
01/11/2012 15:01:49
21
1
delayed_job: how to force processing of failed jobs
I just noticed that all my delayed jobs've been failing the last few days due to a bug in the application. Now the bug is fixed and I want to process the jobs asap, but they are with already too many failed attempts, and the worker pulls them from the database with a huge delay. I've tried by updating the delayed_jobs table and set the number of attempts to a smaller number and the run_at attribute to the current time, but still didn't help. Can you tell me how can I force the worker to execute them ?
ruby-on-rails-3
delayed-job
null
null
null
null
open
delayed_job: how to force processing of failed jobs === I just noticed that all my delayed jobs've been failing the last few days due to a bug in the application. Now the bug is fixed and I want to process the jobs asap, but they are with already too many failed attempts, and the worker pulls them from the database with a huge delay. I've tried by updating the delayed_jobs table and set the number of attempts to a smaller number and the run_at attribute to the current time, but still didn't help. Can you tell me how can I force the worker to execute them ?
0
11,349,248
07/05/2012 17:13:53
1,481,072
06/25/2012 20:52:07
1
0
iText rotate() won't orient the first page
Everything I have read regarding iText says you should be able to set the page size and then create a new page. But for some reason when I try this my first page isn't rotated. But my second is. Any ideas? response.setContentType("application/pdf"); Document document = new Document(); try{ ByteArrayOutputStream buffer = new ByteArrayOutputStream(); PdfWriter.getInstance(document, buffer); document.open(); //Start a new page document.setPageSize(PageSize.LETTER.rotate()); // 11" x 8.5" new Rectangle(792f, 612f) document.newPage(); Paragraph topText = new Paragraph(); topText.add(new Paragraph("This is a title for the first page.", FontFactory.getFont(FontFactory.TIMES_ROMAN, 26, Font.NORMAL))); topText.setAlignment(Element.ALIGN_CENTER); document.add(topText); document.newPage(); Paragraph paragraph = new Paragraph("This is a paragraph", FontFactory.getFont(FontFactory.HELVETICA, 18, Font.BOLDITALIC)); paragraph.setAlignment(Element.ALIGN_CENTER); document.add(paragraph); //add an image for fun Image imghead = Image.getInstance("http://t1.gstatic.com/images?q=tbn:ANd9GcSaIm1Xyqs6Zoqu1z647rar18VbRIogAjuHm48nhtoqu_LTCQtk"); imghead.setAbsolutePosition(70,300); //imghead.scaleAbsolute(125, 200); document.add(imghead); //add a table PdfPTable table = new PdfPTable(3); table.addCell("1"); table.addCell("2"); table.addCell("3"); table.addCell("4"); table.addCell("5"); table.addCell("6"); document.add(table); document.close(); DataOutput dataOutput = new DataOutputStream(response.getOutputStream()); byte[] bytes = buffer.toByteArray(); response.setContentLength(bytes.length); for(int i = 0; i < bytes.length; i++) { dataOutput.writeByte(bytes[i]); } }catch(DocumentException e){ e.printStackTrace(); }
java
itext
null
null
null
null
open
iText rotate() won't orient the first page === Everything I have read regarding iText says you should be able to set the page size and then create a new page. But for some reason when I try this my first page isn't rotated. But my second is. Any ideas? response.setContentType("application/pdf"); Document document = new Document(); try{ ByteArrayOutputStream buffer = new ByteArrayOutputStream(); PdfWriter.getInstance(document, buffer); document.open(); //Start a new page document.setPageSize(PageSize.LETTER.rotate()); // 11" x 8.5" new Rectangle(792f, 612f) document.newPage(); Paragraph topText = new Paragraph(); topText.add(new Paragraph("This is a title for the first page.", FontFactory.getFont(FontFactory.TIMES_ROMAN, 26, Font.NORMAL))); topText.setAlignment(Element.ALIGN_CENTER); document.add(topText); document.newPage(); Paragraph paragraph = new Paragraph("This is a paragraph", FontFactory.getFont(FontFactory.HELVETICA, 18, Font.BOLDITALIC)); paragraph.setAlignment(Element.ALIGN_CENTER); document.add(paragraph); //add an image for fun Image imghead = Image.getInstance("http://t1.gstatic.com/images?q=tbn:ANd9GcSaIm1Xyqs6Zoqu1z647rar18VbRIogAjuHm48nhtoqu_LTCQtk"); imghead.setAbsolutePosition(70,300); //imghead.scaleAbsolute(125, 200); document.add(imghead); //add a table PdfPTable table = new PdfPTable(3); table.addCell("1"); table.addCell("2"); table.addCell("3"); table.addCell("4"); table.addCell("5"); table.addCell("6"); document.add(table); document.close(); DataOutput dataOutput = new DataOutputStream(response.getOutputStream()); byte[] bytes = buffer.toByteArray(); response.setContentLength(bytes.length); for(int i = 0; i < bytes.length; i++) { dataOutput.writeByte(bytes[i]); } }catch(DocumentException e){ e.printStackTrace(); }
0
11,349,258
07/05/2012 17:14:39
1,484,391
06/27/2012 02:40:07
6
0
Opening a local executable jar via Javascript or HTML5
I am trying to open a local executable jar from an html page, so I originally tried using javascript window.open("/Users/guest/desktop/fileName"). This almost works. It opens up the folder where the jar is located and selects the jar, but it does not open up the jar. Then I saw threads on here about how opening the file is not possible because of security problems. I came across this page, which I feel like should have my answer: http://www.html5rocks.com/en/tutorials/file/dndfiles/ But all that page talks about is how to read and write to files, not how to open them. Is opening local files still not possible? If it is, how can I go about it? Here is my HTML code in case it may help. <html> <head> <script type="text/javascript"> function open_win() {window.open("/Desktop/folder/jarFile.jar") } </script> </head> <body> <input type="button" value="Open jar" onclick="open_win()" /> </body> </html>
java
html
applet
load
convert
null
open
Opening a local executable jar via Javascript or HTML5 === I am trying to open a local executable jar from an html page, so I originally tried using javascript window.open("/Users/guest/desktop/fileName"). This almost works. It opens up the folder where the jar is located and selects the jar, but it does not open up the jar. Then I saw threads on here about how opening the file is not possible because of security problems. I came across this page, which I feel like should have my answer: http://www.html5rocks.com/en/tutorials/file/dndfiles/ But all that page talks about is how to read and write to files, not how to open them. Is opening local files still not possible? If it is, how can I go about it? Here is my HTML code in case it may help. <html> <head> <script type="text/javascript"> function open_win() {window.open("/Desktop/folder/jarFile.jar") } </script> </head> <body> <input type="button" value="Open jar" onclick="open_win()" /> </body> </html>
0
11,349,259
07/05/2012 17:14:48
1,125,592
01/02/2012 02:02:59
898
48
registered tasks in django admin for celerybeat
I have several tasks that are not showing up in the admin page. Three tasks sepcifically show up: - celery.chord - celery.chord_unlock - celery.backend_cleanup None of my custom tasks show up, but they do work when calling them as normal tasks (for example, mytask.delay) I am trying to set up cron type jobs for certain tasks in the admin, for now I've uused task (custom) with the full path of the task. However, it seems it should be showing in the admin panel? CELERYBEAT_SCHEDULER = 'djcelery.schedulers.DatabaseScheduler' the above is set in the settings.py While I did manage to get the scheduled tasks to run once on my local machine, they have not been running on the remote machine. Also, in my settings.py I have this code: import djcelery djcelery.setup_loader() just below the `CELERY_IMPORTS` My question is how do I schedule the tasks via the admin panel? Also, why is my admin not picking up my tasks for the admin panel?
django
celery
celerybeat
null
null
null
open
registered tasks in django admin for celerybeat === I have several tasks that are not showing up in the admin page. Three tasks sepcifically show up: - celery.chord - celery.chord_unlock - celery.backend_cleanup None of my custom tasks show up, but they do work when calling them as normal tasks (for example, mytask.delay) I am trying to set up cron type jobs for certain tasks in the admin, for now I've uused task (custom) with the full path of the task. However, it seems it should be showing in the admin panel? CELERYBEAT_SCHEDULER = 'djcelery.schedulers.DatabaseScheduler' the above is set in the settings.py While I did manage to get the scheduled tasks to run once on my local machine, they have not been running on the remote machine. Also, in my settings.py I have this code: import djcelery djcelery.setup_loader() just below the `CELERY_IMPORTS` My question is how do I schedule the tasks via the admin panel? Also, why is my admin not picking up my tasks for the admin panel?
0
11,349,036
07/05/2012 16:58:33
1,070,108
11/28/2011 20:46:14
135
4
Using A C++ Class In Windows Form Leads to System.AccessViolationException
I have written a few C++ classes which employ a variety C++ libraries. I made a Windows Form project, and set it up to use my classes successfully. However, I recently made another C++ class and now I consistently get: `A first chance exception of type 'System.AccessViolationException' occurred in TEST_OCU.exe` which leads to: An unhandled exception of type 'System.TypeInitializationException' occurred in Unknown Module. Additional information: The type initializer for '<Module>' threw an exception. --- Some facts: - Compiling and linking is fine, this seems to be a run-time problem. - The C++ class which causes these violations uses `std::ifstream` to read in a file. If I comment out the `std::ifstream` my Forms project runs successfully. - If I use the C++ class in a simple Win32 project, it compiles and runs just fine with the `std::ifstream`. Could anyone offer any advice? Thank you
.net
winapi
runtime-error
ifstream
null
null
open
Using A C++ Class In Windows Form Leads to System.AccessViolationException === I have written a few C++ classes which employ a variety C++ libraries. I made a Windows Form project, and set it up to use my classes successfully. However, I recently made another C++ class and now I consistently get: `A first chance exception of type 'System.AccessViolationException' occurred in TEST_OCU.exe` which leads to: An unhandled exception of type 'System.TypeInitializationException' occurred in Unknown Module. Additional information: The type initializer for '<Module>' threw an exception. --- Some facts: - Compiling and linking is fine, this seems to be a run-time problem. - The C++ class which causes these violations uses `std::ifstream` to read in a file. If I comment out the `std::ifstream` my Forms project runs successfully. - If I use the C++ class in a simple Win32 project, it compiles and runs just fine with the `std::ifstream`. Could anyone offer any advice? Thank you
0
11,349,261
07/05/2012 17:14:58
1,088,617
12/08/2011 21:34:26
566
0
SSI and PHP on the same server?
Can I have PHP, CGI and SSI scripts on the same server without any problems? Before anyone asks why, it's not out of choice, its out of necessity to fulfill a design requirement.
php
cgi
ssi
null
null
null
open
SSI and PHP on the same server? === Can I have PHP, CGI and SSI scripts on the same server without any problems? Before anyone asks why, it's not out of choice, its out of necessity to fulfill a design requirement.
0
11,349,265
07/05/2012 17:15:27
1,481,274
06/25/2012 23:03:33
13
1
Fetching HTTP request/response headers using cURL PHP
http://www.facebook.com/ajax/pages/fan_status.php POST /ajax/pages/fan_status.php HTTP/1.1 Host: www.facebook.com User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:13.0) Gecko/20100101 Firefox/13.0.1 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip, deflate Connection: keep-alive X-SVN-Rev: 585689 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Referer: http://www.facebook.com/nike Content-Length: 186 Cookie: datr=C1r0TyHBGku1pSThXPx30cWq; fr=0OGzSZS4NOYisGugc.AWUaStiOnEdXJkEtxgIAkxxU9t4; lu=whCs63rvwZR-2jp2PpG1Y8KA; c_user=100002370703111; Pragma: no-cache Cache-Control: no-cache fbpage_id=15087023444&add=true&reload=false&fan_origin=page_timeline&nctr[_mod]=pagelet_timeline_page_actions&__user=100002370703111&__a=1&fb_dtsg=AQBk3GwK&phstamp=1658166107517111975155 HTTP/1.1 200 OK Cache-Control: private, no-cache, no-store, must-revalidate Content-Length: 34 Content-Type: application/x-javascript; charset=utf-8 Expires: Sat, 01 Jan 2000 00:00:00 GMT P3P: CP="Facebook does not have a P3P policy. Learn why here: http://fb.me/p3p" Pragma: no-cache X-Content-Type-Options: nosniff X-Frame-Options: DENY Set-Cookie: _e_3gJk_3=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=.facebook.com; httponly Set-Cookie: wd=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=.facebook.com; httponly X-FB-Debug: 5psyEzpd673c6vgDsaU26TSxwm24y5l9MwsaooVcVhA= X-Cnection: close Date: Thu, 05 Jul 2012 17:07:55 GMT There are the Http Headers i got while i liked page. I want to automate this process using PHP(cURL). How can i fetch "fb_dtsg"
php
curl
null
null
null
null
open
Fetching HTTP request/response headers using cURL PHP === http://www.facebook.com/ajax/pages/fan_status.php POST /ajax/pages/fan_status.php HTTP/1.1 Host: www.facebook.com User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:13.0) Gecko/20100101 Firefox/13.0.1 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip, deflate Connection: keep-alive X-SVN-Rev: 585689 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Referer: http://www.facebook.com/nike Content-Length: 186 Cookie: datr=C1r0TyHBGku1pSThXPx30cWq; fr=0OGzSZS4NOYisGugc.AWUaStiOnEdXJkEtxgIAkxxU9t4; lu=whCs63rvwZR-2jp2PpG1Y8KA; c_user=100002370703111; Pragma: no-cache Cache-Control: no-cache fbpage_id=15087023444&add=true&reload=false&fan_origin=page_timeline&nctr[_mod]=pagelet_timeline_page_actions&__user=100002370703111&__a=1&fb_dtsg=AQBk3GwK&phstamp=1658166107517111975155 HTTP/1.1 200 OK Cache-Control: private, no-cache, no-store, must-revalidate Content-Length: 34 Content-Type: application/x-javascript; charset=utf-8 Expires: Sat, 01 Jan 2000 00:00:00 GMT P3P: CP="Facebook does not have a P3P policy. Learn why here: http://fb.me/p3p" Pragma: no-cache X-Content-Type-Options: nosniff X-Frame-Options: DENY Set-Cookie: _e_3gJk_3=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=.facebook.com; httponly Set-Cookie: wd=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=.facebook.com; httponly X-FB-Debug: 5psyEzpd673c6vgDsaU26TSxwm24y5l9MwsaooVcVhA= X-Cnection: close Date: Thu, 05 Jul 2012 17:07:55 GMT There are the Http Headers i got while i liked page. I want to automate this process using PHP(cURL). How can i fetch "fb_dtsg"
0
11,349,268
07/05/2012 17:15:38
245,719
01/07/2010 16:54:03
419
8
Why would a solr search be limited to 5 characters?
When querying for the term "population" on a field called text: .../solr/select?q=text:(pop*) returns results that contain the word "population". However, if there are more then 5 characters before the asterisks, nothing is returned: .../solr/select?q=text:(popula*) This however works: .../solr/select?q=text:(population) As does this (I have no idea why): .../solr/select?q=text:(popul) Without the asterisks only 5 characters works and full text works. It is not limited to "population", the same seems to apply to other words (I tried "numerator"). Why is there a limit of 5 characters? I have not changed much from the version of solr I down loaded. The field "text" has a type "text_en_splitting". "text_en_splitting" has two analyzers, one of type "index", and one of type "query". I haven't touched either of them. The query analyzer looks like this: <analyzer type="query"> <tokenizer class="solr.WhitespaceTokenizerFactory"/> <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/> <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_en.txt" enablePositionIncrements="true" /> <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/> <filter class="solr.LowerCaseFilterFactory"/> <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/> <filter class="solr.PorterStemFilterFactory"/> </analyzer> The index analyzer looks the same, but is missing the "solr.SynonymFilterFactory" filter.
solr
null
null
null
null
null
open
Why would a solr search be limited to 5 characters? === When querying for the term "population" on a field called text: .../solr/select?q=text:(pop*) returns results that contain the word "population". However, if there are more then 5 characters before the asterisks, nothing is returned: .../solr/select?q=text:(popula*) This however works: .../solr/select?q=text:(population) As does this (I have no idea why): .../solr/select?q=text:(popul) Without the asterisks only 5 characters works and full text works. It is not limited to "population", the same seems to apply to other words (I tried "numerator"). Why is there a limit of 5 characters? I have not changed much from the version of solr I down loaded. The field "text" has a type "text_en_splitting". "text_en_splitting" has two analyzers, one of type "index", and one of type "query". I haven't touched either of them. The query analyzer looks like this: <analyzer type="query"> <tokenizer class="solr.WhitespaceTokenizerFactory"/> <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/> <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_en.txt" enablePositionIncrements="true" /> <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/> <filter class="solr.LowerCaseFilterFactory"/> <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/> <filter class="solr.PorterStemFilterFactory"/> </analyzer> The index analyzer looks the same, but is missing the "solr.SynonymFilterFactory" filter.
0
11,349,270
07/05/2012 17:15:44
369,854
06/17/2010 23:06:09
132
3
test output to command line with rspec
So what I want to do is. run ...ruby sayhello.rb...on the command line...then receive..."Hello from Rspec" I've got that with this.. class Hello def speak puts 'Hello from RSpec' end end hi = Hello.new #brings my object into existence hi.speak Now I want to write a test in rspec to check that the command line output is in fact "Hello from RSpec" and not "I like Unix" NOT WORKING....I currently have this in my sayhello_spec.rb file require_relative 'sayhello.rb' #points to file so I can 'see' it describe "sayhello.rb" do it "should say 'Hello from Rspec' when ran" do STDOUT.should_receive(:puts).with('Hello from RSpec') end end Can someone point me in the right direction please?
ruby
rspec
null
null
null
null
open
test output to command line with rspec === So what I want to do is. run ...ruby sayhello.rb...on the command line...then receive..."Hello from Rspec" I've got that with this.. class Hello def speak puts 'Hello from RSpec' end end hi = Hello.new #brings my object into existence hi.speak Now I want to write a test in rspec to check that the command line output is in fact "Hello from RSpec" and not "I like Unix" NOT WORKING....I currently have this in my sayhello_spec.rb file require_relative 'sayhello.rb' #points to file so I can 'see' it describe "sayhello.rb" do it "should say 'Hello from Rspec' when ran" do STDOUT.should_receive(:puts).with('Hello from RSpec') end end Can someone point me in the right direction please?
0
11,297,873
07/02/2012 16:48:42
937,271
09/09/2011 17:38:05
132
9
how to disable cache for development in django?
In some of my templates I'm using the `{% cache %}` template tag to cache some parts, but for development I don't want anything to be cached. I tried using a settings variable to set cache expiring time to zero for dev in a separate settings file and have it called with a `context_processor`, though it's not working. Does anyone know a way to disable cache for dev environment? Thanks for your help :)
python
django
null
null
null
null
open
how to disable cache for development in django? === In some of my templates I'm using the `{% cache %}` template tag to cache some parts, but for development I don't want anything to be cached. I tried using a settings variable to set cache expiring time to zero for dev in a separate settings file and have it called with a `context_processor`, though it's not working. Does anyone know a way to disable cache for dev environment? Thanks for your help :)
0
11,297,883
07/02/2012 16:49:19
249,396
01/13/2010 00:15:57
205
5
CocoaHTTPServer - how can I serve a file I haven't fully downloaded?
I'm serving a file that I haven't fully downloaded myself. How can I handle this? Is there a way to tell the connection- 'no you haven't reached the end of the file, there's more data coming'.
cocoahttpserver
null
null
null
null
null
open
CocoaHTTPServer - how can I serve a file I haven't fully downloaded? === I'm serving a file that I haven't fully downloaded myself. How can I handle this? Is there a way to tell the connection- 'no you haven't reached the end of the file, there's more data coming'.
0
11,297,889
07/02/2012 16:49:37
746,336
05/10/2011 07:17:43
811
8
JavaFX scene builder: having a root node different from AnchorPane
JavaFX scene builder starts editing an AnchorPane. JavaFX doesn't require the root Node to be an AnchorPane, there are cases in which another class is preferrable. <br/> Is there a way to change the rooot container in JavaFX Scene Builder?
java
javafx
null
null
null
null
open
JavaFX scene builder: having a root node different from AnchorPane === JavaFX scene builder starts editing an AnchorPane. JavaFX doesn't require the root Node to be an AnchorPane, there are cases in which another class is preferrable. <br/> Is there a way to change the rooot container in JavaFX Scene Builder?
0
4,579,331
01/02/2011 16:37:30
452,466
09/20/2010 08:12:26
30
0
Help me with query string parameters (Rails)
I'm creating a newsletter. Each email contains a link for editing your subscription: <%= edit_user_url(@user, :secret => @user.created_at.to_i) %> **:secret => @user.created_at.to_i** prevents users from editing each others profiles. def edit @user = user.find(params[:id]) if params[:secret] == @user.created_at.to_i render 'edit' else redirect_to root_path end end It doesn't work - you're always redirected to root_path. It works if I modify it like this: def edit @user = user.find(params[:id]) if params[:secret] == "1293894219" ... 1293894219 is the "created_at.to_i" for a particular user. Do you have any ideas why?
ruby-on-rails
query-string
null
null
null
null
open
Help me with query string parameters (Rails) === I'm creating a newsletter. Each email contains a link for editing your subscription: <%= edit_user_url(@user, :secret => @user.created_at.to_i) %> **:secret => @user.created_at.to_i** prevents users from editing each others profiles. def edit @user = user.find(params[:id]) if params[:secret] == @user.created_at.to_i render 'edit' else redirect_to root_path end end It doesn't work - you're always redirected to root_path. It works if I modify it like this: def edit @user = user.find(params[:id]) if params[:secret] == "1293894219" ... 1293894219 is the "created_at.to_i" for a particular user. Do you have any ideas why?
0
11,268,962
06/29/2012 21:06:56
581,994
01/19/2011 19:31:47
9,566
742
Can't manage to set ClientDataFormat in Apple Extended Audio File Services
AudioStreamBasicDescription clientFormat; clientFormat.mSampleRate = originalFs; clientFormat.mFormatID = kAudioFormatLinearPCM; clientFormat.mFormatFlags = kAudioFormatFlagIsPacked; clientFormat.mBytesPerPacket = channels * sizeof(short); clientFormat.mFramesPerPacket = 1; clientFormat.mBytesPerFrame = channels * sizeof(short); clientFormat.mChannelsPerFrame = channels; clientFormat.mBitsPerChannel = 16; error = ExtAudioFileSetProperty(audioFile, kExtAudioFileProperty_ClientDataFormat, sizeof(clientFormat), &clientFormat); `channels` is 2. Produces an error code of "fmt?". Mucking about with the format flags will produce "!dat" in some cases, but I can't get the error to go away entirely. Any ideas? Running on MacBook Pro, base SDK OS X 10.6.
osx
audio
null
null
null
null
open
Can't manage to set ClientDataFormat in Apple Extended Audio File Services === AudioStreamBasicDescription clientFormat; clientFormat.mSampleRate = originalFs; clientFormat.mFormatID = kAudioFormatLinearPCM; clientFormat.mFormatFlags = kAudioFormatFlagIsPacked; clientFormat.mBytesPerPacket = channels * sizeof(short); clientFormat.mFramesPerPacket = 1; clientFormat.mBytesPerFrame = channels * sizeof(short); clientFormat.mChannelsPerFrame = channels; clientFormat.mBitsPerChannel = 16; error = ExtAudioFileSetProperty(audioFile, kExtAudioFileProperty_ClientDataFormat, sizeof(clientFormat), &clientFormat); `channels` is 2. Produces an error code of "fmt?". Mucking about with the format flags will produce "!dat" in some cases, but I can't get the error to go away entirely. Any ideas? Running on MacBook Pro, base SDK OS X 10.6.
0
11,268,963
06/29/2012 21:06:58
1,003,448
10/19/2011 15:11:05
33
4
Informix group by hour
How one does use the group by clause with hour in Informix? The group by section here gives an error: SELECT cqdr.targetid, cqdr.profileid, ccdr.startdatetime::DATETIME HOUR TO HOUR AS CallHour, Count(cqdr.sessionid), (Sum(cqdr.queuetime) / Count(cqdr.sessionid)), Max(cqdr.queuetime) FROM Contactqueuedetail cqdr, Contactcalldetail ccdr, Selected_csqs sc WHERE cqdr.sessionid = ccdr.sessionid AND cqdr.sessionseqnum = ccdr.sessionseqnum AND cqdr.profileid = ccdr.profileid AND cqdr.nodeid = ccdr.nodeid AND ccdr.startdatetime BETWEEN DATE('12/6/27') AND DATE('12/6/28') AND --cqdr.targettype = l_typecsq AND cqdr.targetid = sc.csqrecordid AND cqdr.profileid = sc.profileid GROUP BY ccdr.startdatetime::DATETIME HOUR TO HOUR, cqdr.targetid, cqdr.profileid;
datetime
informix
hour
null
null
null
open
Informix group by hour === How one does use the group by clause with hour in Informix? The group by section here gives an error: SELECT cqdr.targetid, cqdr.profileid, ccdr.startdatetime::DATETIME HOUR TO HOUR AS CallHour, Count(cqdr.sessionid), (Sum(cqdr.queuetime) / Count(cqdr.sessionid)), Max(cqdr.queuetime) FROM Contactqueuedetail cqdr, Contactcalldetail ccdr, Selected_csqs sc WHERE cqdr.sessionid = ccdr.sessionid AND cqdr.sessionseqnum = ccdr.sessionseqnum AND cqdr.profileid = ccdr.profileid AND cqdr.nodeid = ccdr.nodeid AND ccdr.startdatetime BETWEEN DATE('12/6/27') AND DATE('12/6/28') AND --cqdr.targettype = l_typecsq AND cqdr.targetid = sc.csqrecordid AND cqdr.profileid = sc.profileid GROUP BY ccdr.startdatetime::DATETIME HOUR TO HOUR, cqdr.targetid, cqdr.profileid;
0
11,226,175
06/27/2012 12:26:36
1,485,591
06/27/2012 12:14:49
1
0
how to display markers in my google map API at all times along with mysql database data
I want to create an application using Gooogle MAP API v3 along with MYSQL.I am able to fetch data from my databases table and display in Map.But I want to display some FIXED markers which will display at all times on the map. Now when user will input data he will able to view the Mysql fetched data along side these FIXED Datas(markers)..Please view the image for better understanding of the problem...
mysql
null
null
null
null
null
open
how to display markers in my google map API at all times along with mysql database data === I want to create an application using Gooogle MAP API v3 along with MYSQL.I am able to fetch data from my databases table and display in Map.But I want to display some FIXED markers which will display at all times on the map. Now when user will input data he will able to view the Mysql fetched data along side these FIXED Datas(markers)..Please view the image for better understanding of the problem...
0
11,199,932
06/26/2012 02:13:35
1,481,483
06/26/2012 02:08:13
1
0
How do I back up a remote SQL Server database when it's not listed in SSMS's "Databases" section
I have a remote database on a shared host, and I can connect to it through SSMS if I specify the db name in advanced options. If I try to expand the "Databases" section of the object explorer, it times out and won't list the available databases. I need to back it up locally, so scripting it seems to be the only way. However, you need to right-click the db name to do that, which isn't possible. Is there a SQL script that I can run to export a db's structure and data?
sql
sql-server
database-backups
null
null
null
open
How do I back up a remote SQL Server database when it's not listed in SSMS's "Databases" section === I have a remote database on a shared host, and I can connect to it through SSMS if I specify the db name in advanced options. If I try to expand the "Databases" section of the object explorer, it times out and won't list the available databases. I need to back it up locally, so scripting it seems to be the only way. However, you need to right-click the db name to do that, which isn't possible. Is there a SQL script that I can run to export a db's structure and data?
0
11,226,252
06/27/2012 12:30:45
667,301
03/19/2011 12:38:39
8,205
241
python -c and `while`
Is there a way to loop in `while` if you start the script with `python -c`? This doesn't seem to be related to platform or python version... **Linux** [mpenning@Hotcoffee ~]$ python -c "import os;while (True): os.system('ls')" File "<string>", line 1 import os;while (True): os.system('ls') ^ SyntaxError: invalid syntax [mpenning@Hotcoffee ~]$ [mpenning@Hotcoffee ~]$ python -V Python 2.6.6 [mpenning@Hotcoffee ~]$ uname -a Linux Hotcoffee 2.6.32-5-amd64 #1 SMP Sun May 6 04:00:17 UTC 2012 x86_64 GNU/Linux [mpenning@Hotcoffee ~]$ **Windows** C:\Users\mike_pennington>python -c "import os;while True: os.system('dir')" File "<string>", line 1 import os;while True: os.system('dir') ^ SyntaxError: invalid syntax C:\Users\mike_pennington>python -V Python 2.7.2 C:\Users\mike_pennington> I have tried removing parenthesis in the `while` statement, but nothing seems to make this run.
python
windows
linux
command-line
null
null
open
python -c and `while` === Is there a way to loop in `while` if you start the script with `python -c`? This doesn't seem to be related to platform or python version... **Linux** [mpenning@Hotcoffee ~]$ python -c "import os;while (True): os.system('ls')" File "<string>", line 1 import os;while (True): os.system('ls') ^ SyntaxError: invalid syntax [mpenning@Hotcoffee ~]$ [mpenning@Hotcoffee ~]$ python -V Python 2.6.6 [mpenning@Hotcoffee ~]$ uname -a Linux Hotcoffee 2.6.32-5-amd64 #1 SMP Sun May 6 04:00:17 UTC 2012 x86_64 GNU/Linux [mpenning@Hotcoffee ~]$ **Windows** C:\Users\mike_pennington>python -c "import os;while True: os.system('dir')" File "<string>", line 1 import os;while True: os.system('dir') ^ SyntaxError: invalid syntax C:\Users\mike_pennington>python -V Python 2.7.2 C:\Users\mike_pennington> I have tried removing parenthesis in the `while` statement, but nothing seems to make this run.
0
11,220,353
06/27/2012 06:09:52
1,221,162
02/20/2012 13:29:48
1
0
How to put imageview in scrollview?
I am stuck in very strange problem. I'll try my level best to explain it. I have one image which i received from the web and set it in image view and below that image i have set a listview which displays the comments related to the image. Now i know that listview is itself scrollable.but what i want to do is: when i scroll the screen only listview is scroll not image . I want to scroll both the things together. How to achieve this.. any help will be appreciated .. Thnx in advance...
listview
imageview
scrollview
null
null
null
open
How to put imageview in scrollview? === I am stuck in very strange problem. I'll try my level best to explain it. I have one image which i received from the web and set it in image view and below that image i have set a listview which displays the comments related to the image. Now i know that listview is itself scrollable.but what i want to do is: when i scroll the screen only listview is scroll not image . I want to scroll both the things together. How to achieve this.. any help will be appreciated .. Thnx in advance...
0
11,226,254
06/27/2012 12:30:48
1,376,906
05/05/2012 14:20:09
28
2
How to find image on whole screen?
Is it possible to click on an image, that is not located in a specific container element? When I do have a container, I use something like this: MyRepo.AnyForm.AnyElement.Click(new Location(Imaging.Load(anyPicture.bmp))); and that works very well. But now, I want to click on a menu item inside some context menu that Ranorex is not able to identify. So I want to let Ranorex easily search the whole screen for the target image. Something like this: AnyElementThatRepresentsTheWholeScreen.Click(new Location(Imaging.Load(anyPicture.bmp))) Thanks and regards, fachexot
c#
image
ui-automation
ranorex
null
null
open
How to find image on whole screen? === Is it possible to click on an image, that is not located in a specific container element? When I do have a container, I use something like this: MyRepo.AnyForm.AnyElement.Click(new Location(Imaging.Load(anyPicture.bmp))); and that works very well. But now, I want to click on a menu item inside some context menu that Ranorex is not able to identify. So I want to let Ranorex easily search the whole screen for the target image. Something like this: AnyElementThatRepresentsTheWholeScreen.Click(new Location(Imaging.Load(anyPicture.bmp))) Thanks and regards, fachexot
0
11,226,257
06/27/2012 12:30:59
1,417,177
05/25/2012 10:34:22
7
0
WHY ItemizeOverlay produce ArrayOutOfBoundException?
I am showing POI's List on google map as:- 1- User Zoom-In or Zoom-Out a webservice call which responce xml of properties in perticular location. 2- After getting property we have to filter those properties which have same lat,long and show those number on bubbles on map(say 3 list have same lat ,long put that list into a arrayList and show on bubbles 3). 3- but when I seldom not always I am zooming map following Exception is occure:- 06-27 15:10:57.269: E/AndroidRuntime(4968): FATAL EXCEPTION: main 06-27 15:10:57.269: E/AndroidRuntime(4968): java.lang.ArrayIndexOutOfBoundsException: index=0 length=0 06-27 15:10:57.269: E/AndroidRuntime(4968): at com.google.android.maps.ItemizedOverlay.getIndexToDraw(ItemizedOverlay.java:211) 06-27 15:10:57.269: E/AndroidRuntime(4968): at com.google.android.maps.ItemizedOverlay.draw(ItemizedOverlay.java:240) 06-27 15:10:57.269: E/AndroidRuntime(4968): at com.google.android.maps.Overlay.draw(Overlay.java:179) 06-27 15:10:57.269: E/AndroidRuntime(4968): at com.google.android.maps.OverlayBundle.draw(OverlayBundle.java:42) 06-27 15:10:57.269: E/AndroidRuntime(4968): at com.google.android.maps.MapView.onDraw(MapView.java:530) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.view.View.draw(View.java:9304) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.view.ViewGroup.drawChild(ViewGroup.java:2586) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2189) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.view.ViewGroup.drawChild(ViewGroup.java:2584) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2189) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.view.ViewGroup.drawChild(ViewGroup.java:2584) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2189) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.view.ViewGroup.drawChild(ViewGroup.java:2584) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2189) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.view.ViewGroup.drawChild(ViewGroup.java:2584) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2189) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.view.ViewGroup.drawChild(ViewGroup.java:2584) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2189) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.view.View.draw(View.java:9307) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.widget.FrameLayout.draw(FrameLayout.java:419) 06-27 15:10:57.269: E/AndroidRuntime(4968): at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2076) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.view.ViewRoot.draw(ViewRoot.java:1706) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.view.ViewRoot.performTraversals(ViewRoot.java:1420) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.view.ViewRoot.handleMessage(ViewRoot.java:2066) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.os.Handler.dispatchMessage(Handler.java:99) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.os.Looper.loop(Looper.java:132) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.app.ActivityThread.main(ActivityThread.java:4126) 06-27 15:10:57.269: E/AndroidRuntime(4968): at java.lang.reflect.Method.invokeNative(Native Method) 06-27 15:10:57.269: E/AndroidRuntime(4968): at java.lang.reflect.Method.invoke(Method.java:491) 06-27 15:10:57.269: E/AndroidRuntime(4968): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844) 06-27 15:10:57.269: E/AndroidRuntime(4968): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602) 06-27 15:10:57.269: E/AndroidRuntime(4968): at dalvik.system.NativeStart.main(Native Method) And I am using This code:- private class GoogleMapViewOverlay extends ItemizedOverlay { ImageButton bluebutton,savebutton,closebutton; ImageThreadLoader imageloader; //final MapController mc; TextView text1,text2,text3,text4,textup; ImageView imageview; private List<OverlayItem> items; private Activity activity; // ArrayList<Applicationdataset> arrayList1 ; String str_amen = ""; String str_transport = ""; String str_school = ""; private PopupPanel panel = new PopupPanel(R.layout.mappopup); private Drawable marker; private Context mContext; public GoogleMapViewOverlay(Drawable drawable, MapView mapView, Activity activity2) { //super(drawable); super(boundCenterBottom(drawable)); setLastFocusedIndex(-1); populate(); // arrayList1 = new ArrayList<Applicationdataset>() ; items = new ArrayList<OverlayItem>(); marker = drawable; mContext = mapView.getContext(); mc = mapView.getController(); this.activity = activity2; DB = new DatabaseHelper(activity2); } public void removeAll() { items.clear(); setLastFocusedIndex(-1); populate(); } @Override protected OverlayItem createItem(int index) { Projection getcoords; GeoPoint point = null; int size =0; String latvalue=""; String lonvalue=""; Point pcon = new Point(0,0); getcoords = mapView.getProjection(); if(myvectorlist!=null && myvectorlist.size()!=0) { size = myvectorlist.get(index).size(); latvalue = myvectorlist.get(index).get(0).getLatitude().toString(); lonvalue = myvectorlist.get(index).get(0).getLongitude().toString(); } try { point = new GeoPoint((int)(Double.parseDouble(latvalue)*1E6),(int)(Double.parseDouble(lonvalue)*1E6)); } catch (NumberFormatException e) { e.printStackTrace(); } if(getcoords!=null && point!=null &&pcon!=null) { getcoords.toPixels(point, pcon); } OverlayItem oi = new OverlayItem(point, "", ""); if(size == 1) { boundCenterBottom(drawable); oi.setMarker(drawable); } else { Drawable d= writeOnDrawable(drawable1,size); boundCenterBottom(d);//drawable1 oi.setMarker(d);//drawable1 } return oi; } myvectorlist in code is contais list of arraylist that arralist contains properties which have same lat,long.. Please Anyone suggest me..
android
google-maps
null
null
null
null
open
WHY ItemizeOverlay produce ArrayOutOfBoundException? === I am showing POI's List on google map as:- 1- User Zoom-In or Zoom-Out a webservice call which responce xml of properties in perticular location. 2- After getting property we have to filter those properties which have same lat,long and show those number on bubbles on map(say 3 list have same lat ,long put that list into a arrayList and show on bubbles 3). 3- but when I seldom not always I am zooming map following Exception is occure:- 06-27 15:10:57.269: E/AndroidRuntime(4968): FATAL EXCEPTION: main 06-27 15:10:57.269: E/AndroidRuntime(4968): java.lang.ArrayIndexOutOfBoundsException: index=0 length=0 06-27 15:10:57.269: E/AndroidRuntime(4968): at com.google.android.maps.ItemizedOverlay.getIndexToDraw(ItemizedOverlay.java:211) 06-27 15:10:57.269: E/AndroidRuntime(4968): at com.google.android.maps.ItemizedOverlay.draw(ItemizedOverlay.java:240) 06-27 15:10:57.269: E/AndroidRuntime(4968): at com.google.android.maps.Overlay.draw(Overlay.java:179) 06-27 15:10:57.269: E/AndroidRuntime(4968): at com.google.android.maps.OverlayBundle.draw(OverlayBundle.java:42) 06-27 15:10:57.269: E/AndroidRuntime(4968): at com.google.android.maps.MapView.onDraw(MapView.java:530) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.view.View.draw(View.java:9304) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.view.ViewGroup.drawChild(ViewGroup.java:2586) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2189) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.view.ViewGroup.drawChild(ViewGroup.java:2584) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2189) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.view.ViewGroup.drawChild(ViewGroup.java:2584) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2189) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.view.ViewGroup.drawChild(ViewGroup.java:2584) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2189) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.view.ViewGroup.drawChild(ViewGroup.java:2584) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2189) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.view.ViewGroup.drawChild(ViewGroup.java:2584) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2189) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.view.View.draw(View.java:9307) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.widget.FrameLayout.draw(FrameLayout.java:419) 06-27 15:10:57.269: E/AndroidRuntime(4968): at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2076) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.view.ViewRoot.draw(ViewRoot.java:1706) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.view.ViewRoot.performTraversals(ViewRoot.java:1420) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.view.ViewRoot.handleMessage(ViewRoot.java:2066) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.os.Handler.dispatchMessage(Handler.java:99) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.os.Looper.loop(Looper.java:132) 06-27 15:10:57.269: E/AndroidRuntime(4968): at android.app.ActivityThread.main(ActivityThread.java:4126) 06-27 15:10:57.269: E/AndroidRuntime(4968): at java.lang.reflect.Method.invokeNative(Native Method) 06-27 15:10:57.269: E/AndroidRuntime(4968): at java.lang.reflect.Method.invoke(Method.java:491) 06-27 15:10:57.269: E/AndroidRuntime(4968): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844) 06-27 15:10:57.269: E/AndroidRuntime(4968): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602) 06-27 15:10:57.269: E/AndroidRuntime(4968): at dalvik.system.NativeStart.main(Native Method) And I am using This code:- private class GoogleMapViewOverlay extends ItemizedOverlay { ImageButton bluebutton,savebutton,closebutton; ImageThreadLoader imageloader; //final MapController mc; TextView text1,text2,text3,text4,textup; ImageView imageview; private List<OverlayItem> items; private Activity activity; // ArrayList<Applicationdataset> arrayList1 ; String str_amen = ""; String str_transport = ""; String str_school = ""; private PopupPanel panel = new PopupPanel(R.layout.mappopup); private Drawable marker; private Context mContext; public GoogleMapViewOverlay(Drawable drawable, MapView mapView, Activity activity2) { //super(drawable); super(boundCenterBottom(drawable)); setLastFocusedIndex(-1); populate(); // arrayList1 = new ArrayList<Applicationdataset>() ; items = new ArrayList<OverlayItem>(); marker = drawable; mContext = mapView.getContext(); mc = mapView.getController(); this.activity = activity2; DB = new DatabaseHelper(activity2); } public void removeAll() { items.clear(); setLastFocusedIndex(-1); populate(); } @Override protected OverlayItem createItem(int index) { Projection getcoords; GeoPoint point = null; int size =0; String latvalue=""; String lonvalue=""; Point pcon = new Point(0,0); getcoords = mapView.getProjection(); if(myvectorlist!=null && myvectorlist.size()!=0) { size = myvectorlist.get(index).size(); latvalue = myvectorlist.get(index).get(0).getLatitude().toString(); lonvalue = myvectorlist.get(index).get(0).getLongitude().toString(); } try { point = new GeoPoint((int)(Double.parseDouble(latvalue)*1E6),(int)(Double.parseDouble(lonvalue)*1E6)); } catch (NumberFormatException e) { e.printStackTrace(); } if(getcoords!=null && point!=null &&pcon!=null) { getcoords.toPixels(point, pcon); } OverlayItem oi = new OverlayItem(point, "", ""); if(size == 1) { boundCenterBottom(drawable); oi.setMarker(drawable); } else { Drawable d= writeOnDrawable(drawable1,size); boundCenterBottom(d);//drawable1 oi.setMarker(d);//drawable1 } return oi; } myvectorlist in code is contais list of arraylist that arralist contains properties which have same lat,long.. Please Anyone suggest me..
0
11,226,258
06/27/2012 12:31:00
681,022
03/28/2011 21:59:52
110
3
How to make searchable "text/contents" on wiki page?
I have created a page on Wiki and I want to make the contents of this page searchable via wiki search option. i.e. title/heading of page is "ABCDEFG". If someone search "ABCD" in wiki search then this page should appear in search list. May be its possible through adding <Meta> tags into wiki page, but I don't know how to add meta tags in wiki. Or someone know some other way? Thanks in advance.
search
search-engine
wiki
meta-tags
wikipedia
null
open
How to make searchable "text/contents" on wiki page? === I have created a page on Wiki and I want to make the contents of this page searchable via wiki search option. i.e. title/heading of page is "ABCDEFG". If someone search "ABCD" in wiki search then this page should appear in search list. May be its possible through adding <Meta> tags into wiki page, but I don't know how to add meta tags in wiki. Or someone know some other way? Thanks in advance.
0
11,226,260
06/27/2012 12:31:10
603,633
02/04/2011 18:45:12
1,393
81
joda time api behaves differently for two different set of dates
The two different code snippets(with minor change) show some error in calculations by joda time api: **First one: Gives correct result** DateTime date1 = new DateTime(2010,1,5, 0, 0, 0, 0); DateTime date2 = new DateTime(2012,6,11, 0, 0, 0, 0); Period age =new Period(date1,date2); System.out.println(age.getYears()+" years "+age.getMonths()+" months "+age.getDays()+" days"); **Gives result :** `2 years 5 months 6 days` **Second one: Gives incorrect result** > **Change in snippet**: DateTime date2 = new DateTime(2012,6,**12**, 0, 0, 0, 0); DateTime date1 = new DateTime(2010,1,5, 0, 0, 0, 0); DateTime date2 = new DateTime(2012,6,12, 0, 0, 0, 0); Period age =new Period(date1,date2); System.out.println(age.getYears()+" years "+age.getMonths()+" months "+age.getDays()+" days"); **Gives result :** `2 years 5 months 0 days` Is this an error of calculation or am I missing some configuration?
java
jodatime
null
null
null
null
open
joda time api behaves differently for two different set of dates === The two different code snippets(with minor change) show some error in calculations by joda time api: **First one: Gives correct result** DateTime date1 = new DateTime(2010,1,5, 0, 0, 0, 0); DateTime date2 = new DateTime(2012,6,11, 0, 0, 0, 0); Period age =new Period(date1,date2); System.out.println(age.getYears()+" years "+age.getMonths()+" months "+age.getDays()+" days"); **Gives result :** `2 years 5 months 6 days` **Second one: Gives incorrect result** > **Change in snippet**: DateTime date2 = new DateTime(2012,6,**12**, 0, 0, 0, 0); DateTime date1 = new DateTime(2010,1,5, 0, 0, 0, 0); DateTime date2 = new DateTime(2012,6,12, 0, 0, 0, 0); Period age =new Period(date1,date2); System.out.println(age.getYears()+" years "+age.getMonths()+" months "+age.getDays()+" days"); **Gives result :** `2 years 5 months 0 days` Is this an error of calculation or am I missing some configuration?
0
11,627,708
07/24/2012 09:16:02
1,429,247
05/31/2012 19:09:52
1
0
Contact form + redirect doesnt work
I made a simple "name and email" contact form and I would want it to redirect to "page2.html" after the information has been submitted. I cant get it to work. This is the html part I made for the submission form. Im still not sure what does "name" part stand for, the id part (with the dash) refers to CSS styling. But anyhow, this is how I made the contact "name and email" form. <form method="post" action="submission.php" name="contactform" id="contact-form"> <fieldset> <label for=name accesskey=U><span class="required">*</span> Name</label> <input name="name" type="text" id="name" size="30" value="" /> <br /> <label for=email accesskey=E><span class="required">*</span> Email</label> <input name="email" type="text" id="email" size="30" value="" /> <br /> <input type="submit" class="submit" id="submit-button" value="Submit" /> </fieldset> </form> and php part is recycled, i tried entering header with redirect in the last line but it doesnt work, the best it does is opens up a blank page in the browser that prints out the info I entered in the form. I would like to have the form redirect after the info has been submitted, so...thanks for help, in advance :D <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript" src="jquery-1.3.2.min.js"></script> <script src="http://www.google.com/jsapi"></script> <script type="text/javascript">google.load("jqueryui", "1.5.2");</script> <? if($_POST['name']!="" ){ $headers = "From: Webmaster"; $message = strtoupper($_POST['name'])." ".strtoupper($_POST['email'])." "; echo str_replace("\n","<br />", $message); $headers2 = "From: Sender Name <[email protected]>\nContent-Type: text/plain; charset=UTF-8; format=flowed\nMIME-Version: 1.0\nContent-Transfer-Encoding: 8bit\nX-Mailer: PHP\n"; $message2 = "Message "; mail("[email protected]", "Subject", $message, $headers); mail("$_POST[email]", "Subject", $message2, $headers2); $myFile = "submissions.txt"; $fh = fopen($myFile, 'a') or die("can't open file"); $stringData = "$_POST[name]*$_POST[email]*".$_SERVER['REMOTE_ADDR']."*".date("d-m-Y H:i")." "; fwrite($fh, $stringData); fclose($fh); } else { echo "You didnt enter anything"; ?> <script language="javascript"> alert("You didnt enter anything"); </script> <? } ?>
php
forms
redirect
submit
null
null
open
Contact form + redirect doesnt work === I made a simple "name and email" contact form and I would want it to redirect to "page2.html" after the information has been submitted. I cant get it to work. This is the html part I made for the submission form. Im still not sure what does "name" part stand for, the id part (with the dash) refers to CSS styling. But anyhow, this is how I made the contact "name and email" form. <form method="post" action="submission.php" name="contactform" id="contact-form"> <fieldset> <label for=name accesskey=U><span class="required">*</span> Name</label> <input name="name" type="text" id="name" size="30" value="" /> <br /> <label for=email accesskey=E><span class="required">*</span> Email</label> <input name="email" type="text" id="email" size="30" value="" /> <br /> <input type="submit" class="submit" id="submit-button" value="Submit" /> </fieldset> </form> and php part is recycled, i tried entering header with redirect in the last line but it doesnt work, the best it does is opens up a blank page in the browser that prints out the info I entered in the form. I would like to have the form redirect after the info has been submitted, so...thanks for help, in advance :D <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript" src="jquery-1.3.2.min.js"></script> <script src="http://www.google.com/jsapi"></script> <script type="text/javascript">google.load("jqueryui", "1.5.2");</script> <? if($_POST['name']!="" ){ $headers = "From: Webmaster"; $message = strtoupper($_POST['name'])." ".strtoupper($_POST['email'])." "; echo str_replace("\n","<br />", $message); $headers2 = "From: Sender Name <[email protected]>\nContent-Type: text/plain; charset=UTF-8; format=flowed\nMIME-Version: 1.0\nContent-Transfer-Encoding: 8bit\nX-Mailer: PHP\n"; $message2 = "Message "; mail("[email protected]", "Subject", $message, $headers); mail("$_POST[email]", "Subject", $message2, $headers2); $myFile = "submissions.txt"; $fh = fopen($myFile, 'a') or die("can't open file"); $stringData = "$_POST[name]*$_POST[email]*".$_SERVER['REMOTE_ADDR']."*".date("d-m-Y H:i")." "; fwrite($fh, $stringData); fclose($fh); } else { echo "You didnt enter anything"; ?> <script language="javascript"> alert("You didnt enter anything"); </script> <? } ?>
0
11,627,714
07/24/2012 09:16:27
1,502,703
07/05/2012 01:00:33
8
0
text_changed event not working
private void txtName_TextChanged(object sender, EventArgs e) { if (dataGridView1.SelectedRows.Count == 1) { dataGridView1.SelectedRows[0].Cells["someValue"].Value = txtName.Text; } } When the text is changed in the text box it should be displayed in the datagrid view,if i select cell already having data then it works fine but if i select a new row(empty row) the text does not appear in the datagridview allow user to add row is set to true for the datagrid view.
c#
null
null
null
null
null
open
text_changed event not working === private void txtName_TextChanged(object sender, EventArgs e) { if (dataGridView1.SelectedRows.Count == 1) { dataGridView1.SelectedRows[0].Cells["someValue"].Value = txtName.Text; } } When the text is changed in the text box it should be displayed in the datagrid view,if i select cell already having data then it works fine but if i select a new row(empty row) the text does not appear in the datagridview allow user to add row is set to true for the datagrid view.
0
11,627,725
07/24/2012 09:16:59
1,531,195
07/17/2012 08:48:58
25
0
Navigating around application
In my application I have an interesting UI: there is a header on the top of the activity, the footer at its bottom and the content between them. What I need to do is to change the content field to display different views and information, and to make different transitions between different contents. I mean if user clicks button (1) then the content (something like a next page) is appearing from the top, and if button (2) then the content appears from the left. And so on. There can be many different transitions and directions, but the header and the footer should stay in one place on the screen. Is it possible to make such a thing?
android
animation
transition
null
null
null
open
Navigating around application === In my application I have an interesting UI: there is a header on the top of the activity, the footer at its bottom and the content between them. What I need to do is to change the content field to display different views and information, and to make different transitions between different contents. I mean if user clicks button (1) then the content (something like a next page) is appearing from the top, and if button (2) then the content appears from the left. And so on. There can be many different transitions and directions, but the header and the footer should stay in one place on the screen. Is it possible to make such a thing?
0
11,627,726
07/24/2012 09:17:02
1,548,124
07/24/2012 09:04:03
1
0
Is there code based on Iterative Water Filling for Omnet
This is my first time using omnet++ and i 'm searching for a network based on iterative water filling for this simulator. Please if you any information i would apreciate your assistance!
omnet++
null
null
null
null
null
open
Is there code based on Iterative Water Filling for Omnet === This is my first time using omnet++ and i 'm searching for a network based on iterative water filling for this simulator. Please if you any information i would apreciate your assistance!
0
11,627,729
07/24/2012 09:17:11
1,073,129
11/30/2011 10:32:08
136
8
Is it necessary to use Initial Vector at the time of Encryption and Decryption?
I am newbie to C# and I have a task to encrypt the files in C# and put it onto server (Mentioned that use 256-bit AES encryption). Whoever wants it, they should Decrypt it first and then use it. But I have some doubts related to it as: I am using AESCryptoServiceProvider Class. In that I am using the method `CreateEncryptor(Byte[], Byte[])`. But the question I want to ask is, If I encrypt the file using key as well as IV, then I have to share the both with the user Key and IV. What should I do in such case? I want that I should only use the only key at the time of encryption and decryption. How can I do that? I am totally confused about it. Please suggest me some steps over it. Thanks
c#
encryption-symmetric
null
null
null
null
open
Is it necessary to use Initial Vector at the time of Encryption and Decryption? === I am newbie to C# and I have a task to encrypt the files in C# and put it onto server (Mentioned that use 256-bit AES encryption). Whoever wants it, they should Decrypt it first and then use it. But I have some doubts related to it as: I am using AESCryptoServiceProvider Class. In that I am using the method `CreateEncryptor(Byte[], Byte[])`. But the question I want to ask is, If I encrypt the file using key as well as IV, then I have to share the both with the user Key and IV. What should I do in such case? I want that I should only use the only key at the time of encryption and decryption. How can I do that? I am totally confused about it. Please suggest me some steps over it. Thanks
0
11,627,736
07/24/2012 09:17:32
1,548,088
07/24/2012 08:48:39
1
0
Delegate.Combine() issue?
I really don't understand what is wrong with this code It is throwing several errors error CS0079: The event `core.Events.Event.thisEvent' can only appear on the left hand side of `+=' or `-=' operator error CS0070: The event `core.Events.Event.thisEvent' can only appear on the left hand side of += or -= when used outside of the type `core.Events.Event' error CS1502: The best overloaded method match for `System.Delegate.Combine(System.Delegate, System.Delegate)' has some invalid arguments error CS1503: Argument `#1' cannot convert `object' expression to type `System.Delegate' what am I doing wrong and how can I fix this? Any help would be appreciated! using System; using System.Runtime.CompilerServices; namespace core.Events { public class Event { public delegate void EventDelegate (object from,EventArgs args); public event Event.EventDelegate thisEvent { [MethodImpl(MethodImplOptions.Synchronized)] add { this.thisEvent += (Event.EventDelegate)Delegate.Combine (this.thisEvent, value); } [MethodImpl(MethodImplOptions.Synchronized)] remove { this.thisEvent -= (Event.EventDelegate)Delegate.Remove (this.thisEvent, value); } } public void call (object from, EventArgs args) { this.thisEvent (from, args); } } } Thank you in advance for your help I think I am just super tired and lost in source...
events
delegates
combine
null
null
null
open
Delegate.Combine() issue? === I really don't understand what is wrong with this code It is throwing several errors error CS0079: The event `core.Events.Event.thisEvent' can only appear on the left hand side of `+=' or `-=' operator error CS0070: The event `core.Events.Event.thisEvent' can only appear on the left hand side of += or -= when used outside of the type `core.Events.Event' error CS1502: The best overloaded method match for `System.Delegate.Combine(System.Delegate, System.Delegate)' has some invalid arguments error CS1503: Argument `#1' cannot convert `object' expression to type `System.Delegate' what am I doing wrong and how can I fix this? Any help would be appreciated! using System; using System.Runtime.CompilerServices; namespace core.Events { public class Event { public delegate void EventDelegate (object from,EventArgs args); public event Event.EventDelegate thisEvent { [MethodImpl(MethodImplOptions.Synchronized)] add { this.thisEvent += (Event.EventDelegate)Delegate.Combine (this.thisEvent, value); } [MethodImpl(MethodImplOptions.Synchronized)] remove { this.thisEvent -= (Event.EventDelegate)Delegate.Remove (this.thisEvent, value); } } public void call (object from, EventArgs args) { this.thisEvent (from, args); } } } Thank you in advance for your help I think I am just super tired and lost in source...
0
11,471,347
07/13/2012 13:20:49
123,367
06/15/2009 21:18:09
370
6
Entity Framework 5 - Could not load file or assembly EntityFramework, Version=5.0.0.0
I am trying to use Entity Framework 5 for my project but I seem to be having some issue getting the assembly installed to comply. And since I installed this initially using nuget, I am not certain what I need to do to cause this to work as I expect . Any help on what I need to do to fix this problem please? **System.IO.FileNotFoundException : Could not load file or assembly EntityFramework, Version=5.0.0.0, Culture=Neutral, PublicKeyToken=b77a5c561934e089' or one of it's dependencies The System cannot find the file specified.WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registy value . . . **
c#
entity-framework
entity-framework-ctp5
null
null
null
open
Entity Framework 5 - Could not load file or assembly EntityFramework, Version=5.0.0.0 === I am trying to use Entity Framework 5 for my project but I seem to be having some issue getting the assembly installed to comply. And since I installed this initially using nuget, I am not certain what I need to do to cause this to work as I expect . Any help on what I need to do to fix this problem please? **System.IO.FileNotFoundException : Could not load file or assembly EntityFramework, Version=5.0.0.0, Culture=Neutral, PublicKeyToken=b77a5c561934e089' or one of it's dependencies The System cannot find the file specified.WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registy value . . . **
0