PostId
int64 13
11.8M
| PostCreationDate
stringlengths 19
19
| OwnerUserId
int64 3
1.57M
| OwnerCreationDate
stringlengths 10
19
| ReputationAtPostCreation
int64 -33
210k
| OwnerUndeletedAnswerCountAtPostTime
int64 0
5.77k
| Title
stringlengths 10
250
| BodyMarkdown
stringlengths 12
30k
| Tag1
stringlengths 1
25
⌀ | Tag2
stringlengths 1
25
⌀ | Tag3
stringlengths 1
25
⌀ | Tag4
stringlengths 1
25
⌀ | Tag5
stringlengths 1
25
⌀ | PostClosedDate
stringlengths 19
19
⌀ | OpenStatus
stringclasses 5
values | unified_texts
stringlengths 47
30.1k
| OpenStatus_id
int64 0
4
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
10,612,438 | 05/16/2012 05:18:51 | 559,648 | 01/01/2011 05:02:03 | 551 | 39 | Javascript reload the page with hash value | I am trying to refresh the page with this statement in external javascript file after some processes.
window.location.href = window.location.href
It perfectly reload the page but I want to scroll to the specific location after reload.
So, I put this on the page.
<a name="mypara"></a>
And change the javascript to
window.location.href = window.location.href + "#mypara";
When I do that, it doesn't reload the page at all. Is there any way I can reload the page with scroll bar position? | javascript | jquery | null | null | null | null | open | Javascript reload the page with hash value
===
I am trying to refresh the page with this statement in external javascript file after some processes.
window.location.href = window.location.href
It perfectly reload the page but I want to scroll to the specific location after reload.
So, I put this on the page.
<a name="mypara"></a>
And change the javascript to
window.location.href = window.location.href + "#mypara";
When I do that, it doesn't reload the page at all. Is there any way I can reload the page with scroll bar position? | 0 |
7,977,746 | 11/02/2011 08:57:03 | 876,142 | 08/03/2011 08:05:08 | 386 | 14 | Customizing jFree Chart | I have a special requirement to display a TimeSeries chart using jFree Chart.
I need some thing like the image below, where there is a line apart from the chart which shows
average temp.
Can anyone help me how to achieve it??
[Time Series Chart (Custom)][1]
[1]: http://i.stack.imgur.com/VMFnz.jpg | java | jasper-reports | jfreechart | ireport | null | null | open | Customizing jFree Chart
===
I have a special requirement to display a TimeSeries chart using jFree Chart.
I need some thing like the image below, where there is a line apart from the chart which shows
average temp.
Can anyone help me how to achieve it??
[Time Series Chart (Custom)][1]
[1]: http://i.stack.imgur.com/VMFnz.jpg | 0 |
7,251,124 | 08/31/2011 00:01:00 | 523,168 | 11/28/2010 20:02:52 | 420 | 9 | How generate DAO with Hibernate Tools in Eclipse? | I'm using :
Eclipse Java EE IDE Web Developers
version:Indigo Release
with hibernate tools, i'm new to hibernate in Eclipse, so i learn how configure the hibernate and generate the POJO's with annotations (which i think is better than .xml).
So after generate my POJO's and DAO's i try to make a insertion, but launch a 'null point exception' to my entity manager, this is how hibernate tools is generating the dao classes:
Trying to use the DAO generated:
public static void main(String[] args) {
// TODO Auto-generated method stub
User user = new User();
user.setEmail("[email protected]");
user.setPassword("123456");
user.setReputation(0);
DaoUser daoUser = new DaoUser();
daoUser.persist(user);
}
DAO generated:
package com.example.pojo;
// Generated 30/08/2011 20:43:29 by Hibernate Tools 3.4.0.CR1
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* Home object for domain model class User.
* @see com.example.pojo.User
* @author Hibernate Tools
*/
@Stateless
public class UserHome {
private static final Log log = LogFactory.getLog(UserHome.class);
@PersistenceContext
private EntityManager entityManager;
public void persist(User transientInstance) {
log.debug("persisting User instance");
try {
entityManager.persist(transientInstance);
log.debug("persist successful");
} catch (RuntimeException re) {
log.error("persist failed", re);
throw re;
}
}
public void remove(User persistentInstance) {
log.debug("removing User instance");
try {
entityManager.remove(persistentInstance);
log.debug("remove successful");
} catch (RuntimeException re) {
log.error("remove failed", re);
throw re;
}
}
public User merge(User detachedInstance) {
log.debug("merging User instance");
try {
User result = entityManager.merge(detachedInstance);
log.debug("merge successful");
return result;
} catch (RuntimeException re) {
log.error("merge failed", re);
throw re;
}
}
public User findById(Integer id) {
log.debug("getting User instance with id: " + id);
try {
User instance = entityManager.find(User.class, id);
log.debug("get successful");
return instance;
} catch (RuntimeException re) {
log.error("get failed", re);
throw re;
}
}
}
I think i must be doing something wrong in the configuration process.
How should I set correctly my classes and dao's ?
| java | eclipse | hibernate | java-ee | null | null | open | How generate DAO with Hibernate Tools in Eclipse?
===
I'm using :
Eclipse Java EE IDE Web Developers
version:Indigo Release
with hibernate tools, i'm new to hibernate in Eclipse, so i learn how configure the hibernate and generate the POJO's with annotations (which i think is better than .xml).
So after generate my POJO's and DAO's i try to make a insertion, but launch a 'null point exception' to my entity manager, this is how hibernate tools is generating the dao classes:
Trying to use the DAO generated:
public static void main(String[] args) {
// TODO Auto-generated method stub
User user = new User();
user.setEmail("[email protected]");
user.setPassword("123456");
user.setReputation(0);
DaoUser daoUser = new DaoUser();
daoUser.persist(user);
}
DAO generated:
package com.example.pojo;
// Generated 30/08/2011 20:43:29 by Hibernate Tools 3.4.0.CR1
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* Home object for domain model class User.
* @see com.example.pojo.User
* @author Hibernate Tools
*/
@Stateless
public class UserHome {
private static final Log log = LogFactory.getLog(UserHome.class);
@PersistenceContext
private EntityManager entityManager;
public void persist(User transientInstance) {
log.debug("persisting User instance");
try {
entityManager.persist(transientInstance);
log.debug("persist successful");
} catch (RuntimeException re) {
log.error("persist failed", re);
throw re;
}
}
public void remove(User persistentInstance) {
log.debug("removing User instance");
try {
entityManager.remove(persistentInstance);
log.debug("remove successful");
} catch (RuntimeException re) {
log.error("remove failed", re);
throw re;
}
}
public User merge(User detachedInstance) {
log.debug("merging User instance");
try {
User result = entityManager.merge(detachedInstance);
log.debug("merge successful");
return result;
} catch (RuntimeException re) {
log.error("merge failed", re);
throw re;
}
}
public User findById(Integer id) {
log.debug("getting User instance with id: " + id);
try {
User instance = entityManager.find(User.class, id);
log.debug("get successful");
return instance;
} catch (RuntimeException re) {
log.error("get failed", re);
throw re;
}
}
}
I think i must be doing something wrong in the configuration process.
How should I set correctly my classes and dao's ?
| 0 |
8,975,823 | 01/23/2012 17:23:26 | 1,155,884 | 01/18/2012 09:52:31 | 8 | 0 | How to get current date in objective C | I want to get the current date and want to give it with my php post query. This is my code
-(void) postMessage:(NSString *) onderwerp withName:(NSString *) nieuwtje withName:(NSString *) datum {
if (onderwerp != nil && nieuwtje !=nil) {
NSMutableString *postString = [NSMutableString stringWithString:kPostURL];
[postString appendString:[NSString stringWithFormat:@"?%@=%@",kName,onderwerp]];
[postString appendString:[NSString stringWithFormat:@"&%@=%@",kMessage,nieuwtje]];
[postString appendString:[NSString stringWithFormat:@"&%@=%@",kDatum,datum]];
[postString setString:[postString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
NSMutableURLRequest *request= [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:postString]];
[request setHTTPMethod:@"POST"];
postConnection = [[NSURLConnection alloc] initWithRequest:request delegate:self startImmediately:YES];
}
}
-(IBAction)post:(id)sender{
NSDate* now = [NSDate date];
NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
NSDateComponents *dateComponents = [gregorian components:(NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit) fromDate:now];
[self postMessage:messageText.text withName:nameText.text withName:gregorian];
messageText.text = nil;
nameText.text = nil;
FirstViewController *firstView = [[FirstViewController alloc] init];
[self.navigationController pushViewController:firstView animated:TRUE];
}
I am giving the gregorian variabel with the postMessage function as date. | php | objective-c | nsdate | null | null | 01/24/2012 18:44:26 | not a real question | How to get current date in objective C
===
I want to get the current date and want to give it with my php post query. This is my code
-(void) postMessage:(NSString *) onderwerp withName:(NSString *) nieuwtje withName:(NSString *) datum {
if (onderwerp != nil && nieuwtje !=nil) {
NSMutableString *postString = [NSMutableString stringWithString:kPostURL];
[postString appendString:[NSString stringWithFormat:@"?%@=%@",kName,onderwerp]];
[postString appendString:[NSString stringWithFormat:@"&%@=%@",kMessage,nieuwtje]];
[postString appendString:[NSString stringWithFormat:@"&%@=%@",kDatum,datum]];
[postString setString:[postString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
NSMutableURLRequest *request= [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:postString]];
[request setHTTPMethod:@"POST"];
postConnection = [[NSURLConnection alloc] initWithRequest:request delegate:self startImmediately:YES];
}
}
-(IBAction)post:(id)sender{
NSDate* now = [NSDate date];
NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
NSDateComponents *dateComponents = [gregorian components:(NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit) fromDate:now];
[self postMessage:messageText.text withName:nameText.text withName:gregorian];
messageText.text = nil;
nameText.text = nil;
FirstViewController *firstView = [[FirstViewController alloc] init];
[self.navigationController pushViewController:firstView animated:TRUE];
}
I am giving the gregorian variabel with the postMessage function as date. | 1 |
8,984,727 | 01/24/2012 09:49:48 | 1,144,851 | 01/12/2012 06:37:04 | 22 | 1 | QGIS 1.7.3 and pyqt4 version mismatch | I installed QGIS 1.7.3 using OSGeo4W installer.I have python 2.7 and pyqt4-py2.7 installed on my system in c drive.My system paths are:
PATH:C:\Python27\Lib\site-packages\PyQt4;C:\OSGeo4W\apps\qgis\bin;C:\OSGeo4W\bin;
PYTHONPATH:C:\OSGeo4W\apps\qgis\python
When i try to run my .py files i get following error:
Traceback (most recent call last):
File "C:\rt_sql_layer_working\DlgQueryBuilder.py", line 30, in <module>
from qgis.core import *
RuntimeError: the PyQt4.QtCore module is version 1 but the qgis.core module requires version -1
what can be the problem?Please help
| python | plugins | pyqt | null | null | null | open | QGIS 1.7.3 and pyqt4 version mismatch
===
I installed QGIS 1.7.3 using OSGeo4W installer.I have python 2.7 and pyqt4-py2.7 installed on my system in c drive.My system paths are:
PATH:C:\Python27\Lib\site-packages\PyQt4;C:\OSGeo4W\apps\qgis\bin;C:\OSGeo4W\bin;
PYTHONPATH:C:\OSGeo4W\apps\qgis\python
When i try to run my .py files i get following error:
Traceback (most recent call last):
File "C:\rt_sql_layer_working\DlgQueryBuilder.py", line 30, in <module>
from qgis.core import *
RuntimeError: the PyQt4.QtCore module is version 1 but the qgis.core module requires version -1
what can be the problem?Please help
| 0 |
10,981,662 | 06/11/2012 14:02:58 | 1,309,022 | 04/02/2012 20:45:01 | 8 | 0 | QLabel showing an image inside a QScrollArea | I've successfully implemented a Image Viewer (for DICOM) in Qt.
I can see the image and I can zoom in and out correctly.
Now, I want to see scroll bars if the image is too big to show when I zoom in.
I've used the UI. I placed a **QScrollArea**. Inside, the **QLabel**.
The *verticalScrollBarPolicy* is *ScrollBarAsNeeded*.
The *horizontalScrollBarPolicy* is *ScrollBarAsNeeded*.
The problem is: it doesn't work. I zoom in, but no scrollbar appears.
Second try: using a layout inside the QScrollArea.
============================
So now there's a **QWidget** between the QScrollArea and the QLabel: a horizontal layout.
Opened the same image, now I can see a vertical scroll bar on the right. The image is streched from left to right. When I zoom the image gets its correct proportion.
BUT... I zoom out and the scroll bar is the same, even if I can see the whole image. The horizontal scroll bar never appears.
Resizing the QLabel doesn't seem to affect. But if I resize the QScrollArea (resizing the main window) the horizontal scroll bar appears.
I've been checking some numbers:
===============================
In the QScrollArea
------------------
- Its size changes: below 599 width (why this number? I can't see it anywhere) the horizontal bar appears.
- *sizeHint()* always returns the same values: 33x41
In the QLabel
-------------
- The dimensions change, but that doesn't affect.
- *sizeHint()* always returns the same values: 560x1558
What am I missing? Thank you. | image | qt | scrollbar | qlabel | qscrollarea | null | open | QLabel showing an image inside a QScrollArea
===
I've successfully implemented a Image Viewer (for DICOM) in Qt.
I can see the image and I can zoom in and out correctly.
Now, I want to see scroll bars if the image is too big to show when I zoom in.
I've used the UI. I placed a **QScrollArea**. Inside, the **QLabel**.
The *verticalScrollBarPolicy* is *ScrollBarAsNeeded*.
The *horizontalScrollBarPolicy* is *ScrollBarAsNeeded*.
The problem is: it doesn't work. I zoom in, but no scrollbar appears.
Second try: using a layout inside the QScrollArea.
============================
So now there's a **QWidget** between the QScrollArea and the QLabel: a horizontal layout.
Opened the same image, now I can see a vertical scroll bar on the right. The image is streched from left to right. When I zoom the image gets its correct proportion.
BUT... I zoom out and the scroll bar is the same, even if I can see the whole image. The horizontal scroll bar never appears.
Resizing the QLabel doesn't seem to affect. But if I resize the QScrollArea (resizing the main window) the horizontal scroll bar appears.
I've been checking some numbers:
===============================
In the QScrollArea
------------------
- Its size changes: below 599 width (why this number? I can't see it anywhere) the horizontal bar appears.
- *sizeHint()* always returns the same values: 33x41
In the QLabel
-------------
- The dimensions change, but that doesn't affect.
- *sizeHint()* always returns the same values: 560x1558
What am I missing? Thank you. | 0 |
8,570,912 | 12/20/2011 04:44:37 | 743,595 | 05/08/2011 03:17:41 | 1 | 0 | Replace word in template page with title of page in php | I am now starting to realize the infinite ways a person can utilize php.
I have created a template page called new-member.php that calls in the content from another page so that when I add a new member, it is fast and easy. The path I use now is: #1) I add a new page with the company name as the title. #2 I choose the new member template. #3 I Click publish. This creates a "new member coming soon" page that is up in seconds. Perfect!
But I would like to take it to a higher level and have a php function replace "New Member" with the page title (The company name) so that when I add a new page, not only does it have the new members url, but instead of saying "New Member coming soon" it says "XYZ Company Coming Soon!" which is a temporary page until the official one is built.
Could someone please show me the correct code and where to place that code? I am using wordpress. I have no clue how to write this code. Does the code go into the new member.php template? The header? I have no idea but want to learn!
Please help! | php | null | null | null | null | null | open | Replace word in template page with title of page in php
===
I am now starting to realize the infinite ways a person can utilize php.
I have created a template page called new-member.php that calls in the content from another page so that when I add a new member, it is fast and easy. The path I use now is: #1) I add a new page with the company name as the title. #2 I choose the new member template. #3 I Click publish. This creates a "new member coming soon" page that is up in seconds. Perfect!
But I would like to take it to a higher level and have a php function replace "New Member" with the page title (The company name) so that when I add a new page, not only does it have the new members url, but instead of saying "New Member coming soon" it says "XYZ Company Coming Soon!" which is a temporary page until the official one is built.
Could someone please show me the correct code and where to place that code? I am using wordpress. I have no clue how to write this code. Does the code go into the new member.php template? The header? I have no idea but want to learn!
Please help! | 0 |
7,682,550 | 10/07/2011 02:40:27 | 176,841 | 09/21/2009 22:46:27 | 941 | 26 | What is the "Hello World" of concurrent programs? | I'm looking for some canonical, simple concurrency problems, suitable for demonstrating usage of a library for concurrent computations I'm working on.
To clarify what I mean by "concurrency": I'm interested in algorithms that utilize non-deterministic communicating processes, not in e.g. making algorithms like quicksort run faster by spreading the work over multiple processors. [This][1] is how I'm using the term.
I know about the [Dining Philosophers Problem][2], and that would be acceptable, but I wonder if there are any more convincing but equally simple problems.
[1]: http://www.haskell.org/haskellwiki/Parallelism_vs._Concurrency
[2]: http://en.wikipedia.org/wiki/Dining_philosophers_problem | algorithm | language-agnostic | concurrency | null | null | null | open | What is the "Hello World" of concurrent programs?
===
I'm looking for some canonical, simple concurrency problems, suitable for demonstrating usage of a library for concurrent computations I'm working on.
To clarify what I mean by "concurrency": I'm interested in algorithms that utilize non-deterministic communicating processes, not in e.g. making algorithms like quicksort run faster by spreading the work over multiple processors. [This][1] is how I'm using the term.
I know about the [Dining Philosophers Problem][2], and that would be acceptable, but I wonder if there are any more convincing but equally simple problems.
[1]: http://www.haskell.org/haskellwiki/Parallelism_vs._Concurrency
[2]: http://en.wikipedia.org/wiki/Dining_philosophers_problem | 0 |
5,545,800 | 04/05/2011 00:20:08 | 683,068 | 03/30/2011 00:18:50 | 8 | 0 | Firefox 4 awful ClearType text rendering. | I don't know what to think, I've recently installed the latest FF, and it renders websites like everything is between B/STRONG tags.
Example, well known JSFiddle's menu. Above top - Opera (looks almost the same in IE8, Safari and Chrome), below FF4:
[Image link because "new" users are not allowed to post images :P][1]
Totally unreadable. And this looks like that on almost every website.
Even if there's a way of disabling this option it doesn't change a thing, because 80% users won't even care. Great.
The question is:
**Does it look the same for you or is it just me?**
Would love to screen comparisons between FF4 and other browsers.
I hope I have some kind of font rendering virus... Af.
[1]: http://i.stack.imgur.com/dny62.png | firefox | firefox4 | cleartype | null | null | 04/05/2011 02:17:47 | off topic | Firefox 4 awful ClearType text rendering.
===
I don't know what to think, I've recently installed the latest FF, and it renders websites like everything is between B/STRONG tags.
Example, well known JSFiddle's menu. Above top - Opera (looks almost the same in IE8, Safari and Chrome), below FF4:
[Image link because "new" users are not allowed to post images :P][1]
Totally unreadable. And this looks like that on almost every website.
Even if there's a way of disabling this option it doesn't change a thing, because 80% users won't even care. Great.
The question is:
**Does it look the same for you or is it just me?**
Would love to screen comparisons between FF4 and other browsers.
I hope I have some kind of font rendering virus... Af.
[1]: http://i.stack.imgur.com/dny62.png | 2 |
1,833,757 | 12/02/2009 15:47:14 | 223,004 | 12/02/2009 15:47:14 | 1 | 0 | Zend Framework - shared view script path ( global partials ) | How is it possible to set up a shared view script path for partials to create global partials within the Zend Framework?
We know that you can call partials between modules
e.g - echo $this->partial('partial_title','module_name');
but we need to set up a partial folder in the root ( i.e below modules) so that it can be accessble by all views.
It has been suggested to set up a shared view script path, how is this done?
| zend-framework | zend | partials | php | null | null | open | Zend Framework - shared view script path ( global partials )
===
How is it possible to set up a shared view script path for partials to create global partials within the Zend Framework?
We know that you can call partials between modules
e.g - echo $this->partial('partial_title','module_name');
but we need to set up a partial folder in the root ( i.e below modules) so that it can be accessble by all views.
It has been suggested to set up a shared view script path, how is this done?
| 0 |
6,807,434 | 07/24/2011 14:37:00 | 860,304 | 07/24/2011 14:37:00 | 1 | 0 | How to Create CSS3 Paper Curls Without Images | How to Create CSS3 Paper Curls Without Images
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss | css3 | null | null | null | null | 07/24/2011 15:26:28 | not a real question | How to Create CSS3 Paper Curls Without Images
===
How to Create CSS3 Paper Curls Without Images
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss | 1 |
512,166 | 02/04/2009 16:39:26 | 82 | 08/01/2008 16:28:35 | 692 | 41 | (C#)The foreach identifier and closures | In the two following snippets, is the first one safe or must you do the second one?
By safe I mean is each thread guaranteed to call the method on the Foo from the same loop iteration in which the thread was created?
Or must you copy the reference to a new variable "local" to each iteration of the loop?
var threads = new List<Thread>();
foreach (Foo f in ListOfFoo)
{
Thread thread = new Thread(() => f.DoSomething());
threads.Add(thread);
thread.Start();
}
-
var threads = new List<Thread>();
foreach (Foo f in ListOfFoo)
{
Foo f2 = f;
Thread thread = new Thread(() => f2.DoSomething());
threads.Add(thread);
thread.Start();
} | c# | foreach | closures | null | null | null | open | (C#)The foreach identifier and closures
===
In the two following snippets, is the first one safe or must you do the second one?
By safe I mean is each thread guaranteed to call the method on the Foo from the same loop iteration in which the thread was created?
Or must you copy the reference to a new variable "local" to each iteration of the loop?
var threads = new List<Thread>();
foreach (Foo f in ListOfFoo)
{
Thread thread = new Thread(() => f.DoSomething());
threads.Add(thread);
thread.Start();
}
-
var threads = new List<Thread>();
foreach (Foo f in ListOfFoo)
{
Foo f2 = f;
Thread thread = new Thread(() => f2.DoSomething());
threads.Add(thread);
thread.Start();
} | 0 |
11,035,716 | 06/14/2012 14:51:15 | 1,448,276 | 06/11/2012 06:28:19 | 1 | 0 | access struct fields in a concurrent way using threads | suppose I have a data structure with a lot of fields. I want to access it in a concurrent way using threads. Anyway I don't want to lock the entire struct (eg with a completely exclusive access to it using a big mutex ) but i'd like that a thread can access a field even if other threads are accessing OTHER fields.
Is it possible? if yes, how? | multithreading | data-structures | concurrency | mutex | null | null | open | access struct fields in a concurrent way using threads
===
suppose I have a data structure with a lot of fields. I want to access it in a concurrent way using threads. Anyway I don't want to lock the entire struct (eg with a completely exclusive access to it using a big mutex ) but i'd like that a thread can access a field even if other threads are accessing OTHER fields.
Is it possible? if yes, how? | 0 |
11,157,293 | 06/22/2012 13:37:55 | 1,280,271 | 03/20/2012 07:34:33 | 81 | 1 | making two input fields editable with a button click | I have got two input fields which i would like to make editable with a button click.
The data of these two fields is to be written to database in two separate columns which can be achieved by ajax.
But i would like to know about the first part. Tried to google a lot but didnt found a viable solution :( | php | jquery | html | ajax | null | 06/22/2012 19:50:04 | not a real question | making two input fields editable with a button click
===
I have got two input fields which i would like to make editable with a button click.
The data of these two fields is to be written to database in two separate columns which can be achieved by ajax.
But i would like to know about the first part. Tried to google a lot but didnt found a viable solution :( | 1 |
2,168,624 | 01/30/2010 16:58:46 | 315,635 | 01/30/2010 16:36:33 | 1 | 0 | Django: Moving from XAMPP to Django questions | I've worked with XAMPP, WAMPP, MAMPP, etc and am starting to look at Django.
A majority of the work we do is very CMS orientated; although we've been told not to use third-party CMS' (mainly because of user's find them hard to use, and other issues), I've found that I can code a very simple CMS using Cake, CodeIgniter or one of the other PHP frameworks.
And yet, I'm getting increasingly frustrated with the amount of coding I need to do just to get something up and running, and I've been told that Django is a good Python framework to use. It also seems to get a lot of buzz from reddit.
I have some concerns and queries about moving from XAMPP to Django.
1) Security
Any web app should be coded defensively. Over the past few years we've seen a movement towards protecting against XSS, SQL injections, Cross site forgeries, session fixation, session hi-jacking, cookie hi-jacking; the amount of security one needs can be overwhelming.
What things does Django do to prevent/limit XSS, SQL injections, Javascript injections, and santizing input; one normally associates with securing PHP web apps? Is it something I need to worry about, or does Django do all this stuff out of the box.
2) What goes in the /www/ public folder?
In a manual I read it said not to put manage.py or the other .py stuff in the main webroot, so this means I put everything outside of the webroot; so what goes in there?
Do I put the /templates/ directory inside the webroot? How does the server know what to run?
3) Can I still use .htaccess on Django projects? I am familiar with Apache and often use it to do routing, or blocking off bad bots, but will using .htaccess still work?
4) Cronjobs
Do cronjobs still work with Python/Django projects?
5) Running Third party perl/other scripts
In PHP you can use other libraries such as the curl library, ffmpeg, ImageMagik as well as many others; can I still use these libraries with Python/Django?
6) Admin screen
Django gives you an out-of-the-box admin screen; is this only for development purposes or can it put live? I am concerned about any the security of the admin screen.
7) Integration with Discuss, Facebook, Twitter, OpenID, captcha, etc.
There are libraries in PHP that help integrate DisQuss, Facebook, Twitter; but is it relatively easy to do an integration with these and other third party apps?
8) E-commerce, SSL
Are there many e-commerce sites that use Django? I've seen a lot of CMS/Blog type software but not many e-commerce sites. By which I mean, shopping card, Protx/Paypal or Worldpay integration.
That's another thing; there are sandboxes for Protx, Paypal, Worldpay etc for PHP -- but are there any for Django?
9) Is it worth it?
Is it worth moving to Django from an XAMPP background? Will it really make things faster, or is that just marketing hype?
Thanks. | django | null | null | null | null | null | open | Django: Moving from XAMPP to Django questions
===
I've worked with XAMPP, WAMPP, MAMPP, etc and am starting to look at Django.
A majority of the work we do is very CMS orientated; although we've been told not to use third-party CMS' (mainly because of user's find them hard to use, and other issues), I've found that I can code a very simple CMS using Cake, CodeIgniter or one of the other PHP frameworks.
And yet, I'm getting increasingly frustrated with the amount of coding I need to do just to get something up and running, and I've been told that Django is a good Python framework to use. It also seems to get a lot of buzz from reddit.
I have some concerns and queries about moving from XAMPP to Django.
1) Security
Any web app should be coded defensively. Over the past few years we've seen a movement towards protecting against XSS, SQL injections, Cross site forgeries, session fixation, session hi-jacking, cookie hi-jacking; the amount of security one needs can be overwhelming.
What things does Django do to prevent/limit XSS, SQL injections, Javascript injections, and santizing input; one normally associates with securing PHP web apps? Is it something I need to worry about, or does Django do all this stuff out of the box.
2) What goes in the /www/ public folder?
In a manual I read it said not to put manage.py or the other .py stuff in the main webroot, so this means I put everything outside of the webroot; so what goes in there?
Do I put the /templates/ directory inside the webroot? How does the server know what to run?
3) Can I still use .htaccess on Django projects? I am familiar with Apache and often use it to do routing, or blocking off bad bots, but will using .htaccess still work?
4) Cronjobs
Do cronjobs still work with Python/Django projects?
5) Running Third party perl/other scripts
In PHP you can use other libraries such as the curl library, ffmpeg, ImageMagik as well as many others; can I still use these libraries with Python/Django?
6) Admin screen
Django gives you an out-of-the-box admin screen; is this only for development purposes or can it put live? I am concerned about any the security of the admin screen.
7) Integration with Discuss, Facebook, Twitter, OpenID, captcha, etc.
There are libraries in PHP that help integrate DisQuss, Facebook, Twitter; but is it relatively easy to do an integration with these and other third party apps?
8) E-commerce, SSL
Are there many e-commerce sites that use Django? I've seen a lot of CMS/Blog type software but not many e-commerce sites. By which I mean, shopping card, Protx/Paypal or Worldpay integration.
That's another thing; there are sandboxes for Protx, Paypal, Worldpay etc for PHP -- but are there any for Django?
9) Is it worth it?
Is it worth moving to Django from an XAMPP background? Will it really make things faster, or is that just marketing hype?
Thanks. | 0 |
5,941,242 | 05/09/2011 19:02:02 | 505,990 | 11/12/2010 16:23:27 | 121 | 9 | Physics simulation examples | im starting to study physics simulation and i was hoping i could get code examples... anyone knows where i can find some? i would love it in c#... but any other would be fine too... | physics | null | null | null | null | 05/11/2011 15:38:02 | not a real question | Physics simulation examples
===
im starting to study physics simulation and i was hoping i could get code examples... anyone knows where i can find some? i would love it in c#... but any other would be fine too... | 1 |
1,394,695 | 09/08/2009 15:36:19 | 160,677 | 08/21/2009 09:49:50 | 306 | 0 | C# - Property Clarification | According to the definition :
<i>
<b>
"As interface is not an object by itself ,I can't initialize it.If interface were allowed to declare fileds, then it needs storage location,so we can not declare fields inside interface."
</i>
</b>
Incase of property say example
when i declare
string SayHello { get; set; }
inside the interface
It is internally hooked as `get_SayHello( ) ,set_SayHello()` in IL (when i disassemble i
can see the get and set methods).
<i>
<b>
My question is still property needs some storage location,then how the property declaration
is allowed inside the interface.
</b>
</i>
Edit :
This is what i understood.As I am new to C#,i am seeking your help.
| c# | null | null | null | null | null | open | C# - Property Clarification
===
According to the definition :
<i>
<b>
"As interface is not an object by itself ,I can't initialize it.If interface were allowed to declare fileds, then it needs storage location,so we can not declare fields inside interface."
</i>
</b>
Incase of property say example
when i declare
string SayHello { get; set; }
inside the interface
It is internally hooked as `get_SayHello( ) ,set_SayHello()` in IL (when i disassemble i
can see the get and set methods).
<i>
<b>
My question is still property needs some storage location,then how the property declaration
is allowed inside the interface.
</b>
</i>
Edit :
This is what i understood.As I am new to C#,i am seeking your help.
| 0 |
7,852,776 | 10/21/2011 17:02:47 | 310,291 | 03/02/2010 15:22:39 | 3,294 | 20 | conditional html without javascript: why can't I see my html code | i tried just this:
<table><tr><td>
<!--[if !IE]>
non ie browser
<![endif]-->
</tr></td></table>
on firefox I can't see what I expect: "non ie browser"
why? | html | firefox | null | null | null | 10/26/2011 14:06:46 | not a real question | conditional html without javascript: why can't I see my html code
===
i tried just this:
<table><tr><td>
<!--[if !IE]>
non ie browser
<![endif]-->
</tr></td></table>
on firefox I can't see what I expect: "non ie browser"
why? | 1 |
1,261,658 | 08/11/2009 16:56:38 | 104,060 | 05/09/2009 13:16:27 | 656 | 9 | Exercises to advance a student programmer on down time? | Currently on an internship from my CS degree, we have some down time and I'd like to spend it working through a series of problems (although none too large) that would advance my programming skills and allow me to dip my toes in a large breadth of different topics and areas. Unfortunately, everything I do must be done in vb.net on .net 2.0, without downloading any particular libraries. I've already worked through many of the "code-golf" tagged problems on here and the programming praxis problems posed by dailywtf.
Suggestions? | vb.net | asp.net | career-development | education | null | 11/29/2011 12:49:46 | not constructive | Exercises to advance a student programmer on down time?
===
Currently on an internship from my CS degree, we have some down time and I'd like to spend it working through a series of problems (although none too large) that would advance my programming skills and allow me to dip my toes in a large breadth of different topics and areas. Unfortunately, everything I do must be done in vb.net on .net 2.0, without downloading any particular libraries. I've already worked through many of the "code-golf" tagged problems on here and the programming praxis problems posed by dailywtf.
Suggestions? | 4 |
9,764,607 | 03/19/2012 03:21:53 | 1,158,716 | 01/19/2012 14:35:16 | 5 | 0 | GEF Shapes Example: How can I change the TargetDecoration for Connections? | In the GEF shapes example, there are two types of connections, they differ by line style only (`int Graphics.LINE_DASH` or `int Graphics.LINE_SOLID`).
Now I wanna change the TargetDecoration (or rather set it to `null`) for one of them. How do I do this?
I've tried an `if` in the below method (below is the original), but it didn't have any effect. I tried `if (getCastedModel().getLineStyle() != Graphics.LINE_DASH) connections.setTargetDecoration(null)` and left he rest as it was.
protected IFigure createFigure() {
PolylineConnection connection = (PolylineConnection) super
.createFigure();
connection.setTargetDecoration(new PolygonDecoration()); // arrow at
// target
// endpoint
connection.setLineStyle(getCastedModel().getLineStyle()); // line
// style
return connection;
}
Thanks! | gui | user-interface | connection | eclipse-rcp | eclipse-gef | null | open | GEF Shapes Example: How can I change the TargetDecoration for Connections?
===
In the GEF shapes example, there are two types of connections, they differ by line style only (`int Graphics.LINE_DASH` or `int Graphics.LINE_SOLID`).
Now I wanna change the TargetDecoration (or rather set it to `null`) for one of them. How do I do this?
I've tried an `if` in the below method (below is the original), but it didn't have any effect. I tried `if (getCastedModel().getLineStyle() != Graphics.LINE_DASH) connections.setTargetDecoration(null)` and left he rest as it was.
protected IFigure createFigure() {
PolylineConnection connection = (PolylineConnection) super
.createFigure();
connection.setTargetDecoration(new PolygonDecoration()); // arrow at
// target
// endpoint
connection.setLineStyle(getCastedModel().getLineStyle()); // line
// style
return connection;
}
Thanks! | 0 |
7,454,177 | 09/17/2011 10:45:05 | 938,851 | 09/11/2011 04:54:27 | 162 | 36 | Best way to display pages | Which one of these is better :
include("up.php");
content here
include("down.php");
up.php file contains each page up part
down.php file contains each page footer part
or
$sivu = $_GET['sivu'];
$sivu = str_replace("/", "", $sivu); //only this directory allowed
include("".$sivu.".php"); | php | html | null | null | null | 09/17/2011 13:14:29 | not constructive | Best way to display pages
===
Which one of these is better :
include("up.php");
content here
include("down.php");
up.php file contains each page up part
down.php file contains each page footer part
or
$sivu = $_GET['sivu'];
$sivu = str_replace("/", "", $sivu); //only this directory allowed
include("".$sivu.".php"); | 4 |
5,645,962 | 04/13/2011 07:45:16 | 681,256 | 03/29/2011 02:36:29 | 37 | 0 | Is there a hello world heap overflow example? | Anyone has a demo?
thanks in advance! | c | linux | heap | null | null | 04/14/2011 19:07:22 | not a real question | Is there a hello world heap overflow example?
===
Anyone has a demo?
thanks in advance! | 1 |
7,332,758 | 09/07/2011 11:01:48 | 208,446 | 11/11/2009 06:38:55 | 2,901 | 261 | What makes other languages faster than Java in terms of Rapid Development? | Many people say developing in Python, Ruby, PHP ...etc is much faster than Java.
Question is, why? In terms of coding, IDEs, available libraries... etc. Or is the speed in making the first prototype only?
I'm interested in answers from people who worked long time on Java and long time on other languages.
Note: I have developed for .Net before Java and yes it was faster to make some apps, but on the long run (large web projects) it will become like Java.
| java | php | .net | python | ruby | 09/07/2011 11:10:44 | off topic | What makes other languages faster than Java in terms of Rapid Development?
===
Many people say developing in Python, Ruby, PHP ...etc is much faster than Java.
Question is, why? In terms of coding, IDEs, available libraries... etc. Or is the speed in making the first prototype only?
I'm interested in answers from people who worked long time on Java and long time on other languages.
Note: I have developed for .Net before Java and yes it was faster to make some apps, but on the long run (large web projects) it will become like Java.
| 2 |
299,658 | 11/18/2008 18:26:24 | 37,754 | 11/14/2008 18:28:38 | 6 | 1 | Employee Scheduling Software? Web/Browser Based | Just wondering if any of you guys know of any web-based/browser-based employee scheduling software/tools?
Currently doing it all in Excel, but it just isnt intelligent enough... any product suggestions?
Needs to handle multiple employees time over weeks and months... to schedule in work short-term and long-term, allow me to see possible resourcing issues etc etc.
Its an easy question answer when you work only on projects, but at my agency we work on projects and day-to-day retainer type things that can come in at any time and are usually of the "drop everything and do this now" type.
If it were just projects, then any one of the online Project Management tools (GoPlan, Copper Project, MS Project) would suffice (but definately not Basecamp, I find this ok for very small projects and small teams, but anything larger and I think it falls down completely as a PM tool)
The only thing that came close to doing all that I wanted was Workschedule - http://www.workschedule.net/
Its browser based, low-cost and has a zillion options that really allowed me to plan resource levels for the agency. The only downside is it looks pretty awful, but I soon got over this. | employee | scheduling | web-applications | project-planning | null | 07/16/2011 09:42:19 | off topic | Employee Scheduling Software? Web/Browser Based
===
Just wondering if any of you guys know of any web-based/browser-based employee scheduling software/tools?
Currently doing it all in Excel, but it just isnt intelligent enough... any product suggestions?
Needs to handle multiple employees time over weeks and months... to schedule in work short-term and long-term, allow me to see possible resourcing issues etc etc.
Its an easy question answer when you work only on projects, but at my agency we work on projects and day-to-day retainer type things that can come in at any time and are usually of the "drop everything and do this now" type.
If it were just projects, then any one of the online Project Management tools (GoPlan, Copper Project, MS Project) would suffice (but definately not Basecamp, I find this ok for very small projects and small teams, but anything larger and I think it falls down completely as a PM tool)
The only thing that came close to doing all that I wanted was Workschedule - http://www.workschedule.net/
Its browser based, low-cost and has a zillion options that really allowed me to plan resource levels for the agency. The only downside is it looks pretty awful, but I soon got over this. | 2 |
7,467,415 | 09/19/2011 06:56:43 | 618,091 | 02/15/2011 15:41:59 | 1 | 0 | Computer Scince PhD School Selection: focus on ranking rather than the group? | I was wondering how much the University ranking is important for a PhD school selection.
I think that it could really be established a discussion about University rankings and their reliability. It seems to me that top schools are there because they are the most famous ones, even in the subject ranking.
More specifically, what is the most significant thing in the PhD school selection process, the University ranking or the specific group importance?
In particular, if I could, I would like to compare Melbourne University with Waikato one about the Machine Learning (ML) research group. The first one has significantly higher ranking than the second one, but the latter has a very strong ML group. In fact, they are still publishing new versions of their Data Mining book.
Thank you. | university | graduate-school | null | null | null | 09/19/2011 07:04:09 | off topic | Computer Scince PhD School Selection: focus on ranking rather than the group?
===
I was wondering how much the University ranking is important for a PhD school selection.
I think that it could really be established a discussion about University rankings and their reliability. It seems to me that top schools are there because they are the most famous ones, even in the subject ranking.
More specifically, what is the most significant thing in the PhD school selection process, the University ranking or the specific group importance?
In particular, if I could, I would like to compare Melbourne University with Waikato one about the Machine Learning (ML) research group. The first one has significantly higher ranking than the second one, but the latter has a very strong ML group. In fact, they are still publishing new versions of their Data Mining book.
Thank you. | 2 |
832,551 | 05/07/2009 01:42:41 | 84,631 | 03/30/2009 13:57:34 | 1 | 0 | Rails: How can I log on which site my javascript is embedded? | My site provides a javascript that shows the rate of the Dutch equivalent of the Dow Jones index. Users can embed this script in their website.
It looks like this:
<script type="text/javascript" src="http://www.aexscript.nl/r/gratis"></script>
The corresponding controller action looks like this:
def show
@script = Script.find_by_code(params[:code])
@rate = Rate.find(:first)
respond_to do |format|
format.js # show.js.erb
end
end
I want to log the URL of the site the javascript has been embedded on. How can I do this? | ruby-on-rails | javascript | embed | logging | null | null | open | Rails: How can I log on which site my javascript is embedded?
===
My site provides a javascript that shows the rate of the Dutch equivalent of the Dow Jones index. Users can embed this script in their website.
It looks like this:
<script type="text/javascript" src="http://www.aexscript.nl/r/gratis"></script>
The corresponding controller action looks like this:
def show
@script = Script.find_by_code(params[:code])
@rate = Rate.find(:first)
respond_to do |format|
format.js # show.js.erb
end
end
I want to log the URL of the site the javascript has been embedded on. How can I do this? | 0 |
9,279,973 | 02/14/2012 15:55:32 | 1,093,486 | 12/12/2011 10:09:24 | 1 | 0 | PHP's mysql_real_escape_string and MySQL Injection | I have been trying to figure out how exactly **\x00, \n, \r, \\, or \x1a** can cause an SQL Injection (as it is mentioned at http://nl3.php.net/manual/en/function.mysql-real-escape-string.php)
I understand the idea of single quote and double quotes, but how and why I need to take care of the other items to make my query safe? | mysql-real-escape-string | null | null | null | null | null | open | PHP's mysql_real_escape_string and MySQL Injection
===
I have been trying to figure out how exactly **\x00, \n, \r, \\, or \x1a** can cause an SQL Injection (as it is mentioned at http://nl3.php.net/manual/en/function.mysql-real-escape-string.php)
I understand the idea of single quote and double quotes, but how and why I need to take care of the other items to make my query safe? | 0 |
7,410,290 | 09/14/2011 01:22:03 | 257,583 | 01/23/2010 22:28:23 | 1,463 | 4 | How do I get SLIME + Emacs set up? | [According to this answer][1], Emacs + Slime already has much advanced functionality. So how can I get syntax coloring, auto-completion, and perhaps even version control management, set up and running in my copy of Lispbox?
[1]: http://stackoverflow.com/questions/1997838/what-are-the-good-rich-ides-for-lisp/2018860#2018860 | emacs | ide | slime | null | null | null | open | How do I get SLIME + Emacs set up?
===
[According to this answer][1], Emacs + Slime already has much advanced functionality. So how can I get syntax coloring, auto-completion, and perhaps even version control management, set up and running in my copy of Lispbox?
[1]: http://stackoverflow.com/questions/1997838/what-are-the-good-rich-ides-for-lisp/2018860#2018860 | 0 |
6,165,869 | 05/29/2011 03:57:06 | 402,610 | 07/26/2010 18:23:17 | 373 | 9 | Grouping mysql records fortnightly | I want to group the records on its timestamp field Fortnightly. I am doing it weekly now but i want it to be fortnightly also. How do i do that ? Is there a specific way to do this like how we group by weeks using WEEK('timestamp','%d-%m-%Y') function ?
| mysql | null | null | null | null | null | open | Grouping mysql records fortnightly
===
I want to group the records on its timestamp field Fortnightly. I am doing it weekly now but i want it to be fortnightly also. How do i do that ? Is there a specific way to do this like how we group by weeks using WEEK('timestamp','%d-%m-%Y') function ?
| 0 |
7,145,981 | 08/22/2011 10:18:07 | 576,510 | 01/15/2011 05:51:55 | 384 | 0 | which one is fast in performance, stored procedure or in line sql quries? | Can you please guide (in using SQL Server 2005 with C#) which one is fast ? calling sotred procedure or using inline sql text quries for CRUD operations ? | c# | sql-server | null | null | null | 08/22/2011 11:33:35 | not constructive | which one is fast in performance, stored procedure or in line sql quries?
===
Can you please guide (in using SQL Server 2005 with C#) which one is fast ? calling sotred procedure or using inline sql text quries for CRUD operations ? | 4 |
4,523,772 | 12/24/2010 01:58:15 | 338,204 | 03/29/2010 14:31:57 | 92 | 30 | How do you think why Facebook decides to deprecate REST API ? | As we know, facebook is using new Graph API to replace Old REST API as [here][1].
We know that REST is new architecture design style compared with SOAP etc. Just wonder why REST will be deprecated by facebook. Maybe there are a lot reasons, and facebook will not oepn them and know themselves.
My purpose post question here is to learn more about REST.
Thanks for any comments.
[1]: http://developers.facebook.com/docs/reference/rest/ | facebook | rest | facebook-connect | facebook-graph-api | null | 12/26/2010 13:45:44 | off topic | How do you think why Facebook decides to deprecate REST API ?
===
As we know, facebook is using new Graph API to replace Old REST API as [here][1].
We know that REST is new architecture design style compared with SOAP etc. Just wonder why REST will be deprecated by facebook. Maybe there are a lot reasons, and facebook will not oepn them and know themselves.
My purpose post question here is to learn more about REST.
Thanks for any comments.
[1]: http://developers.facebook.com/docs/reference/rest/ | 2 |
11,035,738 | 06/14/2012 14:52:19 | 182,867 | 10/02/2009 02:37:14 | 137 | 7 | How to install php memcache in a production server? | Is there any way to install memcache without pecl/phpize ?
http://in2.php.net/manual/en/memcache.installation.php
It's a production server, its a good practice to install pecl/phpize into it ? | php | linux | php5 | null | null | 06/14/2012 15:00:13 | off topic | How to install php memcache in a production server?
===
Is there any way to install memcache without pecl/phpize ?
http://in2.php.net/manual/en/memcache.installation.php
It's a production server, its a good practice to install pecl/phpize into it ? | 2 |
9,541,697 | 03/02/2012 23:13:55 | 1,066,894 | 11/26/2011 12:56:43 | 14 | 1 | JSP/Servlets necessity for JSF development | I am an intermediate java developer and i was tying to get to know the java web application capablities,
i want to learn JSF java EE for web application development, because am already in the field of web development using Ruby and PHP.
should i learn jsp/servlets first? or Java Web Application Frameworks do not depend on jsps and servlets? | java | jsp | jsf | servlets | null | 03/02/2012 23:19:30 | not constructive | JSP/Servlets necessity for JSF development
===
I am an intermediate java developer and i was tying to get to know the java web application capablities,
i want to learn JSF java EE for web application development, because am already in the field of web development using Ruby and PHP.
should i learn jsp/servlets first? or Java Web Application Frameworks do not depend on jsps and servlets? | 4 |
220,844 | 10/21/2008 05:18:43 | 22,162 | 09/25/2008 13:28:13 | 177 | 21 | Saved Search Options in ASP.net | I am having an ASP.net page with some 15 controls and each using as filter filter parameter query for search (Select * from Table 1 where (all control values). I need to saved these searches on clicking the button. (I need to hold this in a table what are the things that are searched by user.
Please tell me which is the best way to implement | asp.net | null | null | null | null | 11/10/2008 06:37:34 | off topic | Saved Search Options in ASP.net
===
I am having an ASP.net page with some 15 controls and each using as filter filter parameter query for search (Select * from Table 1 where (all control values). I need to saved these searches on clicking the button. (I need to hold this in a table what are the things that are searched by user.
Please tell me which is the best way to implement | 2 |
8,156,280 | 11/16/2011 17:51:20 | 1,037,772 | 11/09/2011 13:44:48 | -4 | 0 | Reportlab: dynamic color for table column (color stored in django model) in reportlab | I have django model called TestResults
models.py
----------
Class TestResults(models)
chemical_name charfield
value floatfield
unit charfield
method charfield
normal_limit charfield
caution_limit charfield
color charfield
Now,
The below code will generate the table for oils, which has following fields.
views.py
---------
fields = ('Test Name', 'Value', 'Unit', 'Method',
'Normal Limit', 'Caution Limit')
all_oils = [(test.chemical_name, test.value, test.unit, test.method,
test.normal_limit, test.caution_limit)
for test in TestResult.objects.all())]
oil_table = Table([fields] + all_oils
oil_table.setStyle(TableStyle([('BACKGROUND', (0, 0), (-1, 0), '#a7a5a5'),
('FONTSIZE', (0, 0), (-1, 0), 6),
('GRID', (0, 0), (-1, -1), 2, '#a7a5a5'),
('FONTSIZE', (0, 0), (-1, -1), 8),
('FONTNAME',(1,1),(1,-1),'Times-Bold')]))
Now how can I provide dynamic color for each column. Suppose my TestResult model is having field for color (I,e color=red)
In report i want dynamic color for second column which comes from model objects
How can I achieve this?
| reportlab | null | null | null | null | 04/26/2012 09:47:56 | too localized | Reportlab: dynamic color for table column (color stored in django model) in reportlab
===
I have django model called TestResults
models.py
----------
Class TestResults(models)
chemical_name charfield
value floatfield
unit charfield
method charfield
normal_limit charfield
caution_limit charfield
color charfield
Now,
The below code will generate the table for oils, which has following fields.
views.py
---------
fields = ('Test Name', 'Value', 'Unit', 'Method',
'Normal Limit', 'Caution Limit')
all_oils = [(test.chemical_name, test.value, test.unit, test.method,
test.normal_limit, test.caution_limit)
for test in TestResult.objects.all())]
oil_table = Table([fields] + all_oils
oil_table.setStyle(TableStyle([('BACKGROUND', (0, 0), (-1, 0), '#a7a5a5'),
('FONTSIZE', (0, 0), (-1, 0), 6),
('GRID', (0, 0), (-1, -1), 2, '#a7a5a5'),
('FONTSIZE', (0, 0), (-1, -1), 8),
('FONTNAME',(1,1),(1,-1),'Times-Bold')]))
Now how can I provide dynamic color for each column. Suppose my TestResult model is having field for color (I,e color=red)
In report i want dynamic color for second column which comes from model objects
How can I achieve this?
| 3 |
6,744,795 | 07/19/2011 09:10:19 | 564,340 | 01/05/2011 17:49:33 | 1 | 0 | Example of an iPhone app which uses long press option | I need an example of an iPhone application that uses the long press option.
Please, show me just one, :), and I'd like it to be free
Best regards | iphone | null | null | null | null | 07/19/2011 22:16:02 | not constructive | Example of an iPhone app which uses long press option
===
I need an example of an iPhone application that uses the long press option.
Please, show me just one, :), and I'd like it to be free
Best regards | 4 |
6,711,640 | 07/15/2011 18:32:47 | 846,929 | 07/15/2011 17:51:46 | 1 | 0 | Native APIs vs Web frameworks like Sencha,PhoneGap vs Appcelarator | I have been recently exploring some of HTML5/Javascript mobile frameworks like Sencha, Appcelerator and native app development for mobile and tablet apps.
Can you pl let me know me which option will be good based on harnessing device capabilities and performance point of view.
Thanks
| iphone | android | mobile | appcelerator | sencha | 07/15/2011 18:34:54 | not constructive | Native APIs vs Web frameworks like Sencha,PhoneGap vs Appcelarator
===
I have been recently exploring some of HTML5/Javascript mobile frameworks like Sencha, Appcelerator and native app development for mobile and tablet apps.
Can you pl let me know me which option will be good based on harnessing device capabilities and performance point of view.
Thanks
| 4 |
9,778,232 | 03/19/2012 21:29:00 | 1,000,343 | 10/18/2011 03:41:52 | 2,352 | 95 | ggplot unexplained outcome | I started making a reproducible example to ask another question and can't even get past that. Anyway I am attempting to plot categorical data into a faceted bar plot. So I made my own data set using CO3 (code at bottom). Just plotting x by itself seems normal:
![enter image description here][1]
but then gets funky when I try to facet. Showing everything is all equal.
![enter image description here][2]
That doesn't make sense as it would indicate every sub group had equal proportions of the out come that isn't evidenced by an `ftable` of the data:
Type Quebec Mississippi
outcome Treatment
none nonchilled 7 6
chilled 4 7
some nonchilled 6 4
chilled 5 5
lots nonchilled 5 4
chilled 6 3
tons nonchilled 3 7
chilled 6 6
**What am I doing wrong?**
library(ggplot2)
set.seed(10)
CO3 <- data.frame(CO2[, 2:3], outcome=factor(sample(c('none', 'some', 'lots', 'tons'),
nrow(CO2), rep=T), levels=c('none', 'some', 'lots', 'tons')))
CO3
x <- ggplot(CO3, aes(x=outcome)) + geom_bar(aes(x=outcome))
x
x + facet_grid(Treatment~., margins=TRUE)
with(CO3, ftable(outcome, Treatment, Type))
[1]: http://i.stack.imgur.com/HCG35.png
[2]: http://i.stack.imgur.com/lK7Qi.png
| r | ggplot2 | null | null | null | null | open | ggplot unexplained outcome
===
I started making a reproducible example to ask another question and can't even get past that. Anyway I am attempting to plot categorical data into a faceted bar plot. So I made my own data set using CO3 (code at bottom). Just plotting x by itself seems normal:
![enter image description here][1]
but then gets funky when I try to facet. Showing everything is all equal.
![enter image description here][2]
That doesn't make sense as it would indicate every sub group had equal proportions of the out come that isn't evidenced by an `ftable` of the data:
Type Quebec Mississippi
outcome Treatment
none nonchilled 7 6
chilled 4 7
some nonchilled 6 4
chilled 5 5
lots nonchilled 5 4
chilled 6 3
tons nonchilled 3 7
chilled 6 6
**What am I doing wrong?**
library(ggplot2)
set.seed(10)
CO3 <- data.frame(CO2[, 2:3], outcome=factor(sample(c('none', 'some', 'lots', 'tons'),
nrow(CO2), rep=T), levels=c('none', 'some', 'lots', 'tons')))
CO3
x <- ggplot(CO3, aes(x=outcome)) + geom_bar(aes(x=outcome))
x
x + facet_grid(Treatment~., margins=TRUE)
with(CO3, ftable(outcome, Treatment, Type))
[1]: http://i.stack.imgur.com/HCG35.png
[2]: http://i.stack.imgur.com/lK7Qi.png
| 0 |
6,158,728 | 05/27/2011 23:57:04 | 482,473 | 10/21/2010 02:30:33 | 93 | 0 | UILabel not responding to touch | label_win3=[[UILabel alloc] initWithFrame:CGRectMake(55, 358, 210,15)];
label_win3.text=@"Click here";
label_win3.textColor=[UIColor cyanColor];
label_win3.backgroundColor=[UIColor clearColor];
label_win3.font=[UIFont fontWithName:@"Helvetica" size: 14.0];
label_win3.textAlignment=UITextAlignmentCenter;
label_win3.userInteractionEnabled=YES;
[self.view addSubview:label_win3];
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [touches anyObject];
CGPoint currentTouch = [touch locationInView:self.view];
if([touch view]==label_win3) {
[[NSNotificationCenter defaultCenter] postNotificationName:@"ShowRegistration" object:nil];}
}
| iphone | null | null | null | null | 05/28/2011 01:31:55 | not a real question | UILabel not responding to touch
===
label_win3=[[UILabel alloc] initWithFrame:CGRectMake(55, 358, 210,15)];
label_win3.text=@"Click here";
label_win3.textColor=[UIColor cyanColor];
label_win3.backgroundColor=[UIColor clearColor];
label_win3.font=[UIFont fontWithName:@"Helvetica" size: 14.0];
label_win3.textAlignment=UITextAlignmentCenter;
label_win3.userInteractionEnabled=YES;
[self.view addSubview:label_win3];
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [touches anyObject];
CGPoint currentTouch = [touch locationInView:self.view];
if([touch view]==label_win3) {
[[NSNotificationCenter defaultCenter] postNotificationName:@"ShowRegistration" object:nil];}
}
| 1 |
10,165,294 | 04/15/2012 19:29:02 | 273,330 | 02/15/2010 08:24:03 | 255 | 3 | Unable to update DoDataExchange method : VS 2000 Project converted to Visual Studio 2008 or VS 2010 Options | I am having a problem. I have a project "MicroSIP" which is used for
SIP based call voice over IP. I am running it into VS 2010 and I need
to customize it according to my need. For this as soon as I edit the
main dialog ( Dialer ) and add some other controls ( like edit control
of CEdit) and add member variable for from wizard of "Add Variable",
it shows the message "unable to update DoDataExchange method".
More over if getting reference of newly placed "Edit Control" in the
program , it has NULL pointer or undefined reference.
Anybody having any idea about this to resolve or some way around to
resolve the issue. I am having extremely trouble for solving this
scanario.
Regards
Usman Khali
| visual-studio-2010 | visual-studio-2008 | visual-c++ | mfc | null | null | open | Unable to update DoDataExchange method : VS 2000 Project converted to Visual Studio 2008 or VS 2010 Options
===
I am having a problem. I have a project "MicroSIP" which is used for
SIP based call voice over IP. I am running it into VS 2010 and I need
to customize it according to my need. For this as soon as I edit the
main dialog ( Dialer ) and add some other controls ( like edit control
of CEdit) and add member variable for from wizard of "Add Variable",
it shows the message "unable to update DoDataExchange method".
More over if getting reference of newly placed "Edit Control" in the
program , it has NULL pointer or undefined reference.
Anybody having any idea about this to resolve or some way around to
resolve the issue. I am having extremely trouble for solving this
scanario.
Regards
Usman Khali
| 0 |
3,525,838 | 08/19/2010 20:15:44 | 378,435 | 06/28/2010 20:53:07 | 26 | 3 | Need help replacing swprintf | I am using some cross platform stuff called nutcracker to go between Windows and Linux, to make a long story short its limited in its support for wide string chars. I have to take the code below and replace what the swprintf is doing and I have no idea how. My experience with low level byte manipulation sucks. Can someone please help me with this?
Please keep in mind I can't go crazy and re-write swprintf but get the basic functionality to format the pwszString correctly from the data in pBuffer. This is c++ using the Microsoft vc6.0 compiler but through CXX so it's limited as well.
The wszSep is just a delimeter, either "" or "-" for readabilty when printing.
HRESULT BufferHelper::Buff2StrASCII(
/*[in]*/ const unsigned char * pBuffer,
/*[in]*/ int iSize,
/*[in]*/ LPWSTR wszSep,
/*[out]*/ LPWSTR* pwszString )
{
// Check args
if (! pwszString) return E_POINTER;
// Allocate memory
int iSep = (int)wcslen(wszSep);
*pwszString = new WCHAR [ (((iSize * ( 2 + iSep )) + 1 ) - iSep ) ];
if (! pwszString) return E_OUTOFMEMORY;
// Loop
int i = 0;
for (i=0; i< iSize; i++)
{
swprintf( (*pwszString)+(i*(2+iSep)), L"%02X%s", pBuffer[i], (i!=(iSize-1)) ? wszSep : L"" );
}
return S_OK;
}
This takes whats in the pBuffer and encodes the wide buffer with ascii. I use typedef const unsigned short* LPCWSTR; because that type does not exist in the nutcracker.
I can post more if you need to see more code.
Thanks.
| string | null | null | null | null | null | open | Need help replacing swprintf
===
I am using some cross platform stuff called nutcracker to go between Windows and Linux, to make a long story short its limited in its support for wide string chars. I have to take the code below and replace what the swprintf is doing and I have no idea how. My experience with low level byte manipulation sucks. Can someone please help me with this?
Please keep in mind I can't go crazy and re-write swprintf but get the basic functionality to format the pwszString correctly from the data in pBuffer. This is c++ using the Microsoft vc6.0 compiler but through CXX so it's limited as well.
The wszSep is just a delimeter, either "" or "-" for readabilty when printing.
HRESULT BufferHelper::Buff2StrASCII(
/*[in]*/ const unsigned char * pBuffer,
/*[in]*/ int iSize,
/*[in]*/ LPWSTR wszSep,
/*[out]*/ LPWSTR* pwszString )
{
// Check args
if (! pwszString) return E_POINTER;
// Allocate memory
int iSep = (int)wcslen(wszSep);
*pwszString = new WCHAR [ (((iSize * ( 2 + iSep )) + 1 ) - iSep ) ];
if (! pwszString) return E_OUTOFMEMORY;
// Loop
int i = 0;
for (i=0; i< iSize; i++)
{
swprintf( (*pwszString)+(i*(2+iSep)), L"%02X%s", pBuffer[i], (i!=(iSize-1)) ? wszSep : L"" );
}
return S_OK;
}
This takes whats in the pBuffer and encodes the wide buffer with ascii. I use typedef const unsigned short* LPCWSTR; because that type does not exist in the nutcracker.
I can post more if you need to see more code.
Thanks.
| 0 |
7,620,135 | 10/01/2011 12:10:45 | 807,014 | 06/15/2011 03:25:20 | 42 | 1 | UINavigationController Disappears | I am building an app that makes use of a navigation controller. The nav controller works fine, except when I try to switch views using the following code in an IBAction:
settingsViewController *controller
= [[settingsViewController alloc] initWithNibName:@"settingsViewController" bundle:nil];
controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:controller animated:YES];
[controller release];
Upon returning to the view with the navigation controller (the home screen) the nav controller bar is not there, and none of the buttons which usually switch views using the nav controller work.
Is there some way I need to re-initialize the navigation controller when I return to the nav controller view after switching to a view without a nav controller? | objective-c | ios | uinavigationcontroller | uinavigationbar | presentmodalviewcontrolle | null | open | UINavigationController Disappears
===
I am building an app that makes use of a navigation controller. The nav controller works fine, except when I try to switch views using the following code in an IBAction:
settingsViewController *controller
= [[settingsViewController alloc] initWithNibName:@"settingsViewController" bundle:nil];
controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:controller animated:YES];
[controller release];
Upon returning to the view with the navigation controller (the home screen) the nav controller bar is not there, and none of the buttons which usually switch views using the nav controller work.
Is there some way I need to re-initialize the navigation controller when I return to the nav controller view after switching to a view without a nav controller? | 0 |
256,103 | 11/01/2008 21:01:40 | 26,123 | 10/08/2008 12:33:24 | 101 | 4 | Some good example of RESTful web api? | Can you suggest some good example of some real-world and really well-done REST web api? | rest | web-services | web-api | null | null | 11/27/2011 14:11:49 | not constructive | Some good example of RESTful web api?
===
Can you suggest some good example of some real-world and really well-done REST web api? | 4 |
11,244,390 | 06/28/2012 12:13:23 | 1,488,433 | 06/28/2012 11:48:27 | 1 | 0 | Converting Number Into Word In Power Builder 9.0 | Hi My Dear Programmers!!!.
I Just Wanna Corresponding Word From The Field **"Net Amount"**.
for Example
===========
Net Amount : **2500**.
But The Answer Should Be Displayed In **"Two Thousand And Five Hundred"**
My Query
========
Filewrite(Job,char(15)+space(50)+"G"+**" Net Amount : "** +f_lpad(ld_tot - ld_disc,12,true) + char(27) +"H"+ "~n")
Please Help Me. | powerbuilder | null | null | null | null | 06/29/2012 13:12:51 | not a real question | Converting Number Into Word In Power Builder 9.0
===
Hi My Dear Programmers!!!.
I Just Wanna Corresponding Word From The Field **"Net Amount"**.
for Example
===========
Net Amount : **2500**.
But The Answer Should Be Displayed In **"Two Thousand And Five Hundred"**
My Query
========
Filewrite(Job,char(15)+space(50)+"G"+**" Net Amount : "** +f_lpad(ld_tot - ld_disc,12,true) + char(27) +"H"+ "~n")
Please Help Me. | 1 |
6,103,212 | 05/23/2011 21:23:49 | 158,756 | 08/18/2009 20:05:17 | 365 | 8 | MYSQL - How do I delete duplicate rows and keep the first row | I made a mistake and I have unwanted duplicates.
I have a table with 4 key fields. A1, k1, k2, k3.
A1 is auto increment and the primary key.
the combination of k1,k2 and k3 is supposed to be unique and I have to delete the duplicate rows before I create a unique index. Some row have one duplicate, some have many.
<pre>
SELECT CONCAT(k1, k2, k) AS dup_value
FROM myviews
GROUP BY dup_value
HAVING (COUNT(dup_value) > 1)
</pre>
shows me duplicates values that I need to deal with. But now I don't know how to keep one and delete the rest of each duplicate set.
Thanks | mysql | null | null | null | null | null | open | MYSQL - How do I delete duplicate rows and keep the first row
===
I made a mistake and I have unwanted duplicates.
I have a table with 4 key fields. A1, k1, k2, k3.
A1 is auto increment and the primary key.
the combination of k1,k2 and k3 is supposed to be unique and I have to delete the duplicate rows before I create a unique index. Some row have one duplicate, some have many.
<pre>
SELECT CONCAT(k1, k2, k) AS dup_value
FROM myviews
GROUP BY dup_value
HAVING (COUNT(dup_value) > 1)
</pre>
shows me duplicates values that I need to deal with. But now I don't know how to keep one and delete the rest of each duplicate set.
Thanks | 0 |
5,265,924 | 03/10/2011 21:07:36 | 404,020 | 07/28/2010 01:02:19 | 744 | 4 | Can't edit code after running simulation in Modelsim | If I run a simulation in Modelsim and then try to go back to editing the code, I can't edit it sometimes. I have to exit and restart Modelsim in order to do so. Why is that? | simulation | verilog | modelsim | null | null | 03/11/2011 04:25:05 | not a real question | Can't edit code after running simulation in Modelsim
===
If I run a simulation in Modelsim and then try to go back to editing the code, I can't edit it sometimes. I have to exit and restart Modelsim in order to do so. Why is that? | 1 |
862,917 | 05/14/2009 11:56:50 | 45,311 | 12/11/2008 11:47:59 | 194 | 12 | ASP.NET Membership - Can I allow anonymous access and still use automated login using Active Directory? | I hope this is not to paradoxal, but I don't know how this should be done...
I have a VS2008 ASP.NET MVC Project with the following Web.Config entry:
<authentication mode="Windows">
<forms name=".ADAuthCookie" timeout="10" />
</authentication>
This makes the visitor logon automatically with their DOMAIN\username login which they used to logon to Windows. (Right?)
This works with my development server (http://localhost:xxxx), but not with my IIS server (http://localhost). Probably because the development server is 'started' by my local user (which has ActiveDirectory read-rights on the domain) and because IIS is 'started' by the IUSR_WORKSTATION user which does not. (Right?)
**If all of the above is true, how can I impersonate the IIS user (for instance to my own username) to solely authenticate the current user with the Windows login name?** (like the example below)?
**Or should the IUSR_WORKSTATION user be granted ActiveDirectory?** read-rights (not preferred as I will be switching servers / IUSR_ users a lot)
<identity impersonate="true" userName="DOMAIN\myuser" password="mypass"/>
<authentication mode="Windows">
<forms name=".ADAuthCookie" timeout="10" />
</authentication>
<identity impersonate="false"/> | asp.net-membership | windows-authentication | impersonation | iis | null | null | open | ASP.NET Membership - Can I allow anonymous access and still use automated login using Active Directory?
===
I hope this is not to paradoxal, but I don't know how this should be done...
I have a VS2008 ASP.NET MVC Project with the following Web.Config entry:
<authentication mode="Windows">
<forms name=".ADAuthCookie" timeout="10" />
</authentication>
This makes the visitor logon automatically with their DOMAIN\username login which they used to logon to Windows. (Right?)
This works with my development server (http://localhost:xxxx), but not with my IIS server (http://localhost). Probably because the development server is 'started' by my local user (which has ActiveDirectory read-rights on the domain) and because IIS is 'started' by the IUSR_WORKSTATION user which does not. (Right?)
**If all of the above is true, how can I impersonate the IIS user (for instance to my own username) to solely authenticate the current user with the Windows login name?** (like the example below)?
**Or should the IUSR_WORKSTATION user be granted ActiveDirectory?** read-rights (not preferred as I will be switching servers / IUSR_ users a lot)
<identity impersonate="true" userName="DOMAIN\myuser" password="mypass"/>
<authentication mode="Windows">
<forms name=".ADAuthCookie" timeout="10" />
</authentication>
<identity impersonate="false"/> | 0 |
11,628,418 | 07/24/2012 09:58:09 | 1,548,233 | 07/24/2012 09:41:29 | 1 | 0 | GIT - Can't ignore .suo file | i'm trying to work using Git - Extension with a colleague, in an application written in C #.
We have been added on the file .gitignore the file "project1.suo" but every time one of us have to commit the project, Git seems tell us to commit the file "project1.suo".
we have try many method to add the file in .gitignore like that:
*.suo
project1.suo
c:\project\project1.suo
we cant fix this problem.
Someone can help?
Thanks in Advice | c# | null | null | null | null | null | open | GIT - Can't ignore .suo file
===
i'm trying to work using Git - Extension with a colleague, in an application written in C #.
We have been added on the file .gitignore the file "project1.suo" but every time one of us have to commit the project, Git seems tell us to commit the file "project1.suo".
we have try many method to add the file in .gitignore like that:
*.suo
project1.suo
c:\project\project1.suo
we cant fix this problem.
Someone can help?
Thanks in Advice | 0 |
6,328,970 | 06/13/2011 09:59:08 | 530,340 | 12/04/2010 10:20:09 | 193 | 1 | having problem storing data from sql queries into my own data structures | i am needed to fire certain sql queries (on a SQL Server 2008) and then collect this data and put it into my own data structures (like lists and Dictionary's) Can you show me how to do this. what will be the code to store the data from SELECT CURRENT_TIMESTAMP into a string ? Similarly if i have a sql query returning some record ; how can i convert this record into string format or int format data for further processing ?? i need to write an algorithm ; which will know how many records have been returned ; then it will accordingly proceed to store such records in appropriate fashion. Can you please give me a few pointers here ?? | c# | sql | sql-server | null | null | 06/13/2011 11:53:35 | not a real question | having problem storing data from sql queries into my own data structures
===
i am needed to fire certain sql queries (on a SQL Server 2008) and then collect this data and put it into my own data structures (like lists and Dictionary's) Can you show me how to do this. what will be the code to store the data from SELECT CURRENT_TIMESTAMP into a string ? Similarly if i have a sql query returning some record ; how can i convert this record into string format or int format data for further processing ?? i need to write an algorithm ; which will know how many records have been returned ; then it will accordingly proceed to store such records in appropriate fashion. Can you please give me a few pointers here ?? | 1 |
7,695,783 | 10/08/2011 08:56:41 | 887,020 | 08/10/2011 02:01:43 | 10 | 0 | Strange error using google maps tile server and Google Maps utility in PHP | I have a question regarding Map tile server and coordinates conversion in Google Maps using the Google Maps Utility library.
My tile server accesses a database with thousands of gps coordinates (lat,lng), and for every (lat,lng) point, checks if the point is inside the geographical bounds of the tile; if it does, coordinates conversion (WGS84 -> Mercator -> X,Y offset inside the tile) and paints the corresponding pixel inside the tile, using the GoogleMapsUtility Library.
In terms of code, I do the following:
$point = GoogleMapUtility::getOffsetPixelCoords((float)$row['lat'], (float)$row['lng'], $zoom, $X, $Y);
which calls the `getOffsetPixelCoords` function (and in turn the functions below) from the library:
public static function getOffsetPixelCoords($lat,$lng,$zoom, $X, $Y)
{
$pixelCoords = GoogleMapUtility::getPixelCoords($lat, $lng, $zoom);
return new Point(
$pixelCoords->x - $X * GoogleMapUtility::TILE_SIZE,
$pixelCoords->y - $Y * GoogleMapUtility::TILE_SIZE
);
}
public static function getPixelCoords($lat, $lng, $zoom)
{
$normalised = GoogleMapUtility::_toNormalisedMercatorCoords(GoogleMapUtility::_toMercatorCoords($lat, $lng));
$scale = (1 << ($zoom)) * GoogleMapUtility::TILE_SIZE;
return new Point(
(int)($normalised->x * $scale),
(int)($normalised->y * $scale)
);
}
private static function _toNormalisedMercatorCoords($point)
{
$point->x += 0.5;
$point->y = abs($point->y-0.5);
return $point;
}
Ok, now the results. For a zoom level<13 it works great, below is an example of a tile in Zoom level 11:
[Image1][1]
However, for a tile in zoom level >13, the following happens:
[Image2][2]
Which is so strange... the pixels seem to be perfectly aligned ? At first I thought it is a decimal resolution problem, but the resolution of the data is quite good (stored as double in a mysql database, for example, 35.6185989379883, 139.731994628906, and in php floats and doubles are the same thing...)
Could someone help me on how to fix this problem?
Thanks in advance...
[1]: http://i51.tinypic.com/fnfhas.jpg
[2]: http://i56.tinypic.com/2elysdk.png | php | overlay | tile | gmaps | null | null | open | Strange error using google maps tile server and Google Maps utility in PHP
===
I have a question regarding Map tile server and coordinates conversion in Google Maps using the Google Maps Utility library.
My tile server accesses a database with thousands of gps coordinates (lat,lng), and for every (lat,lng) point, checks if the point is inside the geographical bounds of the tile; if it does, coordinates conversion (WGS84 -> Mercator -> X,Y offset inside the tile) and paints the corresponding pixel inside the tile, using the GoogleMapsUtility Library.
In terms of code, I do the following:
$point = GoogleMapUtility::getOffsetPixelCoords((float)$row['lat'], (float)$row['lng'], $zoom, $X, $Y);
which calls the `getOffsetPixelCoords` function (and in turn the functions below) from the library:
public static function getOffsetPixelCoords($lat,$lng,$zoom, $X, $Y)
{
$pixelCoords = GoogleMapUtility::getPixelCoords($lat, $lng, $zoom);
return new Point(
$pixelCoords->x - $X * GoogleMapUtility::TILE_SIZE,
$pixelCoords->y - $Y * GoogleMapUtility::TILE_SIZE
);
}
public static function getPixelCoords($lat, $lng, $zoom)
{
$normalised = GoogleMapUtility::_toNormalisedMercatorCoords(GoogleMapUtility::_toMercatorCoords($lat, $lng));
$scale = (1 << ($zoom)) * GoogleMapUtility::TILE_SIZE;
return new Point(
(int)($normalised->x * $scale),
(int)($normalised->y * $scale)
);
}
private static function _toNormalisedMercatorCoords($point)
{
$point->x += 0.5;
$point->y = abs($point->y-0.5);
return $point;
}
Ok, now the results. For a zoom level<13 it works great, below is an example of a tile in Zoom level 11:
[Image1][1]
However, for a tile in zoom level >13, the following happens:
[Image2][2]
Which is so strange... the pixels seem to be perfectly aligned ? At first I thought it is a decimal resolution problem, but the resolution of the data is quite good (stored as double in a mysql database, for example, 35.6185989379883, 139.731994628906, and in php floats and doubles are the same thing...)
Could someone help me on how to fix this problem?
Thanks in advance...
[1]: http://i51.tinypic.com/fnfhas.jpg
[2]: http://i56.tinypic.com/2elysdk.png | 0 |
9,402,595 | 02/22/2012 20:42:54 | 468,312 | 10/06/2010 18:10:45 | 1,027 | 10 | Wordpress sort posts by custom meta in navigation | I'm sorting my posts by a custom meta value named "size".
$querystr = "
SELECT $wpdb->posts.*
FROM $wpdb->posts, $wpdb->postmeta
WHERE $wpdb->posts.ID = $wpdb->postmeta.post_id
AND $wpdb->postmeta.meta_key = 'size'
AND $wpdb->posts.post_status = 'publish'
AND $wpdb->posts.post_type = 'post'
AND $wpdb->posts.post_date < NOW()
ORDER BY $wpdb->postmeta.meta_value DESC
";
$pageposts = $wpdb->get_results($querystr, OBJECT);
if ($pageposts):
global $post;
foreach ($pageposts as $post):
setup_postdata($post);
the_title();
endforeach;
endif;
At the same time I'm using the WP-pagenavi plugin to navigate the posts by pages. I have 10 posts on each page.
The problem: Posts are sorted separately in each page. How can I sort all posts through all pages? | php | wordpress | custom-fields | null | null | null | open | Wordpress sort posts by custom meta in navigation
===
I'm sorting my posts by a custom meta value named "size".
$querystr = "
SELECT $wpdb->posts.*
FROM $wpdb->posts, $wpdb->postmeta
WHERE $wpdb->posts.ID = $wpdb->postmeta.post_id
AND $wpdb->postmeta.meta_key = 'size'
AND $wpdb->posts.post_status = 'publish'
AND $wpdb->posts.post_type = 'post'
AND $wpdb->posts.post_date < NOW()
ORDER BY $wpdb->postmeta.meta_value DESC
";
$pageposts = $wpdb->get_results($querystr, OBJECT);
if ($pageposts):
global $post;
foreach ($pageposts as $post):
setup_postdata($post);
the_title();
endforeach;
endif;
At the same time I'm using the WP-pagenavi plugin to navigate the posts by pages. I have 10 posts on each page.
The problem: Posts are sorted separately in each page. How can I sort all posts through all pages? | 0 |
9,586,754 | 03/06/2012 15:33:59 | 1,252,564 | 03/06/2012 15:24:41 | 1 | 0 | how remove watermarking from a flash gallery template | I have a flash gallery template and is watermarked with the name of the website created the template I need to use the template soon for my university camp photos to upload it in our website I'm not good in Adobe design stuff I tried to look for the way in how to get rid of the water mark but so far no result.
can somebody help please I need it soooon
I don't know what code to post here. just tell me the one u need and I'll post it for you
BTW here is the template I'm using "http://www.flashxml.net/image-grid.html"u can view it here.....and u see that watermark at the top left most corner I need to get rid of it>>>HOW? | xml | flash | templates | null | null | 03/07/2012 03:39:58 | off topic | how remove watermarking from a flash gallery template
===
I have a flash gallery template and is watermarked with the name of the website created the template I need to use the template soon for my university camp photos to upload it in our website I'm not good in Adobe design stuff I tried to look for the way in how to get rid of the water mark but so far no result.
can somebody help please I need it soooon
I don't know what code to post here. just tell me the one u need and I'll post it for you
BTW here is the template I'm using "http://www.flashxml.net/image-grid.html"u can view it here.....and u see that watermark at the top left most corner I need to get rid of it>>>HOW? | 2 |
5,819,003 | 04/28/2011 13:00:00 | 729,340 | 04/28/2011 13:00:00 | 1 | 0 | i want to know that how to insert data from more than one dropdownlists in to the single column of the database | linebreak add 2 spaces at end. | c# | null | null | null | null | 04/28/2011 15:24:31 | not a real question | i want to know that how to insert data from more than one dropdownlists in to the single column of the database
===
linebreak add 2 spaces at end. | 1 |
5,241,573 | 03/09/2011 05:03:17 | 576,605 | 01/15/2011 09:31:41 | 25 | 0 | draw travelling route on google maps | I have gone through all the suggested links n answers and have come to this stage wherein i am able to calculate distance but can not draw route, all i can get is a straight line between the last two points of the kml file here is my code.....kindly lemme know how can i overcome this as i have to draw the complete travelling route from source to destination
Code:
public class RoutePath extends MapActivity
{ GeoPoint gp1; GeoPoint gp2;
GeoPoint srcGeoPoint;
GeoPoint destGeoPoint;
double distance;
public class MyOverLay extends com.google.android.maps.Overlay
{
private int mRadius=6;
private int mode=0;
private int defaultColor;
public MyOverLay()
{
}
public MyOverLay(GeoPoint p1,GeoPoint p2,int mode) // GeoPoint is a int. (6E)
{
gp1 = p1;
gp2 = p2;
this.mode = mode;
defaultColor = 999; // no defaultColor
}
public MyOverLay(GeoPoint p1,GeoPoint p2,int mode, int defaultColor)
{
gp1 = p1;
gp2 = p2;
this.mode = mode;
this.defaultColor = defaultColor ;
}
public int getMode()
{
return mode;
}
@Override
public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when)
{
Projection projection = mapView.getProjection();
if (shadow == false)
{
Paint paint = new Paint();
paint.setAntiAlias(true);
Point point = new Point();
projection.toPixels(gp1, point);
// mode=1:start
if(mode==1)
{
if(defaultColor==999)
paint.setColor(Color.RED);
//Toast.makeText(getBaseContext(), "mode1", Toast.LENGTH_SHORT).show();
else
paint.setColor(defaultColor);
RectF oval=new RectF(point.x - mRadius, point.y - mRadius,point.x + mRadius, point.y + mRadius);
// start point
canvas.drawOval(oval, paint);
}
// mode=2:path
if(mode==2)
{
if(defaultColor==999)
paint.setColor(Color.RED);
//Toast.makeText(getBaseContext(), "mode2", Toast.LENGTH_SHORT).show();
else
paint.setColor(defaultColor);
Point point2 = new Point();
projection.toPixels(gp2, point2);
paint.setStrokeWidth(5);
paint.setAlpha(120);
canvas.drawLine(point.x, point.y, point2.x,point2.y, paint);
}
/* mode=3:end */
else if(mode==3)
{
//the last path
if(defaultColor==999)
{paint.setColor(Color.BLUE);
Toast.makeText(getBaseContext(), "mode3", Toast.LENGTH_SHORT).show();}
else
paint.setColor(defaultColor);
Point point2 = new Point();
projection.toPixels(gp2, point2);
paint.setStrokeWidth(5);
paint.setAlpha(120);
canvas.drawLine(point.x, point.y, point2.x,point2.y, paint);
RectF oval=new RectF(point2.x - mRadius,point2.y - mRadius,point2.x + mRadius,point2.y + mRadius);
paint.setAlpha(255);
canvas.drawOval(oval, paint);
}
}
return super.draw(canvas, mapView, shadow, when);
}
@Override
public boolean onTouchEvent(MotionEvent event, MapView mapView)
{
//---when user lifts his finger---
if (event.getAction() == 1)
{
GeoPoint destGeoPoint = mapView.getProjection().fromPixels(
(int) event.getX(),
(int) event.getY());
Toast.makeText(getBaseContext(),
destGeoPoint.getLatitudeE6() / 1E6 + "," +
destGeoPoint.getLongitudeE6() /1E6 ,
Toast.LENGTH_SHORT).show();
double src_lat = 19.0552; // the testing source
double src_long = 72.8308;
double dest_lat = destGeoPoint.getLatitudeE6() / 1E6; // the testing destination
double dest_long = destGeoPoint.getLongitudeE6() /1E6;
gp1 = new GeoPoint((int) (src_lat * 1E6),(int) (src_long * 1E6));
gp2 = new GeoPoint((int) (dest_lat * 1E6),(int) (dest_long * 1E6));
Geocoder geoCoder = new Geocoder(
getBaseContext(), Locale.getDefault());
try {
List<Address> addresses = geoCoder.getFromLocation(
gp2.getLatitudeE6() / 1E6,
gp2.getLongitudeE6() / 1E6, 1);
String add = "";
if (addresses.size() > 0)
{
for (int i=0; i<addresses.get(0).getMaxAddressLineIndex();
i++)
add += addresses.get(0).getAddressLine(i) + "\n";
}
Toast.makeText(getBaseContext(), add, Toast.LENGTH_SHORT).show();
DrawPath(gp1, gp2 , Color.GREEN, mapView);
}
catch (IOException e) {
e.printStackTrace();
}
return true;
}
else
return false;
}
}
/** Called when the activity is first created. */
MapView mapView;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
MapView mapView = (MapView) findViewById(R.id.myMapView1);
mapView.setBuiltInZoomControls(true);
double src_lat = 19.0552; // the testing source
double src_long = 72.8308;
gp1 = new GeoPoint(
(int) (src_lat * 1E6),
(int) (src_long * 1E6));
MyOverLay mapOverlay = new MyOverLay();
List<Overlay> listOfOverlays = mapView.getOverlays();
listOfOverlays.clear();
listOfOverlays.add(mapOverlay);
mapView.invalidate();
mapView.setSatellite(true);
mapView.getController().animateTo(gp1);
mapView.getController().setZoom(15);
}
@Override
protected boolean isRouteDisplayed()
{
// TODO Auto-generated method stub
return true;
}
private void DrawPath(GeoPoint src,GeoPoint dest, int color, MapView mMapView01)
{
double distance1=0;
// connect to map web service
StringBuilder urlString = new StringBuilder();
urlString.append("http://maps.google.com/maps?f=d&hl=en");
urlString.append("&saddr=");//from
urlString.append( Double.toString((double)src.getLatitudeE6()/1.0E6 ));
urlString.append(",");
urlString.append( Double.toString((double)src.getLongitudeE6()/1.0E6 ));
urlString.append("&daddr=");//to
urlString.append( Double.toString((double)dest.getLatitudeE6()/1.0E6 ));
urlString.append(",");
urlString.append( Double.toString((double)dest.getLongitudeE6()/1.0E6 ));
urlString.append("&ie=UTF8&0&om=0&output=kml");
Log.d("xxx","URL="+urlString.toString());
// get the kml (XML) doc. And parse it to get the coordinates(direction route).
Document doc = null;
HttpURLConnection urlConnection= null;
URL url = null;
try
{
url = new URL(urlString.toString());
urlConnection=(HttpURLConnection)url.openConnection();
urlConnection.setRequestMethod("GET");
urlConnection.setDoOutput(true);
urlConnection.setDoInput(true);
// Toast.makeText(getBaseContext(), "Before Connection", Toast.LENGTH_SHORT).show();
urlConnection.connect();
// Toast.makeText(getBaseContext(), "After Connection", Toast.LENGTH_SHORT).show();
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
doc = db.parse(urlConnection.getInputStream());
if(doc.getElementsByTagName("GeometryCollection").getLength()>0)
{
String path = doc.getElementsByTagName("GeometryCollection").item(0).getFirstChild().getFirstChild().getFirstChild().getNodeValue() ;
Log.d("xxx","path="+ path);
String [] pairs = path.split(" ");
String[] lngLat = pairs[0].split(","); // lngLat[0]=longitude lngLat[1]=latitude lngLat[2]=height
// src
GeoPoint startGP = new GeoPoint((int)(Double.parseDouble(lngLat[1])*1E6),(int)(Double.parseDouble(lngLat[0])*1E6));
//mMapView01.getOverlays().add(new MyOverLay(src,src,1));
GeoPoint gp1;
GeoPoint gp2 = startGP;
//Toast.makeText(getBaseContext(), "Before Connection", Toast.LENGTH_SHORT).show();
for(int i=1;i<pairs.length;i++) // the last one would be crash
{
Location locationA = new Location("Point A");
locationA.setLatitude(startGP.getLatitudeE6()/1E6);
locationA.setLongitude(startGP.getLongitudeE6()/1E6);
lngLat = pairs[i].split(",");
gp1 = gp2;
gp2 = new GeoPoint((int)(Double.parseDouble(lngLat[1])*1E6),(int)(Double.parseDouble(lngLat[0])*1E6));
mMapView01.getOverlays().add(new MyOverLay(gp1,gp2,2,color));
mMapView01.invalidate();
Location locationB = new Location("Point B");
locationB.setLatitude(gp2.getLatitudeE6()/1E6);
locationB.setLongitude(gp2.getLongitudeE6()/1E6);
distance1 = + locationA.distanceTo(locationB);
Log.d("xxx","pair:" + pairs[i]);
}
distance = distance1/1000;
if(distance<= 5.00)
{Toast.makeText(getBaseContext(), "DISTANCE = "+ distance, Toast.LENGTH_SHORT).show();}
else
{Toast.makeText(getBaseContext(), "Location out of range",Toast.LENGTH_SHORT).show();}
}
}
catch (MalformedURLException e)
{
e.printStackTrace();
}
catch (IOException e)
{
e.printStackTrace();
}
catch (ParserConfigurationException e)
{
e.printStackTrace();
}
catch (SAXException e)
{
e.printStackTrace();
}
} | android | google | null | null | null | 06/13/2011 13:07:28 | not a real question | draw travelling route on google maps
===
I have gone through all the suggested links n answers and have come to this stage wherein i am able to calculate distance but can not draw route, all i can get is a straight line between the last two points of the kml file here is my code.....kindly lemme know how can i overcome this as i have to draw the complete travelling route from source to destination
Code:
public class RoutePath extends MapActivity
{ GeoPoint gp1; GeoPoint gp2;
GeoPoint srcGeoPoint;
GeoPoint destGeoPoint;
double distance;
public class MyOverLay extends com.google.android.maps.Overlay
{
private int mRadius=6;
private int mode=0;
private int defaultColor;
public MyOverLay()
{
}
public MyOverLay(GeoPoint p1,GeoPoint p2,int mode) // GeoPoint is a int. (6E)
{
gp1 = p1;
gp2 = p2;
this.mode = mode;
defaultColor = 999; // no defaultColor
}
public MyOverLay(GeoPoint p1,GeoPoint p2,int mode, int defaultColor)
{
gp1 = p1;
gp2 = p2;
this.mode = mode;
this.defaultColor = defaultColor ;
}
public int getMode()
{
return mode;
}
@Override
public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when)
{
Projection projection = mapView.getProjection();
if (shadow == false)
{
Paint paint = new Paint();
paint.setAntiAlias(true);
Point point = new Point();
projection.toPixels(gp1, point);
// mode=1:start
if(mode==1)
{
if(defaultColor==999)
paint.setColor(Color.RED);
//Toast.makeText(getBaseContext(), "mode1", Toast.LENGTH_SHORT).show();
else
paint.setColor(defaultColor);
RectF oval=new RectF(point.x - mRadius, point.y - mRadius,point.x + mRadius, point.y + mRadius);
// start point
canvas.drawOval(oval, paint);
}
// mode=2:path
if(mode==2)
{
if(defaultColor==999)
paint.setColor(Color.RED);
//Toast.makeText(getBaseContext(), "mode2", Toast.LENGTH_SHORT).show();
else
paint.setColor(defaultColor);
Point point2 = new Point();
projection.toPixels(gp2, point2);
paint.setStrokeWidth(5);
paint.setAlpha(120);
canvas.drawLine(point.x, point.y, point2.x,point2.y, paint);
}
/* mode=3:end */
else if(mode==3)
{
//the last path
if(defaultColor==999)
{paint.setColor(Color.BLUE);
Toast.makeText(getBaseContext(), "mode3", Toast.LENGTH_SHORT).show();}
else
paint.setColor(defaultColor);
Point point2 = new Point();
projection.toPixels(gp2, point2);
paint.setStrokeWidth(5);
paint.setAlpha(120);
canvas.drawLine(point.x, point.y, point2.x,point2.y, paint);
RectF oval=new RectF(point2.x - mRadius,point2.y - mRadius,point2.x + mRadius,point2.y + mRadius);
paint.setAlpha(255);
canvas.drawOval(oval, paint);
}
}
return super.draw(canvas, mapView, shadow, when);
}
@Override
public boolean onTouchEvent(MotionEvent event, MapView mapView)
{
//---when user lifts his finger---
if (event.getAction() == 1)
{
GeoPoint destGeoPoint = mapView.getProjection().fromPixels(
(int) event.getX(),
(int) event.getY());
Toast.makeText(getBaseContext(),
destGeoPoint.getLatitudeE6() / 1E6 + "," +
destGeoPoint.getLongitudeE6() /1E6 ,
Toast.LENGTH_SHORT).show();
double src_lat = 19.0552; // the testing source
double src_long = 72.8308;
double dest_lat = destGeoPoint.getLatitudeE6() / 1E6; // the testing destination
double dest_long = destGeoPoint.getLongitudeE6() /1E6;
gp1 = new GeoPoint((int) (src_lat * 1E6),(int) (src_long * 1E6));
gp2 = new GeoPoint((int) (dest_lat * 1E6),(int) (dest_long * 1E6));
Geocoder geoCoder = new Geocoder(
getBaseContext(), Locale.getDefault());
try {
List<Address> addresses = geoCoder.getFromLocation(
gp2.getLatitudeE6() / 1E6,
gp2.getLongitudeE6() / 1E6, 1);
String add = "";
if (addresses.size() > 0)
{
for (int i=0; i<addresses.get(0).getMaxAddressLineIndex();
i++)
add += addresses.get(0).getAddressLine(i) + "\n";
}
Toast.makeText(getBaseContext(), add, Toast.LENGTH_SHORT).show();
DrawPath(gp1, gp2 , Color.GREEN, mapView);
}
catch (IOException e) {
e.printStackTrace();
}
return true;
}
else
return false;
}
}
/** Called when the activity is first created. */
MapView mapView;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
MapView mapView = (MapView) findViewById(R.id.myMapView1);
mapView.setBuiltInZoomControls(true);
double src_lat = 19.0552; // the testing source
double src_long = 72.8308;
gp1 = new GeoPoint(
(int) (src_lat * 1E6),
(int) (src_long * 1E6));
MyOverLay mapOverlay = new MyOverLay();
List<Overlay> listOfOverlays = mapView.getOverlays();
listOfOverlays.clear();
listOfOverlays.add(mapOverlay);
mapView.invalidate();
mapView.setSatellite(true);
mapView.getController().animateTo(gp1);
mapView.getController().setZoom(15);
}
@Override
protected boolean isRouteDisplayed()
{
// TODO Auto-generated method stub
return true;
}
private void DrawPath(GeoPoint src,GeoPoint dest, int color, MapView mMapView01)
{
double distance1=0;
// connect to map web service
StringBuilder urlString = new StringBuilder();
urlString.append("http://maps.google.com/maps?f=d&hl=en");
urlString.append("&saddr=");//from
urlString.append( Double.toString((double)src.getLatitudeE6()/1.0E6 ));
urlString.append(",");
urlString.append( Double.toString((double)src.getLongitudeE6()/1.0E6 ));
urlString.append("&daddr=");//to
urlString.append( Double.toString((double)dest.getLatitudeE6()/1.0E6 ));
urlString.append(",");
urlString.append( Double.toString((double)dest.getLongitudeE6()/1.0E6 ));
urlString.append("&ie=UTF8&0&om=0&output=kml");
Log.d("xxx","URL="+urlString.toString());
// get the kml (XML) doc. And parse it to get the coordinates(direction route).
Document doc = null;
HttpURLConnection urlConnection= null;
URL url = null;
try
{
url = new URL(urlString.toString());
urlConnection=(HttpURLConnection)url.openConnection();
urlConnection.setRequestMethod("GET");
urlConnection.setDoOutput(true);
urlConnection.setDoInput(true);
// Toast.makeText(getBaseContext(), "Before Connection", Toast.LENGTH_SHORT).show();
urlConnection.connect();
// Toast.makeText(getBaseContext(), "After Connection", Toast.LENGTH_SHORT).show();
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
doc = db.parse(urlConnection.getInputStream());
if(doc.getElementsByTagName("GeometryCollection").getLength()>0)
{
String path = doc.getElementsByTagName("GeometryCollection").item(0).getFirstChild().getFirstChild().getFirstChild().getNodeValue() ;
Log.d("xxx","path="+ path);
String [] pairs = path.split(" ");
String[] lngLat = pairs[0].split(","); // lngLat[0]=longitude lngLat[1]=latitude lngLat[2]=height
// src
GeoPoint startGP = new GeoPoint((int)(Double.parseDouble(lngLat[1])*1E6),(int)(Double.parseDouble(lngLat[0])*1E6));
//mMapView01.getOverlays().add(new MyOverLay(src,src,1));
GeoPoint gp1;
GeoPoint gp2 = startGP;
//Toast.makeText(getBaseContext(), "Before Connection", Toast.LENGTH_SHORT).show();
for(int i=1;i<pairs.length;i++) // the last one would be crash
{
Location locationA = new Location("Point A");
locationA.setLatitude(startGP.getLatitudeE6()/1E6);
locationA.setLongitude(startGP.getLongitudeE6()/1E6);
lngLat = pairs[i].split(",");
gp1 = gp2;
gp2 = new GeoPoint((int)(Double.parseDouble(lngLat[1])*1E6),(int)(Double.parseDouble(lngLat[0])*1E6));
mMapView01.getOverlays().add(new MyOverLay(gp1,gp2,2,color));
mMapView01.invalidate();
Location locationB = new Location("Point B");
locationB.setLatitude(gp2.getLatitudeE6()/1E6);
locationB.setLongitude(gp2.getLongitudeE6()/1E6);
distance1 = + locationA.distanceTo(locationB);
Log.d("xxx","pair:" + pairs[i]);
}
distance = distance1/1000;
if(distance<= 5.00)
{Toast.makeText(getBaseContext(), "DISTANCE = "+ distance, Toast.LENGTH_SHORT).show();}
else
{Toast.makeText(getBaseContext(), "Location out of range",Toast.LENGTH_SHORT).show();}
}
}
catch (MalformedURLException e)
{
e.printStackTrace();
}
catch (IOException e)
{
e.printStackTrace();
}
catch (ParserConfigurationException e)
{
e.printStackTrace();
}
catch (SAXException e)
{
e.printStackTrace();
}
} | 1 |
10,308,094 | 04/25/2012 01:10:33 | 1,355,021 | 04/25/2012 01:07:28 | 1 | 0 | Simple regex expression needed | Should be simple and unfortunately I don't really need to learn Regex, it's just one of those occasions..
What is the expression to find something like this: wordhere_478234828
where the numbers could be random, but the word is always the same?
| regex | null | null | null | null | 04/25/2012 02:38:27 | not a real question | Simple regex expression needed
===
Should be simple and unfortunately I don't really need to learn Regex, it's just one of those occasions..
What is the expression to find something like this: wordhere_478234828
where the numbers could be random, but the word is always the same?
| 1 |
10,407,785 | 05/02/2012 04:34:44 | 1,011,816 | 10/24/2011 23:13:35 | 438 | 1 | Why does CSS styling distort my Google maps zooming? | Here is a working version
http://jsfiddle.net/tH78C/
Here is a broken version (Zooming widget is no longer properly displayed) with Bootstrap styling
http://jsfiddle.net/3sjAU/
Why does it break? | html | css | google-maps | twitter-bootstrap | null | null | open | Why does CSS styling distort my Google maps zooming?
===
Here is a working version
http://jsfiddle.net/tH78C/
Here is a broken version (Zooming widget is no longer properly displayed) with Bootstrap styling
http://jsfiddle.net/3sjAU/
Why does it break? | 0 |
11,008,212 | 06/13/2012 04:27:59 | 1,153,739 | 01/17/2012 10:52:05 | 56 | 5 | Fundamentals of Deserialization in .NET? | I have been working with XML for past couple of months with .NET
Basically all the work I do involve XML in oneway of another so I thought it would be good to learn the serialization and deserialization part of the game.
My work mostly involves the 'Deserialization' part of it. Almost every time I have an XML file which has to be used by the application that I write.
An object form of the XML is the best way to use.
Now initially the XML was very straight forward, just a couple of tags which would translate into a class very easily using XSD.exe tool.
Things grew a bit complex with nesting of tags and I found Xsd2Code gen tool work fine. During this whole process I have been able to do my work with a lot of help from Stackoverflow community, thanks for that, but I think I have missed the forest for the trees.
I need to know how Deserialization works in .NET
Fundamentally, I would like to know what happens behind the scenes in taking a XML and converting it into a usable object. Code samples have helped me in the past, and as mentioned earlier the problem get's solved but the learning does not happen.
So, if anyone can guide to resources that can get me started on the Deserialization part of the game, I would be thankful to them.
Regards.
| c# | .net | deserialization | null | null | 06/13/2012 04:39:55 | not constructive | Fundamentals of Deserialization in .NET?
===
I have been working with XML for past couple of months with .NET
Basically all the work I do involve XML in oneway of another so I thought it would be good to learn the serialization and deserialization part of the game.
My work mostly involves the 'Deserialization' part of it. Almost every time I have an XML file which has to be used by the application that I write.
An object form of the XML is the best way to use.
Now initially the XML was very straight forward, just a couple of tags which would translate into a class very easily using XSD.exe tool.
Things grew a bit complex with nesting of tags and I found Xsd2Code gen tool work fine. During this whole process I have been able to do my work with a lot of help from Stackoverflow community, thanks for that, but I think I have missed the forest for the trees.
I need to know how Deserialization works in .NET
Fundamentally, I would like to know what happens behind the scenes in taking a XML and converting it into a usable object. Code samples have helped me in the past, and as mentioned earlier the problem get's solved but the learning does not happen.
So, if anyone can guide to resources that can get me started on the Deserialization part of the game, I would be thankful to them.
Regards.
| 4 |
10,392,247 | 05/01/2012 00:42:08 | 98,145 | 04/30/2009 00:58:43 | 892 | 14 | Functional language equivalent to Codeacademy? | Is there anything like Codeacademy for a functional language? I'm particularly interested in Lisp, Clojure, Scala and Haskel. | functional-programming | education | null | null | null | 05/03/2012 08:07:45 | off topic | Functional language equivalent to Codeacademy?
===
Is there anything like Codeacademy for a functional language? I'm particularly interested in Lisp, Clojure, Scala and Haskel. | 2 |
11,138,839 | 06/21/2012 13:06:33 | 1,111,452 | 12/22/2011 09:38:58 | 40 | 2 | Regex for telephone number in ITU format | I want to validate the phone number only in ITU format like +xx xxxxxxxxxx only any help will be
greatly appreciated
thanks | javascript | regex | regular-language | null | null | 07/06/2012 22:16:35 | not a real question | Regex for telephone number in ITU format
===
I want to validate the phone number only in ITU format like +xx xxxxxxxxxx only any help will be
greatly appreciated
thanks | 1 |
1,377,807 | 09/04/2009 07:56:50 | 125,540 | 06/19/2009 05:05:09 | 9 | 1 | How to generate a flat map of earth with day/night highlighting? | Does anybody know of an easy-to-use, FOSS equivalent of the program generating this 'live' [colored, earth map][1].
Alternatively, equally appreciated would be enough pointers on the logic, API, and data to use to write such a program on my own in Java or C?
**What I Basically Want**
1. I need to be able to generate a picture for my space-time coordinates (not very far away from the Earth).
2. I'm hoping that this program will have a dependency NEITHER on a large/online database of images, NOR on a live satellite feed, and would instead be able to work off of an in-memory (or on-disk) colored map of Earth with projection and day-/night-highlighting calculations for creating the desired image.
3. The program should be able to run on Linux. Could be in Java, C, or any other portable/cross-platform language.
4. The program should (ideally) be able to run in offline mode... without using the Internet, that is.
[1]: http://www.fourmilab.ch/cgi-bin/Earth?opt=-p. | flat | map | earth | null | null | 06/06/2012 19:00:11 | not constructive | How to generate a flat map of earth with day/night highlighting?
===
Does anybody know of an easy-to-use, FOSS equivalent of the program generating this 'live' [colored, earth map][1].
Alternatively, equally appreciated would be enough pointers on the logic, API, and data to use to write such a program on my own in Java or C?
**What I Basically Want**
1. I need to be able to generate a picture for my space-time coordinates (not very far away from the Earth).
2. I'm hoping that this program will have a dependency NEITHER on a large/online database of images, NOR on a live satellite feed, and would instead be able to work off of an in-memory (or on-disk) colored map of Earth with projection and day-/night-highlighting calculations for creating the desired image.
3. The program should be able to run on Linux. Could be in Java, C, or any other portable/cross-platform language.
4. The program should (ideally) be able to run in offline mode... without using the Internet, that is.
[1]: http://www.fourmilab.ch/cgi-bin/Earth?opt=-p. | 4 |
3,083,405 | 06/21/2010 09:23:35 | 372,005 | 06/21/2010 09:12:56 | 1 | 0 | CodeIgniter / Xinha ImageManager not uploading images | I'm using the Xinha text editor in a CodeIgniter project, and normally it works very well, but this has got me stumped.
When I click the ImageManager icon in the Xinha, it loads the dialog box as usual, and allows me to upload an image. Within the editor, it shows that my image is uploaded, yet when I look directly at the directory using FTP it isn't there. Also, as the image is being inserted with the text, the reference to the image appears, but the image itself doesn't.
The dialog box shows the correct directory, and (according to my web host) the security on the folders is correct. (It's a Linux based server, and the permissions on the folder are 755. I've been told not to use 777 and the files should upload ok anyway).
So, any ideas? There's no actual code to show, as it's done through the Xinha plugin, though I can copy the PHP config files if that'll help.
Thanks,
Adrian | codeigniter | null | null | null | null | null | open | CodeIgniter / Xinha ImageManager not uploading images
===
I'm using the Xinha text editor in a CodeIgniter project, and normally it works very well, but this has got me stumped.
When I click the ImageManager icon in the Xinha, it loads the dialog box as usual, and allows me to upload an image. Within the editor, it shows that my image is uploaded, yet when I look directly at the directory using FTP it isn't there. Also, as the image is being inserted with the text, the reference to the image appears, but the image itself doesn't.
The dialog box shows the correct directory, and (according to my web host) the security on the folders is correct. (It's a Linux based server, and the permissions on the folder are 755. I've been told not to use 777 and the files should upload ok anyway).
So, any ideas? There's no actual code to show, as it's done through the Xinha plugin, though I can copy the PHP config files if that'll help.
Thanks,
Adrian | 0 |
6,724,783 | 07/17/2011 15:22:06 | 604,843 | 02/05/2011 23:48:02 | 504 | 1 | php: redirect() !!?? | This is not a request for a solution, but just to clarify something.
When I do a redirect in php I use header()
but while going through someone else's class code I came across this:
// Redirect to target
redirect(proxifyURL($url, 'norefer'));
What the heck is that? And php does not seem to be throwing an error.
I tried looking it up by going to php.net/redirect
but it shows me the header function that I usually use, not this redirect() !!??
Can someone explain this to me please? | php | redirect | null | null | null | null | open | php: redirect() !!??
===
This is not a request for a solution, but just to clarify something.
When I do a redirect in php I use header()
but while going through someone else's class code I came across this:
// Redirect to target
redirect(proxifyURL($url, 'norefer'));
What the heck is that? And php does not seem to be throwing an error.
I tried looking it up by going to php.net/redirect
but it shows me the header function that I usually use, not this redirect() !!??
Can someone explain this to me please? | 0 |
1,595,806 | 10/20/2009 16:19:17 | 193,237 | 10/20/2009 16:19:17 | 1 | 0 | Read a single registry key value on a remote machine using python 3 | I am having a very tough time achieving this one seemingly very simple goal...
I have to gather the value of a single registry key on several machines for the sake of auditing whether the machines scanned need to be patched with newer versions of software. I am only permitted to use python 3 as per our company policy (which is on drugs, but what can i do).
i have been looking into using the winreg module to connect to the remote machine (using credentials, we are on a domain) but I am confronted time and again with
>TypeError: The object is not a PyHKEY object
(or a number of other issues.)
this seems like a very common need and i've been surprised at the difficulty i have had finding any examples for python 3 that i can use to figure out what I'm doing wrong.
Any assistance that anyone would be kind enough to give would be greatly appreciated. Thanks in advance. | python | remote-registry | winreg | windows | null | null | open | Read a single registry key value on a remote machine using python 3
===
I am having a very tough time achieving this one seemingly very simple goal...
I have to gather the value of a single registry key on several machines for the sake of auditing whether the machines scanned need to be patched with newer versions of software. I am only permitted to use python 3 as per our company policy (which is on drugs, but what can i do).
i have been looking into using the winreg module to connect to the remote machine (using credentials, we are on a domain) but I am confronted time and again with
>TypeError: The object is not a PyHKEY object
(or a number of other issues.)
this seems like a very common need and i've been surprised at the difficulty i have had finding any examples for python 3 that i can use to figure out what I'm doing wrong.
Any assistance that anyone would be kind enough to give would be greatly appreciated. Thanks in advance. | 0 |
6,984,297 | 08/08/2011 15:12:09 | 846,224 | 07/15/2011 10:06:55 | 6 | 0 | $_FILES array is not working properly | Hi guys actually I want to create an application in which I have to create undefined numbers of file type controle.And I have created this thing but I am unable to find the temporary pathof that file.$_FILES[][] is also not working properly.So please help me by providing relevent information. | php | javascript | html | null | null | 08/08/2011 15:14:51 | not a real question | $_FILES array is not working properly
===
Hi guys actually I want to create an application in which I have to create undefined numbers of file type controle.And I have created this thing but I am unable to find the temporary pathof that file.$_FILES[][] is also not working properly.So please help me by providing relevent information. | 1 |
4,128,153 | 11/08/2010 21:17:34 | 810,896 | 11/08/2010 21:17:34 | 1 | 0 | Can't access hadoop web ui for job tracker | I'm trying to set up hadoop and nutch to run on EC2. To get started, I have followed the excellent <a href="http://wiki.apache.org/nutch/NutchHadoopTutorial">NutchHadoopTutorial</a>. Most everything works as it should, except that I am unable to access any of the web interfaces (e.g. JobTracker). The JobTracker starts without errors, and I can hit nutch-master:50030, however I'm getting what looks like jetty's default servlet, which returns a link to the webapps directory, and then from there a job directory, and then a link to nutch-master:50030/webapps/job/jobtracker.jsp -- which in turn returns a 404 for RequestURI=/webapps/job/jobtracker.jsp. I've checked the classpath, and everything that is supposed to be there is in fact available:
/usr/lib/jvm/java-6-openjdk/bin/java -Xmx1000m -Dhadoop.log.dir=/nutch/search/logs -Dhadoop.log.file=hadoop-nutch-jobtracker-nutch-master.log -Dhadoop.home.dir=/nutch/search -Dhadoop.id.str=nutch -Dhadoop.root.logger=INFO,DRFA -Djava.library.path=/nutch/search/lib/native/Linux-i386-32 -Dhadoop.policy.file=hadoop-policy.xml -classpath /nutch/search/bin/../conf:/usr/lib/jvm/java-6-openjdk/lib/tools.jar:/nutch/search/hadoop-0.20.2-core.jar:/nutch/search/lib/apache-solr-core-1.4.0.jar:/nutch/search/lib/apache-solr-solrj-1.4.0.jar:/nutch/search/lib/commons-beanutils-1.8.0.jar:/nutch/search/lib/commons-cli-1.2.jar:/nutch/search/lib/commons-codec-1.3.jar:/nutch/search/lib/commons-collections-3.2.1.jar:/nutch/search/lib/commons-el-1.0.jar:/nutch/search/lib/commons-httpclient-3.1.jar:/nutch/search/lib/commons-io-1.4.jar:/nutch/search/lib/commons-lang-2.1.jar:/nutch/search/lib/commons-logging-1.0.4.jar:/nutch/search/lib/commons-logging-api-1.0.4.jar:/nutch/search/lib/commons-net-1.4.1.jar:/nutch/search/lib/core-3.1.1.jar:/nutch/search/lib/geronimo-stax-api_1.0_spec-1.0.1.jar:/nutch/search/lib/hadoop-0.20.2-core.jar:/nutch/search/lib/hadoop-0.20.2-tools.jar:/nutch/search/lib/hsqldb-1.8.0.10.jar:/nutch/search/lib/icu4j-4_0_1.jar:/nutch/search/lib/jakarta-oro-2.0.8.jar:/nutch/search/lib/jasper-compiler-5.5.12.jar:/nutch/search/lib/jasper-runtime-5.5.12.jar:/nutch/search/lib/jcl-over-slf4j-1.5.5.jar:/nutch/search/lib/jets3t-0.6.1.jar:/nutch/search/lib/jetty-6.1.14.jar:/nutch/search/lib/jetty-util-6.1.14.jar:/nutch/search/lib/junit-3.8.1.jar:/nutch/search/lib/kfs-0.2.2.jar:/nutch/search/lib/log4j-1.2.15.jar:/nutch/search/lib/lucene-core-3.0.1.jar:/nutch/search/lib/lucene-misc-3.0.1.jar:/nutch/search/lib/oro-2.0.8.jar:/nutch/search/lib/resolver.jar:/nutch/search/lib/serializer.jar:/nutch/search/lib/servlet-api-2.5-6.1.14.jar:/nutch/search/lib/slf4j-api-1.5.5.jar:/nutch/search/lib/slf4j-log4j12-1.4.3.jar:/nutch/search/lib/taglibs-i18n.jar:/nutch/search/lib/tika-core-0.7.jar:/nutch/search/lib/wstx-asl-3.2.7.jar:/nutch/search/lib/xercesImpl.jar:/nutch/search/lib/xml-apis.jar:/nutch/search/lib/xmlenc-0.52.jar:/nutch/search/lib/jsp-2.1/jsp-2.1.jar:/nutch/search/lib/jsp-2.1/jsp-api-2.1.jar org.apache.hadoop.mapred.JobTracker
I've been googling and trying different things for about 8 hours now, and I'm just absolutely stuck as to what might be wrong. I'm sure it's something painfully obvious that I'm overlooking. Does anyone have any idea?
A few more details: this is a three node cluster on EC2, I can ssh w/out a password between each, and the nodes seem to be communicating w/out issue (ie no exceptions in logs). They are all ubuntu 10.04 server. Hadoop 0.20.2.
Thanks in advance.
| jobs | jetty | hadoop | nutch | tracker | 05/17/2012 19:42:02 | too localized | Can't access hadoop web ui for job tracker
===
I'm trying to set up hadoop and nutch to run on EC2. To get started, I have followed the excellent <a href="http://wiki.apache.org/nutch/NutchHadoopTutorial">NutchHadoopTutorial</a>. Most everything works as it should, except that I am unable to access any of the web interfaces (e.g. JobTracker). The JobTracker starts without errors, and I can hit nutch-master:50030, however I'm getting what looks like jetty's default servlet, which returns a link to the webapps directory, and then from there a job directory, and then a link to nutch-master:50030/webapps/job/jobtracker.jsp -- which in turn returns a 404 for RequestURI=/webapps/job/jobtracker.jsp. I've checked the classpath, and everything that is supposed to be there is in fact available:
/usr/lib/jvm/java-6-openjdk/bin/java -Xmx1000m -Dhadoop.log.dir=/nutch/search/logs -Dhadoop.log.file=hadoop-nutch-jobtracker-nutch-master.log -Dhadoop.home.dir=/nutch/search -Dhadoop.id.str=nutch -Dhadoop.root.logger=INFO,DRFA -Djava.library.path=/nutch/search/lib/native/Linux-i386-32 -Dhadoop.policy.file=hadoop-policy.xml -classpath /nutch/search/bin/../conf:/usr/lib/jvm/java-6-openjdk/lib/tools.jar:/nutch/search/hadoop-0.20.2-core.jar:/nutch/search/lib/apache-solr-core-1.4.0.jar:/nutch/search/lib/apache-solr-solrj-1.4.0.jar:/nutch/search/lib/commons-beanutils-1.8.0.jar:/nutch/search/lib/commons-cli-1.2.jar:/nutch/search/lib/commons-codec-1.3.jar:/nutch/search/lib/commons-collections-3.2.1.jar:/nutch/search/lib/commons-el-1.0.jar:/nutch/search/lib/commons-httpclient-3.1.jar:/nutch/search/lib/commons-io-1.4.jar:/nutch/search/lib/commons-lang-2.1.jar:/nutch/search/lib/commons-logging-1.0.4.jar:/nutch/search/lib/commons-logging-api-1.0.4.jar:/nutch/search/lib/commons-net-1.4.1.jar:/nutch/search/lib/core-3.1.1.jar:/nutch/search/lib/geronimo-stax-api_1.0_spec-1.0.1.jar:/nutch/search/lib/hadoop-0.20.2-core.jar:/nutch/search/lib/hadoop-0.20.2-tools.jar:/nutch/search/lib/hsqldb-1.8.0.10.jar:/nutch/search/lib/icu4j-4_0_1.jar:/nutch/search/lib/jakarta-oro-2.0.8.jar:/nutch/search/lib/jasper-compiler-5.5.12.jar:/nutch/search/lib/jasper-runtime-5.5.12.jar:/nutch/search/lib/jcl-over-slf4j-1.5.5.jar:/nutch/search/lib/jets3t-0.6.1.jar:/nutch/search/lib/jetty-6.1.14.jar:/nutch/search/lib/jetty-util-6.1.14.jar:/nutch/search/lib/junit-3.8.1.jar:/nutch/search/lib/kfs-0.2.2.jar:/nutch/search/lib/log4j-1.2.15.jar:/nutch/search/lib/lucene-core-3.0.1.jar:/nutch/search/lib/lucene-misc-3.0.1.jar:/nutch/search/lib/oro-2.0.8.jar:/nutch/search/lib/resolver.jar:/nutch/search/lib/serializer.jar:/nutch/search/lib/servlet-api-2.5-6.1.14.jar:/nutch/search/lib/slf4j-api-1.5.5.jar:/nutch/search/lib/slf4j-log4j12-1.4.3.jar:/nutch/search/lib/taglibs-i18n.jar:/nutch/search/lib/tika-core-0.7.jar:/nutch/search/lib/wstx-asl-3.2.7.jar:/nutch/search/lib/xercesImpl.jar:/nutch/search/lib/xml-apis.jar:/nutch/search/lib/xmlenc-0.52.jar:/nutch/search/lib/jsp-2.1/jsp-2.1.jar:/nutch/search/lib/jsp-2.1/jsp-api-2.1.jar org.apache.hadoop.mapred.JobTracker
I've been googling and trying different things for about 8 hours now, and I'm just absolutely stuck as to what might be wrong. I'm sure it's something painfully obvious that I'm overlooking. Does anyone have any idea?
A few more details: this is a three node cluster on EC2, I can ssh w/out a password between each, and the nodes seem to be communicating w/out issue (ie no exceptions in logs). They are all ubuntu 10.04 server. Hadoop 0.20.2.
Thanks in advance.
| 3 |
7,401,495 | 09/13/2011 11:59:38 | 942,009 | 09/13/2011 07:24:45 | 1 | 0 | How to display placeholder's text in HTML5's number-typed input | Is there a way I can show placeholder text inside an input tag of type=number?
Detailed Q:
The property 'placeholder' of an HTML's input tag is used to show description about the input tag in the UI when the element is not focused - the descriptive text goes blank when the same field gets focus. The problem is no text is visible if the input type is made of type="number". I do have space limitations in my UI and cannot afford a label before the input tag.
Any suggestions? | html | input | placeholder | null | null | null | open | How to display placeholder's text in HTML5's number-typed input
===
Is there a way I can show placeholder text inside an input tag of type=number?
Detailed Q:
The property 'placeholder' of an HTML's input tag is used to show description about the input tag in the UI when the element is not focused - the descriptive text goes blank when the same field gets focus. The problem is no text is visible if the input type is made of type="number". I do have space limitations in my UI and cannot afford a label before the input tag.
Any suggestions? | 0 |
24,045 | 08/23/2008 06:42:01 | 163 | 08/02/2008 20:40:09 | 77 | 8 | AnkhSVN versus VisualSVN | I currently use AnkhSVN to integrate subversion into Visual Studio. Is there any reason I should switch to VisualSVN?
AnkhSVN is free (in more than one sense of the word) while VisualSVN costs $50. So right there unless I'm missing some great feature of VisualSVN I don't see any reason to switch. | subversion | visual-studio | ankhsvn | visualsvn | null | 07/18/2012 12:04:19 | not constructive | AnkhSVN versus VisualSVN
===
I currently use AnkhSVN to integrate subversion into Visual Studio. Is there any reason I should switch to VisualSVN?
AnkhSVN is free (in more than one sense of the word) while VisualSVN costs $50. So right there unless I'm missing some great feature of VisualSVN I don't see any reason to switch. | 4 |
10,812,765 | 05/30/2012 08:37:00 | 998,704 | 10/17/2011 07:35:23 | 6 | 0 | paypal reseller | Hello I'd like to set up a web application that will use paypal as payment method.
I want that my application works as reseller. I will post on my website goods of third parties and sell them to consumers.
I'd like only to keep a fee on the transaction and just forward the money to the companyowner of the good.
Actually I'm missing two concepts:
- how these kind of transaction are performed: if the money are sent to the reseller account then on every transaction the amount-fee% will be forward to the seller. Or if the money are sent directly to the seller and he will payback my company the fee.
- is paypal offering a built in solution like reseller account.
Any comment and any link to some tutorial/ guide/doc, will be well accept.
Many thanks | paypal | reseller | null | null | null | null | open | paypal reseller
===
Hello I'd like to set up a web application that will use paypal as payment method.
I want that my application works as reseller. I will post on my website goods of third parties and sell them to consumers.
I'd like only to keep a fee on the transaction and just forward the money to the companyowner of the good.
Actually I'm missing two concepts:
- how these kind of transaction are performed: if the money are sent to the reseller account then on every transaction the amount-fee% will be forward to the seller. Or if the money are sent directly to the seller and he will payback my company the fee.
- is paypal offering a built in solution like reseller account.
Any comment and any link to some tutorial/ guide/doc, will be well accept.
Many thanks | 0 |
10,655,221 | 05/18/2012 15:13:33 | 30,512 | 10/22/2008 19:44:43 | 1,607 | 98 | Multiple matching substring selectors | I'm trying to create a rule to match all classes beginning with `icon-` which also have the `btn` class. `[class^="icon-"] {` matches the first condition, but how do I add "that also have the .btn class? | css | css3 | css-selectors | null | null | null | open | Multiple matching substring selectors
===
I'm trying to create a rule to match all classes beginning with `icon-` which also have the `btn` class. `[class^="icon-"] {` matches the first condition, but how do I add "that also have the .btn class? | 0 |
9,529,481 | 03/02/2012 07:21:59 | 585,101 | 01/21/2011 21:46:19 | 1,043 | 75 | How to implement different attributes sharing one element with sass? | I have the following code:
ul.post, ul.user_profile {
/* this attributes are the same for both classes */
margin-top: 1em;
list-style: none;
padding-bottom: 20px;
border-bottom: 1px solid #CCC;
/* how to implement different attributes for ul.user_profile li.minithumb here? */
/* this for ul.user_profile */
li.minithumb {
float: right;
margin: 0 auto;
}
/* this for ul.post */
li.minithumb {
float: left;
margin-right: 20px;
span.feed_post_image_not_found {
width: 80px;
height: 55px;
color: #333;
font-size: 20%;
padding-top: 25px;
text-align: center;
display: block;
background-color: $lightgray;
}
}
| css | sass | null | null | null | null | open | How to implement different attributes sharing one element with sass?
===
I have the following code:
ul.post, ul.user_profile {
/* this attributes are the same for both classes */
margin-top: 1em;
list-style: none;
padding-bottom: 20px;
border-bottom: 1px solid #CCC;
/* how to implement different attributes for ul.user_profile li.minithumb here? */
/* this for ul.user_profile */
li.minithumb {
float: right;
margin: 0 auto;
}
/* this for ul.post */
li.minithumb {
float: left;
margin-right: 20px;
span.feed_post_image_not_found {
width: 80px;
height: 55px;
color: #333;
font-size: 20%;
padding-top: 25px;
text-align: center;
display: block;
background-color: $lightgray;
}
}
| 0 |
4,499,928 | 12/21/2010 13:50:00 | 413,770 | 08/07/2010 10:34:36 | 49 | 3 | android mediaplayer bacgroung loading | how can i load a file into mediaplayer while showing a splash screen in the foregroung ,i mean after splash sceen i want to display video on the screen directly without wait | android | null | null | null | null | null | open | android mediaplayer bacgroung loading
===
how can i load a file into mediaplayer while showing a splash screen in the foregroung ,i mean after splash sceen i want to display video on the screen directly without wait | 0 |
8,018,217 | 11/05/2011 04:37:45 | 1,030,755 | 11/05/2011 04:33:13 | 1 | 0 | How to create a data model for a boat? | How would one create a model for a boat in javascript that exists as a grid reference in a cartesian plane?
I would like to learn javascript by creating clone of the popular game Battleship!
To this end I need assistance in my quest to start programming boats! | javascript | data | model | null | null | null | open | How to create a data model for a boat?
===
How would one create a model for a boat in javascript that exists as a grid reference in a cartesian plane?
I would like to learn javascript by creating clone of the popular game Battleship!
To this end I need assistance in my quest to start programming boats! | 0 |
73,147 | 09/16/2008 14:48:33 | 11,820 | 09/16/2008 11:33:27 | 1 | 8 | I need an ID3 tag reader library for Java - preferably a fast one | I'd like to know a good ID3 tag reader library for Java.
Would be good if it was easy to use or had very good documentation, but my main criteria is speed - I want to be able to read ID3 tags from over 10,000 files as quickly as possible. | java | mp3 | id3 | null | null | 06/04/2012 14:47:27 | not constructive | I need an ID3 tag reader library for Java - preferably a fast one
===
I'd like to know a good ID3 tag reader library for Java.
Would be good if it was easy to use or had very good documentation, but my main criteria is speed - I want to be able to read ID3 tags from over 10,000 files as quickly as possible. | 4 |
2,185,491 | 02/02/2010 16:04:14 | 781 | 08/08/2008 21:28:19 | 4,819 | 134 | Where can I find commercial grade IP geolocation webservices? | I need a webservice that will return the country location given an IP address. I only have two requirements:
1. It must be able to take thousands for requests per second.
2. It must be a service where I don't have maintain the data.
I know there are very similar questions here on SO, but most of the stuff people reference violates at least one of my requirements.
Thanks in advance! | api | sdk | geolocation | ip-geolocation | web-services | null | open | Where can I find commercial grade IP geolocation webservices?
===
I need a webservice that will return the country location given an IP address. I only have two requirements:
1. It must be able to take thousands for requests per second.
2. It must be a service where I don't have maintain the data.
I know there are very similar questions here on SO, but most of the stuff people reference violates at least one of my requirements.
Thanks in advance! | 0 |
2,626,390 | 04/13/2010 01:08:50 | 175,989 | 09/19/2009 18:05:58 | 8 | 0 | C# Communication between threads. | I am using .NET 3.5 and am trying to wrap my head around a problem (not being a supreme threading expert bear with me).
I have a windows service which has a very intensive process that is always running, I have put this process onto a separate thread so that the main thread of my service can handle operational tasks - i.e., service audit cycles, handling configuration changes, etc, etc.
I'm starting the thread via the typical ThreadStart to a method which kicks the process off - call it workerthread.
On this workerthread I am sending data to another server, as is expected the server reboots every now and again and connection is lost and I need to re-establish the connection (I am notified by the lost of connection via an event). From here I do my reconnect logic and I am back in and running, however what I easily started to notice to happen was that I was creating this worker thread over and over again each time (not what I want).
Now I could kill the workerthread when I lose the connection and start a new one but this seems like a waste of resources.
What I really want to do, is marshal the call (i.e., my thread start method) back to the thread that is still in memory although not doing anything.
Please post any examples or docs you have that would be of use.
Thanks. | c# | multithreading | null | null | null | null | open | C# Communication between threads.
===
I am using .NET 3.5 and am trying to wrap my head around a problem (not being a supreme threading expert bear with me).
I have a windows service which has a very intensive process that is always running, I have put this process onto a separate thread so that the main thread of my service can handle operational tasks - i.e., service audit cycles, handling configuration changes, etc, etc.
I'm starting the thread via the typical ThreadStart to a method which kicks the process off - call it workerthread.
On this workerthread I am sending data to another server, as is expected the server reboots every now and again and connection is lost and I need to re-establish the connection (I am notified by the lost of connection via an event). From here I do my reconnect logic and I am back in and running, however what I easily started to notice to happen was that I was creating this worker thread over and over again each time (not what I want).
Now I could kill the workerthread when I lose the connection and start a new one but this seems like a waste of resources.
What I really want to do, is marshal the call (i.e., my thread start method) back to the thread that is still in memory although not doing anything.
Please post any examples or docs you have that would be of use.
Thanks. | 0 |
5,664,483 | 04/14/2011 14:06:33 | 654,756 | 03/09/2011 07:21:26 | 1 | 0 | social networking website using ASP.NET | hey friends i am gonna make a social networking website with ASP.NET should i use visual studio 2008 or 2010 and sql server 2005 or 2008 so please suggest me. i am learning from *chris payne* **LEARN ASP.NET IN 21 DAYS** and another book *andrew siemers* which is an excellent book.
also what is the difference between asp.net and asp.net4.0
:) thanks | asp.net | null | null | null | null | 06/04/2011 01:50:26 | not a real question | social networking website using ASP.NET
===
hey friends i am gonna make a social networking website with ASP.NET should i use visual studio 2008 or 2010 and sql server 2005 or 2008 so please suggest me. i am learning from *chris payne* **LEARN ASP.NET IN 21 DAYS** and another book *andrew siemers* which is an excellent book.
also what is the difference between asp.net and asp.net4.0
:) thanks | 1 |
7,414,403 | 09/14/2011 09:56:19 | 613,976 | 02/12/2011 05:51:46 | 1 | 0 | What is a PCIe switch | I am looking for a motherboard that may support 4 full BW PCIe2.0 x16 slots.
These are the two I have narrowed down to
http://www.supermicro.com/products/motherboard/QPI/5500/X8DTG-QF.cfm
http://www.supermicro.com/products/motherboard/QPI/5500/X8DTG-QF_.cfm
Apart from dimensions both sport similar configuration but a unique point about the QF+ is the presence of a unit **PLX 8647**.
Google shows that it is a PCIe switch. Now how will the PCI lanes differ in these two motherboards. How does the switch kick into action. The OEM says that it 48 lanes supporting full length 3 x16 slots. Doesn't with 2 Intel 5520 IOHs the lane count double from 36 to 72?
Suggestions please
Thank you
| intel | pci | motherboard | pci-bus | chipset | 09/14/2011 10:19:18 | off topic | What is a PCIe switch
===
I am looking for a motherboard that may support 4 full BW PCIe2.0 x16 slots.
These are the two I have narrowed down to
http://www.supermicro.com/products/motherboard/QPI/5500/X8DTG-QF.cfm
http://www.supermicro.com/products/motherboard/QPI/5500/X8DTG-QF_.cfm
Apart from dimensions both sport similar configuration but a unique point about the QF+ is the presence of a unit **PLX 8647**.
Google shows that it is a PCIe switch. Now how will the PCI lanes differ in these two motherboards. How does the switch kick into action. The OEM says that it 48 lanes supporting full length 3 x16 slots. Doesn't with 2 Intel 5520 IOHs the lane count double from 36 to 72?
Suggestions please
Thank you
| 2 |
5,530,397 | 04/03/2011 15:07:15 | 300,675 | 03/24/2010 09:44:35 | 139 | 0 | flex: how to prevent PASTE (ctrl+V) in a flex3 textinput ? | I need to disable pasting text in a textinout (flex3) : CTRL+V
Any idea ?
reagrds | flex | flex3 | null | null | null | null | open | flex: how to prevent PASTE (ctrl+V) in a flex3 textinput ?
===
I need to disable pasting text in a textinout (flex3) : CTRL+V
Any idea ?
reagrds | 0 |
4,555,784 | 12/29/2010 16:18:20 | 427,205 | 08/21/2010 17:33:25 | 312 | 23 | How to make event pass through visible DOM element | Let us have this code:
<div id="outer_container">
<div id="inner_child_1"></div>
<div id="inner_child_2"></div>
</div>
div#outer_container
{
position: relative;
width: 200px;
height: 200px;
background-color: green;
}
div#inner_child_1
{
position: absolute;
z-index: 1
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: red;
}
div#inner_child_2
{
position: absolute;
z-index: 2
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: blue;
}
When we make a click, for example, on the top layer inner_child_2, the event will propagate to all event handlers registered to inner_child_2 and its parent outer_container. Not to inner_child_1 despite it is directly below inner_child_2. This is by specification. All modern browsers do it.
My question is this:
How to make an event pass through inner_child_2 and reach inner_child_1, besides making inner_child_1 not visible or change its z-index?
(Or transparent, but this will only work in IE8)
I thought about triggering an event myself in some handler code registered to inner_child_2. But in the real usage case, I don't know where to dispatch the event, as below inner_child_2, there are multiple elements laid out in unpredictable fashion and I want each one to receive events as if inner_child_2 was not there. Ideally, I want to be able to selectively let some events pass while keeping others out.
I know this is a difficult question, but I will appreciate any suggestions | javascript | events | dom | layout | null | null | open | How to make event pass through visible DOM element
===
Let us have this code:
<div id="outer_container">
<div id="inner_child_1"></div>
<div id="inner_child_2"></div>
</div>
div#outer_container
{
position: relative;
width: 200px;
height: 200px;
background-color: green;
}
div#inner_child_1
{
position: absolute;
z-index: 1
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: red;
}
div#inner_child_2
{
position: absolute;
z-index: 2
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: blue;
}
When we make a click, for example, on the top layer inner_child_2, the event will propagate to all event handlers registered to inner_child_2 and its parent outer_container. Not to inner_child_1 despite it is directly below inner_child_2. This is by specification. All modern browsers do it.
My question is this:
How to make an event pass through inner_child_2 and reach inner_child_1, besides making inner_child_1 not visible or change its z-index?
(Or transparent, but this will only work in IE8)
I thought about triggering an event myself in some handler code registered to inner_child_2. But in the real usage case, I don't know where to dispatch the event, as below inner_child_2, there are multiple elements laid out in unpredictable fashion and I want each one to receive events as if inner_child_2 was not there. Ideally, I want to be able to selectively let some events pass while keeping others out.
I know this is a difficult question, but I will appreciate any suggestions | 0 |
5,526,768 | 04/03/2011 00:27:51 | 108,541 | 05/17/2009 23:29:13 | 59 | 2 | Reading feeds in Java | What java library for reading RSS/Atom do you use? | rss | atom | null | null | null | 04/04/2011 08:01:35 | not constructive | Reading feeds in Java
===
What java library for reading RSS/Atom do you use? | 4 |
3,238,034 | 07/13/2010 14:14:29 | 389,525 | 07/12/2010 13:33:11 | 28 | 0 | How to install android plateform offline? | I download abdroid SDK components from http://dl-ssl.google.com/android/repository/repository.xml. Now my question is that How to install these components? I am using eclipse and the plugin for android ADT is install. | android | eclipse | null | null | null | null | open | How to install android plateform offline?
===
I download abdroid SDK components from http://dl-ssl.google.com/android/repository/repository.xml. Now my question is that How to install these components? I am using eclipse and the plugin for android ADT is install. | 0 |
7,978,236 | 11/02/2011 09:39:32 | 625,832 | 02/21/2011 00:58:38 | 1 | 0 | Oracle VMWare Licensing | We currently have an application written in Oracle. Most of our customers wish to run on VMWare internally or via third party.
My understanding of Oracle licensing is that you must licence against all the underlying hardware unless you use Oracle's own virtualisation software. However, most hosting organisations use VMWare and any internal hosting will also use VMWare.
How can we licence Oracle products without them looking uncompetitive to competing SQL Server products when the VMWare licensing causes problems?
Thanks. | oracle | licensing | vmware | null | null | 11/18/2011 16:06:22 | off topic | Oracle VMWare Licensing
===
We currently have an application written in Oracle. Most of our customers wish to run on VMWare internally or via third party.
My understanding of Oracle licensing is that you must licence against all the underlying hardware unless you use Oracle's own virtualisation software. However, most hosting organisations use VMWare and any internal hosting will also use VMWare.
How can we licence Oracle products without them looking uncompetitive to competing SQL Server products when the VMWare licensing causes problems?
Thanks. | 2 |
11,329,491 | 07/04/2012 12:50:34 | 767,920 | 08/30/2009 07:49:27 | 1,137 | 19 | Tools usefull for dotnet developer vs2008 | Can anyone tell me which are tools that helps developer in **coding, testing the service(wcf, webservices), in html alignment, formatting the code**
as i haven’t used any tools it would be great if you can tell me which are the tools that are freely available to download and use it
any help on this would be greatly appreciated.
Thanks
Prince | visual-studio-2008 | null | null | null | null | 07/04/2012 19:41:53 | not constructive | Tools usefull for dotnet developer vs2008
===
Can anyone tell me which are tools that helps developer in **coding, testing the service(wcf, webservices), in html alignment, formatting the code**
as i haven’t used any tools it would be great if you can tell me which are the tools that are freely available to download and use it
any help on this would be greatly appreciated.
Thanks
Prince | 4 |
11,521,891 | 07/17/2012 11:51:05 | 878,520 | 08/04/2011 11:51:24 | 114 | 2 | Payment System API or Company | I'm building a market in which a lot of merchants sell their own products.
I've not used Paypal, Google checkout, or whatever payments system yet.
So I have no any idea about them.
What I'm looking for is safe payment system where customers purchase products and pay my market for them and when customers have received their products they ordered, my market pay back to the seller.
Again..
1. a customer purchases products from a seller in a Market.
2. a customer pays money to Market not to seller.
3. when the customer receive his product, Market pay back to seller so that the transaction will be safe.
here are my questions.
1. is it possible to implement that system by using paypal, google checkout, or amazon payment system?
2. if not, what companies do I have to look for? | python | paypal | payment-gateway | payment | checkout | 07/18/2012 00:12:53 | not constructive | Payment System API or Company
===
I'm building a market in which a lot of merchants sell their own products.
I've not used Paypal, Google checkout, or whatever payments system yet.
So I have no any idea about them.
What I'm looking for is safe payment system where customers purchase products and pay my market for them and when customers have received their products they ordered, my market pay back to the seller.
Again..
1. a customer purchases products from a seller in a Market.
2. a customer pays money to Market not to seller.
3. when the customer receive his product, Market pay back to seller so that the transaction will be safe.
here are my questions.
1. is it possible to implement that system by using paypal, google checkout, or amazon payment system?
2. if not, what companies do I have to look for? | 4 |
9,306,787 | 02/16/2012 06:50:35 | 1,147,361 | 01/13/2012 09:29:48 | 35 | 1 | SEVERE: Context [/dynamicjavaproject] startup failed due to previous errors | On running java project It gives such error .
I have tried all on internet , but unable to fix this error,
I am building a dynamic web project by ant tool.
On running of project it give error code 404.
Please Help me ..
Thank you. | java | tomcat | null | null | null | 05/03/2012 19:17:01 | not a real question | SEVERE: Context [/dynamicjavaproject] startup failed due to previous errors
===
On running java project It gives such error .
I have tried all on internet , but unable to fix this error,
I am building a dynamic web project by ant tool.
On running of project it give error code 404.
Please Help me ..
Thank you. | 1 |
10,542,600 | 05/10/2012 21:44:35 | 1,308,986 | 04/02/2012 20:24:52 | 76 | 0 | What are some good resources (that you recommend) for improving coding style? | I'm wondering if any experienced Java programmers could point out a few resources (can be websites, books, ebooks, videos, etc) that show a programmer good programming styles.
I look at my code and compare it to some example source online and mine just looks bloated, poorly formatted, and just not as readable as other's code. I know each programmer has their own style, but I would like to kick any bad programming habits that I've picked up. I would like my code to be read to an individual who has never touched the source before.
I know there are a lot of resources out there, but I don't know what the name of the topic is to be honest. (good programming structure? good programming conventions?)
I would like if there are some books I could pick up and read on the topic.
I appreciate any and all answers. | java | coding-style | null | null | null | 05/10/2012 21:49:53 | off topic | What are some good resources (that you recommend) for improving coding style?
===
I'm wondering if any experienced Java programmers could point out a few resources (can be websites, books, ebooks, videos, etc) that show a programmer good programming styles.
I look at my code and compare it to some example source online and mine just looks bloated, poorly formatted, and just not as readable as other's code. I know each programmer has their own style, but I would like to kick any bad programming habits that I've picked up. I would like my code to be read to an individual who has never touched the source before.
I know there are a lot of resources out there, but I don't know what the name of the topic is to be honest. (good programming structure? good programming conventions?)
I would like if there are some books I could pick up and read on the topic.
I appreciate any and all answers. | 2 |
5,561,216 | 04/06/2011 03:45:23 | 224,142 | 12/03/2009 18:24:31 | 60 | 5 | Does Hibernate HQL support aliasing subqueries? | I'm using Hibernate 3.2.6 and I'm attempting to make a query like so:
select
a,
(select min(date) as someAlias from B b where a.id = b.id)
from A a
where someAlias is not null and someAlias between :start and :end
Imagine that this query makes sense in the context that I'm operating in. When I run this query, I get an error saying "Unknown column 'someAlias' in 'where clause'". When I show the SQL output, I see that SQL doesn't seem to include the 'as someAlias' part of the query.
Is this just unsupported, or am I missing something? Or this just a feature not supported in version of Hibernate?
| java | mysql | sql | hibernate | hql | null | open | Does Hibernate HQL support aliasing subqueries?
===
I'm using Hibernate 3.2.6 and I'm attempting to make a query like so:
select
a,
(select min(date) as someAlias from B b where a.id = b.id)
from A a
where someAlias is not null and someAlias between :start and :end
Imagine that this query makes sense in the context that I'm operating in. When I run this query, I get an error saying "Unknown column 'someAlias' in 'where clause'". When I show the SQL output, I see that SQL doesn't seem to include the 'as someAlias' part of the query.
Is this just unsupported, or am I missing something? Or this just a feature not supported in version of Hibernate?
| 0 |
10,520,460 | 05/09/2012 16:43:50 | 1,319,509 | 04/07/2012 19:18:18 | 1 | 0 | Get instance failure when trying connect to ms sql server | Trying connect to ms sql from c# code, but get this error. If I make simple connection like this:
String connect = "server=MY-PC\\SQLEXPRESS; database=mydb; Integrated Security=SSPI;";
con.ConnectionString = connect;
But when I try connecto from app.config, I get this error:
String connect = ConfigurationManager.AppSettings["connectionString"];
con.ConnectionString = connect ;
Here is xml code:
<configuration>
<appSettings>
<add key="connectionString" value="server=MY-PC\\SQLEXPRESS; database=mydb; Integrated Security=SSPI;"/>
</appSettings>
</configuration>
Some ideas? | .net | ado | null | null | null | null | open | Get instance failure when trying connect to ms sql server
===
Trying connect to ms sql from c# code, but get this error. If I make simple connection like this:
String connect = "server=MY-PC\\SQLEXPRESS; database=mydb; Integrated Security=SSPI;";
con.ConnectionString = connect;
But when I try connecto from app.config, I get this error:
String connect = ConfigurationManager.AppSettings["connectionString"];
con.ConnectionString = connect ;
Here is xml code:
<configuration>
<appSettings>
<add key="connectionString" value="server=MY-PC\\SQLEXPRESS; database=mydb; Integrated Security=SSPI;"/>
</appSettings>
</configuration>
Some ideas? | 0 |
10,219,614 | 04/18/2012 23:32:45 | 761,164 | 05/19/2011 13:35:27 | 42 | 0 | Class to edit pdf Android | I need to edit an existing pdf file in my Android app. I search on internet but i only found apps to show/edit it. I need a class to edit it from java. Where I can find it? | java | android | pdf | null | null | 05/16/2012 21:24:46 | too localized | Class to edit pdf Android
===
I need to edit an existing pdf file in my Android app. I search on internet but i only found apps to show/edit it. I need a class to edit it from java. Where I can find it? | 3 |
9,761,868 | 03/18/2012 20:13:33 | 1,150,859 | 01/15/2012 20:42:54 | 3 | 0 | Index Out of Bounds Exception in Binary Search | I'm confused at exactly where this happens. I've traced this simple code out on paper as well as used the computer but I can't figure out. In my example I created an array of {1, 2, 3, 4, 5} and it came up with this error for numbers 4 and 5. It worked fine for numbers 1, 2, and 3, as well as numbers not in the array. Can anyone help, please?
public static int search(int[] ar, int num)
{
int low=0;
int hi=ar.length-1;
int mid=(low+hi/2);
while(hi>=low || mid<=low || mid>=hi )
{
if(ar[mid]==num)
{
return mid;
}
else if(ar[mid]>num)
{
hi=mid-1;
mid=(low+hi/2);
}
else
{
low=mid+1;
mid=(low+hi/2);
}
}
return -1;
} | java | binary-search | indexoutofboundsexception | null | null | null | open | Index Out of Bounds Exception in Binary Search
===
I'm confused at exactly where this happens. I've traced this simple code out on paper as well as used the computer but I can't figure out. In my example I created an array of {1, 2, 3, 4, 5} and it came up with this error for numbers 4 and 5. It worked fine for numbers 1, 2, and 3, as well as numbers not in the array. Can anyone help, please?
public static int search(int[] ar, int num)
{
int low=0;
int hi=ar.length-1;
int mid=(low+hi/2);
while(hi>=low || mid<=low || mid>=hi )
{
if(ar[mid]==num)
{
return mid;
}
else if(ar[mid]>num)
{
hi=mid-1;
mid=(low+hi/2);
}
else
{
low=mid+1;
mid=(low+hi/2);
}
}
return -1;
} | 0 |
4,840,465 | 01/30/2011 00:52:45 | 95,265 | 04/24/2009 01:28:43 | 1,099 | 11 | show current user location? | I know this has been asked by many others, I just wanted to know that by now the simulator is still unable to detect the current location (it always detects it as Cupertino). Is this true? Has apple actually did some update on this issue? | iphone | objective-c | null | null | null | null | open | show current user location?
===
I know this has been asked by many others, I just wanted to know that by now the simulator is still unable to detect the current location (it always detects it as Cupertino). Is this true? Has apple actually did some update on this issue? | 0 |
7,850,368 | 10/21/2011 13:51:37 | 445,117 | 09/11/2010 14:07:48 | 117 | 6 | Android - 4.0 is out, which version to use? | I'm just starting to learn Android development and writing my first app. I started with V2.2 but up until now mostly wrote generic Java code. Now that I started to write Android specific code I saw that a new version was out.
After installing it, eclipse IDE lets me choose between v2.1 and v4.0. non of the others are available.
So should I jump to 4.0 or stay with 2.1 to have the app compatible with a greater number of older handhelds? I'm not planning on using any new technology / functionality that 4.0 might be offering. | android | null | null | null | null | 11/20/2011 00:50:59 | not a real question | Android - 4.0 is out, which version to use?
===
I'm just starting to learn Android development and writing my first app. I started with V2.2 but up until now mostly wrote generic Java code. Now that I started to write Android specific code I saw that a new version was out.
After installing it, eclipse IDE lets me choose between v2.1 and v4.0. non of the others are available.
So should I jump to 4.0 or stay with 2.1 to have the app compatible with a greater number of older handhelds? I'm not planning on using any new technology / functionality that 4.0 might be offering. | 1 |
11,275,380 | 06/30/2012 15:36:44 | 1,493,201 | 06/30/2012 15:29:00 | 1 | 0 | EXPECTED an indented block error in python .. make a MYsql database on server | i get an error EXPECTED an indented block error when running
$
#!/usr/bin/env python
import socket
import MySQLdb
TCP_IP = "10.23.4.2"
TCP_PORT = 32000
BUFFER_SIZE = 40
# ClearDB. Deletes the entire tracking table
def ClearDB(curs,d ):
curs.execute ("INSERT INTO gmaptracker (lat, lon)VALUES (0.0,0.0)")
d.commit()
# Connect to the mySQL Database
def tServer():
try:
db = MySQLdb.connect (host = "http:\\m7atta.zxq.net",
user = "751178_filgo",
passwd = "lpl,]mms1",
db = "m7atta_zxq_test" )
except MySQLdb.Error, e:
print "Error %d: %s" %(e.args[0], e.args[1])
sys.exit(1);
cursor = db.cursor()
# Start with a fresh tracking table
ClearDB(cursor,db)
# Set up listening Socket
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind((TCP_IP, TCP_PORT))
print "Listening...."
s.listen(1)
conn, addr = s.accept()
print 'Accepted connection from address:', addr
except socket.error:
if s:
s.close()
print "Could not open socket: "
cursor.close()
conn.close()
db.close()
sys.exit(1)
try:
while 1:
data = conn.recv(BUFFER_SIZE)
if not data:break
str1,str2 = data.split("Long: ")
str1 = str1.split("Lat: ")[1]
latitude = float(str1)
longitude = float(str2)
cursor.execute ("""
INSERT INTO gmaptracker (lat, lon)
VALUES (%s,%s)""", (latitude,longitude))
db.commit()
except KeyboardInterrupt:
ClearDB(cursor,db);
cursor.close()
conn.close()
db.close()
if __name__ == '__main__':
tServer()
| python | mysql | database | ubuntu | null | 06/30/2012 15:52:31 | not a real question | EXPECTED an indented block error in python .. make a MYsql database on server
===
i get an error EXPECTED an indented block error when running
$
#!/usr/bin/env python
import socket
import MySQLdb
TCP_IP = "10.23.4.2"
TCP_PORT = 32000
BUFFER_SIZE = 40
# ClearDB. Deletes the entire tracking table
def ClearDB(curs,d ):
curs.execute ("INSERT INTO gmaptracker (lat, lon)VALUES (0.0,0.0)")
d.commit()
# Connect to the mySQL Database
def tServer():
try:
db = MySQLdb.connect (host = "http:\\m7atta.zxq.net",
user = "751178_filgo",
passwd = "lpl,]mms1",
db = "m7atta_zxq_test" )
except MySQLdb.Error, e:
print "Error %d: %s" %(e.args[0], e.args[1])
sys.exit(1);
cursor = db.cursor()
# Start with a fresh tracking table
ClearDB(cursor,db)
# Set up listening Socket
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind((TCP_IP, TCP_PORT))
print "Listening...."
s.listen(1)
conn, addr = s.accept()
print 'Accepted connection from address:', addr
except socket.error:
if s:
s.close()
print "Could not open socket: "
cursor.close()
conn.close()
db.close()
sys.exit(1)
try:
while 1:
data = conn.recv(BUFFER_SIZE)
if not data:break
str1,str2 = data.split("Long: ")
str1 = str1.split("Lat: ")[1]
latitude = float(str1)
longitude = float(str2)
cursor.execute ("""
INSERT INTO gmaptracker (lat, lon)
VALUES (%s,%s)""", (latitude,longitude))
db.commit()
except KeyboardInterrupt:
ClearDB(cursor,db);
cursor.close()
conn.close()
db.close()
if __name__ == '__main__':
tServer()
| 1 |
10,575,767 | 05/13/2012 22:34:52 | 935,780 | 09/08/2011 21:46:05 | 571 | 17 | Evaluating polynomials? | Why does evaluating polynomials with n points using the Fast Fourier Transform take O(n log n) time? I am specifically talking about implementing a divide and conquer algorithm that divides the polynomial A(x) into its even powers and odd powers and then uses recursion. | math | computer-science | null | null | null | 05/14/2012 16:02:49 | off topic | Evaluating polynomials?
===
Why does evaluating polynomials with n points using the Fast Fourier Transform take O(n log n) time? I am specifically talking about implementing a divide and conquer algorithm that divides the polynomial A(x) into its even powers and odd powers and then uses recursion. | 2 |
1,289,751 | 08/17/2009 18:55:01 | 152,092 | 08/06/2009 21:20:24 | 42 | 2 | ASP.net - Using a jQuery datepicker in a custom control | I'm trying to use the jquery datepicker - http://jqueryui.com/demos/datepicker/ in a custom control (.ascx).
To enable the datepicker, I need to add the following script at the top for an input:
$("#dateinput").datepicker({});
The problem is, that the id of the element changes when the custom control is on a page. When the custom control is given an id of "c1" for example, the id field becomes "c1_dateinput".
How do I get around this? I need multiple custom controls with datepickers on the page. | asp.net | jquery | jquery-datepicker | custom-controls | null | null | open | ASP.net - Using a jQuery datepicker in a custom control
===
I'm trying to use the jquery datepicker - http://jqueryui.com/demos/datepicker/ in a custom control (.ascx).
To enable the datepicker, I need to add the following script at the top for an input:
$("#dateinput").datepicker({});
The problem is, that the id of the element changes when the custom control is on a page. When the custom control is given an id of "c1" for example, the id field becomes "c1_dateinput".
How do I get around this? I need multiple custom controls with datepickers on the page. | 0 |
8,484,490 | 12/13/2011 04:51:31 | 1,095,033 | 12/13/2011 04:46:38 | 1 | 0 | Is there any signal generated if we copy/delete a file from Linux folder? How to trap it? | Hi I am working on a situation in which i need to trap a signal whenever there is a change in a linux folder? Does any signal generated if we copy/delete/modify the files inside a linux folder?
I can trap signals like: ctrl+c , ctrl+z but not able to identify if my situation generates a signal?
Warm Regards,
Kapil | linux | null | null | null | null | null | open | Is there any signal generated if we copy/delete a file from Linux folder? How to trap it?
===
Hi I am working on a situation in which i need to trap a signal whenever there is a change in a linux folder? Does any signal generated if we copy/delete/modify the files inside a linux folder?
I can trap signals like: ctrl+c , ctrl+z but not able to identify if my situation generates a signal?
Warm Regards,
Kapil | 0 |
7,642,434 | 10/04/2011 01:32:46 | 440,677 | 09/06/2010 13:30:59 | 715 | 32 | Is there a way to implement methods like __len__ of __eq__ as classmethods? | It is pretty easy to implement `__len__(self)` method in Python so that it handles `len(inst)` calls like this one:
class A(object):
def __len__(self):
return 7
a = A()
len(a) # gives us 7
And there are plenty of alike methods you can define (`__eq__`, `__str__`, `__repr__` etc.).
I know that Python classes are objects as well.
My question: can I somehow define, for example, `__len__` so that the following works:
len(A) # makes sense and gives some predictable result
| python | class | null | null | null | null | open | Is there a way to implement methods like __len__ of __eq__ as classmethods?
===
It is pretty easy to implement `__len__(self)` method in Python so that it handles `len(inst)` calls like this one:
class A(object):
def __len__(self):
return 7
a = A()
len(a) # gives us 7
And there are plenty of alike methods you can define (`__eq__`, `__str__`, `__repr__` etc.).
I know that Python classes are objects as well.
My question: can I somehow define, for example, `__len__` so that the following works:
len(A) # makes sense and gives some predictable result
| 0 |
306,504 | 11/20/2008 19:14:34 | 22,761 | 09/26/2008 16:18:36 | 1 | 0 | Good way to maintain ASP.NET Panel states? | I'm creating a multi-part web form in ASP.NET that uses Panels for the different steps, making only the Panel for the current step visible. On Step 1, I have a drop-down list that uses a Javascript function to reconfigure some of the fields in the same Panel via "onchange". Obviously, since the client-side script is only affecting the DOM, when I go to Step 2 and then back up to Step 1, the fields in Step 1 are back to their orignal configuration even though the same drop-down choice is selected.
What is a good method for storing the visual state of the Panels between steps? I considered calling the drop-down's onchange function on page load, but that seemed clunky. Thanks! | c# | panel | state | null | null | null | open | Good way to maintain ASP.NET Panel states?
===
I'm creating a multi-part web form in ASP.NET that uses Panels for the different steps, making only the Panel for the current step visible. On Step 1, I have a drop-down list that uses a Javascript function to reconfigure some of the fields in the same Panel via "onchange". Obviously, since the client-side script is only affecting the DOM, when I go to Step 2 and then back up to Step 1, the fields in Step 1 are back to their orignal configuration even though the same drop-down choice is selected.
What is a good method for storing the visual state of the Panels between steps? I considered calling the drop-down's onchange function on page load, but that seemed clunky. Thanks! | 0 |
9,894,807 | 03/27/2012 17:45:44 | 993,797 | 10/13/2011 15:26:43 | 13 | 0 | Duplicate component id in JSF | I am working through an example in the "JSF in action book" which displays a dynamic grid(html table) of numbers driven by an input. The jsp portion is below
<p>
<h:panelGrid id="controlPanel"
binding="#{helloBean.controlPanel}"
columns="20" border="1" cellspacing="0"/>
</p>
<h:commandButton id="redisplayCommand" type="submit"
value="Redisplay"
actionListener="#{helloBean.addControls}"/>
The binding bean code is below
public void addControls(ActionEvent actionEvent)
{
Application application = FacesContext.getCurrentInstance().getApplication();
List children = controlPanel.getChildren();
children.clear();
for (int count = 0; count < numControls; count++)
{
HtmlOutputText output = (HtmlOutputText)application.
createComponent(HtmlOutputText.COMPONENT_TYPE);
output.setValue(" " + count + " ");
output.setStyle("color: blue");
children.add(output);
}
}
The code is functional for a few values and then out of nowhere i get this error
"javax.servlet.ServletException: Component ID welcomeForm:j_id51 has already been found in the view"
There doesent seem to be a pattern to when this exception occurs. Is there an way to "drop" a component from its parent?
Thanks in advande
| jsf | components | null | null | null | null | open | Duplicate component id in JSF
===
I am working through an example in the "JSF in action book" which displays a dynamic grid(html table) of numbers driven by an input. The jsp portion is below
<p>
<h:panelGrid id="controlPanel"
binding="#{helloBean.controlPanel}"
columns="20" border="1" cellspacing="0"/>
</p>
<h:commandButton id="redisplayCommand" type="submit"
value="Redisplay"
actionListener="#{helloBean.addControls}"/>
The binding bean code is below
public void addControls(ActionEvent actionEvent)
{
Application application = FacesContext.getCurrentInstance().getApplication();
List children = controlPanel.getChildren();
children.clear();
for (int count = 0; count < numControls; count++)
{
HtmlOutputText output = (HtmlOutputText)application.
createComponent(HtmlOutputText.COMPONENT_TYPE);
output.setValue(" " + count + " ");
output.setStyle("color: blue");
children.add(output);
}
}
The code is functional for a few values and then out of nowhere i get this error
"javax.servlet.ServletException: Component ID welcomeForm:j_id51 has already been found in the view"
There doesent seem to be a pattern to when this exception occurs. Is there an way to "drop" a component from its parent?
Thanks in advande
| 0 |
11,421,379 | 07/10/2012 20:25:37 | 416,623 | 08/10/2010 21:12:27 | 1,072 | 75 | Mule ESB: XSLT Transformers or Java Transformers? | Is there any performance improvement if I use a custom Java transformer in place of an XSLT transformer in Mule?
I have a cxf proxy-service and proxy-client pattern, and my transformers are being used to change the payload so that it is a valid input for subsequent SOAP web-service calls. | xml | performance | esb | mule | null | null | open | Mule ESB: XSLT Transformers or Java Transformers?
===
Is there any performance improvement if I use a custom Java transformer in place of an XSLT transformer in Mule?
I have a cxf proxy-service and proxy-client pattern, and my transformers are being used to change the payload so that it is a valid input for subsequent SOAP web-service calls. | 0 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.