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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8,779,497 | 01/08/2012 17:14:59 | 717,441 | 04/20/2011 15:38:19 | 132 | 10 | How to programmatically retreive access_token from client-side OAuth flow using Python? | *This question was [posted on StackApps][1], but the issue may be more a programming issue than an authentication issue, hence it may deserve a better place over here.*
I am working on an desktop inbox notifier for StackOverflow, using the API with Python.
The script I am working on first logs the user in on StackExchange, and then requests authorisation for the application. Assuming the application has been authorised through web-browser interaction of the user. The application should be able to make requests to the API with authentication, hence it needs the access token specific to the user. This is done with the URL: `https://stackexchange.com/oauth/dialog?client_id=54&scope=read_inbox&redirect_uri=https://stackexchange.com/oauth/login_success`
When requesting authorisation via the web-browser the redirect is taking place and an access code is returned after a `#`. **However, when requesting this same URL with Python (urllib2), no hash or key is returned in the response.**
Why is it my urllib2 request is handled differently from the same request made in Firefox or W3m? What should I do to programmatically simulate this request and retrieve the `access_token`?
Here is my script (it's experimental) and remember: it assumes the user has already authorised the application.
#!/usr/bin/env python
import urllib
import urllib2
import cookielib
from BeautifulSoup import BeautifulSoup
from getpass import getpass
# Define URLs
parameters = [ 'client_id=54',
'scope=read_inbox',
'redirect_uri=https://stackexchange.com/oauth/login_success'
]
oauth_url = 'https://stackexchange.com/oauth/dialog?' + '&'.join(parameters)
login_url = 'https://openid.stackexchange.com/account/login'
submit_url = 'https://openid.stackexchange.com/account/login/submit'
authentication_url = 'http://stackexchange.com/users/authenticate?openid_identifier='
# Set counter for requests:
counter = 0
# Build opener
jar = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(jar))
def authenticate(username='', password=''):
'''
Authenticates to StackExchange using user-provided username and password
'''
# Build up headers
user_agent = 'Mozilla/5.0 (Ubuntu; X11; Linux i686; rv:8.0) Gecko/20100101 Firefox/8.0'
headers = {'User-Agent' : user_agent}
# Set Data to None
data = None
# 1. Build up URL request with headers and data
request = urllib2.Request(login_url, data, headers)
response = opener.open(request)
# Build up POST data for authentication
html = response.read()
fkey = BeautifulSoup(html).findAll(attrs={'name' : 'fkey'})[0].get('value').encode()
values = {'email' : username,
'password' : password,
'fkey' : fkey}
data = urllib.urlencode(values)
# 2. Build up URL for authentication
request = urllib2.Request(submit_url, data, headers)
response = opener.open(request)
# Check if logged in
if response.url == 'https://openid.stackexchange.com/user':
print ' Logged in! :) '
else:
print ' Login failed! :( '
# Find user ID URL
html = response.read()
id_url = BeautifulSoup(html).findAll('code')[0].text.split('"')[-2].encode()
# 3. Build up URL for OpenID authentication
data = None
url = authentication_url + urllib.quote_plus(id_url)
request = urllib2.Request(url, data, headers)
response = opener.open(request)
# 4. Build up URL request with headers and data
request = urllib2.Request(oauth_url, data, headers)
response = opener.open(request)
if '#' in response.url:
print 'Access code provided in URL.'
else:
print 'No access code provided in URL.'
if __name__ == '__main__':
username = raw_input('Enter your username: ')
password = getpass('Enter your password: ')
authenticate(username, password)
[1]: http://stackapps.com/questions/2903/api-implicit-authentication-with-python | python | oauth | urllib2 | null | null | null | open | How to programmatically retreive access_token from client-side OAuth flow using Python?
===
*This question was [posted on StackApps][1], but the issue may be more a programming issue than an authentication issue, hence it may deserve a better place over here.*
I am working on an desktop inbox notifier for StackOverflow, using the API with Python.
The script I am working on first logs the user in on StackExchange, and then requests authorisation for the application. Assuming the application has been authorised through web-browser interaction of the user. The application should be able to make requests to the API with authentication, hence it needs the access token specific to the user. This is done with the URL: `https://stackexchange.com/oauth/dialog?client_id=54&scope=read_inbox&redirect_uri=https://stackexchange.com/oauth/login_success`
When requesting authorisation via the web-browser the redirect is taking place and an access code is returned after a `#`. **However, when requesting this same URL with Python (urllib2), no hash or key is returned in the response.**
Why is it my urllib2 request is handled differently from the same request made in Firefox or W3m? What should I do to programmatically simulate this request and retrieve the `access_token`?
Here is my script (it's experimental) and remember: it assumes the user has already authorised the application.
#!/usr/bin/env python
import urllib
import urllib2
import cookielib
from BeautifulSoup import BeautifulSoup
from getpass import getpass
# Define URLs
parameters = [ 'client_id=54',
'scope=read_inbox',
'redirect_uri=https://stackexchange.com/oauth/login_success'
]
oauth_url = 'https://stackexchange.com/oauth/dialog?' + '&'.join(parameters)
login_url = 'https://openid.stackexchange.com/account/login'
submit_url = 'https://openid.stackexchange.com/account/login/submit'
authentication_url = 'http://stackexchange.com/users/authenticate?openid_identifier='
# Set counter for requests:
counter = 0
# Build opener
jar = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(jar))
def authenticate(username='', password=''):
'''
Authenticates to StackExchange using user-provided username and password
'''
# Build up headers
user_agent = 'Mozilla/5.0 (Ubuntu; X11; Linux i686; rv:8.0) Gecko/20100101 Firefox/8.0'
headers = {'User-Agent' : user_agent}
# Set Data to None
data = None
# 1. Build up URL request with headers and data
request = urllib2.Request(login_url, data, headers)
response = opener.open(request)
# Build up POST data for authentication
html = response.read()
fkey = BeautifulSoup(html).findAll(attrs={'name' : 'fkey'})[0].get('value').encode()
values = {'email' : username,
'password' : password,
'fkey' : fkey}
data = urllib.urlencode(values)
# 2. Build up URL for authentication
request = urllib2.Request(submit_url, data, headers)
response = opener.open(request)
# Check if logged in
if response.url == 'https://openid.stackexchange.com/user':
print ' Logged in! :) '
else:
print ' Login failed! :( '
# Find user ID URL
html = response.read()
id_url = BeautifulSoup(html).findAll('code')[0].text.split('"')[-2].encode()
# 3. Build up URL for OpenID authentication
data = None
url = authentication_url + urllib.quote_plus(id_url)
request = urllib2.Request(url, data, headers)
response = opener.open(request)
# 4. Build up URL request with headers and data
request = urllib2.Request(oauth_url, data, headers)
response = opener.open(request)
if '#' in response.url:
print 'Access code provided in URL.'
else:
print 'No access code provided in URL.'
if __name__ == '__main__':
username = raw_input('Enter your username: ')
password = getpass('Enter your password: ')
authenticate(username, password)
[1]: http://stackapps.com/questions/2903/api-implicit-authentication-with-python | 0 |
1,679,606 | 11/05/2009 10:20:13 | 3,848 | 08/31/2008 11:24:27 | 5,122 | 160 | What's the difference between "domain" and "non-domain" cookies? | I'm reading the [MDC entry for `nsICookieManager2.add`](https://developer.mozilla.org/en/nsICookieManager2#add.28.29) and it talks about *domain* and *non-domain* cookies. What are the differences between the two types of cookies? | cookies | domain | mozilla | null | null | null | open | What's the difference between "domain" and "non-domain" cookies?
===
I'm reading the [MDC entry for `nsICookieManager2.add`](https://developer.mozilla.org/en/nsICookieManager2#add.28.29) and it talks about *domain* and *non-domain* cookies. What are the differences between the two types of cookies? | 0 |
7,622,255 | 10/01/2011 18:51:23 | 964,920 | 09/26/2011 11:12:21 | 10 | 1 | second parameter in Symfony routing | job_show_user:
url: /job/:company/:location/:id/:position
class: sfDoctrineRoute
options: { model: JobeetJob, type: object }
param: { module: job, action: show }
requirements:
id: \d+
sf_method: [get]
in template i use:
url_for('job_show_user', $job)
earlier (without routing) i used
url_for('job/show?id=', $id)
how can i make this in routing?
i dont have $job, but i know $id - where this i must redirect.
if i use
url_for('job_show_user', 2)
then i have error - second parameter must be array. | php | symfony | url-routing | symfony-1.4 | null | null | open | second parameter in Symfony routing
===
job_show_user:
url: /job/:company/:location/:id/:position
class: sfDoctrineRoute
options: { model: JobeetJob, type: object }
param: { module: job, action: show }
requirements:
id: \d+
sf_method: [get]
in template i use:
url_for('job_show_user', $job)
earlier (without routing) i used
url_for('job/show?id=', $id)
how can i make this in routing?
i dont have $job, but i know $id - where this i must redirect.
if i use
url_for('job_show_user', 2)
then i have error - second parameter must be array. | 0 |
11,354,484 | 07/06/2012 00:47:19 | 335,639 | 05/07/2010 16:36:33 | 140 | 7 | How to include page with $_GET function & htaccess linking? | Currently developing a website and am wondering how to include pages into the main index (to only change a certain areas content and not the whole page) using the $_Get function.
Files would be something like index.php (where content pages are included), news.php (default page display on index), members.php, about.php, guides.php, downloads.php, sponsors.php etc.
I believe (if i remember correctly) linking with the $_Get method usually looks something like this index.php?pid=about
I would also like to find out how I can change the link (via htaccess?) to link as follows: www.mywebsite.com/about/ instead of mywebsite.com/index.php?pid=about
It has been some time since I have done any PHP and do not remember how the above things are done exactly.
Preview of what I am working on can be found at www.survivaloperations.net/dev/ | php | .htaccess | null | null | null | 07/06/2012 04:08:17 | not a real question | How to include page with $_GET function & htaccess linking?
===
Currently developing a website and am wondering how to include pages into the main index (to only change a certain areas content and not the whole page) using the $_Get function.
Files would be something like index.php (where content pages are included), news.php (default page display on index), members.php, about.php, guides.php, downloads.php, sponsors.php etc.
I believe (if i remember correctly) linking with the $_Get method usually looks something like this index.php?pid=about
I would also like to find out how I can change the link (via htaccess?) to link as follows: www.mywebsite.com/about/ instead of mywebsite.com/index.php?pid=about
It has been some time since I have done any PHP and do not remember how the above things are done exactly.
Preview of what I am working on can be found at www.survivaloperations.net/dev/ | 1 |
11,647,884 | 07/25/2012 10:37:33 | 1,058,210 | 11/21/2011 16:37:22 | 321 | 0 | Matching people based on a set of criteria | I’m creating a facebook application which matches people people based on a set of criteria, and I figure it’s pretty easy to make a query to search the database for people matching the criteria EXACTLY, but was wondering how websites normally generate results which don’t exactly match the criteria.
I was thinking of something like a tally system where I look at the first parameter and find all the people who match that and increment a counter for their id, then look at the second and increment a counter for all the ones which match that etc. Then just display the results for the cases with the highest counters. The problem with this is that some criteria may be more important than others and I guess this could be solved with giving them a higher weighting i.e. increment counter by higher value.
So my questions are:
1. How do websites normally do this and are there any standard php recipes for this?
2. Is the algorithm I suggested feasible?
3. What is this general area called? (I don't know what I should be searching google for...)
| php | mysql | algorithm | matching | null | 07/28/2012 10:59:49 | not a real question | Matching people based on a set of criteria
===
I’m creating a facebook application which matches people people based on a set of criteria, and I figure it’s pretty easy to make a query to search the database for people matching the criteria EXACTLY, but was wondering how websites normally generate results which don’t exactly match the criteria.
I was thinking of something like a tally system where I look at the first parameter and find all the people who match that and increment a counter for their id, then look at the second and increment a counter for all the ones which match that etc. Then just display the results for the cases with the highest counters. The problem with this is that some criteria may be more important than others and I guess this could be solved with giving them a higher weighting i.e. increment counter by higher value.
So my questions are:
1. How do websites normally do this and are there any standard php recipes for this?
2. Is the algorithm I suggested feasible?
3. What is this general area called? (I don't know what I should be searching google for...)
| 1 |
2,559,549 | 04/01/2010 10:01:42 | 61,529 | 02/02/2009 14:41:34 | 264 | 16 | How to get SQL Function run a different query and return value from either query? | I need a function, but cannot seem to get it quite right, I have looked at examples here and elsewhere and cannot seem to get this just right, I need an optional item to be included in my query, I have this query (which works):
SELECT TOP 100 PERCENT SKU, Description, LEN(CONVERT(VARCHAR
(1000),Description)) AS LenDesc FROM tblItem
WHERE Title = @Title AND Manufacturer = @Manufacturer
ORDER BY LenDesc DESC
This works within a Function, however the Manufacturer is Optional for this search - which is to find the description of a similar item, if none is present, the other query is:
SELECT TOP 100 PERCENT SKU, Description, LEN(CONVERT(VARCHAR
(1000),Description)) AS LenDesc FROM tblItem
WHERE Title = @Title ORDER BY LenDesc DESC
Which is missing the Manufacturer, how to I get my function to use either query based on the Manufacturer Value being present or not.
The reason is I will have a function which first checks an SKU for a Description, if it is not present - it uses this method to get a Description from a Similar Product, then updates the product being added with the similar product's description.
Here is the function so far:
ALTER FUNCTION [dbo].[GetDescriptionByTitleManufacturer]
(
@Title varchar(400),
@Manufacturer varchar(160)
)
RETURNS TABLE
AS
RETURN (
SELECT TOP 100 PERCENT SKU, Description, LEN(CONVERT(VARCHAR
(1000),Description)) AS LenDesc FROM tblItem
WHERE Title = @Title AND Manufacturer = @Manufacturer
ORDER BY LenDesc DESC
)
I've tried adding BEGINs and IF...ELSEs but get errors or syntax problems each way I try it, I want to be able to do something like this pseudo-function (which does not work):
ALTER FUNCTION [dbo].[GetDescriptionByTitleManufacturer]
(
@Title varchar(400),
@Manufacturer varchar(160)
)
RETURNS TABLE
AS
BEGIN
IF (@Manufacturer = Null)
RETURN (
SELECT TOP 100 PERCENT SKU, Description, LEN(CONVERT(VARCHAR
(1000),Description)) AS LenDesc FROM tblItem
WHERE Title = @Title ORDER BY LenDesc DESC
)
ELSE
RETURN (
SELECT TOP 100 PERCENT SKU, Description, LEN(CONVERT(VARCHAR
(1000),Description)) AS LenDesc FROM tblItem
WHERE Title = @Title AND Manufacturer = @Manufacturer
ORDER BY LenDesc DESC
)
END | sql | sql-server | function | optional | sql-server-2008 | null | open | How to get SQL Function run a different query and return value from either query?
===
I need a function, but cannot seem to get it quite right, I have looked at examples here and elsewhere and cannot seem to get this just right, I need an optional item to be included in my query, I have this query (which works):
SELECT TOP 100 PERCENT SKU, Description, LEN(CONVERT(VARCHAR
(1000),Description)) AS LenDesc FROM tblItem
WHERE Title = @Title AND Manufacturer = @Manufacturer
ORDER BY LenDesc DESC
This works within a Function, however the Manufacturer is Optional for this search - which is to find the description of a similar item, if none is present, the other query is:
SELECT TOP 100 PERCENT SKU, Description, LEN(CONVERT(VARCHAR
(1000),Description)) AS LenDesc FROM tblItem
WHERE Title = @Title ORDER BY LenDesc DESC
Which is missing the Manufacturer, how to I get my function to use either query based on the Manufacturer Value being present or not.
The reason is I will have a function which first checks an SKU for a Description, if it is not present - it uses this method to get a Description from a Similar Product, then updates the product being added with the similar product's description.
Here is the function so far:
ALTER FUNCTION [dbo].[GetDescriptionByTitleManufacturer]
(
@Title varchar(400),
@Manufacturer varchar(160)
)
RETURNS TABLE
AS
RETURN (
SELECT TOP 100 PERCENT SKU, Description, LEN(CONVERT(VARCHAR
(1000),Description)) AS LenDesc FROM tblItem
WHERE Title = @Title AND Manufacturer = @Manufacturer
ORDER BY LenDesc DESC
)
I've tried adding BEGINs and IF...ELSEs but get errors or syntax problems each way I try it, I want to be able to do something like this pseudo-function (which does not work):
ALTER FUNCTION [dbo].[GetDescriptionByTitleManufacturer]
(
@Title varchar(400),
@Manufacturer varchar(160)
)
RETURNS TABLE
AS
BEGIN
IF (@Manufacturer = Null)
RETURN (
SELECT TOP 100 PERCENT SKU, Description, LEN(CONVERT(VARCHAR
(1000),Description)) AS LenDesc FROM tblItem
WHERE Title = @Title ORDER BY LenDesc DESC
)
ELSE
RETURN (
SELECT TOP 100 PERCENT SKU, Description, LEN(CONVERT(VARCHAR
(1000),Description)) AS LenDesc FROM tblItem
WHERE Title = @Title AND Manufacturer = @Manufacturer
ORDER BY LenDesc DESC
)
END | 0 |
10,150,703 | 04/14/2012 03:14:48 | 1,058,683 | 11/21/2011 21:58:55 | 55 | 2 | accessing the Tesco Website's online shopping list and cart with my 3rd party App | I am wondering how to access/control someone else's online shopping system with my 3rd party app?
What I would like to do is to buy items from Tesco Website using my app. I know that they already have the Tesco app but I wonder if I can access their website using the app?
If so, I would like to get step by step advice please.
Have a lovely Easter !
Regards
Thet | android | shopping-cart | 3rd-party | null | null | 07/12/2012 01:39:11 | off topic | accessing the Tesco Website's online shopping list and cart with my 3rd party App
===
I am wondering how to access/control someone else's online shopping system with my 3rd party app?
What I would like to do is to buy items from Tesco Website using my app. I know that they already have the Tesco app but I wonder if I can access their website using the app?
If so, I would like to get step by step advice please.
Have a lovely Easter !
Regards
Thet | 2 |
7,793,555 | 10/17/2011 12:12:14 | 982,929 | 10/06/2011 20:02:52 | 1 | 0 | Typo3: How to insert the page title automatically into an img alt tag and into rtetextarea | Say we have a Text/Images record and go to "Images & Captions" and then to "Alternative Labels (one per line)".
> I would like something like this: "this is the alt image info for
> {page:title}."
Using {page:title} in the "main" page elements like "General>Header" works, but not for "Images>Alternative Labels (one per line)"
Also, would the solution to the above work similarly "{page:title}" in the RTEtextarea? | typo3 | rte | typoscript | null | null | null | open | Typo3: How to insert the page title automatically into an img alt tag and into rtetextarea
===
Say we have a Text/Images record and go to "Images & Captions" and then to "Alternative Labels (one per line)".
> I would like something like this: "this is the alt image info for
> {page:title}."
Using {page:title} in the "main" page elements like "General>Header" works, but not for "Images>Alternative Labels (one per line)"
Also, would the solution to the above work similarly "{page:title}" in the RTEtextarea? | 0 |
7,352,708 | 09/08/2011 18:23:35 | 7,011 | 09/15/2008 13:00:14 | 787 | 13 | Resharper multiline method invocation parenthesis alignment | Resharper is formatting multiline method calls like this:
foo.Bar(
x,
y
);
I would prefer it to align the closing parenthesis with the first line e.g.:
foo.Bar(
x,
y
);
I've looked through the Resharper code layout options, but cannot see the right setting. Can someone tell me how to achieve this alternative formatting? | c# | resharper | null | null | null | null | open | Resharper multiline method invocation parenthesis alignment
===
Resharper is formatting multiline method calls like this:
foo.Bar(
x,
y
);
I would prefer it to align the closing parenthesis with the first line e.g.:
foo.Bar(
x,
y
);
I've looked through the Resharper code layout options, but cannot see the right setting. Can someone tell me how to achieve this alternative formatting? | 0 |
5,490,950 | 03/30/2011 19:04:35 | 666,691 | 03/18/2011 20:46:12 | 8 | 0 | ftp unix file to windows | ftp unix file to windows ... how can i do that | windows | unix | ftp | null | null | 03/30/2011 19:10:47 | off topic | ftp unix file to windows
===
ftp unix file to windows ... how can i do that | 2 |
2,707,447 | 04/25/2010 07:03:08 | 238,626 | 12/25/2009 17:08:58 | 232 | 14 | How to resolve %CommonProgramFiles%\system\ | I have a situation where I need to return a directory path by reading the registry settings. Registry value returns me a path in the format
%CommonProgramFiles%\System\web32.dll
while the consumer code is expecting it in the format
C:\Program Files\Common Files\System\web32.dll
How can I resolve such directory path in .net code? | c# | .net | vb.net | null | null | null | open | How to resolve %CommonProgramFiles%\system\
===
I have a situation where I need to return a directory path by reading the registry settings. Registry value returns me a path in the format
%CommonProgramFiles%\System\web32.dll
while the consumer code is expecting it in the format
C:\Program Files\Common Files\System\web32.dll
How can I resolve such directory path in .net code? | 0 |
6,618,367 | 07/07/2011 23:37:08 | 547,515 | 12/19/2010 06:44:25 | 41 | 5 | c/c++ module for apache | I am invoking c/c++ from PHP using shell_exec(Server is httpd).
Is there any way where I can directly execute c/c++ executables from apache?
So the Apache will always execute only 1 executable each time (this file acts as a router). And then this executable will take care of the rest.
Thanks | c++ | c | apache | null | null | null | open | c/c++ module for apache
===
I am invoking c/c++ from PHP using shell_exec(Server is httpd).
Is there any way where I can directly execute c/c++ executables from apache?
So the Apache will always execute only 1 executable each time (this file acts as a router). And then this executable will take care of the rest.
Thanks | 0 |
3,283,730 | 07/19/2010 18:06:35 | 369,161 | 06/17/2010 09:29:38 | 32 | 1 | Using C codes in .NET | How Can I use C codes In .NET?
there is a game that written in c
how can i convert it to .net code
or use some parts of it?
or make dll from it?
help me :)
http://www.gnubg.org/
tnx
shaahin | .net | c | null | null | null | 07/19/2010 18:31:52 | not a real question | Using C codes in .NET
===
How Can I use C codes In .NET?
there is a game that written in c
how can i convert it to .net code
or use some parts of it?
or make dll from it?
help me :)
http://www.gnubg.org/
tnx
shaahin | 1 |
683,625 | 03/25/2009 21:48:37 | 78,550 | 03/16/2009 11:46:42 | 1 | 2 | Best Book to Learn VBA? | Anyone have any suggestions for good books or even links? I was tasked with writing some things at work and they insist on using VBA and I am not very familiar with it. | access-vba | vba | books | null | null | 09/15/2011 07:23:06 | not constructive | Best Book to Learn VBA?
===
Anyone have any suggestions for good books or even links? I was tasked with writing some things at work and they insist on using VBA and I am not very familiar with it. | 4 |
2,337,216 | 02/25/2010 20:06:11 | 31,610 | 10/26/2008 17:16:50 | 7,350 | 289 | Any way of achieving the same thing as python -mpdb from inside the script? | Besides wrapping all your code in `try` `except`, is there any way of achieving the same thing as running your script like `python -mpdb script`? I'd like to be able to see what went wrong when an exception gets raised. | python | debugging | pdb | null | null | null | open | Any way of achieving the same thing as python -mpdb from inside the script?
===
Besides wrapping all your code in `try` `except`, is there any way of achieving the same thing as running your script like `python -mpdb script`? I'd like to be able to see what went wrong when an exception gets raised. | 0 |
8,783,404 | 01/09/2012 02:47:06 | 1,070,609 | 11/29/2011 05:05:05 | 38 | 1 | Mass mail using PHP from my web application | I had a web application in PHP which hosted in GoDaddy server . The site is a type of movie database and discussion . I have to send mass mail to my registered users from my application. For eg. at the time of a movie release I have to send mass mail to users , also I have to send theatre updates etc etc .... From some journals I heard that PHP mail function is not enough for doing that. I am nooby for this case and please suggest me a better option for this . Will goDaddy allow mass mail using PHP mail function ?
Thanks in advance
| php | email | godaddy | phpmailer | phpmail | null | open | Mass mail using PHP from my web application
===
I had a web application in PHP which hosted in GoDaddy server . The site is a type of movie database and discussion . I have to send mass mail to my registered users from my application. For eg. at the time of a movie release I have to send mass mail to users , also I have to send theatre updates etc etc .... From some journals I heard that PHP mail function is not enough for doing that. I am nooby for this case and please suggest me a better option for this . Will goDaddy allow mass mail using PHP mail function ?
Thanks in advance
| 0 |
8,026,024 | 11/06/2011 08:53:27 | 977,069 | 10/03/2011 16:38:55 | 11 | 0 | while loop printing list in python | The following code:
c=0 while c < len(demolist):
print ’demolist[’,c,’]=’,demolist[c]
c=c+1
Creates this output:
demolist[ 0 ]= life
demolist[ 1 ]= 42
demolist[ 2 ]= the universe
demolist[ 3 ]= 6
demolist[ 4 ]= and
demolist[ 5 ]= 7
demolist[ 6 ]= everything
What's up with the `demolist[',c,']` format that is being printed in the while loop? Why does this give a number in the brackets, whereas putting `demolist[c]` there just prints that exactly?
| python | loops | null | null | null | null | open | while loop printing list in python
===
The following code:
c=0 while c < len(demolist):
print ’demolist[’,c,’]=’,demolist[c]
c=c+1
Creates this output:
demolist[ 0 ]= life
demolist[ 1 ]= 42
demolist[ 2 ]= the universe
demolist[ 3 ]= 6
demolist[ 4 ]= and
demolist[ 5 ]= 7
demolist[ 6 ]= everything
What's up with the `demolist[',c,']` format that is being printed in the while loop? Why does this give a number in the brackets, whereas putting `demolist[c]` there just prints that exactly?
| 0 |
3,614,123 | 09/01/2010 00:09:07 | 291,097 | 03/11/2010 01:36:49 | 1 | 0 | javascript regex for validating email list with ASP MVC 2 data annotations | I am trying to use ASP MVC 2 data annotations to validate a semicolon delimited list of email addresses on the client side. The regex below works on the server side but doesn't work with the javascript because javascript regular expressions don't support conditionals.
"^([A-Za-z0-9_\\+\\-]+(\\.[A-Za-z0-9_\\+\\-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*\\.([A-Za-z]{2,4})(?(?=.);[ ]*|))+$"
Is there a way to require that the email address is followed by a semicolon only if it is followed by another email address without using a conditional? Thanks.
| javascript | regex | asp.net-mvc-2 | null | null | null | open | javascript regex for validating email list with ASP MVC 2 data annotations
===
I am trying to use ASP MVC 2 data annotations to validate a semicolon delimited list of email addresses on the client side. The regex below works on the server side but doesn't work with the javascript because javascript regular expressions don't support conditionals.
"^([A-Za-z0-9_\\+\\-]+(\\.[A-Za-z0-9_\\+\\-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*\\.([A-Za-z]{2,4})(?(?=.);[ ]*|))+$"
Is there a way to require that the email address is followed by a semicolon only if it is followed by another email address without using a conditional? Thanks.
| 0 |
3,428,890 | 08/07/2010 02:07:32 | 260,597 | 01/28/2010 02:36:06 | 1 | 1 | javascript form input loop help | I have a form that currently only parses the first input variable in the POST.
I have had to add multiple variables so i would like the function to loop through now and grab all the input param's and add to the POST
here is the working code for grabbing the first name and value.... how can i get it to check the form and grab all custom name's and variables.
// dynamically add key/value pair to POST body
function read_custom_param(){
var nameEl = document.getElementById("custom_name");
var valueEl = document.getElementById("custom_value");
// save custom param name and value
var cust_param_name = nameEl.value;
var cust_param_value = valueEl.value;
// remove old custom param form elements
if (valueEl.parentNode && valueEl.parentNode.removeChild){
valueEl.parentNode.removeChild(valueEl);
}
if (nameEl.parentNode && nameEl.parentNode.removeChild){
nameEl.parentNode.removeChild(nameEl);
}
// add new custom param form elements
var el=document.createElement("input");
el.type="text";
el.name=cust_param_name;
el.value=cust_param_value;
document.getElementById("dcapiform").appendChild(el);
}
Kind Regards,
Chris | javascript | forms | function | loops | null | null | open | javascript form input loop help
===
I have a form that currently only parses the first input variable in the POST.
I have had to add multiple variables so i would like the function to loop through now and grab all the input param's and add to the POST
here is the working code for grabbing the first name and value.... how can i get it to check the form and grab all custom name's and variables.
// dynamically add key/value pair to POST body
function read_custom_param(){
var nameEl = document.getElementById("custom_name");
var valueEl = document.getElementById("custom_value");
// save custom param name and value
var cust_param_name = nameEl.value;
var cust_param_value = valueEl.value;
// remove old custom param form elements
if (valueEl.parentNode && valueEl.parentNode.removeChild){
valueEl.parentNode.removeChild(valueEl);
}
if (nameEl.parentNode && nameEl.parentNode.removeChild){
nameEl.parentNode.removeChild(nameEl);
}
// add new custom param form elements
var el=document.createElement("input");
el.type="text";
el.name=cust_param_name;
el.value=cust_param_value;
document.getElementById("dcapiform").appendChild(el);
}
Kind Regards,
Chris | 0 |
8,681,411 | 12/30/2011 16:06:30 | 794,000 | 06/11/2011 14:02:11 | 198 | 8 | Modal Pop Up To Hover Over Parent Page | I wonder whether someone could help me please.
I've really got myself in a bit of a pickle with this and I just seem to be going round in circles to find a solution.
I have created [this][1] modal dialog page to allow users to upload images. I would like to access this through the click of the 'Upload Images' button on [this][2] page.
The problem I have is two fold, but are linked.
I can't seem to get the modal dialog page to act as a pop dialog hovering over the parent page, instead it opens as another web browser page, and because I'm using two submit buttons, I can't get the 'submit' functionality to work independently i.e. one that submits the form, whilst the other opens up the modal dialog.
I've been working on this for quite some time now, changing the button types, giving specific name to each button and calling that in a Javascript function, but I just can't seem to find the solution.
I just wondered whether someone could perhaps have a look at this please and help me with this problem.
Sincere thanks and regards
[1]: http://www.mapmyfinds.co.uk/development/testdialog.php
[2]: http://www.mapmyfinds.co.uk/development/test.php | php | javascript | html | null | null | 12/31/2011 06:27:54 | not a real question | Modal Pop Up To Hover Over Parent Page
===
I wonder whether someone could help me please.
I've really got myself in a bit of a pickle with this and I just seem to be going round in circles to find a solution.
I have created [this][1] modal dialog page to allow users to upload images. I would like to access this through the click of the 'Upload Images' button on [this][2] page.
The problem I have is two fold, but are linked.
I can't seem to get the modal dialog page to act as a pop dialog hovering over the parent page, instead it opens as another web browser page, and because I'm using two submit buttons, I can't get the 'submit' functionality to work independently i.e. one that submits the form, whilst the other opens up the modal dialog.
I've been working on this for quite some time now, changing the button types, giving specific name to each button and calling that in a Javascript function, but I just can't seem to find the solution.
I just wondered whether someone could perhaps have a look at this please and help me with this problem.
Sincere thanks and regards
[1]: http://www.mapmyfinds.co.uk/development/testdialog.php
[2]: http://www.mapmyfinds.co.uk/development/test.php | 1 |
6,844,741 | 07/27/2011 13:01:54 | 684,646 | 03/30/2011 20:08:38 | 313 | 16 | I've been asked to develop a c# with DB with a "magnetic card", Where to start? | I'm used to work with the previous two (c#, mssql), but I don't know how does the magnetic card thing.
It's supposed to be an usb device and I suppose a little investigation concerning magnetic cards, but I can't accept the project and then realize I can't do it...
- I've been said that they don't have any kind of API to handle it, does c# provide one?
- I suppose that every magnetic card has some kind of encryption, doesn't it? If it does, I'm screwed.
- How to write IN the card? (Is the card that's written or the data stays on a server and the card only holds an Id?)
- Do you know of any tutorial you could provide? | c# | sql | usb-drive | null | null | 07/27/2011 13:12:36 | not a real question | I've been asked to develop a c# with DB with a "magnetic card", Where to start?
===
I'm used to work with the previous two (c#, mssql), but I don't know how does the magnetic card thing.
It's supposed to be an usb device and I suppose a little investigation concerning magnetic cards, but I can't accept the project and then realize I can't do it...
- I've been said that they don't have any kind of API to handle it, does c# provide one?
- I suppose that every magnetic card has some kind of encryption, doesn't it? If it does, I'm screwed.
- How to write IN the card? (Is the card that's written or the data stays on a server and the card only holds an Id?)
- Do you know of any tutorial you could provide? | 1 |
6,085,267 | 05/22/2011 00:20:10 | 129,960 | 06/28/2009 02:18:43 | 333 | 15 | Linq latter processing behavior | In this situation:
var allCustomers = from c in customers select c;
var oldCustomers = from o in allCustomers where age > 70 select o;
Will **where** clause reach database? | .net | database | linq | orm | late-binding | null | open | Linq latter processing behavior
===
In this situation:
var allCustomers = from c in customers select c;
var oldCustomers = from o in allCustomers where age > 70 select o;
Will **where** clause reach database? | 0 |
3,948,227 | 10/16/2010 08:58:17 | 425,243 | 08/19/2010 12:53:21 | 16 | 0 | what does this mean ? | int *temp = new int[atoi(argv[3])];
what does the above statement mean ?Please explain in detail . | c++ | c | null | null | null | 10/16/2010 10:57:04 | not a real question | what does this mean ?
===
int *temp = new int[atoi(argv[3])];
what does the above statement mean ?Please explain in detail . | 1 |
10,641,837 | 05/17/2012 18:55:49 | 1,388,136 | 05/10/2012 21:12:03 | 10 | 0 | Shopping-Cart Javascript quantities and custom functions | I am working really hard on a shopping cart script (that can be found on Codecanyon).
I bought it from someone, but I can't reach him.
Here's the JSFiddle of what It looks like :
http://jsfiddle.net/mVFZd/2/
What I need, is to find a way to add the following features :
1 - Being able to add a minimum quantity for each product. So a product minimum can be 4, and the other one next to it can be 5...and so on.
2 - Being able to set a "quantity gap" when adding products to the shopping cart. So let's say for item 1, the quantity you can buy are only 4, 8, 12, and 16. You can't buy 5 of it, or 10...only the quantities that are set for that item.
3 - Last thing, being able to set the price per item for quantities. So let's say if I buy 4 items, the price per item will be $20. If I buy 8 items, the price per item will be $18...and so on.
I tried really hard to make this work working in the javascript, but I'm not enough expiremented in Javascript to find a way to do this. I'm pretty sure it's not that hard.
Thank you very much! | javascript | jquery | html | css | shopping-cart | 05/22/2012 14:15:53 | not a real question | Shopping-Cart Javascript quantities and custom functions
===
I am working really hard on a shopping cart script (that can be found on Codecanyon).
I bought it from someone, but I can't reach him.
Here's the JSFiddle of what It looks like :
http://jsfiddle.net/mVFZd/2/
What I need, is to find a way to add the following features :
1 - Being able to add a minimum quantity for each product. So a product minimum can be 4, and the other one next to it can be 5...and so on.
2 - Being able to set a "quantity gap" when adding products to the shopping cart. So let's say for item 1, the quantity you can buy are only 4, 8, 12, and 16. You can't buy 5 of it, or 10...only the quantities that are set for that item.
3 - Last thing, being able to set the price per item for quantities. So let's say if I buy 4 items, the price per item will be $20. If I buy 8 items, the price per item will be $18...and so on.
I tried really hard to make this work working in the javascript, but I'm not enough expiremented in Javascript to find a way to do this. I'm pretty sure it's not that hard.
Thank you very much! | 1 |
5,247,292 | 03/09/2011 14:36:07 | 715,757 | 12/15/2009 02:27:08 | 232 | 0 | infrastructure for grid computing java | I have some scientific programs wose must run in a grid architecture.
So I need some company that can support me with 1000 machines (for ex.)
My application is not commercial, so I think a Non Comercial institution could provide me this kind of infrastructure?
So my question is: does anyone know any company/institution that could provide me access to java grid computing without payment, if not, which companies are the best for this service. | java | grid | infrastructure | computing | null | 03/09/2011 17:37:41 | off topic | infrastructure for grid computing java
===
I have some scientific programs wose must run in a grid architecture.
So I need some company that can support me with 1000 machines (for ex.)
My application is not commercial, so I think a Non Comercial institution could provide me this kind of infrastructure?
So my question is: does anyone know any company/institution that could provide me access to java grid computing without payment, if not, which companies are the best for this service. | 2 |
9,753,653 | 03/17/2012 20:58:04 | 21,199 | 09/23/2008 15:50:08 | 503 | 16 | MSBuild handling circular dependencies | I am new to MSBuild. Just started trying it two days ago, and now I am just testing it. I have run into a problem where I get this error:
"c:\Users\martinslot\Documents\Visual Studio 2010\Projects\MultifileAssembly\SpecializedBuild.xml" (BuildNumberUtil target) (1) ->
c:\Users\martinslot\Documents\Visual Studio 2010\Projects\MultifileAssembly\SpecializedBuild.xml(4,34): error MSB4006: There is a circular dependency in t
he target dependency graph involving target "BuildNumberUtil".
My MSBuild script look like this:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="BuildNumberUtil" DependsOnTargets="BuildStringUtil" >
<Message Text="=============Building modules for NumberUtil============="/>
<Csc TargetType="Module" Sources="NumberUtil/DoubleUtil.cs; NumberUtil/IntegerUtil.cs" AddModules="/StringUtil/StringUtil"/>
<Copy SourceFiles="@(NetModules)" DestinationFolder="../Output/Specialized"/>
</Target>
<Target Name="BuildStringUtil" DependsOnTargets="BuildNumberUtil" >
<Message Text="=============Building modules for StringUtil============="/>
<Csc TargetType="Module" Sources="StringUtil/StringUtil.cs;" AddModules="/NumberUtil/IntegerUtil;/NumberUtil/DoubleUtil"/>
<Copy SourceFiles="@(NetModules)" DestinationFolder="/Output/Specialized"/>
</Target>
</Project>
I understand the problem, actually I created this small example to see if MSBuild understood and could somehow correct the problem. How do I solve this?
My problem is that the two targets compile modules that rely on eachother. Does someone here have a solution on how to handle this kind of problem with MSBuild? Maybe I am structing this in the wrong way? | c# | .net-4.0 | msbuild | null | null | null | open | MSBuild handling circular dependencies
===
I am new to MSBuild. Just started trying it two days ago, and now I am just testing it. I have run into a problem where I get this error:
"c:\Users\martinslot\Documents\Visual Studio 2010\Projects\MultifileAssembly\SpecializedBuild.xml" (BuildNumberUtil target) (1) ->
c:\Users\martinslot\Documents\Visual Studio 2010\Projects\MultifileAssembly\SpecializedBuild.xml(4,34): error MSB4006: There is a circular dependency in t
he target dependency graph involving target "BuildNumberUtil".
My MSBuild script look like this:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="BuildNumberUtil" DependsOnTargets="BuildStringUtil" >
<Message Text="=============Building modules for NumberUtil============="/>
<Csc TargetType="Module" Sources="NumberUtil/DoubleUtil.cs; NumberUtil/IntegerUtil.cs" AddModules="/StringUtil/StringUtil"/>
<Copy SourceFiles="@(NetModules)" DestinationFolder="../Output/Specialized"/>
</Target>
<Target Name="BuildStringUtil" DependsOnTargets="BuildNumberUtil" >
<Message Text="=============Building modules for StringUtil============="/>
<Csc TargetType="Module" Sources="StringUtil/StringUtil.cs;" AddModules="/NumberUtil/IntegerUtil;/NumberUtil/DoubleUtil"/>
<Copy SourceFiles="@(NetModules)" DestinationFolder="/Output/Specialized"/>
</Target>
</Project>
I understand the problem, actually I created this small example to see if MSBuild understood and could somehow correct the problem. How do I solve this?
My problem is that the two targets compile modules that rely on eachother. Does someone here have a solution on how to handle this kind of problem with MSBuild? Maybe I am structing this in the wrong way? | 0 |
3,206,972 | 07/08/2010 18:56:13 | 84,539 | 03/30/2009 09:34:26 | 1,074 | 36 | Reading a File on OS X via Java - Is my path correct? | I am trying to do this
File file = new File("/Users/Jon/Downloads/mynewalbum/artist - title.mp3");
I don't think its correct though as the properties returned don't seem correct. Maybe I have got a backslash or something wrong? | java | osx | file-io | null | null | null | open | Reading a File on OS X via Java - Is my path correct?
===
I am trying to do this
File file = new File("/Users/Jon/Downloads/mynewalbum/artist - title.mp3");
I don't think its correct though as the properties returned don't seem correct. Maybe I have got a backslash or something wrong? | 0 |
5,280,792 | 03/12/2011 05:33:50 | 656,337 | 03/12/2011 05:33:50 | 1 | 0 | Oracle connection error | java.sql.SQLException: Io exception: The Network Adapter could not establish the
connection at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java)
I am getting this error when data in database is increased (nearly 3000). It works fine with limited data( say 100)
| oracle | null | null | null | null | null | open | Oracle connection error
===
java.sql.SQLException: Io exception: The Network Adapter could not establish the
connection at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java)
I am getting this error when data in database is increased (nearly 3000). It works fine with limited data( say 100)
| 0 |
11,372,704 | 07/07/2012 06:01:05 | 1,454,990 | 06/13/2012 23:24:42 | 74 | 8 | PHP file will not update in browser | For some odd reason, every time I update a file, it is not updating inside a browser (localhost - wampserver). To be more specific. If I have a simple php script:
echo "hello world";
It runs fine in the browser, and shows the text 'hello world'.
However, if I update it to
echo "goodbye world";
And refresh the browser, nothing happens. The text remains 'hello world'.
This has not been a problem before and was refreshing perfectly. I tried clearing the browser cache, tested on multiple browsers, restarted my wamp server, and restarted the computer. Nothing seems to be working.
The only way the code seems to be updated is if I run the script from my IDE. Then it shows up in the browser with the updated code. How can this problem be fixed? I want it to go back to the way it was and be able to refresh from within the browser.
Using wampserver php - 5.3.13, apache 2.2.22
| php | browser | null | null | null | null | open | PHP file will not update in browser
===
For some odd reason, every time I update a file, it is not updating inside a browser (localhost - wampserver). To be more specific. If I have a simple php script:
echo "hello world";
It runs fine in the browser, and shows the text 'hello world'.
However, if I update it to
echo "goodbye world";
And refresh the browser, nothing happens. The text remains 'hello world'.
This has not been a problem before and was refreshing perfectly. I tried clearing the browser cache, tested on multiple browsers, restarted my wamp server, and restarted the computer. Nothing seems to be working.
The only way the code seems to be updated is if I run the script from my IDE. Then it shows up in the browser with the updated code. How can this problem be fixed? I want it to go back to the way it was and be able to refresh from within the browser.
Using wampserver php - 5.3.13, apache 2.2.22
| 0 |
6,458,812 | 06/23/2011 18:21:20 | 788,337 | 06/07/2011 22:23:18 | 23 | 0 | Python ctypes: SetWindowsHookEx callback function never called | I'm trying to write a program in Python that is aware of when alert boxes/dialogues are shown. It's dealing with multiple monitors, and I want it to display a visualization on the secondary monitor when a taskbar icon flashes, an error/notification pops up, etc.
As far as I can tell, the way to do detect these events is using message hooks, as described here: http://msdn.microsoft.com/en-us/library/ms632589%28v=vs.85%29.aspx
I was even lucky enough to find an example that accesses the SetWindowsHookEx function from Python. (This particular example uses mouse signals, but I can just change the constants to listen for different messages).
http://www.python-forum.org/pythonforum/viewtopic.php?f=2&t=11154
However, the above example does not work. The callback function is never called, regardless of my mouse clicks, and a middle mouse click does not cause the program to exit.
The example is from 2009 (pre windows 7?),though I don't know if that's the issue.
So, my question is, can anybody 1. find out why the code works, or 2. tell me another way to achieve what I'm doing (preferably in Python, though I'll go to other languages if necesarry). | python | windows | winapi | events | pywin32 | null | open | Python ctypes: SetWindowsHookEx callback function never called
===
I'm trying to write a program in Python that is aware of when alert boxes/dialogues are shown. It's dealing with multiple monitors, and I want it to display a visualization on the secondary monitor when a taskbar icon flashes, an error/notification pops up, etc.
As far as I can tell, the way to do detect these events is using message hooks, as described here: http://msdn.microsoft.com/en-us/library/ms632589%28v=vs.85%29.aspx
I was even lucky enough to find an example that accesses the SetWindowsHookEx function from Python. (This particular example uses mouse signals, but I can just change the constants to listen for different messages).
http://www.python-forum.org/pythonforum/viewtopic.php?f=2&t=11154
However, the above example does not work. The callback function is never called, regardless of my mouse clicks, and a middle mouse click does not cause the program to exit.
The example is from 2009 (pre windows 7?),though I don't know if that's the issue.
So, my question is, can anybody 1. find out why the code works, or 2. tell me another way to achieve what I'm doing (preferably in Python, though I'll go to other languages if necesarry). | 0 |
850,551 | 05/11/2009 23:44:19 | 97,893 | 04/29/2009 19:01:51 | 2 | 3 | what is the best language and best tools for desktop application with a database development ?? | i means by that for a light app what would be the best database , best IDE , best language, best tools.
thanks everybody | database | gui | ide | programming-languages | null | 08/31/2011 13:53:23 | not constructive | what is the best language and best tools for desktop application with a database development ??
===
i means by that for a light app what would be the best database , best IDE , best language, best tools.
thanks everybody | 4 |
3,067,298 | 06/18/2010 05:00:28 | 1,470,997 | 12/28/2009 11:31:32 | 382 | 8 | Presentation on WPF | I have just start to learn wpf. Can anybody clear me the following to give a presentation on WPF.
1. What is WPF?
2. Why we need it.
3. Difference b/w Win form and wpf.
4. windowsform vs WPF.
Geetha. | wpf | null | null | null | null | 05/02/2012 12:40:58 | not constructive | Presentation on WPF
===
I have just start to learn wpf. Can anybody clear me the following to give a presentation on WPF.
1. What is WPF?
2. Why we need it.
3. Difference b/w Win form and wpf.
4. windowsform vs WPF.
Geetha. | 4 |
10,652,385 | 05/18/2012 12:09:49 | 579,182 | 01/17/2011 22:53:17 | 73 | 2 | Count occurrences of a field for each group? | I'm doing a pretty complicated query, and I'm slipping at the very last step.
I have managed to get this far:
id refid system_id item_description_id system_component_id current_status
711 4fb62cece5313 49 NULL 711 RUNNING
712 4fb62cece547d 49 NULL 712 STOPPED
713 4fb62cece5616 50 NULL 713 RUNNING
714 4fb62cece5803 50 NULL 714 STOPPED
716 4fb62cece5ab8 51 NULL 716 RUNNING
These are the current statuses of every component of each system. What comes next is to group them by system and count the occurrences that are 'STOPPED'.
My problem is that some systems will not have any rows with 'STOPPED', or any rows at all if the system has never been updated. Yet, I still have to get them as part of the result. Just grouping them by system works for all but these two cases, in which the resulting value is '1' even though there are no stopped components at all.
How can I make a query that will return something like this:
system_id status_count
49 1
50 1
51 0
And not:
system_id status_count
49 1
50 1
51 1
With the above table? | mysql | sql | null | null | null | null | open | Count occurrences of a field for each group?
===
I'm doing a pretty complicated query, and I'm slipping at the very last step.
I have managed to get this far:
id refid system_id item_description_id system_component_id current_status
711 4fb62cece5313 49 NULL 711 RUNNING
712 4fb62cece547d 49 NULL 712 STOPPED
713 4fb62cece5616 50 NULL 713 RUNNING
714 4fb62cece5803 50 NULL 714 STOPPED
716 4fb62cece5ab8 51 NULL 716 RUNNING
These are the current statuses of every component of each system. What comes next is to group them by system and count the occurrences that are 'STOPPED'.
My problem is that some systems will not have any rows with 'STOPPED', or any rows at all if the system has never been updated. Yet, I still have to get them as part of the result. Just grouping them by system works for all but these two cases, in which the resulting value is '1' even though there are no stopped components at all.
How can I make a query that will return something like this:
system_id status_count
49 1
50 1
51 0
And not:
system_id status_count
49 1
50 1
51 1
With the above table? | 0 |
1,182,871 | 07/25/2009 19:38:10 | 41,021 | 11/26/2008 13:16:39 | 2,351 | 72 | Firefox - all form buttons blank | While debugging an extension I was creating, all of the form buttons on a page have gone blank. Any idea how to solve this?
I've cleared my cache and everything. I even tried disabling all my addons and plugins but to no avail.
![alt text][1]
[1]: http://img44.imageshack.us/img44/7765/picblank.png | firefox | null | null | null | null | null | open | Firefox - all form buttons blank
===
While debugging an extension I was creating, all of the form buttons on a page have gone blank. Any idea how to solve this?
I've cleared my cache and everything. I even tried disabling all my addons and plugins but to no avail.
![alt text][1]
[1]: http://img44.imageshack.us/img44/7765/picblank.png | 0 |
11,358,391 | 07/06/2012 08:16:02 | 1,506,091 | 07/06/2012 07:55:26 | 1 | 0 | Google Docs Code to copy entered data on sheet1 onto sheet2 | I have been looking and found some code for Copying data from Google Spreadsheet to another sheet within spreadsheet, but im a noob at this.
i have a sheet called " BookinSheet" in there i have 2 Sheets, "sheet1" - acts as a database
"Sheet2" has a form for ppl to fill in
what i wanna do , is copy the form data(sheet2) onto a spreadsheet (Sheet1) - what i wanna accomplish is basically printing the Form as a receipt for the customers. before i submit it / as there is no print option only (submit)
| gwt | null | null | null | null | null | open | Google Docs Code to copy entered data on sheet1 onto sheet2
===
I have been looking and found some code for Copying data from Google Spreadsheet to another sheet within spreadsheet, but im a noob at this.
i have a sheet called " BookinSheet" in there i have 2 Sheets, "sheet1" - acts as a database
"Sheet2" has a form for ppl to fill in
what i wanna do , is copy the form data(sheet2) onto a spreadsheet (Sheet1) - what i wanna accomplish is basically printing the Form as a receipt for the customers. before i submit it / as there is no print option only (submit)
| 0 |
11,252,036 | 06/28/2012 20:04:07 | 478,144 | 10/16/2010 20:24:18 | 6,075 | 276 | jQuery, grab last-child but not of a certain class | So i'm trying this: `inner.children('.image:not(dont):last-child').width();`
What is the correct way to combine not(classname) and :last-child?
Thanks | jquery | null | null | null | null | null | open | jQuery, grab last-child but not of a certain class
===
So i'm trying this: `inner.children('.image:not(dont):last-child').width();`
What is the correct way to combine not(classname) and :last-child?
Thanks | 0 |
4,126,230 | 11/08/2010 17:18:03 | 498,124 | 11/05/2010 08:46:31 | 8 | 0 | Creating a Regex to replace characters | I want to build Regex in C#, the Regex maches char and swap it to another clone char. (e.g. swape 1 to 2,but 2 to 4 etc.)
How can I do it?
Thanks
| c# | regex | null | null | null | 11/09/2010 10:46:00 | not a real question | Creating a Regex to replace characters
===
I want to build Regex in C#, the Regex maches char and swap it to another clone char. (e.g. swape 1 to 2,but 2 to 4 etc.)
How can I do it?
Thanks
| 1 |
9,351,764 | 02/19/2012 18:12:19 | 548,448 | 12/20/2010 09:51:46 | 6 | 1 | Most pythonic way to truncate a list to N indices when you can't guarantee the list is at least N length? | What is the most pythonic way to truncate a list to N indices when you can not guarantee the list is even N length? Something like this:
list = range(6)
if len(list) > 4:
list = list[:4]
I'm fairly new to python and am trying to learn to think pythonicly. The reason I want to even truncate the list is because I'm going to enumerate on it with an expected length and I only care about the first 4 elements. | python | null | null | null | null | null | open | Most pythonic way to truncate a list to N indices when you can't guarantee the list is at least N length?
===
What is the most pythonic way to truncate a list to N indices when you can not guarantee the list is even N length? Something like this:
list = range(6)
if len(list) > 4:
list = list[:4]
I'm fairly new to python and am trying to learn to think pythonicly. The reason I want to even truncate the list is because I'm going to enumerate on it with an expected length and I only care about the first 4 elements. | 0 |
7,244,360 | 08/30/2011 13:54:56 | 187,241 | 10/09/2009 14:54:16 | 36 | 0 | Generate unique sequence number for entity during one day | I need to generate unique numbers for entities inserted into a table. Each number consists from entity creation date and serial number: date + sn. Serial numbers must be reset at the beginning of next day.
| id | creation date | unique number |
--------------------------------------
| 1 | Sep 1, 2010 | 201009011 |
| 2 | Sep 1, 2010 | 201009012 |
| 3 | Sep 2, 2010 | 201009021 |
| 4 | Sep 2, 2010 | 201009022 |
How can it be done using JPA over Hibernate (currently they are used for all database interactions) and in transaction safe way (entities can be inserted simultaneously) in MySQL database?
Of course, I will appreciate the descriptions of all other approaches. Thanks.
| mysql | hibernate | jpa | transactions | sequence | null | open | Generate unique sequence number for entity during one day
===
I need to generate unique numbers for entities inserted into a table. Each number consists from entity creation date and serial number: date + sn. Serial numbers must be reset at the beginning of next day.
| id | creation date | unique number |
--------------------------------------
| 1 | Sep 1, 2010 | 201009011 |
| 2 | Sep 1, 2010 | 201009012 |
| 3 | Sep 2, 2010 | 201009021 |
| 4 | Sep 2, 2010 | 201009022 |
How can it be done using JPA over Hibernate (currently they are used for all database interactions) and in transaction safe way (entities can be inserted simultaneously) in MySQL database?
Of course, I will appreciate the descriptions of all other approaches. Thanks.
| 0 |
4,332,077 | 12/02/2010 05:47:06 | 501,340 | 11/09/2010 01:11:16 | 13 | 0 | jQuery - Adding field fields dynamically | Im trying to implement some code i found on a website which duplicates a file field when you click a href link, the code is pretty much exactly the same from the site, yet its not working at all.
Could someone have a look and let me know where im going wrong.
The complete code is as follows:
<script>
$(
function(){
var jAddNewUpload = $( "#add-file-upload" );
jAddNewUpload
.attr( "href", "javascript:void( 0 )" )
.click(
function( objEvent ){
AddNewUpload();
objEvent.preventDefault();
return( false );
}
);
}
);
function AddNewUpload(){
var jFilesContainer = $( "mpfiles" );
var jUploadTemplate = $( "#element-templates div.row" );
var jUpload = jUploadTemplate.clone();
var strNewHTML = jUpload.html();
var intNewFileCount = (jFilesContainer.find( "div.row" ).length + 1);
jUpload.attr( "id", ("file" + intNewFileCount) );
strNewHTML = strNewHTML
.replace(
new RegExp( "::FIELD3::", "i" ), ("mpfile[]")
);
jUpload.html( strNewHTML );
jFilesContainer.append( jUpload );
}
</script>
<div id="mpfiles">
<div class="row">
<label>Files:</label>
<div class="files-box">
<div class="file sub-file">
<input class="file-input-area" name="mpfile[]" type="file" size="32" value="" />
<input readonly="readonly" class="text" type="text" value="click to upload" />
<a href="#" class="button">view</a>
</div>
</div>
</div>
</div>
<div id="element-templates" style="display: none;">
<div class="row">
<label>Files:</label>
<div class="files-box">
<div class="file sub-file">
<input class="file-input-area" type="file" name="::FIELD3::" size="32" value="" />
<input readonly="readonly" class="text" type="text" value="click to upload" />
<a href="#" class="button">view</a>
</div>
</div>
</div>
</div>
<div class="row">
<label> </label>
<a href="" id="add-file-upload">Upload another file</a>
</div>
The website where i got the code from is here [http://www.bennadel.com/blog/1375-Ask-Ben-Dynamically-Adding-File-Upload-Fields-To-A-Form-Using-jQuery.htm][1]
[1]: http://www.bennadel.com/blog/1375-Ask-Ben-Dynamically-Adding-File-Upload-Fields-To-A-Form-Using-jQuery.htm | jquery | null | null | null | null | 02/15/2012 11:49:17 | too localized | jQuery - Adding field fields dynamically
===
Im trying to implement some code i found on a website which duplicates a file field when you click a href link, the code is pretty much exactly the same from the site, yet its not working at all.
Could someone have a look and let me know where im going wrong.
The complete code is as follows:
<script>
$(
function(){
var jAddNewUpload = $( "#add-file-upload" );
jAddNewUpload
.attr( "href", "javascript:void( 0 )" )
.click(
function( objEvent ){
AddNewUpload();
objEvent.preventDefault();
return( false );
}
);
}
);
function AddNewUpload(){
var jFilesContainer = $( "mpfiles" );
var jUploadTemplate = $( "#element-templates div.row" );
var jUpload = jUploadTemplate.clone();
var strNewHTML = jUpload.html();
var intNewFileCount = (jFilesContainer.find( "div.row" ).length + 1);
jUpload.attr( "id", ("file" + intNewFileCount) );
strNewHTML = strNewHTML
.replace(
new RegExp( "::FIELD3::", "i" ), ("mpfile[]")
);
jUpload.html( strNewHTML );
jFilesContainer.append( jUpload );
}
</script>
<div id="mpfiles">
<div class="row">
<label>Files:</label>
<div class="files-box">
<div class="file sub-file">
<input class="file-input-area" name="mpfile[]" type="file" size="32" value="" />
<input readonly="readonly" class="text" type="text" value="click to upload" />
<a href="#" class="button">view</a>
</div>
</div>
</div>
</div>
<div id="element-templates" style="display: none;">
<div class="row">
<label>Files:</label>
<div class="files-box">
<div class="file sub-file">
<input class="file-input-area" type="file" name="::FIELD3::" size="32" value="" />
<input readonly="readonly" class="text" type="text" value="click to upload" />
<a href="#" class="button">view</a>
</div>
</div>
</div>
</div>
<div class="row">
<label> </label>
<a href="" id="add-file-upload">Upload another file</a>
</div>
The website where i got the code from is here [http://www.bennadel.com/blog/1375-Ask-Ben-Dynamically-Adding-File-Upload-Fields-To-A-Form-Using-jQuery.htm][1]
[1]: http://www.bennadel.com/blog/1375-Ask-Ben-Dynamically-Adding-File-Upload-Fields-To-A-Form-Using-jQuery.htm | 3 |
8,302,385 | 11/28/2011 21:13:48 | 674,033 | 03/23/2011 23:34:04 | 118 | 16 | PHP, json_decode, array issue | I have a multi-dimensional associative array that is encoded into JSON for database storage, and then decoded for display. I am having trouble accessing the resulting array elements.
An example JSON string: {"service":"Star Break Repair","options":{"Buy with me -60":"-60.00","Bulseye Break Repair":"30.00"}}
After decoding this using json_decode($array, true) (true gets an array, not an object), I get an array as expected:
Array
(
[service] => Star Break Repair
[options] => Array
(
[Buy with me -60] => -60.00
[Bulseye Break Repair] => 30.00
)
)
But when I try and echo a specific element:
echo @key($services['options'][0]);
or
echo $services['options'][0];
I get nothing, blank.
When I try to:
key($services['options'][0])
I get this error:
key() [function.key]: Passed variable is not an array or object in...
I've tried saving the options array as its own PHP variable, and the same thing happens. I can print_r() either array (the original with the nested options array, or just the options array), but when I try and print a specific element, nothing happens. When I try and print the element key, I get that PHP error.
What's going on? | php | json | null | null | null | null | open | PHP, json_decode, array issue
===
I have a multi-dimensional associative array that is encoded into JSON for database storage, and then decoded for display. I am having trouble accessing the resulting array elements.
An example JSON string: {"service":"Star Break Repair","options":{"Buy with me -60":"-60.00","Bulseye Break Repair":"30.00"}}
After decoding this using json_decode($array, true) (true gets an array, not an object), I get an array as expected:
Array
(
[service] => Star Break Repair
[options] => Array
(
[Buy with me -60] => -60.00
[Bulseye Break Repair] => 30.00
)
)
But when I try and echo a specific element:
echo @key($services['options'][0]);
or
echo $services['options'][0];
I get nothing, blank.
When I try to:
key($services['options'][0])
I get this error:
key() [function.key]: Passed variable is not an array or object in...
I've tried saving the options array as its own PHP variable, and the same thing happens. I can print_r() either array (the original with the nested options array, or just the options array), but when I try and print a specific element, nothing happens. When I try and print the element key, I get that PHP error.
What's going on? | 0 |
9,295,542 | 02/15/2012 14:51:11 | 1,187,490 | 02/03/2012 12:36:18 | 33 | 0 | How to translate such javaScript to coffeeScript | How to translate such javascript to use on rails applications? when I use service js2coffee and paste it's to *.js.coffee it doesn't work.
$(document).ready(function(){
if ($.browser.msie && jQuery.browser.version.substr(0,1)<='6' && readCookie('already_submit')!=1) {
var iemessage = document.createElement("div");
$(iemessage).addClass("ie-message");
$('body').append(iemessage);
var frame = document.createElement("iframe");
$(frame).addClass("nsframe");
$(iemessage).append(frame);
var alerterror = document.createElement("div");
$(alerterror).addClass("alert error");
$(iemessage).append(alerterror);
var close = document.createElement("div");
$(close).addClass("close-text");
$(alerterror).append(close);
var textclose = document.createElement("div");
$(textclose).addClass("text-img");
$(textclose).text("close");
$(close).append(textclose);
var h2 = document.createElement("h2");
$(h2).text("Sorry, your web-browser is outdated...");
$(alerterror).append(h2);
var h3 = document.createElement("h3");
$(h3).text("Our site could be displayed not correctly in your browser.");
$(alerterror).append(h3);
var p = document.createElement("p");
$(p).text("We recommend you install new version of web-browser:");
$(alerterror).append(p);
var browserslist = document.createElement("div");
$(browserslist).addClass("browsers-list");
$(iemessage).append(browserslist);
var achrome = document.createElement("a");
$(achrome).attr("href", "http://www.google.com/chrome");
$(browserslist).append(achrome);
var spanchrome = document.createElement("span");
$(spanchrome).addClass("browser-button chrome");
$(spanchrome).text("Google Chrome");
$(achrome).append(spanchrome);
var afirefox = document.createElement("a");
$(afirefox).attr("href", "http://www.mozilla.com/firefox/");
$(browserslist).append(afirefox);
var spanfirefox = document.createElement("span");
$(spanfirefox).addClass("browser-button firefox");
$(spanfirefox).text("Mozilla Firefox");
$(afirefox).append(spanfirefox);
var aopera = document.createElement("a");
$(aopera).attr("href", "http://www.opera.com/download/");
$(browserslist).append(aopera);
var spanopera = document.createElement("span");
$(spanopera).addClass("browser-button opera");
$(spanopera).text("Opera");
$(aopera).append(spanopera);
var asafari = document.createElement("a");
$(asafari).attr("href", "http://www.apple.com/safari/download/");
$(browserslist).append(asafari);
var spansafari = document.createElement("span");
$(spansafari).addClass("browser-button safari");
$(spansafari).text("Apple Safari");
$(asafari).append(spansafari);
var aexplorer = document.createElement("a");
$(aexplorer).attr("href", "http://www.microsoft.com/windows/Internet-explorer/default.aspx");
$(browserslist).append(aexplorer);
var spanexplorer = document.createElement("span");
$(spanexplorer).addClass("browser-button ie");
$(spanexplorer).text("Internet Explorer");
$(aexplorer).append(spanexplorer);
$(iemessage).toggle();
$('.close-text').mouseover(function() {
$('.close-text').css({"border-bottom":"1px solid #000"});
$('.close-text').css({"color":"#959595"});
$('.close-text').css({"background":"url(/assets/browsers/button-close-hover.png) 100% 100% no-repeat"});
});
$('.close-text').mouseleave(function() {
$('.close-text').css({"border-bottom":"none"});
$('.close-text').css({"color":"#4e4e4e"});
$('.close-text').css({"background":"url(/assets/browsers/button-close.png) 100% 100% no-repeat"});
});
$('.close-text').click(function() {
$('.ie-message').hide();
createCookie('already_submit', 1, 0);
});
}
function createCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}
function eraseCookie(name) {
createCookie(name,"",-1);
}
});
Moreover, how to refactor my code, but in my style using objects? | javascript | jquery | ruby-on-rails | coffeescript | null | 02/15/2012 22:17:22 | too localized | How to translate such javaScript to coffeeScript
===
How to translate such javascript to use on rails applications? when I use service js2coffee and paste it's to *.js.coffee it doesn't work.
$(document).ready(function(){
if ($.browser.msie && jQuery.browser.version.substr(0,1)<='6' && readCookie('already_submit')!=1) {
var iemessage = document.createElement("div");
$(iemessage).addClass("ie-message");
$('body').append(iemessage);
var frame = document.createElement("iframe");
$(frame).addClass("nsframe");
$(iemessage).append(frame);
var alerterror = document.createElement("div");
$(alerterror).addClass("alert error");
$(iemessage).append(alerterror);
var close = document.createElement("div");
$(close).addClass("close-text");
$(alerterror).append(close);
var textclose = document.createElement("div");
$(textclose).addClass("text-img");
$(textclose).text("close");
$(close).append(textclose);
var h2 = document.createElement("h2");
$(h2).text("Sorry, your web-browser is outdated...");
$(alerterror).append(h2);
var h3 = document.createElement("h3");
$(h3).text("Our site could be displayed not correctly in your browser.");
$(alerterror).append(h3);
var p = document.createElement("p");
$(p).text("We recommend you install new version of web-browser:");
$(alerterror).append(p);
var browserslist = document.createElement("div");
$(browserslist).addClass("browsers-list");
$(iemessage).append(browserslist);
var achrome = document.createElement("a");
$(achrome).attr("href", "http://www.google.com/chrome");
$(browserslist).append(achrome);
var spanchrome = document.createElement("span");
$(spanchrome).addClass("browser-button chrome");
$(spanchrome).text("Google Chrome");
$(achrome).append(spanchrome);
var afirefox = document.createElement("a");
$(afirefox).attr("href", "http://www.mozilla.com/firefox/");
$(browserslist).append(afirefox);
var spanfirefox = document.createElement("span");
$(spanfirefox).addClass("browser-button firefox");
$(spanfirefox).text("Mozilla Firefox");
$(afirefox).append(spanfirefox);
var aopera = document.createElement("a");
$(aopera).attr("href", "http://www.opera.com/download/");
$(browserslist).append(aopera);
var spanopera = document.createElement("span");
$(spanopera).addClass("browser-button opera");
$(spanopera).text("Opera");
$(aopera).append(spanopera);
var asafari = document.createElement("a");
$(asafari).attr("href", "http://www.apple.com/safari/download/");
$(browserslist).append(asafari);
var spansafari = document.createElement("span");
$(spansafari).addClass("browser-button safari");
$(spansafari).text("Apple Safari");
$(asafari).append(spansafari);
var aexplorer = document.createElement("a");
$(aexplorer).attr("href", "http://www.microsoft.com/windows/Internet-explorer/default.aspx");
$(browserslist).append(aexplorer);
var spanexplorer = document.createElement("span");
$(spanexplorer).addClass("browser-button ie");
$(spanexplorer).text("Internet Explorer");
$(aexplorer).append(spanexplorer);
$(iemessage).toggle();
$('.close-text').mouseover(function() {
$('.close-text').css({"border-bottom":"1px solid #000"});
$('.close-text').css({"color":"#959595"});
$('.close-text').css({"background":"url(/assets/browsers/button-close-hover.png) 100% 100% no-repeat"});
});
$('.close-text').mouseleave(function() {
$('.close-text').css({"border-bottom":"none"});
$('.close-text').css({"color":"#4e4e4e"});
$('.close-text').css({"background":"url(/assets/browsers/button-close.png) 100% 100% no-repeat"});
});
$('.close-text').click(function() {
$('.ie-message').hide();
createCookie('already_submit', 1, 0);
});
}
function createCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}
function eraseCookie(name) {
createCookie(name,"",-1);
}
});
Moreover, how to refactor my code, but in my style using objects? | 3 |
4,095,625 | 11/04/2010 10:14:22 | 326,821 | 04/27/2010 11:43:16 | 449 | 4 | insert into doesnt work | Why query below doesnt work:
insert into [ProcessStatus] ([ProcessId])
SELECT TMP.[ProcessId]`
from (
select distinct
[ProcessId]
FROM [Process]
) TMP
error message is:
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
| sql | sql-server-2008 | null | null | null | null | open | insert into doesnt work
===
Why query below doesnt work:
insert into [ProcessStatus] ([ProcessId])
SELECT TMP.[ProcessId]`
from (
select distinct
[ProcessId]
FROM [Process]
) TMP
error message is:
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
| 0 |
9,114,073 | 02/02/2012 14:31:20 | 429,751 | 08/24/2010 15:54:56 | 169 | 18 | Best Email Marketing API Recommendations | Does anyone have experience using the APIs from some of the email marketing services. We're currently a MailChimp user but we're looking at building a system around a service to help our clients manage events, conferences etc. I've looked at the APIs for MailChimp, Active Campaign and Campaign Monitor. They all seem to offer similar options.
Is there a reason to avoid any due to a poorly design API, is one far superior to the others?
Features we'd be looking for are:
- Easily segmenting lists based on if a recipient wants to attend an event.
- Generate (send?) tailored emails if they signed up to come
- Automatically send reminder / thanks emails
We primarily code in PHP on the back end, but are a design lead company so being able to customise email templates is a must. We're happy with white label or co-branding.
Thanks
Ric | api | email | newsletter | mailchimp | null | 02/05/2012 05:04:37 | not constructive | Best Email Marketing API Recommendations
===
Does anyone have experience using the APIs from some of the email marketing services. We're currently a MailChimp user but we're looking at building a system around a service to help our clients manage events, conferences etc. I've looked at the APIs for MailChimp, Active Campaign and Campaign Monitor. They all seem to offer similar options.
Is there a reason to avoid any due to a poorly design API, is one far superior to the others?
Features we'd be looking for are:
- Easily segmenting lists based on if a recipient wants to attend an event.
- Generate (send?) tailored emails if they signed up to come
- Automatically send reminder / thanks emails
We primarily code in PHP on the back end, but are a design lead company so being able to customise email templates is a must. We're happy with white label or co-branding.
Thanks
Ric | 4 |
8,996,619 | 01/25/2012 01:01:29 | 1,166,340 | 01/24/2012 05:36:39 | 1 | 0 | Drupal 7 db_insert error on simple query | I am having an issue inserting an entry with db_insert. I am 100% certain my table and field names match up, and the values I'm passing are fine and look good in debug output. Yet, I keep getting a syntax error:
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc, fstate, fname, fexpire, size, item) VALUES ('0', '1', '1327451461', '0', '' at line 1
<?
$e = array();
$e['id'] = 0;
$e['type'] = exif_imagetype($fullpath);
$e['updated'] = time();
$e['lc'] = 0;
$e['desc'] = $form_state['values']['brand_name'] . ' logo';
$e['fstate'] = EET_BULK_LOCKED;
$e['fname'] = $fif->filename;
$e['fexpire'] = $e['updated'] + (3600 * 24 * 7);
$e['size'] = $fif->filesize;
// $e['item'] = file_get_contents($fullpath);
$e['item'] = 0;
debug("e = " . print_r($e));
$dbi = db_insert('eet_bulk');
$dbi->fields($e);
try
{
$bulk_id = $dbi->execute();
}
catch (PDOException $pe)
{
form_set_error("dbi bulk item", $pe->getMessage());
}
$dbi = NULL;
My db field names match up, and the data outputs fine in debug.
What am I missing? | database | insert | drupal-7 | syntax-error | null | 01/25/2012 13:42:59 | too localized | Drupal 7 db_insert error on simple query
===
I am having an issue inserting an entry with db_insert. I am 100% certain my table and field names match up, and the values I'm passing are fine and look good in debug output. Yet, I keep getting a syntax error:
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc, fstate, fname, fexpire, size, item) VALUES ('0', '1', '1327451461', '0', '' at line 1
<?
$e = array();
$e['id'] = 0;
$e['type'] = exif_imagetype($fullpath);
$e['updated'] = time();
$e['lc'] = 0;
$e['desc'] = $form_state['values']['brand_name'] . ' logo';
$e['fstate'] = EET_BULK_LOCKED;
$e['fname'] = $fif->filename;
$e['fexpire'] = $e['updated'] + (3600 * 24 * 7);
$e['size'] = $fif->filesize;
// $e['item'] = file_get_contents($fullpath);
$e['item'] = 0;
debug("e = " . print_r($e));
$dbi = db_insert('eet_bulk');
$dbi->fields($e);
try
{
$bulk_id = $dbi->execute();
}
catch (PDOException $pe)
{
form_set_error("dbi bulk item", $pe->getMessage());
}
$dbi = NULL;
My db field names match up, and the data outputs fine in debug.
What am I missing? | 3 |
1,600,379 | 10/21/2009 11:58:33 | 79,980 | 03/19/2009 11:30:37 | 269 | 2 | Best option to use while generating a Field inside a Form on loading | i m having a doubt regarding which one is better option to use ?
$("<input id="input1"></input>").appendTo("#Form");
OR
using $(<?php echo $form->input();?>).appendTo("#Form");
| cakephp | jquery | null | null | null | null | open | Best option to use while generating a Field inside a Form on loading
===
i m having a doubt regarding which one is better option to use ?
$("<input id="input1"></input>").appendTo("#Form");
OR
using $(<?php echo $form->input();?>).appendTo("#Form");
| 0 |
9,362,849 | 02/20/2012 14:36:32 | 655,373 | 03/11/2011 12:58:07 | 77 | 0 | Where can i find out information about the british programing culture of the sinclair generation | Any pointers to books, magazines, articles from the era and articles about the era would be appreciated.Also any information about the coders said era produced or any software still in use from that time. | history | culture | sinclair | null | null | 04/07/2012 21:04:11 | off topic | Where can i find out information about the british programing culture of the sinclair generation
===
Any pointers to books, magazines, articles from the era and articles about the era would be appreciated.Also any information about the coders said era produced or any software still in use from that time. | 2 |
11,153,738 | 06/22/2012 09:39:00 | 1,284,989 | 03/22/2012 04:09:38 | 29 | 0 | How to display the values in listview in android? | private DataSource mDataSource;
private Context mContext;
private SQLiteDatabase mSQLiteDatabase;
String log;
Lazycommunity adapter;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.list);
mDataSource = new DataSource(getBaseContext());
// Getting All Contacts
Log.d("Reading: ", "Reading all contacts..");
ArrayList<Contact> contacts = mDataSource.getAllContacts();
for (Contact cn : contacts) {
String log = "Id: "+cn.getID()+" ,Name: " + cn.getName() + " ,Phone: " + cn.getrelation();
// Writing Contacts to log
Log.d("Name: ", log);
}
Here i am getting the database values using ArrayList.String Log gives the database values in my log cat.but i want to display the string value in array List format.can anybody help me? | android | sqlite | listview | arraylist | null | 06/22/2012 15:49:15 | not a real question | How to display the values in listview in android?
===
private DataSource mDataSource;
private Context mContext;
private SQLiteDatabase mSQLiteDatabase;
String log;
Lazycommunity adapter;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.list);
mDataSource = new DataSource(getBaseContext());
// Getting All Contacts
Log.d("Reading: ", "Reading all contacts..");
ArrayList<Contact> contacts = mDataSource.getAllContacts();
for (Contact cn : contacts) {
String log = "Id: "+cn.getID()+" ,Name: " + cn.getName() + " ,Phone: " + cn.getrelation();
// Writing Contacts to log
Log.d("Name: ", log);
}
Here i am getting the database values using ArrayList.String Log gives the database values in my log cat.but i want to display the string value in array List format.can anybody help me? | 1 |
10,129,521 | 04/12/2012 18:25:31 | 1,300,427 | 03/29/2012 09:46:34 | 6 | 1 | Javascript Basic Slider | Basically, I have no experience with Javascript whatsoever.
I have to make a very simple image slider but I can't get it to show the next image automatically.
var currentItem = $('#project-list li').first();
function showNextSlide()
{
if(currentItem.length == 0){
currentItem = $('#project-list li').first();
}
console.log(currentItem);
currentItem.css('display', 'none');
currentItem = currentItem.next();
currentItem.css('display', 'block');
}
My images are loaded like this
<ul class="project-list" id="project-list">
<li class="project current slide-1">
<img src="http://lorempixel.com/600/300/animals/1" />
</li>
<li class="project slide-2">
<img src="http://lorempixel.com/600/300/animals/2" />
</li>
<li class="project slide-3">
<img src="http://lorempixel.com/600/300/animals/3" />
</li>
<li class="project slide-4">
<img src="http://lorempixel.com/600/300/animals/4" />
</li>
</ul>
Appreciate any help! | javascript | slider | basic | null | null | null | open | Javascript Basic Slider
===
Basically, I have no experience with Javascript whatsoever.
I have to make a very simple image slider but I can't get it to show the next image automatically.
var currentItem = $('#project-list li').first();
function showNextSlide()
{
if(currentItem.length == 0){
currentItem = $('#project-list li').first();
}
console.log(currentItem);
currentItem.css('display', 'none');
currentItem = currentItem.next();
currentItem.css('display', 'block');
}
My images are loaded like this
<ul class="project-list" id="project-list">
<li class="project current slide-1">
<img src="http://lorempixel.com/600/300/animals/1" />
</li>
<li class="project slide-2">
<img src="http://lorempixel.com/600/300/animals/2" />
</li>
<li class="project slide-3">
<img src="http://lorempixel.com/600/300/animals/3" />
</li>
<li class="project slide-4">
<img src="http://lorempixel.com/600/300/animals/4" />
</li>
</ul>
Appreciate any help! | 0 |
10,352,187 | 04/27/2012 14:07:23 | 209,591 | 11/12/2009 13:17:52 | 904 | 21 | connecting to MongoDB using mongoose (node.js) while schema was already defined (in Java) | I'm trying to connect to MongoDB in Node.js through Mongoose. All examples talk about first designing a schema for your documents before attempting to save and find documents.
However, I've already defined lot's of schema's in MongoDB using java (Morphia) . Is there any way I could leverage the already (implicitly) existing schema's in MongoDB in Mongoose? I.e: I can imagine meta-data being stored in MongoDB about the types of documents being created, which could be used by Mongoose to create it's own client-side schema's.
Thanks. | mongodb | mongoose | null | null | null | null | open | connecting to MongoDB using mongoose (node.js) while schema was already defined (in Java)
===
I'm trying to connect to MongoDB in Node.js through Mongoose. All examples talk about first designing a schema for your documents before attempting to save and find documents.
However, I've already defined lot's of schema's in MongoDB using java (Morphia) . Is there any way I could leverage the already (implicitly) existing schema's in MongoDB in Mongoose? I.e: I can imagine meta-data being stored in MongoDB about the types of documents being created, which could be used by Mongoose to create it's own client-side schema's.
Thanks. | 0 |
6,733,976 | 07/18/2011 13:53:45 | 847,375 | 07/16/2011 01:16:07 | 3 | 0 | C++ if statement error! | I got the following error:
> error: no matching function for call to 'max(int&, int&, int&, int&)'
My code is:
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <time.h>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <stdio.h>
using namespace std;
int main()
{
srand(time(NULL));
int g1l= rand()%5;
int g1r= rand()%5;
int g2l= rand()%5;
int g2r= rand()%5;
int g3l= rand()%5;
int g3r= rand()%5;
int g4l= rand()%5;
int g4r= rand()%5;
int g5l= rand()%5;
int g5r= rand()%5;
int g6l= rand()%5;
int g6r= rand()%5;
int manudw = 0;
int manudd = 0;
int manudl = 0;
int lagalw = 0;
int lagald = 0;
int lagall = 0;
int rmadw = 0;
int rmadd = 0;
int rmadl = 0;
int acmilw = 0;
int acmild = 0;
int acmill = 0;
int manudp = ((manudw*3)+(manudd*1));
int lagalp = ((lagalw*3)+(lagald*1));
int rmadp = ((rmadw*3)+(rmadd*1));
int acmilp = ((acmilw*3)+(acmild*1));
string manud = "Manchester United";
string lagal = "Los Angeles Galaxy";
string rmad = "Real Madrid";
string acmil = "AC Milan";
string place1 = "Manchester United |";
string place2 = "Real Madrid |";
string place3 = "AC Milan |";
string place4 = "Los Angeles Galaxy |";
int counter=0;
int round1;
int round2;
int round3;
int manudgd = 0;
int rmadgd = 0;
int acmilgd = 0;
int lagalgd = 0;
do
{
int manudp = ((manudw*3)+(manudd*1));
int lagalp = ((lagalw*3)+(lagald*1));
int rmadp = ((rmadw*3)+(rmadd*1));
int acmilp = ((acmilw*3)+(acmild*1));
int manudgd = ((g1l+g3r+g6r)-(g1r+g3l+g6l));
int rmadgd = ((g2l+g3l+g5r)-(g2r+g3r+g5l));
int acmilgd = ((g2r+g4l+g6l)-(g2l+g4r+g6r));
int lagalgd = ((g1r+g4r+g5l)-(g1l+g4l+g5r));
cout<<place1<<" "<<manudw<<" | "<<manudd<<" | "<<manudl<<" | "<<manudp<<" | "<<manudgd<<" |"<<endl<<
place2<<" "<<rmadw<<" | "<<rmadd<<" | "<<rmadl<<" | "<<rmadp<<" | "<<rmadgd<<" |"<<endl<<
place3<<" "<<acmilw<<" | "<<acmild<<" | "<<acmill<<" | "<<acmilp<<" | "<<acmilgd<<" |"<<endl<<
place4<<" "<<lagalw<<" | "<<lagald<<" | "<<lagall<<" | "<<lagalp<<" | "<<lagalgd<<" |"<<endl<<endl;
// if(max(manudgd,rmadgd,lagalgd,acmilgd)==manudgd || max(manudgd,rmadgd,lagalgd,acmilgd)==rmadgd || max(manudgd,rmadgd,lagalgd,acmilgd)==lagalgd || max(manudgd,rmadgd,lagalgd,acmilgd)==acmilgd)
if(counter==0)
{
for(round1=0;round1<=0;round1++)
{
cout<<"Manchester United "<<g1l<<"-"<<g1r<<" Los Angeles Galaxy"<<endl;
cout<<"Real Madrid "<<g2l<<"-"<<g2r<<" AC Milan"<<endl<<endl;
int manudgd = ((g1l)-(g1r));
int rmadgd = ((g2l)-(g2r));
int acmilgd = ((g2r)-(g2l));
int lagalgd = ((g1r)-(g1l));
if(g1l>g1r)
{
manudw++;
lagall++;
}
else if(g1l<g1r)
{
lagalw++;
manudl++;
}
else if(g1l==g1r)
{
manudd++;
lagald++;
}
if(g2l>g2r)
{
rmadw++;
acmill++;
}
else if(g2l<g2r)
{
rmadl++;
acmilw++;
}
else if(g2l==g2r)
{
rmadd++;
acmild++;
}
}
}
else if(counter==1)
{
for(round2=0;round2<=0;round2++)
{
cout<<"Real Madrid "<<g3l<<"-"<<g3r<<" Manchester United"<<endl;
cout<<"AC Milan "<<g4l<<"-"<<g4r<<" Los Angeles Galaxy"<<endl<<endl;
int manudgd = ((g1l+g3r)-(g1r+g3l));
int rmadgd = ((g2l+g3l)-(g2r+g3r));
int acmilgd = ((g2r+g4l)-(g2l+g4r));
int lagalgd = ((g1r+g4r)-(g1l+g4l));
if(g3l>g3r)
{
rmadw++;
manudl++;
}
else if(g3l<g3r)
{
manudw++;
rmadl++;
}
else if(g3l==g3r)
{
manudd++;
rmadd++;
}
if(g4l>g4r)
{
acmilw++;
lagall++;
}
else if(g4l<g4r)
{
acmill++;
lagalw++;
}
else if(g4l==g4r)
{
lagald++;
acmild++;
}
}
}
else if(counter==2)
{
for(round3=0;round3<=0;round3++)
{
cout<<"Los Angeles Galaxy "<<g5l<<"-"<<g5r<<" Real Madrid"<<endl;
cout<<"AC Milan "<<g6l<<"-"<<g6r<<" Manchester United"<<endl<<endl;
int manudgd = ((g1l+g3r+g6r)-(g1r+g3l+g6l));
int rmadgd = ((g2l+g3l+g5r)-(g2r+g3r+g5l));
int acmilgd = ((g2r+g4l+g6l)-(g2l+g4r+g6r));
int lagalgd = ((g1r+g4r+g5l)-(g1l+g4l+g5r));
if(g5l>g5r)
{
lagalw++;
rmadl++;
}
else if(g5l<g5r)
{
rmadw++;
lagall++;
}
else if(g5l==g5r)
{
lagald++;
rmadd++;
}
if(g6l>g6r)
{
acmilw++;
manudl++;
}
else if(g6l<g6r)
{
acmill++;
manudw++;
}
else if(g6l==g6r)
{
manudd++;
acmild++;
}
}
}
counter++;
}
while(counter!=4);
}
The line I got the error on was on the 74th line:
if(max(manudgd,rmadgd,lagalgd,acmilgd)==manudgd || max(manudgd,rmadgd,lagalgd,acmilgd)==rmadgd || max(manudgd,rmadgd,lagalgd,acmilgd)==lagalgd || max(manudgd,rmadgd,lagalgd,acmilgd)==acmilgd)
This was all in C++ just in case you don't see the tags or recognize the code.
| c++ | if-statement | null | null | null | 07/18/2011 15:46:14 | not a real question | C++ if statement error!
===
I got the following error:
> error: no matching function for call to 'max(int&, int&, int&, int&)'
My code is:
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <time.h>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <stdio.h>
using namespace std;
int main()
{
srand(time(NULL));
int g1l= rand()%5;
int g1r= rand()%5;
int g2l= rand()%5;
int g2r= rand()%5;
int g3l= rand()%5;
int g3r= rand()%5;
int g4l= rand()%5;
int g4r= rand()%5;
int g5l= rand()%5;
int g5r= rand()%5;
int g6l= rand()%5;
int g6r= rand()%5;
int manudw = 0;
int manudd = 0;
int manudl = 0;
int lagalw = 0;
int lagald = 0;
int lagall = 0;
int rmadw = 0;
int rmadd = 0;
int rmadl = 0;
int acmilw = 0;
int acmild = 0;
int acmill = 0;
int manudp = ((manudw*3)+(manudd*1));
int lagalp = ((lagalw*3)+(lagald*1));
int rmadp = ((rmadw*3)+(rmadd*1));
int acmilp = ((acmilw*3)+(acmild*1));
string manud = "Manchester United";
string lagal = "Los Angeles Galaxy";
string rmad = "Real Madrid";
string acmil = "AC Milan";
string place1 = "Manchester United |";
string place2 = "Real Madrid |";
string place3 = "AC Milan |";
string place4 = "Los Angeles Galaxy |";
int counter=0;
int round1;
int round2;
int round3;
int manudgd = 0;
int rmadgd = 0;
int acmilgd = 0;
int lagalgd = 0;
do
{
int manudp = ((manudw*3)+(manudd*1));
int lagalp = ((lagalw*3)+(lagald*1));
int rmadp = ((rmadw*3)+(rmadd*1));
int acmilp = ((acmilw*3)+(acmild*1));
int manudgd = ((g1l+g3r+g6r)-(g1r+g3l+g6l));
int rmadgd = ((g2l+g3l+g5r)-(g2r+g3r+g5l));
int acmilgd = ((g2r+g4l+g6l)-(g2l+g4r+g6r));
int lagalgd = ((g1r+g4r+g5l)-(g1l+g4l+g5r));
cout<<place1<<" "<<manudw<<" | "<<manudd<<" | "<<manudl<<" | "<<manudp<<" | "<<manudgd<<" |"<<endl<<
place2<<" "<<rmadw<<" | "<<rmadd<<" | "<<rmadl<<" | "<<rmadp<<" | "<<rmadgd<<" |"<<endl<<
place3<<" "<<acmilw<<" | "<<acmild<<" | "<<acmill<<" | "<<acmilp<<" | "<<acmilgd<<" |"<<endl<<
place4<<" "<<lagalw<<" | "<<lagald<<" | "<<lagall<<" | "<<lagalp<<" | "<<lagalgd<<" |"<<endl<<endl;
// if(max(manudgd,rmadgd,lagalgd,acmilgd)==manudgd || max(manudgd,rmadgd,lagalgd,acmilgd)==rmadgd || max(manudgd,rmadgd,lagalgd,acmilgd)==lagalgd || max(manudgd,rmadgd,lagalgd,acmilgd)==acmilgd)
if(counter==0)
{
for(round1=0;round1<=0;round1++)
{
cout<<"Manchester United "<<g1l<<"-"<<g1r<<" Los Angeles Galaxy"<<endl;
cout<<"Real Madrid "<<g2l<<"-"<<g2r<<" AC Milan"<<endl<<endl;
int manudgd = ((g1l)-(g1r));
int rmadgd = ((g2l)-(g2r));
int acmilgd = ((g2r)-(g2l));
int lagalgd = ((g1r)-(g1l));
if(g1l>g1r)
{
manudw++;
lagall++;
}
else if(g1l<g1r)
{
lagalw++;
manudl++;
}
else if(g1l==g1r)
{
manudd++;
lagald++;
}
if(g2l>g2r)
{
rmadw++;
acmill++;
}
else if(g2l<g2r)
{
rmadl++;
acmilw++;
}
else if(g2l==g2r)
{
rmadd++;
acmild++;
}
}
}
else if(counter==1)
{
for(round2=0;round2<=0;round2++)
{
cout<<"Real Madrid "<<g3l<<"-"<<g3r<<" Manchester United"<<endl;
cout<<"AC Milan "<<g4l<<"-"<<g4r<<" Los Angeles Galaxy"<<endl<<endl;
int manudgd = ((g1l+g3r)-(g1r+g3l));
int rmadgd = ((g2l+g3l)-(g2r+g3r));
int acmilgd = ((g2r+g4l)-(g2l+g4r));
int lagalgd = ((g1r+g4r)-(g1l+g4l));
if(g3l>g3r)
{
rmadw++;
manudl++;
}
else if(g3l<g3r)
{
manudw++;
rmadl++;
}
else if(g3l==g3r)
{
manudd++;
rmadd++;
}
if(g4l>g4r)
{
acmilw++;
lagall++;
}
else if(g4l<g4r)
{
acmill++;
lagalw++;
}
else if(g4l==g4r)
{
lagald++;
acmild++;
}
}
}
else if(counter==2)
{
for(round3=0;round3<=0;round3++)
{
cout<<"Los Angeles Galaxy "<<g5l<<"-"<<g5r<<" Real Madrid"<<endl;
cout<<"AC Milan "<<g6l<<"-"<<g6r<<" Manchester United"<<endl<<endl;
int manudgd = ((g1l+g3r+g6r)-(g1r+g3l+g6l));
int rmadgd = ((g2l+g3l+g5r)-(g2r+g3r+g5l));
int acmilgd = ((g2r+g4l+g6l)-(g2l+g4r+g6r));
int lagalgd = ((g1r+g4r+g5l)-(g1l+g4l+g5r));
if(g5l>g5r)
{
lagalw++;
rmadl++;
}
else if(g5l<g5r)
{
rmadw++;
lagall++;
}
else if(g5l==g5r)
{
lagald++;
rmadd++;
}
if(g6l>g6r)
{
acmilw++;
manudl++;
}
else if(g6l<g6r)
{
acmill++;
manudw++;
}
else if(g6l==g6r)
{
manudd++;
acmild++;
}
}
}
counter++;
}
while(counter!=4);
}
The line I got the error on was on the 74th line:
if(max(manudgd,rmadgd,lagalgd,acmilgd)==manudgd || max(manudgd,rmadgd,lagalgd,acmilgd)==rmadgd || max(manudgd,rmadgd,lagalgd,acmilgd)==lagalgd || max(manudgd,rmadgd,lagalgd,acmilgd)==acmilgd)
This was all in C++ just in case you don't see the tags or recognize the code.
| 1 |
7,358,011 | 09/09/2011 06:42:01 | 860,994 | 07/25/2011 06:16:57 | 29 | 0 | UIScrollView horiztal paging | I want to create an iphone application that has horizontal paging views. I have seen many examples online with the horizontal paging but I haven't seen one with vertical scrolling for each of the page. In other word, I want to have a horizontal paging, and each of the page will scroll vertically (up and down).Thanks for your help!
Kevin | iphone | uiscrollview | null | null | null | null | open | UIScrollView horiztal paging
===
I want to create an iphone application that has horizontal paging views. I have seen many examples online with the horizontal paging but I haven't seen one with vertical scrolling for each of the page. In other word, I want to have a horizontal paging, and each of the page will scroll vertically (up and down).Thanks for your help!
Kevin | 0 |
6,212,148 | 06/02/2011 08:27:44 | 745,647 | 05/09/2011 18:31:42 | 1 | 0 | problem with apache htaccess rules | How do I make apache stop following rules once one is matched in a .htaccess file?
I've added the following to the bottom of the file:
RewriteRule ^(.+)$ index.php [QSA,L,NC]
However, it seems to be skipping all other rules above it and just uses that rule. I want to use the rule above as a catch all for any URLs not matched previously.
Is this possible?
| apache | .htaccess | null | null | null | 06/02/2011 08:50:25 | off topic | problem with apache htaccess rules
===
How do I make apache stop following rules once one is matched in a .htaccess file?
I've added the following to the bottom of the file:
RewriteRule ^(.+)$ index.php [QSA,L,NC]
However, it seems to be skipping all other rules above it and just uses that rule. I want to use the rule above as a catch all for any URLs not matched previously.
Is this possible?
| 2 |
9,610,960 | 03/07/2012 23:50:11 | 1,180,653 | 01/31/2012 15:21:15 | 44 | 0 | How to capture Deleted events for nested folders using keyboard delete | I have a FileWatcher program written using C# - FileSystemWatcherClass
I have nested folders (C:\F1\F2\F3\F4\Test.txt. When I copy the root folder F1 to the FileWatcher folder using Mouse, I used to get events for each folder separately, ie, **created** event for F1, F2,F3,F4 etc and Changed event for f1,f2,f3 etc.
But when I delete Folder F1, I am getting just a **deleted** event for F1. But if use **shift + delete**, I am getting **deleted** events for each folder separately.
Question:
Is it the windows functionality?
Can I capture each folder events **Deleted** separately for every folder , if I delete the folder F1 using the keyboard delete?
| c# | null | null | null | null | null | open | How to capture Deleted events for nested folders using keyboard delete
===
I have a FileWatcher program written using C# - FileSystemWatcherClass
I have nested folders (C:\F1\F2\F3\F4\Test.txt. When I copy the root folder F1 to the FileWatcher folder using Mouse, I used to get events for each folder separately, ie, **created** event for F1, F2,F3,F4 etc and Changed event for f1,f2,f3 etc.
But when I delete Folder F1, I am getting just a **deleted** event for F1. But if use **shift + delete**, I am getting **deleted** events for each folder separately.
Question:
Is it the windows functionality?
Can I capture each folder events **Deleted** separately for every folder , if I delete the folder F1 using the keyboard delete?
| 0 |
7,447,545 | 09/16/2011 16:08:38 | 949,231 | 09/16/2011 16:08:38 | 1 | 0 | some matrix operations and extracting data | I want to ask a question in some matrix operations in MATLAB
Assume we have this matrix:
A = [1 1 17
1 1 14
1 2 10
1 2 11
2 1 9
2 1 9
2 2 13
2 2 12
3 1 18
3 1 15]
I want the first column, say M and the second column, say D to
control the entire matrix to result to one row matrix depending
on the following condition:
the program will ask the user to enter the values of M then D as follows:
M = input(' ENTER M VALUE = ') ;
D = input(' ENTER D VALUE = ') ;
Now, the output will be the corresponding 2 values to M and D .
and these two values will be taken from the third column,
for example:
if M = 1 and D = 2 , the output is B = 10 ; 11
another example:
if M = 3 and D = 1 , the output is B = 18 ; 15
and so on
Actually, I know how to solve this using if statement but I have large
data and this will take very long time since M values will be up to 15
and N values will be up to 35 and for simplicity I posted the above small example.
Thanks
| matlab | matrix | null | null | null | null | open | some matrix operations and extracting data
===
I want to ask a question in some matrix operations in MATLAB
Assume we have this matrix:
A = [1 1 17
1 1 14
1 2 10
1 2 11
2 1 9
2 1 9
2 2 13
2 2 12
3 1 18
3 1 15]
I want the first column, say M and the second column, say D to
control the entire matrix to result to one row matrix depending
on the following condition:
the program will ask the user to enter the values of M then D as follows:
M = input(' ENTER M VALUE = ') ;
D = input(' ENTER D VALUE = ') ;
Now, the output will be the corresponding 2 values to M and D .
and these two values will be taken from the third column,
for example:
if M = 1 and D = 2 , the output is B = 10 ; 11
another example:
if M = 3 and D = 1 , the output is B = 18 ; 15
and so on
Actually, I know how to solve this using if statement but I have large
data and this will take very long time since M values will be up to 15
and N values will be up to 35 and for simplicity I posted the above small example.
Thanks
| 0 |
6,819,741 | 07/25/2011 17:02:55 | 478,699 | 10/17/2010 18:31:25 | 1 | 0 | Magento throws 404 Page not found error when going to CMS->Pages in admin | All the other views/functionality on the administrator work fine, but when I go to CMS->Pages, I get a "404 error: Page not found." page.
This is preventing me from managing my pages, what can be causing this? I realize there are similar issues of getting this erro on the admin side, but for me, its happening only when trying to access the "Pages" section.
| php | magento | content-management-system | e-commerce | null | 07/27/2011 13:43:53 | off topic | Magento throws 404 Page not found error when going to CMS->Pages in admin
===
All the other views/functionality on the administrator work fine, but when I go to CMS->Pages, I get a "404 error: Page not found." page.
This is preventing me from managing my pages, what can be causing this? I realize there are similar issues of getting this erro on the admin side, but for me, its happening only when trying to access the "Pages" section.
| 2 |
11,447,635 | 07/12/2012 08:13:43 | 783,589 | 06/04/2011 03:13:10 | 65 | 4 | Upload a file using Html and Applet | I want to develop an uploading code for my application. Her are my requirements.
1. My html page should open upload window and let me browse and select multiple files to be upload.
2. Once I select files that files should be transfer to my signed applet class, where I am going to encrypt the file content and the save it on server.
I have developed encryption code and its working fine, But I am confused how to do rest of the work. Can some one please provide me an example or any reference for it? | java | html | jsp | applet | null | 07/13/2012 15:26:04 | not a real question | Upload a file using Html and Applet
===
I want to develop an uploading code for my application. Her are my requirements.
1. My html page should open upload window and let me browse and select multiple files to be upload.
2. Once I select files that files should be transfer to my signed applet class, where I am going to encrypt the file content and the save it on server.
I have developed encryption code and its working fine, But I am confused how to do rest of the work. Can some one please provide me an example or any reference for it? | 1 |
2,708,887 | 04/25/2010 16:18:15 | 325,418 | 05/09/2009 15:50:29 | 3,209 | 104 | An exception to avoid copy and paste code? | There are many files in our project that would call a Facebook api. And the call is complicated, spanning usually 8 lines or more, just for the argument values.
In this case, we can make it into a function, and place that function in a common_library.php, but doing so would just change the name of the function call from the Facebook API function to our name, and we still need to repeat the 8 lines of arguments. Each time, the call is very similar, but with slight variations to the argument values.
In that case, would copy and paste be needed no matter what we do?
| dry | null | null | null | null | null | open | An exception to avoid copy and paste code?
===
There are many files in our project that would call a Facebook api. And the call is complicated, spanning usually 8 lines or more, just for the argument values.
In this case, we can make it into a function, and place that function in a common_library.php, but doing so would just change the name of the function call from the Facebook API function to our name, and we still need to repeat the 8 lines of arguments. Each time, the call is very similar, but with slight variations to the argument values.
In that case, would copy and paste be needed no matter what we do?
| 0 |
11,273,485 | 06/30/2012 10:51:54 | 1,166,862 | 01/24/2012 11:25:15 | 45 | 0 | ASP.net CheckboxList Inserting to DB | I have a page with several CheckBoxList controls with 4 checkboxes in each of them and I'm trying to run an Insert statement for each of the checkboxes that are checked in the CheckBoxList controls after user hits on the Submit button. Any guide so as to how i can do this? Using OLEDB. | c# | asp.net | checkboxlist | null | null | null | open | ASP.net CheckboxList Inserting to DB
===
I have a page with several CheckBoxList controls with 4 checkboxes in each of them and I'm trying to run an Insert statement for each of the checkboxes that are checked in the CheckBoxList controls after user hits on the Submit button. Any guide so as to how i can do this? Using OLEDB. | 0 |
4,171,608 | 11/13/2010 08:18:52 | 506,586 | 11/13/2010 08:18:52 | 1 | 0 | HTML5 & XHTML role attribute question. | Does the role attribute have defined values if so can you tell what they are?
Or can I create my own values for the role attribute if is so are they case-sensitive do they have to be letters can there be numbers or both?
Or can you have both defined values and user created values. | xhtml | html5 | null | null | null | null | open | HTML5 & XHTML role attribute question.
===
Does the role attribute have defined values if so can you tell what they are?
Or can I create my own values for the role attribute if is so are they case-sensitive do they have to be letters can there be numbers or both?
Or can you have both defined values and user created values. | 0 |
6,873,581 | 07/29/2011 13:07:25 | 869,418 | 07/29/2011 13:07:25 | 1 | 0 | How to write determinant for algebra? | How to write determinant for algebra? for example det([x*y+1 y+2 x; x x+1 y; x x+1 x+2;])
any algorithm for this complicated computation
i am writing for det(sylvestor)
| algorithm | null | null | null | null | 07/29/2011 13:39:50 | not a real question | How to write determinant for algebra?
===
How to write determinant for algebra? for example det([x*y+1 y+2 x; x x+1 y; x x+1 x+2;])
any algorithm for this complicated computation
i am writing for det(sylvestor)
| 1 |
7,502,729 | 09/21/2011 15:46:38 | 1,176 | 08/13/2008 10:32:13 | 392 | 17 | How to load correctly my class? | I have a class defined in a an external pair of files, let's name them *engine.h* and *engine.m* . Also, it was given to me the file "engineListener.h".
this is how they look:
**File engine.h:**
@interface PhysicsEngine: NSObject {
NSString *displaydValue;
id <PhysicsEngineListener> listener;
}
-PhysicsEngine*)initWithListener:(id <PhysicsEngineListener>) _listener;
//...
File **engine.m**
//imports here
@interface PhysicsEngine()
-(Boolean) MyOperation: ... ... (etc)
@end
File **engineListener.h**
//imports here...
@class PhysicsEngine;
@protocol PhysicsEngineListener <NSObject>
@required
-(void) someVariable:(PhysicsEngine *)source;
@end
_____________
Now, in my **myController.h** I have this:
//... imports and include ...
@interface myController : NSObject
{
coreEngine *PhysicsEngine;
}
- (IBAction)doSomething:(id)sender;
And in the **myController.m** this is what I have:
-(id) init
{
NSAutorelease *pool = [[NSAutoreleasePool alloc] init];
coreEngine *PhysicsEngine = [[PhysicsEngine alloc] init];
[PhysicsEngine release];
[pool drain];
return self;
}
- (IBAction)doSomething:(id)sender
{
[PhysicsEngine MyOperation:Something];
}
The thing now is: the code compiles correctly, but the "[PhysicsEngine MyOperation:Something]" is doing nothing. I'm sure I'm instantiating my class wrongly. The NSObject defined in "engine.h engine.m and enginelistener.h" the "that I have to load was not made by me, and I have no means to modify it.
I've tried doing some dummy/random things based on what I've seen around on the internet, without knowing 100% what I was doing. I'm not even close to be familiar with ObjectiveC or C/C++, so be gentle with me. I'm totally noob on this subject.
I'm using Xcode 4, and I have also access to XCode 3.2.6
How should I load my class properly?
Any advice is welcome.
Thanks
| objective-c | class | initialization | nsobject | null | null | open | How to load correctly my class?
===
I have a class defined in a an external pair of files, let's name them *engine.h* and *engine.m* . Also, it was given to me the file "engineListener.h".
this is how they look:
**File engine.h:**
@interface PhysicsEngine: NSObject {
NSString *displaydValue;
id <PhysicsEngineListener> listener;
}
-PhysicsEngine*)initWithListener:(id <PhysicsEngineListener>) _listener;
//...
File **engine.m**
//imports here
@interface PhysicsEngine()
-(Boolean) MyOperation: ... ... (etc)
@end
File **engineListener.h**
//imports here...
@class PhysicsEngine;
@protocol PhysicsEngineListener <NSObject>
@required
-(void) someVariable:(PhysicsEngine *)source;
@end
_____________
Now, in my **myController.h** I have this:
//... imports and include ...
@interface myController : NSObject
{
coreEngine *PhysicsEngine;
}
- (IBAction)doSomething:(id)sender;
And in the **myController.m** this is what I have:
-(id) init
{
NSAutorelease *pool = [[NSAutoreleasePool alloc] init];
coreEngine *PhysicsEngine = [[PhysicsEngine alloc] init];
[PhysicsEngine release];
[pool drain];
return self;
}
- (IBAction)doSomething:(id)sender
{
[PhysicsEngine MyOperation:Something];
}
The thing now is: the code compiles correctly, but the "[PhysicsEngine MyOperation:Something]" is doing nothing. I'm sure I'm instantiating my class wrongly. The NSObject defined in "engine.h engine.m and enginelistener.h" the "that I have to load was not made by me, and I have no means to modify it.
I've tried doing some dummy/random things based on what I've seen around on the internet, without knowing 100% what I was doing. I'm not even close to be familiar with ObjectiveC or C/C++, so be gentle with me. I'm totally noob on this subject.
I'm using Xcode 4, and I have also access to XCode 3.2.6
How should I load my class properly?
Any advice is welcome.
Thanks
| 0 |
11,617,728 | 07/23/2012 17:48:47 | 1,197,024 | 02/08/2012 11:20:27 | 34 | 1 | Jquery cool submit form | So I have a form inside an envelope image. When I submit the form, js alerts with "Thank you...". I want something cooler, for example a popup image instead of an alert, or a div colapse and a new div where it is writtrn "Thank you...". Can it be done in a simple way? Alerts are so ugly...
js:
<script type="text/javascript">
$(document).ready(function() {
$('#form1').ajaxForm(function() {
alert("Thank you for your comment!");
});
});
</script>
html:
<form id="form1" action="send.php" onSubmit="return chkForm(this)" name="form1" method="post" >
<textarea name="message" cols="4" rows="4" id="message" value=""></textarea></br>
<input type="text" id="name" name="name" value="" /></br>
<input type="text" id="email" name="email" value="" /></br>
<input type="submit" value="" id="submit" />
</form>
| jquery | forms | null | null | null | 07/23/2012 18:03:52 | not constructive | Jquery cool submit form
===
So I have a form inside an envelope image. When I submit the form, js alerts with "Thank you...". I want something cooler, for example a popup image instead of an alert, or a div colapse and a new div where it is writtrn "Thank you...". Can it be done in a simple way? Alerts are so ugly...
js:
<script type="text/javascript">
$(document).ready(function() {
$('#form1').ajaxForm(function() {
alert("Thank you for your comment!");
});
});
</script>
html:
<form id="form1" action="send.php" onSubmit="return chkForm(this)" name="form1" method="post" >
<textarea name="message" cols="4" rows="4" id="message" value=""></textarea></br>
<input type="text" id="name" name="name" value="" /></br>
<input type="text" id="email" name="email" value="" /></br>
<input type="submit" value="" id="submit" />
</form>
| 4 |
2,234,726 | 02/10/2010 05:48:55 | 194,982 | 10/22/2009 23:48:30 | 1,430 | 46 | JFormattedTextField : input time duration value | I want to use a `JFormattedTextField` to allow the user to input time *duration* values into a form. Sample valid values are:
`2h 30m`
`72h 15m`
`6h`
`0h`
However I am having limited success with this. Can some one please suggest how this can be accomplished? I am OK if this result can be achieved using a `JTextField` as well.
Thanks!
| java | jformattedtextfield | jtextfield | time | duration | null | open | JFormattedTextField : input time duration value
===
I want to use a `JFormattedTextField` to allow the user to input time *duration* values into a form. Sample valid values are:
`2h 30m`
`72h 15m`
`6h`
`0h`
However I am having limited success with this. Can some one please suggest how this can be accomplished? I am OK if this result can be achieved using a `JTextField` as well.
Thanks!
| 0 |
10,746,197 | 05/24/2012 22:30:30 | 802,542 | 06/17/2011 02:07:00 | 167 | 0 | How to fit elements of two vectors alternately in C++? | Given two vectors A and B of the same dimension, create a vector C so that the elements of A is embedded in the elements of B. example:
A: 1 2 3 4 5
B: 6 7 8 9 10
C: 1 6 2 7 3 8 4 9 5 10 | c++ | vector | null | null | null | 05/24/2012 22:44:46 | not a real question | How to fit elements of two vectors alternately in C++?
===
Given two vectors A and B of the same dimension, create a vector C so that the elements of A is embedded in the elements of B. example:
A: 1 2 3 4 5
B: 6 7 8 9 10
C: 1 6 2 7 3 8 4 9 5 10 | 1 |
10,991,690 | 06/12/2012 06:46:17 | 916,138 | 08/28/2011 05:13:27 | 175 | 1 | query string sending value = 0, not new assigned value in jquery | **in Js**
$(document).ready(function() {
var trxID=0;
var oHoldTable=$('#posHold').dataTable();
$('#posHold tbody tr').die();
$('#posHold tbody tr').live('dblclick', function () {
var oHData = oHoldTable.fnGetData( this );
trxID=oHData[0];
if (oHData[0] > 0) {
$.post("VoidTransaction",{
trxID:oHData[0]
},function(data){
if (data.rst==1) {
parent.tb_remove();
$('.btnPrint').trigger('click');
}
});
}else{
alert("No Transaction is Available for Void");
}
});
$(".btnPrint").printPage({
url: "receipts/void.jsp?trxID="+trxID,
attr: "href",
message:"Your document is being created"
})
});
I have declared a variable trxID and initialized with 0. Then assign a value in .live even handler such as:
trxID=oHData[0];
but query string still sending value = 0, not new assigned value.
url: "receipts/void.jsp?trxID="+trxID
how get updated value of trxID?
| javascript | jquery | variables | javascript-events | initialization | null | open | query string sending value = 0, not new assigned value in jquery
===
**in Js**
$(document).ready(function() {
var trxID=0;
var oHoldTable=$('#posHold').dataTable();
$('#posHold tbody tr').die();
$('#posHold tbody tr').live('dblclick', function () {
var oHData = oHoldTable.fnGetData( this );
trxID=oHData[0];
if (oHData[0] > 0) {
$.post("VoidTransaction",{
trxID:oHData[0]
},function(data){
if (data.rst==1) {
parent.tb_remove();
$('.btnPrint').trigger('click');
}
});
}else{
alert("No Transaction is Available for Void");
}
});
$(".btnPrint").printPage({
url: "receipts/void.jsp?trxID="+trxID,
attr: "href",
message:"Your document is being created"
})
});
I have declared a variable trxID and initialized with 0. Then assign a value in .live even handler such as:
trxID=oHData[0];
but query string still sending value = 0, not new assigned value.
url: "receipts/void.jsp?trxID="+trxID
how get updated value of trxID?
| 0 |
4,078,832 | 11/02/2010 14:50:07 | 494,874 | 11/02/2010 14:50:07 | 1 | 0 | Stop my Batch from flicking accross the screen | can anybody enlighten me to a way stopping my bat from flashing across the screen when executed? is there a way to stop the CMD window from doing this???? | batch | cmd | batch-file | null | null | null | open | Stop my Batch from flicking accross the screen
===
can anybody enlighten me to a way stopping my bat from flashing across the screen when executed? is there a way to stop the CMD window from doing this???? | 0 |
7,812,903 | 10/18/2011 19:58:10 | 484,290 | 10/22/2010 14:06:21 | 616 | 19 | Load XML File from an RSS in JavaScript | I need to load an XML File from a RSS in JavaScript. Can someone show a proper example or points to a tutorial that works?? | javascript | xml | rss | null | null | 10/19/2011 11:29:27 | not a real question | Load XML File from an RSS in JavaScript
===
I need to load an XML File from a RSS in JavaScript. Can someone show a proper example or points to a tutorial that works?? | 1 |
7,704,593 | 10/09/2011 15:37:33 | 965,975 | 09/26/2011 23:08:03 | 1 | 1 | Please me for Mysql | I am in a terrible situation, my php works with mysql database when i use mysqli connection code but when i try to connect the database using
<?php
mysql_connect("localhost", "admin", "1admin") or die(mysql_error());
echo "Connected to MySQL<br />";
?>
I dont get any error message rather just browser goes offline or error message, i have been trying to figure this our for two weeks,
in my php both mysql and mysqli lines are uncommented
i am using win 7 64 bit,
any helps will be much appreciated
Kind Regards
| mysql | mysqli-multi-query | null | null | null | null | open | Please me for Mysql
===
I am in a terrible situation, my php works with mysql database when i use mysqli connection code but when i try to connect the database using
<?php
mysql_connect("localhost", "admin", "1admin") or die(mysql_error());
echo "Connected to MySQL<br />";
?>
I dont get any error message rather just browser goes offline or error message, i have been trying to figure this our for two weeks,
in my php both mysql and mysqli lines are uncommented
i am using win 7 64 bit,
any helps will be much appreciated
Kind Regards
| 0 |
9,149,663 | 02/05/2012 13:35:26 | 917,842 | 08/29/2011 12:49:46 | 6 | 0 | How to prevent user from saving webpage in cache, or force to request new page each time? | I can't access to server, can this be done from adding code to html page?? | javascript | jquery | html | ajax | null | 02/07/2012 16:32:56 | not a real question | How to prevent user from saving webpage in cache, or force to request new page each time?
===
I can't access to server, can this be done from adding code to html page?? | 1 |
2,659,824 | 04/17/2010 20:03:01 | 319,392 | 04/17/2010 20:03:01 | 1 | 0 | NSNotification on multiple objects | In my NSApp delegate I add an observer of an object that is an NSWindow subclass that gets initiated in the delegate itself and that posts a notification once the window gets clicked. The selector is also in the delegate. From that same delegate class I initiate another object which when initiated adds itself as an observer for another window of the same NSWindow subclass of above and the selector is in this newly initiated class too. Both notifications get posted but the problem is that they get posted in both classes... Is this normal? I was hoping that it only got posted once. | nsnotifications | cocoa | null | null | null | null | open | NSNotification on multiple objects
===
In my NSApp delegate I add an observer of an object that is an NSWindow subclass that gets initiated in the delegate itself and that posts a notification once the window gets clicked. The selector is also in the delegate. From that same delegate class I initiate another object which when initiated adds itself as an observer for another window of the same NSWindow subclass of above and the selector is in this newly initiated class too. Both notifications get posted but the problem is that they get posted in both classes... Is this normal? I was hoping that it only got posted once. | 0 |
11,301,243 | 07/02/2012 21:12:02 | 484,390 | 10/22/2010 15:45:33 | 888 | 0 | Modeling Tool for Data Warehouse | What data modelling tool for data warehouse do you recommend me to use? | sql | sql-server | null | null | null | 07/03/2012 15:14:45 | not constructive | Modeling Tool for Data Warehouse
===
What data modelling tool for data warehouse do you recommend me to use? | 4 |
6,325,990 | 06/13/2011 01:52:50 | 788,263 | 06/07/2011 21:19:55 | 28 | 0 | Best cloud hosted database solution for 900,000 row database that has to be updated daily? | A company we deal with sends us a ~900,000 row CSV daily of their product listings.
I want to store this in the cloud with someone else handling patching, administration, etc. The underlying engine does not matter (mysql, sql server, mongo couchdb, etc.).
The major requirement though is that there is some way to automatically flush and load the database from CSV without doing 900,000 INSERT statements or the equivalent every day. Like with SQL Server, we could use bcp, or with mySQL, we could do mysqlimport. The listings change so much from day to day, that doing a diff of today's vs. yesterday's doesn't make sense.
It will only be queried 400-500 times per day and not concurrently. Just a one off query about 400-500 times per day. But the data all has to be there and updated daily.
Any suggestions? We're looking into mongohq, windows azure, xeround, and stuff like that. | mysql | database | mongodb | couchdb | cloud | 06/13/2011 03:05:17 | off topic | Best cloud hosted database solution for 900,000 row database that has to be updated daily?
===
A company we deal with sends us a ~900,000 row CSV daily of their product listings.
I want to store this in the cloud with someone else handling patching, administration, etc. The underlying engine does not matter (mysql, sql server, mongo couchdb, etc.).
The major requirement though is that there is some way to automatically flush and load the database from CSV without doing 900,000 INSERT statements or the equivalent every day. Like with SQL Server, we could use bcp, or with mySQL, we could do mysqlimport. The listings change so much from day to day, that doing a diff of today's vs. yesterday's doesn't make sense.
It will only be queried 400-500 times per day and not concurrently. Just a one off query about 400-500 times per day. But the data all has to be there and updated daily.
Any suggestions? We're looking into mongohq, windows azure, xeround, and stuff like that. | 2 |
10,044,958 | 04/06/2012 14:35:19 | 1,263,746 | 03/12/2012 09:28:43 | 37 | 1 | Not rendering a PHP page to IE | I have a PHP page which breaks down in IE 6 and 7, hence I want users to not use IE. Warnings and notices will be definitely ignored by them. So as a solution, can I just stop rendering the page if the request come from IE and just display a line that IE is not supported?
I am new to php and hence the question. IE SUCKS! | php | browser | null | null | null | null | open | Not rendering a PHP page to IE
===
I have a PHP page which breaks down in IE 6 and 7, hence I want users to not use IE. Warnings and notices will be definitely ignored by them. So as a solution, can I just stop rendering the page if the request come from IE and just display a line that IE is not supported?
I am new to php and hence the question. IE SUCKS! | 0 |
6,515,271 | 06/29/2011 02:52:37 | 682,662 | 03/29/2011 18:39:22 | 228 | 2 | fatal error LNK1120: 1 unresolved externals | This is the program :
#include <windows.h>
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
{
MessageBox (NULL, TEXT ("Hello, Windows!"), TEXT ("HelloMsg"), 0) ;
return 0 ;
}
I can't understand the error.Please help in correcting it.
**ERROR** `fatal error LNK1120: 1 unresolved externals` | c++ | windows | visual-c++ | graphics | null | 06/29/2011 04:36:54 | not a real question | fatal error LNK1120: 1 unresolved externals
===
This is the program :
#include <windows.h>
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
{
MessageBox (NULL, TEXT ("Hello, Windows!"), TEXT ("HelloMsg"), 0) ;
return 0 ;
}
I can't understand the error.Please help in correcting it.
**ERROR** `fatal error LNK1120: 1 unresolved externals` | 1 |
3,218,570 | 07/10/2010 09:00:38 | 113,748 | 05/28/2009 13:40:59 | 662 | 27 | Why does the browser go crazy when I write things like <div/>? | I mean, aren't `<div/>` and `<div></div>` supposed to be *exactly* the same thing?
By browser I mean the latest Firefox and Internet Explorer. And by go crazy I mean ignore styles of tags that contain the `<div/>`. | xhtml | browser | null | null | null | 07/11/2010 02:40:43 | not a real question | Why does the browser go crazy when I write things like <div/>?
===
I mean, aren't `<div/>` and `<div></div>` supposed to be *exactly* the same thing?
By browser I mean the latest Firefox and Internet Explorer. And by go crazy I mean ignore styles of tags that contain the `<div/>`. | 1 |
10,363,068 | 04/28/2012 11:28:47 | 341,970 | 05/15/2010 15:11:59 | 2,576 | 90 | Will there be an English translation of this book on the new C++ standard? | Based on the reviews and the table of contents, [this book][1] is exactly what I am looking for. Unfortunately it is written in German. I googled for a while and I could not find the answer: is there an English translation planned?
[1]: http://www.amazon.de/11-Leitfaden-Programmierer-neuen-Standard/dp/3827330882 | c++ | c++11 | null | null | null | 04/28/2012 11:50:59 | off topic | Will there be an English translation of this book on the new C++ standard?
===
Based on the reviews and the table of contents, [this book][1] is exactly what I am looking for. Unfortunately it is written in German. I googled for a while and I could not find the answer: is there an English translation planned?
[1]: http://www.amazon.de/11-Leitfaden-Programmierer-neuen-Standard/dp/3827330882 | 2 |
11,639,276 | 07/24/2012 21:03:25 | 1,515,669 | 07/10/2012 18:05:03 | 6 | 0 | JS error on my website | Why am I getting this js error on this following link in ie. <http://www.quiksilver.com/product/index.jsp?productId=12664364&kw=12664364&sr=1&origkw=12664364>.
Please use your Developer to0l's console on the Scrip to see the Error on line 332.
**"SCRIPT5007: Unable to set value of the property 'onclick': object is null or undefined
index.jsp?productId=12664364&kw=12664364&sr=1&origkw=12664364, line 332 character 3
"**
| javascript | null | null | null | null | 07/26/2012 01:07:52 | too localized | JS error on my website
===
Why am I getting this js error on this following link in ie. <http://www.quiksilver.com/product/index.jsp?productId=12664364&kw=12664364&sr=1&origkw=12664364>.
Please use your Developer to0l's console on the Scrip to see the Error on line 332.
**"SCRIPT5007: Unable to set value of the property 'onclick': object is null or undefined
index.jsp?productId=12664364&kw=12664364&sr=1&origkw=12664364, line 332 character 3
"**
| 3 |
11,553,488 | 07/19/2012 03:28:14 | 359,474 | 06/06/2010 01:09:11 | 338 | 3 | data has two trends. How to extract independent trendlines | I have a set of data that is not ordered in any particular way but when plotted clearly has two distinct trends. A simple linear regression would not really be adequate here because of the clear distinction between the two series. Is there a simple way to get the two trendline statistics?
For the record I'm using Python and I am reasonably comfortable with programming and data analysis (incl machine learning) but am willing two jump over to R if absolutely necessary.
![enter image description here][1]
[1]: http://i.stack.imgur.com/SkEm3.png | python | statistics | machine-learning | trendline | null | 07/26/2012 12:49:16 | off topic | data has two trends. How to extract independent trendlines
===
I have a set of data that is not ordered in any particular way but when plotted clearly has two distinct trends. A simple linear regression would not really be adequate here because of the clear distinction between the two series. Is there a simple way to get the two trendline statistics?
For the record I'm using Python and I am reasonably comfortable with programming and data analysis (incl machine learning) but am willing two jump over to R if absolutely necessary.
![enter image description here][1]
[1]: http://i.stack.imgur.com/SkEm3.png | 2 |
6,217,458 | 06/02/2011 16:39:14 | 692,280 | 04/05/2011 05:50:26 | 38 | 6 | Break a Multi-Page Tif to Individual Pages : Flow | I came to ask the right process flow for breaking a multi-page tiff image. I just can't figure out how to start the process flow. Right now, the thing that comes in my mind is breaking the tiff to separate pages, but i don't know the process behind it. Maybe you guys can give me an idea on how to do it.
Thanks in advance.
Cheers! | image | process | tiff | flow | null | 06/02/2011 18:18:11 | not a real question | Break a Multi-Page Tif to Individual Pages : Flow
===
I came to ask the right process flow for breaking a multi-page tiff image. I just can't figure out how to start the process flow. Right now, the thing that comes in my mind is breaking the tiff to separate pages, but i don't know the process behind it. Maybe you guys can give me an idea on how to do it.
Thanks in advance.
Cheers! | 1 |
3,922,840 | 10/13/2010 10:48:27 | 474,353 | 10/13/2010 10:48:27 | 1 | 0 | SFML window resizing events blocking the main thread | I just started using the [SFML][1] library and its fantastic. However when resizing a window by dragging the corner with my mouse i don't get the resize events until i release the mouse. This means i can't update my graphics until the mouse is released (game loop is on the gui thread) and is also causing a massive flood of events to come through of all the resize positions.
How can i make it so resizing doesn't block the thread?
[1]: http://www.sfml-dev.org | windows | opengl | resize | sfml | null | null | open | SFML window resizing events blocking the main thread
===
I just started using the [SFML][1] library and its fantastic. However when resizing a window by dragging the corner with my mouse i don't get the resize events until i release the mouse. This means i can't update my graphics until the mouse is released (game loop is on the gui thread) and is also causing a massive flood of events to come through of all the resize positions.
How can i make it so resizing doesn't block the thread?
[1]: http://www.sfml-dev.org | 0 |
242,813 | 10/28/2008 10:34:35 | 28,150 | 10/15/2008 08:33:55 | 106 | 11 | When to Use Double or Single Quotes in JavaScript | `console.log("Double");` **vs** `console.log('singe');`
I saw more and more JavaScript libraries out there using single qoutes when handling string. What are the reason to use one over the other? I thought they're pretty much interchangeable.
| javascript | conventions | coding-style | null | null | null | open | When to Use Double or Single Quotes in JavaScript
===
`console.log("Double");` **vs** `console.log('singe');`
I saw more and more JavaScript libraries out there using single qoutes when handling string. What are the reason to use one over the other? I thought they're pretty much interchangeable.
| 0 |
6,077,284 | 05/20/2011 20:31:58 | 716,118 | 04/19/2011 22:31:55 | 373 | 13 | Design guidelines for configuration system? | Most of my programming has been in web-based applications, although I have done some desktop application development for personal projects. A recurring design issue has been on how to manage the configuration. For example, we all know that in ASP.NET the web.config is used frequently to hold configuration information, whether it be generated or manually configured.
Before I even knew what design patterns were, I would implement what would be in essence a Singleton pattern. I'd write a static class that, upon startup, would read the configuration file and store the information, along with any auto-generated information, in fields, which were then exposed to the rest of the application through some kind of accessor (properties, get() methods...).
Something in the back of my mind keeps telling me that this isn't the best way to go about it. So, my question is, are there any design patterns or guidelines for designing a configuration system? When and how should the configuration system read the configuration, and how should it expose this information to the rest of the application? Should it be a Singleton? I'm not asking for recommended storage mechanisms (XML vs database vs text file...), although I am interested in an answer to that as well. | oop | design-patterns | architecture | configuration | null | null | open | Design guidelines for configuration system?
===
Most of my programming has been in web-based applications, although I have done some desktop application development for personal projects. A recurring design issue has been on how to manage the configuration. For example, we all know that in ASP.NET the web.config is used frequently to hold configuration information, whether it be generated or manually configured.
Before I even knew what design patterns were, I would implement what would be in essence a Singleton pattern. I'd write a static class that, upon startup, would read the configuration file and store the information, along with any auto-generated information, in fields, which were then exposed to the rest of the application through some kind of accessor (properties, get() methods...).
Something in the back of my mind keeps telling me that this isn't the best way to go about it. So, my question is, are there any design patterns or guidelines for designing a configuration system? When and how should the configuration system read the configuration, and how should it expose this information to the rest of the application? Should it be a Singleton? I'm not asking for recommended storage mechanisms (XML vs database vs text file...), although I am interested in an answer to that as well. | 0 |
7,654,050 | 10/04/2011 21:08:08 | 671,203 | 03/22/2011 12:46:39 | 193 | 8 | Database access from different threads in Android | I have a Service that downloads data from the Internet in AsyncTasks. It parses the data and store it in a db. The Service runs continuously.
There is a change that a Activity attempts to read from the db while the Service is writing to it.
I have a database helper with several methods for writing and reading. Could this cause problems? Potentially trying to open the db from two different threads? | android | sqlite | null | null | null | null | open | Database access from different threads in Android
===
I have a Service that downloads data from the Internet in AsyncTasks. It parses the data and store it in a db. The Service runs continuously.
There is a change that a Activity attempts to read from the db while the Service is writing to it.
I have a database helper with several methods for writing and reading. Could this cause problems? Potentially trying to open the db from two different threads? | 0 |
9,496,120 | 02/29/2012 08:57:15 | 578,906 | 01/17/2011 18:21:07 | 18 | 0 | Unable to get divs sorted properly | I have been running into some issues with a JS script and have isolated the problems.
My divs are completely messed up.
The layout I am looking for is :
<pre>
wrapper - whole page.
header
left menu 1 right content (stretches to / past left menu item 3)
left menu 2
left menu 3
footer
</pre>
I would like the menu items to be contained in a div which is the same height as the right content div.
This is the code I have :
<html>
<head>
<title>Bliss</title>
<link rel="stylesheet" type="text/css" href="styling1.css" />
</head>
<body>
<div id="wholewrap">
<div id="header">header</div>
<div id="middlewrap">
<div id="menuwrap">
<div id="1" class="floatleftnw">1</div>
<div id="1" class="floatleftnw">2</div>
<div id="1" class="floatleftnw">3</div>
</div><!-- end of menu-->
<div id="right" style="float:right; display:inline;">right</div>
</div><!-- end of middlewrap-->
<div id="footer">
footer
</div >
</div><!-- end of whole wrap-->
</body></html>
and the css I have (as per styling1.css) is :
@charset "utf-8";
/* CSS Document */
html, body {
margin: 0px;
padding: 0px;
}
body {
font-family: Verdana, Arial, sans-serif;
font-size: 11px;
text-align: center;
line-height: 1.8em;
background:#fff;
}
#wholewrap {
width:1000px;
margin-left:auto;
margin-right:auto;
}
#right {
margin-left:220px;
width:740px;
margin-bottom:40px;
float:right;
display:inline;
}
.floatleftnw {
float:left;
}
#middlewrap {
height:800px;
width:1000px;
}
#menuwrap {
height:800px;
width:200px;
display:inline;
border:1px solid blue;
}
.clearer {
font-size: 0px;
height: 0px;
width: 100%;
display: block;
clear: both;
}
Can anyone see where I am going wrong? When I rewrote this layout (last hour or 2) I opened my div and made sure I closed it straight away and even commented it. The code is not showing any errors in DreamWeaver, however when I view in firebug, the divs are not functioning as supposed, I.e the menuwrap should have a blue border around it. Right should be inline with the left menus (I can get the border around the menuwrap, however as soon as I add inline to right's properties, it all gets destroyed.)
Thank you
| html | css | web | null | null | 03/01/2012 20:03:52 | too localized | Unable to get divs sorted properly
===
I have been running into some issues with a JS script and have isolated the problems.
My divs are completely messed up.
The layout I am looking for is :
<pre>
wrapper - whole page.
header
left menu 1 right content (stretches to / past left menu item 3)
left menu 2
left menu 3
footer
</pre>
I would like the menu items to be contained in a div which is the same height as the right content div.
This is the code I have :
<html>
<head>
<title>Bliss</title>
<link rel="stylesheet" type="text/css" href="styling1.css" />
</head>
<body>
<div id="wholewrap">
<div id="header">header</div>
<div id="middlewrap">
<div id="menuwrap">
<div id="1" class="floatleftnw">1</div>
<div id="1" class="floatleftnw">2</div>
<div id="1" class="floatleftnw">3</div>
</div><!-- end of menu-->
<div id="right" style="float:right; display:inline;">right</div>
</div><!-- end of middlewrap-->
<div id="footer">
footer
</div >
</div><!-- end of whole wrap-->
</body></html>
and the css I have (as per styling1.css) is :
@charset "utf-8";
/* CSS Document */
html, body {
margin: 0px;
padding: 0px;
}
body {
font-family: Verdana, Arial, sans-serif;
font-size: 11px;
text-align: center;
line-height: 1.8em;
background:#fff;
}
#wholewrap {
width:1000px;
margin-left:auto;
margin-right:auto;
}
#right {
margin-left:220px;
width:740px;
margin-bottom:40px;
float:right;
display:inline;
}
.floatleftnw {
float:left;
}
#middlewrap {
height:800px;
width:1000px;
}
#menuwrap {
height:800px;
width:200px;
display:inline;
border:1px solid blue;
}
.clearer {
font-size: 0px;
height: 0px;
width: 100%;
display: block;
clear: both;
}
Can anyone see where I am going wrong? When I rewrote this layout (last hour or 2) I opened my div and made sure I closed it straight away and even commented it. The code is not showing any errors in DreamWeaver, however when I view in firebug, the divs are not functioning as supposed, I.e the menuwrap should have a blue border around it. Right should be inline with the left menus (I can get the border around the menuwrap, however as soon as I add inline to right's properties, it all gets destroyed.)
Thank you
| 3 |
3,577,208 | 08/26/2010 16:25:22 | 244,413 | 01/06/2010 02:46:19 | 700 | 0 | How to receive credit card payments ? | I am looking to add credit card payments to my little eCommerce but I don't want to pay a percentage to the credit card processing service.
So... How can I accept Credit Card payments ?
| php | php5 | ssl | e-commerce | credit-card | 08/27/2010 01:55:38 | off topic | How to receive credit card payments ?
===
I am looking to add credit card payments to my little eCommerce but I don't want to pay a percentage to the credit card processing service.
So... How can I accept Credit Card payments ?
| 2 |
8,477,025 | 12/12/2011 15:55:39 | 1,094,058 | 12/12/2011 15:46:24 | 1 | 0 | Setting up new framework-based projects and using LESS | So I'm trying to set up an environment where I can generate a new project and minimize the customization/complexity involved in setting up that new project. I'm using Structurer Pro (from nettuts+) to build the fileset, and this is an awesome thing. I've got github for MAC set up, allowing me to grab the latest Foundation framework files and put them in to the current project.
Now, I'm trying to incorporate LESS into the process also. However, Foundation's css files aren't currently set up with LESS, which means I have 2 options...(1) take a current version and LESS-ize them, then use those customized files to create new projects. (2) don't use LESS...
The other problem I have is, there seem to be quite a few compilers for LESS (simpLESS, CodeKit, LESS, compass), but none of them combine css files! So if I set up 10 LESS files (e.g. IE.less, mobile.less, grid.less, typography.less etc), and have the variables in them, I really don't want 10 css files as the output. I really want 1 compiled css file as the output. I know I can do this manually, or even through Clean css or any of the 30 other sites out there...
But is there one 'thing' out there that will let me use the latest files to create a project framework, customize it by applying a color swatch set to a series of variables (LESS), then compile & combine the resulting CSS for actual implementation? | html | css | less | foundation | null | null | open | Setting up new framework-based projects and using LESS
===
So I'm trying to set up an environment where I can generate a new project and minimize the customization/complexity involved in setting up that new project. I'm using Structurer Pro (from nettuts+) to build the fileset, and this is an awesome thing. I've got github for MAC set up, allowing me to grab the latest Foundation framework files and put them in to the current project.
Now, I'm trying to incorporate LESS into the process also. However, Foundation's css files aren't currently set up with LESS, which means I have 2 options...(1) take a current version and LESS-ize them, then use those customized files to create new projects. (2) don't use LESS...
The other problem I have is, there seem to be quite a few compilers for LESS (simpLESS, CodeKit, LESS, compass), but none of them combine css files! So if I set up 10 LESS files (e.g. IE.less, mobile.less, grid.less, typography.less etc), and have the variables in them, I really don't want 10 css files as the output. I really want 1 compiled css file as the output. I know I can do this manually, or even through Clean css or any of the 30 other sites out there...
But is there one 'thing' out there that will let me use the latest files to create a project framework, customize it by applying a color swatch set to a series of variables (LESS), then compile & combine the resulting CSS for actual implementation? | 0 |
8,845,917 | 01/13/2012 04:25:55 | 1,146,937 | 01/13/2012 04:22:15 | 1 | 0 | Merge Conflicts in TFS 2010 | In TFS 2010, is it possible to send an email notification to the developers when there is a conflicts when we merge from branch to main?
Thanks,
shana
| tfs | null | null | null | null | null | open | Merge Conflicts in TFS 2010
===
In TFS 2010, is it possible to send an email notification to the developers when there is a conflicts when we merge from branch to main?
Thanks,
shana
| 0 |
9,832,503 | 03/23/2012 00:22:26 | 1,287,201 | 03/22/2012 23:59:40 | 1 | 0 | Android - Include native StageFright features in my own project | I am currently developing an application that needs to record audio, encode it as AAC, and stream it, and do the same but playing audio (receiving stream, decoding AAC, and playing audio).
I successfully recorded AAC (wrapped in a MP4 container) using the `MediaRecorder`, and successfully up-streamed audio using the `AudioRecord` class. But, I need to be able to encode the audio as I stream it, and none of these classes seem to help me do that.
I researched a bit, and found that most people that has this problem end up using a native library like ffmpeg.
But I was wondering, since Android already includes StageFright, that has native code that can do encoding and decoding (for example, [aac encoding][1] and [aac decoding][2]), is there a way to use this native code on my application? How can I do that?
It would be great if I only needed to implement some JNI classes with their native code. Plus, since it is an Android library, it would be no licensing problems whatsoever (correct me if I'm wrong).
Thanks in advance!
[1]: https://github.com/android/platform_frameworks_base/blob/master/media/libstagefright/include/AACEncoder.h
[2]: https://github.com/android/platform_frameworks_base/blob/master/media/libstagefright/include/AACDecoder.h | android | stream | native | aac | stagefright | null | open | Android - Include native StageFright features in my own project
===
I am currently developing an application that needs to record audio, encode it as AAC, and stream it, and do the same but playing audio (receiving stream, decoding AAC, and playing audio).
I successfully recorded AAC (wrapped in a MP4 container) using the `MediaRecorder`, and successfully up-streamed audio using the `AudioRecord` class. But, I need to be able to encode the audio as I stream it, and none of these classes seem to help me do that.
I researched a bit, and found that most people that has this problem end up using a native library like ffmpeg.
But I was wondering, since Android already includes StageFright, that has native code that can do encoding and decoding (for example, [aac encoding][1] and [aac decoding][2]), is there a way to use this native code on my application? How can I do that?
It would be great if I only needed to implement some JNI classes with their native code. Plus, since it is an Android library, it would be no licensing problems whatsoever (correct me if I'm wrong).
Thanks in advance!
[1]: https://github.com/android/platform_frameworks_base/blob/master/media/libstagefright/include/AACEncoder.h
[2]: https://github.com/android/platform_frameworks_base/blob/master/media/libstagefright/include/AACDecoder.h | 0 |
2,113,638 | 01/21/2010 23:01:25 | 164,980 | 08/28/2009 16:23:33 | 233 | 16 | Trying to draw textured triangles on device fails, but the emulator works. Why? | I have a series of OpenGL-ES calls that properly render a triangle and texture it with alpha blending on the emulator (2.0.1). When I fire up the same code on an actual device (Droid 2.0.1), all I get are white squares.
This suggests to me that the textures aren't loading, but I can't figure out why they aren't loading. All of my textures are 32-bit PNGs with alpha channels, under res/raw so they aren't optimized per the [sdk docs][1].
Here's how I am loading my textures:
private void loadGLTexture(GL10 gl, Context context, int reasource_id, int texture_id)
{
//Get the texture from the Android resource directory
Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(), reasource_id);
//Generate one texture pointer...
gl.glGenTextures(1, textures, texture_id);
//...and bind it to our array
gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[texture_id]);
//Create Nearest Filtered Texture
gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_NEAREST);
gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);
//Different possible texture parameters, e.g. GL10.GL_CLAMP_TO_EDGE
gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_REPEAT);
gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_REPEAT);
//Use the Android GLUtils to specify a two-dimensional texture image from our bitmap
GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0);
//Clean up
bitmap.recycle();
}
Here's how I am rendering the texture:
//Push transformation matrix
gl.glPushMatrix();
//Transformation matrices
gl.glTranslatef(x, y, 0.0f);
gl.glScalef(scalefactor, scalefactor, 0.0f);
gl.glColor4f(1.0f,1.0f,1.0f,1.0f);
//Bind the texture
gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[textureid]);
//Draw the vertices as triangles
gl.glDrawElements(GL10.GL_TRIANGLES, indices.length, GL10.GL_UNSIGNED_BYTE, indexBuffer);
//Pop the matrix back to where we left it
gl.glPopMatrix();
And here are the options I have enabled:
gl.glShadeModel(GL10.GL_SMOOTH); //Enable Smooth Shading
gl.glEnable(GL10.GL_DEPTH_TEST); //Enables Depth Testing
gl.glDepthFunc(GL10.GL_LEQUAL); //The Type Of Depth Testing To Do
gl.glEnable(GL10.GL_TEXTURE_2D);
gl.glEnable(GL10.GL_BLEND);
gl.glBlendFunc(GL10.GL_SRC_ALPHA,GL10.GL_ONE_MINUS_SRC_ALPHA);
[1]: http://developer.android.com/guide/topics/graphics/2d-graphics.html | android | opengl-es | null | null | null | null | open | Trying to draw textured triangles on device fails, but the emulator works. Why?
===
I have a series of OpenGL-ES calls that properly render a triangle and texture it with alpha blending on the emulator (2.0.1). When I fire up the same code on an actual device (Droid 2.0.1), all I get are white squares.
This suggests to me that the textures aren't loading, but I can't figure out why they aren't loading. All of my textures are 32-bit PNGs with alpha channels, under res/raw so they aren't optimized per the [sdk docs][1].
Here's how I am loading my textures:
private void loadGLTexture(GL10 gl, Context context, int reasource_id, int texture_id)
{
//Get the texture from the Android resource directory
Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(), reasource_id);
//Generate one texture pointer...
gl.glGenTextures(1, textures, texture_id);
//...and bind it to our array
gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[texture_id]);
//Create Nearest Filtered Texture
gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_NEAREST);
gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);
//Different possible texture parameters, e.g. GL10.GL_CLAMP_TO_EDGE
gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_REPEAT);
gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_REPEAT);
//Use the Android GLUtils to specify a two-dimensional texture image from our bitmap
GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0);
//Clean up
bitmap.recycle();
}
Here's how I am rendering the texture:
//Push transformation matrix
gl.glPushMatrix();
//Transformation matrices
gl.glTranslatef(x, y, 0.0f);
gl.glScalef(scalefactor, scalefactor, 0.0f);
gl.glColor4f(1.0f,1.0f,1.0f,1.0f);
//Bind the texture
gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[textureid]);
//Draw the vertices as triangles
gl.glDrawElements(GL10.GL_TRIANGLES, indices.length, GL10.GL_UNSIGNED_BYTE, indexBuffer);
//Pop the matrix back to where we left it
gl.glPopMatrix();
And here are the options I have enabled:
gl.glShadeModel(GL10.GL_SMOOTH); //Enable Smooth Shading
gl.glEnable(GL10.GL_DEPTH_TEST); //Enables Depth Testing
gl.glDepthFunc(GL10.GL_LEQUAL); //The Type Of Depth Testing To Do
gl.glEnable(GL10.GL_TEXTURE_2D);
gl.glEnable(GL10.GL_BLEND);
gl.glBlendFunc(GL10.GL_SRC_ALPHA,GL10.GL_ONE_MINUS_SRC_ALPHA);
[1]: http://developer.android.com/guide/topics/graphics/2d-graphics.html | 0 |
8,401,359 | 12/06/2011 14:19:39 | 210,188 | 11/13/2009 04:58:45 | 126 | 4 | C2491: 'std::numpunct<_Elem>::id' : definition of dllimport static data member not allowed | error C2491: 'std::numpunct<_Elem>::id' : definition of dllimport static data member not allowed
followed the instruction void _declspecimport()
{
}
changed to void _declspecimport();
even then error pertains
| visual-studio-2010 | visual-c++ | null | null | null | 12/06/2011 19:23:44 | not a real question | C2491: 'std::numpunct<_Elem>::id' : definition of dllimport static data member not allowed
===
error C2491: 'std::numpunct<_Elem>::id' : definition of dllimport static data member not allowed
followed the instruction void _declspecimport()
{
}
changed to void _declspecimport();
even then error pertains
| 1 |
618,844 | 03/06/2009 13:24:59 | 65,230 | 02/11/2009 18:57:36 | 233 | 20 | How to properly handle error logs? | I tried to do several searches before posting this question. If this is a duplicate, please let me know and I will delete it.
My question revolves around the proper way to handle errors produced through our web application. We currently log everything through log4j. If an error happens, it just says "An error has occurred. The IT Department has been notified and will work to correct this as soon as possible" right on the screen. This tells the user nothing... but it also does not tell the developer anything either when we try to reproduce the error. We have to go to the error log folder and try finding this error. Let me also mention that the folder is full of logs from the past week. Each time there is an error, one log file is created for that user and email is sent to the IT staff assigned to work on errors. This email does not mention the log file name but it is a copy of the same error text written that is in the log file.
So if Alicia has a problem at 7:15 with something, but there are 10 other errors that happen that same minute, I have to go through each log file trying to find hers.
What I was proposing to my fellow co-workers is adding an Error Log table into the database. This would write a record to the table for each error, record who it is for, the error, what page it happened on, etc. The bonus of this would be that we can return the primary key value from the table (error_log_id) and show that on the page with a message like "Error Reference Id (1337) has been logged and the proper IT staff has been notified. Please keep this reference id handy for future use". When we get the email, it would tell us the id of the error for quick reference. Or if the user is persistent, they can contact us with the id and we can find the error rather quickly.
How do you setup your error logging? By the way, our system uses Java Servlets that connect to a SQL Server database. | servlets | java | error-handling | null | null | null | open | How to properly handle error logs?
===
I tried to do several searches before posting this question. If this is a duplicate, please let me know and I will delete it.
My question revolves around the proper way to handle errors produced through our web application. We currently log everything through log4j. If an error happens, it just says "An error has occurred. The IT Department has been notified and will work to correct this as soon as possible" right on the screen. This tells the user nothing... but it also does not tell the developer anything either when we try to reproduce the error. We have to go to the error log folder and try finding this error. Let me also mention that the folder is full of logs from the past week. Each time there is an error, one log file is created for that user and email is sent to the IT staff assigned to work on errors. This email does not mention the log file name but it is a copy of the same error text written that is in the log file.
So if Alicia has a problem at 7:15 with something, but there are 10 other errors that happen that same minute, I have to go through each log file trying to find hers.
What I was proposing to my fellow co-workers is adding an Error Log table into the database. This would write a record to the table for each error, record who it is for, the error, what page it happened on, etc. The bonus of this would be that we can return the primary key value from the table (error_log_id) and show that on the page with a message like "Error Reference Id (1337) has been logged and the proper IT staff has been notified. Please keep this reference id handy for future use". When we get the email, it would tell us the id of the error for quick reference. Or if the user is persistent, they can contact us with the id and we can find the error rather quickly.
How do you setup your error logging? By the way, our system uses Java Servlets that connect to a SQL Server database. | 0 |
7,077,320 | 08/16/2011 11:14:42 | 3,408 | 08/28/2008 13:20:22 | 4,969 | 128 | Pausing/Breaking execution in javascript for debugging, but only for certain javascript files | Do any browsers support pausing execution / stepping through code, but only for certain files or regions? I'm using jQuery and several other libraries, and I'm not interested in stepping through their code in 99% of cases, as it is my code that is wrong. All my code is in my script file, other libraries are included separately.
If I use the pause button, I tend to find that I am very quickly taken to some part of jquery with code I don't understand or need to understand. If I click the step into button a lot, I sometimes get taken to a point in my script, sometimes not.
I could manually click every single line of my code to add a breakpoint, but this would be extremely tedious, and I couldn't un-pause execution easily. If there is a browser that lets you select multiple lines and add breakpoints to all of them in one click, that would be a great alternative, though. | javascript | debugging | google-chrome | firebug | ie8-developer-tools | null | open | Pausing/Breaking execution in javascript for debugging, but only for certain javascript files
===
Do any browsers support pausing execution / stepping through code, but only for certain files or regions? I'm using jQuery and several other libraries, and I'm not interested in stepping through their code in 99% of cases, as it is my code that is wrong. All my code is in my script file, other libraries are included separately.
If I use the pause button, I tend to find that I am very quickly taken to some part of jquery with code I don't understand or need to understand. If I click the step into button a lot, I sometimes get taken to a point in my script, sometimes not.
I could manually click every single line of my code to add a breakpoint, but this would be extremely tedious, and I couldn't un-pause execution easily. If there is a browser that lets you select multiple lines and add breakpoints to all of them in one click, that would be a great alternative, though. | 0 |
8,736,443 | 01/05/2012 01:21:04 | 809,217 | 06/21/2011 20:30:13 | 34 | 3 | PHP get CGI Page Contents | I am very familar with PHP but not so much with CGI. There is a page that I would like to get the contents from (specifically one that has just a jpg image) that has the extension .cgi
My question: is there a way to get the contents(or image) from a CGI page using PHP? Using file_get_contents($url) and imagecreatefromjpeg($url) gives me an error that says it failed to open the stream however I am able to right click on the image and save it as a jpg. I assume that is because the browser can recognize it as an image. | php | cgi | null | null | null | null | open | PHP get CGI Page Contents
===
I am very familar with PHP but not so much with CGI. There is a page that I would like to get the contents from (specifically one that has just a jpg image) that has the extension .cgi
My question: is there a way to get the contents(or image) from a CGI page using PHP? Using file_get_contents($url) and imagecreatefromjpeg($url) gives me an error that says it failed to open the stream however I am able to right click on the image and save it as a jpg. I assume that is because the browser can recognize it as an image. | 0 |
7,547,426 | 09/25/2011 17:59:34 | 684,116 | 03/30/2011 14:30:31 | 1 | 0 | installing JAVA/Netbeans on Mac OS X 10.7.1 | I just bought my first macbook pro few days ago and I am trying to install netbeans 6.9.1 on the apple. After trying to install the package, netbeans says it can't proceed because Java 6 is not installed.
So after googling a bit I found this link: http://support.apple.com/kb/DL1421 to install the correct Java for lion.
Installation of this package says: This software is not supported on your system!
How can I fix this? | java | netbeans | osx-lion | null | null | 09/26/2011 06:21:43 | off topic | installing JAVA/Netbeans on Mac OS X 10.7.1
===
I just bought my first macbook pro few days ago and I am trying to install netbeans 6.9.1 on the apple. After trying to install the package, netbeans says it can't proceed because Java 6 is not installed.
So after googling a bit I found this link: http://support.apple.com/kb/DL1421 to install the correct Java for lion.
Installation of this package says: This software is not supported on your system!
How can I fix this? | 2 |
9,362,447 | 02/20/2012 14:05:29 | 1,221,231 | 02/20/2012 13:59:42 | 1 | 0 | Is it feasible to test microprocessor/microcontroller? | I am working on some microcontroller based portable devices (embedded system).
Sometimes microcontroller becomes reset due to noise.
What I can do if I want to test the microcontroller? | testing | microcontroller | null | null | null | 02/20/2012 18:39:08 | off topic | Is it feasible to test microprocessor/microcontroller?
===
I am working on some microcontroller based portable devices (embedded system).
Sometimes microcontroller becomes reset due to noise.
What I can do if I want to test the microcontroller? | 2 |
8,112,822 | 11/13/2011 16:09:42 | 1,044,327 | 11/13/2011 16:07:23 | 1 | 0 | How do you go from one layout to another layout? | I have a huge problem i strated using Eclipse today and i made a app for our clan where you click a button link and come to our youtube pages but how do you klick a button so you go rom main layout to another layout?? | xml | eclipse | layout | null | null | 11/13/2011 22:50:07 | not a real question | How do you go from one layout to another layout?
===
I have a huge problem i strated using Eclipse today and i made a app for our clan where you click a button link and come to our youtube pages but how do you klick a button so you go rom main layout to another layout?? | 1 |
5,598,379 | 04/08/2011 17:00:10 | 502,039 | 11/09/2010 14:59:43 | 201 | 12 | How do I use urls.py in Django? | How do I use urls.py in Django? How can I do something similar to the following?
(r'^polls/(?P<poll_id>\d+)/$', 'polls.views.detail')
Does anybody have a tutorial or just explain it to me? | django | django-urls | null | null | null | 04/09/2011 05:04:13 | not a real question | How do I use urls.py in Django?
===
How do I use urls.py in Django? How can I do something similar to the following?
(r'^polls/(?P<poll_id>\d+)/$', 'polls.views.detail')
Does anybody have a tutorial or just explain it to me? | 1 |
6,899,109 | 08/01/2011 13:30:22 | 872,827 | 03/07/2011 09:34:28 | 1 | 0 | How to design and configure the | How are you?
A software design issue.
Imagine you gonna build an advance Enterprise application for facturation of bills, documents, business proposals.
A company could have one single printer with a USB printer.
Some have an advanced network with multiple network printers that have multiple trays with several different papertrays. Trays for bills, trays for papers with company logo's etc.
How to develop a way that the the program will choose the designated printer automatically. Would you choose configuration based on IP/printernames, configurationfiles or leave this to the userpreference? The goal is to make it advanced as possible, without human interference...
Printer management is the systemadmin's hell, what kind of OS or printer should you use?
Regards | software-design | null | null | null | null | 08/01/2011 13:36:23 | not a real question | How to design and configure the
===
How are you?
A software design issue.
Imagine you gonna build an advance Enterprise application for facturation of bills, documents, business proposals.
A company could have one single printer with a USB printer.
Some have an advanced network with multiple network printers that have multiple trays with several different papertrays. Trays for bills, trays for papers with company logo's etc.
How to develop a way that the the program will choose the designated printer automatically. Would you choose configuration based on IP/printernames, configurationfiles or leave this to the userpreference? The goal is to make it advanced as possible, without human interference...
Printer management is the systemadmin's hell, what kind of OS or printer should you use?
Regards | 1 |
10,400,096 | 05/01/2012 15:37:49 | 1,367,787 | 05/01/2012 13:06:06 | 11 | 0 | Simple While Loop Example Explanation | Assume that the method enigma has been defined as follows:
public int enigma(int n)
{
int m;
while (n >= 10) {
m = 0;
while (n > 10) {
m += n % 10;
n /= 10;
}
n = m;
}
return (n);
}
What is the value of enigma(1995) ?
I understood that the value of enigma(1995) is 3. What is the step by step?
| java | methods | null | null | null | 05/02/2012 20:11:13 | too localized | Simple While Loop Example Explanation
===
Assume that the method enigma has been defined as follows:
public int enigma(int n)
{
int m;
while (n >= 10) {
m = 0;
while (n > 10) {
m += n % 10;
n /= 10;
}
n = m;
}
return (n);
}
What is the value of enigma(1995) ?
I understood that the value of enigma(1995) is 3. What is the step by step?
| 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.