PostId
int64 13
11.8M
| PostCreationDate
stringlengths 19
19
| OwnerUserId
int64 3
1.57M
| OwnerCreationDate
stringlengths 10
19
| ReputationAtPostCreation
int64 -33
210k
| OwnerUndeletedAnswerCountAtPostTime
int64 0
5.77k
| Title
stringlengths 10
250
| BodyMarkdown
stringlengths 12
30k
| Tag1
stringlengths 1
25
⌀ | Tag2
stringlengths 1
25
⌀ | Tag3
stringlengths 1
25
⌀ | Tag4
stringlengths 1
25
⌀ | Tag5
stringlengths 1
25
⌀ | PostClosedDate
stringlengths 19
19
⌀ | OpenStatus
stringclasses 5
values | unified_texts
stringlengths 47
30.1k
| OpenStatus_id
int64 0
4
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
118,512 | 09/23/2008 00:57:18 | 9,532 | 09/15/2008 19:04:16 | 85 | 6 | Project retirement or archiving | What is the best way to retire a currently active project? I've been working on this one for a while now and I think its time to let go. Without going into too much detail, there are other projects and technologies that are way ahead now and I don't see much value in investing in it any further.
What have you done to retire a project and what is the process like? | development | null | null | null | null | 06/08/2011 13:28:25 | off topic | Project retirement or archiving
===
What is the best way to retire a currently active project? I've been working on this one for a while now and I think its time to let go. Without going into too much detail, there are other projects and technologies that are way ahead now and I don't see much value in investing in it any further.
What have you done to retire a project and what is the process like? | 2 |
8,286,887 | 11/27/2011 16:07:56 | 1,037,519 | 11/09/2011 11:12:12 | 10 | 0 | How to deal with subdomains in a mvc iis | routes.Add("DomainRoute", new DomainRoute(
"{controller}.localhost:5096",
"{action}/{id}",
new { controller = "Home", action = "Index", id = "" }
));
without iis all good
with iis I have
> Bad Request - Invalid Hostname
>
> HTTP Error 400. The request hostname is invalid.
http://develop.localhost:5096/
| asp.net-mvc | iis | null | null | null | null | open | How to deal with subdomains in a mvc iis
===
routes.Add("DomainRoute", new DomainRoute(
"{controller}.localhost:5096",
"{action}/{id}",
new { controller = "Home", action = "Index", id = "" }
));
without iis all good
with iis I have
> Bad Request - Invalid Hostname
>
> HTTP Error 400. The request hostname is invalid.
http://develop.localhost:5096/
| 0 |
8,168,674 | 11/17/2011 14:23:34 | 1,051,965 | 11/17/2011 14:13:10 | 1 | 0 | SSRS - Mutiple Columns with Row Group in Reports | Example:<br/>
SubTitle1 : SubTitle2<br/>
Question1 : Question1 <br/>
Question2 : Question2 <br/>
<br/>
Is it possible in SSRS. Please help this. | sql-server | null | null | null | null | 01/21/2012 03:46:35 | not a real question | SSRS - Mutiple Columns with Row Group in Reports
===
Example:<br/>
SubTitle1 : SubTitle2<br/>
Question1 : Question1 <br/>
Question2 : Question2 <br/>
<br/>
Is it possible in SSRS. Please help this. | 1 |
11,641,098 | 07/25/2012 00:20:44 | 1,056,386 | 11/20/2011 13:23:39 | 178 | 2 | I made a little math benchmark in C, Clojure, Python, Ruby, Scala and some others. And I want to ask an advice | ##**Disclaimer**
I know that artificial benchmarks are evil. They can show results only for very specific narrow situation. I don't assume that one language is better than the other because of the some stupid bench. However I wonder why results is so different. Please see my questions at the bottom.
##Math benchmark description
Benchmark is simple math calculations to find pairs of prime numbers which differs by 6 (so called [sexy primes][1])
E.g. sexy primes below 100 would be: `(5 11) (7 13) (11 17) (13 19) (17 23) (23 29) (31 37) (37 43) (41 47) (47 53) (53 59) (61 67) (67 73) (73 79) (83 89) (97 103)`
##Results table
*In table: calculation time in seconds*
Running: all except Factor was running in VirtualBox (Debian unstable amd64 guest, Windows 7 x64 host)
CPU: AMD A4-3305M
Sexy primes up to: 10k 20k 30k 100k
Bash 58.00 200.00 [*1] [*1]
C 0.20 0.65 1.42 15.00
Clojure 4.12 8.32 16.00 137.93
Factor n/a n/a 15.00 180.00
Python2.7 9.57 42.20 96.14 [*2]
Python3.2 13.23 52.82 119 [*2]
Ruby1.8 5.10 18.32 40.48 377.00
Ruby1.9.3 1.36 5.73 10.48 106.00
Scala 0.93 1.41 2.73 20.84
[*1] - I'm afraid to imagine how much time will it take<br>
[*2] - After 30 minutes the python script was still running. Terminated it because I was bored.
##Code listings
C:
int isprime(int x) {
int i;
for (i = 2; i < x; ++i)
if (x%i == 0) return 0;
return 1;
}
void findprimes(int m) {
int i;
for ( i = 11; i < m; ++i)
if (isprime(i) && isprime(i-6))
printf("%d %d\n", i-6, i);
}
main() {
findprimes(10*1000);
}
Ruby:
def is_prime?(n)
(2...n).all?{|m| n%m != 0 }
end
def sexy_primes(x)
(9..x).map do |i|
[i-6, i]
end.select do |j|
j.all?{|j| is_prime? j}
end
end
a = Time.now
p sexy_primes(10*1000)
b = Time.now
puts "#{(b-a)*1000} mils"
Scala:
def isPrime(n:Int):Boolean =
(2 until n) forall {n%_!=0}
def sexyPrimes(n:Int) = {
(11 to n) map { i => List(i-6, i) } filter { i =>
i.forall(isPrime(_))
}
}
val a = System.currentTimeMillis()
println(sexyPrimes(100*1000))
val b = System.currentTimeMillis()
println((b-a).toString + " mils")
Clojure:
(defn is-prime? [n]
(every? #(> (mod n %) 0)
(range 2 n)))
(defn sexy-primes [m]
(for [x (range 11 (inc m))
:let [z (list (- x 6) x)]
:when (every? #(is-prime? %) z)]
z))
(let [a (System/currentTimeMillis)]
(println (sexy-primes (* 10 1000)))
(let [b (System/currentTimeMillis)]
(println (- b a) "mils")))
Python
import time as time_
def is_prime(n):
return all([(n%j > 0) for j in range(2, n)])
def primes_below(x):
return [[j-6, j] for j in range(9, x+1) if is_prime(j) and is_prime(j-6)]
a = int(round(time_.time() * 1000))
print(primes_below(10*1000))
b = int(round(time_.time() * 1000))
print(str((b-a)) + " mils")
Factor
MEMO:: prime? ( n -- ? )
n 1 - 2 [a,b] [ n swap mod 0 > ] all? ;
MEMO: sexyprimes ( n n -- r r )
[a,b] [ prime? ] filter [ 6 + ] map [ prime? ] filter dup [ 6 - ] map ;
5 10 1000 * sexyprimes . .
Bash(zsh):
#!/usr/bin/zsh
function prime {
for (( i = 2; i < $1; i++ )); do
if [[ $[$1%i] == 0 ]]; then
echo 1
exit
fi
done
echo 0
}
function sexy-primes {
for (( i = 9; i <= $1; i++ )); do
j=$[i-6]
if [[ $(prime $i) == 0 && $(prime $j) == 0 ]]; then
echo $j $i
fi
done
}
sexy-primes 10000
##Questions
1. Why Scala is so fast? Is it because of **static typing**? Or it is just using JVM very efficiently?
2. Why such a huge difference between Ruby and Python? I thought these two are not somewhat totally different. Maybe my code is wrong. Please enlighten me! Thanks.
3. Really impressive jump in productivity between Ruby versions.
4. Can I optimize clojure by adding type declarations? Will it help?
[1]: https://en.wikipedia.org/wiki/Sexy_prime | python | ruby | scala | clojure | benchmarking | 07/27/2012 16:54:16 | not constructive | I made a little math benchmark in C, Clojure, Python, Ruby, Scala and some others. And I want to ask an advice
===
##**Disclaimer**
I know that artificial benchmarks are evil. They can show results only for very specific narrow situation. I don't assume that one language is better than the other because of the some stupid bench. However I wonder why results is so different. Please see my questions at the bottom.
##Math benchmark description
Benchmark is simple math calculations to find pairs of prime numbers which differs by 6 (so called [sexy primes][1])
E.g. sexy primes below 100 would be: `(5 11) (7 13) (11 17) (13 19) (17 23) (23 29) (31 37) (37 43) (41 47) (47 53) (53 59) (61 67) (67 73) (73 79) (83 89) (97 103)`
##Results table
*In table: calculation time in seconds*
Running: all except Factor was running in VirtualBox (Debian unstable amd64 guest, Windows 7 x64 host)
CPU: AMD A4-3305M
Sexy primes up to: 10k 20k 30k 100k
Bash 58.00 200.00 [*1] [*1]
C 0.20 0.65 1.42 15.00
Clojure 4.12 8.32 16.00 137.93
Factor n/a n/a 15.00 180.00
Python2.7 9.57 42.20 96.14 [*2]
Python3.2 13.23 52.82 119 [*2]
Ruby1.8 5.10 18.32 40.48 377.00
Ruby1.9.3 1.36 5.73 10.48 106.00
Scala 0.93 1.41 2.73 20.84
[*1] - I'm afraid to imagine how much time will it take<br>
[*2] - After 30 minutes the python script was still running. Terminated it because I was bored.
##Code listings
C:
int isprime(int x) {
int i;
for (i = 2; i < x; ++i)
if (x%i == 0) return 0;
return 1;
}
void findprimes(int m) {
int i;
for ( i = 11; i < m; ++i)
if (isprime(i) && isprime(i-6))
printf("%d %d\n", i-6, i);
}
main() {
findprimes(10*1000);
}
Ruby:
def is_prime?(n)
(2...n).all?{|m| n%m != 0 }
end
def sexy_primes(x)
(9..x).map do |i|
[i-6, i]
end.select do |j|
j.all?{|j| is_prime? j}
end
end
a = Time.now
p sexy_primes(10*1000)
b = Time.now
puts "#{(b-a)*1000} mils"
Scala:
def isPrime(n:Int):Boolean =
(2 until n) forall {n%_!=0}
def sexyPrimes(n:Int) = {
(11 to n) map { i => List(i-6, i) } filter { i =>
i.forall(isPrime(_))
}
}
val a = System.currentTimeMillis()
println(sexyPrimes(100*1000))
val b = System.currentTimeMillis()
println((b-a).toString + " mils")
Clojure:
(defn is-prime? [n]
(every? #(> (mod n %) 0)
(range 2 n)))
(defn sexy-primes [m]
(for [x (range 11 (inc m))
:let [z (list (- x 6) x)]
:when (every? #(is-prime? %) z)]
z))
(let [a (System/currentTimeMillis)]
(println (sexy-primes (* 10 1000)))
(let [b (System/currentTimeMillis)]
(println (- b a) "mils")))
Python
import time as time_
def is_prime(n):
return all([(n%j > 0) for j in range(2, n)])
def primes_below(x):
return [[j-6, j] for j in range(9, x+1) if is_prime(j) and is_prime(j-6)]
a = int(round(time_.time() * 1000))
print(primes_below(10*1000))
b = int(round(time_.time() * 1000))
print(str((b-a)) + " mils")
Factor
MEMO:: prime? ( n -- ? )
n 1 - 2 [a,b] [ n swap mod 0 > ] all? ;
MEMO: sexyprimes ( n n -- r r )
[a,b] [ prime? ] filter [ 6 + ] map [ prime? ] filter dup [ 6 - ] map ;
5 10 1000 * sexyprimes . .
Bash(zsh):
#!/usr/bin/zsh
function prime {
for (( i = 2; i < $1; i++ )); do
if [[ $[$1%i] == 0 ]]; then
echo 1
exit
fi
done
echo 0
}
function sexy-primes {
for (( i = 9; i <= $1; i++ )); do
j=$[i-6]
if [[ $(prime $i) == 0 && $(prime $j) == 0 ]]; then
echo $j $i
fi
done
}
sexy-primes 10000
##Questions
1. Why Scala is so fast? Is it because of **static typing**? Or it is just using JVM very efficiently?
2. Why such a huge difference between Ruby and Python? I thought these two are not somewhat totally different. Maybe my code is wrong. Please enlighten me! Thanks.
3. Really impressive jump in productivity between Ruby versions.
4. Can I optimize clojure by adding type declarations? Will it help?
[1]: https://en.wikipedia.org/wiki/Sexy_prime | 4 |
3,665,841 | 09/08/2010 08:26:39 | 442,198 | 09/08/2010 08:26:39 | 1 | 0 | Packet encryption | I need to write a code to encryption packet before send it, I am using C# | c#-4.0 | null | null | null | null | 09/09/2010 02:02:31 | not a real question | Packet encryption
===
I need to write a code to encryption packet before send it, I am using C# | 1 |
1,953,690 | 12/23/2009 16:09:35 | 19,112 | 09/19/2008 17:28:07 | 825 | 51 | What is the maximum size of a primary key in Firebird? | I need to set a Varchar(255) field as the primary key of a database table in Firebird 2.1.
I get error messages saying that the field size is too large. I'm using UTF8 as my character set and the default page size of 4096.
Is it possible to do this in Firebird? I need to ensure that this column is unique. | firebird | primary-key | database-design | null | null | null | open | What is the maximum size of a primary key in Firebird?
===
I need to set a Varchar(255) field as the primary key of a database table in Firebird 2.1.
I get error messages saying that the field size is too large. I'm using UTF8 as my character set and the default page size of 4096.
Is it possible to do this in Firebird? I need to ensure that this column is unique. | 0 |
9,631,776 | 03/09/2012 09:34:06 | 379,739 | 06/30/2010 07:00:41 | 158 | 10 | Call Javascript from GridView TemplateField | I have a GridView, I have coded like the below
<asp:TemplateField HeaderText="Cheque">
<ItemTemplate>
<asp:Button ID="btnCheque" OnClientClick="javascript:SearchReqsult(<%#Eval("Id") %>);"
CssClass="Save" runat="server" />
</ItemTemplate>
</asp:TemplateField>
I face a run time error which says that my button control is formatted correctly
I suppose the issue with the following
OnClientClick="javascript:SearchReqsult(<%#Eval("Id") %>);"
Any idea? | c# | javascript | asp.net | null | null | null | open | Call Javascript from GridView TemplateField
===
I have a GridView, I have coded like the below
<asp:TemplateField HeaderText="Cheque">
<ItemTemplate>
<asp:Button ID="btnCheque" OnClientClick="javascript:SearchReqsult(<%#Eval("Id") %>);"
CssClass="Save" runat="server" />
</ItemTemplate>
</asp:TemplateField>
I face a run time error which says that my button control is formatted correctly
I suppose the issue with the following
OnClientClick="javascript:SearchReqsult(<%#Eval("Id") %>);"
Any idea? | 0 |
3,479,930 | 08/13/2010 18:59:16 | 419,911 | 08/13/2010 18:59:16 | 1 | 0 | nees a sheel script | I need a script for uncompressing file directory.logs .z.z.z.z.z.z to directory.logs | shell | null | null | null | null | 08/13/2010 19:33:16 | not a real question | nees a sheel script
===
I need a script for uncompressing file directory.logs .z.z.z.z.z.z to directory.logs | 1 |
7,291,185 | 09/03/2011 04:33:23 | 520,444 | 11/25/2010 16:55:56 | 2 | 0 | How To use Movies Custom Post Type field in single-custom.php? | I have a Wordpress Blog, Actually I m totally new for this field so no idea about much the CUSTOM POST TYPE Plugin. I have create a Movies field in CPT. but I don't know how to use this in single-custom.php file. I use single-custom.php page to seprate this movie page from other categories. But I don't know how to attach this page to movies. Bz This time my movies going on the same single.php file. Just make me simple example or clear it as sharp as you can.
Again: I want to show movies custom post type field to my single-custom.php file but how to do this which code i use for this. Thanx in advance
Kumar | wordpress | null | null | null | null | 09/06/2011 18:08:31 | not a real question | How To use Movies Custom Post Type field in single-custom.php?
===
I have a Wordpress Blog, Actually I m totally new for this field so no idea about much the CUSTOM POST TYPE Plugin. I have create a Movies field in CPT. but I don't know how to use this in single-custom.php file. I use single-custom.php page to seprate this movie page from other categories. But I don't know how to attach this page to movies. Bz This time my movies going on the same single.php file. Just make me simple example or clear it as sharp as you can.
Again: I want to show movies custom post type field to my single-custom.php file but how to do this which code i use for this. Thanx in advance
Kumar | 1 |
9,872,031 | 03/26/2012 12:22:44 | 1,266,761 | 03/13/2012 14:44:15 | 14 | 0 | Tcp/udp client/server Programs over Ipv6 in java | i am struggling with
IPV6 programing
please help me or guide to me to ipv6
if it is posible please send reference site for following programs
Tcp/upd client /server examples over ipv6
Advanced Thanks | java | null | null | null | null | 04/03/2012 05:20:07 | not a real question | Tcp/udp client/server Programs over Ipv6 in java
===
i am struggling with
IPV6 programing
please help me or guide to me to ipv6
if it is posible please send reference site for following programs
Tcp/upd client /server examples over ipv6
Advanced Thanks | 1 |
9,887,585 | 03/27/2012 10:18:37 | 1,295,201 | 03/27/2012 10:08:54 | 1 | 0 | How to read the Proxy settings? | How to detect & read the browser proxy settings?
can anyone explain me how mozila-firefox read the System Internet Options?i searched one week i didn't get any detail.this information is very useful for...
Thanks in Advance...
| java | null | null | null | null | 05/07/2012 12:16:47 | not a real question | How to read the Proxy settings?
===
How to detect & read the browser proxy settings?
can anyone explain me how mozila-firefox read the System Internet Options?i searched one week i didn't get any detail.this information is very useful for...
Thanks in Advance...
| 1 |
3,096,900 | 06/22/2010 20:32:39 | 4,384 | 09/03/2008 11:45:32 | 226 | 6 | Is using something like the MvcContrib Grid a step backwards in code readability? | I mean, now we have all this movement towards separating your html markup from your code as much as possible using modern template engines (in the old days programmers usually just kept concatenating strings in php, which was terrible.)
Then I look at a co-worker's code for generating an html table, and it looks like:
<% Html.Grid(Model).Columns(column => {
column.For(x => Html.ActionLink("Edit", "Edit", new { id = x.Id })).Attributes(width => "30px").DoNotEncode();
column.For(x => Html.ActionLink("Delete", "Delete", new { id = x.Id }, new { @class = "delete" })).Attributes(width => "95px").DoNotEncode();
column.For(x => x.Id).Named("Code");
column.For(x => x.Name).Named("Name").HeaderAttributes(align => "left");
column.For(x => x.CPF).Named("CPF");
})
.Attributes(width => "100%", border => "0", cellpadding => "0", cellspacing => "0", @class => "data-table")
.Empty("No users found!")
.RowStart(row => string.Format("<tr class='row{0}'>", row.IsAlternate ? "-alternating" : ""))
.Render();
%>
He thinks it's awesome, I think it's quite ugly, so I'd like to know more people's opinion. | asp.net-mvc | coding-style | mvccontrib | null | null | 06/23/2010 11:20:34 | not constructive | Is using something like the MvcContrib Grid a step backwards in code readability?
===
I mean, now we have all this movement towards separating your html markup from your code as much as possible using modern template engines (in the old days programmers usually just kept concatenating strings in php, which was terrible.)
Then I look at a co-worker's code for generating an html table, and it looks like:
<% Html.Grid(Model).Columns(column => {
column.For(x => Html.ActionLink("Edit", "Edit", new { id = x.Id })).Attributes(width => "30px").DoNotEncode();
column.For(x => Html.ActionLink("Delete", "Delete", new { id = x.Id }, new { @class = "delete" })).Attributes(width => "95px").DoNotEncode();
column.For(x => x.Id).Named("Code");
column.For(x => x.Name).Named("Name").HeaderAttributes(align => "left");
column.For(x => x.CPF).Named("CPF");
})
.Attributes(width => "100%", border => "0", cellpadding => "0", cellspacing => "0", @class => "data-table")
.Empty("No users found!")
.RowStart(row => string.Format("<tr class='row{0}'>", row.IsAlternate ? "-alternating" : ""))
.Render();
%>
He thinks it's awesome, I think it's quite ugly, so I'd like to know more people's opinion. | 4 |
10,641,053 | 05/17/2012 18:02:04 | 913,336 | 08/26/2011 04:14:52 | 33 | 0 | Equivalent to X11 for Windows Server | I am not really sure what I am looking for. I was told that there is an equivalent to X11 protocol for use on a windows server, but I don't know what it is or where to start looking. I googled it and found nothing.
Is there anything like this? And is there any client side program like Xming for use with windows servers? Thanks!
William | windows | x11 | null | null | null | 06/29/2012 17:55:52 | off topic | Equivalent to X11 for Windows Server
===
I am not really sure what I am looking for. I was told that there is an equivalent to X11 protocol for use on a windows server, but I don't know what it is or where to start looking. I googled it and found nothing.
Is there anything like this? And is there any client side program like Xming for use with windows servers? Thanks!
William | 2 |
2,892,673 | 05/23/2010 17:18:09 | 146,780 | 07/29/2009 01:23:43 | 1,473 | 6 | Is this possible with OpenGL? | Basically what I'd like to do is make textured NGONS. I also want to use a tesselator (GLU) to make concave and multicontour objects. I was wondering how the texture comes into play though. I think that the tesselator will return verticies so I will add these to my array, that's fine. But my vertex array will contain more than one polygon object so then how can I tell it when to bind the texture like in immediate mode? Right now I feel stuck with one call to bind. How can this be done?
Thanks | c++ | c | opengl | null | null | null | open | Is this possible with OpenGL?
===
Basically what I'd like to do is make textured NGONS. I also want to use a tesselator (GLU) to make concave and multicontour objects. I was wondering how the texture comes into play though. I think that the tesselator will return verticies so I will add these to my array, that's fine. But my vertex array will contain more than one polygon object so then how can I tell it when to bind the texture like in immediate mode? Right now I feel stuck with one call to bind. How can this be done?
Thanks | 0 |
7,013,368 | 08/10/2011 15:23:46 | 888,200 | 08/10/2011 15:23:46 | 1 | 0 | Filtering a form with multiple check boxes | What I have is a form which shows company information and also multiple contact subform that shows contact information, seperated by what the contacts job responsibility is(tabbed).
I have a combo box on the company form which displays the job responsibilities, and once a responsibility is selected it will show only company records with a contact of the selected responsibility. This is the code;
Sub SetFilter()
Dim ASQL As String
If IsNull(Me.cboshowcat) Then
' If the combo and all check boxes are Null, use the whole table as the RecordSource.
Me.RecordSource = "SELECT company.* FROM company"
Else
ASQL = "SELECT company.* FROM company INNER JOIN Contacts ON company.company_id = Contacts.company_id WHERE Contacts.responsibility= '" & cboshowcat & "'"
Form_Startup.RecordSource = ASQL
End If
End Sub
The company table will then only show records with a contact of the type specified in the cboshowcat combo box, without showing duplicate companies on the main form.
I then want to apply some further filters based on check boxes on the main form, which relate to fields on the contacts subform. These are activated by a button along with the recordsource code from above;
Private Sub Command201_Click()
If Nz(Me.cboshowcat) = "" And Me.Check194 = True Or Nz(Me.cboshowcat) = "" And Me.Check199 = True Or Nz(Me.cboshowcat) = "" And Me.Check205 = True Then
MsgBox "Please Select a Job Responsibility"
Cancel = True
Else
SetFilter
If Me.Check194 = True Then
Me.Filter = "cedit <=Date()-90"
Me.FilterOn = True
Else
Me.Filter = ""
Me.FilterOn = False
If Me.Check199 = True Then
Me.Filter = "((copt)='No')"
Me.FilterOn = True
Else
Me.Filter = ""
Me.FilterOn = False
If Me.Check205 = True Then
Me.Filter = "exsite is null"
Me.FilterOn = True
Else
Me.Filter = ""
Me.FilterOn = False
End If
End If
End If
End If
End Sub
At the moment the button filters out the selected contacts by category but if more than 1 of the checkboxes are checked it only uses one of the filters. How do I make it use multiple filters combined depending which tick box is ticked? | vba | access-vba | access | null | null | null | open | Filtering a form with multiple check boxes
===
What I have is a form which shows company information and also multiple contact subform that shows contact information, seperated by what the contacts job responsibility is(tabbed).
I have a combo box on the company form which displays the job responsibilities, and once a responsibility is selected it will show only company records with a contact of the selected responsibility. This is the code;
Sub SetFilter()
Dim ASQL As String
If IsNull(Me.cboshowcat) Then
' If the combo and all check boxes are Null, use the whole table as the RecordSource.
Me.RecordSource = "SELECT company.* FROM company"
Else
ASQL = "SELECT company.* FROM company INNER JOIN Contacts ON company.company_id = Contacts.company_id WHERE Contacts.responsibility= '" & cboshowcat & "'"
Form_Startup.RecordSource = ASQL
End If
End Sub
The company table will then only show records with a contact of the type specified in the cboshowcat combo box, without showing duplicate companies on the main form.
I then want to apply some further filters based on check boxes on the main form, which relate to fields on the contacts subform. These are activated by a button along with the recordsource code from above;
Private Sub Command201_Click()
If Nz(Me.cboshowcat) = "" And Me.Check194 = True Or Nz(Me.cboshowcat) = "" And Me.Check199 = True Or Nz(Me.cboshowcat) = "" And Me.Check205 = True Then
MsgBox "Please Select a Job Responsibility"
Cancel = True
Else
SetFilter
If Me.Check194 = True Then
Me.Filter = "cedit <=Date()-90"
Me.FilterOn = True
Else
Me.Filter = ""
Me.FilterOn = False
If Me.Check199 = True Then
Me.Filter = "((copt)='No')"
Me.FilterOn = True
Else
Me.Filter = ""
Me.FilterOn = False
If Me.Check205 = True Then
Me.Filter = "exsite is null"
Me.FilterOn = True
Else
Me.Filter = ""
Me.FilterOn = False
End If
End If
End If
End If
End Sub
At the moment the button filters out the selected contacts by category but if more than 1 of the checkboxes are checked it only uses one of the filters. How do I make it use multiple filters combined depending which tick box is ticked? | 0 |
11,701,029 | 07/28/2012 12:28:55 | 794,510 | 06/11/2011 18:39:16 | 11 | 0 | Windows Shell context menu: Sample code required | can somebody plesae share me the code for Windows Shell context menu code in C# which works both in 32-bit and 64-bit OS.
I wanted to do some action on click of context menu (right click on folder).
And I have to use .NET 3.5 only...
Please let me know if anyone have the sample code..
Thanks
Sharath | windows | shell | menu | context | null | 07/29/2012 09:19:47 | not a real question | Windows Shell context menu: Sample code required
===
can somebody plesae share me the code for Windows Shell context menu code in C# which works both in 32-bit and 64-bit OS.
I wanted to do some action on click of context menu (right click on folder).
And I have to use .NET 3.5 only...
Please let me know if anyone have the sample code..
Thanks
Sharath | 1 |
5,590,863 | 04/08/2011 05:35:29 | 698,047 | 04/08/2011 05:33:29 | 1 | 0 | nested listview add edit problem | i have nested listview. i want to edit data in both inner and outer listview. how to do that. | .net | null | null | null | null | 04/08/2011 05:56:49 | not a real question | nested listview add edit problem
===
i have nested listview. i want to edit data in both inner and outer listview. how to do that. | 1 |
713,637 | 04/03/2009 11:58:27 | 3,834 | 08/31/2008 06:25:52 | 1,464 | 68 | Inverse Attribute in NHibernate | How to use Inverse Attribute? If I am not mistaken, for one to many relationship the inverse attribute must be set to true. For many-to-many one of the entity class inverse attribute must be set to true and another set to false.
Anyone can shed some lights on this? | nhibernate | null | null | null | null | null | open | Inverse Attribute in NHibernate
===
How to use Inverse Attribute? If I am not mistaken, for one to many relationship the inverse attribute must be set to true. For many-to-many one of the entity class inverse attribute must be set to true and another set to false.
Anyone can shed some lights on this? | 0 |
6,934,385 | 08/03/2011 23:08:06 | 482,095 | 10/20/2010 18:14:07 | 25 | 0 | Jquery JS Lint error but jquery working | Hi im' getting the following error: **Problem at line 3 character 14: Cannot set property 'first' of undefined Implied global: $ 2** Check out the working script [jsFiddle][1]
Thanks in advance
[1]: http://jsfiddle.net/makingthings/7TVfh/ | jsfiddle | null | null | null | null | 12/20/2011 02:27:05 | too localized | Jquery JS Lint error but jquery working
===
Hi im' getting the following error: **Problem at line 3 character 14: Cannot set property 'first' of undefined Implied global: $ 2** Check out the working script [jsFiddle][1]
Thanks in advance
[1]: http://jsfiddle.net/makingthings/7TVfh/ | 3 |
4,681,672 | 01/13/2011 15:21:05 | 574,355 | 01/13/2011 14:29:55 | 1 | 0 | Can I play Pogo Games (That requires Java Virtual Machine) on a Mobile Phone? | My question is about Java Runtime Environment or Java Virtual Machine, Is there a similar product for mobile phones that enables me to play online games that require Java -like Pogo Games or Yahoo Games- on a mobile phone?
| java | null | null | null | null | 01/14/2011 00:09:30 | off topic | Can I play Pogo Games (That requires Java Virtual Machine) on a Mobile Phone?
===
My question is about Java Runtime Environment or Java Virtual Machine, Is there a similar product for mobile phones that enables me to play online games that require Java -like Pogo Games or Yahoo Games- on a mobile phone?
| 2 |
8,769,911 | 01/07/2012 13:06:52 | 1,124,480 | 12/31/2011 16:11:29 | 20 | 0 | Pass class Constructor through template argument in C++ | I know function can pass through `template` argument, can I pass class Constructor like this.
<!-- language: c++ -->
class A
{
A(){n=0;}
A(int i){n=i;}
int n;
};
template<class T,class Constructor>
T* new_func()
{
return new Constructor;
}
new_func<A,A()>(); //get default class
new_func<A,A(1)>(); | c++ | templates | constructor | null | null | null | open | Pass class Constructor through template argument in C++
===
I know function can pass through `template` argument, can I pass class Constructor like this.
<!-- language: c++ -->
class A
{
A(){n=0;}
A(int i){n=i;}
int n;
};
template<class T,class Constructor>
T* new_func()
{
return new Constructor;
}
new_func<A,A()>(); //get default class
new_func<A,A(1)>(); | 0 |
8,488,059 | 12/13/2011 11:02:58 | 1,095,575 | 12/13/2011 10:57:31 | 1 | 0 | I need help in installation of eclipse | I have tried to install eclipse with help from you tube videos.Although all of the videos show similar process,i am unable to install and everytime an error comes that return code1 returned.So please if anyone knows about this problem help me.And also I ve java 1.5 and 1.6 both installed on my laptop. | java-ee | null | null | null | null | 12/13/2011 11:51:11 | not a real question | I need help in installation of eclipse
===
I have tried to install eclipse with help from you tube videos.Although all of the videos show similar process,i am unable to install and everytime an error comes that return code1 returned.So please if anyone knows about this problem help me.And also I ve java 1.5 and 1.6 both installed on my laptop. | 1 |
10,674,632 | 05/20/2012 15:14:25 | 974,747 | 10/01/2011 18:23:41 | 119 | 1 | Line deleting trouble in bash: passing user-input to sed vs to grep? | Bashing trouble in MSYS: The following simple function should delete all lines that match user-input string `$kwd`.
<!-- lang: bash -->
function delnote () {
read kwd
sed -e "/$kwd/d" -i ~/notes.txt
}
Instead, I keep getting *"sed -e expression #1, char 0: no previous regular expression"* errors. Why?
I'm new to both bash and sed (and MSYS), so I'm not sure whether this is an issue of passing variables to sed or using quotes the wrong way. I tried replacing my function with [the one provided here][1], but still got the same error.
In case this is an issue of misplacing quotes, then what's the difference between how sed and grep handle user input in bash? (As opposed to sed, using `'"$*"'` in a grep function does work.)
Thanks for any help and explanations!
[1]: http://stackoverflow.com/questions/4108850/passing-bash-arguments-into-sed-to-delete-lines | bash | sed | grep | msys | null | null | open | Line deleting trouble in bash: passing user-input to sed vs to grep?
===
Bashing trouble in MSYS: The following simple function should delete all lines that match user-input string `$kwd`.
<!-- lang: bash -->
function delnote () {
read kwd
sed -e "/$kwd/d" -i ~/notes.txt
}
Instead, I keep getting *"sed -e expression #1, char 0: no previous regular expression"* errors. Why?
I'm new to both bash and sed (and MSYS), so I'm not sure whether this is an issue of passing variables to sed or using quotes the wrong way. I tried replacing my function with [the one provided here][1], but still got the same error.
In case this is an issue of misplacing quotes, then what's the difference between how sed and grep handle user input in bash? (As opposed to sed, using `'"$*"'` in a grep function does work.)
Thanks for any help and explanations!
[1]: http://stackoverflow.com/questions/4108850/passing-bash-arguments-into-sed-to-delete-lines | 0 |
11,718,535 | 07/30/2012 09:19:29 | 851,249 | 07/19/2011 04:39:45 | 310 | 1 | How can i place binary values to particular position of multidimensional string array? | I Declared multidimensional string array like this
public String[][] DataArray = new String[][]
{
new String[] { "2.1", "2.2", "3.6", "3.7", "3.8", "4.3", "4.4", "4.5" },
new String[] { "2.3", "2.4", "2.5", "5.1", "5.2", "4.6", "4.7", "4.8" },
new String[] { "2.6", "2.7", "2.8", "5.3", "5.4", "5.5", "1.1", "1.2" },
new String[] { "1.5", "6.1", "6.2", "5.6", "5.7", "5.8", "1.3", "1.4" },
new String[] { "1.8", "6.3", "6.4", "6.5", "8.1", "8.2", "1.6", "1.7" },
new String[] { "7.2", "6.6", "6.7", "6.8", "8.3", "8.4", "8.5", "7.1" },
new String[] { "7.4", "7.5", "3.1", "3.2", "8.6", "8.7", "8.8", "7.3" },
new String[] { "7.7", "7.8", "3.3", "3.4", "3.5", "4.1", "4.2", "7.6" }
};
I having set of binary values(For eg.01000010) in string array of size 8.this string array contains total 8 binary values set.For eg if i want to place 01000010 binary values to the position of 2 like in 2.1=0,2.2=1,2.3=0 ...etc.How can i do it?
| c# | c | c#-4.0 | c#-3.0 | null | null | open | How can i place binary values to particular position of multidimensional string array?
===
I Declared multidimensional string array like this
public String[][] DataArray = new String[][]
{
new String[] { "2.1", "2.2", "3.6", "3.7", "3.8", "4.3", "4.4", "4.5" },
new String[] { "2.3", "2.4", "2.5", "5.1", "5.2", "4.6", "4.7", "4.8" },
new String[] { "2.6", "2.7", "2.8", "5.3", "5.4", "5.5", "1.1", "1.2" },
new String[] { "1.5", "6.1", "6.2", "5.6", "5.7", "5.8", "1.3", "1.4" },
new String[] { "1.8", "6.3", "6.4", "6.5", "8.1", "8.2", "1.6", "1.7" },
new String[] { "7.2", "6.6", "6.7", "6.8", "8.3", "8.4", "8.5", "7.1" },
new String[] { "7.4", "7.5", "3.1", "3.2", "8.6", "8.7", "8.8", "7.3" },
new String[] { "7.7", "7.8", "3.3", "3.4", "3.5", "4.1", "4.2", "7.6" }
};
I having set of binary values(For eg.01000010) in string array of size 8.this string array contains total 8 binary values set.For eg if i want to place 01000010 binary values to the position of 2 like in 2.1=0,2.2=1,2.3=0 ...etc.How can i do it?
| 0 |
480,872 | 01/26/2009 18:34:52 | 34,224 | 11/04/2008 16:12:40 | 321 | 23 | Entity Framework: Setting a Foreign Key Property | We have a table that looks roughly like this:
<pre><code>CREATE TABLE Lockers
{
UserID int NOT NULL PRIMARY KEY (foreign key),
LockerStyleID int (foreign key),
NameplateID int (foreign key)
}</code></pre>
All of the keys relate to other tables, but because of the way the application is distributed, it's easier for us to pass along IDs as parameters. So we'd like to do this:
<pre><code>
Locker l = new Locker { UserID = userID, LockerStyleID = lockerStyleID, NameplateID = nameplateID };
entities.AddLocker(l);
</code></pre>
We could do it in LINQ-to-SQL, but not EF? | ado.net-entity-data-model | c# | null | null | null | null | open | Entity Framework: Setting a Foreign Key Property
===
We have a table that looks roughly like this:
<pre><code>CREATE TABLE Lockers
{
UserID int NOT NULL PRIMARY KEY (foreign key),
LockerStyleID int (foreign key),
NameplateID int (foreign key)
}</code></pre>
All of the keys relate to other tables, but because of the way the application is distributed, it's easier for us to pass along IDs as parameters. So we'd like to do this:
<pre><code>
Locker l = new Locker { UserID = userID, LockerStyleID = lockerStyleID, NameplateID = nameplateID };
entities.AddLocker(l);
</code></pre>
We could do it in LINQ-to-SQL, but not EF? | 0 |
9,407,333 | 02/23/2012 04:48:27 | 252,047 | 01/16/2010 06:37:47 | 1,348 | 9 | Why doesn't Microsoft compiler support C99? | I don't understand why they are not shipped C99 feature in their compiler.
When I write device driver, I always have to use old and old C syntax. I don't have any choice.
Is there a acceptable reason? And how about VS11? | c | visual-studio-2010 | microsoft | c99 | c89 | 02/23/2012 04:56:13 | not constructive | Why doesn't Microsoft compiler support C99?
===
I don't understand why they are not shipped C99 feature in their compiler.
When I write device driver, I always have to use old and old C syntax. I don't have any choice.
Is there a acceptable reason? And how about VS11? | 4 |
11,246,699 | 06/28/2012 14:18:46 | 1,423,586 | 05/29/2012 11:40:32 | 52 | 0 | Is there any SSO based Question2Answer(forums) PHP open source applications? | I want to integrate a forum site for my web site,I need SSO(Single Sign-On) based web application which is coded in PHP.I found [this][1]
but very difficult to understand the code because written in PHP4 but I'm flexible with frameworks like Kohana or Codeigniter.Is there any open source application developed using any PHP framework.
[1]: http://www.question2answer.org | php | open-source | null | null | null | 07/13/2012 04:11:29 | not a real question | Is there any SSO based Question2Answer(forums) PHP open source applications?
===
I want to integrate a forum site for my web site,I need SSO(Single Sign-On) based web application which is coded in PHP.I found [this][1]
but very difficult to understand the code because written in PHP4 but I'm flexible with frameworks like Kohana or Codeigniter.Is there any open source application developed using any PHP framework.
[1]: http://www.question2answer.org | 1 |
11,486,499 | 07/14/2012 18:55:44 | 1,149,279 | 01/14/2012 13:06:08 | 1 | 0 | Best TECHNOLOGY STACK for a real-time mobile application? | I have seen many questions similar to this and all the answers suggest that the best stack solution depends on the exact requirements of the application, like the data transfer: its type and amounts and so on. Had it been a web-app i would have straight away gone for node.js and couchDB etc, but i am not sure what i should build the whole thing on to support millions of users connected to thousands of presentation sessions simultaneously.
So, i thought of writing all the details of the application so that i can choose the stack and build upon it.
The application is an online collaborative environment where different people can collaborate with each other: very small messages are sent from the presenter to the server which are broadcast to all the people connected to that particular presentation. Right now, we have a native Android application that uses sockets to connect to a java based server which does everything.
A log is also to be kept, right now we are just writing to a file, which I know is not the right way, I need help in that regard as well, so as to how should that be done exactly so that there is no effect of it on the overall server performance.
Thirdly, audio is also being transmitted from the presenter to all the clients, again, a very naive implementation has been done for the POC, any recommendations on the whole stack?
I am sorry if i left something, I can give more details about the application if required. | android | real-time | java-server | null | null | 07/16/2012 02:03:29 | not constructive | Best TECHNOLOGY STACK for a real-time mobile application?
===
I have seen many questions similar to this and all the answers suggest that the best stack solution depends on the exact requirements of the application, like the data transfer: its type and amounts and so on. Had it been a web-app i would have straight away gone for node.js and couchDB etc, but i am not sure what i should build the whole thing on to support millions of users connected to thousands of presentation sessions simultaneously.
So, i thought of writing all the details of the application so that i can choose the stack and build upon it.
The application is an online collaborative environment where different people can collaborate with each other: very small messages are sent from the presenter to the server which are broadcast to all the people connected to that particular presentation. Right now, we have a native Android application that uses sockets to connect to a java based server which does everything.
A log is also to be kept, right now we are just writing to a file, which I know is not the right way, I need help in that regard as well, so as to how should that be done exactly so that there is no effect of it on the overall server performance.
Thirdly, audio is also being transmitted from the presenter to all the clients, again, a very naive implementation has been done for the POC, any recommendations on the whole stack?
I am sorry if i left something, I can give more details about the application if required. | 4 |
7,344,909 | 09/08/2011 08:01:08 | 601,260 | 02/03/2011 09:39:44 | 279 | 20 | Dynamic Price changes (add/subtract) - Bundled Products | I’ve been playing with Magento now for a few months and I’m stuck. I’m wondering if Magento can do Dynamic pricing. I have a bundled product with several options. I’d like, instead of the set price, to have that price change depending on whats selected. For instance…
Option 1 + $100
Option 2 + $200
Option 3 + $300
Is what I have right now, no matter what you select it always says + ‘Static Price’. What I’d like is if you selected Option 2, Option 1 would then say ’Subtract $100‘ and Option 3 would say ‘Add $100’.
Does anyone know how to do this? I’m more than willing to pay for the module if it exists. It seems like a somewhat simple thing.
Thanks in advance for the help! | magento | null | null | null | null | 10/10/2011 10:56:41 | not a real question | Dynamic Price changes (add/subtract) - Bundled Products
===
I’ve been playing with Magento now for a few months and I’m stuck. I’m wondering if Magento can do Dynamic pricing. I have a bundled product with several options. I’d like, instead of the set price, to have that price change depending on whats selected. For instance…
Option 1 + $100
Option 2 + $200
Option 3 + $300
Is what I have right now, no matter what you select it always says + ‘Static Price’. What I’d like is if you selected Option 2, Option 1 would then say ’Subtract $100‘ and Option 3 would say ‘Add $100’.
Does anyone know how to do this? I’m more than willing to pay for the module if it exists. It seems like a somewhat simple thing.
Thanks in advance for the help! | 1 |
6,210,972 | 06/02/2011 05:54:58 | 780,614 | 06/02/2011 05:54:58 | 1 | 0 | Opengl Texture Loading issue in android device | We are creating a cube on which we are loading texture.It is working fine in emulator and HTC Desire device but in another device(LG Optimus,HTC Desire) texture is not coming.Let us know if any one solved this issue.Thanks in advance.. | android | opengl | null | null | null | null | open | Opengl Texture Loading issue in android device
===
We are creating a cube on which we are loading texture.It is working fine in emulator and HTC Desire device but in another device(LG Optimus,HTC Desire) texture is not coming.Let us know if any one solved this issue.Thanks in advance.. | 0 |
7,810,121 | 10/18/2011 15:53:54 | 208,934 | 11/11/2009 18:37:27 | 28 | 0 | ASP.NET MVC3 Fluent Validation Constructor hit multiple times per request | I have an ASP.NET MVC3 website setup using fluent validation and ninject. The validation code is working. However, I set a break point in the validation class constructor and I noticed that when I request my view that uses the validation the constructor gets hit multiple times. Based on very basic testing it seems that the number of times the constructor is hit is equal to the number of properties that exist on the object. Has anyone else come across something similar? Or can someone shed more insight on how this type of validation works behind the scenes? -Thanks
Here is the constructor...
public class PersonValidator : AbstractValidator<Person> {
public PersonValidator() {
RuleFor(x => x.Id).NotNull();
RuleFor(x => x.Name).Length(0, 10);
RuleFor(x => x.Email).EmailAddress();
RuleFor(x => x.Age).InclusiveBetween(18, 60);
}
} | asp.net-mvc-3 | ninject | fluentvalidation | null | null | null | open | ASP.NET MVC3 Fluent Validation Constructor hit multiple times per request
===
I have an ASP.NET MVC3 website setup using fluent validation and ninject. The validation code is working. However, I set a break point in the validation class constructor and I noticed that when I request my view that uses the validation the constructor gets hit multiple times. Based on very basic testing it seems that the number of times the constructor is hit is equal to the number of properties that exist on the object. Has anyone else come across something similar? Or can someone shed more insight on how this type of validation works behind the scenes? -Thanks
Here is the constructor...
public class PersonValidator : AbstractValidator<Person> {
public PersonValidator() {
RuleFor(x => x.Id).NotNull();
RuleFor(x => x.Name).Length(0, 10);
RuleFor(x => x.Email).EmailAddress();
RuleFor(x => x.Age).InclusiveBetween(18, 60);
}
} | 0 |
11,748,073 | 07/31/2012 20:03:55 | 1,566,642 | 07/31/2012 18:35:51 | 1 | 0 | PrimeFaces Ajax calls does not refresh the JSF view | I'm creating a project with Spring 3.2.0, PrimeFaces 3.3.1, Mojarra 2.1.11 and then Spring Security 3.1.1.
My problem is the whenever an ajax call is fired by PrimeFaces, like for example in table pagination, the screen components are not refreshed.
I stripped down the application to a minimum and tried this code:
<h:form id="testAjax" >
<h:panelGrid columns="4" cellpadding="5">
<h:outputLabel for="test" value="test:" style="font-weight:bold"/>
<p:inputText id="test" value="#{testBean.test}" />
<p:commandButton value="Submit" update="@form"/>
<h:outputText value="#{testBean.test}" id="display" />
</h:panelGrid>
</h:form>
note that I double checked that no forms are nested, I tried both "process" and "update" with @form or the elements id.
What happens is that the setter of TestBean is called, the attribute setted, but then the getter is never called again to display the new value. This are the logs on server side:
org.springframework.web.servlet.DispatcherServlet - DispatcherServlet with name 'Spring MVC Dispatcher Servlet' processing POST request for [/TryAjax/spring/WEB-INF/login.xhtml]
org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Mapping [/WEB-INF/login.xhtml] to HandlerExecutionChain with handler [org.springframework.web.servlet.mvc.UrlFilenameViewController@2f46ccac] and 1 interceptor
org.springframework.web.servlet.mvc.UrlFilenameViewController - Returning view name 'WEB-INF/login' for lookup path [/WEB-INF/login.xhtml]
org.springframework.web.servlet.DispatcherServlet - Rendering view [org.springframework.faces.mvc.JsfView: name 'WEB-INF/login'; URL [/WEB-INF/WEB-INF/login.xhtml]] in DispatcherServlet with name 'Spring MVC Dispatcher Servlet'
org.springframework.faces.support.RequestLoggingPhaseListener - Entering JSF Phase: RESTORE_VIEW 1
org.springframework.faces.mvc.JsfView - Asking faces lifecycle to render
org.springframework.faces.support.RequestLoggingPhaseListener - Entering JSF Phase: RENDER_RESPONSE 6
org.springframework.faces.mvc.JsfView - View rendering complete
org.springframework.web.servlet.DispatcherServlet - Successfully completed request
I fear is a problem of configuration, I followed the basic instruction but then made some modifications to correct some errors, here's the web.xml stripped of some not relevant part
<?xml version = '1.0'?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee">
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/log4j.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring_context.xml</param-value>
</context-param>
<servlet>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value></param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<url-pattern>/spring/*</url-pattern>
</servlet-mapping>
<listener>
<listener-class>org.springframework.security.web.session.HttpSessionEventPublisher</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener </listener-class>
</listener>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<context-param>
<param-name>facelets.LIBRARIES</param-name>
<param-value>/WEB-INF/tags/synaptic.taglib.xml</param-value>
</context-param>
<filter>
<filter-name>openSessionInViewFilter</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
<init-param>
<param-name>flushMode</param-name>
<param-value>AUTO</param-value>
</init-param>
</filter>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Production</param-value>
</context-param>
<context-param>
<param-name>facelets.SKIP_COMMENTS</param-name>
<param-value>true</param-value>
</context-param>
<servlet>
<servlet-name>Resources Servlet</servlet-name>
<servlet-class>org.springframework.js.resource.ResourceServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Resources Servlet</servlet-name>
<url-pattern>/resources/*</url-pattern>
</servlet-mapping>
</web-app>
Faces config
<?xml version="1.0" encoding="UTF-8"?>
<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
version="2.0">
<application>
<el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
</application>
</faces-config>
other spring flow configuration
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:webflow="http://www.springframework.org/schema/webflow-config"
xmlns:faces="http://www.springframework.org/schema/faces"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/webflow-config
http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.3.xsd
http://www.springframework.org/schema/faces
http://www.springframework.org/schema/faces/spring-faces-2.2.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd">
<faces:resources />
<context:annotation-config />
<context:component-scan base-package="com.synaptic"/>
<bean class="org.springframework.faces.webflow.JsfFlowHandlerAdapter">
<property name="flowExecutor" ref="flowExecutor" />
</bean>
<bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<value>
/flows/*=flowController
</value>
</property>
<property name="defaultHandler">
<bean class="org.springframework.web.servlet.mvc.UrlFilenameViewController"/>
</property>
</bean>
<bean class="org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter">
</bean>
<bean id="faceletsViewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="viewClass" value="org.springframework.faces.mvc.JsfView"/>
<property name="prefix" value="/WEB-INF/"/>
<property name="suffix" value=".xhtml"/>
</bean>
<bean id="flowController" class="org.springframework.webflow.mvc.servlet.FlowController">
<property name="flowExecutor" ref="flowExecutor"/>
</bean>
<webflow:flow-executor id="flowExecutor" flow-registry="flowRegistry">
<webflow:flow-execution-listeners>
<webflow:listener ref="flowFacesContextLifecycleListener" />
<!-- <webflow:listener ref="facesContextListener"/>-->
</webflow:flow-execution-listeners>
</webflow:flow-executor>
<bean id="flowFacesContextLifecycleListener" class="org.springframework.faces.webflow.FlowFacesContextLifecycleListener" />
<webflow:flow-registry id="flowRegistry" flow-builder-services="facesFlowBuilderServices">
<webflow:flow-location-pattern value="/WEB-INF/flows/**/*.xml"/>
</webflow:flow-registry>
<bean id="conversionService" class="org.springframework.faces.model.converter.FacesConversionService"/>
<bean id="expressionParser" class="org.springframework.webflow.expression.el.WebFlowELExpressionParser">
<constructor-arg>
<bean class="org.jboss.el.ExpressionFactoryImpl"/>
</constructor-arg>
<property name="conversionService" ref="conversionService"/>
</bean>
<faces:flow-builder-services id="facesFlowBuilderServices" expression-parser="expressionParser" conversion-service="conversionService"/>
</beans>
Please if you see anything wrong or you have any idea help me, this issue is bugging me from days. Thank you!
| ajax | spring | jsf | primefaces | null | null | open | PrimeFaces Ajax calls does not refresh the JSF view
===
I'm creating a project with Spring 3.2.0, PrimeFaces 3.3.1, Mojarra 2.1.11 and then Spring Security 3.1.1.
My problem is the whenever an ajax call is fired by PrimeFaces, like for example in table pagination, the screen components are not refreshed.
I stripped down the application to a minimum and tried this code:
<h:form id="testAjax" >
<h:panelGrid columns="4" cellpadding="5">
<h:outputLabel for="test" value="test:" style="font-weight:bold"/>
<p:inputText id="test" value="#{testBean.test}" />
<p:commandButton value="Submit" update="@form"/>
<h:outputText value="#{testBean.test}" id="display" />
</h:panelGrid>
</h:form>
note that I double checked that no forms are nested, I tried both "process" and "update" with @form or the elements id.
What happens is that the setter of TestBean is called, the attribute setted, but then the getter is never called again to display the new value. This are the logs on server side:
org.springframework.web.servlet.DispatcherServlet - DispatcherServlet with name 'Spring MVC Dispatcher Servlet' processing POST request for [/TryAjax/spring/WEB-INF/login.xhtml]
org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Mapping [/WEB-INF/login.xhtml] to HandlerExecutionChain with handler [org.springframework.web.servlet.mvc.UrlFilenameViewController@2f46ccac] and 1 interceptor
org.springframework.web.servlet.mvc.UrlFilenameViewController - Returning view name 'WEB-INF/login' for lookup path [/WEB-INF/login.xhtml]
org.springframework.web.servlet.DispatcherServlet - Rendering view [org.springframework.faces.mvc.JsfView: name 'WEB-INF/login'; URL [/WEB-INF/WEB-INF/login.xhtml]] in DispatcherServlet with name 'Spring MVC Dispatcher Servlet'
org.springframework.faces.support.RequestLoggingPhaseListener - Entering JSF Phase: RESTORE_VIEW 1
org.springframework.faces.mvc.JsfView - Asking faces lifecycle to render
org.springframework.faces.support.RequestLoggingPhaseListener - Entering JSF Phase: RENDER_RESPONSE 6
org.springframework.faces.mvc.JsfView - View rendering complete
org.springframework.web.servlet.DispatcherServlet - Successfully completed request
I fear is a problem of configuration, I followed the basic instruction but then made some modifications to correct some errors, here's the web.xml stripped of some not relevant part
<?xml version = '1.0'?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee">
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/log4j.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring_context.xml</param-value>
</context-param>
<servlet>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value></param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<url-pattern>/spring/*</url-pattern>
</servlet-mapping>
<listener>
<listener-class>org.springframework.security.web.session.HttpSessionEventPublisher</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener </listener-class>
</listener>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<context-param>
<param-name>facelets.LIBRARIES</param-name>
<param-value>/WEB-INF/tags/synaptic.taglib.xml</param-value>
</context-param>
<filter>
<filter-name>openSessionInViewFilter</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
<init-param>
<param-name>flushMode</param-name>
<param-value>AUTO</param-value>
</init-param>
</filter>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Production</param-value>
</context-param>
<context-param>
<param-name>facelets.SKIP_COMMENTS</param-name>
<param-value>true</param-value>
</context-param>
<servlet>
<servlet-name>Resources Servlet</servlet-name>
<servlet-class>org.springframework.js.resource.ResourceServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Resources Servlet</servlet-name>
<url-pattern>/resources/*</url-pattern>
</servlet-mapping>
</web-app>
Faces config
<?xml version="1.0" encoding="UTF-8"?>
<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
version="2.0">
<application>
<el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
</application>
</faces-config>
other spring flow configuration
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:webflow="http://www.springframework.org/schema/webflow-config"
xmlns:faces="http://www.springframework.org/schema/faces"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/webflow-config
http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.3.xsd
http://www.springframework.org/schema/faces
http://www.springframework.org/schema/faces/spring-faces-2.2.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd">
<faces:resources />
<context:annotation-config />
<context:component-scan base-package="com.synaptic"/>
<bean class="org.springframework.faces.webflow.JsfFlowHandlerAdapter">
<property name="flowExecutor" ref="flowExecutor" />
</bean>
<bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<value>
/flows/*=flowController
</value>
</property>
<property name="defaultHandler">
<bean class="org.springframework.web.servlet.mvc.UrlFilenameViewController"/>
</property>
</bean>
<bean class="org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter">
</bean>
<bean id="faceletsViewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="viewClass" value="org.springframework.faces.mvc.JsfView"/>
<property name="prefix" value="/WEB-INF/"/>
<property name="suffix" value=".xhtml"/>
</bean>
<bean id="flowController" class="org.springframework.webflow.mvc.servlet.FlowController">
<property name="flowExecutor" ref="flowExecutor"/>
</bean>
<webflow:flow-executor id="flowExecutor" flow-registry="flowRegistry">
<webflow:flow-execution-listeners>
<webflow:listener ref="flowFacesContextLifecycleListener" />
<!-- <webflow:listener ref="facesContextListener"/>-->
</webflow:flow-execution-listeners>
</webflow:flow-executor>
<bean id="flowFacesContextLifecycleListener" class="org.springframework.faces.webflow.FlowFacesContextLifecycleListener" />
<webflow:flow-registry id="flowRegistry" flow-builder-services="facesFlowBuilderServices">
<webflow:flow-location-pattern value="/WEB-INF/flows/**/*.xml"/>
</webflow:flow-registry>
<bean id="conversionService" class="org.springframework.faces.model.converter.FacesConversionService"/>
<bean id="expressionParser" class="org.springframework.webflow.expression.el.WebFlowELExpressionParser">
<constructor-arg>
<bean class="org.jboss.el.ExpressionFactoryImpl"/>
</constructor-arg>
<property name="conversionService" ref="conversionService"/>
</bean>
<faces:flow-builder-services id="facesFlowBuilderServices" expression-parser="expressionParser" conversion-service="conversionService"/>
</beans>
Please if you see anything wrong or you have any idea help me, this issue is bugging me from days. Thank you!
| 0 |
11,712,646 | 07/29/2012 20:26:48 | 353,137 | 05/28/2010 17:49:01 | 1,741 | 25 | iCloud + Core Data - When to know to seed the iCloud core data store? | I am working to implement iCloud core data sync in my iPhone app. I am working on the user workflow, and the problem that I am encountering is trying to figure out when my app should "seed" the data to iCloud. This can happen under two use cases: (1) When the app is first installed and I want to seed with some pre-loaded data, or (2) if a pre-existing customer downloads the iCloud update, and their existing data should be uploaded to the iCloud. In each of these cases, I will have a "seed store" in the application which I will read from and upload the data to iCloud.
The problem is, how do I know if the data has already been seeded? One option is to *delete the seed store* from the device once seeding is completed, so that the next time the app launches, it will know that it does not need to seed again.
But, what if the store was already seeded from a different device? Is there some sort of flag I can check in iCloud which will tell me that the data should not be seeded? Or, am I forced to *always* seed the data when the local seed store is extant, and then de-dupe? That will cause problems because the initial seed data (from the app's initial launch after installation) is user-deletable, and so if they (1) install the app on their iPhone, and then delete the default data set, and then (2) install the app on their iPad, then the default data set will be re-uploaded *again*.
Another option that just occurred to me is that when the user installs the app, or turns on iCloud, I could ask the user: Have you already uploaded data? Do you want to replace any data in iCloud with the local data? And if they say yes, then it will nuke iCloud's data store and then re-seed with local data. The problem with this, however, is that it creates the possibility of user error—and this is something that I don't want users to screw up.
Any thoughts? | iphone | ios | core-data | synchronization | icloud | 07/31/2012 02:30:01 | off topic | iCloud + Core Data - When to know to seed the iCloud core data store?
===
I am working to implement iCloud core data sync in my iPhone app. I am working on the user workflow, and the problem that I am encountering is trying to figure out when my app should "seed" the data to iCloud. This can happen under two use cases: (1) When the app is first installed and I want to seed with some pre-loaded data, or (2) if a pre-existing customer downloads the iCloud update, and their existing data should be uploaded to the iCloud. In each of these cases, I will have a "seed store" in the application which I will read from and upload the data to iCloud.
The problem is, how do I know if the data has already been seeded? One option is to *delete the seed store* from the device once seeding is completed, so that the next time the app launches, it will know that it does not need to seed again.
But, what if the store was already seeded from a different device? Is there some sort of flag I can check in iCloud which will tell me that the data should not be seeded? Or, am I forced to *always* seed the data when the local seed store is extant, and then de-dupe? That will cause problems because the initial seed data (from the app's initial launch after installation) is user-deletable, and so if they (1) install the app on their iPhone, and then delete the default data set, and then (2) install the app on their iPad, then the default data set will be re-uploaded *again*.
Another option that just occurred to me is that when the user installs the app, or turns on iCloud, I could ask the user: Have you already uploaded data? Do you want to replace any data in iCloud with the local data? And if they say yes, then it will nuke iCloud's data store and then re-seed with local data. The problem with this, however, is that it creates the possibility of user error—and this is something that I don't want users to screw up.
Any thoughts? | 2 |
4,094,497 | 11/04/2010 06:56:35 | 493,325 | 11/01/2010 08:06:11 | 9 | 1 | what is the best and fast ways, skills and the tools needed to develop a commercial web site that has customized and advanced features ? | what is the best and fast ways, skills and the tools needed to develop a commercial web site that has customized and advanced features ?
what is the minimum time and cost needed to develop a simple and professional web site ?
what is the good way to design the home or index page of the the web site and how we can use it as a template for other web site pages ?
which tools and software are better for developing web appliaction ?
what are the steps I should follow in designing and developing a web application ?
How I can apply a security policy and login mechanism in my web site ?
Is there a really good web site that describes and teaches that in step by step way with real and practical examples and as a whole web application not just some parts divided in different topics ?
I will appreciate sharing that and answering this question which will be very useful for many senior developers and junior programmers ..
Thanks in Advance .. | security | website | software-engineering | professional-development | null | 11/04/2010 10:32:24 | not a real question | what is the best and fast ways, skills and the tools needed to develop a commercial web site that has customized and advanced features ?
===
what is the best and fast ways, skills and the tools needed to develop a commercial web site that has customized and advanced features ?
what is the minimum time and cost needed to develop a simple and professional web site ?
what is the good way to design the home or index page of the the web site and how we can use it as a template for other web site pages ?
which tools and software are better for developing web appliaction ?
what are the steps I should follow in designing and developing a web application ?
How I can apply a security policy and login mechanism in my web site ?
Is there a really good web site that describes and teaches that in step by step way with real and practical examples and as a whole web application not just some parts divided in different topics ?
I will appreciate sharing that and answering this question which will be very useful for many senior developers and junior programmers ..
Thanks in Advance .. | 1 |
10,302,456 | 04/24/2012 16:55:37 | 609,825 | 02/09/2011 13:46:24 | 26 | 1 | How to forward ssh-agent credentials from an auxiliary ssh-agent? | Problem: I have a remote **git server** with ssh-accessible git repository and another remote **deployment server** where I want to checkout the sources with git-clone. I want to minimize the chances that an attacker who took over the deployment server is able to browse my git repository. (I checkout with "git clone --depth 1" to limit the history stored on the deployment server.)
I have a private key that grants read-only ssh access to the git server. Let's call this key **weak credentials.** I also have a bunch of my personal private keys that grant full access to misc hosts. Let's call these keys **strong credentials.**
Normally I run ssh-agent on my localhost and keep my strong credentials in it, so that I can login passwordless to misc hosts (let's call it **strong ssh-agent**). Additionally, just for the checkout procedure, I would like to start another ssh-agent and make it hold just the weak credentials (let's call it **weak ssh-agent**).
I want to login (with ssh) to the deployment host using strong agent and forward the credentials from the weak agent. What is the easiest way to achieve this effect?
Unfortunately 'ssh -A' does not distinguish between the ssh-agent used for authorization and the ssh-agent being forwarded.
I know about the possibility of forwarding an arbitrary Unix domain socket by using ssh with `socat` (e.g. to forward the socket of the weak ssh-agent), but this requires socat installation at the remote end and seems clumsy.
I know that I can simply clone to my localhost and then upload to the deployment host, but I want to avoid it, because deployment server and git server have much better network than my localhost.
| ssh | credentials | ssh-agent | null | null | 04/25/2012 19:22:22 | off topic | How to forward ssh-agent credentials from an auxiliary ssh-agent?
===
Problem: I have a remote **git server** with ssh-accessible git repository and another remote **deployment server** where I want to checkout the sources with git-clone. I want to minimize the chances that an attacker who took over the deployment server is able to browse my git repository. (I checkout with "git clone --depth 1" to limit the history stored on the deployment server.)
I have a private key that grants read-only ssh access to the git server. Let's call this key **weak credentials.** I also have a bunch of my personal private keys that grant full access to misc hosts. Let's call these keys **strong credentials.**
Normally I run ssh-agent on my localhost and keep my strong credentials in it, so that I can login passwordless to misc hosts (let's call it **strong ssh-agent**). Additionally, just for the checkout procedure, I would like to start another ssh-agent and make it hold just the weak credentials (let's call it **weak ssh-agent**).
I want to login (with ssh) to the deployment host using strong agent and forward the credentials from the weak agent. What is the easiest way to achieve this effect?
Unfortunately 'ssh -A' does not distinguish between the ssh-agent used for authorization and the ssh-agent being forwarded.
I know about the possibility of forwarding an arbitrary Unix domain socket by using ssh with `socat` (e.g. to forward the socket of the weak ssh-agent), but this requires socat installation at the remote end and seems clumsy.
I know that I can simply clone to my localhost and then upload to the deployment host, but I want to avoid it, because deployment server and git server have much better network than my localhost.
| 2 |
7,761,153 | 10/13/2011 22:26:26 | 752,267 | 05/13/2011 11:25:03 | 67 | 1 | C# : use mysql library | i am writing a C# code that requires data to be stored either on the hard drive or inside the program using mysql , i`d like to do it using mysql , but my problem is i don`t know how to make mysql redistributable so the client don`t install the mysql on his machine , i heard about a library that makes it redistributable but i dont know it and i don`t know how to use it , please help me and thanks . | c# | .net | mysql | null | null | 10/14/2011 02:36:43 | not a real question | C# : use mysql library
===
i am writing a C# code that requires data to be stored either on the hard drive or inside the program using mysql , i`d like to do it using mysql , but my problem is i don`t know how to make mysql redistributable so the client don`t install the mysql on his machine , i heard about a library that makes it redistributable but i dont know it and i don`t know how to use it , please help me and thanks . | 1 |
10,321,555 | 04/25/2012 18:24:50 | 1,302,360 | 03/30/2012 03:57:12 | 23 | 0 | Applescript Proxy | Ok. So I am having a little trouble getting an apple script program to work. Basically, I have a text file named Proxy.rtf and I need an applescript that grabs line one from this text file and changes the proxy settings on my mac to use that proxy. Then open a webpage using the new proxy settings. Then, basically I just want it to keep doing this until it reaches the end of the text file. Any ideas?
Thanks | proxy | applescript | null | null | null | 05/03/2012 20:53:16 | off topic | Applescript Proxy
===
Ok. So I am having a little trouble getting an apple script program to work. Basically, I have a text file named Proxy.rtf and I need an applescript that grabs line one from this text file and changes the proxy settings on my mac to use that proxy. Then open a webpage using the new proxy settings. Then, basically I just want it to keep doing this until it reaches the end of the text file. Any ideas?
Thanks | 2 |
11,253,778 | 06/28/2012 22:25:07 | 888,824 | 08/10/2011 21:53:53 | 1 | 0 | Need extremely easy backup system | I have a small web design agency and I'd like an automated backup system for our work files. We've got a local Linux server (Slackware) but I don't know much about Linux. I want to backup everything online. What do you recommend? | linux | backup | slackware | null | null | 06/28/2012 23:33:15 | off topic | Need extremely easy backup system
===
I have a small web design agency and I'd like an automated backup system for our work files. We've got a local Linux server (Slackware) but I don't know much about Linux. I want to backup everything online. What do you recommend? | 2 |
3,283,904 | 07/19/2010 18:29:55 | 245,706 | 01/07/2010 16:41:56 | 8,042 | 307 | Migrating SVN to GIT: Incorrect filenames with special characters | I'm trying to convert an existing SVN repository to GIT using `git-svn clone` but versioned files with special characters in the filename like "ö" are showing as "ö" after migration. Obviously, git-svn saves the filenames "as is" - I assume that SVN stores filenames in UTF-8 (as done with the logs), but my Windows uses windows-1252 encoding.
Is it possible to force git-svn to change the filename encoding? Didn't find anything in the manuals. | git-svn | special-characters | migrate | null | null | null | open | Migrating SVN to GIT: Incorrect filenames with special characters
===
I'm trying to convert an existing SVN repository to GIT using `git-svn clone` but versioned files with special characters in the filename like "ö" are showing as "ö" after migration. Obviously, git-svn saves the filenames "as is" - I assume that SVN stores filenames in UTF-8 (as done with the logs), but my Windows uses windows-1252 encoding.
Is it possible to force git-svn to change the filename encoding? Didn't find anything in the manuals. | 0 |
10,879,415 | 06/04/2012 09:53:49 | 1,141,346 | 01/10/2012 16:45:28 | 61 | 2 | Framework vs own project | Before saying anything I apologize for this post, because I know it's not a programming question, it's about where to start or what recommendations you will gave to me. I'm sorry, but I didn't know where I could ask it.
I already made different web pages with large databases, administration panels. I know programming in PHP, SQL, also in HTML, CSS and a little bit in JS. I never coded PHP with objects, I never used Zend or cakePHP.
I found a post (what was written by a programmer) about Frameworks. He said that everybody must use an already made project (framework) and to continue from there.
What should I do? When I'm creating a web page, for example a web page which you can buy diff. products, what am I supposed to do? Go to an already made framework (Drupal, Joomla or Wordpress) or to create myself?
When I'm creating such a web page (own project, coding from scratch), I made the design in Photoshop, after that I slice up into pieces, I code up with HTML, CSS and JS, after that I start creating the administration panel, at the same time creating the tables for databases.
The time for creating such a page, it took too long, 1 month or much more. Why such a long? Because I don't know if the client is satisfied (with design, the administration panel, the buttons, etc) + adding fake data into database (for testing).
What am I supposed to do? Where can I start? Am I need to start learning OOP in PHP, and after that to start learning Zend or cakePHP? What you recommend to me? What am I supposed to ask the client when we discuss about 'what type/kind of web page he want'? What questions am I need to ask him?
I must reduce the time spent for creating such a web page, and also I want to learn using zend and cakePHP.
For any web developer here, they know what means when their boss or their client says: 'Oh, I also want a button to do that'. He thinks it's just a button, it's nothing... but on the background it could be 10+ more SQL Queries, 10+ functions, not an easy one.
Thank you ! | php | html | sql | frameworks | project | 06/04/2012 10:09:12 | not a real question | Framework vs own project
===
Before saying anything I apologize for this post, because I know it's not a programming question, it's about where to start or what recommendations you will gave to me. I'm sorry, but I didn't know where I could ask it.
I already made different web pages with large databases, administration panels. I know programming in PHP, SQL, also in HTML, CSS and a little bit in JS. I never coded PHP with objects, I never used Zend or cakePHP.
I found a post (what was written by a programmer) about Frameworks. He said that everybody must use an already made project (framework) and to continue from there.
What should I do? When I'm creating a web page, for example a web page which you can buy diff. products, what am I supposed to do? Go to an already made framework (Drupal, Joomla or Wordpress) or to create myself?
When I'm creating such a web page (own project, coding from scratch), I made the design in Photoshop, after that I slice up into pieces, I code up with HTML, CSS and JS, after that I start creating the administration panel, at the same time creating the tables for databases.
The time for creating such a page, it took too long, 1 month or much more. Why such a long? Because I don't know if the client is satisfied (with design, the administration panel, the buttons, etc) + adding fake data into database (for testing).
What am I supposed to do? Where can I start? Am I need to start learning OOP in PHP, and after that to start learning Zend or cakePHP? What you recommend to me? What am I supposed to ask the client when we discuss about 'what type/kind of web page he want'? What questions am I need to ask him?
I must reduce the time spent for creating such a web page, and also I want to learn using zend and cakePHP.
For any web developer here, they know what means when their boss or their client says: 'Oh, I also want a button to do that'. He thinks it's just a button, it's nothing... but on the background it could be 10+ more SQL Queries, 10+ functions, not an easy one.
Thank you ! | 1 |
8,222,641 | 11/22/2011 06:00:57 | 204,884 | 11/06/2009 14:16:22 | 518 | 8 | Best practices for developing library for Android | I am developing a library for Android application which contacts various servers, pulls information from them and store this in a local db.<br>
The library then gives the client easy and fast access to this information based on the pre-fetched data while also taking care of updating the information when needed.
My main background is in C/++ and ObjC so I am wondering whether there are any best practices for this kind of development for Android?<br>
Any standard components which should be used?
| android | api | design-patterns | architecture | null | 11/22/2011 06:05:58 | not constructive | Best practices for developing library for Android
===
I am developing a library for Android application which contacts various servers, pulls information from them and store this in a local db.<br>
The library then gives the client easy and fast access to this information based on the pre-fetched data while also taking care of updating the information when needed.
My main background is in C/++ and ObjC so I am wondering whether there are any best practices for this kind of development for Android?<br>
Any standard components which should be used?
| 4 |
10,201,914 | 04/18/2012 02:19:10 | 941,500 | 09/12/2011 22:49:17 | 332 | 11 | How to clear an application from rendering on localhost | Sometime ago, I cloned an application on github and ran it locally to look at it. It was a ruby application running on rack. The port I used to view it was localhost:9292.
Fast forward to today. I am trying to run a very simple rack application I wrote. Just a one liner basically to study rack. When I go to localhost:9292, the old application I downloaded before comes up in my browser. I have no idea why this is happening and since I don't need the app, I closed everything and deleted that old application from my computer. I then tried 'localhost:9292' again, and oddly, that same application came up.
Even when I don't run anything, rack or otherwise, any time I go to localhost:9292, I get that ghost application showing up. I've tried clearing the cache and killing rack, restarting firefox, etc. This happens only on Firefox. Only when I use another browser do I get the proper response on localhost:9292. So I guess this has to do with Firefox somehow tying that port to that other application.
My question is how do I clear this application from Firefox? And what is the mechanism by which Firefox would tie a port to one application (for months literally) after I ran it. I don't believe this is happening from rack as I suppose I could just keep using another browser but I'd really just like to know what is happening to cause this. I've been searching around for this for hours and can find nothing. | ruby | firefox | sinatra | localhost | rack | 04/19/2012 14:59:41 | off topic | How to clear an application from rendering on localhost
===
Sometime ago, I cloned an application on github and ran it locally to look at it. It was a ruby application running on rack. The port I used to view it was localhost:9292.
Fast forward to today. I am trying to run a very simple rack application I wrote. Just a one liner basically to study rack. When I go to localhost:9292, the old application I downloaded before comes up in my browser. I have no idea why this is happening and since I don't need the app, I closed everything and deleted that old application from my computer. I then tried 'localhost:9292' again, and oddly, that same application came up.
Even when I don't run anything, rack or otherwise, any time I go to localhost:9292, I get that ghost application showing up. I've tried clearing the cache and killing rack, restarting firefox, etc. This happens only on Firefox. Only when I use another browser do I get the proper response on localhost:9292. So I guess this has to do with Firefox somehow tying that port to that other application.
My question is how do I clear this application from Firefox? And what is the mechanism by which Firefox would tie a port to one application (for months literally) after I ran it. I don't believe this is happening from rack as I suppose I could just keep using another browser but I'd really just like to know what is happening to cause this. I've been searching around for this for hours and can find nothing. | 2 |
11,133,642 | 06/21/2012 07:40:54 | 836,349 | 07/09/2011 02:52:12 | 60 | 2 | SignalIR and KnockoutJS in Asp.Net Web Form | I seen may samples of SignalIR and KnockoutJS samples on MVC platform but not on WebForm. Please suggest me, can we use on WebForm? Any articles link would be appreciable. | asp.net | webforms | knockout.js | signalr | null | null | open | SignalIR and KnockoutJS in Asp.Net Web Form
===
I seen may samples of SignalIR and KnockoutJS samples on MVC platform but not on WebForm. Please suggest me, can we use on WebForm? Any articles link would be appreciable. | 0 |
10,140,425 | 04/13/2012 12:01:57 | 1,054,798 | 11/19/2011 00:13:57 | 59 | 2 | return randomised mysql function from an array? | So I want to create a script where out of about ten mysql functions that give a user a different item, whenever the user clicks on the page, one of those functions is executed at random.
It's kind of an rpg function I need, where depending on the user's level with hunting, they are more successful, but won't always get food. So they click on the page and from an array of items, one is at random returned and that item given to them via a mysql_query.
I hope that makes sense, if not, let me know...
so far I've got these starting points
$input = array("value 1", "value 2", "value 3", "value 4", "value 5");
$rand_keys = array_rand($input, 1);
echo $input[$rand_keys[0]] . "\n";
I don't know if this would allow mysql queries in the array though.
I've also thought about using a redirect thing, but the one I tried kept redirecting, which was not what i wanted, and urls can be tampered to get the good result with that...
Anyway, I hope that made sense and any help would be greatly appreciated :) | mysql | arrays | random | null | null | null | open | return randomised mysql function from an array?
===
So I want to create a script where out of about ten mysql functions that give a user a different item, whenever the user clicks on the page, one of those functions is executed at random.
It's kind of an rpg function I need, where depending on the user's level with hunting, they are more successful, but won't always get food. So they click on the page and from an array of items, one is at random returned and that item given to them via a mysql_query.
I hope that makes sense, if not, let me know...
so far I've got these starting points
$input = array("value 1", "value 2", "value 3", "value 4", "value 5");
$rand_keys = array_rand($input, 1);
echo $input[$rand_keys[0]] . "\n";
I don't know if this would allow mysql queries in the array though.
I've also thought about using a redirect thing, but the one I tried kept redirecting, which was not what i wanted, and urls can be tampered to get the good result with that...
Anyway, I hope that made sense and any help would be greatly appreciated :) | 0 |
8,230,670 | 11/22/2011 17:00:43 | 805,156 | 06/19/2011 07:59:07 | 491 | 42 | Would it be possible to make Android screen see-through using backside camera? | Is there a way I could show what the hind-side camera captures on a full-screen such that it creates an illusion of screen being see-through? It doesn't need to be perfect, just convincing enough, a little lag won't make any difference.
Is it possible to create such an effect using phone camera? If yes, how can the effect be achieved? (as in what transformations to apply etc.)
(I already know how to [create a simple Camera Preview][1])
Thanks for help,
Shobhit,
[1]: http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.html | android | math | camera | transformation | android-camera | null | open | Would it be possible to make Android screen see-through using backside camera?
===
Is there a way I could show what the hind-side camera captures on a full-screen such that it creates an illusion of screen being see-through? It doesn't need to be perfect, just convincing enough, a little lag won't make any difference.
Is it possible to create such an effect using phone camera? If yes, how can the effect be achieved? (as in what transformations to apply etc.)
(I already know how to [create a simple Camera Preview][1])
Thanks for help,
Shobhit,
[1]: http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.html | 0 |
10,262,535 | 04/21/2012 20:02:40 | 1,103,956 | 12/17/2011 22:20:23 | 304 | 18 | Why is hardlink and softlink required ? | What is the use of creating a Hardlink and a softlink ? In what kind of scenarios do we create them ? | linux | unix | null | null | null | 04/21/2012 21:07:30 | off topic | Why is hardlink and softlink required ?
===
What is the use of creating a Hardlink and a softlink ? In what kind of scenarios do we create them ? | 2 |
10,608,554 | 05/15/2012 20:39:46 | 417,872 | 08/12/2010 01:11:11 | 5,415 | 184 | Rails: simplest way to put a blog on a subdomain | I've been digging around on subdomains in Rails for a couple days and haven't found a good explanation of this yet...
I have a rails app which has a blog integrated into it, and I'd like to put that blog on a subdomain. Ie. `blog.myapp.com`.
Now, within the blog I want the user to be able to view posts, `blog.myapp.com/posts/123`. However, if the user were to click to any other resources on the site, say `videos` for example, I'd like them to be redirected back to root, ie. `www.myapp.com/videos/123`. I don't want `blog.myapp.com/videos...` to cause a routing error, I just want it to redirect.
Basically, I'm looking for the simplest way to setup a subdomain and specify that certain controllers use that subdomain and the others don't. Ideally I'd even like the controller layer to handle redirection both ways, so that in views I could link back and forth to things just using helpers like `post_path(123)` and `video_path(123)` and that the subdomain would automatically be used or not used based on which controller was serving the view.
I tried putting all the controllers in a constraints block, ie:
constraints :subdomain => 'www' do
resources :sessions
resources :users
resources :videos
root :to => 'home#show'
end
constraints :subdomain => 'nexturb' do
resources :posts
root :to => "posts#index"
end
root :to => 'home#show'
However this doesn't seem to work well, I've especially had trouble with getting redirection between links to work very consistently.
I'm pretty sure other people must have run into this issue in the past, but I can't seem to find a good example of this situation in writing. What's the best way to handle this? | ruby-on-rails | routing | subdomain | null | null | null | open | Rails: simplest way to put a blog on a subdomain
===
I've been digging around on subdomains in Rails for a couple days and haven't found a good explanation of this yet...
I have a rails app which has a blog integrated into it, and I'd like to put that blog on a subdomain. Ie. `blog.myapp.com`.
Now, within the blog I want the user to be able to view posts, `blog.myapp.com/posts/123`. However, if the user were to click to any other resources on the site, say `videos` for example, I'd like them to be redirected back to root, ie. `www.myapp.com/videos/123`. I don't want `blog.myapp.com/videos...` to cause a routing error, I just want it to redirect.
Basically, I'm looking for the simplest way to setup a subdomain and specify that certain controllers use that subdomain and the others don't. Ideally I'd even like the controller layer to handle redirection both ways, so that in views I could link back and forth to things just using helpers like `post_path(123)` and `video_path(123)` and that the subdomain would automatically be used or not used based on which controller was serving the view.
I tried putting all the controllers in a constraints block, ie:
constraints :subdomain => 'www' do
resources :sessions
resources :users
resources :videos
root :to => 'home#show'
end
constraints :subdomain => 'nexturb' do
resources :posts
root :to => "posts#index"
end
root :to => 'home#show'
However this doesn't seem to work well, I've especially had trouble with getting redirection between links to work very consistently.
I'm pretty sure other people must have run into this issue in the past, but I can't seem to find a good example of this situation in writing. What's the best way to handle this? | 0 |
7,766,093 | 10/14/2011 10:05:35 | 118,500 | 06/06/2009 11:05:38 | 4,161 | 417 | 401 Auth error while adding file to SharePoint library from Silverlight | I am trying to add a XML file to a library in SharePoint 2010 site from a silverlight application. I am following the steps as in http://sharepoint.stackexchange.com/questions/1837/how-can-i-upload-a-file-to-a-sharepoint-document-library-using-silverlight-and-cl and http://social.msdn.microsoft.com/Forums/en/sharepointdevelopment/thread/f135aaa2-3345-483f-ade4-e4fd597d50d4 and http://stackoverflow.com/questions/2419951/how-can-i-upload-a-file-to-a-sharepoint-document-library-using-silverlight-and-cl.
But I am getting an Auth error.
On some changes to a silverlight view (MVC), the data is updated in the database. I trigger a service (basicHTTP) on the silverlight web app to get the data from the database and write an XML file. Once the file is written, I try to upload the file to the SharePoint library using the SharePoint's Copy webservice.
Any clue?
I am using | silverlight-4.0 | sharepoint2010 | null | null | null | null | open | 401 Auth error while adding file to SharePoint library from Silverlight
===
I am trying to add a XML file to a library in SharePoint 2010 site from a silverlight application. I am following the steps as in http://sharepoint.stackexchange.com/questions/1837/how-can-i-upload-a-file-to-a-sharepoint-document-library-using-silverlight-and-cl and http://social.msdn.microsoft.com/Forums/en/sharepointdevelopment/thread/f135aaa2-3345-483f-ade4-e4fd597d50d4 and http://stackoverflow.com/questions/2419951/how-can-i-upload-a-file-to-a-sharepoint-document-library-using-silverlight-and-cl.
But I am getting an Auth error.
On some changes to a silverlight view (MVC), the data is updated in the database. I trigger a service (basicHTTP) on the silverlight web app to get the data from the database and write an XML file. Once the file is written, I try to upload the file to the SharePoint library using the SharePoint's Copy webservice.
Any clue?
I am using | 0 |
4,569,863 | 12/31/2010 11:38:50 | 262,325 | 01/30/2010 04:38:58 | 476 | 2 | get the abs value of long long integer | I try to use the codes below to get the abs value of a long long type integer;
long long v=abs(originalValue);
It works as I expected until the value of v exceeds 1073741824 (1G)
If v is 2147482648, abs(v) is -2147482648.
If v is 10737418240, abs(v) is -2147482648 also.
I do not understand what causes these happened.
Welcome any comment
Thanks
interdev | iphone | null | null | null | null | null | open | get the abs value of long long integer
===
I try to use the codes below to get the abs value of a long long type integer;
long long v=abs(originalValue);
It works as I expected until the value of v exceeds 1073741824 (1G)
If v is 2147482648, abs(v) is -2147482648.
If v is 10737418240, abs(v) is -2147482648 also.
I do not understand what causes these happened.
Welcome any comment
Thanks
interdev | 0 |
802,607 | 04/29/2009 14:26:04 | 97,729 | 04/29/2009 14:15:11 | 1 | 0 | performance impact of jvmti when debugger isn't connected? | We recently pushed a web application (tomcat 5.5.x web app) into production and it started exhibiting odd behavior today. We don't see this behavior in any development or pre-production environment.
Our only view into the production system at runtime is logging. Although they can tell us what happened they can't really help us diagnose why it is happening.
We have had to reload the context twice yesterday to resolve the issue.
I was considering starting the production tomcat server with jpda active. This would allow me to connect a debugger to the application if the problem reoccurred (after removing tomcat from the pool of servers servicing user requests).
You clearly pay a performance penalty with jpda when a debugger is connected. However, I was wondering what the "cost" was when a debugger wasn't connected? I suspect that the overhead associated with "listening" for a debugger might be pretty minimal. Before I spend a few hours on performance measurements I was hoping that someone could point me to documentation that might clarify this?
java version "1.5.0_17"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_17-b04)
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_17-b04, mixed mode)
on RHEL 5.3
Thanks!
Carlos | java | debugging | performance | null | null | null | open | performance impact of jvmti when debugger isn't connected?
===
We recently pushed a web application (tomcat 5.5.x web app) into production and it started exhibiting odd behavior today. We don't see this behavior in any development or pre-production environment.
Our only view into the production system at runtime is logging. Although they can tell us what happened they can't really help us diagnose why it is happening.
We have had to reload the context twice yesterday to resolve the issue.
I was considering starting the production tomcat server with jpda active. This would allow me to connect a debugger to the application if the problem reoccurred (after removing tomcat from the pool of servers servicing user requests).
You clearly pay a performance penalty with jpda when a debugger is connected. However, I was wondering what the "cost" was when a debugger wasn't connected? I suspect that the overhead associated with "listening" for a debugger might be pretty minimal. Before I spend a few hours on performance measurements I was hoping that someone could point me to documentation that might clarify this?
java version "1.5.0_17"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_17-b04)
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_17-b04, mixed mode)
on RHEL 5.3
Thanks!
Carlos | 0 |
11,560,518 | 07/19/2012 12:06:07 | 1,504,720 | 07/05/2012 17:06:56 | 1 | 0 | How can I accept credit card payment without leaving my website? | I'm creating an eCommerce website and I was researching on how I can accept credit cards on my website. I came across a lot of payment gateways but they do the processing on their website and I don't want my visitors to leave my URL. How can I achieve this? Thanks. | e-commerce | payment-gateway | payment | null | null | 07/20/2012 12:32:31 | not a real question | How can I accept credit card payment without leaving my website?
===
I'm creating an eCommerce website and I was researching on how I can accept credit cards on my website. I came across a lot of payment gateways but they do the processing on their website and I don't want my visitors to leave my URL. How can I achieve this? Thanks. | 1 |
10,940,496 | 06/07/2012 22:01:21 | 502,404 | 11/09/2010 20:44:38 | 100 | 9 | How can I create a hidden file with php without using the sistem() or exec(), on windows |
Im using windows and I want to hide or create a file with php.
How can i do it, thenks... | php | filesystems | null | null | null | 06/07/2012 23:12:22 | not a real question | How can I create a hidden file with php without using the sistem() or exec(), on windows
===
Im using windows and I want to hide or create a file with php.
How can i do it, thenks... | 1 |
9,086,993 | 01/31/2012 21:09:33 | 353,305 | 05/28/2010 22:30:42 | 1 | 0 | Unable to find an entry point named 'AxSquare' in DLL 'C:\PracProj\Maths\Maths\bin\Release\Maths.dll' | Before you make a comment saying its a redundant question, please allow me to put up the details:
Situation:
Though I know VB, I never get a chance to create a DLL with the help of Visual Studio 2010 using VB
Steps tried:
- Launch VS 2010 and created a Project by selecting "VB Class library
(.dll)"
- Created a Class [say Maths.vb] with following code:
Namespace Maths
Public Class Maths
Public Const DLL_PROCESS_DETACH = 0
Public Const DLL_PROCESS_ATTACH = 1
Public Const DLL_THREAD_ATTACH = 2
Public Const DLL_THREAD_DETACH = 3
Public Function DllMain(ByVal hInst As Long, ByVal fdwReason As Long,
ByVal lpvReserved As Long) As Boolean
MsgBox("A")
Select Case fdwReason
Case DLL_PROCESS_DETACH
' No per-process cleanup needed
Case DLL_PROCESS_ATTACH
MsgBox("A")
DllMain = True
Case DLL_THREAD_ATTACH
' No per-thread initialization needed
Case DLL_THREAD_DETACH
' No per-thread cleanup needed
' Case Else
' DllMain = False
End Select
End Function
Public Function AxIncrement(ByVal var As Integer) As Integer
If Not IsNumeric(var) Then Err.Raise(5)
AxIncrement = var + 1
End Function
Public Function AxDecrement(ByVal var As Integer) As Integer
If Not IsNumeric(var) Then Err.Raise(5)
AxDecrement = var - 1
End Function
Public Function AxSquare(ByVal var As Long) As Long
If Not IsNumeric(var) Then Err.Raise(5)
AxSquare = var ^ 2
End Function
End Class
End Namespace
- Do Right Click on Project and Create a Build >> This step will give
you a dll created Maths.dll
- Now Close the Project and create a New Project Say StandardEXE
- Create a Form [say Form1.vb] with three buttons and put the following
code by clicking View Code:
Pulic Class Form1
Dim incr As Integer
Dim decr As Integer
Dim sqr As Long
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
incr = 1
decr = 100
sqr = 2
End Sub
Private Sub cmdSquare_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSquare.Click
sqr = AxSquare(sqr)
cmdSquare.Text = "x = " & CStr(sqr)
End Sub
Private Sub cmdIncrement_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdIncrement.Click
incr = Increment(incr)
cmdIncrement.Text = "x = " & CStr(incr)
End Sub
Private Sub cmdDecrement_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdDecrement.Click
decr = Increment(decr)
cmdDecrement.Text = "x = " & CStr(decr)
End Sub
End Class
- Right Click on Project and Select Add >> Module1.vb . Paste the below
code:
Module Module1
Public Declare Function Increment Lib "C:\PracProj\Maths\Maths\bin\Release\Maths.dll" (ByVal var As Integer) As Integer
Public Declare Function Decrement Lib "C:\PracProj\Maths\Maths\bin\Release\Maths.dll" (ByVal var As Integer) As Integer
Public Declare Function AxSquare Lib "C:\PracProj\Maths\Maths\bin\Release\Maths.dll" (ByVal var As Long) As Long
Public Declare Function DllMain Lib "C:\PracProj\Maths\Maths\bin\Release\Maths.dll" (ByVal hInst As Long, ByVal fdwReason As Long, ByVal lpvReserved As Long) As Boolean
End Module
>>> Where "C:\PracProj\Maths\Maths\bin\Release\Maths.dll" is the path of previous created DLL
- Now Run the Form1.Vb
You will find the form gets visible and once you click on any of the button you will get the Error saying "**Unable to find an entry point named 'AxSquare' in DLL 'C:\PracProj\Maths\Maths\bin\Release\Maths.dll'.**"
And I tried every thing and not able to solve this.
Please guide me with the missing steps. | visual-studio-2010 | dll | null | null | null | null | open | Unable to find an entry point named 'AxSquare' in DLL 'C:\PracProj\Maths\Maths\bin\Release\Maths.dll'
===
Before you make a comment saying its a redundant question, please allow me to put up the details:
Situation:
Though I know VB, I never get a chance to create a DLL with the help of Visual Studio 2010 using VB
Steps tried:
- Launch VS 2010 and created a Project by selecting "VB Class library
(.dll)"
- Created a Class [say Maths.vb] with following code:
Namespace Maths
Public Class Maths
Public Const DLL_PROCESS_DETACH = 0
Public Const DLL_PROCESS_ATTACH = 1
Public Const DLL_THREAD_ATTACH = 2
Public Const DLL_THREAD_DETACH = 3
Public Function DllMain(ByVal hInst As Long, ByVal fdwReason As Long,
ByVal lpvReserved As Long) As Boolean
MsgBox("A")
Select Case fdwReason
Case DLL_PROCESS_DETACH
' No per-process cleanup needed
Case DLL_PROCESS_ATTACH
MsgBox("A")
DllMain = True
Case DLL_THREAD_ATTACH
' No per-thread initialization needed
Case DLL_THREAD_DETACH
' No per-thread cleanup needed
' Case Else
' DllMain = False
End Select
End Function
Public Function AxIncrement(ByVal var As Integer) As Integer
If Not IsNumeric(var) Then Err.Raise(5)
AxIncrement = var + 1
End Function
Public Function AxDecrement(ByVal var As Integer) As Integer
If Not IsNumeric(var) Then Err.Raise(5)
AxDecrement = var - 1
End Function
Public Function AxSquare(ByVal var As Long) As Long
If Not IsNumeric(var) Then Err.Raise(5)
AxSquare = var ^ 2
End Function
End Class
End Namespace
- Do Right Click on Project and Create a Build >> This step will give
you a dll created Maths.dll
- Now Close the Project and create a New Project Say StandardEXE
- Create a Form [say Form1.vb] with three buttons and put the following
code by clicking View Code:
Pulic Class Form1
Dim incr As Integer
Dim decr As Integer
Dim sqr As Long
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
incr = 1
decr = 100
sqr = 2
End Sub
Private Sub cmdSquare_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSquare.Click
sqr = AxSquare(sqr)
cmdSquare.Text = "x = " & CStr(sqr)
End Sub
Private Sub cmdIncrement_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdIncrement.Click
incr = Increment(incr)
cmdIncrement.Text = "x = " & CStr(incr)
End Sub
Private Sub cmdDecrement_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdDecrement.Click
decr = Increment(decr)
cmdDecrement.Text = "x = " & CStr(decr)
End Sub
End Class
- Right Click on Project and Select Add >> Module1.vb . Paste the below
code:
Module Module1
Public Declare Function Increment Lib "C:\PracProj\Maths\Maths\bin\Release\Maths.dll" (ByVal var As Integer) As Integer
Public Declare Function Decrement Lib "C:\PracProj\Maths\Maths\bin\Release\Maths.dll" (ByVal var As Integer) As Integer
Public Declare Function AxSquare Lib "C:\PracProj\Maths\Maths\bin\Release\Maths.dll" (ByVal var As Long) As Long
Public Declare Function DllMain Lib "C:\PracProj\Maths\Maths\bin\Release\Maths.dll" (ByVal hInst As Long, ByVal fdwReason As Long, ByVal lpvReserved As Long) As Boolean
End Module
>>> Where "C:\PracProj\Maths\Maths\bin\Release\Maths.dll" is the path of previous created DLL
- Now Run the Form1.Vb
You will find the form gets visible and once you click on any of the button you will get the Error saying "**Unable to find an entry point named 'AxSquare' in DLL 'C:\PracProj\Maths\Maths\bin\Release\Maths.dll'.**"
And I tried every thing and not able to solve this.
Please guide me with the missing steps. | 0 |
332,972 | 12/02/2008 03:42:07 | 39,532 | 11/21/2008 01:36:19 | 113 | 8 | Where is the Visual Studio 2008 Crash Log? | I have Visual Studio 2008 with SP1 installed and it is crashing when I'm using lambda expressions in the Moq Framework.
At first I thought the problem was Resharper...but now that I have uninstalled it, VS 2008 still crashes. I'm able to replicate the issue every time.
I'm thinking perhaps it may be some other plugin that is causing the issue rather than VS 2008...but I can't be sure of that.
So what I'm trying to find is where Visual Studio logs the crashes that occur?
Unfortunately I'm unable to find it...does anyone out there know if it exists and if so where to look?
Thanks in advance! | visual-studio-2008 | resharper | plugins | crash | logging | 12/07/2008 22:31:32 | off topic | Where is the Visual Studio 2008 Crash Log?
===
I have Visual Studio 2008 with SP1 installed and it is crashing when I'm using lambda expressions in the Moq Framework.
At first I thought the problem was Resharper...but now that I have uninstalled it, VS 2008 still crashes. I'm able to replicate the issue every time.
I'm thinking perhaps it may be some other plugin that is causing the issue rather than VS 2008...but I can't be sure of that.
So what I'm trying to find is where Visual Studio logs the crashes that occur?
Unfortunately I'm unable to find it...does anyone out there know if it exists and if so where to look?
Thanks in advance! | 2 |
7,401,061 | 09/13/2011 11:25:41 | 927,492 | 09/04/2011 11:38:09 | 10 | 0 | Are on-click java pop-ups a good idea in this modern day and age? | So it seems that a rational solution to the need to provide more information on a certain subject without navigating users away from a page is to use javascript to either reveal a hidden div or create a small pop-up. Java seems to be regarded as something of a risk, with most figures suggesting that 5% of users have JS disabled, and many have dark suspicions that the real number may be much higher due to corporate firewalls blocking JS undetected by the sources of data collection. Furthermore, having a load of hidden divs (which in my case, and I'm sure many others, would need to include some rather large images) would increase page load time a fair bit. But the problem with JS pop-ups seems to be that as well as a certain amount of users having JS disabled, there's a smorgasbord of brutal pop-up blockers out there waiting for the opportunity to spill pop-up blood. After testing the pop-ups at this website: http://www.tizag.com/javascriptT/javascriptpopups.php I found that Firefox, Chrome and IE all let the pop-up load (on my computer at least) - but I haven't had a pop-up blocker other than those that are built into the above browsers installed for years. What I'm wondering is what the good people of stackoverflow feel about the subject - are pop-ups that convey important information playing with fire, and is there a good alternative to JS?
Thanks! | javascript | popup | null | null | null | 09/13/2011 12:20:49 | not constructive | Are on-click java pop-ups a good idea in this modern day and age?
===
So it seems that a rational solution to the need to provide more information on a certain subject without navigating users away from a page is to use javascript to either reveal a hidden div or create a small pop-up. Java seems to be regarded as something of a risk, with most figures suggesting that 5% of users have JS disabled, and many have dark suspicions that the real number may be much higher due to corporate firewalls blocking JS undetected by the sources of data collection. Furthermore, having a load of hidden divs (which in my case, and I'm sure many others, would need to include some rather large images) would increase page load time a fair bit. But the problem with JS pop-ups seems to be that as well as a certain amount of users having JS disabled, there's a smorgasbord of brutal pop-up blockers out there waiting for the opportunity to spill pop-up blood. After testing the pop-ups at this website: http://www.tizag.com/javascriptT/javascriptpopups.php I found that Firefox, Chrome and IE all let the pop-up load (on my computer at least) - but I haven't had a pop-up blocker other than those that are built into the above browsers installed for years. What I'm wondering is what the good people of stackoverflow feel about the subject - are pop-ups that convey important information playing with fire, and is there a good alternative to JS?
Thanks! | 4 |
7,402,829 | 09/13/2011 13:38:47 | 122,229 | 06/12/2009 19:07:38 | 913 | 22 | Does XNA have a BGRA/BGRX surface format? | I have a video stream coming in from the Kinect. It's data is packed in a 32bit BGRX format. I would like to move this data directly into a Texture2d but I cant find a matching SurfaceFormat. The closest thing I can find is SurfaceFormat.Color which looks to be 32bit RGBX.
Assuming that there is not a compatible format. What is the quickest way to convert and push the data to a texture 2d
I was thinking something like this would be good, but it seems to slow down the framerate:
void nui_VideoFrameReady(object sender, ImageFrameReadyEventArgs e)
{
byte a, b, c, d;
for (int i = 0; i < e.ImageFrame.Image.Bits.Length; i += 4)
{
a = e.ImageFrame.Image.Bits[i];
b = e.ImageFrame.Image.Bits[i + 1];
c = e.ImageFrame.Image.Bits[i + 2];
d = e.ImageFrame.Image.Bits[i + 3];
e.ImageFrame.Image.Bits[i] = c;
e.ImageFrame.Image.Bits[i + 1] = b;
e.ImageFrame.Image.Bits[i + 2] = a;
e.ImageFrame.Image.Bits[i + 3] = d;
}
canvas.SetData(e.ImageFrame.Image.Bits);
} | c# | xna4.0 | kinect | null | null | null | open | Does XNA have a BGRA/BGRX surface format?
===
I have a video stream coming in from the Kinect. It's data is packed in a 32bit BGRX format. I would like to move this data directly into a Texture2d but I cant find a matching SurfaceFormat. The closest thing I can find is SurfaceFormat.Color which looks to be 32bit RGBX.
Assuming that there is not a compatible format. What is the quickest way to convert and push the data to a texture 2d
I was thinking something like this would be good, but it seems to slow down the framerate:
void nui_VideoFrameReady(object sender, ImageFrameReadyEventArgs e)
{
byte a, b, c, d;
for (int i = 0; i < e.ImageFrame.Image.Bits.Length; i += 4)
{
a = e.ImageFrame.Image.Bits[i];
b = e.ImageFrame.Image.Bits[i + 1];
c = e.ImageFrame.Image.Bits[i + 2];
d = e.ImageFrame.Image.Bits[i + 3];
e.ImageFrame.Image.Bits[i] = c;
e.ImageFrame.Image.Bits[i + 1] = b;
e.ImageFrame.Image.Bits[i + 2] = a;
e.ImageFrame.Image.Bits[i + 3] = d;
}
canvas.SetData(e.ImageFrame.Image.Bits);
} | 0 |
8,965,647 | 01/22/2012 23:24:18 | 977,121 | 10/03/2011 17:16:32 | 190 | 11 | Rails 3 - Javascript Spinner. Anyone knows one? | I am developing a Rails 3 site.
I need to show a control which is used to define periods of time: Ex. 10 minutes, 20 minutes, 1 hour in the following format: 0:10 , 0:20, 1:00.
The control must have an spinner (up and down arrows to increase or decrease in 10 minutes period).
Anyone knows a good, easy and portable JS spinner to use?
Thanks! | javascript | jquery | ruby | ruby-on-rails-3 | spinner | 01/23/2012 01:27:56 | not constructive | Rails 3 - Javascript Spinner. Anyone knows one?
===
I am developing a Rails 3 site.
I need to show a control which is used to define periods of time: Ex. 10 minutes, 20 minutes, 1 hour in the following format: 0:10 , 0:20, 1:00.
The control must have an spinner (up and down arrows to increase or decrease in 10 minutes period).
Anyone knows a good, easy and portable JS spinner to use?
Thanks! | 4 |
8,455,137 | 12/10/2011 07:31:22 | 1,090,981 | 12/10/2011 07:26:37 | 1 | 0 | Passing byte array from service to activity in android | I have an activity clas in which i am starting the service and want byte array from service back to this service class plzz help me out...
and thanz in advance | android | null | null | null | null | null | open | Passing byte array from service to activity in android
===
I have an activity clas in which i am starting the service and want byte array from service back to this service class plzz help me out...
and thanz in advance | 0 |
10,542,861 | 05/10/2012 22:07:56 | 1,388,203 | 05/10/2012 21:58:55 | 1 | 0 | Advantages and Disadvantages of Apache vs. Your own server? | I have been working on my own ssl based multi process multi file descriptor threaded server for a few weeks now, needless to say it can handle a good amount of punishment. I am writing it in C++ in an object oriented manner and it is nearly finished with signal handling (atomic access included) and exception / errno.h handled.
The goal is to use the server to make multi-player applications and games for Android/iOS. I am actually very close to the completion, but it recently occurred to me that I can just use Apache to accomplish that.
I tried doing some research but couldn't find anything so perhaps someone can help me decide weather I should finish my server and use that or use apache or whatever. What are the advantages and disadvantages of apache vs your own server?
Thank you to those who are willing to participate in this discussion! | apache | ssl | null | null | null | 05/15/2012 12:31:24 | not constructive | Advantages and Disadvantages of Apache vs. Your own server?
===
I have been working on my own ssl based multi process multi file descriptor threaded server for a few weeks now, needless to say it can handle a good amount of punishment. I am writing it in C++ in an object oriented manner and it is nearly finished with signal handling (atomic access included) and exception / errno.h handled.
The goal is to use the server to make multi-player applications and games for Android/iOS. I am actually very close to the completion, but it recently occurred to me that I can just use Apache to accomplish that.
I tried doing some research but couldn't find anything so perhaps someone can help me decide weather I should finish my server and use that or use apache or whatever. What are the advantages and disadvantages of apache vs your own server?
Thank you to those who are willing to participate in this discussion! | 4 |
11,548,553 | 07/18/2012 19:06:04 | 1,499,490 | 07/03/2012 17:11:48 | 11 | 0 | Android:create a android program | >android
how can i create a simple android application
that will capture user details allow them to share the
application on facebook twitter linked in . thank you . | android | null | null | null | null | 07/18/2012 19:08:09 | not a real question | Android:create a android program
===
>android
how can i create a simple android application
that will capture user details allow them to share the
application on facebook twitter linked in . thank you . | 1 |
6,212,041 | 06/02/2011 08:13:43 | 775,157 | 05/29/2011 13:22:17 | 1 | 0 | Direct sending of e-mail without an SMTP server in C# | I'm wondering how to programmatically send an email without an (open relay) SMTP server in C#?
I found this library :
http://mailsystem.codeplex.com/
But the sample code given does not get compiled!
| c# | email | null | null | null | 06/02/2011 08:22:31 | not a real question | Direct sending of e-mail without an SMTP server in C#
===
I'm wondering how to programmatically send an email without an (open relay) SMTP server in C#?
I found this library :
http://mailsystem.codeplex.com/
But the sample code given does not get compiled!
| 1 |
7,565,642 | 09/27/2011 07:34:28 | 881,635 | 08/06/2011 05:19:01 | 429 | 12 | Why i am not able to load Adverticement sometimes? | I have implemented the AdMob to My Application from this Docunemtation: [Here][1]
I can see the Add perfectly as i want. But some times i cant able to see the adverticements. If i refresh the activity, it will show me the Adverticement again. and ita work perfectly.
But when i am not able to see the adverticement at that time i got the message at catlog like:
09-27 12:58:54.451: INFO/Ads(940): onFailedToReceiveAd(Ad request successful, but no ad returned due to lack of ad inventory.)
I dont know Where is the Problem ?
Why i am not able to see the Add sometimes ??
Please give the way if i am wrong regarding it.
Thanks.
[1]: http://code.google.com/mobile/ads/docs/android/fundamentals.html | android | android-layout | android-emulator | android-widget | admob | null | open | Why i am not able to load Adverticement sometimes?
===
I have implemented the AdMob to My Application from this Docunemtation: [Here][1]
I can see the Add perfectly as i want. But some times i cant able to see the adverticements. If i refresh the activity, it will show me the Adverticement again. and ita work perfectly.
But when i am not able to see the adverticement at that time i got the message at catlog like:
09-27 12:58:54.451: INFO/Ads(940): onFailedToReceiveAd(Ad request successful, but no ad returned due to lack of ad inventory.)
I dont know Where is the Problem ?
Why i am not able to see the Add sometimes ??
Please give the way if i am wrong regarding it.
Thanks.
[1]: http://code.google.com/mobile/ads/docs/android/fundamentals.html | 0 |
4,463,674 | 12/16/2010 17:35:42 | 486,578 | 10/25/2010 15:03:02 | 169 | 2 | Scheme vs Common Lisp | Scheme vs Common-Lisp ?
What to choose ? | scheme | common-lisp | null | null | null | 12/16/2010 20:19:15 | not constructive | Scheme vs Common Lisp
===
Scheme vs Common-Lisp ?
What to choose ? | 4 |
8,947,673 | 01/20/2012 20:47:58 | 780,855 | 06/02/2011 09:16:49 | 16 | 0 | how to know raid 5 disk failed, server is in remote | the server is remote, cannot see the disk's LED light.
The Raid Controller is motherboard integrated. 6 disks build a Raid 5. Windows 2003 Server system.
so if one disk failed, how the admin get aware ? | server | raid | raid5 | null | null | 03/09/2012 17:19:22 | off topic | how to know raid 5 disk failed, server is in remote
===
the server is remote, cannot see the disk's LED light.
The Raid Controller is motherboard integrated. 6 disks build a Raid 5. Windows 2003 Server system.
so if one disk failed, how the admin get aware ? | 2 |
2,387,321 | 03/05/2010 14:22:53 | 287,189 | 03/05/2010 14:22:53 | 1 | 0 | "Buzz" around programming decreasing? | This google trends graph is neccessary for my question:
[http://www.google.com/trends?q=...][1]
I think you can try this with every programming language (maybe something like ruby will be a bit misleading because you will actually get stats for the *gem*)
- Why is the buzz around like **all** programming languages decreasing (at least counted in google searches and that does say something)?
- Are there any programming languages rising at the moment?
[1]: http://www.google.com/trends?q=c%23%2C.net%2Cc%2B%2B%2Cphp%2Cjava%2Cpython&ctab=0&geo=all&date=all&sort=0 | google | programming-languages | null | null | null | 03/05/2010 15:39:24 | not a real question | "Buzz" around programming decreasing?
===
This google trends graph is neccessary for my question:
[http://www.google.com/trends?q=...][1]
I think you can try this with every programming language (maybe something like ruby will be a bit misleading because you will actually get stats for the *gem*)
- Why is the buzz around like **all** programming languages decreasing (at least counted in google searches and that does say something)?
- Are there any programming languages rising at the moment?
[1]: http://www.google.com/trends?q=c%23%2C.net%2Cc%2B%2B%2Cphp%2Cjava%2Cpython&ctab=0&geo=all&date=all&sort=0 | 1 |
6,557,552 | 07/02/2011 14:17:19 | 426,133 | 08/20/2010 08:27:54 | 1,283 | 104 | How to disable routing in Symfony2 for certain paths/urls | I would like to call a php file directly from javascript in my SF2 application without routing/controllers.
The reason therefore is, that an external js framework (dhtmlx) has to call "`generate.php`" to produce an excel report. I put the `generate.php` under "`vendors/dhtmlx/generate.php`".
How can I call the generate.php file without a route?
I could implement a route to this file, but then the file is no controller object... | routing | symfony-2.0 | null | null | null | null | open | How to disable routing in Symfony2 for certain paths/urls
===
I would like to call a php file directly from javascript in my SF2 application without routing/controllers.
The reason therefore is, that an external js framework (dhtmlx) has to call "`generate.php`" to produce an excel report. I put the `generate.php` under "`vendors/dhtmlx/generate.php`".
How can I call the generate.php file without a route?
I could implement a route to this file, but then the file is no controller object... | 0 |
3,882,831 | 10/07/2010 14:44:40 | 403,226 | 07/27/2010 09:56:07 | 6 | 0 | Problem of alignment of string in textarea in Flex 3.0 | I need to display a long string in TextArea in the form of two columns. Say 20 character of the string in left side and then some space and then 20 character on right side of TextArea. At next line again i am doing same thing till my string is complete.
But what is happening is like at right column all rows are not alingned exactly. this is happening because each character has different pixel width so alignment of right column depends on character printed on left column. if on left column characters are like 'iiii' then second coumn row starts a bit early in textarea and if on left column, characters are like 'MMMMMM' then second coumn row starts a bit late.
I am using <textFormat> tag for text formatting into this string.
Thanks in advance,
Amit Pathak | flex3 | null | null | null | null | null | open | Problem of alignment of string in textarea in Flex 3.0
===
I need to display a long string in TextArea in the form of two columns. Say 20 character of the string in left side and then some space and then 20 character on right side of TextArea. At next line again i am doing same thing till my string is complete.
But what is happening is like at right column all rows are not alingned exactly. this is happening because each character has different pixel width so alignment of right column depends on character printed on left column. if on left column characters are like 'iiii' then second coumn row starts a bit early in textarea and if on left column, characters are like 'MMMMMM' then second coumn row starts a bit late.
I am using <textFormat> tag for text formatting into this string.
Thanks in advance,
Amit Pathak | 0 |
9,664,619 | 03/12/2012 09:37:07 | 1,263,702 | 03/12/2012 09:09:08 | 1 | 0 | OpenCV CascadeClassifier initialization | I've installed opencv (2.3.1) and now I use it with Qt (SDK 1.1.3, Creator 2.3.0).
(I've used this tutorial: http://www.barbato.us/2011/12/20/opencv-2-3-qtcreator-windows/)
First thing i've tried was HelloWorld example (like the one in Getting Started on the official website), and there were no problems with it. I've also tried some other examples.
Now I've got a problem with example of face recognition. The code itself can be found here: http://www.opencv.org.cn/opencvdoc/2.3.1/html/doc/tutorials/objdetect/cascade_classifier/cascade_classifier.html, but when I try to run it, the program exits with code 0 as if everything was fine, but nothing actually happens. After some hours of trying to solve it I've found that the problem itself is in the CascadeClassifier variable. So if I have any working sample, and then I try to initialize an object of CascadeClassifier class, the program just exits with code 0 on this line.
CascadeClassifier face_cascade;
It also doesn't depend on this variable being global or not. I've also tried to initialize pointer, but the same thing happens on object creation. | c++ | qt | opencv | null | null | 03/13/2012 17:25:08 | too localized | OpenCV CascadeClassifier initialization
===
I've installed opencv (2.3.1) and now I use it with Qt (SDK 1.1.3, Creator 2.3.0).
(I've used this tutorial: http://www.barbato.us/2011/12/20/opencv-2-3-qtcreator-windows/)
First thing i've tried was HelloWorld example (like the one in Getting Started on the official website), and there were no problems with it. I've also tried some other examples.
Now I've got a problem with example of face recognition. The code itself can be found here: http://www.opencv.org.cn/opencvdoc/2.3.1/html/doc/tutorials/objdetect/cascade_classifier/cascade_classifier.html, but when I try to run it, the program exits with code 0 as if everything was fine, but nothing actually happens. After some hours of trying to solve it I've found that the problem itself is in the CascadeClassifier variable. So if I have any working sample, and then I try to initialize an object of CascadeClassifier class, the program just exits with code 0 on this line.
CascadeClassifier face_cascade;
It also doesn't depend on this variable being global or not. I've also tried to initialize pointer, but the same thing happens on object creation. | 3 |
8,566 | 08/12/2008 07:32:32 | 551 | 08/06/2008 16:24:59 | 65 | 4 | Best way to access a control on another form in c#? | First off, this is a question about a desktop app using Windows Forms, not an ASP.Net question.
I need to interact with controls on other forms. Trying to access the controls by using, for example, the following...
otherForm.Controls["nameOfControl"].Visible = false;
...doesn't work the way I would expect. I end up with an exception thrown from `Main`. However, if I make the controls `public` instead of `private`, I can then access them directly, as so...
otherForm.nameOfControl.Visible = false;
But is that the best way to do it? Is making the controls `public` on the other form considered "best practice"? Is there a "better" way to access controls on another form? | windowsforms | c# | controls | bestpractices | null | null | open | Best way to access a control on another form in c#?
===
First off, this is a question about a desktop app using Windows Forms, not an ASP.Net question.
I need to interact with controls on other forms. Trying to access the controls by using, for example, the following...
otherForm.Controls["nameOfControl"].Visible = false;
...doesn't work the way I would expect. I end up with an exception thrown from `Main`. However, if I make the controls `public` instead of `private`, I can then access them directly, as so...
otherForm.nameOfControl.Visible = false;
But is that the best way to do it? Is making the controls `public` on the other form considered "best practice"? Is there a "better" way to access controls on another form? | 0 |
4,378,778 | 12/07/2010 16:08:45 | 197,529 | 10/27/2009 17:43:14 | 21 | 4 | Good C#.NET Solution to manage frequent database polling | I am currently working on a c# .NET desktop application that will be communicating to a database over the internet via WCF and WCF Data Services. There will be many spots in the application that may need to be refreshed upon some interval. The easiest solution would be to just put these areas on a timer and requery the database. However, with thousands of clients connecting to the service layer and hence database, these operations would be very expensive to the server.
What I have considered is creating an RSS feed that is polled by the client, and lets the client know when these particular areas need to be updated. The RSS feed will be managed by a service that either polls the database for changes, or iterates through a list of items that are queued up by the WCF requests made by the client.
I have also considered creating some direct and continuous connection from the client to the server, but I am not sure what outbound firewall ports would be open from the client. I could probably only count on port 80/443.
So my question is what solutions have people had success implementing to solve this problem? Have people done RSS? Microsoft Sync Services? Two way communication between client and server over some save port via WCF?
Any ideas are greatly appreciated. | c# | sql-server | wcf | rss | polling | null | open | Good C#.NET Solution to manage frequent database polling
===
I am currently working on a c# .NET desktop application that will be communicating to a database over the internet via WCF and WCF Data Services. There will be many spots in the application that may need to be refreshed upon some interval. The easiest solution would be to just put these areas on a timer and requery the database. However, with thousands of clients connecting to the service layer and hence database, these operations would be very expensive to the server.
What I have considered is creating an RSS feed that is polled by the client, and lets the client know when these particular areas need to be updated. The RSS feed will be managed by a service that either polls the database for changes, or iterates through a list of items that are queued up by the WCF requests made by the client.
I have also considered creating some direct and continuous connection from the client to the server, but I am not sure what outbound firewall ports would be open from the client. I could probably only count on port 80/443.
So my question is what solutions have people had success implementing to solve this problem? Have people done RSS? Microsoft Sync Services? Two way communication between client and server over some save port via WCF?
Any ideas are greatly appreciated. | 0 |
11,031,841 | 06/14/2012 11:10:16 | 632,055 | 02/24/2011 09:50:46 | 139 | 9 | Analytic tool for API based application | I am developing an application which is based on SAAS and exposing services as API. I would like to develop effective analytic platform for API usage, prediction of usage and cost estimation etc. Is there any analytic service which I can leverage like Google Analytic? | api | google-analytics | analytics | google-analytics-api | null | null | open | Analytic tool for API based application
===
I am developing an application which is based on SAAS and exposing services as API. I would like to develop effective analytic platform for API usage, prediction of usage and cost estimation etc. Is there any analytic service which I can leverage like Google Analytic? | 0 |
8,827,097 | 01/11/2012 21:43:29 | 287,592 | 03/06/2010 04:41:11 | 639 | 5 | Sed inside bash script not working: But it works on command line | I have tried the following on the command line and they work, but when I place them in a bash script I get an error (see below):
sed -e "s/INSERT_ME_HERE/"${ROOT_BUILD_HOME}"/g" ./Doxyfile > ./tmp && mv ./tmp ./Doxyfile
sed -e "s/INSERT_ME_HERE/'${ROOT_BUILD_HOME}'/g" ./Doxyfile > ./tmp && mv ./tmp ./Doxyfile
sed -e "s/INSERT_ME_HERE/`echo ${ROOT_BUILD_HOME}`/g" ./Doxyfile > ./tmp && mv ./tmp ./Doxyfile
The error I am getting is:
sed: -e expression #1, char 19: unknown option to `s'
However like I said I am using it from the command line and it works:
[mehoggan@hogganz400 Doxygen]$ ROOT_BUILD_HOME=MONKEY; sed -e "s/INSERT_ME_HERE/`echo ${ROOT_BUILD_HOME}`/g" ./Doxyfile | grep MONKEY
INPUT = MONKEY
Why does it work under one case and not the other?
Also `ROOT_BUILD_HOME` is set, I echo it right before the sed expression within the shell script.
echo `date`: "Going to run doxygen on source and move to ${ROOT_BUILD_HOME}";
| bash | scripting | sed | null | null | null | open | Sed inside bash script not working: But it works on command line
===
I have tried the following on the command line and they work, but when I place them in a bash script I get an error (see below):
sed -e "s/INSERT_ME_HERE/"${ROOT_BUILD_HOME}"/g" ./Doxyfile > ./tmp && mv ./tmp ./Doxyfile
sed -e "s/INSERT_ME_HERE/'${ROOT_BUILD_HOME}'/g" ./Doxyfile > ./tmp && mv ./tmp ./Doxyfile
sed -e "s/INSERT_ME_HERE/`echo ${ROOT_BUILD_HOME}`/g" ./Doxyfile > ./tmp && mv ./tmp ./Doxyfile
The error I am getting is:
sed: -e expression #1, char 19: unknown option to `s'
However like I said I am using it from the command line and it works:
[mehoggan@hogganz400 Doxygen]$ ROOT_BUILD_HOME=MONKEY; sed -e "s/INSERT_ME_HERE/`echo ${ROOT_BUILD_HOME}`/g" ./Doxyfile | grep MONKEY
INPUT = MONKEY
Why does it work under one case and not the other?
Also `ROOT_BUILD_HOME` is set, I echo it right before the sed expression within the shell script.
echo `date`: "Going to run doxygen on source and move to ${ROOT_BUILD_HOME}";
| 0 |
7,102,989 | 08/18/2011 05:53:02 | 10,247 | 09/15/2008 21:54:44 | 1,131 | 44 | What does 0x80020101 represent? | A simple question that I can't find an answer for in Microsoft's error lookup or easily using google: what does the HRESULT 0x80020101 represent? | hr | null | null | null | null | null | open | What does 0x80020101 represent?
===
A simple question that I can't find an answer for in Microsoft's error lookup or easily using google: what does the HRESULT 0x80020101 represent? | 0 |
96,815 | 09/18/2008 20:51:28 | 92 | 08/01/2008 17:55:41 | 7,499 | 61 | What are the best books for SOAP webservices? | My team is about to build a new product and we are using SOAP webservices as the interface between the client and server. There are other book posts on stackoverflow, but I couldn't find one that matched my needs.
My manager will be purchasing books for our team to use as a resource so...
What are the best books about SOAP webservices?
(Please list each book suggestion in a separate answer) | books | soap | webservices | null | null | 09/30/2011 14:47:31 | not constructive | What are the best books for SOAP webservices?
===
My team is about to build a new product and we are using SOAP webservices as the interface between the client and server. There are other book posts on stackoverflow, but I couldn't find one that matched my needs.
My manager will be purchasing books for our team to use as a resource so...
What are the best books about SOAP webservices?
(Please list each book suggestion in a separate answer) | 4 |
11,207,352 | 06/26/2012 12:29:07 | 1,482,702 | 06/26/2012 12:26:08 | 1 | 0 | Export data from Serena Agile Planner | How can I export/extract data from SAP like Backlog, sprints (features, stories, tasks,..)
Thanks in advance | serena | null | null | null | null | null | open | Export data from Serena Agile Planner
===
How can I export/extract data from SAP like Backlog, sprints (features, stories, tasks,..)
Thanks in advance | 0 |
7,657,100 | 10/05/2011 05:36:50 | 725,619 | 03/16/2011 21:05:59 | 67 | 0 | Passing ModelAttribute across multiple requests in Spring MVC | I have a multiple criteria search form with a command attribute. On the first submit, results are obtained based on the options in command object. On the results page, there is a link to export all the results to excel.. I have implemented it using the XMLViewResolver. I need to pass the SearchForm model attribute to the controller that handles this export requests. Also, from search results page, user can click on a person's profile and can come back to search results again. I want to keep this Model Attributes in session across all these requests. How would I achieve that in Spring MVC? @SessionAttributes is probably not an option because, as I understand, once the request goes to different controller, this object is flushed. | session | spring-mvc | null | null | null | null | open | Passing ModelAttribute across multiple requests in Spring MVC
===
I have a multiple criteria search form with a command attribute. On the first submit, results are obtained based on the options in command object. On the results page, there is a link to export all the results to excel.. I have implemented it using the XMLViewResolver. I need to pass the SearchForm model attribute to the controller that handles this export requests. Also, from search results page, user can click on a person's profile and can come back to search results again. I want to keep this Model Attributes in session across all these requests. How would I achieve that in Spring MVC? @SessionAttributes is probably not an option because, as I understand, once the request goes to different controller, this object is flushed. | 0 |
767,212 | 04/20/2009 07:11:05 | 15,055 | 09/17/2008 05:31:28 | 5,671 | 195 | Programattically taking screenshots in windows without the application noticing | There are various ways to take screenshots of a running application in Windows. However, I hear that an application can be tailored such that it can notice when a screenshot is being taken of it, through some windows event handlers perhaps? Is there any way of taking a screenshot such that it is impossible for the application to notice? (Maybe even running the application inside a VM, and taking a screenshot from the host?) I'd prefer solutions in Python, but anything will do. | python | screenshot | operating-system | windows | events | null | open | Programattically taking screenshots in windows without the application noticing
===
There are various ways to take screenshots of a running application in Windows. However, I hear that an application can be tailored such that it can notice when a screenshot is being taken of it, through some windows event handlers perhaps? Is there any way of taking a screenshot such that it is impossible for the application to notice? (Maybe even running the application inside a VM, and taking a screenshot from the host?) I'd prefer solutions in Python, but anything will do. | 0 |
275,098 | 11/08/2008 19:47:13 | 4,227 | 09/02/2008 13:08:22 | 174 | 7 | What applications could I study to understand (Data)Model-View-ViewModel? | I understand the basics of the Model-View-ViewModel pattern or as Dan Crevier calls it the [DataModel-View-ViewModel][1] pattern and I understand that it is a good approach to design WPF based applications. But there are still some open question. For example:
Where do I put my business logic where my validation logic?
How do I decouple the Database (in a way that the underlying storage solution can easily be exchanged) from the Model but still be able to do complex datamining?
How do I design the ViewModel that it can observe statechanges in the Model?
Do you know of any applications that use this pattern that I could study for evaluate differnet approaches? Preferably ones where the sourcecode is available?
Or maybe you even know of articles, books, blogs, websites that go a bit more into detail?
[1]: http://blogs.msdn.com/dancre/archive/2006/10/11/datamodel-view-viewmodel-pattern-series.aspx | model-view-viewmodel | wpf | .net | design-patterns | null | 11/18/2011 12:07:59 | not constructive | What applications could I study to understand (Data)Model-View-ViewModel?
===
I understand the basics of the Model-View-ViewModel pattern or as Dan Crevier calls it the [DataModel-View-ViewModel][1] pattern and I understand that it is a good approach to design WPF based applications. But there are still some open question. For example:
Where do I put my business logic where my validation logic?
How do I decouple the Database (in a way that the underlying storage solution can easily be exchanged) from the Model but still be able to do complex datamining?
How do I design the ViewModel that it can observe statechanges in the Model?
Do you know of any applications that use this pattern that I could study for evaluate differnet approaches? Preferably ones where the sourcecode is available?
Or maybe you even know of articles, books, blogs, websites that go a bit more into detail?
[1]: http://blogs.msdn.com/dancre/archive/2006/10/11/datamodel-view-viewmodel-pattern-series.aspx | 4 |
4,391,615 | 12/08/2010 19:49:06 | 535,497 | 12/08/2010 19:39:47 | 1 | 0 | iPhone - Parsing XML file - Please help!! | I need help with parsing a xml file. My problem is I don't know how to implement the didEndElement delegate.
What I want is that I will have 2 cells where Old Testament and New Testament will be displayed and then the Books of the Bible and the the chapters.
If I can just get some help with the xml parsing the rest I can manage.
Will be very grateful for any help!
Thanks and regards!
My xml file is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<bible>
<testament name="Old Testament">
<book name="Genesis">
<chapter id="Genesis 1"></chapter>
<chapter id="Genesis 2"></chapter>
</book>
<book name="Exodus">
<chapter id="Exodus 1"></chapter>
<chapter id="Exodus 2"></chapter>
</book>
</testament>
<testament name="New Testament">
<book name="Matthew">
<chapter id="Matthew 1"></chapter>
<chapter id="Matthew 2"></chapter>
</book>
<book name="Revelation">
<chapter id="Revelation 1"></chapter>
<chapter id="Revelation 2"></chapter>
</book>
</testament>
</bible>
-------------------------------------------------------------------
// Bible.h
#import <Foundation/Foundation.h>
@interface Bible : NSObject {
NSMutableArray *bible;
NSMutableArray *testament;
NSMutableArray *book;
NSString *chapterID;
}
@property (nonatomic, retain)NSMutableArray *bible;
@property (nonatomic, retain)NSMutableArray *testament;
@property (nonatomic, retain)NSMutableArray *book;
@property (nonatomic, retain)NSString *chapterID;
@end
------------------------------------------------------------------------
// Bible.m
#import "Bible.h"
@implementation Bible
@synthesize bible;
@synthesize testament;
@synthesize book;
@synthesize chapterID;
- (void) dealloc {
[bible release];
[testament release];
[book release];
[chapterID release];
[super dealloc];
}
@end
-----------------------------------------------------------------
//
// XMLParser.h
// BibleXML
//
#import <Foundation/Foundation.h>
#import "Bible.h"
@protocol NSXMLParserDelegate;
@class BibleXMLAppDelegate, Bible;
@interface XMLParser : NSObject <NSXMLParserDelegate> {
NSMutableString *currentElementValue;
BibleXMLAppDelegate *appDelegate;
Bible *theBible;
}
- (XMLParser *) initXMLParser;
@end
-------------------------------------------------------------------------
//
// XMLParser.m
#import "XMLParser.h"
#import "BibleXMLAppDelegate.h"
#import "Bible.h"
@implementation XMLParser
- (XMLParser *) initXMLParser {
[super init];
appDelegate = (BibleXMLAppDelegate *) [[UIApplication sharedApplication] delegate];
return self;
}
- (void)parserDidStartDocument:(NSXMLParser *)parser{
NSLog(@"found file and started parsing");
}
- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName
namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName
attributes:(NSDictionary *)attributeDict {
if([elementName isEqualToString:@"bible"]) {
NSLog(@"Found element: %@", elementName);
appDelegate.bible = [[NSMutableArray alloc] init];
}
else if([elementName isEqualToString:@"testament"]) {
theBible = [[Bible alloc] init];
//Extract the attribute here.
theBible.testament = [attributeDict valueForKey:@"name"];
NSLog(@"Testament: %@", theBible.testament);
return;
}
else if ([elementName isEqualToString:@"book"])
{
theBible.book = [attributeDict valueForKey:@"name"];
NSLog(@"Book: %@", theBible.book);
return;
}
else if([elementName isEqualToString:@"chapter"])
{
theBible.chapterID =[attributeDict objectForKey:@"id"];
NSLog(@"Chapter: %@", theBible.chapterID);
return;
}
}
- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string {
}
- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName
namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName {
if([elementName isEqualToString:@"bible"]){
return;
}
}
- (void) dealloc {
[theBible release];
[currentElementValue release];
[super dealloc];
}
@end
------------------------------------------------------------------
Following is the output from the debugger console:
2010-12-08 19:53:10.101 BibleXML[25641:207] found file and started parsing
2010-12-08 19:53:10.102 BibleXML[25641:207] Found element: bible
2010-12-08 19:53:10.103 BibleXML[25641:207] Testament: Old Testament
2010-12-08 19:53:10.103 BibleXML[25641:207] Book: Genesis
2010-12-08 19:53:10.104 BibleXML[25641:207] Chapter: Genesis 1
2010-12-08 19:53:10.104 BibleXML[25641:207] Chapter: Genesis 2
2010-12-08 19:53:10.105 BibleXML[25641:207] Book: Exodus
2010-12-08 19:53:10.105 BibleXML[25641:207] Chapter: Exodus 1
2010-12-08 19:53:10.106 BibleXML[25641:207] Chapter: Exodus 2
2010-12-08 19:53:10.107 BibleXML[25641:207] Testament: New Testament
2010-12-08 19:53:10.107 BibleXML[25641:207] Book: Matthew
2010-12-08 19:53:10.108 BibleXML[25641:207] Chapter: Matthew 1
2010-12-08 19:53:10.108 BibleXML[25641:207] Chapter: Matthew 2
2010-12-08 19:53:10.109 BibleXML[25641:207] Book: Revelation
2010-12-08 19:53:10.109 BibleXML[25641:207] Chapter: Revelation 1
2010-12-08 19:53:10.110 BibleXML[25641:207] Chapter: Revelation 2
2010-12-08 19:53:10.110 BibleXML[25641:207] No Errors
| iphone | xml | uitableview | nsxmlparser | null | null | open | iPhone - Parsing XML file - Please help!!
===
I need help with parsing a xml file. My problem is I don't know how to implement the didEndElement delegate.
What I want is that I will have 2 cells where Old Testament and New Testament will be displayed and then the Books of the Bible and the the chapters.
If I can just get some help with the xml parsing the rest I can manage.
Will be very grateful for any help!
Thanks and regards!
My xml file is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<bible>
<testament name="Old Testament">
<book name="Genesis">
<chapter id="Genesis 1"></chapter>
<chapter id="Genesis 2"></chapter>
</book>
<book name="Exodus">
<chapter id="Exodus 1"></chapter>
<chapter id="Exodus 2"></chapter>
</book>
</testament>
<testament name="New Testament">
<book name="Matthew">
<chapter id="Matthew 1"></chapter>
<chapter id="Matthew 2"></chapter>
</book>
<book name="Revelation">
<chapter id="Revelation 1"></chapter>
<chapter id="Revelation 2"></chapter>
</book>
</testament>
</bible>
-------------------------------------------------------------------
// Bible.h
#import <Foundation/Foundation.h>
@interface Bible : NSObject {
NSMutableArray *bible;
NSMutableArray *testament;
NSMutableArray *book;
NSString *chapterID;
}
@property (nonatomic, retain)NSMutableArray *bible;
@property (nonatomic, retain)NSMutableArray *testament;
@property (nonatomic, retain)NSMutableArray *book;
@property (nonatomic, retain)NSString *chapterID;
@end
------------------------------------------------------------------------
// Bible.m
#import "Bible.h"
@implementation Bible
@synthesize bible;
@synthesize testament;
@synthesize book;
@synthesize chapterID;
- (void) dealloc {
[bible release];
[testament release];
[book release];
[chapterID release];
[super dealloc];
}
@end
-----------------------------------------------------------------
//
// XMLParser.h
// BibleXML
//
#import <Foundation/Foundation.h>
#import "Bible.h"
@protocol NSXMLParserDelegate;
@class BibleXMLAppDelegate, Bible;
@interface XMLParser : NSObject <NSXMLParserDelegate> {
NSMutableString *currentElementValue;
BibleXMLAppDelegate *appDelegate;
Bible *theBible;
}
- (XMLParser *) initXMLParser;
@end
-------------------------------------------------------------------------
//
// XMLParser.m
#import "XMLParser.h"
#import "BibleXMLAppDelegate.h"
#import "Bible.h"
@implementation XMLParser
- (XMLParser *) initXMLParser {
[super init];
appDelegate = (BibleXMLAppDelegate *) [[UIApplication sharedApplication] delegate];
return self;
}
- (void)parserDidStartDocument:(NSXMLParser *)parser{
NSLog(@"found file and started parsing");
}
- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName
namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName
attributes:(NSDictionary *)attributeDict {
if([elementName isEqualToString:@"bible"]) {
NSLog(@"Found element: %@", elementName);
appDelegate.bible = [[NSMutableArray alloc] init];
}
else if([elementName isEqualToString:@"testament"]) {
theBible = [[Bible alloc] init];
//Extract the attribute here.
theBible.testament = [attributeDict valueForKey:@"name"];
NSLog(@"Testament: %@", theBible.testament);
return;
}
else if ([elementName isEqualToString:@"book"])
{
theBible.book = [attributeDict valueForKey:@"name"];
NSLog(@"Book: %@", theBible.book);
return;
}
else if([elementName isEqualToString:@"chapter"])
{
theBible.chapterID =[attributeDict objectForKey:@"id"];
NSLog(@"Chapter: %@", theBible.chapterID);
return;
}
}
- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string {
}
- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName
namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName {
if([elementName isEqualToString:@"bible"]){
return;
}
}
- (void) dealloc {
[theBible release];
[currentElementValue release];
[super dealloc];
}
@end
------------------------------------------------------------------
Following is the output from the debugger console:
2010-12-08 19:53:10.101 BibleXML[25641:207] found file and started parsing
2010-12-08 19:53:10.102 BibleXML[25641:207] Found element: bible
2010-12-08 19:53:10.103 BibleXML[25641:207] Testament: Old Testament
2010-12-08 19:53:10.103 BibleXML[25641:207] Book: Genesis
2010-12-08 19:53:10.104 BibleXML[25641:207] Chapter: Genesis 1
2010-12-08 19:53:10.104 BibleXML[25641:207] Chapter: Genesis 2
2010-12-08 19:53:10.105 BibleXML[25641:207] Book: Exodus
2010-12-08 19:53:10.105 BibleXML[25641:207] Chapter: Exodus 1
2010-12-08 19:53:10.106 BibleXML[25641:207] Chapter: Exodus 2
2010-12-08 19:53:10.107 BibleXML[25641:207] Testament: New Testament
2010-12-08 19:53:10.107 BibleXML[25641:207] Book: Matthew
2010-12-08 19:53:10.108 BibleXML[25641:207] Chapter: Matthew 1
2010-12-08 19:53:10.108 BibleXML[25641:207] Chapter: Matthew 2
2010-12-08 19:53:10.109 BibleXML[25641:207] Book: Revelation
2010-12-08 19:53:10.109 BibleXML[25641:207] Chapter: Revelation 1
2010-12-08 19:53:10.110 BibleXML[25641:207] Chapter: Revelation 2
2010-12-08 19:53:10.110 BibleXML[25641:207] No Errors
| 0 |
10,089,345 | 04/10/2012 13:03:25 | 597,858 | 02/01/2011 04:28:34 | 494 | 12 | any alternate algorithm in C | The question is to write a program that takes an integer keyed in from the terminal and extracts and displays each digit of the integer in English. so, if a user types 932, the program should display 'nine three two'..
My algorithm is to reverse the number first so that 932 becomes 239. now I extract the last digit using mod operator and print. divide the number by 10. extract the last digit again and so on...
Is there any other alogirthm (shorter and efficient) possible?
it is possible to extract the last digit of an integer. Is it possible to extract the first digit and so on? | c | algorithm | null | null | null | null | open | any alternate algorithm in C
===
The question is to write a program that takes an integer keyed in from the terminal and extracts and displays each digit of the integer in English. so, if a user types 932, the program should display 'nine three two'..
My algorithm is to reverse the number first so that 932 becomes 239. now I extract the last digit using mod operator and print. divide the number by 10. extract the last digit again and so on...
Is there any other alogirthm (shorter and efficient) possible?
it is possible to extract the last digit of an integer. Is it possible to extract the first digit and so on? | 0 |
10,935,187 | 06/07/2012 15:42:20 | 77,047 | 03/12/2009 04:38:30 | 2,579 | 89 | Dynamic allocation in uClinux | I'm new to embedded development, and the big differences I see between traditional Linux and uClinux is that uClinux lacks the MMU.
From [this article][1]:
> Without VM, each process must be located at a place in memory where it can be run. In the simplest case, this area of memory must be contiguous. Generally, it cannot be expanded as there may be other processes above and below it. This means that a process in uClinux cannot increase the size of its available memory at runtime as a traditional Linux process would.
To me, this sounds like all data must reside on the stack, and that heap allocation is impossible, meaning malloc() and/or "new" are out of the question... is that accurate? Perhaps there are techniques/libraries which allow for managing a "static heap" (i.e. a stack based area from which "dynamic" allocations can be requested)?
Or am I over thinking it? Or over simplifying it?
[1]: http://www.linuxjournal.com/article/7221 | c++ | c | virtual-memory | uclinux | mmu | null | open | Dynamic allocation in uClinux
===
I'm new to embedded development, and the big differences I see between traditional Linux and uClinux is that uClinux lacks the MMU.
From [this article][1]:
> Without VM, each process must be located at a place in memory where it can be run. In the simplest case, this area of memory must be contiguous. Generally, it cannot be expanded as there may be other processes above and below it. This means that a process in uClinux cannot increase the size of its available memory at runtime as a traditional Linux process would.
To me, this sounds like all data must reside on the stack, and that heap allocation is impossible, meaning malloc() and/or "new" are out of the question... is that accurate? Perhaps there are techniques/libraries which allow for managing a "static heap" (i.e. a stack based area from which "dynamic" allocations can be requested)?
Or am I over thinking it? Or over simplifying it?
[1]: http://www.linuxjournal.com/article/7221 | 0 |
5,512,551 | 04/01/2011 11:10:07 | 631,786 | 02/24/2011 06:27:15 | 22 | 0 | how to make pattern for grep command on linux? | I hav to grep a file whos content is as follw:
=====================
<wekobj>
<name>bla bla bla</name>
<wekobject>
<strongobj>
<name>this is not requred</name>
</strongobj>
===============
i need to get "bla bla bla" from each wekobj tag.. i am using this in c++ program. i just have to define a pattern that mathes "<wekobj>
<name>" atg thank in advance.
| c++ | linux | null | null | null | 04/01/2011 11:30:23 | not a real question | how to make pattern for grep command on linux?
===
I hav to grep a file whos content is as follw:
=====================
<wekobj>
<name>bla bla bla</name>
<wekobject>
<strongobj>
<name>this is not requred</name>
</strongobj>
===============
i need to get "bla bla bla" from each wekobj tag.. i am using this in c++ program. i just have to define a pattern that mathes "<wekobj>
<name>" atg thank in advance.
| 1 |
6,849,745 | 07/27/2011 19:00:20 | 860,926 | 07/25/2011 05:02:33 | 1 | 0 | is ZendX_JQuery shutdown in zend 2 | i downloaded zend 2 dev3 but it is missing ZendX_JQuery, is development team going to shutdown ZendX_JQuery in zend2 ? | zend-framework | zendx | null | null | null | 07/28/2011 20:34:40 | off topic | is ZendX_JQuery shutdown in zend 2
===
i downloaded zend 2 dev3 but it is missing ZendX_JQuery, is development team going to shutdown ZendX_JQuery in zend2 ? | 2 |
3,619,682 | 09/01/2010 15:26:37 | 240,337 | 12/29/2009 17:17:16 | 551 | 4 | java.lang.NullPointerException, when i am inside the constructor of a managed bean invoking methods from other beans | When I am inside the constructor of a managed and trying to reach out to other methods from other beans, I got `java.lang.NullPointerException`. Is there some kind of specification that not allow managed bean to do that?
@ManagedProperty(value="#{document}")
private DisplayListController document;
@EJB
DocumentSBean sBean;
public NewUserController() {
document.list();
}
Above I just do regular bean injection, nothing fancy. `document` is a `SessionScoped` managed bean that has method `list()` which just return a `String`. `NewUserController` is a `RequestScoped` managed bean. | java | jsf | java-ee | managed-bean | null | null | open | java.lang.NullPointerException, when i am inside the constructor of a managed bean invoking methods from other beans
===
When I am inside the constructor of a managed and trying to reach out to other methods from other beans, I got `java.lang.NullPointerException`. Is there some kind of specification that not allow managed bean to do that?
@ManagedProperty(value="#{document}")
private DisplayListController document;
@EJB
DocumentSBean sBean;
public NewUserController() {
document.list();
}
Above I just do regular bean injection, nothing fancy. `document` is a `SessionScoped` managed bean that has method `list()` which just return a `String`. `NewUserController` is a `RequestScoped` managed bean. | 0 |
10,441,124 | 05/04/2012 00:21:05 | 1,373,852 | 05/04/2012 00:10:12 | 1 | 0 | Invalid object name 'ctd_priority_db'? | I need help with inserting data to a database ? Gives an error Invalid object name 'ctd_priority_db' ?
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection myConn = new SqlConnection("server =10.12.24.143; uid = xxxxxx ; pwd = xxxxx; database = ctd_priority_db;");
myConn.Open();
string pname = TextTwo.Text;
string sqlquery = ("INSERT INTO [ctd_priority_db] (Name) VALUES (' " + TextTwo.Text + "')");
SqlCommand myCom = new SqlCommand(sqlquery, myConn);
myCom.Parameters.AddWithValue("Name ", pname);
myCom.ExecuteNonQuery();
}
| sql | database | visual-studio | connection | null | 05/09/2012 11:48:13 | too localized | Invalid object name 'ctd_priority_db'?
===
I need help with inserting data to a database ? Gives an error Invalid object name 'ctd_priority_db' ?
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection myConn = new SqlConnection("server =10.12.24.143; uid = xxxxxx ; pwd = xxxxx; database = ctd_priority_db;");
myConn.Open();
string pname = TextTwo.Text;
string sqlquery = ("INSERT INTO [ctd_priority_db] (Name) VALUES (' " + TextTwo.Text + "')");
SqlCommand myCom = new SqlCommand(sqlquery, myConn);
myCom.Parameters.AddWithValue("Name ", pname);
myCom.ExecuteNonQuery();
}
| 3 |
5,674,003 | 04/15/2011 08:09:03 | 710,159 | 04/14/2011 02:03:17 | 1 | 0 | what to do in a situation when a class doesn’t implement a method from a protocol | what to do in a situation when a class doesn’t implement a method from a protocol | iphone | objective-c | null | null | null | 04/15/2011 13:31:58 | not a real question | what to do in a situation when a class doesn’t implement a method from a protocol
===
what to do in a situation when a class doesn’t implement a method from a protocol | 1 |
6,180,042 | 05/30/2011 19:26:50 | 776,697 | 05/30/2011 19:26:50 | 1 | 0 | Fundamental difference between Generic Principal and Forms Authentication in context of ASP.NET? | what exactly is the difference between Forms Authentication and Generic Principal? If I use Forms Authentication in ASP.NET, what advantage would I have by implementing the Generic Principal as well as Generic Identity over not implementing these? This is assuming that they are 2 different approaches to the same thing.
However, if they are not 2 different approaches to the same thing, then what exactly does Generic Principal provide for us that Forms Authentication alone does not?
I have searched high and low on this but unable to get a definite answer.
Thanks | asp.net | forms | generics | authentication | principal | null | open | Fundamental difference between Generic Principal and Forms Authentication in context of ASP.NET?
===
what exactly is the difference between Forms Authentication and Generic Principal? If I use Forms Authentication in ASP.NET, what advantage would I have by implementing the Generic Principal as well as Generic Identity over not implementing these? This is assuming that they are 2 different approaches to the same thing.
However, if they are not 2 different approaches to the same thing, then what exactly does Generic Principal provide for us that Forms Authentication alone does not?
I have searched high and low on this but unable to get a definite answer.
Thanks | 0 |
7,035,624 | 08/12/2011 04:34:34 | 891,125 | 08/12/2011 04:34:34 | 1 | 0 | Removing duplicated word with its contents in perl | i want to remove the duplicated word with its value (which is placed in front of that word).As i am beginner please give some simple code to understand.. | per | null | null | null | null | 08/12/2011 17:35:26 | not a real question | Removing duplicated word with its contents in perl
===
i want to remove the duplicated word with its value (which is placed in front of that word).As i am beginner please give some simple code to understand.. | 1 |
9,552,992 | 03/04/2012 06:51:55 | 1,247,742 | 03/04/2012 05:53:07 | 1 | 0 | How to define custom events and event listeners in Android? | I'm a starter in Android app development, and my experience in Java development is also minimal.
I'm working on a very basic context-aware application and I want to understand how can I notify my activity class of some custom event? (unlike onClick()). So if I have a class which is responsible for monitoring some resource. (For simplicity, let's assume a Timer class which monitors time and notifies the Activity class every hour).
How can my activity class 'subscribe' and listen for such events from the Timer class?
I would really appreciate if you provide some code example and perhaps how event handling works in Android/Java. Thanks for your time and help! | java | android | events | callback | null | null | open | How to define custom events and event listeners in Android?
===
I'm a starter in Android app development, and my experience in Java development is also minimal.
I'm working on a very basic context-aware application and I want to understand how can I notify my activity class of some custom event? (unlike onClick()). So if I have a class which is responsible for monitoring some resource. (For simplicity, let's assume a Timer class which monitors time and notifies the Activity class every hour).
How can my activity class 'subscribe' and listen for such events from the Timer class?
I would really appreciate if you provide some code example and perhaps how event handling works in Android/Java. Thanks for your time and help! | 0 |
9,507,778 | 02/29/2012 22:37:44 | 823,112 | 06/30/2011 13:18:41 | 27 | 0 | what happens in an application server (tomcat etc.) when a client request is cancelled and the server is still working ? (writing on its output) | If a client cancel its request, the application server is suposed to throw the following error :
java.net.SocketException: Connection reset by peer: socket write error
But what is exactly happening ?
Let's say I'm doing a very expensive operation on the server side, and I'm writing some data to the outputstream everytime my server service get a new result (kind of streaming).
In the middle of this operation, the client cancel the request. What happens ?
The operation stops, because the socket throws this error when the connection closed ? If it's not stopped, what happens to the data flushed in the outputstream after that ?
Thanks
| http | request | cancel | null | null | null | open | what happens in an application server (tomcat etc.) when a client request is cancelled and the server is still working ? (writing on its output)
===
If a client cancel its request, the application server is suposed to throw the following error :
java.net.SocketException: Connection reset by peer: socket write error
But what is exactly happening ?
Let's say I'm doing a very expensive operation on the server side, and I'm writing some data to the outputstream everytime my server service get a new result (kind of streaming).
In the middle of this operation, the client cancel the request. What happens ?
The operation stops, because the socket throws this error when the connection closed ? If it's not stopped, what happens to the data flushed in the outputstream after that ?
Thanks
| 0 |
7,455,566 | 09/17/2011 14:45:20 | 950,355 | 09/17/2011 14:45:20 | 1 | 0 | dma programming | I want to write vast amount data to binary file in c++ and I want to do this job using dma(direct memory access) to save my cpu power and time for other processes.
tank you for your help and attention | c++ | performance | writing | dma | null | 09/17/2011 22:13:01 | not a real question | dma programming
===
I want to write vast amount data to binary file in c++ and I want to do this job using dma(direct memory access) to save my cpu power and time for other processes.
tank you for your help and attention | 1 |
2,981,799 | 06/05/2010 19:40:05 | 270,483 | 02/10/2010 17:25:04 | 24 | 1 | Visual Basic WebBrowser tell when done Refreshing | I have a page that refreshes every 20 seconds and I need to know when it is done refreshing, the DocumentCompleted event does not fire when you refresh for some reason. Any ideas? | windows | vb | webbrowser-control | null | null | null | open | Visual Basic WebBrowser tell when done Refreshing
===
I have a page that refreshes every 20 seconds and I need to know when it is done refreshing, the DocumentCompleted event does not fire when you refresh for some reason. Any ideas? | 0 |
10,002,396 | 04/03/2012 22:30:35 | 131,433 | 07/01/2009 01:11:25 | 30,587 | 1,455 | Reversing a commit in svn 1.7.4 | I tried the usual recipe to reverse-merge an unintended commit:
svn merge -rBAD_REV:BAD_REV-1 .
and was perturbed to get, as a response, merely a message about mergeinfo. No actual revert of file content to the previous rev.
I went and did the fix up in another tree where I could use svn 1.6.x, but I ended up wondering: was it doing the right thing and not telling me, or has the recipe changed?
| svn | null | null | null | null | null | open | Reversing a commit in svn 1.7.4
===
I tried the usual recipe to reverse-merge an unintended commit:
svn merge -rBAD_REV:BAD_REV-1 .
and was perturbed to get, as a response, merely a message about mergeinfo. No actual revert of file content to the previous rev.
I went and did the fix up in another tree where I could use svn 1.6.x, but I ended up wondering: was it doing the right thing and not telling me, or has the recipe changed?
| 0 |
10,717,907 | 05/23/2012 10:18:02 | 830,423 | 07/05/2011 20:29:41 | 153 | 0 | PHP string concatination | The next code didn't concat the strings for me, how come ?
$test = $this->address . $this->url;
echo $test results only the contents of $this->address
But the next code this concat the example, works:
$begin = $this->address;
$end = $this->url;
$test = $begin.$end;
echo $test resulted a concatination.
What am I missing? | php | null | null | null | null | 05/23/2012 15:22:03 | not a real question | PHP string concatination
===
The next code didn't concat the strings for me, how come ?
$test = $this->address . $this->url;
echo $test results only the contents of $this->address
But the next code this concat the example, works:
$begin = $this->address;
$end = $this->url;
$test = $begin.$end;
echo $test resulted a concatination.
What am I missing? | 1 |
6,481,993 | 06/26/2011 03:38:05 | 765,409 | 05/23/2011 03:58:39 | 110 | 2 | Debugging ping pong game in Python | I'm tired, and I've tried to run this all day. IT's a game of pong where the ball bounces off the wall and comes into contact with the user's "Slab" or paddle. I've treid to debug for a while, and turns out my iCollide and the iGet_Velocity parts have been causing a lot of issues.
from livewires import games, color
games.init (screen_width = 640, screen_height = 480, fps = 50)
class Ball (games.Sprite):
def update (self):
if self.right>544:
self.dx = -self.dx
if self.top > 11 or self.bottom > 470:
self.dy = -self.dy
if self.left < 0:
self.iLost()
def iLost (self):
games.Message (screen = self.screen,
x = 340,
y = 240,
text = "Game Over",
size = 90,
color = color.red,
lifetime = 250,
after_death = self.screen.quit)
def ihandle_collision (self):
new_dx, new_dy = Slab.iVelocity()
self.dx += self.dx + new_dx #For handling collision, must take velocity of the mouse object and put add it to the velocity of the ball.
self.dy += self.dy + new_dy
class Slab (games.Sprite):
def update (self):
self.x = games.mouse.x
self.y = games.mouse.y
self.iCollide()
def iCollide (self):
for Ball in self.overlapping_sprites:
Ball.ihandle_collision()
def iVelocity (self):
self.get_velocity()
def main():
#Backgrounds
pingpongbackground = games.load_image ("pingpongbackground.jpg", transparent = False)
games.screen.background = pingpongbackground
#Ball: Initializing object and setting speed.
ballimage = games.load_image ("pingpongball.jpg", transparent = True)
theball = Ball (image = ballimage,
x = 320,
y = 240,
dx = 2,
dy = 2)
games.screen.add(theball)
#Paddle: Initializing ping pong object and setting initial poisition to the initial mouse position
slabimage = games.load_image ("pingpongpaddle.jpg", transparent = True)
theslab = Slab (image = slabimage,
x = games.mouse.x,
y = games.mouse.y)
games.screen.add(theslab)
games.mouse.is_visible = False
games.screen.event_grab = True
games.screen.mainloop()
main () | python | pygame | pong | null | null | 06/27/2011 03:03:45 | not a real question | Debugging ping pong game in Python
===
I'm tired, and I've tried to run this all day. IT's a game of pong where the ball bounces off the wall and comes into contact with the user's "Slab" or paddle. I've treid to debug for a while, and turns out my iCollide and the iGet_Velocity parts have been causing a lot of issues.
from livewires import games, color
games.init (screen_width = 640, screen_height = 480, fps = 50)
class Ball (games.Sprite):
def update (self):
if self.right>544:
self.dx = -self.dx
if self.top > 11 or self.bottom > 470:
self.dy = -self.dy
if self.left < 0:
self.iLost()
def iLost (self):
games.Message (screen = self.screen,
x = 340,
y = 240,
text = "Game Over",
size = 90,
color = color.red,
lifetime = 250,
after_death = self.screen.quit)
def ihandle_collision (self):
new_dx, new_dy = Slab.iVelocity()
self.dx += self.dx + new_dx #For handling collision, must take velocity of the mouse object and put add it to the velocity of the ball.
self.dy += self.dy + new_dy
class Slab (games.Sprite):
def update (self):
self.x = games.mouse.x
self.y = games.mouse.y
self.iCollide()
def iCollide (self):
for Ball in self.overlapping_sprites:
Ball.ihandle_collision()
def iVelocity (self):
self.get_velocity()
def main():
#Backgrounds
pingpongbackground = games.load_image ("pingpongbackground.jpg", transparent = False)
games.screen.background = pingpongbackground
#Ball: Initializing object and setting speed.
ballimage = games.load_image ("pingpongball.jpg", transparent = True)
theball = Ball (image = ballimage,
x = 320,
y = 240,
dx = 2,
dy = 2)
games.screen.add(theball)
#Paddle: Initializing ping pong object and setting initial poisition to the initial mouse position
slabimage = games.load_image ("pingpongpaddle.jpg", transparent = True)
theslab = Slab (image = slabimage,
x = games.mouse.x,
y = games.mouse.y)
games.screen.add(theslab)
games.mouse.is_visible = False
games.screen.event_grab = True
games.screen.mainloop()
main () | 1 |
10,820,762 | 05/30/2012 16:54:13 | 963,395 | 09/25/2011 07:49:23 | 23 | 10 | admin panel login in php | I am crating an admin panel login page.. if the username is admin, then it will open the signup page .. if username is not admin then it will open some other page and if user enters wrong password,it shall display "wrong password." i had created the code . but i find some syntax error .. please help me
the coding is working username=admin. and for wrong pasword, but not for any other username
<?php
if(isset($_POST['btnSubmit']) )
{
$val = $Tblsignup->selectpass($_POST['uname'],$_POST['pass']);
if ($val =='1'){
if($_POST['uname'] == 'admin'){
echo "Welcome! Admin Thanks for Login";
redirect("index.php?page=signup");
}
}
else {
echo "Welcome! Thanks for Login";
redirect("index.php?page=grid.php");
}
}
else
{
echo "WRONG USER";
redirect("index.php?page=login.php"); ?>
| php | php5 | cakephp | phpmyadmin | null | 06/04/2012 14:37:49 | not a real question | admin panel login in php
===
I am crating an admin panel login page.. if the username is admin, then it will open the signup page .. if username is not admin then it will open some other page and if user enters wrong password,it shall display "wrong password." i had created the code . but i find some syntax error .. please help me
the coding is working username=admin. and for wrong pasword, but not for any other username
<?php
if(isset($_POST['btnSubmit']) )
{
$val = $Tblsignup->selectpass($_POST['uname'],$_POST['pass']);
if ($val =='1'){
if($_POST['uname'] == 'admin'){
echo "Welcome! Admin Thanks for Login";
redirect("index.php?page=signup");
}
}
else {
echo "Welcome! Thanks for Login";
redirect("index.php?page=grid.php");
}
}
else
{
echo "WRONG USER";
redirect("index.php?page=login.php"); ?>
| 1 |
5,141,518 | 02/28/2011 11:44:34 | 508,127 | 11/15/2010 10:28:18 | 866 | 2 | SQL server table partition year wise | i read few article for table partition in sql server searching google but those was not very understandable for me. so please anyone help me to partition a table year wise. help me with script. | sql | sql-server-2005 | null | null | null | 02/28/2011 13:27:22 | not a real question | SQL server table partition year wise
===
i read few article for table partition in sql server searching google but those was not very understandable for me. so please anyone help me to partition a table year wise. help me with script. | 1 |
9,169,274 | 02/07/2012 00:13:20 | 449,347 | 09/16/2010 10:09:26 | 10 | 0 | Providing documentation to customers regarding applications properties - best approach? | We are developing a fairly complex commercial server / client java application.
We have several property files with lots of properties that an "administrator" may need to tune/edit.
What is best way to communicate what these do - some of the props are complex so it's difficult to make the property name descriptive enough.
Adding comments in the property file seems a bit messy.
Documenting in our install/user guide will add extra over head & lots of hassle?
Any advice? | java | documentation | properties | null | null | 02/10/2012 14:21:47 | not constructive | Providing documentation to customers regarding applications properties - best approach?
===
We are developing a fairly complex commercial server / client java application.
We have several property files with lots of properties that an "administrator" may need to tune/edit.
What is best way to communicate what these do - some of the props are complex so it's difficult to make the property name descriptive enough.
Adding comments in the property file seems a bit messy.
Documenting in our install/user guide will add extra over head & lots of hassle?
Any advice? | 4 |
1,787,447 | 11/24/2009 02:39:11 | 153,409 | 08/09/2009 20:50:47 | 6 | 0 | Best Rails / Android / Appcelearator development OS if have no money to buy a Mac | What operative system do you recommend. Currently I have Vista installed but it isn't developer friendly.
Im doing rails apps and learning Android development an Appcelerator.
Oh, and haven't bundget for a Mac :( | windows | linux | rails | android | null | 07/25/2012 12:27:19 | not constructive | Best Rails / Android / Appcelearator development OS if have no money to buy a Mac
===
What operative system do you recommend. Currently I have Vista installed but it isn't developer friendly.
Im doing rails apps and learning Android development an Appcelerator.
Oh, and haven't bundget for a Mac :( | 4 |
6,469,772 | 06/24/2011 15:09:46 | 648,358 | 03/07/2011 15:14:53 | 754 | 49 | Why do I keep getting this message "The content access permissions need to be rebuilt. Please visit this page" | On every page I get this message. I click on the link and click "rebuild permissions" but I still keep getting this message. | drupal | null | null | null | null | 11/22/2011 03:18:54 | too localized | Why do I keep getting this message "The content access permissions need to be rebuilt. Please visit this page"
===
On every page I get this message. I click on the link and click "rebuild permissions" but I still keep getting this message. | 3 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.