PostId
int64 13
11.8M
| PostCreationDate
stringlengths 19
19
| OwnerUserId
int64 3
1.57M
| OwnerCreationDate
stringlengths 10
19
| ReputationAtPostCreation
int64 -33
210k
| OwnerUndeletedAnswerCountAtPostTime
int64 0
5.77k
| Title
stringlengths 10
250
| BodyMarkdown
stringlengths 12
30k
| Tag1
stringlengths 1
25
⌀ | Tag2
stringlengths 1
25
⌀ | Tag3
stringlengths 1
25
⌀ | Tag4
stringlengths 1
25
⌀ | Tag5
stringlengths 1
25
⌀ | PostClosedDate
stringlengths 19
19
⌀ | OpenStatus
stringclasses 5
values | unified_texts
stringlengths 47
30.1k
| OpenStatus_id
int64 0
4
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8,704,889 | 01/02/2012 20:11:23 | 975,898 | 10/02/2011 23:42:12 | 70 | 0 | Auto Full Screen for FLV? | I have my own player that I use to play flv files (link is below).
If autoStart=true is for auto play, is there anything for auto fullscreen?
http://player.longtailvideo.com/player.swf?file=http://content.bitsontherun.com/videos/bkaovAYt-364766.mp4&autoStart=true&allowfullscreen=true | html | swf | flv | player | null | null | open | Auto Full Screen for FLV?
===
I have my own player that I use to play flv files (link is below).
If autoStart=true is for auto play, is there anything for auto fullscreen?
http://player.longtailvideo.com/player.swf?file=http://content.bitsontherun.com/videos/bkaovAYt-364766.mp4&autoStart=true&allowfullscreen=true | 0 |
4,728,639 | 01/18/2011 20:23:39 | 379,079 | 06/29/2010 14:05:34 | 915 | 60 | Localization with NHibernate | I'm a new to NHibernate. I just started development of my next project using NHibernate. One of the requirements is that entity classes should be localized. I'm doing localization the following way:
- Every entity which should be localized is split into 2 table and 2 entities. For example, I have an entity Service which holds some information, and another entity ServiceLocale which holds localized properties, such as Name, description etc. Same goes for tables.
- Service has a protected field which holds a list of ServiceLocales. ServiceLocale has a property Culture which specifies which language the object belongs.
- The list of ServiceLocale is loaded eagerly from xml mapping file. So when Service is loaded from database, all ServiceLocales also is loaded for this service object.
- Service has public properties, Name and Description. From this properties, I check what's current culture, load appropriate ServiceLocale object and return ServiceLocale's Name and Description.
- Service is persisted using a repository. The repository checks saves or updates the service, and also all of it's ServiceLocale objects.
So my question is: is there a better way to achieve this kind of transparent localization via NHibernate?
Thanks
| .net | nhibernate | orm | localization | nhibernate-mapping | null | open | Localization with NHibernate
===
I'm a new to NHibernate. I just started development of my next project using NHibernate. One of the requirements is that entity classes should be localized. I'm doing localization the following way:
- Every entity which should be localized is split into 2 table and 2 entities. For example, I have an entity Service which holds some information, and another entity ServiceLocale which holds localized properties, such as Name, description etc. Same goes for tables.
- Service has a protected field which holds a list of ServiceLocales. ServiceLocale has a property Culture which specifies which language the object belongs.
- The list of ServiceLocale is loaded eagerly from xml mapping file. So when Service is loaded from database, all ServiceLocales also is loaded for this service object.
- Service has public properties, Name and Description. From this properties, I check what's current culture, load appropriate ServiceLocale object and return ServiceLocale's Name and Description.
- Service is persisted using a repository. The repository checks saves or updates the service, and also all of it's ServiceLocale objects.
So my question is: is there a better way to achieve this kind of transparent localization via NHibernate?
Thanks
| 0 |
3,049,658 | 06/15/2010 22:54:03 | 333,948 | 05/05/2010 23:05:51 | 126 | 15 | Silverlight 4.0 question - synchronous calls to asmx web service | I have Silverlight problem.
I have to deal with fairly large legacy application that has some web services exposed (regular asmx, not wcf). What I need to do is to build Silverlight app that consumes those web services. Due to business logic I need to have the same web method to be called from Silverlight app synchronously. I was able to build web services consumption but only asynchronously because that would be default Silverlight behavior.
Is there a way to make asynchronous calls synchronous in Silverlight? I looked here and googled around but came across only wcf examples. I would appreciate if somebody would get me a code example for regular asmx web service. I use Silverlight 4.0.
Thanks! | silverlight | service | synchronous | null | null | null | open | Silverlight 4.0 question - synchronous calls to asmx web service
===
I have Silverlight problem.
I have to deal with fairly large legacy application that has some web services exposed (regular asmx, not wcf). What I need to do is to build Silverlight app that consumes those web services. Due to business logic I need to have the same web method to be called from Silverlight app synchronously. I was able to build web services consumption but only asynchronously because that would be default Silverlight behavior.
Is there a way to make asynchronous calls synchronous in Silverlight? I looked here and googled around but came across only wcf examples. I would appreciate if somebody would get me a code example for regular asmx web service. I use Silverlight 4.0.
Thanks! | 0 |
9,351,238 | 02/19/2012 17:09:07 | 1,191,803 | 02/06/2012 08:00:32 | 1 | 0 | Updating Clients on any changing of server database | I made a program on VS + SQL Server 2008 and launched it on a home network of 3 computers connected through LAN ,The Program fetches data from database and Put it in Dataset ,So users will work on the datasets and any Update ,delete or add on the dataset will update the Database.
The database is on one of the PC (server) which is also running same app,other two PCs are just clients and take there data from the Server database.
My problem is when one PC update the database the other PCs do not know of that update,So for example if one user delete an item and the other user delete the same item ..It will cause an error.
My Question is obvious : How Can I make all PCs updated by any change in Database ?
One Last thing each App talks only with SQL server database on the server and does not talk with other Apps on other PCs. | database | visual-studio | sql-server-2008 | networking | null | 02/20/2012 20:12:14 | not a real question | Updating Clients on any changing of server database
===
I made a program on VS + SQL Server 2008 and launched it on a home network of 3 computers connected through LAN ,The Program fetches data from database and Put it in Dataset ,So users will work on the datasets and any Update ,delete or add on the dataset will update the Database.
The database is on one of the PC (server) which is also running same app,other two PCs are just clients and take there data from the Server database.
My problem is when one PC update the database the other PCs do not know of that update,So for example if one user delete an item and the other user delete the same item ..It will cause an error.
My Question is obvious : How Can I make all PCs updated by any change in Database ?
One Last thing each App talks only with SQL server database on the server and does not talk with other Apps on other PCs. | 1 |
11,545,772 | 07/18/2012 16:11:52 | 1,024,553 | 11/01/2011 21:42:33 | 176 | 11 | Does anyone has compiled igraph, graph layout library for iOS? | Does anyone has compiled graph (http://igraph.sourceforge.net/), graph layout library for iOS?
| ios | igraph | null | null | null | 07/23/2012 05:49:44 | off topic | Does anyone has compiled igraph, graph layout library for iOS?
===
Does anyone has compiled graph (http://igraph.sourceforge.net/), graph layout library for iOS?
| 2 |
1,778,683 | 11/22/2009 13:23:46 | 74,089 | 03/05/2009 05:43:34 | 238 | 18 | Dead code detection in PHP | I have a project with very messy code - lots of duplication and dead code here and there.
Some time ago there was zero code coverage by unit-tests but now we're trying to write all new code in T.D.D. manner and lowering technical debt by covering "old" code by unit-tests as well(test-last technique).
<b>Business logic's complexity is quite high</b> and sometimes no one can answer whether some methods are used or not.
How this dead code methods can be found? Extensive logging? Higher test coverage?(It is not very easy because customers want new features to come out) | refactoring | legacy-code | code-coverage | php | null | 06/19/2012 18:43:39 | not constructive | Dead code detection in PHP
===
I have a project with very messy code - lots of duplication and dead code here and there.
Some time ago there was zero code coverage by unit-tests but now we're trying to write all new code in T.D.D. manner and lowering technical debt by covering "old" code by unit-tests as well(test-last technique).
<b>Business logic's complexity is quite high</b> and sometimes no one can answer whether some methods are used or not.
How this dead code methods can be found? Extensive logging? Higher test coverage?(It is not very easy because customers want new features to come out) | 4 |
1,347,572 | 08/28/2009 15:01:52 | 52,962 | 01/08/2009 15:27:08 | 46 | 5 | How do I make an Infragistics WinForm Grid to allow only a single row to be selected? | How do I make an Infragistics WinForm Grid to allow only a single row to be selected? | c# | infragistics | winforms | null | null | null | open | How do I make an Infragistics WinForm Grid to allow only a single row to be selected?
===
How do I make an Infragistics WinForm Grid to allow only a single row to be selected? | 0 |
11,553,491 | 07/19/2012 03:28:38 | 456,218 | 09/23/2010 13:39:16 | 736 | 1 | Why the type doesn't match in this value swap code in C? | void swap(char *a,char *b){
char t;
t = *a;
*a = *b;
*b = t;
}
int main(void){
char a = '1';
char b = '2';
swap(&a,&b);
printf("The value is %c and %c respectively\n",a,b);
return 0;
}
in the above code, there's a spot that confuse me
I think if `a` is a pointer, and `*a` is the value it points to
int *ptr, a = 1;
ptr = &a;
printf("The value of *ptr should be a: %d\n",*ptr);
printf("The value of *a should be an hex address: %p\n",ptr);
so in the `swap(char *a, char *b)` function,it takes the value not pointer( *a not a),
`swap(&a, &b)`
but it actually pass the pointer value to it as the parameter, and the code works. Anybody can explain it to me?(I think for `swap(char *a){...}` part, the declaration doesn't mean it require *a to pass in, it means declare a pointer value `a`, not the value a points to as `*a`in elsewhere means).
| c | pointers | null | null | null | null | open | Why the type doesn't match in this value swap code in C?
===
void swap(char *a,char *b){
char t;
t = *a;
*a = *b;
*b = t;
}
int main(void){
char a = '1';
char b = '2';
swap(&a,&b);
printf("The value is %c and %c respectively\n",a,b);
return 0;
}
in the above code, there's a spot that confuse me
I think if `a` is a pointer, and `*a` is the value it points to
int *ptr, a = 1;
ptr = &a;
printf("The value of *ptr should be a: %d\n",*ptr);
printf("The value of *a should be an hex address: %p\n",ptr);
so in the `swap(char *a, char *b)` function,it takes the value not pointer( *a not a),
`swap(&a, &b)`
but it actually pass the pointer value to it as the parameter, and the code works. Anybody can explain it to me?(I think for `swap(char *a){...}` part, the declaration doesn't mean it require *a to pass in, it means declare a pointer value `a`, not the value a points to as `*a`in elsewhere means).
| 0 |
11,168,679 | 06/23/2012 10:13:18 | 1,379,851 | 05/07/2012 13:24:12 | 499 | 36 | how to create interface? | How to create Interface in Javascript...
Actually i am developing one project and in it i need to download an image & save it in SDcard. By using ponegap downloader plugin i have done that one in Android & by using Blackberry File download API done in BlackBerry. But my people are asking me now to create Interface for that Blackberry download code. As i am new to developing field i don't have any idea of creating interface in javascript. The code i am using is...
AndroidCode:
I am using [Phonegap Downloader Plugin (for android)][1]..
BlackberryCode:
Imagedownload.js
var pictureDownload = function pictureDownload() {
console.log("picture download");
var _url = "http://www.google.co.in/images/srpr/logo3w.png";
var filename = _url.replace(/^.*[\\\/]/, '')
var sdfile = "file:///SDCard/BlackBerry/pictures/";
var internalfile = "file:///store/home/user/";
var sdcard = {
url: _url,
file: sdfile+filename,
timeout: 60000, // in milliseconds default is 30000
params: {
custom1: 'test'
},
headers: {
'Authorization':'AUTH_HERE'
},
success: function(data) {
alert('Success!');
},
error: function(e, code) {
alert(e + " " + code);
}
};
var internal = {
url: _url,
file: internalfile+filename,
timeout: 60000, // in milliseconds default is 30000
params: {
custom1: 'test'
},
headers: {
'Authorization':'AUTH_HERE'
},
success: function(data) {
alert('Success!');
},
error: function(e, code) {
alert(e + " " + code);
}
};
if (blackberry.io.dir.exists(sdfile))
{
webworks.io.FileDownloader.download(sdcard);
alert("Image saved in" + sdfile);
}else if(blackberry.io.dir.exists(internalfile))
{
webworks.io.FileDownloader.download(internal);
alert("Image saved in" + internalfile);
}
}
Here as per android phonegap plugin i am using
**window.plugins.downloader.downloadFile("http://server/file.txt", {overwrite: true});**
to call the download.js file in Android.
Now my company people are asking me to create interface for blackberry code that when the following above **window.plugins.downloader.downloadFile("http://server/file.txt", {overwrite: true});** was called in html it needs to work for both android & blackberry.
Mainly what i want is how to create interface for the following blackberry code. Can anyone please help me with this.
As i am new to developing field i don't know how to create interface.... Waiting for your reply...
[1]: https://github.com/phonegap/phonegap-plugins/tree/master/Android/Downloader | javascript | android | jquery | blackberry | interface | null | open | how to create interface?
===
How to create Interface in Javascript...
Actually i am developing one project and in it i need to download an image & save it in SDcard. By using ponegap downloader plugin i have done that one in Android & by using Blackberry File download API done in BlackBerry. But my people are asking me now to create Interface for that Blackberry download code. As i am new to developing field i don't have any idea of creating interface in javascript. The code i am using is...
AndroidCode:
I am using [Phonegap Downloader Plugin (for android)][1]..
BlackberryCode:
Imagedownload.js
var pictureDownload = function pictureDownload() {
console.log("picture download");
var _url = "http://www.google.co.in/images/srpr/logo3w.png";
var filename = _url.replace(/^.*[\\\/]/, '')
var sdfile = "file:///SDCard/BlackBerry/pictures/";
var internalfile = "file:///store/home/user/";
var sdcard = {
url: _url,
file: sdfile+filename,
timeout: 60000, // in milliseconds default is 30000
params: {
custom1: 'test'
},
headers: {
'Authorization':'AUTH_HERE'
},
success: function(data) {
alert('Success!');
},
error: function(e, code) {
alert(e + " " + code);
}
};
var internal = {
url: _url,
file: internalfile+filename,
timeout: 60000, // in milliseconds default is 30000
params: {
custom1: 'test'
},
headers: {
'Authorization':'AUTH_HERE'
},
success: function(data) {
alert('Success!');
},
error: function(e, code) {
alert(e + " " + code);
}
};
if (blackberry.io.dir.exists(sdfile))
{
webworks.io.FileDownloader.download(sdcard);
alert("Image saved in" + sdfile);
}else if(blackberry.io.dir.exists(internalfile))
{
webworks.io.FileDownloader.download(internal);
alert("Image saved in" + internalfile);
}
}
Here as per android phonegap plugin i am using
**window.plugins.downloader.downloadFile("http://server/file.txt", {overwrite: true});**
to call the download.js file in Android.
Now my company people are asking me to create interface for blackberry code that when the following above **window.plugins.downloader.downloadFile("http://server/file.txt", {overwrite: true});** was called in html it needs to work for both android & blackberry.
Mainly what i want is how to create interface for the following blackberry code. Can anyone please help me with this.
As i am new to developing field i don't know how to create interface.... Waiting for your reply...
[1]: https://github.com/phonegap/phonegap-plugins/tree/master/Android/Downloader | 0 |
8,290,936 | 11/28/2011 02:38:05 | 1,061,354 | 11/23/2011 07:15:25 | 1 | 0 | How do you stop a game of Hangman when the user guesses all the right letters or if the user uses all his tries? | This is the code that i have written. It can ask for the the user to guess a letter and keeps on doing it and asks the user how many tries he wants but that part is kind of broken because you can guess as much wrong letters as you want. I need to fix that and also I need the game to stop once the user uses all of his tries and once the user guess all the letters.
import java.io.*;
import java.util.*;
public class Hangman {
public static void main(String[] args) throws FileNotFoundException {
String[] dictionary = loadWords();
Scanner kb = new Scanner(System.in);
System.out.println("Welcome to Hangman!");
System.out.println("How many tries");
int tries = kb.nextInt();
String word = chooseWord(dictionary);
System.out.println("OK, I've choseen my word. Start guessing");
System.out.println(word);
boolean[] bool = new boolean[26];
while (tries >= 0){
String wordguess = kb.next();
char guess = wordguess.charAt(0);
processGuess(guess, word, bool);
printPattern(word, bool);
}
// FINISH IMPLEMENTING THIS!
}
// Loads a list of words from a file and returns the lsit as a String[].
// DO NOT ALTER THIS IMPLEMENTATION!!
public static String[] loadWords() throws FileNotFoundException {
ArrayList<String> wordList = new ArrayList<String>();
Scanner wordFile = new Scanner(new File("dictionary.txt"));
String line;
while (wordFile.hasNextLine()) {
line = wordFile.nextLine();
if(!line.equals(""))
wordList.add(line);
}
String[] result = new String[1];
return wordList.toArray(result);
}
// Takes an array of strings that represents the valid words as a parameter.
// Chooses one such word randomly and returns it.
public static String chooseWord(String[] dict) {
Random r = new Random();
int numword = r.nextInt(dict.length);
String hangword = dict[numword];
return hangword;
}
// Checks if a player has won the game
// Returns true only if all letters in the word have been guessed
public static boolean hasWon(String word, boolean[] guesses) {
int incorrect_tries = 0;
for(int i = 0; i < word.length(); i++) {
if (guesses[word.charAt(i)-'a'] == false){
incorrect_tries++;
return false;
}
}
return true;
}
// for(int i = 0; i < word.length(); i++) {
// if (guesses[word.charAt(i)-'a'] == false){
// return false;
// }
// }
// return true;
//
// Prints out the pattern of letters in the secret word based on the word
// and the letters that have been guessed.
// Prints any letter that has already been guessed and a _ for a letter that
// has not been guessed.
public static void printPattern(String word, boolean[] guesses) {
StringBuilder pattern = new StringBuilder();
for(int i = 0; i < word.length(); i++) {
if (guesses[word.charAt(i) - 'a']) {
pattern.append(word.charAt(i));
}
else {
pattern.append("_");
}
pattern.append(" ");
}
System.out.println(pattern.toString());
}
// Handles a guess by marking the letter as guessed and returns the number of
// tries to be charged: 0 if the guessed letter is in the word and 1 otherwise.
public static int processGuess(char guess, String word, boolean[] guesses) {
// int holdvalue = 0;
// if (guesses[guess - 'a']) {
// return 0;
// }
//
// for(int i = 0; i < word.length(); i++) {
// if (word.charAt(i) == guess) {
// holdvalue ++;
// }
// }
// if (holdvalue >= 0){
// return 0;
// }
// else {
// return 1;
// }
//
// }
if(guesses[(guess - 'a')] == false){
guesses[(guess - 'a')] = true;
}
else {
System.out.println("you already guessed that letter");
}
return guess;
}
}
| java | javascript | eclipse | null | null | 11/28/2011 03:35:40 | not a real question | How do you stop a game of Hangman when the user guesses all the right letters or if the user uses all his tries?
===
This is the code that i have written. It can ask for the the user to guess a letter and keeps on doing it and asks the user how many tries he wants but that part is kind of broken because you can guess as much wrong letters as you want. I need to fix that and also I need the game to stop once the user uses all of his tries and once the user guess all the letters.
import java.io.*;
import java.util.*;
public class Hangman {
public static void main(String[] args) throws FileNotFoundException {
String[] dictionary = loadWords();
Scanner kb = new Scanner(System.in);
System.out.println("Welcome to Hangman!");
System.out.println("How many tries");
int tries = kb.nextInt();
String word = chooseWord(dictionary);
System.out.println("OK, I've choseen my word. Start guessing");
System.out.println(word);
boolean[] bool = new boolean[26];
while (tries >= 0){
String wordguess = kb.next();
char guess = wordguess.charAt(0);
processGuess(guess, word, bool);
printPattern(word, bool);
}
// FINISH IMPLEMENTING THIS!
}
// Loads a list of words from a file and returns the lsit as a String[].
// DO NOT ALTER THIS IMPLEMENTATION!!
public static String[] loadWords() throws FileNotFoundException {
ArrayList<String> wordList = new ArrayList<String>();
Scanner wordFile = new Scanner(new File("dictionary.txt"));
String line;
while (wordFile.hasNextLine()) {
line = wordFile.nextLine();
if(!line.equals(""))
wordList.add(line);
}
String[] result = new String[1];
return wordList.toArray(result);
}
// Takes an array of strings that represents the valid words as a parameter.
// Chooses one such word randomly and returns it.
public static String chooseWord(String[] dict) {
Random r = new Random();
int numword = r.nextInt(dict.length);
String hangword = dict[numword];
return hangword;
}
// Checks if a player has won the game
// Returns true only if all letters in the word have been guessed
public static boolean hasWon(String word, boolean[] guesses) {
int incorrect_tries = 0;
for(int i = 0; i < word.length(); i++) {
if (guesses[word.charAt(i)-'a'] == false){
incorrect_tries++;
return false;
}
}
return true;
}
// for(int i = 0; i < word.length(); i++) {
// if (guesses[word.charAt(i)-'a'] == false){
// return false;
// }
// }
// return true;
//
// Prints out the pattern of letters in the secret word based on the word
// and the letters that have been guessed.
// Prints any letter that has already been guessed and a _ for a letter that
// has not been guessed.
public static void printPattern(String word, boolean[] guesses) {
StringBuilder pattern = new StringBuilder();
for(int i = 0; i < word.length(); i++) {
if (guesses[word.charAt(i) - 'a']) {
pattern.append(word.charAt(i));
}
else {
pattern.append("_");
}
pattern.append(" ");
}
System.out.println(pattern.toString());
}
// Handles a guess by marking the letter as guessed and returns the number of
// tries to be charged: 0 if the guessed letter is in the word and 1 otherwise.
public static int processGuess(char guess, String word, boolean[] guesses) {
// int holdvalue = 0;
// if (guesses[guess - 'a']) {
// return 0;
// }
//
// for(int i = 0; i < word.length(); i++) {
// if (word.charAt(i) == guess) {
// holdvalue ++;
// }
// }
// if (holdvalue >= 0){
// return 0;
// }
// else {
// return 1;
// }
//
// }
if(guesses[(guess - 'a')] == false){
guesses[(guess - 'a')] = true;
}
else {
System.out.println("you already guessed that letter");
}
return guess;
}
}
| 1 |
6,407,849 | 06/20/2011 07:05:31 | 781,764 | 06/02/2011 19:48:52 | 26 | 3 | Apply font size to img alt property without affecting the image size | Hi I am trying to set the font size to the img **alt property** but it affects the image size.
I'm doing something like this in the css
---
HTML Code:
<img alt="Some Text" src="http://www.someimage.com/img/010.jpg">
CSS:
img[alt]{font-size:0.75em;}
---
Can anyone help me in applying of font-size for the alt property of image without affecting image size.
**Please note I don't want to use Javascript. Just pure CSS** | css | null | null | null | null | null | open | Apply font size to img alt property without affecting the image size
===
Hi I am trying to set the font size to the img **alt property** but it affects the image size.
I'm doing something like this in the css
---
HTML Code:
<img alt="Some Text" src="http://www.someimage.com/img/010.jpg">
CSS:
img[alt]{font-size:0.75em;}
---
Can anyone help me in applying of font-size for the alt property of image without affecting image size.
**Please note I don't want to use Javascript. Just pure CSS** | 0 |
637,324 | 03/12/2009 04:06:57 | 36,397 | 11/11/2008 00:51:34 | 111 | 16 | Write-Once + Read-Numerous Map in Java? | I have a requirement that a <tt>Map</tt> will be constructed with up to 50~200 entries (it could be more, let's call it not-too-little anyway). The writing is only done once and the reading (using <tt>Map.get("keyName")</tt>) can go more than 20 per request (it's a webapp).
I'm going for <tt>Hashmap</tt> currently as it (I suppose) gives me the most optimum performance. Not being a data-structure guy, can any of you suggest a Map implementation that's best fit for my requirement, say from the <tt>java.lang.*</tt>, Apache commons, etc. packages?
yc
| java | data-structures | performance | null | null | null | open | Write-Once + Read-Numerous Map in Java?
===
I have a requirement that a <tt>Map</tt> will be constructed with up to 50~200 entries (it could be more, let's call it not-too-little anyway). The writing is only done once and the reading (using <tt>Map.get("keyName")</tt>) can go more than 20 per request (it's a webapp).
I'm going for <tt>Hashmap</tt> currently as it (I suppose) gives me the most optimum performance. Not being a data-structure guy, can any of you suggest a Map implementation that's best fit for my requirement, say from the <tt>java.lang.*</tt>, Apache commons, etc. packages?
yc
| 0 |
2,688,791 | 04/22/2010 06:57:59 | 322,978 | 04/22/2010 06:57:59 | 1 | 0 | How to check if a DateTime range is within another 3 month DateTime range .NET 3.5 C# | Hi I have a Start Date and End Date per record in a db.
I need to check to see where the time period falls in a 2 year period broken into two lots of quarters then display what quarters each record falls into.
Quarter 1 includes June 09, Jul 09, Aug 09
Quarter 2 includes Sept 09, Oct 09, Nov 09
Quarter 3 includes Dec 09, Jan 10, Feb 10
Quarter 4 includes Mar 10, Apr 10, May 10
Quaretr 5 includes Jun 10, Jul 10...
e.g. 01/10/09 - 01/06/10 would fall into quarters 2, 3, 4 & 5
I am very new to .NET so any examples would be much appreciated. | asp.net-3.5 | c# | null | null | null | null | open | How to check if a DateTime range is within another 3 month DateTime range .NET 3.5 C#
===
Hi I have a Start Date and End Date per record in a db.
I need to check to see where the time period falls in a 2 year period broken into two lots of quarters then display what quarters each record falls into.
Quarter 1 includes June 09, Jul 09, Aug 09
Quarter 2 includes Sept 09, Oct 09, Nov 09
Quarter 3 includes Dec 09, Jan 10, Feb 10
Quarter 4 includes Mar 10, Apr 10, May 10
Quaretr 5 includes Jun 10, Jul 10...
e.g. 01/10/09 - 01/06/10 would fall into quarters 2, 3, 4 & 5
I am very new to .NET so any examples would be much appreciated. | 0 |
7,833,597 | 10/20/2011 09:11:26 | 562,417 | 01/04/2011 10:45:35 | 374 | 29 | Wordpress plugin issue | Tried creating a simple plugin.
<?php
/**
* @package Hello_Dolly
* @version 1.6
*/
/*
Plugin Name: FomXong
Plugin URI: http://wordpress.org/extend/plugins/hello-dolly/
Description: This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in two words sung most famously by Louis Armstrong: Hello, Dolly. When activated you will randomly see a lyric from <cite>Hello, Dolly</cite> in the upper right of your admin screen on every page.
Author: Matt Mullenweg
Version: 1.6
Author URI: http://ma.tt/
*/
class My_Widget extends WP_Widget {
function My_Widget() {
// widget actual processes
}
function form($instance) {
// outputs the options form on admin
}
function update($new_instance, $old_instance) {
// processes widget options to be saved
}
function widget($args, $instance) {
// outputs the content of the widget
}
}
register_widget('My_Widget');
?>
When run this error is displayed. Why????
**Fatal error: Call to a member function register() on a non-object in D:\AppServ\www\wpt\wp-includes\widgets.php on line 431**
| wordpress | wordpress-plugin | null | null | null | 10/24/2011 02:28:51 | off topic | Wordpress plugin issue
===
Tried creating a simple plugin.
<?php
/**
* @package Hello_Dolly
* @version 1.6
*/
/*
Plugin Name: FomXong
Plugin URI: http://wordpress.org/extend/plugins/hello-dolly/
Description: This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in two words sung most famously by Louis Armstrong: Hello, Dolly. When activated you will randomly see a lyric from <cite>Hello, Dolly</cite> in the upper right of your admin screen on every page.
Author: Matt Mullenweg
Version: 1.6
Author URI: http://ma.tt/
*/
class My_Widget extends WP_Widget {
function My_Widget() {
// widget actual processes
}
function form($instance) {
// outputs the options form on admin
}
function update($new_instance, $old_instance) {
// processes widget options to be saved
}
function widget($args, $instance) {
// outputs the content of the widget
}
}
register_widget('My_Widget');
?>
When run this error is displayed. Why????
**Fatal error: Call to a member function register() on a non-object in D:\AppServ\www\wpt\wp-includes\widgets.php on line 431**
| 2 |
3,047,217 | 06/15/2010 16:42:03 | 248,827 | 01/12/2010 11:24:07 | 935 | 41 | How to resolve conflicting assemblies in .Net? | In my web application I am using **NHibernate.dll**. This has a dependency on folowing assembly.
> 'Antlr3.Runtime, Version=3.1.0.39271,
> Culture=neutral,
> PublicKeyToken=3a9cab8f8d22bfb7'
Now in the same project for another requirement I have to introduce **Antlr3.StringTemplate.dll**. Which has a dependency on another version of the above assembly.
If I use the version of **Antlr3.Runtime.dll** which satisfies **NHibernate** , **Antlr3.StringTemplate** starts complaining and vice-versa.
How to resolve a situation like this?
| .net | asp.net | nhibernate | assembly | assembly-resolution | null | open | How to resolve conflicting assemblies in .Net?
===
In my web application I am using **NHibernate.dll**. This has a dependency on folowing assembly.
> 'Antlr3.Runtime, Version=3.1.0.39271,
> Culture=neutral,
> PublicKeyToken=3a9cab8f8d22bfb7'
Now in the same project for another requirement I have to introduce **Antlr3.StringTemplate.dll**. Which has a dependency on another version of the above assembly.
If I use the version of **Antlr3.Runtime.dll** which satisfies **NHibernate** , **Antlr3.StringTemplate** starts complaining and vice-versa.
How to resolve a situation like this?
| 0 |
10,867,729 | 06/03/2012 03:44:10 | 506,230 | 11/12/2010 20:24:11 | 290 | 25 | Should nested data in Ember have a single arrayController or multiple? | I'm working on a proof of concept app and I have a question about data storage.
My app has a client model
PM.Client = Ember.Object.extend({
id: null,
client: null,
projects: {}
});
and a projects model
PM.Project = Ember.Object.extend({
id: null,
title: null,
totalHours: null,
cost: function(){
return this.get('totalHours') * PM.get('rate');
}.property('totalHours')
});
Each client can have multiple projects, but each project can only have one client. Currently I have a dummy JSON file with the following data
[
{
"id": "1",
"client": "Fastbook",
"projects": [
{
"id": "1",
"title": "Website redesign",
"totalHours": "45",
"cost": "4500"
},
{
"id": "2",
"title": "Tidy up admin section",
"totalHours": "10",
"cost": "1000"
}
]
},
{
"id": "2",
"client": "Epicenter",
"projects": [
{
"id": "1",
"title": "Chaching",
"totalHours": "25",
"cost": "2500"
}
]
}
]
What's the best way to store this data within Ember? Should I have an arrayController for clients and another for projects?
Ember Data might be okay but I don't plan on having REST set up for this. Can Ember Data use localStorage? | emberjs | null | null | null | null | null | open | Should nested data in Ember have a single arrayController or multiple?
===
I'm working on a proof of concept app and I have a question about data storage.
My app has a client model
PM.Client = Ember.Object.extend({
id: null,
client: null,
projects: {}
});
and a projects model
PM.Project = Ember.Object.extend({
id: null,
title: null,
totalHours: null,
cost: function(){
return this.get('totalHours') * PM.get('rate');
}.property('totalHours')
});
Each client can have multiple projects, but each project can only have one client. Currently I have a dummy JSON file with the following data
[
{
"id": "1",
"client": "Fastbook",
"projects": [
{
"id": "1",
"title": "Website redesign",
"totalHours": "45",
"cost": "4500"
},
{
"id": "2",
"title": "Tidy up admin section",
"totalHours": "10",
"cost": "1000"
}
]
},
{
"id": "2",
"client": "Epicenter",
"projects": [
{
"id": "1",
"title": "Chaching",
"totalHours": "25",
"cost": "2500"
}
]
}
]
What's the best way to store this data within Ember? Should I have an arrayController for clients and another for projects?
Ember Data might be okay but I don't plan on having REST set up for this. Can Ember Data use localStorage? | 0 |
7,913,646 | 10/27/2011 08:53:35 | 420,613 | 08/14/2010 20:15:21 | 637 | 72 | RAD 8 not installing on windows | I installed RAD 8 trial version successfully few months ago. My windows crashed and now I have new windows on my PC. When I try to install RAD 8 its giving the attached error before selecting features to install. What can I do. I have its license but it is not being installed.
![enter image description here][1]
[1]: http://i.stack.imgur.com/rpFKt.jpg | java | ibm | ibm-rad | null | null | 10/28/2011 01:15:45 | off topic | RAD 8 not installing on windows
===
I installed RAD 8 trial version successfully few months ago. My windows crashed and now I have new windows on my PC. When I try to install RAD 8 its giving the attached error before selecting features to install. What can I do. I have its license but it is not being installed.
![enter image description here][1]
[1]: http://i.stack.imgur.com/rpFKt.jpg | 2 |
1,595,637 | 10/20/2009 15:52:37 | 190,548 | 10/15/2009 11:28:08 | 1 | 0 | What's the most productive way to do NHibernate mapping? | I know annotations to do the hibernate mapping in Java and am looking now for a similar way to do the same in C# and NHibernate. I found out that there exists several approaches
- do the mapping in xml files
- NHibernate.Mapping.Attributes (NHMA)
- Fluent
- are there any more??
I tried NHMA and found out it had some blocking points for me...
I don't want you to discuss, whats the best way to map models to NHibernate, but I was looking for a good comparison on the internet.
Do you know such sites? What facts are the main points to consider, if I choose one of the "frameworks" listed above? I'm thinking of aspects like 'is this project offically supported by the NH-Developers?', 'are there models that can be mapped in xml-mapping but not in fluent/NHMA/etc...?'
What can you recommend?
Why? | nhibernate | mapping | fluent-nhibernate | nhibernate-mapping | null | null | open | What's the most productive way to do NHibernate mapping?
===
I know annotations to do the hibernate mapping in Java and am looking now for a similar way to do the same in C# and NHibernate. I found out that there exists several approaches
- do the mapping in xml files
- NHibernate.Mapping.Attributes (NHMA)
- Fluent
- are there any more??
I tried NHMA and found out it had some blocking points for me...
I don't want you to discuss, whats the best way to map models to NHibernate, but I was looking for a good comparison on the internet.
Do you know such sites? What facts are the main points to consider, if I choose one of the "frameworks" listed above? I'm thinking of aspects like 'is this project offically supported by the NH-Developers?', 'are there models that can be mapped in xml-mapping but not in fluent/NHMA/etc...?'
What can you recommend?
Why? | 0 |
7,947,469 | 10/30/2011 20:04:27 | 1,020,270 | 10/30/2011 00:10:52 | 9 | 0 | Write a function that opens a web page and returns a dictionary of all the links and their text on that page | Write a function that opens a web page and returns a dictionary of all the links and
their text on that page.
For each line in page [use appropriate syntax for webpages]
• while there remains some character in line
i. if line contains <a href=
A. slice line so that everything up to <a href= is removed
B. find >
C. url = text from beginning of line to the character before >
D. print url
E. slice line so that > is removed
F. find < /a >
G. text = text from beginning of line to the character before < /a >
H. print text
I. add {url:text} to the dictionary
ii. else truncate line
• The resulting dictionary is to be written to an output txt file, where each dictionary element (pair) is written on a new line.
• You can assume that the html tags are all in lower case.
| python | null | null | null | null | 10/30/2011 23:40:56 | too localized | Write a function that opens a web page and returns a dictionary of all the links and their text on that page
===
Write a function that opens a web page and returns a dictionary of all the links and
their text on that page.
For each line in page [use appropriate syntax for webpages]
• while there remains some character in line
i. if line contains <a href=
A. slice line so that everything up to <a href= is removed
B. find >
C. url = text from beginning of line to the character before >
D. print url
E. slice line so that > is removed
F. find < /a >
G. text = text from beginning of line to the character before < /a >
H. print text
I. add {url:text} to the dictionary
ii. else truncate line
• The resulting dictionary is to be written to an output txt file, where each dictionary element (pair) is written on a new line.
• You can assume that the html tags are all in lower case.
| 3 |
4,286,793 | 11/26/2010 16:03:17 | 521,567 | 11/26/2010 16:03:17 | 1 | 0 | How do i make a map stimulator like in minigames? | I need a stimulator that teleports all players to a random chosen map and is timed to stay at that map for 1 minute, then returns to lobby for 20 seconds
EXTRA: if you know how to get points for blowing up stuff then tag it with an EXTRA:. | roblox | null | null | null | null | 08/31/2011 01:58:35 | not a real question | How do i make a map stimulator like in minigames?
===
I need a stimulator that teleports all players to a random chosen map and is timed to stay at that map for 1 minute, then returns to lobby for 20 seconds
EXTRA: if you know how to get points for blowing up stuff then tag it with an EXTRA:. | 1 |
9,046,918 | 01/28/2012 16:40:01 | 472,123 | 10/11/2010 09:05:59 | 444 | 8 | PowerShell - IE Object, Set value error | I want to create a script with PowerShell to check the flight status.
But it´s not possible for me to set textbox value.
How can I fix it? Thank you in advance!
**Error: Property 'value' cannot be found on this object; make sure it exists and is settable.**
Code:
#Flight Number (Only Lufthansa)
#For example flight number
[string]$flightNumber = "LH 3102"
$ie = new-object -com "InternetExplorer.Application"
$ie.navigate("http://www.lufthansa.com/de/de/Ankunft-und-Abflug")
$ie.visible = $true
sleep 5
#while ($ie.busy) {sleep -milliseconds 50}
while($ie.ReadyState -ne 4) {start-sleep -m 100}
$ie.document.getElementsByName("flightNumber").value = $flightNumber
#Error
$ie.document.getElementsByName("flightNumber").IHTMLInputTextElement_value = $flightNumber
#Error
$ie.document.getElementsByName("flightNumber").IHTMLInputElement_value = $flightNumber
#Error | internet-explorer | powershell | null | null | null | null | open | PowerShell - IE Object, Set value error
===
I want to create a script with PowerShell to check the flight status.
But it´s not possible for me to set textbox value.
How can I fix it? Thank you in advance!
**Error: Property 'value' cannot be found on this object; make sure it exists and is settable.**
Code:
#Flight Number (Only Lufthansa)
#For example flight number
[string]$flightNumber = "LH 3102"
$ie = new-object -com "InternetExplorer.Application"
$ie.navigate("http://www.lufthansa.com/de/de/Ankunft-und-Abflug")
$ie.visible = $true
sleep 5
#while ($ie.busy) {sleep -milliseconds 50}
while($ie.ReadyState -ne 4) {start-sleep -m 100}
$ie.document.getElementsByName("flightNumber").value = $flightNumber
#Error
$ie.document.getElementsByName("flightNumber").IHTMLInputTextElement_value = $flightNumber
#Error
$ie.document.getElementsByName("flightNumber").IHTMLInputElement_value = $flightNumber
#Error | 0 |
10,014,590 | 04/04/2012 15:43:52 | 1,278,908 | 03/19/2012 15:28:38 | 9 | 0 | System.out.println("Console message") does not work | I tried printing messages using the System.out.println("Console message") but the messages are not getting printed in the console. Any specific reasons for this? How to print the console messages then?
i can see another window named DDMS. what is the use of it?
Please help
Regards,
Bunty | android | android-layout | android-emulator | null | null | 04/05/2012 12:30:03 | not a real question | System.out.println("Console message") does not work
===
I tried printing messages using the System.out.println("Console message") but the messages are not getting printed in the console. Any specific reasons for this? How to print the console messages then?
i can see another window named DDMS. what is the use of it?
Please help
Regards,
Bunty | 1 |
9,750,675 | 03/17/2012 14:17:51 | 495,874 | 11/03/2010 12:03:57 | 68 | 0 | Retrieving Data from JSON | Pls how do I retrieve the **title** from this json usng PHP
{
"kind": "plus#activityFeed",
"etag": "\"U2cYozG4eBioYd-8MEmyk8vsux4/98RQufcXcSAhnognM4kqOBjWygU\"",
"items": [
{
"kind": "plus#activity",
"etag": "\"U2cYozG4eBioYd-8MEmyk8vsux4/AMRVwIlEV6SoJ8ZkMErQKx04FIc\"",
"title": "Reshared post from Jesse Oguntimehin\n \n\nMy post for #GNigeria day 2 | php | json | null | null | null | 03/18/2012 14:01:06 | too localized | Retrieving Data from JSON
===
Pls how do I retrieve the **title** from this json usng PHP
{
"kind": "plus#activityFeed",
"etag": "\"U2cYozG4eBioYd-8MEmyk8vsux4/98RQufcXcSAhnognM4kqOBjWygU\"",
"items": [
{
"kind": "plus#activity",
"etag": "\"U2cYozG4eBioYd-8MEmyk8vsux4/AMRVwIlEV6SoJ8ZkMErQKx04FIc\"",
"title": "Reshared post from Jesse Oguntimehin\n \n\nMy post for #GNigeria day 2 | 3 |
7,883,194 | 10/24/2011 23:41:03 | 688,352 | 04/01/2011 22:07:44 | 11 | 0 | Create an iframe and set its base tag with jquery correctly | I'm attempting to set the base tag of a dynamically created iframe.
Everything works if I set the base tag to the root (http://example.com/) and make the links in the src file include the path from the base. However, if I set the base to include the folder path (http://example.com/Test/) only links work.
I've been trying to get this working correctly for a few days now.
**index.html**
//jquery - create iframe and set base tag.
$(document).ready(function(){
$('<iframe id="theFrame"/>').load(function(){
$('#theFrame').attr('src', 'test.html');
var baseTag= document.createElement('base');
baseTag.href = 'http://example.com/Test/';
$('#theFrame').contents().find('head').append(baseTag);
}).appendTo('body');
$('#theFrame').attr('src', 'test.html');
});
**test.html**
<script type="text/javascript" src="javascript.js"></script> //DOES NOT WORK
<a href="index.php">LINK</a><br> //WORKS
<img src="image.png" /> //DOES NOT WORK
<input type="button" value="ajaxCall" onClick="TestJava()"/> //DOES NOT WORK
**test2.html**
If i set the base tag to exclude the directory, example (http://example.com/) and then add the path onto all of the links in the src file, everything starts to work.
<script type="text/javascript" src="/Test/javascript.js"></script> //WORKS
<a href="/Test/index.php">LINK</a><br> //WORKS
<img src="/Test/image.png" /> //WORKS
<input type="button" value="ajaxCall" onClick="TestJava()"/> //WORKS | jquery | iframe | links | relative | base-tag | null | open | Create an iframe and set its base tag with jquery correctly
===
I'm attempting to set the base tag of a dynamically created iframe.
Everything works if I set the base tag to the root (http://example.com/) and make the links in the src file include the path from the base. However, if I set the base to include the folder path (http://example.com/Test/) only links work.
I've been trying to get this working correctly for a few days now.
**index.html**
//jquery - create iframe and set base tag.
$(document).ready(function(){
$('<iframe id="theFrame"/>').load(function(){
$('#theFrame').attr('src', 'test.html');
var baseTag= document.createElement('base');
baseTag.href = 'http://example.com/Test/';
$('#theFrame').contents().find('head').append(baseTag);
}).appendTo('body');
$('#theFrame').attr('src', 'test.html');
});
**test.html**
<script type="text/javascript" src="javascript.js"></script> //DOES NOT WORK
<a href="index.php">LINK</a><br> //WORKS
<img src="image.png" /> //DOES NOT WORK
<input type="button" value="ajaxCall" onClick="TestJava()"/> //DOES NOT WORK
**test2.html**
If i set the base tag to exclude the directory, example (http://example.com/) and then add the path onto all of the links in the src file, everything starts to work.
<script type="text/javascript" src="/Test/javascript.js"></script> //WORKS
<a href="/Test/index.php">LINK</a><br> //WORKS
<img src="/Test/image.png" /> //WORKS
<input type="button" value="ajaxCall" onClick="TestJava()"/> //WORKS | 0 |
9,942,592 | 03/30/2012 12:06:32 | 1,264,429 | 03/12/2012 15:08:27 | 11 | 0 | How to make checkbox checked by default in php | I am working in a form in which there are check boxes now i want to check one by default in admin panel which is checked by the user in fromt end while he submitted form.Form is same in both the panel but in admin panel the form is already filled with values entered by the user at the time of submitted in front end.
thank you. | php | javascript | null | null | null | 03/31/2012 15:19:06 | not a real question | How to make checkbox checked by default in php
===
I am working in a form in which there are check boxes now i want to check one by default in admin panel which is checked by the user in fromt end while he submitted form.Form is same in both the panel but in admin panel the form is already filled with values entered by the user at the time of submitted in front end.
thank you. | 1 |
10,563,789 | 05/12/2012 12:35:37 | 253,832 | 01/19/2010 08:27:50 | 52 | 1 | How to locate user with leaflet locate? | I'm trying to locate a user and set the map to this position with leaflet:
map.locate({setView : true});
On execute the browser ask for permission, but then nothing happens? What's wrong with my code? | javascript | leaflet | null | null | null | null | open | How to locate user with leaflet locate?
===
I'm trying to locate a user and set the map to this position with leaflet:
map.locate({setView : true});
On execute the browser ask for permission, but then nothing happens? What's wrong with my code? | 0 |
6,373,315 | 06/16/2011 14:12:23 | 424,294 | 08/18/2010 16:50:12 | 103 | 4 | How to replace a char in string with an Empty character in C#.NET | I have a string like this:
string val = "123-12-1234";
How can I replace the dashes using an empty string in C#.
I mean val.Replace(char oldChar, newChar);
What needs to go in oldChar and newChar. | c# | null | null | null | null | 06/16/2011 15:48:07 | too localized | How to replace a char in string with an Empty character in C#.NET
===
I have a string like this:
string val = "123-12-1234";
How can I replace the dashes using an empty string in C#.
I mean val.Replace(char oldChar, newChar);
What needs to go in oldChar and newChar. | 3 |
10,842,080 | 05/31/2012 22:21:41 | 1,429,476 | 05/31/2012 21:29:11 | 1 | 0 | model/view/presenter: presenter-to-presenter communication | I have a view class that represents a widget, and an accompanying presenter class. I also have a view class for a window that owns the widget, and an accompanying presenter for the window view. The window manipulates the widget, so I need the window presenter to communicate with the widget presenter. To visualize:
+-------------+ +------------------+
| widget_view |<------>| widget_presenter |
+-------------+ +------------------+
^ ^
| |
| V
+-------------+ +------------------+
| window_view |<------>| window_presenter |
+-------------+ +------------------+
What I'm not sure about is how to construct the objects. I know the MVP architecture doesn't deal with this issue but "leaves it as an exercise for the reader". Things I tried:
1. The views construct their presenters, and `window_view` constructs `widget_view`. But then, `window_view` needs extra parameters in its constructors, parameters it shouldn't care about, merely to instantiate the presenter. I also am not sure how the `window_presenter` would access the `widget_presenter`. Adding a `widget_presenter` setter to `window presenter` for `window_view` to fill in doesn't feel right to me.
2. Eliminate the communication line between the two presenters. `window_presenter` talks to `widget_presenter` through `window_view`. This too doesn't seem ideal to me because it requires adding code to `window_view` merely for the communication between `window_presenter` and `widget_presenter`. It also only allows one way communication, and it also adds fat to `widget_view` to allow outsiders to communicate with its presenter.
I can imagine the complexity growing exponentially here as other `window_presenter` needs to talk to another presenter, or other presenters need to talk with yet other presenters.
I also thought of adding a mediator object here to absorb all these intercommunications and dependencies, but at this point the whole idea of separating the logic from the presentation starts to feel very costly and very complex. Surely I'm doing something wrong here. | mvp | construction | null | null | null | null | open | model/view/presenter: presenter-to-presenter communication
===
I have a view class that represents a widget, and an accompanying presenter class. I also have a view class for a window that owns the widget, and an accompanying presenter for the window view. The window manipulates the widget, so I need the window presenter to communicate with the widget presenter. To visualize:
+-------------+ +------------------+
| widget_view |<------>| widget_presenter |
+-------------+ +------------------+
^ ^
| |
| V
+-------------+ +------------------+
| window_view |<------>| window_presenter |
+-------------+ +------------------+
What I'm not sure about is how to construct the objects. I know the MVP architecture doesn't deal with this issue but "leaves it as an exercise for the reader". Things I tried:
1. The views construct their presenters, and `window_view` constructs `widget_view`. But then, `window_view` needs extra parameters in its constructors, parameters it shouldn't care about, merely to instantiate the presenter. I also am not sure how the `window_presenter` would access the `widget_presenter`. Adding a `widget_presenter` setter to `window presenter` for `window_view` to fill in doesn't feel right to me.
2. Eliminate the communication line between the two presenters. `window_presenter` talks to `widget_presenter` through `window_view`. This too doesn't seem ideal to me because it requires adding code to `window_view` merely for the communication between `window_presenter` and `widget_presenter`. It also only allows one way communication, and it also adds fat to `widget_view` to allow outsiders to communicate with its presenter.
I can imagine the complexity growing exponentially here as other `window_presenter` needs to talk to another presenter, or other presenters need to talk with yet other presenters.
I also thought of adding a mediator object here to absorb all these intercommunications and dependencies, but at this point the whole idea of separating the logic from the presentation starts to feel very costly and very complex. Surely I'm doing something wrong here. | 0 |
10,469,223 | 05/06/2012 08:30:21 | 1,377,803 | 05/06/2012 08:19:51 | 1 | 0 | old flex sdk download | Since old flex sdk download links don't work,
and question
http://stackoverflow.com/questions/10456540/where-else-find-a-download-link-of-flex-sdk-4
is closed,
maybe somebody have some other (private) link ...
? | flex | sdk | null | null | null | 07/13/2012 07:25:59 | too localized | old flex sdk download
===
Since old flex sdk download links don't work,
and question
http://stackoverflow.com/questions/10456540/where-else-find-a-download-link-of-flex-sdk-4
is closed,
maybe somebody have some other (private) link ...
? | 3 |
11,370,929 | 07/06/2012 23:33:32 | 1,352,300 | 04/23/2012 20:48:16 | 3 | 0 | cross chat code | Please some one explain me the following.
I am trying to build a cross domain chat using curl, but i don't know what the below statements do
1)
curl_setopt($ch, CURLOPT_POSTFIELDS,"user_name=$user_name&cmd=$send_cmd&domain=$my_domain");
2) curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);
//code
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($ch,CURLOPT_FAILONERROR,1);
curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,"user_name=$user_name&cmd=$send_cmd&domain=$my_domain");
$res = curl_exec($ch);
curl_close($ch);
Thanks
| php | javascript | html | ajax | curl | 07/08/2012 07:34:09 | not a real question | cross chat code
===
Please some one explain me the following.
I am trying to build a cross domain chat using curl, but i don't know what the below statements do
1)
curl_setopt($ch, CURLOPT_POSTFIELDS,"user_name=$user_name&cmd=$send_cmd&domain=$my_domain");
2) curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);
//code
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($ch,CURLOPT_FAILONERROR,1);
curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,"user_name=$user_name&cmd=$send_cmd&domain=$my_domain");
$res = curl_exec($ch);
curl_close($ch);
Thanks
| 1 |
5,665,874 | 04/14/2011 15:45:05 | 708,268 | 04/14/2011 15:45:05 | 1 | 0 | SQL relationships between tables | it might sound stupid.
can we have a database containing some tables without relations. | sql | null | null | null | null | null | open | SQL relationships between tables
===
it might sound stupid.
can we have a database containing some tables without relations. | 0 |
2,528,589 | 03/27/2010 08:01:38 | 298,800 | 03/22/2010 06:28:36 | 1 | 0 | Git-windows case sensitive file names not handled properly |
We have the git bare repository in unix that has files with same name that differs only in cases.
Example:
GRANT.sql
grant.sql
When we clone the bare repository from unix in to a windows box, git status detecs the file as modified. The working tree is loaded only with grant.sql, but git status compares grant.sql and GRANT.sql and shows the file as modified in the working tree.
I tried using the core.ignorecase false but the result is the same.
Is there any way to rix this issue. | msys | null | null | null | null | null | open | Git-windows case sensitive file names not handled properly
===
We have the git bare repository in unix that has files with same name that differs only in cases.
Example:
GRANT.sql
grant.sql
When we clone the bare repository from unix in to a windows box, git status detecs the file as modified. The working tree is loaded only with grant.sql, but git status compares grant.sql and GRANT.sql and shows the file as modified in the working tree.
I tried using the core.ignorecase false but the result is the same.
Is there any way to rix this issue. | 0 |
1,204,446 | 07/30/2009 04:25:45 | 116,371 | 06/03/2009 05:28:06 | 914 | 73 | Is there a need of namespaces in database? | Often I am frustrated by the fact that there are a lot of tables, views, stored procedure all placed under one hierarchy. I am looking for a way (like namespaces) that would group related tables under one banner. This would not only be easy to understand. Also i would avoid the need for coming up with fancy names. I am not aware of any present trick to achieve this, Kindly help me if there is way I can use to achieve the similar effect.
Thanks | database-design | namespaces | null | null | null | null | open | Is there a need of namespaces in database?
===
Often I am frustrated by the fact that there are a lot of tables, views, stored procedure all placed under one hierarchy. I am looking for a way (like namespaces) that would group related tables under one banner. This would not only be easy to understand. Also i would avoid the need for coming up with fancy names. I am not aware of any present trick to achieve this, Kindly help me if there is way I can use to achieve the similar effect.
Thanks | 0 |
1,375,806 | 09/03/2009 20:36:42 | 25,515 | 10/06/2008 15:01:43 | 1,035 | 55 | Help simplifying this Regular Expression pattern | I have this Regular Expression that matches the following strings:
<!-- 09-02-2009 --->
<!-- 09-02-2009 12:00:00 -->
<!-- 09-02-2009 12:00:00 A -->
<!-- 09-02-2009 12:00:00 AM -->
Here is the pattern:
<!-- (?<month>\d{2}?)-(?<day>\d{2}?)-(?<year>\d{4}?)(?:(?: ?\d{2}:?){3}?(?: ?[aApP][mM]?)?)? --->
Is there anything I can do to simplify this pattern?
Thanks! | regex | null | null | null | null | null | open | Help simplifying this Regular Expression pattern
===
I have this Regular Expression that matches the following strings:
<!-- 09-02-2009 --->
<!-- 09-02-2009 12:00:00 -->
<!-- 09-02-2009 12:00:00 A -->
<!-- 09-02-2009 12:00:00 AM -->
Here is the pattern:
<!-- (?<month>\d{2}?)-(?<day>\d{2}?)-(?<year>\d{4}?)(?:(?: ?\d{2}:?){3}?(?: ?[aApP][mM]?)?)? --->
Is there anything I can do to simplify this pattern?
Thanks! | 0 |
6,054,011 | 05/19/2011 05:06:06 | 629,530 | 02/23/2011 04:26:40 | 23 | 0 | Trouble getting RAlt to autorepeat as when mapped as backspace | I could use a hand getting a key remapping to work. Backspace is too far away - my poor pinky has to stretch to get to it and it's starting to get sore. That might seem silly, but I want to deal with rsi early on.
A solution, as I see it, is to remap my Right Alt key (which I never use) to backspace so I can hit it with my thumb. This works OK using an .Xmodmap file:
!! No Caps Lock
clear lock
!! Make Caps_lock an escape key.
keycode 0x42 = Escape
keycode 0x6C = BackSpace
As you can see, I also make use of my caps lock by converting it to escape for ease with vi. I know that some people use the CapsLock for back space, but I'd rather use my stronger thumb for such an often used key.
Anyway, here's my problem. I can't get autorepeat to always work correctly with it. I use xset (0x6C is 108):
xset r 108
However, though xev shows that the key is repeating, applications like gnome-terminal and firefox somehow seem to behave badly with it. gnome-terminal accepts the first backspace but then seems to think escape was pressed and seems to stop processing the key presses thereafter (I use set -o vi and after the first backspace I'm placed in command mode). firefox doesn't process the other backspaces after the first one. Good ol' vim works as I'd expect though.
I don't understand this behavior. How can these applications be misbehaving this way? Doesn't Xmodmap work at a level below these apps? Is there a lower-level way for me to do this, other than getting a programmable keyboard? Am I missing something?
My system's running Ubuntu 10.10 with Gnome Desktop, in case that's helpful. | keyboard | x | xmodmap | null | null | 05/25/2011 17:03:26 | off topic | Trouble getting RAlt to autorepeat as when mapped as backspace
===
I could use a hand getting a key remapping to work. Backspace is too far away - my poor pinky has to stretch to get to it and it's starting to get sore. That might seem silly, but I want to deal with rsi early on.
A solution, as I see it, is to remap my Right Alt key (which I never use) to backspace so I can hit it with my thumb. This works OK using an .Xmodmap file:
!! No Caps Lock
clear lock
!! Make Caps_lock an escape key.
keycode 0x42 = Escape
keycode 0x6C = BackSpace
As you can see, I also make use of my caps lock by converting it to escape for ease with vi. I know that some people use the CapsLock for back space, but I'd rather use my stronger thumb for such an often used key.
Anyway, here's my problem. I can't get autorepeat to always work correctly with it. I use xset (0x6C is 108):
xset r 108
However, though xev shows that the key is repeating, applications like gnome-terminal and firefox somehow seem to behave badly with it. gnome-terminal accepts the first backspace but then seems to think escape was pressed and seems to stop processing the key presses thereafter (I use set -o vi and after the first backspace I'm placed in command mode). firefox doesn't process the other backspaces after the first one. Good ol' vim works as I'd expect though.
I don't understand this behavior. How can these applications be misbehaving this way? Doesn't Xmodmap work at a level below these apps? Is there a lower-level way for me to do this, other than getting a programmable keyboard? Am I missing something?
My system's running Ubuntu 10.10 with Gnome Desktop, in case that's helpful. | 2 |
10,653,200 | 05/18/2012 13:04:32 | 369,765 | 02/22/2010 12:49:04 | 665 | 17 | Outlook 2010 Stationary and Signatures Position | I am trying to build a corporate Email template which everyone can use.
Two Issues I am having with this. When using the template, Signatures are entered below the code of the html Stationary file I have created. I would like to pick where the signature goes. Is this possible?
Secondly im having issues with background images. I can apply background against the body (but have no control of if it repeats.. it just does!) also A background doesn't appear when applied to a table
Sample code below is top section of the email which shows no-repeat set but it will repeat on the body but not in the table itself!
<body id="ridBody" style="
background-image: url('edited/pp-top.png');
background-repeat: no-repeat no-repeat;
background-position: top center;
background-color: #fff;
text-align:center;
width:650px;
padding:0px;
margin:10px auto;">
<table background="edited/pp-top.png" style="padding:0px;
margin:0px;
background-image: url('edited/pp-top.png');
background-repeat: repeat-y no-repeat;
background-position: top center;
background-color: #fff;"
cellpadding="0"
cellspacing="0"
width="650">
<tr >
P.S I know it should be background-repeat: no-repeat but that fails to work also and I read outlook expects it twice for x and y.. neither works.
| email | signature | outlook-2010 | null | null | 06/26/2012 11:51:24 | not a real question | Outlook 2010 Stationary and Signatures Position
===
I am trying to build a corporate Email template which everyone can use.
Two Issues I am having with this. When using the template, Signatures are entered below the code of the html Stationary file I have created. I would like to pick where the signature goes. Is this possible?
Secondly im having issues with background images. I can apply background against the body (but have no control of if it repeats.. it just does!) also A background doesn't appear when applied to a table
Sample code below is top section of the email which shows no-repeat set but it will repeat on the body but not in the table itself!
<body id="ridBody" style="
background-image: url('edited/pp-top.png');
background-repeat: no-repeat no-repeat;
background-position: top center;
background-color: #fff;
text-align:center;
width:650px;
padding:0px;
margin:10px auto;">
<table background="edited/pp-top.png" style="padding:0px;
margin:0px;
background-image: url('edited/pp-top.png');
background-repeat: repeat-y no-repeat;
background-position: top center;
background-color: #fff;"
cellpadding="0"
cellspacing="0"
width="650">
<tr >
P.S I know it should be background-repeat: no-repeat but that fails to work also and I read outlook expects it twice for x and y.. neither works.
| 1 |
9,438,537 | 02/24/2012 21:47:41 | 1,010,031 | 10/23/2011 23:34:50 | 303 | 1 | jQuery ajax not returning youtube iframe src | I have a jsFiddle here : http://jsfiddle.net/ZXDYS/22/
----------
I am creating Blogger post summaries using jQuery although it will not return the element iframe's attr src...You can find the blog [here][1] for reference . what have i done wrong? please help!
$.ajax({
url: 'http://www.blogger.com/feeds/1570527947646221682/posts/default?alt=json-in-script&max-results=3',
type: 'get',
dataType: "jsonp",
success: function(data){
for (var i = 0; i < data.feed.entry.length; i++){
var title = data.feed.entry[i].title.$t;
var content = data.feed.entry[i].content.$t;
var img = $(content).find("img").attr("src");
var iframe = $(content).find("iframe").attr("src");
if(img==undefined){
var imgsrc = "no image in post :( sorry?";
}else{
var imgsrc = img;
}
$('div.related').append('<table border="1"><tr><td colspan="2">post title - '+title+'</td></tr><tr><th width="100%">Image src</th><th width="100px">Iframe src</th></tr><tr><td>'+imgsrc+'</td><td>'+iframe+'</td></tr></table>');
}
}
});
[1]: http://ykhaliq.blogspot.com/ | javascript | jquery | iframe | src | null | null | open | jQuery ajax not returning youtube iframe src
===
I have a jsFiddle here : http://jsfiddle.net/ZXDYS/22/
----------
I am creating Blogger post summaries using jQuery although it will not return the element iframe's attr src...You can find the blog [here][1] for reference . what have i done wrong? please help!
$.ajax({
url: 'http://www.blogger.com/feeds/1570527947646221682/posts/default?alt=json-in-script&max-results=3',
type: 'get',
dataType: "jsonp",
success: function(data){
for (var i = 0; i < data.feed.entry.length; i++){
var title = data.feed.entry[i].title.$t;
var content = data.feed.entry[i].content.$t;
var img = $(content).find("img").attr("src");
var iframe = $(content).find("iframe").attr("src");
if(img==undefined){
var imgsrc = "no image in post :( sorry?";
}else{
var imgsrc = img;
}
$('div.related').append('<table border="1"><tr><td colspan="2">post title - '+title+'</td></tr><tr><th width="100%">Image src</th><th width="100px">Iframe src</th></tr><tr><td>'+imgsrc+'</td><td>'+iframe+'</td></tr></table>');
}
}
});
[1]: http://ykhaliq.blogspot.com/ | 0 |
1,772,336 | 11/20/2009 18:15:48 | 214,348 | 11/19/2009 05:48:57 | 42 | 0 | suggest me a book with java programming problems | please suggest me a java book that contains challenging programming problems. | java | null | null | null | null | 11/21/2009 20:16:02 | not a real question | suggest me a book with java programming problems
===
please suggest me a java book that contains challenging programming problems. | 1 |
8,547,221 | 12/17/2011 19:06:59 | 1,020,785 | 10/30/2011 14:57:40 | 80 | 4 | Variable type specifier in C | I just started in C programming and I know that "%d" defines that it will be a number value, as in:
int x = 9;
printf("X = %d", x);
getchar();
return 0;
but what are the other variable specifiers for C? (to define strings, and do they change for float, double, long, etc.?) | c | variables | null | null | null | 12/17/2011 19:24:37 | not a real question | Variable type specifier in C
===
I just started in C programming and I know that "%d" defines that it will be a number value, as in:
int x = 9;
printf("X = %d", x);
getchar();
return 0;
but what are the other variable specifiers for C? (to define strings, and do they change for float, double, long, etc.?) | 1 |
6,266,425 | 06/07/2011 14:05:40 | 787,581 | 06/07/2011 13:56:42 | 1 | 1 | C# How to terminate application.run() | I would like to know, how to terminate a program using, for example, the escape key.
In general, what I have to do to stop it after the application.run(..)?
thank you. | c# | null | null | null | null | 06/07/2011 14:15:30 | not a real question | C# How to terminate application.run()
===
I would like to know, how to terminate a program using, for example, the escape key.
In general, what I have to do to stop it after the application.run(..)?
thank you. | 1 |
3,836,455 | 10/01/2010 03:59:42 | 463,509 | 10/01/2010 03:59:42 | 1 | 0 | Simple algorithm performance | Can you please distinguish which formula would be computationally more effective:
1. Sn = 1/n * ∑(Xi - C)² | sum "i" till "n"
or
2. Sn = 1/n * ∑Xi² - C² | sum "i" till "n"
C is const.
First one has n squares and second one (n+1) squares
Thanks in advance | algorithm | null | null | null | null | 10/01/2010 04:13:37 | not a real question | Simple algorithm performance
===
Can you please distinguish which formula would be computationally more effective:
1. Sn = 1/n * ∑(Xi - C)² | sum "i" till "n"
or
2. Sn = 1/n * ∑Xi² - C² | sum "i" till "n"
C is const.
First one has n squares and second one (n+1) squares
Thanks in advance | 1 |
5,463,494 | 03/28/2011 18:38:17 | 323,670 | 04/22/2010 20:26:47 | 6 | 1 | Can Visual Studio Package built in VS2005 be deployed on VS2010? | I want to deploy a Visual Studio package built using VS2005 deploy on VS2010. I am able to register the package(using regpkg.exe) and I am able to see it as a project template in VS2010. However, the package has a editor page which is displayed as soon as we select this project template which does not get displayed and instead it shows a default editor of VS2010.
I am not sure if this is a problem registering the package or a problem between Visual Studio versions. Can someone help?
| visual-studio | visual-studio-2010 | visual-studio-2005 | null | null | null | open | Can Visual Studio Package built in VS2005 be deployed on VS2010?
===
I want to deploy a Visual Studio package built using VS2005 deploy on VS2010. I am able to register the package(using regpkg.exe) and I am able to see it as a project template in VS2010. However, the package has a editor page which is displayed as soon as we select this project template which does not get displayed and instead it shows a default editor of VS2010.
I am not sure if this is a problem registering the package or a problem between Visual Studio versions. Can someone help?
| 0 |
7,466,224 | 09/19/2011 03:42:38 | 951,911 | 09/19/2011 03:22:44 | 1 | 0 | PHP: if image exists show image else show different image | i am making a login system with registration and a profile page in php and i am trying to make a profile picture work.
if the user has not uploaded a profile picture yet then make it show a "no profile picture" image if the user has uploaded a profile picture make make it show the image that he has uploaded.
Right now it only show the default picture, noprofile.png.
<tab>< img src="uploads/< ? echo "$username" ? >/noprofile.png">
i want it to show icon.png if icon.png has been uploaded and if it hasnt been uploaded make it show, noprofile.png. | php | null | null | null | null | null | open | PHP: if image exists show image else show different image
===
i am making a login system with registration and a profile page in php and i am trying to make a profile picture work.
if the user has not uploaded a profile picture yet then make it show a "no profile picture" image if the user has uploaded a profile picture make make it show the image that he has uploaded.
Right now it only show the default picture, noprofile.png.
<tab>< img src="uploads/< ? echo "$username" ? >/noprofile.png">
i want it to show icon.png if icon.png has been uploaded and if it hasnt been uploaded make it show, noprofile.png. | 0 |
3,570,898 | 08/25/2010 23:04:34 | 114,786 | 05/30/2009 13:12:32 | 28 | 1 | Django: Update Field Value Based on Other Fields | I am not sure this is even possible without modifying the Admin interface.
I have a model called "Quote" that can contain multiple "Product" models. I connect the two using an intermediate model "QuoteIncludes". Here are the three models as they currently stand:
class Product(models.Model):
name = models.CharField(max_length=100)
short_desc = models.CharField(max_length=200)
default_cost = models.DecimalField(max_digits=15, decimal_places=2)
default_price = models.DecimalField(max_digits=15, decimal_places=2)
shipping_per_unit = models.DecimalField(max_digits=9, decimal_places=2)
weight_in_lbs = models.DecimalField(max_digits=5, decimal_places=2)
def __unicode__(self):
return self.name
class Quote(models.Model):
## Human name for easy reference
name = models.CharField(max_length=100)
items = models.ManyToManyField(Product, through='QuoteIncludes')
def __unicode__(self):
return self.name
class QuoteIncludes(models.Model):
## Attach foreign keys between a Quote and Product
product = models.ForeignKey(Product)
quote = models.ForeignKey(Quote)
## Additional fields when adding product to a Quote
quantity = models.PositiveIntegerField()
per_unit_cost = models.DecimalField(max_digits=15, decimal_places=2)
per_unit_price = models.DecimalField(max_digits=15, decimal_places=2)
def _get_extended_price(self):
"""Gets extended price by multiplying quantity and unit price."""
if self.quantity and self.per_unit_price:
return self.quantity * self.per_unit_price
else:
return 0.00
extended_price = _get_extended_price
What I would like to be able to do is create a Quote in the Admin interface such that when I've filled in both the quantity and the per_unit_price of a line item, it fills in the "extended_price" as a product of the two when I tab over. I think it requires adding some AJAX in there.
![Annotated picture describing what I would like][1]
[1]: http://i.stack.imgur.com/Nk8Wn.jpg | python | django | methods | django-admin | admin | null | open | Django: Update Field Value Based on Other Fields
===
I am not sure this is even possible without modifying the Admin interface.
I have a model called "Quote" that can contain multiple "Product" models. I connect the two using an intermediate model "QuoteIncludes". Here are the three models as they currently stand:
class Product(models.Model):
name = models.CharField(max_length=100)
short_desc = models.CharField(max_length=200)
default_cost = models.DecimalField(max_digits=15, decimal_places=2)
default_price = models.DecimalField(max_digits=15, decimal_places=2)
shipping_per_unit = models.DecimalField(max_digits=9, decimal_places=2)
weight_in_lbs = models.DecimalField(max_digits=5, decimal_places=2)
def __unicode__(self):
return self.name
class Quote(models.Model):
## Human name for easy reference
name = models.CharField(max_length=100)
items = models.ManyToManyField(Product, through='QuoteIncludes')
def __unicode__(self):
return self.name
class QuoteIncludes(models.Model):
## Attach foreign keys between a Quote and Product
product = models.ForeignKey(Product)
quote = models.ForeignKey(Quote)
## Additional fields when adding product to a Quote
quantity = models.PositiveIntegerField()
per_unit_cost = models.DecimalField(max_digits=15, decimal_places=2)
per_unit_price = models.DecimalField(max_digits=15, decimal_places=2)
def _get_extended_price(self):
"""Gets extended price by multiplying quantity and unit price."""
if self.quantity and self.per_unit_price:
return self.quantity * self.per_unit_price
else:
return 0.00
extended_price = _get_extended_price
What I would like to be able to do is create a Quote in the Admin interface such that when I've filled in both the quantity and the per_unit_price of a line item, it fills in the "extended_price" as a product of the two when I tab over. I think it requires adding some AJAX in there.
![Annotated picture describing what I would like][1]
[1]: http://i.stack.imgur.com/Nk8Wn.jpg | 0 |
11,192,202 | 06/25/2012 15:21:31 | 1,479,894 | 06/25/2012 12:03:54 | 1 | 0 | sending ATA commands directly from user space in linux | What I wanna trying to accomplish:
Developing an linux application in C language, that "exclusively" accesses a
PATA/SATA hard disk drive(HDD) to send ATA commands(in fact only those ATA commands that
do not modify any byte on HDD accessed - eg. READ_SECTOR, IDENTIFY_DEVICE, SET_FEATURES,
etc.).
By "exclusively", I mean that as soon as HDD is powered on(a custom hardware-which is a simple on-off switch, ensures that HDD is not powered on till the application is loaded and desires to do so), the first and only access to that HDD is only to my application. IOWs except my application, not even the linux kernel(including SCSI sub-system) nor any other application or process or human user will ever be able to access that HDD, unless when my application instructs/permits them to do so.
There is another requirement on my application:
As the access to HDD is quite critical(in terms of control and not in terms of performance) in our app., so it is not desired that any I/O schedular is involved in the transactions done by application(performance on this HDD is not a constraint.). Also it is not desired that the data read from HDD is buffered by kernel buffer or page buffer. The application will read in block size of 512 bytes or a multiple of it only.
Now the problem that I'm facing is:
The SCSI sub-system resides below(and written to work with) I/O scheduler and kernel buffer or page buffer cache.
Although 'sg-driver' is provided by the SCSI subsystem to directly send commands(- Linux SCSI sub-system commands, not ATA or SCSI commands directly - which are then translated by libata to actual ATA commands. Am I right here?) to the HDD,but that is a I/O approach - you give i/p and get o/p, i.e. you have no control over the process of data transfer protocol (eg PIO, DMA and ATA status and Error registers, etc.) and device configuration(via Set Features ATA command.).
Also the error reporting mechanism must be sound and is specific to ATA protocol and not simply Linux SCSI subsystem error codes. IOWs my application need to have access to ATA error register and ATA status register on PATA/SATA HDDs.
What my application demands is exclusive control of HDD - eg. issuing a READ_SECTOR ATA cmd and then retrieving the data itself from HDD directly via reading i/o ports or via 'libata' with the above requirements must be satisfied.
What I can't do ?
I'm not going to write a PATA/SATA HBA device driver or every HBA available in market, as those are already included in kernel for libata.
What I learned till now ?
To accomplish the desired task, I may(or may not?) need to write a block device driver that interacts directly with VFS layer(or is there any way to bypass VFS even, so that my app. can directly communicate with this block driver) w/o involving/messing with kernel buffer or page buffer and I/O scheduler.
This block driver will communicate directly with libata(bypassing SCSI subsystem upper layer ), which then communicates with PATA/SATA HBA driver.
Is it possible to write such a driver in a cpu architecture independent way?
Is it a feasible approach? If yes then would it affect I/O performance of other HDDs attached that are not accessed by my app. in this way. Do I need to write a system call over VFS(or bypassing it if possible)in this case for my application to communicate wih my block driver?
Please enlighten me regarding this approach.
or is it possible for my block device driver to directly communicate with PATA/SATA HBA driver written for libata,
But again would this approach affect I/O performance of other HDDs attached that are not accessed by my app. in this way. Also how would my application communicate with this block device driver?
Please enlighten me.
Also I wanna know about the same scenario for my application, with one difference - instead of PATA/SATA drives what if I have SCSI hard drives and its variants - specifically, SAS, Fibre channel and USB. And of course this time i'll not be using libata and ATA commands, but SCSI protocol commands.
Would u like to suggest a live cd distro as my application host, that contains PATA/SATA HBA libata drivers(- not for IDE sub-system as I will not be using it for it is depreciated now and hence might not be updated with regards for HBA drivers.) for most HBAs.
In short, what is the most direct way for an linux application to access a PATA/SATA or SCSI/SAS/Fibre Channel HDD.
I hope, I have provided sufficient info regarding my question, but if u wanna get more info or more clarification, please feel free to ask.
| linux-kernel | driver | sata | ata | hard-drive | null | open | sending ATA commands directly from user space in linux
===
What I wanna trying to accomplish:
Developing an linux application in C language, that "exclusively" accesses a
PATA/SATA hard disk drive(HDD) to send ATA commands(in fact only those ATA commands that
do not modify any byte on HDD accessed - eg. READ_SECTOR, IDENTIFY_DEVICE, SET_FEATURES,
etc.).
By "exclusively", I mean that as soon as HDD is powered on(a custom hardware-which is a simple on-off switch, ensures that HDD is not powered on till the application is loaded and desires to do so), the first and only access to that HDD is only to my application. IOWs except my application, not even the linux kernel(including SCSI sub-system) nor any other application or process or human user will ever be able to access that HDD, unless when my application instructs/permits them to do so.
There is another requirement on my application:
As the access to HDD is quite critical(in terms of control and not in terms of performance) in our app., so it is not desired that any I/O schedular is involved in the transactions done by application(performance on this HDD is not a constraint.). Also it is not desired that the data read from HDD is buffered by kernel buffer or page buffer. The application will read in block size of 512 bytes or a multiple of it only.
Now the problem that I'm facing is:
The SCSI sub-system resides below(and written to work with) I/O scheduler and kernel buffer or page buffer cache.
Although 'sg-driver' is provided by the SCSI subsystem to directly send commands(- Linux SCSI sub-system commands, not ATA or SCSI commands directly - which are then translated by libata to actual ATA commands. Am I right here?) to the HDD,but that is a I/O approach - you give i/p and get o/p, i.e. you have no control over the process of data transfer protocol (eg PIO, DMA and ATA status and Error registers, etc.) and device configuration(via Set Features ATA command.).
Also the error reporting mechanism must be sound and is specific to ATA protocol and not simply Linux SCSI subsystem error codes. IOWs my application need to have access to ATA error register and ATA status register on PATA/SATA HDDs.
What my application demands is exclusive control of HDD - eg. issuing a READ_SECTOR ATA cmd and then retrieving the data itself from HDD directly via reading i/o ports or via 'libata' with the above requirements must be satisfied.
What I can't do ?
I'm not going to write a PATA/SATA HBA device driver or every HBA available in market, as those are already included in kernel for libata.
What I learned till now ?
To accomplish the desired task, I may(or may not?) need to write a block device driver that interacts directly with VFS layer(or is there any way to bypass VFS even, so that my app. can directly communicate with this block driver) w/o involving/messing with kernel buffer or page buffer and I/O scheduler.
This block driver will communicate directly with libata(bypassing SCSI subsystem upper layer ), which then communicates with PATA/SATA HBA driver.
Is it possible to write such a driver in a cpu architecture independent way?
Is it a feasible approach? If yes then would it affect I/O performance of other HDDs attached that are not accessed by my app. in this way. Do I need to write a system call over VFS(or bypassing it if possible)in this case for my application to communicate wih my block driver?
Please enlighten me regarding this approach.
or is it possible for my block device driver to directly communicate with PATA/SATA HBA driver written for libata,
But again would this approach affect I/O performance of other HDDs attached that are not accessed by my app. in this way. Also how would my application communicate with this block device driver?
Please enlighten me.
Also I wanna know about the same scenario for my application, with one difference - instead of PATA/SATA drives what if I have SCSI hard drives and its variants - specifically, SAS, Fibre channel and USB. And of course this time i'll not be using libata and ATA commands, but SCSI protocol commands.
Would u like to suggest a live cd distro as my application host, that contains PATA/SATA HBA libata drivers(- not for IDE sub-system as I will not be using it for it is depreciated now and hence might not be updated with regards for HBA drivers.) for most HBAs.
In short, what is the most direct way for an linux application to access a PATA/SATA or SCSI/SAS/Fibre Channel HDD.
I hope, I have provided sufficient info regarding my question, but if u wanna get more info or more clarification, please feel free to ask.
| 0 |
1,021,371 | 06/20/2009 10:20:14 | 101,160 | 05/04/2009 21:38:12 | 97 | 5 | Xcode: Adding Existing Files to Groups & Files Pane causes build error | I'm working on a project hosted in Beanstalk and would like to access one of my files in my subversion repository.
I can clearly see the files "SoundEffect.h" and "SoundEffect.m" in the web-based browser directory, but the files do not appear in the "Groups and Files" pane on the left of Xcode after a refresh and update from Xcode.
I tried to "right click on a file, and add->existing files" for both SoundEffect.(h|m) and they both appear. But now my project won't build and I get strange errors like
"_AudioServicesPlaySystemSound", referenced from:
"_AudioServicesCreateSystemSoundID", referenced from:
"_AudioServicesDisposeSystemSoundID", referenced from:
even though I haven't used the files.
What is going on and how can I fix it? | xcode | null | null | null | null | null | open | Xcode: Adding Existing Files to Groups & Files Pane causes build error
===
I'm working on a project hosted in Beanstalk and would like to access one of my files in my subversion repository.
I can clearly see the files "SoundEffect.h" and "SoundEffect.m" in the web-based browser directory, but the files do not appear in the "Groups and Files" pane on the left of Xcode after a refresh and update from Xcode.
I tried to "right click on a file, and add->existing files" for both SoundEffect.(h|m) and they both appear. But now my project won't build and I get strange errors like
"_AudioServicesPlaySystemSound", referenced from:
"_AudioServicesCreateSystemSoundID", referenced from:
"_AudioServicesDisposeSystemSoundID", referenced from:
even though I haven't used the files.
What is going on and how can I fix it? | 0 |
281,383 | 11/11/2008 16:27:12 | 35,454 | 11/07/2008 12:36:06 | 11 | 6 | Maintaining JavaScript Code in the <Head> after ASP.Net Postback. | As the title suggests, I am having trouble maintaining my code on postback. I have a bunch of jQuery code in the <Head> section and this works fine until a postback occurs after which it ceases to function!
How can I fix this? Does the <head> not get read on postback, and is there a way in which I can force this to happen?
JavaScript is:
<script type="text/javascript">
$(document).ready(function()
{
$('.tablesorter tbody tr').tablesorter();
$('.tablesearch tbody tr').quicksearch({
position: 'before',
attached: 'table.tablesearch',
stripeRowClass: ['odd', 'even'],
labelText: 'Search:',
delay: 100
});
});
</script>
Thanks in advance :) | asp.net | postback | javascript | jquery | null | null | open | Maintaining JavaScript Code in the <Head> after ASP.Net Postback.
===
As the title suggests, I am having trouble maintaining my code on postback. I have a bunch of jQuery code in the <Head> section and this works fine until a postback occurs after which it ceases to function!
How can I fix this? Does the <head> not get read on postback, and is there a way in which I can force this to happen?
JavaScript is:
<script type="text/javascript">
$(document).ready(function()
{
$('.tablesorter tbody tr').tablesorter();
$('.tablesearch tbody tr').quicksearch({
position: 'before',
attached: 'table.tablesearch',
stripeRowClass: ['odd', 'even'],
labelText: 'Search:',
delay: 100
});
});
</script>
Thanks in advance :) | 0 |
5,929,954 | 05/08/2011 19:59:10 | 744,186 | 05/08/2011 19:59:10 | 1 | 0 | Is this a mnemoniac to binary? | What do numbers like 0x00000000 and similar do? | numbers | null | null | null | null | 05/08/2011 20:05:55 | not a real question | Is this a mnemoniac to binary?
===
What do numbers like 0x00000000 and similar do? | 1 |
3,433,275 | 08/08/2010 06:04:29 | 102,704 | 05/07/2009 07:13:48 | 2,565 | 106 | Adjust brightness and contrast of BufferedImage in Java | I'm processing a bunch of images with some framework, and all I'm given is a bunch of `BufferedImage` objects. Unfortunately, these images are really dim, and I'd like to brighten them up and adjust the contrast a little.
Something like:
BufferedImage image = something.getImage();
image = new Brighten(image).brighten(0.3); // for 30%
image = new Contrast(image).contrast(0.3);
// ...
Any ideas? | java | graphics | image-processing | null | null | null | open | Adjust brightness and contrast of BufferedImage in Java
===
I'm processing a bunch of images with some framework, and all I'm given is a bunch of `BufferedImage` objects. Unfortunately, these images are really dim, and I'd like to brighten them up and adjust the contrast a little.
Something like:
BufferedImage image = something.getImage();
image = new Brighten(image).brighten(0.3); // for 30%
image = new Contrast(image).contrast(0.3);
// ...
Any ideas? | 0 |
6,972,648 | 08/07/2011 12:01:17 | 836,311 | 04/20/2010 16:01:44 | 1 | 0 | filtrer réponse xml | my problem is that I get in the first page a list of titles in texblock then navigating to the second page I get the description of each title selected. The problem here is that It returns a full description of all titles which is not my goal
her's the xml file:
<item>
<title>titre11</title>
<description>desc</description>
</item>
<item>
<title>titre3</title>
<description>desccription</description>
</item>
c#:
listBox1.ItemsSource = from channel in xmlItems.Descendants("item")
let tit = channel.Element("title")
let des = channel.Element("description")
select new items
{
title = tit == null ? null : tit.Value,
description = des == null ? null : des.Value,
}; | windows-phone-7 | null | null | null | null | 11/10/2011 13:43:54 | not a real question | filtrer réponse xml
===
my problem is that I get in the first page a list of titles in texblock then navigating to the second page I get the description of each title selected. The problem here is that It returns a full description of all titles which is not my goal
her's the xml file:
<item>
<title>titre11</title>
<description>desc</description>
</item>
<item>
<title>titre3</title>
<description>desccription</description>
</item>
c#:
listBox1.ItemsSource = from channel in xmlItems.Descendants("item")
let tit = channel.Element("title")
let des = channel.Element("description")
select new items
{
title = tit == null ? null : tit.Value,
description = des == null ? null : des.Value,
}; | 1 |
7,895,498 | 10/25/2011 20:31:25 | 400,988 | 07/24/2010 10:18:59 | 47 | 2 | Incompatible pointer types initializing IOS5 | I had the following statement in IOS 4:
drawTimebar *drawView = [drawTimebarView initWithFrame:drawTimebarView.frame];
and it was working just fine then. Now I switched to IOS 5 SDK and the same sentence gives the following warning:
> Incompatible pointer types initializing 'drawTimebar *' with an expression of type 'UIView *'
How come this has changed and what can I do to solve it?
Thanks everybody! | iphone | ios | ios4 | ios5 | null | null | open | Incompatible pointer types initializing IOS5
===
I had the following statement in IOS 4:
drawTimebar *drawView = [drawTimebarView initWithFrame:drawTimebarView.frame];
and it was working just fine then. Now I switched to IOS 5 SDK and the same sentence gives the following warning:
> Incompatible pointer types initializing 'drawTimebar *' with an expression of type 'UIView *'
How come this has changed and what can I do to solve it?
Thanks everybody! | 0 |
9,270,354 | 02/14/2012 01:02:36 | 1,058,229 | 11/21/2011 16:47:29 | 43 | 0 | IS there a way to compile into a JAR even though errors occur | I am trying to compile a file into a .jar, but NetBeans won't let me compile it. Im getting errors that the `import` files are not on the computer. This is because I don't have them on my computer here. Is there a way I can force compile? I am using NetBeans 7.0.1 for Mac. | java | netbeans | compiler | null | null | 02/14/2012 01:22:43 | not a real question | IS there a way to compile into a JAR even though errors occur
===
I am trying to compile a file into a .jar, but NetBeans won't let me compile it. Im getting errors that the `import` files are not on the computer. This is because I don't have them on my computer here. Is there a way I can force compile? I am using NetBeans 7.0.1 for Mac. | 1 |
6,878,954 | 07/29/2011 20:56:11 | 870,045 | 07/29/2011 20:53:53 | 1 | 0 | Add one to a UILabel | I have a UILabel and when the user presses a button i want the label to add one to its value. But I'm having a bit of trouble with this. Here is my code:
- (IBAction)addButton2:(id)sender {
int integer = 1;
integer++;
[label1 setText:[NSString stringWithFormat:@"%i",integer]];
}
Please help :D thanks ,
John Travolta | iphone | cocoa | uilabel | int | null | null | open | Add one to a UILabel
===
I have a UILabel and when the user presses a button i want the label to add one to its value. But I'm having a bit of trouble with this. Here is my code:
- (IBAction)addButton2:(id)sender {
int integer = 1;
integer++;
[label1 setText:[NSString stringWithFormat:@"%i",integer]];
}
Please help :D thanks ,
John Travolta | 0 |
6,400,908 | 06/19/2011 06:15:25 | 805,109 | 06/19/2011 06:15:25 | 1 | 0 | How to create a website with the options to upload & download files to & from it? | I wanted to host my own domain website in x10hosting.com.
So created an account in that & set it up the domain. Now n my site i want to upload some files which has to be available in my site itself & if i choose to upload it has to be uploaded into my site which in turn uploaded into my hosting site. How can i do that? | php | null | null | null | null | 06/19/2011 07:01:56 | not a real question | How to create a website with the options to upload & download files to & from it?
===
I wanted to host my own domain website in x10hosting.com.
So created an account in that & set it up the domain. Now n my site i want to upload some files which has to be available in my site itself & if i choose to upload it has to be uploaded into my site which in turn uploaded into my hosting site. How can i do that? | 1 |
7,467,571 | 09/19/2011 07:17:47 | 952,143 | 09/19/2011 07:17:47 | 1 | 0 | logged in function for both logged in and logged out | okay this is tricky, i need this to work or be shown for both of those logged in and logged out. But with this code, if set to "true" and "false" either only those logged in or only those logged out. How can i get it to work for both situations? here is the code:
<?php if(isset($this->loggedin) && $this->loggedin == false){ ?>
Right now it only work for those logged out because it is set to false. | logged | false | null | null | null | 09/19/2011 21:09:38 | not a real question | logged in function for both logged in and logged out
===
okay this is tricky, i need this to work or be shown for both of those logged in and logged out. But with this code, if set to "true" and "false" either only those logged in or only those logged out. How can i get it to work for both situations? here is the code:
<?php if(isset($this->loggedin) && $this->loggedin == false){ ?>
Right now it only work for those logged out because it is set to false. | 1 |
2,557,357 | 04/01/2010 00:12:26 | 181,452 | 09/29/2009 22:19:50 | 477 | 46 | TFS 2010: how to reject gated checkin based on code duplication metric? | I'm running Microsoft Team Foundation Server 2010, and using it to build a .NET 4.0 Solution.
I have enabled gated checkins, and we run our tests as part of the build, so the server rejects any checkin that causes the tests to break.
However, I want to take this a step further and reject checkins that contain more than a certain proportion of code duplication.
Is there a tool for TFS 2010, or perhaps an existing feature that I've missed, that would allow me to do this? | tfs2010 | code-analysis | null | null | null | null | open | TFS 2010: how to reject gated checkin based on code duplication metric?
===
I'm running Microsoft Team Foundation Server 2010, and using it to build a .NET 4.0 Solution.
I have enabled gated checkins, and we run our tests as part of the build, so the server rejects any checkin that causes the tests to break.
However, I want to take this a step further and reject checkins that contain more than a certain proportion of code duplication.
Is there a tool for TFS 2010, or perhaps an existing feature that I've missed, that would allow me to do this? | 0 |
4,489,177 | 12/20/2010 11:28:15 | 417,081 | 08/11/2010 09:51:55 | 28 | 1 | C# Foreach usercontrols I added to a page. | I've got this code:
protected void ddlTemplate_SelectedIndexChanged(object sender, EventArgs e)
{
Template t = new Template();
t.LoadById(Convert.ToInt32(ddlTemplate.SelectedItem.Value));
foreach (Widget w in t.TemplateWidgets)
{
UserControls_Widget ucWidget = (UserControls_Widget)LoadControl("~/UserControls/ucWidget.ascx");
ucWidget.WidgetTitle = w.Name;
ucWidget.Parameters = w.Parameters;
pnlWidgets.Controls.Add(ucWidget);
}
}
protected void lnkSubmit_Click(object sender, EventArgs e)
{
foreach (Control cc in pnlWidgets.Controls)
{
}
}
Basically I'd like to foreach the Widgets I added to the page in the ddlTemplate_SelectedIndexChanged event. So the question is how do I get the UserControls I added.
| c# | null | null | null | null | null | open | C# Foreach usercontrols I added to a page.
===
I've got this code:
protected void ddlTemplate_SelectedIndexChanged(object sender, EventArgs e)
{
Template t = new Template();
t.LoadById(Convert.ToInt32(ddlTemplate.SelectedItem.Value));
foreach (Widget w in t.TemplateWidgets)
{
UserControls_Widget ucWidget = (UserControls_Widget)LoadControl("~/UserControls/ucWidget.ascx");
ucWidget.WidgetTitle = w.Name;
ucWidget.Parameters = w.Parameters;
pnlWidgets.Controls.Add(ucWidget);
}
}
protected void lnkSubmit_Click(object sender, EventArgs e)
{
foreach (Control cc in pnlWidgets.Controls)
{
}
}
Basically I'd like to foreach the Widgets I added to the page in the ddlTemplate_SelectedIndexChanged event. So the question is how do I get the UserControls I added.
| 0 |
11,641,745 | 07/25/2012 02:11:50 | 1,550,260 | 07/25/2012 01:49:37 | 1 | 0 | Library java code, found at MIT java , not sure whats wrong with the code | i have this problem with the code, for both the Strings that define library up at the top, the error says "Syntax error on token "String", invalid Modifiers" for the first one, and the second error is "Syntax error on token "String", { expected" , I'm not sure how to fix it, thanks for the help. Bolded is where the error code is from.
public abstract class Library {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
}
// Create two libraries
**String Library firstLibrary = new Library("10 Main St.");
String Library1 secondLibrary = new Library("228 Liberty St.");**
// Add four books to the first library
firstLibrary.addBook = (new Book("The Da Vinci Code"));
firstLibrary.addBook = (new Book("Le Petit Prince"));
firstLibrary.addBook = (new Book("A Tale of Two Cities"));
firstLibrary.addBook = (new Book("The Lord of the Rings"));
// Print opening hours and the addresses
System.out.println("Library hours:");
String OpeningHours = "9am - 5pm";
System.out.printOpeningHours();
System.out.println();
System.out.println("Library addresses:");
firstLibrary.printAddress();
secondLibrary.printAddress();
System.out.println();
// Try to borrow The Lords of the Rings from both libraries
System.out.println("Borrowing The Lord of the Rings:");
firstLibrary.borrowBook("The Lord of the Rings");
firstLibrary.borrowBook("The Lord of the Rings");
secondLibrary.borrowBook("The Lord of the Rings");
System.out.println();
// Print the titles of all available books from both libraries
System.out.println("Books available in the first library:");
firstLibrary.printAvailableBooks();
System.out.println();
System.out.println("Books available in the second library:");
secondLibrary.printAvailableBooks();
System.out.println();
// Return The Lords of the Rings to the first library
System.out.println("Returning The Lord of the Rings:");
firstLibrary.returnBook("The Lord of the Rings");
System.out.println();
// Print the titles of available from the first library
System.out.println("Books available in the first library:");
firstLibrary.printAvailableBooks();
}} | java | javascript | null | null | null | 07/25/2012 12:51:30 | too localized | Library java code, found at MIT java , not sure whats wrong with the code
===
i have this problem with the code, for both the Strings that define library up at the top, the error says "Syntax error on token "String", invalid Modifiers" for the first one, and the second error is "Syntax error on token "String", { expected" , I'm not sure how to fix it, thanks for the help. Bolded is where the error code is from.
public abstract class Library {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
}
// Create two libraries
**String Library firstLibrary = new Library("10 Main St.");
String Library1 secondLibrary = new Library("228 Liberty St.");**
// Add four books to the first library
firstLibrary.addBook = (new Book("The Da Vinci Code"));
firstLibrary.addBook = (new Book("Le Petit Prince"));
firstLibrary.addBook = (new Book("A Tale of Two Cities"));
firstLibrary.addBook = (new Book("The Lord of the Rings"));
// Print opening hours and the addresses
System.out.println("Library hours:");
String OpeningHours = "9am - 5pm";
System.out.printOpeningHours();
System.out.println();
System.out.println("Library addresses:");
firstLibrary.printAddress();
secondLibrary.printAddress();
System.out.println();
// Try to borrow The Lords of the Rings from both libraries
System.out.println("Borrowing The Lord of the Rings:");
firstLibrary.borrowBook("The Lord of the Rings");
firstLibrary.borrowBook("The Lord of the Rings");
secondLibrary.borrowBook("The Lord of the Rings");
System.out.println();
// Print the titles of all available books from both libraries
System.out.println("Books available in the first library:");
firstLibrary.printAvailableBooks();
System.out.println();
System.out.println("Books available in the second library:");
secondLibrary.printAvailableBooks();
System.out.println();
// Return The Lords of the Rings to the first library
System.out.println("Returning The Lord of the Rings:");
firstLibrary.returnBook("The Lord of the Rings");
System.out.println();
// Print the titles of available from the first library
System.out.println("Books available in the first library:");
firstLibrary.printAvailableBooks();
}} | 3 |
6,789,825 | 07/22/2011 12:11:35 | 775,761 | 05/30/2011 05:20:27 | 76 | 5 | How to implement pull to refresh in UITableviewcontroller in Tabbased application? | I am working on a project which contains both applications i.e Navigation and Tab based application. There I used tableview to show some titles with there images. I want to implement pull to refresh mechanism in it. I have the code of that and it is working fine in navigation based application. But, when I tried the same code in my project it is not showing there.
There might be some issues of views which I m not able to resolve. So can anybody provide me some sample code or tutorial to solve it.
Thanks in advance | iphone | objective-c | uinavigationcontroller | uitabbarcontroller | null | null | open | How to implement pull to refresh in UITableviewcontroller in Tabbased application?
===
I am working on a project which contains both applications i.e Navigation and Tab based application. There I used tableview to show some titles with there images. I want to implement pull to refresh mechanism in it. I have the code of that and it is working fine in navigation based application. But, when I tried the same code in my project it is not showing there.
There might be some issues of views which I m not able to resolve. So can anybody provide me some sample code or tutorial to solve it.
Thanks in advance | 0 |
11,698,806 | 07/28/2012 06:19:30 | 1,504,134 | 07/05/2012 13:21:52 | 1 | 0 | I want a checking like no user can enter any offensive/abusive data in my database. | I am developing a demo dating application where user can register and anyone can see their profile ( back-end : php ,MySQL).
I want a checking like no user can enter any offensive/abusive data in my database.
Is there any such method to do so. Please suggest.
All suggestion are welcome. | php | android | mysql | database | null | 07/28/2012 09:15:32 | not a real question | I want a checking like no user can enter any offensive/abusive data in my database.
===
I am developing a demo dating application where user can register and anyone can see their profile ( back-end : php ,MySQL).
I want a checking like no user can enter any offensive/abusive data in my database.
Is there any such method to do so. Please suggest.
All suggestion are welcome. | 1 |
7,833,756 | 10/20/2011 09:24:20 | 500,625 | 11/08/2010 11:36:43 | 415 | 40 | iPhone - Electronic Fund Transfer(EFT) system | I am about to develop a new iPhone application in which I need to pay for some bills. I need to use Electronic Fund Transfer(EFT) system to make the payment. I have no idea in integrating the EFT method to the application. Share some useful ideas or links where can I get some ideas regarding EFT and the work flow. | iphone | objective-c | ios | iphone-sdk-4.0 | ios5 | 10/21/2011 17:53:38 | not constructive | iPhone - Electronic Fund Transfer(EFT) system
===
I am about to develop a new iPhone application in which I need to pay for some bills. I need to use Electronic Fund Transfer(EFT) system to make the payment. I have no idea in integrating the EFT method to the application. Share some useful ideas or links where can I get some ideas regarding EFT and the work flow. | 4 |
7,588,011 | 09/28/2011 18:48:31 | 967,149 | 09/27/2011 13:32:22 | 3 | 0 | Php syntax error t_variable error? | Im trying to post to the users wall i have there id and offline token stored in the database
$result22 = mysql_query("SELECT token FROM usersoffline", $link2);
$num_rows2 = mysql_num_rows($result22);
// Get all the data from the "example" table
$result = mysql_query("SELECT * FROM usersoffline")
or die(mysql_error());
echo "<table border='1'>";
echo "<tr> <th>id</th> <th>Toekn</th> </tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo $row['uid'];
echo "</td><td>";
echo $row['token'];
echo "</td></tr>";
$target = $row['uid'] ;
$attachment = array(
'access_token' => $row['token'],
'message' => 'Did a Test Post :',
'name' => "Offline posting using stored tokens",
'link' => "url",
'description' => "This post was made using a stored access token",
'picture'=>"",
);
$ret_code=$facebook->api('/'.$target.'/feed', 'POST', $attachment);
}
echo "</table>";
for some resson it is not posting ??? | php | facebook | php5 | facebook-connect | null | null | open | Php syntax error t_variable error?
===
Im trying to post to the users wall i have there id and offline token stored in the database
$result22 = mysql_query("SELECT token FROM usersoffline", $link2);
$num_rows2 = mysql_num_rows($result22);
// Get all the data from the "example" table
$result = mysql_query("SELECT * FROM usersoffline")
or die(mysql_error());
echo "<table border='1'>";
echo "<tr> <th>id</th> <th>Toekn</th> </tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo $row['uid'];
echo "</td><td>";
echo $row['token'];
echo "</td></tr>";
$target = $row['uid'] ;
$attachment = array(
'access_token' => $row['token'],
'message' => 'Did a Test Post :',
'name' => "Offline posting using stored tokens",
'link' => "url",
'description' => "This post was made using a stored access token",
'picture'=>"",
);
$ret_code=$facebook->api('/'.$target.'/feed', 'POST', $attachment);
}
echo "</table>";
for some resson it is not posting ??? | 0 |
307,232 | 11/20/2008 23:03:06 | 39,476 | 11/20/2008 21:38:48 | 1 | 0 | Immutable beans in Java | I am very curious about the possibility of providing immutability for java beans (by beans here I mean classes with an empty constructor providing getters and setters for members). Clearly these classes are not immutable and where they are used to transport values from the data layer this seems like a real problem.
One approach to this problem has been mentioned here in StackOverflow called "Immutable object pattern in C#" where the object is frozen once fully built. I have an alternative approach and would really like to hear people's opinions on it.
The pattern involves two classes Immutable and Mutable where Mutable extends Immutable and Mutable is a mutable version of the immutable Immutable.
For example
public interface DateBean {
public Date getDate();
public DateBean getImmutableInstance();
public DateBean getMutableInstance();
}
public class ImmutableDate implements DateBean {
private Date date;
ImmutableDate(Date date) {
this.date = new Date(date.getTime());
}
public Date getDate() {
return new Date(date.getTime());
}
public DateBean getImmutableInstance() {
return this;
}
public DateBean getMutableInstance() {
MutableDate dateBean = new MutableDate();
dateBean.setDate(getDate());
return dateBean;
}
}
public class MutableDate implements DateBean {
private Date date;
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
public DateBean getImmutableInstance() {
return new ImmutableDate(this.date);
}
public DateBean getMutableInstance() {
MutableDate dateBean = new MutableDate();
dateBean.setDate(getDate());
return dateBean;
}
}
This approach allows the bean to be constructed using reflection (by the usual conventions) and also allows us to convert to an immutable variant at the nearest opportunity. Unfortunately there is clearly a large amount of boilerplate per bean.
I would really love to hear other people's approach to this issue. (My apologies for not providing a good question, which can be answered rather than discussed :) | concurrency | immutable | javabeans | null | null | null | open | Immutable beans in Java
===
I am very curious about the possibility of providing immutability for java beans (by beans here I mean classes with an empty constructor providing getters and setters for members). Clearly these classes are not immutable and where they are used to transport values from the data layer this seems like a real problem.
One approach to this problem has been mentioned here in StackOverflow called "Immutable object pattern in C#" where the object is frozen once fully built. I have an alternative approach and would really like to hear people's opinions on it.
The pattern involves two classes Immutable and Mutable where Mutable extends Immutable and Mutable is a mutable version of the immutable Immutable.
For example
public interface DateBean {
public Date getDate();
public DateBean getImmutableInstance();
public DateBean getMutableInstance();
}
public class ImmutableDate implements DateBean {
private Date date;
ImmutableDate(Date date) {
this.date = new Date(date.getTime());
}
public Date getDate() {
return new Date(date.getTime());
}
public DateBean getImmutableInstance() {
return this;
}
public DateBean getMutableInstance() {
MutableDate dateBean = new MutableDate();
dateBean.setDate(getDate());
return dateBean;
}
}
public class MutableDate implements DateBean {
private Date date;
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
public DateBean getImmutableInstance() {
return new ImmutableDate(this.date);
}
public DateBean getMutableInstance() {
MutableDate dateBean = new MutableDate();
dateBean.setDate(getDate());
return dateBean;
}
}
This approach allows the bean to be constructed using reflection (by the usual conventions) and also allows us to convert to an immutable variant at the nearest opportunity. Unfortunately there is clearly a large amount of boilerplate per bean.
I would really love to hear other people's approach to this issue. (My apologies for not providing a good question, which can be answered rather than discussed :) | 0 |
5,523,557 | 04/02/2011 13:53:58 | 557,527 | 12/12/2010 08:08:02 | 107 | 11 | Rails help ajax rating | I am having a bit trouble creating some simple ajax rating based on these two answers. http://stackoverflow.com/questions/5033879/rails-3-rateable-model-how-to-create-ajax-rating and http://stackoverflow.com/questions/5516970/rails-ajax-rating-help-how-to-create-a-helper-method-to-display-stars
I get the following error in my kategori view:
NameError in Kategoris#show
Showing C:/Rails/konkurranceportalen/app/views/kategoris/_rating.html.erb where line #1 raised:
undefined local variable or method `vind' for #<#<Class:0x3a13aa8>:0x39e16c0>
Extracted source (around line #1):
1: <%= form_tag url_for(controller: 'konkurrancers', action: 'rate', id: vind.id), remote: true %>
2: <%= f.text_field :ratings, :size => 1, :min => 0, :max => 5, :step => 1 %>
3: <div class="rateit" data-rateit-backingfld="#item_ratings" data-rateit-resetable="true">
4: </div>
My kategori show view:
<h1><%= @kategori.h2.force_encoding("UTF-8") %></h1>
<div id="konkurrancer"><%= render 'konkurrencer', :remote => true %></div>
</div>
My konkurrencer partial:
<div id="tabel">
<table id="tabel1" border="0" bordercolor="#000000" style="background-color:#FFFFFF" width="725" cellpadding="0" cellspacing="0">
<tr id="toptr">
<td><%= sortable "name", "Navn" %></td>
</tr>
<% @konkurrancer.each do |vind| %>
<tr class="thumbnail-item" onclick="window.open('<%= vind.tracking %>')" onmouseout="this.style.background='white';" onmouseover="this.style.background='#99ff33';this.style.cursor='pointer'">
<td width="280px" style="padding-left: 5px;"><%= truncate(vind.name.force_encoding("UTF-8"), :length => 45) %></td>
<td><div id="container"><%= render 'rating', :remote => true %></div></td>
</div>
</tr> <% end %>
</table>
<div id="pagenavi">
<%= hidden_field_tag :direction, params[:direction] %>
<%= hidden_field_tag :sort, params[:sort] %>
</div>
My ratings partial:
<%= form_tag url_for(controller: 'konkurrancers', action: 'rate', id: konkurrancer.id), remote: true %>
<%= f.text_field :ratings, :size => 1, :min => 0, :max => 5, :step => 1 %>
<div class="rateit" data-rateit-backingfld="#item_ratings" data-rateit-resetable="true">
</div>
My rate.js:
$('#<%= @container %>').html('<%= escape_javascript(render(partial: 'rating', locals: { konkurrancer: @konkurrancer })) %>');
My konkurrancers controller:
def rate
@konkurrancer = Konkurrancer.find(params[:id])
@container = "Konkurrancer"[email protected]_s
@theme.rating_score += params[:rating].to_i
@theme.ratings += 1
@theme.save
respond_to do |format|
format.js
end
end
end
| ruby-on-rails | ruby-on-rails-3 | null | null | null | null | open | Rails help ajax rating
===
I am having a bit trouble creating some simple ajax rating based on these two answers. http://stackoverflow.com/questions/5033879/rails-3-rateable-model-how-to-create-ajax-rating and http://stackoverflow.com/questions/5516970/rails-ajax-rating-help-how-to-create-a-helper-method-to-display-stars
I get the following error in my kategori view:
NameError in Kategoris#show
Showing C:/Rails/konkurranceportalen/app/views/kategoris/_rating.html.erb where line #1 raised:
undefined local variable or method `vind' for #<#<Class:0x3a13aa8>:0x39e16c0>
Extracted source (around line #1):
1: <%= form_tag url_for(controller: 'konkurrancers', action: 'rate', id: vind.id), remote: true %>
2: <%= f.text_field :ratings, :size => 1, :min => 0, :max => 5, :step => 1 %>
3: <div class="rateit" data-rateit-backingfld="#item_ratings" data-rateit-resetable="true">
4: </div>
My kategori show view:
<h1><%= @kategori.h2.force_encoding("UTF-8") %></h1>
<div id="konkurrancer"><%= render 'konkurrencer', :remote => true %></div>
</div>
My konkurrencer partial:
<div id="tabel">
<table id="tabel1" border="0" bordercolor="#000000" style="background-color:#FFFFFF" width="725" cellpadding="0" cellspacing="0">
<tr id="toptr">
<td><%= sortable "name", "Navn" %></td>
</tr>
<% @konkurrancer.each do |vind| %>
<tr class="thumbnail-item" onclick="window.open('<%= vind.tracking %>')" onmouseout="this.style.background='white';" onmouseover="this.style.background='#99ff33';this.style.cursor='pointer'">
<td width="280px" style="padding-left: 5px;"><%= truncate(vind.name.force_encoding("UTF-8"), :length => 45) %></td>
<td><div id="container"><%= render 'rating', :remote => true %></div></td>
</div>
</tr> <% end %>
</table>
<div id="pagenavi">
<%= hidden_field_tag :direction, params[:direction] %>
<%= hidden_field_tag :sort, params[:sort] %>
</div>
My ratings partial:
<%= form_tag url_for(controller: 'konkurrancers', action: 'rate', id: konkurrancer.id), remote: true %>
<%= f.text_field :ratings, :size => 1, :min => 0, :max => 5, :step => 1 %>
<div class="rateit" data-rateit-backingfld="#item_ratings" data-rateit-resetable="true">
</div>
My rate.js:
$('#<%= @container %>').html('<%= escape_javascript(render(partial: 'rating', locals: { konkurrancer: @konkurrancer })) %>');
My konkurrancers controller:
def rate
@konkurrancer = Konkurrancer.find(params[:id])
@container = "Konkurrancer"[email protected]_s
@theme.rating_score += params[:rating].to_i
@theme.ratings += 1
@theme.save
respond_to do |format|
format.js
end
end
end
| 0 |
6,329,105 | 06/13/2011 10:12:47 | 10,088 | 09/15/2008 21:09:09 | 1,527 | 26 | XCode4 can not Watch value of variables | It's a bit annoying that when I hit a break point in XCode 4, values of Watch Expressions are always grayed out. I have to create dummy variables pointing to the thing I want to watch in order to get around it.
The log says the following errors when I run the app:
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.3.3 (8J2)/Symbols/System/Library/Frameworks/IOKit.framework/IOKit (file not found).
warning: Tried to remove a non-existent library: /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.3.3 (8J2)/Symbols/System/Library/Frameworks/IOKit.framework/IOKit
Current language: auto; currently objective-c++
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.3.3 (8J2)/Symbols/Developer/usr/lib/libXcodeDebuggerSupport.dylib (file not found).
How can I fix this? | xcode4 | null | null | null | null | null | open | XCode4 can not Watch value of variables
===
It's a bit annoying that when I hit a break point in XCode 4, values of Watch Expressions are always grayed out. I have to create dummy variables pointing to the thing I want to watch in order to get around it.
The log says the following errors when I run the app:
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.3.3 (8J2)/Symbols/System/Library/Frameworks/IOKit.framework/IOKit (file not found).
warning: Tried to remove a non-existent library: /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.3.3 (8J2)/Symbols/System/Library/Frameworks/IOKit.framework/IOKit
Current language: auto; currently objective-c++
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.3.3 (8J2)/Symbols/Developer/usr/lib/libXcodeDebuggerSupport.dylib (file not found).
How can I fix this? | 0 |
6,494,079 | 06/27/2011 14:02:41 | 786,783 | 06/07/2011 03:13:59 | 74 | 0 | How can i create django models , views , forms with different names | Currently i have my models, views, forms in default file.
But i want to have directory structure like
articles
---------models
---------views
---------forms
Books
---------models
---------views
---------forms
Icecreams
---------models
---------views
---------forms
so that i keep separately but i don't want different app | django | django-models | null | null | null | null | open | How can i create django models , views , forms with different names
===
Currently i have my models, views, forms in default file.
But i want to have directory structure like
articles
---------models
---------views
---------forms
Books
---------models
---------views
---------forms
Icecreams
---------models
---------views
---------forms
so that i keep separately but i don't want different app | 0 |
11,719,049 | 07/30/2012 09:51:59 | 735,647 | 05/03/2011 07:19:58 | 74 | 0 | File Paths Are Too Long - Crashing FTP Transfers | I am using licensed version of CuteFTP to transfer files(Thousands in number) for one server to another.
The problem I am facing now is most of the FTP transfers are failing as File Paths Are Too Long.
On average, the character length of my file path would be anywhere between 200 & 250.
I cannot individually shorten the file titles manually as there are huge number of files.
Any ideas or suggestions to overcome this problem?
| c# | asp.net | ftp | null | null | 07/31/2012 07:42:54 | off topic | File Paths Are Too Long - Crashing FTP Transfers
===
I am using licensed version of CuteFTP to transfer files(Thousands in number) for one server to another.
The problem I am facing now is most of the FTP transfers are failing as File Paths Are Too Long.
On average, the character length of my file path would be anywhere between 200 & 250.
I cannot individually shorten the file titles manually as there are huge number of files.
Any ideas or suggestions to overcome this problem?
| 2 |
11,360,501 | 07/06/2012 10:32:07 | 1,506,442 | 07/06/2012 10:23:26 | 1 | 0 | paste a table from excel to powerpoint keep and formatting c# | Is it possible in c# copying a table from Excel and paste it on Powerpoint and keep formatting? I am using Office 2010.
I know it is possible pasting the table in Word but i don't find anything for PowerPoint | c# | null | null | null | null | null | open | paste a table from excel to powerpoint keep and formatting c#
===
Is it possible in c# copying a table from Excel and paste it on Powerpoint and keep formatting? I am using Office 2010.
I know it is possible pasting the table in Word but i don't find anything for PowerPoint | 0 |
8,072,899 | 11/09/2011 22:55:48 | 634,042 | 02/25/2011 11:39:47 | 8 | 0 | How to use nested class in C++? | I'm implementing a Timer such that the time spent on different kinds of events are categorized and listed. The class declaration goes something as follows:
#include "timer_event.h"
#include <boost/timer.hpp>
#include <vector>
class Timer {
private:
class TimedEvent;
public:
static void Construct();
static double GetSeconds(TimerEvent e);
static TimedEvent* Time(TimerEvent e);
protected:
private:
class TimedEvent {
public:
TimedEvent(double seconds, TimerEvent event);
~TimedEvent();
protected:
private:
TimerEvent event_;
double seconds_;
};
static double second_totals_[kCOUNT_TIMER_EVENT];
static int num_calls_[kCOUNT_TIMER_EVENT];
static int max_event_name_len_;
static boost::timer watch_;
};
Then, in the source file, I'm planning to implement the "Time" function as something like:
TimedEvent* Time(TimerEvent e) {
TimedEvent* ret = new TimedEvent(watch_.elapsed(),e);
return ret;
}
However, the linker's error message is:
../utils/timer.cc:24:1: error: ‘TimedEvent’ does not name a type
Could anyone try to help? Thanks! | c++ | nested-class | null | null | null | 11/09/2011 23:57:51 | too localized | How to use nested class in C++?
===
I'm implementing a Timer such that the time spent on different kinds of events are categorized and listed. The class declaration goes something as follows:
#include "timer_event.h"
#include <boost/timer.hpp>
#include <vector>
class Timer {
private:
class TimedEvent;
public:
static void Construct();
static double GetSeconds(TimerEvent e);
static TimedEvent* Time(TimerEvent e);
protected:
private:
class TimedEvent {
public:
TimedEvent(double seconds, TimerEvent event);
~TimedEvent();
protected:
private:
TimerEvent event_;
double seconds_;
};
static double second_totals_[kCOUNT_TIMER_EVENT];
static int num_calls_[kCOUNT_TIMER_EVENT];
static int max_event_name_len_;
static boost::timer watch_;
};
Then, in the source file, I'm planning to implement the "Time" function as something like:
TimedEvent* Time(TimerEvent e) {
TimedEvent* ret = new TimedEvent(watch_.elapsed(),e);
return ret;
}
However, the linker's error message is:
../utils/timer.cc:24:1: error: ‘TimedEvent’ does not name a type
Could anyone try to help? Thanks! | 3 |
1,151,970 | 07/20/2009 06:32:08 | 140,937 | 07/19/2009 11:27:41 | 1 | 0 | How jquery's working? | For example, how do they implement the dollar thing?
Thanks | jquery | null | null | null | null | 07/20/2009 06:41:42 | not a real question | How jquery's working?
===
For example, how do they implement the dollar thing?
Thanks | 1 |
1,468,199 | 09/23/2009 19:50:21 | 69,742 | 02/23/2009 04:34:53 | 483 | 22 | How to tell if a refresh came from a Timer (C#) | I have a ton of update panels and such on my webform(which are created dynamically at runtime)
I am wanting to put a locking timer or something similar in my form also. My problem is this. When someone is typing into a text box, and the timer happens they lose part of their text and the control loses focus.
The reason this happens is because on post back some things are done and the screen is rebuilt and the current control panel is updated. The reason this happens is because the only things that would cause the page to get refreshed prior to this timer were Change events on the controls(in which things need to be checked and updated). So what I need is to know if this Lock Timer is what caused the refresh so that I don't rebuild the screen or touch anything else like that. I can't wait until it gets to the Tick event because by the time it's there the screen has already been rebuilt and messed up for the user.
Also, I can't use viewstate or any other magic, as the screen is rebuilt at Page_Init. I checked if sender would say the timer, but it only gives the current page..
So my question is this:
How do you tell if the reason a refresh happened is because of an update timer at Page_Init? | c# | ajax | timer | webforms | asp.net | null | open | How to tell if a refresh came from a Timer (C#)
===
I have a ton of update panels and such on my webform(which are created dynamically at runtime)
I am wanting to put a locking timer or something similar in my form also. My problem is this. When someone is typing into a text box, and the timer happens they lose part of their text and the control loses focus.
The reason this happens is because on post back some things are done and the screen is rebuilt and the current control panel is updated. The reason this happens is because the only things that would cause the page to get refreshed prior to this timer were Change events on the controls(in which things need to be checked and updated). So what I need is to know if this Lock Timer is what caused the refresh so that I don't rebuild the screen or touch anything else like that. I can't wait until it gets to the Tick event because by the time it's there the screen has already been rebuilt and messed up for the user.
Also, I can't use viewstate or any other magic, as the screen is rebuilt at Page_Init. I checked if sender would say the timer, but it only gives the current page..
So my question is this:
How do you tell if the reason a refresh happened is because of an update timer at Page_Init? | 0 |
7,640,626 | 10/03/2011 21:03:48 | 625,154 | 02/20/2011 10:45:13 | 6 | 0 | Return from await() from other method | I’m newbie in Play! and I have one question about asynchronous programming in HTTP.
I have a piece of code like this:
public void someMethod() {
for (int i = 0; i < 100; i++) {
doSomething();
await(someTime);
}
}
This method is invoked by user by sending GET/POST request.
It does some computations (*doSomething()*) and after that it waits some time.
But: the user has to have ability to “return” from *await(someTime)* and the loop should continue next iteration without waiting all the *“someTime”* time.
The example code:
public void nextAwait() {
continueАForLoop();
}
The user invokes nextAwait() method by GET/POST.
If it is invoked, the loop will continue and *doSomething()* will be (has to be) invoked immediately!
So, is it possible in Play?
Thanks in advance for answers :)
| java | playframework | web-frameworks | null | null | null | open | Return from await() from other method
===
I’m newbie in Play! and I have one question about asynchronous programming in HTTP.
I have a piece of code like this:
public void someMethod() {
for (int i = 0; i < 100; i++) {
doSomething();
await(someTime);
}
}
This method is invoked by user by sending GET/POST request.
It does some computations (*doSomething()*) and after that it waits some time.
But: the user has to have ability to “return” from *await(someTime)* and the loop should continue next iteration without waiting all the *“someTime”* time.
The example code:
public void nextAwait() {
continueАForLoop();
}
The user invokes nextAwait() method by GET/POST.
If it is invoked, the loop will continue and *doSomething()* will be (has to be) invoked immediately!
So, is it possible in Play?
Thanks in advance for answers :)
| 0 |
5,509,114 | 04/01/2011 04:18:42 | 452,421 | 09/20/2010 07:19:34 | 37 | 7 | Currency API in Drupal | I build a webshop, but the client wants a second currency, HKD. In the node-record.tpl.php file I found the line responsible for displaying the price:
print uc_currency_format($node->sell_price);
I looked into the Drupal documentation, and found the function **currency_api_converter**. To use it, I thought it should be like this:
`print ' ('. currency_api_convert('RMB', 'EUR', $node->sell_price) .')</div>';`
But for some reason, all I get is a sort of Array error:
![enter image description here][1]
What am I doing wrong?
Regards in advance
[1]: http://i.stack.imgur.com/VqY2g.png | arrays | api | drupal | currency | null | null | open | Currency API in Drupal
===
I build a webshop, but the client wants a second currency, HKD. In the node-record.tpl.php file I found the line responsible for displaying the price:
print uc_currency_format($node->sell_price);
I looked into the Drupal documentation, and found the function **currency_api_converter**. To use it, I thought it should be like this:
`print ' ('. currency_api_convert('RMB', 'EUR', $node->sell_price) .')</div>';`
But for some reason, all I get is a sort of Array error:
![enter image description here][1]
What am I doing wrong?
Regards in advance
[1]: http://i.stack.imgur.com/VqY2g.png | 0 |
11,692,193 | 07/27/2012 16:48:50 | 1,558,250 | 07/27/2012 16:37:19 | 1 | 1 | Unity vs Ninject generic parameters | In ninject i can do this: kernel.Bind(typeof(IRepository<>)).To(typeof(Repository<,>));
but in unity container i get this error
The supplied type IRepository1 does not have the same number of generic arguments as the target type Repository2. Parameter name: sourceType
container.RegisterType(typeof(IRepository<>), typeof(Repository<,>)); | generics | dependency-injection | ninject | unity | null | 07/27/2012 22:28:24 | not a real question | Unity vs Ninject generic parameters
===
In ninject i can do this: kernel.Bind(typeof(IRepository<>)).To(typeof(Repository<,>));
but in unity container i get this error
The supplied type IRepository1 does not have the same number of generic arguments as the target type Repository2. Parameter name: sourceType
container.RegisterType(typeof(IRepository<>), typeof(Repository<,>)); | 1 |
7,346,634 | 09/08/2011 10:33:52 | 560,648 | 01/02/2011 22:20:15 | 32,908 | 1,441 | Dereferencing an invalid pointer, then taking the address of the result | Consider:
int* ptr = (int*)0xDEADBEEF;
cout << (void*)&*ptr;
How illegal is the `*`, given that it's used in conjunction with an immediate `&` and given that there are no overloaded `op&`/`op*` in play?
---
(This has particular ramifications for addressing a past-the-end array element `&myArray[n]`, an expression which is explicitly equivalent to `&*(myArray+n)`. [This Q&A][1] addresses the wider case but I don't feel that it ever really satisfied the above question.)
[1]: http://stackoverflow.com/questions/988158/take-the-address-of-a-one-past-the-end-array-element-via-subscript-legal-by-the | c++ | pointers | null | null | null | null | open | Dereferencing an invalid pointer, then taking the address of the result
===
Consider:
int* ptr = (int*)0xDEADBEEF;
cout << (void*)&*ptr;
How illegal is the `*`, given that it's used in conjunction with an immediate `&` and given that there are no overloaded `op&`/`op*` in play?
---
(This has particular ramifications for addressing a past-the-end array element `&myArray[n]`, an expression which is explicitly equivalent to `&*(myArray+n)`. [This Q&A][1] addresses the wider case but I don't feel that it ever really satisfied the above question.)
[1]: http://stackoverflow.com/questions/988158/take-the-address-of-a-one-past-the-end-array-element-via-subscript-legal-by-the | 0 |
8,238,971 | 11/23/2011 08:14:25 | 626,891 | 02/21/2011 15:59:51 | 11 | 0 | Final year project ideas | I'm in my final year and planning to my project on mobile technologies and GIS. Can anyone tell me about the new trends in this area that I could use for my project. Thanks in advance | android | mobile | research | null | null | 11/23/2011 09:26:49 | off topic | Final year project ideas
===
I'm in my final year and planning to my project on mobile technologies and GIS. Can anyone tell me about the new trends in this area that I could use for my project. Thanks in advance | 2 |
9,794,767 | 03/20/2012 20:55:02 | 1,281,926 | 03/20/2012 20:41:18 | 1 | 0 | How to Start with tablet development | I have been task with a tablet application project; all my experience is with Windows Apps (VFP and C# .Net WebForms). The app will initially be Android based but must have the architecture to port to iPad, Windows Tablet without too much re-write.
The application must work "offline" so I need to use local data and not be web based so as I understand it HTML5 is out.
I am leaning towards C# .Net and using Mono, but have struggled to find resources on keeping the UI size independent and how to create and access a database (SQLite?).
After some real newbie ideas and links please or maybe a simple sample app to show cross platform limitations and flexibility.
Gary. | c# | sqlite | mono | tablet | null | null | open | How to Start with tablet development
===
I have been task with a tablet application project; all my experience is with Windows Apps (VFP and C# .Net WebForms). The app will initially be Android based but must have the architecture to port to iPad, Windows Tablet without too much re-write.
The application must work "offline" so I need to use local data and not be web based so as I understand it HTML5 is out.
I am leaning towards C# .Net and using Mono, but have struggled to find resources on keeping the UI size independent and how to create and access a database (SQLite?).
After some real newbie ideas and links please or maybe a simple sample app to show cross platform limitations and flexibility.
Gary. | 0 |
6,856,963 | 07/28/2011 09:44:09 | 799,046 | 06/15/2011 06:31:15 | 387 | 28 | Can anybody explains how Operating System works ? | Can anybody explains how OS works ?
What are all the initial process it takes care of ?
(Can somebody give dependency diagram? i.e Related process) | operating-system | null | null | null | null | 07/28/2011 10:22:36 | not a real question | Can anybody explains how Operating System works ?
===
Can anybody explains how OS works ?
What are all the initial process it takes care of ?
(Can somebody give dependency diagram? i.e Related process) | 1 |
11,377,002 | 07/07/2012 17:05:44 | 1,509,023 | 07/07/2012 17:01:07 | 1 | 0 | how to disable logging of wurfl with java | I using wurfl lib to detect mobile browser with java, and I want disable log of wurfl or change log level. how can I do? thanks | logging | wurfl | null | null | null | 07/08/2012 13:16:00 | not a real question | how to disable logging of wurfl with java
===
I using wurfl lib to detect mobile browser with java, and I want disable log of wurfl or change log level. how can I do? thanks | 1 |
4,620,706 | 01/06/2011 22:35:50 | 560,587 | 01/02/2011 20:43:48 | 8 | 0 | How to block certain apps in android | I would like to make an application that would block an app due to user settings is there any way to accomplish this? | android | application | textblock | null | null | 02/27/2011 05:35:48 | not a real question | How to block certain apps in android
===
I would like to make an application that would block an app due to user settings is there any way to accomplish this? | 1 |
3,743,938 | 09/18/2010 23:30:59 | 339,228 | 05/12/2010 11:18:49 | 303 | 2 | what's your reason to learn clojure ? | I got a personal question for you guys out there: what's your reason for learning Clojure ?
(For me, it's the same thing as it was with Java over C, it promises a better programming experience) | clojure | null | null | null | null | 09/19/2010 00:17:27 | not constructive | what's your reason to learn clojure ?
===
I got a personal question for you guys out there: what's your reason for learning Clojure ?
(For me, it's the same thing as it was with Java over C, it promises a better programming experience) | 4 |
1,688,910 | 11/06/2009 16:57:15 | 122,134 | 06/12/2009 16:17:33 | 18 | 2 | Returning unread records using Linq To SQL | I'm not sure how to ask this question, so I'll start with an example of what I'm doing.
Here is my table structure...
**Documents** (Primary key = ID)<br />
ID, Title, LatestApprovedRevID
**Revisions** (Primary key = ID)<br />
ID, DocumentID, RevisionNum, Body
**Document_Reads** (Primary key = DocumentID, UserName)<br />
DocumentID, UserName, RevisionID
When a user opens a document, the latest approved revision is opened and a record is inserted into Document_Reads showing the document and revision the user had read. I would like to know how to query using Linq to return the documents that have NOT been read by UserName (the current authenticated user).
To get the list of unread documents, there are three cases where I would like to return the document:
- if a document has no records in Document_Reads.
- if a document has records in Document_Reads, but none of them are for UserName.
- if a document has records in Document_Reads and one for UserName exists, but the Document_Reads.RevisionID does not match Documents.LastApprovedRevID.
I have written a filter function, but I'm having problems writing the query for the 2nd requirement. It will return the document if any Document_Reads are found that do not match the UserName.
<Runtime.CompilerServices.Extension()> _
Public Function FilterLatestUnread(ByVal query As IQueryable(Of Document), ByVal userName As String) As IQueryable(Of Document)
'Documents with no document_reads
Dim q As IQueryable(Of Document) = From d In query _
Where d.Document_Reads.Count = 0 _
Select d
'documents with document_reads but none for userName
q = q.Union(From d In query _
From dr In d.Document_Reads _
Where Not (dr.UserName = userName) _
Select d)
'documents with document_reads for userName but RevisionID does not match LastApprovedRevID
q = q.Union(From d In query _
From dr In d.Document_Reads _
Where dr.UserName = userName And _
Not (dr.RevisionID = d.LastApprovedRevID) _
Select d)
'Return the combined query.
Return q
End Function
Then, I have my repository return all documents that have an approved revision and use the filter like...
return _repository.List().FilterLatestUnread("John Doe").ToList()
Thanks for any help and I apologize if this topic can be found on this site already...I wasn't sure what I needed to search for.
| linq-to-sql | query | read-unread | null | null | null | open | Returning unread records using Linq To SQL
===
I'm not sure how to ask this question, so I'll start with an example of what I'm doing.
Here is my table structure...
**Documents** (Primary key = ID)<br />
ID, Title, LatestApprovedRevID
**Revisions** (Primary key = ID)<br />
ID, DocumentID, RevisionNum, Body
**Document_Reads** (Primary key = DocumentID, UserName)<br />
DocumentID, UserName, RevisionID
When a user opens a document, the latest approved revision is opened and a record is inserted into Document_Reads showing the document and revision the user had read. I would like to know how to query using Linq to return the documents that have NOT been read by UserName (the current authenticated user).
To get the list of unread documents, there are three cases where I would like to return the document:
- if a document has no records in Document_Reads.
- if a document has records in Document_Reads, but none of them are for UserName.
- if a document has records in Document_Reads and one for UserName exists, but the Document_Reads.RevisionID does not match Documents.LastApprovedRevID.
I have written a filter function, but I'm having problems writing the query for the 2nd requirement. It will return the document if any Document_Reads are found that do not match the UserName.
<Runtime.CompilerServices.Extension()> _
Public Function FilterLatestUnread(ByVal query As IQueryable(Of Document), ByVal userName As String) As IQueryable(Of Document)
'Documents with no document_reads
Dim q As IQueryable(Of Document) = From d In query _
Where d.Document_Reads.Count = 0 _
Select d
'documents with document_reads but none for userName
q = q.Union(From d In query _
From dr In d.Document_Reads _
Where Not (dr.UserName = userName) _
Select d)
'documents with document_reads for userName but RevisionID does not match LastApprovedRevID
q = q.Union(From d In query _
From dr In d.Document_Reads _
Where dr.UserName = userName And _
Not (dr.RevisionID = d.LastApprovedRevID) _
Select d)
'Return the combined query.
Return q
End Function
Then, I have my repository return all documents that have an approved revision and use the filter like...
return _repository.List().FilterLatestUnread("John Doe").ToList()
Thanks for any help and I apologize if this topic can be found on this site already...I wasn't sure what I needed to search for.
| 0 |
10,592,077 | 05/14/2012 22:52:10 | 601,851 | 02/03/2011 16:12:37 | 18 | 1 | What is the best Git setup to use on Mac for php application development | My lead developer is always raving about Netbeans as a IDE.
We have just started to use Git properly for a project we are working on and I'm not too happy with Netbeans and Git. I find switching between branches quite slow. Especially, compared to using just the Terminal.
What do people recommend as the best setup when developing php applications and using git? | php | git | application | ide | null | 05/15/2012 00:23:20 | not constructive | What is the best Git setup to use on Mac for php application development
===
My lead developer is always raving about Netbeans as a IDE.
We have just started to use Git properly for a project we are working on and I'm not too happy with Netbeans and Git. I find switching between branches quite slow. Especially, compared to using just the Terminal.
What do people recommend as the best setup when developing php applications and using git? | 4 |
6,557,445 | 07/02/2011 13:55:01 | 214,010 | 11/18/2009 18:51:56 | 13,791 | 402 | Passing state between macros | What is the best way to create a set of macros that share information with each other at compile time in Clojure?
I'm looking for some way of having macros know what previous macros have done and act accordingly, e.g. how would you implement macros that can be used like the following:
(macro-block-with-data ["A" "B" "C"]
(process-next-data-item) ; macro expands using "A"
(process-next-data-item) ; macro expands using "B"
(process-next-data-item)) ; macro expands using "C"
| macros | clojure | null | null | null | null | open | Passing state between macros
===
What is the best way to create a set of macros that share information with each other at compile time in Clojure?
I'm looking for some way of having macros know what previous macros have done and act accordingly, e.g. how would you implement macros that can be used like the following:
(macro-block-with-data ["A" "B" "C"]
(process-next-data-item) ; macro expands using "A"
(process-next-data-item) ; macro expands using "B"
(process-next-data-item)) ; macro expands using "C"
| 0 |
3,489,236 | 08/15/2010 20:58:39 | 419,042 | 08/13/2010 00:02:36 | 1 | 2 | Facebooker params empty | I am trying to connect facebooker and authlogic using this http://github.com/kalasjocke/authlogic_facebook_connect
I was having problems so began to debug the facebooker gem code. I realized that no params are getting set using the facebook login that have anything to do with facebook. I can push the facebook login button, it brings up the facebook window as it should and I accept/sign into facebook. Then in facebooker/rails/controller.secure_with_facebook_params! I print out params, this is what shows:
authenticity_token<pulled out token number>actioncreatecontrollerperson_sessions
person_sessions is the name of my user_sessions. Not sure if this makes a difference though...
This is it. Clearly there should be other parameters here. I checked to make sure that my application numbers are all OK with facebooker.yml (although honestly I don't understand why that would matter as I'm not yet making a facebook app, just want to use connect).
Any ideas?? I would be SOOOO thankful if someone could help me out... any clues would be useful!
K | ruby-on-rails | authlogic | facebooker | null | null | null | open | Facebooker params empty
===
I am trying to connect facebooker and authlogic using this http://github.com/kalasjocke/authlogic_facebook_connect
I was having problems so began to debug the facebooker gem code. I realized that no params are getting set using the facebook login that have anything to do with facebook. I can push the facebook login button, it brings up the facebook window as it should and I accept/sign into facebook. Then in facebooker/rails/controller.secure_with_facebook_params! I print out params, this is what shows:
authenticity_token<pulled out token number>actioncreatecontrollerperson_sessions
person_sessions is the name of my user_sessions. Not sure if this makes a difference though...
This is it. Clearly there should be other parameters here. I checked to make sure that my application numbers are all OK with facebooker.yml (although honestly I don't understand why that would matter as I'm not yet making a facebook app, just want to use connect).
Any ideas?? I would be SOOOO thankful if someone could help me out... any clues would be useful!
K | 0 |
11,597,995 | 07/22/2012 05:40:47 | 1,493,020 | 06/30/2012 13:07:11 | 1 | 0 | How many apps can be published in google play? | I'm developing android applications. I haven't created a publisher account yet.
I want to publish my own created android apps in Google Play. There is fees of 25$. How many apps I can publish from my account? Is this one time fees (25$) or may I have to pay again in the future for this account? | android | null | null | null | null | 07/22/2012 14:43:31 | off topic | How many apps can be published in google play?
===
I'm developing android applications. I haven't created a publisher account yet.
I want to publish my own created android apps in Google Play. There is fees of 25$. How many apps I can publish from my account? Is this one time fees (25$) or may I have to pay again in the future for this account? | 2 |
5,648,105 | 04/13/2011 11:03:14 | 520,396 | 11/25/2010 16:14:09 | 743 | 27 | Email address for a subdomain? | Is it possible to have an email address for a specific subdomain? For example:
[email protected]
Does anyone have experience at setting this type of email address up on their server?
I am running Linux (CentOS 5.5, Apache2).
Thank you. | linux | email | subdomain | null | null | 04/13/2011 13:36:30 | off topic | Email address for a subdomain?
===
Is it possible to have an email address for a specific subdomain? For example:
[email protected]
Does anyone have experience at setting this type of email address up on their server?
I am running Linux (CentOS 5.5, Apache2).
Thank you. | 2 |
5,318,844 | 03/15/2011 22:27:45 | 340,554 | 05/13/2010 17:54:39 | 254 | 5 | C++ interview application question | I have an interview in 3 days and they told me the interview will consist in a C++ application.
Anyone has an idee an what C++ aspect would the application emphasizes the most ? (from a past experience) | interview-questions | null | null | null | null | 03/15/2011 22:31:39 | not a real question | C++ interview application question
===
I have an interview in 3 days and they told me the interview will consist in a C++ application.
Anyone has an idee an what C++ aspect would the application emphasizes the most ? (from a past experience) | 1 |
8,639,973 | 12/26/2011 23:46:16 | 1,114,084 | 12/23/2011 22:55:46 | 15 | 0 | How to plot with x-axis at the top of the figure? | I would like to ask how to produce a plot similar to that in the figure below? Basically, how to have x-axis at the top of the figure. Thanks
![enter image description here][1]
[1]: http://i.stack.imgur.com/aOehD.jpg
Image from: http://oceanographyclay1987.blogspot.com/2010/10/light-attenuation-in-ocean.html | python | plot | matplotlib | axis | null | null | open | How to plot with x-axis at the top of the figure?
===
I would like to ask how to produce a plot similar to that in the figure below? Basically, how to have x-axis at the top of the figure. Thanks
![enter image description here][1]
[1]: http://i.stack.imgur.com/aOehD.jpg
Image from: http://oceanographyclay1987.blogspot.com/2010/10/light-attenuation-in-ocean.html | 0 |
7,432,288 | 09/15/2011 14:13:05 | 795,586 | 06/13/2011 08:06:59 | 3 | 0 | How to using HttpDelete to delete data on Android flowing curl command? | my command in terminal.
curl --dump-header - -H "Content-Type: application/json" -X DELETE http://localhost:8000/api/get1/delivery/
HTTP/1.0 204 NO CONTENTAndroid
Date: Thu, 15 Sep 2011 14:01:55 GMT
Server: WSGIServer/0.1 Python/2.7.1+
Content-Length: 0
Content-Type: text/html; charset=utf-8
I write a method to try this but not success
public static boolean deleteDataOnWebService(String table_name)
{
HttpParams myParams = new BasicHttpParams();
HttpConnectionParams.setConnectionTimeout(myParams, 10000);
HttpConnectionParams.setSoTimeout(myParams, 10000);
HttpClient client = new DefaultHttpClient(myParams);
HttpContext localContext = new BasicHttpContext();
HttpDelete delete = new HttpDelete("http://10.0.2.2:8000/api/get1/"+ table_name +"/");
//delete.setHeader("Accept","application/json");
delete.setHeader("Content-Type", "application/json");
try {
HttpResponse respone = client.execute(delete,localContext);
return true;
} catch (ClientProtocolException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return false;
}
Can you help me? | android | httpwebrequest | null | null | null | 09/17/2011 11:47:13 | not a real question | How to using HttpDelete to delete data on Android flowing curl command?
===
my command in terminal.
curl --dump-header - -H "Content-Type: application/json" -X DELETE http://localhost:8000/api/get1/delivery/
HTTP/1.0 204 NO CONTENTAndroid
Date: Thu, 15 Sep 2011 14:01:55 GMT
Server: WSGIServer/0.1 Python/2.7.1+
Content-Length: 0
Content-Type: text/html; charset=utf-8
I write a method to try this but not success
public static boolean deleteDataOnWebService(String table_name)
{
HttpParams myParams = new BasicHttpParams();
HttpConnectionParams.setConnectionTimeout(myParams, 10000);
HttpConnectionParams.setSoTimeout(myParams, 10000);
HttpClient client = new DefaultHttpClient(myParams);
HttpContext localContext = new BasicHttpContext();
HttpDelete delete = new HttpDelete("http://10.0.2.2:8000/api/get1/"+ table_name +"/");
//delete.setHeader("Accept","application/json");
delete.setHeader("Content-Type", "application/json");
try {
HttpResponse respone = client.execute(delete,localContext);
return true;
} catch (ClientProtocolException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return false;
}
Can you help me? | 1 |
6,739,262 | 07/18/2011 20:49:11 | 807,416 | 06/20/2011 21:21:09 | 11 | 0 | ipa files unzip to cpgz ...OS X Lion specific problem | I used to have no problem unzipping ipa files but now since I upgraded to OS X Lion, they just unzip to a cpgz and I end up going in a circle.
Any ideas what's causing this problem or how to solve it? | unzip | ipa | null | null | null | 07/19/2011 18:38:10 | off topic | ipa files unzip to cpgz ...OS X Lion specific problem
===
I used to have no problem unzipping ipa files but now since I upgraded to OS X Lion, they just unzip to a cpgz and I end up going in a circle.
Any ideas what's causing this problem or how to solve it? | 2 |
2,234,760 | 02/10/2010 05:59:59 | 154,219 | 08/11/2009 09:16:49 | 242 | 22 | is visual studio 2010 ready for production | Regarding to this [post][1], can **visual studio 2010 RC** ready for production
I know there is already a [duplicate][2] question here, but that was asked when beta were available.
[1]: http://blogs.msdn.com/jeffbe/archive/2010/02/08/going-live-with-the-visual-studio-2010-release-candidate.aspx
[2]: http://stackoverflow.com/questions/1486021/is-visual-studio-2010-ready-for-production-closed | vs2010 | ide | null | null | null | 05/23/2012 00:30:56 | too localized | is visual studio 2010 ready for production
===
Regarding to this [post][1], can **visual studio 2010 RC** ready for production
I know there is already a [duplicate][2] question here, but that was asked when beta were available.
[1]: http://blogs.msdn.com/jeffbe/archive/2010/02/08/going-live-with-the-visual-studio-2010-release-candidate.aspx
[2]: http://stackoverflow.com/questions/1486021/is-visual-studio-2010-ready-for-production-closed | 3 |
5,368,174 | 03/20/2011 11:26:58 | 607,178 | 02/07/2011 21:39:26 | 26 | 3 | How to implement Cover Flow effect in ios? | I need your help. I need to implement cover flow effect of 5-6 images. Can you advise me some framework or library or other way to implement? | objective-c | ios | frameworks | xcode4 | coverflow | 06/06/2012 13:59:45 | not constructive | How to implement Cover Flow effect in ios?
===
I need your help. I need to implement cover flow effect of 5-6 images. Can you advise me some framework or library or other way to implement? | 4 |
4,708,077 | 01/16/2011 21:11:18 | 220,804 | 11/29/2009 11:04:51 | 250 | 2 | Comprehensive arguments for high-technologies vs cheap development | This question is not really specific, but I am sure many of you faced such situations.
Consider a customer who knows nothing about IT is asking you to develop a large application. You know that for such an app you should use high-level bundle like Java+Spring+Hibernate or other solution with IOC, transactions, I18n, concurrency, security, clustering etc. You also tell him this task will take lots of man-hours.
Then customer's friends recommend him a web-"developer" who says: I will write all this stuff on PHP/MySQL in two months myself.
The question is: what are the comprehensive arguments for your position? How do you explain that it is impossible to create such a project in two months, that it is not "just another site", that PHP is not an appropriate technology in such a case. How do you explain this to a customer who has no notion of all this "programmers crap"?
Thank you! | customer | null | null | null | null | 04/30/2012 18:57:45 | off topic | Comprehensive arguments for high-technologies vs cheap development
===
This question is not really specific, but I am sure many of you faced such situations.
Consider a customer who knows nothing about IT is asking you to develop a large application. You know that for such an app you should use high-level bundle like Java+Spring+Hibernate or other solution with IOC, transactions, I18n, concurrency, security, clustering etc. You also tell him this task will take lots of man-hours.
Then customer's friends recommend him a web-"developer" who says: I will write all this stuff on PHP/MySQL in two months myself.
The question is: what are the comprehensive arguments for your position? How do you explain that it is impossible to create such a project in two months, that it is not "just another site", that PHP is not an appropriate technology in such a case. How do you explain this to a customer who has no notion of all this "programmers crap"?
Thank you! | 2 |
10,629,105 | 05/17/2012 02:23:41 | 1,395,147 | 05/15/2012 03:54:42 | 16 | 0 | How to move my apps from Eclipse IDE to my Android phone | I have developed a simple Android apps prototype and I would like to move it to my phone, but when I set my phone USB debugging on and my laptop starts to install the driver, end up it asks me to insert CD in order to install the driver, but I do not have any CD when I bought my HTC phone, so how I am gonna to solve it? Thanks | android | usb | null | null | null | 05/29/2012 04:32:08 | off topic | How to move my apps from Eclipse IDE to my Android phone
===
I have developed a simple Android apps prototype and I would like to move it to my phone, but when I set my phone USB debugging on and my laptop starts to install the driver, end up it asks me to insert CD in order to install the driver, but I do not have any CD when I bought my HTC phone, so how I am gonna to solve it? Thanks | 2 |
5,484,784 | 03/30/2011 09:56:52 | 549,958 | 05/07/2010 10:38:21 | 19 | 3 | PHP: imagecreatefromstring | I have a file upload class which returns an image resize object if the file upload is believed to be an image. The construct of the image resize class starts with this:
$this->resource = imagecreatefromstring($this->getData());
if (!is_resource($this->resource)) {
return $this->error(IMAGE_ERR_SOURCE_CREATION_ERROR);
}
<code>$this->getData()</code> returns the string returned from file_get_contents from <code>tmp_name</code> from <code>$_FILES[..]</code> array.
The promlem is as follows. It works perfectly fine on my development server <code>5.3.0</code> but <code>imagecreatefromstring()</code> fails on the production server, <code>5.3.5</code>.
Why? I cannot get my head around it, I have compared strings of images from development and product using base64 and they are identical. What do I need to look at thats changed from <code>.0</code> to <code>.5</code>? | php | php5 | gd2 | null | null | null | open | PHP: imagecreatefromstring
===
I have a file upload class which returns an image resize object if the file upload is believed to be an image. The construct of the image resize class starts with this:
$this->resource = imagecreatefromstring($this->getData());
if (!is_resource($this->resource)) {
return $this->error(IMAGE_ERR_SOURCE_CREATION_ERROR);
}
<code>$this->getData()</code> returns the string returned from file_get_contents from <code>tmp_name</code> from <code>$_FILES[..]</code> array.
The promlem is as follows. It works perfectly fine on my development server <code>5.3.0</code> but <code>imagecreatefromstring()</code> fails on the production server, <code>5.3.5</code>.
Why? I cannot get my head around it, I have compared strings of images from development and product using base64 and they are identical. What do I need to look at thats changed from <code>.0</code> to <code>.5</code>? | 0 |
4,032,387 | 10/27/2010 10:48:39 | 454,925 | 09/22/2010 10:35:08 | 225 | 16 | How to create skill tree? | I would like to create a skill tree for my own and a community usage. I have data in format like below:
skill_1 [description etc.] requires: none
skill_2 [...] requires: skill_1
skill_3 [...] requires: skill_1, skill_2
skill_4 [...] requires: skill_1 OR skill_2
(data format from Civilization 5 units promotion)
now i want to change those informations into graphic, tree-like structure. Something like: [skill tree image][1]
The main problem I have is that connections between skills tangle and I would recive mess instead of clear, helpful picture, when I add those skills just one by one. Is there any (sort?) algorithm to prevent (or minimalise) crossing connections? Or I have to possition them mannually in a graphic program?
[1]: http://nick.gladius.org/projects/planner/index.html | algorithm | null | null | null | null | null | open | How to create skill tree?
===
I would like to create a skill tree for my own and a community usage. I have data in format like below:
skill_1 [description etc.] requires: none
skill_2 [...] requires: skill_1
skill_3 [...] requires: skill_1, skill_2
skill_4 [...] requires: skill_1 OR skill_2
(data format from Civilization 5 units promotion)
now i want to change those informations into graphic, tree-like structure. Something like: [skill tree image][1]
The main problem I have is that connections between skills tangle and I would recive mess instead of clear, helpful picture, when I add those skills just one by one. Is there any (sort?) algorithm to prevent (or minimalise) crossing connections? Or I have to possition them mannually in a graphic program?
[1]: http://nick.gladius.org/projects/planner/index.html | 0 |
3,066,540 | 06/18/2010 00:38:20 | 369,893 | 06/18/2010 00:38:20 | 1 | 0 | Is Java worth learning in my late fourties? | First I want to say is that I am 37 years old and not from programer background (actualy from biology). And my question is should I start learning java? I have coded in php and javascript for a year and a half. Every answer would be appreciated
Thanks in advance
Bobi. | java | null | null | null | null | 06/18/2010 00:48:44 | not constructive | Is Java worth learning in my late fourties?
===
First I want to say is that I am 37 years old and not from programer background (actualy from biology). And my question is should I start learning java? I have coded in php and javascript for a year and a half. Every answer would be appreciated
Thanks in advance
Bobi. | 4 |
1,070,186 | 07/01/2009 16:45:32 | 121,660 | 06/11/2009 22:31:49 | 21 | 4 | AssertWasCalled in rhino mocks | I have an object under test that makes a fairly complicated call to a data access object. IT looks something like
`object.DoSomething(somestring,someObject,someOtherObject,someOtherOtherObject)`
In my test structure I have a mocked version of object and I want to test that Dosomething got called with somestring == "value1" and someObject.porpertyA == "value2".
I can't use the simple AssertWasCalled() overload because I don;t know about (or care about) someOtherObject. I notice another overload that takes an an action for setup constraints, but I've never seen it used. Any advice would be great. | unit-testing | rhino-mocks | c# | null | null | null | open | AssertWasCalled in rhino mocks
===
I have an object under test that makes a fairly complicated call to a data access object. IT looks something like
`object.DoSomething(somestring,someObject,someOtherObject,someOtherOtherObject)`
In my test structure I have a mocked version of object and I want to test that Dosomething got called with somestring == "value1" and someObject.porpertyA == "value2".
I can't use the simple AssertWasCalled() overload because I don;t know about (or care about) someOtherObject. I notice another overload that takes an an action for setup constraints, but I've never seen it used. Any advice would be great. | 0 |
7,865,590 | 10/23/2011 10:29:07 | 975,129 | 10/02/2011 04:53:50 | 491 | 7 | What are some open source C++ projects with excellent coding style? | I'm looking for a **practical C++ coding style** for medium to large projects which **maximizes readability**. I am indifferent to clever design patterns or constructs as long as the code is obvious when you browse it.
Choices will obviously be based on personal preferences, but that's ok, as long as **you** think the style makes for clear readability.
C++ style guides are also welcome, but I prefer to browse real code so I can easily determine if their guidelines do, in fact, effectively increase readability. | c++ | coding-style | open-source | null | null | 10/23/2011 10:47:34 | not constructive | What are some open source C++ projects with excellent coding style?
===
I'm looking for a **practical C++ coding style** for medium to large projects which **maximizes readability**. I am indifferent to clever design patterns or constructs as long as the code is obvious when you browse it.
Choices will obviously be based on personal preferences, but that's ok, as long as **you** think the style makes for clear readability.
C++ style guides are also welcome, but I prefer to browse real code so I can easily determine if their guidelines do, in fact, effectively increase readability. | 4 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.