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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6,998,599 | 08/09/2011 15:20:54 | 610,607 | 02/09/2011 23:35:28 | 36 | 0 | Java program with two or more exceptions caused by similar values | I am working on project where I am trying to find programs which give any exception but because of close values. Let me explain by an example. I will highly appreciate any help and support. In the following program first fault is generated when x == 100 and second when x == 98. Cheers.
public class Fault {
public void faulty(int x, int y) {
int z;
y = 20;
int a [] = new int[10];
if (x == 100)
{
a[11] = 22;
}
if ( x == 98)
z= ( x + y )/0;
}
} | java | testing | bugs | faults | null | 07/05/2012 23:25:09 | not a real question | Java program with two or more exceptions caused by similar values
===
I am working on project where I am trying to find programs which give any exception but because of close values. Let me explain by an example. I will highly appreciate any help and support. In the following program first fault is generated when x == 100 and second when x == 98. Cheers.
public class Fault {
public void faulty(int x, int y) {
int z;
y = 20;
int a [] = new int[10];
if (x == 100)
{
a[11] = 22;
}
if ( x == 98)
z= ( x + y )/0;
}
} | 1 |
8,617,334 | 12/23/2011 14:48:07 | 490,246 | 10/28/2010 15:06:43 | 301 | 2 | Why is "-std=c++0x" still needed for g++ 4.6.2? | I downloaded and built gcc 4.6.2. I find that for C++11 features, the command line option `-std=c++0x` is still needed. Why is that? Isn't is supposed to support it by default?
$ g++ --version
g++ (GCC) 4.6.2
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | c++ | gcc | g++ | null | null | 12/24/2011 01:35:46 | not a real question | Why is "-std=c++0x" still needed for g++ 4.6.2?
===
I downloaded and built gcc 4.6.2. I find that for C++11 features, the command line option `-std=c++0x` is still needed. Why is that? Isn't is supposed to support it by default?
$ g++ --version
g++ (GCC) 4.6.2
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 1 |
6,587,107 | 07/05/2011 18:23:15 | 553,609 | 12/24/2010 23:19:46 | 448 | 19 | C# operator overload for "+="? | Hi there StackOverflow.
I am trying to do operator overloads for "+=", but I can't. I can only make an operator overload for "+".
How come? | c# | c#-4.0 | null | null | null | null | open | C# operator overload for "+="?
===
Hi there StackOverflow.
I am trying to do operator overloads for "+=", but I can't. I can only make an operator overload for "+".
How come? | 0 |
926,000 | 05/29/2009 13:35:30 | 66,473 | 02/14/2009 17:39:55 | 408 | 9 | Compiling GNU software on HP-UX. yy* symbols problem | When trying to compile GNU software on HP-UX (binutils for example) I'm getting error meggages about unsatisfied symbols yyfnd, yyextra, yytextuc, yyolsp ...
Some software can't be compiled using HP-UX own lex so i've included byacc and flex executables in my PATH. Is it HP-UX lex problem? How to fix it? | hp-ux | compilation | gnu | null | null | null | open | Compiling GNU software on HP-UX. yy* symbols problem
===
When trying to compile GNU software on HP-UX (binutils for example) I'm getting error meggages about unsatisfied symbols yyfnd, yyextra, yytextuc, yyolsp ...
Some software can't be compiled using HP-UX own lex so i've included byacc and flex executables in my PATH. Is it HP-UX lex problem? How to fix it? | 0 |
7,514,842 | 09/22/2011 12:39:40 | 718,785 | 04/21/2011 10:47:08 | 92 | 4 | Android phone listens for GPS updates and sends it without user permission | I was fiddling with my HTC DESIRE when I thought let me hook it on to the computer and see what its doing behind the scenes using LOGCAT from eclipse. As I was scrolling through the log I saw a "I"(info) that had updated my location and also subsequently retrieved information about the state, country, latitude and logitude. What surprised me further was that GPS was switched off and even my A-GPS was switched off. How is this possible ? Could someone throw some light on this matter. | android | permissions | gps | user-permissions | null | 09/23/2011 23:27:54 | off topic | Android phone listens for GPS updates and sends it without user permission
===
I was fiddling with my HTC DESIRE when I thought let me hook it on to the computer and see what its doing behind the scenes using LOGCAT from eclipse. As I was scrolling through the log I saw a "I"(info) that had updated my location and also subsequently retrieved information about the state, country, latitude and logitude. What surprised me further was that GPS was switched off and even my A-GPS was switched off. How is this possible ? Could someone throw some light on this matter. | 2 |
4,665,973 | 01/12/2011 06:34:34 | 507,007 | 11/13/2010 22:00:55 | 92 | 5 | Android admob requests keep going up | Firstly, I am new to admob and this is my very first app that includes ads from admob.
Just a simple question which I am not too sure about.
I have uploaded my first app today and I have been refreshing the admob control panel? page every half an hour or so an the number of ad requests keep going up.
I don't think I have anyone who has even downloaded the app and was wondering why it is going up and if that is a good or bad thing.
Thanks. | java | android | admob | null | null | null | open | Android admob requests keep going up
===
Firstly, I am new to admob and this is my very first app that includes ads from admob.
Just a simple question which I am not too sure about.
I have uploaded my first app today and I have been refreshing the admob control panel? page every half an hour or so an the number of ad requests keep going up.
I don't think I have anyone who has even downloaded the app and was wondering why it is going up and if that is a good or bad thing.
Thanks. | 0 |
9,783,192 | 03/20/2012 08:00:18 | 192,023 | 10/18/2009 14:34:28 | 17 | 3 | Java information for sysadmins | I've got years of experience as a linux admin and have some basic knowledge of java. For an upcoming job interview I'm looking for some more java information specifically for linux sys admins.
I'm thinking about good practices for filesystem layout, apache/tomcat configuration, basically anything a sysadmin support java apps/devs should know.
Thanks! | java | linux | sysadmin | null | null | 03/20/2012 08:39:04 | not constructive | Java information for sysadmins
===
I've got years of experience as a linux admin and have some basic knowledge of java. For an upcoming job interview I'm looking for some more java information specifically for linux sys admins.
I'm thinking about good practices for filesystem layout, apache/tomcat configuration, basically anything a sysadmin support java apps/devs should know.
Thanks! | 4 |
10,737,826 | 05/24/2012 12:48:36 | 825,363 | 07/01/2011 18:37:04 | 1 | 0 | Grails handling network connection stall | I am using Grails Ws-Client Plugin
but my application waits for the SOAP response back from the server from which i am consuming web service and my application waits from this code
def proxy = webService.getClient(wsdlUrl)
This mostly occours when the server is down or net connection is slow.
How can i set time out like property so that in case of stall my application run smoothly without any waiting for response.
I also don't get any exception or error as well.
| grails | soap | ws-client | null | null | null | open | Grails handling network connection stall
===
I am using Grails Ws-Client Plugin
but my application waits for the SOAP response back from the server from which i am consuming web service and my application waits from this code
def proxy = webService.getClient(wsdlUrl)
This mostly occours when the server is down or net connection is slow.
How can i set time out like property so that in case of stall my application run smoothly without any waiting for response.
I also don't get any exception or error as well.
| 0 |
10,679,831 | 05/21/2012 05:21:06 | 1,123,724 | 12/31/2011 00:18:46 | 14 | 0 | Get PHP to show PING RESPONSE | I am having issues getting my PHP script to display the response time to the IP of the visitor displaying in ms. I have already seen this: http://stackoverflow.com/questions/7555846/php-get-server-to-ping-a-visitors-ip-and-return-the-ping-in-ms
When I try to do some of the same code all mine outputs is
"8.8.8.8 is alive"
I'd actually like it to return the average round trip time or just the response time in milliseconds.
Here is my code that just outputs the above:
$pinginfo = array();
exec("/usr/sbin/ping -v -c 1 8.8.8.8", $pinginfo);
var_dump($pinginfo); | php | exec | ping | null | null | null | open | Get PHP to show PING RESPONSE
===
I am having issues getting my PHP script to display the response time to the IP of the visitor displaying in ms. I have already seen this: http://stackoverflow.com/questions/7555846/php-get-server-to-ping-a-visitors-ip-and-return-the-ping-in-ms
When I try to do some of the same code all mine outputs is
"8.8.8.8 is alive"
I'd actually like it to return the average round trip time or just the response time in milliseconds.
Here is my code that just outputs the above:
$pinginfo = array();
exec("/usr/sbin/ping -v -c 1 8.8.8.8", $pinginfo);
var_dump($pinginfo); | 0 |
11,321,243 | 07/04/2012 01:09:56 | 1,383,444 | 05/09/2012 01:34:45 | 20 | 2 | grouped pandas DataFrames: how do I apply scipy.stats.sem to them? | I know that I can apply numpy methods by doing the following:
`dataList` is a list of DataFrames (same cols/rows).
testDF = (concat(dataList, axis=1, keys=range(len(dataList)))
.swaplevel(0, 1, axis=1)
.sortlevel(axis=1)
.groupby(level=0, axis=1))
testDF.aggregate(numpy.mean)
testDF.aggregate(numpy.var)
and so on. However, what if I want to compute the standard error of the mean (sem)?
I tried:
testDF.aggregate(scipy.stats.sem)
but it gave a confusing error. Anyone know how to do this? What are the scipy.stats methods doing differently? | python | numpy | statistics | scipy | pandas | null | open | grouped pandas DataFrames: how do I apply scipy.stats.sem to them?
===
I know that I can apply numpy methods by doing the following:
`dataList` is a list of DataFrames (same cols/rows).
testDF = (concat(dataList, axis=1, keys=range(len(dataList)))
.swaplevel(0, 1, axis=1)
.sortlevel(axis=1)
.groupby(level=0, axis=1))
testDF.aggregate(numpy.mean)
testDF.aggregate(numpy.var)
and so on. However, what if I want to compute the standard error of the mean (sem)?
I tried:
testDF.aggregate(scipy.stats.sem)
but it gave a confusing error. Anyone know how to do this? What are the scipy.stats methods doing differently? | 0 |
10,453,012 | 05/04/2012 16:54:02 | 1,149,513 | 01/14/2012 17:08:37 | 1 | 1 | How to reload implicitly linked dll | I am facing one problem with implicitly linked dll.
I have one application written in C++ which is implicitly linked to dll.
After particular number of iteration, the dll functions do not work as per expectations.
I want to reload this dll so that the freshly loaded dll work properly.
The problem is that since the dll is linked implicitly to the application, I am not able to reload the dll during runtime.
Is there any way so that the implicitly linked dll can reload again?
Thanks in advance. | c++ | null | null | null | null | null | open | How to reload implicitly linked dll
===
I am facing one problem with implicitly linked dll.
I have one application written in C++ which is implicitly linked to dll.
After particular number of iteration, the dll functions do not work as per expectations.
I want to reload this dll so that the freshly loaded dll work properly.
The problem is that since the dll is linked implicitly to the application, I am not able to reload the dll during runtime.
Is there any way so that the implicitly linked dll can reload again?
Thanks in advance. | 0 |
7,954,630 | 10/31/2011 13:51:57 | 903,323 | 08/20/2011 01:09:19 | 147 | 0 | How to make this shape with css? | Please check out this link:
http://alexking.org/wp-content/uploads/2011/10/ios-shortcut-button-510x358.png
Look at the part that says 'keyboard'
I want that shape but facing the other way (right) and not curved.
I know this is a pentagon but its not the standard type so its hard to find the name or type of this shape to learn how to make it in css. Any ideas on how to make it!?!?
Thanks guys,
James | css | shape | null | null | null | 11/01/2011 00:54:46 | off topic | How to make this shape with css?
===
Please check out this link:
http://alexking.org/wp-content/uploads/2011/10/ios-shortcut-button-510x358.png
Look at the part that says 'keyboard'
I want that shape but facing the other way (right) and not curved.
I know this is a pentagon but its not the standard type so its hard to find the name or type of this shape to learn how to make it in css. Any ideas on how to make it!?!?
Thanks guys,
James | 2 |
1,697,214 | 11/08/2009 17:18:07 | 125,633 | 06/19/2009 09:36:36 | 130 | 0 | VIM like tools and softwares Collection | I've used VI(M) for over 2 years, and I really love its easy navigation and keyboard orientation. So except VI(VIM, gvim), I try to find more VIM-like tools(softwares) to benefit more. And I've got the following findings:
1. [apvlv][1]: for pdf reading(really impressive)
2. [VIM like chrome browser plugin][2] (and firefox has a similar [vimoperator][3])
And we can use vim like navigation key binding in gmail/greader too. But it's not enough. So I hope anyone who knows more such tools(software), which has the VIM like key binding, can list your findings here too. Writing down the corresponding link and main features will be appreciated. Thanks.
[1]: http://code.google.com/p/apvlv/
[2]: http://code.google.com/p/vimlike-smooziee/
[3]: https://addons.mozilla.org/en-US/firefox/addon/4891 | vim | productivity | null | null | null | 11/17/2011 15:58:17 | not constructive | VIM like tools and softwares Collection
===
I've used VI(M) for over 2 years, and I really love its easy navigation and keyboard orientation. So except VI(VIM, gvim), I try to find more VIM-like tools(softwares) to benefit more. And I've got the following findings:
1. [apvlv][1]: for pdf reading(really impressive)
2. [VIM like chrome browser plugin][2] (and firefox has a similar [vimoperator][3])
And we can use vim like navigation key binding in gmail/greader too. But it's not enough. So I hope anyone who knows more such tools(software), which has the VIM like key binding, can list your findings here too. Writing down the corresponding link and main features will be appreciated. Thanks.
[1]: http://code.google.com/p/apvlv/
[2]: http://code.google.com/p/vimlike-smooziee/
[3]: https://addons.mozilla.org/en-US/firefox/addon/4891 | 4 |
9,710,687 | 03/14/2012 21:40:02 | 1,259,881 | 03/09/2012 17:43:34 | 1 | 0 | Renderscript GLSL shader converting all uniforms to floats | When creating a custom shader in GLSL for renderscript the program builder seems to be converting all the members of structure I bind as uniform constants to floats or vec, regardless of what their specified type is. Also, I have a uniform that is reporting at compile time the following error: "Could not link program, L0010, Uniform "uniform name here" differ on precision.". I have the same named uniform in two different structures that separately bind to the vertex and fragment shaders. | android | renderscript | null | null | null | null | open | Renderscript GLSL shader converting all uniforms to floats
===
When creating a custom shader in GLSL for renderscript the program builder seems to be converting all the members of structure I bind as uniform constants to floats or vec, regardless of what their specified type is. Also, I have a uniform that is reporting at compile time the following error: "Could not link program, L0010, Uniform "uniform name here" differ on precision.". I have the same named uniform in two different structures that separately bind to the vertex and fragment shaders. | 0 |
6,461,257 | 06/23/2011 22:16:43 | 149,080 | 08/01/2009 21:00:20 | 3,111 | 32 | A clean way to update attributes across objects? | I want to do something like this:
**Given:**
@user1
@user2
Where the Post model has (id, user_id)
@posts = @user1.posts
I want to take all of the posts of user1, and set the user_id to @user2
Is there an easy one liner way to do this? Or do I have to loop through all the @posts and update attributes and save the record?
Thanks
| ruby-on-rails | ruby | ruby-on-rails-3 | null | null | null | open | A clean way to update attributes across objects?
===
I want to do something like this:
**Given:**
@user1
@user2
Where the Post model has (id, user_id)
@posts = @user1.posts
I want to take all of the posts of user1, and set the user_id to @user2
Is there an easy one liner way to do this? Or do I have to loop through all the @posts and update attributes and save the record?
Thanks
| 0 |
4,850,650 | 01/31/2011 12:07:14 | 424,986 | 08/19/2010 09:03:05 | 26 | 2 | Packing double byte filenames | I'm trying to pack some files which names contains korean characters into one installer, using Inno-Setup 5.4.0. When the compiler reach them it prompts an error
> The filename, directory name, or
> volume syntax is incorrect.
Is there any flag to allow it to read those or some workaround to include those files into the installer? | compiler-errors | inno-setup | multibyte | null | null | null | open | Packing double byte filenames
===
I'm trying to pack some files which names contains korean characters into one installer, using Inno-Setup 5.4.0. When the compiler reach them it prompts an error
> The filename, directory name, or
> volume syntax is incorrect.
Is there any flag to allow it to read those or some workaround to include those files into the installer? | 0 |
9,700,608 | 03/14/2012 10:58:58 | 1,071,138 | 11/29/2011 11:05:15 | 11 | 0 | MULTIPROCESS SERVER OR MULTITHREAD SERVER? | Hi' i'm writing a simple client server in C. What are advantages of making a multiprocess server instead of a multithread one? | c | multithreading | multiprocessing | null | null | 03/14/2012 12:03:37 | not a real question | MULTIPROCESS SERVER OR MULTITHREAD SERVER?
===
Hi' i'm writing a simple client server in C. What are advantages of making a multiprocess server instead of a multithread one? | 1 |
7,845,187 | 10/21/2011 05:06:45 | 1,006,452 | 10/21/2011 04:52:32 | 1 | 0 | how to use struct in c | I was trying to write a program to generate fibonacci such that parent process will call fork and child process will write sequences in shared memory fromwhere parent process will read the sequence and display .I know how to create shared memory but I donot know how to link struct array and shared memory so that parent display the value after child complete | c | struct | fibonacci | null | null | 10/21/2011 07:44:06 | not a real question | how to use struct in c
===
I was trying to write a program to generate fibonacci such that parent process will call fork and child process will write sequences in shared memory fromwhere parent process will read the sequence and display .I know how to create shared memory but I donot know how to link struct array and shared memory so that parent display the value after child complete | 1 |
3,043,582 | 06/15/2010 08:25:07 | 318,312 | 04/16/2010 08:42:26 | 6 | 0 | How much time do you spent on what task while working on a project? | How much time do you spend (in percent) in a project with
- writing actual code?
- writing unit tests?
- bug fixing?
- writing documentation?
- communicating with the customer?
- communicating with team members?
- setting up the project?
- integrating other parts?
- reviewing code from other developers?
- deployment?
- ... | time | statistics | management | null | null | 06/15/2010 12:17:56 | not constructive | How much time do you spent on what task while working on a project?
===
How much time do you spend (in percent) in a project with
- writing actual code?
- writing unit tests?
- bug fixing?
- writing documentation?
- communicating with the customer?
- communicating with team members?
- setting up the project?
- integrating other parts?
- reviewing code from other developers?
- deployment?
- ... | 4 |
8,408,367 | 12/06/2011 23:24:40 | 858,515 | 07/22/2011 18:54:29 | 38 | 2 | PHP Dependency Injection engine in PHP | I am writing a PHP Dependency Injection engine in PHP could you guys direct me to some valuable documents/articles which I can read?
Any comments/advice would also be appreciated :). | php | mvc | dependency-injection | null | null | 12/06/2011 23:41:39 | not a real question | PHP Dependency Injection engine in PHP
===
I am writing a PHP Dependency Injection engine in PHP could you guys direct me to some valuable documents/articles which I can read?
Any comments/advice would also be appreciated :). | 1 |
9,310,547 | 02/16/2012 11:32:15 | 1,012,928 | 10/25/2011 14:45:44 | 64 | 2 | Rewrite Rule - only using one parameter out of two? | I have a rewrite rule in .htaccess that turns this:
metro/metroreports.php?city=ny&full=New-York
into this:
metro/bed-bug-reports-for-ny-New-York
This is the rule:
RewriteRule ^metro/bed-bug-reports-for-([0-9a-zA-Z]+)-([0-9a-zA-Z]+) metro/metroreports.php?city=$1&full=$2 [NC,L]
But I'd like to get rid of the 'ny' part, so the url would look like this:
metro/bed-bug-reports-for-New-York
At the same time, I need to keep the `city=ny` part in the original URL because I have to use that variable on the page.
So, is there a way to do the rewrite while using only one of the two values ('full' in this case)? | php | .htaccess | null | null | null | 02/17/2012 06:04:50 | too localized | Rewrite Rule - only using one parameter out of two?
===
I have a rewrite rule in .htaccess that turns this:
metro/metroreports.php?city=ny&full=New-York
into this:
metro/bed-bug-reports-for-ny-New-York
This is the rule:
RewriteRule ^metro/bed-bug-reports-for-([0-9a-zA-Z]+)-([0-9a-zA-Z]+) metro/metroreports.php?city=$1&full=$2 [NC,L]
But I'd like to get rid of the 'ny' part, so the url would look like this:
metro/bed-bug-reports-for-New-York
At the same time, I need to keep the `city=ny` part in the original URL because I have to use that variable on the page.
So, is there a way to do the rewrite while using only one of the two values ('full' in this case)? | 3 |
9,216,231 | 02/09/2012 18:00:25 | 324,135 | 04/23/2010 11:51:04 | 188 | 26 | Is perfomance the same for x/2 or x*0.5f? | I would be interrested to know if the compiler in .NET can detect a simple division by 2 and form it to a multiplication by 0.5.
Just thought about it, probably that would be a small part where I can improve my game code.
(Actually I wouldnt worry about that normally, but it's something I could easily think of in the future when I write game code.) | c# | performance | null | null | null | 02/10/2012 00:44:08 | not constructive | Is perfomance the same for x/2 or x*0.5f?
===
I would be interrested to know if the compiler in .NET can detect a simple division by 2 and form it to a multiplication by 0.5.
Just thought about it, probably that would be a small part where I can improve my game code.
(Actually I wouldnt worry about that normally, but it's something I could easily think of in the future when I write game code.) | 4 |
5,780,085 | 04/25/2011 15:41:43 | 603,632 | 02/04/2011 18:44:46 | 1 | 0 | Es Jquery lo mas revolucionario? | Respecto a movimiento visual con mucho diseño | jquery | null | null | null | null | 04/25/2011 15:44:51 | not a real question | Es Jquery lo mas revolucionario?
===
Respecto a movimiento visual con mucho diseño | 1 |
5,158,145 | 03/01/2011 17:36:03 | 50,820 | 01/02/2009 06:31:39 | 313 | 20 | JAXB Parsing - weird behavior | I am receiving a valid XML from server. lets say
<rootElement>
<childElement type="1"></childElement>
<childElement type="2"></childElement>
<childElement type="3"></childElement>
</rootElement>
The JAXB unmarshling is working fine for childElement 1, childElement2 and so on. however, no sooner did the childelement 3 is finised, it is suppose to move onward but what it does that it creates another childElement with empty strings.
Lets say that eclipse is showing me childElement1 as an object with some valid values but when i see the childElement4 it shows me "" everywhere. hence the result is I get exception when that particular object is transformed from JAXB object to my VO.
Could someone guide me what would be possible reason? I am unable to debugg from where should i start.
its jaxb v 1.3 | java | xml | web-services | jaxb | null | null | open | JAXB Parsing - weird behavior
===
I am receiving a valid XML from server. lets say
<rootElement>
<childElement type="1"></childElement>
<childElement type="2"></childElement>
<childElement type="3"></childElement>
</rootElement>
The JAXB unmarshling is working fine for childElement 1, childElement2 and so on. however, no sooner did the childelement 3 is finised, it is suppose to move onward but what it does that it creates another childElement with empty strings.
Lets say that eclipse is showing me childElement1 as an object with some valid values but when i see the childElement4 it shows me "" everywhere. hence the result is I get exception when that particular object is transformed from JAXB object to my VO.
Could someone guide me what would be possible reason? I am unable to debugg from where should i start.
its jaxb v 1.3 | 0 |
11,272,254 | 06/30/2012 07:17:12 | 1,481,713 | 06/26/2012 05:22:46 | 31 | 1 | How to read html table in c# | <table id="mytable" runat="server">
<thead>
<tr>
<td >
</td>
<td>
Minute
</td>
<td
Category Name
</td>
</tr>
</thead>
<tbody>
<tr>
<td >
10
</td>
<td>
</td>
<td>
<span></span>
</td>
</tr>
<tr >
<td>
</td>
<td>
15
</td>
<td>
<span></span>
</td>
</tr>
</table>
This is my html table Here i have to find first cell second cell third cell data of each row in c# How can i find.This is my html table Here i have to find first cell second cell third cell data of each row in c# How can i find | c# | asp.net | null | null | null | 07/02/2012 14:01:55 | not a real question | How to read html table in c#
===
<table id="mytable" runat="server">
<thead>
<tr>
<td >
</td>
<td>
Minute
</td>
<td
Category Name
</td>
</tr>
</thead>
<tbody>
<tr>
<td >
10
</td>
<td>
</td>
<td>
<span></span>
</td>
</tr>
<tr >
<td>
</td>
<td>
15
</td>
<td>
<span></span>
</td>
</tr>
</table>
This is my html table Here i have to find first cell second cell third cell data of each row in c# How can i find.This is my html table Here i have to find first cell second cell third cell data of each row in c# How can i find | 1 |
311,802 | 11/22/2008 21:35:04 | 38,522 | 11/18/2008 10:18:37 | 247 | 6 | W3C Involvement In Flash & Silverlight | It seems to me that the key USP of Flash/Silverlight is the ability to provide access (albeit indirectly) to the graphics subsystem of the client, enabling video, smooth transitions and "fancy" visual effects.
This sounds like a good idea, and a natural evolution/extension of HTML. But surely it would be better if someone like the W3C controlled such a technology, rather than Microsoft or Adobe locking users into their "platform".
Has the W3C taken a role in the development of these technologies, and if not, why? | flash | silverlight | w3c | html | null | null | open | W3C Involvement In Flash & Silverlight
===
It seems to me that the key USP of Flash/Silverlight is the ability to provide access (albeit indirectly) to the graphics subsystem of the client, enabling video, smooth transitions and "fancy" visual effects.
This sounds like a good idea, and a natural evolution/extension of HTML. But surely it would be better if someone like the W3C controlled such a technology, rather than Microsoft or Adobe locking users into their "platform".
Has the W3C taken a role in the development of these technologies, and if not, why? | 0 |
6,267,545 | 06/07/2011 15:22:25 | 676,424 | 03/25/2011 09:23:28 | 69 | 1 | Reducing the granularity of a data set | I have an in-memory cache which stores a set of information by a certain level of aggregation - in the Students example below let's say I store it by Year, Subject, Teacher:
# Students Year Subject Teacher
1 30 7 Math Mrs Smith
2 28 7 Math Mr Cork
3 20 8 Math Mrs Smith
4 20 8 English Mr White
5 18 8 English Mr Book
6 10 12 Math Mrs Jones
Now unfortunately my cache doesn't have GROUP BY or similar functions - so when I want to look at things at a higher level of aggregation, I will have to 'roll up' the data myself. For example, if I aggregate Students by Year, Subject the aforementioned data would look like so:
# Students Year Subject
1 58 7 Math
2 20 8 Math
3 38 8 English
4 10 12 Math
My question is thus - how would I best do this in Java? Theoretically I could be pulling back tens of thousands of objects from this cache, so being able to 'roll up' these collections quickly may become very important.
My initial (perhaps naive) thought would be to do something along the following lines;
Until I exhaust the list of records:
- Each 'unique' record that I come
across is added as a key to a
hashmap.
- If I encounter a record that
has the same data for this new level
of aggregation, add its quantity to
the existing one.
Now for all I know this is a fairly common problem and there's much better ways of doing this. So I'd welcome any feedback as to whether I'm pointing myself in the right direction.
"Get a new cache" not an option I'm afraid :)
-Dave. | java | algorithm | aggregate | null | null | null | open | Reducing the granularity of a data set
===
I have an in-memory cache which stores a set of information by a certain level of aggregation - in the Students example below let's say I store it by Year, Subject, Teacher:
# Students Year Subject Teacher
1 30 7 Math Mrs Smith
2 28 7 Math Mr Cork
3 20 8 Math Mrs Smith
4 20 8 English Mr White
5 18 8 English Mr Book
6 10 12 Math Mrs Jones
Now unfortunately my cache doesn't have GROUP BY or similar functions - so when I want to look at things at a higher level of aggregation, I will have to 'roll up' the data myself. For example, if I aggregate Students by Year, Subject the aforementioned data would look like so:
# Students Year Subject
1 58 7 Math
2 20 8 Math
3 38 8 English
4 10 12 Math
My question is thus - how would I best do this in Java? Theoretically I could be pulling back tens of thousands of objects from this cache, so being able to 'roll up' these collections quickly may become very important.
My initial (perhaps naive) thought would be to do something along the following lines;
Until I exhaust the list of records:
- Each 'unique' record that I come
across is added as a key to a
hashmap.
- If I encounter a record that
has the same data for this new level
of aggregation, add its quantity to
the existing one.
Now for all I know this is a fairly common problem and there's much better ways of doing this. So I'd welcome any feedback as to whether I'm pointing myself in the right direction.
"Get a new cache" not an option I'm afraid :)
-Dave. | 0 |
10,479,104 | 05/07/2012 08:42:38 | 1,277,961 | 03/19/2012 06:23:55 | -4 | 0 | how do i know how many users are online | i did not find my answer by viewing other question.
As i wanted to make online chat application for my web site
Many answers says that store users status to 1 so that we can identify who is login
on Logut i will make status to 0
yes this is good idea but my confusion is that if someone not logut and close the browser or user's session expire in anyway how do i set status to 0
| php | null | null | null | null | null | open | how do i know how many users are online
===
i did not find my answer by viewing other question.
As i wanted to make online chat application for my web site
Many answers says that store users status to 1 so that we can identify who is login
on Logut i will make status to 0
yes this is good idea but my confusion is that if someone not logut and close the browser or user's session expire in anyway how do i set status to 0
| 0 |
10,019,262 | 04/04/2012 21:08:31 | 411,965 | 08/05/2010 12:59:15 | 1,393 | 46 | does guice make my code less readable | I just started to use Guice.
When I am using guice my application classes get loosly coupled.
Is using google guice make the code less readbale, less clear, more complicated to understand and debug?
How is your experience with it? | java | guice | null | null | null | 04/05/2012 09:09:28 | off topic | does guice make my code less readable
===
I just started to use Guice.
When I am using guice my application classes get loosly coupled.
Is using google guice make the code less readbale, less clear, more complicated to understand and debug?
How is your experience with it? | 2 |
4,084,427 | 11/03/2010 05:25:33 | 485,358 | 10/23/2010 23:18:04 | 6 | 2 | how to create a fact in swi prolog | I just want to create something like: like(x,y).
I've been trying for a long time and am really frustrated, could anyone please tell me how to do it???!!!
thx. | prolog | null | null | null | null | null | open | how to create a fact in swi prolog
===
I just want to create something like: like(x,y).
I've been trying for a long time and am really frustrated, could anyone please tell me how to do it???!!!
thx. | 0 |
602,688 | 03/02/2009 15:14:08 | 29,620 | 10/20/2008 13:59:18 | 216 | 12 | What's the best way of dealing with AWT Graphics contexts? | Some users of our Swing application have reported weird artefacts appearing on the display. This ranges from components not repainting themselves properly for a second or two, right upto whole portions of the application being repainted like tiled wallpaper over areas of the window.
The app has been worked on by developers of all levels between experienced Java guys to young chaps right out of university over the course of five years or so, and as you'd expect, some of the AWT code is an outright mess. I'm now faced with the task of trying to correct as much of the badness as I can over the next few months or so.
Some of this is easy to deal with. Deal with components only on the event dispatch thread, IO asynchronously, kind of thing, and I'm hopefully getting the message across to the rest of the team.
What I'd like to know is the best way of dealing with Graphics contexts, especially in a paintComponent() context. I see a lot of...
public void paintComponent( Graphics g ) {
super.paintComponent( g );
Graphics2D gfx = (Graphics2D)g;
// ...Whole lotta drawing code...
}
Is it better practice to do this?
public void paintComponent( Graphics g ) {
super.paintComponent( g );
Graphics2D gfx = (Graphics2D)g.create();
// ...Whole lotta drawing code...
gfx.dispose();
}
If the g parameter is going to be reused in other paints then don't I need to restore it to a good state, undo AffineTransforms, etc.?
| java | awt | swing | graphics | null | null | open | What's the best way of dealing with AWT Graphics contexts?
===
Some users of our Swing application have reported weird artefacts appearing on the display. This ranges from components not repainting themselves properly for a second or two, right upto whole portions of the application being repainted like tiled wallpaper over areas of the window.
The app has been worked on by developers of all levels between experienced Java guys to young chaps right out of university over the course of five years or so, and as you'd expect, some of the AWT code is an outright mess. I'm now faced with the task of trying to correct as much of the badness as I can over the next few months or so.
Some of this is easy to deal with. Deal with components only on the event dispatch thread, IO asynchronously, kind of thing, and I'm hopefully getting the message across to the rest of the team.
What I'd like to know is the best way of dealing with Graphics contexts, especially in a paintComponent() context. I see a lot of...
public void paintComponent( Graphics g ) {
super.paintComponent( g );
Graphics2D gfx = (Graphics2D)g;
// ...Whole lotta drawing code...
}
Is it better practice to do this?
public void paintComponent( Graphics g ) {
super.paintComponent( g );
Graphics2D gfx = (Graphics2D)g.create();
// ...Whole lotta drawing code...
gfx.dispose();
}
If the g parameter is going to be reused in other paints then don't I need to restore it to a good state, undo AffineTransforms, etc.?
| 0 |
763,464 | 04/18/2009 13:49:05 | 82,044 | 03/24/2009 14:25:15 | 68 | 0 | What's the HARDEST program you've written? | Just curious, I'm wondering what all you experienced programmers or newbies (like me) out there have done. So what's the HARDEST most complicated program you've written? | hard | code-complexity | programmer-skills | null | null | 06/26/2012 23:06:41 | off topic | What's the HARDEST program you've written?
===
Just curious, I'm wondering what all you experienced programmers or newbies (like me) out there have done. So what's the HARDEST most complicated program you've written? | 2 |
1,408,774 | 09/11/2009 03:02:37 | 168,394 | 09/04/2009 09:02:45 | 6 | 2 | objective c delegate explanation with example |
i read a lot about objective c delegate but didn't get clear idea.Can anyone explain it with
a good and precise example so that i can understand it. Advanced thanks for your reply. | objective | c | null | null | null | null | open | objective c delegate explanation with example
===
i read a lot about objective c delegate but didn't get clear idea.Can anyone explain it with
a good and precise example so that i can understand it. Advanced thanks for your reply. | 0 |
968,748 | 06/09/2009 08:01:24 | 119,655 | 06/09/2009 07:59:50 | 1 | 0 | What spellchecker does StackOverflow use? | I'm sold on the WMD textarea and markdown, but I'd like to give the same features to my users too! | wmd | spellchecking | null | null | null | 06/09/2009 10:20:33 | off topic | What spellchecker does StackOverflow use?
===
I'm sold on the WMD textarea and markdown, but I'd like to give the same features to my users too! | 2 |
3,201,272 | 07/08/2010 06:53:34 | 386,321 | 07/08/2010 06:53:34 | 1 | 0 | how to create tables in HTML which support all (IE, safari ,firefox) browsers? | table row background color supports in IE but not in safari | html | null | null | null | null | 07/08/2010 09:37:33 | not a real question | how to create tables in HTML which support all (IE, safari ,firefox) browsers?
===
table row background color supports in IE but not in safari | 1 |
11,114,630 | 06/20/2012 07:17:58 | 1,468,340 | 06/20/2012 06:47:09 | 1 | 0 | video with iframe doesn't display on Android Webview | I am working on an android project( API level 8 ) displaying webview from another website which I cannot change the code of these website. I am having trouble with video clip in webview on some devices that does not enable Force GPU rendering (in settings --> Developer options). The following codes are the codes that I read from the website
<center><iframe width=\"500\" height=\"315\" src=\"http:\/\/www.youtube.com\/embed\/bf7wpubnyIE\" frameborder=\"0\" allowfullscreen><\/iframe><\/center> <br \/>
and
<center> <iframe frameborder=\"0\" width=\"480\" height=\"323\" src=\"http:\/\/www.dailymotion.com\/embed\/video\/xrmnk1\"><\/iframe> <\/center><br \/>
On android side I already enable several settings which are
webview.setWebChromeClient(new WebChromeClient());
webview.setWebViewClient(new WebViewClient());
webview.getSettings().setJavaScriptEnabled(true);
webview.getSettings().setPluginsEnabled(true);
I believe I cant use `android:hardwareAccelerated="true"` since I am working on API level 8
When I turn off Force GPU rendering the error on logcat are shown as follows
06-20 14:04:24.455: W/webview(28201): at android.webkit.WebView.checkThread(WebView.java:9468)
06-20 14:04:24.455: W/webview(28201): at android.webkit.WebView.loadDataWithBaseURL(WebView.java:2186)
06-20 14:04:24.455: W/webview(28201): at com.tss.one.MainDetail$1.run(MainDetail.java:144)
06-20 14:04:24.455: W/webview(28201): at java.lang.Thread.run(Thread.java:856)
06-20 14:04:24.533: V/PhoneStatusBar(10977): setLightsOn(true)
06-20 14:04:24.697: I/ActivityManager(10909): Displayed com.tss.one/.MainDetail: +614ms
06-20 14:04:27.197: D/libEGL(28201): loaded /system/lib/egl/libGLES_android.so
06-20 14:04:27.205: D/libEGL(28201): loaded /vendor/lib/egl/libEGL_POWERVR_SGX540_120.so
06-20 14:04:27.221: D/libEGL(28201): loaded /vendor/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.so
06-20 14:04:27.229: D/libEGL(28201): loaded /vendor/lib/egl/libGLESv2_POWERVR_SGX540_120.so
06-20 14:04:27.729: E/Web Console(28201): Unsafe JavaScript attempt to access frame with URL about:blank from frame with URL http://www.youtube.com/embed/bf7wpubnyIE. Domains, protocols and ports must match.
06-20 14:04:27.729: E/Web Console(28201): at null:1
06-20 14:04:27.838: E/libEGL(28201): call to OpenGL ES API with no current context (logged once per thread)
06-20 14:04:27.838: D/ShaderProgram(28201): couldn't load the vertex shader!
06-20 14:04:27.838: D/ShaderProgram(28201): couldn't load the vertex shader!
06-20 14:04:27.838: D/ShaderProgram(28201): couldn't load the vertex shader!
06-20 14:04:27.838: D/ShaderProgram(28201): couldn't load the vertex shader!
06-20 14:04:27.838: D/ShaderProgram(28201): couldn't load the vertex shader!
06-20 14:04:28.213: D/dalvikvm(28201): GC_CONCURRENT freed 3468K, 17% free 20475K/24519K, paused 3ms+2ms
06-20 14:04:29.783: E/Web Console(28201): Uncaught Error: INDEX_SIZE_ERR: DOM Exception 1 at http://static1.dmcdn.net/js/gen/widget/pack/player.js.v91ec0434953824904:1
06-20 14:04:29.791: D/MediaPlayer(28201): Couldn't open file on client side, trying server side
06-20 14:04:29.791: I/AwesomePlayer(10888): setDataSource_l('http://www.dailymotion.com/cdn/H264-512x384/video/xrmnk1.mp4?auth=1340348666-9f8ec9001ccce92feec18d9419b07065&helper=0')
06-20 14:04:29.791: V/ChromiumHTTPDataSource(10888): connect on behalf of uid 10124
06-20 14:04:29.791: I/ChromiumHTTPDataSource(10888): connect to http://www.dailymotion.com/cdn/H264-512x384/video/xrmnk1.mp4?auth=1340348666-9f8ec9001ccce92feec18d9419b07065&helper=0 @0
06-20 14:04:33.291: I/SampleTable(10888): There are reordered frames present.
06-20 14:04:33.299: I/OMXCodec(10888): [OMX.TI.DUCATI1.VIDEO.DECODER] AVC profile = 66 (Baseline), level = 30
06-20 14:04:33.299: I/OMXCodec(10888): [OMX.TI.DUCATI1.VIDEO.DECODER] video dimensions are 512 x 344
06-20 14:04:33.299: I/OMXCodec(10888): [OMX.TI.DUCATI1.VIDEO.DECODER] Crop rect is 512 x 344 @ (0, 0)
06-20 14:04:34.432: I/OMXCodec(10888): [OMX.TI.DUCATI1.VIDEO.DECODER] video dimensions are 640 x 448
06-20 14:04:34.432: I/OMXCodec(10888): [OMX.TI.DUCATI1.VIDEO.DECODER] Crop rect is 512 x 344 @ (0, 0)
06-20 14:04:34.604: I/OMXCodec(10888): [OMX.TI.DUCATI1.VIDEO.DECODER] video dimensions are 640 x 448
06-20 14:04:34.604: I/OMXCodec(10888): [OMX.TI.DUCATI1.VIDEO.DECODER] Crop rect is 512 x 344 @ (32, 24)
06-20 14:04:34.612: W/SoftAAC(10888): Sample rate was 44100 Hz, but now is 22050 Hz
06-20 14:04:39.666: I/NuCachedSource2(10888): ERROR_END_OF_STREAM
| android | video | iframe | webview | video-streaming | null | open | video with iframe doesn't display on Android Webview
===
I am working on an android project( API level 8 ) displaying webview from another website which I cannot change the code of these website. I am having trouble with video clip in webview on some devices that does not enable Force GPU rendering (in settings --> Developer options). The following codes are the codes that I read from the website
<center><iframe width=\"500\" height=\"315\" src=\"http:\/\/www.youtube.com\/embed\/bf7wpubnyIE\" frameborder=\"0\" allowfullscreen><\/iframe><\/center> <br \/>
and
<center> <iframe frameborder=\"0\" width=\"480\" height=\"323\" src=\"http:\/\/www.dailymotion.com\/embed\/video\/xrmnk1\"><\/iframe> <\/center><br \/>
On android side I already enable several settings which are
webview.setWebChromeClient(new WebChromeClient());
webview.setWebViewClient(new WebViewClient());
webview.getSettings().setJavaScriptEnabled(true);
webview.getSettings().setPluginsEnabled(true);
I believe I cant use `android:hardwareAccelerated="true"` since I am working on API level 8
When I turn off Force GPU rendering the error on logcat are shown as follows
06-20 14:04:24.455: W/webview(28201): at android.webkit.WebView.checkThread(WebView.java:9468)
06-20 14:04:24.455: W/webview(28201): at android.webkit.WebView.loadDataWithBaseURL(WebView.java:2186)
06-20 14:04:24.455: W/webview(28201): at com.tss.one.MainDetail$1.run(MainDetail.java:144)
06-20 14:04:24.455: W/webview(28201): at java.lang.Thread.run(Thread.java:856)
06-20 14:04:24.533: V/PhoneStatusBar(10977): setLightsOn(true)
06-20 14:04:24.697: I/ActivityManager(10909): Displayed com.tss.one/.MainDetail: +614ms
06-20 14:04:27.197: D/libEGL(28201): loaded /system/lib/egl/libGLES_android.so
06-20 14:04:27.205: D/libEGL(28201): loaded /vendor/lib/egl/libEGL_POWERVR_SGX540_120.so
06-20 14:04:27.221: D/libEGL(28201): loaded /vendor/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.so
06-20 14:04:27.229: D/libEGL(28201): loaded /vendor/lib/egl/libGLESv2_POWERVR_SGX540_120.so
06-20 14:04:27.729: E/Web Console(28201): Unsafe JavaScript attempt to access frame with URL about:blank from frame with URL http://www.youtube.com/embed/bf7wpubnyIE. Domains, protocols and ports must match.
06-20 14:04:27.729: E/Web Console(28201): at null:1
06-20 14:04:27.838: E/libEGL(28201): call to OpenGL ES API with no current context (logged once per thread)
06-20 14:04:27.838: D/ShaderProgram(28201): couldn't load the vertex shader!
06-20 14:04:27.838: D/ShaderProgram(28201): couldn't load the vertex shader!
06-20 14:04:27.838: D/ShaderProgram(28201): couldn't load the vertex shader!
06-20 14:04:27.838: D/ShaderProgram(28201): couldn't load the vertex shader!
06-20 14:04:27.838: D/ShaderProgram(28201): couldn't load the vertex shader!
06-20 14:04:28.213: D/dalvikvm(28201): GC_CONCURRENT freed 3468K, 17% free 20475K/24519K, paused 3ms+2ms
06-20 14:04:29.783: E/Web Console(28201): Uncaught Error: INDEX_SIZE_ERR: DOM Exception 1 at http://static1.dmcdn.net/js/gen/widget/pack/player.js.v91ec0434953824904:1
06-20 14:04:29.791: D/MediaPlayer(28201): Couldn't open file on client side, trying server side
06-20 14:04:29.791: I/AwesomePlayer(10888): setDataSource_l('http://www.dailymotion.com/cdn/H264-512x384/video/xrmnk1.mp4?auth=1340348666-9f8ec9001ccce92feec18d9419b07065&helper=0')
06-20 14:04:29.791: V/ChromiumHTTPDataSource(10888): connect on behalf of uid 10124
06-20 14:04:29.791: I/ChromiumHTTPDataSource(10888): connect to http://www.dailymotion.com/cdn/H264-512x384/video/xrmnk1.mp4?auth=1340348666-9f8ec9001ccce92feec18d9419b07065&helper=0 @0
06-20 14:04:33.291: I/SampleTable(10888): There are reordered frames present.
06-20 14:04:33.299: I/OMXCodec(10888): [OMX.TI.DUCATI1.VIDEO.DECODER] AVC profile = 66 (Baseline), level = 30
06-20 14:04:33.299: I/OMXCodec(10888): [OMX.TI.DUCATI1.VIDEO.DECODER] video dimensions are 512 x 344
06-20 14:04:33.299: I/OMXCodec(10888): [OMX.TI.DUCATI1.VIDEO.DECODER] Crop rect is 512 x 344 @ (0, 0)
06-20 14:04:34.432: I/OMXCodec(10888): [OMX.TI.DUCATI1.VIDEO.DECODER] video dimensions are 640 x 448
06-20 14:04:34.432: I/OMXCodec(10888): [OMX.TI.DUCATI1.VIDEO.DECODER] Crop rect is 512 x 344 @ (0, 0)
06-20 14:04:34.604: I/OMXCodec(10888): [OMX.TI.DUCATI1.VIDEO.DECODER] video dimensions are 640 x 448
06-20 14:04:34.604: I/OMXCodec(10888): [OMX.TI.DUCATI1.VIDEO.DECODER] Crop rect is 512 x 344 @ (32, 24)
06-20 14:04:34.612: W/SoftAAC(10888): Sample rate was 44100 Hz, but now is 22050 Hz
06-20 14:04:39.666: I/NuCachedSource2(10888): ERROR_END_OF_STREAM
| 0 |
11,340,227 | 07/05/2012 08:06:36 | 1,071,416 | 11/29/2011 13:51:54 | 101 | 8 | Math assistance with my Grid: nth-child(an+b) | I am trying to make a grid that is not dependent on a preset number of columns. I created a small sample to show the situation:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Grid in HTML5 and CSS3</title>
<style>
* {margin:0;padding:0;}
.row {display:block;position:relative;clear:both;}
.row>* ,.gold>* {display:block;position:relative;clear:both;float:left;clear:none;width:100%;}
.row>*:empty, .gold>*:empty {width:0px;}
/* one column in the row */
.row>:nth-last-child(1):nth-child(1) {width:100%;}
/* two columns in the row */
.row>:nth-last-child(2):nth-child(1) {width:50%;}
.row>:nth-last-child(1):nth-child(2) {width:50%;}
/* three columns in the row */
.row>:nth-last-child(3):nth-child(1) {width:33.33%;}
.row>:nth-last-child(2):nth-child(2) {width:33.33%;}
.row>:nth-last-child(1):nth-child(3) {width:33.34%;}
.row>:empty:nth-last-child(3):nth-child(1)+:not(:empty) {width:66.66%;}
.row>:empty:nth-last-child(2):nth-child(2)+:not(:empty) {width:66.67%;}
article {margin:.5em;border:1px solid green;border-radius:.3em;padding:.5em; }
</style>
</head>
<body>
<section class="row">
<div>
<article>
<p>This row has only one child.</p>
</article>
</div>
</section>
<section class="row">
<div>
<article>
<p>This row has two children</p>
</article>
</div>
<div>
<article>
<p>This is the second child</p>
</article>
</div>
</section>
<section class="row">
<div>
<article>
<p>
This row has three children
</p>
</article>
</div>
<div>
<article>
<p>So this is col 2 of 3</p>
</article>
</div>
<div>
<article>
<p>And this is col 3 of 3.</p>
</article>
</div>
</section>
<section class="row">
<div></div>
<div>
<article>
<p>The first child of this row is empty so spanned with the second</p>
</article>
</div>
<div>
<article>
<p>This is the second column</p>
</article>
</div>
</section>
<section class="row">
<div>
<article>
<p>This is the first column</p>
</article>
</div>
<div></div>
<div>
<article>
<p>The second and third column are spanned</p>
</article>
</div>
</section>
</body>
</html>
I put a larger sample - describing the problems in more detail - on jsfiddle at
http://jsfiddle.net/jordenvanforeest/MDv32/
My problem now is that if you want this grid to accomodate for more than 3 columns, the CSS-size gets big exponentially. So I am looking for an other solution. I tried to do something like
.row>:nth-last-child(an+b):nth-child(cn+d) {}
but my calculus skills are a bit rusty and I cannot get it to work properly.
Help would be much appreciated.
| css | css3 | null | null | null | null | open | Math assistance with my Grid: nth-child(an+b)
===
I am trying to make a grid that is not dependent on a preset number of columns. I created a small sample to show the situation:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Grid in HTML5 and CSS3</title>
<style>
* {margin:0;padding:0;}
.row {display:block;position:relative;clear:both;}
.row>* ,.gold>* {display:block;position:relative;clear:both;float:left;clear:none;width:100%;}
.row>*:empty, .gold>*:empty {width:0px;}
/* one column in the row */
.row>:nth-last-child(1):nth-child(1) {width:100%;}
/* two columns in the row */
.row>:nth-last-child(2):nth-child(1) {width:50%;}
.row>:nth-last-child(1):nth-child(2) {width:50%;}
/* three columns in the row */
.row>:nth-last-child(3):nth-child(1) {width:33.33%;}
.row>:nth-last-child(2):nth-child(2) {width:33.33%;}
.row>:nth-last-child(1):nth-child(3) {width:33.34%;}
.row>:empty:nth-last-child(3):nth-child(1)+:not(:empty) {width:66.66%;}
.row>:empty:nth-last-child(2):nth-child(2)+:not(:empty) {width:66.67%;}
article {margin:.5em;border:1px solid green;border-radius:.3em;padding:.5em; }
</style>
</head>
<body>
<section class="row">
<div>
<article>
<p>This row has only one child.</p>
</article>
</div>
</section>
<section class="row">
<div>
<article>
<p>This row has two children</p>
</article>
</div>
<div>
<article>
<p>This is the second child</p>
</article>
</div>
</section>
<section class="row">
<div>
<article>
<p>
This row has three children
</p>
</article>
</div>
<div>
<article>
<p>So this is col 2 of 3</p>
</article>
</div>
<div>
<article>
<p>And this is col 3 of 3.</p>
</article>
</div>
</section>
<section class="row">
<div></div>
<div>
<article>
<p>The first child of this row is empty so spanned with the second</p>
</article>
</div>
<div>
<article>
<p>This is the second column</p>
</article>
</div>
</section>
<section class="row">
<div>
<article>
<p>This is the first column</p>
</article>
</div>
<div></div>
<div>
<article>
<p>The second and third column are spanned</p>
</article>
</div>
</section>
</body>
</html>
I put a larger sample - describing the problems in more detail - on jsfiddle at
http://jsfiddle.net/jordenvanforeest/MDv32/
My problem now is that if you want this grid to accomodate for more than 3 columns, the CSS-size gets big exponentially. So I am looking for an other solution. I tried to do something like
.row>:nth-last-child(an+b):nth-child(cn+d) {}
but my calculus skills are a bit rusty and I cannot get it to work properly.
Help would be much appreciated.
| 0 |
7,443,098 | 09/16/2011 10:06:13 | 727,208 | 04/27/2011 12:11:55 | 2,646 | 182 | jQuery.getJSON() doesn't work on IE7 | This is the line i am trying to execute and it *does not work* ( i know .. it is annoying statement ):
$.getJSON('/index.php/list/' + query , target.populate );
It works like expected on all browsers but IE7. After inspecting server access logs, i conclude that request is never sent.
Same code works fine on IE9 and using full URL had no effect.
Ideas ? | jquery | internet-explorer-7 | null | null | null | 06/04/2012 00:43:07 | too localized | jQuery.getJSON() doesn't work on IE7
===
This is the line i am trying to execute and it *does not work* ( i know .. it is annoying statement ):
$.getJSON('/index.php/list/' + query , target.populate );
It works like expected on all browsers but IE7. After inspecting server access logs, i conclude that request is never sent.
Same code works fine on IE9 and using full URL had no effect.
Ideas ? | 3 |
4,021,419 | 10/26/2010 07:10:29 | 104,422 | 05/10/2009 17:10:35 | 68 | 12 | What is the best book about osdev? | What is the best book about operating systems development and programming? What books can be more helpful for those looking to program operating systems? | operating-system | osdev | system-programming | null | null | 08/01/2012 02:23:03 | not constructive | What is the best book about osdev?
===
What is the best book about operating systems development and programming? What books can be more helpful for those looking to program operating systems? | 4 |
243,655 | 10/28/2008 15:06:43 | 31,765 | 10/27/2008 11:24:19 | 1 | 1 | What is the best open source .NET content management system (CMS)? | I'm trying to find a decent (ie cheap / free) .NET content management system. DotNetNuke is not an option as far as I am concerned.
Wish list:
1. Works out of the box
2. Easy to install
3. Simple clean interface
4. Skinable / template driven
5. Free or cheap
6. Open source preferred
Or is is just better to PHP for this kind of thing? If so, what should I be checking out?
Thanks :D | content-management-system | .net | asp.net | content-management | null | 04/05/2012 18:38:58 | not constructive | What is the best open source .NET content management system (CMS)?
===
I'm trying to find a decent (ie cheap / free) .NET content management system. DotNetNuke is not an option as far as I am concerned.
Wish list:
1. Works out of the box
2. Easy to install
3. Simple clean interface
4. Skinable / template driven
5. Free or cheap
6. Open source preferred
Or is is just better to PHP for this kind of thing? If so, what should I be checking out?
Thanks :D | 4 |
5,861,238 | 05/02/2011 19:00:52 | 5,287 | 09/08/2008 21:29:47 | 6,794 | 249 | Is it possible to bind to a value in Properties.Settings.Default? | Is it possible to bind to a value in Properties.Settings.Default in a way that will keep my UI current with the value stored there?
I have a class:
public class FavoritePlayer
{
public string Name
{
get
{
return wpfSample021.Properties.Settings.Default.FavoritePlayer.ToString();
}
set
{
wpfSample021.Properties.Settings.Default.FavoritePlayer = value;
}
}
}
In my XAML, I have a resource:
<local:FavoritePlayer x:Key="fvPlayer"/>
and a binding:
<Label DataContext="{DynamicResource fvPlayer}" Content="{Binding Path=Name}" Foreground="Red"
HorizontalAlignment="Center" Margin="5"/>
What I would like is for the data-binding to update any time the property is changed. Is there a way to do this?
| wpf | data-binding | properties.settings | null | null | null | open | Is it possible to bind to a value in Properties.Settings.Default?
===
Is it possible to bind to a value in Properties.Settings.Default in a way that will keep my UI current with the value stored there?
I have a class:
public class FavoritePlayer
{
public string Name
{
get
{
return wpfSample021.Properties.Settings.Default.FavoritePlayer.ToString();
}
set
{
wpfSample021.Properties.Settings.Default.FavoritePlayer = value;
}
}
}
In my XAML, I have a resource:
<local:FavoritePlayer x:Key="fvPlayer"/>
and a binding:
<Label DataContext="{DynamicResource fvPlayer}" Content="{Binding Path=Name}" Foreground="Red"
HorizontalAlignment="Center" Margin="5"/>
What I would like is for the data-binding to update any time the property is changed. Is there a way to do this?
| 0 |
2,640,317 | 04/14/2010 19:14:29 | 130,442 | 06/29/2009 13:10:55 | 822 | 27 | "Tracking" connections with Thrift | I am trying to create a game using Thrift, so that the clients are the players, and the server manages the boards, much like [this][1]. However, I cannot figure out how Facebook's Thrift server can "track" the user, i.e. when calling `attack()` on [their service][2], I do not have to identify myself again.
According to what the generated server stub suggests, there is no way to do this:
int main(int argc, char **argv) {
int port = 9090;
shared_ptr<ConnectFourHandler> handler(new ConnectFourHandler());
shared_ptr<TProcessor> processor(new ConnectFourProcessor(handler));
shared_ptr<TServerTransport> serverTransport(new TServerSocket(port));
shared_ptr<TTransportFactory> transportFactory(new TBufferedTransportFactory());
shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory());
TSimpleServer server(processor, serverTransport, transportFactory, protocolFactory);
server.serve();
return 0;
}
In that example, there is only one handler being created for the server, and the server is what accepts connections.
How is Facebook able to keep track of what clients are connected to the server, if all requests are routed through only one handler per server?
[1]: http://www.facebook.com/careers/puzzles.php?puzzle_id=14
[2]: http://www.facebook.com/jobs_puzzles/battleship2.thrift | thrift | c++ | rpc | null | null | null | open | "Tracking" connections with Thrift
===
I am trying to create a game using Thrift, so that the clients are the players, and the server manages the boards, much like [this][1]. However, I cannot figure out how Facebook's Thrift server can "track" the user, i.e. when calling `attack()` on [their service][2], I do not have to identify myself again.
According to what the generated server stub suggests, there is no way to do this:
int main(int argc, char **argv) {
int port = 9090;
shared_ptr<ConnectFourHandler> handler(new ConnectFourHandler());
shared_ptr<TProcessor> processor(new ConnectFourProcessor(handler));
shared_ptr<TServerTransport> serverTransport(new TServerSocket(port));
shared_ptr<TTransportFactory> transportFactory(new TBufferedTransportFactory());
shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory());
TSimpleServer server(processor, serverTransport, transportFactory, protocolFactory);
server.serve();
return 0;
}
In that example, there is only one handler being created for the server, and the server is what accepts connections.
How is Facebook able to keep track of what clients are connected to the server, if all requests are routed through only one handler per server?
[1]: http://www.facebook.com/careers/puzzles.php?puzzle_id=14
[2]: http://www.facebook.com/jobs_puzzles/battleship2.thrift | 0 |
10,564,789 | 05/12/2012 14:56:14 | 1,103,080 | 12/17/2011 04:39:51 | 8 | 0 | mIRC bot - copy/paste lines in 2 channels | I’m a noob in mirc scripting, and I need some help.
1. there’s 2 irc channels. let’s call then #channel1 and #channel2;
2. There’s 2 bots. One is mine, let’s call him “mybot” (my bot is in both channels). The other bot is from a third person, let’s call him “otherBot”;
What I need is… let me make an example to better explain.
a) in #channel1 some user type:
[14:38:48] <@someuser> !user xpto
At this time, “mybot” is in both channels. he reads the command “!user*” and copy/paste it in #channel2, where the “otherBot” will recognize the command “!user*” and will paste some information about this command.
b) so, in #channel2 it will append something like:
[14:38:50] <@ mybot > !user xpto
[14:38:52] <@ otherBot > User name is xpto and he likes popatos.
Now I want that “mybot” reads the information provided by the “otherBot” and then paste it on #channel1
c) so, in #channel1:
[14:38:54] <@ mybot > User name is xpto and he likes popatos.
So far I have the fowling code in my remote:
on *:TEXT:!user*:#channel1 {
/msg # channel2 $1-
}
on *:TEXT:User name*:#channel2 {
if $address($nick,2) == *!*@otherBot.users.gameea {
/msg # channel1 $1-
}
}
This works fine, but have a problem: if someone else ( not “mybot” ) type “!user kakaka” in #channel2, “mybot” will also copy/paste the information provided by the “otherBot” and then paste it on #channel1. And I only want that “mybot” copy/paste only the information that “mybot” ask to “otherBot”.
Any suggestion?
Thanks!
| irc | mirc | null | null | null | null | open | mIRC bot - copy/paste lines in 2 channels
===
I’m a noob in mirc scripting, and I need some help.
1. there’s 2 irc channels. let’s call then #channel1 and #channel2;
2. There’s 2 bots. One is mine, let’s call him “mybot” (my bot is in both channels). The other bot is from a third person, let’s call him “otherBot”;
What I need is… let me make an example to better explain.
a) in #channel1 some user type:
[14:38:48] <@someuser> !user xpto
At this time, “mybot” is in both channels. he reads the command “!user*” and copy/paste it in #channel2, where the “otherBot” will recognize the command “!user*” and will paste some information about this command.
b) so, in #channel2 it will append something like:
[14:38:50] <@ mybot > !user xpto
[14:38:52] <@ otherBot > User name is xpto and he likes popatos.
Now I want that “mybot” reads the information provided by the “otherBot” and then paste it on #channel1
c) so, in #channel1:
[14:38:54] <@ mybot > User name is xpto and he likes popatos.
So far I have the fowling code in my remote:
on *:TEXT:!user*:#channel1 {
/msg # channel2 $1-
}
on *:TEXT:User name*:#channel2 {
if $address($nick,2) == *!*@otherBot.users.gameea {
/msg # channel1 $1-
}
}
This works fine, but have a problem: if someone else ( not “mybot” ) type “!user kakaka” in #channel2, “mybot” will also copy/paste the information provided by the “otherBot” and then paste it on #channel1. And I only want that “mybot” copy/paste only the information that “mybot” ask to “otherBot”.
Any suggestion?
Thanks!
| 0 |
7,330,217 | 09/07/2011 07:23:17 | 860,500 | 07/24/2011 18:36:09 | 49 | 0 | problem with including a php file in Zend framework | i have a php file that contains a list of variables (a list of error messages) and nothing else.
in my controller, i included the file using the following line right before the definition of my controller
require_once PATH_TO_FILE;
class mycontrollerController extends Zend_Controller_Action {
all my actions here
}
so if everything goes well , i can access any variable from any action in my controller, however it doesnt work and i get an error message that says that the variable i'm trying to access is not defined.
<br /> but if i include the file inside the action, everything works perfect and i can access the variables.
i have no idea why including the file in the top of the controller doesnt seem to work. | php | zend-framework | null | null | null | null | open | problem with including a php file in Zend framework
===
i have a php file that contains a list of variables (a list of error messages) and nothing else.
in my controller, i included the file using the following line right before the definition of my controller
require_once PATH_TO_FILE;
class mycontrollerController extends Zend_Controller_Action {
all my actions here
}
so if everything goes well , i can access any variable from any action in my controller, however it doesnt work and i get an error message that says that the variable i'm trying to access is not defined.
<br /> but if i include the file inside the action, everything works perfect and i can access the variables.
i have no idea why including the file in the top of the controller doesnt seem to work. | 0 |
9,245,826 | 02/12/2012 02:09:09 | 1,175,930 | 01/29/2012 01:23:49 | 1 | 1 | In compare mode, after updating left to right, "SAVE" command fails with empty message | I am newbie, but as I was using for the first time the comparison of two files, intending to upgrade right file from changes made in left file.
**After check and upgrade right panel I used "save" command :**
**I got a message entirely empty of text neither title with the option YES NO** (I had supposed that the mean could be a confirmation and I answer YES.
This YES has deleted the changes and reset the file to disk content before changes.
The empty message is a bug.
Farther I can make an hypothesis of interaction with the option ?, which one ? the context is :
General:Editors:text Editors: Quick Diff -> panel : Enable quick diff ON, Show differences in overview ruler, Use this reference source = Version on disk
So If know how I can update a file form another element by element, **I don't what does the "SAVE" command on a panel in comparison mode.**
**To workaround I copy all to and replace in pure edit mode the content of the file and save it.**
Thanks for telling me how to save the content of a comparison panel updated, then edit the file by selection of his panel and get a Warning "the file has been upgraded" reload from disk ? or save as...
Best regards
Trebly | editor | aptana3 | savechanges | null | null | null | open | In compare mode, after updating left to right, "SAVE" command fails with empty message
===
I am newbie, but as I was using for the first time the comparison of two files, intending to upgrade right file from changes made in left file.
**After check and upgrade right panel I used "save" command :**
**I got a message entirely empty of text neither title with the option YES NO** (I had supposed that the mean could be a confirmation and I answer YES.
This YES has deleted the changes and reset the file to disk content before changes.
The empty message is a bug.
Farther I can make an hypothesis of interaction with the option ?, which one ? the context is :
General:Editors:text Editors: Quick Diff -> panel : Enable quick diff ON, Show differences in overview ruler, Use this reference source = Version on disk
So If know how I can update a file form another element by element, **I don't what does the "SAVE" command on a panel in comparison mode.**
**To workaround I copy all to and replace in pure edit mode the content of the file and save it.**
Thanks for telling me how to save the content of a comparison panel updated, then edit the file by selection of his panel and get a Warning "the file has been upgraded" reload from disk ? or save as...
Best regards
Trebly | 0 |
2,063,321 | 01/14/2010 10:03:20 | 216,431 | 11/22/2009 11:07:03 | 121 | 4 | android httprequest compress response. | I am using httprequest to retrieve data from webservice, i know using tomcat we can compress response data using gunzip algo.
but how can uncompress data to display, is un-compress is time consuming?? is there any other way to compress response and uncompress on android ??? | android | httprequest | response | compression | null | null | open | android httprequest compress response.
===
I am using httprequest to retrieve data from webservice, i know using tomcat we can compress response data using gunzip algo.
but how can uncompress data to display, is un-compress is time consuming?? is there any other way to compress response and uncompress on android ??? | 0 |
204,506 | 10/15/2008 12:20:38 | 20,927 | 09/23/2008 06:44:46 | 1 | 0 | How to manage non English speaking customer | What are the best practices when we are managing a software project involving a non English
speaking client.
1:Communication
2:Maintain documentation in both languages (specially updating the specifications regularly)
please share your experience based on above points.
Regards,
Kedar Hukeri
| best | practices | null | null | null | 07/03/2010 18:38:51 | off topic | How to manage non English speaking customer
===
What are the best practices when we are managing a software project involving a non English
speaking client.
1:Communication
2:Maintain documentation in both languages (specially updating the specifications regularly)
please share your experience based on above points.
Regards,
Kedar Hukeri
| 2 |
5,122,304 | 02/25/2011 20:33:52 | 544,140 | 12/16/2010 01:12:59 | 128 | 2 | Push content in container down on click, load content into space revealed Jquery - Part 2 | Before I begin, please reference this link which is Part 1 of my issue:
http://stackoverflow.com/questions/5113569/push-content-in-container-down-on-click-load-content-into-space-revealed-jquery/5113681#5113681
Now this is what it looks like after I've implemented the code from the prior example:
http://flexbeltsite.info/TestPages/SlideUpandDown.html
Its close, but not 100% what i want. When you click the button for the 2nd time, I want the animation to play exactly in reverse, at the same slow speed... bringing the container back to the top, and hiding the top content. Currently, the code im using is making the entire page disappear totally when the button is pressed the second time. I do not want that.
*-Bonus-*
I also would like to, if at all possible, lock the header to the bottom of the page at a min-height when the button is first pressed to slide down. The header would only be able to come up only so high when the window is shrunk, but if the window is fully expanded, the header is locked to the bottom of the page. In a nutshell, You basically will see the header become the footer when the button is first pressed.
Not only that, I want to remove the ability to scroll the page down so that you can see the slid down container contents. There should be no scroll bars once the container drops after pressing the slide down button.
*-Final Bonus-*
I would like to externally load another page automatically into the topContent div once the container is slid down and the top content is fully revealed.
I hope I can get help on this. Itd also be great if the coders who provide answers have contact info avaliable in case I need to need to follow up on your response | jquery | css | div | null | null | null | open | Push content in container down on click, load content into space revealed Jquery - Part 2
===
Before I begin, please reference this link which is Part 1 of my issue:
http://stackoverflow.com/questions/5113569/push-content-in-container-down-on-click-load-content-into-space-revealed-jquery/5113681#5113681
Now this is what it looks like after I've implemented the code from the prior example:
http://flexbeltsite.info/TestPages/SlideUpandDown.html
Its close, but not 100% what i want. When you click the button for the 2nd time, I want the animation to play exactly in reverse, at the same slow speed... bringing the container back to the top, and hiding the top content. Currently, the code im using is making the entire page disappear totally when the button is pressed the second time. I do not want that.
*-Bonus-*
I also would like to, if at all possible, lock the header to the bottom of the page at a min-height when the button is first pressed to slide down. The header would only be able to come up only so high when the window is shrunk, but if the window is fully expanded, the header is locked to the bottom of the page. In a nutshell, You basically will see the header become the footer when the button is first pressed.
Not only that, I want to remove the ability to scroll the page down so that you can see the slid down container contents. There should be no scroll bars once the container drops after pressing the slide down button.
*-Final Bonus-*
I would like to externally load another page automatically into the topContent div once the container is slid down and the top content is fully revealed.
I hope I can get help on this. Itd also be great if the coders who provide answers have contact info avaliable in case I need to need to follow up on your response | 0 |
9,022,943 | 01/26/2012 18:01:48 | 479,449 | 10/18/2010 15:26:14 | 935 | 36 | psycopg2 on Fedora | I'm trying to install psycopg2, using pip, on Fedora.
I get the message:
"pg_config executable not found."
In ubuntu, this problem can be resolved by installing the libpq-dev and python-dev packages. There's no clear analogous solution in Fedora. | python | postgresql | fedora | psycopg2 | null | 01/28/2012 00:48:09 | off topic | psycopg2 on Fedora
===
I'm trying to install psycopg2, using pip, on Fedora.
I get the message:
"pg_config executable not found."
In ubuntu, this problem can be resolved by installing the libpq-dev and python-dev packages. There's no clear analogous solution in Fedora. | 2 |
8,250,215 | 11/23/2011 22:56:32 | 569,183 | 01/09/2011 22:33:46 | 1,353 | 61 | java printing string variable | I'm getting some weird output when running (seemingly simple) code. Here's what I have:
import java.util.Scanner;
public class TestApplication
{
public static void main(String[] args)
{
System.out.println("Enter a password: ");
Scanner input = new Scanner(System.in);
input.next();
String s = input.toString();
System.out.println(s);
}
}
And the output I get after compiling successfully is:
Enter a password:
hello
java.util.Scanner[delimiters=\p{javaWhitespace}+][position=5][match valid=true][need input=false][source closed=false][skipped=false][group separator=\,][decimal separator=\.][positive prefix=][negative prefix=\Q-\E][positive suffix=][negative suffix=][NaN string=\Q�\E][infinity string=\Q∞\E]
Which is sort of weird. What's happening and how do I print the value of `s`? | java | string | variables | value | weirdness | null | open | java printing string variable
===
I'm getting some weird output when running (seemingly simple) code. Here's what I have:
import java.util.Scanner;
public class TestApplication
{
public static void main(String[] args)
{
System.out.println("Enter a password: ");
Scanner input = new Scanner(System.in);
input.next();
String s = input.toString();
System.out.println(s);
}
}
And the output I get after compiling successfully is:
Enter a password:
hello
java.util.Scanner[delimiters=\p{javaWhitespace}+][position=5][match valid=true][need input=false][source closed=false][skipped=false][group separator=\,][decimal separator=\.][positive prefix=][negative prefix=\Q-\E][positive suffix=][negative suffix=][NaN string=\Q�\E][infinity string=\Q∞\E]
Which is sort of weird. What's happening and how do I print the value of `s`? | 0 |
11,517,614 | 07/17/2012 07:11:34 | 1,417,282 | 05/25/2012 11:34:22 | 17 | 3 | Date Format for 07/15/2012 09:31:45 PM | I need a date format for above date ,my code is like this
function formatDateTime(date) { return $.telerik.formatString('{0:dd/MM/yyyy hh:mm:ss}', date); }
but it shows 07/15/2012 09:31:45 only , misses the AM and PM,but i need with AM and PM,can anyone help?
Thanks,
| jquery | telerik | null | null | null | null | open | Date Format for 07/15/2012 09:31:45 PM
===
I need a date format for above date ,my code is like this
function formatDateTime(date) { return $.telerik.formatString('{0:dd/MM/yyyy hh:mm:ss}', date); }
but it shows 07/15/2012 09:31:45 only , misses the AM and PM,but i need with AM and PM,can anyone help?
Thanks,
| 0 |
7,812,310 | 10/18/2011 19:04:31 | 973,810 | 09/30/2011 20:32:29 | 96 | 5 | Obfuscate multiplication by 2 | Help me come up with an obfuscated way to multiply a number by 2, accurate to the second decimal.
Ideas:
- use the Russian multiplication technique
- trig / other mathematical identities
- monte carlo methods
- but of course bonus points for CS trickery | math | obfuscation | null | null | null | 10/19/2011 17:28:04 | too localized | Obfuscate multiplication by 2
===
Help me come up with an obfuscated way to multiply a number by 2, accurate to the second decimal.
Ideas:
- use the Russian multiplication technique
- trig / other mathematical identities
- monte carlo methods
- but of course bonus points for CS trickery | 3 |
11,272,905 | 06/30/2012 09:08:47 | 891,494 | 08/12/2011 09:21:55 | 46 | 0 | data pulling from another domain | i have problem regarding data pulling from one domain.
Is that possible to fetch data from another domain form fields data with javascript and ajax.
| javascript | jquery-ajax | null | null | null | 06/30/2012 11:25:16 | not a real question | data pulling from another domain
===
i have problem regarding data pulling from one domain.
Is that possible to fetch data from another domain form fields data with javascript and ajax.
| 1 |
1,296,610 | 08/18/2009 21:25:38 | 15,613 | 09/17/2008 11:11:45 | 868 | 42 | Recommended reading on 'how the web works' | After about 4 years of winforms development with VB.Net and C#, I moved onto web development using standard ASP.NET webforms (which I've been doing for the last year and a half). What I'm realising now though is <i>how little I actually know about how the web works</i>. This is partly laziness on my part but partly due to the level of abstraction of ASP.NET.
Can anyone suggest any good books or articles which I should read to gain a better understanding of the lower-level aspects of web development. | books | null | null | null | null | null | open | Recommended reading on 'how the web works'
===
After about 4 years of winforms development with VB.Net and C#, I moved onto web development using standard ASP.NET webforms (which I've been doing for the last year and a half). What I'm realising now though is <i>how little I actually know about how the web works</i>. This is partly laziness on my part but partly due to the level of abstraction of ASP.NET.
Can anyone suggest any good books or articles which I should read to gain a better understanding of the lower-level aspects of web development. | 0 |
9,304,124 | 02/16/2012 01:09:53 | 1,212,765 | 02/16/2012 01:06:52 | 1 | 0 | How to set non proxy host for Apache HttpComponents 4.1 | How to set non proxy hosts using apache http components 4.1? I can't find anything in the document | java | httpclient-4.x | null | null | null | 02/17/2012 21:56:18 | off topic | How to set non proxy host for Apache HttpComponents 4.1
===
How to set non proxy hosts using apache http components 4.1? I can't find anything in the document | 2 |
10,291,532 | 04/24/2012 03:54:18 | 1,330,096 | 04/12/2012 19:54:49 | 1 | 0 | Android Java: Multiplayer Quiz Buzz In System with Minimal Lag? | So I've been trying to think of a way to make a multiplayer quiz game where a question is displayed and the first person to buzz in (just a button on the screen) is given the opportunity to answer the question. So with the possibility of two people buzzing in at almost the same time, what would be the best way to go about this to determine who the true first person to buzz in was? Sockets? A service like Pusher? Bluetooth? Scoreloop? Skiller? OpenFeint? Some other solution?
Thanks for any input/examples. | java | android | multiplayer | lag | null | null | open | Android Java: Multiplayer Quiz Buzz In System with Minimal Lag?
===
So I've been trying to think of a way to make a multiplayer quiz game where a question is displayed and the first person to buzz in (just a button on the screen) is given the opportunity to answer the question. So with the possibility of two people buzzing in at almost the same time, what would be the best way to go about this to determine who the true first person to buzz in was? Sockets? A service like Pusher? Bluetooth? Scoreloop? Skiller? OpenFeint? Some other solution?
Thanks for any input/examples. | 0 |
4,767,036 | 01/22/2011 09:08:01 | 260,594 | 01/28/2010 02:29:49 | 1,640 | 7 | What is the difference between Query and Invoke in ria services? | What is the exact difference between [Query] and [Invoke] in Ria services?
Thanks in advance :) | ria-services | null | null | null | null | null | open | What is the difference between Query and Invoke in ria services?
===
What is the exact difference between [Query] and [Invoke] in Ria services?
Thanks in advance :) | 0 |
1,503,673 | 10/01/2009 12:29:55 | 120,487 | 06/10/2009 12:16:17 | 20 | 2 | Default selected Item in Connected web part | I have a web part connected to another (provide a row to).
It shows the raido button that when clicked correctly provides the data to the second web part.
Can I have this radio button selected by default so that it automatically provides the filter data as soon as the page is loaded?
Thanks in advance
Sachin | wss | moss | sharepoint | null | null | null | open | Default selected Item in Connected web part
===
I have a web part connected to another (provide a row to).
It shows the raido button that when clicked correctly provides the data to the second web part.
Can I have this radio button selected by default so that it automatically provides the filter data as soon as the page is loaded?
Thanks in advance
Sachin | 0 |
8,126,037 | 11/14/2011 18:06:43 | 847,200 | 07/15/2011 21:13:18 | 265 | 19 | Performance tests to demonstrate the difference between single-sided ram and double sided ram | I'm looking to buy new memory for my PC, and during my research I discovered that there's such thing as double-sided and single sided ram (I've also seen quadro-sided ram on the market).
I've read some opinions on the internet, ranging from that double-sided ram is actually faster than single-sided ram to that there's no difference to that single-sided ram is faster to that single sided ram is MUCH faster.
Did someone do/see any tests on this one? Which one is it? | memory | hardware | ram | null | null | 11/15/2011 10:23:44 | off topic | Performance tests to demonstrate the difference between single-sided ram and double sided ram
===
I'm looking to buy new memory for my PC, and during my research I discovered that there's such thing as double-sided and single sided ram (I've also seen quadro-sided ram on the market).
I've read some opinions on the internet, ranging from that double-sided ram is actually faster than single-sided ram to that there's no difference to that single-sided ram is faster to that single sided ram is MUCH faster.
Did someone do/see any tests on this one? Which one is it? | 2 |
10,027,693 | 04/05/2012 11:26:10 | 443,966 | 09/10/2010 02:07:29 | 1,423 | 25 | why make said no rule to make target | Isn't Makefile syntax is
target: require_files
cmd...
Why I got this problem?
Makefile
MXMLC = /opt/flex/bin/mxmlc
MXMLC_RELEASE = $(MXMLC) -debug=false -compiler.optimize=true
release: bin-release/Wrapper.swf, bin-release/Application.swf
bin-release/Application.swf: src/**/*.as, lib/*.swc
$(MXMLC_RELEASE) -output bin-release/Application.swf src/Application.as
@@-rm ../server/public/game/Application.swf
$(CP) bin-release/Application.swf ../server/public/game/Application.swf
bin-release/Wrapper.swf: src/*.as, src/engine/**/*.as, lib/*.swc
$(MXMLC_RELEASE) -output bin-release/Wrapper.swf src/Wrapper.as
@@-rm ../server/public/game/Wrapper.swf
$(CP) bin-release/Wrapper.swf ../server/public/game/Wrapper.swf
$: make bin-release/Application.swf
> ~/workspace/project/src/flash [2]19:20 make: *** No rule to make
> target `src/constant/*.as,', needed by `bin-release/Application.swf'.
> Stop.
| c++ | c | makefile | null | null | null | open | why make said no rule to make target
===
Isn't Makefile syntax is
target: require_files
cmd...
Why I got this problem?
Makefile
MXMLC = /opt/flex/bin/mxmlc
MXMLC_RELEASE = $(MXMLC) -debug=false -compiler.optimize=true
release: bin-release/Wrapper.swf, bin-release/Application.swf
bin-release/Application.swf: src/**/*.as, lib/*.swc
$(MXMLC_RELEASE) -output bin-release/Application.swf src/Application.as
@@-rm ../server/public/game/Application.swf
$(CP) bin-release/Application.swf ../server/public/game/Application.swf
bin-release/Wrapper.swf: src/*.as, src/engine/**/*.as, lib/*.swc
$(MXMLC_RELEASE) -output bin-release/Wrapper.swf src/Wrapper.as
@@-rm ../server/public/game/Wrapper.swf
$(CP) bin-release/Wrapper.swf ../server/public/game/Wrapper.swf
$: make bin-release/Application.swf
> ~/workspace/project/src/flash [2]19:20 make: *** No rule to make
> target `src/constant/*.as,', needed by `bin-release/Application.swf'.
> Stop.
| 0 |
6,817,400 | 07/25/2011 14:08:20 | 861,712 | 07/25/2011 14:02:03 | 1 | 0 | Can I enable my wp7 app to use GPS in background? | I want to use my Windows Phone app to use GPS service in background. | windows-phone-7 | dev | null | null | null | 07/26/2011 17:07:40 | not a real question | Can I enable my wp7 app to use GPS in background?
===
I want to use my Windows Phone app to use GPS service in background. | 1 |
5,559,278 | 04/05/2011 22:21:13 | 477,228 | 10/15/2010 17:23:17 | 532 | 12 | How does one get to this stage: | Hey guys reading some of the posts I came to realise something:
http://stackoverflow.com/questions/1718037/abuse-of-c-lambda-expressions-or-syntax-brilliance
Why is it that atm im learning how to implement operations but I have no bearing on the foundations its made of.
I can write a program to do a specific task but I dont know where its taking it from... kind of hard to explain what I mean but I dont understand what the system is doing for me. If that makes sense.
When will I get to the stage I truley understand C or any code? How can I get to that stage?
| c# | php | javascript | asp.net | c++ | 04/05/2011 22:28:30 | not a real question | How does one get to this stage:
===
Hey guys reading some of the posts I came to realise something:
http://stackoverflow.com/questions/1718037/abuse-of-c-lambda-expressions-or-syntax-brilliance
Why is it that atm im learning how to implement operations but I have no bearing on the foundations its made of.
I can write a program to do a specific task but I dont know where its taking it from... kind of hard to explain what I mean but I dont understand what the system is doing for me. If that makes sense.
When will I get to the stage I truley understand C or any code? How can I get to that stage?
| 1 |
8,315,838 | 11/29/2011 18:32:02 | 539,465 | 12/12/2010 10:43:55 | 45 | 3 | Cannot insert custom links in TextView | I am trying to insert links to TextView in order to make them start a new activity. I wrote a function to do that:
static public void linkify(TextView view) {
String text = view.getText().toString();
text = text.replaceAll(Utils.tagPattern, Utils.tagReplace);
text = text.replaceAll(Utils.userPattern, Utils.userReplace);
view.setMovementMethod(LinkMovementMethod.getInstance());
view.setText(Html.fromHtml(text));
Log.d("SeenDroid", text);
Linkify.addLinks(view, Linkify.ALL);
}
An example output (to the logcat) is:
foo <a href="org.openihs.seendroid://display/tag/bar/">#bar</a>baz http://google.fr/
And the real UI gives http://google.fr/ as a link (expected behavior), but `#bar` as a normal text (unexpected behavior).
The TextView is in a ListView.
Any idea to solve that issue?
Regards,
ProgVal | android | hyperlink | textview | linkify | null | null | open | Cannot insert custom links in TextView
===
I am trying to insert links to TextView in order to make them start a new activity. I wrote a function to do that:
static public void linkify(TextView view) {
String text = view.getText().toString();
text = text.replaceAll(Utils.tagPattern, Utils.tagReplace);
text = text.replaceAll(Utils.userPattern, Utils.userReplace);
view.setMovementMethod(LinkMovementMethod.getInstance());
view.setText(Html.fromHtml(text));
Log.d("SeenDroid", text);
Linkify.addLinks(view, Linkify.ALL);
}
An example output (to the logcat) is:
foo <a href="org.openihs.seendroid://display/tag/bar/">#bar</a>baz http://google.fr/
And the real UI gives http://google.fr/ as a link (expected behavior), but `#bar` as a normal text (unexpected behavior).
The TextView is in a ListView.
Any idea to solve that issue?
Regards,
ProgVal | 0 |
3,053,144 | 06/16/2010 12:20:46 | 357,980 | 06/03/2010 22:57:39 | 11 | 1 | Moving from a non-clustered PK to a clustered PK in SQL 2005 | HI all, I recently asked this question in another thread, and thought I would reproduce it here with my solution:
>What if I have an auto-increment INT as my non-clustered primary key, and there are about 15 foreign keys defined to it ? (snide comment about original designer being braindead in the original :) )
>This is a 15M row table, on a live database, SQL Standard, so dropping indexes is out of the question. Even temporarily dropping the foreign key constraints will be difficult.
>I'm curious if anybody has a solution that causes minimal downtime.
I tested this in our testing environment and finally found that the downtime wasn't as severe as I had originally feared.
I ended up writing a script that drops all FK constraints, then drops the non-clustered key, re-creates the PK as a clustered index, and finally re-created all FKs WITH NOCHECK to avoid trawling through all FKs to check constraint compliance. Then I just enable the CHECK constraints to enable constraint checking from that point onwards, and all is dandy :)
The most important thing to realize is that during the time the FKs are absent, there MUST NOT be any INSERTs or DELETEs on the parent table, as this may break the constraints and cause issues in the future.
The total time taken for clustering a 15M row, 800MB index was ~4 minutes :)
| sql-server-2005 | clustered-index | indexes | null | null | 06/18/2010 05:22:16 | not a real question | Moving from a non-clustered PK to a clustered PK in SQL 2005
===
HI all, I recently asked this question in another thread, and thought I would reproduce it here with my solution:
>What if I have an auto-increment INT as my non-clustered primary key, and there are about 15 foreign keys defined to it ? (snide comment about original designer being braindead in the original :) )
>This is a 15M row table, on a live database, SQL Standard, so dropping indexes is out of the question. Even temporarily dropping the foreign key constraints will be difficult.
>I'm curious if anybody has a solution that causes minimal downtime.
I tested this in our testing environment and finally found that the downtime wasn't as severe as I had originally feared.
I ended up writing a script that drops all FK constraints, then drops the non-clustered key, re-creates the PK as a clustered index, and finally re-created all FKs WITH NOCHECK to avoid trawling through all FKs to check constraint compliance. Then I just enable the CHECK constraints to enable constraint checking from that point onwards, and all is dandy :)
The most important thing to realize is that during the time the FKs are absent, there MUST NOT be any INSERTs or DELETEs on the parent table, as this may break the constraints and cause issues in the future.
The total time taken for clustering a 15M row, 800MB index was ~4 minutes :)
| 1 |
6,013,135 | 05/16/2011 04:20:13 | 734,015 | 05/02/2011 06:36:30 | 1 | 0 | Pie Chart Drawing in Android | RectF rectf = new RectF (10, 10, 200, 200);
Paint paint = new Paint();
for(int i=0;i<list.length;i++)
{
if(i==0)
{
paint.setColor(COLORS[i]);
canvas.drawArc(rectf, 0, list_degree[i], true, paint);
}
else
{
paint.setColor(COLORS[i]);
canvas.drawArc(rectf, (list_degree[i-1]), (list_degree[i]), true, paint);
}
}
This is the code I'ev used for the chart is not comin properly..Any Suggestions?? | android | null | null | null | null | 05/16/2011 05:13:53 | not a real question | Pie Chart Drawing in Android
===
RectF rectf = new RectF (10, 10, 200, 200);
Paint paint = new Paint();
for(int i=0;i<list.length;i++)
{
if(i==0)
{
paint.setColor(COLORS[i]);
canvas.drawArc(rectf, 0, list_degree[i], true, paint);
}
else
{
paint.setColor(COLORS[i]);
canvas.drawArc(rectf, (list_degree[i-1]), (list_degree[i]), true, paint);
}
}
This is the code I'ev used for the chart is not comin properly..Any Suggestions?? | 1 |
1,493,050 | 09/29/2009 14:52:22 | 89,035 | 04/09/2009 11:46:52 | 801 | 38 | Open Source VoIP/SIP Objective-C Code | I have been tasked with investigating the feasibility of writing an iPhone App to access our internal VoIP/SIP systems.
I've never coded anything close to VoIP before. Are there any open source VoIP/SIP libraries/examples in C or Objective-C?
An O/S iPhone App that I can skin and add our required features to (mainly UI related) would be the *holly grail* here. | iphone | objective-c | voip | sip | open-source | null | open | Open Source VoIP/SIP Objective-C Code
===
I have been tasked with investigating the feasibility of writing an iPhone App to access our internal VoIP/SIP systems.
I've never coded anything close to VoIP before. Are there any open source VoIP/SIP libraries/examples in C or Objective-C?
An O/S iPhone App that I can skin and add our required features to (mainly UI related) would be the *holly grail* here. | 0 |
1,399,054 | 09/09/2009 11:17:23 | 45,211 | 12/11/2008 01:52:39 | 61 | 2 | C - Problems with pointers to pointers, can't seem to see it. | Ok guys, just a quick question hopefully someone can find my mistake quickly, but I just can't see it at the moment
Here is my struct:
typedef struct {
Car *buffer[CAR_PARK_SIZE];
char *arrival_time[CAR_PARK_SIZE];
int keep_running;
int size;
} CarPark;
typedef struct {
Car *buffer[MAX_QUEUE_SIZE];
char *arrival_time[MAX_QUEUE_SIZE];
int keep_running;
int size;
int index;
} CarQueue;
typedef struct {
char str[3];
int id;
} Car;
I'll try to talk this out and hopefully i've provided enough information for someone to find out where the problem may lie, the problem is to do with the pointer in the CarQueue buffer, which is meant to be an array of car pointers. When my code runs, it seems to write the same pointer to ever item in the CarQueue buffer, here's the play by play.
_cq = CarQueue, _cp = CarPark
They are both globals
My thread calls these lines to generate a new car struct.
Car c;
c = new_car();
printf("[A] Car Arrived with ID: %s\n", get_car_id(&c));
pthread_mutex_lock(&mutex);
_cq.size++;
_cq.index++;
_cq.buffer[_cq.index] = &c;
pthread_mutex_unlock(&mutex);
This should put the pointer of the new car structure into the the CarQueue buffer.
The next thread than attempts to take the pointer out of that array, and stick it into its own, and then remove it from the old array. CarPark takes the pointer of the car, puts it into it's storage array, and then removes it from CarQueue (or in this case, just increases the index and overrides it later).
pthread_mutex_lock(&mutex);
_cp.buffer[_cp.size] = _cq.buffer[_cq.index]; //should take the pointer and put it into its own
printf("[C] Car Parked -> %s\n", get_car_id(_cp.buffer[_cp.size])); //gets the right information
_cp.size++;
pthread_mutex_unlock(&mutex);
I think the problem lies around where the comment in the code is, but I am not certain. Eventually if I print out the array in CarPark, all it's items seem to be the exact same. Am I passing a wrong pointer to a pointer somewhere accidentally?
if I traverse through the CarPark array and print it out like the following
printf("| element %d is %s with pointer %d |\n", j, get_car_id(_cp.buffer[j]), _cp.buffer[j]);
They all appear to be the exact same item, same name and pointer.
| c | pointers | null | null | null | null | open | C - Problems with pointers to pointers, can't seem to see it.
===
Ok guys, just a quick question hopefully someone can find my mistake quickly, but I just can't see it at the moment
Here is my struct:
typedef struct {
Car *buffer[CAR_PARK_SIZE];
char *arrival_time[CAR_PARK_SIZE];
int keep_running;
int size;
} CarPark;
typedef struct {
Car *buffer[MAX_QUEUE_SIZE];
char *arrival_time[MAX_QUEUE_SIZE];
int keep_running;
int size;
int index;
} CarQueue;
typedef struct {
char str[3];
int id;
} Car;
I'll try to talk this out and hopefully i've provided enough information for someone to find out where the problem may lie, the problem is to do with the pointer in the CarQueue buffer, which is meant to be an array of car pointers. When my code runs, it seems to write the same pointer to ever item in the CarQueue buffer, here's the play by play.
_cq = CarQueue, _cp = CarPark
They are both globals
My thread calls these lines to generate a new car struct.
Car c;
c = new_car();
printf("[A] Car Arrived with ID: %s\n", get_car_id(&c));
pthread_mutex_lock(&mutex);
_cq.size++;
_cq.index++;
_cq.buffer[_cq.index] = &c;
pthread_mutex_unlock(&mutex);
This should put the pointer of the new car structure into the the CarQueue buffer.
The next thread than attempts to take the pointer out of that array, and stick it into its own, and then remove it from the old array. CarPark takes the pointer of the car, puts it into it's storage array, and then removes it from CarQueue (or in this case, just increases the index and overrides it later).
pthread_mutex_lock(&mutex);
_cp.buffer[_cp.size] = _cq.buffer[_cq.index]; //should take the pointer and put it into its own
printf("[C] Car Parked -> %s\n", get_car_id(_cp.buffer[_cp.size])); //gets the right information
_cp.size++;
pthread_mutex_unlock(&mutex);
I think the problem lies around where the comment in the code is, but I am not certain. Eventually if I print out the array in CarPark, all it's items seem to be the exact same. Am I passing a wrong pointer to a pointer somewhere accidentally?
if I traverse through the CarPark array and print it out like the following
printf("| element %d is %s with pointer %d |\n", j, get_car_id(_cp.buffer[j]), _cp.buffer[j]);
They all appear to be the exact same item, same name and pointer.
| 0 |
7,929,824 | 10/28/2011 13:21:33 | 1,018,369 | 10/28/2011 13:11:12 | 1 | 0 | PHP count not working properly | This only returns User doesn't exist.
Im guessing it is the count that is failing but it worked last night, but not sure why it isn't currently working, i have been playing with my code and making it look better but everything else is still functioning and sadly i do not have any back ups. this is basically for reputation on my websites and this is the php file that the add reputation links to, e.g you are on someones profile ([id number 5]) then when you want to give them a reputation you click a link that is reputation.php?good=5
Pastebin link
http://pastebin.com/HizC9hq2 | php | null | null | null | null | 10/28/2011 13:32:48 | too localized | PHP count not working properly
===
This only returns User doesn't exist.
Im guessing it is the count that is failing but it worked last night, but not sure why it isn't currently working, i have been playing with my code and making it look better but everything else is still functioning and sadly i do not have any back ups. this is basically for reputation on my websites and this is the php file that the add reputation links to, e.g you are on someones profile ([id number 5]) then when you want to give them a reputation you click a link that is reputation.php?good=5
Pastebin link
http://pastebin.com/HizC9hq2 | 3 |
9,498,298 | 02/29/2012 11:30:35 | 1,187,116 | 02/03/2012 09:06:20 | 1 | 1 | Permission denied in cron jobs comand | im add the a new cron jobs comand:
/bin/sh: /home/gbtusyll/public_html/run.php
but comand in cot run and i got a mail
/bin/sh: /home/gbtusyll/public_html/run.php: Permission denied
what is problam... | php | apache | null | null | null | 03/01/2012 13:38:26 | off topic | Permission denied in cron jobs comand
===
im add the a new cron jobs comand:
/bin/sh: /home/gbtusyll/public_html/run.php
but comand in cot run and i got a mail
/bin/sh: /home/gbtusyll/public_html/run.php: Permission denied
what is problam... | 2 |
4,663,910 | 01/11/2011 23:37:47 | 328,102 | 04/28/2010 16:39:02 | 158 | 1 | Login to SSH twice at the same time | Is there any way to setup my SSH client or my GNOME terminal or whatver so that when I SSH into a remote server it opens up TWO connections (or tabs or whatever)?
I always like to have two SSH connections to my remote servers open - one for displaying log files and another to do actual work. It bugs me that I have to login twice everytime.
Possible? Sensible? What's the verdict?! | linux | ssh | gnome-terminal | null | null | 01/12/2011 14:05:08 | off topic | Login to SSH twice at the same time
===
Is there any way to setup my SSH client or my GNOME terminal or whatver so that when I SSH into a remote server it opens up TWO connections (or tabs or whatever)?
I always like to have two SSH connections to my remote servers open - one for displaying log files and another to do actual work. It bugs me that I have to login twice everytime.
Possible? Sensible? What's the verdict?! | 2 |
4,888,450 | 02/03/2011 16:01:11 | 601,829 | 02/03/2011 16:01:11 | 1 | 0 | Help in naming my models | I have a library app I am writing. The models I have are `users` and `books`. Users can checkout books. What should I call the table that keeps track of the books that are loaned out to the users? Right now my top choice is `checkouts` but I'm not sure this is the best name.
So my models will look like:
User
has_many :checkouts
has_many :users, through :checkouts
Checkout
belongs_to :user
belongs_to :book
Book
has_many :checkouts
has_many :users, through :checkouts
Is there a better name I can use other than `checkout`? | ruby-on-rails | null | null | null | null | 08/17/2011 08:22:57 | off topic | Help in naming my models
===
I have a library app I am writing. The models I have are `users` and `books`. Users can checkout books. What should I call the table that keeps track of the books that are loaned out to the users? Right now my top choice is `checkouts` but I'm not sure this is the best name.
So my models will look like:
User
has_many :checkouts
has_many :users, through :checkouts
Checkout
belongs_to :user
belongs_to :book
Book
has_many :checkouts
has_many :users, through :checkouts
Is there a better name I can use other than `checkout`? | 2 |
9,260,359 | 02/13/2012 12:15:28 | 1,025,055 | 11/02/2011 06:21:30 | 7 | 0 | How to create dynamic UI in android? | I am new to android development. I want to learn to design complext UI at runtime. Any good ebook or blog suggestion will be helpful.
Thanks | android | android-layout | null | null | null | 02/13/2012 13:45:05 | not a real question | How to create dynamic UI in android?
===
I am new to android development. I want to learn to design complext UI at runtime. Any good ebook or blog suggestion will be helpful.
Thanks | 1 |
11,356,314 | 07/06/2012 05:28:56 | 269,121 | 02/09/2010 00:40:05 | 48 | 3 | How can I use partial server projects in my server project? | ### Scenario: ###
In my organisation, we separately develop multiple applications. In the end however, many of the applications (and their databases) are deployed to the same SQL instance, so they share the same master database.
We use Visual Studio 2010 database and server projects to source control said databases.
To try and standardise some things, I want to do the following:
1. Create a 'Core' Server database project which has all the server settings, core logins etc. Things like SET TRUSTWORTHY ON and server-level ANSI settings etc.
2. Have each Application's own Server.dbproj specify the logins and roles etc specific to that application.
3. Have each Application's own ApplicationDatabase.dbproj reference the ApplicationX.Server.dbproj
In theory, each Application in source control would only contain the items specific to it, rather than keeping server related settings or configuration synchronised across many projects.
### Problem ###
However, in practice I can get this far:
1. Done. Produces a .schema file which I reference in future steps
2. Done. Server.dbproj happily references Core.dbschema and 'extends' it with it's own logins and roles etc. Is happy to deploy this anywhere I point it.
3. Nadda. I add a reference from ApplicationDatabase.dbproj to Server.dbproj (assuming Server would pull in the items from Core) and it complains about any logins that are actually in Core.
So I then added both Server and Core as references to ApplicationDatabase as it settled down. Compiles fine.
However, when you deploy, you get the same problem described here: http://social.msdn.microsoft.com/Forums/uk/vstsdb/thread/23cb9132-00d4-42ed-b34c-ab49027cddf7
Error TSD01234: The source model contains 2 server option elements.
Only one element can be contained in a model that can be deployed
The problem I think is that ApplicationDatabase essentially has two Server projects that it knows about, and therefore duplicate settings.
Microsofts documentation makes no mention of using partial projects in Server projects, but neither is it listed as a limitation.
### So the question is... ###
Has anybody used partial projects successfully for Server projects, or is there a way you can see to achieve the same thing?
I'll be honest and say I won't just 'remove the Server projects' to make the problem disappear - we had it working very well up until I tried to improve things! | visual-studio-2010 | database-project | null | null | null | null | open | How can I use partial server projects in my server project?
===
### Scenario: ###
In my organisation, we separately develop multiple applications. In the end however, many of the applications (and their databases) are deployed to the same SQL instance, so they share the same master database.
We use Visual Studio 2010 database and server projects to source control said databases.
To try and standardise some things, I want to do the following:
1. Create a 'Core' Server database project which has all the server settings, core logins etc. Things like SET TRUSTWORTHY ON and server-level ANSI settings etc.
2. Have each Application's own Server.dbproj specify the logins and roles etc specific to that application.
3. Have each Application's own ApplicationDatabase.dbproj reference the ApplicationX.Server.dbproj
In theory, each Application in source control would only contain the items specific to it, rather than keeping server related settings or configuration synchronised across many projects.
### Problem ###
However, in practice I can get this far:
1. Done. Produces a .schema file which I reference in future steps
2. Done. Server.dbproj happily references Core.dbschema and 'extends' it with it's own logins and roles etc. Is happy to deploy this anywhere I point it.
3. Nadda. I add a reference from ApplicationDatabase.dbproj to Server.dbproj (assuming Server would pull in the items from Core) and it complains about any logins that are actually in Core.
So I then added both Server and Core as references to ApplicationDatabase as it settled down. Compiles fine.
However, when you deploy, you get the same problem described here: http://social.msdn.microsoft.com/Forums/uk/vstsdb/thread/23cb9132-00d4-42ed-b34c-ab49027cddf7
Error TSD01234: The source model contains 2 server option elements.
Only one element can be contained in a model that can be deployed
The problem I think is that ApplicationDatabase essentially has two Server projects that it knows about, and therefore duplicate settings.
Microsofts documentation makes no mention of using partial projects in Server projects, but neither is it listed as a limitation.
### So the question is... ###
Has anybody used partial projects successfully for Server projects, or is there a way you can see to achieve the same thing?
I'll be honest and say I won't just 'remove the Server projects' to make the problem disappear - we had it working very well up until I tried to improve things! | 0 |
909,869 | 05/26/2009 09:50:00 | 39,242 | 11/20/2008 08:57:51 | 357 | 18 | In-Memory File System for WIndows | I have a command-line executable which I need to run from Java on Windows XP. It uses files as input and output. But I want to avoid the overhead of file IO, so I thought of an in-memory RAM file system.
NetBSD has mount_mfs.
Could you recommend the most convenient way of doing this? | in-memory-file-system | java | windows | filesystems | null | null | open | In-Memory File System for WIndows
===
I have a command-line executable which I need to run from Java on Windows XP. It uses files as input and output. But I want to avoid the overhead of file IO, so I thought of an in-memory RAM file system.
NetBSD has mount_mfs.
Could you recommend the most convenient way of doing this? | 0 |
1,668,033 | 11/03/2009 15:27:48 | 88,118 | 04/07/2009 14:01:19 | 26 | 1 | Localized tables and Entity Framework | I have a scenario where I need to localized values of objects in my database.
Let's say you have an application that can create animals, if the user is english the value of the "Name" property of an animal would be entered as "Cat" in the UI whereas it would be entered as "Chat" in french.
The animal culture table would contain 2 records pointing to the same animal in the parent table.
When reading values back, if the value of "Name" does not exist in the user culture the default value (value the object was originally created with) would be used.
The following diagrams demonstrate how the data is stored in SQL:
![alt text][1]
[1]: http://onp8ca.blu.livefilestore.com/y1p9Ibyza0UK6U8VP8cw8G92c6Jc2gZr_dj1W1IwV76nEDJfhP8kturLsscTvPWOEqZH7nUC7_X-TSK8oZ4AA_8_aW1II8mqW7u/EF%20Localized%20Table.PNG
I'm trying to map this schema to an object model using the Entity Framework, I'm a bit confused as to what the best way to approach the problem.
Is EF appropriate for this? Should I used EF4?
This EF model will be used by .NET RIA Services.
Thanks,
Pierre-Yves Troel
Ayuda Media Systems
http://www.ayudasystems.com
| entity | entity-framework | c# | culture | null | null | open | Localized tables and Entity Framework
===
I have a scenario where I need to localized values of objects in my database.
Let's say you have an application that can create animals, if the user is english the value of the "Name" property of an animal would be entered as "Cat" in the UI whereas it would be entered as "Chat" in french.
The animal culture table would contain 2 records pointing to the same animal in the parent table.
When reading values back, if the value of "Name" does not exist in the user culture the default value (value the object was originally created with) would be used.
The following diagrams demonstrate how the data is stored in SQL:
![alt text][1]
[1]: http://onp8ca.blu.livefilestore.com/y1p9Ibyza0UK6U8VP8cw8G92c6Jc2gZr_dj1W1IwV76nEDJfhP8kturLsscTvPWOEqZH7nUC7_X-TSK8oZ4AA_8_aW1II8mqW7u/EF%20Localized%20Table.PNG
I'm trying to map this schema to an object model using the Entity Framework, I'm a bit confused as to what the best way to approach the problem.
Is EF appropriate for this? Should I used EF4?
This EF model will be used by .NET RIA Services.
Thanks,
Pierre-Yves Troel
Ayuda Media Systems
http://www.ayudasystems.com
| 0 |
222,370 | 10/21/2008 15:51:44 | 26,396 | 10/09/2008 07:17:40 | 118 | 14 | Option Strict On and .NET for VB6 programmers | I'm preparing a class on Visual Basic 2005 targeting Visual Basic 6 programmers migrating to the .NET platform.<br /><br/>
I would like a word of advice about whether to recommend them to always enable **Option Strict** or not.<br /><br/>
I've worked exclusively with C-style programming languages, more precisely Java and C#, so for me **explicit casting** is something I always expect I have to, since it's never been an option.<br/>However I recognize the value of working with a language that has built-in support for **late-binding**, because not having to be excessively explicit about types in the code indeed saves time. This is further proved by the popular diffusion of **dynamic typed languages**, even on the .NET platform with the Dynamic Language Runtime.
<br><br/>
With this in mind, should someone who is approaching .NET for the first time using VB.NET and with a VB6 background be encouraged to get into the mindset of **having to work with compile-time type checking** because that's the "best practice" in the CLR? Or is it "OK" to continue enjoying the benefits of late-binding?
| vb.net | late-binding | .net | null | null | null | open | Option Strict On and .NET for VB6 programmers
===
I'm preparing a class on Visual Basic 2005 targeting Visual Basic 6 programmers migrating to the .NET platform.<br /><br/>
I would like a word of advice about whether to recommend them to always enable **Option Strict** or not.<br /><br/>
I've worked exclusively with C-style programming languages, more precisely Java and C#, so for me **explicit casting** is something I always expect I have to, since it's never been an option.<br/>However I recognize the value of working with a language that has built-in support for **late-binding**, because not having to be excessively explicit about types in the code indeed saves time. This is further proved by the popular diffusion of **dynamic typed languages**, even on the .NET platform with the Dynamic Language Runtime.
<br><br/>
With this in mind, should someone who is approaching .NET for the first time using VB.NET and with a VB6 background be encouraged to get into the mindset of **having to work with compile-time type checking** because that's the "best practice" in the CLR? Or is it "OK" to continue enjoying the benefits of late-binding?
| 0 |
6,604,961 | 07/07/2011 01:44:42 | 778,659 | 06/01/2011 02:56:08 | 27 | 2 | why java vitural machine specifucation still is the 1999 version | the jvm spec version 2: http://java.sun.com/docs/books/jvms/second_edition/html/VMSpecTOC.doc.html
seems quite old.
java has been release new versions, quite a lot changed. java 5, java6..
But it seems the jvm spec stays the same.
does it mean it is just out of date?
or
the new java language feature just doesn't change the jvm spec. even a lot has introduced for example generics, concurrency , and jvmti in 1.5?
Or is it because jvm only related to run the class file and the class file has not changed and how to run them's spec has not changed?
I am a little confused on this topic.
| java | jvm | null | null | null | 07/07/2011 04:19:56 | off topic | why java vitural machine specifucation still is the 1999 version
===
the jvm spec version 2: http://java.sun.com/docs/books/jvms/second_edition/html/VMSpecTOC.doc.html
seems quite old.
java has been release new versions, quite a lot changed. java 5, java6..
But it seems the jvm spec stays the same.
does it mean it is just out of date?
or
the new java language feature just doesn't change the jvm spec. even a lot has introduced for example generics, concurrency , and jvmti in 1.5?
Or is it because jvm only related to run the class file and the class file has not changed and how to run them's spec has not changed?
I am a little confused on this topic.
| 2 |
7,807,312 | 10/18/2011 12:37:17 | 1,000,539 | 10/18/2011 06:48:04 | 1 | 0 | I want to integrate a map other than google map into an android app..Anyone plz help me | Plz help me...
I want to integrate a map other than google map into an android app | android | null | null | null | null | 10/18/2011 12:55:52 | not a real question | I want to integrate a map other than google map into an android app..Anyone plz help me
===
Plz help me...
I want to integrate a map other than google map into an android app | 1 |
4,772,071 | 01/23/2011 03:07:38 | 298,406 | 03/21/2010 11:15:18 | 465 | 3 | PHP reflection and invokeArgs(): forcing a parameter to use its default value | I need to call a function using the Reflection API. The function has optional parameters, and I need to invoke it providing just some of them.
For example, I have this function:
public function doSomething($firstParam, $secondParam = "default", $thirdParam = "default)
And I'm using `invokeArgs()` to invoke `doSomething()`, passing an array of values representing the arguments omitting to set a value to the optional `$secondParam`:
$parameters = array("firstParam"=>"value", "thirdParam"=>"thirdValue");
$reflectedDoSomething->invokeArgs($instance, $parameters);
What happens here is that `invokeArgs()` invokes the method setting its parameters in a row, without skipping the `$secondParam`, that now is valued "thirdValue" and omitting the `$thirdParam`. And that's logically correct. The method is invoked like `doSomething("value", "thirdValue")`.
What I'd like to here is to force the `$secondParam` to use its default value. Setting `"secondParam" => null` in the `$parameters` array is not a solution because `null` is a value.
Is it possibile using Reflection?
Thanks | php | reflection | parameters | null | null | null | open | PHP reflection and invokeArgs(): forcing a parameter to use its default value
===
I need to call a function using the Reflection API. The function has optional parameters, and I need to invoke it providing just some of them.
For example, I have this function:
public function doSomething($firstParam, $secondParam = "default", $thirdParam = "default)
And I'm using `invokeArgs()` to invoke `doSomething()`, passing an array of values representing the arguments omitting to set a value to the optional `$secondParam`:
$parameters = array("firstParam"=>"value", "thirdParam"=>"thirdValue");
$reflectedDoSomething->invokeArgs($instance, $parameters);
What happens here is that `invokeArgs()` invokes the method setting its parameters in a row, without skipping the `$secondParam`, that now is valued "thirdValue" and omitting the `$thirdParam`. And that's logically correct. The method is invoked like `doSomething("value", "thirdValue")`.
What I'd like to here is to force the `$secondParam` to use its default value. Setting `"secondParam" => null` in the `$parameters` array is not a solution because `null` is a value.
Is it possibile using Reflection?
Thanks | 0 |
11,496,482 | 07/15/2012 23:25:22 | 1,527,573 | 07/15/2012 23:00:25 | 1 | 0 | Non-Java Based PHP IDEs for Linux | Do you know if there are non-java based PHP IDEs available for Linux these days?
I've looked back and forth and haven't find any.
Please help. Thanks
BTW running anything under wine is not an option :) | php | linux | ide | null | null | 07/16/2012 01:35:52 | off topic | Non-Java Based PHP IDEs for Linux
===
Do you know if there are non-java based PHP IDEs available for Linux these days?
I've looked back and forth and haven't find any.
Please help. Thanks
BTW running anything under wine is not an option :) | 2 |
5,579,926 | 04/07/2011 10:52:57 | 316,459 | 04/14/2010 11:59:22 | 37 | 1 | What about detecting Firefox 4? | i know there is the new:
<!--[if IE 9]>
<link rel="stylesheet" type="text/css" href="css/ie9-only.css" />
<![endif]-->
to detect Internet Explorer 9, but what about Firefox 4? How do i load a css only for Firefox 4 ?
| firefox | null | null | null | null | null | open | What about detecting Firefox 4?
===
i know there is the new:
<!--[if IE 9]>
<link rel="stylesheet" type="text/css" href="css/ie9-only.css" />
<![endif]-->
to detect Internet Explorer 9, but what about Firefox 4? How do i load a css only for Firefox 4 ?
| 0 |
8,554,548 | 12/18/2011 20:24:52 | 947,354 | 09/15/2011 17:20:26 | 27 | 0 | return system date on checkbox check jquery | I am somewhat a beginner to jquery. I am having trouble creating a function to fill a textbox with the current date when a checkbox is clicked. I have the routine working on its own, but i would like to wrap it in a function so i can call it multiple times on the page. I have included the code here as well as a jsfiddle link
[jsFiddle Link][1]
[1]: http://jsfiddle.net/pa7vn/
html:
<span id="ContentPlaceHolder1_Label8">Start Date:</span>
<input name="ctl00$ContentPlaceHolder1$startdateSrvcTXT" type="text" id="ContentPlaceHolder1_startdateSrvcTXT" disabled="disabled" class="aspNetDisabled" />
<span id="ContentPlaceHolder1_Label11">Check to Start</span>
<input id="ContentPlaceHolder1_StartFillCHK" type="checkbox" name="ctl00$ContentPlaceHolder1$StartFillCHK" />
javascript:
/*----This works------
$('#ContentPlaceHolder1_StartFillCHK').click(function () {
if (this.checked) {
var myDate = new Date();
var prettyDate = (myDate.getMonth() + 1) + '.' + myDate.getDate() + '.' +
myDate.getFullYear();
$('#ContentPlaceHolder1_startdateSrvcTXT').val(prettyDate);
} else { //if not checked
$('#ContentPlaceHolder1_startdateSrvcTXT').val('');
}
});
*/
//this doesnt
function fillclick(txtid,checkid){
$("'" + checkid + "'").click(function () {
if (this.checked) {
var myDate = new Date();
var prettyDate = (myDate.getMonth() + 1) + '.' + myDate.getDate() + '.' +
myDate.getFullYear();
$("'" + txtid + "'").val(prettyDate);
} else { //if not checked
$("'" + txtid + "'").val('');
}
});
}
fillclick("#ContentPlaceHolder1_startdateSrvcTXT","#ContentPlaceHolder1_StartFillCHK");
| javascript | jquery | null | null | null | null | open | return system date on checkbox check jquery
===
I am somewhat a beginner to jquery. I am having trouble creating a function to fill a textbox with the current date when a checkbox is clicked. I have the routine working on its own, but i would like to wrap it in a function so i can call it multiple times on the page. I have included the code here as well as a jsfiddle link
[jsFiddle Link][1]
[1]: http://jsfiddle.net/pa7vn/
html:
<span id="ContentPlaceHolder1_Label8">Start Date:</span>
<input name="ctl00$ContentPlaceHolder1$startdateSrvcTXT" type="text" id="ContentPlaceHolder1_startdateSrvcTXT" disabled="disabled" class="aspNetDisabled" />
<span id="ContentPlaceHolder1_Label11">Check to Start</span>
<input id="ContentPlaceHolder1_StartFillCHK" type="checkbox" name="ctl00$ContentPlaceHolder1$StartFillCHK" />
javascript:
/*----This works------
$('#ContentPlaceHolder1_StartFillCHK').click(function () {
if (this.checked) {
var myDate = new Date();
var prettyDate = (myDate.getMonth() + 1) + '.' + myDate.getDate() + '.' +
myDate.getFullYear();
$('#ContentPlaceHolder1_startdateSrvcTXT').val(prettyDate);
} else { //if not checked
$('#ContentPlaceHolder1_startdateSrvcTXT').val('');
}
});
*/
//this doesnt
function fillclick(txtid,checkid){
$("'" + checkid + "'").click(function () {
if (this.checked) {
var myDate = new Date();
var prettyDate = (myDate.getMonth() + 1) + '.' + myDate.getDate() + '.' +
myDate.getFullYear();
$("'" + txtid + "'").val(prettyDate);
} else { //if not checked
$("'" + txtid + "'").val('');
}
});
}
fillclick("#ContentPlaceHolder1_startdateSrvcTXT","#ContentPlaceHolder1_StartFillCHK");
| 0 |
3,723,805 | 09/16/2010 04:48:57 | 444,158 | 09/10/2010 08:24:10 | 1 | 0 | To set a bool value if any of the column in empty in Sql Table using Linq in C#? | I need to get the details from the table using LINQ in C# and the where condition is ID and here my condition is ,if any of the column in the selected row is empty or null i need to return as False if not means True should be returned.....Cn any one help for this...Thanks in advance. | linq-to-sql | null | null | null | null | null | open | To set a bool value if any of the column in empty in Sql Table using Linq in C#?
===
I need to get the details from the table using LINQ in C# and the where condition is ID and here my condition is ,if any of the column in the selected row is empty or null i need to return as False if not means True should be returned.....Cn any one help for this...Thanks in advance. | 0 |
3,888,018 | 10/08/2010 05:50:23 | 336,929 | 12/10/2009 10:47:44 | 383 | 20 | ActionScript - Overriding Method Without Matching Signature? | when extending a class, is it impossible to override a method without also matching the parameters?
for example, i'd like to use the method's name, in this case it's a socket extension and the method i want to override is connect. however, i want to request additional parameters that the stock connect function does not request.
is the only alternative to create my own connect-like method with my own parameters, call super.connect from this function and override the stock connect function to throw an error if it's called?
that all kind of sounds like a train wreck. | actionscript-3 | methods | override | null | null | null | open | ActionScript - Overriding Method Without Matching Signature?
===
when extending a class, is it impossible to override a method without also matching the parameters?
for example, i'd like to use the method's name, in this case it's a socket extension and the method i want to override is connect. however, i want to request additional parameters that the stock connect function does not request.
is the only alternative to create my own connect-like method with my own parameters, call super.connect from this function and override the stock connect function to throw an error if it's called?
that all kind of sounds like a train wreck. | 0 |
6,415,151 | 06/20/2011 17:36:45 | 56,861 | 01/19/2009 22:04:11 | 924 | 20 | Anything better than XSL-FO? | I'm looking at technologies for print rendering, and I know there's lots of old print engines around, but I'd like something that is flexible and also gives some sort of standard (which means that rendering gives us options).
XSL-FO seems to stick out like a sore thumb as the technology we should be using, but if there's other options that fit the bill, I'd be interested to hear about them.
Thanks. | printing | xsl-fo | null | null | null | null | open | Anything better than XSL-FO?
===
I'm looking at technologies for print rendering, and I know there's lots of old print engines around, but I'd like something that is flexible and also gives some sort of standard (which means that rendering gives us options).
XSL-FO seems to stick out like a sore thumb as the technology we should be using, but if there's other options that fit the bill, I'd be interested to hear about them.
Thanks. | 0 |
10,868,475 | 06/03/2012 06:53:18 | 1,261,597 | 03/10/2012 22:06:39 | 20 | 0 | Wookmark plugin for text? | I'm creating a news feed site. I want all the text that users upload to be placed in a Pinterest style. I've founded out the Wookmark jQuery. But this is just for images. How can I make it so that each text that users upload gets in a customized box?
My news.php looks like this [http://www.youngcreativity.se][1]
<!DOCTYPE html>
<html lang='en'>
<head>
<style type="text/css">
element {
color: black;
}
body {
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-attachment: fixed;
background-image: url(paper1.png);
background-repeat: no-repeat;
background-position: center top;
}
.news {
font-family: Rough_Typewriter;
}
</style>
<meta charset="UTF-8">
<title>Setting Up</title>
<meta name="view" content="width-device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="keywords" content="">
<link href="css/bootstrap.css" rel="stylesheet">
</head>
<h1 class="news">Texts</h1>
<p>
<hr>
<p>
<p>
<p>
<p>
<p>
<p>
<p>
<p>
<p>
<a href='post.php'>Want to post a text?</a>
<?php
//connect
mysql_connect("MyDatabase","username","password") or die(mysql_error());
mysql_select_db("database") or die(mysql_error());
//query the database
$getnews = mysql_query("SELECT * FROM news ORDER BY id DESC") or die(mysql_query());
while ($row = mysql_fetch_assoc($getnews))
{
//get data
$id = $row['id'];
$title = $row['title'];
$body = $row['body'];
$date = $row['date'];
echo "
<b>$title posted on $date</b><br>
";
echo nl2br($body);
echo "<hr>
";
}
?>
</hr></html>
And my post.php looks like this[http://www.youngcreativity.se/post.php][2]
<!DOCTYPE html>
<html lang='en'>
<head>
<style type="text/css">
element {
color: black;
}
body {
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-attachment: fixed;
background-repeat: no-repeat;
background-position: center top;
}
.body {
font-family: Onyx;
font-size: 16px;
}
.Title {
font-family: "Sketch Rockwell";
font-size: 24px;
color: #333;
}
.body {
font-family: "Sketch Rockwell";
font-size: 24px;
color: #333;
}
.post {
font-family: "Sketch Rockwell";
font-size: 50px;
color: #333;
font-style: normal;
}
.textfeed {
font-family: Sketch Rockwell;
}
.pleasefillout {
font-family: "Sketch Rockwell";
font-size: 14px;
color: #33F;
text-decoration: blink;
}
</style>
<meta charset="UTF-8">
<title>Post</title>
<meta name="view" content="width-device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="keywords" content="">
<link href="css/bootstrap.css" rel="stylesheet">
</head>
<p> </p>
<h1 align="center" class="post">Post a text</h1>
<hr>
<p>
<span class="pleasefillout">
<?php
//insert category to database
if(isset($_POST['qty'])) {
// Fetch and clean the <select> value.
// The (int) makes sure the value is really a integer.
$qty = (int)$_POST['qty'];
// Create the INSERT query.
$sql = "INSERT INTO `tables`(`quantity`)
VALUES ({$qty})";
// Connect to a database and execute the query.
$dbLink = mysql_connect('MyDatabase', 'username', 'password') or die(mysql_error());
mysql_select_db('database', $dbLink) or die(mysql_errno());
$result = mysql_query($sql);
// Check the results and print the appropriate message.
if($result) {
echo "Record successfully inserted!";
}
else {
echo "Record not inserted! (". mysql_error() .")";
}
}
if ($_POST['post'])
{
//get data
$title = $_POST['title'];
$body = $_POST['body'];
//check for existance
if ($title&&$body)
{
mysql_connect("MyDatabase","username","password") or die(mysql_error());
mysql_select_db("database") or die(mysql_error());
$date = date("Y-m-d");
//insert data
$insert = mysql_query("INSERT INTO news VALUES ('','$title','$body','$date')") or die(mysql_error());
die("Your text has been posted!");
}
else
echo "Please fill out title and body<p>";
}
?>
</span>
<a href="http://www.youngcreativity.se" class="textfeed">Text Feed</a>
<p> </p>
<form action='post.php' method='POST'>
<p align="center" class="Title">
Title:</p>
<p align="center" class="Title"><br>
<input type='text' name='title' style="width:200px; height:30px;">
</p>
<p class="Title"> </p>
<p align="center" class="Typsnitt"><span class="body">
Body:</span>
<p align="center" class="Typsnitt"><span class="body"><br>
</span>
<span class="body">
<textarea rows='6' cols='35' name='body' style="width:300px; height:150px;"></textarea>
</span>
<p>
<input type='submit' name='post' value='Post text'>
<span class="Typsnitt"><span class="body">
<form action="insert.php" method="post">
</form>
<p>
</hr>
</html>
[1]: http://www.youngcreativity.se
[2]: http://www.youngcreativity.se/post.php
Please, help me fix this. It would be so cool.
| php | api | text | upload | null | 06/03/2012 16:15:29 | too localized | Wookmark plugin for text?
===
I'm creating a news feed site. I want all the text that users upload to be placed in a Pinterest style. I've founded out the Wookmark jQuery. But this is just for images. How can I make it so that each text that users upload gets in a customized box?
My news.php looks like this [http://www.youngcreativity.se][1]
<!DOCTYPE html>
<html lang='en'>
<head>
<style type="text/css">
element {
color: black;
}
body {
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-attachment: fixed;
background-image: url(paper1.png);
background-repeat: no-repeat;
background-position: center top;
}
.news {
font-family: Rough_Typewriter;
}
</style>
<meta charset="UTF-8">
<title>Setting Up</title>
<meta name="view" content="width-device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="keywords" content="">
<link href="css/bootstrap.css" rel="stylesheet">
</head>
<h1 class="news">Texts</h1>
<p>
<hr>
<p>
<p>
<p>
<p>
<p>
<p>
<p>
<p>
<p>
<a href='post.php'>Want to post a text?</a>
<?php
//connect
mysql_connect("MyDatabase","username","password") or die(mysql_error());
mysql_select_db("database") or die(mysql_error());
//query the database
$getnews = mysql_query("SELECT * FROM news ORDER BY id DESC") or die(mysql_query());
while ($row = mysql_fetch_assoc($getnews))
{
//get data
$id = $row['id'];
$title = $row['title'];
$body = $row['body'];
$date = $row['date'];
echo "
<b>$title posted on $date</b><br>
";
echo nl2br($body);
echo "<hr>
";
}
?>
</hr></html>
And my post.php looks like this[http://www.youngcreativity.se/post.php][2]
<!DOCTYPE html>
<html lang='en'>
<head>
<style type="text/css">
element {
color: black;
}
body {
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-attachment: fixed;
background-repeat: no-repeat;
background-position: center top;
}
.body {
font-family: Onyx;
font-size: 16px;
}
.Title {
font-family: "Sketch Rockwell";
font-size: 24px;
color: #333;
}
.body {
font-family: "Sketch Rockwell";
font-size: 24px;
color: #333;
}
.post {
font-family: "Sketch Rockwell";
font-size: 50px;
color: #333;
font-style: normal;
}
.textfeed {
font-family: Sketch Rockwell;
}
.pleasefillout {
font-family: "Sketch Rockwell";
font-size: 14px;
color: #33F;
text-decoration: blink;
}
</style>
<meta charset="UTF-8">
<title>Post</title>
<meta name="view" content="width-device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="keywords" content="">
<link href="css/bootstrap.css" rel="stylesheet">
</head>
<p> </p>
<h1 align="center" class="post">Post a text</h1>
<hr>
<p>
<span class="pleasefillout">
<?php
//insert category to database
if(isset($_POST['qty'])) {
// Fetch and clean the <select> value.
// The (int) makes sure the value is really a integer.
$qty = (int)$_POST['qty'];
// Create the INSERT query.
$sql = "INSERT INTO `tables`(`quantity`)
VALUES ({$qty})";
// Connect to a database and execute the query.
$dbLink = mysql_connect('MyDatabase', 'username', 'password') or die(mysql_error());
mysql_select_db('database', $dbLink) or die(mysql_errno());
$result = mysql_query($sql);
// Check the results and print the appropriate message.
if($result) {
echo "Record successfully inserted!";
}
else {
echo "Record not inserted! (". mysql_error() .")";
}
}
if ($_POST['post'])
{
//get data
$title = $_POST['title'];
$body = $_POST['body'];
//check for existance
if ($title&&$body)
{
mysql_connect("MyDatabase","username","password") or die(mysql_error());
mysql_select_db("database") or die(mysql_error());
$date = date("Y-m-d");
//insert data
$insert = mysql_query("INSERT INTO news VALUES ('','$title','$body','$date')") or die(mysql_error());
die("Your text has been posted!");
}
else
echo "Please fill out title and body<p>";
}
?>
</span>
<a href="http://www.youngcreativity.se" class="textfeed">Text Feed</a>
<p> </p>
<form action='post.php' method='POST'>
<p align="center" class="Title">
Title:</p>
<p align="center" class="Title"><br>
<input type='text' name='title' style="width:200px; height:30px;">
</p>
<p class="Title"> </p>
<p align="center" class="Typsnitt"><span class="body">
Body:</span>
<p align="center" class="Typsnitt"><span class="body"><br>
</span>
<span class="body">
<textarea rows='6' cols='35' name='body' style="width:300px; height:150px;"></textarea>
</span>
<p>
<input type='submit' name='post' value='Post text'>
<span class="Typsnitt"><span class="body">
<form action="insert.php" method="post">
</form>
<p>
</hr>
</html>
[1]: http://www.youngcreativity.se
[2]: http://www.youngcreativity.se/post.php
Please, help me fix this. It would be so cool.
| 3 |
5,189,661 | 03/04/2011 04:27:42 | 377,412 | 06/27/2010 14:01:34 | 19 | 1 | using grep in a If statement to get all items, ignoring spaces | This is part of a homework problem in a beginning bash class.
I need to bring in the passwd file, which I have done with my passfile variable, then I need to be able to extract certain pieces of it and display the different fields. When I manually grep from CLI using this statement below it works fine. I'm wanting all the variables and I get them all.
grep 1000 passfile | cut -c1-
However, when I do this from the script it stops or breaks or starts over at the first 'blank space' in the users full name. John D. Doe will return 3 lines when I only want one. I see this by echoing the value of i and the following.
for i in `grep 1000 ${passfile} | cut -c1-
user=`echo $1 | cut -d : -f1`
userID=`echo $1 | cut -d : -f3`
For example, if the line reads
jdoe:x:123:1000:John D Doe:/home/jdoe:/bin/bash
I get the following:
i = jdoe:x:123:1000:John
which gives me:
User is jdoe, UID is 509
but then in the next line i starts at R.
i = R. so User is R., UID is R.
next line
i = Johnson:/home/jjohnson:/bin/bash
which returns User is Johnson, UID is /bin/bash
The passwd file holds many users so I need to use the for loop to process them all. I think if I can get it to ignore the space I can get it. But not knowing a whole lot about linux, I'm not sure if I'm even going down the right path. Thanks in Advance for guidence/help.
| linux | homework | bash | null | null | null | open | using grep in a If statement to get all items, ignoring spaces
===
This is part of a homework problem in a beginning bash class.
I need to bring in the passwd file, which I have done with my passfile variable, then I need to be able to extract certain pieces of it and display the different fields. When I manually grep from CLI using this statement below it works fine. I'm wanting all the variables and I get them all.
grep 1000 passfile | cut -c1-
However, when I do this from the script it stops or breaks or starts over at the first 'blank space' in the users full name. John D. Doe will return 3 lines when I only want one. I see this by echoing the value of i and the following.
for i in `grep 1000 ${passfile} | cut -c1-
user=`echo $1 | cut -d : -f1`
userID=`echo $1 | cut -d : -f3`
For example, if the line reads
jdoe:x:123:1000:John D Doe:/home/jdoe:/bin/bash
I get the following:
i = jdoe:x:123:1000:John
which gives me:
User is jdoe, UID is 509
but then in the next line i starts at R.
i = R. so User is R., UID is R.
next line
i = Johnson:/home/jjohnson:/bin/bash
which returns User is Johnson, UID is /bin/bash
The passwd file holds many users so I need to use the for loop to process them all. I think if I can get it to ignore the space I can get it. But not knowing a whole lot about linux, I'm not sure if I'm even going down the right path. Thanks in Advance for guidence/help.
| 0 |
1,488,534 | 09/28/2009 18:14:23 | 50,305 | 12/30/2008 20:58:06 | 1,080 | 26 | latex newenvironment label | I have the following `newenvironment` command:
\newcounter{algoctr}[chapter] \setcounter{algoctr}{0}
\newenvironment{algo}[1] {
\refstepcounter{algoctr}\vspace{0.2cm}\noindent{\bf Algorithm
\arabic{chapter}.\arabic{algoctr}: #1}}{\par}
and I use it thusly
\begin{algo}{blabbing a blah}
blah
blah
\label{eq:blabbing}
\end{algo}
However, every time I reference the label (\ref{eq:blabbing}), I get a "1", instead of a "1.1".
Could someone kindly let me know what I'm doing wrong?
Thanks | newenvironment | latex | null | null | null | null | open | latex newenvironment label
===
I have the following `newenvironment` command:
\newcounter{algoctr}[chapter] \setcounter{algoctr}{0}
\newenvironment{algo}[1] {
\refstepcounter{algoctr}\vspace{0.2cm}\noindent{\bf Algorithm
\arabic{chapter}.\arabic{algoctr}: #1}}{\par}
and I use it thusly
\begin{algo}{blabbing a blah}
blah
blah
\label{eq:blabbing}
\end{algo}
However, every time I reference the label (\ref{eq:blabbing}), I get a "1", instead of a "1.1".
Could someone kindly let me know what I'm doing wrong?
Thanks | 0 |
8,585,783 | 12/21/2011 06:16:51 | 462,608 | 09/30/2010 08:01:21 | 545 | 17 | Can one reference be assigned different values at different locations? | #include <iostream>
using namespace std;
int main ()
{
int x = 0;
int y = 1;
int& z = x;
z = x;
z = y;
cout << "\nz: " << z;
return 0;
}
This code returns 1. Shouldn't this be an error instead?
8.5.3 section of C++ standard says:
> A reference cannot be changed to refer to another object after
> initialization. Note that initialization of a 2 reference is treated
> very differently from assignment to it. Argument passing (5.2.2) and
> function value return (6.6.3) are initializations.
| c++ | reference | null | null | null | null | open | Can one reference be assigned different values at different locations?
===
#include <iostream>
using namespace std;
int main ()
{
int x = 0;
int y = 1;
int& z = x;
z = x;
z = y;
cout << "\nz: " << z;
return 0;
}
This code returns 1. Shouldn't this be an error instead?
8.5.3 section of C++ standard says:
> A reference cannot be changed to refer to another object after
> initialization. Note that initialization of a 2 reference is treated
> very differently from assignment to it. Argument passing (5.2.2) and
> function value return (6.6.3) are initializations.
| 0 |
7,872,700 | 10/24/2011 07:59:37 | 735,050 | 05/02/2011 20:08:37 | 18 | 0 | AJAX Unexpected Token / Unterminated String Literal | The page I am working with is: http://glenwoodia.com/business-directory
I am having issues getting the pagination functionality to work. When you click on one of the numbers (the 1 2 3 4 5 6 7 at the top), it is supposed to dynamically pull that set of businesses and display them on the page. However, in Google Chrome I get an 'unexpected token illegal' error, and in firefox / IE I get an 'unterminated string literal' error.
The specific PHP code I have to process the AJAX should, in my mind, take care of any rogue characters that could be causing the issue:
$listings = trim(strip_tags(str_replace("'","\'",stripslashes(bizdir_directory("",@$v["offset"])))));
$response = "clearMessage();
document.getElementById('bizdir_directory').innerHTML = '{$listings}';
";
Any ideas? | php | ajax | null | null | null | null | open | AJAX Unexpected Token / Unterminated String Literal
===
The page I am working with is: http://glenwoodia.com/business-directory
I am having issues getting the pagination functionality to work. When you click on one of the numbers (the 1 2 3 4 5 6 7 at the top), it is supposed to dynamically pull that set of businesses and display them on the page. However, in Google Chrome I get an 'unexpected token illegal' error, and in firefox / IE I get an 'unterminated string literal' error.
The specific PHP code I have to process the AJAX should, in my mind, take care of any rogue characters that could be causing the issue:
$listings = trim(strip_tags(str_replace("'","\'",stripslashes(bizdir_directory("",@$v["offset"])))));
$response = "clearMessage();
document.getElementById('bizdir_directory').innerHTML = '{$listings}';
";
Any ideas? | 0 |
8,078,097 | 11/10/2011 10:29:00 | 1,037,922 | 11/09/2011 15:00:25 | 1 | 0 | cocos3d error Undefined symbols for architecture armv6: | Undefined symbols for architecture armv6:
"CC3VectorMake(float, float, float)", referenced from:
-[WorldViewController initializeWorld] in WorldViewController.o
ld: symbol(s) not found for architecture armv6
collect2: ld returned 1 exit status | iphone | null | null | null | null | 11/10/2011 12:13:29 | not a real question | cocos3d error Undefined symbols for architecture armv6:
===
Undefined symbols for architecture armv6:
"CC3VectorMake(float, float, float)", referenced from:
-[WorldViewController initializeWorld] in WorldViewController.o
ld: symbol(s) not found for architecture armv6
collect2: ld returned 1 exit status | 1 |
2,723,591 | 04/27/2010 17:45:00 | 265,550 | 10/21/2009 14:34:05 | 35 | 2 | iPhone SDK: How to center map around a particular point? | New to MapKit. Having problems centering map around a specified point. Here is the code. Not sure why this is not working. We are expecting to see a map centered around Cincinnati, OH. What we are seeing is the default google map of the world.
Any help appreciated.
/ Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[super viewDidLoad];
CLLocationCoordinate2D mapCoords[2];
mapCoords[0].latitude = 39.144057;
mapCoords[0].latitude = -84.505484;
mapCoords[1].latitude = 39.142984;
mapCoords[1].latitude = -84.502534;
MKCoordinateSpan span;
span.latitudeDelta = 0.2;
span.longitudeDelta = 0.2;
MKCoordinateRegion region;
region.center = mapCoords[0];
region.span = span;
[mapView setRegion:region animated:YES];
}
| iphone | null | null | null | null | null | open | iPhone SDK: How to center map around a particular point?
===
New to MapKit. Having problems centering map around a specified point. Here is the code. Not sure why this is not working. We are expecting to see a map centered around Cincinnati, OH. What we are seeing is the default google map of the world.
Any help appreciated.
/ Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[super viewDidLoad];
CLLocationCoordinate2D mapCoords[2];
mapCoords[0].latitude = 39.144057;
mapCoords[0].latitude = -84.505484;
mapCoords[1].latitude = 39.142984;
mapCoords[1].latitude = -84.502534;
MKCoordinateSpan span;
span.latitudeDelta = 0.2;
span.longitudeDelta = 0.2;
MKCoordinateRegion region;
region.center = mapCoords[0];
region.span = span;
[mapView setRegion:region animated:YES];
}
| 0 |
78,639 | 09/17/2008 00:22:51 | 4,920 | 09/06/2008 16:40:28 | 1 | 0 | What should a conference newbie bring to make the most out of their first conference? | I am planning to attend my first developer conference (Microsoft TechDays 2008 in Toronto). I have been looking around for suggestions so that I can prepare and make the most out of my first developer conference. Many articles make suggestions about asking questions, getting involved, being social. These are great! I am also wondering about physical items. I have seen many conference photos with most of the audience having their laptops. Are they just taking notes? Are they working on a problem during the session? Are these photos just during a break and everyone is catching up on blogs/email/outside contact?
Thank you StackOverflow-ers (StackOverflow-ites?) | conferences | newbies | self-improvement | null | null | 03/02/2012 20:23:50 | not constructive | What should a conference newbie bring to make the most out of their first conference?
===
I am planning to attend my first developer conference (Microsoft TechDays 2008 in Toronto). I have been looking around for suggestions so that I can prepare and make the most out of my first developer conference. Many articles make suggestions about asking questions, getting involved, being social. These are great! I am also wondering about physical items. I have seen many conference photos with most of the audience having their laptops. Are they just taking notes? Are they working on a problem during the session? Are these photos just during a break and everyone is catching up on blogs/email/outside contact?
Thank you StackOverflow-ers (StackOverflow-ites?) | 4 |
11,357,141 | 07/06/2012 06:43:37 | 1,505,952 | 07/06/2012 06:39:04 | 1 | 0 | Can someone build a Wikipedia app for Foursquare? | Can someone build a Foursquare app that links venues to their wiki pages if there is one?
Would be really handy for people travelling to find out more on the spot where they are.
And if after that there is some more time left, look at how it would be possible to link Foursquare places to audio/video clips that are relevant to that venue?
e.g. the I have a dream speech at the Lincoln Memorial. | foursquare | null | null | null | null | 07/09/2012 01:30:13 | off topic | Can someone build a Wikipedia app for Foursquare?
===
Can someone build a Foursquare app that links venues to their wiki pages if there is one?
Would be really handy for people travelling to find out more on the spot where they are.
And if after that there is some more time left, look at how it would be possible to link Foursquare places to audio/video clips that are relevant to that venue?
e.g. the I have a dream speech at the Lincoln Memorial. | 2 |
10,311,311 | 04/25/2012 07:36:28 | 1,349,756 | 04/22/2012 16:18:44 | 6 | 1 | Resizing a .png image when drawing to HTML5 canvas using JavaScript | I am trying to draw a few .png images to the HTML5 canvas using JavaScript. I currently have a function that will draw an image to the canvas, but the image is too large for the canvas, so only part of it displays.
The function I currently have is:
function drawImage(x, y){
var numberImage = new Image();
numberImage.src = imageSource;
context.drawImage(numberImage, x, y);
}
and I call the function by using:
var image1 = new Image();
image1.onLoad = function(){
context.drawImage(image1, 50, 50);
};
image1.src="1.png";
I was just wondering if anyone knows of a way of resizing an image when it's drawn to the canvas, so that I could just a thumbnail sized image?
Thanks in advance!
| javascript | image | html5-canvas | null | null | null | open | Resizing a .png image when drawing to HTML5 canvas using JavaScript
===
I am trying to draw a few .png images to the HTML5 canvas using JavaScript. I currently have a function that will draw an image to the canvas, but the image is too large for the canvas, so only part of it displays.
The function I currently have is:
function drawImage(x, y){
var numberImage = new Image();
numberImage.src = imageSource;
context.drawImage(numberImage, x, y);
}
and I call the function by using:
var image1 = new Image();
image1.onLoad = function(){
context.drawImage(image1, 50, 50);
};
image1.src="1.png";
I was just wondering if anyone knows of a way of resizing an image when it's drawn to the canvas, so that I could just a thumbnail sized image?
Thanks in advance!
| 0 |
6,791,487 | 07/22/2011 14:27:05 | 858,120 | 07/22/2011 14:27:05 | 1 | 0 | PHP dynamic user creation | Each user can create more than one user
I want to display all user's and his child user
eg: I have user admin
Admin user create user1, user2, user3,
user1 create user1.1, user1.2 and user2 create user2.1, user2.2 etc....
I want to display this like
Admin
User1
user1.1
user1.1.1
user1.1.2
user1.1.3
user1.2
user1.3
user2
user2.1
user2.2
user3
please answer me | php | recursion | null | null | null | 07/22/2011 14:37:35 | not a real question | PHP dynamic user creation
===
Each user can create more than one user
I want to display all user's and his child user
eg: I have user admin
Admin user create user1, user2, user3,
user1 create user1.1, user1.2 and user2 create user2.1, user2.2 etc....
I want to display this like
Admin
User1
user1.1
user1.1.1
user1.1.2
user1.1.3
user1.2
user1.3
user2
user2.1
user2.2
user3
please answer me | 1 |
11,560,005 | 07/19/2012 11:35:25 | 1,537,707 | 07/19/2012 11:17:54 | 1 | 0 | Zend Framework and Mysql at 100% CPU | I'm trying to redirect my web site to a static file when the database machine is at 100% CPU because of the the backend process, this makes the web page loading until the browser shows a timeout error, I would like to catch this situation in order to display an error in a static file. | mysql | zend-framework | zend-db | null | null | 07/20/2012 00:37:58 | not constructive | Zend Framework and Mysql at 100% CPU
===
I'm trying to redirect my web site to a static file when the database machine is at 100% CPU because of the the backend process, this makes the web page loading until the browser shows a timeout error, I would like to catch this situation in order to display an error in a static file. | 4 |
7,845,164 | 10/21/2011 05:02:58 | 975,290 | 10/02/2011 10:02:46 | 19 | 0 | How to break very long string in table? | I have similar code
<table width="1024" height="768">
<tr>
<td>
<? echo $description; ?>
</td>
</tr>
</table>
But $description is very long string, and it break my design, width of table increases. How can I divide my string with transfer into next row? PHP or HTML, CSS | php | html | css | null | null | null | open | How to break very long string in table?
===
I have similar code
<table width="1024" height="768">
<tr>
<td>
<? echo $description; ?>
</td>
</tr>
</table>
But $description is very long string, and it break my design, width of table increases. How can I divide my string with transfer into next row? PHP or HTML, CSS | 0 |
8,458,433 | 12/10/2011 17:28:23 | 1,091,470 | 12/10/2011 17:23:32 | 1 | 0 | getAssets(); from another class | I have a simple read a txt-file function.
AssetManager mngr = getAssets();
InputStream is = mngr.open("textdb.txt");
It works from my main activity. But if I use the same code in a separate class, getAssets() just return null / crash.
I am unable to find why it only works from the main class.
Any ideas? | android | assets | null | null | null | null | open | getAssets(); from another class
===
I have a simple read a txt-file function.
AssetManager mngr = getAssets();
InputStream is = mngr.open("textdb.txt");
It works from my main activity. But if I use the same code in a separate class, getAssets() just return null / crash.
I am unable to find why it only works from the main class.
Any ideas? | 0 |
7,203,891 | 08/26/2011 11:20:48 | 136,141 | 07/10/2009 08:41:48 | 3,294 | 34 | Why my Visual Studio automatically started to focus OutPut window after each Build instead of ErrorList? | For some reason my Visual Studio started to focus Output window -if it is closed it opens it- after each build.
I was more happy to see the Error List instead.
How can I configure my VS to focus on Error List window instead of Output window?
Thanks
| visual-studio | visual-studio-2010 | null | null | null | null | open | Why my Visual Studio automatically started to focus OutPut window after each Build instead of ErrorList?
===
For some reason my Visual Studio started to focus Output window -if it is closed it opens it- after each build.
I was more happy to see the Error List instead.
How can I configure my VS to focus on Error List window instead of Output window?
Thanks
| 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.