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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9,148,841 |
02/05/2012 11:27:33
| 387,194 |
07/08/2010 21:53:53
| 2,711 | 216 |
Which version of php add anonymous functions
|
In manual there is `create_function` function and you can pass result from that function to `array_map`, I thought that that is the only way to have something like anonymous functions and closures, but then I found that I can just put function like in javascript
array_map(function($a) {
return $a+1;
}, array(1, 2, 3, 4, 5));
In which version of php I can do this? I this was always there?
|
php
|
anonymous-function
| null | null | null | null |
open
|
Which version of php add anonymous functions
===
In manual there is `create_function` function and you can pass result from that function to `array_map`, I thought that that is the only way to have something like anonymous functions and closures, but then I found that I can just put function like in javascript
array_map(function($a) {
return $a+1;
}, array(1, 2, 3, 4, 5));
In which version of php I can do this? I this was always there?
| 0 |
4,144,493 |
11/10/2010 12:34:06
| 503,160 |
11/10/2010 12:07:48
| 1 | 0 |
Creating a private MSMQ queue in a Microsoft Cluster via a script
|
We are migrating to Windows 2008 R2 Standard and will be using a Microsoft Clustering (active-passive) configuration. Our application is heavily dependent on MSMQ private queues and our install creates well over 100 private queues using the following C# code.
MessageQueue.Create(".\private$\myqueue", false);
Since the install is not running inside the context of the cluster, the queues are created on the local node and not in the cluster.
We then tried changing the code to:
MessageQueue.Create("MYCLUSTERNAME\private$\myqueue", false);
However, you can't create private queues on a different server (in this case the cluster server context) and you receive the error "Invalid queue path name".
My two questions are:
1) Is there a way I can run the install in the cluster's context so that when creating a private queue, it would actually be creating the queue in the cluster?
2) If not, what's the best approach on creating queues in the cluster via .NET? I've read some blogs where people create a middle-man Windows service that resides inside the cluster and then their install uses interprocess communication to tell the service which queues to create. That seems like a hack, but is doable if that turns out to be the only approach.
|
msmq
|
cluster-analysis
|
windows-server-2008-r2
| null | null | null |
open
|
Creating a private MSMQ queue in a Microsoft Cluster via a script
===
We are migrating to Windows 2008 R2 Standard and will be using a Microsoft Clustering (active-passive) configuration. Our application is heavily dependent on MSMQ private queues and our install creates well over 100 private queues using the following C# code.
MessageQueue.Create(".\private$\myqueue", false);
Since the install is not running inside the context of the cluster, the queues are created on the local node and not in the cluster.
We then tried changing the code to:
MessageQueue.Create("MYCLUSTERNAME\private$\myqueue", false);
However, you can't create private queues on a different server (in this case the cluster server context) and you receive the error "Invalid queue path name".
My two questions are:
1) Is there a way I can run the install in the cluster's context so that when creating a private queue, it would actually be creating the queue in the cluster?
2) If not, what's the best approach on creating queues in the cluster via .NET? I've read some blogs where people create a middle-man Windows service that resides inside the cluster and then their install uses interprocess communication to tell the service which queues to create. That seems like a hack, but is doable if that turns out to be the only approach.
| 0 |
5,839,608 |
04/30/2011 04:50:02
| 728,356 |
04/28/2011 01:00:21
| 7 | 0 |
unbound prefix error on imageview
|
I made an imageview to include in other layouts and I am getting this error. "Error parsing XML: unbound prefix". Here's the code.
<ImageView android:id="@+id/water"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@drawable/water"
android:scaleType="centerInside" />
|
android
|
imageview
| null | null | null | null |
open
|
unbound prefix error on imageview
===
I made an imageview to include in other layouts and I am getting this error. "Error parsing XML: unbound prefix". Here's the code.
<ImageView android:id="@+id/water"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@drawable/water"
android:scaleType="centerInside" />
| 0 |
9,964,793 |
04/01/2012 13:34:54
| 1,233,018 |
02/25/2012 20:34:23
| 96 | 9 |
Dynamically change text on Twitter Bootstrap button whilst preserving icon?
|
How do I use javascript/jquery to change the text on a button in Twitter Bootstrap *without destroying the icon*?
So, this is my static markup:
<a class="btn" id="myButton" onclick="doSomething()"><i class="icon-ok"></i> Do it...</a>
I am able to change the icon, like this:
$('#myButton i:first-child').attr('class','icon icon-remove');
Which is fine, but for the love of all that is good I cannot find a way to set the button text without then wiping out the icon. Eg. if I do this:
$('#myButton').text('Some Remove Text');
I lose the icon element, so how can I access *just the text* and edit that, whilst preserving any child elements?
|
javascript
|
jquery
|
twitter-bootstrap
| null | null | null |
open
|
Dynamically change text on Twitter Bootstrap button whilst preserving icon?
===
How do I use javascript/jquery to change the text on a button in Twitter Bootstrap *without destroying the icon*?
So, this is my static markup:
<a class="btn" id="myButton" onclick="doSomething()"><i class="icon-ok"></i> Do it...</a>
I am able to change the icon, like this:
$('#myButton i:first-child').attr('class','icon icon-remove');
Which is fine, but for the love of all that is good I cannot find a way to set the button text without then wiping out the icon. Eg. if I do this:
$('#myButton').text('Some Remove Text');
I lose the icon element, so how can I access *just the text* and edit that, whilst preserving any child elements?
| 0 |
7,032,205 |
08/11/2011 20:12:12
| 833,531 |
07/07/2011 12:41:24
| -1 | 3 |
Regular Expression - Match [XPTO_XPTO] [XPTO_XPTO]
|
I need to match the following words
Underscore is optional, blank space between brackets are optional too.
"[XPTO_XPTO] [XPTO_XPTO]"
I tried this
[/\[/][\w][/\]/]+[ ]{1,}[/\[/][\w][/\]/]+
|
c#
|
regex
|
brackets
|
square-bracket
| null |
07/06/2012 22:20:31
|
not a real question
|
Regular Expression - Match [XPTO_XPTO] [XPTO_XPTO]
===
I need to match the following words
Underscore is optional, blank space between brackets are optional too.
"[XPTO_XPTO] [XPTO_XPTO]"
I tried this
[/\[/][\w][/\]/]+[ ]{1,}[/\[/][\w][/\]/]+
| 1 |
10,588,519 |
05/14/2012 17:53:33
| 988,092 |
10/10/2011 16:58:23
| 9 | 0 |
Send email to multiple recipients with attachment PHP
|
I'm attempting to build an email blast that can optionally include an attachment. I had the code working previously sans attachment but including the attachment doesn't seem to work. This is what I have:
<?php
if(isset($_POST['submit']))
{
$output = '<h1>Successfully sent your message.</h1>';
$flags = 'style="display:none;"';
include 'connection.php';
$query = "select * from login";
$result = mysql_query($query) or die(mysql_error());
$num_results = mysql_num_rows($result);
if ($num_results !="")
{
for ($i=0;$i<$num_results;$i++)
{
$row = mysql_fetch_array($result);
$email = stripslashes($row['email']);
$to = "Undisclosed Recipients";
$subject = strip_tags($_POST['subject']);
$message = strip_tags($_POST['message']);
$attachment = chunk_split(base64_encode(file_get_contents($_FILES['file']['tmp_name'])));
$filename = $_FILES['file']['name'];
$boundary =md5(date('r', time()));
$headers = "From: [email protected]\r\n" . "Bcc: " . $email;
$headers .= "\r\nMIME-Version: 1.0\r\nContent-Type: multipart/mixed; boundary=\"_1_$boundary\"";
$message="This is a multi-part message in MIME format.
--_1_$boundary
Content-Type: multipart/alternative; boundary=\"_2_$boundary\"
--_2_$boundary
Content-Type: text/plain; charset=\"iso-8859-1\"
Content-Transfer-Encoding: 7bit
$message
--_2_$boundary--
--_1_$boundary
Content-Type: application/octet-stream; name=\"$filename\"
Content-Transfer-Encoding: base64
Content-Disposition: attachment
$attachment
--_1_$boundary--";
mail($to, $subject, $message, $headers);
}
}
}
?>
|
php
|
mysql
|
email
| null | null |
05/15/2012 11:33:13
|
not a real question
|
Send email to multiple recipients with attachment PHP
===
I'm attempting to build an email blast that can optionally include an attachment. I had the code working previously sans attachment but including the attachment doesn't seem to work. This is what I have:
<?php
if(isset($_POST['submit']))
{
$output = '<h1>Successfully sent your message.</h1>';
$flags = 'style="display:none;"';
include 'connection.php';
$query = "select * from login";
$result = mysql_query($query) or die(mysql_error());
$num_results = mysql_num_rows($result);
if ($num_results !="")
{
for ($i=0;$i<$num_results;$i++)
{
$row = mysql_fetch_array($result);
$email = stripslashes($row['email']);
$to = "Undisclosed Recipients";
$subject = strip_tags($_POST['subject']);
$message = strip_tags($_POST['message']);
$attachment = chunk_split(base64_encode(file_get_contents($_FILES['file']['tmp_name'])));
$filename = $_FILES['file']['name'];
$boundary =md5(date('r', time()));
$headers = "From: [email protected]\r\n" . "Bcc: " . $email;
$headers .= "\r\nMIME-Version: 1.0\r\nContent-Type: multipart/mixed; boundary=\"_1_$boundary\"";
$message="This is a multi-part message in MIME format.
--_1_$boundary
Content-Type: multipart/alternative; boundary=\"_2_$boundary\"
--_2_$boundary
Content-Type: text/plain; charset=\"iso-8859-1\"
Content-Transfer-Encoding: 7bit
$message
--_2_$boundary--
--_1_$boundary
Content-Type: application/octet-stream; name=\"$filename\"
Content-Transfer-Encoding: base64
Content-Disposition: attachment
$attachment
--_1_$boundary--";
mail($to, $subject, $message, $headers);
}
}
}
?>
| 1 |
8,636,205 |
12/26/2011 13:28:56
| 1,021,583 |
10/31/2011 07:52:56
| 1 | 0 |
How i navigate using slider keyboard in Windows phone Applications?How it implimenting only using xaml?
|
can i navigate using slider keyboard in Windows phone Applications?How it implementing only using xaml?
|
windows-phone-7
| null | null | null | null |
12/28/2011 08:02:21
|
not a real question
|
How i navigate using slider keyboard in Windows phone Applications?How it implimenting only using xaml?
===
can i navigate using slider keyboard in Windows phone Applications?How it implementing only using xaml?
| 1 |
6,552,101 |
07/01/2011 18:51:39
| 821,948 |
06/29/2011 21:09:43
| 3 | 0 |
how set default type, collation and charset database in Doctrine?
|
if i build schema with Doctrine 1.2 for Symfony 1.4 i must add options: type, collate and charset, for example:
AlSupplier:
options:
type: InnoDB
collate: utf8_unicode_ci
charset: utf8
columns:
company_name:
type: string(255)
AlCountry:
options:
type: InnoDB
collate: utf8_unicode_ci
charset: utf8
columns:
country_name:
type: string(70)
AlSupplierCategory:
actAs:
NestedSet:
hasManyRoots: true
rootColumnName: root_id
Searchable:
fields: [category_keywords]
options:
type: InnoDB
collate: utf8_unicode_ci
charset: utf8
columns:
category_name:
type: string(200)
category_description:
type: text
category_keywords:
type: text
how can i set default options (type, collate, charset)? I don't want every time this write.
|
symfony
|
doctrine
| null | null | null | null |
open
|
how set default type, collation and charset database in Doctrine?
===
if i build schema with Doctrine 1.2 for Symfony 1.4 i must add options: type, collate and charset, for example:
AlSupplier:
options:
type: InnoDB
collate: utf8_unicode_ci
charset: utf8
columns:
company_name:
type: string(255)
AlCountry:
options:
type: InnoDB
collate: utf8_unicode_ci
charset: utf8
columns:
country_name:
type: string(70)
AlSupplierCategory:
actAs:
NestedSet:
hasManyRoots: true
rootColumnName: root_id
Searchable:
fields: [category_keywords]
options:
type: InnoDB
collate: utf8_unicode_ci
charset: utf8
columns:
category_name:
type: string(200)
category_description:
type: text
category_keywords:
type: text
how can i set default options (type, collate, charset)? I don't want every time this write.
| 0 |
7,792,022 |
10/17/2011 09:49:17
| 931,351 |
09/06/2011 18:47:24
| 20 | 1 |
Android switch button same as iphone?
|
Is there any way to develop this switch button http://www.iclarified.com/images/tutorials/775/3778/3778.png ..in android?? and view and functionality same as iphonw switch button...
|
android
| null | null | null | null |
10/17/2011 11:14:52
|
not a real question
|
Android switch button same as iphone?
===
Is there any way to develop this switch button http://www.iclarified.com/images/tutorials/775/3778/3778.png ..in android?? and view and functionality same as iphonw switch button...
| 1 |
7,368,414 |
09/09/2011 23:15:24
| 335,993 |
05/08/2010 04:52:17
| 52 | 2 |
Configuring Haproxy with Tomcat to use context
|
I'm a newbie with haproxy and I'm trying to figure out how to do something which seems quite simple. I want to proxy a tomcat context.
For example http://bobsautomotive.com:8080/HelloWorld
Here is my haproxy config:
global
daemon
maxconn 256
log 127.0.0.1 local0
defaults
mode http
option httplog
option logasap
log global
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms
frontend http-in
bind *:80
default_backend servers
backend servers
balance roundrobin
option redispatch
option httpclose
option forwardfor
cookie JSESSIONID prefix
server one tomcat.bobsautomotive.com:8009 cookie tomcat1 check
stats uri /admin?stats
stats realm haproxy
stats scope .
This works fine to get to the Tomcat main page. But, If I try to change it to use a context like:
server one tomcat.bobsautomotive.com:8009/han cookie tomcat1 check
It won't work...
Any ideas?
Thanks
|
tomcat
|
haproxy
| null | null | null | null |
open
|
Configuring Haproxy with Tomcat to use context
===
I'm a newbie with haproxy and I'm trying to figure out how to do something which seems quite simple. I want to proxy a tomcat context.
For example http://bobsautomotive.com:8080/HelloWorld
Here is my haproxy config:
global
daemon
maxconn 256
log 127.0.0.1 local0
defaults
mode http
option httplog
option logasap
log global
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms
frontend http-in
bind *:80
default_backend servers
backend servers
balance roundrobin
option redispatch
option httpclose
option forwardfor
cookie JSESSIONID prefix
server one tomcat.bobsautomotive.com:8009 cookie tomcat1 check
stats uri /admin?stats
stats realm haproxy
stats scope .
This works fine to get to the Tomcat main page. But, If I try to change it to use a context like:
server one tomcat.bobsautomotive.com:8009/han cookie tomcat1 check
It won't work...
Any ideas?
Thanks
| 0 |
11,535,745 |
07/18/2012 06:49:53
| 1,533,842 |
07/18/2012 06:43:41
| 1 | 0 |
HTTP 500- Internal Server error on IIS7 + ASP.Net
|
When the number of concurrent users increases beyond 1000, I get HTTP 500-Internal Server Error. Its an ASP.Net application running on IIS7.
Can someone please tell the possible reason and solution?
Thanks in advance.
|
iis7
| null | null | null | null |
07/19/2012 11:40:00
|
not a real question
|
HTTP 500- Internal Server error on IIS7 + ASP.Net
===
When the number of concurrent users increases beyond 1000, I get HTTP 500-Internal Server Error. Its an ASP.Net application running on IIS7.
Can someone please tell the possible reason and solution?
Thanks in advance.
| 1 |
1,888,969 |
12/11/2009 15:51:49
| 25,050 |
10/04/2008 02:05:27
| 6,320 | 215 |
git: ignoring files in the origin
|
Is there a way to tell git to ignore a file that's stored in its origin? Since the files in question are in the upstream repository, just adding them to .gitignore or .git/info/exclude don't work.
**Background**:
My upstream repository has some generated files in it. Every time I do a local rebuild, these generated files are changed and differ from the committed version. The generated files are in the repository because many users don't have the software to generate them (and I don't have the power to change this). These generated files are never generated by hand and I never want to commit them to my git repository. I have a separate mechanism to push them to the master repository (and I have no control over this separate mechanism).
I'm using a private git repository for making edits to an upstream subversion repository. To do this, I have a git repository just for pulling commits from subversion. That git repository is periodically synced via a cronjob. I then have private git repositories that are clones of the upstream git repository. I want git to not bug me about the generated files. I'm happy with either of these two results: the files are no longer tracked by my local git repository (but they should be tracked by the one that syncs with svn), or git will silently update my generated files but it will never commit my changes and the files will never show up in the "Changed but not updated:" section of "git status".
|
git
|
git-svn
|
gitignore
| null | null | null |
open
|
git: ignoring files in the origin
===
Is there a way to tell git to ignore a file that's stored in its origin? Since the files in question are in the upstream repository, just adding them to .gitignore or .git/info/exclude don't work.
**Background**:
My upstream repository has some generated files in it. Every time I do a local rebuild, these generated files are changed and differ from the committed version. The generated files are in the repository because many users don't have the software to generate them (and I don't have the power to change this). These generated files are never generated by hand and I never want to commit them to my git repository. I have a separate mechanism to push them to the master repository (and I have no control over this separate mechanism).
I'm using a private git repository for making edits to an upstream subversion repository. To do this, I have a git repository just for pulling commits from subversion. That git repository is periodically synced via a cronjob. I then have private git repositories that are clones of the upstream git repository. I want git to not bug me about the generated files. I'm happy with either of these two results: the files are no longer tracked by my local git repository (but they should be tracked by the one that syncs with svn), or git will silently update my generated files but it will never commit my changes and the files will never show up in the "Changed but not updated:" section of "git status".
| 0 |
6,862,087 |
07/28/2011 16:07:07
| 867,879 |
07/28/2011 16:07:07
| 1 | 0 |
Foundation Videos included with Mac Developer Program?
|
What is the list of "Foundation Videos" included with the paid Mac Developer Program?
|
osx
| null | null | null | null |
07/29/2011 12:18:49
|
off topic
|
Foundation Videos included with Mac Developer Program?
===
What is the list of "Foundation Videos" included with the paid Mac Developer Program?
| 2 |
9,700,322 |
03/14/2012 10:40:02
| 916,538 |
08/28/2011 15:18:47
| 3 | 0 |
Best cross-platform framework for Nokia development?
|
I will port an BlackBerry application to Nokia models, to all 3 of them (Windows Phone, Qt and S40). Which cross-platform framework (Titanium, PhoneGap, etc.) would be the best choice for this? Or any other best-practice recommendations? Thanks in advance,
Best Regards
|
qt
|
cross-platform
|
nokia
|
windows-phone
| null |
03/15/2012 12:47:24
|
not constructive
|
Best cross-platform framework for Nokia development?
===
I will port an BlackBerry application to Nokia models, to all 3 of them (Windows Phone, Qt and S40). Which cross-platform framework (Titanium, PhoneGap, etc.) would be the best choice for this? Or any other best-practice recommendations? Thanks in advance,
Best Regards
| 4 |
9,621,387 |
03/08/2012 16:44:11
| 539,285 |
12/12/2010 01:39:31
| 321 | 19 |
Worpess - Preview of latest wordpress blog post in iframe
|
I have a website and a blog. I want to insert an iframe into the website, displaying the latest post from the blog.
So I need just the post content inside the iframe, without wordpress headers and sidebars.
Whats the best approach to achieve this?
Thanks for help.
|
wordpress
| null | null | null | null | null |
open
|
Worpess - Preview of latest wordpress blog post in iframe
===
I have a website and a blog. I want to insert an iframe into the website, displaying the latest post from the blog.
So I need just the post content inside the iframe, without wordpress headers and sidebars.
Whats the best approach to achieve this?
Thanks for help.
| 0 |
11,267,688 |
06/29/2012 19:16:53
| 1,403,405 |
05/18/2012 12:59:54
| 5 | 0 |
send a string in php (simple)
|
i have very simple question in php...
below link get a string and convert it to persian language
http://syavash.com/beta/pi2fa/convert.php?q=salam%20khoobi
i want know how can create a textarea for write a string and send it to top link for convert..but i want result go to this text are not a link :)
<form method="get" action="http://syavash.com/beta/pi2fa/convert.php?q=">
<input type="text" id="txtSearch" name="q" class="searchInput" value="" />
<input type="submit" id="btnSubmit" name="btnSubmit" value="translate" />
</form>
Please explain fully.I do not know PHP and ajax.
thanks and best regards for you
|
php
|
json
|
string
| null | null |
06/29/2012 19:27:57
|
not a real question
|
send a string in php (simple)
===
i have very simple question in php...
below link get a string and convert it to persian language
http://syavash.com/beta/pi2fa/convert.php?q=salam%20khoobi
i want know how can create a textarea for write a string and send it to top link for convert..but i want result go to this text are not a link :)
<form method="get" action="http://syavash.com/beta/pi2fa/convert.php?q=">
<input type="text" id="txtSearch" name="q" class="searchInput" value="" />
<input type="submit" id="btnSubmit" name="btnSubmit" value="translate" />
</form>
Please explain fully.I do not know PHP and ajax.
thanks and best regards for you
| 1 |
3,951,882 |
10/17/2010 03:24:54
| 468,605 |
10/07/2010 00:47:08
| 6 | 0 |
Is it difficult to measure productivity of pair programming ?
|
what are difficulties that prevent us to measure and compare between pair and solo programming ?
is it difficult to compare their productivity? if yes , why ?
|
pair-programming
| null | null | null | null |
10/17/2010 03:34:18
|
off topic
|
Is it difficult to measure productivity of pair programming ?
===
what are difficulties that prevent us to measure and compare between pair and solo programming ?
is it difficult to compare their productivity? if yes , why ?
| 2 |
10,814,482 |
05/30/2012 10:29:34
| 1,171,067 |
01/26/2012 10:38:31
| 21 | 0 |
Windows 8 + Metro Style Apps Presentation
|
I need some presentation/contents on Windows 8 + Metro Style Apps Development. Can anybody help me out please.
|
windows-8
|
presentation
| null | null | null |
05/31/2012 08:38:08
|
not a real question
|
Windows 8 + Metro Style Apps Presentation
===
I need some presentation/contents on Windows 8 + Metro Style Apps Development. Can anybody help me out please.
| 1 |
5,301,218 |
03/14/2011 16:07:35
| 228,517 |
12/10/2009 05:08:22
| 16 | 0 |
django sphinx automodule -- basics
|
I have a projects with several large apps and where settings and apps files are split.
directory structure goes something like that:
**project_name**
- \__init__.py
- apps
- \__init__.py
- app1
- app2
- 3rdparty
- \__init__.py
- lib1
- lib2
- settings
- \__init__.py
- installed_apps.py
- path.py
- templates.py
- locale.py
- ...
- urls.py
**every app is like that**
- \__init__.py
- admin
- \__init__.py
- file1.py
- file2.py
- models
- \__init__.py
- model1.py
- model2.py
- tests
- \__init__.py
- test1.py
- test2.py
- views
- \__init__.py
- view1.py
- view2.py
- urls.py
how to use a sphinx to autogenerate documentation for that?
I want something like that
for each in settings module or INSTALLED_APPS (not starting with django.* or 3rdparty.*) give me a auto documentation output based on docstring
and autogen documentation and run tests before git commit
btw.
I tried doing .rst files by hand with
.. automodule:: module_name
:members:
but is sucks for such a big project,
and it does not works for settings
Is there an autogen method or something?
I am not tied to sphinx, is there a better solution for my problem?
|
python
|
django
|
documentation
|
sphinx
| null | null |
open
|
django sphinx automodule -- basics
===
I have a projects with several large apps and where settings and apps files are split.
directory structure goes something like that:
**project_name**
- \__init__.py
- apps
- \__init__.py
- app1
- app2
- 3rdparty
- \__init__.py
- lib1
- lib2
- settings
- \__init__.py
- installed_apps.py
- path.py
- templates.py
- locale.py
- ...
- urls.py
**every app is like that**
- \__init__.py
- admin
- \__init__.py
- file1.py
- file2.py
- models
- \__init__.py
- model1.py
- model2.py
- tests
- \__init__.py
- test1.py
- test2.py
- views
- \__init__.py
- view1.py
- view2.py
- urls.py
how to use a sphinx to autogenerate documentation for that?
I want something like that
for each in settings module or INSTALLED_APPS (not starting with django.* or 3rdparty.*) give me a auto documentation output based on docstring
and autogen documentation and run tests before git commit
btw.
I tried doing .rst files by hand with
.. automodule:: module_name
:members:
but is sucks for such a big project,
and it does not works for settings
Is there an autogen method or something?
I am not tied to sphinx, is there a better solution for my problem?
| 0 |
9,309,747 |
02/16/2012 10:36:24
| 1,179,653 |
01/31/2012 06:21:29
| 1 | 1 |
cell programming guide
|
Can anyone give me link to some guide for cell programming. I'm searching for a long time. But all the resources I'm getting is not in the programming perspective. I need a document mainly focusing on Cell programming. I have enough basic architecture knowledge about CELL/BE architecture by studying a lot more pdfs online. So please tell me some resource that only concentrates on programming Cell.
thanks in advance.
|
cell
|
ibm
|
ps3
| null | null |
02/17/2012 21:55:37
|
off topic
|
cell programming guide
===
Can anyone give me link to some guide for cell programming. I'm searching for a long time. But all the resources I'm getting is not in the programming perspective. I need a document mainly focusing on Cell programming. I have enough basic architecture knowledge about CELL/BE architecture by studying a lot more pdfs online. So please tell me some resource that only concentrates on programming Cell.
thanks in advance.
| 2 |
8,673,344 |
12/29/2011 20:56:05
| 1,121,894 |
12/29/2011 20:47:45
| 1 | 0 |
How to use Slax modules in other
|
this my first Question (-_-) that how to use [Slax][1] modules in other distributions ??
[1]: http://www.slax.org
|
linux
|
slackware
| null | null | null |
12/29/2011 23:47:46
|
off topic
|
How to use Slax modules in other
===
this my first Question (-_-) that how to use [Slax][1] modules in other distributions ??
[1]: http://www.slax.org
| 2 |
5,050,329 |
02/19/2011 10:50:38
| 576,589 |
01/15/2011 09:02:10
| 110 | 5 |
Jquery Click Event Not Firing On First Click, but does on second click, why?
|
I've got a jquery code, which
$("a.reply").click(function() {
//code
});
When I click the link with .reply class the first time, nothing happens. The second time I click, the code inside the click function works.
The link is being inserted on the page using php from a mysql database. so it's not being inserted dynamically.
Why is this happening? Any solution?
|
php
|
jquery
|
mysql
|
html
|
css
| null |
open
|
Jquery Click Event Not Firing On First Click, but does on second click, why?
===
I've got a jquery code, which
$("a.reply").click(function() {
//code
});
When I click the link with .reply class the first time, nothing happens. The second time I click, the code inside the click function works.
The link is being inserted on the page using php from a mysql database. so it's not being inserted dynamically.
Why is this happening? Any solution?
| 0 |
4,411,503 |
12/10/2010 17:19:37
| 337,138 |
05/10/2010 09:56:12
| 98 | 9 |
Export HTML to EXCEL with PHP & jQuery
|
I would like to export an HTML `table` to a MS Excel document (and PDF ideally) as it is displayed on the HTML/CSS page. I read a lot of pages and topics about it (on stack mainly) but everyone seemed to be talking about exporting the table, and not formatting the final excel file.
I think it should work like this:
1. click on export button: call to jQuery
2. jQuery creates a pure HTML document from the HTML/CSS of the `table`
3. jQuery calls a PHP function/class ([http://phpexcel.codeplex.com][1] maybe) to generate the EXCEL file from the HTML code reformatted
4. With the headers sent by PHP, the browser asks the user to save/open the excel generated file
Would this work? If so do you know any jQuery plugins and PHP classes/functions to do so? If not, what is your idea about it?
<br />
Cheers,<br />
Nicolas.
[1]: http://phpexcel.codeplex.com/
|
php
|
jquery
|
css
|
export-to-excel
| null | null |
open
|
Export HTML to EXCEL with PHP & jQuery
===
I would like to export an HTML `table` to a MS Excel document (and PDF ideally) as it is displayed on the HTML/CSS page. I read a lot of pages and topics about it (on stack mainly) but everyone seemed to be talking about exporting the table, and not formatting the final excel file.
I think it should work like this:
1. click on export button: call to jQuery
2. jQuery creates a pure HTML document from the HTML/CSS of the `table`
3. jQuery calls a PHP function/class ([http://phpexcel.codeplex.com][1] maybe) to generate the EXCEL file from the HTML code reformatted
4. With the headers sent by PHP, the browser asks the user to save/open the excel generated file
Would this work? If so do you know any jQuery plugins and PHP classes/functions to do so? If not, what is your idea about it?
<br />
Cheers,<br />
Nicolas.
[1]: http://phpexcel.codeplex.com/
| 0 |
8,045,386 |
11/08/2011 02:48:22
| 781,700 |
06/02/2011 18:59:16
| 1 | 0 |
car class (OOPS Concept)
|
Hello I have one c++ Programming assignment question.
I tried hard but somehow I am not getting.
Ques:
Assuming you are given a class “Engine” that has the “start()” method prototyped below, write a “Car” class with a “turnKey()” method that tells you whether the car started or not. The Car class should encapsulate the “Engine” class.
bool Engine::start();
Can anybody please help me?
Thanks in advance.
|
c++
| null | null | null | null |
11/08/2011 02:57:57
|
too localized
|
car class (OOPS Concept)
===
Hello I have one c++ Programming assignment question.
I tried hard but somehow I am not getting.
Ques:
Assuming you are given a class “Engine” that has the “start()” method prototyped below, write a “Car” class with a “turnKey()” method that tells you whether the car started or not. The Car class should encapsulate the “Engine” class.
bool Engine::start();
Can anybody please help me?
Thanks in advance.
| 3 |
6,198,601 |
06/01/2011 08:56:32
| 597,388 |
01/31/2011 19:44:20
| 124 | 1 |
Is it possible to have duplicate action names and parameter list for post and get?
|
is it possible to have 2 actions with the same name and parameters but one's a post, the other a get? e.g Delete(id) and [HttpPost]Delete(id)...i get an error saying that this is not allowed...
|
asp.net-mvc-3
|
action
| null | null | null | null |
open
|
Is it possible to have duplicate action names and parameter list for post and get?
===
is it possible to have 2 actions with the same name and parameters but one's a post, the other a get? e.g Delete(id) and [HttpPost]Delete(id)...i get an error saying that this is not allowed...
| 0 |
8,983,371 |
01/24/2012 07:29:48
| 1,043,070 |
11/12/2011 11:45:22
| 8 | 0 |
How To Download Large Number of Images From List of URLs?
|
I have a long list (hundreds of thousands) of image urls and want to download them automatically to a local folder, what is the most straightforward way of doing so?
I considered curl/php, but am not sure how that would work.
Any helpful suggestions/pointers appreciated.
|
php
|
image
|
curl
|
download
| null |
01/24/2012 18:33:30
|
not a real question
|
How To Download Large Number of Images From List of URLs?
===
I have a long list (hundreds of thousands) of image urls and want to download them automatically to a local folder, what is the most straightforward way of doing so?
I considered curl/php, but am not sure how that would work.
Any helpful suggestions/pointers appreciated.
| 1 |
5,506,912 |
03/31/2011 22:06:58
| 98,422 |
04/30/2009 09:51:51
| 3,550 | 131 |
How should I make my VBA code compatible with 64-bit Windows?
|
I have a VBA application developed in Excel 2007, and it contains the following code to allow access to the `ShellExecute` function from `Shell32.dll`:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Apparently the application will not compile on a 64-bit version of Windows (still using 32-bit Office 2007). I assume that this is because the `Declare` declaration needs updated.
I've read that Office 2010 introduced a new VBA runtime (VB7), and that this has some new keywords that can be used in the `Declare` statement to allow it to work properly on 64-bit Windows. VB7 also has new predefined compiler constants to support conditional compilation where either the old or new declaration will be used, depending on whether the application is running on 32 or 64-bit Windows.
However, since I'm stuck with Office 2007 I need an alternative solution. What are my options? (I'd really prefer not to have to release 2 separate versions of my application if at all possible).
|
excel
|
vba
|
64bit
| null | null | null |
open
|
How should I make my VBA code compatible with 64-bit Windows?
===
I have a VBA application developed in Excel 2007, and it contains the following code to allow access to the `ShellExecute` function from `Shell32.dll`:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Apparently the application will not compile on a 64-bit version of Windows (still using 32-bit Office 2007). I assume that this is because the `Declare` declaration needs updated.
I've read that Office 2010 introduced a new VBA runtime (VB7), and that this has some new keywords that can be used in the `Declare` statement to allow it to work properly on 64-bit Windows. VB7 also has new predefined compiler constants to support conditional compilation where either the old or new declaration will be used, depending on whether the application is running on 32 or 64-bit Windows.
However, since I'm stuck with Office 2007 I need an alternative solution. What are my options? (I'd really prefer not to have to release 2 separate versions of my application if at all possible).
| 0 |
223,673 |
10/21/2008 22:00:13
| 30,145 |
10/21/2008 22:00:13
| 1 | 0 |
Internal DNS configuration woes
|
Alright, I am going to state up front that this question may be too involved (amount of detail not complexity) for this medium. But I figured this was the best place to start.
I am attempting to setup a proof of concept project and my BIND configuration is my first big hurdle. I want to setup 3 DNS servers on 3 physical boxes. **None** of these boxes needs to resolve public addresses, this is internal **only**. I have read through how to setup internal roots in the (mostly) excellent DNS & BIND 5th ed book. But my translation of their example is not functional. All IP's are RFC 1918 non-routable.
Box 1 will be authoritative for addresses on the *box1.bogus* domain, and Box 2 will be authoritative for addresses on the *box2.bogus* domain. Box 3 will act as both an internal root and the TLD server for the domain *bogus*.
Current unresolved issues:
- I have a hints file on box 1 and 2 that contains a single **NS** record to the NS definition of the root zone. Additionally there is an **A** record that translates the NS to the ip of the root. if I `dig .` from box 1 I get an *authority* Section with the NS name, not an *answer* and *additional* record section. Therefore I am unable to actually resolve the IP of the root server from box 1.
- If I point my `/etc/resolv.conf` from box 1 directly at the root server and do a `dig box1.bogus` I get the ns.box1.bogus *answer* record and the translation in the *additional* section. However on the next iteration (when should get the A record) I get `dig: couldn't get address for ns.box1.bogus`
Obviously my configs are **not** correct. I don't see a way to attach them to this post, so if people want to walk through this step by step I will cut'n'paste them into a comment for this question. Otherwise I am open to taking this 'offline' with a "DNS guy" to figure out where I'm missing a '.' or have one too many!
I personally think the web could do with another internal root example that doesn't make use of the Movie-U example.
|
bind
|
dns
|
dig
| null | null |
11/22/2011 01:51:33
|
off topic
|
Internal DNS configuration woes
===
Alright, I am going to state up front that this question may be too involved (amount of detail not complexity) for this medium. But I figured this was the best place to start.
I am attempting to setup a proof of concept project and my BIND configuration is my first big hurdle. I want to setup 3 DNS servers on 3 physical boxes. **None** of these boxes needs to resolve public addresses, this is internal **only**. I have read through how to setup internal roots in the (mostly) excellent DNS & BIND 5th ed book. But my translation of their example is not functional. All IP's are RFC 1918 non-routable.
Box 1 will be authoritative for addresses on the *box1.bogus* domain, and Box 2 will be authoritative for addresses on the *box2.bogus* domain. Box 3 will act as both an internal root and the TLD server for the domain *bogus*.
Current unresolved issues:
- I have a hints file on box 1 and 2 that contains a single **NS** record to the NS definition of the root zone. Additionally there is an **A** record that translates the NS to the ip of the root. if I `dig .` from box 1 I get an *authority* Section with the NS name, not an *answer* and *additional* record section. Therefore I am unable to actually resolve the IP of the root server from box 1.
- If I point my `/etc/resolv.conf` from box 1 directly at the root server and do a `dig box1.bogus` I get the ns.box1.bogus *answer* record and the translation in the *additional* section. However on the next iteration (when should get the A record) I get `dig: couldn't get address for ns.box1.bogus`
Obviously my configs are **not** correct. I don't see a way to attach them to this post, so if people want to walk through this step by step I will cut'n'paste them into a comment for this question. Otherwise I am open to taking this 'offline' with a "DNS guy" to figure out where I'm missing a '.' or have one too many!
I personally think the web could do with another internal root example that doesn't make use of the Movie-U example.
| 2 |
11,561,465 |
07/19/2012 13:02:19
| 352,176 |
05/27/2010 16:30:42
| 494 | 31 |
SQL query filtering by list of parameters
|
I have a query where I want to return all the rows which are associated with a list of values. You could write this very simply as:
select * from TableA where ColumnB in (1, 2, 3, 5)
I could generate this query in C# and execute it. However this is obviously less than ideal as it doesn't use parameters, it will suffer when trying to cache query plans and is obviously vulnerable to a SQL injection attack.
An alternative is to write this as:
select * from TableA where ColumnB = @value
This could be executed many times by C#, however this will result in N DB hits.
The only other alternative I can see is to create a temp table and join it that way, however I don't see this point of this as it would be more complex and suffer from the same limitations as the first option.
Which of these three methods is more efficient? Have I missed an alternative?
|
c#
|
sql
|
performance
|
parameters
| null | null |
open
|
SQL query filtering by list of parameters
===
I have a query where I want to return all the rows which are associated with a list of values. You could write this very simply as:
select * from TableA where ColumnB in (1, 2, 3, 5)
I could generate this query in C# and execute it. However this is obviously less than ideal as it doesn't use parameters, it will suffer when trying to cache query plans and is obviously vulnerable to a SQL injection attack.
An alternative is to write this as:
select * from TableA where ColumnB = @value
This could be executed many times by C#, however this will result in N DB hits.
The only other alternative I can see is to create a temp table and join it that way, however I don't see this point of this as it would be more complex and suffer from the same limitations as the first option.
Which of these three methods is more efficient? Have I missed an alternative?
| 0 |
7,775,401 |
10/15/2011 02:41:26
| 996,407 |
10/15/2011 01:57:00
| 1 | 0 |
how to receive form input in javascript
|
How to receive form input in javascript?
Forms like: text(area), text(input), drop down box, check box and input radio.
Thank you.
|
javascript
|
html
| null | null | null |
10/15/2011 03:05:26
|
not a real question
|
how to receive form input in javascript
===
How to receive form input in javascript?
Forms like: text(area), text(input), drop down box, check box and input radio.
Thank you.
| 1 |
3,847,294 |
10/02/2010 19:54:36
| 84,131 |
03/28/2009 23:11:03
| 830 | 22 |
Replace all characters not in range (Java String)
|
How do you replace all of the characters in a string that do not fit a criteria. I'm having trouble specifically with the NOT operator.
Specifically, I'm trying to remove all characters that are not a digit, I've tried this so far:
String number = "703-463-9281";
String number2 = number.replaceAll("[0-9]!", ""); // produces: "703-463-9281" (no change)
String number3 = number.replaceAll("[0-9]", ""); // produces: "--"
String number4 = number.replaceAll("![0-9]", ""); // produces: "703-463-9281" (no change)
String number6 = number.replaceAll("^[0-9]", ""); // produces: "03-463-9281"
|
java
|
regex
| null | null | null | null |
open
|
Replace all characters not in range (Java String)
===
How do you replace all of the characters in a string that do not fit a criteria. I'm having trouble specifically with the NOT operator.
Specifically, I'm trying to remove all characters that are not a digit, I've tried this so far:
String number = "703-463-9281";
String number2 = number.replaceAll("[0-9]!", ""); // produces: "703-463-9281" (no change)
String number3 = number.replaceAll("[0-9]", ""); // produces: "--"
String number4 = number.replaceAll("![0-9]", ""); // produces: "703-463-9281" (no change)
String number6 = number.replaceAll("^[0-9]", ""); // produces: "03-463-9281"
| 0 |
8,468,871 |
12/12/2011 01:06:25
| 1,091,455 |
12/10/2011 17:12:05
| 10 | 0 |
Auto-delete Max/Min from Array on creation
|
I have a script that gathers prices for a query from google api and spits out the min/max of the array created. See the below output. How do I get it to delete the value of the variables `$minval` and `$maxval` aka the minimum value and maximum value within the array?
<?php
$url = 'https://www.googleapis.com/shopping/search/v1/public/products?key=thekey&country=US&q=nintendo+wii';
$data = curl_init($url);
curl_setopt($data, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($data, CURLOPT_HEADER, 0);
$product_result = curl_exec($data);
curl_close($data);
$arr = json_decode($product_result, true);
$prices = array();
foreach ($arr['items'] as $item)
{
if (isset($item['product']['inventories'][0]['price']) !== false)
{
$prices[] = $item['product']['inventories'][0]['price'];
}
}
echo '<pre>';
print_r($prices);
echo '<br /><br />';
$minval = min($prices);
$maxval = max($prices);
$avgofval = array_sum($prices) / count($prices) ;
echo "min is ". $minval . "<br>Max is ". $maxval . "<br />avg is " . $avgofval ;
echo '</pre>';
?>
Output:
Array
(
[0] => 129.99
[1] => 149.99
[2] => 149.99
[3] => 149.99
[4] => 149.99
[5] => 124.99
[6] => 149.99
[7] => 225.99
[8] => 149.96
[9] => 149.99
[10] => 209.95
[11] => 249.99
[12] => 326.99
[13] => 149.99
[14] => 193.99
[15] => 269.96
[16] => 258.99
[17] => 149.99
[18] => 149.99
[19] => 39.99
[20] => 149.99
[21] => 299.99
[22] => 357.38
[23] => 125
[24] => 169.96
)
min is 39.99
Max is 357.38
avg is 185.3208
|
php
|
arrays
|
operators
|
max
|
min
| null |
open
|
Auto-delete Max/Min from Array on creation
===
I have a script that gathers prices for a query from google api and spits out the min/max of the array created. See the below output. How do I get it to delete the value of the variables `$minval` and `$maxval` aka the minimum value and maximum value within the array?
<?php
$url = 'https://www.googleapis.com/shopping/search/v1/public/products?key=thekey&country=US&q=nintendo+wii';
$data = curl_init($url);
curl_setopt($data, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($data, CURLOPT_HEADER, 0);
$product_result = curl_exec($data);
curl_close($data);
$arr = json_decode($product_result, true);
$prices = array();
foreach ($arr['items'] as $item)
{
if (isset($item['product']['inventories'][0]['price']) !== false)
{
$prices[] = $item['product']['inventories'][0]['price'];
}
}
echo '<pre>';
print_r($prices);
echo '<br /><br />';
$minval = min($prices);
$maxval = max($prices);
$avgofval = array_sum($prices) / count($prices) ;
echo "min is ". $minval . "<br>Max is ". $maxval . "<br />avg is " . $avgofval ;
echo '</pre>';
?>
Output:
Array
(
[0] => 129.99
[1] => 149.99
[2] => 149.99
[3] => 149.99
[4] => 149.99
[5] => 124.99
[6] => 149.99
[7] => 225.99
[8] => 149.96
[9] => 149.99
[10] => 209.95
[11] => 249.99
[12] => 326.99
[13] => 149.99
[14] => 193.99
[15] => 269.96
[16] => 258.99
[17] => 149.99
[18] => 149.99
[19] => 39.99
[20] => 149.99
[21] => 299.99
[22] => 357.38
[23] => 125
[24] => 169.96
)
min is 39.99
Max is 357.38
avg is 185.3208
| 0 |
3,585,292 |
08/27/2010 14:41:51
| 433,023 |
08/22/2010 01:58:24
| 11 | 0 |
Switch from Web programming to data warehousing? Should I?
|
I was looking a report on internet that data warehousing is much lucrative and highly paid IT career. I am talking about technologies like abinitio etl datastage teradata. I work in ASP.net and sql server 05. Is it a good thought to move from web programming to data warehousing technologies. Since I would have no experience with data warehousing would I be eligible for a good pay? What technologies other than data warehousing are hot in terms to salary? I know, this may sound immature but I am planning to start my own business in future and would need capital for that.
Thanks
|
asp.net
|
etl
|
teradata
|
abinitio
|
datastage
|
01/28/2012 21:06:33
|
not constructive
|
Switch from Web programming to data warehousing? Should I?
===
I was looking a report on internet that data warehousing is much lucrative and highly paid IT career. I am talking about technologies like abinitio etl datastage teradata. I work in ASP.net and sql server 05. Is it a good thought to move from web programming to data warehousing technologies. Since I would have no experience with data warehousing would I be eligible for a good pay? What technologies other than data warehousing are hot in terms to salary? I know, this may sound immature but I am planning to start my own business in future and would need capital for that.
Thanks
| 4 |
11,052,655 |
06/15/2012 14:28:51
| 1,380,918 |
05/08/2012 00:33:23
| 28 | 0 |
PHP: Getting X number of lines
|
How would I go on getting X number of lines with file_get_contents? If that function wouldn't work, what function would work without me having to delete lines from the beginning of the textfile?
|
php
| null | null | null | null |
06/15/2012 14:51:37
|
not a real question
|
PHP: Getting X number of lines
===
How would I go on getting X number of lines with file_get_contents? If that function wouldn't work, what function would work without me having to delete lines from the beginning of the textfile?
| 1 |
11,046,799 |
06/15/2012 08:01:04
| 1,457,874 |
06/15/2012 05:37:15
| 1 | 0 |
How to append data in .dat file using C language in ubuntu?
|
Here is the code in which i m getting error....
for (i=0; i<portcount; i++)
{
printf("%f ", ccds[i]/100000);
fp=fopen("/administrator/IDS/et.dat", "a");
//fprintf(fp, "er");
fprintf(fp, "%d ", (int)ccds[i]/100000);
fclose(fp);
}
|
c
| null | null | null | null |
06/15/2012 15:11:07
|
not a real question
|
How to append data in .dat file using C language in ubuntu?
===
Here is the code in which i m getting error....
for (i=0; i<portcount; i++)
{
printf("%f ", ccds[i]/100000);
fp=fopen("/administrator/IDS/et.dat", "a");
//fprintf(fp, "er");
fprintf(fp, "%d ", (int)ccds[i]/100000);
fclose(fp);
}
| 1 |
10,270,275 |
04/22/2012 17:29:12
| 1,171,965 |
01/26/2012 18:36:56
| 33 | 0 |
Using South migrations with Heroku.
|
I have successfully synced my database using south on the local server. I am having problems using south in Heroku. When I run
git add app/migrations/*
git commit -m 'adding new migrations'
heroku run python manage.py migrate app
I am getting a DatabaseError. Relation field already exists.
Any ideas why this isn't working? Also, do I need to run migrations locally and on the production environment each time one of my models change? Thanks for reading.
|
django
|
heroku
|
django-south
| null | null | null |
open
|
Using South migrations with Heroku.
===
I have successfully synced my database using south on the local server. I am having problems using south in Heroku. When I run
git add app/migrations/*
git commit -m 'adding new migrations'
heroku run python manage.py migrate app
I am getting a DatabaseError. Relation field already exists.
Any ideas why this isn't working? Also, do I need to run migrations locally and on the production environment each time one of my models change? Thanks for reading.
| 0 |
8,870,357 |
01/15/2012 14:22:08
| 1,150,439 |
01/15/2012 14:13:55
| 1 | 0 |
Lambda calculus representation of "if" structure and boolean "True"
|
I was wandering if anyone could tell me alternative lambda calculus representations for the "IF - THEN - ELSE" structure and the boolean "TRUE" besides the "classical" ones (i.e. for "if": \pca.pca ; and for true: \xy.x ).
I would really appreciate it if you could give me two different solutions.
|
lambda-calculus
| null | null | null | null |
02/07/2012 09:42:04
|
off topic
|
Lambda calculus representation of "if" structure and boolean "True"
===
I was wandering if anyone could tell me alternative lambda calculus representations for the "IF - THEN - ELSE" structure and the boolean "TRUE" besides the "classical" ones (i.e. for "if": \pca.pca ; and for true: \xy.x ).
I would really appreciate it if you could give me two different solutions.
| 2 |
10,572,425 |
05/13/2012 14:12:01
| 1,344,853 |
04/19/2012 19:02:35
| 1 | 0 |
Backbone-on-rails object is undefined
|
I use rails 3.2.3 with backbone-on-rails gem, something wrong with my collection, here is few line from my router file:
initalize: ->
@collection = new Elements.Collections.Entries()
@collection.fetch()
index: ->
view = new Elements.Views.EntriesIndex(collection: @collection)
$('#container').html(view.render().el)
and my view file contains:
render: ->
$(@el).html(@template(entries: @collection))
this
If i call <%= @entries.length %> in the template file, i get this error:
> "Uncaught TypeError: Cannot read property 'length' of undefined"
|
ruby-on-rails
|
backbone.js
|
backbone-views
| null | null |
05/13/2012 23:51:16
|
too localized
|
Backbone-on-rails object is undefined
===
I use rails 3.2.3 with backbone-on-rails gem, something wrong with my collection, here is few line from my router file:
initalize: ->
@collection = new Elements.Collections.Entries()
@collection.fetch()
index: ->
view = new Elements.Views.EntriesIndex(collection: @collection)
$('#container').html(view.render().el)
and my view file contains:
render: ->
$(@el).html(@template(entries: @collection))
this
If i call <%= @entries.length %> in the template file, i get this error:
> "Uncaught TypeError: Cannot read property 'length' of undefined"
| 3 |
6,010,311 |
05/15/2011 18:21:56
| 648,746 |
03/07/2011 19:46:19
| 137 | 4 |
Grid-lines on a GridView
|
How do I define grid-lines for a GridView?
Is there an attribute or do I have to draw my own background with them in it?
|
android
|
gridview
| null | null | null | null |
open
|
Grid-lines on a GridView
===
How do I define grid-lines for a GridView?
Is there an attribute or do I have to draw my own background with them in it?
| 0 |
6,980,283 |
08/08/2011 09:44:07
| 732,996 |
04/29/2011 14:29:08
| 11 | 0 |
Good tutorial for RESTful Services
|
can anyone post a good tutorial or sample for WCF RESTful services/I want to learn from the basic.
|
c#
|
wcf
|
rest
| null | null |
08/08/2011 10:19:05
|
not constructive
|
Good tutorial for RESTful Services
===
can anyone post a good tutorial or sample for WCF RESTful services/I want to learn from the basic.
| 4 |
8,704,610 |
01/02/2012 19:31:45
| 333,061 |
05/05/2010 04:31:45
| 543 | 48 |
Easy typing for non-english keyboards vim users
|
In English or US keyboards keys like `\` `/` `[` `]` are very easily typed with only one key stroke. Usually is not the same for non-english keyboards. Is there a way to achieve the same easiness of typing for these type of keyboards?
If it is a matter of `mapping keys` can you please put clear instructions to do it? (Spanish layout example is welcome)
|
vim
|
keyboard
|
mapping
| null | null |
06/20/2012 01:56:57
|
not constructive
|
Easy typing for non-english keyboards vim users
===
In English or US keyboards keys like `\` `/` `[` `]` are very easily typed with only one key stroke. Usually is not the same for non-english keyboards. Is there a way to achieve the same easiness of typing for these type of keyboards?
If it is a matter of `mapping keys` can you please put clear instructions to do it? (Spanish layout example is welcome)
| 4 |
7,622,677 |
10/01/2011 20:12:18
| 647,481 |
03/07/2011 01:26:31
| 781 | 21 |
Notepad++, Remember previous line folds on startup/file-open?
|
How do I get Notepad++ to remember previous line folds when I start the program or re-open a file?
Example:
//I collapsed/folded my code
[+] My code is collapsed/folded now
-----------------------------------------
//Closed and re-opened file or Notepad++
[-] My code is no longer collapsed/folded, Notepad++ doesn't remember the previous file state
| code
| code
| code
-----------------------------------------
I would like it to behave just like Visual Studio does if possible.
Thanks for any help!
|
notepad++
| null | null | null | null |
10/03/2011 05:45:30
|
off topic
|
Notepad++, Remember previous line folds on startup/file-open?
===
How do I get Notepad++ to remember previous line folds when I start the program or re-open a file?
Example:
//I collapsed/folded my code
[+] My code is collapsed/folded now
-----------------------------------------
//Closed and re-opened file or Notepad++
[-] My code is no longer collapsed/folded, Notepad++ doesn't remember the previous file state
| code
| code
| code
-----------------------------------------
I would like it to behave just like Visual Studio does if possible.
Thanks for any help!
| 2 |
8,929,461 |
01/19/2012 16:18:58
| 1,018,075 |
10/28/2011 09:30:23
| 22 | 1 |
StringBuffer going to append path for every method call
|
i am setting contextPath dynamically by using StringBuffer in java file. Here for every call the path is appending to StringBuffer Object based on number of calls. How can i run below code properly.
StringBuffer blankDeposit = new StringBuffer();
blankDeposit.setLength(0);
String rcp = request.getContextPath();
String create = "Create";
blankDeposit.append("<a href="+rcp+"/deposit/showBlankDepositSheet.do>"+create+"</a>"+"a blank Deposit Sheet.");
ActionHelper.formatInfoMessage(
mapping,
request,blankDeposit.toString());
Here `blankDeposit` should have the contextPath(/myapp)with the String. But i am getting a blank space instead of this. How can i do for this.
And the `blankDeposit` is appending the string by number of times i run. if i call five times then the above variable blankDeposit containing five times the appended string.
|
java
|
stringbuffer
|
contextpath
| null | null | null |
open
|
StringBuffer going to append path for every method call
===
i am setting contextPath dynamically by using StringBuffer in java file. Here for every call the path is appending to StringBuffer Object based on number of calls. How can i run below code properly.
StringBuffer blankDeposit = new StringBuffer();
blankDeposit.setLength(0);
String rcp = request.getContextPath();
String create = "Create";
blankDeposit.append("<a href="+rcp+"/deposit/showBlankDepositSheet.do>"+create+"</a>"+"a blank Deposit Sheet.");
ActionHelper.formatInfoMessage(
mapping,
request,blankDeposit.toString());
Here `blankDeposit` should have the contextPath(/myapp)with the String. But i am getting a blank space instead of this. How can i do for this.
And the `blankDeposit` is appending the string by number of times i run. if i call five times then the above variable blankDeposit containing five times the appended string.
| 0 |
5,774,705 |
04/25/2011 02:34:35
| 87,158 |
04/04/2009 20:03:28
| 2,130 | 62 |
Pros of storing image resources inside a .bundle
|
I've been told that it's best practice to do so. I know the [Facebook iOS SDK][1] does this (look inside the `FBDialog.bundle` file). There are a few SO questions about [how to create them][2] as well. Apple also has a [Bundle Programming Guide][3].
But in a nutshell (and localization aside), are there significant pros of storing image resources inside a .bundle file?
[1]: https://github.com/facebook/facebook-ios-sdk
[2]: http://stackoverflow.com/questions/3672670
[3]: http://developer.apple.com/library/mac/#documentation/CoreFoundation/Conceptual/CFBundles/Introduction/Introduction.html#//apple_ref/doc/uid/10000123i-CH1-SW1
|
xcode
|
ios
|
resources
|
organization
| null | null |
open
|
Pros of storing image resources inside a .bundle
===
I've been told that it's best practice to do so. I know the [Facebook iOS SDK][1] does this (look inside the `FBDialog.bundle` file). There are a few SO questions about [how to create them][2] as well. Apple also has a [Bundle Programming Guide][3].
But in a nutshell (and localization aside), are there significant pros of storing image resources inside a .bundle file?
[1]: https://github.com/facebook/facebook-ios-sdk
[2]: http://stackoverflow.com/questions/3672670
[3]: http://developer.apple.com/library/mac/#documentation/CoreFoundation/Conceptual/CFBundles/Introduction/Introduction.html#//apple_ref/doc/uid/10000123i-CH1-SW1
| 0 |
11,460,287 |
07/12/2012 20:39:52
| 844,438 |
07/14/2011 11:24:05
| 237 | 0 |
Masking image on Shape
|
I'm not sure if the title explains what I want to do, but here goes:
I have drawn a circle with a shape. I have an photo.
What I want to be able to do is somehow make it so that only the parts of the photo that are within this circle are visible and what is outside is not visible. Therefore being able to drag the image to position how I want within the circle and therefore ending up with an image which is in the shape of a circle
Is this possible?
|
photoshop
|
photoshop-cs3
| null | null | null |
07/12/2012 22:15:10
|
off topic
|
Masking image on Shape
===
I'm not sure if the title explains what I want to do, but here goes:
I have drawn a circle with a shape. I have an photo.
What I want to be able to do is somehow make it so that only the parts of the photo that are within this circle are visible and what is outside is not visible. Therefore being able to drag the image to position how I want within the circle and therefore ending up with an image which is in the shape of a circle
Is this possible?
| 2 |
8,497,343 |
12/13/2011 22:47:41
| 1,096,741 |
12/13/2011 22:42:31
| 1 | 0 |
Make a youtube app usind visual studio 2008/2010
|
does anyone have a sample or tutorial of how to make a youtube app using visual studio 2008 or 2010.
|
youtube
|
youtube-api
| null | null | null |
12/14/2011 00:44:03
|
not a real question
|
Make a youtube app usind visual studio 2008/2010
===
does anyone have a sample or tutorial of how to make a youtube app using visual studio 2008 or 2010.
| 1 |
2,395,732 |
03/07/2010 09:18:34
| 70,942 |
02/25/2009 17:01:58
| 925 | 17 |
winsock gethostbyname fails
|
Visual Studio C++ 2008
I am using this code. However, gethostbyname always returns an error. Everything looks ok to me, so I don't understand why I am getting this error.
This is the code I am using up to getting the gethostbyname.
Any think obvious that I might be doing wrong?
int32_t sockfd;
/* struct definition */
struct sockaddr_in conn_addr;
/* gethostbyname for the function and struct definition */
struct hostent *server_hostname;
/* set address to connect to the local loopback */
char buffer[BUF_SIZE] = "127.0.0.1";
char data[BUF_SIZE] = {0};
/* getting hostname for the ip address stored in the buffer */
if((server_hostname = gethostbyname(buffer)) == NULL)
{
/* gethostbyname uses a special h_errno for error number */
fprintf(stderr, "gethostbyname [ %s ] [ %s ] [ %d ]\n", strerror(h_errno), __FUNCTION__, __LINE__);
return CS_FAILURE;
}
The error that gets returned is 'Unknown Error' which doesn't help too much.
Many thanks for any suggestions,
|
sockets
|
visual-studio-2008
| null | null | null | null |
open
|
winsock gethostbyname fails
===
Visual Studio C++ 2008
I am using this code. However, gethostbyname always returns an error. Everything looks ok to me, so I don't understand why I am getting this error.
This is the code I am using up to getting the gethostbyname.
Any think obvious that I might be doing wrong?
int32_t sockfd;
/* struct definition */
struct sockaddr_in conn_addr;
/* gethostbyname for the function and struct definition */
struct hostent *server_hostname;
/* set address to connect to the local loopback */
char buffer[BUF_SIZE] = "127.0.0.1";
char data[BUF_SIZE] = {0};
/* getting hostname for the ip address stored in the buffer */
if((server_hostname = gethostbyname(buffer)) == NULL)
{
/* gethostbyname uses a special h_errno for error number */
fprintf(stderr, "gethostbyname [ %s ] [ %s ] [ %d ]\n", strerror(h_errno), __FUNCTION__, __LINE__);
return CS_FAILURE;
}
The error that gets returned is 'Unknown Error' which doesn't help too much.
Many thanks for any suggestions,
| 0 |
9,401,254 |
02/22/2012 19:01:53
| 645,957 |
03/05/2011 11:22:10
| 269 | 12 |
Code refactoring tools for C, Usable on GNU/Linux? FOSS prefrable
|
Variations of this question have been asked, but not specific to GNU/Linux and C. I use Komodo Edit as my usual Editor, but I'd actually prefer something that can be used from CLI.
I don't need C++ support, its fine if the tool can only handle plain C.
I really appreciate any direction, as I was unable to find anything.
I hope I'm not forced to 'roll' something myself.
|
c
|
linux
|
refactoring
|
gnu
| null | null |
open
|
Code refactoring tools for C, Usable on GNU/Linux? FOSS prefrable
===
Variations of this question have been asked, but not specific to GNU/Linux and C. I use Komodo Edit as my usual Editor, but I'd actually prefer something that can be used from CLI.
I don't need C++ support, its fine if the tool can only handle plain C.
I really appreciate any direction, as I was unable to find anything.
I hope I'm not forced to 'roll' something myself.
| 0 |
7,189,185 |
08/25/2011 10:57:50
| 818,117 |
06/27/2011 20:48:54
| 3 | 0 |
Android listview shows elements at the bottom when there is few elements?
|
When the size of elements is few,like 1,2 or 3 in a Listview
It shows elements at the bottom.
How can I make it to show elements at the top even there are few?
|
android
|
listview
| null | null | null |
08/25/2011 23:35:41
|
not a real question
|
Android listview shows elements at the bottom when there is few elements?
===
When the size of elements is few,like 1,2 or 3 in a Listview
It shows elements at the bottom.
How can I make it to show elements at the top even there are few?
| 1 |
8,061,694 |
11/09/2011 07:35:38
| 1,037,019 |
11/09/2011 06:12:00
| 1 | 0 |
Mastering technology like LINQ, WCF really necessary or is OOPS enough?
|
I am a C# developer.
My observation in the IT industry as a C# developer is that, technology is always changing or being updated by Microsoft like LINQ, WCF, and WPF etc.
OOPS has been the fundamental for all kinds of developments that we see today in any language.
My question is,
1. Is it good if I am a decent programmer in OOPS but not mastering any specific technology?
2. As a winforms developer, is it necessary to know C++ with C# for better job perspective?
Thanks for your support.
|
c#
| null | null | null | null |
11/09/2011 08:24:06
|
not a real question
|
Mastering technology like LINQ, WCF really necessary or is OOPS enough?
===
I am a C# developer.
My observation in the IT industry as a C# developer is that, technology is always changing or being updated by Microsoft like LINQ, WCF, and WPF etc.
OOPS has been the fundamental for all kinds of developments that we see today in any language.
My question is,
1. Is it good if I am a decent programmer in OOPS but not mastering any specific technology?
2. As a winforms developer, is it necessary to know C++ with C# for better job perspective?
Thanks for your support.
| 1 |
2,581,959 |
04/06/2010 00:33:20
| 266,800 |
02/05/2010 05:59:08
| 1 | 0 |
Cloud Server Configuration
|
What type of rig (server config) would you recommend for building your cloud own server.
|
cloud
| null | null | null | null |
03/29/2012 22:55:35
|
off topic
|
Cloud Server Configuration
===
What type of rig (server config) would you recommend for building your cloud own server.
| 2 |
7,832,274 |
10/20/2011 07:03:25
| 326,089 |
04/26/2010 14:35:48
| 109 | 0 |
Calendar button behaving badly
|
This is a beginner level task. I am trying to implement a calendar widget in django using the following
example: `http://djangosnippets.org/snippets/1629/`
I am putting this calendar inside a form with that already has a submit button.
The problem I am having is that my calendar button submits my form rather than
displaying the calendar widget. The calendar icon and button display properly and I can
see that it has the right code from firebug, but that's about it.
What I really need is an EASY calendar to go along with a ModelForm. I don't
care so much about using the JSCal2 as much as making any calendar work.
Why is my calbutton submitting my form? How do I make it display the widget
and work properly? Any other suggestions to easily get a working calendar?
-------------widgets.py ---------------------
calbtn = u"""<input id="calendar-inputField" /><button id="calendar-trigger"> <img src="%simages/calbutton.gif" alt="calendar" id="%s_btn"
style="cursor: pointer; height="20"; width="20"; border: 1px solid #8888aa;" title="Select date and
time"
onmouseover="this.style.background='#444444';"
onmouseout="this.style.background=''" />
</button>
<script type="text/javascript">
Calendar.setup({
trigger : "calendar-trigger",
inputField : "calendar-inputField"
inputField : "%s",
ifFormat : "%s",
button : "%s_btn",
singleClick : true,
showsTime : true
onSelect : function() { this.hide() }
});
</script>"""
class DateTimeWidget(forms.widgets.TextInput):
dformat = '%Y-%m-%d %H:%M'
def render(self, name, value, attrs=None):
# Same as the example ...
def value_from_datadict(self, data, files, name):
# Same as the example ...
class Media:
css = {
'all': ('/static/calendar/gold.css', )
}
js = ('/static/calendar/jscal2.js',
'/static/calendar/en.js',
)
------------- forms.py ----------------
class CustMainForm(ModelForm):
lastName = forms.CharField(max_length=20)
firstName = forms.CharField(max_length=20)
class Meta:
model = Customer
fields = ('notes', 'saleDate' )
widgets = {
'notes': Textarea(attrs={'cols': 80, 'rows': 20}),
'saleDate' : DateTimeWidget(), # shown above
}
|
django
|
forms
|
calendar
|
widget
| null | null |
open
|
Calendar button behaving badly
===
This is a beginner level task. I am trying to implement a calendar widget in django using the following
example: `http://djangosnippets.org/snippets/1629/`
I am putting this calendar inside a form with that already has a submit button.
The problem I am having is that my calendar button submits my form rather than
displaying the calendar widget. The calendar icon and button display properly and I can
see that it has the right code from firebug, but that's about it.
What I really need is an EASY calendar to go along with a ModelForm. I don't
care so much about using the JSCal2 as much as making any calendar work.
Why is my calbutton submitting my form? How do I make it display the widget
and work properly? Any other suggestions to easily get a working calendar?
-------------widgets.py ---------------------
calbtn = u"""<input id="calendar-inputField" /><button id="calendar-trigger"> <img src="%simages/calbutton.gif" alt="calendar" id="%s_btn"
style="cursor: pointer; height="20"; width="20"; border: 1px solid #8888aa;" title="Select date and
time"
onmouseover="this.style.background='#444444';"
onmouseout="this.style.background=''" />
</button>
<script type="text/javascript">
Calendar.setup({
trigger : "calendar-trigger",
inputField : "calendar-inputField"
inputField : "%s",
ifFormat : "%s",
button : "%s_btn",
singleClick : true,
showsTime : true
onSelect : function() { this.hide() }
});
</script>"""
class DateTimeWidget(forms.widgets.TextInput):
dformat = '%Y-%m-%d %H:%M'
def render(self, name, value, attrs=None):
# Same as the example ...
def value_from_datadict(self, data, files, name):
# Same as the example ...
class Media:
css = {
'all': ('/static/calendar/gold.css', )
}
js = ('/static/calendar/jscal2.js',
'/static/calendar/en.js',
)
------------- forms.py ----------------
class CustMainForm(ModelForm):
lastName = forms.CharField(max_length=20)
firstName = forms.CharField(max_length=20)
class Meta:
model = Customer
fields = ('notes', 'saleDate' )
widgets = {
'notes': Textarea(attrs={'cols': 80, 'rows': 20}),
'saleDate' : DateTimeWidget(), # shown above
}
| 0 |
9,874,785 |
03/26/2012 15:15:27
| 275,651 |
02/17/2010 22:37:18
| 23 | 2 |
Cruise Control .Net exception writing msbuild-results.xml
|
I have a cruise control server running a build on a VM. All I did was change the source control from Perforce to Git, and the build is now failing.
**CCNet Config**
<tasks>
<msbuild>
<executable>C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe</executable>
<workingDirectory>c:\Build\Pcp_Main</workingDirectory>
<buildArgs>/v:d Pcp.proj /target:Clobber;Build /property:Configurations="Debug;Release" /property:NUnitRedirectConsoleOutput=1</buildArgs>
<logger>C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MSBuild.dll</logger>
<timeout>2700</timeout>
</msbuild>
</tasks>
**Build Log**
Done Building Project "c:\Build\Pcp_Main\Pcp.proj" (Clobber;Build target(s)).
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:01:32.39
MSBUILD : error MSB4015: The build stopped unexpectedly because the "ReusableLogger" logger failed unexpectedly during shutdown.
System.IO.DirectoryNotFoundException: Could not find a part of the path 'c:\Build\Pcp_Main\Artifacts\msbuild-results-2d082e8c-0e88-4c0b-9a6b-aa0e3094cab9.xml'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at System.Xml.XmlDocument.Save(String filename)
at ThoughtWorks.CruiseControl.MSBuild.XmlLogger.Shutdown()
at Microsoft.Build.Evaluation.ProjectCollection.ReusableLogger.Shutdown()
at Microsoft.Build.BackEnd.Logging.LoggingService.ShutdownLogger(ILogger logger)
</build>
The folder c:\Build\Pcp_Main\Artifacts\ exists and the user running the build has write access to the folder.
I have also tried changing the logging dll to Rodemeyer.MsBuildToCCnet.dll and I get the same exception.
The project also builds from the command line without any problems.
|
git
|
cruisecontrol.net
|
msbuild-task
|
msbuild-4.0
|
ccnet-config
| null |
open
|
Cruise Control .Net exception writing msbuild-results.xml
===
I have a cruise control server running a build on a VM. All I did was change the source control from Perforce to Git, and the build is now failing.
**CCNet Config**
<tasks>
<msbuild>
<executable>C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe</executable>
<workingDirectory>c:\Build\Pcp_Main</workingDirectory>
<buildArgs>/v:d Pcp.proj /target:Clobber;Build /property:Configurations="Debug;Release" /property:NUnitRedirectConsoleOutput=1</buildArgs>
<logger>C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MSBuild.dll</logger>
<timeout>2700</timeout>
</msbuild>
</tasks>
**Build Log**
Done Building Project "c:\Build\Pcp_Main\Pcp.proj" (Clobber;Build target(s)).
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:01:32.39
MSBUILD : error MSB4015: The build stopped unexpectedly because the "ReusableLogger" logger failed unexpectedly during shutdown.
System.IO.DirectoryNotFoundException: Could not find a part of the path 'c:\Build\Pcp_Main\Artifacts\msbuild-results-2d082e8c-0e88-4c0b-9a6b-aa0e3094cab9.xml'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at System.Xml.XmlDocument.Save(String filename)
at ThoughtWorks.CruiseControl.MSBuild.XmlLogger.Shutdown()
at Microsoft.Build.Evaluation.ProjectCollection.ReusableLogger.Shutdown()
at Microsoft.Build.BackEnd.Logging.LoggingService.ShutdownLogger(ILogger logger)
</build>
The folder c:\Build\Pcp_Main\Artifacts\ exists and the user running the build has write access to the folder.
I have also tried changing the logging dll to Rodemeyer.MsBuildToCCnet.dll and I get the same exception.
The project also builds from the command line without any problems.
| 0 |
8,136,270 |
11/15/2011 12:22:57
| 868,975 |
04/27/2011 09:22:25
| 27 | 1 |
Grails. Select tag
|
I am using 2 select tags. Their content can be modified inside the web page(via javascript).
By default grails will take only the selected option (or all selected options if multiple is enabled) and pass it to the controller.
How could I pass to the controller all the available rows from a select box ?
|
grails
| null | null | null | null | null |
open
|
Grails. Select tag
===
I am using 2 select tags. Their content can be modified inside the web page(via javascript).
By default grails will take only the selected option (or all selected options if multiple is enabled) and pass it to the controller.
How could I pass to the controller all the available rows from a select box ?
| 0 |
8,580,607 |
12/20/2011 19:06:10
| 136,445 |
07/10/2009 18:19:04
| 3,134 | 233 |
Hide action bar menu items from invisible fragment
|
I use 3 FrameLayouts in my activity view xml into which I dynamically insert different fragments. Many of these fragments contribute ActionBar MenuItems. Now I have a situation where I hide a FrameLayout (set visibility to View.GONE) and therefore the Fragment in it becomes invisible. However it still contributes the menu item since the fragment does not to seem to be paused or anything so I cant seem to call a method that actively hides the action bar item.
As a solution I now just insert a fragment into the FrameLayout that has no menu item when I switch the FrameLayout to invisible. While that works it feels like a hack to me. What is the proper way to hide any action bar menu items? What states does the fragment go into if I just hide the layout it is in?
I am doing all this with the compatibility library r6 in case that matters.
|
android
| null | null | null | null | null |
open
|
Hide action bar menu items from invisible fragment
===
I use 3 FrameLayouts in my activity view xml into which I dynamically insert different fragments. Many of these fragments contribute ActionBar MenuItems. Now I have a situation where I hide a FrameLayout (set visibility to View.GONE) and therefore the Fragment in it becomes invisible. However it still contributes the menu item since the fragment does not to seem to be paused or anything so I cant seem to call a method that actively hides the action bar item.
As a solution I now just insert a fragment into the FrameLayout that has no menu item when I switch the FrameLayout to invisible. While that works it feels like a hack to me. What is the proper way to hide any action bar menu items? What states does the fragment go into if I just hide the layout it is in?
I am doing all this with the compatibility library r6 in case that matters.
| 0 |
5,142,448 |
02/28/2011 13:15:00
| 30,099 |
10/21/2008 20:03:54
| 1,571 | 26 |
Is there a utility that will greate an iPhone screenshot with hardware and reflection?
|
I need to take screen shots of my iPhone app and load it on a web site. I know how to get the raw image of the screen but I was wondering if there is a utility out there that can take a screen shot and add the hardware image too?
|
iphone
|
graphics
| null | null | null | null |
open
|
Is there a utility that will greate an iPhone screenshot with hardware and reflection?
===
I need to take screen shots of my iPhone app and load it on a web site. I know how to get the raw image of the screen but I was wondering if there is a utility out there that can take a screen shot and add the hardware image too?
| 0 |
6,131,511 |
05/25/2011 22:01:19
| 695,044 |
04/06/2011 14:40:55
| 1 | 0 |
C++: Array index as reference to instance
|
I have to do some code for the university which gives me a headache. Some of you brilliant minds might help me out :D
I'm asked to create a table in which studentdata is stored (like age and name), and everyone has a unique number for identifying. Though the number shall be stored in an array which will be searched by an algorhithm later on to find specific students.
Now my problem: How do I link the number in the array with the proper instance of class student? Given hint points towards the array index as reference, but I have no clue at all how to implement that.
Thanks in advance :)
|
c++
|
arrays
|
reference
|
index
|
instance
|
05/26/2011 08:03:51
|
not a real question
|
C++: Array index as reference to instance
===
I have to do some code for the university which gives me a headache. Some of you brilliant minds might help me out :D
I'm asked to create a table in which studentdata is stored (like age and name), and everyone has a unique number for identifying. Though the number shall be stored in an array which will be searched by an algorhithm later on to find specific students.
Now my problem: How do I link the number in the array with the proper instance of class student? Given hint points towards the array index as reference, but I have no clue at all how to implement that.
Thanks in advance :)
| 1 |
339,744 |
12/04/2008 06:49:04
| 26,671 |
10/09/2008 23:27:11
| 310 | 20 |
Higher-level languages for stored procedures
|
I'm getting increasingly frustrated with the limitations and verbosity required to actually commit some business logic to stored procedures, using languages such as Transact-SQL or PL/SQL. I would love to convert some current databases to Oracle and take advantage of its support for Java stored procedures, but that option is not available at the moment.
What other alternatives would you recommend in the way of databases that support high level stored procedure languages?
|
stored-procedures
|
database
| null | null | null |
02/13/2012 23:10:12
|
not constructive
|
Higher-level languages for stored procedures
===
I'm getting increasingly frustrated with the limitations and verbosity required to actually commit some business logic to stored procedures, using languages such as Transact-SQL or PL/SQL. I would love to convert some current databases to Oracle and take advantage of its support for Java stored procedures, but that option is not available at the moment.
What other alternatives would you recommend in the way of databases that support high level stored procedure languages?
| 4 |
11,113,557 |
06/20/2012 05:53:06
| 1,365,103 |
04/30/2012 05:21:22
| 6 | 0 |
calling sharepoint webservice in ios with phonegap
|
I am new to phonegap. I need to call SharePoint web service to my ios app with phonegap in html5. Can anyone help? How can it be called? Is is possible?
|
ios
|
html5
|
phonegap
|
sharepoint2010
| null |
06/21/2012 12:22:21
|
not a real question
|
calling sharepoint webservice in ios with phonegap
===
I am new to phonegap. I need to call SharePoint web service to my ios app with phonegap in html5. Can anyone help? How can it be called? Is is possible?
| 1 |
6,735,996 |
07/18/2011 16:19:52
| 662,967 |
03/16/2011 17:14:17
| 460 | 4 |
How to avoid certain formatting with PAR?
|
PAR does i.m.o. a much better formatting as Vim default formatter.
But sometimes PAR does't work very well.
p.e.
<pre>this is a test this is a test this is a test.
this is my text this is my text this is my text.</pre>
formatting with par 44 becomes:
<pre>this is a test this is a test this is a t.
this is tes my text this is my text this t.
this is is my tex t.</pre>
Is there a way to resolve this kind of formattion?
|
vim
|
formatting
|
par
| null | null | null |
open
|
How to avoid certain formatting with PAR?
===
PAR does i.m.o. a much better formatting as Vim default formatter.
But sometimes PAR does't work very well.
p.e.
<pre>this is a test this is a test this is a test.
this is my text this is my text this is my text.</pre>
formatting with par 44 becomes:
<pre>this is a test this is a test this is a t.
this is tes my text this is my text this t.
this is is my tex t.</pre>
Is there a way to resolve this kind of formattion?
| 0 |
5,585,435 |
04/07/2011 17:57:08
| 284,560 |
03/02/2010 16:18:00
| 178 | 13 |
Code First Modeling with Membership Teables
|
I want to track additional user profile information in my own table rather than the default tables setup by asp.net. So how do you make a foreign key to that maps to the aspnet_Users.UserId field in my UserInfoModel class?
public class UserInfoModel
{
[MaxLength(30)]
[Display(Name = "First Name")]
public string FirstName { get; set; }
[MaxLength(50)]
[Display(Name = "Last Name")]
public string LastName { get; set; }
}
|
c#
|
entity-framework-4
|
asp.net-membership
| null | null | null |
open
|
Code First Modeling with Membership Teables
===
I want to track additional user profile information in my own table rather than the default tables setup by asp.net. So how do you make a foreign key to that maps to the aspnet_Users.UserId field in my UserInfoModel class?
public class UserInfoModel
{
[MaxLength(30)]
[Display(Name = "First Name")]
public string FirstName { get; set; }
[MaxLength(50)]
[Display(Name = "Last Name")]
public string LastName { get; set; }
}
| 0 |
9,150,757 |
02/05/2012 16:16:06
| 1,145,718 |
01/12/2012 14:26:22
| 3 | 0 |
Listview Sort with Drag and drop Android
|
Hi i have a problem saving the list after edit the listview with drag and drop.
I'am using the sourche code from here:[Android Drag and Drop List][1]
The code works finde but the new list order is not save when you exit and open the app again:
eks.
i mean first the listview is like this
a
b
c
after drag and drop
c
b
a
but if i quit this app and then start it later , it will still be -> a b c
public class DragNDropListActivity extends ListActivity {
public static String[] mNewPositions;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.dragndroplistview);
ArrayList<String> content = new ArrayList<String>(mListContent.length);
for (int i=0; i < mListContent.length; i++) {
content.add(mListContent[i]);
}
setListAdapter(new DragNDropAdapter(this, new int[]{R.layout.dragitem}, new int[]{R.id.TextView01}, content));//new DragNDropAdapter(this,content)
ListView listView = getListView();
if (listView instanceof DragNDropListView) {
((DragNDropListView) listView).setDropListener(mDropListener);
((DragNDropListView) listView).setRemoveListener(mRemoveListener);
((DragNDropListView) listView).setDragListener(mDragListener);
((DragNDropListView) listView).setPositionListener(mPositionListener);
}
}
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
String selection = (String) getListAdapter().getItem(position);
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
SharedPreferences.Editor editor = preferences.edit();
editor.putString("selection", selection);
editor.commit();
Intent i = new Intent(this, DkNewsActivity.class);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
this.startActivity(i);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case (R.id.Info):
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("market://search?q=pub:notToSee"));
startActivity(intent);
break;
case (R.id.Rate):
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
SharedPreferences.Editor editor = preferences.edit();
editor.putInt("rateDone", 1);
editor.commit();
intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("market://details?id=notToSee"));
startActivity(intent);
break;
}
return true;
}
@Override
public boolean onPrepareOptionsMenu (Menu menu) {
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
//set menu rate visible
if (preferences.getInt("rateDone", 0) == 0){
menu.getItem(1).setVisible(true);
}
else {
menu.getItem(1).setVisible(false);
}
return true;
}
private PositionListener mPositionListener=new PositionListener(){
public void tryToScrollInAndroid_1point5(int position) {
ListAdapter adapter = getListAdapter();
if (adapter instanceof DragNDropAdapter) {
getListView().setSelection(position); //android 1.5
}
}
};
private DropListener mDropListener =
new DropListener() {
public void onDrop(int from, int to) {
ListAdapter adapter = getListAdapter();
if (adapter instanceof DragNDropAdapter) {
((DragNDropAdapter)adapter).onDrop(from, to);
getListView().invalidateViews();
//Saving dragNDropList
mNewPositions = new String[adapter.getCount()]; //Initialize your new items storage
for(int i=0; i < adapter.getCount(); i++) {
//Implement here your logic for save positions
mNewPositions[i] = adapter.getItem(i).toString();
}
}
}
};
private RemoveListener mRemoveListener =
new RemoveListener() {
public void onRemove(int which) {
ListAdapter adapter = getListAdapter();
if (adapter instanceof DragNDropAdapter) {
((DragNDropAdapter)adapter).onRemove(which);
getListView().invalidateViews();
}
}
};
private DragListener mDragListener =
new DragListener() {
int backgroundColor = 0xe0103010;
int defaultBackgroundColor;
public void onDrag(int x, int y, ListView listView) {}
public void onStartDrag(View itemView) {
if (itemView != null){itemView.setVisibility(View.INVISIBLE);
defaultBackgroundColor = itemView.getDrawingCacheBackgroundColor();
itemView.setBackgroundColor(backgroundColor);
ImageView iv = (ImageView)itemView.findViewById(R.id.ImageView01);
if (iv != null) iv.setVisibility(View.INVISIBLE);
}
}
public void onStopDrag(View itemView) {
if (itemView != null){itemView.setVisibility(View.VISIBLE);
itemView.setBackgroundColor(defaultBackgroundColor);
ImageView iv = (ImageView)itemView.findViewById(R.id.ImageView01);
if (iv != null) iv.setVisibility(View.VISIBLE);}
}
};
private static String[] mListContent={
"Item 1", "Item 2", "Item 3", "Item 4", "Item 5", "Item 6", "Item 7","Item 8", "Item 9", "Item 10"
,"Item 11", "Item 12", "Item 13", "Item 14", "Item 15", "Item 16", "Item 17","Item 18", "Item 19", "Item 20"};
}
I believe i have to do something under "private DropListener mDropListener" to save the change and the i need to read the new item position onCreate?
[1]: http://ericharlow.blogspot.com/2010/10/experience-android-drag-and-drop-list.html
|
android
|
listview
|
sorting
|
drag
|
drop
| null |
open
|
Listview Sort with Drag and drop Android
===
Hi i have a problem saving the list after edit the listview with drag and drop.
I'am using the sourche code from here:[Android Drag and Drop List][1]
The code works finde but the new list order is not save when you exit and open the app again:
eks.
i mean first the listview is like this
a
b
c
after drag and drop
c
b
a
but if i quit this app and then start it later , it will still be -> a b c
public class DragNDropListActivity extends ListActivity {
public static String[] mNewPositions;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.dragndroplistview);
ArrayList<String> content = new ArrayList<String>(mListContent.length);
for (int i=0; i < mListContent.length; i++) {
content.add(mListContent[i]);
}
setListAdapter(new DragNDropAdapter(this, new int[]{R.layout.dragitem}, new int[]{R.id.TextView01}, content));//new DragNDropAdapter(this,content)
ListView listView = getListView();
if (listView instanceof DragNDropListView) {
((DragNDropListView) listView).setDropListener(mDropListener);
((DragNDropListView) listView).setRemoveListener(mRemoveListener);
((DragNDropListView) listView).setDragListener(mDragListener);
((DragNDropListView) listView).setPositionListener(mPositionListener);
}
}
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
String selection = (String) getListAdapter().getItem(position);
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
SharedPreferences.Editor editor = preferences.edit();
editor.putString("selection", selection);
editor.commit();
Intent i = new Intent(this, DkNewsActivity.class);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
this.startActivity(i);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case (R.id.Info):
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("market://search?q=pub:notToSee"));
startActivity(intent);
break;
case (R.id.Rate):
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
SharedPreferences.Editor editor = preferences.edit();
editor.putInt("rateDone", 1);
editor.commit();
intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("market://details?id=notToSee"));
startActivity(intent);
break;
}
return true;
}
@Override
public boolean onPrepareOptionsMenu (Menu menu) {
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
//set menu rate visible
if (preferences.getInt("rateDone", 0) == 0){
menu.getItem(1).setVisible(true);
}
else {
menu.getItem(1).setVisible(false);
}
return true;
}
private PositionListener mPositionListener=new PositionListener(){
public void tryToScrollInAndroid_1point5(int position) {
ListAdapter adapter = getListAdapter();
if (adapter instanceof DragNDropAdapter) {
getListView().setSelection(position); //android 1.5
}
}
};
private DropListener mDropListener =
new DropListener() {
public void onDrop(int from, int to) {
ListAdapter adapter = getListAdapter();
if (adapter instanceof DragNDropAdapter) {
((DragNDropAdapter)adapter).onDrop(from, to);
getListView().invalidateViews();
//Saving dragNDropList
mNewPositions = new String[adapter.getCount()]; //Initialize your new items storage
for(int i=0; i < adapter.getCount(); i++) {
//Implement here your logic for save positions
mNewPositions[i] = adapter.getItem(i).toString();
}
}
}
};
private RemoveListener mRemoveListener =
new RemoveListener() {
public void onRemove(int which) {
ListAdapter adapter = getListAdapter();
if (adapter instanceof DragNDropAdapter) {
((DragNDropAdapter)adapter).onRemove(which);
getListView().invalidateViews();
}
}
};
private DragListener mDragListener =
new DragListener() {
int backgroundColor = 0xe0103010;
int defaultBackgroundColor;
public void onDrag(int x, int y, ListView listView) {}
public void onStartDrag(View itemView) {
if (itemView != null){itemView.setVisibility(View.INVISIBLE);
defaultBackgroundColor = itemView.getDrawingCacheBackgroundColor();
itemView.setBackgroundColor(backgroundColor);
ImageView iv = (ImageView)itemView.findViewById(R.id.ImageView01);
if (iv != null) iv.setVisibility(View.INVISIBLE);
}
}
public void onStopDrag(View itemView) {
if (itemView != null){itemView.setVisibility(View.VISIBLE);
itemView.setBackgroundColor(defaultBackgroundColor);
ImageView iv = (ImageView)itemView.findViewById(R.id.ImageView01);
if (iv != null) iv.setVisibility(View.VISIBLE);}
}
};
private static String[] mListContent={
"Item 1", "Item 2", "Item 3", "Item 4", "Item 5", "Item 6", "Item 7","Item 8", "Item 9", "Item 10"
,"Item 11", "Item 12", "Item 13", "Item 14", "Item 15", "Item 16", "Item 17","Item 18", "Item 19", "Item 20"};
}
I believe i have to do something under "private DropListener mDropListener" to save the change and the i need to read the new item position onCreate?
[1]: http://ericharlow.blogspot.com/2010/10/experience-android-drag-and-drop-list.html
| 0 |
6,899,813 |
08/01/2011 14:22:53
| 744,015 |
05/08/2011 15:55:48
| 19 | 1 |
How to dispaly user avatar in Drupal 7?
|
I'd like to know how to display a user avatar in Drupal 7.
I want to display the avatar in full size and as the thumbnail.
|
user
|
display
|
drupal-7
|
avatar
| null | null |
open
|
How to dispaly user avatar in Drupal 7?
===
I'd like to know how to display a user avatar in Drupal 7.
I want to display the avatar in full size and as the thumbnail.
| 0 |
8,967,618 |
01/23/2012 05:41:27
| 1,134,602 |
01/06/2012 15:37:41
| 49 | 0 |
Which pattern should I use?
|
I have been making Android application, and I have following task: which device is shaked application should download data from server, part of this data should be shown on screen, another part shoud be spoken using text2speech class. Which pattern should I use for it?
|
java
|
android
| null | null | null |
01/23/2012 10:44:05
|
not a real question
|
Which pattern should I use?
===
I have been making Android application, and I have following task: which device is shaked application should download data from server, part of this data should be shown on screen, another part shoud be spoken using text2speech class. Which pattern should I use for it?
| 1 |
10,101,593 |
04/11/2012 07:23:41
| 694,119 |
04/06/2011 04:01:40
| 5 | 1 |
What is the best free online private code repository up to now?
|
I would like to know there is any online private code repository that is free and supports auto-build as well as email notification so far?
|
svn
|
repository
|
source-code
|
private
|
online
|
04/12/2012 07:44:22
|
not constructive
|
What is the best free online private code repository up to now?
===
I would like to know there is any online private code repository that is free and supports auto-build as well as email notification so far?
| 4 |
8,859,450 |
01/14/2012 01:41:43
| 798,280 |
06/14/2011 18:28:38
| 29 | 0 |
how to build Gstreamer in Qt SDK source code?
|
in source code of Qt SDK have Gstreamer, but i dont know and nokia have not document guide build it and use it, if you can, please help me build and use it, i want stream audio and video via Internet, thanks a lot
sonnh
skype:sonnh89
|
qt
|
mediaplayer
| null | null | null |
01/18/2012 21:47:13
|
not a real question
|
how to build Gstreamer in Qt SDK source code?
===
in source code of Qt SDK have Gstreamer, but i dont know and nokia have not document guide build it and use it, if you can, please help me build and use it, i want stream audio and video via Internet, thanks a lot
sonnh
skype:sonnh89
| 1 |
7,984,311 |
11/02/2011 17:00:22
| 902,839 |
08/19/2011 17:12:32
| 1,012 | 18 |
How to express current date in MQL Freebase Query?
|
Freebase's [metaweb query language][1] can be used to retreive future events if you pass in an [ISO8601][2] formatted date.
[{
"id": null,
"name": null,
"start_date" : null,
"type": "/time/event",
"start_date>" : "2011-09-02"
}]
^ [run this query][3]
###Does MQL support an equivalent to SQL's `NOW()` or `CURDATE()`?
[1]: http://wiki.freebase.com/wiki/MQL
[2]: http://en.wikipedia.org/wiki/ISO_8601
[3]: http://www.freebase.com/queryeditor?autorun=true&q=%5B%7B%22id%22:null,%22name%22:null,%22type%22:%22/music/concert%22,%22/music/concert/performances%22:%5B%5D%7D%5D
|
query
|
freebase
|
mql
| null | null | null |
open
|
How to express current date in MQL Freebase Query?
===
Freebase's [metaweb query language][1] can be used to retreive future events if you pass in an [ISO8601][2] formatted date.
[{
"id": null,
"name": null,
"start_date" : null,
"type": "/time/event",
"start_date>" : "2011-09-02"
}]
^ [run this query][3]
###Does MQL support an equivalent to SQL's `NOW()` or `CURDATE()`?
[1]: http://wiki.freebase.com/wiki/MQL
[2]: http://en.wikipedia.org/wiki/ISO_8601
[3]: http://www.freebase.com/queryeditor?autorun=true&q=%5B%7B%22id%22:null,%22name%22:null,%22type%22:%22/music/concert%22,%22/music/concert/performances%22:%5B%5D%7D%5D
| 0 |
9,194,520 |
02/08/2012 13:45:59
| 92,213 |
04/17/2009 16:29:40
| 716 | 25 |
How to get to /public outside WEB-INF when using Spring MVC
|
i'm having hard time uploading images to public folder.The public folder is a sibbling of WEB-INF inside Webapp folder.
attempts like
`this.getClass().getResource("/images/16x16").toString()` returns null pointer exception.
i've added image folder as resource
<mvc:resources mapping="/images/**" location="/public/images/" />
is there a way to achieve that? thanks for reading this
|
java-ee
|
web-applications
|
tomcat
|
spring-mvc
|
document-root
| null |
open
|
How to get to /public outside WEB-INF when using Spring MVC
===
i'm having hard time uploading images to public folder.The public folder is a sibbling of WEB-INF inside Webapp folder.
attempts like
`this.getClass().getResource("/images/16x16").toString()` returns null pointer exception.
i've added image folder as resource
<mvc:resources mapping="/images/**" location="/public/images/" />
is there a way to achieve that? thanks for reading this
| 0 |
7,133,951 |
08/20/2011 18:54:55
| 472,292 |
10/11/2010 12:47:44
| 75 | 4 |
Control Best Practices
|
Is it better to only create an instance variable for a control or an instance variable with a property in objective c/xcode?
If you are to create a property is it best to make it atomic or nonatomic (for a control).
For example, what is the best practice for doing the following:
@interface blah
{
UILabel *label;
}
@property (nonatomic, retain) IBOutlet UILabel *label;
OR
@interface blah
{
IBOutlet UILabel *label;
}
OR
@interface blah
{
UILabel *label;
}
@property (retain) IBOutlet UILabel *label;
Then when I dealloc is it best to do:
[self.label release]
or
[label release]
|
objective-c
|
xcode
|
properties
| null | null |
06/10/2012 15:46:53
|
not constructive
|
Control Best Practices
===
Is it better to only create an instance variable for a control or an instance variable with a property in objective c/xcode?
If you are to create a property is it best to make it atomic or nonatomic (for a control).
For example, what is the best practice for doing the following:
@interface blah
{
UILabel *label;
}
@property (nonatomic, retain) IBOutlet UILabel *label;
OR
@interface blah
{
IBOutlet UILabel *label;
}
OR
@interface blah
{
UILabel *label;
}
@property (retain) IBOutlet UILabel *label;
Then when I dealloc is it best to do:
[self.label release]
or
[label release]
| 4 |
6,153,334 |
05/27/2011 14:02:46
| 114,388 |
05/29/2009 16:12:21
| 1,063 | 10 |
Making a better Makefile
|
so I learned what a Makefile was some time ago, created a template Makefile and all I do is copy and alter the same file for every program I'm doing. I changed it a few times, but it's still a very crude Makefile. How should I improve it? This is an example of my current version:
CC = g++
CFLAGS = -std=gnu++0x -m64 -O3 -Wall
IFLAGS = -I/usr/include/igraph
LFLAGS = -ligraph -lgsl -lgslcblas -lm
DFLAGS = -g -pg
# make all
all: run test
# make a fresh compilation from scratch
fresh: clean test
#makes the final executable binary
run: main.o foo1.o foo2.o
$(CC) $(CFLAGS) $(LFLAGS) $^ -o $@
#makes the test executable with debugging and profiling tags
test: test.o foo1.o foo2.o
$(CC) $(DFLAGS) $(CFLAGS) $(LFLAGS) $^ -o $@
#makes teste.o
teste.o: teste.cpp
$(CC) $(CFLAGS) $(IFLAGS) -c $^ -o $@
#makes main.o
main.o: main.cpp
$(CC) $(CFLAGS) $(IFLAGS) -c $^ -o $@
#file foo1
foo1.o: foo1.cpp
$(CC) $(CFLAGS) $(IFLAGS) -c $^ -o $@
#file foo2
foo2.o: foo2.cpp
$(CC) $(CFLAGS) $(IFLAGS) -c $^ -o $@
clean: clean-test clean-o clean-annoying
clean-test:
rm test-rfv
clean-o:
rm *.o -rfv
clean-annoying:
rm *~ -rfv
Just by visually comparing with other makefiles I saw around in the web, this seems to be not a very bright Makefile. I don't know how they work, but I can see there's significantly less boilerplate and more generic code in them.
Can this can be made better, safer, and easier to particularize for each project?
|
makefile
|
code-improvement
| null | null | null | null |
open
|
Making a better Makefile
===
so I learned what a Makefile was some time ago, created a template Makefile and all I do is copy and alter the same file for every program I'm doing. I changed it a few times, but it's still a very crude Makefile. How should I improve it? This is an example of my current version:
CC = g++
CFLAGS = -std=gnu++0x -m64 -O3 -Wall
IFLAGS = -I/usr/include/igraph
LFLAGS = -ligraph -lgsl -lgslcblas -lm
DFLAGS = -g -pg
# make all
all: run test
# make a fresh compilation from scratch
fresh: clean test
#makes the final executable binary
run: main.o foo1.o foo2.o
$(CC) $(CFLAGS) $(LFLAGS) $^ -o $@
#makes the test executable with debugging and profiling tags
test: test.o foo1.o foo2.o
$(CC) $(DFLAGS) $(CFLAGS) $(LFLAGS) $^ -o $@
#makes teste.o
teste.o: teste.cpp
$(CC) $(CFLAGS) $(IFLAGS) -c $^ -o $@
#makes main.o
main.o: main.cpp
$(CC) $(CFLAGS) $(IFLAGS) -c $^ -o $@
#file foo1
foo1.o: foo1.cpp
$(CC) $(CFLAGS) $(IFLAGS) -c $^ -o $@
#file foo2
foo2.o: foo2.cpp
$(CC) $(CFLAGS) $(IFLAGS) -c $^ -o $@
clean: clean-test clean-o clean-annoying
clean-test:
rm test-rfv
clean-o:
rm *.o -rfv
clean-annoying:
rm *~ -rfv
Just by visually comparing with other makefiles I saw around in the web, this seems to be not a very bright Makefile. I don't know how they work, but I can see there's significantly less boilerplate and more generic code in them.
Can this can be made better, safer, and easier to particularize for each project?
| 0 |
61,324 |
09/14/2008 13:17:08
| 445,087 |
09/02/2008 17:25:48
| 478 | 16 |
Best Parctices for Architecting Large Systems in a Dynamic Language
|
From my experiences building non-trivial applications in Java and C# I know that using good modular design based on known patterns and "coding to interfaces" are keys to success.
What are the architecture best practices when building large systems in a dynamic language like: python or ruby?
|
python
|
ruby
|
architecture
|
dynamic-languages
| null |
05/22/2012 12:23:55
|
not constructive
|
Best Parctices for Architecting Large Systems in a Dynamic Language
===
From my experiences building non-trivial applications in Java and C# I know that using good modular design based on known patterns and "coding to interfaces" are keys to success.
What are the architecture best practices when building large systems in a dynamic language like: python or ruby?
| 4 |
1,563,243 |
10/13/2009 22:12:46
| 135,952 |
07/09/2009 22:37:00
| 1,845 | 154 |
Books that will cover TDD, DDD and Design Patterns in .NET
|
I would like to get book(s) that will really give me a complete view of modern ASP.NET development using C#, TDD, ASP.NET MVC, DDD and Design Patterns such as the Repository pattern. I'm very competent with C# and ASP.NET MVC, but want to fill in the gaps.
If you've had a good experience with a book or two that covers these topics could you please share them?
|
domain-driven-design
|
tdd
|
repository-pattern
|
asp.net
|
asp.net-mvc
| null |
open
|
Books that will cover TDD, DDD and Design Patterns in .NET
===
I would like to get book(s) that will really give me a complete view of modern ASP.NET development using C#, TDD, ASP.NET MVC, DDD and Design Patterns such as the Repository pattern. I'm very competent with C# and ASP.NET MVC, but want to fill in the gaps.
If you've had a good experience with a book or two that covers these topics could you please share them?
| 0 |
3,693,014 |
09/11/2010 23:00:44
| 388,548 |
05/19/2009 19:23:33
| 104 | 2 |
BigDecimal from Double incorrect value?
|
I am trying to make a BigDecimal from a string. Don't ask me why, I just need it! This is my code:
Double theDouble = new Double(".3");
System.out.println("The Double: " + theDouble.toString());
BigDecimal theBigDecimal = new BigDecimal(theDouble);
System.out.println("The Big: " + theBigDecimal.toString());
This is the output I get?
The Double: 0.3
The Big: 0.299999999999999988897769753748434595763683319091796875
Any ideas?
|
java
|
double
|
bigdecimal
| null | null | null |
open
|
BigDecimal from Double incorrect value?
===
I am trying to make a BigDecimal from a string. Don't ask me why, I just need it! This is my code:
Double theDouble = new Double(".3");
System.out.println("The Double: " + theDouble.toString());
BigDecimal theBigDecimal = new BigDecimal(theDouble);
System.out.println("The Big: " + theBigDecimal.toString());
This is the output I get?
The Double: 0.3
The Big: 0.299999999999999988897769753748434595763683319091796875
Any ideas?
| 0 |
4,212,780 |
11/18/2010 08:11:32
| 496,387 |
11/03/2010 19:23:53
| 17 | 0 |
Skills required to develop html5 application
|
what are the skills combination required to develop html5 application ?
|
html5
|
application
| null | null | null |
11/18/2010 08:22:45
|
not a real question
|
Skills required to develop html5 application
===
what are the skills combination required to develop html5 application ?
| 1 |
1,670,094 |
11/03/2009 20:57:27
| 142,178 |
07/21/2009 17:26:08
| 179 | 32 |
Why do I get this error when reading this url with rebol
|
http://www.informit.com/guides/content.aspx?g=dotnet&seqNum=759
>> read http://www.informit.com/guides/content.aspx?g=dotnet&s
eqNum=759
connecting to: www.informit.com
** User Error: HTTP forwarding error: Scheme https for URL htt
ps://memberservices.informit.com/checkLogin.ashx?partner=53&r=
http%3a%2f%...
** Near: read http://www.informit.com/guides/content.aspx?g=do
tnet&seqNum=759
>>
This doesn't happen with Firefox, is it possible to "simulate" firefox ?
|
rebol
| null | null | null | null | null |
open
|
Why do I get this error when reading this url with rebol
===
http://www.informit.com/guides/content.aspx?g=dotnet&seqNum=759
>> read http://www.informit.com/guides/content.aspx?g=dotnet&s
eqNum=759
connecting to: www.informit.com
** User Error: HTTP forwarding error: Scheme https for URL htt
ps://memberservices.informit.com/checkLogin.ashx?partner=53&r=
http%3a%2f%...
** Near: read http://www.informit.com/guides/content.aspx?g=do
tnet&seqNum=759
>>
This doesn't happen with Firefox, is it possible to "simulate" firefox ?
| 0 |
10,122,466 |
04/12/2012 11:16:44
| 1,046,571 |
11/14/2011 23:58:55
| 55 | 0 |
where to store Serial number in an embedded system running fedora 11
|
I have to implement a functionality to set serial number in an embedded product using C++ and json string for the production team.
My question is where will I saved or stored the serial number so that user cant play with it. The product is an embedded system and OS (Fedora ) is on Compact Flash card.
Thanks and regards,
Sam
|
linux
|
embedded
|
embedded-linux
| null | null |
04/14/2012 12:58:38
|
not a real question
|
where to store Serial number in an embedded system running fedora 11
===
I have to implement a functionality to set serial number in an embedded product using C++ and json string for the production team.
My question is where will I saved or stored the serial number so that user cant play with it. The product is an embedded system and OS (Fedora ) is on Compact Flash card.
Thanks and regards,
Sam
| 1 |
7,292,806 |
09/03/2011 11:23:48
| 926,550 |
09/03/2011 11:13:20
| 1 | 0 |
Nginx name based virtual hosting default site
|
I am trying to figure out how to configure my Nginx virtual host files. Here's what I have.
In my DNS (at the registrar), I direct *.sitename.com to a single IP address, say 123.456.789.012
Now, on the server itself, I am running Nginx, with virtual hosts.
I have serveral virtual hosts, say
www.sitename.com
demo1.sitename.com
...etc...
demo5.sitename.com
The problem I am trying to solve, is that I want to redirect all requests for subdomains not defined explicitly as virtual hosts, to the www.sitename.com.
So, if someone requests someundefined.sitename.com, I want to redirect this request to www.sitename.com
At the moment though, Nginx just redirects them to demo1.sitename.com ... I cannot figure out how to keep all the other virtual hosts working, whilst redirecting all the unnamed ones to the main site.
|
nginx
|
redirect
| null | null | null |
09/03/2011 18:55:08
|
off topic
|
Nginx name based virtual hosting default site
===
I am trying to figure out how to configure my Nginx virtual host files. Here's what I have.
In my DNS (at the registrar), I direct *.sitename.com to a single IP address, say 123.456.789.012
Now, on the server itself, I am running Nginx, with virtual hosts.
I have serveral virtual hosts, say
www.sitename.com
demo1.sitename.com
...etc...
demo5.sitename.com
The problem I am trying to solve, is that I want to redirect all requests for subdomains not defined explicitly as virtual hosts, to the www.sitename.com.
So, if someone requests someundefined.sitename.com, I want to redirect this request to www.sitename.com
At the moment though, Nginx just redirects them to demo1.sitename.com ... I cannot figure out how to keep all the other virtual hosts working, whilst redirecting all the unnamed ones to the main site.
| 2 |
3,348,442 |
07/27/2010 22:10:29
| 369,819 |
06/17/2010 21:48:41
| 71 | 13 |
What is the best way to implement notification in a C# web application?
|
What is the best way to implement notification in a C# web application? If this was an EAI BPEL application, I would be using the notification feature within the BPEL specifications to emit events at key tasks I want to monitor. Since this is a C# web application, what are the architectural options? Should I drop messages via pub/sub using NServiceBus at points I want to monitor or should I use .Net event handling to attach to methods I care about or a mixture of both or is there an option I'm not aware of. The case I'm trying to optimize is the least amount of code with the maximum flexibility and scalability.
|
c#
|
notifications
| null | null | null | null |
open
|
What is the best way to implement notification in a C# web application?
===
What is the best way to implement notification in a C# web application? If this was an EAI BPEL application, I would be using the notification feature within the BPEL specifications to emit events at key tasks I want to monitor. Since this is a C# web application, what are the architectural options? Should I drop messages via pub/sub using NServiceBus at points I want to monitor or should I use .Net event handling to attach to methods I care about or a mixture of both or is there an option I'm not aware of. The case I'm trying to optimize is the least amount of code with the maximum flexibility and scalability.
| 0 |
10,466,990 |
05/06/2012 00:05:26
| 1,377,418 |
05/05/2012 23:02:39
| 1 | 0 |
multiple threads in Intel core 2, i-series of processors?
|
Will the performance be improved more than 25% if the a singled threaded task (pure computation) is split into multiple threads in Intel core 2, i-series of processors ?
Note - As I know One core executes one thread at a time
The hardware is changed from 2000 to 2012, but the style of programming is not changed that much
Scenarios1 - Just one application is running which is very ideal case
Scenario 2 - Multiple applications are running which is our day to day usage
Thanks in advance
|
x86
|
core
|
intel
| null | null |
05/06/2012 02:09:09
|
not a real question
|
multiple threads in Intel core 2, i-series of processors?
===
Will the performance be improved more than 25% if the a singled threaded task (pure computation) is split into multiple threads in Intel core 2, i-series of processors ?
Note - As I know One core executes one thread at a time
The hardware is changed from 2000 to 2012, but the style of programming is not changed that much
Scenarios1 - Just one application is running which is very ideal case
Scenario 2 - Multiple applications are running which is our day to day usage
Thanks in advance
| 1 |
962,512 |
06/07/2009 18:40:16
| 105,768 |
05/12/2009 21:53:28
| 45 | 4 |
How to use two TSplitter with different aligns (Horizontal and Vertical) ?
|
I have a form with three sections, and I want to allow the users to resize them as they please
There is one section on the left (which take the whole height) and one on the right that is again cut in two vertically. See below:
11|22<br />
11|---<br />
11|33<br />
Using one splitter is quite easy:
<pre>Component1.align := alLeft
Splitter1.align := alLeft
Component2.align := alClient</pre>
Now, starting with that I have absolutely no idea how to get a vertical splitter working. If I set my second splitter to alTop or alBottom, it does all the way to the top/bottom and not only in the right half.
One possible solution is to use a panel as my right side and then use a splitter INSIDE this pannel for vertical splitting but it doesn't really feels like the right way.
Thanks
|
delphi
|
splitter
| null | null | null | null |
open
|
How to use two TSplitter with different aligns (Horizontal and Vertical) ?
===
I have a form with three sections, and I want to allow the users to resize them as they please
There is one section on the left (which take the whole height) and one on the right that is again cut in two vertically. See below:
11|22<br />
11|---<br />
11|33<br />
Using one splitter is quite easy:
<pre>Component1.align := alLeft
Splitter1.align := alLeft
Component2.align := alClient</pre>
Now, starting with that I have absolutely no idea how to get a vertical splitter working. If I set my second splitter to alTop or alBottom, it does all the way to the top/bottom and not only in the right half.
One possible solution is to use a panel as my right side and then use a splitter INSIDE this pannel for vertical splitting but it doesn't really feels like the right way.
Thanks
| 0 |
9,906,953 |
03/28/2012 11:54:12
| 1,298,054 |
03/28/2012 11:40:58
| 1 | 0 |
How to collect data from social networks using C# or other OOP?
|
I'm having a reasearch called "Data Mining on Social Networks". In the first part I used user ready programs like NodeXL and Netminer. Because of the programs limitations the reasearchs mining part lacked. So I need to have a more sophisticated data mining reasearch using object oriented programs and I am asking how.
|
c#
|
oop
|
social-networking
|
data-mining
| null |
03/29/2012 12:54:28
|
not constructive
|
How to collect data from social networks using C# or other OOP?
===
I'm having a reasearch called "Data Mining on Social Networks". In the first part I used user ready programs like NodeXL and Netminer. Because of the programs limitations the reasearchs mining part lacked. So I need to have a more sophisticated data mining reasearch using object oriented programs and I am asking how.
| 4 |
10,423,823 |
05/03/2012 01:07:09
| 1,039,143 |
11/10/2011 06:30:09
| 164 | 10 |
Postgresql breaking rails querying functionality
|
I have a rails app that was working fine with sqlite but upon switching over to postgre I'm having an issue with this query:
User.find(2).ratings.query
Querying for just one user works, e.g.
User.find(1)
produces
SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 1]]
however if I append ratings like so:
User.find(1).ratings
produces
User Load (1.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 1]]
Rating Load (0.9ms) SELECT "ratings".* FROM "ratings" WHERE "ratings"."user_id" = 1
PG::Error: ERROR: operator does not exist: character varying = integer
LINE 1: ...CT "ratings".* FROM "ratings" WHERE "ratings"."user_id" = 1
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
: SELECT "ratings".* FROM "ratings" WHERE "ratings"."user_id" = 1
ActiveRecord::StatementInvalid: PG::Error: ERROR: operator does not exist: character varying = integer
LINE 1: ...CT "ratings".* FROM "ratings" WHERE "ratings"."user_id" = 1
^
Whether a pass the :id as an int or string it still produces the above error. The models are set up so :ratings belongs_to User which has_many :ratings. Any ideas? Thanks in advance.
Versions: Rails 3.1.1, Ruby 1.9.2, devise 1.5.1
|
ruby-on-rails
|
ruby-on-rails-3
|
postgresql
| null | null | null |
open
|
Postgresql breaking rails querying functionality
===
I have a rails app that was working fine with sqlite but upon switching over to postgre I'm having an issue with this query:
User.find(2).ratings.query
Querying for just one user works, e.g.
User.find(1)
produces
SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 1]]
however if I append ratings like so:
User.find(1).ratings
produces
User Load (1.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 1]]
Rating Load (0.9ms) SELECT "ratings".* FROM "ratings" WHERE "ratings"."user_id" = 1
PG::Error: ERROR: operator does not exist: character varying = integer
LINE 1: ...CT "ratings".* FROM "ratings" WHERE "ratings"."user_id" = 1
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
: SELECT "ratings".* FROM "ratings" WHERE "ratings"."user_id" = 1
ActiveRecord::StatementInvalid: PG::Error: ERROR: operator does not exist: character varying = integer
LINE 1: ...CT "ratings".* FROM "ratings" WHERE "ratings"."user_id" = 1
^
Whether a pass the :id as an int or string it still produces the above error. The models are set up so :ratings belongs_to User which has_many :ratings. Any ideas? Thanks in advance.
Versions: Rails 3.1.1, Ruby 1.9.2, devise 1.5.1
| 0 |
8,489,920 |
12/13/2011 13:18:35
| 981,993 |
10/06/2011 10:22:32
| 28 | 0 |
How to implement a log in system using CI sessions that is stored in databases
|
I have a table with the following columns:
session_id varchar(40) No 0
ip_address varchar(16) No 0
user_agent varchar(50) No
last_activity int(10) No 0
user_data text No
I tried adding 2 more columns(`is_logged`, `user_id`), but my PHP script just assign it to `NULL`,
Other columns are assigned automatically by Codeigniter.
this is my PHP script:
$user_data = array(
'id' => $row->id,
'is_logged' => TRUE
);
$this->session->set_userdata($user_data);
Note:
I'm new to Codeigniter.
|
database
|
codeigniter
|
session
|
login
|
mysqli
| null |
open
|
How to implement a log in system using CI sessions that is stored in databases
===
I have a table with the following columns:
session_id varchar(40) No 0
ip_address varchar(16) No 0
user_agent varchar(50) No
last_activity int(10) No 0
user_data text No
I tried adding 2 more columns(`is_logged`, `user_id`), but my PHP script just assign it to `NULL`,
Other columns are assigned automatically by Codeigniter.
this is my PHP script:
$user_data = array(
'id' => $row->id,
'is_logged' => TRUE
);
$this->session->set_userdata($user_data);
Note:
I'm new to Codeigniter.
| 0 |
7,552,735 |
09/26/2011 08:50:37
| 774,105 |
05/28/2011 07:12:17
| 54 | 1 |
Jquery mobile orientation change returns opposite value
|
I am currently working on a mobile website using jquery mobile and I encountered problem in detecting orientation change. My mobile website detects the orientation as "landscape" when in portrait mode and vice versa when testing on my Samsung Galaxy. However, working properly on iphone n HTC Desire. I did find in some forums that described that as Android bug and someone used setTimeOut to tackle it. But I can't solve the problem using that. Not sure if it's my syntax error or not. Can someone kindly enlighten me? Thanks in advance.
Sample code will be much appreciated.
Here is my current code:
$(document).ready(function() {
$(window).bind("orientationchange", function (event) {
setTimeout(detectOri(event),100);
});
function detectOri(event)
{
alert(event.orientation);
if(event.orientation == 'portrait')
{
//load portrait mode page
}
else if(event.orientation == 'landscape')
{
//load landscape mode page
}
}
});
|
android
|
jquery-mobile
|
orientation-changes
| null | null | null |
open
|
Jquery mobile orientation change returns opposite value
===
I am currently working on a mobile website using jquery mobile and I encountered problem in detecting orientation change. My mobile website detects the orientation as "landscape" when in portrait mode and vice versa when testing on my Samsung Galaxy. However, working properly on iphone n HTC Desire. I did find in some forums that described that as Android bug and someone used setTimeOut to tackle it. But I can't solve the problem using that. Not sure if it's my syntax error or not. Can someone kindly enlighten me? Thanks in advance.
Sample code will be much appreciated.
Here is my current code:
$(document).ready(function() {
$(window).bind("orientationchange", function (event) {
setTimeout(detectOri(event),100);
});
function detectOri(event)
{
alert(event.orientation);
if(event.orientation == 'portrait')
{
//load portrait mode page
}
else if(event.orientation == 'landscape')
{
//load landscape mode page
}
}
});
| 0 |
4,193,392 |
11/16/2010 10:55:28
| 248,733 |
01/12/2010 09:11:51
| 121 | 3 |
Which is the best file explorer or file commander
|
I need file explorer or file commander which search strings in more than one text file in the same time. Like FreeCommander but they doesn't search good enough.
|
file
|
search
|
text
| null | null | null |
open
|
Which is the best file explorer or file commander
===
I need file explorer or file commander which search strings in more than one text file in the same time. Like FreeCommander but they doesn't search good enough.
| 0 |
1,183,982 |
07/26/2009 07:34:40
| 30,572 |
10/22/2008 23:23:56
| 189 | 11 |
WPF - How to make Style.Triggers trigger a different named style to be applied
|
Lets say I have the below:
<Style TargetType="{x:Type TextBox}">
<Setter Property="BorderThickness" Value="1" />
<Setter Property="BorderBrush" Value="Gray" />
<Style.Triggers>
<Trigger Property="IsFocused" Value="true">
<Setter Property="BorderBrush" Value="Green" />
<Setter Property="BorderThickness" Value="2" />
</Trigger>
</Style.Triggers>
</Style>
This works fine and there is nothing too much wrong here, but it is a fairly simple case. What happens if I want to have the IsFocused style state listed as a exsplicit style how do reference that style as being the IsFocused style, i.e.
<Style x:key="ActiveStyle" TargetType="{x:Type TextBox}">
<Setter Property="BorderBrush" Value="Green" />
<Setter Property="BorderThickness" Value="2" />
</Style>
<Style TargetType="{x:Type TextBox}">
<Setter Property="BorderThickness" Value="1" />
<Setter Property="BorderBrush" Value="Gray" />
<Style.Triggers>
<Trigger Property="IsFocused" Value="true">
-- Here I want to reference ActiveStyle and not copy the copy the setters
</Trigger>
</Style.Triggers>
</Style>
Cheers
Anthony
|
wpf
|
setter
|
triggers
|
styles
| null | null |
open
|
WPF - How to make Style.Triggers trigger a different named style to be applied
===
Lets say I have the below:
<Style TargetType="{x:Type TextBox}">
<Setter Property="BorderThickness" Value="1" />
<Setter Property="BorderBrush" Value="Gray" />
<Style.Triggers>
<Trigger Property="IsFocused" Value="true">
<Setter Property="BorderBrush" Value="Green" />
<Setter Property="BorderThickness" Value="2" />
</Trigger>
</Style.Triggers>
</Style>
This works fine and there is nothing too much wrong here, but it is a fairly simple case. What happens if I want to have the IsFocused style state listed as a exsplicit style how do reference that style as being the IsFocused style, i.e.
<Style x:key="ActiveStyle" TargetType="{x:Type TextBox}">
<Setter Property="BorderBrush" Value="Green" />
<Setter Property="BorderThickness" Value="2" />
</Style>
<Style TargetType="{x:Type TextBox}">
<Setter Property="BorderThickness" Value="1" />
<Setter Property="BorderBrush" Value="Gray" />
<Style.Triggers>
<Trigger Property="IsFocused" Value="true">
-- Here I want to reference ActiveStyle and not copy the copy the setters
</Trigger>
</Style.Triggers>
</Style>
Cheers
Anthony
| 0 |
9,716,154 |
03/15/2012 08:28:58
| 755,255 |
05/16/2011 07:24:23
| 201 | 29 |
Populating temporary table with result of independent Sql Query
|
I want to return a temporary table from `stored procedure` which populates with data retrieved from two independent sql query
Select column1,column2 FROM TABLE1 WHERE someCondition
Select column3,column4 FROM TABLE1 WHERE someOtherCondition
INSERT INTO Temp_table(column1,column2,column3,column4) values VALUE from those two table
Some of the result from table contains null as well.Also i am using some mathematical function like `sum` on some column as well
Thanks in advance
|
sql
|
sql-server-2005
| null | null | null | null |
open
|
Populating temporary table with result of independent Sql Query
===
I want to return a temporary table from `stored procedure` which populates with data retrieved from two independent sql query
Select column1,column2 FROM TABLE1 WHERE someCondition
Select column3,column4 FROM TABLE1 WHERE someOtherCondition
INSERT INTO Temp_table(column1,column2,column3,column4) values VALUE from those two table
Some of the result from table contains null as well.Also i am using some mathematical function like `sum` on some column as well
Thanks in advance
| 0 |
7,027,997 |
08/11/2011 14:50:44
| 888,420 |
08/10/2011 17:16:35
| 32 | 0 |
How to echo a string using XPath syntax?
|
I would like to echo a string "mystring" using XPath syntax.
I mean Xpath is for selecting from xml , hovever I would like to send a certain value like "mystring" using it.
Is this possible?
How to achieve this?
|
xml
|
xpath
| null | null | null |
08/11/2011 20:43:03
|
not a real question
|
How to echo a string using XPath syntax?
===
I would like to echo a string "mystring" using XPath syntax.
I mean Xpath is for selecting from xml , hovever I would like to send a certain value like "mystring" using it.
Is this possible?
How to achieve this?
| 1 |
7,155,022 |
08/23/2011 00:15:24
| 535,967 |
12/09/2010 05:51:49
| 781 | 3 |
Set page's title based on another's URL title?
|
How do I set my title tag inner HTML to match the Title tag from an URL stored in the variable: $url?
I should somehow retrieve the Title on the url $url and then echo it inside my title tag.
How can I do this?
|
php
|
javascript
| null | null | null |
08/23/2011 21:40:57
|
not a real question
|
Set page's title based on another's URL title?
===
How do I set my title tag inner HTML to match the Title tag from an URL stored in the variable: $url?
I should somehow retrieve the Title on the url $url and then echo it inside my title tag.
How can I do this?
| 1 |
2,246,540 |
02/11/2010 18:07:56
| 249,034 |
11/09/2009 18:35:30
| 43 | 7 |
css not working in table "td" , but it works for "th"....what's going on?
|
I've been coding a webapp for some time now and all the layout, css was working fine. Some time in the last week or so I made some kind of a change that I absolutely have no idea what I changed that is causing this problem and I've tried reversing the code with no luck. I have figured out however that the problem goes away if I use a `<th>` in place of a `<td>` in my tables. Problem is there are thousands of lines of code that have to be modified and I'm using the tables to display my columnar data read out of the db. If I can avoid having to change the `<td>` tags to `<th>` I will be really happy.
I use css to style the column names. Can anyone explain why the following now fails when it has worked fine for 8 months now. I know the code obviously changed somewhere, but I'm clueless where to look....perhaps your explanation will give me an idea where to look in my code.
This used to work but now displays only grey text in the FIELD_name area:
`<td class="FIELD_name">Field Name:</td><td class="FIELD_text">small grey text here"</td>`
If I do this I get the proper display (using "th" instead of "td"):
`<th class="FIELD_name">Field Name:</th><th class="FIELD_text">small grey text here"</th>`
or if I use a span tag like this it also works:
`<td><span class="FIELD_name">Field Name:</span></td><td class="FIELD_text">small grey text here"</td>`
Here's the CSS:
.FIELD_name {
font-family: Tahoma;
font-size: 11px;
font-style: normal;
color: #135386;
font-weight: bold;
}
.FIELD_text {
font-family: "Times New Roman", Times, serif;
font-size: 12px;
font-style: normal;
color: #666666;
font-weight: bold;
}
I'm hoping it's just a simple code fix somewhere...your help is appreciated. thanks.
|
html
|
table
|
css
| null | null |
02/07/2012 20:49:36
|
too localized
|
css not working in table "td" , but it works for "th"....what's going on?
===
I've been coding a webapp for some time now and all the layout, css was working fine. Some time in the last week or so I made some kind of a change that I absolutely have no idea what I changed that is causing this problem and I've tried reversing the code with no luck. I have figured out however that the problem goes away if I use a `<th>` in place of a `<td>` in my tables. Problem is there are thousands of lines of code that have to be modified and I'm using the tables to display my columnar data read out of the db. If I can avoid having to change the `<td>` tags to `<th>` I will be really happy.
I use css to style the column names. Can anyone explain why the following now fails when it has worked fine for 8 months now. I know the code obviously changed somewhere, but I'm clueless where to look....perhaps your explanation will give me an idea where to look in my code.
This used to work but now displays only grey text in the FIELD_name area:
`<td class="FIELD_name">Field Name:</td><td class="FIELD_text">small grey text here"</td>`
If I do this I get the proper display (using "th" instead of "td"):
`<th class="FIELD_name">Field Name:</th><th class="FIELD_text">small grey text here"</th>`
or if I use a span tag like this it also works:
`<td><span class="FIELD_name">Field Name:</span></td><td class="FIELD_text">small grey text here"</td>`
Here's the CSS:
.FIELD_name {
font-family: Tahoma;
font-size: 11px;
font-style: normal;
color: #135386;
font-weight: bold;
}
.FIELD_text {
font-family: "Times New Roman", Times, serif;
font-size: 12px;
font-style: normal;
color: #666666;
font-weight: bold;
}
I'm hoping it's just a simple code fix somewhere...your help is appreciated. thanks.
| 3 |
7,878,819 |
10/24/2011 16:32:58
| 15,985 |
09/17/2008 13:55:21
| 3,179 | 85 |
NServiceBus: How to stop distributor acting as a processing bottleneck (reduces rate 65%)
|
We have an event processing system that will process events sent directly from the source to handler process at 200 eps (events per second). The queues and message sends are transactional. Adding the NSB distributor between the event generator and the handler process reduces this rate from 200 eps to 70 eps. The disk usage and CPU on the distributor box become significantly higher as well.
Seen with commercial build of NServiceBus, version 2.6.0.1505.
Has anyone else seen this behaviour or have any advice?
|
performance
|
transactions
|
msmq
|
nservicebus
|
distributor
| null |
open
|
NServiceBus: How to stop distributor acting as a processing bottleneck (reduces rate 65%)
===
We have an event processing system that will process events sent directly from the source to handler process at 200 eps (events per second). The queues and message sends are transactional. Adding the NSB distributor between the event generator and the handler process reduces this rate from 200 eps to 70 eps. The disk usage and CPU on the distributor box become significantly higher as well.
Seen with commercial build of NServiceBus, version 2.6.0.1505.
Has anyone else seen this behaviour or have any advice?
| 0 |
7,037,464 |
08/12/2011 08:28:28
| 372,526 |
06/20/2010 02:28:27
| 434 | 1 |
PYTHON- Given a starting word, which sequence of letters will allow you to maximize the number of valid words that can be spelled
|
I was inspired to write a program based on the card game Scrabble Slam! I'm new to algorithms, however, and can't think of an efficient way of solving this problem:
You start with a string containing an English-valid 4 letter word. You can place one letter on that word at a time such that by placing the letter you form a new dictionary-valid word. The letters that you have are equal to the letters in the alphabet.
For example if the starting word was "cart", this could be a valid sequence of moves:
sand --> sane --> sine --> line --> lins --> pins --> fins , etc.
The goal is to maximize the number of words in a sequence by using as many letters of the alphabet (without using a letter more than once).
My algorithm can't find the longest sequence, just a guess at what the longest might be.
First, it gets a list of all words that can be formed by changing one letter of the starting word. That list is called 'adjacentList.' It then looks through all the words in adjacentList and finds which of those words have the most adjacent words. Whichever word has the most adjacentWords, it chooses to turn the starting word into.
For example, the word sane can be turned in 28 other words, the word sine can be turned into 27 other words, the word line can be turned into 30 other words-- each one of these choices was made to maximize the likelihood that more and more words could be spelled.
##Returns a list of all adjacent words. Lists contain tuples of the adjacent word and the letter that
##makes the difference between those two words.
def adjacentWords(userWord):
adjacentList, exactMatches, wrongMatches = list(), list(), str()
for dictWords in allWords:
for a,b in zip(userWord, dictWords):
if a==b: exactMatches.append(a)
else: wrongMatches = b
if len(exactMatches) == 3:
adjacentList.append((dictWords, wrongMatches))
exactMatches, wrongMatches = list(), list()
return adjacentList
#return [dictWords for dictWords in allWords if len([0 for a,b in zip(userWord, dictWords) if a==b]) == 3]
def adjacentLength(content):
return (len(adjacentWords(content[0])), content[0], content[1])
#Find a word that can be turned into the most other words by changing one letter
def maxLength(adjacentList, startingLetters):
return max(adjacentLength(content) for content in adjacentList if content[1] in startingLetters)
def main():
startingWord = "sand"
startingLetters = "a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z".replace(" ", "").split(',')
existingWords = list()
while True:
adjacentList = adjacentWords(startingWord)
letterChoice = maxLength(adjacentList, startingLetters)
if letterChoice[1] not in existingWords:
print "Going to use letter: "+ str(letterChoice[2]) + " to spell the word "+ str(letterChoice[1]) + " with "+ str(letterChoice[0]) + " possibilities."
existingWords.append(letterChoice[1])
startingLetters.remove(str(letterChoice[2]))
startingWord = letterChoice[1]
main()
|
python
|
algorithm
|
trie
| null | null | null |
open
|
PYTHON- Given a starting word, which sequence of letters will allow you to maximize the number of valid words that can be spelled
===
I was inspired to write a program based on the card game Scrabble Slam! I'm new to algorithms, however, and can't think of an efficient way of solving this problem:
You start with a string containing an English-valid 4 letter word. You can place one letter on that word at a time such that by placing the letter you form a new dictionary-valid word. The letters that you have are equal to the letters in the alphabet.
For example if the starting word was "cart", this could be a valid sequence of moves:
sand --> sane --> sine --> line --> lins --> pins --> fins , etc.
The goal is to maximize the number of words in a sequence by using as many letters of the alphabet (without using a letter more than once).
My algorithm can't find the longest sequence, just a guess at what the longest might be.
First, it gets a list of all words that can be formed by changing one letter of the starting word. That list is called 'adjacentList.' It then looks through all the words in adjacentList and finds which of those words have the most adjacent words. Whichever word has the most adjacentWords, it chooses to turn the starting word into.
For example, the word sane can be turned in 28 other words, the word sine can be turned into 27 other words, the word line can be turned into 30 other words-- each one of these choices was made to maximize the likelihood that more and more words could be spelled.
##Returns a list of all adjacent words. Lists contain tuples of the adjacent word and the letter that
##makes the difference between those two words.
def adjacentWords(userWord):
adjacentList, exactMatches, wrongMatches = list(), list(), str()
for dictWords in allWords:
for a,b in zip(userWord, dictWords):
if a==b: exactMatches.append(a)
else: wrongMatches = b
if len(exactMatches) == 3:
adjacentList.append((dictWords, wrongMatches))
exactMatches, wrongMatches = list(), list()
return adjacentList
#return [dictWords for dictWords in allWords if len([0 for a,b in zip(userWord, dictWords) if a==b]) == 3]
def adjacentLength(content):
return (len(adjacentWords(content[0])), content[0], content[1])
#Find a word that can be turned into the most other words by changing one letter
def maxLength(adjacentList, startingLetters):
return max(adjacentLength(content) for content in adjacentList if content[1] in startingLetters)
def main():
startingWord = "sand"
startingLetters = "a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z".replace(" ", "").split(',')
existingWords = list()
while True:
adjacentList = adjacentWords(startingWord)
letterChoice = maxLength(adjacentList, startingLetters)
if letterChoice[1] not in existingWords:
print "Going to use letter: "+ str(letterChoice[2]) + " to spell the word "+ str(letterChoice[1]) + " with "+ str(letterChoice[0]) + " possibilities."
existingWords.append(letterChoice[1])
startingLetters.remove(str(letterChoice[2]))
startingWord = letterChoice[1]
main()
| 0 |
2,552,012 |
03/31/2010 10:18:28
| 300,532 |
03/24/2010 05:23:36
| 6 | 0 |
error: incompatible types in assignment
|
My C code
#include <stdio.h>
#include <stdlib.h>
#include "help.h"
int test(int x, P *ut) {
int point = 10;
ut->dt[10].max_x = NULL;
}
int main(int argc, char** argv) {
return (EXIT_SUCCESS);
}
my help.h file code
typedef struct{
double max_x;
double max_y;
}X;
typedef struct{
X dt[10];
}P;
I got an error i.e
error: incompatible types in assignment
error comes in here
ut->dt[10].max_x = NULL;
can anybody help me.
thanks in advance.
|
c
| null | null | null | null | null |
open
|
error: incompatible types in assignment
===
My C code
#include <stdio.h>
#include <stdlib.h>
#include "help.h"
int test(int x, P *ut) {
int point = 10;
ut->dt[10].max_x = NULL;
}
int main(int argc, char** argv) {
return (EXIT_SUCCESS);
}
my help.h file code
typedef struct{
double max_x;
double max_y;
}X;
typedef struct{
X dt[10];
}P;
I got an error i.e
error: incompatible types in assignment
error comes in here
ut->dt[10].max_x = NULL;
can anybody help me.
thanks in advance.
| 0 |
8,077,905 |
11/10/2011 10:15:01
| 1,017,846 |
10/28/2011 06:41:42
| 1 | 0 |
inserting can not be done using mysql_query()
|
i cant to insert this html text into mysql table using mysql_query()
Thanks for signing up!<br><br><div style="margin-left: 40px;">Please keep on sharing with your friends via Facebook,Twitter or email(make sure to use the referal link : "http://rapidsurfing.net/launchrock/?lRef=refid")<br><br> </div><div style="margin-left: 40px;">Our new platform will be launching soon and you will be one of the first to be invited. <font color="#ff9900"><u><b></b><br></u></font><br></div><div style="margin-left: 40px;">The LaunchRock Team<br></div>
plz help me.
thankz in advance.
|
php
|
mysql
| null | null | null |
11/10/2011 10:19:05
|
not a real question
|
inserting can not be done using mysql_query()
===
i cant to insert this html text into mysql table using mysql_query()
Thanks for signing up!<br><br><div style="margin-left: 40px;">Please keep on sharing with your friends via Facebook,Twitter or email(make sure to use the referal link : "http://rapidsurfing.net/launchrock/?lRef=refid")<br><br> </div><div style="margin-left: 40px;">Our new platform will be launching soon and you will be one of the first to be invited. <font color="#ff9900"><u><b></b><br></u></font><br></div><div style="margin-left: 40px;">The LaunchRock Team<br></div>
plz help me.
thankz in advance.
| 1 |
5,932,371 |
05/09/2011 04:03:37
| 744,494 |
05/09/2011 04:03:37
| 1 | 0 |
Serial <> Ethernet converter and SerialPort.Write()
|
I'm trying to achieve maximum throughput on a serial port. I believe my C# code is causing a buffer overrun condition. SerialPort.Write() is usually a blocking method.
The problem is the unit/driver doing the Ethernet to Serial conversion doesn't block for the duration it takes for it to transmit the message. It doesn't appear to block at at all. Until it ends up blocking forever once too much data is written to it too fast. Then the SerialPort needs to be disposed before it will work again. Another issue is BytesToWrite always == 0 directly after thw write. Driver???
So, how do I get around this issue?
I tried doing a Sleep directly after the write for the duration it would take send the message out, but it doesn't work.
com.Write(buffer, 0, length);
double sleepTime = ((length + 1) * .000572916667) * 1000; //11 bits, 19.2K baud
Thread.Sleep((int) sleepTime);
I realize there may be some delay between when the unit receives the message and when it sends it out the COM port. Perhaps this is the reason why the driver does not block the .Write call?
I could wait for the message to be ack'd by the node. Problem is I'm dealing with thousands of nodes and some messages are broadcast globally. It is not feasible to wait for everyone to ack. What to do?
Any ideas?
|
c#
|
serial-port
| null | null | null | null |
open
|
Serial <> Ethernet converter and SerialPort.Write()
===
I'm trying to achieve maximum throughput on a serial port. I believe my C# code is causing a buffer overrun condition. SerialPort.Write() is usually a blocking method.
The problem is the unit/driver doing the Ethernet to Serial conversion doesn't block for the duration it takes for it to transmit the message. It doesn't appear to block at at all. Until it ends up blocking forever once too much data is written to it too fast. Then the SerialPort needs to be disposed before it will work again. Another issue is BytesToWrite always == 0 directly after thw write. Driver???
So, how do I get around this issue?
I tried doing a Sleep directly after the write for the duration it would take send the message out, but it doesn't work.
com.Write(buffer, 0, length);
double sleepTime = ((length + 1) * .000572916667) * 1000; //11 bits, 19.2K baud
Thread.Sleep((int) sleepTime);
I realize there may be some delay between when the unit receives the message and when it sends it out the COM port. Perhaps this is the reason why the driver does not block the .Write call?
I could wait for the message to be ack'd by the node. Problem is I'm dealing with thousands of nodes and some messages are broadcast globally. It is not feasible to wait for everyone to ack. What to do?
Any ideas?
| 0 |
10,153,473 |
04/14/2012 12:06:37
| 545,089 |
12/16/2010 17:18:23
| 70 | 1 |
Accessing the array typed mustache partial
|
I am using Mustache with PHP for my view layer. And I want to use an easy&dirty workaround for i18n. So I'm just curious;
I have a predefined partial set as;
$messages = array();
$messages['welcome'] = 'Hello World to you {{user.getName}}';
$messages['put'] = 'you put a {{variable}} here.'; //and etc
And the main partial set includes the messages as;
$partials['messages'] = $messages;
And of course this is rendered with a silly line of;
$mustache->render($template, $parameters, $partials);
I want to make use of the messages easily in my template. Such as;
{{>#messages}}{{>put}}{{>/messages}}
I don't want to mix the messages and partials because there are some minor conflicts.
Is there any way to reach those 'nested' partials?
|
php
|
internationalization
|
mustache
| null | null | null |
open
|
Accessing the array typed mustache partial
===
I am using Mustache with PHP for my view layer. And I want to use an easy&dirty workaround for i18n. So I'm just curious;
I have a predefined partial set as;
$messages = array();
$messages['welcome'] = 'Hello World to you {{user.getName}}';
$messages['put'] = 'you put a {{variable}} here.'; //and etc
And the main partial set includes the messages as;
$partials['messages'] = $messages;
And of course this is rendered with a silly line of;
$mustache->render($template, $parameters, $partials);
I want to make use of the messages easily in my template. Such as;
{{>#messages}}{{>put}}{{>/messages}}
I don't want to mix the messages and partials because there are some minor conflicts.
Is there any way to reach those 'nested' partials?
| 0 |
1,012,025 |
06/18/2009 10:52:34
| 102,040 |
03/21/2009 15:04:39
| 194 | 10 |
Best database for inserting records
|
What would be the best DB for Inserting records at a very high rate.
The DB will have only one table and the Application is very simple. Insert a row into the DB and commit it but the insertion rate will be very high.
Targetting about 5000 Row Insert per second.
Any of the very expensive DB's like Oracle\SQLServer are out of option.
Also what are the technologies for taking a DB Backup and will it be possible to create one DB from the older backed up DB's ?
|
database
| null | null | null | null |
09/14/2011 15:21:47
|
not constructive
|
Best database for inserting records
===
What would be the best DB for Inserting records at a very high rate.
The DB will have only one table and the Application is very simple. Insert a row into the DB and commit it but the insertion rate will be very high.
Targetting about 5000 Row Insert per second.
Any of the very expensive DB's like Oracle\SQLServer are out of option.
Also what are the technologies for taking a DB Backup and will it be possible to create one DB from the older backed up DB's ?
| 4 |
553,637 |
02/16/2009 15:19:15
| 36,352 |
11/10/2008 22:03:33
| 95 | 4 |
Should programmers have to be part of a professional body to practice?
|
Accountants, lawyers, doctors (and many other professions) have respected professional bodies that are responsible for awarding chartered status to the members. Through this mechanism, they gain trust and respect and can demonstrate that they adhere to a code of standards and ethics, and maintain their skills to keep them current.
Programming has a similarly large body of knowledge and a similar need for study and continual development. It is far younger a discipline than any of the examples quoted, but is of growing consequince to business, the economy, and most areas of life.
Will programming eventually become as respected a profession with a powerful professional body? (Lawyer and accountant jokes aside!) Shold we be aiming for this?
|
professionalism
|
regulation
| null | null | null |
01/30/2012 14:58:05
|
not constructive
|
Should programmers have to be part of a professional body to practice?
===
Accountants, lawyers, doctors (and many other professions) have respected professional bodies that are responsible for awarding chartered status to the members. Through this mechanism, they gain trust and respect and can demonstrate that they adhere to a code of standards and ethics, and maintain their skills to keep them current.
Programming has a similarly large body of knowledge and a similar need for study and continual development. It is far younger a discipline than any of the examples quoted, but is of growing consequince to business, the economy, and most areas of life.
Will programming eventually become as respected a profession with a powerful professional body? (Lawyer and accountant jokes aside!) Shold we be aiming for this?
| 4 |
8,259,824 |
11/24/2011 16:08:26
| 190,791 |
10/15/2009 18:00:33
| 325 | 2 |
Creating json data with duplicate keys
|
I want to build a json object with PHP.
The json object needs to be like this (for creating a google line charts):
> {"cols":[{"id":"bingo","label":"bingo","type":"string"},{"id":"value","label":"value","type":"number"}],"rows":[{"c":[{"v":"date1"},{"v":151}]},{"c":[{"v":"date2"},{"v":102}]},{"c":[{"v":"date3"},{"v":52}]},{"c":[{"v":"date4"},{"v":32}]},{"c":[{"v":"date5"},{"v":7}]},{"c":[{"v":"date5"},{"v":7}]},{"c":[{"v":"date5"},{"v":7}]}]}
I have a problem creating the following part:
> {"c":[{"v":"date3"},{"v":52}]},{"c":[{"v":"date4"},{"v":32}]},{"c":[{"v":"date5"},{"v":7}]},{"c":[{"v":"date5"},{"v":7}]},{"c":[{"v":"date5"},{"v":7}]}
How can I create this with PHP?
|
php
|
json
| null | null | null |
11/24/2011 21:53:38
|
not a real question
|
Creating json data with duplicate keys
===
I want to build a json object with PHP.
The json object needs to be like this (for creating a google line charts):
> {"cols":[{"id":"bingo","label":"bingo","type":"string"},{"id":"value","label":"value","type":"number"}],"rows":[{"c":[{"v":"date1"},{"v":151}]},{"c":[{"v":"date2"},{"v":102}]},{"c":[{"v":"date3"},{"v":52}]},{"c":[{"v":"date4"},{"v":32}]},{"c":[{"v":"date5"},{"v":7}]},{"c":[{"v":"date5"},{"v":7}]},{"c":[{"v":"date5"},{"v":7}]}]}
I have a problem creating the following part:
> {"c":[{"v":"date3"},{"v":52}]},{"c":[{"v":"date4"},{"v":32}]},{"c":[{"v":"date5"},{"v":7}]},{"c":[{"v":"date5"},{"v":7}]},{"c":[{"v":"date5"},{"v":7}]}
How can I create this with PHP?
| 1 |
9,715,905 |
03/15/2012 08:06:15
| 1,151,462 |
01/16/2012 08:22:41
| 38 | 0 |
check return of sql command in c#
|
i want to check if my query returns anv value or not and write the remaining logic accordingly.
SqlCommand myCommand = new SqlCommand("Select * from phc.userbase where [user]='@Username' and [password]='@password'", myConnection);
I want to know this command returns null or not. I tried
myReader = myCommand.ExecuteReader();
bool rd = myReader.Read();
if rd==false
but i can't get it working.any ideas?
here are my prameters .
SqlParameter myParam = new SqlParameter("@Username", SqlDbType.VarChar, 25);
myParam.Value = usr;
SqlParameter myParam2 = new SqlParameter("@password", SqlDbType.VarChar, 25);
myParam2.Value = pass;
|
c#
|
visual-studio-2010
| null | null | null | null |
open
|
check return of sql command in c#
===
i want to check if my query returns anv value or not and write the remaining logic accordingly.
SqlCommand myCommand = new SqlCommand("Select * from phc.userbase where [user]='@Username' and [password]='@password'", myConnection);
I want to know this command returns null or not. I tried
myReader = myCommand.ExecuteReader();
bool rd = myReader.Read();
if rd==false
but i can't get it working.any ideas?
here are my prameters .
SqlParameter myParam = new SqlParameter("@Username", SqlDbType.VarChar, 25);
myParam.Value = usr;
SqlParameter myParam2 = new SqlParameter("@password", SqlDbType.VarChar, 25);
myParam2.Value = pass;
| 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.