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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7,952,727 | 10/31/2011 10:55:19 | 455,961 | 09/23/2010 08:48:47 | 57 | 0 | how to display the value instead of parentage in a pie chat made with jqury Highcharts | for a project of mine im using a pie char that made with jqury Highcharts. what like to do is to display the value i inserted instead of the the parentage. example: chart shows firefox - 43.269...% instead i like to show the value firefox -45 clicks. can anyone help me with this. thanks in advance.
Chart code
<!-- 1. Add these JavaScript inclusions in the head of your page -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script type="text/javascript" src="../js/highcharts.js"></script>
<!-- 1a) Optional: add a theme file -->
<!--
<script type="text/javascript" src="../js/themes/gray.js"></script>
-->
<!-- 1b) Optional: the exporting module -->
<script type="text/javascript" src="../js/modules/exporting.js"></script>
<!-- 2. Add the JavaScript to initialize the chart on document ready -->
<script type="text/javascript">
var chart;
$(document).ready(function() {
chart = new Highcharts.Chart({
chart: {
renderTo: 'browser_cart',
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false
},
title: {
text: 'Browser market shares at a specific website, 2010'
},
tooltip: {
formatter: function() {
return '<b>'+ this.point.name +'</b>: '+ this.percentage +' %';
}
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
color: '#000000',
connectorColor: '#000000',
formatter: function() {
return '<b>'+ this.point.name +'</b>: '+ this.percentage +' clicks';
}
}
}
},
series: [{
type: 'pie',
name: 'Browser share',
data: [
['Firefox', 45],
['IE', 26],
['Chrome', 12],
['Safari', 8],
['Opera', 6],
['Others', 7]
]
}]
});
});
</script>
</head>
<body>
<!-- 3. Add the container -->
<div id="browser_cart" style="width: 800px; height: 400px; margin: 0 auto"></div>
</body> | javascript | jquery | null | null | null | null | open | how to display the value instead of parentage in a pie chat made with jqury Highcharts
===
for a project of mine im using a pie char that made with jqury Highcharts. what like to do is to display the value i inserted instead of the the parentage. example: chart shows firefox - 43.269...% instead i like to show the value firefox -45 clicks. can anyone help me with this. thanks in advance.
Chart code
<!-- 1. Add these JavaScript inclusions in the head of your page -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script type="text/javascript" src="../js/highcharts.js"></script>
<!-- 1a) Optional: add a theme file -->
<!--
<script type="text/javascript" src="../js/themes/gray.js"></script>
-->
<!-- 1b) Optional: the exporting module -->
<script type="text/javascript" src="../js/modules/exporting.js"></script>
<!-- 2. Add the JavaScript to initialize the chart on document ready -->
<script type="text/javascript">
var chart;
$(document).ready(function() {
chart = new Highcharts.Chart({
chart: {
renderTo: 'browser_cart',
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false
},
title: {
text: 'Browser market shares at a specific website, 2010'
},
tooltip: {
formatter: function() {
return '<b>'+ this.point.name +'</b>: '+ this.percentage +' %';
}
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
color: '#000000',
connectorColor: '#000000',
formatter: function() {
return '<b>'+ this.point.name +'</b>: '+ this.percentage +' clicks';
}
}
}
},
series: [{
type: 'pie',
name: 'Browser share',
data: [
['Firefox', 45],
['IE', 26],
['Chrome', 12],
['Safari', 8],
['Opera', 6],
['Others', 7]
]
}]
});
});
</script>
</head>
<body>
<!-- 3. Add the container -->
<div id="browser_cart" style="width: 800px; height: 400px; margin: 0 auto"></div>
</body> | 0 |
11,366,591 | 07/06/2012 17:01:39 | 1,507,378 | 07/06/2012 16:52:26 | 1 | 0 | how to print a set of strings on the same line in C? | I made a C program that when I write a number on the keyboard, I press the second largest number in a string of characters that I've done, only that if for example I'm writing 123 print 1 big, 2 big head and then 3 in the head as big as I print the three strings in large numbers on the same line? | c | arrays | string | null | null | 07/06/2012 19:32:13 | not a real question | how to print a set of strings on the same line in C?
===
I made a C program that when I write a number on the keyboard, I press the second largest number in a string of characters that I've done, only that if for example I'm writing 123 print 1 big, 2 big head and then 3 in the head as big as I print the three strings in large numbers on the same line? | 1 |
1,744,482 | 11/16/2009 19:57:01 | 449,902 | 10/29/2008 17:39:16 | 397 | 42 | Drupal Custom Form Arrangement/Placement | I am just starting out with Drupal but I am pretty clueless how to custom 'place' all of the form elements. I usually have a lot of stuff, like this other dude's thing, so placement and aesthetics are a MUST:
![alt text][1]
Drupal's default way of rendering forums like a questionnaire (one long horizontal column with lots of spaces) are unacceptable for my purposes. I have been looking around the Drupal forums and several other people all have the same problem. The main approach seems to be to return a long concatenated string of html and php controls - for my forms, that would be insane! What is the easiest and cleanest solution to this?
Is there a way, like in ASP.NET with the page.aspx/page.aspx.cs, all the markup and controls are in one file and the code in another? Or maybe I can put all of the form markup in one file with just placeholders, and in the code, it tells Drupal to render each form elment in it's placeholder?
[1]: http://img20.imageshack.us/img20/3103/55744697.jpg | drupal | forms | styling | null | null | null | open | Drupal Custom Form Arrangement/Placement
===
I am just starting out with Drupal but I am pretty clueless how to custom 'place' all of the form elements. I usually have a lot of stuff, like this other dude's thing, so placement and aesthetics are a MUST:
![alt text][1]
Drupal's default way of rendering forums like a questionnaire (one long horizontal column with lots of spaces) are unacceptable for my purposes. I have been looking around the Drupal forums and several other people all have the same problem. The main approach seems to be to return a long concatenated string of html and php controls - for my forms, that would be insane! What is the easiest and cleanest solution to this?
Is there a way, like in ASP.NET with the page.aspx/page.aspx.cs, all the markup and controls are in one file and the code in another? Or maybe I can put all of the form markup in one file with just placeholders, and in the code, it tells Drupal to render each form elment in it's placeholder?
[1]: http://img20.imageshack.us/img20/3103/55744697.jpg | 0 |
6,240,749 | 06/05/2011 03:01:03 | 145,567 | 07/27/2009 07:10:18 | 1,550 | 53 | Generating a 2D grid in Haskell | Learning haskell and want to generate a 2D grid similar to how you might in C:
int data[10][10]
what's an acceptable and elegant approach? Zip? Foldl?
| haskell | null | null | null | null | null | open | Generating a 2D grid in Haskell
===
Learning haskell and want to generate a 2D grid similar to how you might in C:
int data[10][10]
what's an acceptable and elegant approach? Zip? Foldl?
| 0 |
8,748,828 | 01/05/2012 19:53:55 | 1,013,112 | 10/25/2011 16:24:52 | 312 | 22 | Using less memory filling an PDF Form, with flattening, using iText | I have a web application that uses a couple of PDF forms to create documents of up to 500 pages; each form is one page and has 40-50 fields on it. The completed document is display-and-print only, there is no need to retain the fill-in aspect of the PDF form as the document is being created.
I have working code using iText 1.4.5; it creates these documents in less than 30 seconds (websphere, MVS) which is fine for my purposes.
The app does use significant amounts of memory, and recently contributed to a server crash. I am interested in whether I can modify the existing code to keep most of its attributes and use significantly less memory. It seems to me it *should* be possible, given that the amount of memory used suggests the entire document is in memory until completed, and my logic has no need for that -- once a page is filled, my program is done with it, it could be written to disk and any memory associated just with that page freed.
I have found reference to the method com.lowagie.text.pdf.PdfWriter.freeReader(), but am not sure how to use it in my environment. My question is whether it would cause my program to use less memory (at one time) and where to put the call.
I create iText Document , PdfWriter, and PdfReader objects as follows:
public PdfFormFiller(String givenInputSpecification,
Document givenDocument,
PdfWriter givenWriter)
{
// instance fields stored for PDF or tracking purposes.
inputSpecification = givenInputSpecification;
document = givenDocument;
writer = givenWriter;
contentByte = writer.getDirectContent();
// 'DirectContentUnder' is a contentByte object that allows
// our app to write out document content that appears
// underneath things written to the DirectContentOver; i.e.,
// this is a layer underneath some other things.
underContent = writer.getDirectContentUnder();
try
{
PdfReader reader = new PdfReader(inputSpecification);
template = writer.getImportedPage(reader, 1); // this line limits us to 1-page forms;
AcroFields aFields = reader.getAcroFields(); // the fields on the form.
<<more stuff in this constructor, deleted from here>>
I fill in values in the form using this:
/**
* * 'Fill' this given form with the given data values, i.e., write the given data
* values onto the positions in the forms corresponding to their field names.
* @param fieldValueMap a map with each key the name
* of the data field, and each value the string to be put on
* the form for that field.
*/
public void fillForm(Map fieldValueMap) throws DocumentException
{
Iterator keys = fieldValueMap.keySet().iterator();
while (keys.hasNext())
{
String fieldName = (String)keys.next();
FormField formField = (FormField)fields.get(fieldName);
String value = null;
if (fieldName != null)
{
value = (String)fieldValueMap.get(fieldName);
}
if (null != value && null != formField)
{
fillField(formField, value);
}
}
// add the template of the form; the fact that it is added
// to "underContent" causes iText to put it in a list if it's
// not already there, so it only gets added once per doc.
underContent.addTemplate(getTemplate(), 0, 0);
// start a new page - throws DocumentException
document.newPage();
}
And I write a value to a field using this:
/**
* fills the given field with the given value
* @param formField field and attributes
* @param value String value
*/
private void fillField(FormField formField, String value) throws DocumentException
{
if (formField.fieldType == AcroFields.FIELD_TYPE_CHECKBOX)
{
if (value.substring(0,1).equalsIgnoreCase("Y")) { value = "X"; }
else { value = " "; }
}
ColumnText columnText = new ColumnText(contentByte);
<<excised code determining fontToUse>>
setSimpleColumn(columnText, value, fontToUse, formField.box,
leading, Element.ALIGN_LEFT, false);
}
'setSimpleColumn()' is a utlility routine handling the fitting of text into a rectangle on the form.
private int setSimpleColumn(ColumnText columnText, String value, Font fontToUse,
Rectangle box, int leading, int alignment, boolean simulate)
throws DocumentException
{
columnText.setSimpleColumn(new Phrase(value, fontToUse),
box.left(), box.bottom(),
box.right(), box.top(),
leading, alignment
);
int result = columnText.go(simulate);
return result;
}
So again, the main 2 questions are: would use of PdfWriter.freeReader() help free up memory that's otherwise held until the document is complete, and (2) where would I put a call to it?
If someone wants to tell me how to do multi-page forms, I'm interested in that as well...
| java | itext | null | null | null | null | open | Using less memory filling an PDF Form, with flattening, using iText
===
I have a web application that uses a couple of PDF forms to create documents of up to 500 pages; each form is one page and has 40-50 fields on it. The completed document is display-and-print only, there is no need to retain the fill-in aspect of the PDF form as the document is being created.
I have working code using iText 1.4.5; it creates these documents in less than 30 seconds (websphere, MVS) which is fine for my purposes.
The app does use significant amounts of memory, and recently contributed to a server crash. I am interested in whether I can modify the existing code to keep most of its attributes and use significantly less memory. It seems to me it *should* be possible, given that the amount of memory used suggests the entire document is in memory until completed, and my logic has no need for that -- once a page is filled, my program is done with it, it could be written to disk and any memory associated just with that page freed.
I have found reference to the method com.lowagie.text.pdf.PdfWriter.freeReader(), but am not sure how to use it in my environment. My question is whether it would cause my program to use less memory (at one time) and where to put the call.
I create iText Document , PdfWriter, and PdfReader objects as follows:
public PdfFormFiller(String givenInputSpecification,
Document givenDocument,
PdfWriter givenWriter)
{
// instance fields stored for PDF or tracking purposes.
inputSpecification = givenInputSpecification;
document = givenDocument;
writer = givenWriter;
contentByte = writer.getDirectContent();
// 'DirectContentUnder' is a contentByte object that allows
// our app to write out document content that appears
// underneath things written to the DirectContentOver; i.e.,
// this is a layer underneath some other things.
underContent = writer.getDirectContentUnder();
try
{
PdfReader reader = new PdfReader(inputSpecification);
template = writer.getImportedPage(reader, 1); // this line limits us to 1-page forms;
AcroFields aFields = reader.getAcroFields(); // the fields on the form.
<<more stuff in this constructor, deleted from here>>
I fill in values in the form using this:
/**
* * 'Fill' this given form with the given data values, i.e., write the given data
* values onto the positions in the forms corresponding to their field names.
* @param fieldValueMap a map with each key the name
* of the data field, and each value the string to be put on
* the form for that field.
*/
public void fillForm(Map fieldValueMap) throws DocumentException
{
Iterator keys = fieldValueMap.keySet().iterator();
while (keys.hasNext())
{
String fieldName = (String)keys.next();
FormField formField = (FormField)fields.get(fieldName);
String value = null;
if (fieldName != null)
{
value = (String)fieldValueMap.get(fieldName);
}
if (null != value && null != formField)
{
fillField(formField, value);
}
}
// add the template of the form; the fact that it is added
// to "underContent" causes iText to put it in a list if it's
// not already there, so it only gets added once per doc.
underContent.addTemplate(getTemplate(), 0, 0);
// start a new page - throws DocumentException
document.newPage();
}
And I write a value to a field using this:
/**
* fills the given field with the given value
* @param formField field and attributes
* @param value String value
*/
private void fillField(FormField formField, String value) throws DocumentException
{
if (formField.fieldType == AcroFields.FIELD_TYPE_CHECKBOX)
{
if (value.substring(0,1).equalsIgnoreCase("Y")) { value = "X"; }
else { value = " "; }
}
ColumnText columnText = new ColumnText(contentByte);
<<excised code determining fontToUse>>
setSimpleColumn(columnText, value, fontToUse, formField.box,
leading, Element.ALIGN_LEFT, false);
}
'setSimpleColumn()' is a utlility routine handling the fitting of text into a rectangle on the form.
private int setSimpleColumn(ColumnText columnText, String value, Font fontToUse,
Rectangle box, int leading, int alignment, boolean simulate)
throws DocumentException
{
columnText.setSimpleColumn(new Phrase(value, fontToUse),
box.left(), box.bottom(),
box.right(), box.top(),
leading, alignment
);
int result = columnText.go(simulate);
return result;
}
So again, the main 2 questions are: would use of PdfWriter.freeReader() help free up memory that's otherwise held until the document is complete, and (2) where would I put a call to it?
If someone wants to tell me how to do multi-page forms, I'm interested in that as well...
| 0 |
11,374,235 | 07/07/2012 10:32:44 | 1,461,413 | 06/17/2012 04:33:36 | 1 | 1 | Java static table maintanance | I want to keep a static table that will be updated over time.
This will be a sizable table so I need to initialize it with another program.
Question: Is it possible to keep the table in existence without keeping the source code that initialized it, once the table is initialized? If yes, how do I go about it; and I assume that I may modify the source code responsible for updating the table via the same approach?
Thanks.
| java | table | static | null | null | 07/07/2012 12:51:45 | not a real question | Java static table maintanance
===
I want to keep a static table that will be updated over time.
This will be a sizable table so I need to initialize it with another program.
Question: Is it possible to keep the table in existence without keeping the source code that initialized it, once the table is initialized? If yes, how do I go about it; and I assume that I may modify the source code responsible for updating the table via the same approach?
Thanks.
| 1 |
6,293,914 | 06/09/2011 13:56:03 | 496,223 | 11/03/2010 16:56:47 | 4,595 | 272 | Are there any good PHP quiz for testing php knowledge? | Something like this quiz for javascript. http://perfectionkills.com/javascript-quiz/
I have searched it but I came across only on newb quiz.
| php | null | null | null | null | 06/09/2011 14:06:59 | off topic | Are there any good PHP quiz for testing php knowledge?
===
Something like this quiz for javascript. http://perfectionkills.com/javascript-quiz/
I have searched it but I came across only on newb quiz.
| 2 |
6,442,232 | 06/22/2011 15:14:15 | 422,252 | 08/16/2010 22:36:54 | 638 | 24 | Php function names pared with classes | Is it considered bad practice to pair function names with classes?
For example in kohana I could do the following.
function Model($a,$b){
return new Model($a,$b);
}
Then I could drop all references to new, and also I wouldn't have to make a $temp variable.
$temp = Model('book');
$book=$temp->where('title','=','name')->find();
Or
$book = Model::factory('book')->where('title','=','name');
To
$book = Model('book')->where('title','=','name');
I understand global pollution is bad and it is slightly obscure to read at first, but it has it's benefits.
I mean it would be even more confusing if someone else defined a function that had no relation to the class, so why not use the function?
For example:
$book = new Model('book');
// looks so close to the above, it's scary
$book = Model('book');
Other Pros or Cons? | php | function | null | null | null | 06/24/2011 01:26:53 | not constructive | Php function names pared with classes
===
Is it considered bad practice to pair function names with classes?
For example in kohana I could do the following.
function Model($a,$b){
return new Model($a,$b);
}
Then I could drop all references to new, and also I wouldn't have to make a $temp variable.
$temp = Model('book');
$book=$temp->where('title','=','name')->find();
Or
$book = Model::factory('book')->where('title','=','name');
To
$book = Model('book')->where('title','=','name');
I understand global pollution is bad and it is slightly obscure to read at first, but it has it's benefits.
I mean it would be even more confusing if someone else defined a function that had no relation to the class, so why not use the function?
For example:
$book = new Model('book');
// looks so close to the above, it's scary
$book = Model('book');
Other Pros or Cons? | 4 |
3,282,368 | 07/19/2010 15:17:44 | 395,943 | 07/19/2010 15:13:16 | 1 | 0 | How to Generate HTML from within ASP.NET MVC? | is it possible to generate HTML code from within ASP.NET MVC, please?
Have a nice day,
Alex | .net | html | asp.net-mvc | dynamically-generated | null | 07/20/2010 04:37:30 | not a real question | How to Generate HTML from within ASP.NET MVC?
===
is it possible to generate HTML code from within ASP.NET MVC, please?
Have a nice day,
Alex | 1 |
6,905,241 | 08/01/2011 22:27:14 | 198,584 | 10/29/2009 01:37:52 | 45 | 1 | Anyone recognize these "hacks?" | My company's hosting account was hacked a while back, and ads for everything from WoW Gold to Nikes were placed on our sites. We've since changed hosts, and downloaded each site and gone through line by line to remove the hacks and ads. We're also updating the sites (read: rebuilding from scratch) to use a new, more secure CMS.
We have two servers - Server A for the updated "secure" sites and Server B for sites that we're not sure of (we inherited a lot of crappy code).
Anyhow, this is the third day on our new servers, and several sites on Server B now have new files in them, files we definitely didn't make.
Filenames Seen:
- Global.asa (Deleted before I could check what was in it, but we definitely didn't create it)
- roots.txt (Contained only the URL for the site)
- roots.aspx (Contained only the site URL)
- tur.aspx (and several other variations, including tur.aspx.jpg. Deleted before I could review the file)
- conn.aspx (which had a nice little bit of code to run any string passed in a request string as code)
We're trying to determine how these files are getting there. Has anyone seen any of these file names before when dealing with a similar hack? | asp.net | iis7 | asp | windows-server-2008 | hacks | 08/02/2011 00:08:39 | off topic | Anyone recognize these "hacks?"
===
My company's hosting account was hacked a while back, and ads for everything from WoW Gold to Nikes were placed on our sites. We've since changed hosts, and downloaded each site and gone through line by line to remove the hacks and ads. We're also updating the sites (read: rebuilding from scratch) to use a new, more secure CMS.
We have two servers - Server A for the updated "secure" sites and Server B for sites that we're not sure of (we inherited a lot of crappy code).
Anyhow, this is the third day on our new servers, and several sites on Server B now have new files in them, files we definitely didn't make.
Filenames Seen:
- Global.asa (Deleted before I could check what was in it, but we definitely didn't create it)
- roots.txt (Contained only the URL for the site)
- roots.aspx (Contained only the site URL)
- tur.aspx (and several other variations, including tur.aspx.jpg. Deleted before I could review the file)
- conn.aspx (which had a nice little bit of code to run any string passed in a request string as code)
We're trying to determine how these files are getting there. Has anyone seen any of these file names before when dealing with a similar hack? | 2 |
4,896,496 | 02/04/2011 09:38:31 | 51,336 | 01/04/2009 07:33:42 | 322 | 8 | Which relationship should I choose: association or aggregation? | I have a Proffesor table in a database. I would like to create an UML diagram for the code-behind part.
The class structure would be:
- a Proffesor class that maps the information from the database table (id, first name, etc)
- a ProffesorDAL class which connects to the DB and queries it in order to add,remove,update Proffesor instances
- 3 forms which add/delete/update proffesors, by accesing the ProffesorDAL class
I thought that the forms-ProffesorDAL relationship is a composition relationship. Is this correct?
How about the ProffesorDAL-Proffesor relationship, could it be aggregation or is it just association? What's the best UML relationship for the forms-Proffesor relationship?
Thanks! | uml | associations | data-access-layer | aggregation | class-diagram | null | open | Which relationship should I choose: association or aggregation?
===
I have a Proffesor table in a database. I would like to create an UML diagram for the code-behind part.
The class structure would be:
- a Proffesor class that maps the information from the database table (id, first name, etc)
- a ProffesorDAL class which connects to the DB and queries it in order to add,remove,update Proffesor instances
- 3 forms which add/delete/update proffesors, by accesing the ProffesorDAL class
I thought that the forms-ProffesorDAL relationship is a composition relationship. Is this correct?
How about the ProffesorDAL-Proffesor relationship, could it be aggregation or is it just association? What's the best UML relationship for the forms-Proffesor relationship?
Thanks! | 0 |
3,097,027 | 06/22/2010 20:47:05 | 310,283 | 04/06/2010 18:11:21 | 21 | 0 | Script to determine if an HTTP reponse is from intended domain. | I am trying to write a script that will send an HTTP "GET" to a URL then determine if the response came from the same domain or not.
I have been playing around with VBS and the WinHttp.WinHttpRequest.5.1 object. Sadly this does not give me any access to where exactly the response came from.
I tried parsing through the response headers but that only yields results if the web-server sets a cookie with the server's domain in it. For example (in my script below) "google.com" will pass but "avg.com" will fail.
I am not very attached to my current script and gladly will change if anyone knows a better way.
My current script:
Dim objWinHttp
Dim strContent, strURL
Set objWinHttp = CreateObject("WinHttp.WinHttpRequest.5.1")
objWinHttp.SetTimeouts 29000, 29000, 29000, 29000
objWinHttp.Option(0) = "Website_monitor_light/1.0"
objWinHttp.Option(6) = True
If (InStr(WScript.Arguments.Item(0), "www.") = 1) Then
URL = "http://" & WScript.Arguments.Item(0)
Else
URL = "http://www." & WScript.Arguments.Item(0)
End If
objWinHttp.Open "GET", URL
On Error Resume Next
objWinHttp.Send()
If (objWinHttp.Status = 200) Then
strContent = objWinHttp.GetAllResponseHeaders
End If
Wscript.Quit InStr(strContent, "domain=." & Mid(URL,12))
Thanks a million. | http | scripting | vbscript | winhttprequest | null | null | open | Script to determine if an HTTP reponse is from intended domain.
===
I am trying to write a script that will send an HTTP "GET" to a URL then determine if the response came from the same domain or not.
I have been playing around with VBS and the WinHttp.WinHttpRequest.5.1 object. Sadly this does not give me any access to where exactly the response came from.
I tried parsing through the response headers but that only yields results if the web-server sets a cookie with the server's domain in it. For example (in my script below) "google.com" will pass but "avg.com" will fail.
I am not very attached to my current script and gladly will change if anyone knows a better way.
My current script:
Dim objWinHttp
Dim strContent, strURL
Set objWinHttp = CreateObject("WinHttp.WinHttpRequest.5.1")
objWinHttp.SetTimeouts 29000, 29000, 29000, 29000
objWinHttp.Option(0) = "Website_monitor_light/1.0"
objWinHttp.Option(6) = True
If (InStr(WScript.Arguments.Item(0), "www.") = 1) Then
URL = "http://" & WScript.Arguments.Item(0)
Else
URL = "http://www." & WScript.Arguments.Item(0)
End If
objWinHttp.Open "GET", URL
On Error Resume Next
objWinHttp.Send()
If (objWinHttp.Status = 200) Then
strContent = objWinHttp.GetAllResponseHeaders
End If
Wscript.Quit InStr(strContent, "domain=." & Mid(URL,12))
Thanks a million. | 0 |
2,980,599 | 06/05/2010 13:51:29 | 359,223 | 06/05/2010 13:50:41 | 1 | 0 | changes are not updated in eclipse | I am new to eclipse. I am trying eclipse with a simple web application. Whenever I make changes in the jsp pages and run the application. The changes are not updated in the server. please let me know the problem. | eclipse | null | null | null | null | null | open | changes are not updated in eclipse
===
I am new to eclipse. I am trying eclipse with a simple web application. Whenever I make changes in the jsp pages and run the application. The changes are not updated in the server. please let me know the problem. | 0 |
10,667,692 | 05/19/2012 18:11:05 | 1,281,833 | 03/20/2012 19:49:15 | 11 | 1 | Non standart sql query | I need to select items with defined idBook from **"exemplar"** table which are currently not ordered(dateReturn field in **"orders"** table is not null).
**Table "orders" can contain previously fulfilled orders with the same idExemplar!**
If exemplar **has at least one record in "orders" table with dateReturned=null** then this exemplar should be excluded!
###I've tried to use this query:###
`select * from exemplar join orders on` <br/> `orders.idExemplar=exemplar.idExemplar`
<br/>`where dateReturned is not null`<br/>
but it gives wrong result if table orders contains previusly fulfilled orders with the same idExemplar <br/>
[tables][1]
[1]: http://i.stack.imgur.com/sMq06.pngv | mysql | sql | null | null | null | null | open | Non standart sql query
===
I need to select items with defined idBook from **"exemplar"** table which are currently not ordered(dateReturn field in **"orders"** table is not null).
**Table "orders" can contain previously fulfilled orders with the same idExemplar!**
If exemplar **has at least one record in "orders" table with dateReturned=null** then this exemplar should be excluded!
###I've tried to use this query:###
`select * from exemplar join orders on` <br/> `orders.idExemplar=exemplar.idExemplar`
<br/>`where dateReturned is not null`<br/>
but it gives wrong result if table orders contains previusly fulfilled orders with the same idExemplar <br/>
[tables][1]
[1]: http://i.stack.imgur.com/sMq06.pngv | 0 |
3,726,981 | 09/16/2010 13:11:07 | 264,028 | 02/02/2010 02:54:50 | 20 | 3 | Live Chat support in my website | I just wanted to know if there is any (preferently freeware) solution to provide live chat support in my website, but connected to a Live Messenger account, because I would like to answer by this way...
Thanks! | chat | support | livechat | null | null | 01/20/2012 12:23:39 | not constructive | Live Chat support in my website
===
I just wanted to know if there is any (preferently freeware) solution to provide live chat support in my website, but connected to a Live Messenger account, because I would like to answer by this way...
Thanks! | 4 |
10,346,558 | 04/27/2012 07:31:45 | 969,062 | 09/28/2011 12:29:40 | 6 | 0 | How to use Quickbooks accounting software integration with joomla and virtuemart.? | I want to devlope a website that have three types of user's like customer center,supplier center and sales man center and site administrator can be resposible to create their userId and password.
Customer center: Once we create ID and Password for customer then customer will be able to login in his account and can see the available inventory and price on website. Order placing will also be available on the website itself.
Supplier Center: Once we create ID and Password for supplier then supplier can see the order we placed through website and supplier can also load the information of merchandise they already shipped and their price with total amount (similar to their exact invoice). Once we receive the shipment in our warehouse then we will upload this invoice information from the website to the vendor information in quick books.
SalesMan center: Through sales man login they can take the order from customer and it we will be able to see the sales of every salesman.
We will transfer data(quantity available and price of all the items) from this website to accounting software 'Quickbooks' everyday.
So please suggest me that can i make this website in joomla content management system and what version that i will use with it and also there is any api for the integration of the Quickbooks with the joomla and virtuemart.
OR
Can i use core php to built this website.
| php | joomla | joomla1.5 | running-other-programs | null | 05/03/2012 17:35:39 | not a real question | How to use Quickbooks accounting software integration with joomla and virtuemart.?
===
I want to devlope a website that have three types of user's like customer center,supplier center and sales man center and site administrator can be resposible to create their userId and password.
Customer center: Once we create ID and Password for customer then customer will be able to login in his account and can see the available inventory and price on website. Order placing will also be available on the website itself.
Supplier Center: Once we create ID and Password for supplier then supplier can see the order we placed through website and supplier can also load the information of merchandise they already shipped and their price with total amount (similar to their exact invoice). Once we receive the shipment in our warehouse then we will upload this invoice information from the website to the vendor information in quick books.
SalesMan center: Through sales man login they can take the order from customer and it we will be able to see the sales of every salesman.
We will transfer data(quantity available and price of all the items) from this website to accounting software 'Quickbooks' everyday.
So please suggest me that can i make this website in joomla content management system and what version that i will use with it and also there is any api for the integration of the Quickbooks with the joomla and virtuemart.
OR
Can i use core php to built this website.
| 1 |
3,233,611 | 07/13/2010 01:39:09 | 365,734 | 06/13/2010 15:00:50 | 56 | 9 | Why my SharpDevelop didn't have SVN Addin? | My SharpDevelop Version is 4.0.0.
Some one said I can found at Tools->Subversion, but I didn't found.
Should I go to download it? What url is it?
Thanks. | svn | add-in | sharpdevelop | null | null | 09/18/2011 12:18:12 | too localized | Why my SharpDevelop didn't have SVN Addin?
===
My SharpDevelop Version is 4.0.0.
Some one said I can found at Tools->Subversion, but I didn't found.
Should I go to download it? What url is it?
Thanks. | 3 |
10,882,845 | 06/04/2012 14:16:44 | 439,980 | 09/05/2010 10:36:28 | 1 | 0 | ActiveRecord::ConnectionNotEstablished with PostgreSQL 9.1.3 and RoR 3.2.5 | I just installed PostgreSQL with homebrew:
$ brew install postgresql
I installed the pg gem with:
$ gem install pg -- --with-pg-config= '/usr/local/var/postgres/postgresql.conf'
I changed my app's database.yml to
development:
adapter: postgresql
encoding: unicode
database: rails_dev
pool: 5
username: vise890
password:
test:
adapter: postgresql
encoding: unicode
database: rails_test
pool: 5
username: vise890
password:
production:
adapter: postgresql
encoding: unicode
database: ddb
port: 5432
pool: 5
username: postgres
password: admin
However, whenever i load any page I get the error:
ActiveRecord::ConnectionNotEstablished
I can connect to the db with pgAdmin (u:vise890 P:{none}) and i see the databases.
I am doing [example3][1] from the Ruby on Rails Tutorial
If you want to check the whole thing: [Sample App github branch][3]
Thanks in advance guys!
[1]: http://ruby.railstutorial.org/chapters/static-pages#sec:static_pages_exercises
[3]: https://github.com/vise890/sample_app/tree/postgres | ruby-on-rails | osx | postgresql | homebrew | null | null | open | ActiveRecord::ConnectionNotEstablished with PostgreSQL 9.1.3 and RoR 3.2.5
===
I just installed PostgreSQL with homebrew:
$ brew install postgresql
I installed the pg gem with:
$ gem install pg -- --with-pg-config= '/usr/local/var/postgres/postgresql.conf'
I changed my app's database.yml to
development:
adapter: postgresql
encoding: unicode
database: rails_dev
pool: 5
username: vise890
password:
test:
adapter: postgresql
encoding: unicode
database: rails_test
pool: 5
username: vise890
password:
production:
adapter: postgresql
encoding: unicode
database: ddb
port: 5432
pool: 5
username: postgres
password: admin
However, whenever i load any page I get the error:
ActiveRecord::ConnectionNotEstablished
I can connect to the db with pgAdmin (u:vise890 P:{none}) and i see the databases.
I am doing [example3][1] from the Ruby on Rails Tutorial
If you want to check the whole thing: [Sample App github branch][3]
Thanks in advance guys!
[1]: http://ruby.railstutorial.org/chapters/static-pages#sec:static_pages_exercises
[3]: https://github.com/vise890/sample_app/tree/postgres | 0 |
6,530,379 | 06/30/2011 05:36:59 | 822,393 | 06/30/2011 05:36:59 | 1 | 0 | Virtual embedded wireless device to VGA transmitter | Is there a way to simulate VGA wireless USB transmitter using an embedded wireless device + some kind of driver so the final setup would just need VGA wireless receiver/s instead of having the USB transmitter + USB receiver?
###Target setup###
computer + virtual USB transmitter + embedded Wifi device =======> wireless VGA USB receiver/s
###Default setup###
computer + wireless USB transmitter + driver ============> wireless VGA USB receiver/s
| linux-kernel | linux-device-driver | embedded-linux | transmission | wireless-connection | 06/30/2011 13:11:03 | off topic | Virtual embedded wireless device to VGA transmitter
===
Is there a way to simulate VGA wireless USB transmitter using an embedded wireless device + some kind of driver so the final setup would just need VGA wireless receiver/s instead of having the USB transmitter + USB receiver?
###Target setup###
computer + virtual USB transmitter + embedded Wifi device =======> wireless VGA USB receiver/s
###Default setup###
computer + wireless USB transmitter + driver ============> wireless VGA USB receiver/s
| 2 |
10,761,916 | 05/25/2012 22:10:58 | 1,336,427 | 04/16/2012 13:37:31 | 13 | 0 | FormClosing() event loaded twice | I want to show a MessageBox to confirm the exiting before letting a form close. So, a FormClosing event is created.
private void Form_Main_FormClosing(object sender, FormClosingEventArgs e)
{
//nothing here for now
}
I have the MessageBox shown twice. Debugging tool shows that somehow the code goes over FormClosing() twice. That happens even when I have nothing inside FormClosing() as above. I did search for FormClosing() in my entire code, and there is only 1 place where it is subscribed to. I have the same FormClosing() in two other projects, and that does not happen. Can anyone give me a pointer? This is not making any sense to me.
Much gracias! Merci beaucoup! Thank you very much! | c# | twice | formclosing | null | null | 05/30/2012 19:04:58 | too localized | FormClosing() event loaded twice
===
I want to show a MessageBox to confirm the exiting before letting a form close. So, a FormClosing event is created.
private void Form_Main_FormClosing(object sender, FormClosingEventArgs e)
{
//nothing here for now
}
I have the MessageBox shown twice. Debugging tool shows that somehow the code goes over FormClosing() twice. That happens even when I have nothing inside FormClosing() as above. I did search for FormClosing() in my entire code, and there is only 1 place where it is subscribed to. I have the same FormClosing() in two other projects, and that does not happen. Can anyone give me a pointer? This is not making any sense to me.
Much gracias! Merci beaucoup! Thank you very much! | 3 |
7,533,775 | 09/23/2011 19:19:51 | 1,209,690 | 04/12/2011 20:35:17 | 81 | 2 | Which database to use- Mysql or Oracle? | If someone is to build a University Management System using PHP, which database would you suggest for that- Mysql or Oracle? Or let me put it this way.. is it okay if someone uses mysql as a database for the University Management System or it is better to use Oracle?
Thanks in Advance | php | mysql | oracle | null | null | 09/23/2011 19:26:20 | not constructive | Which database to use- Mysql or Oracle?
===
If someone is to build a University Management System using PHP, which database would you suggest for that- Mysql or Oracle? Or let me put it this way.. is it okay if someone uses mysql as a database for the University Management System or it is better to use Oracle?
Thanks in Advance | 4 |
3,582,608 | 08/27/2010 08:50:26 | 279,259 | 02/23/2010 08:24:46 | 4,969 | 140 | How to correctly implement custom iterators and const_iterators ? | I have a custom container class for which I'd like to write the `iterator` and `const_iterator` classes.
I never did this before and I failed to find an appropriate how-to. What are the guidelines regarding iterator creation, and what should I be aware of ?
I'd also like to avoid code duplication (I feel that `const_iterator` and `iterator` share many things; should one subclass the other ?).
Thanks.
*Foot note: I'm pretty sure Boost has something to ease this but I can't use it here, for many stupid reasons.*
| c++ | iterator | const-iterator | null | null | null | open | How to correctly implement custom iterators and const_iterators ?
===
I have a custom container class for which I'd like to write the `iterator` and `const_iterator` classes.
I never did this before and I failed to find an appropriate how-to. What are the guidelines regarding iterator creation, and what should I be aware of ?
I'd also like to avoid code duplication (I feel that `const_iterator` and `iterator` share many things; should one subclass the other ?).
Thanks.
*Foot note: I'm pretty sure Boost has something to ease this but I can't use it here, for many stupid reasons.*
| 0 |
2,656,229 | 04/16/2010 21:34:58 | 121,333 | 06/11/2009 13:49:07 | 193 | 22 | Downloading jQuery UI: Ok, so what part of this mess do I copy to the server? | From the "should be simple, but..." files: Trying to get started with jQuery UI. Went to the site, used their custom builder thingy to assemble the parts I need, made myself a custom theme using the Theme Roller, downloaded the zip file thus produced, unzipped it on my local drive. Ok, so I have 37 folders, 311 files, and a total of 2.4 MB. Ain't no way in hell all this is going on the server. What parts do I need to put there?
- 'css'
- 'custom-theme': `jquery-ui-1.8.custom.css`, 'images' subfolder with 12 .png images
- 'development-bundle'
- 'demos': `demos.css`, `index.html`, plus 18 subfolders, but I'm guessing "not needed"
- 'docs': 17 .html files, but again, I'm guessing "not needed"
- 'external': 4 .js files, one .css
- 'themes': 'base' and 'custom-theme' subfolders, each with 8 or 9 .css files and an 'images' subfolder with about a dozen images
- 'ui': 25 .js files, an 'i18n' subfolder with 53 .js files, and a 'minified' subfolder with 24 .js files
- 'js': `jquery-1.4.2.min.js` and `jquery-ui-1.8.custom.min.js`
<br>
Also, the file structure. Our server is set up something like this:
- root
- admin (administrative tools)
- css
- forms (the gist of the site lives here)
- images
- include (asp code snippets that are used by multiple pages)
- js (just a few things right now, like an ancient wheezing spelling checker)
As far as I can tell, the jQuery css files assume that (1) each theme is in its own folder, and (2) each folder has its own images subfolder. How can I convince it otherwise? i.e. put the necessary .js files in the 'js' folder, the .css files in the 'css' folder, and the images in the 'images' folder? | jquery-ui | jquery | file-structure | themeroller | null | null | open | Downloading jQuery UI: Ok, so what part of this mess do I copy to the server?
===
From the "should be simple, but..." files: Trying to get started with jQuery UI. Went to the site, used their custom builder thingy to assemble the parts I need, made myself a custom theme using the Theme Roller, downloaded the zip file thus produced, unzipped it on my local drive. Ok, so I have 37 folders, 311 files, and a total of 2.4 MB. Ain't no way in hell all this is going on the server. What parts do I need to put there?
- 'css'
- 'custom-theme': `jquery-ui-1.8.custom.css`, 'images' subfolder with 12 .png images
- 'development-bundle'
- 'demos': `demos.css`, `index.html`, plus 18 subfolders, but I'm guessing "not needed"
- 'docs': 17 .html files, but again, I'm guessing "not needed"
- 'external': 4 .js files, one .css
- 'themes': 'base' and 'custom-theme' subfolders, each with 8 or 9 .css files and an 'images' subfolder with about a dozen images
- 'ui': 25 .js files, an 'i18n' subfolder with 53 .js files, and a 'minified' subfolder with 24 .js files
- 'js': `jquery-1.4.2.min.js` and `jquery-ui-1.8.custom.min.js`
<br>
Also, the file structure. Our server is set up something like this:
- root
- admin (administrative tools)
- css
- forms (the gist of the site lives here)
- images
- include (asp code snippets that are used by multiple pages)
- js (just a few things right now, like an ancient wheezing spelling checker)
As far as I can tell, the jQuery css files assume that (1) each theme is in its own folder, and (2) each folder has its own images subfolder. How can I convince it otherwise? i.e. put the necessary .js files in the 'js' folder, the .css files in the 'css' folder, and the images in the 'images' folder? | 0 |
2,847,662 | 05/17/2010 08:44:49 | 334,380 | 05/06/2010 11:48:18 | 6 | 0 | what is the difference between union and join | i m confused union and join
| sql | null | null | null | null | null | open | what is the difference between union and join
===
i m confused union and join
| 0 |
7,608,336 | 09/30/2011 09:19:52 | 668,970 | 03/21/2011 06:21:45 | 1,156 | 119 | getting error on invocation.invoke() method | Iam working on implementation of singlesingon , users will get link in mail, onclicking the link, he will get the details of his account. This working fine when clicking on the link or pasting the link in addressbar of browser. Now i written stub java class, which will post the user details by invoking the link from the stubclass. In the process iam getting error in interceptor class `result = invocation.invoke()` this will return the action class which we are invoking from the link. But iam get result = "error" on debugging. Can any one suggest me, on which case we can get result="error" ? how to rectify this? | java | java-ee | struts2 | null | null | 09/30/2011 09:44:08 | not a real question | getting error on invocation.invoke() method
===
Iam working on implementation of singlesingon , users will get link in mail, onclicking the link, he will get the details of his account. This working fine when clicking on the link or pasting the link in addressbar of browser. Now i written stub java class, which will post the user details by invoking the link from the stubclass. In the process iam getting error in interceptor class `result = invocation.invoke()` this will return the action class which we are invoking from the link. But iam get result = "error" on debugging. Can any one suggest me, on which case we can get result="error" ? how to rectify this? | 1 |
10,759,314 | 05/25/2012 18:04:43 | 640,558 | 03/02/2011 04:50:28 | 1,791 | 47 | Why am I getting different results when using Arrays.fill vs. manually making the list? | I'm not that familiar with all the behavior of Java so sorry if I'm making an obvious mistake. Basically I'm making a program that given a list of items & range it calculates percentages that would could be used to include all items. For example, if you have a basket of fruit and want to put Apple, Pears, Peaches with no item less than 20% and no item greater than 60% the program will tell you.
In order to do that I have a list that has the lower bound(min. percentage) and the higher bound(max. percentage). My problem is when I create the list manually it seems to work(using the above example, 3 items, 20-60 range I get 41 items), but when I use `Arrays.fill` I get 882 results(which is wrong because its including 0's and not respecting the lower bound).
I'm not sure what the problem is..I looked into `Arrays.fill` and it seems to do what I want, I also listed the items in the list in both cases(manual vs. Arrays.fill) and they both look the same.
Here's the differences(working version):
static final String[] names = new String[] {"apples", "pears", "peach" }; //test
static final int[] low_bound = new int[] {20,20, 20}; //this allows us to invididually set the range of each item
static final int[] high_bound = new int[] {60,60, 20};
Not working version:
static final String[] names = new String[] {"apples", "pears", "peach" };
static int[] low_bound = new int[names.length];
static int[] high_bound = new int[names.length];
//then in the main method
Arrays.fill(low_bound, 20); //fills the min list with default value
Arrays.fill(high_bound, 60); //fills the max list with default value
Why are the results different? These are the only changes between the working version and broken version. I want to use large lists and don't want to enter the data manually(but I like the flexibility of making individual ranges if I want), am I using Arrays.fill wrong or some other rookie mistake?
If it helps to see the full context, here's the full code:
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
public class recursion_percent_returner {
static final int target_percent = 100;
//smaller test data
static final String[] names = new String[] {"apples", "pears", "peach" }; //test
//static final int[] low_bound = new int[] {20,20, 20}; //this allows us to invididually set the range of each item
//static final int[] high_bound = new int[] {60,60, 20};
//larger test data
static int[] low_bound = new int[names.length];
static int[] high_bound = new int[names.length];
static int[] max_add_by_bounds = new int[names.length];
static int totalItemsToAdd = 0; //this will hold the value of adding all the min values together
static ArrayList results = new ArrayList();
static int items_to_add__base_map = 0;
static int[] default_coeff = new int[names.length];
public static void main(String[] args) throws IOException {
System.out.println("starting..");
System.out.println("list size " + names.length);
Arrays.fill(low_bound, 20); //fills the min list with default value
Arrays.fill(high_bound, 60); //fills the max list with default value
Arrays.fill(default_coeff, 0); //fills the default list with zeros
//populate the variable max_add_by_bounds with the max a variable can add
//also figure out how many total items can be added to the base map(take the target_range and subtract it by all
for (int x = 0; x<names.length; x++) {
max_add_by_bounds[x] = (high_bound[x] - low_bound[x]);
totalItemsToAdd = totalItemsToAdd + low_bound[x];
}
items_to_add__base_map = target_percent - totalItemsToAdd;
File f = new File("results.txt");
FileWriter fw = new FileWriter(f);
recursion_part(names.length-1,target_percent,default_coeff, fw);
System.out.println("total size of results are " + results.size());
}
private static void recursion_part(int k, int sum, int[] coeff, FileWriter fw) throws IOException {
for (int c = low_bound[k]; c <= high_bound[k]; c++) {
coeff[k] = c;
int[] newcoeff = Arrays.copyOf(coeff, coeff.length);
if (c - sum == 0) {
results.add(newcoeff);
printresults(newcoeff,fw);
break;
} else if (k > 0) {
recursion_part(k - 1, sum - c, newcoeff, fw);
}
}
}
private static void printresults(int[] newcoeff, FileWriter fw) throws IOException {
//StringBuffer sb = new StringBuffer();
for (int x = 0; x<newcoeff.length; x++) {
//sb.append(names[x]).append(" * ").append(newcoeff[x]).append(" ");
System.out.println(names[x] + " = " + newcoeff[x]);
}
System.out.println("*********");
//fw.append(sb);
//fw.write("\n");
}
}
| java | null | null | null | null | null | open | Why am I getting different results when using Arrays.fill vs. manually making the list?
===
I'm not that familiar with all the behavior of Java so sorry if I'm making an obvious mistake. Basically I'm making a program that given a list of items & range it calculates percentages that would could be used to include all items. For example, if you have a basket of fruit and want to put Apple, Pears, Peaches with no item less than 20% and no item greater than 60% the program will tell you.
In order to do that I have a list that has the lower bound(min. percentage) and the higher bound(max. percentage). My problem is when I create the list manually it seems to work(using the above example, 3 items, 20-60 range I get 41 items), but when I use `Arrays.fill` I get 882 results(which is wrong because its including 0's and not respecting the lower bound).
I'm not sure what the problem is..I looked into `Arrays.fill` and it seems to do what I want, I also listed the items in the list in both cases(manual vs. Arrays.fill) and they both look the same.
Here's the differences(working version):
static final String[] names = new String[] {"apples", "pears", "peach" }; //test
static final int[] low_bound = new int[] {20,20, 20}; //this allows us to invididually set the range of each item
static final int[] high_bound = new int[] {60,60, 20};
Not working version:
static final String[] names = new String[] {"apples", "pears", "peach" };
static int[] low_bound = new int[names.length];
static int[] high_bound = new int[names.length];
//then in the main method
Arrays.fill(low_bound, 20); //fills the min list with default value
Arrays.fill(high_bound, 60); //fills the max list with default value
Why are the results different? These are the only changes between the working version and broken version. I want to use large lists and don't want to enter the data manually(but I like the flexibility of making individual ranges if I want), am I using Arrays.fill wrong or some other rookie mistake?
If it helps to see the full context, here's the full code:
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
public class recursion_percent_returner {
static final int target_percent = 100;
//smaller test data
static final String[] names = new String[] {"apples", "pears", "peach" }; //test
//static final int[] low_bound = new int[] {20,20, 20}; //this allows us to invididually set the range of each item
//static final int[] high_bound = new int[] {60,60, 20};
//larger test data
static int[] low_bound = new int[names.length];
static int[] high_bound = new int[names.length];
static int[] max_add_by_bounds = new int[names.length];
static int totalItemsToAdd = 0; //this will hold the value of adding all the min values together
static ArrayList results = new ArrayList();
static int items_to_add__base_map = 0;
static int[] default_coeff = new int[names.length];
public static void main(String[] args) throws IOException {
System.out.println("starting..");
System.out.println("list size " + names.length);
Arrays.fill(low_bound, 20); //fills the min list with default value
Arrays.fill(high_bound, 60); //fills the max list with default value
Arrays.fill(default_coeff, 0); //fills the default list with zeros
//populate the variable max_add_by_bounds with the max a variable can add
//also figure out how many total items can be added to the base map(take the target_range and subtract it by all
for (int x = 0; x<names.length; x++) {
max_add_by_bounds[x] = (high_bound[x] - low_bound[x]);
totalItemsToAdd = totalItemsToAdd + low_bound[x];
}
items_to_add__base_map = target_percent - totalItemsToAdd;
File f = new File("results.txt");
FileWriter fw = new FileWriter(f);
recursion_part(names.length-1,target_percent,default_coeff, fw);
System.out.println("total size of results are " + results.size());
}
private static void recursion_part(int k, int sum, int[] coeff, FileWriter fw) throws IOException {
for (int c = low_bound[k]; c <= high_bound[k]; c++) {
coeff[k] = c;
int[] newcoeff = Arrays.copyOf(coeff, coeff.length);
if (c - sum == 0) {
results.add(newcoeff);
printresults(newcoeff,fw);
break;
} else if (k > 0) {
recursion_part(k - 1, sum - c, newcoeff, fw);
}
}
}
private static void printresults(int[] newcoeff, FileWriter fw) throws IOException {
//StringBuffer sb = new StringBuffer();
for (int x = 0; x<newcoeff.length; x++) {
//sb.append(names[x]).append(" * ").append(newcoeff[x]).append(" ");
System.out.println(names[x] + " = " + newcoeff[x]);
}
System.out.println("*********");
//fw.append(sb);
//fw.write("\n");
}
}
| 0 |
2,639 | 08/05/2008 18:07:26 | 434 | 08/05/2008 17:42:54 | 1 | 0 | What are some web-based knowledge-base solutions? | I've used a WordPress blog and a Screwturn Wiki (at two separate jobs) to store private, company-specific KB info, but I'm looking for something that was created to be a knowledge base. Specifically, I'd like to see:
- Free/low cost
- Simple method for users to subscribe to KB (or just sections) to get updates
- Ability to do page versioning/audit changes
- Limit access to certain pages for certain users
- Very simple method of posting/editing articles
- Very simple method of adding images to articles
- Excellent (fast, accurate) searching abilities
- Ability to rate and comment on articles
I liked using the Wordpress blog because it allowed me to use [Live Writer][1] to add/edit articles and images, but it didn't have page versioning (that I could see).
I like using Screwturn wiki because of it's ability to track article versions, and I like it's clean look, but some non-technical people balk at the input and editing.
[1]: http://get.live.com/ | language-agnostic | planning | null | null | null | null | open | What are some web-based knowledge-base solutions?
===
I've used a WordPress blog and a Screwturn Wiki (at two separate jobs) to store private, company-specific KB info, but I'm looking for something that was created to be a knowledge base. Specifically, I'd like to see:
- Free/low cost
- Simple method for users to subscribe to KB (or just sections) to get updates
- Ability to do page versioning/audit changes
- Limit access to certain pages for certain users
- Very simple method of posting/editing articles
- Very simple method of adding images to articles
- Excellent (fast, accurate) searching abilities
- Ability to rate and comment on articles
I liked using the Wordpress blog because it allowed me to use [Live Writer][1] to add/edit articles and images, but it didn't have page versioning (that I could see).
I like using Screwturn wiki because of it's ability to track article versions, and I like it's clean look, but some non-technical people balk at the input and editing.
[1]: http://get.live.com/ | 0 |
4,734,590 | 01/19/2011 11:18:11 | 577,160 | 01/16/2011 00:36:53 | 16 | 0 | How to read rtf attached to the document to RichTextBox? | I attached rtf document to my app, and I want its content to be display in RichTextBox, I know how to do that with rtf file from disk, but I can't access file in project. | wpf | richtextbox | rtf | null | null | null | open | How to read rtf attached to the document to RichTextBox?
===
I attached rtf document to my app, and I want its content to be display in RichTextBox, I know how to do that with rtf file from disk, but I can't access file in project. | 0 |
5,150,440 | 03/01/2011 04:26:04 | 113,004 | 05/27/2009 08:54:33 | 139 | 8 | Copy selected columns from one DataTable to another | I have a scenario where-in I have a DataTable with certain columns "Col1, Col2, Col3". I want to copy just "Col2, Col3" into another DataTable which has a primary key "ID". What is the best way to copy them. There are 5000+ records and performance is a key factor.
I tried with Select, DefaultView.RowsFilter but no success. I know one option is to loop through all records an copy data one by one in second DataTable. But wanted to know a better way. | vb.net | datatable | null | null | null | null | open | Copy selected columns from one DataTable to another
===
I have a scenario where-in I have a DataTable with certain columns "Col1, Col2, Col3". I want to copy just "Col2, Col3" into another DataTable which has a primary key "ID". What is the best way to copy them. There are 5000+ records and performance is a key factor.
I tried with Select, DefaultView.RowsFilter but no success. I know one option is to loop through all records an copy data one by one in second DataTable. But wanted to know a better way. | 0 |
11,500,472 | 07/16/2012 08:19:27 | 808,265 | 06/21/2011 10:52:24 | 72 | 0 | Add increasing time to a date (php) | Hello everybody and thanls for taking the time to read this ;
I was wandering if i have a variable that contains a formated date like this :
> 07/02/2012
That i obtained with the following query
> date_format(data,'%d/%m/%Y') as data_scadenza,
How can i loop this date to have somthingh like this:
> 2012-02-07 11:53:00, 2012-02-07 11:54:00, 2012-02-07 11:55:00, ect..
Thanks everybody in advance , was wandering how to do this either in php or directlly in the mysql querry
| php | mysql | null | null | null | null | open | Add increasing time to a date (php)
===
Hello everybody and thanls for taking the time to read this ;
I was wandering if i have a variable that contains a formated date like this :
> 07/02/2012
That i obtained with the following query
> date_format(data,'%d/%m/%Y') as data_scadenza,
How can i loop this date to have somthingh like this:
> 2012-02-07 11:53:00, 2012-02-07 11:54:00, 2012-02-07 11:55:00, ect..
Thanks everybody in advance , was wandering how to do this either in php or directlly in the mysql querry
| 0 |
8,364,402 | 12/03/2011 00:29:37 | 656,224 | 03/12/2011 01:11:11 | 747 | 23 | Member functions for scalar types and operator overloading | I've been thinking about some possible features C++ could have, does anyone know why they aren't supported?
1. **Member functions for built-in types.** This may just not seem necessary, but an interesting feature nonetheless. Example pseudocode: `int int::getFirstBit(void) {return *this & 1;} ... int a = 2; a.getFirstBit();` This may seem useless, but it shouldn't be hard to implement either. With this springs up the following thought:
2. **Member functions outside class definition.** I don't see why this shouldn't be supported, except for conflicts with access restriction (public,protected,private,etc.) and encapsulation, but perhaps only `structs` could have this feature.
3. **Operator overloading for non-object types**, a use for this could be for pointers or arrays.
I know these features aren't necessary for much, but they still seem cool. Is it because they don't seem necessary or because they can cause many headaches? | c++ | null | null | null | null | 12/03/2011 01:23:45 | not constructive | Member functions for scalar types and operator overloading
===
I've been thinking about some possible features C++ could have, does anyone know why they aren't supported?
1. **Member functions for built-in types.** This may just not seem necessary, but an interesting feature nonetheless. Example pseudocode: `int int::getFirstBit(void) {return *this & 1;} ... int a = 2; a.getFirstBit();` This may seem useless, but it shouldn't be hard to implement either. With this springs up the following thought:
2. **Member functions outside class definition.** I don't see why this shouldn't be supported, except for conflicts with access restriction (public,protected,private,etc.) and encapsulation, but perhaps only `structs` could have this feature.
3. **Operator overloading for non-object types**, a use for this could be for pointers or arrays.
I know these features aren't necessary for much, but they still seem cool. Is it because they don't seem necessary or because they can cause many headaches? | 4 |
6,591,375 | 07/06/2011 03:53:04 | 712,997 | 04/18/2011 07:49:04 | 52 | 1 | ifconfig and interfaces | just a question for my understanding. on my mac when I use `ifconfig` command on my mac I get the following interfaces:
- en0
- en1
- lo0
- fw0
- vment0
- vment1
I don't understand why there are so many. I understand that eth0 would be for LAN connections, and that en0 is the wireless connection. But macbook only has one airport..so why en1 as well? not sure what vments are for either. | osx | interface | ip | ifconfig | null | 07/06/2011 11:23:35 | off topic | ifconfig and interfaces
===
just a question for my understanding. on my mac when I use `ifconfig` command on my mac I get the following interfaces:
- en0
- en1
- lo0
- fw0
- vment0
- vment1
I don't understand why there are so many. I understand that eth0 would be for LAN connections, and that en0 is the wireless connection. But macbook only has one airport..so why en1 as well? not sure what vments are for either. | 2 |
5,258,387 | 03/10/2011 10:31:12 | 608,941 | 02/08/2011 23:13:30 | 11 | 3 | Android Calendar | I develop app where I need to use Calendar. I read StackOverflow to make some researches in this topic,
and I'm a little fuzzy.
First of all, my App don't need to sync with any account ( ex with google ), prefer to work online. I need to display events in calendar, only these events that my app create.
Now, I know that there is no Calendar in SDK. I can use Calendar from Google GData, but it works only when I'm online.
(correct me if I'm wrong)
Any sugesstions to use Calendar in my App ? Maybe there is nice open source calendar that I can use, or mayby the best
approach is to write my own calendar (cost extra time :/ )
Thx for help | android | calendar | null | null | null | 07/11/2012 17:15:35 | not constructive | Android Calendar
===
I develop app where I need to use Calendar. I read StackOverflow to make some researches in this topic,
and I'm a little fuzzy.
First of all, my App don't need to sync with any account ( ex with google ), prefer to work online. I need to display events in calendar, only these events that my app create.
Now, I know that there is no Calendar in SDK. I can use Calendar from Google GData, but it works only when I'm online.
(correct me if I'm wrong)
Any sugesstions to use Calendar in my App ? Maybe there is nice open source calendar that I can use, or mayby the best
approach is to write my own calendar (cost extra time :/ )
Thx for help | 4 |
8,380,650 | 12/05/2011 03:17:24 | 1,080,810 | 12/05/2011 02:57:52 | 1 | 0 | Constructor DI + Unity 2.0 + issue with resolving dependency | **Controller:**
public class HomeController : Controller
{
IEmployeeTask _employeeTask;
public HomeController()
{
_employeeTask = new UnityContainer().Resolve<IEmployeeTask>();
}
public HomeController(IEmployeeTask employeeTask)
{
_employeeTask = employeeTask;
}
public ActionResult Index()
{
ViewBag.Message = "Welcome to ASP.NET MVC!";
return View();
}
public ActionResult GetAndDisplayEmployee()
{
return View();
}
[HttpPost]
public ActionResult GetAndDisplayEmployee(int empid)
{
return View(_employeeTask.GetEmployeeModelFromService(empid));
}
}
**Global.asax.cs:**
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
RegisterGlobalFilters(GlobalFilters.Filters);
RegisterRoutes(RouteTable.Routes);
var container = new UnityContainer();
container.RegisterType<IEmployeeModelMap, EmployeeModelMap>();
container.RegisterType<IEmployeeService, EmployeeService>();
container.RegisterType<IEmployeeTask, EmployeeTask>();
container.RegisterType<IEmployee, Employee>();
DependencyResolver.SetResolver(new UnityDependencyResolver(container));
}
**Unity Dependency Resolver:**
public class UnityDependencyResolver : IDependencyResolver
{
readonly IUnityContainer _container;
public UnityDependencyResolver(IUnityContainer container)
{
this._container = container;
}
public object GetService(Type serviceType)
{
try
{
return _container.Resolve(serviceType);
}
catch
{
return null;
}
}
public IEnumerable<object> GetServices(Type serviceType)
{
try
{
return _container.ResolveAll(serviceType);
}
catch
{
return new List<object>();
}
}
}
**Employee Task class:**
public class EmployeeTask: IEmployeeTask
{
IEmployeeService _employeeService;
IEmployeeModelMap _employeeModelMap;
public EmployeeTask(IEmployeeService employeeService, IEmployeeModelMap employeeModelMap)
{
_employeeService = employeeService;
_employeeModelMap = employeeModelMap;
}
public EmployeeViewModel GetEmployeeModelFromService(int empId)
{
return _employeeModelMap.ToModel(_employeeService.GetEmployeeFromEntities(empId));
}
}
Now, i have used unity 2.0 application block. Tried to resolve the dependency of the controller using unity with out using Custom Controller factory.
I am stuck with below error.
> The current type, DataProviderInfrastructure.IEmployeeTask, is an
> interface and cannot be constructed. Are you missing a type mapping?
| asp.net-mvc-3 | dependency-injection | unity | ioc-container | null | null | open | Constructor DI + Unity 2.0 + issue with resolving dependency
===
**Controller:**
public class HomeController : Controller
{
IEmployeeTask _employeeTask;
public HomeController()
{
_employeeTask = new UnityContainer().Resolve<IEmployeeTask>();
}
public HomeController(IEmployeeTask employeeTask)
{
_employeeTask = employeeTask;
}
public ActionResult Index()
{
ViewBag.Message = "Welcome to ASP.NET MVC!";
return View();
}
public ActionResult GetAndDisplayEmployee()
{
return View();
}
[HttpPost]
public ActionResult GetAndDisplayEmployee(int empid)
{
return View(_employeeTask.GetEmployeeModelFromService(empid));
}
}
**Global.asax.cs:**
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
RegisterGlobalFilters(GlobalFilters.Filters);
RegisterRoutes(RouteTable.Routes);
var container = new UnityContainer();
container.RegisterType<IEmployeeModelMap, EmployeeModelMap>();
container.RegisterType<IEmployeeService, EmployeeService>();
container.RegisterType<IEmployeeTask, EmployeeTask>();
container.RegisterType<IEmployee, Employee>();
DependencyResolver.SetResolver(new UnityDependencyResolver(container));
}
**Unity Dependency Resolver:**
public class UnityDependencyResolver : IDependencyResolver
{
readonly IUnityContainer _container;
public UnityDependencyResolver(IUnityContainer container)
{
this._container = container;
}
public object GetService(Type serviceType)
{
try
{
return _container.Resolve(serviceType);
}
catch
{
return null;
}
}
public IEnumerable<object> GetServices(Type serviceType)
{
try
{
return _container.ResolveAll(serviceType);
}
catch
{
return new List<object>();
}
}
}
**Employee Task class:**
public class EmployeeTask: IEmployeeTask
{
IEmployeeService _employeeService;
IEmployeeModelMap _employeeModelMap;
public EmployeeTask(IEmployeeService employeeService, IEmployeeModelMap employeeModelMap)
{
_employeeService = employeeService;
_employeeModelMap = employeeModelMap;
}
public EmployeeViewModel GetEmployeeModelFromService(int empId)
{
return _employeeModelMap.ToModel(_employeeService.GetEmployeeFromEntities(empId));
}
}
Now, i have used unity 2.0 application block. Tried to resolve the dependency of the controller using unity with out using Custom Controller factory.
I am stuck with below error.
> The current type, DataProviderInfrastructure.IEmployeeTask, is an
> interface and cannot be constructed. Are you missing a type mapping?
| 0 |
8,650,336 | 12/27/2011 23:32:14 | 688,266 | 04/01/2011 20:42:09 | 324 | 2 | How can I get rails routes to match * for the final parameter of my url? | I would like to allow a user to automatically login if they use their encrypted password in the url. I have the following url that I would like matched with rails routes:
/attendants/update_player_status/game/1/maybe/user_hash/$2a$10$1kY8xvOjkqZJJJGWDd0q2Oeyl7kICSBDPTYzGhkJ6pZnE6YA/nJie
where the latter part of the url can have any characters, like * (ie. it can have '/' '$' '*' etc)
My routes works but then it bombs out on '/' in the parameter (as seen above):
match '/attendants/update_player_status/game/:game_id/:status/user_hash/:user_hash' => 'attendants#update_player_status_using_hash', :as => 'update_player_status_using_hash'
Any recommendations on what I should do? Once i pull the parameter correctly I will use it to login the user into the website, and allow very limited access. | ruby-on-rails | rails-routing | null | null | null | null | open | How can I get rails routes to match * for the final parameter of my url?
===
I would like to allow a user to automatically login if they use their encrypted password in the url. I have the following url that I would like matched with rails routes:
/attendants/update_player_status/game/1/maybe/user_hash/$2a$10$1kY8xvOjkqZJJJGWDd0q2Oeyl7kICSBDPTYzGhkJ6pZnE6YA/nJie
where the latter part of the url can have any characters, like * (ie. it can have '/' '$' '*' etc)
My routes works but then it bombs out on '/' in the parameter (as seen above):
match '/attendants/update_player_status/game/:game_id/:status/user_hash/:user_hash' => 'attendants#update_player_status_using_hash', :as => 'update_player_status_using_hash'
Any recommendations on what I should do? Once i pull the parameter correctly I will use it to login the user into the website, and allow very limited access. | 0 |
4,405,366 | 12/10/2010 03:26:58 | 512,383 | 11/18/2010 16:15:09 | 1 | 0 | show data in listview from webservice according to keypress in android | i am developing a apps for korean client.i have to search a data according to key press. like if i press A then all the data who started from A show in listview where data come from a webservice in listview.is it possible?if yes,then how to do it.if possible give me some code or link which i can use.
thanks | android | null | null | null | null | null | open | show data in listview from webservice according to keypress in android
===
i am developing a apps for korean client.i have to search a data according to key press. like if i press A then all the data who started from A show in listview where data come from a webservice in listview.is it possible?if yes,then how to do it.if possible give me some code or link which i can use.
thanks | 0 |
4,372,374 | 12/07/2010 00:37:14 | 18,091 | 09/18/2008 18:40:50 | 1,872 | 58 | How prevent data in an iOS app from being synced with iTunes | The <a href="http://sites.force.com/blogs/ideaView?c=09a30000000D9xo&id=087300000007DAbAAM">mobile release preview</a> for the new Salesforce for iPhone app states:
<blockquote>Encrypted Data Store: ... To protect data from attacks, this release incorporates an encrypted data store (AES 128bit encryption) that goes beyond the standard on-device security offered by iPhones and iPods. This encrypted data store does not get synced to iTunes.</blockquote>
How is this accomplished?
(The documentation for the <a href="http://developer.apple.com/library/ios/#documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW20">UIFileSharingEnabled</a> property indicates that a file browser will not appear in iTunes, but does not make it clear whether the contents of the Documents directory is backed up.) | cocoa-touch | security | itunes | ios-4.2 | null | null | open | How prevent data in an iOS app from being synced with iTunes
===
The <a href="http://sites.force.com/blogs/ideaView?c=09a30000000D9xo&id=087300000007DAbAAM">mobile release preview</a> for the new Salesforce for iPhone app states:
<blockquote>Encrypted Data Store: ... To protect data from attacks, this release incorporates an encrypted data store (AES 128bit encryption) that goes beyond the standard on-device security offered by iPhones and iPods. This encrypted data store does not get synced to iTunes.</blockquote>
How is this accomplished?
(The documentation for the <a href="http://developer.apple.com/library/ios/#documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW20">UIFileSharingEnabled</a> property indicates that a file browser will not appear in iTunes, but does not make it clear whether the contents of the Documents directory is backed up.) | 0 |
2,438,404 | 03/13/2010 13:01:50 | 50,974 | 01/02/2009 17:37:43 | 1,015 | 24 | What is the best way to monitor a .NET Application ? | What is the best way to monitor a .NET Application ? | .net | monitoring | null | null | null | 03/30/2012 12:28:55 | not constructive | What is the best way to monitor a .NET Application ?
===
What is the best way to monitor a .NET Application ? | 4 |
18,722 | 08/20/2008 20:19:27 | 1,582 | 08/16/2008 20:41:09 | 1 | 0 | Looking for light-weight multi-platform IDE | I've been recently scouring the internet for an IDE to use on some hobby projects. I use VS at one of my jobs and Emacs on the other. I'm looking for something multi-platform and more light-weight than stuff like Eclipse.
Most of the work I do is in C/C++, Python and Lua.
I've looked into Code::Blocks and it seemed to have exactly what I wanted. It's got code completion, supports custom makefiles easily, a visual debugger, but unfortunately it seems to have bad support for darker themes which is a must for me.
Any suggestions? | ide | softwaretools | null | null | null | 08/30/2011 14:10:40 | not constructive | Looking for light-weight multi-platform IDE
===
I've been recently scouring the internet for an IDE to use on some hobby projects. I use VS at one of my jobs and Emacs on the other. I'm looking for something multi-platform and more light-weight than stuff like Eclipse.
Most of the work I do is in C/C++, Python and Lua.
I've looked into Code::Blocks and it seemed to have exactly what I wanted. It's got code completion, supports custom makefiles easily, a visual debugger, but unfortunately it seems to have bad support for darker themes which is a must for me.
Any suggestions? | 4 |
5,119,048 | 02/25/2011 15:26:04 | 626,704 | 02/21/2011 13:53:22 | 1 | 0 | jQuery show div if value > x | I've been reading lots of topics about jQuery and showing div's, but I haven't found the answer to my specific question yet. Here's the thing:
Based on my <select> value I want to show either div A or div B. The select field is filled with 20 countries, of which 19 get the same div (B) and only one get's another div (A). The one that get's div A has "value=1", so I figured to apply a "if select value > 1, show div B" principle. However, I can't manage to get it working. My other select-show-div mechanism was based on the exact value (I've posted it below), but this if-else thing makes me going crazy.
Any help would be appreciated!
My old value=exact code:
$('.div').hide();
$('#country').change(function() {
$('.div').hide();
$('#country' + $(this).val()).show();
});
});
And the corresponding HTML:
<div id="country1" class="div">
BLABLA
</div>
<div id="country2" class="div">
BLABLA
</div>
etc
| jquery-selectors | if-statement | div | null | null | null | open | jQuery show div if value > x
===
I've been reading lots of topics about jQuery and showing div's, but I haven't found the answer to my specific question yet. Here's the thing:
Based on my <select> value I want to show either div A or div B. The select field is filled with 20 countries, of which 19 get the same div (B) and only one get's another div (A). The one that get's div A has "value=1", so I figured to apply a "if select value > 1, show div B" principle. However, I can't manage to get it working. My other select-show-div mechanism was based on the exact value (I've posted it below), but this if-else thing makes me going crazy.
Any help would be appreciated!
My old value=exact code:
$('.div').hide();
$('#country').change(function() {
$('.div').hide();
$('#country' + $(this).val()).show();
});
});
And the corresponding HTML:
<div id="country1" class="div">
BLABLA
</div>
<div id="country2" class="div">
BLABLA
</div>
etc
| 0 |
10,133,987 | 04/13/2012 01:04:15 | 1,325,693 | 04/11/2012 05:15:27 | 1 | 1 | Issues with std::string in Android ndk-r7b with gnustl_static | I have a C++ project I am trying to build with ndk-build. As part of the debugging of the program, I am trying to use <iostream>, <fstream> and <string>. As such, I have include APP_STL := gnustl_static in Application.mk.
When I try to build, I get the error:
<code>
In file included from C:/Android/android-ndk-r7b/sources/cxx-stl/gnu-libstdc++/include/string:53,
from jni/libcan.h:74:
C:/Android/.../include/bits/basic_string.h: In member function 'int std::basic_string...::compare(...)':
error: expected unqualified-id before '(' token
</code>
And the same error repeated for "basic_string.tcc", plus a few more 'unqualified-id' errors in "basic_string.tcc", and repeated for < iostream> and < fstream>.
Searching Google the only advice I have found is 'make sure you add APP_STL := gnustl_static to Application.mk', and 'check your #includes' but I don't see any problem with it.
Here are the includes:
<code>
#include <vector>
#include <time.h>
#include <linux/types.h>
#include <linux/socket.h>
#include <linux/in.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <pthread.h>
#include <fixedtypes.h>
#include <stdio.h>
#include <string>
#include <linux/posix_types.h>
#include <time.h>
#include <netdb.h>
#include <asm/ioctls.h>
#include <errno.h>
#include <math.h>
#include <stdlib.h>
#include <fstream>
#include <iostream>
#include <sys/types.h>
#include <sys/socket.h>
</code>
If anyone knows what else can cause an 'unqualified-id' error, it would be most helpful.
My alternative would be to use char*, and use strcat, strlen, etc instead of append(), length(), but it still won't work with iostream or fstream.
Thanks | string | iostream | gnu | basic-string | android-ndk-r7 | null | open | Issues with std::string in Android ndk-r7b with gnustl_static
===
I have a C++ project I am trying to build with ndk-build. As part of the debugging of the program, I am trying to use <iostream>, <fstream> and <string>. As such, I have include APP_STL := gnustl_static in Application.mk.
When I try to build, I get the error:
<code>
In file included from C:/Android/android-ndk-r7b/sources/cxx-stl/gnu-libstdc++/include/string:53,
from jni/libcan.h:74:
C:/Android/.../include/bits/basic_string.h: In member function 'int std::basic_string...::compare(...)':
error: expected unqualified-id before '(' token
</code>
And the same error repeated for "basic_string.tcc", plus a few more 'unqualified-id' errors in "basic_string.tcc", and repeated for < iostream> and < fstream>.
Searching Google the only advice I have found is 'make sure you add APP_STL := gnustl_static to Application.mk', and 'check your #includes' but I don't see any problem with it.
Here are the includes:
<code>
#include <vector>
#include <time.h>
#include <linux/types.h>
#include <linux/socket.h>
#include <linux/in.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <pthread.h>
#include <fixedtypes.h>
#include <stdio.h>
#include <string>
#include <linux/posix_types.h>
#include <time.h>
#include <netdb.h>
#include <asm/ioctls.h>
#include <errno.h>
#include <math.h>
#include <stdlib.h>
#include <fstream>
#include <iostream>
#include <sys/types.h>
#include <sys/socket.h>
</code>
If anyone knows what else can cause an 'unqualified-id' error, it would be most helpful.
My alternative would be to use char*, and use strcat, strlen, etc instead of append(), length(), but it still won't work with iostream or fstream.
Thanks | 0 |
8,255,077 | 11/24/2011 09:52:23 | 9,422 | 09/15/2008 18:45:54 | 355 | 18 | Joining a List<String> in java with commas and and | Given a list
List<String> l = new ArrayList<String>();
l.add("one");
l.add("two");
l.add("three");
I have a method
String join(List<String> messages) {
if (messages.isEmpty()) return "";
if (messages.size() == 1) return messages.get(0);
String message = "";
message = StringUtils.join(messages.subList(0, messages.size() -2), ", ");
message = message + (messages.size() > 2 ? ", " : "") + StringUtils.join(messages.subList(messages.size() -2, messages.size()), ", and ");
return message;
}
which, for l, produces "one, two, and three".
My question is, is there a standard (apache-commons) method that does the same?, eg
WhatEverUtils.join(l, ", ", ", and ");
| java | join | apache-commons | null | null | null | open | Joining a List<String> in java with commas and and
===
Given a list
List<String> l = new ArrayList<String>();
l.add("one");
l.add("two");
l.add("three");
I have a method
String join(List<String> messages) {
if (messages.isEmpty()) return "";
if (messages.size() == 1) return messages.get(0);
String message = "";
message = StringUtils.join(messages.subList(0, messages.size() -2), ", ");
message = message + (messages.size() > 2 ? ", " : "") + StringUtils.join(messages.subList(messages.size() -2, messages.size()), ", and ");
return message;
}
which, for l, produces "one, two, and three".
My question is, is there a standard (apache-commons) method that does the same?, eg
WhatEverUtils.join(l, ", ", ", and ");
| 0 |
5,167,450 | 03/02/2011 12:28:02 | 309,834 | 01/13/2009 12:14:25 | 248 | 2 | How to define dependency between tests in MStest | I have some tests which are dependent on the success and failure of some tests. How can I define dependency as I am using VS2010 Mstest and selenium.
E.g
if test1 is failed then dont run test5, test 6. is this possible. | visual-studio-2010 | testing | automation | selenium | mstest | null | open | How to define dependency between tests in MStest
===
I have some tests which are dependent on the success and failure of some tests. How can I define dependency as I am using VS2010 Mstest and selenium.
E.g
if test1 is failed then dont run test5, test 6. is this possible. | 0 |
11,281,907 | 07/01/2012 12:22:03 | 1,098,357 | 12/14/2011 17:18:36 | 63 | 0 | How to get my dropdown menu and hover effect right? | I've built a horizontal menu with drop-down capabilities and it's almost working correctly. I only have 2 problems with it, which i can't find the right method to solve these issues:
1. The distance between the main menu links and the dropdown menu are a little bit to far, so when you try to move your mouse to the dropdown menu it just disappears.I know by changing the **`#submenu_dames{top:34px}`** into a smaller number wil bring it closer to the links,but that also means that it will cover the main menu grey line beneath. Which the dropdown must stay under the line.
2. I've tried to change the background-color of the main menu links with the CSS hover effect. But what happens is that the background-color doesn't fill up with the right width and height.
**Here is my code in action:**
http://jsfiddle.net/flasy_kid/bFBcg/ | html | css | menu | drop-down-menu | null | null | open | How to get my dropdown menu and hover effect right?
===
I've built a horizontal menu with drop-down capabilities and it's almost working correctly. I only have 2 problems with it, which i can't find the right method to solve these issues:
1. The distance between the main menu links and the dropdown menu are a little bit to far, so when you try to move your mouse to the dropdown menu it just disappears.I know by changing the **`#submenu_dames{top:34px}`** into a smaller number wil bring it closer to the links,but that also means that it will cover the main menu grey line beneath. Which the dropdown must stay under the line.
2. I've tried to change the background-color of the main menu links with the CSS hover effect. But what happens is that the background-color doesn't fill up with the right width and height.
**Here is my code in action:**
http://jsfiddle.net/flasy_kid/bFBcg/ | 0 |
5,497,916 | 03/31/2011 09:43:38 | 461,564 | 09/29/2010 09:38:55 | 1 | 2 | Real-Time database update at specified time | Given a Database that has a table Called [Bid Transactions], which contains records of all available auctions that are currently running on an ASP.net website .. something similar to Ebay.com, when the deadline of the auction passed, I should close that auction, Send a notification message to both the item owner and the bidding winner to inform them.
how should I keep track of all open auctions? how could I monitor all their ending time and update the Auction status to be "Closed" on Real-time basis? ..
(1) Using SQL jobs ? .. that should reduce system performance .. shouldn't it ?
(2) A back-end service that is running on the server and uses Threading ? .. I have no clear background about that solution, but should it help ?
anything else ? .. which solution would be better ? | c# | asp.net | sql | sql-server | multithreading | null | open | Real-Time database update at specified time
===
Given a Database that has a table Called [Bid Transactions], which contains records of all available auctions that are currently running on an ASP.net website .. something similar to Ebay.com, when the deadline of the auction passed, I should close that auction, Send a notification message to both the item owner and the bidding winner to inform them.
how should I keep track of all open auctions? how could I monitor all their ending time and update the Auction status to be "Closed" on Real-time basis? ..
(1) Using SQL jobs ? .. that should reduce system performance .. shouldn't it ?
(2) A back-end service that is running on the server and uses Threading ? .. I have no clear background about that solution, but should it help ?
anything else ? .. which solution would be better ? | 0 |
6,420,385 | 06/21/2011 04:34:07 | 260,151 | 01/27/2010 14:38:49 | 1 | 0 | Worpress 2nd level subpages. | I have this structure in my WP pages.
home<br/>
--submenu<br/>
------ submenu 1<br/>
--submenu<br/>
------ submenu 1<br/>
--submenu<br/>
------ submenu 1<br/>
--submenu<br/>
------ submenu 1<br/>
--submenu<br/>
------ submenu 1<br/>
how do i get all the submenu 1 items?
using wp_list_pages?
i tried using parameter depth =2 but it wont give me the
sub-menu 1 items.
can anybody help me?
any help would be appreciated.
thanks, | wordpress | content-management-system | null | null | null | null | open | Worpress 2nd level subpages.
===
I have this structure in my WP pages.
home<br/>
--submenu<br/>
------ submenu 1<br/>
--submenu<br/>
------ submenu 1<br/>
--submenu<br/>
------ submenu 1<br/>
--submenu<br/>
------ submenu 1<br/>
--submenu<br/>
------ submenu 1<br/>
how do i get all the submenu 1 items?
using wp_list_pages?
i tried using parameter depth =2 but it wont give me the
sub-menu 1 items.
can anybody help me?
any help would be appreciated.
thanks, | 0 |
11,307,720 | 07/03/2012 09:06:36 | 1,353,102 | 04/24/2012 07:37:23 | 66 | 4 | UiDocumentInteraction returns generic icons for images in iPad | i need to make a simple file viewer and this method returns icon images for files.
+ (UIImage *)imageForFile:(NSString *)filePath {
NSURL *url = [NSURL fileURLWithPath:filePath];
UIDocumentInteractionController *c = [UIDocumentInteractionController interactionControllerWithURL:url];
UIImage *thumbnail = nil;
NSArray *icons = c.icons;
if([icons count] > 0) {
thumbnail = [icons objectAtIndex:0];
}
return thumbnail;
}
On iPod icons are correct, but on iPad 1G it returns generic file icon for images (jpg/png/gif). Both have iOS 5.0. How can i get proper icons for images?
Thank you! | iphone | ios | ipad | uidocumentinteraction | null | null | open | UiDocumentInteraction returns generic icons for images in iPad
===
i need to make a simple file viewer and this method returns icon images for files.
+ (UIImage *)imageForFile:(NSString *)filePath {
NSURL *url = [NSURL fileURLWithPath:filePath];
UIDocumentInteractionController *c = [UIDocumentInteractionController interactionControllerWithURL:url];
UIImage *thumbnail = nil;
NSArray *icons = c.icons;
if([icons count] > 0) {
thumbnail = [icons objectAtIndex:0];
}
return thumbnail;
}
On iPod icons are correct, but on iPad 1G it returns generic file icon for images (jpg/png/gif). Both have iOS 5.0. How can i get proper icons for images?
Thank you! | 0 |
3,497,528 | 08/16/2010 21:29:40 | 56,952 | 01/20/2009 04:39:48 | 923 | 19 | Is there a way to overcome the port limit on a linux system? | Is there a way to overcome the port limit on a linux system? We have a server running that accepts incoming connection and it uses very little memory and cpu. It's rather silly that we have to build a cluster of small linux boxes just to overcome a software limit (number of points of around 60k). Any ideas? | linux | networking | null | null | null | 08/18/2010 01:06:16 | off topic | Is there a way to overcome the port limit on a linux system?
===
Is there a way to overcome the port limit on a linux system? We have a server running that accepts incoming connection and it uses very little memory and cpu. It's rather silly that we have to build a cluster of small linux boxes just to overcome a software limit (number of points of around 60k). Any ideas? | 2 |
8,864,197 | 01/14/2012 18:03:42 | 249,819 | 01/13/2010 13:10:13 | 26 | 4 | How to add htaccess rewrite rule in Joomla | I use Joomla 1.5.22 and mod_rewrite with nice links. But I would like to add also a redirection like this:
RewriteRule ^mail /squirrelmail
So if Someone enters www.mypage.com/mail he will be redirected to www.mypage.com/squirrelmail
How to update Joomla .htaccess filein order this to work? For now if I use this Rule it shows Joomla 404 Error | .htaccess | mod-rewrite | joomla | joomla1.5 | null | null | open | How to add htaccess rewrite rule in Joomla
===
I use Joomla 1.5.22 and mod_rewrite with nice links. But I would like to add also a redirection like this:
RewriteRule ^mail /squirrelmail
So if Someone enters www.mypage.com/mail he will be redirected to www.mypage.com/squirrelmail
How to update Joomla .htaccess filein order this to work? For now if I use this Rule it shows Joomla 404 Error | 0 |
8,705,569 | 01/02/2012 21:33:30 | 18,480 | 09/19/2008 02:51:41 | 159 | 3 | How to install an INF file without DefaultInstall | How do I install an INF file that lacks a DefaultInstall section? | windows | installer | inf | null | null | 01/03/2012 08:25:51 | not a real question | How to install an INF file without DefaultInstall
===
How do I install an INF file that lacks a DefaultInstall section? | 1 |
2,463,521 | 03/17/2010 15:25:36 | 84,201 | 03/29/2009 07:46:24 | 4,294 | 71 | cross-browser text shadow.. | How to get cross-browser text shadow? including IE6, 7, 8.
is there any css or js solution?
I want to get text-shadow with semantic and valid markup. | css | jquery | javascript | xhtml | sifr | null | open | cross-browser text shadow..
===
How to get cross-browser text shadow? including IE6, 7, 8.
is there any css or js solution?
I want to get text-shadow with semantic and valid markup. | 0 |
6,695,915 | 07/14/2011 15:37:19 | 300,972 | 03/24/2010 16:09:37 | 734 | 43 | Zxing compiles for device fine, but fails in simulator | I have downloaded the latest zxing library via SVN, then integrated according to README file. I was able to integrate, compile and test on device. However, when compiling in the simulator I get:
Missing required architecture i386 in file
"_OBJC_CLASS_$_ZXingWidgetController", referenced from:
objc-class-ref-to-ZXingWidgetController in ScannerViewController.o
and
error: 'AVCaptureDevice' undeclared (first use in this function)
I have attempted to "weak" link (optional in Xcode 4) the AVFoundation library to fix the second error but no dice.
Anyone know why this would occur? A search seems to pull up the opposite problem, failing on device but succeeding in simulator. Very weird.
| ios | zxing | null | null | null | null | open | Zxing compiles for device fine, but fails in simulator
===
I have downloaded the latest zxing library via SVN, then integrated according to README file. I was able to integrate, compile and test on device. However, when compiling in the simulator I get:
Missing required architecture i386 in file
"_OBJC_CLASS_$_ZXingWidgetController", referenced from:
objc-class-ref-to-ZXingWidgetController in ScannerViewController.o
and
error: 'AVCaptureDevice' undeclared (first use in this function)
I have attempted to "weak" link (optional in Xcode 4) the AVFoundation library to fix the second error but no dice.
Anyone know why this would occur? A search seems to pull up the opposite problem, failing on device but succeeding in simulator. Very weird.
| 0 |
9,482,968 | 02/28/2012 13:40:52 | 1,154,030 | 01/17/2012 13:40:26 | 48 | 1 | What recommended machine learning libriries to use? | I used Mahout, it is great , but need something better that have more implemented algorithms and maybe faster | machine-learning | mahout | null | null | null | 04/26/2012 12:33:45 | not a real question | What recommended machine learning libriries to use?
===
I used Mahout, it is great , but need something better that have more implemented algorithms and maybe faster | 1 |
7,183,302 | 08/24/2011 22:56:27 | 441,082 | 04/09/2010 07:20:18 | 49 | 0 | Makefile: how to find out dependencies are no longer used in other rules | I have a somewhat complicated Makefile which runs perl scripts and other tools and generates some 1000 files. I would like to edit/modify some of those generated files after all files are generated. So I thought I can simply add a new rule to do so like this:
(phony new rule): $LIST_OF_FILES_TO_EDIT
file_modifier ...
however, the point here is some of those generated files which I'd like to edit (`$LIST_OF_FILES_TO_EDIT`) are used in the same make process to generate a long list of files. So I have to wait to make sure those files are no longer needed in the make process before I can go ahead and edit them. But I don't know how to do that. Not to mention that it is really hard to find out what files are generated by the help of `$LIST_OF_FILES_TO_EDIT`.
If it was possible to mention in the Makefile that this rule should be only run as the last rule, then my problem would be solved. but as far as I know this is not possible. So anyone has an idea?
Some points:
- List of files to edit ($LIST_OF_FILES_TO_EDIT) is determined dynamically (not known before make process)
- I am not sure I have picked a good title for this question. :) | makefile | null | null | null | null | null | open | Makefile: how to find out dependencies are no longer used in other rules
===
I have a somewhat complicated Makefile which runs perl scripts and other tools and generates some 1000 files. I would like to edit/modify some of those generated files after all files are generated. So I thought I can simply add a new rule to do so like this:
(phony new rule): $LIST_OF_FILES_TO_EDIT
file_modifier ...
however, the point here is some of those generated files which I'd like to edit (`$LIST_OF_FILES_TO_EDIT`) are used in the same make process to generate a long list of files. So I have to wait to make sure those files are no longer needed in the make process before I can go ahead and edit them. But I don't know how to do that. Not to mention that it is really hard to find out what files are generated by the help of `$LIST_OF_FILES_TO_EDIT`.
If it was possible to mention in the Makefile that this rule should be only run as the last rule, then my problem would be solved. but as far as I know this is not possible. So anyone has an idea?
Some points:
- List of files to edit ($LIST_OF_FILES_TO_EDIT) is determined dynamically (not known before make process)
- I am not sure I have picked a good title for this question. :) | 0 |
5,714,527 | 04/19/2011 09:49:59 | 714,949 | 04/19/2011 09:49:59 | 1 | 0 | why my video cannot come out? | **this is LatestVideo.java**
package com.android.imammuda;
import android.app.Activity;
import android.content.Context;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnBufferingUpdateListener;
import android.media.MediaPlayer.OnCompletionListener;
import android.media.MediaPlayer.OnPreparedListener;
import android.media.MediaPlayer.OnVideoSizeChangedListener;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
public class LatestVideo extends Activity implements
OnBufferingUpdateListener, OnCompletionListener,
OnPreparedListener, OnVideoSizeChangedListener, SurfaceHolder.Callback{
private static final String TAG = "ImamMuda";
private int mVideoWidth;
private int mVideoHeight;
private MediaPlayer mMediaPlayer;
private SurfaceView mPreview;
private SurfaceHolder holder;
private Uri path;
private Bundle extras;
private static final String MEDIA = "MEDIA";
private static final int LOCAL_VIDEO = 1;
private boolean mIsVideoSizeKnown = false;
private boolean mIsVideoReadyToBePlayed = false;
private Context context;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.latestvideo);
mPreview = (SurfaceView) findViewById(R.id.surface);
holder = mPreview.getHolder();
holder.addCallback(this);
holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
extras = getIntent().getExtras();
}
private void playVideo(Integer Media) {
doCleanUp();
path = Uri.parse("android.resource://com.android.imammuda/" + R.raw.video1);
try {
if(Media == LOCAL_VIDEO) {
mMediaPlayer = new MediaPlayer();
mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
mMediaPlayer.setDataSource(context, path);
mMediaPlayer.setDisplay(holder);
mMediaPlayer.prepare();
mMediaPlayer.start();
mMediaPlayer.setOnBufferingUpdateListener(this);
mMediaPlayer.setOnCompletionListener(this);
mMediaPlayer.setOnPreparedListener(this);
mMediaPlayer.setOnVideoSizeChangedListener(this);
}
} catch (Exception e) {
Log.e(TAG, "error: " + e.getMessage(), e);
}
}
public void onBufferingUpdate(MediaPlayer arg0, int percent) {
Log.d(TAG, "onBufferingUpdate percent:" + percent);
}
public void onCompletion(MediaPlayer arg0) {
Log.d(TAG, "onCompletion called");
}
public void onVideoSizeChanged(MediaPlayer mp, int width, int height) {
Log.v(TAG, "onVideoSizeChanged called");
if (width == 0 || height == 0) {
Log.e(TAG, "invalid video width(" + width + ") or height(" + height + ")");
return;
}
mIsVideoSizeKnown = true;
mVideoWidth = width;
mVideoHeight = height;
if (mIsVideoReadyToBePlayed && mIsVideoSizeKnown) {
startVideoPlayback();
}
}
public void onPrepared(MediaPlayer mediaplayer) {
Log.d(TAG, "onPrepared called");
mIsVideoReadyToBePlayed = true;
if (mIsVideoReadyToBePlayed && mIsVideoSizeKnown) {
startVideoPlayback();
}
}
public void surfaceChanged(SurfaceHolder surfaceholder, int i, int j, int k) {
Log.d(TAG, "surfaceChanged called");
}
public void surfaceDestroyed(SurfaceHolder surfaceholder) {
Log.d(TAG, "surfaceDestroyed called");
}
public void surfaceCreated(SurfaceHolder holder) {
Log.d(TAG, "surfaceCreated called");
playVideo(extras.getInt(MEDIA));
}
@Override
protected void onPause() {
super.onPause();
releaseMediaPlayer();
doCleanUp();
}
@Override
protected void onDestroy() {
super.onDestroy();
releaseMediaPlayer();
doCleanUp();
}
private void releaseMediaPlayer() {
if (mMediaPlayer != null) {
mMediaPlayer.release();
mMediaPlayer = null;
}
}
private void doCleanUp() {
mVideoWidth = 0;
mVideoHeight = 0;
mIsVideoReadyToBePlayed = false;
mIsVideoSizeKnown = false;
}
private void startVideoPlayback() {
Log.v(TAG, "startVideoPlayback");
holder.setFixedSize(mVideoWidth, mVideoHeight);
mMediaPlayer.start();
}
}
**this is main**
package com.android.imammuda;
import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;
public class ImamMuda extends TabActivity {
private static final String MEDIA = "MEDIA";
private static final int LOCAL_VIDEO = 1;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Resources res = getResources();
TabHost tabHost = getTabHost();
TabHost .TabSpec spec;
Intent intent;
//program tab
intent = new Intent().setClass(this, Program.class);
spec = tabHost.newTabSpec("Program").setIndicator("", res.getDrawable(R.drawable.program_icon)).setContent(intent);
tabHost.addTab(spec);
//candidate
intent = new Intent().setClass(this, Candidate.class);
spec = tabHost.newTabSpec("Candidate").setIndicator("", res.getDrawable(R.drawable.candidate_icon)).setContent(intent);
tabHost.addTab(spec);
//video
intent = new Intent().setClass(this, LatestVideo.class);
intent.putExtra(MEDIA, LOCAL_VIDEO);
spec = tabHost.newTabSpec("Video").setIndicator("", res.getDrawable(R.drawable.video_icon)).setContent(intent);
tabHost.addTab(spec);
//result
intent = new Intent().setClass(this, Result.class);
spec = tabHost.newTabSpec("Result").setIndicator("", res.getDrawable(R.drawable.result_icon)).setContent(intent);
tabHost.addTab(spec);
//comment
intent = new Intent().setClass(this, Comment.class);
spec = tabHost.newTabSpec("Comment").setIndicator(null, res.getDrawable(R.drawable.comment_icon)).setContent(intent);
tabHost.addTab(spec);
tabHost.setCurrentTab(5);
}
}
**this is latestvideo.xml**
<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/relativeLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/menu_background">
<SurfaceView
android:id="@+id/surface"
android:layout_centerHorizontal="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/menu_background">
</SurfaceView>
</RelativeLayout>
the video format is video1.3gp and put in raw folder | java | android | xml | null | null | 04/25/2011 12:44:13 | not a real question | why my video cannot come out?
===
**this is LatestVideo.java**
package com.android.imammuda;
import android.app.Activity;
import android.content.Context;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnBufferingUpdateListener;
import android.media.MediaPlayer.OnCompletionListener;
import android.media.MediaPlayer.OnPreparedListener;
import android.media.MediaPlayer.OnVideoSizeChangedListener;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
public class LatestVideo extends Activity implements
OnBufferingUpdateListener, OnCompletionListener,
OnPreparedListener, OnVideoSizeChangedListener, SurfaceHolder.Callback{
private static final String TAG = "ImamMuda";
private int mVideoWidth;
private int mVideoHeight;
private MediaPlayer mMediaPlayer;
private SurfaceView mPreview;
private SurfaceHolder holder;
private Uri path;
private Bundle extras;
private static final String MEDIA = "MEDIA";
private static final int LOCAL_VIDEO = 1;
private boolean mIsVideoSizeKnown = false;
private boolean mIsVideoReadyToBePlayed = false;
private Context context;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.latestvideo);
mPreview = (SurfaceView) findViewById(R.id.surface);
holder = mPreview.getHolder();
holder.addCallback(this);
holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
extras = getIntent().getExtras();
}
private void playVideo(Integer Media) {
doCleanUp();
path = Uri.parse("android.resource://com.android.imammuda/" + R.raw.video1);
try {
if(Media == LOCAL_VIDEO) {
mMediaPlayer = new MediaPlayer();
mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
mMediaPlayer.setDataSource(context, path);
mMediaPlayer.setDisplay(holder);
mMediaPlayer.prepare();
mMediaPlayer.start();
mMediaPlayer.setOnBufferingUpdateListener(this);
mMediaPlayer.setOnCompletionListener(this);
mMediaPlayer.setOnPreparedListener(this);
mMediaPlayer.setOnVideoSizeChangedListener(this);
}
} catch (Exception e) {
Log.e(TAG, "error: " + e.getMessage(), e);
}
}
public void onBufferingUpdate(MediaPlayer arg0, int percent) {
Log.d(TAG, "onBufferingUpdate percent:" + percent);
}
public void onCompletion(MediaPlayer arg0) {
Log.d(TAG, "onCompletion called");
}
public void onVideoSizeChanged(MediaPlayer mp, int width, int height) {
Log.v(TAG, "onVideoSizeChanged called");
if (width == 0 || height == 0) {
Log.e(TAG, "invalid video width(" + width + ") or height(" + height + ")");
return;
}
mIsVideoSizeKnown = true;
mVideoWidth = width;
mVideoHeight = height;
if (mIsVideoReadyToBePlayed && mIsVideoSizeKnown) {
startVideoPlayback();
}
}
public void onPrepared(MediaPlayer mediaplayer) {
Log.d(TAG, "onPrepared called");
mIsVideoReadyToBePlayed = true;
if (mIsVideoReadyToBePlayed && mIsVideoSizeKnown) {
startVideoPlayback();
}
}
public void surfaceChanged(SurfaceHolder surfaceholder, int i, int j, int k) {
Log.d(TAG, "surfaceChanged called");
}
public void surfaceDestroyed(SurfaceHolder surfaceholder) {
Log.d(TAG, "surfaceDestroyed called");
}
public void surfaceCreated(SurfaceHolder holder) {
Log.d(TAG, "surfaceCreated called");
playVideo(extras.getInt(MEDIA));
}
@Override
protected void onPause() {
super.onPause();
releaseMediaPlayer();
doCleanUp();
}
@Override
protected void onDestroy() {
super.onDestroy();
releaseMediaPlayer();
doCleanUp();
}
private void releaseMediaPlayer() {
if (mMediaPlayer != null) {
mMediaPlayer.release();
mMediaPlayer = null;
}
}
private void doCleanUp() {
mVideoWidth = 0;
mVideoHeight = 0;
mIsVideoReadyToBePlayed = false;
mIsVideoSizeKnown = false;
}
private void startVideoPlayback() {
Log.v(TAG, "startVideoPlayback");
holder.setFixedSize(mVideoWidth, mVideoHeight);
mMediaPlayer.start();
}
}
**this is main**
package com.android.imammuda;
import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;
public class ImamMuda extends TabActivity {
private static final String MEDIA = "MEDIA";
private static final int LOCAL_VIDEO = 1;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Resources res = getResources();
TabHost tabHost = getTabHost();
TabHost .TabSpec spec;
Intent intent;
//program tab
intent = new Intent().setClass(this, Program.class);
spec = tabHost.newTabSpec("Program").setIndicator("", res.getDrawable(R.drawable.program_icon)).setContent(intent);
tabHost.addTab(spec);
//candidate
intent = new Intent().setClass(this, Candidate.class);
spec = tabHost.newTabSpec("Candidate").setIndicator("", res.getDrawable(R.drawable.candidate_icon)).setContent(intent);
tabHost.addTab(spec);
//video
intent = new Intent().setClass(this, LatestVideo.class);
intent.putExtra(MEDIA, LOCAL_VIDEO);
spec = tabHost.newTabSpec("Video").setIndicator("", res.getDrawable(R.drawable.video_icon)).setContent(intent);
tabHost.addTab(spec);
//result
intent = new Intent().setClass(this, Result.class);
spec = tabHost.newTabSpec("Result").setIndicator("", res.getDrawable(R.drawable.result_icon)).setContent(intent);
tabHost.addTab(spec);
//comment
intent = new Intent().setClass(this, Comment.class);
spec = tabHost.newTabSpec("Comment").setIndicator(null, res.getDrawable(R.drawable.comment_icon)).setContent(intent);
tabHost.addTab(spec);
tabHost.setCurrentTab(5);
}
}
**this is latestvideo.xml**
<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/relativeLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/menu_background">
<SurfaceView
android:id="@+id/surface"
android:layout_centerHorizontal="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/menu_background">
</SurfaceView>
</RelativeLayout>
the video format is video1.3gp and put in raw folder | 1 |
8,327,811 | 11/30/2011 14:52:05 | 996,807 | 10/15/2011 11:52:14 | 23 | 0 | Javascript for dropdown menu | I am trying to copy the dropdown menu (the one with red background) of this site: http://bloggerstore-javatemplates.blogspot.com/ to my blog. I *think* I have copied the css codes but I am not sure how to get the javascript codes. Could you please see what I can do to make the dropdown to my website @ http://allfacebookgames.blogspot.com/2011/11/mafia-wars-2.html. Also, I am getting a black dot beside the menu and I am not sure why is it there. Any help?
| javascript | html | css | blogs | blogger | 12/01/2011 04:13:01 | not a real question | Javascript for dropdown menu
===
I am trying to copy the dropdown menu (the one with red background) of this site: http://bloggerstore-javatemplates.blogspot.com/ to my blog. I *think* I have copied the css codes but I am not sure how to get the javascript codes. Could you please see what I can do to make the dropdown to my website @ http://allfacebookgames.blogspot.com/2011/11/mafia-wars-2.html. Also, I am getting a black dot beside the menu and I am not sure why is it there. Any help?
| 1 |
9,884,239 | 03/27/2012 06:14:05 | 1,253,909 | 03/07/2012 05:54:47 | 1 | 0 | Richfaces FecesContext not found exception | org.apache.jasper.JasperException: java.lang.RuntimeException: Cannot find FacesContext
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:416)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
| richfaces | null | null | null | null | 03/27/2012 13:05:30 | not a real question | Richfaces FecesContext not found exception
===
org.apache.jasper.JasperException: java.lang.RuntimeException: Cannot find FacesContext
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:416)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
| 1 |
7,472,582 | 09/19/2011 14:33:28 | 243,354 | 01/04/2010 17:49:17 | 100 | 8 | Reloading a JSONP request with different params in sencha touch | I have taken code from GeoTweets tutorial from Sencha Touch learning center and it's working great. I got to a point where I want a form with a Submit button which sends new request to the JSON server with changed parameters. Can anyone please guide me towards the right direction, searched for a bit on google but couldn't find anything that works with Sencha Touch.
Here is the code for the request I am making:
Ext.util.JSONP.request({
url: 'http://myserver/testdetails.php',
callbackKey: 'callback',
params: {
q: "bored",
rpp: 30,
uniqueify: Math.random()
},
callback: function(data) {
console.log(data.results);
var tweet_list = data;
timeline.update(tweet_list); // Update the tweets in timeline
}
});
};
All I want to do is reload the JSONP with new parameters. | json | sencha-touch | jsonp | null | null | null | open | Reloading a JSONP request with different params in sencha touch
===
I have taken code from GeoTweets tutorial from Sencha Touch learning center and it's working great. I got to a point where I want a form with a Submit button which sends new request to the JSON server with changed parameters. Can anyone please guide me towards the right direction, searched for a bit on google but couldn't find anything that works with Sencha Touch.
Here is the code for the request I am making:
Ext.util.JSONP.request({
url: 'http://myserver/testdetails.php',
callbackKey: 'callback',
params: {
q: "bored",
rpp: 30,
uniqueify: Math.random()
},
callback: function(data) {
console.log(data.results);
var tweet_list = data;
timeline.update(tweet_list); // Update the tweets in timeline
}
});
};
All I want to do is reload the JSONP with new parameters. | 0 |
157,697 | 10/01/2008 13:52:38 | 21,045 | 09/23/2008 11:19:08 | 53 | 6 | Best UI development framework on windows? | I have been developing UI in Win32/MFC, but developing cool UI in Win32/MFC is very difficult and time consuming. Please note, I always want my code to be platform independent, So I prefer programming back-end (Business logic) in C++.
Which is the best framework for developing cool UI on windows platform? I heard of quite a few, like QT, Flex, Delphi. What is your thoughts (Pros and Cons) on these UI development frameworks. Which one do you recommend ?
| user-interface | winapi | mfc | c++ | qt | 09/15/2011 22:11:59 | not constructive | Best UI development framework on windows?
===
I have been developing UI in Win32/MFC, but developing cool UI in Win32/MFC is very difficult and time consuming. Please note, I always want my code to be platform independent, So I prefer programming back-end (Business logic) in C++.
Which is the best framework for developing cool UI on windows platform? I heard of quite a few, like QT, Flex, Delphi. What is your thoughts (Pros and Cons) on these UI development frameworks. Which one do you recommend ?
| 4 |
6,166,069 | 05/29/2011 05:08:28 | 266,711 | 02/05/2010 01:43:25 | 49 | 1 | how difficult would it be for a non-webgeek to set up and host a stack clone? | I'm really interested in getting a stack exchange-type site up and running for economics, since the project over at Area51 has been stalled for over a year and doesn't seem to be approaching critical mass. Some of the prepackaged solutions, like [osqa][1] and [question2answer][2] boast really simple setup, but I don't have any experience with apache, mysql, php or anything of the sort.
How hard do you think it'd be for the average computer-savvy non-webmaster to get something like this up and running, and how much work would it take to maintain?
[1]: http://www.osqa.net/
[2]: http://www.question2answer.org/ | php | mysql | apache | null | null | 05/29/2011 05:29:53 | off topic | how difficult would it be for a non-webgeek to set up and host a stack clone?
===
I'm really interested in getting a stack exchange-type site up and running for economics, since the project over at Area51 has been stalled for over a year and doesn't seem to be approaching critical mass. Some of the prepackaged solutions, like [osqa][1] and [question2answer][2] boast really simple setup, but I don't have any experience with apache, mysql, php or anything of the sort.
How hard do you think it'd be for the average computer-savvy non-webmaster to get something like this up and running, and how much work would it take to maintain?
[1]: http://www.osqa.net/
[2]: http://www.question2answer.org/ | 2 |
1,678,284 | 11/05/2009 04:08:16 | 199,183 | 10/29/2009 19:29:29 | 6 | 0 | How to test Nhibernate with Nunit? | Sorry for the repost.
I'm using Nhibernate for ORM and have this class I need to perform unit tests using Nunit:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate;
using NHibernate.Cfg;
using NutritionLibrary.Entity;
using System.Data;
using System.Data.SqlClient;
using System.Collections;
namespace NutritionLibrary.DAO
{
public class IngredientDAONHibernate : NutritionLibrary.DAO.IngredientDAO
{
private Configuration config;
private ISessionFactory factory;
public IngredientDAONHibernate()
{
config = new Configuration();
config.AddClass(typeof(NutritionLibrary.Entity.Ingredient));
config.AddClass(typeof(Entity.Nutrient));
config.AddClass(typeof(Entity.NutrientIngredient));
factory = config.BuildSessionFactory();
}
/// <summary>
/// gets the list of ingredients from the db
/// </summary>
/// <returns>IList of ingredients</returns>
public System.Collections.Generic.IList<Ingredient> GetIngredientList()
{
System.Collections.Generic.IList<Ingredient> ingredients;
string hql = "from NutritionLibrary.Entity.Ingredient ingredient";
ISession session = null;
ITransaction tx = null;
try
{
session = factory.OpenSession();
tx = session.BeginTransaction();
IQuery q = session.CreateQuery(hql);
ingredients = q.List<Ingredient>();
tx.Commit();
}
catch (Exception e)
{
if (tx != null) tx.Rollback();
/*if (logger.IsErrorEnabled)
{
logger.Error("EXCEPTION OCCURRED", e);
}*/
ingredients = null;
}
finally
{
session.Close();
session = null;
tx = null;
}
return ingredients;
}
}
}
I started with the constructor, but I got a few people advising me its not really necessary. So this is my method that I need to test. It queries the db and gives me a List of ingredient objects. I am having difficulty getting started with how to test the getIngredientList() method. I have this test stub:
[TestMethod()]
public void GetIngredientListTest()
{
IngredientDAONHibernate target = new IngredientDAONHibernate(); // TODO: Initialize to an appropriate value
IList<Ingredient> expected = null; // TODO: Initialize to an appropriate value
IList<Ingredient> actual;
actual = target.GetIngredientList();
Assert.AreEqual(expected, actual);
}
I have a lot of other similar methods that I have to test, so if someone could be kind enough to help me get started with this, I will have a basic idea of how to implement unit tests on my other methods.
Once again, thank you for your time and advise. | nhibernate | c# | nunit | unit-testing | null | null | open | How to test Nhibernate with Nunit?
===
Sorry for the repost.
I'm using Nhibernate for ORM and have this class I need to perform unit tests using Nunit:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate;
using NHibernate.Cfg;
using NutritionLibrary.Entity;
using System.Data;
using System.Data.SqlClient;
using System.Collections;
namespace NutritionLibrary.DAO
{
public class IngredientDAONHibernate : NutritionLibrary.DAO.IngredientDAO
{
private Configuration config;
private ISessionFactory factory;
public IngredientDAONHibernate()
{
config = new Configuration();
config.AddClass(typeof(NutritionLibrary.Entity.Ingredient));
config.AddClass(typeof(Entity.Nutrient));
config.AddClass(typeof(Entity.NutrientIngredient));
factory = config.BuildSessionFactory();
}
/// <summary>
/// gets the list of ingredients from the db
/// </summary>
/// <returns>IList of ingredients</returns>
public System.Collections.Generic.IList<Ingredient> GetIngredientList()
{
System.Collections.Generic.IList<Ingredient> ingredients;
string hql = "from NutritionLibrary.Entity.Ingredient ingredient";
ISession session = null;
ITransaction tx = null;
try
{
session = factory.OpenSession();
tx = session.BeginTransaction();
IQuery q = session.CreateQuery(hql);
ingredients = q.List<Ingredient>();
tx.Commit();
}
catch (Exception e)
{
if (tx != null) tx.Rollback();
/*if (logger.IsErrorEnabled)
{
logger.Error("EXCEPTION OCCURRED", e);
}*/
ingredients = null;
}
finally
{
session.Close();
session = null;
tx = null;
}
return ingredients;
}
}
}
I started with the constructor, but I got a few people advising me its not really necessary. So this is my method that I need to test. It queries the db and gives me a List of ingredient objects. I am having difficulty getting started with how to test the getIngredientList() method. I have this test stub:
[TestMethod()]
public void GetIngredientListTest()
{
IngredientDAONHibernate target = new IngredientDAONHibernate(); // TODO: Initialize to an appropriate value
IList<Ingredient> expected = null; // TODO: Initialize to an appropriate value
IList<Ingredient> actual;
actual = target.GetIngredientList();
Assert.AreEqual(expected, actual);
}
I have a lot of other similar methods that I have to test, so if someone could be kind enough to help me get started with this, I will have a basic idea of how to implement unit tests on my other methods.
Once again, thank you for your time and advise. | 0 |
10,579,592 | 05/14/2012 08:09:45 | 1,183,972 | 02/01/2012 23:50:09 | 55 | 4 | Nokia 5800 Messages folder wiped out | my phone has just deleted all the messages i had, so i am trying to recover the data from the SD to restore it.
I can't find any file which seems to me the right one and wouldn't like to get this situation worse.
My phone is a S60 Nokia 5800 (Symbian). Anyone knows which are exactly (or more o less) the folders/files i should be looking for to restore?
Thanks a lot. | backup | symbian | nokia | s60 | cellphone | 05/15/2012 11:46:10 | off topic | Nokia 5800 Messages folder wiped out
===
my phone has just deleted all the messages i had, so i am trying to recover the data from the SD to restore it.
I can't find any file which seems to me the right one and wouldn't like to get this situation worse.
My phone is a S60 Nokia 5800 (Symbian). Anyone knows which are exactly (or more o less) the folders/files i should be looking for to restore?
Thanks a lot. | 2 |
9,345,543 | 02/19/2012 00:29:45 | 1,200,107 | 02/09/2012 16:15:22 | 1 | 0 | Legal issue: (encrypted) copyrighted ebooks on server | I was wondering whether it's legal to have copyrighted ebooks (which I bought) in my MySQL database - behind a login system - to access them everywhere in the world. If not, is it legal to have encrypted versions in my database?
| mysql | legal | copyright | ebook | null | 02/19/2012 00:42:39 | off topic | Legal issue: (encrypted) copyrighted ebooks on server
===
I was wondering whether it's legal to have copyrighted ebooks (which I bought) in my MySQL database - behind a login system - to access them everywhere in the world. If not, is it legal to have encrypted versions in my database?
| 2 |
7,723,517 | 10/11/2011 08:52:40 | 765,775 | 05/23/2011 09:53:49 | 1 | 1 | How to turn on android mobile network | How to turn on android mobile network in program,like HTC desire's netwrok widget! | android | mobile | null | null | null | 10/11/2011 12:54:51 | not a real question | How to turn on android mobile network
===
How to turn on android mobile network in program,like HTC desire's netwrok widget! | 1 |
1,749,424 | 11/17/2009 14:57:22 | 98,361 | 04/30/2009 08:41:07 | 188 | 2 | Pros and cons of MIT Scheme and DrScheme to study SICP? | All,
In your mind, what are the pros and cons of using MIT Scheme versus DrScheme, in the context of trying to go through SICP (presumably simultaneously to watching some / all the MIT 6.001 videos)?
Please feel free to edit below:
MIT Scheme pros:
- Specifically built for SICP and MIT 6.001.
MIT Scheme cons:
DrScheme pros:
- Wider-spread usage, more active community.
DrScheme Cons: | scheme | sicp | drscheme | null | null | 07/02/2012 15:21:58 | not constructive | Pros and cons of MIT Scheme and DrScheme to study SICP?
===
All,
In your mind, what are the pros and cons of using MIT Scheme versus DrScheme, in the context of trying to go through SICP (presumably simultaneously to watching some / all the MIT 6.001 videos)?
Please feel free to edit below:
MIT Scheme pros:
- Specifically built for SICP and MIT 6.001.
MIT Scheme cons:
DrScheme pros:
- Wider-spread usage, more active community.
DrScheme Cons: | 4 |
6,975,021 | 08/07/2011 18:59:33 | 622,096 | 02/17/2011 20:40:01 | 137 | 3 | Validating number using javascript | I have a 3 textboxes on a page quantity, price and total . When the quantity and price are entered by the user the total is being calculated directly by using javascript.
Below is the code:
function quantity(textvalue) {
var qty = textvalue.value;
var price = document.getElementById('<%=Price.ClientID %>').value;
var Total = Math.round(qty * price * 100) / 100;
document.getElementById('<%=Total.ClientID %>').value = Total;
}
function Price(textvalue) {
var price = textvalue.value;
var qty = document.getElementById('<%=Quantity.ClientID %>').value;
var Total = Math.round(qty * price * 100) / 100;
document.getElementById('<%=Total.ClientID %>').value = Total;
}
<asp:TextBox ID="Quantity" runat="server" onchange="javascript: quantity(this);" CausesValidation="True"></asp:TextBox>
<asp:TextBox ID="Price" runat="server" onchange="javascript: Price(this);" ></asp:TextBox>
<asp:TextBox ID="txtLineItemTotal" runat="server" Width="120px" MaxLength="14" ReadOnly="true"
BackColor="Silver" BorderWidth="2px" style="font-weight: 700">0.00</asp:TextBox>
I also need to validate the value calculated in the total textbox and it should not exceed 100000000000.00.
I am using the below function to achieve this
function TotalChanged() {
var lineitemtotal = document.getElementById('<%=Total.ClientID %>').value;
alert("entered function");
if (lineitemtotal >= 100000000000.00) {
alert("Total cannot exceed 100000000000.00,please re-enter");
}
else
return false;
}
And on Page Load
txtLineItemTotal.Attributes.Add("onchange", "{return LineItemTotalChanged()};");
But it is not entering the function, please let me know what am I missing...or if I am using the wrong event...trying it for the past 1 day....:( | javascript | asp.net | null | null | null | null | open | Validating number using javascript
===
I have a 3 textboxes on a page quantity, price and total . When the quantity and price are entered by the user the total is being calculated directly by using javascript.
Below is the code:
function quantity(textvalue) {
var qty = textvalue.value;
var price = document.getElementById('<%=Price.ClientID %>').value;
var Total = Math.round(qty * price * 100) / 100;
document.getElementById('<%=Total.ClientID %>').value = Total;
}
function Price(textvalue) {
var price = textvalue.value;
var qty = document.getElementById('<%=Quantity.ClientID %>').value;
var Total = Math.round(qty * price * 100) / 100;
document.getElementById('<%=Total.ClientID %>').value = Total;
}
<asp:TextBox ID="Quantity" runat="server" onchange="javascript: quantity(this);" CausesValidation="True"></asp:TextBox>
<asp:TextBox ID="Price" runat="server" onchange="javascript: Price(this);" ></asp:TextBox>
<asp:TextBox ID="txtLineItemTotal" runat="server" Width="120px" MaxLength="14" ReadOnly="true"
BackColor="Silver" BorderWidth="2px" style="font-weight: 700">0.00</asp:TextBox>
I also need to validate the value calculated in the total textbox and it should not exceed 100000000000.00.
I am using the below function to achieve this
function TotalChanged() {
var lineitemtotal = document.getElementById('<%=Total.ClientID %>').value;
alert("entered function");
if (lineitemtotal >= 100000000000.00) {
alert("Total cannot exceed 100000000000.00,please re-enter");
}
else
return false;
}
And on Page Load
txtLineItemTotal.Attributes.Add("onchange", "{return LineItemTotalChanged()};");
But it is not entering the function, please let me know what am I missing...or if I am using the wrong event...trying it for the past 1 day....:( | 0 |
4,416,387 | 12/11/2010 11:00:33 | 1,162,063 | 12/07/2010 10:47:49 | 3 | 1 | TWITTER COMMENT BOX | am beginner for php...
i want to create a comment box on twiter.. if i write anything in that comment box that will be updated on twitter...how should i do... any one can tell where do i get the source code...
thanking you in advance..
regards
GOWTHAM | php | javascript | jquery | html | twitter | 01/22/2012 14:24:12 | not a real question | TWITTER COMMENT BOX
===
am beginner for php...
i want to create a comment box on twiter.. if i write anything in that comment box that will be updated on twitter...how should i do... any one can tell where do i get the source code...
thanking you in advance..
regards
GOWTHAM | 1 |
25,950 | 08/25/2008 12:34:21 | 1,693 | 08/18/2008 02:25:37 | 588 | 28 | Ruby Performance | I'm pretty keen to develop my first Ruby app, as my company has finally blessed its use internally.
In everything I've read about Ruby up to v1.8, there is never anything positive said about performance, but I've found nothing about version 1.9. The last figures I saw about 1.8 had it drastically slower than just about everything out there, so I'm hoping this was addressed in 1.9.
Has performance drastically improved? Are there some concrete things that can be done with Ruby apps (or things to avoid) to keep performance at the best possible level? | ruby | performance | null | null | null | null | open | Ruby Performance
===
I'm pretty keen to develop my first Ruby app, as my company has finally blessed its use internally.
In everything I've read about Ruby up to v1.8, there is never anything positive said about performance, but I've found nothing about version 1.9. The last figures I saw about 1.8 had it drastically slower than just about everything out there, so I'm hoping this was addressed in 1.9.
Has performance drastically improved? Are there some concrete things that can be done with Ruby apps (or things to avoid) to keep performance at the best possible level? | 0 |
8,786,788 | 01/09/2012 10:11:45 | 111,307 | 05/22/2009 21:08:48 | 5,749 | 170 | No longer able to max CPU | I've been programming normally using an AMD 1100 6 core chip. Previously (using the __same__ code) I was able to max out all CPU's (6 threads)
Now, _the same code_ is doing this (still 6 threads):
![low cpu usage][1]
Before, I was able to get them right to 100% (all 6 cores would go straight up and draw straight lines right across the top. Now I can't seem to figure why the application isn't maxing out the CPU cores, even though there are 6 parallel threads, and the same code used to max out the CPU just a day ago.
I'm running no extra processes, and am doing nothing generally different.
I'm running an extra fan on the CPU as well, and the CPU fan remains calm (which indicates it's not overheating).
[1]: http://i.stack.imgur.com/UqTd6.png | c++ | windows-7 | parallel-processing | null | null | 01/12/2012 04:02:54 | not a real question | No longer able to max CPU
===
I've been programming normally using an AMD 1100 6 core chip. Previously (using the __same__ code) I was able to max out all CPU's (6 threads)
Now, _the same code_ is doing this (still 6 threads):
![low cpu usage][1]
Before, I was able to get them right to 100% (all 6 cores would go straight up and draw straight lines right across the top. Now I can't seem to figure why the application isn't maxing out the CPU cores, even though there are 6 parallel threads, and the same code used to max out the CPU just a day ago.
I'm running no extra processes, and am doing nothing generally different.
I'm running an extra fan on the CPU as well, and the CPU fan remains calm (which indicates it's not overheating).
[1]: http://i.stack.imgur.com/UqTd6.png | 1 |
8,820,014 | 01/11/2012 13:23:48 | 209,706 | 11/12/2009 15:30:53 | 2,230 | 98 | SWT: quick way of finding out whether a shell has child shells | I could iterate over all shells reported by `display.getShells()` and check their parents. Is there an alternative to find out whether a shell has child shells (or get all child shells)? | swt | null | null | null | null | null | open | SWT: quick way of finding out whether a shell has child shells
===
I could iterate over all shells reported by `display.getShells()` and check their parents. Is there an alternative to find out whether a shell has child shells (or get all child shells)? | 0 |
8,036,972 | 11/07/2011 13:13:30 | 1,033,787 | 11/07/2011 13:08:23 | 1 | 0 | Facebook App not appearing in search results | I've created a new facebook application at developer.facebook.com with following details:
Canvas Page:
http://apps.facebook.com/utvtribe
However, this app is not appearing in search results, if i am trying to search in under search textbox at facebook, what can be the reason?
Please guide me,
Thanks,
Kul.
| application | facebook-php-sdk | facebook-iframe | facebook-social-plugins | null | 11/07/2011 15:11:17 | off topic | Facebook App not appearing in search results
===
I've created a new facebook application at developer.facebook.com with following details:
Canvas Page:
http://apps.facebook.com/utvtribe
However, this app is not appearing in search results, if i am trying to search in under search textbox at facebook, what can be the reason?
Please guide me,
Thanks,
Kul.
| 2 |
8,059,818 | 11/09/2011 02:55:38 | 80,857 | 03/21/2009 12:59:22 | 315 | 10 | JavaScript error says "confirm is not a function" | I'm using jQuery with the validation plugin when I submit a form:
$('.frmProject:visible').validate( {
errorContainer: ".site_details:visible .messageBox1",
errorLabelContainer: ".site_details:visible .messageBox1 span.messagehere",
invalidHandler: function(form, validator) {
},
rules: {
site_id: {
required: true,
}
},
messages: {
site_id: "Project has no assigned site information. Click the marker on the map at left to specify the site where this project took place."
},
submitHandler: function(data) {
SaveProject();
}
});
In the submitHandler,
function SaveProject(){
//... load variables with input contents
$.ajax({
url: 'ajax/save_project.php',
dataType: 'json',
data: 'id='+id+'&title='+title+'&project='+project+'§or='+sector+'&volunteer='+volunteer+'&lat='+lat+'&lng='+lng+'&name='+name+'&mun='+mun+'&prov='+prov,
success: function(data) {
//... load 'messages' object with stuff
$.each(messages, function(key, value) {
if (confirm(key)){
console.log(item);
}
});
}
});
}
When I submit the validated form and it gets to the confirm inside the each loop, I get the error message: "confirm is not a function".
How can I present a message to the user for confirmation? | jquery | jquery-ui | validation | jquery-ajax | jquery-plugins | null | open | JavaScript error says "confirm is not a function"
===
I'm using jQuery with the validation plugin when I submit a form:
$('.frmProject:visible').validate( {
errorContainer: ".site_details:visible .messageBox1",
errorLabelContainer: ".site_details:visible .messageBox1 span.messagehere",
invalidHandler: function(form, validator) {
},
rules: {
site_id: {
required: true,
}
},
messages: {
site_id: "Project has no assigned site information. Click the marker on the map at left to specify the site where this project took place."
},
submitHandler: function(data) {
SaveProject();
}
});
In the submitHandler,
function SaveProject(){
//... load variables with input contents
$.ajax({
url: 'ajax/save_project.php',
dataType: 'json',
data: 'id='+id+'&title='+title+'&project='+project+'§or='+sector+'&volunteer='+volunteer+'&lat='+lat+'&lng='+lng+'&name='+name+'&mun='+mun+'&prov='+prov,
success: function(data) {
//... load 'messages' object with stuff
$.each(messages, function(key, value) {
if (confirm(key)){
console.log(item);
}
});
}
});
}
When I submit the validated form and it gets to the confirm inside the each loop, I get the error message: "confirm is not a function".
How can I present a message to the user for confirmation? | 0 |
5,495,749 | 03/31/2011 05:45:18 | 504,099 | 11/11/2010 05:36:06 | 207 | 5 | ho to switch from one screen to another in black berry RIM developement | I am developing a black berry application I have to switch from one screen to an other from category screen to detail ,when I press the button ,but I dnt know how to switch from one screen to antoher any help plz
| blackberry | null | null | null | null | null | open | ho to switch from one screen to another in black berry RIM developement
===
I am developing a black berry application I have to switch from one screen to an other from category screen to detail ,when I press the button ,but I dnt know how to switch from one screen to antoher any help plz
| 0 |
11,416,672 | 07/10/2012 15:24:49 | 1,512,307 | 07/09/2012 14:46:26 | 1 | 0 | Android Error:Failed to install *.apk on device *: timeout No Check on the Target | I getting the error when I try to debug any program on my android device
>>Failed to install *.apk on device *: timeout
I have tried restarting, and extending the timeout in the DDMS
When I have to select a device there is an red X in the target field next to the numbers
I'm new to android development and I would appreciate any help | android | timeout | apk | null | null | null | open | Android Error:Failed to install *.apk on device *: timeout No Check on the Target
===
I getting the error when I try to debug any program on my android device
>>Failed to install *.apk on device *: timeout
I have tried restarting, and extending the timeout in the DDMS
When I have to select a device there is an red X in the target field next to the numbers
I'm new to android development and I would appreciate any help | 0 |
5,362,158 | 03/19/2011 12:48:29 | 641,990 | 03/02/2011 21:38:00 | 1 | 0 | how to display array items whthout knwoing its number? | how to display an array content without using a while loop? coz I don't know how items are within, and without using the function print_r() that displays items with a specific way: array([0]=>..)
I want to display items one by one, exemple: PHP - Ajax - JSON - DOM, u got it?
How to achieve that guys?
Thank u all who wanna help me!
Regards!
| php | arrays | display | null | null | null | open | how to display array items whthout knwoing its number?
===
how to display an array content without using a while loop? coz I don't know how items are within, and without using the function print_r() that displays items with a specific way: array([0]=>..)
I want to display items one by one, exemple: PHP - Ajax - JSON - DOM, u got it?
How to achieve that guys?
Thank u all who wanna help me!
Regards!
| 0 |
1,096,972 | 07/08/2009 09:04:22 | 91,607 | 04/16/2009 12:44:26 | 278 | 2 | best book to learn J2EE |
I have a friend who asked me about a good book to learn J2EE as a beginner.
and I thought I would ask other more knowledgeaable people. what book/resources do you recommend for learning J2EEe as a beginner ? | j2eee | java | null | null | null | 09/11/2011 17:21:13 | not constructive | best book to learn J2EE
===
I have a friend who asked me about a good book to learn J2EE as a beginner.
and I thought I would ask other more knowledgeaable people. what book/resources do you recommend for learning J2EEe as a beginner ? | 4 |
10,657,302 | 05/18/2012 17:40:39 | 153,863 | 08/10/2009 17:13:07 | 2,030 | 71 | Non-technical interview questions that make real geeks stand out | I'll be interviewing some candidates for a development position next week, and I've got the "technical test" pretty much covered (typical code writing, code reviewing, low and high level stuff, etc).
I'd like to throw a couple of non-technical questions in there to poke at the candidate's personality to see if he would be a good fit (we're all a bunch of geeks here). I'm looking for the kind of questions that don't necessarily have a right or wrong answer, but that the way the candidate answers would give me a hint of how he thinks. I'm not looking for trivia, I'm not looking for testing his technical skills, what I'm looking for is "Is this a true geek?".
What I've got so far is :
- Name two books on programming, computer science or general geek culture that you enjoyed
- Vi or Emacs?
- Which blogs or news aggregator sites do you read on a regular basis?
- What is the mythical man-month?
What questions should I add (or remove) from the list? | interview-questions | non-technical | null | null | null | 05/20/2012 15:49:48 | off topic | Non-technical interview questions that make real geeks stand out
===
I'll be interviewing some candidates for a development position next week, and I've got the "technical test" pretty much covered (typical code writing, code reviewing, low and high level stuff, etc).
I'd like to throw a couple of non-technical questions in there to poke at the candidate's personality to see if he would be a good fit (we're all a bunch of geeks here). I'm looking for the kind of questions that don't necessarily have a right or wrong answer, but that the way the candidate answers would give me a hint of how he thinks. I'm not looking for trivia, I'm not looking for testing his technical skills, what I'm looking for is "Is this a true geek?".
What I've got so far is :
- Name two books on programming, computer science or general geek culture that you enjoyed
- Vi or Emacs?
- Which blogs or news aggregator sites do you read on a regular basis?
- What is the mythical man-month?
What questions should I add (or remove) from the list? | 2 |
6,856,582 | 07/28/2011 09:11:36 | 350,789 | 05/26/2010 10:18:46 | 193 | 7 | How to build an Active Recond query for the show action in the controller of the nested resource? | I have two models: Books and Chapters, where book has many chapters.
I've set up the route like:
match 'book/:book_title/:chapter/:chapter_title' => 'chapter#show', :as => "chapter"
and the delegation to the Chapters controller, action show works fine.
The problem for me now is to retrieve that chapter in the show controller through the book.
How this is done in case the identifiers for the query are not the primary keys?
Thanks! | ruby-on-rails | ruby-on-rails-3 | activerecord | nested-resources | null | null | open | How to build an Active Recond query for the show action in the controller of the nested resource?
===
I have two models: Books and Chapters, where book has many chapters.
I've set up the route like:
match 'book/:book_title/:chapter/:chapter_title' => 'chapter#show', :as => "chapter"
and the delegation to the Chapters controller, action show works fine.
The problem for me now is to retrieve that chapter in the show controller through the book.
How this is done in case the identifiers for the query are not the primary keys?
Thanks! | 0 |
11,105,070 | 06/19/2012 16:13:45 | 1,262,062 | 03/11/2012 09:25:22 | 73 | 0 | Pointer expressions in C | What is the difference between the following pointer expressions
*ptr++
----------
++*ptr
----------
(*ptr)++ | c | null | null | null | null | 06/20/2012 02:55:47 | not constructive | Pointer expressions in C
===
What is the difference between the following pointer expressions
*ptr++
----------
++*ptr
----------
(*ptr)++ | 4 |
10,074,270 | 04/09/2012 13:55:51 | 1,183,263 | 02/01/2012 16:58:55 | 52 | 0 | How can I find the minimum number of lines needed to cover all the zeros in a 2 dimenstional array? | I'm trying to make a decent implementation of the hungarian algorithm however I'm stuck at how to find the minimum number of lines that cover all the zeros in an array
also I need to know these lines to make some computations later
here is the explanation:
http://www.ams.jhu.edu/~castello/362/Handouts/hungarian.pdf
in step 3 it says
Use as few lines as possible to cover all the zeros in the matrix. There is no easy rule to do this - basically trial and error.
what does trial and error mean in terms of computation? If I have for example an 2d array of 5 rows and 5 columns then
The first row can cover all the zeros, the first and second, the first row and first column, etc etc too many combinations
isn't there something more efficient than this?
thanks in advance | algorithm | null | null | null | null | null | open | How can I find the minimum number of lines needed to cover all the zeros in a 2 dimenstional array?
===
I'm trying to make a decent implementation of the hungarian algorithm however I'm stuck at how to find the minimum number of lines that cover all the zeros in an array
also I need to know these lines to make some computations later
here is the explanation:
http://www.ams.jhu.edu/~castello/362/Handouts/hungarian.pdf
in step 3 it says
Use as few lines as possible to cover all the zeros in the matrix. There is no easy rule to do this - basically trial and error.
what does trial and error mean in terms of computation? If I have for example an 2d array of 5 rows and 5 columns then
The first row can cover all the zeros, the first and second, the first row and first column, etc etc too many combinations
isn't there something more efficient than this?
thanks in advance | 0 |
158,512 | 10/01/2008 16:30:58 | 23,794 | 09/30/2008 14:25:57 | 79 | 6 | What books/websites would you recommend to get startet with game development? | What books would you recommend to dive into the world of game-development?<br>
at best no programming-language specific stuff...more about the basics(KI, Basic Code Design).
Thanks for your answers! | books | null | null | null | null | 09/30/2011 00:50:55 | not constructive | What books/websites would you recommend to get startet with game development?
===
What books would you recommend to dive into the world of game-development?<br>
at best no programming-language specific stuff...more about the basics(KI, Basic Code Design).
Thanks for your answers! | 4 |
8,382,907 | 12/05/2011 08:59:11 | 742,102 | 05/06/2011 16:04:04 | 15 | 6 | customvalidator always isvalid=true | I have a custom validator for checking if date enetred is valid. but it is always true that makes it not firing. I used to have a comaprevalidator and daterange but it won't work coz as page refreshes, it validates the date of birth and says invalid when it is. So I changed it to customvalidator hoping I will find luck.
<asp:CustomValidator ID="CustomValidator1" runat="server" ErrorMessage="Please enter MM/DD/YYYY format. Invalid Date 01/01/1901 to 12/31/9999"
ControlToValidate="txtAccusedDOB" SetFocusOnError="True" ClientValidationFunction="ServerValidation1" Display="Static">
<asp:Image ID="Image125" runat="server" ImageUrl="~/images/validatearrow.png" />
</asp:CustomValidator>
<ajaxToolkit:ValidatorCalloutExtender
runat="Server" ID="ValidatorCalloutExtender5" TargetControlID="CustomValidator1" Width="250px" HighlightCssClass="highlight"
CssClass="CustomCalloutStyle" PopupPosition="Right" WarningIconImageUrl="~/images/001_11.png"
CloseImageUrl="~/images/001_05.png" />
<asp:TextBox ID="txtAccusedDOB" runat="server" Style="text-transform: uppercase" onkeydown="TrapEnterKey()"
Width="70px" TabIndex="85">
</asp:TextBox>
here's the java script. it always shows the alert("test" + arguments.Value.toString()); The try catch is not working.
function ServerValidation1(source, arguments)
{
try{
var x= new Date();
x = Date.parse(arguments.Value.toString())
arguments.IsValid = true;
alert("test" + arguments.Value.toString());
}
catch(Error r)
{
arguments.IsValid = false;
alert("test OUt" + r.toString());
}
is there a simpler way to check if date entered is valid. I have been struggling on this for days already. thanks. | datetime | daterange | custom-validators | null | null | null | open | customvalidator always isvalid=true
===
I have a custom validator for checking if date enetred is valid. but it is always true that makes it not firing. I used to have a comaprevalidator and daterange but it won't work coz as page refreshes, it validates the date of birth and says invalid when it is. So I changed it to customvalidator hoping I will find luck.
<asp:CustomValidator ID="CustomValidator1" runat="server" ErrorMessage="Please enter MM/DD/YYYY format. Invalid Date 01/01/1901 to 12/31/9999"
ControlToValidate="txtAccusedDOB" SetFocusOnError="True" ClientValidationFunction="ServerValidation1" Display="Static">
<asp:Image ID="Image125" runat="server" ImageUrl="~/images/validatearrow.png" />
</asp:CustomValidator>
<ajaxToolkit:ValidatorCalloutExtender
runat="Server" ID="ValidatorCalloutExtender5" TargetControlID="CustomValidator1" Width="250px" HighlightCssClass="highlight"
CssClass="CustomCalloutStyle" PopupPosition="Right" WarningIconImageUrl="~/images/001_11.png"
CloseImageUrl="~/images/001_05.png" />
<asp:TextBox ID="txtAccusedDOB" runat="server" Style="text-transform: uppercase" onkeydown="TrapEnterKey()"
Width="70px" TabIndex="85">
</asp:TextBox>
here's the java script. it always shows the alert("test" + arguments.Value.toString()); The try catch is not working.
function ServerValidation1(source, arguments)
{
try{
var x= new Date();
x = Date.parse(arguments.Value.toString())
arguments.IsValid = true;
alert("test" + arguments.Value.toString());
}
catch(Error r)
{
arguments.IsValid = false;
alert("test OUt" + r.toString());
}
is there a simpler way to check if date entered is valid. I have been struggling on this for days already. thanks. | 0 |
11,177,447 | 06/24/2012 12:32:45 | 550,015 | 12/21/2010 14:07:48 | 1 | 0 | Error Can't get a folder under box.net using sharpbox | i created some code to get a folder from box.NET using the method GetFolder( ) of the CloudStorage object. but when i ran it gave a NullReferenceExeption and i dont know what is the problem. the code work fine for Dropbox. by the way there is no problem with Box.NET credential since i managed to successfully open the connection to Box.NET.
Any help will be appreciated
| c# | cloud | dropbox | null | null | null | open | Error Can't get a folder under box.net using sharpbox
===
i created some code to get a folder from box.NET using the method GetFolder( ) of the CloudStorage object. but when i ran it gave a NullReferenceExeption and i dont know what is the problem. the code work fine for Dropbox. by the way there is no problem with Box.NET credential since i managed to successfully open the connection to Box.NET.
Any help will be appreciated
| 0 |
4,298,593 | 11/28/2010 19:29:28 | 523,149 | 11/28/2010 19:29:28 | 1 | 0 | Video Streaming Server | Hello I'm looking for a open source (or at least free and ad-free) video streaming server/client. Can anybody recommend me one? | video | audio | streaming | live | capture | 06/10/2011 04:30:30 | off topic | Video Streaming Server
===
Hello I'm looking for a open source (or at least free and ad-free) video streaming server/client. Can anybody recommend me one? | 2 |
11,718,170 | 07/30/2012 08:54:34 | 1,488,814 | 06/28/2012 14:09:31 | 73 | 1 | handling telephone calls in c sharp | I'm developing a desktop application that needs to handle telephone calls. how can I achieve this in c sharp programming? are there any libraries for this. please help me with concept to achieve this.
thank you in advance. | c# | visual-studio-2010 | telephony | null | null | 07/30/2012 19:23:44 | not a real question | handling telephone calls in c sharp
===
I'm developing a desktop application that needs to handle telephone calls. how can I achieve this in c sharp programming? are there any libraries for this. please help me with concept to achieve this.
thank you in advance. | 1 |
7,484,738 | 09/20/2011 11:57:37 | 464,685 | 10/02/2010 16:00:54 | 261 | 7 | UIPageControl makes me crazy. How can I center it after device rotation? | I'm trying centralize an UIPageControl in portrait and landscape modes, but it isn't working, the x changes after device rotation.
@interface DetailViewController : UIViewController<UIScrollViewDelegate>
{
UIPageControl *pageControl;
}
- (void)viewDidLoad
{
pageControl = [[UIPageControl alloc] init] ;
[self renderMyView];
[self.view addSubview:pageControl];
}
- (void)renderMyView
{
if(isPortrait)
{
pageControl.frame = CGRectMake(200, 976, 0, 0);
} else {
pageControl.frame = CGRectMake(200, 720, 0, 0);
}
}
The renderMyView is executed on didLoad and didRotate.
At first time (viewDidLoad) it works well in portrait and landscape, but if I rotate the device the pagecontrol appears in a different x (!= 200).
I also tried pageControl.center but it didn't work.
How can I keep it centralized? | objective-c | iphone-sdk-4.0 | uipagecontrol | null | null | null | open | UIPageControl makes me crazy. How can I center it after device rotation?
===
I'm trying centralize an UIPageControl in portrait and landscape modes, but it isn't working, the x changes after device rotation.
@interface DetailViewController : UIViewController<UIScrollViewDelegate>
{
UIPageControl *pageControl;
}
- (void)viewDidLoad
{
pageControl = [[UIPageControl alloc] init] ;
[self renderMyView];
[self.view addSubview:pageControl];
}
- (void)renderMyView
{
if(isPortrait)
{
pageControl.frame = CGRectMake(200, 976, 0, 0);
} else {
pageControl.frame = CGRectMake(200, 720, 0, 0);
}
}
The renderMyView is executed on didLoad and didRotate.
At first time (viewDidLoad) it works well in portrait and landscape, but if I rotate the device the pagecontrol appears in a different x (!= 200).
I also tried pageControl.center but it didn't work.
How can I keep it centralized? | 0 |
7,143,292 | 08/22/2011 04:49:35 | 905,262 | 08/22/2011 04:49:35 | 1 | 0 | iPhone App Development Cost | I'm working on a project for a uni assignment where I have to do a cost analysis even though we're making the application for free. What is the typical cost of developing an iPhone application? Please include a source as this is an academic submission and I can't exactly include stackoverflow as a reference as much as I would like to. | iphone | application | analysis | cost | null | 08/22/2011 05:17:04 | off topic | iPhone App Development Cost
===
I'm working on a project for a uni assignment where I have to do a cost analysis even though we're making the application for free. What is the typical cost of developing an iPhone application? Please include a source as this is an academic submission and I can't exactly include stackoverflow as a reference as much as I would like to. | 2 |
9,161,921 | 02/06/2012 14:48:40 | 1,192,509 | 02/06/2012 14:31:58 | 1 | 0 | I want to create a chat of my own but | I've been trying to create a chat of my own but I dont want to use nobody else code. What should I use to send the text back and forth? I tried java socket, but is missing something. but should I go that route or is there something else out there? any help? by the way Im new at this site. great site! | android | null | null | null | null | 03/03/2012 03:40:08 | not a real question | I want to create a chat of my own but
===
I've been trying to create a chat of my own but I dont want to use nobody else code. What should I use to send the text back and forth? I tried java socket, but is missing something. but should I go that route or is there something else out there? any help? by the way Im new at this site. great site! | 1 |
5,616,885 | 04/11/2011 04:54:07 | 496,949 | 11/04/2010 08:45:00 | 3,480 | 2 | why there are many compile errors if using jre not coming from jdk | when I use jre not coming witht the JDK, Eclipse reports a lot of errors. Want to know why? | java | eclipse | null | null | null | 06/23/2011 16:37:23 | not a real question | why there are many compile errors if using jre not coming from jdk
===
when I use jre not coming witht the JDK, Eclipse reports a lot of errors. Want to know why? | 1 |
5,588,377 | 04/07/2011 22:23:14 | 600,560 | 02/02/2011 19:56:34 | 437 | 2 | How can I convert foreground color in a .png image file from blue to black? | I have a .png image file of a company logo with blue foreground on white. Can I convert it to black foreground on transparent background, using freeware tools?
| html | css | gimp | null | null | 04/08/2011 10:05:26 | off topic | How can I convert foreground color in a .png image file from blue to black?
===
I have a .png image file of a company logo with blue foreground on white. Can I convert it to black foreground on transparent background, using freeware tools?
| 2 |
8,232,549 | 11/22/2011 19:24:06 | 911,930 | 08/25/2011 11:20:53 | 120 | 0 | Need pagination solution for the following following issue | Right now I use a pagination system that requires url like
http://mypage.com/index.php?page=1 <br />
http://mypage.com/index.php?page=2 <br />
http://mypage.com/index.php?page=3 <br />
http://mypage.com/index.php?page=4 <br />
etc...
So it uses $_GET method to find out what page the user is on.
I decided to switch most of my website to ajax and came over a problem. When I use Ajax to load new content on a page the url stays the same all the time e.g. http://mypage.com/index.php . Therefore pagination system I use is useless.
I was not able to find efficient AJAX pagination systems, (e.g some where lagy, most required user to scrol to the tiop each time he / she clicked on a next page, because they stayed at the bottom of the page when they clicked next page. etc...)
So I decided to ask you lot if anyone has an efficient pagination solution that works with ajax.
**Example of what needs to be paginated:**
$sql = mysql_query("SELECT * FROM myMembers WHERE username='$username' LIMIT 1") or die (mysql_error("There was an error in connection"));
//Gather profile information
while($row = mysql_fetch_assoc($sql)){
$username = $row["username"];
$id = $row["id"];
$data_display .= '<b>'.Name.'</b> has an id of <span style="color: f0f0f0;">'.$id.'</span>';
}
<!doctype>
<html>
<?php echo "$data_display"; ?> //and I need to paginate this entries
</html> | php | javascript | mysql | ajax | pagination | null | open | Need pagination solution for the following following issue
===
Right now I use a pagination system that requires url like
http://mypage.com/index.php?page=1 <br />
http://mypage.com/index.php?page=2 <br />
http://mypage.com/index.php?page=3 <br />
http://mypage.com/index.php?page=4 <br />
etc...
So it uses $_GET method to find out what page the user is on.
I decided to switch most of my website to ajax and came over a problem. When I use Ajax to load new content on a page the url stays the same all the time e.g. http://mypage.com/index.php . Therefore pagination system I use is useless.
I was not able to find efficient AJAX pagination systems, (e.g some where lagy, most required user to scrol to the tiop each time he / she clicked on a next page, because they stayed at the bottom of the page when they clicked next page. etc...)
So I decided to ask you lot if anyone has an efficient pagination solution that works with ajax.
**Example of what needs to be paginated:**
$sql = mysql_query("SELECT * FROM myMembers WHERE username='$username' LIMIT 1") or die (mysql_error("There was an error in connection"));
//Gather profile information
while($row = mysql_fetch_assoc($sql)){
$username = $row["username"];
$id = $row["id"];
$data_display .= '<b>'.Name.'</b> has an id of <span style="color: f0f0f0;">'.$id.'</span>';
}
<!doctype>
<html>
<?php echo "$data_display"; ?> //and I need to paginate this entries
</html> | 0 |
10,644,220 | 05/17/2012 22:13:07 | 1,399,394 | 05/16/2012 18:44:37 | 1 | 0 | create and initialize python list | I am stuck on making list using python.
I want to make m x n files such as file00.txt, file01.txt, ..., and file99.txt, but when I tried to make it, it shows some errors. Please let me help out.
filename = []
for i in range(0, sm):
filename.append('')
for j in range(0, sn):
filename[i].append('')
Thanks. | python | list | file-io | null | null | 05/18/2012 17:52:30 | not a real question | create and initialize python list
===
I am stuck on making list using python.
I want to make m x n files such as file00.txt, file01.txt, ..., and file99.txt, but when I tried to make it, it shows some errors. Please let me help out.
filename = []
for i in range(0, sm):
filename.append('')
for j in range(0, sn):
filename[i].append('')
Thanks. | 1 |
7,238,002 | 08/30/2011 02:11:43 | 789,476 | 06/08/2011 15:37:35 | 383 | 26 | Google Apps email hosting for a GoDaddy-hosted site works locally but not on live site | GoDaddy email issues are plentiful, but I have not been able to find anyone resolve this same problem:
I have a GoDaddy hosted site, and a Google Apps account. The MX info on GoDaddy is correct, as is my server-side code, and the Google Apps credentials in my web.config file (host:smtp.gmail.com, port:587) are correct. I know this because I am able to send emails through SmtpClient hosted my local machine's server when debugging the site. However, once transferred to the GoDaddy hosting account, all emails will not send -- they just time out. Nothing has changed aside from the site being run on the GoDaddy server as opposed to a local server.
A two part question:
1) Does anybody have any ideas about how to tackle this?
2) If not, is there another web hosting or email hosting site, or a combination of 2, that people can confirm is fast, actually works, and is not impossible to coordinate as is everything with GoDaddy? (I am aware that GoDaddy has their own relaying email server, but I initially used it before switching to Google and found emails coming in 30-60 minutes late).
Thanks very much! | google | smtp | hosting | gmail | godaddy | 08/30/2011 03:14:15 | off topic | Google Apps email hosting for a GoDaddy-hosted site works locally but not on live site
===
GoDaddy email issues are plentiful, but I have not been able to find anyone resolve this same problem:
I have a GoDaddy hosted site, and a Google Apps account. The MX info on GoDaddy is correct, as is my server-side code, and the Google Apps credentials in my web.config file (host:smtp.gmail.com, port:587) are correct. I know this because I am able to send emails through SmtpClient hosted my local machine's server when debugging the site. However, once transferred to the GoDaddy hosting account, all emails will not send -- they just time out. Nothing has changed aside from the site being run on the GoDaddy server as opposed to a local server.
A two part question:
1) Does anybody have any ideas about how to tackle this?
2) If not, is there another web hosting or email hosting site, or a combination of 2, that people can confirm is fast, actually works, and is not impossible to coordinate as is everything with GoDaddy? (I am aware that GoDaddy has their own relaying email server, but I initially used it before switching to Google and found emails coming in 30-60 minutes late).
Thanks very much! | 2 |
1,909,059 | 12/15/2009 17:30:55 | 231,651 | 12/14/2009 21:44:46 | 1 | 1 | Building app to Classify / Describe Products - Overwhelmed somewhere between planning & execution | Greetings!
I recently started working for a company that carries a line of 20,000 Surgical Instruments. Our data on all items is currently spotty and chaotic at best. I intend to fix this.
I have been tasked with redesigning the web site. As part of the project, I'm building an app to classify and describe all products. We don't do any direct sales on the site, but have a network of sales reps and distributors that will utilize this info.
A picture says a thousand words, so here's a link to a diagram I made showing what I'm trying to accomplish: <http://i.imgur.com/gUuxB.png>
I'm currently trying to achieve this with CakePHP / MySQL. I'm not too heavily invested in these, and am open to suggestions for alternatives. Perhaps a CMS already has this functionality? Some sort of Open-Source gizmo? Python / Django?
I'm having difficulties determining proper database structure and code logistics. I'm headed in to this project a novice, hoping to emerge as an intermediate.
Any advice on how to tackle this enormous task would be helpful. I've spent almost 4 weeks in the planning phase, and can no longer see the forest for the trees. My head's about to explode.
Thanks! | cakephp | mysql | architecture | database-design | python | null | open | Building app to Classify / Describe Products - Overwhelmed somewhere between planning & execution
===
Greetings!
I recently started working for a company that carries a line of 20,000 Surgical Instruments. Our data on all items is currently spotty and chaotic at best. I intend to fix this.
I have been tasked with redesigning the web site. As part of the project, I'm building an app to classify and describe all products. We don't do any direct sales on the site, but have a network of sales reps and distributors that will utilize this info.
A picture says a thousand words, so here's a link to a diagram I made showing what I'm trying to accomplish: <http://i.imgur.com/gUuxB.png>
I'm currently trying to achieve this with CakePHP / MySQL. I'm not too heavily invested in these, and am open to suggestions for alternatives. Perhaps a CMS already has this functionality? Some sort of Open-Source gizmo? Python / Django?
I'm having difficulties determining proper database structure and code logistics. I'm headed in to this project a novice, hoping to emerge as an intermediate.
Any advice on how to tackle this enormous task would be helpful. I've spent almost 4 weeks in the planning phase, and can no longer see the forest for the trees. My head's about to explode.
Thanks! | 0 |
3,240,816 | 07/13/2010 19:41:05 | 265,650 | 02/03/2010 21:05:20 | 177 | 13 | What does Google get by offering free email service ? | Google provides many services - Google Adwords, Google Adsense, Google Search APIs which are directly or indirectly generating lot of revenue for Google.
But what does Google gain by providing free email service with 10's of Gigabytes of space at free of cost? And I bet the number of registered users are in millions...and obviously there are several data centers established across the world to support the same!
I don't get the magic! | email | google | null | null | null | 07/13/2010 19:43:47 | off topic | What does Google get by offering free email service ?
===
Google provides many services - Google Adwords, Google Adsense, Google Search APIs which are directly or indirectly generating lot of revenue for Google.
But what does Google gain by providing free email service with 10's of Gigabytes of space at free of cost? And I bet the number of registered users are in millions...and obviously there are several data centers established across the world to support the same!
I don't get the magic! | 2 |
10,447,721 | 05/04/2012 11:14:12 | 1,196,969 | 02/08/2012 10:52:49 | 54 | 1 | Communication between native app & web app | I want to make the communication between native app and web app in android.How to do it can anyone help me please. | android | web-applications | null | null | null | 05/04/2012 11:18:43 | not a real question | Communication between native app & web app
===
I want to make the communication between native app and web app in android.How to do it can anyone help me please. | 1 |
9,071,156 | 01/30/2012 21:39:44 | 931,726 | 07/21/2011 00:18:51 | 43 | 10 | XCode : /Developer/usr/bin/clang failed with exit code 1 | I just updated my xcode to 4.2 and before my project worked fine. I had to upgrade xcode to be able to install QT creator etc. Now I can no longer run my project. First I could no longer find the header <gmp.h> which I really need. When I then removed all the code connected to that I got the following error.
Ld /Users/Jen/Library/Developer/Xcode/DerivedData/SeedVault-dxmmjmxopqwbwmbgumpolenvfppl/Build/Products/Debug-iphonesimulator/SeedVault.app/SeedVault normal i386
cd /Users/Jen/Documents/Programming/SeedVault
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -L/Users/Jen/Library/Developer/Xcode/DerivedData/SeedVault-dxmmjmxopqwbwmbgumpolenvfppl/Build/Products/Debug-iphonesimulator -L/Developer/usr/local/lib -F/Users/Jen/Library/Developer/Xcode/DerivedData/SeedVault-dxmmjmxopqwbwmbgumpolenvfppl/Build/Products/Debug-iphonesimulator -filelist /Users/Jen/Library/Developer/Xcode/DerivedData/SeedVault-dxmmjmxopqwbwmbgumpolenvfppl/Build/Intermediates/SeedVault.build/Debug-iphonesimulator/SeedVault.build/Objects-normal/i386/SeedVault.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 - -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -framework Foundation -framework UIKit -framework CoreGraphics -o /Users/Jen/Library/Developer/Xcode/DerivedData/SeedVault-dxmmjmxopqwbwmbgumpolenvfppl/Build/Products/Debug-iphonesimulator/SeedVault.app/SeedVault
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang failed with exit code 1
If anyone would be able to help I would much appreciate it. I really need to get this project to work so I can finish my thesis...
Thanks! | objective-c | xcode | linker | clang | gmp | 01/31/2012 20:26:41 | too localized | XCode : /Developer/usr/bin/clang failed with exit code 1
===
I just updated my xcode to 4.2 and before my project worked fine. I had to upgrade xcode to be able to install QT creator etc. Now I can no longer run my project. First I could no longer find the header <gmp.h> which I really need. When I then removed all the code connected to that I got the following error.
Ld /Users/Jen/Library/Developer/Xcode/DerivedData/SeedVault-dxmmjmxopqwbwmbgumpolenvfppl/Build/Products/Debug-iphonesimulator/SeedVault.app/SeedVault normal i386
cd /Users/Jen/Documents/Programming/SeedVault
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -L/Users/Jen/Library/Developer/Xcode/DerivedData/SeedVault-dxmmjmxopqwbwmbgumpolenvfppl/Build/Products/Debug-iphonesimulator -L/Developer/usr/local/lib -F/Users/Jen/Library/Developer/Xcode/DerivedData/SeedVault-dxmmjmxopqwbwmbgumpolenvfppl/Build/Products/Debug-iphonesimulator -filelist /Users/Jen/Library/Developer/Xcode/DerivedData/SeedVault-dxmmjmxopqwbwmbgumpolenvfppl/Build/Intermediates/SeedVault.build/Debug-iphonesimulator/SeedVault.build/Objects-normal/i386/SeedVault.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 - -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -framework Foundation -framework UIKit -framework CoreGraphics -o /Users/Jen/Library/Developer/Xcode/DerivedData/SeedVault-dxmmjmxopqwbwmbgumpolenvfppl/Build/Products/Debug-iphonesimulator/SeedVault.app/SeedVault
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang failed with exit code 1
If anyone would be able to help I would much appreciate it. I really need to get this project to work so I can finish my thesis...
Thanks! | 3 |
2,965,575 | 06/03/2010 11:44:05 | 341,868 | 05/15/2010 10:34:31 | 16 | 1 | how to remove stop words in english using java program | How to remove stop words in english using java program. Please help me with simplest program or suggest me some ideas. Thanks in advance | java | null | null | null | null | null | open | how to remove stop words in english using java program
===
How to remove stop words in english using java program. Please help me with simplest program or suggest me some ideas. Thanks in advance | 0 |
9,509,869 | 03/01/2012 02:40:29 | 277,940 | 02/21/2010 03:38:03 | 131 | 26 | TrayMenu cannot hide after clicking other place | I have implemented tray icon menu for QT application. But the tray icon menu would not hide after clicking other places. Following is my code:
m_trayIconMenu = new QMenu(this);
m_trayIconMenu->addAction(m_restoreAction);
m_trayIconMenu->addAction(m_quitAction);
m_trayIcon = new QSystemTrayIcon(this);
m_trayIcon->setContextMenu(m_trayIconMenu); | qt | null | null | null | null | null | open | TrayMenu cannot hide after clicking other place
===
I have implemented tray icon menu for QT application. But the tray icon menu would not hide after clicking other places. Following is my code:
m_trayIconMenu = new QMenu(this);
m_trayIconMenu->addAction(m_restoreAction);
m_trayIconMenu->addAction(m_quitAction);
m_trayIcon = new QSystemTrayIcon(this);
m_trayIcon->setContextMenu(m_trayIconMenu); | 0 |
4,614,524 | 01/06/2011 11:44:02 | 565,375 | 01/06/2011 11:44:03 | 1 | 0 | Is it possible to omit escaping some html in <c:out value="${str}"> ? | I want make secure display (escaping html characters with c:out) but allow some links (`<img>` `<a href>` and youtube embedded). How can I do this? Is it possible achieve this with c:out? | java | jsp | jstl | null | null | null | open | Is it possible to omit escaping some html in <c:out value="${str}"> ?
===
I want make secure display (escaping html characters with c:out) but allow some links (`<img>` `<a href>` and youtube embedded). How can I do this? Is it possible achieve this with c:out? | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.